COPASI API  4.16.103
Public Member Functions | Private Attributes | List of all members
CQRDFTreeViewItem Class Reference

#include <CQRDFTreeViewItem.h>

Inheritance diagram for CQRDFTreeViewItem:
Inheritance graph
[legend]
Collaboration diagram for CQRDFTreeViewItem:
Collaboration graph
[legend]

Public Member Functions

 CQRDFTreeViewItem (QTreeWidget *pParent, CQRDFTreeViewItem *pAfter=NULL)
 
 CQRDFTreeViewItem (CQRDFTreeViewItem *pParent, CQRDFTreeViewItem *pAfter=NULL)
 
void setTriplet (const CRDFTriplet &triplet)
 
virtual ~CQRDFTreeViewItem ()
 

Private Attributes

CRDFTriplet mTriplet
 

Detailed Description

Definition at line 22 of file CQRDFTreeViewItem.h.

Constructor & Destructor Documentation

CQRDFTreeViewItem::CQRDFTreeViewItem ( QTreeWidget *  pParent,
CQRDFTreeViewItem pAfter = NULL 
)

Default Constructor

Parameters
QTreeWidget* pParent
CQRDFTreeViewItem* pAfter (default: NULL)

Definition at line 26 of file CQRDFTreeViewItem.cpp.

26  :
27  QTreeWidgetItem(pParent, pAfter),
28  mTriplet()
29 {
30  assert(pParent != NULL);
31  setExpanded(true);
32 }
CQRDFTreeViewItem::CQRDFTreeViewItem ( CQRDFTreeViewItem pParent,
CQRDFTreeViewItem pAfter = NULL 
)

Specific Constructor

Parameters
CQRDFTreeViewItem* pParent
CQRDFTreeViewItem* pAfter (default: NULL)

Definition at line 34 of file CQRDFTreeViewItem.cpp.

34  :
35  QTreeWidgetItem(pParent, pAfter),
36  mTriplet()
37 {
38  assert(pParent != NULL);
39  setExpanded(true);
40 }
CQRDFTreeViewItem::~CQRDFTreeViewItem ( )
virtual

Destructor

Definition at line 42 of file CQRDFTreeViewItem.cpp.

43 {}

Member Function Documentation

void CQRDFTreeViewItem::setTriplet ( const CRDFTriplet triplet)

Set the RDF triplet represented by this item

Parameters
constCRDFTriplet & triplet

Definition at line 45 of file CQRDFTreeViewItem.cpp.

References CRDFObject::BLANK_NODE, COL_OBJECT, COL_PREDICATE, COL_SUBJECT, FROM_UTF8, CRDFObject::getBlankNodeID(), CRDFLiteral::getLexicalData(), CRDFObject::getLiteral(), CRDFNode::getObject(), CRDFObject::getResource(), CRDFLiteral::getType(), CRDFObject::getType(), CRDFPredicate::getURI(), CRDFObject::LITERAL, mTriplet, CRDFLiteral::PLAIN, CRDFTriplet::pObject, CRDFTriplet::Predicate, CRDFObject::RESOURCE, and CRDFLiteral::TYPED.

Referenced by CQRDFTreeView::enterProtected().

46 {
47  mTriplet = triplet;
48 
49  // Set the predicate
51 
52  const CRDFObject & Object = mTriplet.pObject->getObject();
53 
54  switch (Object.getType())
55  {
57  {
58  const CRDFLiteral & Literal = Object.getLiteral();
59 
60  switch (Literal.getType())
61  {
62  case CRDFLiteral::PLAIN:
63  case CRDFLiteral::TYPED:
64  setText(COL_OBJECT, FROM_UTF8(Literal.getLexicalData()));
65  break;
66  }
67  }
68  break;
69 
71  setText(COL_OBJECT, FROM_UTF8(Object.getResource()));
72  break;
73 
75 
76  if (mTriplet. Predicate.getURI() != "http://www.w3.org/1999/02/22-rdf-syntax-ns#subject")
77  setText(COL_SUBJECT, FROM_UTF8(Object.getBlankNodeID()));
78  else
79  setText(COL_OBJECT, FROM_UTF8(Object.getBlankNodeID()));
80 
81  break;
82  }
83 }
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
#define COL_OBJECT
const eObjectType & getType() const
Definition: CRDFObject.cpp:85
const std::string & getBlankNodeID() const
Definition: CRDFObject.cpp:103
#define COL_PREDICATE
#define COL_SUBJECT
CRDFObject & getObject()
Definition: CRDFNode.cpp:94
const eLiteralType & getType() const
Definition: CRDFLiteral.cpp:42
CRDFPredicate Predicate
Definition: CRDFTriplet.h:40
const std::string & getURI() const
const std::string & getLexicalData() const
Definition: CRDFLiteral.cpp:60
CRDFNode * pObject
Definition: CRDFTriplet.h:42
const std::string & getResource() const
Definition: CRDFObject.cpp:94
CRDFLiteral & getLiteral()
Definition: CRDFObject.cpp:112

Member Data Documentation

CRDFTriplet CQRDFTreeViewItem::mTriplet
private

The triplet represneted by this item.

Definition at line 56 of file CQRDFTreeViewItem.h.

Referenced by setTriplet().


The documentation for this class was generated from the following files: