Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class LineAttributes

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.NodeComponent
          extended by org.j3d.aviatrix3d.LineAttributes
All Implemented Interfaces:
java.lang.Comparable, AppearanceAttributeRenderable, ObjectRenderable, Renderable

public class LineAttributes
extends NodeComponent
implements AppearanceAttributeRenderable

Describes attributes used when rendering a line.

Default size of a line is 1.0 pixels and is not antialiased. The predefined line types are taken from the ISO internation register of line styles. The definitions can be found at http://jitc.fhu.disa.mil/nitf/graph_reg/graph_reg.htm#LINETYPE.

Internationalisation Resource Names

Version:
$Revision: 1.16 $
Author:
Justin Couch

Field Summary
static short PATTERN_CENTER_LINE
          Predefined line pattern that uses alternating long and short dashes where the beginning and end always end in a long segment.
static short PATTERN_CHAIN_LINE
          Predefined line pattern that uses alternating long and short dashes.
static short PATTERN_DASH
          Predefined line pattern that is a dashed line.
static short PATTERN_DASH_DOT
          Predefined line pattern that is a dash-dot line.
static short PATTERN_DASH_DOT_DOT
          Predefined line pattern that is a dash-dot line.
static short PATTERN_DOT
          Predefined line pattern that is a dotted line.
static short PATTERN_PHANTOM_LINE
          Predefined line pattern that is a long dash, short dash, short dash line with evenly space dashes and the beginning and the end of a line always ending in a dash of the same length.
static short PATTERN_SOLID
          Predefined line pattern that is the normal solid line.
static short PATTERN_STITCH_LINE
          Predefined line pattern that is equal sized dash and space.
 
Fields inherited from class org.j3d.aviatrix3d.NodeComponent
lastParent, liveCount, parentList
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
Fields inherited from interface org.j3d.aviatrix3d.rendering.AppearanceAttributeRenderable
ALPHA_ATTRIBUTE, BLEND_ATTRIBUTE, DEPTH_ATTRIBUTE, LINE_ATTRIBUTE, POINT_ATTRIBUTE, POLYGON_ATTRIBUTE, STENCIL_ATTRIBUTE
 
Constructor Summary
LineAttributes()
          Constructs a attribute set with default values.
 
Method Summary
 int compareTo(LineAttributes la)
          Compares this object with the specified object for order.
 int compareTo(java.lang.Object o)
          Compares this object with the specified object for order.
 boolean equals(LineAttributes la)
          Compares this object with the specified object to check for equivalence.
 boolean equals(java.lang.Object o)
          Compare this object for equality to the given object.
 int getAttributeType()
          Get the type this visual attribute represents.
 float getLineWidth()
          Get the current line size in use.
 short getStipplePattern()
          Get the current line stipple pattern.
 int getStippleScaleFactor()
          Get the current line stipple pattern.
 boolean isAntiAliased()
          Check the state of the antialiased flag setting for this geometry.
 void postRender(javax.media.opengl.GL gl)
          Restore all openGL state to the given drawable.
 void render(javax.media.opengl.GL gl)
          Issue ogl commands needed for this component
 void setAntiAliased(boolean state)
          Set the antialiased flag state.
 void setLineWidth(float size)
          Set the size in pixels of the line size.
 void setStipplePattern(short pattern)
          Set the stipple pattern to be used on the line.
 void setStippleScaleFactor(int scale)
          Set the scale to be applied to the pattern.
 
Methods inherited from class org.j3d.aviatrix3d.NodeComponent
addParent, getParents, numParents, removeParent
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATTERN_SOLID

public static final short PATTERN_SOLID
Predefined line pattern that is the normal solid line. The register identifier number is 1.

See Also:
Constant Field Values

PATTERN_DASH

public static final short PATTERN_DASH
Predefined line pattern that is a dashed line. The pattern is defined as repeated 1110 pattern. The register identifier number is 2.

See Also:
Constant Field Values

PATTERN_DOT

public static final short PATTERN_DOT
Predefined line pattern that is a dotted line. The pattern is defined as repeated 1010 pattern. The register identifier number is 3.

See Also:
Constant Field Values

PATTERN_DASH_DOT

public static final short PATTERN_DASH_DOT
Predefined line pattern that is a dash-dot line. The pattern is defined as repeated 1110 0100 pattern. The register identifier number is 4.

See Also:
Constant Field Values

PATTERN_DASH_DOT_DOT

public static final short PATTERN_DASH_DOT_DOT
Predefined line pattern that is a dash-dot line. The pattern is defined as repeated 1110 1010 pattern. The register identifier number is 5.

See Also:
Constant Field Values

PATTERN_STITCH_LINE

public static final short PATTERN_STITCH_LINE
Predefined line pattern that is equal sized dash and space. The pattern is defined as repeated 1100 1100 pattern. The register identifier number is 9.

See Also:
Constant Field Values

PATTERN_CHAIN_LINE

public static final short PATTERN_CHAIN_LINE
Predefined line pattern that uses alternating long and short dashes. The pattern is defined as repeated 1111 0110 pattern. The register identifier number is 10.

See Also:
Constant Field Values

PATTERN_CENTER_LINE

public static final short PATTERN_CENTER_LINE
Predefined line pattern that uses alternating long and short dashes where the beginning and end always end in a long segment. The pattern is defined as repeated 1111 1011 1101 1111 pattern. The register identifier number is 11.

See Also:
Constant Field Values

PATTERN_PHANTOM_LINE

public static final short PATTERN_PHANTOM_LINE
Predefined line pattern that is a long dash, short dash, short dash line with evenly space dashes and the beginning and the end of a line always ending in a dash of the same length. The pattern is defined as 1110 1110 1110 1111. The register identifier number is 13.

See Also:
Constant Field Values
Constructor Detail

LineAttributes

public LineAttributes()
Constructs a attribute set with default values.

Method Detail

getAttributeType

public int getAttributeType()
Get the type this visual attribute represents.

Specified by:
getAttributeType in interface AppearanceAttributeRenderable
Returns:
One of the _ATTRIBUTE constants

render

public void render(javax.media.opengl.GL gl)
Issue ogl commands needed for this component

Specified by:
render in interface ObjectRenderable
Parameters:
gl - The gl context to draw with

postRender

public void postRender(javax.media.opengl.GL gl)
Restore all openGL state to the given drawable.

Specified by:
postRender in interface ObjectRenderable
Parameters:
gl - The gl context to draw with

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The objec to be compared
Returns:
-1, 0 or 1 depending on order
Throws:
java.lang.ClassCastException - The specified object's type prevents it from being compared to this Object

equals

public boolean equals(java.lang.Object o)
Compare this object for equality to the given object.

Specified by:
equals in interface Renderable
Overrides:
equals in class java.lang.Object
Parameters:
o - The object to be compared
Returns:
True if these represent the same values

setAntiAliased

public void setAntiAliased(boolean state)
                    throws InvalidWriteTimingException
Set the antialiased flag state. By antialiasing is off.

Parameters:
state - True to use antialiasing, false to turn it off
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

isAntiAliased

public boolean isAntiAliased()
Check the state of the antialiased flag setting for this geometry.

Returns:
true if antialiasing is currently enabled

setLineWidth

public void setLineWidth(float size)
                  throws InvalidWriteTimingException
Set the size in pixels of the line size. Line size must be greater than zero.

Parameters:
size - The size of the line in pixels
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method
java.lang.IllegalArgumentException - Line size was non-positive

getLineWidth

public float getLineWidth()
Get the current line size in use.

Returns:
A value greater than zero

setStipplePattern

public void setStipplePattern(short pattern)
                       throws InvalidWriteTimingException
Set the stipple pattern to be used on the line. A value of zero will clear the current stipple pattern and return to a normal line.

Parameters:
pattern - The bit pattern used to draw the line
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getStipplePattern

public short getStipplePattern()
Get the current line stipple pattern. A zero value indicates no stipple is applied.

Returns:
A value greater than zero

setStippleScaleFactor

public void setStippleScaleFactor(int scale)
                           throws InvalidWriteTimingException
Set the scale to be applied to the pattern. By default a dot is a single pixel, while a dash is three pixels. This scale can change how big the values are. The default value is 1.

Parameters:
scale - The scale factor to apply to the pattern
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getStippleScaleFactor

public int getStippleScaleFactor()
Get the current line stipple pattern. A zero value indicates no stipple is applied.

Returns:
A value greater than zero

compareTo

public int compareTo(LineAttributes la)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Parameters:
la - The attributes instance to be comlared
Returns:
-1, 0 or 1 depending on order

equals

public boolean equals(LineAttributes la)
Compares this object with the specified object to check for equivalence.

Parameters:
la - The attributes instance to be compared
Returns:
true if the objects represent identical values

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org