public class Custom2DShape extends AbstractShape
This is a class for custom 2D shapes that can be manually constructed via the Mesh Editor. A shape comprises several polygons that together form a single mesh.
iComponentVisitor
iComponentListener
Constructor and Description |
---|
Custom2DShape()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptShapeVisitor(IShapeVisitor visitor)
Calls back onto the visitor's visit() operation, revealing the concrete
type of the IShape
|
void |
addPolygon(Polygon polygon)
Adds a Polygon to the Custom2DShape.
|
java.lang.Object |
clone()
This operation returns a clone of the Custom2DShape using a deep copy.
|
void |
copy(Custom2DShape otherObject)
This operation copies the contents of a Custom2DShape into the current
object using a deep copy.
|
boolean |
equals(java.lang.Object otherObject)
This operation is used to check equality between this Custom2DShape and
another Custom2DShape.
|
java.util.ArrayList<Polygon> |
getPolygons()
Gets the collection of polygons composing the Custom2DShape.
|
int |
hashCode()
This operation returns the hash value of the Custom2DShape.
|
void |
removePolygon(Polygon polygon)
Removes a Polygon from the Custom2DShape.
|
void |
setPolygons(java.util.ArrayList<Polygon> polygons)
Sets the collection of polygons composing the Custom2DShape.
|
void |
update(java.lang.String updatedKey,
java.lang.String newValue)
(non-Javadoc)
|
accept, copy, getParent, getProperty, getTransformation, removeProperty, setProperty, setTransformation
copy, getDescription, getId, getName, register, setDescription, setId, setName, unregister
getClass, notify, notifyAll, toString, wait, wait, wait
register, unregister
getDescription, getId, getName, setDescription, setId, setName
public java.util.ArrayList<Polygon> getPolygons()
Gets the collection of polygons composing the Custom2DShape.
The collection of Polygon2Ds composing a Custom2DShape.
public void setPolygons(java.util.ArrayList<Polygon> polygons)
Sets the collection of polygons composing the Custom2DShape.
polygons
- The collection of Polygon2Ds that will compose the Custom2DShape.
public void addPolygon(Polygon polygon)
Adds a Polygon to the Custom2DShape.
polygon
- The polygon that will be added to the Custom2DShape.
public void removePolygon(Polygon polygon)
Removes a Polygon from the Custom2DShape.
polygon
- The polygon that will be removed from the Custom2DShape.
public int hashCode()
This operation returns the hash value of the Custom2DShape.
hashCode
in interface Identifiable
hashCode
in class AbstractShape
The hash of the Object.
Identifiable.hashCode()
public boolean equals(java.lang.Object otherObject)
This operation is used to check equality between this Custom2DShape and another Custom2DShape. It returns true if the Custom2DShapes are equal and false if they are not.
equals
in interface Identifiable
equals
in class AbstractShape
otherObject
- The other Object that should be compared with this one.
True if the Objects are equal, false otherwise.
Identifiable.equals(Object otherObject)
public void copy(Custom2DShape otherObject)
This operation copies the contents of a Custom2DShape into the current object using a deep copy.
otherObject
- The Object from which the values should be copied.
public java.lang.Object clone()
This operation returns a clone of the Custom2DShape 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)
ICEObject
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 acceptShapeVisitor(IShapeVisitor visitor)
IShape
Calls back onto the visitor's visit() operation, revealing the concrete type of the IShape
The name of this operation is changed from the typical naming conventions of the visitor pattern to avoid conflicts with the Component::accept() operation.
visitor
- The IShapeVisitor to call back in order to reveal the type of this IShape