OpenAlea Grapheditor’s API¶
API¶
- class openalea.grapheditor.base.GraphAdapterBase(graph=None)[source]¶
Base class for adapter to graph
- add_edge(source, target, *args, **kwargs)[source]¶
Create an edge in the model between source and target.
Upon succes it must emit the following event tuple: (“edge_added”, (“edge_type”, edge, sourceObs, targetObs)).
- “edge-type” is a edge-type string defined in the strategy used for a particular graph type.
- edge, sourceObs and targetObs are the observable objects
representing an egde and its two anchors.
- add_vertex(vertex, *args, **kwargs)[source]¶
Add an existing vertex to the model.
Upon succes it must emit the following event tuple: (“vertex_added”, (“vertex_type”, vertex)).
- “vertex-type” is a vertex-type string defined in the strategy used for a particular graph type.
- “vertex” is the observable object representing a vertex.
- classmethod get_edge_types()[source]¶
Used by the GraphListenerBase class to check if the types declared here are really implemented in the strategy
- classmethod get_vertex_types()[source]¶
Used by the GraphListenerBase class to check if the types declared here are really implemented in the strategy
- new_vertex(vtype=None, position=None)[source]¶
Create a new vertex at the defined position and add it to the model
- remove_edge(source, target)[source]¶
Removes the specified vertex from the model.
Upon success it must emit the following event tuple: (“edge_removed”, (edge,)).
- edge is the observable object representing an edge.
- remove_vertex(vertex)[source]¶
Removes the specified vertex from the model.
Upon success it must emit the following event tuple: (“vertex_removed”, (vertex,)).
- vertex is the observable object representing a vertex.
- openalea.grapheditor.base.GraphStrategyMaker(graphView, vertexWidgetMap, edgeWidgetMap, connectorTypes=, []graphViewInitialiser=None, adapterType=None)[source]¶
Interfaces for the generic graph view module. The graph view widget won’t check for inheritance of the object’s it is passed. Instead, it will check the interfaces match more or less.
- class openalea.grapheditor.interfaces.IGraphViewConnectable[source]¶
Interface for connectable objects
- class openalea.grapheditor.interfaces.IGraphViewEdge[source]¶
Interface for edges between two vertexs.
- class openalea.grapheditor.interfaces.IGraphViewElement[source]¶
Base class for elements in a GraphView
- class openalea.grapheditor.interfaces.IGraphViewFloatingEdge(src)[source]¶
Interface for edges to be drawn during creation time, ie while the user drags.
Class diagrams¶
Graphical edges and vertices¶
digraph inheritanceeee735f5b6 { rankdir=LR; size="8.0, 12.0"; "QtGui.QAbstractGraphicsShapeItem" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="QAbstractGraphicsShapeItem(QGraphicsItem parent=None, QGraphicsScene scene=None)",height=0.25,shape=box,fontsize=10]; "QtGui.QGraphicsItem" -> "QtGui.QAbstractGraphicsShapeItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtGui.QGraphicsEllipseItem" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="QGraphicsEllipseItem(QGraphicsItem parent=None, QGraphicsScene scene=None)",height=0.25,shape=box,fontsize=10]; "QtGui.QAbstractGraphicsShapeItem" -> "QtGui.QGraphicsEllipseItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtGui.QGraphicsItem" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="QGraphicsItem(QGraphicsItem parent=None, QGraphicsScene scene=None)",height=0.25,shape=box,fontsize=10]; "sip.wrapper" -> "QtGui.QGraphicsItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtGui.QGraphicsPathItem" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="QGraphicsPathItem(QGraphicsItem parent=None, QGraphicsScene scene=None)",height=0.25,shape=box,fontsize=10]; "QtGui.QAbstractGraphicsShapeItem" -> "QtGui.QGraphicsPathItem" [arrowsize=0.5,style="setlinewidth(0.5)"]; "baselisteners.GraphElementListenerBase" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Base class for elements in a GraphView",height=0.25,shape=box,fontsize=10]; "observer.AbstractListener" -> "baselisteners.GraphElementListenerBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "observer.AbstractListener" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Listener base class",height=0.25,shape=box,fontsize=10]; "qtgraphview.DefaultGraphicalFloatingEdge" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",height=0.25]; "QtGui.QGraphicsPathItem" -> "qtgraphview.DefaultGraphicalFloatingEdge" [arrowsize=0.5,style="setlinewidth(0.5)"]; "qtgraphview.FloatingEdge" -> "qtgraphview.DefaultGraphicalFloatingEdge" [arrowsize=0.5,style="setlinewidth(0.5)"]; "qtgraphview.DefaultGraphicalVertex" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",height=0.25]; "qtgraphview.Vertex" -> "qtgraphview.DefaultGraphicalVertex" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtGui.QGraphicsEllipseItem" -> "qtgraphview.DefaultGraphicalVertex" [arrowsize=0.5,style="setlinewidth(0.5)"]; "qtgraphview.Edge" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Base class for Qt based edges.",height=0.25,shape=box,fontsize=10]; "qtgraphview.Element" -> "qtgraphview.Edge" [arrowsize=0.5,style="setlinewidth(0.5)"]; "qtgraphview.Element" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Base class for elements in a qtgraphview.View.",height=0.25,shape=box,fontsize=10]; "baselisteners.GraphElementListenerBase" -> "qtgraphview.Element" [arrowsize=0.5,style="setlinewidth(0.5)"]; "qtgraphview.FloatingEdge" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",height=0.25]; "qtgraphview.Edge" -> "qtgraphview.FloatingEdge" [arrowsize=0.5,style="setlinewidth(0.5)"]; "qtgraphview.Vertex" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="An abstract graphic item that represents a graph vertex.",height=0.25,shape=box,fontsize=10]; "qtgraphview.Element" -> "qtgraphview.Vertex" [arrowsize=0.5,style="setlinewidth(0.5)"]; "sip.simplewrapper" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",height=0.25]; "sip.wrapper" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",height=0.25]; "sip.simplewrapper" -> "sip.wrapper" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
Scene¶
digraph inheritance3ccf52aa1c { rankdir=LR; size="8.0, 12.0"; "QtCore.QObject" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="QObject(QObject parent=None)",height=0.25,shape=box,fontsize=10]; "sip.wrapper" -> "QtCore.QObject" [arrowsize=0.5,style="setlinewidth(0.5)"]; "QtGui.QGraphicsScene" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="QGraphicsScene(QObject parent=None)",height=0.25,shape=box,fontsize=10]; "QtCore.QObject" -> "QtGui.QGraphicsScene" [arrowsize=0.5,style="setlinewidth(0.5)"]; "baselisteners.GraphListenerBase" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="This object strictly watches the given graph.",height=0.25,shape=box,fontsize=10]; "observer.AbstractListener" -> "baselisteners.GraphListenerBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "observer.AbstractListener" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Listener base class",height=0.25,shape=box,fontsize=10]; "qtgraphview.Scene" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A Qt implementation of GraphListenerBase",height=0.25,shape=box,fontsize=10]; "QtGui.QGraphicsScene" -> "qtgraphview.Scene" [arrowsize=0.5,style="setlinewidth(0.5)"]; "baselisteners.GraphListenerBase" -> "qtgraphview.Scene" [arrowsize=0.5,style="setlinewidth(0.5)"]; "sip.simplewrapper" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",height=0.25]; "sip.wrapper" [shape=box,style="setlinewidth(0.5)",fontsize=10,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",height=0.25]; "sip.simplewrapper" -> "sip.wrapper" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
GraphElementListenerBase¶
digraph inheritance1ba65fa599 { rankdir=LR; size="8.0, 12.0"; "baselisteners.GraphElementListenerBase" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Base class for elements in a GraphView",height=0.25,shape=box,fontsize=10]; "observer.AbstractListener" -> "baselisteners.GraphElementListenerBase" [arrowsize=0.5,style="setlinewidth(0.5)"]; "observer.AbstractListener" [style="setlinewidth(0.5)",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Listener base class",height=0.25,shape=box,fontsize=10]; }