|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.chart.TrackChange | +--com.klg.jclass.chart.ChartInteriorRegion | +--com.klg.jclass.chart.ChartText
Any label that appears on a JClass Chart. A ChartText
can be
rotated by increments of 90 degrees. The 2D API is used to rotate the drawn
text.
Field Summary | |
protected int |
adjust
|
protected Image |
buffer
|
static int |
CENTER
|
static int |
DEG_0
|
static int |
DEG_180
|
static int |
DEG_270
|
static int |
DEG_90
|
static int |
DEG_OTHER
|
protected boolean |
isHTML
|
static int |
LEFT
|
protected com.klg.jclass.chart.JCAxis |
parentAxis
|
protected com.klg.jclass.util.swing.TextRenderer |
rendComp
|
static int |
RIGHT
|
protected int |
rotation
|
protected String |
text
|
Fields inherited from class com.klg.jclass.chart.ChartInteriorRegion |
background, dimIsDefaultChangedToTrue, font, foreground, groupingUsed, height, insets, inUpdate, left, name, needsRepaint, numberLocalization, parentChart, parentRegion, top, transparent, updateParent, visible, width |
Fields inherited from class com.klg.jclass.chart.TrackChange |
changed, changedFlag |
Fields inherited from interface com.klg.jclass.chart.Changeable |
BASIC_CHANGE_MASK, NOTIFY_AXES_RECALC, NOTIFY_AXES_REDRAW, NOTIFY_CA_RECALC, NOTIFY_CA_REDRAW, NOTIFY_LEGEND_RECALC, NOTIFY_LEGEND_REDRAW |
Fields inherited from interface com.klg.jclass.util.Changeable |
LAYOUT, NO_CHANGE, NOTIFY_PARENT_LAYOUT, RECALC, REDRAW |
Constructor Summary | |
ChartText()
Public constructor for ChartText . |
|
ChartText(com.klg.jclass.chart.JCChart p,
String lab,
com.klg.jclass.chart.ChartRegion cr)
A smart ChartText constructor; it knows how to deal with
String and ChartText objects passed in. |
|
ChartText(com.klg.jclass.chart.JCChart p,
String lab,
com.klg.jclass.chart.JCAxis axis)
A smart ChartText constructor; it knows how to deal with String
and ChartText objects passed in. |
Method Summary | |
Dimension |
calcLineSize()
Attempts to calculate the size of one line of a multi-line piece of text. |
protected Dimension |
calcSize()
Calculates the size needed to display the existing text in this object. |
void |
draw(Graphics gc)
Renders the chart label using the provided graphics context. |
int |
getAdjust()
Gets the Adjust property, which determines how text is
justified (positioned) in the label. |
Color |
getBackground()
Calculates the desired background color of this ChartText
object. |
Font |
getFont()
Caculates the desired font of this ChartText object. |
FontMetrics |
getFontMetrics(Font f)
Gets the font metrics of the font passed in. |
Color |
getForeground()
Calculates the desired foreground color of this ChartText
object. |
int |
getRotation()
Gets the value of the Rotation property, which specifies the
rotation (counterclockwise ) of the label. |
String |
getText()
Gets the value of the Text property. |
Dimension |
preferredSize()
Gets the preferred size of this ChartText object. |
void |
recalc()
Recalculates the contents of the chart region. |
protected void |
recalc(boolean forceRecalc)
Recalculates the extents of the label. |
void |
setAdjust(int justify)
Sets the Adjust property, which determines how text is
justified (positioned) in the label. |
void |
setParentChart(com.klg.jclass.chart.JCChart p)
Connects the chart region to a JCChart . |
void |
setRotation(int rot)
Sets the Rotation property, which specifies the rotation
(counterclockwise ) of the label. |
void |
setText(String nc)
Sets the Text property. |
void |
setText(String nc,
boolean isVisible)
Sets the Text property. |
String |
toString()
Gets a String version of this object, which is just the ChartText 's text if it is not null. |
Methods inherited from class com.klg.jclass.chart.ChartInteriorRegion |
getDrawingArea, getDrawingArea, getGraphics, getGroupingUsed, getHeight, getHeightIsDefault, getInsets, getLeft, getLeftIsDefault, getName, getNumberFormatter, getNumberLocalization, getParentChart, getParentRegion, getSize, getTop, getTopIsDefault, getWidth, getWidthIsDefault, hide, insets, inside, isVisible, location, repaint, setBackground, setBounds, setChanged, setChanged, setFont, setForeground, setGroupingUsed, setHeight, setHeightIsDefault, setInsets, setLeft, setLeftIsDefault, setLocation, setName, setNumberFormatterLocale, setNumberLocalization, setParentRegion, setSize, setTop, setTopIsDefault, setVisible, setWidth, setWidthIsDefault, show, size, sizeChanged, updateParent |
Methods inherited from class com.klg.jclass.chart.TrackChange |
getChanged, getChanged, isBatched, isChanged, isChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int adjust
protected int rotation
protected String text
protected com.klg.jclass.chart.JCAxis parentAxis
protected boolean isHTML
protected com.klg.jclass.util.swing.TextRenderer rendComp
protected transient Image buffer
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int DEG_0
public static final int DEG_90
public static final int DEG_180
public static final int DEG_270
public static final int DEG_OTHER
Constructor Detail |
public ChartText()
ChartText
. Creates a parentless
ChartText
that can be attached to any JCChart
component.
public ChartText(com.klg.jclass.chart.JCChart p, String lab, com.klg.jclass.chart.JCAxis axis)
ChartText
constructor; it knows how to deal with String
and ChartText
objects passed in.
p
- the parent chartlab
- the text to be used for this ChartText
objectaxis
- the parent axispublic ChartText(com.klg.jclass.chart.JCChart p, String lab, com.klg.jclass.chart.ChartRegion cr)
ChartText
constructor; it knows how to deal with
String and ChartText
objects passed in.
p
- the parent chartlab
- the text to be used for this ChartText
objectcr
- the parent chart regionMethod Detail |
public FontMetrics getFontMetrics(Font f)
f
- the font whose font metrics are required
public void draw(Graphics gc)
draw
in interface com.klg.jclass.chart.Drawable
draw
in class ChartInteriorRegion
gc
- graphics contextpublic void setRotation(int rot)
Rotation
property, which specifies the rotation
(counterclockwise
) of the label.
rot
- one of DEG_90
, DEG_180
,
DEG_270
, or DEG_0
IllegalArgumentException
- If the rotation is not one of
DEG_0
, DEG_90
, DEG_180
, or
DEG_270
.public int getRotation()
Rotation
property, which specifies the
rotation (counterclockwise
) of the label.
DEG_0
, DEG_90
, DEG_180
,
or DEG_270
public int getAdjust()
Adjust
property, which determines how text is
justified (positioned) in the label.
LEFT
, CENTER
, or RIGHT
public void setAdjust(int justify)
Adjust
property, which determines how text is
justified (positioned) in the label.
justify
- one of LEFT
, CENTER
, or
RIGHT
IllegalArgumentException
- If the text justification is not
one of LEFT
, CENTER
, or RIGHT
public String getText()
Text
property. A ChartText
can render plain text.
ChartText
is rendering
plain text, or returns null if the ChartText
has no textpublic void setText(String nc)
Text
property.
nc
- new String contents of the ChartText
instance;
otherwise, the raw text is used in the labelpublic void setText(String nc, boolean isVisible)
Text
property.
nc
- new String contents of the ChartText
instance.isVisible
- if true
, visible indication is set to
true
protected void recalc(boolean forceRecalc)
forceRecalc
- force a recalculationpublic void recalc()
ChartInteriorRegion
recalc
in class ChartInteriorRegion
public void setParentChart(com.klg.jclass.chart.JCChart p)
JCChart
.
setParentChart
in class ChartInteriorRegion
p
- parent chartprotected Dimension calcSize()
public Dimension calcLineSize()
public Color getForeground()
ChartText
object. If no foreground color has been set, we can take the color of the
parent region, the parent axis, or the parent chart.
getForeground
in class ChartInteriorRegion
public Color getBackground()
ChartText
object. If no background color has been set, we can take the color of the
parent axis or the parent chart, if it is not opaque.
getBackground
in class ChartInteriorRegion
public Font getFont()
ChartText
object. If no
font has been set, we can take the font of the parent axis or the parent
chart.
getFont
in class ChartInteriorRegion
public Dimension preferredSize()
ChartText
object.
preferredSize
in class ChartInteriorRegion
public String toString()
ChartText
's text if it is not null.
toString
in class Object
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |