public class GeometryComponent extends ICEObject implements Component, IUpdateableListener
Composite container for ComplexShapes and PrimitiveShapes along with any additional information required to interpret the geometry data
iComponentVisitor
iComponentListener
component
Constructor and Description |
---|
GeometryComponent()
Creates an empty list of IShapes and ComponentListeners
|
Modifier and Type | Method and Description |
---|---|
void |
accept(IComponentVisitor visitor)
(non-Javadoc)
|
void |
addShape(IShape shape)
Adds an IShape to the shape list
|
java.lang.Object |
clone()
This operation returns a clone of the GeometryComponent using a deep
copy.
|
void |
copy(GeometryComponent iceObject)
This operation copies the contents of a GeometryComponent into the
current object using a deep copy.
|
boolean |
equals(java.lang.Object otherObject)
This operation is used to check equality between this GeometryComponent
and another GeometryComponent.
|
java.util.ArrayList<IShape> |
getShapes()
Returns a list of all IShapes stored in the shapes list
|
int |
hashCode()
This operation returns the hashcode value of the GeometryComponent.
|
void |
register(IUpdateableListener listener)
(non-Javadoc)
|
void |
removeShape(IShape shape)
Removes the given IShape if it exists in the shape list
|
void |
setId(int id)
This operation overrides the ICEObject.setId() operation and provides an
update notification in addition to setting the id.
|
void |
setName(java.lang.String name)
This operation overrides the ICEObject.setName() operation and provides
an update notification in addition to setting the name.
|
void |
setShapes(java.util.ArrayList<IShape> shapes) |
void |
update(IUpdateable component)
This operation notifies the listener that an update has occurred in the
Component.
|
void |
update(java.lang.String updatedKey,
java.lang.String newValue)
(non-Javadoc)
|
copy, getDescription, getId, getName, setDescription, unregister
getClass, notify, notifyAll, toString, wait, wait, wait
unregister
getDescription, getId, getName, setDescription
public GeometryComponent()
Creates an empty list of IShapes and ComponentListeners
public void setName(java.lang.String name)
This operation overrides the ICEObject.setName() operation and provides an update notification in addition to setting the name.
setName
in interface Identifiable
setName
in class ICEObject
name
- The new ICEObject ID
Identifiable.setName(String name)
public void setId(int id)
This operation overrides the ICEObject.setId() operation and provides an update notification in addition to setting the id.
setId
in interface Identifiable
setId
in class ICEObject
id
- The new ICEObject ID
Identifiable.setId(int id)
public void addShape(IShape shape)
Adds an IShape to the shape list
shape
- The new shape to be added to the existing list
public void removeShape(IShape shape)
Removes the given IShape if it exists in the shape list
shape
- The IShape reference to be removed from the shapes list
public java.util.ArrayList<IShape> getShapes()
Returns a list of all IShapes stored in the shapes list
The list of shapes contained in this GeometryComponent container
public void setShapes(java.util.ArrayList<IShape> shapes)
shapes
- The shapes list to replace the existing shapes list
public int hashCode()
This operation returns the hashcode value of the GeometryComponent.
hashCode
in interface Identifiable
hashCode
in class ICEObject
The hashcode of the ICEObject.
Identifiable.hashCode()
public boolean equals(java.lang.Object otherObject)
This operation is used to check equality between this GeometryComponent and another GeometryComponent. It returns true if the GeometryComponents are equal and false if they are not.
equals
in interface Identifiable
equals
in class ICEObject
otherObject
- The other ICEObject that should be compared with this one.
True if the ICEObjects are equal, false otherwise.
Identifiable.equals(Object otherObject)
public void copy(GeometryComponent iceObject)
This operation copies the contents of a GeometryComponent into the current object using a deep copy.
iceObject
- The ICEObject from which the values should be copied
public java.lang.Object clone()
This operation returns a clone of the GeometryComponent using a deep copy.
clone
in interface Identifiable
clone
in class ICEObject
The new clone
public void update(java.lang.String updatedKey, java.lang.String newValue)
update
in interface IUpdateable
update
in class ICEObject
updatedKey
- A unique key that describes the value that to be updated.
newValue
- The updated value of the key.
IUpdateable.update(String updatedKey, String newValue)
public void register(IUpdateableListener listener)
register
in interface IUpdateable
register
in class ICEObject
listener
- The new listener that should be notified when the the Component's state changes.
IUpdateable.register(IUpdateableListener listener)
public void accept(IComponentVisitor visitor)
accept
in interface Component
visitor
- The visitor
Component.accept(IComponentVisitor visitor)
public void update(IUpdateable component)
IUpdateableListener
This operation notifies the listener that an update has occurred in the Component.
update
in interface IUpdateableListener
component
- The component that was updated in some way.