public class FXTransformConnectionPolicy extends FXTransformPolicy
FXTransformConnectionPolicy
is an FXTransformPolicy
that
is adjusted for the relocation of an Connection
. It uses an
FXBendConnectionOperation
to update the anchors of the
Connection
according to the applied translation.adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
TRANSFORM_PROVIDER_KEY
Constructor and Description |
---|
FXTransformConnectionPolicy() |
Modifier and Type | Method and Description |
---|---|
ITransactionalOperation |
commit()
Returns an
ITransactionalOperation that performs all
manipulations applied by the policy since the previous AbstractTransactionPolicy.init()
call. |
protected ITransactionalOperation |
createOperation()
Creates an
ITransactionalOperation that is used to encapsulate
the changes that are applied by this AbstractTransactionPolicy
through its "work" methods. |
protected ITransactionalOperation |
createTransformContentOperation()
Returns an operation to transform the content.
|
protected FXBendConnectionOperation |
getBendConnectionOperation()
Returns the
FXBendConnectionOperation to be used by this policy. |
IVisualPart<javafx.scene.Node,Connection> |
getHost()
|
protected java.util.List<java.lang.Integer> |
getIndicesOfUnconnectedAnchors()
Returns the indices of all movable anchors within the operation.
|
void |
init()
Initializes the policy, so that the policy's "work" methods can be used.
|
protected boolean |
isContentTransformable()
Returns whether the content can be transformed.
|
protected void |
updateTransformOperation(AffineTransform newTransform)
Updates the operation that was created within
AbstractTransactionPolicy.createOperation()
so that it will set the host's transformation to match
the given AffineTransform upon execution. |
getCurrentTransform
applyTransform, createPostTransform, createPreTransform, getInitialTransform, getSnapToGridOffset, setPostRotate, setPostScale, setPostTransform, setPostTranslate, setPreRotate, setPreScale, setPreTransform, setPreTranslate, setTransform, updateTransform
checkInitialized, getOperation, isInitialized, locallyExecuteOperation, rollback
adaptableProperty, getAdaptable, setAdaptable
public ITransactionalOperation commit()
AbstractTransactionPolicy
ITransactionalOperation
that performs all
manipulations applied by the policy since the previous AbstractTransactionPolicy.init()
call.commit
in class AbstractTransformPolicy<javafx.scene.Node>
ITransactionalOperation
that performs all
manipulations applied by the policy since the last
AbstractTransactionPolicy.init()
call.protected ITransactionalOperation createOperation()
AbstractTransactionPolicy
ITransactionalOperation
that is used to encapsulate
the changes that are applied by this AbstractTransactionPolicy
through its "work" methods. The created operation should allow for
local execution
at each time.createOperation
in class FXTransformPolicy
ITransactionalOperation
to encapsulate all applied
changes.protected ITransactionalOperation createTransformContentOperation()
AbstractTransformPolicy
createTransformContentOperation
in class AbstractTransformPolicy<javafx.scene.Node>
protected FXBendConnectionOperation getBendConnectionOperation()
FXBendConnectionOperation
to be used by this policy.FXBendConnectionOperation
used to transform the
visual.public IVisualPart<javafx.scene.Node,Connection> getHost()
IPolicy
getHost
in interface IPolicy<javafx.scene.Node>
getHost
in class AbstractPolicy<javafx.scene.Node>
IPolicy
.protected java.util.List<java.lang.Integer> getIndicesOfUnconnectedAnchors()
List
of Integer
s specifying the anchors to
relocate.public void init()
AbstractTransactionPolicy
IllegalStateException
, as well as re-initializing before
committing or rolling back.init
in class AbstractTransformPolicy<javafx.scene.Node>
protected boolean isContentTransformable()
AbstractTransformPolicy
isContentTransformable
in class AbstractTransformPolicy<javafx.scene.Node>
true
if the content can be transformed,
false
otherwise.protected void updateTransformOperation(AffineTransform newTransform)
AbstractTransformPolicy
AbstractTransactionPolicy.createOperation()
so that it will set the host's
transformation to match
the given AffineTransform
upon execution.updateTransformOperation
in class FXTransformPolicy
newTransform
- The new transformation for the host.Copyright (c) 2014 itemis AG and others. All rights reserved.