JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d.shape
Class BaseShape

java.lang.Object
  |
  +--com.klg.jclass.chart3d.shape.BaseShape
All Implemented Interfaces:
JCSymbolShape, Serializable
Direct Known Subclasses:
Box, Circle, Cross, Diamond, Dot, HorizontalLine, Rectangle, Square, Star, Triangle, VerticalLine

public abstract class BaseShape
extends Object
implements JCSymbolShape, Serializable

BaseShape is an abstract base class used for defining custom point styles in Chart 3D. To create a new shape class, extend BaseShape 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.

See Also:
Serialized Form

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
BaseShape()
           
 
Method Summary
 void draw(Graphics gc, int xorg, int yorg)
          Draws the symbol at the specified coordinates using the x[] and y[] arrays.
abstract  String getName()
          Return a localized name for this shape
 void resize(int size)
          Method used for setting the size of the shape.
 
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. For some symbols, used inside resize() to populate the x[] and y[] arrays


x

protected int[] x
Array of x values


y

protected int[] y
Array of y values

Constructor Detail

BaseShape

public BaseShape()
Method Detail

getName

public abstract String getName()
Return a localized name for this shape

Specified by:
getName in interface JCSymbolShape
Returns:
The name of this shape

resize

public void resize(int size)
Method used for setting the size of the shape. For Triangle and Diamond this is use for populating the x[] and y[] arrays based on the provided size.

Specified by:
resize in interface JCSymbolShape
Parameters:
size - value to be assigned to size member variable

draw

public void draw(Graphics gc,
                 int xorg,
                 int yorg)
Draws the symbol at the specified coordinates using the x[] and y[] arrays.

Specified by:
draw in interface JCSymbolShape
Parameters:
gc - graphics context to use for drawing
xorg - x origin point
yorg - y origin point

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