GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | Protected Member Functions | List of all members
NodeWidget Class Reference
Inheritance diagram for NodeWidget:
Inheritance graph
[legend]
Collaboration diagram for NodeWidget:
Collaboration graph
[legend]

Public Member Functions

 NodeWidget (const QString &node_text, QGraphicsItem *parent=0)
 
 ~NodeWidget ()
 
void set_marked (bool marked)
 
bool is_marked ()
 
void set_color (QColor)
 
void set_opacity (int)
 
QColor color ()
 
int opacity ()
 
QPainterPath shape () const
 The outline of the node. More...
 
QRectF boundingRect () const
 Required methods for drawing. More...
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 Paints the node. More...
 
void add_edge (EdgeWidget *w)
 Keep a list of edges in order to notify the edges when this item changes. More...
 
QString node_text ()
 Accessor functions. More...
 
qreal height ()
 
qreal width ()
 
void unmark_path ()
 
void mark_path ()
 
QModelIndex get_index_in_model ()
 
void set_index_in_model (QModelIndex)
 

Protected Member Functions

QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 Event handler for changes to the item. More...
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
 Event handler for double clicks. More...
 
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 Event handler for mouse clicks. More...
 

Constructor & Destructor Documentation

NodeWidget::NodeWidget ( const QString &  node_text,
QGraphicsItem *  parent = 0 
)

The constructor for the NodeWidget class.

Parameters
QStringtext that is displayed for node.

Geometry changes are sent to the edges so that they can be redrawn when node size is altered

NodeWidget::~NodeWidget ( )
inline

Destructor.

Member Function Documentation

void NodeWidget::add_edge ( EdgeWidget w)

Keep a list of edges in order to notify the edges when this item changes.

Add an edge to another node widget.

Parameters
Theedge widget to make the new node connection with.
QRectF NodeWidget::boundingRect ( ) const

Required methods for drawing.

Provides the bounding rectangle of the node.

Returns
The bounding rectangle of the node.

Bounding rect provides the outlines - need to take into account the pen_width The size here is in relation to item space

QColor NodeWidget::color ( )

Returns the color of the node.

Returns
The color of the node.
qreal NodeWidget::height ( )

Returns the height of the node.

Returns
The height of the node.
bool NodeWidget::is_marked ( )

Returns true if node is marked.

Returns
True if node is marked.
QVariant NodeWidget::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
protected

Event handler for changes to the item.

This is an event handler to deal with the instance if an event has changed.

void NodeWidget::mark_path ( )

Mark connecting nodes and edges.

void NodeWidget::mouseDoubleClickEvent ( QGraphicsSceneMouseEvent *  event)
protected

Event handler for double clicks.

Call the native event handler

void NodeWidget::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protected

Event handler for mouse clicks.

Call the native event handler

QString NodeWidget::node_text ( )

Accessor functions.

Returns the text of the node.

Returns
the text of the node.
int NodeWidget::opacity ( )

Returns the opacity of the node.

Returns
The opacity of the node.
void NodeWidget::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)

Paints the node.

Overrides the parent method for drawing the node.

Set the color

Draw the ellipse

void NodeWidget::set_color ( QColor  color)

Set the color of the node.

Parameters
Colorwhich should be applied.
void NodeWidget::set_marked ( bool  marked)

Set node as marked Node is marked if true, otherwise node is unmarked.

Parameters
boolSet as marked if true, unmarked if false.
void NodeWidget::set_opacity ( int  opacity)

Set the opacity of the node.

Parameters
Opacitythat the node should have.
QPainterPath NodeWidget::shape ( ) const

The outline of the node.

Provides the shape of the node.

Returns
The current shape of the node.
void NodeWidget::unmark_path ( )

Unmark connecting nodes and edges.

qreal NodeWidget::width ( )

Returns the width of the node.

Returns
The width of the node.

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