|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.chart3d.JCStyle | +--com.klg.jclass.chart3d.JCSymbolStyle
JCSymbolStyle
controls the appearance of points in a scatter
plot by allowing the modification of the symbol shape, symbol color, and
symbol size.
Field Summary | |
static String |
BOX
|
static String |
CIRCLE
|
protected Color |
color
The symbol color. |
protected int |
colorIndex
The index into the default color for this object. |
static String |
CONE
|
static String |
CROSS
|
static String |
CUBE
|
static String |
CYLINDER
|
static int |
DEFAULT_SIZE
The default size of a symbol. |
protected static String[] |
defaultShapes
The default shape list (intialized to the standard default array). |
static String |
DIAMOND
|
static String |
DOT
|
static String |
HORIZ_LINE
|
static String |
NONE
The following are predefined shapes for the Java2D implementation. |
static String |
POINT
|
static String |
RECTANGLE
|
protected String |
shape
The symbol shape. |
protected int |
shapeIndex
The index into the default shape array for this object. |
protected int |
size
The symbol size in pixels. |
static String |
SPHERE
The following are predefined shapes for the Java3D implementation. |
static String |
SQUARE
|
static String |
STAR
|
static Hashtable |
symbolInstances
Keeps a static table of symbol instances. |
static String |
TETRAHEDRON
|
static String |
TRIANGLE
|
static String |
VERT_LINE
|
Fields inherited from class com.klg.jclass.chart3d.JCStyle |
defaultColors, FILL_STYLE, LINE_STYLE, parent, SYMBOL_STYLE |
Constructor Summary | |
JCSymbolStyle(String shape,
Color color,
int size)
Constructor for symbol style objects. |
Method Summary | |
void |
draw(Graphics gc,
int x,
int y)
Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance. |
void |
draw(Graphics gc,
int x,
int y,
Color col)
Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance. |
void |
draw(Graphics gc,
int x,
int y,
int sz)
Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance. |
void |
draw(Graphics gc,
int x,
int y,
int sz,
Color col)
Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance. |
Color |
getColor()
Gets the Color property of JCSymbolStyle , which
determines the color used to paint the symbols. |
int |
getColorIndex()
Returns the index used to generate the color. |
protected static String |
getDefaultShape(com.klg.jclass.chart3d.JCChart3d c)
Gets the current default shape for this chart based on its default shape index. |
static String[] |
getDefaultShapes()
Allows access to the default shape list. |
String |
getShape()
Gets the Shape property. |
int |
getSize()
Gets the Size property. |
static com.klg.jclass.chart3d.shape.JCSymbolShape |
getSymbolShapeInstance(String shape)
Gets an instance of a symbol shape object for a given shape. |
static com.klg.jclass.chart3d.JCSymbolStyle |
makeDefault(com.klg.jclass.chart3d.JCChart3d c)
Creates a default symbol style. |
void |
setColor(Color color)
Sets the Color property of JCSymbolStyle , which
determines the color used to paint the symbols. |
static void |
setDefault2dShapes(String[] newShapes)
Uses a new default 2d shapes array. |
static void |
setDefault3dShapes(String[] newShapes)
Uses a new default 3d shapes array. |
void |
setShape(String shape)
Sets the Shape property. |
void |
setSize(int size)
Sets the Size property of JCSymbolStyle , which
determines the size of the symbols. |
static int |
shapeToIndex(String shape)
Gets a default shape's index from its String value. |
Methods inherited from class com.klg.jclass.chart3d.JCStyle |
getDefaultColors, setDefaultColors |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String shape
protected int colorIndex
protected int shapeIndex
protected Color color
protected int size
public static final int DEFAULT_SIZE
public static Hashtable symbolInstances
public static final String NONE
public static final String DOT
public static final String BOX
public static final String TRIANGLE
public static final String DIAMOND
public static final String STAR
public static final String VERT_LINE
public static final String HORIZ_LINE
public static final String CROSS
public static final String CIRCLE
public static final String SQUARE
public static final String RECTANGLE
public static final String SPHERE
public static final String CUBE
public static final String CONE
public static final String POINT
public static final String CYLINDER
public static final String TETRAHEDRON
protected static String[] defaultShapes
Constructor Detail |
public JCSymbolStyle(String shape, Color color, int size)
shape
- symbol shape (one of NONE
, DOT
, BOX
,
TRIANGLE
, DIAMOND
, STAR
, VERT_LINE
,
HORIZ_LINE
, CROSS
, CIRCLE
, or SQUARE
)color
- symbol colorsize
- symbol sizeMethod Detail |
public static com.klg.jclass.chart3d.JCSymbolStyle makeDefault(com.klg.jclass.chart3d.JCChart3d c)
c
- the chart for which to generate the default symbol style
JCSymbolStyle
object with default color and symbol
style. The defaults are cycled, so consecutive calls will return
different symbol styles.public static String[] getDefaultShapes()
public static void setDefault2dShapes(String[] newShapes)
newShapes
- the new default shapes arraypublic static void setDefault3dShapes(String[] newShapes)
newShapes
- the new default shapes arraypublic static int shapeToIndex(String shape)
shape
- the shape for which to get the index
defaultShapes
array of the shape (returns -1 if
not found)public void draw(Graphics gc, int x, int y)
JCSymbolStyle
instance.
gc
- graphics context to use for drawingx
- x position of symbol (in pixels)y
- y position of symbol (in pixels)public void draw(Graphics gc, int x, int y, Color col)
JCSymbolStyle
instance.
gc
- graphics context to use for drawingx
- x position of symbol (in pixels)y
- y position of symbol (in pixels)col
- the color to draw withpublic void draw(Graphics gc, int x, int y, int sz)
JCSymbolStyle
instance.
gc
- graphics context to use for drawingx
- x position of symbol (in pixels)y
- y position of symbol (in pixels)sz
- size of the symbolpublic void draw(Graphics gc, int x, int y, int sz, Color col)
JCSymbolStyle
instance.
gc
- graphics context to use for drawingx
- x position of symbol (in pixels)y
- y position of symbol (in pixels)sz
- size of the symbolcol
- the color to draw withpublic String getShape()
Shape
property. The Shape
property
determines the shape of symbol that will be drawn.
NONE
, DOT
, BOX
, TRIANGLE
,
DIAMOND
, STAR
, VERT_LINE
, HORIZ_LINE
,
CROSS
, CIRCLE
, SQUARE
or RECTANGLE
public void setShape(String shape)
Shape
property. The Shape
property
determines the shape of symbol that will be drawn.
shape
- one of NONE
, DOT
, BOX
, TRIANGLE
,
DIAMOND
, STAR
, VERT_LINE
, HORIZ_LINE
,
CROSS
, CIRCLE
, SQUARE
or RECTANGLE
public Color getColor()
Color
property of JCSymbolStyle
, which
determines the color used to paint the symbols.
Graphics
object is used.public void setColor(Color color)
Color
property of JCSymbolStyle
, which
determines the color used to paint the symbols.
color
- AWT Color class representing the color to be used to paint the
symbols. If null, the current color of the Graphics
object is used.public int getSize()
Size
property.
The Size
property determines the size of the symbols.
public void setSize(int size)
Size
property of JCSymbolStyle
, which
determines the size of the symbols.
size
- positive integer representing sizeprotected static String getDefaultShape(com.klg.jclass.chart3d.JCChart3d c)
c
-
public int getColorIndex()
public static com.klg.jclass.chart3d.shape.JCSymbolShape getSymbolShapeInstance(String shape)
hashTable
. If it exists in the table, use it. If not, create a
new instance and store it in the table.
shape
- the shape whose value points to a class to instantiate
JCSymbolShape
interface, ready for
use
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |