public class

Line

extends Element
java.lang.Object
   ↳ casmi.graphics.element.Element
     ↳ casmi.graphics.element.Line

Class Overview

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

Summary

Constants
int LINES
int LINES_3D
[Expand]
Inherited Fields
From class casmi.graphics.element.Element
Public Constructors
Line()
Creates a new Line object
Line(double x1, double y1, double x2, double y2)
Creates a new Line object using coordinates for the first and second point.
Line(Vector3D v1, Vector3D v2)
Creates a new Line object using coordinates for the first and second point.
Line(double x1, double y1, double z1, double x2, double y2, double z2)
Creates a new Line object using coordinates for the first and second point.
Public Methods
Vector3D getCorner(int index)
Gets coordinates of the point.
double getDashedLineInterval()
double getDashedLinelength()
void render(GL2 gl, GLU glu, int width, int height, boolean selection)
void reset(GL2 gl)
void set(boolean index, double x, double y)
Sets the coordinates for the first or second point.
void set(double x1, double y1, double x2, double y2)
Sets the coordinates for the first and second point.
void set(boolean index, double x, double y, double z)
Sets the coordinates for the first or second point.
void set(double x1, double y1, double z1, double x2, double y2, double z2)
Sets the coordinates for the first and second point.
void set(Vector3D v1, Vector3D v2)
Sets the coordinates for the first and second point.
void setCornerColor(int index, Color color)
Sets the color of the first or second point for gradation.
void setCornerColor(int index, ColorSet colorSet)
Sets the color of the first or second point for gradation.
void setDashedLine(boolean dashed)
void setDashedLinePram(double length, double interval)
Sets the parameter for the dashed line.
[Expand]
Inherited Methods
From class casmi.graphics.element.Element
From class java.lang.Object
From interface casmi.graphics.object.Renderable
From interface casmi.graphics.object.Resettable

Constants

public static final int LINES

Constant Value: 1 (0x00000001)

public static final int LINES_3D

Constant Value: 3 (0x00000003)

Public Constructors

public Line ()

Creates a new Line object

public Line (double x1, double y1, double x2, double y2)

Creates a new Line object using coordinates for the first and second point.

Parameters
x1 The x-coordinates for the first point.
y1 The y-coordinates for the first point.
x2 The x-coordinates for the second point.
y2 The y-coordinates for the second point.

public Line (Vector3D v1, Vector3D v2)

Creates a new Line object using coordinates for the first and second point.

Parameters
v1 The coordinates for the first point.
v2 The coordinates for the second point.

public Line (double x1, double y1, double z1, double x2, double y2, double z2)

Creates a new Line object using coordinates for the first and second point.

Parameters
x1 The x-coordinates for the first point.
y1 The y-coordinates for the first point.
z1 The z-coordinates for the first point.
x2 The x-coordinates for the second point.
y2 The y-coordinates for the second point.
z2 The z-coordinates for the second point.

Public Methods

public Vector3D getCorner (int index)

Gets coordinates of the point.

Parameters
index The index of the point; if the index is 0, the point is first.
Returns
  • The coordinates of the point.

public double getDashedLineInterval ()

public double getDashedLinelength ()

public void render (GL2 gl, GLU glu, int width, int height, boolean selection)

public void reset (GL2 gl)

public void set (boolean index, double x, double y)

Sets the coordinates for the first or second point.

Parameters
index choose the point; if index is true, the point is first.
x The x-coordinate of the first or second control point.
y The y-coordinate of the first or second control point.

public void set (double x1, double y1, double x2, double y2)

Sets the coordinates for the first and second point.

Parameters
x1 The x-coordinates for the first point.
y1 The y-coordinates for the first point.
x2 The x-coordinates for the second point.
y2 The y-coordinates for the second point.

public void set (boolean index, double x, double y, double z)

Sets the coordinates for the first or second point.

Parameters
index choose the point; if index is true, the point is first.
x The x-coordinate of the first or second control point.
y The y-coordinate of the first or second control point.
z The z-coordinate of the first or second control point.

public void set (double x1, double y1, double z1, double x2, double y2, double z2)

Sets the coordinates for the first and second point.

Parameters
x1 The x-coordinates for the first point.
y1 The y-coordinates for the first point.
z1 The z-coordinates for the first point.
x2 The x-coordinates for the second point.
y2 The y-coordinates for the second point.
z2 The z-coordinates for the second point.

public void set (Vector3D v1, Vector3D v2)

Sets the coordinates for the first and second point.

Parameters
v1 The coordinates for the first anchor point.
v2 The coordinates for the first control point.

public void setCornerColor (int index, Color color)

Sets the color of the first or second point for gradation.

Parameters
index The index of the point; if index is 0, the point is first.
color The color of the first or second point.

public void setCornerColor (int index, ColorSet colorSet)

Sets the color of the first or second point for gradation.

Parameters
index The index of the point; if index is 0, the point is first.
colorSet The colorSt of the first or second point.

public void setDashedLine (boolean dashed)

public void setDashedLinePram (double length, double interval)

Sets the parameter for the dashed line.

Parameters
length The length of the dashed lines.
interval The interval of the dashed lines.