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 Type
    Method
    Description
    void
    addToolWidget(org.netbeans.api.visual.widget.Widget tool)
    Add a widget to the the node tools container.
    void
    attachPinWidget(org.netbeans.api.visual.widget.Widget widget)
    Attaches a pin widget to the node widget.
    void
    Clear all widgets from the tools container.
    void
    Collapses the widget.
    void
    Expands the widget.
    Get the comment text.
    org.netbeans.api.visual.widget.Widget
    Returns a header widget.
    org.netbeans.api.visual.widget.Widget
    Returns a minimize button widget.
    Returns a node name.
    org.netbeans.api.visual.widget.LabelWidget
    Returns a node name widget.
     
    boolean
     
    boolean
    Check the minimized state.
    protected void
     
    protected void
     
    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.
    protected void
     
    void
    removeToolWidget(org.netbeans.api.visual.widget.Widget tool)
    Remove a widget from the tools container.
    void
    setComment(String comment)
    Set the widget comment.
    void
    setCommentEditProvider(org.netbeans.api.visual.action.EditProvider provider)
    Set an edit provider for the node comment.
    void
    setGlyphs(List<Image> glyphs)
    Sets node glyphs.
    void
    setMinimized(boolean minimized)
    Set the minimized state.
    void
    Sets a node image.
    void
    setNodeName(String nodeName)
    Sets a node name.
    void
     
    void
    Called when a minimized state is changed.
    void
    Toggles 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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • notifyAdded

      protected void notifyAdded()
      Overrides:
      notifyAdded in class org.netbeans.api.visual.widget.Widget
    • notifyRemoved

      protected void notifyRemoved()
      Overrides:
      notifyRemoved in class org.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:
      stateChanged in interface org.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:
      notifyStateChanged in class org.netbeans.api.visual.widget.Widget
      Parameters:
      previousState - the previous state
      state - the new state
    • setNodeImage

      public void setNodeImage(Image image)
      Sets a node image.
      Parameters:
      image - the image
    • getNodeName

      public String getNodeName()
      Returns a node name.
      Returns:
      the node name
    • setNodeName

      public void setNodeName(String nodeName)
      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

      public void setGlyphs(List<Image> glyphs)
      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:
      collapseWidget in interface MinimizeAbility
    • expandWidget

      public void expandWidget()
      Expands the widget.
      Specified by:
      expandWidget in interface MinimizeAbility
    • 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

      public void setComment(String comment)
      Set the widget comment. If null or empty the comment will be removed.
      Parameters:
      comment - comment text
    • getComment

      public String 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:
      paintChildren in class org.netbeans.api.visual.widget.Widget
    • isBelowLODThreshold

      public boolean isBelowLODThreshold()
    • setSchemeColors

      public void setSchemeColors(LAFScheme.Colors colors)
    • getSchemeColors

      public LAFScheme.Colors getSchemeColors()