Class ConnectionBendpointTracker

  • All Implemented Interfaces:
    DragTracker, RequestConstants, Tool

    public class ConnectionBendpointTracker
    extends SimpleDragTracker
    A tracker for creating new bendpoints or dragging existing ones. The Connection bendpoint tracker is returned by connection bendpoint handles. This tracker will send a BendpointRequest to the connection editpart which originated the tracker. The bendpoint request may be either a request to move an existing bendpoint, or a request to create a new bendpoint.

    A ConnectionBendpointTracker operates on a single connection editpart.

    • Constructor Detail

      • ConnectionBendpointTracker

        protected ConnectionBendpointTracker()
        Null constructor.
      • ConnectionBendpointTracker

        public ConnectionBendpointTracker​(ConnectionEditPart editpart,
                                          int i)
        Constructs a tracker for the given connection and index.
        Parameters:
        editpart - the connection
        i - the index of the bendpoint
    • Method Detail

      • createOperationSet

        protected java.util.List createOperationSet()
        Description copied from class: AbstractTool
        Returns a new List of editparts that this tool is operating on. This method is called once during AbstractTool.getOperationSet(), and its result is cached.

        By default, the operations set is the current viewer's entire selection. Subclasses may override this method to filter or alter the operation set as necessary.

        Overrides:
        createOperationSet in class AbstractTool
        Returns:
        a list of editparts being operated on
        See Also:
        AbstractTool.createOperationSet()
      • getCommandName

        protected java.lang.String getCommandName()
        Description copied from class: AbstractTool
        Returns the identifier of the command that is being sought. This name is also the named that will be logged in the debug view.
        Specified by:
        getCommandName in class AbstractTool
        Returns:
        the identifier for the command
        See Also:
        AbstractTool.getCommandName()
      • getConnection

        protected org.eclipse.draw2d.Connection getConnection()
        Convenience method to obtain the connection editpart's connection figure.
        Returns:
        the connection figure
      • getConnectionEditPart

        protected ConnectionEditPart getConnectionEditPart()
        Returns the connection editpart on which the tracker operates.
        Returns:
        the connection editpart
      • getIndex

        protected int getIndex()
        Returns the index of the bendpoint being dragged or created.
        Returns:
        the index
      • setConnectionEditPart

        public void setConnectionEditPart​(ConnectionEditPart cep)
        Sets the connection editpart being operated on.
        Parameters:
        cep - the connection
      • setIndex

        public void setIndex​(int i)
        Sets the index of the operation.
        Parameters:
        i - the index
      • setType

        public void setType​(java.lang.Object type)
        Sets the type of bendpoint drag being performed.
        Parameters:
        type - the drag type
        See Also:
        getType()