public interface ILcdEditableShapeList extends ILcdShapeList
ILcdEditableShapeList
is an ILcdShapeList
whose contents can be
modified. It provides methods for adding and removing shapes, and notification of shape changes.
Implementations may place limitations on what shapes may be added to this
ILcdShapeList
. They should clearly specify in their documentation which restrictions
apply.Modifier and Type | Method and Description |
---|---|
void |
addShape(ILcdShape aShape)
Appends the specified shape to the end of this
ILcdShapeList . |
void |
addShape(int aIndex,
ILcdShape aShape)
Inserts the specified shape at the specified position in this
ILcdShapeList . |
void |
addShapes(ILcdShape[] aShape)
Appends the specified array of shapes to the end of this
ILcdShapeList . |
void |
clearShapes()
Removes all of the shapes from this
ILcdShapeList . |
boolean |
removeShape(ILcdShape aShape)
Removes the first occurrence of the specified shape in this
ILcdShapeList . |
ILcdShape |
removeShape(int aIndex)
Removes the shape at the specified position in this
ILcdShapeList . |
void |
removeShapes(ILcdShape[] aShape)
Removes all shapes from this
ILcdShapeList that are contained in the specified
array of shapes. |
ILcdShape |
setShape(int aIndex,
ILcdShape aShape)
Replaces the shape at the specified position in this
ILcdShapeList with the
specified shape. |
void |
setShapes(ILcdShape[] aShapes)
Replace the list of shapes contained in this
ILcdShapeList with the specified
array of shapes. |
void |
shapeChanged(ILcdShape aShape)
Notifies this
ILcdShapeList that the specified shape has changed. |
void |
shapeChanged(int aIndex)
Notifies this
ILcdShapeList that the shape at the specified position has changed. |
void |
shapesChanged()
Notifies this
ILcdShapeList that some (possibly all) of its shapes have changed. |
getShape, getShapeCount
contains2D, contains2D, contains3D, contains3D, getFocusPoint
getBounds
clone
void addShape(int aIndex, ILcdShape aShape)
ILcdShapeList
.aIndex
- the index at which the shape is to be inserted.aShape
- the shape to be inserted.ClassCastException
- if the class of the specified shape prevents it from being
added to this ILcdShapeList
.NullPointerException
- if the specified shape is null
.IllegalArgumentException
- if some aspect of the specified shape prevents it from being
added to this ILcdShapeList
.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index
> getShapeCount()
).void addShape(ILcdShape aShape)
ILcdShapeList
.aShape
- the shape to be appended to this ILcdShapeList
.ClassCastException
- if the class of the specified shape prevents it from being
added to this ILcdShapeList
.NullPointerException
- if the specified shape is null
.IllegalArgumentException
- if some aspect of the specified shape prevents it from being
added to this ILcdShapeList
.void addShapes(ILcdShape[] aShape)
ILcdShapeList
.aShape
- the array of shapes to be appended to this ILcdShapeList
.ClassCastException
- if the class of one or more of the shapes in the specified
array prevents it from being added to this
ILcdShapeList
.NullPointerException
- if the specified array is null
.IllegalArgumentException
- if some aspect one or more of the shapes in the specified
array prevents it from being added to this
ILcdShapeList
.void clearShapes()
ILcdShapeList
.ILcdShape removeShape(int aIndex)
ILcdShapeList
. Shifts any
subsequent shapes to the left. Returns the shape that was removed from this
ILcdShapeList
.aIndex
- the index of the shape to removed.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >=
size()).boolean removeShape(ILcdShape aShape)
ILcdShapeList
. If this
ILcdShapeList
does not contain the shape, it is unchanged.aShape
- the shape to be removed, if present.true
if this ILcdShapeList
contained the specified element.NullPointerException
- if the specified shape is null
.void removeShapes(ILcdShape[] aShape)
ILcdShapeList
that are contained in the specified
array of shapes.aShape
- the array of shapes to be removed from this ILcdShapeList
.NullPointerException
- if the specified array is null
.ILcdShape setShape(int aIndex, ILcdShape aShape)
ILcdShapeList
with the
specified shape.aIndex
- index of shape to replace.aShape
- the shape to be stored at the specified position.ClassCastException
- if the class of the specified shape prevents it from being
added to this ILcdShapeList
.NullPointerException
- if the specified shape is null
.IllegalArgumentException
- if some aspect of the specified shape prevents it from being
added to this ILcdShapeList
.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index
> getShapeCount()
).void setShapes(ILcdShape[] aShapes)
ILcdShapeList
with the specified
array of shapes.aShapes
- the array of shapes to be stored in this ILcdShapeList
.ClassCastException
- if the class of one or more of the shapes in the specified
array prevents it from being added to this
ILcdShapeList
.NullPointerException
- if the specified array is null
.IllegalArgumentException
- if some aspect one or more of the shapes in the specified
array prevents it from being added to this
ILcdShapeList
.void shapeChanged(int aIndex)
ILcdShapeList
that the shape at the specified position has changed.aIndex
- the index of the shape that has changed.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index
> getShapeCount()
).void shapeChanged(ILcdShape aShape)
ILcdShapeList
that the specified shape has changed.aShape
- the shape that has changed.void shapesChanged()
ILcdShapeList
that some (possibly all) of its shapes have changed.