JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class JCShape

java.lang.Object
  |
  +--com.klg.jclass.chart.JCShape
Direct Known Subclasses:
Diamond, Triangle

public abstract class JCShape
extends Object

JCShape is an abstract base class used for defining custom point styles in JClass Chart. To create a new shape class, extend JCShape and provide a resize() method. The resize() method must populate the x[] and y[] arrays with point values for the shape to be drawn. The point values are relative to (0,0). Chart will automatically move the shape to the appropriate location.


Field Summary
protected  int size
          Size of the point.
protected  int[] x
          Array of x values.
protected  int[] y
          Array of y values.
 
Constructor Summary
JCShape()
           
 
Method Summary
 void draw(Graphics gc, double xorg, double yorg)
          Draws the point at the specified floating point pixel coordinates.
 void draw(Graphics gc, int xorg, int yorg)
          Draws the point at the specified integer pixel coordinates.
protected abstract  void resize(int sz)
          Populates the x[] and y[] arrays based on the provided size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected int size
Size of the point. Used inside resize() to populate x[] and y[]


x

protected int[] x
Array of x values.


y

protected int[] y
Array of y values.

Constructor Detail

JCShape

public JCShape()
Method Detail

resize

protected abstract void resize(int sz)
Populates the x[] and y[] arrays based on the provided size.

Parameters:
sz - value to be assigned to size member variable

draw

public void draw(Graphics gc,
                 int xorg,
                 int yorg)
Draws the point at the specified integer pixel coordinates.

Parameters:
gc - graphics context to use for drawing
xorg - x origin point as an integer
yorg - y origin point as an integer

draw

public void draw(Graphics gc,
                 double xorg,
                 double yorg)
Draws the point at the specified floating point pixel coordinates.

Parameters:
gc - graphics context to use for drawing
xorg - x origin point as a double
yorg - y origin point as a double

Copyright © 2004 Quest Software Inc..
All rights reserved.