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 intABSOLUTE_POSITIONstatic intABSOLUTE_ROTATIONstatic intABSOLUTE_SIZEstatic intALIGN_BOTTOMBottom Alignmentstatic intALIGN_CENTERCenter Alignmentstatic intALIGN_LEFTLeft Alignmentstatic intALIGN_MIDDLEMiddle Alignmentstatic intALIGN_RIGHTRight Alignmentstatic intALIGN_TOPTop Alignmentprotected java.lang.Objectcolor_Color or Color binding of the primitive.protected IParsedExpressiondrawconditionThe condition deciding if the drawable should be drawn.protected booleanenableDCPosEnable DrawableCombiner positionprotected booleanenableDCRotEnable DrawableCombiner positionprotected booleanenableDCSizeEnable DrawableCombiner positionprotected inthalignHorizontal alignmentstatic intPRIMITIVE_TYPE_ELLIPSEstatic intPRIMITIVE_TYPE_RECTANGLEstatic intPRIMITIVE_TYPE_REGULARPOLYGONstatic intPRIMITIVE_TYPE_TEXTstatic intPRIMITIVE_TYPE_TEXTUREDRECTANGLEstatic intPRIMITIVE_TYPE_TRIANGLEprotected java.lang.Object[]renderinfosCached render informationprotected inttypePrimitive typeprotected intvalignVertical 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 voidenableAbsolutePosition(boolean enable)Enables using absolute positioning.voidenableAbsoluteRotation(boolean enable)Enables using absolute rotation.voidenableAbsoluteSize(boolean enable)Enables using absolute scaling.voidflushRenderInfo()Flushes the render information.java.lang.ObjectgetColor()Gets the color or color binding of the drawableIParsedExpressiongetDrawCondition()Gets the draw condition.intgetHAlign()Gets the horizontal alignment.java.lang.ObjectgetRenderInfo(int infoId)Returns cached render information.intgetType()Get the primitive type.intgetVAlign()Gets the vertical alignment.booleanisRelativePosition()Tests if primitive is using relative positioning.booleanisRelativeRotation()Tests if primitive is using relative rotation.booleanisRelativeSize()Tests if primitive is using relative scaling.voidsetColor(java.lang.Object c)Sets a new color or binding for the drawablevoidsetDrawCondition(IParsedExpression drawcondition)Sets the draw condition.voidsetHAlign(int halign)Sets the horizontal alignment.voidsetRenderInfo(int infoId, java.lang.Object info)Sets cached render information.voidsetType(int type)Set the primitive type.voidsetVAlign(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.
-
-