Reference guide#

Class Inheritance diagram#

openalea.grapheditor.base module#

Download the source file ../../src/openalea/grapheditor/base.py.

class openalea.grapheditor.base.GraphAdapterBase(graph=None)[source]#

Bases: object

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

get_vertex(vid=None)[source]#

Return the vertex object matching vid. By default this is just vid!

get_vertex_input(graphicalV, pid)[source]#
get_vertex_inputs(graphicalV)[source]#
get_vertex_output(graphicalV, pid)[source]#
get_vertex_outputs(graphicalV)[source]#
classmethod get_vertex_types()[source]#

Used by the GraphListenerBase class to check if the types declared here are really implemented in the strategy

is_input(input)[source]#
is_output(output)[source]#
is_vertex_protected(vertex)[source]#
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_edges(edgeList)[source]#

Removes a list of vertices by forwarding them to self.remove_vertex

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.

remove_vertices(vertexList)[source]#

Removes a list of vertices by forwarding them to self.remove_vertex

replace_vertex(oldVertex, newVertex)[source]#
set_graph(graph)[source]#
openalea.grapheditor.base.GraphStrategyMaker(graphView, vertexWidgetMap, edgeWidgetMap, connectorTypes=[], graphViewInitialiser=None, adapterType=None)[source]#

openalea.grapheditor.baselisteners module#

Download the source file ../../src/openalea/grapheditor/baselisteners.py.

Generic Graph Widget

class openalea.grapheditor.baselisteners.BlackBoxModel(owner, observed)[source]#

Bases: object

An object that allows to unify certain model (in the MVC meaning) operations calls, wether the model is an Observed instance or just any random class.

In the case it is an Observed instance, it calls the according methods of the model. In any other case, the implementation does (almost) nothing.

clear_observed()[source]#
get_observed()[source]#
get_observers()[source]#
is_true()[source]#
class openalea.grapheditor.baselisteners.GraphElementListenerBase(observed=None, graph=None)[source]#

Bases: AbstractListener

Base class for elements in a GraphView

add_to_view(view)[source]#

An element adds itself to the given view

call_notify(sender, event=None)#

Basic implementation call directly notify function Sub class can override this method to implement different call strategy (like signal slot)

change_observed(old, new)[source]#
clear_observed(*args)[source]#
deaf(setDeaf=True)#
default_position()[source]#
get_observed()[source]#
get_view()[source]#
get_view_data(key)[source]#
graph()[source]#
initialise(observed)#

Register self as a listener to observed

initialise_from_model()[source]#
is_notification_locked()#
lock_position(val=True)[source]#
notify(sender, event)[source]#

called by the observed when something happens to it.

notify_lock = None#
position_changed(*args)[source]#

Updates the item’s graphical position from model notifications.

queue_call_notifications(call, *args, **kwargs)#

Runs a call and queues notifications coming from that call to this listener. Once the call is finished, queued notifications are processed FIFO.

remove_from_view(view)[source]#

An element removes itself from the given view

set_graph(graph)[source]#
set_observed(observed)[source]#
store_view_data(**kwargs)[source]#
class openalea.grapheditor.baselisteners.GraphListenerBase[source]#

Bases: AbstractListener

This object strictly watches the given graph. It deduces the correct representation out of a known list of representations.

It is MVC oriented.

add_edge(*args, **kwargs)[source]#
add_vertex(*args, **kwargs)[source]#
call_notify(sender, event=None)#

Basic implementation call directly notify function Sub class can override this method to implement different call strategy (like signal slot)

change_observed(old, new)#
clear()[source]#
deaf(setDeaf=True)#
edge_added(etype, edgeModel, src, dst, *args, **kwargs)[source]#
edge_event(edge, data)[source]#
edge_removed(vtype, edgeModel)[source]#
get_adapter()[source]#
get_edge_types()[source]#
get_graph()[source]#
get_graphical_edges_connected_to(cmodel)[source]#
get_observable_graph()[source]#
get_strategy()[source]#
get_vertex(*args, **kwargs)[source]#
get_vertex_input(*args, **kwargs)[source]#
get_vertex_inputs(*args, **kwargs)[source]#
get_vertex_output(*args, **kwargs)[source]#
get_vertex_outputs(*args, **kwargs)[source]#
get_vertex_types()[source]#
initialise(observed)#

Register self as a listener to observed

initialise_from_model()[source]#
is_connectable(obj)[source]#
is_input(*args, **kwargs)[source]#
is_notification_locked()#
is_output(*args, **kwargs)[source]#
classmethod make_scene(*args, **kwargs)[source]#
new_vertex(*args, **kwargs)[source]#
notify(sender, event)[source]#

This function is called by observed objects

Parameters:
  • sender – the observed object which send notification

  • event – the data associated to the notification

notify_lock = None#
queue_call_notifications(call, *args, **kwargs)#

Runs a call and queues notifications coming from that call to this listener. Once the call is finished, queued notifications are processed FIFO.

remove_edge(*args, **kwargs)[source]#
remove_edges(*args, **kwargs)[source]#
remove_vertex(*args, **kwargs)[source]#
remove_vertices(*args, **kwargs)[source]#
set_graph(graph, adapter=None, observableGraph=None)[source]#
set_strategy(stratCls)[source]#
vertex_added(vtype, vertexModel, *args, **kwargs)[source]#
vertex_event(vertex, data)[source]#
vertex_removed(vtype, vertexModel)[source]#
class openalea.grapheditor.baselisteners.GraphViewBase[source]#

Bases: object

set_canvas(canvas)[source]#
exception openalea.grapheditor.baselisteners.StrategyError(msg)[source]#

Bases: Exception

add_note(note, /)#

Add a note to the exception

args#
get_message()[source]#
with_traceback(tb, /)#

Set self.__traceback__ to tb and return self.

openalea.grapheditor.qtgraphview module#

Download the source file ../../src/openalea/grapheditor/qtgraphview.py.

Generic Qt Graph Widget

class openalea.grapheditor.qtgraphview.Connector(*args, **kwargs)[source]#

Bases: Element

get_scene_center()[source]#
itemChange(change, value)[source]#
mousePressEvent(event)[source]#
notify_position_change(pos=None)[source]#
set_connection_button(button)[source]#
set_connection_modifiers(modifiers)[source]#
set_highlighted(val)[source]#
class openalea.grapheditor.qtgraphview.DefaultGraphicalEdge(edge=None, graph=None, src=None, dest=None)[source]#

Bases: Edge, QGraphicsPathItem

get_view_data = None#
store_view_data = None#
class openalea.grapheditor.qtgraphview.DefaultGraphicalFloatingEdge(srcPoint, graph)[source]#

Bases: FloatingEdge, QGraphicsPathItem

class openalea.grapheditor.qtgraphview.DefaultGraphicalVertex(vertex, graph)[source]#

Bases: Vertex, QGraphicsEllipseItem

circleSize = 20.0#
itemChange(*args, **kwargs)#

Used mainly to capture position changes from the QGraphicsScene and store it in the model so that it can be saved.

mousePressEvent(self, event: QGraphicsSceneMouseEvent | None)#
paint(*args, **kwargs)#

Qt-specific call to paint things.

class openalea.grapheditor.qtgraphview.Edge(edge=None, graph=None, src=None, dst=None)[source]#

Bases: Element

Base class for Qt based edges.

change_observed(old, new)[source]#
clear_observed(*args)[source]#
edge()#
initialise_from_model()[source]#
itemChange(change, value)[source]#

Callback when item has been modified (move…)

notify(sender, event)[source]#

called by the observed when something happens to it.

remove()[source]#
set_edge_creator(creator)[source]#
set_observed_destination(dst)[source]#
set_observed_source(src)[source]#
shape()[source]#
update_line_destination(*pos)[source]#
update_line_source(*pos)[source]#
class openalea.grapheditor.qtgraphview.Element(observed=None, graph=None)[source]#

Bases: GraphElementListenerBase

Base class for elements in a qtgraphview.View.

Implements basic listeners calls for elements of a graph. A listener call is the method that is called after the main listening method (self.notify) dispatches the events. They are specified by interfaces.IGraphViewElement.

Listener calls:
  • position_changed(self, (posx, posy))

  • add_to_view(self, view)

  • remove_from_view(self, view)

add_to_view(view)[source]#

An element adds itself to the given view

default_position()[source]#
get_view()[source]#
lock_position(val=True)[source]#
position_changed(*args)[source]#

Updates the item’s graphical position from model notifications.

remove_from_view(view)[source]#

An element removes itself from the given view

class openalea.grapheditor.qtgraphview.FloatingEdge(srcPoint, graph)[source]#

Bases: Edge

consolidate(graph)[source]#
get_connections()[source]#
notify(sender, event)[source]#

called by the observed when something happens to it.

openalea.grapheditor.qtgraphview.QtGraphStrategyMaker(*args, **kwargs)[source]#
class openalea.grapheditor.qtgraphview.Scene(parent)[source]#

Bases: QGraphicsScene, GraphListenerBase

A Qt implementation of GraphListenerBase

clear()[source]#

Remove all items from the scene

find_closest_connectable(pos, boxsize=10.0)[source]#
focusedItemChanged#

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

get_items(filterType=None, subcall=None)[source]#
get_scene()[source]#
get_selected_items(filterType=None, subcall=None)[source]#
get_selection_center(selection=None)[source]#
classmethod make_scene(graph, clone=False, parent=None)[source]#
mouseMoveEvent(self, event: QGraphicsSceneMouseEvent | None)[source]#
mouseReleaseEvent(self, event: QGraphicsSceneMouseEvent | None)[source]#
post_addition(element)[source]#
rebuild()[source]#

Build the scene with graphic vertex and edge

register_view(view)[source]#
select_added_elements(val)[source]#
select_added_items(val)[source]#
unregister_view(view, scene)[source]#
class openalea.grapheditor.qtgraphview.Vertex(vertex, graph, defaultCenterConnector=False)[source]#

Bases: Element

An abstract graphic item that represents a graph vertex.

The actual implementation is done in the derived class. What this intermediate implementation does is that it provides the basics for handling edge creation from one node to the other. It also provides a state based pluggable painting system, meant to customize the painting from the application side. Of course, if it doesn’t match your needs you can override it completely in your subclass.

class InvisibleConnector(parent, *args, **kwargs)[source]#

Bases: QGraphicsEllipseItem, Connector

itemChange(self, change: QGraphicsItem.GraphicsItemChange, value: Any) Any#
paint(self, painter: QPainter | None, option: QStyleOptionGraphicsItem | None, widget: QWidget | None = None)[source]#
position_changed(*args)[source]#

reimplemented to do nothing. otherwise caught position changes from the model and ignored the position it was forced to

size = 10#
add_connector(connector)[source]#
add_to_view(view)[source]#

An element adds itself to the given view

get_scene_center()[source]#

retrieve the center of the widget on the scene

itemChange(change, value)[source]#

Used mainly to capture position changes from the QGraphicsScene and store it in the model so that it can be saved.

iter_connectors(filter_fun=<function Vertex.<lambda>>)[source]#
notify(sender, event)[source]#

called by the observed when something happens to it.

notify_position_change()[source]#

Triggers a visual refresh of anything that observes the position of the vertex.

paint(painter, option, widget)[source]#

Qt-specific call to paint things.

remove_connector(connector)[source]#
remove_from_view(view)[source]#

An element removes itself from the given view

set_highlighted(value)[source]#
set_painting_strategy(strat)[source]#
vertex()#
class openalea.grapheditor.qtgraphview.View(parent)[source]#

Bases: QGraphicsView, GraphViewBase

A View implementing client customisation

class AcceptEvent[source]#

Bases: object

accept_drop(event)[source]#

Return the format of the object if a handler is registered for it. If not, if there is a default handler, returns True, else returns False.

clear_scene(*args, **kwargs)#
closeEvent(evt)[source]#

a big hack to cleanly remove items from the view and delete the python objects so that they stop leaking on some operating systems

closing#

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

copyRequest#

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

cutRequest#

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

deleteRequest#

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

dragEnterEvent(event)[source]#

While the user hasn’t released the object, this method is called to tell qt if the view accepts the object or not.

dragMoveEvent(self, event: QDragMoveEvent | None)[source]#
dropEvent(self, event: QDropEvent | None)[source]#
get_selected_items(*args, **kwargs)#
get_selection_center(*args, **kwargs)#
graph(*args, **kwargs)#
keyPressEvent(self, event: QKeyEvent | None)[source]#
keyReleaseEvent(self, event: QKeyEvent | None)[source]#
notify(*args, **kwargs)#
pasteRequest#

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

post_addition(*args, **kwargs)#
rebuild_scene(*args, **kwargs)#
scale_view(factor)[source]#
select_added_elements(*args, **kwargs)#
setScene(scene)[source]#

Overload of QGraphicsView.setScene to correctly handle multiple views of the same scene using reference counting.

set_canvas(scene)[source]#
set_default_drop_handler(handler)[source]#
set_graph(*args, **kwargs)#
set_keypress_handler_map(mapping)[source]#
set_keyrelease_handler_map(mapping)[source]#
set_mime_handler_map(mapping)[source]#
show_entire_scene()[source]#

Scale the scene and center it in order to display the entire content without scrolling.

wheelEvent(self, event: QWheelEvent | None)[source]#
openalea.grapheditor.qtgraphview.defaultPaint(owner, painter, paintOptions, widget)[source]#
openalea.grapheditor.qtgraphview.deprecate(methodName, newName=None)[source]#

create deprecation wrappers

openalea.grapheditor.edgefactory module#

Download the source file ../../src/openalea/grapheditor/edgefactory.py.

class openalea.grapheditor.edgefactory.LinearEdgePath[source]#

Bases: object

Draw edges as line.

get_path(p1, p2)[source]#
shape()[source]#
class openalea.grapheditor.edgefactory.PolylineEdgePath[source]#

Bases: LinearEdgePath

Edge as Polyline

WIDTH = 30#
get_path(p1, p2)[source]#
shape()[source]#
class openalea.grapheditor.edgefactory.SplineEdgePath[source]#

Bases: PolylineEdgePath

Edge as Spline

get_path(p1, p2)[source]#

openalea.grapheditor.qtutils module#

Download the source file ../../src/openalea/grapheditor/qtutils.py.

class openalea.grapheditor.qtutils.AleaQGraphicsButtonMixin(auto=True)[source]#

Bases: object

mousePressEvent(event)[source]#
mouseReleaseEvent(event)[source]#
class openalea.grapheditor.qtutils.AleaQGraphicsColorWheel(radius=3.0, parent=None)[source]#

Bases: AleaQGraphicsVanishingMixin, AleaQGraphicsButtonMixin, QGraphicsEllipseItem

class openalea.grapheditor.qtutils.AleaQGraphicsEmitingTextItem(*args, **kwargs)[source]#

Bases: QGraphicsTextItem

A QtWidgets.QGraphicsTextItem that emits geometryModified whenever its geometry can have changed.

geometryModified#

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

hoverEnterEvent(self, event: QGraphicsSceneHoverEvent | None)[source]#
hoverLeaveEvent(self, event: QGraphicsSceneHoverEvent | None)[source]#
class openalea.grapheditor.qtutils.AleaQGraphicsFontButton(parent=None)[source]#

Bases: AleaQGraphicsButtonMixin, QGraphicsSimpleTextItem

class openalea.grapheditor.qtutils.AleaQGraphicsFontColorButton(parent=None)[source]#

Bases: AleaQGraphicsFontButton

class openalea.grapheditor.qtutils.AleaQGraphicsRoundedRectItem(radius, cache=False, *args)[source]#

Bases: QGraphicsRectItem

paint(self, painter: QPainter | None, option: QStyleOptionGraphicsItem | None, widget: QWidget | None = None)[source]#
refresh_cached_shape()[source]#
shape(self) QPainterPath[source]#
class openalea.grapheditor.qtutils.AleaQGraphicsToolbar(parent=None)[source]#

Bases: AleaQGraphicsVanishingMixin, QGraphicsRectItem

addItem(item)[source]#
refreshGeometry()[source]#
class openalea.grapheditor.qtutils.AleaQGraphicsVanishingMixin(vanishingTime=500, baseOpacity=0.01)[source]#

Bases: object

appear()[source]#
disappear()[source]#
hoverEnterEvent(event)[source]#
hoverLeaveEvent(event)[source]#
setBaseOpactity(opacity)[source]#
setSleepOnDisappear(val)[source]#
setVanishingEnabled(val)[source]#
setVanishingTime(time)[source]#
sleep()[source]#
vanishingTime()[source]#
wakeup()[source]#
class openalea.grapheditor.qtutils.AleaQMenu(arg1=None, arg2=None)[source]#

Bases: QMenu

move(self, a0: QPoint)[source]#
move(self, ax: int, ay: int) None
class openalea.grapheditor.qtutils.AleaSignal(*types)[source]#

Bases: object

connect(callback)[source]#
disconnect(callback=None)[source]#
emit(*args)[source]#
class openalea.grapheditor.qtutils.HorizontalLayout(parent=None, final=None, margins=(0.0, 0.0, 0.0, 0.0), innerMargins=(0.0, 0.0), center=False, mins=(0.0, 0.0))[source]#

Bases: Layout

setPos(pos)[source]#
class openalea.grapheditor.qtutils.Layout(parent=None, final=None, margins=(0.0, 0.0, 0.0, 0.0), innerMargins=(0.0, 0.0), center=False, mins=(0.0, 0.0))[source]#

Bases: object

addFinalItem(item)[source]#
addItem(item)[source]#
boundingRect(force=True)[source]#
center(val)[source]#
clear()[source]#
isVisible()[source]#
removeItem(item)[source]#
setInnerMargins(ix1=None, iy1=None)[source]#
setMargins(x1=None, x2=None, y1=None, y2=None)[source]#
setMinimumSize(width=None, height=None)[source]#
setPos(pos)[source]#
sort(cmp)[source]#
visibleItems(subcall=None)[source]#
class openalea.grapheditor.qtutils.MemoRects(rect, parent=None)[source]#

Bases: QGraphicsRectItem

mouseMoveEvent(self, event: QGraphicsSceneMouseEvent | None)[source]#
mousePressEvent(self, event: QGraphicsSceneMouseEvent | None)[source]#
mouseReleaseEvent(self, event: QGraphicsSceneMouseEvent | None)[source]#
paint(self, painter: QPainter | None, option: QStyleOptionGraphicsItem | None, widget: QWidget | None = None)[source]#
setColor(color)[source]#
setHeaderRect(rect)[source]#
class openalea.grapheditor.qtutils.VerticalLayout(parent=None, final=None, margins=(0.0, 0.0, 0.0, 0.0), innerMargins=(0.0, 0.0), center=False, mins=(0.0, 0.0))[source]#

Bases: Layout

setPos(pos)[source]#
openalea.grapheditor.qtutils.extend_qt_scene_event(qtcls)[source]#
openalea.grapheditor.qtutils.mixin_method(mixinOne, mixinTwo, methodname, firstWins=False, invert=False, caller=None)[source]#

A function that returns a method calling method “methodname” from mixinOne and then from mixinTwo, or the reverse order if invert is True. Can be used to quickly reimplement simple overloads.

openalea.grapheditor.qtutils.qrect_contains(r1, r2, proper)[source]#

openalea.grapheditor.interfaces module#

Download the source file ../../src/openalea/grapheditor/interfaces.py.

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.IGraphAdapter[source]#

Bases: object

add_edge(*args, **kargs)[source]#
add_vertex(*args, **kargs)[source]#
get_edge_types()[source]#
get_vertex(*args, **kargs)[source]#
get_vertex_input(*args, **kargs)[source]#
get_vertex_inputs(*args, **kargs)[source]#
get_vertex_output(*args, **kargs)[source]#
get_vertex_outputs(*args, **kargs)[source]#
get_vertex_types()[source]#
is_input(*args, **kargs)[source]#
is_output(*args, **kargs)[source]#
remove_edge(*args, **kargs)[source]#
remove_vertex(*args, **kargs)[source]#
remove_vertices(*args, **kargs)[source]#
class openalea.grapheditor.interfaces.IGraphListener[source]#

Bases: object

clear(*args, **kwargs)[source]#
edge_added(edgeModel, srcPort, dstPort)[source]#
edge_removed(edgeModel)[source]#
find_closest_connectable(*args, **kwargs)[source]#
initialise_from_model()[source]#
is_connectable(*args, **kwargs)[source]#
post_addition(*args, **kwargs)[source]#
vertex_added(vtype, vertexModel)[source]#
vertex_removed(vtype, vertexModel)[source]#
class openalea.grapheditor.interfaces.IGraphViewAnnotation[source]#

Bases: IGraphViewElement

Interface for Annotations

notify(sender, event)[source]#

(“metadata_changed”, “text”, “a string”, str)

set_text(text)[source]#

to change the visible text

class openalea.grapheditor.interfaces.IGraphViewConnectable[source]#

Bases: object

Interface for connectable objects

get_scene_center()[source]#
set_highlighted(*args, **kwargs)[source]#
class openalea.grapheditor.interfaces.IGraphViewEdge[source]#

Bases: IGraphViewElement

Interface for edges between two vertexs.

notify(sender, event)[source]#

(“metadata_changed”, “canvasPosition”, [x,x], list)

update_line_destination(*pos)[source]#

updates this edge’s ending point. Called when dest point is moved

update_line_source(*pos)[source]#

updates this edge’s starting point. Called when source point is moved

class openalea.grapheditor.interfaces.IGraphViewElement[source]#

Bases: object

Base class for elements in a GraphView

add_to_view(view)[source]#

add this element to the graphical view

get_view_data(key)[source]#
initialise_from_model()[source]#
notify(sender, event)[source]#

called by the observed objects Expected event = (“metadata_changed”, “position”, [x,x], list)

position_changed(*args)[source]#

Place the element’s representation in the view space

remove_from_view(view)[source]#

remove this element from the graphical view

store_view_data(**kwargs)[source]#
class openalea.grapheditor.interfaces.IGraphViewFloatingEdge(src)[source]#

Bases: object

Interface for edges to be drawn during creation time, ie while the user drags.

consolidate(model)[source]#

returns whatever object is under the mouse pointer at the time the button was released

get_connections(*args)[source]#
class openalea.grapheditor.interfaces.IGraphViewStrategies[source]#

Bases: object

Define implementations of this trait class to define the behaviour of the graph. For example : DataFlowGraphViewTrait, TreeGraphViewTrait, NetworkGraphViewTrait…

create_edge_widget(etype, *args, **kwargs)[source]#

Instanciates an edge matching etype

create_vertex_widget(vtype, *args, **kwargs)[source]#

Instanciates a node matching vtype

create_view(parent, graph, *args, **kwargs)[source]#

Instanciates the view

get_connector_types()[source]#
get_graph_model_type()[source]#

Returns the classobj defining the graph type

initialise_graph_view(graphView, graphModel)[source]#

intialise graph view from model

class openalea.grapheditor.interfaces.IGraphViewVertex[source]#

Bases: IGraphViewElement

lock_position(val=True)[source]#
class openalea.grapheditor.interfaces.IInterfaceMetaClass(name, bases, dict)[source]#

Bases: type

Adds a method to the interface class that checks that the given object implements the class’ interface. Allows some sort of safe-ducktyping

check(obj)[source]#

Check if obj matches this interface.