JClass 4.5.0 API
Documentation

com.klg.jclass.swing.gauge
Class JCNeedleStyle

java.lang.Object
  |
  +--java.awt.Polygon
        |
        +--com.klg.jclass.swing.gauge.JCNeedleStyle

public class JCNeedleStyle
extends Polygon
implements Serializable

Provides constants for the built-in needle styles for a JCNeedle and provides a constructor for passing in a user-defined needle style. Alternatively, custom needle styles may be defined by subclassing.

See Also:
Serialized Form

Field Summary
static JCNeedleStyle ARROW
          Arrow polygon using these points,
protected  Rectangle boundingBox
          min_x, min_y are x and y and max_x and max_y are width and height.
static JCNeedleStyle POINTER
          A pointer needle using these points,
static JCNeedleStyle TAILED_ARROW
          Tailed Arrow polygon (tail extends beyond center)
static JCNeedleStyle TAILED_POINTER
          A tailed pointer needle (tail extends beyond center).
static JCNeedleStyle TRIANGLE
          Triangle using ponits,
 
Fields inherited from class java.awt.Polygon
bounds, npoints, xpoints, ypoints
 
Constructor Summary
JCNeedleStyle()
           
JCNeedleStyle(int[] xpoints, int[] ypoints, int numPoints)
          Construct a needle using the points of a polygon.
 
Method Summary
 Rectangle getExtrema()
          Return the upper-left-most point of the polygon as x, y in the Rectangle and the lower-right-most point as width and height.
 
Methods inherited from class java.awt.Polygon
addPoint, contains, contains, contains, contains, contains, contains, getBoundingBox, getBounds, getBounds2D, getPathIterator, getPathIterator, inside, intersects, intersects, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

boundingBox

protected Rectangle boundingBox
min_x, min_y are x and y and max_x and max_y are width and height.

POINTER

public static final JCNeedleStyle POINTER
A pointer needle using these points,

 new int[] { 0,	0,	90,	100,	90,	0}
 new int[] { -5, 5,	5,	0,		-5,	-5}

 --------------*
 |               \
 |                *
 |               /
 --------------*
 

TAILED_POINTER

public static final JCNeedleStyle TAILED_POINTER
A tailed pointer needle (tail extends beyond center). It uses these points,

 new int[] { -20,		-20,	90,	100,	90,	-20}
 new int[] { -5,		5,		5,	0,		-5,	-5}


 --------------*
 |               \
 |   x(Center)    *
 |               /
 --------------*
 

ARROW

public static final JCNeedleStyle ARROW
Arrow polygon using these points,

 new int[] { 0,	0,	100,	100,	120,	100,	100,	0},
 new int[] { 5, -5,	-5,		-10,	0,		10,		5,		5},


 |\
 --------* \
 |          *
 --------* /
 |/
 

TAILED_ARROW

public static final JCNeedleStyle TAILED_ARROW
Tailed Arrow polygon (tail extends beyond center)

 new int[] { -20,	-20,	100,	100,	120,	100,	100,	-20},
 new int[] { 5, -5,	-5,		-10,	0,		10,		5,		5},


 |\
 ---------------------* \
 |  x(Center)            *
 ---------------------* /
 |/
 

TRIANGLE

public static final JCNeedleStyle TRIANGLE
Triangle using ponits,

 new int[] {0,	100,	0},
 new int[] {-7,	0,		7},

 *
 | \
 |  *
 | /
 *

 
Constructor Detail

JCNeedleStyle

public JCNeedleStyle(int[] xpoints,
                     int[] ypoints,
                     int numPoints)
Construct a needle using the points of a polygon. For a user-defined needle.
Parameters:
xpoints - The x coordinates for the polygon
ypoints - The y coordinates for the polygon
numPoints - The number of points in this polygon

JCNeedleStyle

public JCNeedleStyle()
Method Detail

getExtrema

public Rectangle getExtrema()
Return the upper-left-most point of the polygon as x, y in the Rectangle and the lower-right-most point as width and height.

Copyright© 1999-2000 KL Group Inc.
All rights reserved.