public abstract class GeometryAttachment extends Attachment implements IGeometry
Base for GeometryAttachment implementations, which provide nodes with the ability to display ICE Geometry elements and their constituent IShapes.
Constructor and Description |
---|
GeometryAttachment() |
Modifier and Type | Method and Description |
---|---|
void |
addGeometry(IController geom)
Adds a Geometry instance to this entity.
|
void |
addShape(IController shape)
Adds an IShape to this entity.
|
void |
attach(INode owner)
Adds this instance to the supplied node.
|
void |
clearShapes()
Removes all shapes associated with this entity.
|
void |
detach(INode owner)
Removes this instance from the supplied node.
|
IController |
getShape(int index)
Returns the IShape at the specified index or null if it cannot be found.
|
java.util.List<IController> |
getShapes(boolean copy)
Returns a list of the shapes associated with this entity.
|
boolean |
hasShape(IController shape)
Returns true if the entity contains the supplied IShape, false otherwise.
|
boolean |
isImmutable()
Returns true if the entity is immutable, false otherwise.
|
boolean |
isVisible()
Returns true if the entity is visible, false otherwise.
|
void |
removeShape(IController shape)
Removes the supplied IShape from this entity.
|
void |
setImmutable(boolean immutable)
Sets the entity to be immutable, which means it's values cannot be
changed (no new geometry or shapes).
|
void |
setVisible(boolean visible)
Sets the entity to be visible or not visible in the scene.
|
getOwner, isSingleton
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getType
public void addGeometry(IController geom)
IGeometry
Adds a Geometry instance to this entity.
addGeometry
in interface IGeometry
geom
- an ICE Geometry instanceIGeometry#addGeometry(Geometry)
public void addShape(IController shape)
IGeometry
Adds an IShape to this entity.
public void attach(INode owner)
IAttachment
Adds this instance to the supplied node. The attachment's functionality will be applied to the new owner node.
If the attachment is a singleton, this will replace any existing attachment of the same type.
attach
in interface IAttachment
attach
in class Attachment
owner
- the node to attach toIAttachment.attach(INode)
public void detach(INode owner)
IAttachment
Removes this instance from the supplied node. Any functionality provided by this attachment will be removed from the owner node.
If the supplied node is not attached, this is a no-op.
detach
in interface IAttachment
detach
in class Attachment
owner
- the node to detach fromIAttachment.detach(INode)
public void removeShape(IController shape)
IGeometry
Removes the supplied IShape from this entity.
removeShape
in interface IGeometry
shape
- the ICE IShape to removeIGeometry#addShape(Geometry)
public boolean hasShape(IController shape)
IGeometry
Returns true if the entity contains the supplied IShape, false otherwise.
public IController getShape(int index)
IGeometry
Returns the IShape at the specified index or null if it cannot be found.
public java.util.List<IController> getShapes(boolean copy)
IGeometry
Returns a list of the shapes associated with this entity.
Optionally, a copy can be made of the list.
public void clearShapes()
IGeometry
Removes all shapes associated with this entity.
clearShapes
in interface IGeometry
public void setVisible(boolean visible)
IGeometry
Sets the entity to be visible or not visible in the scene.
setVisible
in interface IGeometry
visible
- if true, the entity will be made visible otherwise the entity
will not be visiblepublic boolean isVisible()
IGeometry
Returns true if the entity is visible, false otherwise.
public boolean isImmutable()
IGeometry
Returns true if the entity is immutable, false otherwise.
isImmutable
in interface IGeometry
public void setImmutable(boolean immutable)
IGeometry
Sets the entity to be immutable, which means it's values cannot be changed (no new geometry or shapes).
setImmutable
in interface IGeometry
immutable
- if true, the entity will be made immutable otherwise the
entity will be mutable