All Packages Class Hierarchy This Package Previous Next Index
Class jclass.chart.ChartText
java.lang.Object
|
+----jclass.chart.TrackChange
|
+----jclass.chart.ChartRegion
|
+----jclass.chart.ChartText
- public class ChartText
- extends ChartRegion
- implements JCSerializable, HTMLHandler
Any label that appears on a Chart is a
ChartText. A ChartText can interpret
and contain JCString instances, and can
be rotated by increments of 90 degrees.
If the label is rotated, it will be stored using an
Image. If it is in the normal orientation, it will be
drawn normally, which is slightly more efficient.
Properties
Name |
Description |
Adjust
|
The Adjust property determines how text is justified
(positioned) in the label. Valid values include ChartText.LEFT,
ChartText.CENTER and ChartText.RIGHT. The default value is ChartText.LEFT.
|
Background
|
The Background property determines the background color used to draw
inside the chart region. Note that the Background property is inherited
from the parent ChartRegion.
|
BorderType
|
Determines the style of border drawn around the ChartRegion. Valid
values come from BWTEnum, and include SHADOW_NONE, SHADOW_ETCHED_IN,
SHADOW_ETCHED_OUT, SHADOW_IN, SHADOW_OUT, SHADOW_PLAIN, SHADOW_FRAME_IN,
SHADOW_FRAME_OUT. The default value is BWTEnum.SHADOW_IN.
|
BorderWidth
|
The BorderWidth property determines the width of the border drawn
around the region. The default value is 2.
|
Font
|
The Font property determines what font is used to render text inside
the chart region. Note that the Font property is inherited from the
parent ChartRegion.
|
Foreground
|
The Foreground property determines the foreground color used to draw
inside the chart region. Note that the Foreground property is inherited
from the parent ChartRegion.
|
Height
|
The Height property determines the height of the
ChartRegion. The default value is calculated.
|
HeightIsDefault
|
The HeightIsDefault property determines whether the height
of the chart region is calculated by Chart (true) or
taken from the Height property (false). The default value is true.
|
IsShowing
|
The IsShowing property determines whether the associated ChartRegion
is currently visible. Default value is true.
|
Left
|
The Left property determines the location of the
left of the ChartRegion. The default value is calculated.
|
LeftIsDefault
|
The LeftIsDefault property determines whether the left
position of the chart region is calculated by Chart (true) or
taken from the Left property (false). The default value is true.
|
Name
|
The Name property specifies a string identifier for
the ChartRegion object.
|
Parent
|
The Parent property assures the connection to the chart on which the
ChartRegion appears. Default value is null.
|
ParentRegion
|
The ParentRegion property is the ChartRegion parent. Default value is null.
|
Rotation
|
The Rotation property controls the rotation of the label. Valid values
include ChartText.DEG_90, ChartText.DEG_180, ChartText.DEG_270
and ChartText.DEG_0. The default value is ChartText.DEG_0.
|
Text
|
The Text property is a string property that represents the text
to be displayed inside the chart label. In some cases, the Text
property is used to create a JCString instance. Default value is " " (empty string).
|
Top
|
The Top property determines the location of the
top of the ChartRegion. The default value is calculated.
|
TopIsDefault
|
The TopIsDefault property determines whether the top
position of the chart region is calculated by Chart (true) or
taken from the Top property (false). The default value is true.
|
Width
|
The Width property determines the width of the
ChartRegion. The default value is calculated.
|
WidthIsDefault
|
The WidthIsDefault property determines whether the width
of the chart region is calculated by Chart (true) or
taken from the Width property (false). The default value is true.
|
-
adjust_strings
-
-
adjust_values
-
-
CENTER
-
-
DEG_0
-
-
DEG_180
-
-
DEG_270
-
-
DEG_90
-
-
LEFT
-
-
RIGHT
-
-
rotation_strings
-
-
rotation_values
-
-
ChartText()
- Public constructor for ChartText.
-
ChartText(ChartRegion, JCString)
-
-
ChartText(JCChart, JCString)
-
-
ChartText(JCChart, String, boolean, JCAxis)
- A smart ChartText constructor; it knows how to deal with
JCString, String and ChartText objects passed in.
-
draw(Graphics)
- Renders the chart label using the provided graphics context.
-
getAdjust()
- Gets the Adjust property, which determines how text is
justified (positioned) in the label.
-
getBackground()
- Gets the value of the Background property.
-
getFont()
- Gets the value of the Font property.
-
getForeground()
- Gets the value of the Foreground property.
-
getRotation()
- Gets the value of the Rotation property, which controls the
rotation of the label.
-
getText()
- Gets the value of the Text property.
-
loadParams(String, JCChart)
- Load JCChart parameters from HTML file
-
preferredSize()
- Returns the preferred size for the JCTitle instance.
-
recalc()
- Recalculates the contents of the chart region.
-
saveParams(String, JCChart)
- Save JCChart parameters as HTML tags
-
setAdjust(int)
- Sets the Adjust property, which determines how text is
justified (positioned) in the label.
-
setParent(JCChart)
- Connects the chart region to a JCChart.
-
setRotation(int)
- Sets the Rotation property, which controls the rotation of the label.
-
setText(String)
- Sets the Text property.
-
setText(String, boolean)
- Sets the Text property.
-
setText(String, boolean, boolean)
- Sets the Text property.
LEFT
public static final int LEFT
CENTER
public static final int CENTER
RIGHT
public static final int RIGHT
DEG_0
public static final int DEG_0
DEG_90
public static final int DEG_90
DEG_180
public static final int DEG_180
DEG_270
public static final int DEG_270
adjust_strings
public static final String adjust_strings[]
adjust_values
public static final int adjust_values[]
rotation_strings
public static final String rotation_strings[]
rotation_values
public static final int rotation_values[]
ChartText
public ChartText()
- Public constructor for ChartText. Creates a parentless
ChartText that can be attached to any JCChart component.
ChartText
public ChartText(JCChart p,
String lab,
boolean jcstring,
JCAxis axis)
- A smart ChartText constructor; it knows how to deal with
JCString, String and ChartText objects passed in.
ChartText
public ChartText(JCChart p,
JCString lab)
ChartText
public ChartText(ChartRegion r,
JCString lab)
draw
public void draw(Graphics gc)
- Renders the chart label using the provided graphics context.
- Parameters:
- gc - graphics context
- Overrides:
- draw in class ChartRegion
setRotation
public void setRotation(int rot)
- Sets the Rotation property, which controls the rotation of the label.
- Parameters:
- rot - one of DEG_90, DEG_180, DEG_270 or DEG_0
- Throws: IllegalArgumentException
- If the rotation is not one of
DEG_0, DEG_90, DEG_180 or DEG_270.
getRotation
public int getRotation()
- Gets the value of the Rotation property, which controls the
rotation of the label.
- Returns:
- one of DEG_0, DEG_90, DEG_180 or DEG_270
getAdjust
public int getAdjust()
- Gets the Adjust property, which determines how text is
justified (positioned) in the label.
- Returns:
- one of LEFT, CENTER or RIGHT
setAdjust
public void setAdjust(int justify)
- Sets the Adjust property, which determines how text is
justified (positioned) in the label.
- Parameters:
- justify - one of LEFT, CENTER or RIGHT
- Throws: IllegalArgumentException
- If the text justification is not
one of LEFT, CENTER or RIGHT.
getText
public String getText()
- Gets the value of the Text property. A ChartText can render
plain text, and it can render JCStrings.
- Returns:
- returns a JCString instance if the ChartText is rendering
a JCString, returns a String instance if the ChartText is rendering
plain text, or returns null if the ChartText has no text.
setText
public void setText(String nc)
- Sets the Text property.
- Parameters:
- nc - new string contents of the ChartText instance.
setText
public void setText(String nc,
boolean jcs)
- Sets the Text property.
- Parameters:
- nc - new string contents of the ChartText instance. If
the jcs parameter is true, nc is parsed as a JCString.
- jcs - if true, the string is converted to a JCString.
Otherwise, the raw text is used in the label.
setText
public void setText(String nc,
boolean jcs,
boolean setShowing)
- Sets the Text property.
- Parameters:
- nc - new string contents of the ChartText instance. If
the jcs parameter is true, nc is parsed as a JCString.
- jcs - if true, the string is converted to a JCString.
Otherwise, the raw text is used in the label.
- setShowing - if true, isShowing indication is set to true
recalc
public void recalc()
- Recalculates the contents of the chart region.
- Overrides:
- recalc in class ChartRegion
setParent
public void setParent(JCChart p)
- Connects the chart region to a JCChart.
- Parameters:
- p - parent chart.
- Overrides:
- setParent in class ChartRegion
getForeground
public Color getForeground()
- Gets the value of the Foreground property.
- Overrides:
- getForeground in class ChartRegion
getBackground
public Color getBackground()
- Gets the value of the Background property.
- Overrides:
- getBackground in class ChartRegion
getFont
public Font getFont()
- Gets the value of the Font property.
- Overrides:
- getFont in class ChartRegion
preferredSize
public Dimension preferredSize()
- Returns the preferred size for the JCTitle instance.
- Overrides:
- preferredSize in class ChartRegion
saveParams
public void saveParams(String name,
JCChart comp)
- Save JCChart parameters as HTML tags
- Parameters:
- name - the PARAM NAME
- chart - the JCChart component
- Overrides:
- saveParams in class ChartRegion
loadParams
public void loadParams(String name,
JCChart comp)
- Load JCChart parameters from HTML file
- Parameters:
- name - the PARAM NAME
- chart - the JCChart component
- Overrides:
- loadParams in class ChartRegion
All Packages Class Hierarchy This Package Previous Next Index