Package org.eclipse.graphiti.pattern

# Class ResizeShapeFeatureForPattern

java.lang.Object
org.eclipse.graphiti.features.impl.AbstractFeature
org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature
org.eclipse.graphiti.pattern.ResizeShapeFeatureForPattern

All Implemented Interfaces:
  `ICustomAbortableUndoRedoFeature`, `ICustomUndoRedoFeature`, `IFeature`, `IFeatureProviderHolder`, `IResizeFeature`, `IResizeShapeFeature`, `IResizeShape`, `IDescription`, `IName`

public class ResizeShapeFeatureForPattern extends DefaultResizeShapeFeature implements ICustomAbortableUndoRedoFeature
This feature wraps the resize shape functionality of a pattern for calls of the Graphiti framework. Clients should not need to use this class directly.

## Constructor Summary

Constructors
Constructor
Description
`ResizeShapeFeatureForPattern(IFeatureProvider featureProvider, IPattern pattern)`
Creates a new `ResizeShapeFeatureForPattern`.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`canRedo(IContext context)`
Decides if the processed feature can be re-done.
`boolean`
`canResizeShape(IResizeShapeContext context)`
Can resize shape.
`boolean`
`canUndo(IContext context)`
Decides if the current feature can be undone - this is the undo of the execute operation.
`IResizeConfiguration`
`getResizeConfiguration(IResizeShapeContext context)`
Provides configuration object, which describes the resize behavior
`boolean`
`isAbort()`
The Graphiti framework will call this method after `ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)`/ `ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext)` have been called and before the actual undo/redo operation is triggered.
`void`
`postRedo(IContext context)`
This method will be called by the Graphiti framework after the EMF undo has finished.
`void`
`postUndo(IContext context)`
This method will be called by the Graphiti framework after the EMF undo is finished.
`void`
`preRedo(IContext context)`
This method will be called by the Graphiti framework before the EMF undo has triggered.
`void`
`preUndo(IContext context)`
This method will be called by the Graphiti framework before the EMF undo is triggered.
`void`
`resizeShape(IResizeShapeContext context)`
Resize shape.

### Methods inherited from class org.eclipse.graphiti.features.impl.DefaultResizeShapeFeature

`canExecute, execute, getName, resizeShape`

### Methods inherited from class org.eclipse.graphiti.features.impl.AbstractFeature

`addGraphicalRepresentation, getAllBusinessObjectsForPictogramElement, getBusinessObjectForPictogramElement, getDescription, getDiagram, getDiagramBehavior, getFeatureProvider, getProgressCallback, getUserDecision, hasDoneChanges, isAvailable, layoutPictogramElement, link, link, manageColor, manageColor, manageDefaultFont, manageFont, manageFont, setProgressCallback, toString, updatePictogramElement`

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

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

### Methods inherited from interface org.eclipse.graphiti.IDescription

`getDescription`

### Methods inherited from interface org.eclipse.graphiti.features.IFeature

`hasDoneChanges, isAvailable`

### Methods inherited from interface org.eclipse.graphiti.features.IFeatureProviderHolder

`getFeatureProvider`

## Constructor Details

### ResizeShapeFeatureForPattern

public ResizeShapeFeatureForPattern(IFeatureProvider featureProvider, IPattern pattern)
Creates a new `ResizeShapeFeatureForPattern`.

Parameters:
  `featureProvider` - the feature provider
  `pattern` - the pattern

## Method Details

### canResizeShape

public boolean canResizeShape(IResizeShapeContext context)
Description copied from interface: `IResizeShape`
Can resize shape.

Specified by:
  `canResizeShape` in interface `IResizeShape`
Overrides:
  `canResizeShape` in class `DefaultResizeShapeFeature`
Parameters:
  `context` - the context
Returns:
  true, if successful

### resizeShape

public void resizeShape(IResizeShapeContext context)
Description copied from interface: `IResizeShape`
Resize shape.

Specified by:
  `resizeShape` in interface `IResizeShape`
Overrides:
  `resizeShape` in class `DefaultResizeShapeFeature`
Parameters:
  `context` - the context

### getResizeConfiguration

public IResizeConfiguration getResizeConfiguration(IResizeShapeContext context)
Description copied from interface: `IResizeFeature`
Provides configuration object, which describes the resize behavior

Specified by:
  `getResizeConfiguration` in interface `IResizeFeature`
Overrides:
  `getResizeConfiguration` in class `DefaultResizeShapeFeature`
Parameters:
  `context` - the resizing context
Returns:
  configuration object

### isAbort

public boolean isAbort()
Description copied from interface: `ICustomAbortableUndoRedoFeature`
The Graphiti framework will call this method after `ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)`/ `ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext)` have been called and before the actual undo/redo operation is triggered. In case this method returns `true`, the operation will be cancelled by the Graphiti framework by throwing an `OperationCanceledException` that causes am EMF revert of the operation.

Implementing classes might e.g. set a flag in `ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)`/ `ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext)` as cancellation indication and check that that flag here.

Specified by:
  `isAbort` in interface `ICustomAbortableUndoRedoFeature`
Returns:
  `true` in case you want to cancel the current operation, `false` otherwise.
Since:
  0.12

### canUndo

public boolean canUndo(IContext context)
Description copied from interface: `IFeature`
Decides if the current feature can be undone - this is the undo of the execute operation.

Specified by:
  `canUndo` in interface `ICustomUndoRedoFeature`
Specified by:
  `canUndo` in interface `IFeature`
Overrides:
  `canUndo` in class `AbstractFeature`
Parameters:
  `context` - this is the general input for this method
Returns:
  true if the feature can be undone, false if not
See Also:
  - `IContext`

### preUndo

public void preUndo(IContext context)
Description copied from interface: `ICustomUndoRedoFeature`
This method will be called by the Graphiti framework before the EMF undo is triggered. Customers may revert their non-EMF changes done by the feature here or in `ICustomUndoRedoFeature.postUndo(IContext)`.

Specified by:
  `preUndo` in interface `ICustomUndoRedoFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Since:
  0.12

### postUndo

public void postUndo(IContext context)
Description copied from interface: `ICustomUndoRedoFeature`
This method will be called by the Graphiti framework after the EMF undo is finished. Customers may revert their non-EMF changes done by the feature here or in `ICustomUndoRedoFeature.preUndo(IContext)`.

Specified by:
  `postUndo` in interface `ICustomUndoRedoFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Since:
  0.12

### canRedo

public boolean canRedo(IContext context)
Description copied from interface: `ICustomUndoRedoFeature`
Decides if the processed feature can be re-done. This method is called once by the Graphiti framework just before any redo work is started, e.g. before `ICustomUndoRedoFeature.preRedo(IContext)`.

Note that as soon as any feature reports `false` here, also all consecutive entries in the command stack are no longer reachable for redo.

Specified by:
  `canRedo` in interface `ICustomUndoRedoFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Returns:
  true if the feature can be re-done, false if not
Since:
  0.8

### preRedo

public void preRedo(IContext context)
Description copied from interface: `ICustomUndoRedoFeature`
This method will be called by the Graphiti framework before the EMF undo has triggered. Customers may re-apply their non-EMF changes done by the feature here or in `ICustomUndoRedoFeature.postRedo(IContext)`. (Usually it might be sufficient to delegate to the execution method of the feature.)

Specified by:
  `preRedo` in interface `ICustomUndoRedoFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Since:
  0.12

### postRedo

public void postRedo(IContext context)
Description copied from interface: `ICustomUndoRedoFeature`
This method will be called by the Graphiti framework after the EMF undo has finished. Customers may re-apply their non-EMF changes done by the feature here or in `ICustomUndoRedoFeature.preRedo(IContext)`. (Usually it might be sufficient to delegate to the execution method of the feature.)

Specified by:
  `postRedo` in interface `ICustomUndoRedoFeature`
Parameters:
  `context` - this is the instance of the `IContext` object that was in use when executing the feature
Since:
  0.12