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.


Variable Index

 o adjust_strings
 o adjust_values
 o CENTER
 o DEG_0
 o DEG_180
 o DEG_270
 o DEG_90
 o LEFT
 o RIGHT
 o rotation_strings
 o rotation_values

Constructor Index

 o ChartText()
Public constructor for ChartText.
 o ChartText(ChartRegion, JCString)
 o ChartText(JCChart, JCString)
 o ChartText(JCChart, String, boolean, JCAxis)
A smart ChartText constructor; it knows how to deal with JCString, String and ChartText objects passed in.

Method Index

 o draw(Graphics)
Renders the chart label using the provided graphics context.
 o getAdjust()
Gets the Adjust property, which determines how text is justified (positioned) in the label.
 o getBackground()
Gets the value of the Background property.
 o getFont()
Gets the value of the Font property.
 o getForeground()
Gets the value of the Foreground property.
 o getRotation()
Gets the value of the Rotation property, which controls the rotation of the label.
 o getText()
Gets the value of the Text property.
 o loadParams(String, JCChart)
Load JCChart parameters from HTML file
 o preferredSize()
Returns the preferred size for the JCTitle instance.
 o recalc()
Recalculates the contents of the chart region.
 o saveParams(String, JCChart)
Save JCChart parameters as HTML tags
 o setAdjust(int)
Sets the Adjust property, which determines how text is justified (positioned) in the label.
 o setParent(JCChart)
Connects the chart region to a JCChart.
 o setRotation(int)
Sets the Rotation property, which controls the rotation of the label.
 o setText(String)
Sets the Text property.
 o setText(String, boolean)
Sets the Text property.
 o setText(String, boolean, boolean)
Sets the Text property.

Variables

 o LEFT
 public static final int LEFT
 o CENTER
 public static final int CENTER
 o RIGHT
 public static final int RIGHT
 o DEG_0
 public static final int DEG_0
 o DEG_90
 public static final int DEG_90
 o DEG_180
 public static final int DEG_180
 o DEG_270
 public static final int DEG_270
 o adjust_strings
 public static final String adjust_strings[]
 o adjust_values
 public static final int adjust_values[]
 o rotation_strings
 public static final String rotation_strings[]
 o rotation_values
 public static final int rotation_values[]

Constructors

 o ChartText
 public ChartText()
Public constructor for ChartText. Creates a parentless ChartText that can be attached to any JCChart component.

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

 o ChartText
 public ChartText(JCChart p,
                  JCString lab)
 o ChartText
 public ChartText(ChartRegion r,
                  JCString lab)

Methods

 o draw
 public void draw(Graphics gc)
Renders the chart label using the provided graphics context.

Parameters:
gc - graphics context
Overrides:
draw in class ChartRegion
 o 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.
 o 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
 o 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
 o 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.
 o 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.
 o setText
 public void setText(String nc)
Sets the Text property.

Parameters:
nc - new string contents of the ChartText instance.
 o 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.
 o 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
 o recalc
 public void recalc()
Recalculates the contents of the chart region.

Overrides:
recalc in class ChartRegion
 o setParent
 public void setParent(JCChart p)
Connects the chart region to a JCChart.

Parameters:
p - parent chart.
Overrides:
setParent in class ChartRegion
 o getForeground
 public Color getForeground()
Gets the value of the Foreground property.

Overrides:
getForeground in class ChartRegion
 o getBackground
 public Color getBackground()
Gets the value of the Background property.

Overrides:
getBackground in class ChartRegion
 o getFont
 public Font getFont()
Gets the value of the Font property.

Overrides:
getFont in class ChartRegion
 o preferredSize
 public Dimension preferredSize()
Returns the preferred size for the JCTitle instance.

Overrides:
preferredSize in class ChartRegion
 o 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
 o 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