JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class JCSymbolStyle

java.lang.Object
  |
  +--com.klg.jclass.chart.JCStyle
        |
        +--com.klg.jclass.chart.JCSymbolStyle
All Implemented Interfaces:
Serializable

public class JCSymbolStyle
extends JCStyle

JCSymbolStyle controls the appearance of points in a plot graph by allowing the modification of the symbol shape, symbol color and symbol size.

See Also:
Serialized Form

Field Summary
static int BOX
           
static int CIRCLE
           
protected  Color color
           
protected  int colorIndex
           
static int CROSS
           
protected  com.klg.jclass.chart.JCShape customShape
           
static int DIAMOND
           
static int DOT
           
static int HORIZ_LINE
           
static int LAST
           
static int NONE
           
static int OTHER
           
protected  int shape
           
protected  int shapeIndex
           
protected  int size
           
static int SQUARE
           
static int STAR
           
static int TRIANGLE
           
static int VERT_LINE
           
 
Fields inherited from class com.klg.jclass.chart.JCStyle
defaultColors, parent
 
Constructor Summary
JCSymbolStyle(int tp, Color c, int sz)
          Constructor for symbol style objects.
 
Method Summary
 void draw(Graphics gc, double x, double y, Color col)
          Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance.
 void draw(Graphics gc, double x, double y, int sz, Color col)
          Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance.
 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.
 com.klg.jclass.chart.JCShape getCustomShape()
          Gets the value of the CustomShape property.
 int getShape()
          Gets the Shape property.
 int getSize()
          Gets the Size property.
static com.klg.jclass.chart.JCSymbolStyle makeDefault(com.klg.jclass.chart.JCChart c)
          Creates a default symbol style.
 void setColor(Color clr)
          Sets the Color property of JCSymbolStyle, which determines the color used to paint the symbols.
 void setCustomShape(com.klg.jclass.chart.JCShape ns)
          Sets the value of the CustomShape property.
 void setShape(int tp)
          Sets the Shape property.
 void setSize(int sz)
          Sets the Size property of JCSymbolStyle, which determines the size of the symbols.
 
Methods inherited from class com.klg.jclass.chart.JCStyle
getDefaultColors, setDefaultColors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shape

protected int shape

colorIndex

protected int colorIndex

shapeIndex

protected int shapeIndex

color

protected Color color

size

protected int size

customShape

protected com.klg.jclass.chart.JCShape customShape

NONE

public static final int NONE
See Also:
Constant Field Values

DOT

public static final int DOT
See Also:
Constant Field Values

BOX

public static final int BOX
See Also:
Constant Field Values

TRIANGLE

public static final int TRIANGLE
See Also:
Constant Field Values

DIAMOND

public static final int DIAMOND
See Also:
Constant Field Values

STAR

public static final int STAR
See Also:
Constant Field Values

VERT_LINE

public static final int VERT_LINE
See Also:
Constant Field Values

HORIZ_LINE

public static final int HORIZ_LINE
See Also:
Constant Field Values

CROSS

public static final int CROSS
See Also:
Constant Field Values

CIRCLE

public static final int CIRCLE
See Also:
Constant Field Values

SQUARE

public static final int SQUARE
See Also:
Constant Field Values

OTHER

public static final int OTHER
See Also:
Constant Field Values

LAST

public static final int LAST
See Also:
Constant Field Values
Constructor Detail

JCSymbolStyle

public JCSymbolStyle(int tp,
                     Color c,
                     int sz)
Constructor for symbol style objects.

Parameters:
tp - symbol shape. One of NONE, DOT, BOX, TRIANGLE, DIAMOND, STAR, VERT_LINE, HORIZ_LINE, CROSS, CIRCLE, or SQUARE.
c - symbol color
sz - symbol size
Method Detail

makeDefault

public static com.klg.jclass.chart.JCSymbolStyle makeDefault(com.klg.jclass.chart.JCChart c)
Creates a default symbol style.

Parameters:
c - symbol color
Returns:
JCFillStyle object with default color and symbol style. The defaults are cycled, so consecutive calls will return different symbol styles.

draw

public void draw(Graphics gc,
                 int x,
                 int y)
Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance.

Parameters:
gc - graphics context to use for drawing
x - x position of symbol (in pixels)
y - y position of symbol (in pixels)

draw

public void draw(Graphics gc,
                 int x,
                 int y,
                 Color col)
Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance.

Parameters:
gc - graphics context to use for drawing
x - x position of symbol (in pixels)
y - y position of symbol (in pixels)
col - the color used to draw

draw

public void draw(Graphics gc,
                 double x,
                 double y,
                 Color col)
Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance.

Parameters:
gc - graphics context to use for drawing
x - x position of symbol (in pixels)
y - y position of symbol (in pixels)
col - the color used to draw

draw

public void draw(Graphics gc,
                 int x,
                 int y,
                 int sz)
Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance.

Parameters:
gc - graphics context to use for drawing
x - x position of symbol (in pixels)
y - y position of symbol (in pixels)
sz - size of the symbol

draw

public 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.

Parameters:
gc - graphics context to use for drawing
x - x position of symbol (in pixels)
y - y position of symbol (in pixels)
sz - size of the symbol
col - the color used to draw

draw

public void draw(Graphics gc,
                 double x,
                 double y,
                 int sz,
                 Color col)
Draws a symbol at the specified location, using the properties of the JCSymbolStyle instance.

Parameters:
gc - graphics context to use for drawing
x - x position of symbol (in pixels)
y - y position of symbol (in pixels)
sz - size of the symbol
col - the color used to draw

getShape

public int getShape()
Gets the Shape property.

The Shape property determines the shape of symbol that will be drawn.

Returns:
One of NONE, DOT, BOX, TRIANGLE, DIAMOND, STAR, VERT_LINE, HORIZ_LINE, CROSS, CIRCLE, or SQUARE.

setShape

public void setShape(int tp)
Sets the Shape property.

The Shape property determines the shape of symbol that will be drawn.

Parameters:
tp - one of NONE, DOT, BOX, TRIANGLE, DIAMOND, STAR, VERT_LINE, HORIZ_LINE, CROSS, CIRCLE, or SQUARE.
Throws:
IllegalArgumentException - If the shape value is not one of NONE, DOT, BOX, TRIANGLE, DIAMOND, STAR, VERT_LINE, HORIZ_LINE, CROSS, CIRCLE, or SQUARE.

getColor

public Color getColor()
Gets the Color property of JCSymbolStyle, which determines the color used to paint the symbols.

Returns:
AWT Color class representing the color to be used to paint the symbols. If null, the current color of the Graphics object is used.

setColor

public void setColor(Color clr)
Sets the Color property of JCSymbolStyle, which determines the color used to paint the symbols.

Parameters:
clr - AWT Color class representing the color to be used to paint the symbols. If null, the current color of the Graphics object is used.

getSize

public int getSize()
Gets the Size property.

The Size property determines the size of the symbols. Note that a value of zero size means the symbol will not be drawn.

Returns:
positive integer representing size

setSize

public void setSize(int sz)
Sets the Size property of JCSymbolStyle, which determines the size of the symbols.
Note: A value of zero size means the symbol will not be drawn.

Parameters:
sz - positive integer representing size

getColorIndex

public int getColorIndex()
Returns the index used to generate the color. Only set if default colors used.

Returns:
index used to generate the color

getCustomShape

public com.klg.jclass.chart.JCShape getCustomShape()
Gets the value of the CustomShape property.

The CustomShape property contains an object derived from JCShape that is used to draw symbols.

Returns:
object derived from JCShape that defined the shape to be drawn for the symbols
See Also:
JCShape

setCustomShape

public void setCustomShape(com.klg.jclass.chart.JCShape ns)
Sets the value of the CustomShape property.

The CustomShape property contains an object derived from JCShape that is used to draw symbols.

Parameters:
ns - object derived from JCShape that defined the shape to be drawn for the symbols
See Also:
JCShape

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