All Packages Class Hierarchy This Package Previous Next Index
Class jclass.chart.JCLineStyle
java.lang.Object
|
+----jclass.chart.JCStyle
|
+----jclass.chart.JCLineStyle
- public class JCLineStyle
- extends JCStyle
- implements HTMLHandler
JCLineStyle controls how a line is drawn. It stores
the line pattern and line width, and then
draws lines accordingly.
Properties
Name |
Description |
Color
|
The Color property determines the color used to draw a line. The default value is generated.
|
Pattern
|
The Pattern property dictates the pattern used to draw a line. Valid
values include JCLineStyle.NONE, JCLineStyle.SOLID,
JCLineStyle.LONG_DASH, JCLineStyle.SHORT_DASH, JCLineStyle.LSL_DASH
and JCLineStyle.DASH_DOT. Note: Since Java does not support line
patterns, this property is currently not supported. The default value is JCLineStyle.SOLID.
|
Width
|
The Width property controls the line width. Note: Since Java only
supports width-1 lines, this property is currently not supported.
The default value is 1.
|
-
DASH_DOT
-
-
linePattern_strings
-
-
linePattern_values
-
-
LONG_DASH
-
-
LSL_DASH
-
-
NONE
-
-
SHORT_DASH
-
-
SOLID
-
-
JCLineStyle(int, Color, int)
- Constructor for line style objects.
-
draw(Graphics, int, int, int, int)
- Draws a line between two points according to the properties
of the JCLineStyle instance.
-
drawRect(Graphics, int, int, int, int)
- Performs the requested draw rect given the values of the properties
of the JCLineStyle instance.
-
fillRect(Graphics, int, int, int, int)
- Performs the requested fill given the values of the properties
of the JCLineStyle instance.
-
getColor()
- Gets the Color property of JCLineStyle, which determines the
color used to draw the line.
-
getPattern()
- Gets the Pattern property, which dictates the pattern
used to draw a line.
-
getWidth()
- Gets the Width property, which controls line width.
-
loadParams(String, JCChart)
- Load JCChart parameters from HTML file
-
makeDefault(JCChart)
- Creates a default line style
-
saveParams(String, HTMLSaveDriver)
- Save JCChart parameters as HTML tags
-
setColor(Color)
- Sets the Color property of JCLineStyle, which determines the
color used to draw the line.
-
setPattern(int)
- Sets the Pattern property, which dictates the pattern
used to draw a line.
-
setWidth(int)
- Sets the Width property, which controls line width.
NONE
public static final int NONE
SOLID
public static final int SOLID
LONG_DASH
public static final int LONG_DASH
SHORT_DASH
public static final int SHORT_DASH
LSL_DASH
public static final int LSL_DASH
DASH_DOT
public static final int DASH_DOT
linePattern_strings
public static final String linePattern_strings[]
linePattern_values
public static final int linePattern_values[]
JCLineStyle
public JCLineStyle(int w,
Color c,
int p)
- Constructor for line style objects.
- Parameters:
- w - line width
- c - line color
- p - line pattern. One of NONE, SOLID, LONG_DASH,
LSL_DASH or DASH_DOT.
makeDefault
public static JCLineStyle makeDefault(JCChart c)
- Creates a default line style
- Returns:
- JCLineStyle object with default width, color and
pattern. The defaults are cycled, so consecutive calls
will return different line styles.
draw
public void draw(Graphics gc,
int x1,
int y1,
int x2,
int y2)
- Draws a line between two points according to the properties
of the JCLineStyle instance.
- Parameters:
- gr - graphics context to use for drawing.
- x1 - x value of first point (in pixels)
- y1 - y value of first point (in pixels)
- x2 - x value of second point (in pixels)
- y2 - y value of second point (in pixels)
drawRect
public void drawRect(Graphics gc,
int x,
int y,
int width,
int height)
- Performs the requested draw rect given the values of the properties
of the JCLineStyle instance.
- Parameters:
- gc - graphics context to use for drawing
- x - x origin of rect region (in pixels)
- y - y origin of rect region (in pixels)
- width - width of rect region (in pixels)
- height - height of rect region (in pixels)
fillRect
public void fillRect(Graphics gc,
int x,
int y,
int width,
int height)
- Performs the requested fill given the values of the properties
of the JCLineStyle instance.
- Parameters:
- gc - graphics context to use for drawing
- x - x origin of fill region (in pixels)
- y - y origin of fill region (in pixels)
- width - width of fill region (in pixels)
- height - height of fill region (in pixels)
getPattern
public int getPattern()
- Gets the Pattern property, which dictates the pattern
used to draw a line.
- Returns:
- one of NONE, SOLID, LONG_DASH, SHORT_DASH,
LSL_DASH or DASH_DOT
setPattern
public void setPattern(int p)
- Sets the Pattern property, which dictates the pattern
used to draw a line.
- Parameters:
- p - one of NONE, SOLID, LONG_DASH, SHORT_DASH,
LSL_DASH or DASH_DOT
- Throws: IllegalArgumentException
- If the patter is not one of
NONE, SOLID, LONG_DASH, SHORT_DASH, LSL_DASH or DASH_DOT.
getWidth
public int getWidth()
- Gets the Width property, which controls line width.
- Returns:
- positive integer representing line width
setWidth
public void setWidth(int w)
- Sets the Width property, which controls line width.
- Parameters:
- w - positive integer representing line width
getColor
public Color getColor()
- Gets the Color property of JCLineStyle, which determines the
color used to draw the line.
- Returns:
- AWT Color class representing the color to be used
to draw the lines. If null, the current color of the Graphics
object is used.
setColor
public void setColor(Color clr)
- Sets the Color property of JCLineStyle, which determines the
color used to draw the line.
- Parameters:
- clr - AWT Color class representing the color to be used
to draw the lines. If null, the current color of the Graphics
object is used.
saveParams
public void saveParams(String name,
HTMLSaveDriver comp)
- Save JCChart parameters as HTML tags
- Parameters:
- name - the PARAM NAME
- chart - the JCChart component
loadParams
public void loadParams(String name,
JCChart comp)
- Load JCChart parameters from HTML file
- Parameters:
- name - the PARAM NAME
- chart - the JCChart component
All Packages Class Hierarchy This Package Previous Next Index