DisplayNode Class Reference

Class for drawing a Node on a QGraphicsScene each node may have a caption and an SgNode associated to it. More...

#include <DisplayNode.h>

Inheritance diagram for DisplayNode:

Inheritance graph
[legend]
List of all members.

Public Types

 DisplayNodeType = UserType + 1
enum  { DisplayNodeType = UserType + 1 }
 Each user defined QGraphicsItem needs a unique constant. More...

Public Member Functions

 DisplayNode (QGraphicsScene *scene=NULL)
 The Node is deleted by the scene, if scene is not null.
 DisplayNode (const QString &caption, QGraphicsScene *scene=NULL)
virtual ~DisplayNode ()
virtual const QString & getDisplayName ()
 Display Name is the String which is printed in the node.
virtual void setDisplayName (const QString &n)
virtual void setBgColor (const QColor &c)
 Background color, when not selected.
virtual void setBgColorSelected (const QColor &c)
virtual QColor getBgColor () const
virtual QColor getBgColorSelected () const
virtual SgNode * getSgNode ()
 Returns the Sage Node which corresponds to this DisplayNode.
virtual void setSgNode (SgNode *sgNode)
virtual QRectF boundingRect () const
 Functions required by QGraphicsScene.
virtual QPainterPath shape () const
virtual int type () const
virtual void setScene (QGraphicsScene *scene)
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Custom Paint Event.
virtual bool isMouseHold () const

Protected Member Functions

virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
void init ()
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value)

Protected Attributes

QGraphicsScene * scene
QString caption
 Text which is rendered inside of node.
SgNode * sg
QFont textFont
 The font used for drawing the caption.
QColor bgColor
 Background color if node is not selected.
QColor bgColorSelected
 Background color when node is selected.
bool mouseHold
 True when a mouse button is pressed over this node.

Detailed Description

Class for drawing a Node on a QGraphicsScene each node may have a caption and an SgNode associated to it.

Definition at line 20 of file DisplayNode.h.


Member Enumeration Documentation

anonymous enum

Each user defined QGraphicsItem needs a unique constant.

Enumerator:
DisplayNodeType 

Definition at line 24 of file DisplayNode.h.


Constructor & Destructor Documentation

DisplayNode::DisplayNode ( QGraphicsScene *  scene = NULL  ) 

The Node is deleted by the scene, if scene is not null.

Definition at line 15 of file DisplayNode.cpp.

Here is the call graph for this function:

DisplayNode::DisplayNode ( const QString &  caption,
QGraphicsScene *  scene = NULL 
)

Definition at line 22 of file DisplayNode.cpp.

Here is the call graph for this function:

virtual DisplayNode::~DisplayNode (  )  [inline, virtual]

Definition at line 31 of file DisplayNode.h.


Member Function Documentation

QRectF DisplayNode::boundingRect (  )  const [virtual]

Functions required by QGraphicsScene.

Definition at line 61 of file DisplayNode.cpp.

Referenced by DisplayEdge::adjust(), TreeLayoutGenerator::ExtremeInfo::merge(), paint(), shape(), and DisplayGraph::springBasedLayoutIteration().

Here is the caller graph for this function:

virtual QColor DisplayNode::getBgColor (  )  const [inline, virtual]

Definition at line 42 of file DisplayNode.h.

virtual QColor DisplayNode::getBgColorSelected (  )  const [inline, virtual]

Definition at line 43 of file DisplayNode.h.

virtual const QString& DisplayNode::getDisplayName (  )  [inline, virtual]

Display Name is the String which is printed in the node.

Definition at line 34 of file DisplayNode.h.

virtual SgNode* DisplayNode::getSgNode (  )  [inline, virtual]

Returns the Sage Node which corresponds to this DisplayNode.

Definition at line 47 of file DisplayNode.h.

Referenced by DisplayCallGraph::deleteNode(), RoseGraphicsView::mouseMoveEvent(), and RoseGraphicsView::mousePressEvent().

Here is the caller graph for this function:

void DisplayNode::init (  )  [protected]

Definition at line 31 of file DisplayNode.cpp.

Referenced by DisplayNode().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool DisplayNode::isMouseHold (  )  const [inline, virtual]

Definition at line 67 of file DisplayNode.h.

QVariant DisplayNode::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
) [protected, virtual]

Needed to listen on selection-changes node is drawn differently when selected)

Reimplemented in DisplayGraphNode, and DisplayTreeNode.

Definition at line 116 of file DisplayNode.cpp.

Referenced by DisplayTreeNode::itemChange(), and DisplayGraphNode::itemChange().

Here is the caller graph for this function:

void DisplayNode::mousePressEvent ( QGraphicsSceneMouseEvent *  event  )  [protected, virtual]

Definition at line 125 of file DisplayNode.cpp.

void DisplayNode::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event  )  [protected, virtual]

Definition at line 131 of file DisplayNode.cpp.

void DisplayNode::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [virtual]

Custom Paint Event.

Definition at line 79 of file DisplayNode.cpp.

Here is the call graph for this function:

void DisplayNode::setBgColor ( const QColor &  c  )  [virtual]

Background color, when not selected.

Definition at line 48 of file DisplayNode.cpp.

Referenced by DisplayGraph::addGravityNode().

Here is the caller graph for this function:

void DisplayNode::setBgColorSelected ( const QColor &  c  )  [virtual]

Definition at line 54 of file DisplayNode.cpp.

virtual void DisplayNode::setDisplayName ( const QString &  n  )  [inline, virtual]

Definition at line 35 of file DisplayNode.h.

Referenced by DisplayTreeNode::addChild(), and DisplayTreeNode::mergeTrees().

Here is the caller graph for this function:

void DisplayNode::setScene ( QGraphicsScene *  scene  )  [virtual]

Displays this node on another scene, the scene of the edges is not changed! if scene is NULL the node is removed from current scene, and the ownership is passes to the caller

Reimplemented in DisplayGraphNode, and DisplayTreeNode.

Definition at line 100 of file DisplayNode.cpp.

Referenced by DisplayNode(), init(), DisplayTreeNode::setScene(), and DisplayGraphNode::setScene().

Here is the caller graph for this function:

virtual void DisplayNode::setSgNode ( SgNode *  sgNode  )  [inline, virtual]

Definition at line 48 of file DisplayNode.h.

Referenced by DisplayCallGraph::addCgNode(), and DisplayTreeNode::addChild().

Here is the caller graph for this function:

QPainterPath DisplayNode::shape (  )  const [virtual]

Definition at line 71 of file DisplayNode.cpp.

Here is the call graph for this function:

virtual int DisplayNode::type (  )  const [inline, virtual]

Definition at line 53 of file DisplayNode.h.


Member Data Documentation

QColor DisplayNode::bgColor [protected]

Background color if node is not selected.

Definition at line 96 of file DisplayNode.h.

Referenced by getBgColor(), init(), paint(), and setBgColor().

QColor DisplayNode::bgColorSelected [protected]

Background color when node is selected.

Definition at line 98 of file DisplayNode.h.

Referenced by getBgColorSelected(), init(), paint(), and setBgColorSelected().

QString DisplayNode::caption [protected]

Text which is rendered inside of node.

Definition at line 86 of file DisplayNode.h.

Referenced by boundingRect(), DisplayTreeGenerator::generateTree(), paint(), and DisplayTreeNode::simplifyTree().

bool DisplayNode::mouseHold [protected]

True when a mouse button is pressed over this node.

Definition at line 101 of file DisplayNode.h.

Referenced by init(), isMouseHold(), mousePressEvent(), and mouseReleaseEvent().

QGraphicsScene* DisplayNode::scene [protected]

GraphicsScene where this node is rendered, or NULL if in no scene the scene takes ownership of nodes

Definition at line 83 of file DisplayNode.h.

Referenced by DisplayTreeNode::addChild(), DisplayGraphNode::addEdge(), DisplayGraphNode::addInEdge(), DisplayGraphNode::addOutEdge(), init(), DisplayTreeNode::registerAdditionalEdge(), DisplayTreeNode::setScene(), setScene(), and DisplayGraphNode::setScene().

SgNode* DisplayNode::sg [protected]

SgNode associated with this DisplayNode not used internally

Definition at line 90 of file DisplayNode.h.

Referenced by DisplayTreeGenerator::generateTree(), getSgNode(), and setSgNode().

QFont DisplayNode::textFont [protected]

The font used for drawing the caption.

Definition at line 93 of file DisplayNode.h.

Referenced by boundingRect().


The documentation for this class was generated from the following files:
Generated on Tue Sep 15 14:48:49 2009 for RoseQtWidgets by  doxygen 1.4.7