Link Item (linkitem)

class orangecanvas.canvas.items.linkitem.LinkItem(*args)

Bases: PyQt4.QtGui.QGraphicsObject

A Link item in the canvas that connects two NodeItems in the canvas.

The link curve connects two Anchor items (see setSourceItem() and setSinkItem()). Once the anchors are set the curve automatically adjusts its end points whenever the anchors move.

An optional source/sink text item can be displayed above the curve’s central point (setSourceName(), setSinkName())

Z_VALUE = 0

Z value of the item

setSourceItem(item, anchor=None)

Set the source item (NodeItem). Use anchor (AnchorPoint) as the curve start point (if None a new output anchor will be created using item.newOutputAnchor()).

Setting item to None and a valid anchor is a valid operation (for instance while mouse dragging one end of the link).

setSinkItem(item, anchor=None)

Set the sink item (NodeItem). Use anchor (AnchorPoint) as the curve end point (if None a new input anchor will be created using item.newInputAnchor()).

Setting item to None and a valid anchor is a valid operation (for instance while mouse dragging one and of the link).

setFont(font)

Set the font for the channel names text item.

font()

Return the font for the channel names text.

setChannelNamesVisible(visible)

Set the visibility of the channel name text.

setSourceName(name)

Set the name of the source (used in channel name text).

sourceName()

Return the source name.

setSinkName(name)

Set the name of the sink (used in channel name text).

sinkName()

Return the sink name.

setEnabled(enabled)

Reimplemented from QGraphicsObject

Set link enabled state. When disabled the link is rendered with a dashed line.

setDynamicEnabled(enabled)

Set the link’s dynamic enabled state.

If the link is dynamic it will be rendered in red/green color respectively depending on the state of the dynamic enabled state.

isDynamicEnabled()

Is the link dynamic enabled.

setDynamic(dynamic)

Mark the link as dynamic (i.e. it responds to setDynamicEnabled()).

isDynamic()

Is the link dynamic.