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.ITransactional.NoOperation, ITransactional.UnexecutableOperation| Modifier and Type | Field and Description |
|---|---|
protected boolean |
initialized
Stores the initialized flag for this policy, i.e.
|
NOOP, UNEXECUTABLE| Constructor and Description |
|---|
FXChangeViewportPolicy() |
| Modifier and Type | Method and Description |
|---|---|
ITransactionalOperation |
commit()
Returns an
ITransactionalOperation 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 ITransactionalOperation commit()
ITransactionalITransactionalOperation 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.
You can return ITransactional.NOOP if no changes have to be applied. The domain
will filter out all ITransactional.NOOPs before their execution.
You can return ITransactional.UNEXECUTABLE to prevent any composite operation
that contains the ITransactional.UNEXECUTABLE from execution.
commit in interface ITransactionalITransactionalOperation 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.