Class VMDGraphScene

All Implemented Interfaces:
Accessible, org.openide.util.Lookup.Provider

public class VMDGraphScene extends GraphPinScene<String,String,String>
This class represents a GraphPinScene for the VMD visualization style. Nodes, edges and pins are represented using String class. The visualization is done by: VMDNodeWidget for nodes, VMDPinWidget for pins, ConnectionWidget fro edges.

The scene has 4 layers: background, main, connection, upper.

The scene has following actions: zoom, panning, rectangular selection.

  • Field Details

  • Constructor Details

    • VMDGraphScene

      public VMDGraphScene()
      Creates a VMD graph scene.
    • VMDGraphScene

      public VMDGraphScene(VMDColorScheme scheme)
      Creates a VMD graph scene with a specific color scheme.
      Parameters:
      scheme - the color scheme
  • Method Details

    • attachNodeWidget

      protected Widget attachNodeWidget(String node)
      Implements attaching a widget to a node. The widget is VMDNodeWidget and has object-hover, select, popup-menu and move actions.
      Specified by:
      attachNodeWidget in class GraphPinScene<String,String,String>
      Parameters:
      node - the node
      Returns:
      the widget attached to the node
    • attachPinWidget

      protected Widget attachPinWidget(String node, String pin)
      Implements attaching a widget to a pin. The widget is VMDPinWidget and has object-hover and select action. The the node id ends with "#default" then the pin is the default pin of a node and therefore it is non-visual.
      Specified by:
      attachPinWidget in class GraphPinScene<String,String,String>
      Parameters:
      node - the node
      pin - the pin
      Returns:
      the widget attached to the pin, null, if it is a default pin
    • attachEdgeWidget

      protected Widget attachEdgeWidget(String edge)
      Implements attaching a widget to an edge. the widget is ConnectionWidget and has object-hover, select and move-control-point actions.
      Specified by:
      attachEdgeWidget in class GraphPinScene<String,String,String>
      Parameters:
      edge - the edge
      Returns:
      the widget attached to the edge
    • attachEdgeSourceAnchor

      protected void attachEdgeSourceAnchor(String edge, String oldSourcePin, String sourcePin)
      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.
      Specified by:
      attachEdgeSourceAnchor in class GraphPinScene<String,String,String>
      Parameters:
      edge - the edge
      oldSourcePin - the old source pin
      sourcePin - the new source pin
    • attachEdgeTargetAnchor

      protected void attachEdgeTargetAnchor(String edge, String oldTargetPin, String targetPin)
      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.
      Specified by:
      attachEdgeTargetAnchor in class GraphPinScene<String,String,String>
      Parameters:
      edge - the edge
      oldTargetPin - the old target pin
      targetPin - the new target pin
    • layoutScene

      public void layoutScene()
      Invokes layout of the scene.