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
adaptableProperties 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected BendArcPolicyReturns theBendCurvePolicythat is installed on thegetTargetPart().protected org.eclipse.gef.mvc.fx.parts.IVisualPart<? extends org.eclipse.gef.fx.nodes.GeometryNode<?>> Determines the targetIVisualPartfor this interaction handler.voiddrag(javafx.scene.input.MouseEvent e, org.eclipse.gef.geometry.planar.Dimension delta) voidendDrag(javafx.scene.input.MouseEvent e, org.eclipse.gef.geometry.planar.Dimension delta) protected BendArcPolicyReturns theBendCurvePolicyto use for manipulating thegetTargetPart().org.eclipse.gef.mvc.fx.parts.AbstractSegmentHandlePart<? extends javafx.scene.Node> getHost()protected org.eclipse.gef.mvc.fx.parts.IVisualPart<? extends javafx.scene.Node> Returns the targetIVisualPartfor this policy that is determined usingdetermineTargetPart()if it is not set, yet.voidprotected booleanisBend(javafx.scene.input.MouseEvent event) Returnstrueif the givenMouseEventshould trigger bend,falseotherwise.protected booleanisPrecise(javafx.scene.input.MouseEvent e) Returnstrueif precise manipulations should be performed for the givenMouseEvent.booleanshowIndicationCursor(javafx.scene.input.KeyEvent event) booleanshowIndicationCursor(javafx.scene.input.MouseEvent event) voidstartDrag(javafx.scene.input.MouseEvent e) protected voidRe-computes the handle parts.Methods inherited from class org.eclipse.gef.mvc.fx.handlers.AbstractHandler
commit, execute, init, isRegistered, isRegisteredForHost, restoreRefreshVisuals, rollback, storeAndDisableRefreshVisualsMethods inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl
adaptableProperty, getAdaptable, setAdaptableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
abortDragin interfaceorg.eclipse.gef.mvc.fx.handlers.IOnDragHandler
-
determineBendPolicy
Returns theBendCurvePolicythat is installed on thegetTargetPart().- Returns:
- The
BendCurvePolicythat is installed on thegetTargetPart().
-
determineTargetPart
protected org.eclipse.gef.mvc.fx.parts.IVisualPart<? extends org.eclipse.gef.fx.nodes.GeometryNode<?>> determineTargetPart()Determines the targetIVisualPartfor this interaction handler. Per default, the first anchorage of thegetHost()is returned.- Returns:
- The target
IVisualPartfor this interaction handler.
-
drag
public void drag(javafx.scene.input.MouseEvent e, org.eclipse.gef.geometry.planar.Dimension delta) - Specified by:
dragin interfaceorg.eclipse.gef.mvc.fx.handlers.IOnDragHandler
-
endDrag
public void endDrag(javafx.scene.input.MouseEvent e, org.eclipse.gef.geometry.planar.Dimension delta) - Specified by:
endDragin interfaceorg.eclipse.gef.mvc.fx.handlers.IOnDragHandler
-
getBendPolicy
Returns theBendCurvePolicyto use for manipulating thegetTargetPart().- Returns:
- The
BendCurvePolicyto use for manipulating thegetTargetPart().
-
getHost
public org.eclipse.gef.mvc.fx.parts.AbstractSegmentHandlePart<? extends javafx.scene.Node> getHost()- Specified by:
getHostin interfaceorg.eclipse.gef.mvc.fx.handlers.IHandler- Overrides:
getHostin classorg.eclipse.gef.mvc.fx.handlers.AbstractHandler
-
getTargetPart
protected org.eclipse.gef.mvc.fx.parts.IVisualPart<? extends javafx.scene.Node> getTargetPart()Returns the targetIVisualPartfor this policy that is determined usingdetermineTargetPart()if it is not set, yet.- Returns:
- The target
IVisualPartfor this policy.
-
hideIndicationCursor
public void hideIndicationCursor()- Specified by:
hideIndicationCursorin interfaceorg.eclipse.gef.mvc.fx.handlers.IOnDragHandler
-
isBend
protected boolean isBend(javafx.scene.input.MouseEvent event) Returnstrueif the givenMouseEventshould trigger bend,falseotherwise. Otherwise returnsfalse. By default will always returntrue.- Parameters:
event- TheMouseEventin question.- Returns:
trueif the givenMouseEventshould trigger bend, otherwisefalse.
-
isPrecise
protected boolean isPrecise(javafx.scene.input.MouseEvent e) Returnstrueif precise manipulations should be performed for the givenMouseEvent. Otherwise returnsfalse.- Parameters:
e- TheMouseEventthat is used to determine if precise manipulations should be performed (i.e. if the corresponding modifier key is pressed).- Returns:
trueif precise manipulations should be performed,falseotherwise.
-
showIndicationCursor
public boolean showIndicationCursor(javafx.scene.input.KeyEvent event) - Specified by:
showIndicationCursorin interfaceorg.eclipse.gef.mvc.fx.handlers.IOnDragHandler
-
showIndicationCursor
public boolean showIndicationCursor(javafx.scene.input.MouseEvent event) - Specified by:
showIndicationCursorin interfaceorg.eclipse.gef.mvc.fx.handlers.IOnDragHandler
-
startDrag
public void startDrag(javafx.scene.input.MouseEvent e) - Specified by:
startDragin interfaceorg.eclipse.gef.mvc.fx.handlers.IOnDragHandler
-
updateHandles
protected void updateHandles()Re-computes the handle parts. Adjusts the host to reflect its new position.
-