public class TransformVisualOperation extends org.eclipse.core.commands.operations.AbstractOperation implements ITransactionalOperation
TransformVisualOperation
can be used to change an Affine
,
for example, one that is contained within the transformations list of a
Node
to transform that Node
.Constructor and Description |
---|
TransformVisualOperation(ITransformableContentPart<? extends javafx.scene.Node> transformablePart)
Constructs a new
TransformVisualOperation to change the given
nodeTransform. |
TransformVisualOperation(ITransformableContentPart<? extends javafx.scene.Node> transformablePart,
javafx.scene.transform.Affine newTransform)
Constructs a new
TransformVisualOperation to change the given
nodeTransform. |
Modifier and Type | Method and Description |
---|---|
protected void |
applyTransform(javafx.scene.transform.Affine transform)
Sets the visual transformation to the given
Affine . |
org.eclipse.core.runtime.IStatus |
execute(org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.core.runtime.IAdaptable info) |
javafx.scene.transform.Affine |
getInitialTransform()
Returns the initial
Affine of the
ITransformableContentPart . |
javafx.scene.transform.Affine |
getNewTransform()
Returns the
Affine that will be set as the transformation matrix
of the ITransformableContentPart . |
boolean |
isContentRelevant()
Returns
true if this ITransactionalOperation is
actually changing model data (instead of only affecting the
visualization). |
boolean |
isNoOp()
Returns
true if this ITransactionalOperation has no
effect (in comparison to its initial state). |
org.eclipse.core.runtime.IStatus |
redo(org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.core.runtime.IAdaptable info) |
void |
setFinalTransform(javafx.scene.transform.Affine newTransform)
Sets the
Affine that will be set as the transformation matrix of
the ITransformableContentPart . |
org.eclipse.core.runtime.IStatus |
undo(org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.core.runtime.IAdaptable info) |
addContext, canExecute, canRedo, canUndo, dispose, getContexts, getLabel, hasContext, removeContext, setLabel, toString
public TransformVisualOperation(ITransformableContentPart<? extends javafx.scene.Node> transformablePart)
TransformVisualOperation
to change the given
nodeTransform.transformablePart
- The ITransformableContentPart
that will be transformed
by this operation.public TransformVisualOperation(ITransformableContentPart<? extends javafx.scene.Node> transformablePart, javafx.scene.transform.Affine newTransform)
TransformVisualOperation
to change the given
nodeTransform. The given newTransform will be applied to
the nodeTransform upon execution of this operation.transformablePart
- The ITransformableContentPart
that will be transformed
by this operation.newTransform
- The Affine
that will be set as the visual
transformation for the given ITransformableContentPart
upon execution of this operation.protected void applyTransform(javafx.scene.transform.Affine transform)
Affine
.transform
- The Affine
that is to be set as the total visual
transformation for the ITransformableContentPart
.public org.eclipse.core.runtime.IStatus execute(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException
execute
in interface org.eclipse.core.commands.operations.IUndoableOperation
execute
in class org.eclipse.core.commands.operations.AbstractOperation
org.eclipse.core.commands.ExecutionException
public javafx.scene.transform.Affine getInitialTransform()
Affine
of the
ITransformableContentPart
.Affine
of the
ITransformableContentPart
.public javafx.scene.transform.Affine getNewTransform()
Affine
that will be set as the transformation matrix
of the ITransformableContentPart
.Affine
that will be set as the transformation matrix
of the ITransformableContentPart
.public boolean isContentRelevant()
ITransactionalOperation
true
if this ITransactionalOperation
is
actually changing model data (instead of only affecting the
visualization). Otherwise returns false
. The content
relevance of an ITransactionalOperation
can be checked to
determine if the execution of the operation will affect the model, for
example, to set an editor's dirty flag.isContentRelevant
in interface ITransactionalOperation
true
if this ITransactionalOperation
is
actually changing model data, otherwise false
.public boolean isNoOp()
ITransactionalOperation
true
if this ITransactionalOperation
has no
effect (in comparison to its initial state). Otherwise returns
false
.isNoOp
in interface ITransactionalOperation
true
if this ITransactionalOperation
has no
effect, otherwise false
.public org.eclipse.core.runtime.IStatus redo(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException
redo
in interface org.eclipse.core.commands.operations.IUndoableOperation
redo
in class org.eclipse.core.commands.operations.AbstractOperation
org.eclipse.core.commands.ExecutionException
public void setFinalTransform(javafx.scene.transform.Affine newTransform)
Affine
that will be set as the transformation matrix of
the ITransformableContentPart
.newTransform
- The Affine
that will be set as the transformation
matrix of the ITransformableContentPart
.public org.eclipse.core.runtime.IStatus undo(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException
undo
in interface org.eclipse.core.commands.operations.IUndoableOperation
undo
in class org.eclipse.core.commands.operations.AbstractOperation
org.eclipse.core.commands.ExecutionException
Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.