Interface GraphListener

All Known Implementing Classes:
GraphAdapter

public interface GraphListener

What a NodeGraph tells an application about. Extend GraphAdapter to implement only what is needed.

Every edit is offered first to the listeners, any of which may refuse it, and then to the model, which may refuse it too.

  • Method Details

    • selectionChanged

      void selectionChanged(NodeGraph graph)
      The selection changed.
    • nodeOpened

      void nodeOpened(NodeGraph graph, GraphNode node)
      A node was double tapped.
    • nodeMoving

      boolean nodeMoving(NodeGraph graph, GraphNode node, double x, double y)

      A node was dragged and is about to be moved to a world position.

      Returns

      false to refuse, which puts it back

    • nodeMoved

      void nodeMoved(NodeGraph graph, GraphNode node)
      A node was moved by the user.
    • edgeCreating

      boolean edgeCreating(NodeGraph graph, GraphNode source, GraphPort sourcePort, GraphNode target, GraphPort targetPort)

      An edge was dragged from a node or port to another and is about to be made. Either port may be null.

      Returns

      false to refuse

    • edgeCreated

      void edgeCreated(NodeGraph graph, GraphEdge edge)
      An edge was made by the user.
    • removing

      boolean removing(NodeGraph graph, GraphNode node, GraphEdge edge)

      A node or an edge is about to be removed by NodeGraph.deleteSelection. Exactly one of the two is not null.

      Returns

      false to refuse

    • groupToggled

      void groupToggled(NodeGraph graph, GraphGroup group)
      A group was collapsed or expanded by a tap on its title.
    • nodeCreating

      boolean nodeCreating(NodeGraph graph, GraphNode node)

      A node is about to be added: dropped from a GraphPalette, pasted or duplicated. The node is already where it will be.

      Returns

      false to refuse

    • nodeCreated

      void nodeCreated(NodeGraph graph, GraphNode node)
      A node was added by the user.
    • nodeResizing

      boolean nodeResizing(NodeGraph graph, GraphNode node, double width, double height)

      A node was dragged by a corner and is about to take a new size, in world units.

      Returns

      false to refuse, which puts it back

    • nodeResized

      void nodeResized(NodeGraph graph, GraphNode node)
      A node was resized by the user.