public class TLcdNVG15Composite extends TLcdNVG15DataObject implements ILcdEditableShapeList, ILcdCache, ILcdInvalidateable
ILcdEditableShapeList
that represents an NVG 1.5 Composite.
You can retrieve elements through getGeometry()
or the ILcdEditableShapeList
interface.
Composite contain either shapes (e.g. TLcdNVG15Circle),
text
or
data objects
.
The ILcdEditableShapeList
only exposes elements that implement ILcdShape.
Modifier and Type | Field and Description |
---|---|
static TLcdDataProperty |
GEOMETRY_PROPERTY
Data property that maps to the choice between the
text and point and circle and ellipse and polyline and corridor and polygon and arc and arcband and multipoint and content-item and arrow elements. |
static TLcdDataProperty |
LABEL_PROPERTY
Data property that maps to the
label attribute. |
static TLcdDataProperty |
STYLE_PROPERTY
Data property that maps to the
style attribute. |
static TLcdDataProperty |
URI_PROPERTY
Data property that maps to the
uri attribute. |
EXTENDED_DATA_PROPERTY, METADATA_PROPERTY
Constructor and Description |
---|
TLcdNVG15Composite() |
TLcdNVG15Composite(TLcdDataType aDataType)
Creates a new instance of TLcdNVG15Composite with the given data type.
|
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[] aShapes)
Appends the specified array of shapes to the end of this
ILcdShapeList . |
void |
clearCache()
Clears the cache.
|
void |
clearShapes()
Removes all of the shapes from this
ILcdShapeList . |
TLcdNVG15Composite |
clone()
Returns a deep clone of this object.
|
TLcdNVG15Composite |
clone(Map aObjectDictionary)
Returns a deep clone of this object.
|
boolean |
contains2D(double aX,
double aY)
Checks whether this
ILcdShape contains the given point in
the 2D space. |
boolean |
contains2D(ILcdPoint aILcdPoint)
Checks whether this
ILcdShape contains the given ILcdPoint in the 2D space. |
boolean |
contains3D(double aX,
double aY,
double aZ)
Checks whether this
ILcdShape contains the given point in
the 3D space. |
boolean |
contains3D(ILcdPoint aILcdPoint)
Checks whether this
ILcdShape contains the given ILcdPoint in the 3D space. |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
Object |
getCachedObject(Object aKey)
Looks up and returns the cached Object corresponding to the given key.
|
ILcdPoint |
getFocusPoint()
Returns the focus point of this
ILcdShape . |
List<Object> |
getGeometry()
Returns the value of the property that maps to the choice between the
text and point and circle and ellipse and polyline and corridor and polygon and arc and arcband and multipoint and content-item and arrow elements. |
String |
getLabel()
Returns the value of the property that maps to the
label attribute. |
Object |
getObject(int aIndex)
Returns the Object at the given index.
|
int |
getObjectCount()
Returns the total number of Object objects in the list.
|
ILcdNVGNode |
getParent()
Get the parent of this object.
|
ILcdShape |
getShape(int aIndex)
Returns the
ILcdShape at the given index. |
int |
getShapeCount()
Returns the number of
ILcdShape objects in the list. |
TLcdNVGStyle |
getStyle()
Returns the value of the property that maps to the
style attribute. |
URI |
getUri()
Returns the value of the property that maps to the
uri attribute. |
void |
insertIntoCache(Object aKey,
Object aObject)
Inserts a cache Object corresponding to the given key Object.
|
void |
invalidateObject()
Invalidates all cached values of this object.
|
Object |
removeCachedObject(Object aKey)
Looks up and removes the cached Object corresponding to the given key.
|
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[] aShapes)
Removes all shapes from this
ILcdShapeList that are contained in the specified
array of shapes. |
void |
setLabel(String aValue)
Sets the value of the property that maps to the
label attribute. |
void |
setParent(ILcdNVGNode aParent)
Set the parent of this object to the given parent.
|
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 |
setStyle(TLcdNVGStyle aValue)
Sets the value of the property that maps to the
style attribute. |
void |
setUri(URI aValue)
Sets the value of the property that maps to the
uri attribute. |
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. |
getExtendedData, getMetadata, setExtendedData, setMetadata
getDataType, getValue, getValue, hasValue, hasValue, setValue, setValue, toString
public static final TLcdDataProperty GEOMETRY_PROPERTY
text
and point
and circle
and ellipse
and polyline
and corridor
and polygon
and arc
and arcband
and multipoint
and content-item
and arrow
elements.
The possible values for this property are instances of java.util.List
with elements of class
public static final TLcdDataProperty LABEL_PROPERTY
label
attribute.
The possible values for this property are instances of String
.public static final TLcdDataProperty STYLE_PROPERTY
style
attribute.
The possible values for this property are instances of TLcdNVGStyle
.public static final TLcdDataProperty URI_PROPERTY
uri
attribute.
The possible values for this property are instances of URI
.public TLcdNVG15Composite()
public TLcdNVG15Composite(TLcdDataType aDataType)
aDataType
- the data type for the composite.public TLcdNVG15Composite clone()
TLcdDataObject.clone(Map)
.clone
in interface ILcdCloneable
clone
in class TLcdDataObject
Object.clone()
public TLcdNVG15Composite clone(Map aObjectDictionary)
TLcdDataObject
ILcdDataObject
, the value is cloned by first creating a new instance via
the value.getDataType().newInstance()
method, and then cloning its properties one by one.ILcdDeepCloneable
or
ILcdCloneable
then this interface is used to clone the value.clone
in interface ILcdDeepCloneable
clone
in class TLcdDataObject
aObjectDictionary
- the Object dictionary that keeps track of the objects for which a clone has already been made,
and their corresponding clone Object.public void insertIntoCache(Object aKey, Object aObject)
insertIntoCache
in interface ILcdCache
aKey
- the key Object that will be used to identify the Object.
The key must therefore be a unique identifier, typically the caller
itself: insertIntoCache(this, ...)
.aObject
- the Object to be cached.public Object getCachedObject(Object aKey)
getCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public Object removeCachedObject(Object aKey)
removeCachedObject
in interface ILcdCache
aKey
- the key Object that was used for storing the cache Object.public void clearCache()
clearCache
in interface ILcdCache
public int getShapeCount()
ILcdShape
objects in the list.getShapeCount
in interface ILcdShapeList
ILcdShape
objects in the list.public int getObjectCount()
public ILcdShape getShape(int aIndex) throws IndexOutOfBoundsException
ILcdShape
at the given index.getShape
in interface ILcdShapeList
aIndex
- a valid index in the list of ILcdShape
objects.ILcdShape
at the given index.IndexOutOfBoundsException
- when the index is not valid.public Object getObject(int aIndex) throws IndexOutOfBoundsException
aIndex
- a valid index in the list of Object objects.IndexOutOfBoundsException
- when the index is not valid.public ILcdPoint getFocusPoint()
ILcdShape
.getFocusPoint
in interface ILcdShape
ILcdShape
.public boolean contains2D(ILcdPoint aILcdPoint)
ILcdShape
contains the given ILcdPoint
in the 2D space.
Only the first two dimensions of the ILcdShape
and the ILcdPoint
are considered.contains2D
in interface ILcdShape
aILcdPoint
- the ILcdPoint
to test.ILcdShape.contains2D(double, double)
public boolean contains2D(double aX, double aY)
ILcdShape
contains the given point in
the 2D space. Only the first two dimensions of the ILcdShape
are considered.contains2D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.public boolean contains3D(ILcdPoint aILcdPoint)
ILcdShape
contains the given ILcdPoint
in the 3D space.contains3D
in interface ILcdShape
aILcdPoint
- the ILcdPoint
to test.ILcdShape.contains3D(double, double, double)
public boolean contains3D(double aX, double aY, double aZ)
ILcdShape
contains the given point in
the 3D space.contains3D
in interface ILcdShape
aX
- the x coordinate of the point.aY
- the y coordinate of the point.aZ
- the z coordinate of the point.public ILcdBounds getBounds()
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.
If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points)
the return value is unspecified.
It is highly recommended to return an undefined
bounds.
You can create undefined bounds using the default constructors
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public ILcdNVGNode getParent()
ILcdNVGNode
getParent
in interface ILcdNVGNode
getParent
in class TLcdNVG15Base
public void setParent(ILcdNVGNode aParent)
ILcdNVGNode
setParent
in interface ILcdNVGNode
setParent
in class TLcdNVG15Base
aParent
- The parent to be set to this object.public void invalidateObject()
ILcdInvalidateable
invalidateObject
in interface ILcdInvalidateable
public void shapesChanged()
ILcdEditableShapeList
ILcdShapeList
that some (possibly all) of its shapes have changed.shapesChanged
in interface ILcdEditableShapeList
public void shapeChanged(ILcdShape aShape)
ILcdEditableShapeList
ILcdShapeList
that the specified shape has changed.shapeChanged
in interface ILcdEditableShapeList
aShape
- the shape that has changed.public void shapeChanged(int aIndex)
ILcdEditableShapeList
ILcdShapeList
that the shape at the specified position has changed.shapeChanged
in interface ILcdEditableShapeList
aIndex
- the index of the shape that has changed.public void setShapes(ILcdShape[] aShapes)
ILcdEditableShapeList
ILcdShapeList
with the specified
array of shapes.setShapes
in interface ILcdEditableShapeList
aShapes
- the array of shapes to be stored in this ILcdShapeList
.public void removeShapes(ILcdShape[] aShapes)
ILcdEditableShapeList
ILcdShapeList
that are contained in the specified
array of shapes.removeShapes
in interface ILcdEditableShapeList
aShapes
- the array of shapes to be removed from this ILcdShapeList
.public boolean removeShape(ILcdShape aShape)
ILcdEditableShapeList
ILcdShapeList
. If this
ILcdShapeList
does not contain the shape, it is unchanged.removeShape
in interface ILcdEditableShapeList
aShape
- the shape to be removed, if present.true
if this ILcdShapeList
contained the specified element.public void clearShapes()
ILcdEditableShapeList
ILcdShapeList
.clearShapes
in interface ILcdEditableShapeList
public void addShapes(ILcdShape[] aShapes)
ILcdEditableShapeList
ILcdShapeList
.addShapes
in interface ILcdEditableShapeList
aShapes
- the array of shapes to be appended to this ILcdShapeList
.public void addShape(int aIndex, ILcdShape aShape)
ILcdEditableShapeList
ILcdShapeList
.addShape
in interface ILcdEditableShapeList
aIndex
- the index at which the shape is to be inserted.aShape
- the shape to be inserted.public ILcdShape removeShape(int aIndex)
ILcdEditableShapeList
ILcdShapeList
. Shifts any
subsequent shapes to the left. Returns the shape that was removed from this
ILcdShapeList
.removeShape
in interface ILcdEditableShapeList
aIndex
- the index of the shape to removed.public ILcdShape setShape(int aIndex, ILcdShape aShape)
ILcdEditableShapeList
ILcdShapeList
with the
specified shape.setShape
in interface ILcdEditableShapeList
aIndex
- index of shape to replace.aShape
- the shape to be stored at the specified position.public void addShape(ILcdShape aShape)
ILcdEditableShapeList
ILcdShapeList
.addShape
in interface ILcdEditableShapeList
aShape
- the shape to be appended to this ILcdShapeList
.public List<Object> getGeometry()
text
and point
and circle
and ellipse
and polyline
and corridor
and polygon
and arc
and arcband
and multipoint
and content-item
and arrow
elements.
The possible values for this property are instances of java.util.List
with elements of class
GEOMETRY_PROPERTY
property.public String getLabel()
label
attribute.
A textual representation of this element.
LABEL_PROPERTY
property.public void setLabel(String aValue)
label
attribute.
A textual representation of this element.
aValue
- the value to set for the LABEL_PROPERTY
property.public TLcdNVGStyle getStyle()
style
attribute.
CSS based style description which indicates how this element should be rendered graphically.
STYLE_PROPERTY
property.public void setStyle(TLcdNVGStyle aValue)
style
attribute.
CSS based style description which indicates how this element should be rendered graphically.
aValue
- the value to set for the STYLE_PROPERTY
property.public URI getUri()
uri
attribute.
URI schema that uniquely identifies the object. See the URI Scheme for more details.
URI_PROPERTY
property.public void setUri(URI aValue)
uri
attribute.
URI schema that uniquely identifies the object. See the URI Scheme for more details.
aValue
- the value to set for the URI_PROPERTY
property.