public abstract class

Element

extends Object
implements Renderable Resettable Cloneable
java.lang.Object
   ↳ casmi.graphics.element.Element
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Element class. Wrap JOGL and make it easy to use.

Summary

Fields
public boolean enableMask
protected boolean enableTexture
protected boolean fill
protected double fillBlue
protected Color fillColor
protected double fillGreen
protected double fillRed
protected boolean gradation
protected boolean init
protected boolean ismaterial
protected Material material
protected boolean reset
protected double rotate
protected double rotateX
protected double rotateY
protected double scaleX
protected double scaleY
protected double scaleZ
protected Color sceneFillColor
protected Color sceneStrokeColor
protected boolean stroke
protected double strokeBlue
protected Color strokeColor
protected double strokeGreen
protected double strokeRed
protected float strokeWidth
protected boolean visible
protected double x
protected double y
protected double z
Public Constructors
Element()
Public Methods
void addMouseEventCallback(MouseEventCallback callback)
Adds the mosueEventCallback to the Element
Element clone()
void disableMask()
void disableTexture()
Disables the texture.
void enableMask()
void enableTexture()
Enables the texture.
void flip(int mode)
Flips the Element.
Color getFillColor()
Returns the color of this Element's fill.
List<MouseEventCallback> getMouseEventCallbacks()
Returns the callbacks that are added to the Element.
Vector3D getPosition()
Gets the position of the Element.
double getRotation()
Gets the rotation angle round on z-axis.
double getRotationX()
Gets the rotation angle round x-axis.
double getRotationY()
Gets the rotation angle round y-axis.
double getRotationZ()
Gets the rotation angle round z-axis.
double getScaleX()
Gets the scale of x-axis.
double getScaleY()
Gets the scale of y-axis.
double getScaleZ()
Gets the scale of z-axis.
Color getSceneColor(Color color)
Color getSceneFillColor()
Color getSceneStrokeColor()
Color getStrokeColor()
Returns the color of this Element's stroke.
double getStrokeWidth()
Returns the width of this Element's stroke.
double getX()
Gets x-coordinate of the Element.
double getY()
Gets y-coordinate of the Element.
double getZ()
Gets z-coordinate of the Element.
boolean isDepthTest()
boolean isEnableTexture()
Check texture is enable or not.
boolean isFill()
boolean isGradation()
boolean isReset()
boolean isStroke()
boolean isVisible()
void reset(GL2 gl)
void setAlpha(double alpha)
void setDepthTest(boolean depthTest)
void setFill(boolean fill)
Enables or disables filling geometry
void setFillColor(ColorSet colorSet, double alpha)
Sets the color of this Element's fill.
void setFillColor(ColorSet colorSet)
Sets the color of this Element's fill.
void setFillColor(Color color)
Sets the color of this Element's fill.
void setFillColorAlpha(double alpha)
Sets the alpha of this Element's fill.
void setGradation(boolean bool)
void setMaterial(Material m)
Sets Material to this Element
void setPosition(double x, double y, double z)
Sets the position of the Element in 3D.
void setPosition(Vector3D v)
Sets the position of the Element in 2D.
void setPosition(double x, double y)
Sets the position of the Element in 2D.
void setReset(boolean reset)
void setRotation(double angle)
Sets the rotation angle of the Element round on z-axis.
void setRotation(double x, double y, double z)
Sets the rotation angle of the Element.
void setRotation(double angle, double x, double y, double z)
Sets the rotation angle of the Element.
void setRotationX(double angle)
Sets the rotation angle of the Element round on x-axis.
void setRotationY(double angle)
Sets the rotation angle of the Element round on y-axis.
void setRotationZ(double angle)
Sets the rotation angle of the Element round on z-axis.
void setScale(double scale)
Sets the scale of the Element
void setScale(double scaleX, double scaleY, double scaleZ)
Sets the scale of the Element
void setScaleX(double scaleX)
Sets the scale of the Element of x-axis direction.
void setScaleY(double scaleY)
Sets the scale of the Element of y-axis direction.
void setScaleZ(double scaleZ)
Sets the scale of the Element of z-axis direction.
void setSceneAlpha(double alpha)
void setStroke(boolean stroke)
Enables or disables drawing the stroke (outline)
void setStrokeColor(Color color)
Sets the color of this Element's stroke.
void setStrokeColor(ColorSet colorSet)
Sets the color of this Element's stroke.
void setStrokeColor(ColorSet colorSet, double alpha)
Sets the color of this Element's stroke.
void setStrokeColorAlpha(double alpha)
Sets the alpha of this Element's stroke.
void setStrokeWidth(double strokeWidth)
Sets the width of this Element's stroke.
void setVisible(boolean visible)
Modify visibility of the Element.
void setX(double x)
Sets x-coordinate of the Element.
void setY(double y)
Sets y-coordinate of the Element.
void setZ(double z)
Sets z-coordinate of the Element.
void triggerMouseEvent(MouseStatus status, boolean selected)
Protected Methods
void move(GL2 gl)
[Expand]
Inherited Methods
From class java.lang.Object
From interface casmi.graphics.object.Renderable
From interface casmi.graphics.object.Resettable

Fields

public boolean enableMask

protected boolean enableTexture

protected boolean fill

protected double fillBlue

protected Color fillColor

protected double fillGreen

protected double fillRed

protected boolean gradation

protected boolean init

protected boolean ismaterial

protected Material material

protected boolean reset

protected double rotate

protected double rotateX

protected double rotateY

protected double scaleX

protected double scaleY

protected double scaleZ

protected Color sceneFillColor

protected Color sceneStrokeColor

protected boolean stroke

protected double strokeBlue

protected Color strokeColor

protected double strokeGreen

protected double strokeRed

protected float strokeWidth

protected boolean visible

protected double x

protected double y

protected double z

Public Constructors

public Element ()

Public Methods

public void addMouseEventCallback (MouseEventCallback callback)

Adds the mosueEventCallback to the Element

Parameters
callback mouseEventCallback

public Element clone ()

public void disableMask ()

public void disableTexture ()

Disables the texture.

public void enableMask ()

public void enableTexture ()

Enables the texture.

public void flip (int mode)

Flips the Element. You can choose the way of flip with 0 or 1.

Parameters
mode You can choose the way of flip with 0 or 1. If you choose 0, the Element flips round on y-axis. If you choose 1, the Element flips round on x-axis. If you choose other numbers, the Element flips round on z-axis.

public Color getFillColor ()

Returns the color of this Element's fill.

Returns
  • The color of the Element's fill.

public List<MouseEventCallback> getMouseEventCallbacks ()

Returns the callbacks that are added to the Element.

Returns
  • The callbacks that are added to the Element.

public Vector3D getPosition ()

Gets the position of the Element.

Returns
  • the position of the Element

public double getRotation ()

Gets the rotation angle round on z-axis.

Returns
  • The rotation angle round on z-axis

public double getRotationX ()

Gets the rotation angle round x-axis.

Returns
  • The rotation angle round on x-axis

public double getRotationY ()

Gets the rotation angle round y-axis.

Returns
  • The rotation angle round on y-axis

public double getRotationZ ()

Gets the rotation angle round z-axis.

Returns
  • The rotation angle round on z-axis

public double getScaleX ()

Gets the scale of x-axis.

Returns
  • The scale of x-axis

public double getScaleY ()

Gets the scale of y-axis.

Returns
  • The scale of y-axis

public double getScaleZ ()

Gets the scale of z-axis.

Returns
  • The scale of z-axis

public Color getSceneColor (Color color)

public Color getSceneFillColor ()

public Color getSceneStrokeColor ()

public Color getStrokeColor ()

Returns the color of this Element's stroke.

Returns
  • The color of the Element's stroke.

public double getStrokeWidth ()

Returns the width of this Element's stroke.

Returns
  • The width of the Element's stroke.

public double getX ()

Gets x-coordinate of the Element.

Returns
  • x-coordinate

public double getY ()

Gets y-coordinate of the Element.

Returns
  • y-coordinate

public double getZ ()

Gets z-coordinate of the Element.

Returns
  • z-coordinate

public boolean isDepthTest ()

public boolean isEnableTexture ()

Check texture is enable or not.

public boolean isFill ()

public boolean isGradation ()

public boolean isReset ()

public boolean isStroke ()

public boolean isVisible ()

public void reset (GL2 gl)

public void setAlpha (double alpha)

public void setDepthTest (boolean depthTest)

public void setFill (boolean fill)

Enables or disables filling geometry

public void setFillColor (ColorSet colorSet, double alpha)

Sets the color of this Element's fill.

Parameters
colorSet The color of the Element's fill.
alpha The alpha of the Element's fill.

public void setFillColor (ColorSet colorSet)

Sets the color of this Element's fill.

Parameters
colorSet The color of the Element's fill.

public void setFillColor (Color color)

Sets the color of this Element's fill.

Parameters
color The color of the Element's fill.

public void setFillColorAlpha (double alpha)

Sets the alpha of this Element's fill.

Parameters
alpha The color of the Element's fill.

public void setGradation (boolean bool)

public void setMaterial (Material m)

Sets Material to this Element

Parameters
m The Material of this Element.

public void setPosition (double x, double y, double z)

Sets the position of the Element in 3D.

Parameters
x x-coordinate
y y-coordinate
z z-coordinate

public void setPosition (Vector3D v)

Sets the position of the Element in 2D.

Parameters
v the vertex of the position of the Element

public void setPosition (double x, double y)

Sets the position of the Element in 2D.

Parameters
x x-coordinate
y y-coordinate

public void setReset (boolean reset)

public void setRotation (double angle)

Sets the rotation angle of the Element round on z-axis.

Parameters
angle The angle of rotation

public void setRotation (double x, double y, double z)

Sets the rotation angle of the Element.

Parameters
x The rotation angle round x-axis
y The rotation angle round x-axis
z The rotation angle round x-axis

public void setRotation (double angle, double x, double y, double z)

Sets the rotation angle of the Element. This method wraps the glRotate method.

Parameters
angle The angle of rotation
x The rate of rotation angle round x-axis
y The rate of rotation angle round x-axis
z The rate of rotation angle round x-axis

public void setRotationX (double angle)

Sets the rotation angle of the Element round on x-axis.

Parameters
angle The angle of rotation round on x-axis

public void setRotationY (double angle)

Sets the rotation angle of the Element round on y-axis.

Parameters
angle The angle of rotation round on y-axis

public void setRotationZ (double angle)

Sets the rotation angle of the Element round on z-axis.

Parameters
angle The angle of rotation round on z-axis

public void setScale (double scale)

Sets the scale of the Element

Parameters
scale The scale of the Element

public void setScale (double scaleX, double scaleY, double scaleZ)

Sets the scale of the Element

Parameters
scaleX The scale of the Element of x-axis direction
scaleY The scale of the Element of y-axis direction
scaleZ The scale of the Element of z-axis direction

public void setScaleX (double scaleX)

Sets the scale of the Element of x-axis direction.

Parameters
scaleX The scale of the Element of x-axis direction

public void setScaleY (double scaleY)

Sets the scale of the Element of y-axis direction.

Parameters
scaleY The scale of the Element of y-axis direction

public void setScaleZ (double scaleZ)

Sets the scale of the Element of z-axis direction.

Parameters
scaleZ The scale of the Element of z-axis direction

public void setSceneAlpha (double alpha)

public void setStroke (boolean stroke)

Enables or disables drawing the stroke (outline)

public void setStrokeColor (Color color)

Sets the color of this Element's stroke.

Parameters
color The color of the Element's stroke.

public void setStrokeColor (ColorSet colorSet)

Sets the color of this Element's stroke.

Parameters
colorSet The colorSet of the Element's stroke.

public void setStrokeColor (ColorSet colorSet, double alpha)

Sets the color of this Element's stroke.

Parameters
colorSet The colorSet of the Element's stroke.
alpha The alpha of the Element's stroke.

public void setStrokeColorAlpha (double alpha)

Sets the alpha of this Element's stroke.

Parameters
alpha The color of the Element's stroke.

public void setStrokeWidth (double strokeWidth)

Sets the width of this Element's stroke.

Parameters
strokeWidth The width of the Element's stroke.

public void setVisible (boolean visible)

Modify visibility of the Element.

Parameters
visible true to make the Element visible, false to hide the Element.

public void setX (double x)

Sets x-coordinate of the Element.

Parameters
x x-coordinate to set.

public void setY (double y)

Sets y-coordinate of the Element.

Parameters
y y-coordinate to set.

public void setZ (double z)

Sets z-coordinate of the Element.

Parameters
z z-coordinate to set.

public void triggerMouseEvent (MouseStatus status, boolean selected)

Protected Methods

protected void move (GL2 gl)