public class FXPinchSpreadTool extends AbstractTool<javafx.scene.Node>
ITool
to handle pinch/spread (zoom) interaction gestures.
During each pinch/spread 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
AbstractFXOnPinchSpreadPolicy
(see
getTargetPart(IViewer, Node)
).
The FXPinchSpreadTool
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<AbstractFXOnPinchSpreadPolicy> |
TOOL_POLICY_KEY
The type of the policy that has to be supported by target parts.
|
pcs
ACTIVE_PROPERTY
Constructor and Description |
---|
FXPinchSpreadTool() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Set<? extends AbstractFXOnPinchSpreadPolicy> |
getPinchSpreadPolicies(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> targetPart)
Returns a
Set containing all
AbstractFXOnPinchSpreadPolicy 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)
|
protected java.util.Set<? extends AbstractFXOnPinchSpreadPolicy> |
getTargetPolicies(IViewer<javafx.scene.Node> viewer,
javafx.scene.input.ZoomEvent e)
Returns a
Set containing all
AbstractFXOnPinchSpreadPolicy s that are supported by the target
IVisualPart for the given ZoomEvent . |
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<AbstractFXOnPinchSpreadPolicy> TOOL_POLICY_KEY
protected java.util.Set<? extends AbstractFXOnPinchSpreadPolicy> getPinchSpreadPolicies(IVisualPart<javafx.scene.Node,? extends javafx.scene.Node> targetPart)
Set
containing all
AbstractFXOnPinchSpreadPolicy
s that are installed on the given
target IVisualPart
.targetPart
- The target IVisualPart
of which the installed
AbstractFXOnPinchSpreadPolicy
s are returned.Set
containing all
AbstractFXOnPinchSpreadPolicy
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)
viewer
- The IViewer
which is searched for the target
IVisualPart
.target
- The target Node
that received the input event.IVisualPart
that was determined.protected java.util.Set<? extends AbstractFXOnPinchSpreadPolicy> getTargetPolicies(IViewer<javafx.scene.Node> viewer, javafx.scene.input.ZoomEvent e)
Set
containing all
AbstractFXOnPinchSpreadPolicy
s that are supported by the target
IVisualPart
for the given ZoomEvent
.viewer
- The IViewer
that is searched for a target
IVisualPart
.e
- The ZoomEvent
that has to be transfered.Set
containing all
AbstractFXOnPinchSpreadPolicy
s that are supported by the
target IVisualPart
for the given ZoomEvent
.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.