public class FXAttachment extends BasicAttachment
JavaFX implementation of GeometryAttachment.
Constructor and Description |
---|
FXAttachment(IAttachmentManager manager)
Creates an FXGeometryAttachment instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addGeometry(Geometry geom)
Adds a Geometry instance to this entity.
|
void |
addGeometry(IController geom)
Adds a Geometry instance 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.
|
javafx.scene.Group |
getFxNode() |
javafx.scene.Node |
getFxParent() |
java.util.List<IController> |
getKnownPartControllers()
Get the list of all modeling parts which have been added to this
attachment.
|
java.util.List<Geometry> |
getKnownParts()
Get the list of all modeling parts which have been added to this
attachment.
|
IAttachmentManager |
getManager() |
java.lang.String |
getName() |
java.util.List<INode> |
getShapes(boolean copy)
Returns a list of the shapes associated with this entity.
|
java.lang.Class<?> |
getType()
Returns the class type of the attachment.
|
boolean |
isSingleton()
If the attachment is a singleton, only a single instance of the
attachment can be attached to any given node.
|
void |
processShape(INode shape)
Generates JavaFX shapes from the input IShape.
|
void |
removeGeometry(Geometry geom)
Removes a geometry from those displayed in the model.
|
void |
setVisible(boolean visible)
Sets the entity to be visible or not visible in the scene.
|
addShape, getRender, getRenderedNodes, getShape, hasShape, isImmutable, isVisible, removeShape, setImmutable
getOwner
public FXAttachment(IAttachmentManager manager)
Creates an FXGeometryAttachment instance.
manager
- the manager that created this instance.public java.util.List<IController> getKnownPartControllers()
public java.util.List<Geometry> getKnownParts()
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 BasicAttachment
owner
- the node to attach toBasicAttachment.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 BasicAttachment
owner
- the node to detach fromIAttachment.detach(INode)
public boolean isSingleton()
IAttachment
If the attachment is a singleton, only a single instance of the attachment can be attached to any given node.
isSingleton
in interface IAttachment
isSingleton
in class Attachment
IAttachment.isSingleton()
public void setVisible(boolean visible)
IModelPart
Sets the entity to be visible or not visible in the scene.
setVisible
in interface IModelPart
setVisible
in class BasicAttachment
visible
- if true, the entity will be made visible otherwise the entity
will not be visibleIModelPart.setVisible(boolean)
public void addGeometry(IController geom)
IModelPart
Adds a Geometry instance to this entity.
addGeometry
in interface IModelPart
addGeometry
in class BasicAttachment
geom
- an ICE Geometry instanceIModelPart.addGeometry(Geometry)
public void addGeometry(Geometry geom)
IModelPart
addGeometry
in interface IModelPart
addGeometry
in class BasicAttachment
geom
- Geometry instanceIModelPart.addGeometry(Geometry)
public void processShape(INode shape)
Generates JavaFX shapes from the input IShape.
shape
- an ICE Geometry IShapepublic java.util.List<INode> getShapes(boolean copy)
IModelPart
Returns a list of the shapes associated with this entity.
Optionally, a copy can be made of the list.
getShapes
in interface IModelPart
getShapes
in class BasicAttachment
copy
- public void clearShapes()
IModelPart
Removes all shapes associated with this entity.
clearShapes
in interface IModelPart
clearShapes
in class BasicAttachment
public IAttachmentManager getManager()
public javafx.scene.Node getFxParent()
public javafx.scene.Group getFxNode()
public java.lang.Class<?> getType()
IAttachment
Returns the class type of the attachment. Note that this may not be the same as the concrete type.
public java.lang.String getName()
public void removeGeometry(Geometry geom)
IModelPart
geom
- The geometry to be removed.