public class FXResizeTranslateFirstAnchorageOnHandleDragPolicy extends AbstractFXInteractionPolicy implements IFXOnDragPolicy
FXResizeTranslateFirstAnchorageOnHandleDragPolicy
is an
IFXOnDragPolicy
that handles the resize and relocation of its
(selected) first anchorage when an AbstractFXSegmentHandlePart
of the
box selection of the first anchorage is dragged with the mouse.adaptable
adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
Constructor and Description |
---|
FXResizeTranslateFirstAnchorageOnHandleDragPolicy() |
Modifier and Type | Method and Description |
---|---|
protected IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> |
determineTargetPart()
Returns the target
IVisualPart for this policy. |
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. |
AbstractFXSegmentHandlePart<? extends javafx.scene.Node> |
getHost()
|
protected FXResizePolicy |
getResizePolicy()
Returns the
FXResizePolicy that is installed on the
getTargetPart() . |
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 javafx.scene.Node> |
getTargetPart()
Returns the target part of this policy.
|
protected FXTransformPolicy |
getTransformPolicy()
Returns the
FXTransformPolicy that is installed on the
getTargetPart() . |
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 |
isResizeTranslate(javafx.scene.input.MouseEvent event)
Returns
true if the given MouseEvent should trigger
resize and translate. |
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 void |
setTargetPart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> determinedTargetPart)
Sets the target part (i.e. the part that is resized and translated) of
this policy to the given value.
|
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, setAdaptable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adaptableProperty, getAdaptable, setAdaptable
public FXResizeTranslateFirstAnchorageOnHandleDragPolicy()
protected IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> determineTargetPart()
IVisualPart
for this policy. Per default the
first anchorage is returned.IVisualPart
for this policy.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.public AbstractFXSegmentHandlePart<? extends javafx.scene.Node> getHost()
IPolicy
getHost
in interface IPolicy<javafx.scene.Node>
getHost
in class AbstractPolicy<javafx.scene.Node>
IPolicy
.protected FXResizePolicy getResizePolicy()
FXResizePolicy
that is installed on the
getTargetPart()
.FXResizePolicy
that is installed on the
getTargetPart()
.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 javafx.scene.Node> getTargetPart()
protected FXTransformPolicy getTransformPolicy()
FXTransformPolicy
that is installed on the
getTargetPart()
.FXTransformPolicy
that is installed on the
getTargetPart()
.public void hideIndicationCursor()
IFXOnDragPolicy
IFXOnDragPolicy.showIndicationCursor(KeyEvent)
or
IFXOnDragPolicy.showIndicationCursor(MouseEvent)
.hideIndicationCursor
in interface IFXOnDragPolicy
protected boolean isResizeTranslate(javafx.scene.input.MouseEvent event)
true
if the given MouseEvent
should trigger
resize and translate. Otherwise returns false
. Per default
returns true
if <Control>
is not pressed
and there is not more than single anchorage.event
- The MouseEvent
in question.true
if the given MouseEvent
should trigger
resize and translate, otherwise false
.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 void setTargetPart(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> determinedTargetPart)
determinedTargetPart
- The target part of this policy.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.