libyui
Public Member Functions | Protected Member Functions

YGraph Class Reference

Inheritance diagram for YGraph:
YWidget

List of all members.

Public Member Functions

virtual ~YGraph ()
virtual const char * widgetClass () const
virtual bool setProperty (const string &propertyName, const YPropertyValue &val)
virtual YPropertyValue getProperty (const string &propertyName)
virtual const YPropertySetpropertySet ()
string filename () const
virtual void setFilename (const string &filename)
string layoutAlgorithm () const
virtual void setLayoutAlgorithm (const string &filename)
virtual void setGraph (graph_t *graph)
virtual string activatedNode () const

Protected Member Functions

 YGraph (YWidget *parent, const string &filename, const string &layoutAlgorithm)
 YGraph (YWidget *parent, graph_t *graph)
virtual void renderGraph (const string &filename, const string &layoutAlgorithm)=0
virtual void renderGraph (graph_t *graph)=0

Constructor & Destructor Documentation

YGraph::YGraph ( YWidget parent,
const string &  filename,
const string &  layoutAlgorithm 
) [protected]

Constructor.

Loads a graph in DOT format from filename and uses the layout algorithm layoutAlgorithm to layout and then render the graph. The layout algorithm can be any string accepted by the function gvLayout from graphviz, e.g. "dot" or "neato".

YGraph::YGraph ( YWidget parent,
graph_t *  graph 
) [protected]

Constructor.

Renders the graph. The graph must already contain layout information.

YGraph::~YGraph ( ) [virtual]

Destructor.


Member Function Documentation

string YGraph::activatedNode ( ) const [virtual]

Return name of activated node. Activation can happen due to e.g. single right mouse click (context menu) or double left mouse click.

string YGraph::filename ( ) const

Return the filename that describes the graph.

YPropertyValue YGraph::getProperty ( const string &  propertyName) [virtual]

Get a property. Reimplemented from YWidget.

This method may throw YUIPropertyExceptions.

Reimplemented from YWidget.

string YGraph::layoutAlgorithm ( ) const

Return the layout-algorithm used for the graph.

const YPropertySet & YGraph::propertySet ( ) [virtual]

Return this class's property set. This also initializes the property upon the first call.

Reimplemented from YWidget.

Reimplemented from YWidget.

virtual void YGraph::renderGraph ( const string &  filename,
const string &  layoutAlgorithm 
) [protected, pure virtual]

Render the graph from the filename. Derived classes are required to implement this.

virtual void YGraph::renderGraph ( graph_t *  graph) [protected, pure virtual]

Render the graph. Derived classes are required to implement this.

void YGraph::setFilename ( const string &  filename) [virtual]

Set the filename that describes the graph and render the graph. Derived classes can reimplent this, but they should call this base class method in the new implementation. Most derived classes only need to implement renderGraph().

void YGraph::setGraph ( graph_t *  graph) [virtual]

Render the graph. Derived classes can reimplent this, but they should call this base class method in the new implementation. Most derived classes only need to implement renderGraph().

void YGraph::setLayoutAlgorithm ( const string &  filename) [virtual]

Set the layout-algorithm used for the graph. Derived classes can reimplent this, but they should call this base class method in the new implementation.

bool YGraph::setProperty ( const string &  propertyName,
const YPropertyValue val 
) [virtual]

Set a property. Reimplemented from YWidget.

This function may throw YUIPropertyExceptions.

This function returns 'true' if the value was successfully set and 'false' if that value requires special handling (not in error cases: those are covered by exceptions).

Reimplemented from YWidget.

virtual const char* YGraph::widgetClass ( ) const [inline, virtual]

Returns a descriptive name of this widget class for logging, debugging etc.

Reimplemented from YWidget.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Friends