Interface ConnectorNode

All Known Implementing Classes:
ConnectionLine, StandardConnectionPlug, StandardConnectionSocket

public interface ConnectorNode
Interface for any interactive shape in a ConnectionPane.
Author:
Jamie Macaulay
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The shape is connected to another shape.
    static final int
    The shape is disabled and therefore no connections can be made.
    static final int
    No connection to any other shapes.
    static final int
    No connection to any other shapes.
    static final int
    A possible connection to other shapes.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    boolean
    checkPossibleConnection(boolean notify)
    Check whether a connection has
    Get the connected shape- the shape this shape is connected to.
    Get the connection node the shape is associated with;
    int
    Check if the shape is currently connected to another shape.
    double
    getDistance(javafx.scene.shape.Shape shape)
    Get the distance form the CollisionShape to another shape.
    javafx.geometry.Orientation
    Get the orientation of the shape .
    javafx.scene.shape.Shape
    Get the Shape associated with the Collision shape.
    boolean
    Check whether there is an error in the connection
    void
    Set the connected shape- the shape which this shape is connected to.
    void
    Set the connection status.
    void
    setError(boolean error)
    Set the connection to have an error flag.
  • Field Details Link icon

    • NO_CONNECTION Link icon

      static final int NO_CONNECTION
      No connection to any other shapes.
      See Also:
    • POSSIBLE_CONNECTION Link icon

      static final int POSSIBLE_CONNECTION
      A possible connection to other shapes.
      See Also:
    • CONNECTED Link icon

      static final int CONNECTED
      The shape is connected to another shape.
      See Also:
    • CONNECTION_DISABLED Link icon

      static final int CONNECTION_DISABLED
      The shape is disabled and therefore no connections can be made.
      See Also:
    • CONNECTOR_MOVED Link icon

      static final int CONNECTOR_MOVED
      No connection to any other shapes.
      See Also:
  • Method Details Link icon

    • getDistance Link icon

      double getDistance(javafx.scene.shape.Shape shape)
      Get the distance form the CollisionShape to another shape. Usually this is just the centre point of the shape to the other shape centre, however in some cases might be slightly different e.g. for a line you want the closest point on the line to a shape rather than just the centre of the line.
      Parameters:
      shape - - shape to get distance to.
      Returns:
      the distance in pixels from the CollisionShape to the shape.
    • getShape Link icon

      javafx.scene.shape.Shape getShape()
      Get the Shape associated with the Collision shape.
      Returns:
      the shape
    • setConnectionStatus Link icon

      void setConnectionStatus(int type, ConnectorNode shape)
      Set the connection status.
      Parameters:
      type - - type of connection status,
      shape - - the connected or possibly connected shape. Can be null if NO_CONNECTION FLAG.
    • getConnectionStatus Link icon

      int getConnectionStatus()
      Check if the shape is currently connected to another shape.
      Returns:
      true if the shape is connected to another shape.
    • getOrientation Link icon

      javafx.geometry.Orientation getOrientation()
      Get the orientation of the shape .
      Returns:
      orientation of the shape.
    • setConnectedShape Link icon

      void setConnectedShape(ConnectorNode connecionShape)
      Set the connected shape- the shape which this shape is connected to. null if no shape is connected;
      Parameters:
      connecionShape - - the connected shape. Can be null.
    • getConnectedShape Link icon

      ConnectorNode getConnectedShape()
      Get the connected shape- the shape this shape is connected to. null if shape is not connected to anything;
      Parameters:
      connecionShape - - the connected shape. Can be null.
    • getConnectionNode Link icon

      ConnectionNode getConnectionNode()
      Get the connection node the shape is associated with;
      Returns:
      the connection node the shape is associated with;
    • checkPossibleConnection Link icon

      boolean checkPossibleConnection(boolean notify)
      Check whether a connection has
      Parameters:
      notify -
      Returns:
    • isError Link icon

      boolean isError()
      Check whether there is an error in the connection
      Returns:
      true if error in connection.
    • setError Link icon

      void setError(boolean error)
      Set the connection to have an error flag.
      Parameters:
      error - - true if error in connection