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
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
The IsShowing property determines whether the associated ChartLabel
is currently visible. Default value is true.
Name |
Method |
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 ChartCanvas.
|
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 ChartCanvas.
|
Background
|
The Background property determines the foreground color used to draw
inside the chart region. Note that the Background property is inherited
from the parent ChartCanvas.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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).
|
IsShowing
|
-
CENTER
-
-
DEG_0
-
-
DEG_180
-
-
DEG_270
-
-
DEG_90
-
-
LEFT
-
-
RIGHT
-
-
ChartText()
- Public constructor for ChartText.
-
ChartText(ChartCanvas, JCString)
-
-
ChartText(ChartCanvas, String, boolean)
- 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.
-
getRotation()
- Gets the value of the Rotation property, which controls the
rotation of the label.
-
getText()
- Gets the value of the Text property.
-
recalc()
- Recalculates the extents of the label.
-
setAdjust(int)
- Sets the Adjust property, which determines how text is
justified (positioned) in the label.
-
setParent(ChartCanvas)
- Connects the chart region to a ChartCanvas.
-
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.
LEFT
public final static int LEFT
CENTER
public final static int CENTER
RIGHT
public final static int RIGHT
DEG_0
public final static int DEG_0
DEG_90
public final static int DEG_90
DEG_180
public final static int DEG_180
DEG_270
public final static int DEG_270
ChartText
public ChartText()
- Public constructor for ChartText. Creates a parentless
ChartText that can be attached to any JCChart component.
ChartText
public ChartText(ChartCanvas p,
String lab,
boolean jcstring)
- A smart ChartText constructor; it knows how to deal with
JCString, String and ChartText objects passed in.
ChartText
public ChartText(ChartCanvas p,
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 synchronized 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 synchronized 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 synchronized void setText(String nc)
- Sets the Text property.
- Parameters:
- nc - new string contents of the ChartText instance. If
the jcstring parameter is true, nc is parsed as a JCString.
- jcstring - if true, the string is converted to a JCString.
Otherwise, the raw text is used in the label.
setText
public synchronized 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.
recalc
public void recalc()
- Recalculates the extents of the label.
- Overrides:
- recalc in class ChartRegion
setParent
public synchronized void setParent(ChartCanvas p)
- Connects the chart region to a ChartCanvas.
- Parameters:
- p - parent chart canvas
- Overrides:
- setParent in class ChartRegion
All Packages Class Hierarchy This Package Previous Next Index