Scheme Editor (schemeedit
)
Scheme Editor Widget
- class orangecanvas.document.schemeedit.SchemeEditWidget(parent=None)[source]
Bases:
QWidget
A widget for editing a
Scheme
instance.- 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
Interactions 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[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)
- ensureVisible(node: SchemeNode) None [source]
Scroll the contents of the viewport so that node is visible.
- Parameters:
node (SchemeNode)
- scene() QGraphicsScene [source]
Return the
QGraphicsScene
instance used to display the current scheme.
- addNode(node: SchemeNode) None [source]
Add a new node (
SchemeNode
) to the document.
- createNewNode(description: WidgetDescription, title: str | None = None, position: Tuple[float, float] | None = None) SchemeNode [source]
Create a new
SchemeNode
and add it to the document. The new node is constructed usingnewNodeHelper()
method
- newNodeHelper(description: WidgetDescription, title: str | None = None, position: Tuple[float, float] | None = None) 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: SchemeNode) None [source]
Remove a node (
SchemeNode
) from the scheme
- renameNode(node: SchemeNode, title: str) None [source]
Rename a node (
SchemeNode
) to title.
- addLink(link: SchemeLink) None [source]
Add a link (
SchemeLink
) to the scheme.
- removeLink(link: SchemeLink) None [source]
Remove a link (
SchemeLink
) from the scheme.
- insertNode(new_node: SchemeNode, old_link: SchemeLink) None [source]
Insert a node in-between two linked nodes.
- addAnnotation(annotation: BaseSchemeAnnotation) None [source]
Add annotation (
BaseSchemeAnnotation
) to the scheme
- removeAnnotation(annotation: BaseSchemeAnnotation) None [source]
Remove annotation (
BaseSchemeAnnotation
) from the scheme.
- focusNode() SchemeNode | None [source]
Return the current focused
SchemeNode
orNone
if no node has focus.
- selectedNodes() List[SchemeNode] [source]
Return all selected
SchemeNode
items.
- selectedAnnotations() List[BaseSchemeAnnotation] [source]
Return all selected
BaseSchemeAnnotation
items.
- editNodeTitle(node: SchemeNode) None [source]
Edit (rename) the node’s title.
- setDropHandlers(dropHandlers: Sequence[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() WidgetManager | None [source]
Return the widget manager.