public class FXRotateSelectedOnHandleDragPolicy extends AbstractFXInteractionPolicy implements IFXOnDragPolicy
FXRotateSelectedOnHandleDragPolicy
is an IFXOnDragPolicy
that rotates the whole selection
when a selection
handle is dragged.adaptable
adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
Constructor and Description |
---|
FXRotateSelectedOnHandleDragPolicy() |
Modifier and Type | Method and Description |
---|---|
protected Angle |
computeRotationAngleCW(javafx.scene.input.MouseEvent e,
IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> part)
Computes the clock-wise rotation angle based on the initial mouse
position and the actual mouse position.
|
protected javafx.scene.ImageCursor |
createRotateCursor()
Returns the
Cursor that is shown to indicate that this policy
will perform a rotation. |
protected java.util.List<IContentPart<javafx.scene.Node,? extends javafx.scene.Node>> |
determineTargetParts()
Returns a
List containing the whole selection . |
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 CursorSupport |
getCursorSupport()
Returns the
CursorSupport of this policy. |
protected javafx.scene.Cursor |
getRotateCursor()
Returns the
Cursor that indicates rotation. |
protected java.util.List<IContentPart<javafx.scene.Node,? extends javafx.scene.Node>> |
getTargetParts()
Returns the target parts of this policy.
|
protected FXTransformPolicy |
getTransformPolicy(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> part)
Returns the
FXTransformPolicy that is installed on the given
IVisualPart . |
void |
hideIndicationCursor()
Restores the original mouse cursor when it was previously changed by a
call to
IFXOnDragPolicy.showIndicationCursor(KeyEvent) or
IFXOnDragPolicy.showIndicationCursor(MouseEvent) . |
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.
|
protected boolean |
showIndicationCursor(boolean isControlDown)
If the given flag isControlDown is
true , then the
mouse cursor is changed to a rotate cursor. |
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. |
isRegistered, isRegisteredForHost
commit, init, restoreRefreshVisuals, rollback, storeAndDisableRefreshVisuals
adaptableProperty, getAdaptable, getHost, setAdaptable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adaptableProperty, getAdaptable, setAdaptable
protected Angle computeRotationAngleCW(javafx.scene.input.MouseEvent e, IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> part)
e
- The latest MouseEvent
.part
- The IVisualPart
that is rotated.protected javafx.scene.ImageCursor createRotateCursor()
Cursor
that is shown to indicate that this policy
will perform a rotation.Cursor
that is shown to indicate that this policy
will perform a rotation.protected java.util.List<IContentPart<javafx.scene.Node,? extends javafx.scene.Node>> determineTargetParts()
List
containing the whole selection
.List
containing the whole selection
.public void drag(javafx.scene.input.MouseEvent e, Dimension delta)
IFXOnDragPolicy
drag
in interface IFXOnDragPolicy
e
- The original MouseEvent
.delta
- The mouse offset since IFXOnDragPolicy.press(MouseEvent)
(in pixel).public void dragAborted()
IFXOnDragPolicy
dragAborted
in interface IFXOnDragPolicy
protected CursorSupport getCursorSupport()
CursorSupport
of this policy.CursorSupport
of this policy.protected javafx.scene.Cursor getRotateCursor()
Cursor
that indicates rotation. Delegates to
createRotateCursor()
to create that cursor if it was not created
yet.Cursor
that indicates rotation.protected java.util.List<IContentPart<javafx.scene.Node,? extends javafx.scene.Node>> getTargetParts()
protected FXTransformPolicy getTransformPolicy(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> part)
FXTransformPolicy
that is installed on the given
IVisualPart
.part
- The IVisualPart
of which the FXTransformPolicy
is returned.FXTransformPolicy
that is installed on the given
IVisualPart
.public void hideIndicationCursor()
IFXOnDragPolicy
IFXOnDragPolicy.showIndicationCursor(KeyEvent)
or
IFXOnDragPolicy.showIndicationCursor(MouseEvent)
.hideIndicationCursor
in interface IFXOnDragPolicy
public void press(javafx.scene.input.MouseEvent e)
IFXOnDragPolicy
press
in interface IFXOnDragPolicy
e
- The original MouseEvent
public void release(javafx.scene.input.MouseEvent e, Dimension delta)
IFXOnDragPolicy
release
in interface IFXOnDragPolicy
e
- The original MouseEvent
.delta
- The mouse offset since IFXOnDragPolicy.press(MouseEvent)
(in pixel).protected boolean showIndicationCursor(boolean isControlDown)
true
, then the
mouse cursor is changed to a rotate cursor. Otherwise, the mouse cursor
is not changed. Returns true
if the mouse cursor was
changed. Otherwise returns false
.isControlDown
- Flag to indicate if the control modifier key is pressed.true
if the mouse cursor was changed, otherwise
false
.public boolean showIndicationCursor(javafx.scene.input.KeyEvent event)
IFXOnDragPolicy
KeyEvent
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 IFXOnDragPolicy
event
- 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)
IFXOnDragPolicy
MouseEvent
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 IFXOnDragPolicy
event
- The MouseEvent
that initiated the determination of an
indication cursor.true
if the mouse cursor was changed, otherwise
false
.Copyright (c) 2014 itemis AG and others. All rights reserved.