Class PraxisGraphScene<N>
- Type Parameters:
N- node type
- All Implemented Interfaces:
Accessible,org.openide.util.Lookup.Provider
public final class PraxisGraphScene<N>
extends org.netbeans.api.visual.graph.GraphPinScene<N,EdgeID<N>,PinID<N>>
A graph scene providing node widgets with pins and edges. The graph scene is
backed by a set of nodes of the given type. A graph cannot contain duplicate
nodes.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.netbeans.api.visual.graph.GraphPinScene
org.netbeans.api.visual.graph.GraphPinScene.StringGraphNested classes/interfaces inherited from class org.netbeans.api.visual.widget.Scene
org.netbeans.api.visual.widget.Scene.SceneListenerNested classes/interfaces inherited from class org.netbeans.api.visual.widget.Widget
org.netbeans.api.visual.widget.Widget.Dependency -
Constructor Summary
ConstructorsConstructorDescriptionCreate a Praxis graph scene.PraxisGraphScene(org.netbeans.api.visual.action.ConnectProvider connectProvider, org.netbeans.api.visual.action.PopupMenuProvider popupProvider) Create a Praxis graph scene with the provided connect and popup menu providers. -
Method Summary
Modifier and TypeMethodDescriptionAdd a node with the given name.Add a pin with the given name to a node.Add a pin with the given name and alignment to a node.Add a pin with the given ID and alignment.voidaddToolWidget(org.netbeans.api.visual.widget.Widget tool) Add a widget to the the scene tools container.protected voidAttaches an anchor of a source pin an edge.protected voidAttaches an anchor of a target pin an edge.protected org.netbeans.api.visual.widget.WidgetattachEdgeWidget(EdgeID<N> edge) Implements attaching a widget to an edge.protected org.netbeans.api.visual.widget.WidgetattachNodeWidget(N node) Implements attaching a widget to a node.protected org.netbeans.api.visual.widget.WidgetattachPinWidget(N node, PinID<N> pin) Implements attaching a widget to a pin.voidClear all widgets from the scene tools container.Add a connection between the given pins.Add a connection between the given pins.protected voiddetachEdgeWidget(EdgeID<N> edge, org.netbeans.api.visual.widget.Widget widget) protected voiddetachNodeWidget(N node, org.netbeans.api.visual.widget.Widget widget) voiddisconnect(N node1, String pin1, N node2, String pin2) Disconnect the given pins.Get the comment text.Get the look and feel scheme.Get the scheme colours.booleanbooleanQuery whether the graph is zoomed out below the level of detail threshold.booleanbooleanQuery whether the graph is using orthogonal routing.voidvoidremoveToolWidget(org.netbeans.api.visual.widget.Widget tool) Remove a widget from the scene tools container.voidsetAnimateChanges(boolean animate) voidsetComment(String comment) Set a comment text to be displayed on the graph.voidsetCommentEditProvider(org.netbeans.api.visual.action.EditProvider provider) Set an edit provider for the scene comment.voidsetMinimizeConnectedPins(boolean minimizeConnected) voidsetOrthogonalRouting(boolean orthogonal) Set whether to use orthogonal routing (as opposed to curved edges).voidsetSchemeColors(LAFScheme.Colors schemeColors) Set the scheme colours.voiduserSelectionSuggested(Set<?> suggestedSelectedObjects, boolean invertSelection) Methods inherited from class org.netbeans.api.visual.graph.GraphPinScene
addEdge, addNode, addPin, detachPinWidget, findEdgesBetween, findPinEdges, getEdges, getEdgeSource, getEdgeTarget, getNodePins, getNodes, getPinNode, getPins, isEdge, isNode, isPin, notifyEdgeAdded, notifyNodeAdded, notifyPinAdded, removeEdge, removeNode, removeNodeWithEdges, removePin, removePinWithEdges, setEdgeSource, setEdgeTargetMethods inherited from class org.netbeans.api.visual.model.ObjectScene
addObject, addObjectSceneListener, clearObjectState, createObjectHoverAction, createSelectAction, findObject, findObjectState, findStoredObject, findWidget, findWidgets, getFocusedObject, getHighlightedObjects, getHoveredObject, getIdentityCode, getObjects, getObjectState, getSelectedObjects, isObject, removeObject, removeObjectMapping, removeObjectSceneListener, setFocusedObject, setHighlightedObjects, setHoveredObject, setSelectedObjectsMethods inherited from class org.netbeans.api.visual.widget.Scene
addSceneListener, convertSceneToView, convertSceneToView, convertViewToScene, convertViewToScene, createBirdView, createSatelliteView, createView, createWidgetHoverAction, getActiveTool, getDefaultFont, getFocusedWidget, getGraphics, getInputBindings, getKeyEventProcessingType, getLookFeel, getMaximumBounds, getPriorActions, getResourceTable, getSceneAnimator, getView, getZoomFactor, isRepaintRequiredForRevalidating, isValidated, paint, removeSceneListener, setActiveTool, setFocusedWidget, setKeyEventProcessingType, setLookFeel, setMaximumBounds, setResourceTable, setZoomFactor, validate, validateMethods inherited from class org.netbeans.api.visual.widget.Widget
addChild, addChild, addChild, addChild, addChildren, addDependency, bringToBack, bringToFront, calculateClientArea, convertLocalToScene, convertLocalToScene, convertSceneToLocal, convertSceneToLocal, createActions, equals, getAccessibleContext, getActions, getActions, getBackground, getBorder, getBounds, getChildConstraint, getChildren, getClientArea, getCursor, getCursorAt, getDependencies, getFont, getForeground, getLayout, getLocation, getLookup, getMaximumSize, getMinimumSize, getParentWidget, getPreferredBounds, getPreferredLocation, getPreferredSize, getScene, getState, getToolTipText, hashCode, isCheckClipping, isEnabled, isHitAt, isOpaque, isPreferredBoundsSet, isVisible, notifyAdded, notifyBackgroundChanged, notifyFontChanged, notifyForegroundChanged, notifyRemoved, notifyStateChanged, paint, paintBackground, paintBorder, paintChildren, paintWidget, removeChild, removeChildren, removeChildren, removeDependency, removeFromParent, repaint, resolveBounds, revalidate, revalidate, setAccessibleContext, setBackground, setBackgroundFromResource, setBorder, setBorder, setCheckClipping, setChildConstraint, setCursor, setEnabled, setFont, setFontFromResource, setForeground, setForegroundFromResource, setLayout, setMaximumSize, setMinimumSize, setOpaque, setPreferredBounds, setPreferredLocation, setPreferredSize, setState, setToolTipText, setVisible, updateResources
-
Constructor Details
-
PraxisGraphScene
public PraxisGraphScene()Create a Praxis graph scene. -
PraxisGraphScene
public PraxisGraphScene(org.netbeans.api.visual.action.ConnectProvider connectProvider, org.netbeans.api.visual.action.PopupMenuProvider popupProvider) Create a Praxis graph scene with the provided connect and popup menu providers.- Parameters:
connectProvider- connect providerpopupProvider- popup menu provider
-
-
Method Details
-
addNode
Add a node with the given name. Returns the node widget for further customization.- Parameters:
node- nodename- name of node- Returns:
- node widget representation
-
addPin
Add a pin with the given name to a node. The pin will be centrally aligned. Returns the pin widget attached to the node widget for further customization.- Parameters:
node- node to add pin toname- name of pin- Returns:
- pin widget representation
-
addPin
Add a pin with the given name and alignment to a node. Returns the pin widget attached to the node widget for further customization.- Parameters:
node- node to add pin toname- name of pinalignment- pin alignment- Returns:
- pin widget representation
-
addPin
Add a pin with the given ID and alignment. Returns the pin widget for further customization.- Parameters:
pin- pin IDalignment- pin alignment- Returns:
- pin widget representation
-
connect
Add a connection between the given pins. Returns the edge widget for further customization.- Parameters:
node1- first nodepin1- first pin namenode2- second nodepin2- second pin name- Returns:
- edge widget representation
-
connect
Add a connection between the given pins. Returns the edge widget for further customization.- Parameters:
p1- first pin IDp2- second pin ID- Returns:
- edge widget representation
-
disconnect
Disconnect the given pins.- Parameters:
node1- first nodepin1- first pin namenode2- second nodepin2- second pin name
-
getLookAndFeel
Get the look and feel scheme.- Returns:
- LAF scheme
-
setSchemeColors
Set the scheme colours.- Parameters:
schemeColors- scheme colours
-
getSchemeColors
Get the scheme colours.- Returns:
- scheme colours
-
setOrthogonalRouting
public void setOrthogonalRouting(boolean orthogonal) Set whether to use orthogonal routing (as opposed to curved edges).- Parameters:
orthogonal- use orthogonal routing
-
isOrthogonalRouting
public boolean isOrthogonalRouting()Query whether the graph is using orthogonal routing.- Returns:
- using orthogonal routing
-
setMinimizeConnectedPins
public void setMinimizeConnectedPins(boolean minimizeConnected) -
isMinimizeConnectedPins
public boolean isMinimizeConnectedPins() -
userSelectionSuggested
- Overrides:
userSelectionSuggestedin classorg.netbeans.api.visual.model.ObjectScene
-
attachNodeWidget
Implements attaching a widget to a node. The widget is NodeWidget and has object-hover, select, popup-menu and move actions. -
attachPinWidget
Implements attaching a widget to a pin. -
attachEdgeWidget
Implements attaching a widget to an edge. -
attachEdgeSourceAnchor
Attaches an anchor of a source pin an edge. The anchor is a ProxyAnchor that switches between the anchor attached to the pin widget directly and the anchor attached to the pin node widget based on the minimize-state of the node. -
attachEdgeTargetAnchor
Attaches an anchor of a target pin an edge. The anchor is a ProxyAnchor that switches between the anchor attached to the pin widget directly and the anchor attached to the pin node widget based on the minimize-state of the node. -
detachNodeWidget
-
detachEdgeWidget
-
isBelowLODThreshold
public boolean isBelowLODThreshold()Query whether the graph is zoomed out below the level of detail threshold. Pins and node names may not be visible below the threshold.- Returns:
- below level of detail threshold
-
setComment
Set a comment text to be displayed on the graph. A null or empty comment will remove the display.- Parameters:
comment- comment text
-
getComment
Get the comment text.- Returns:
- comment text
-
setCommentEditProvider
public void setCommentEditProvider(org.netbeans.api.visual.action.EditProvider provider) Set an edit provider for the scene comment.- Parameters:
provider- scene comment edit provider
-
addToolWidget
public void addToolWidget(org.netbeans.api.visual.widget.Widget tool) Add a widget to the the scene tools container.- Parameters:
tool- tool widget
-
removeToolWidget
public void removeToolWidget(org.netbeans.api.visual.widget.Widget tool) Remove a widget from the scene tools container.- Parameters:
tool- tool widget
-
clearToolWidgets
public void clearToolWidgets()Clear all widgets from the scene tools container. -
layoutScene
public void layoutScene() -
setAnimateChanges
public void setAnimateChanges(boolean animate) -
isAnimateChanges
public boolean isAnimateChanges()
-