JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.swing.gauge
Class JCPolygon

java.lang.Object
  |
  +--java.awt.Polygon
        |
        +--com.klg.jclass.swing.gauge.JCPolygon
All Implemented Interfaces:
Serializable, Shape
Direct Known Subclasses:
JCIndicatorStyle, JCTickStyle

public abstract class JCPolygon
extends Polygon
implements Serializable

Provides an extension of the Polygon class that stores a bounding box for easy access. This is also done so that the bounding box will only have to be calculated once. Both JCIndicatorStyle and JCTickStyle subclass from this abstract class.

See Also:
Serialized Form

Field Summary
protected  Rectangle boundingBox
          min_x, min_y are x and y, and max_x and max_y are width and height.
 
Fields inherited from class java.awt.Polygon
bounds, npoints, xpoints, ypoints
 
Constructor Summary
JCPolygon()
           
JCPolygon(int[] xpoints, int[] ypoints, int numPoints)
          Constructs an indicator using the points of a polygon.
 
Method Summary
 Rectangle getExtrema()
          Returns 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, invalidate, reset, 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.

Constructor Detail

JCPolygon

public JCPolygon(int[] xpoints,
                 int[] ypoints,
                 int numPoints)
Constructs an indicator using the points of a polygon. For a user-defined indicator.

Parameters:
xpoints - the x coordinates for the polygon
ypoints - the y coordinates for the polygon
numPoints - the number of points in this polygon

JCPolygon

public JCPolygon()
Method Detail

getExtrema

public Rectangle getExtrema()
Returns the upper-left-most point of the polygon as x, y in the Rectangle, and the lower-right-most point as width and height. The rectangle is defined to be: x = min_x, y = min_y, width = max_x and height = max_y.

Returns:
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 © 2004 Quest Software Inc..
All rights reserved.