jadex.application.space.envsupport.observer.graphics.drawable
Class DrawableCombiner

java.lang.Object
  extended by jadex.application.space.envsupport.observer.graphics.drawable.AbstractVisual2D
      extended by jadex.application.space.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
protected  Map properties
          The properties
 
Constructor Summary
DrawableCombiner()
          Creates a new DrawableCombiner of size 1.0.
DrawableCombiner(Object position, Object rotation, Object size)
          Creates a new DrawableCombiner of size 1.0.
 
Method Summary
 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(Object obj, Integer layer, IViewport vp)
          Draws the objects to a viewport
 void flushRenderInfo()
          Flushes the render information.
 Object getBoundValue(Object obj, Object prop, IViewport viewport)
          Gets the bound value for a property.
 Set getLayers()
          Returns all layers used by this DrawableCombiner.
 Object getProperty(String name)
          Returns a property.
 Set getPropertyNames()
          Returns all of the properties.
 boolean hasProperty(String name)
           
 void removePrimitive(Primitive p)
          Removes a primitive from all layers in the combiner.
 void setProperty(String name, Object value)
          Sets a property
 
Methods inherited from class jadex.application.space.envsupport.observer.graphics.drawable.AbstractVisual2D
bindPosition, bindRotation, bindSize, getPosition, getRotation, getSize, setPosition, setRotation, setSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected Map properties
The properties

Constructor Detail

DrawableCombiner

public DrawableCombiner()
Creates a new DrawableCombiner of size 1.0.


DrawableCombiner

public DrawableCombiner(Object position,
                        Object rotation,
                        Object size)
Creates a new DrawableCombiner of size 1.0.

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 primitive
layer - the layer
sizeDefining - 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(Object obj,
                 Integer layer,
                 IViewport vp)
Draws the objects to a viewport

Parameters:
obj - object being drawn
layer - the current layer
vp - the viewport

getLayers

public 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 Object getBoundValue(Object obj,
                            Object prop,
                            IViewport viewport)
Gets the bound value for a property.

Returns:
The bound value.

getProperty

public Object getProperty(String name)
Returns a property.

Specified by:
getProperty in interface IPropertyObject
Parameters:
name - name of the property
Returns:
the property

getPropertyNames

public Set getPropertyNames()
Returns all of the properties.

Specified by:
getPropertyNames in interface IPropertyObject
Returns:
the properties

setProperty

public void setProperty(String name,
                        Object value)
Sets a property

Specified by:
setProperty in interface IPropertyObject
Parameters:
name - name of the property
value - value of the property

hasProperty

public boolean hasProperty(String name)
Specified by:
hasProperty in interface IPropertyObject


Copyright © 2010. All Rights Reserved.