public abstract class ALcyShapeCodec extends Object
Provides an ALcyShapeSupplier
with a codec which is used to implement undo/redo
in the customizers, to clone shapes and to implement shape conversion during drag and drop.
Typically, a shape codec can only be used on a specific shape and therefore it is registered
to an ALcyShapeSupplier.
ALcyShapeSupplier.createShapeCodec()
Constructor and Description |
---|
ALcyShapeCodec() |
Modifier and Type | Method and Description |
---|---|
abstract void |
restoreState(ILcdShape aShapeSFCT,
ILcdModel aTargetModel,
Map aMap)
Restores the state of an
ILcdShape to the state it was when the storeState
method was called with the shape. |
abstract void |
storeState(ILcdShape aShape,
ILcdModel aSourceModel,
Map aMapSFCT)
Encodes the state of an
ILcdShape into a Map . |
public abstract void storeState(ILcdShape aShape, ILcdModel aSourceModel, Map aMapSFCT) throws IllegalArgumentException
ILcdShape
into a Map
.aShape
- the shape which state needs to be encoded.aSourceModel
- the model which contains the ILcdShape
.aMapSFCT
- The map to store the state of the object in.IllegalArgumentException
- when the codec could not handle aShape
public abstract void restoreState(ILcdShape aShapeSFCT, ILcdModel aTargetModel, Map aMap) throws IllegalArgumentException, TLcdOutOfBoundsException
ILcdShape
to the state it was when the storeState
method was called with the shape.aShapeSFCT
- the shape which state should be restored.aTargetModel
- the model which contains aShape
aMap
- the map in which all the properties of the shape were stored during the storeState
method.IllegalArgumentException
- when the codec could not handle aShape
TLcdOutOfBoundsException
- when restoring the state for the target model failed because
the coordinates could not be properly converted from the source ILcdModelReference
to the target ILcdModelReference
.