Package org.eclipse.gef.mvc.fx.operations

# Class TransformVisualOperation

java.lang.Object
org.eclipse.core.commands.operations.AbstractOperation
org.eclipse.gef.mvc.fx.operations.TransformVisualOperation

All Implemented Interfaces:
  `IUndoableOperation`, `ITransactionalOperation`

public class TransformVisualOperation extends AbstractOperation implements ITransactionalOperation
The `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 Summary

Constructors
Constructor
Description
`TransformVisualOperation(ITransformableContentPart<? extends Node> transformablePart)`
Constructs a new `TransformVisualOperation` to change the given nodeTransform.
`TransformVisualOperation(ITransformableContentPart<? extends Node> transformablePart, Affine newTransform)`
Constructs a new `TransformVisualOperation` to change the given nodeTransform.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`applyTransform(Affine transform)`
Sets the visual transformation to the given `Affine`.
`IStatus`
`execute(IProgressMonitor monitor, IAdaptable info)`
`Affine`
`getInitialTransform()`
Returns the initial `Affine` of the `ITransformableContentPart`.
`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).
`IStatus`
`redo(IProgressMonitor monitor, IAdaptable info)`
`void`
`setFinalTransform(Affine newTransform)`
Sets the `Affine` that will be set as the transformation matrix of the `ITransformableContentPart`.
`IStatus`
`undo(IProgressMonitor monitor, IAdaptable info)`

### Methods inherited from class org.eclipse.core.commands.operations.AbstractOperation

`addContext, canExecute, canRedo, canUndo, dispose, getContexts, getLabel, hasContext, removeContext, setLabel, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.eclipse.core.commands.operations.IUndoableOperation

`addContext, canExecute, canRedo, canUndo, dispose, getContexts, getLabel, hasContext, removeContext`

## Constructor Details

### TransformVisualOperation

public TransformVisualOperation(ITransformableContentPart<? extends Node> transformablePart)
Constructs a new `TransformVisualOperation` to change the given nodeTransform.

Parameters:
  `transformablePart` - The `ITransformableContentPart` that will be transformed by this operation.

### TransformVisualOperation

public TransformVisualOperation(ITransformableContentPart<? extends Node> transformablePart, Affine newTransform)
Constructs a new `TransformVisualOperation` to change the given nodeTransform. The given newTransform will be applied to the nodeTransform upon execution of this operation.

Parameters:
  `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.

## Method Details

### applyTransform

protected void applyTransform(Affine transform)
Sets the visual transformation to the given `Affine`.

Parameters:
  `transform` - The `Affine` that is to be set as the total visual transformation for the `ITransformableContentPart`.

### execute

public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException

Specified by:
  `execute` in interface `IUndoableOperation`
Specified by:
  `execute` in class `AbstractOperation`
Throws:
  `ExecutionException`

### getInitialTransform

public Affine getInitialTransform()
Returns the initial `Affine` of the `ITransformableContentPart`.

Returns:
  The initial `Affine` of the `ITransformableContentPart`.

### getNewTransform

public Affine getNewTransform()
Returns the `Affine` that will be set as the transformation matrix of the `ITransformableContentPart`.

Returns:
  The `Affine` that will be set as the transformation matrix of the `ITransformableContentPart`.

### isContentRelevant

public boolean isContentRelevant()
Description copied from interface: `ITransactionalOperation`
Returns `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.

Specified by:
  `isContentRelevant` in interface `ITransactionalOperation`
Returns:
  `true` if this `ITransactionalOperation` is actually changing model data, otherwise `false`.

### isNoOp

public boolean isNoOp()
Description copied from interface: `ITransactionalOperation`
Returns `true` if this `ITransactionalOperation` has no effect (in comparison to its initial state). Otherwise returns `false`.

Specified by:
  `isNoOp` in interface `ITransactionalOperation`
Returns:
  `true` if this `ITransactionalOperation` has no effect, otherwise `false`.

### redo

public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException

Specified by:
  `redo` in interface `IUndoableOperation`
Specified by:
  `redo` in class `AbstractOperation`
Throws:
  `ExecutionException`

### setFinalTransform

public void setFinalTransform(Affine newTransform)
Sets the `Affine` that will be set as the transformation matrix of the `ITransformableContentPart`.

Parameters:
  `newTransform` - The `Affine` that will be set as the transformation matrix of the `ITransformableContentPart`.

### undo

public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException

Specified by:
  `undo` in interface `IUndoableOperation`
Specified by:
  `undo` in class `AbstractOperation`
Throws:
  `ExecutionException`