public class FXBendFirstAnchorageOnSegmentHandleDragPolicy extends AbstractFXInteractionPolicy implements IFXOnDragPolicy
FXBendFirstAnchorageOnSegmentHandleDragPolicy is an
IFXOnDragPolicy 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 FXCircleSegmentHandlePart.adaptableadaptableIAdaptable.Bound.Impl<T extends IAdaptable>| Constructor and Description |
|---|
FXBendFirstAnchorageOnSegmentHandleDragPolicy() |
| Modifier and Type | Method and Description |
|---|---|
void |
drag(javafx.scene.input.MouseEvent e,
Dimension delta)
This callback method is invoked when the mouse is moved while a button is
pressed.
|
void |
dragAborted()
This callback method is invoked when the mouse drag gesture is aborted,
i.e. the gesture ends unexpectedly, without a mouse release event being
fired.
|
protected FXBendConnectionPolicy |
getBendPolicy(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> targetPart)
Returns the
FXBendConnectionPolicy that is installed on the given
IVisualPart. |
protected CursorSupport |
getCursorSupport()
Returns the
CursorSupport of this policy. |
AbstractFXSegmentHandlePart<? extends javafx.scene.Node> |
getHost()
|
protected double |
getSnapToGridGranularityX()
Returns the horizontal granularity for "snap-to-grid" where
1 means it will snap to integer grid positions. |
protected double |
getSnapToGridGranularityY()
Returns the vertical granularity for "snap-to-grid" where
1
means it will snap to integer grid positions. |
protected IVisualPart<javafx.scene.Node,? extends Connection> |
getTargetPart()
Returns the target
IVisualPart for this policy. |
void |
hideIndicationCursor()
Restores the original mouse cursor when it was previously changed by a
call to
IFXOnDragPolicy.showIndicationCursor(KeyEvent) or
IFXOnDragPolicy.showIndicationCursor(MouseEvent). |
protected boolean |
isBend(javafx.scene.input.MouseEvent event)
Returns
true if the given MouseEvent should trigger
bend, false otherwise. |
void |
press(javafx.scene.input.MouseEvent e)
This callback method is invoked when a mouse button is pressed on the
host, which starts a mouse drag gesture.
|
void |
release(javafx.scene.input.MouseEvent e,
Dimension delta)
This callback method is invoked when the initially pressed mouse button
is released, which ends the gesture.
|
boolean |
showIndicationCursor(javafx.scene.input.KeyEvent event)
Changes the mouse cursor depending on the given
KeyEvent to
indicate the action that is performed by this policy. |
boolean |
showIndicationCursor(javafx.scene.input.MouseEvent event)
Changes the mouse cursor depending on the given
MouseEvent to
indicate the action that is performed by this policy. |
protected void |
updateHandles()
Re-computes the handle parts.
|
isRegistered, isRegisteredForHostcommit, init, restoreRefreshVisuals, rollback, storeAndDisableRefreshVisualsadaptableProperty, getAdaptable, setAdaptableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadaptableProperty, getAdaptable, setAdaptablepublic FXBendFirstAnchorageOnSegmentHandleDragPolicy()
public void drag(javafx.scene.input.MouseEvent e,
Dimension delta)
IFXOnDragPolicydrag in interface IFXOnDragPolicye - The original MouseEvent.delta - The mouse offset since IFXOnDragPolicy.press(MouseEvent) (in pixel).public void dragAborted()
IFXOnDragPolicydragAborted in interface IFXOnDragPolicyprotected FXBendConnectionPolicy getBendPolicy(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> targetPart)
FXBendConnectionPolicy that is installed on the given
IVisualPart.targetPart - The IVisualPart of which the installed
FXBendConnectionPolicy is returned.FXBendConnectionPolicy that is installed on the given
IVisualPart.protected CursorSupport getCursorSupport()
CursorSupport of this policy.CursorSupport of this policy.public AbstractFXSegmentHandlePart<? extends javafx.scene.Node> getHost()
IPolicygetHost in interface IPolicy<javafx.scene.Node>getHost in class AbstractPolicy<javafx.scene.Node>IPolicy.protected double getSnapToGridGranularityX()
1 means it will snap to integer grid positions.protected double getSnapToGridGranularityY()
1
means it will snap to integer grid positions.protected IVisualPart<javafx.scene.Node,? extends Connection> getTargetPart()
IVisualPart for this policy. Per default the
first anchorage is returned, which has to be an IVisualPart with
an Connection visual.IVisualPart for this policy.public void hideIndicationCursor()
IFXOnDragPolicyIFXOnDragPolicy.showIndicationCursor(KeyEvent) or
IFXOnDragPolicy.showIndicationCursor(MouseEvent).hideIndicationCursor in interface IFXOnDragPolicyprotected boolean isBend(javafx.scene.input.MouseEvent event)
true if the given MouseEvent should trigger
bend, false otherwise. Otherwise returns false
. By default will always return true.event - The MouseEvent in question.true if the given MouseEvent should trigger
bend, otherwise false.public void press(javafx.scene.input.MouseEvent e)
IFXOnDragPolicypress in interface IFXOnDragPolicye - The original MouseEventpublic void release(javafx.scene.input.MouseEvent e,
Dimension delta)
IFXOnDragPolicyrelease in interface IFXOnDragPolicye - The original MouseEvent.delta - The mouse offset since IFXOnDragPolicy.press(MouseEvent) (in pixel).public boolean showIndicationCursor(javafx.scene.input.KeyEvent event)
IFXOnDragPolicyKeyEvent to
indicate the action that is performed by this policy. The return value
indicates if the mouse cursor was changed or not.showIndicationCursor in interface IFXOnDragPolicyevent - The KeyEvent that initiated the determination of an
indication cursor.true if the mouse cursor was changed, otherwise
false.public boolean showIndicationCursor(javafx.scene.input.MouseEvent event)
IFXOnDragPolicyMouseEvent to
indicate the action that is performed by this policy. The return value
indicates if the mouse cursor was changed or not.showIndicationCursor in interface IFXOnDragPolicyevent - The MouseEvent that initiated the determination of an
indication cursor.true if the mouse cursor was changed, otherwise
false.protected void updateHandles()
Copyright (c) 2014 itemis AG and others. All rights reserved.