Class Primitive
- java.lang.Object
-
- jadex.extension.envsupport.observer.graphics.drawable.AbstractVisual2D
-
- jadex.extension.envsupport.observer.graphics.drawable.Primitive
-
- Direct Known Subclasses:
RegularPolygon
,Text
,TexturedRectangle
public class Primitive extends AbstractVisual2D
-
-
Field Summary
Fields Modifier and Type Field Description static int
ABSOLUTE_POSITION
static int
ABSOLUTE_ROTATION
static int
ABSOLUTE_SIZE
static int
ALIGN_BOTTOM
Bottom Alignmentstatic int
ALIGN_CENTER
Center Alignmentstatic int
ALIGN_LEFT
Left Alignmentstatic int
ALIGN_MIDDLE
Middle Alignmentstatic int
ALIGN_RIGHT
Right Alignmentstatic int
ALIGN_TOP
Top Alignmentprotected java.lang.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 positionprotected boolean
enableDCRot
Enable DrawableCombiner positionprotected boolean
enableDCSize
Enable DrawableCombiner positionprotected int
halign
Horizontal alignmentstatic 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 java.lang.Object[]
renderinfos
Cached render informationprotected int
type
Primitive typeprotected int
valign
Vertical alignment
-
Constructor Summary
Constructors Constructor Description Primitive()
Primitive(int type, java.lang.Object position, java.lang.Object rotation, java.lang.Object size, int absFlags, java.lang.Object c, IParsedExpression drawcondition)
Initializes the drawable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.java.lang.Object
getColor()
Gets the color or color binding of the drawableIParsedExpression
getDrawCondition()
Gets the draw condition.int
getHAlign()
Gets the horizontal alignment.java.lang.Object
getRenderInfo(int infoId)
Returns cached render information.int
getType()
Get the primitive type.int
getVAlign()
Gets the vertical alignment.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(java.lang.Object c)
Sets a new color or binding for the drawablevoid
setDrawCondition(IParsedExpression drawcondition)
Sets the draw condition.void
setHAlign(int halign)
Sets the horizontal alignment.void
setRenderInfo(int infoId, java.lang.Object info)
Sets cached render information.void
setType(int type)
Set the primitive type.void
setVAlign(int valign)
Sets the vertical alignment.-
Methods inherited from class jadex.extension.envsupport.observer.graphics.drawable.AbstractVisual2D
bindPosition, bindRotation, bindSize, getPosition, getRotation, getSize, setPosition, setRotation, setSize
-
-
-
-
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
-
ALIGN_LEFT
public static final int ALIGN_LEFT
Left Alignment- See Also:
- Constant Field Values
-
ALIGN_CENTER
public static final int ALIGN_CENTER
Center Alignment- See Also:
- Constant Field Values
-
ALIGN_RIGHT
public static final int ALIGN_RIGHT
Right Alignment- See Also:
- Constant Field Values
-
ALIGN_TOP
public static final int ALIGN_TOP
Top Alignment- See Also:
- Constant Field Values
-
ALIGN_MIDDLE
public static final int ALIGN_MIDDLE
Middle Alignment- See Also:
- Constant Field Values
-
ALIGN_BOTTOM
public static final int ALIGN_BOTTOM
Bottom Alignment- 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 java.lang.Object color_
Color or Color binding of the primitive.
-
drawcondition
protected IParsedExpression drawcondition
The condition deciding if the drawable should be drawn.
-
renderinfos
protected java.lang.Object[] renderinfos
Cached render information
-
type
protected int type
Primitive type
-
halign
protected int halign
Horizontal alignment
-
valign
protected int valign
Vertical alignment
-
-
Constructor Detail
-
Primitive
public Primitive()
-
Primitive
public Primitive(int type, java.lang.Object position, java.lang.Object rotation, java.lang.Object size, int absFlags, java.lang.Object c, IParsedExpression drawcondition)
Initializes the drawable.- Parameters:
position
- position or position-bindingxrotation
- xrotation or rotation-bindingyrotation
- yrotation or rotation-bindingzrotation
- zrotation or rotation-bindingsize
- size or size-bindingabsFlags
- flags for setting position, size and rotation as absolutesc
- 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 java.lang.Object getColor()
Gets the color or color binding of the drawable- Returns:
- color or color binding of the drawable
-
setColor
public void setColor(java.lang.Object c)
Sets a new color or binding for the drawable- Parameters:
c
- new color or binding
-
getVAlign
public int getVAlign()
Gets the vertical alignment.- Returns:
- The vertical alignment (top, middle, bottom).
-
setVAlign
public void setVAlign(int valign)
Sets the vertical alignment.- Parameters:
valign
- The vertical alignment (top, middle, bottom).
-
getHAlign
public int getHAlign()
Gets the horizontal alignment.- Returns:
- The horizontal alignment (left, center, right).
-
setHAlign
public void setHAlign(int halign)
Sets the horizontal alignment.- Parameters:
halign
- The horizontal alignment (left, center, right).
-
getRenderInfo
public java.lang.Object getRenderInfo(int infoId)
Returns cached render information.- Parameters:
infoId
- id of the information- Returns:
- render info
-
setRenderInfo
public void setRenderInfo(int infoId, java.lang.Object info)
Sets cached render information.- Parameters:
infoId
- id of the informationinfo
- the render info
-
flushRenderInfo
public void flushRenderInfo()
Flushes the render information.
-
-