public class FXRotateTool extends AbstractTool<javafx.scene.Node>
ITool
to handle rotate interaction gestures.
During each rotate interaction, the tool identifies an IVisualPart
that serves as interaction target. It is identified via hit-testing on the
visuals and the availability of a corresponding
AbstractFXOnRotatePolicy
(see getTargetPart(IViewer, Node)
).
The FXRotateTool
handles the opening and closing of an transaction
operation via the FXDomain
, to which it is adapted. It controls that
a single transaction operation is used for the complete interaction , so all
interaction results can be undone in a single undo step.
Modifier and Type | Field and Description |
---|---|
static java.lang.Class<AbstractFXOnRotatePolicy> |
TOOL_POLICY_KEY
The type of the policy that has to be supported by target parts.
|
pcs
ACTIVE_PROPERTY
Constructor and Description |
---|
FXRotateTool() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Set<? extends AbstractFXOnRotatePolicy> |
getRotatePolicies(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> targetPart)
Returns a
Set containing all AbstractFXOnRotatePolicy s
that are installed on the given target IVisualPart . |
protected IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> |
getTargetPart(IViewer<javafx.scene.Node> viewer,
javafx.scene.Node target)
Returns the target
IVisualPart within the given IViewer
for the given target Node that received the input event. |
protected java.util.Set<? extends AbstractFXOnRotatePolicy> |
getTargetPolicies(IViewer<javafx.scene.Node> viewer,
javafx.scene.input.RotateEvent e)
Returns a
Set containing all AbstractFXOnRotatePolicy s
that are installed on the target IVisualPart for the given
RotateEvent . |
protected void |
registerListeners()
This method is called when a valid
IDomain is attached to this
tool so that you can register event listeners for various inputs
(keyboard, mouse) or model changes (selection, scroll offset / viewport). |
protected void |
unregisterListeners()
This method is called when the attached
IDomain is reset to
null so that you can unregister previously registered event
listeners. |
activate, addPropertyChangeListener, deactivate, getAdaptable, getDomain, isActive, removePropertyChangeListener, setAdaptable
public static final java.lang.Class<AbstractFXOnRotatePolicy> TOOL_POLICY_KEY
protected java.util.Set<? extends AbstractFXOnRotatePolicy> getRotatePolicies(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> targetPart)
Set
containing all AbstractFXOnRotatePolicy
s
that are installed on the given target IVisualPart
.targetPart
- The target IVisualPart
of which the
AbstractFXOnRotatePolicy
s are returned.Set
containing all AbstractFXOnRotatePolicy
s
that are installed on the given target IVisualPart
.protected IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> getTargetPart(IViewer<javafx.scene.Node> viewer, javafx.scene.Node target)
IVisualPart
within the given IViewer
for the given target Node
that received the input event.viewer
- The IViewer
in which a target IVisualPart
is
searched.target
- The target Node
that received the input event.IVisualPart
.protected java.util.Set<? extends AbstractFXOnRotatePolicy> getTargetPolicies(IViewer<javafx.scene.Node> viewer, javafx.scene.input.RotateEvent e)
Set
containing all AbstractFXOnRotatePolicy
s
that are installed on the target IVisualPart
for the given
RotateEvent
. The target IVisualPart
is determined using
getTargetPart(IViewer, Node)
.viewer
- The IViewer
in which the input event occured.e
- The input RotateEvent
.Set
containing all AbstractFXOnRotatePolicy
s
that are installed on the target IVisualPart
for the
given input event.protected void registerListeners()
AbstractTool
IDomain
is attached to this
tool so that you can register event listeners for various inputs
(keyboard, mouse) or model changes (selection, scroll offset / viewport).registerListeners
in class AbstractTool<javafx.scene.Node>
protected void unregisterListeners()
AbstractTool
IDomain
is reset to
null
so that you can unregister previously registered event
listeners.unregisterListeners
in class AbstractTool<javafx.scene.Node>
Copyright (c) 2014 itemis AG and others. All rights reserved.