Scheme Editor (schemeedit)
Scheme Editor Widget
- class orangecanvas.document.schemeedit.SchemeEditWidget(parent=None)[source]
Bases:
PyQt5.QtWidgets.QWidgetA widget for editing a
Schemeinstance.- undoAvailable(bool)
Undo command has become available/unavailable.
- redoAvailable(bool)
Redo command has become available/unavailable.
- modificationChanged(bool)
Document modified state has changed.
- undoCommandAdded
Undo command was added to the undo stack.
- selectionChanged
Item selection has changed.
- titleChanged
Document title has changed.
- pathChanged
Document path has changed.
- class OpenAnchors(value)[source]
Bases:
enum.EnumInteractions with individual anchors
- Never = 'Never'
Channel anchors never separate
- Always = 'Always'
Channel anchors separate on hover
- OnShift = 'OnShift'
Channel anchors separate on hover on Shift key
- toolbarActions() List[PyQt5.QtWidgets.QAction][source]
Return a list of actions that can be inserted into a toolbar. At the moment these are:
‘Zoom in’ action
‘Zoom out’ action
‘Zoom Reset’ action
‘Clean up’ action (align to grid)
‘New text annotation’ action (with a size menu)
‘New arrow annotation’ action (with a color menu)
Return a list of actions that can be inserted into a QMenuBar.
- modified
Is the document is a modified state.
- isModifiedStrict()[source]
Is the document modified.
Run a strict check against all node properties as they were at the time when the last call to setModified(True) was made.
- uncleanProperties()[source]
Returns node properties differences since last clean state, excluding unclean nodes.
- setQuickMenuTriggers(triggers: int) None[source]
Set quick menu trigger flags.
Flags can be a bitwise or of:
SchemeEditWidget.NoTrigeres
SchemeEditWidget.RightClicked
SchemeEditWidget.DoubleClicked
SchemeEditWidget.SpaceKey
SchemeEditWidget.AnyKey
- setChannelNamesVisible(visible: bool) None[source]
Set channel names visibility state. When enabled the links in the view will have a source/sink channel names displayed over them.
- setPath(path: str) None[source]
Set the path associated with the current scheme.
Note
Calling setScheme will invalidate the path (i.e. set it to an empty string)
- setScheme(scheme: orangecanvas.scheme.scheme.Scheme) None[source]
Set the
Schemeinstance to display/edit.
- ensureVisible(node: orangecanvas.scheme.node.SchemeNode) None[source]
Scroll the contents of the viewport so that node is visible.
- Parameters
node (SchemeNode) –
- scheme() Optional[orangecanvas.scheme.scheme.Scheme][source]
Return the
Schemeedited by the widget.
- scene() PyQt5.QtWidgets.QGraphicsScene[source]
Return the
QGraphicsSceneinstance used to display the current scheme.
- view() PyQt5.QtWidgets.QGraphicsView[source]
Return the
QGraphicsViewinstance used to display the current scene.
- quickMenu() orangecanvas.document.quickmenu.QuickMenu[source]
Return a
QuickMenupopup menu instance for new node creation.
- addNode(node: orangecanvas.scheme.node.SchemeNode) None[source]
Add a new node (
SchemeNode) to the document.
- createNewNode(description: orangecanvas.registry.description.WidgetDescription, title: Optional[str] = None, position: Optional[Tuple[float, float]] = None) orangecanvas.scheme.node.SchemeNode[source]
Create a new
SchemeNodeand add it to the document. The new node is constructed usingnewNodeHelper()method
- newNodeHelper(description: orangecanvas.registry.description.WidgetDescription, title: Optional[str] = None, position: Optional[Tuple[float, float]] = None) orangecanvas.scheme.node.SchemeNode[source]
Return a new initialized
SchemeNode. If title and position are not supplied they are initialized to sensible defaults.
- enumerateTitle(title: str) str[source]
Enumerate a title string (i.e. add a number in parentheses) so it is not equal to any node title in the current scheme.
- nextPosition() Tuple[float, float][source]
Return the next default node position as a (x, y) tuple. This is a position left of the last added node.
- removeNode(node: orangecanvas.scheme.node.SchemeNode) None[source]
Remove a node (
SchemeNode) from the scheme
- renameNode(node: orangecanvas.scheme.node.SchemeNode, title: str) None[source]
Rename a node (
SchemeNode) to title.
- addLink(link: orangecanvas.scheme.link.SchemeLink) None[source]
Add a link (
SchemeLink) to the scheme.
- removeLink(link: orangecanvas.scheme.link.SchemeLink) None[source]
Remove a link (
SchemeLink) from the scheme.
- insertNode(new_node: orangecanvas.scheme.node.SchemeNode, old_link: orangecanvas.scheme.link.SchemeLink) None[source]
Insert a node in-between two linked nodes.
- addAnnotation(annotation: orangecanvas.scheme.annotations.BaseSchemeAnnotation) None[source]
Add annotation (
BaseSchemeAnnotation) to the scheme
- removeAnnotation(annotation: orangecanvas.scheme.annotations.BaseSchemeAnnotation) None[source]
Remove annotation (
BaseSchemeAnnotation) from the scheme.
- focusNode() Optional[orangecanvas.scheme.node.SchemeNode][source]
Return the current focused
SchemeNodeorNoneif no node has focus.
- selectedNodes() List[orangecanvas.scheme.node.SchemeNode][source]
Return all selected
SchemeNodeitems.
- selectedAnnotations() List[orangecanvas.scheme.annotations.BaseSchemeAnnotation][source]
Return all selected
BaseSchemeAnnotationitems.
- editNodeTitle(node: orangecanvas.scheme.node.SchemeNode) None[source]
Edit (rename) the node’s title.
- setDropHandlers(dropHandlers: Sequence[orangecanvas.document.interactions.DropHandler]) None[source]
Set handlers for drop events onto the workflow view.
- activateDefaultWindowGroup() bool[source]
Activate the default window group if one exists.
Return True if a default group exists and was activated; False if not.
- widgetManager() Optional[orangecanvas.scheme.widgetmanager.WidgetManager][source]
Return the widget manager.