Class NodeWidget
java.lang.Object
org.netbeans.api.visual.widget.Widget
org.praxislive.ide.pxr.graph.scene.NodeWidget
- All Implemented Interfaces:
Accessible,org.netbeans.api.visual.model.StateModel.Listener,org.openide.util.Lookup.Provider,MinimizeAbility
public class NodeWidget
extends org.netbeans.api.visual.widget.Widget
implements org.netbeans.api.visual.model.StateModel.Listener, MinimizeAbility
Node widget within a
PraxisGraphScene.-
Nested Class Summary
Nested classes/interfaces inherited from class org.netbeans.api.visual.widget.Widget
org.netbeans.api.visual.widget.Widget.Dependency -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToolWidget(org.netbeans.api.visual.widget.Widget tool) Add a widget to the the node tools container.voidattachPinWidget(org.netbeans.api.visual.widget.Widget widget) Attaches a pin widget to the node widget.voidClear all widgets from the tools container.voidCollapses the widget.voidExpands the widget.Get the comment text.org.netbeans.api.visual.widget.WidgetReturns a header widget.org.netbeans.api.visual.widget.WidgetReturns a minimize button widget.Returns a node name.org.netbeans.api.visual.widget.LabelWidgetReturns a node name widget.booleanbooleanCheck the minimized state.protected voidprotected voidprotected voidnotifyStateChanged(org.netbeans.api.visual.model.ObjectState previousState, org.netbeans.api.visual.model.ObjectState state) Called to notify about the change of the widget state.protected voidvoidremoveToolWidget(org.netbeans.api.visual.widget.Widget tool) Remove a widget from the tools container.voidsetComment(String comment) Set the widget comment.voidsetCommentEditProvider(org.netbeans.api.visual.action.EditProvider provider) Set an edit provider for the node comment.voidSets node glyphs.voidsetMinimized(boolean minimized) Set the minimized state.voidsetNodeImage(Image image) Sets a node image.voidsetNodeName(String nodeName) Sets a node name.voidsetSchemeColors(LAFScheme.Colors colors) voidCalled when a minimized state is changed.voidToggles the minimized state.Methods 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, getGraphics, getLayout, getLocation, getLookup, getMaximumSize, getMinimumSize, getParentWidget, getPreferredBounds, getPreferredLocation, getPreferredSize, getResourceTable, getScene, getState, getToolTipText, hashCode, isCheckClipping, isEnabled, isHitAt, isOpaque, isPreferredBoundsSet, isRepaintRequiredForRevalidating, isValidated, isVisible, notifyBackgroundChanged, notifyFontChanged, notifyForegroundChanged, paint, paintBackground, paintBorder, 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, setResourceTable, setState, setToolTipText, setVisible, updateResources
-
Method Details
-
notifyAdded
protected void notifyAdded()- Overrides:
notifyAddedin classorg.netbeans.api.visual.widget.Widget
-
notifyRemoved
protected void notifyRemoved()- Overrides:
notifyRemovedin classorg.netbeans.api.visual.widget.Widget
-
isMinimized
public boolean isMinimized()Check the minimized state.- Returns:
- true, if minimized
-
setMinimized
public void setMinimized(boolean minimized) Set the minimized state. This method will show/hide child widgets of this Widget and switches anchors between node and pin widgets.- Parameters:
minimized- if true, then the widget is going to be minimized
-
toggleMinimized
public void toggleMinimized()Toggles the minimized state. This method will show/hide child widgets of this Widget and switches anchors between node and pin widgets. -
stateChanged
public void stateChanged()Called when a minimized state is changed. This method will show/hide child widgets of this Widget and switches anchors between node and pin widgets.- Specified by:
stateChangedin interfaceorg.netbeans.api.visual.model.StateModel.Listener
-
notifyStateChanged
protected void notifyStateChanged(org.netbeans.api.visual.model.ObjectState previousState, org.netbeans.api.visual.model.ObjectState state) Called to notify about the change of the widget state.- Overrides:
notifyStateChangedin classorg.netbeans.api.visual.widget.Widget- Parameters:
previousState- the previous statestate- the new state
-
setNodeImage
Sets a node image.- Parameters:
image- the image
-
getNodeName
Returns a node name.- Returns:
- the node name
-
setNodeName
Sets a node name.- Parameters:
nodeName- the node name
-
attachPinWidget
public void attachPinWidget(org.netbeans.api.visual.widget.Widget widget) Attaches a pin widget to the node widget.- Parameters:
widget- the pin widget
-
setGlyphs
Sets node glyphs.- Parameters:
glyphs- the list of images
-
getNodeNameWidget
public org.netbeans.api.visual.widget.LabelWidget getNodeNameWidget()Returns a node name widget.- Returns:
- the node name widget
-
collapseWidget
public void collapseWidget()Collapses the widget.- Specified by:
collapseWidgetin interfaceMinimizeAbility
-
expandWidget
public void expandWidget()Expands the widget.- Specified by:
expandWidgetin interfaceMinimizeAbility
-
getHeader
public org.netbeans.api.visual.widget.Widget getHeader()Returns a header widget.- Returns:
- the header widget
-
getMinimizeButton
public org.netbeans.api.visual.widget.Widget getMinimizeButton()Returns a minimize button widget.- Returns:
- the minimize button widget
-
setComment
Set the widget comment. If null or empty the comment will be removed.- 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 node comment.- Parameters:
provider- comment edit provider
-
addToolWidget
public void addToolWidget(org.netbeans.api.visual.widget.Widget tool) Add a widget to the the node tools container.- Parameters:
tool- tool widget
-
removeToolWidget
public void removeToolWidget(org.netbeans.api.visual.widget.Widget tool) Remove a widget from the tools container.- Parameters:
tool- tool widget
-
clearToolWidgets
public void clearToolWidgets()Clear all widgets from the tools container. -
paintChildren
protected void paintChildren()- Overrides:
paintChildrenin classorg.netbeans.api.visual.widget.Widget
-
isBelowLODThreshold
public boolean isBelowLODThreshold() -
setSchemeColors
-
getSchemeColors
-