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

java.lang.Object
  extended by jadex.application.space.envsupport.observer.graphics.drawable.AbstractVisual2D
      extended by jadex.application.space.envsupport.observer.graphics.drawable.Primitive
Direct Known Subclasses:
RegularPolygon, Text, TexturedRectangle

public class Primitive
extends AbstractVisual2D


Field Summary
static int ABSOLUTE_POSITION
           
static int ABSOLUTE_ROTATION
           
static int ABSOLUTE_SIZE
           
protected  Object color_
          Color or Color binding of the primitive.
protected  IParsedExpression drawcondition
          The condition deciding if the drawable should be drawn.
protected  boolean enableDCPos
          Enable DrawableCombiner position
protected  boolean enableDCRot
          Enable DrawableCombiner position
protected  boolean enableDCSize
          Enable DrawableCombiner position
static int PRIMITIVE_TYPE_ELLIPSE
           
static int PRIMITIVE_TYPE_RECTANGLE
           
static int PRIMITIVE_TYPE_REGULARPOLYGON
           
static int PRIMITIVE_TYPE_TEXT
           
static int PRIMITIVE_TYPE_TEXTUREDRECTANGLE
           
static int PRIMITIVE_TYPE_TRIANGLE
           
protected  Object[] renderinfos
          Cached render information
protected  int type
          Primitive type
 
Constructor Summary
Primitive()
           
Primitive(int type, Object position, Object rotation, Object size, int absFlags, Object c, IParsedExpression drawcondition)
          Initializes the drawable.
 
Method Summary
 void enableAbsolutePosition(boolean enable)
          Enables using absolute positioning.
 void enableAbsoluteRotation(boolean enable)
          Enables using absolute rotation.
 void enableAbsoluteSize(boolean enable)
          Enables using absolute scaling.
 void flushRenderInfo()
          Flushes the render information.
 Object getColor()
          Gets the color or color binding of the drawable
 IParsedExpression getDrawCondition()
          Gets the draw condition.
 Object getRenderInfo(int infoId)
          Returns cached render information.
 int getType()
          Get the primitive type.
 boolean isRelativePosition()
          Tests if primitive is using relative positioning.
 boolean isRelativeRotation()
          Tests if primitive is using relative rotation.
 boolean isRelativeSize()
          Tests if primitive is using relative scaling.
 void setColor(Object c)
          Sets a new color or binding for the drawable
 void setDrawCondition(IParsedExpression drawcondition)
          Sets the draw condition.
 void setRenderInfo(int infoId, Object info)
          Sets cached render information.
 void setType(int type)
          Set the primitive type.
 
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

ABSOLUTE_POSITION

public static final int ABSOLUTE_POSITION
See Also:
Constant Field Values

ABSOLUTE_SIZE

public static final int ABSOLUTE_SIZE
See Also:
Constant Field Values

ABSOLUTE_ROTATION

public static final int ABSOLUTE_ROTATION
See Also:
Constant Field Values

PRIMITIVE_TYPE_ELLIPSE

public static final int PRIMITIVE_TYPE_ELLIPSE
See Also:
Constant Field Values

PRIMITIVE_TYPE_RECTANGLE

public static final int PRIMITIVE_TYPE_RECTANGLE
See Also:
Constant Field Values

PRIMITIVE_TYPE_REGULARPOLYGON

public static final int PRIMITIVE_TYPE_REGULARPOLYGON
See Also:
Constant Field Values

PRIMITIVE_TYPE_TEXT

public static final int PRIMITIVE_TYPE_TEXT
See Also:
Constant Field Values

PRIMITIVE_TYPE_TEXTUREDRECTANGLE

public static final int PRIMITIVE_TYPE_TEXTUREDRECTANGLE
See Also:
Constant Field Values

PRIMITIVE_TYPE_TRIANGLE

public static final int PRIMITIVE_TYPE_TRIANGLE
See Also:
Constant Field Values

enableDCPos

protected boolean enableDCPos
Enable DrawableCombiner position


enableDCSize

protected boolean enableDCSize
Enable DrawableCombiner position


enableDCRot

protected boolean enableDCRot
Enable DrawableCombiner position


color_

protected Object color_
Color or Color binding of the primitive.


drawcondition

protected IParsedExpression drawcondition
The condition deciding if the drawable should be drawn.


renderinfos

protected Object[] renderinfos
Cached render information


type

protected int type
Primitive type

Constructor Detail

Primitive

public Primitive()

Primitive

public Primitive(int type,
                 Object position,
                 Object rotation,
                 Object size,
                 int absFlags,
                 Object c,
                 IParsedExpression drawcondition)
Initializes the drawable.

Parameters:
position - position or position-binding
xrotation - xrotation or rotation-binding
yrotation - yrotation or rotation-binding
zrotation - zrotation or rotation-binding
size - size or size-binding
absFlags - flags for setting position, size and rotation as absolutes
c - the drawable's color or color binding
Method Detail

getType

public int getType()
Get the primitive type.

Returns:
The type.

setType

public void setType(int type)
Set the primitive type.

Parameters:
type - The type to set.

enableAbsolutePosition

public void enableAbsolutePosition(boolean enable)
Enables using absolute positioning.

Parameters:
enable - true, to use the drawable's value as an absolute.

enableAbsoluteSize

public void enableAbsoluteSize(boolean enable)
Enables using absolute scaling.

Parameters:
enable - true, to use the drawable's value as an absolute.

enableAbsoluteRotation

public void enableAbsoluteRotation(boolean enable)
Enables using absolute rotation.

Parameters:
enable - true, to use the drawable's value as an absolute.

isRelativePosition

public boolean isRelativePosition()
Tests if primitive is using relative positioning.

Returns:
true, if the drawable's value is an absolute.

isRelativeSize

public boolean isRelativeSize()
Tests if primitive is using relative scaling.

Returns:
true, if the drawable's value is an absolute.

isRelativeRotation

public boolean isRelativeRotation()
Tests if primitive is using relative rotation.

Returns:
true, if the drawable's value is an absolute.

setDrawCondition

public void setDrawCondition(IParsedExpression drawcondition)
Sets the draw condition.

Parameters:
drawcondition - the draw condition

getDrawCondition

public IParsedExpression getDrawCondition()
Gets the draw condition.

Returns:
the draw condition

getColor

public Object getColor()
Gets the color or color binding of the drawable

Returns:
color or color binding of the drawable

setColor

public void setColor(Object c)
Sets a new color or binding for the drawable

Parameters:
c - new color or binding

getRenderInfo

public Object getRenderInfo(int infoId)
Returns cached render information.

Parameters:
infoId - id of the information
Returns:
render info

setRenderInfo

public void setRenderInfo(int infoId,
                          Object info)
Sets cached render information.

Parameters:
infoId - id of the information
info - the render info

flushRenderInfo

public void flushRenderInfo()
Flushes the render information.



Copyright © 2010. All Rights Reserved.