Class DrawableCombiner
- java.lang.Object
-
- jadex.extension.envsupport.observer.graphics.drawable.AbstractVisual2D
-
- jadex.extension.envsupport.observer.graphics.drawable.DrawableCombiner
-
- All Implemented Interfaces:
IPropertyObject
public class DrawableCombiner extends AbstractVisual2D implements IPropertyObject
This drawable combines multiple drawables into a single drawable object.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map
properties
The properties
-
Constructor Summary
Constructors Constructor Description DrawableCombiner()
Creates a new DrawableCombiner of size 1.0.DrawableCombiner(java.lang.Object position, java.lang.Object rotation, java.lang.Object size)
Creates a new DrawableCombiner of size 1.0.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPrimitive(Primitive p)
Adds a primitive to the combiner.void
addPrimitive(Primitive p, int layer)
Adds a primitive to the combiner in a specific layer.void
draw(java.lang.Object obj, java.lang.Integer layer, IViewport vp)
Draws the objects to a viewportvoid
flushRenderInfo()
Flushes the render information.java.lang.Object
getBoundValue(java.lang.Object obj, java.lang.Object prop, IViewport viewport)
Gets the bound value for a property.java.util.Set
getLayers()
Returns all layers used by this DrawableCombiner.java.lang.Object
getProperty(java.lang.String name)
Returns a property.java.util.Set
getPropertyNames()
Returns all of the properties.boolean
hasProperty(java.lang.String name)
Tests if the given property name exists If an property isnull
it existsvoid
removePrimitive(Primitive p)
Removes a primitive from all layers in the combiner.void
setProperty(java.lang.String name, java.lang.Object value)
Sets a property-
Methods inherited from class jadex.extension.envsupport.observer.graphics.drawable.AbstractVisual2D
bindPosition, bindRotation, bindSize, getPosition, getRotation, getSize, setPosition, setRotation, setSize
-
-
-
-
Method Detail
-
addPrimitive
public void addPrimitive(Primitive p)
Adds a primitive to the combiner.- Parameters:
p
- the primitive
-
addPrimitive
public void addPrimitive(Primitive p, int layer)
Adds a primitive to the combiner in a specific layer.- Parameters:
p
- the primitivelayer
- the layersizeDefining
- true if the added object should be the size-defining one
-
removePrimitive
public void removePrimitive(Primitive p)
Removes a primitive from all layers in the combiner.- Parameters:
p
- the primitive
-
draw
public void draw(java.lang.Object obj, java.lang.Integer layer, IViewport vp)
Draws the objects to a viewport- Parameters:
obj
- object being drawnlayer
- the current layervp
- the viewport
-
getLayers
public java.util.Set getLayers()
Returns all layers used by this DrawableCombiner.- Returns:
- all layers used by the DrawableCombiner
-
flushRenderInfo
public void flushRenderInfo()
Flushes the render information.
-
getBoundValue
public java.lang.Object getBoundValue(java.lang.Object obj, java.lang.Object prop, IViewport viewport)
Gets the bound value for a property.- Returns:
- The bound value.
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Returns a property.- Specified by:
getProperty
in interfaceIPropertyObject
- Parameters:
name
- name of the property- Returns:
- the property
-
getPropertyNames
public java.util.Set getPropertyNames()
Returns all of the properties.- Specified by:
getPropertyNames
in interfaceIPropertyObject
- Returns:
- the properties
-
setProperty
public void setProperty(java.lang.String name, java.lang.Object value)
Sets a property- Specified by:
setProperty
in interfaceIPropertyObject
- Parameters:
name
- name of the propertyvalue
- value of the property
-
hasProperty
public boolean hasProperty(java.lang.String name)
Description copied from interface:IPropertyObject
Tests if the given property name exists If an property isnull
it exists- Specified by:
hasProperty
in interfaceIPropertyObject
- Parameters:
name
- the name of the property to test- Returns:
true
if and only if the property exists
-
-