Scheme Editor (schemeedit)

# Orange Canvas Core 0.0.8 documentation

## Scheme Editor (schemeedit)

# Scheme Editor (`schemeedit`)

## Scheme Editor Widget

class `orangecanvas.document.schemeedit.` `SchemeEditWidget`(parent=None)

  Bases: `PyQt5.QtWidgets.QWidget`

  A widget for editing a `Scheme` instance.

  `undoAvailable`(bool)
  `redoAvailable`(bool)
  `modificationChanged`(bool)
  `undoCommandAdded`()
  `selectionChanged`()
  `titleChanged`()
  `pathChanged`()
  `undoAvailable`

    Undo command has become available/unavailable.

  `redoAvailable`

    Redo command has become available/unavailable.

  `toolbarActions`()

    Return a list of actions that can be inserted into a toolbar. At the moment these are:

    > - ‘Zoom’ action
    > - ‘Clean up’ action (align to grid)
    > - ‘New text annotation’ action (with a size menu)
    > - ‘New arrow annotation’ action (with a color menu)

  `menuBarActions`()

    Return a list of actions that can be inserted into a QMenuBar.

  `isModified`()

    Is the document is a modified state.

  `setModified`(modified)

    Set the document modified state.

  `modified`

    Is the document is a modified state.

  `isModifiedStrict`()

    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.

  `setQuickMenuTriggers`(triggers)

    Set quick menu trigger flags.

    Flags can be a bitwise or of:

    > - SchemeEditWidget.NoTrigeres
    > - SchemeEditWidget.RightClicked
    > - SchemeEditWidget.DoubleClicked
    > - SchemeEditWidget.SpaceKey
    > - SchemeEditWidget.AnyKey

  `quickMenuTriggers`()

    Return quick menu trigger flags.

  `setChannelNamesVisible`(visible)

    Set channel names visibility state. When enabled the links in the view will have a source/sink channel names displayed over them.

  `channelNamesVisible`()

    Return the channel name visibility state.

  `setNodeAnimationEnabled`(enabled)

    Set the node item animation enabled state.

  `nodeAnimationEnabled`()

    Return the node item animation enabled state.

  `undoStack`()

    Return the undo stack.

  `setPath`(path)

    Set the path associated with the current scheme.

    Note

    Calling setScheme will invalidate the path (i.e. set it to an empty string)

  `path`()

    Return the path associated with the scheme

  `setScheme`(scheme)

    Set the `Scheme` instance to display/edit.

  `ensureVisible`(node)

    Scroll the contents of the viewport so that node is visible.

    Parameters: | node (SchemeNode) –

  `scheme`()

    Return the `Scheme` edited by the widget.

  `scene`()

    Return the `QGraphicsScene` instance used to display the current scheme.

  `view`()

    Return the `QGraphicsView` instance used to display the current scene.

  `quickMenu`()

    Return a `QuickMenu` popup menu instance for new node creation.

  `setTitle`(title)

    Set the scheme title.

  `setDescription`(description)

    Set the scheme description string.

  `addNode`(node)

    Add a new node (`SchemeNode`) to the document.

  `createNewNode`(description, title=None, position=None)

    Create a new `SchemeNode` and add it to the document. The new node is constructed using `newNodeHelper()` method

  `newNodeHelper`(description, title=None, position=None)

    Return a new initialized `SchemeNode`. If title and position are not supplied they are initialized to sensible defaults.

  `enumerateTitle`(title)

    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`()

    Return the next default node position as a (x, y) tuple. This is a position left of the last added node.

  `removeNode`(node)

    Remove a node (`SchemeNode`) from the scheme

  `renameNode`(node, title)

    Rename a node (`SchemeNode`) to title.

  `addLink`(link)

    Add a link (`SchemeLink`) to the scheme.

  `removeLink`(link)

    Remove a link (`SchemeLink`) from the scheme.

  `addAnnotation`(annotation)

    Add annotation (`BaseSchemeAnnotation`) to the scheme

  `removeAnnotation`(annotation)

    Remove annotation (`BaseSchemeAnnotation`) from the scheme.

  `removeSelected`()

    Remove all selected items in the scheme.

  `selectAll`()

    Select all selectable items in the scheme.

  `toggleZoom`(zoom)

    Toggle view zoom. If zoom is True the scheme is displayed scaled to 150%.

  `alignToGrid`()

    Align nodes to a grid.

  `focusNode`()

    Return the current focused `SchemeNode` or `None` if no node has focus.

  `selectedNodes`()

    Return all selected `SchemeNode` items.

  `selectedAnnotations`()

    Return all selected `BaseSchemeAnnotation` items.

  `openSelected`()

    Open (show and raise) all widgets for the current selected nodes.

  `editNodeTitle`(node)

    Edit (rename) the node’s title. Opens an input dialog.