Package com.luciad.shape
Class TLcdShapeList
java.lang.Object
com.luciad.shape.ALcdShape
com.luciad.shape.ALcdShapeList
com.luciad.shape.TLcdShapeList
- All Implemented Interfaces:
ILcdBounded
,ILcdEditableShapeList
,ILcdShape
,ILcdShapeList
,ILcdCache
,ILcdCloneable
,ILcdInvalidateable
,Serializable
,Cloneable
- Direct Known Subclasses:
TLcdDataObjectShapeList
,TLcdDGN3DSurface
,TLcdDGNCell
,TLcdDGNComplexChain
,TLcdDGNComplexShape
,TLcdDGNSolid
,TLcdDGNTextNode2D
,TLcdDWGBlock
,TLcdFeaturedShapeList
This class provides an implementation of
ILcdShapeList
.
This implementation uses an array of the right size to store the list of
shapes, which is memory efficient, but inefficient for adding and
removing shapes.
This class is thread-safe for concurrent read-only access of its contents. For read-write access, external locking must be used. Such locking is typically done at the model level.
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs aTLcdShapeList
that doesn't have anyILcdShape
objects.TLcdShapeList
(ILcdShape[] aShapeArray) Constructs aTLcdShapeList
containing the givenILcdShape
objects.TLcdShapeList
(ILcdShape[] aShapeArray, ILcdBounds aBounds) Constructs aTLcdShapeList
containing the givenILcdShape
objects.TLcdShapeList
(TLcdShapeList aShapeList) Constructs aTLcdShapeList
that is a clone of the givenTLcdShapeList
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Inserts the specified shape at the specified position in thisILcdShapeList
.void
Appends the specified shape to the end of thisILcdShapeList
.void
Appends the specified array of shapes to the end of thisILcdShapeList
.void
Removes all of the shapes from thisILcdShapeList
.clone()
Creates and returns a copy of this object.final ILcdShape
getShape
(int aIndex) Returns theILcdShape
at the given index.final int
Returns the number ofILcdShape
objects in the list.removeShape
(int aIndex) Removes the shape at the specified position in thisILcdShapeList
.boolean
removeShape
(ILcdShape aShape) Removes the first occurrence of the specified shape in thisILcdShapeList
.void
removeShapes
(ILcdShape[] aShapes) Removes all shapes from thisILcdShapeList
that are contained in the specified array of shapes.Replaces the shape at the specified position in thisILcdShapeList
with the specified shape.void
Sets theILcdShape
objects associated with thisILcdShapeList
.void
Replace the list of shapes contained in thisILcdShapeList
with the specified array of shapes.void
shapeChanged
(int aIndex) Notifies thisILcdShapeList
that the shape at the specified position has changed.void
shapeChanged
(ILcdShape aShape) Notifies thisILcdShapeList
that the specified shape has changed.void
Notifies thisILcdShapeList
that some (possibly all) of its shapes have changed.Methods inherited from class com.luciad.shape.ALcdShapeList
calculateFocusPoint, clearCache, contains2D, contains3D, equals, getBounds, getCachedObject, getFocusPoint, hashCode, insertIntoCache, invalidateBounds, invalidateObject, removeCachedObject, setFocusPoint, toString
Methods inherited from class com.luciad.shape.ALcdShape
contains2D, contains3D, fromDomainObject
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.luciad.shape.ILcdBounded
getBounds
Methods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains2D, contains3D, contains3D, getFocusPoint
-
Constructor Details
-
TLcdShapeList
public TLcdShapeList()Constructs aTLcdShapeList
that doesn't have anyILcdShape
objects. -
TLcdShapeList
Constructs aTLcdShapeList
containing the givenILcdShape
objects.- Parameters:
aShapeArray
- an array of shape objects to put in this shape list.
-
TLcdShapeList
Constructs aTLcdShapeList
containing the givenILcdShape
objects.- Parameters:
aShapeArray
- an array of shape objects to put in this shape list.aBounds
- the total bounds of this shape list, if already known at construction time, ornull
if unknown.
-
TLcdShapeList
Constructs aTLcdShapeList
that is a clone of the givenTLcdShapeList
.- Parameters:
aShapeList
- the shape list to clone.
-
-
Method Details
-
setShape
Sets theILcdShape
objects associated with thisILcdShapeList
. This method does exactly the same assetShapes(ILcdShape[])
.- Parameters:
aShapeArray
- theILcdShape
objects associated with thisILcdShapeList
.- See Also:
-
getShapeCount
public final int getShapeCount()Description copied from interface:ILcdShapeList
Returns the number ofILcdShape
objects in the list.- Specified by:
getShapeCount
in interfaceILcdShapeList
- Returns:
- the number of
ILcdShape
objects in the list.
-
getShape
Description copied from interface:ILcdShapeList
Returns theILcdShape
at the given index.- Specified by:
getShape
in interfaceILcdShapeList
- Parameters:
aIndex
- a valid index in the list ofILcdShape
objects.- Returns:
- the
ILcdShape
at the given index. - Throws:
IndexOutOfBoundsException
- when the index is not valid.
-
clone
Creates and returns a copy of this object. The shape array is copied without being cloned.- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classALcdShapeList
- See Also:
-
addShape
Description copied from interface:ILcdEditableShapeList
Inserts the specified shape at the specified position in thisILcdShapeList
.- Specified by:
addShape
in interfaceILcdEditableShapeList
- Parameters:
aIndex
- the index at which the shape is to be inserted.aShape
- the shape to be inserted.
-
addShape
Description copied from interface:ILcdEditableShapeList
Appends the specified shape to the end of thisILcdShapeList
.- Specified by:
addShape
in interfaceILcdEditableShapeList
- Parameters:
aShape
- the shape to be appended to thisILcdShapeList
.
-
addShapes
Description copied from interface:ILcdEditableShapeList
Appends the specified array of shapes to the end of thisILcdShapeList
.- Specified by:
addShapes
in interfaceILcdEditableShapeList
- Parameters:
aShape
- the array of shapes to be appended to thisILcdShapeList
.
-
clearShapes
public void clearShapes()Description copied from interface:ILcdEditableShapeList
Removes all of the shapes from thisILcdShapeList
.- Specified by:
clearShapes
in interfaceILcdEditableShapeList
-
removeShape
Description copied from interface:ILcdEditableShapeList
Removes the shape at the specified position in thisILcdShapeList
. Shifts any subsequent shapes to the left. Returns the shape that was removed from thisILcdShapeList
.- Specified by:
removeShape
in interfaceILcdEditableShapeList
- Parameters:
aIndex
- the index of the shape to removed.- Returns:
- the shape previously at the specified position.
-
removeShape
Description copied from interface:ILcdEditableShapeList
Removes the first occurrence of the specified shape in thisILcdShapeList
. If thisILcdShapeList
does not contain the shape, it is unchanged.- Specified by:
removeShape
in interfaceILcdEditableShapeList
- Parameters:
aShape
- the shape to be removed, if present.- Returns:
true
if thisILcdShapeList
contained the specified element.
-
removeShapes
Description copied from interface:ILcdEditableShapeList
Removes all shapes from thisILcdShapeList
that are contained in the specified array of shapes.- Specified by:
removeShapes
in interfaceILcdEditableShapeList
- Parameters:
aShapes
- the array of shapes to be removed from thisILcdShapeList
.
-
setShape
Description copied from interface:ILcdEditableShapeList
Replaces the shape at the specified position in thisILcdShapeList
with the specified shape.- Specified by:
setShape
in interfaceILcdEditableShapeList
- Parameters:
aIndex
- index of shape to replace.aShape
- the shape to be stored at the specified position.- Returns:
- the shape previously at the specified position.
-
setShapes
Description copied from interface:ILcdEditableShapeList
Replace the list of shapes contained in thisILcdShapeList
with the specified array of shapes.- Specified by:
setShapes
in interfaceILcdEditableShapeList
- Parameters:
aShapes
- the array of shapes to be stored in thisILcdShapeList
.
-
shapeChanged
public void shapeChanged(int aIndex) Description copied from interface:ILcdEditableShapeList
Notifies thisILcdShapeList
that the shape at the specified position has changed.- Specified by:
shapeChanged
in interfaceILcdEditableShapeList
- Parameters:
aIndex
- the index of the shape that has changed.
-
shapeChanged
Description copied from interface:ILcdEditableShapeList
Notifies thisILcdShapeList
that the specified shape has changed.- Specified by:
shapeChanged
in interfaceILcdEditableShapeList
- Parameters:
aShape
- the shape that has changed.
-
shapesChanged
public void shapesChanged()Description copied from interface:ILcdEditableShapeList
Notifies thisILcdShapeList
that some (possibly all) of its shapes have changed.- Specified by:
shapesChanged
in interfaceILcdEditableShapeList
-