Class BendFirstAnchorageOnArcHandleDragHandler

java.lang.Object
org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl<org.eclipse.gef.mvc.fx.parts.IVisualPart<? extends javafx.scene.Node>>
org.eclipse.gef.mvc.fx.handlers.AbstractHandler
com.amalgamasimulation.graphicaleditor.handlers.BendFirstAnchorageOnArcHandleDragHandler
All Implemented Interfaces:
org.eclipse.gef.common.adapt.IAdaptable.Bound<org.eclipse.gef.mvc.fx.parts.IVisualPart<? extends javafx.scene.Node>>, org.eclipse.gef.mvc.fx.handlers.IHandler, org.eclipse.gef.mvc.fx.handlers.IOnDragHandler

public class BendFirstAnchorageOnArcHandleDragHandler extends org.eclipse.gef.mvc.fx.handlers.AbstractHandler implements org.eclipse.gef.mvc.fx.handlers.IOnDragHandler
The BendFirstAnchorageOnSegmentHandleDragHandlerEx is an IOnDragHandler that can be installed on the handle parts of an Connection, so that the user is able to manipulate that connection by dragging its handles. This policy expects that a handle is created for each anchor point of the connection (start, way, end), as well as for each middle point of a segment. Moreover, this policy expects that the respective handles are of type CircleSegmentHandlePart.
Author:
mwienand, anyssen
  • Property Summary

    Properties inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl

    adaptable

    Properties inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

    adaptable
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

    org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl<T extends org.eclipse.gef.common.adapt.IAdaptable>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    protected BendArcPolicy
    Returns the BendCurvePolicy that is installed on the getTargetPart().
    protected org.eclipse.gef.mvc.fx.parts.IVisualPart<? extends org.eclipse.gef.fx.nodes.GeometryNode<?>>
    Determines the target IVisualPart for this interaction handler.
    void
    drag(javafx.scene.input.MouseEvent e, org.eclipse.gef.geometry.planar.Dimension delta)
     
    void
    endDrag(javafx.scene.input.MouseEvent e, org.eclipse.gef.geometry.planar.Dimension delta)
     
    protected BendArcPolicy
    Returns the BendCurvePolicy to use for manipulating the getTargetPart().
    org.eclipse.gef.mvc.fx.parts.AbstractSegmentHandlePart<? extends javafx.scene.Node>
     
    protected org.eclipse.gef.mvc.fx.parts.IVisualPart<? extends javafx.scene.Node>
    Returns the target IVisualPart for this policy that is determined using determineTargetPart() if it is not set, yet.
    void
     
    protected boolean
    isBend(javafx.scene.input.MouseEvent event)
    Returns true if the given MouseEvent should trigger bend, false otherwise.
    protected boolean
    isPrecise(javafx.scene.input.MouseEvent e)
    Returns true if precise manipulations should be performed for the given MouseEvent.
    boolean
    showIndicationCursor(javafx.scene.input.KeyEvent event)
     
    boolean
    showIndicationCursor(javafx.scene.input.MouseEvent event)
     
    void
    startDrag(javafx.scene.input.MouseEvent e)
     
    protected void
    Re-computes the handle parts.

    Methods inherited from class org.eclipse.gef.mvc.fx.handlers.AbstractHandler

    commit, execute, init, isRegistered, isRegisteredForHost, restoreRefreshVisuals, rollback, storeAndDisableRefreshVisuals

    Methods inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl

    adaptableProperty, getAdaptable, setAdaptable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

    adaptableProperty, getAdaptable, setAdaptable
  • Constructor Details

    • BendFirstAnchorageOnArcHandleDragHandler

      public BendFirstAnchorageOnArcHandleDragHandler()
  • Method Details

    • abortDrag

      public void abortDrag()
      Specified by:
      abortDrag in interface org.eclipse.gef.mvc.fx.handlers.IOnDragHandler
    • determineBendPolicy

      protected BendArcPolicy determineBendPolicy()
      Returns the BendCurvePolicy that is installed on the getTargetPart().
      Returns:
      The BendCurvePolicy that is installed on the getTargetPart().
    • determineTargetPart

      protected org.eclipse.gef.mvc.fx.parts.IVisualPart<? extends org.eclipse.gef.fx.nodes.GeometryNode<?>> determineTargetPart()
      Determines the target IVisualPart for this interaction handler. Per default, the first anchorage of the getHost() is returned.
      Returns:
      The target IVisualPart for this interaction handler.
    • drag

      public void drag(javafx.scene.input.MouseEvent e, org.eclipse.gef.geometry.planar.Dimension delta)
      Specified by:
      drag in interface org.eclipse.gef.mvc.fx.handlers.IOnDragHandler
    • endDrag

      public void endDrag(javafx.scene.input.MouseEvent e, org.eclipse.gef.geometry.planar.Dimension delta)
      Specified by:
      endDrag in interface org.eclipse.gef.mvc.fx.handlers.IOnDragHandler
    • getBendPolicy

      protected BendArcPolicy getBendPolicy()
      Returns the BendCurvePolicy to use for manipulating the getTargetPart().
      Returns:
      The BendCurvePolicy to use for manipulating the getTargetPart().
    • getHost

      public org.eclipse.gef.mvc.fx.parts.AbstractSegmentHandlePart<? extends javafx.scene.Node> getHost()
      Specified by:
      getHost in interface org.eclipse.gef.mvc.fx.handlers.IHandler
      Overrides:
      getHost in class org.eclipse.gef.mvc.fx.handlers.AbstractHandler
    • getTargetPart

      protected org.eclipse.gef.mvc.fx.parts.IVisualPart<? extends javafx.scene.Node> getTargetPart()
      Returns the target IVisualPart for this policy that is determined using determineTargetPart() if it is not set, yet.
      Returns:
      The target IVisualPart for this policy.
    • hideIndicationCursor

      public void hideIndicationCursor()
      Specified by:
      hideIndicationCursor in interface org.eclipse.gef.mvc.fx.handlers.IOnDragHandler
    • isBend

      protected boolean isBend(javafx.scene.input.MouseEvent event)
      Returns true if the given MouseEvent should trigger bend, false otherwise. Otherwise returns false . By default will always return true.
      Parameters:
      event - The MouseEvent in question.
      Returns:
      true if the given MouseEvent should trigger bend, otherwise false.
    • isPrecise

      protected boolean isPrecise(javafx.scene.input.MouseEvent e)
      Returns true if precise manipulations should be performed for the given MouseEvent. Otherwise returns false.
      Parameters:
      e - The MouseEvent that is used to determine if precise manipulations should be performed (i.e. if the corresponding modifier key is pressed).
      Returns:
      true if precise manipulations should be performed, false otherwise.
    • showIndicationCursor

      public boolean showIndicationCursor(javafx.scene.input.KeyEvent event)
      Specified by:
      showIndicationCursor in interface org.eclipse.gef.mvc.fx.handlers.IOnDragHandler
    • showIndicationCursor

      public boolean showIndicationCursor(javafx.scene.input.MouseEvent event)
      Specified by:
      showIndicationCursor in interface org.eclipse.gef.mvc.fx.handlers.IOnDragHandler
    • startDrag

      public void startDrag(javafx.scene.input.MouseEvent e)
      Specified by:
      startDrag in interface org.eclipse.gef.mvc.fx.handlers.IOnDragHandler
    • updateHandles

      protected void updateHandles()
      Re-computes the handle parts. Adjusts the host to reflect its new position.