public class FXChangeViewportPolicy extends AbstractPolicy<javafx.scene.Node> implements ITransactional
IPolicy to change the viewport of an IViewer
via its attached ViewportModel. The ViewportModel is expected
to be registered as adapter on the IViewer, which is retrieved
through navigating via the IRootPart of this policy's host.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
initialized
Stores the initialized flag for this policy, i.e.
|
| Constructor and Description |
|---|
FXChangeViewportPolicy() |
| Modifier and Type | Method and Description |
|---|---|
IUndoableOperation |
commit()
Returns an
IUndoableOperation that performs all manipulations
applied by the policy since the last ITransactional.init() call. |
void |
init()
Initializes the policy, so that the policy's "work" methods can be used.
|
void |
scrollRelative(double deltaTranslateX,
double deltaTranslateY)
Advances the viewport transformation by the given translation values.
|
void |
zoomRelative(double relativeZoom,
double sceneX,
double sceneY)
Concatenates a scaling transformation to the current viewport
transformation.
|
commit, disableRefreshVisuals, enableRefreshVisuals, getAdaptable, getHost, init, setAdaptablepublic IUndoableOperation commit()
ITransactionalIUndoableOperation that performs all manipulations
applied by the policy since the last ITransactional.init() call. When called
multiple times in sequence, only the first call will yield an operation,
the subsequent calls will yield null.commit in interface ITransactionalIUndoableOperation that performs all manipulations
applied by the policy since the last ITransactional.init() call.public void init()
ITransactionalIllegalStateException. It is safe to call ITransactional.init()
multiple times in sequence.init in interface ITransactionalpublic void scrollRelative(double deltaTranslateX,
double deltaTranslateY)
deltaTranslateX - The horizontal translation delta.deltaTranslateY - The vertical translation delta.public void zoomRelative(double relativeZoom,
double sceneX,
double sceneY)
relativeZoom - The scale factor.sceneX - The pivot x-coordinate.sceneY - The pivot y-coordinate.Copyright (c) 2014 itemis AG and others. All rights reserved.