|
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.JCChartLabel
JCChartLabel
manages and renders a floating label attached
somewhere on the chart.
Field Summary | |
protected int |
anchor
Instance variables. |
static int |
ATTACH_COORD
|
static int |
ATTACH_DATACOORD
|
static int |
ATTACH_DATAINDEX
|
static int |
ATTACH_NONE
|
protected com.klg.jclass.chart.JCDataIndex |
attachDataIndex
|
protected int |
attachMethod
|
protected Point |
attachPoint
|
protected int |
attachX
|
protected int |
attachY
|
static int |
AUTO
|
static int |
CENTER
|
protected JComponent |
component
|
protected boolean |
connected
|
protected double |
dataAttachX
|
protected double |
dataAttachY
|
protected com.klg.jclass.chart.ChartDataView |
dataView
|
protected String |
defaultText
|
protected int |
dwellDelay
|
protected boolean |
dwellLabel
|
static int |
EAST
|
protected com.klg.jclass.chart.JCChartLabelLine |
line
|
static int |
NORTH
|
static int |
NORTHEAST
|
static int |
NORTHWEST
|
protected int |
offsetX
|
protected int |
offsetY
|
protected com.klg.jclass.chart.JCChartLabelManager |
parent
|
static int |
SOUTH
|
static int |
SOUTHEAST
|
static int |
SOUTHWEST
|
protected String |
text
|
static int |
WEST
|
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 | |
JCChartLabel()
Default constructor for JCChartLabel , required by JavaBeans. |
|
JCChartLabel(String contents)
Constructor for JCChartLabel . |
Method Summary | |
protected void |
addConnectedLine()
Adds the JCChartLabel line component associated with this chart
label to the chart at the appropriate position, right after the component
associated with this chart label. |
protected boolean |
calcConnectingLine(Point linePoint)
Calculates the connecting line. |
protected void |
calcLineBounds(com.klg.jclass.chart.JCChartLabelLine thisLine)
Calculates the connector between the attach point and this chart label. |
void |
drawConnector(Graphics g)
For internal use only. |
int |
getAnchor()
Gets the Anchor property. |
int |
getAttachMethod()
Gets the Attachment Method of the label. |
protected Point |
getAttachPoint()
Gets the point on the chart that this label is attached to. |
JComponent |
getComponent()
Gets the component portion of this chart label. |
Point |
getCoord()
Gets the coordinates that the label is attached to. |
com.klg.jclass.chart.JCDataCoord |
getDataCoord()
Gets the data coordinates that the label is attached to, if the label's attachMethod is ATTACH_DATACOORD . |
com.klg.jclass.chart.JCDataIndex |
getDataIndex()
Gets the data item that the label is attached to. |
com.klg.jclass.chart.ChartDataView |
getDataView()
Gets the data view specified with the setDataView() method. |
protected void |
getDefaultLabel()
|
String |
getDefaultText()
Internal use only. |
com.klg.jclass.chart.ChartDataView |
getEffectiveDataView()
Gets the effective data view, that is the data view that will be used to determine the correct attachment axes for this label. |
Point |
getOffset()
Gets the adjustment to the location of the label relative to the position determined by the attachMethod . |
com.klg.jclass.chart.JCChart |
getParentChart()
Returns the parent chart to this chart label. |
com.klg.jclass.chart.JCChartLabelManager |
getParentManager()
Returns the manager chart to this chart label. |
com.klg.jclass.chart.ChartDataView |
getSetDataView()
Internal use only. |
String |
getSetText()
Internal use only. |
boolean |
isConnected()
Gets a value indicating if this is a label that is connected or not. |
boolean |
isDwellLabel()
Gets the value indicating if this is a dwell label or not. |
void |
recalc()
Determines the correct location of the label and moves there. |
protected void |
removeConnectedLine()
Removes the JCChartLabel line component associated with this
chart label from the chart. |
void |
setAnchor(int a)
Sets the Anchor property. |
void |
setAttachMethod(int newMethod)
Sets the Attachment Method of the label. |
void |
setChanged(boolean c,
int cf)
Sets the value of the Changed property and updates the
parent object. |
void |
setChanged(boolean n,
int cf,
boolean updateParent)
Sets the value of the Changed property. |
void |
setComponent(JComponent comp)
Sets the component portion of this chart label. |
void |
setConnected(boolean b)
Determines whether a line is drawn from the chart label to the attachment position. |
void |
setCoord(Point p)
Sets the coordinates that the label is attached to. |
void |
setDataCoord(com.klg.jclass.chart.JCDataCoord p)
Sets the data coordinates that the label is attached to, if the label's attachMethod is ATTACH_DATACOORD . |
void |
setDataIndex(com.klg.jclass.chart.JCDataIndex di)
Sets the data item that the label is attached to. |
void |
setDataView(com.klg.jclass.chart.ChartDataView dv)
Sets the current data view for this label. |
void |
setDwellLabel(boolean b)
Sets this label to always display, or to display only when the cursor is over the data to which the label is attached. |
void |
setOffset(Point point)
Sets the Offset to adjust the location of the label relative to the position determined by the attachMethod . |
void |
setParentManager(com.klg.jclass.chart.JCChartLabelManager manager)
Sets the parent manager of this chart label. |
void |
setText(String s)
Convenience method for setting text. |
boolean |
shouldPopupHere(com.klg.jclass.chart.JCDataIndex di)
Determines if the label is attached to the specified data index. |
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, toString, wait, wait, wait |
Field Detail |
public static final int NORTHEAST
public static final int NORTH
public static final int NORTHWEST
public static final int EAST
public static final int WEST
public static final int SOUTHEAST
public static final int SOUTH
public static final int SOUTHWEST
public static final int CENTER
public static final int AUTO
public static final int ATTACH_NONE
public static final int ATTACH_COORD
public static final int ATTACH_DATACOORD
public static final int ATTACH_DATAINDEX
protected int anchor
protected int attachMethod
protected int attachX
protected int attachY
protected double dataAttachX
protected double dataAttachY
protected int offsetX
protected int offsetY
protected com.klg.jclass.chart.JCDataIndex attachDataIndex
protected com.klg.jclass.chart.ChartDataView dataView
protected boolean dwellLabel
protected int dwellDelay
protected boolean connected
protected JComponent component
protected com.klg.jclass.chart.JCChartLabelLine line
protected String text
protected String defaultText
protected com.klg.jclass.chart.JCChartLabelManager parent
protected Point attachPoint
Constructor Detail |
public JCChartLabel(String contents)
JCChartLabel
.
contents
- the text to be displayed in the labelpublic JCChartLabel()
JCChartLabel
, required by JavaBeans.
Method Detail |
public void setComponent(JComponent comp)
JComponent
that actually draws on
the chart.
comp
- the component portion of the chart labelpublic JComponent getComponent()
JComponent
that actually draws on the
chart.
public void setText(String s)
JLabel
will be created with the specified text. If a
component already exists and it is a JLabel
, that instance will
be set with the specified text. Otherwise, nothing will happen.
s
- The text to set. If the text is null, text will automatically
be generated.public String getSetText()
public String getDefaultText()
public com.klg.jclass.chart.JCChart getParentChart()
public com.klg.jclass.chart.JCChartLabelManager getParentManager()
public void setParentManager(com.klg.jclass.chart.JCChartLabelManager manager)
manager
- parent managerpublic void recalc()
recalc
in class TrackChange
protected Point getAttachPoint()
public void drawConnector(Graphics g)
g
- protected void calcLineBounds(com.klg.jclass.chart.JCChartLabelLine thisLine)
thisLine
- protected boolean calcConnectingLine(Point linePoint)
true
if line is to be
drawn and the endpoint will be returned in the provided Point
object. Returns false
and doesn't modify the provided point
object if line is not to be drawn.
linePoint
-
true
if the line is to be drawn and the endpoint will
be returned in the provided Point
object; false
otherwise.public void setAnchor(int a)
Anchor
property.
This property determines the position of the
label relative to the its attachment location.
a
- one of NORTH
, SOUTH
,
EAST
, WEST
, NORTHWEST
,
SOUTHWEST
, NORTHEAST
, or SOUTHEAST
IllegalArgumentException
- If the anchor value is not one
of NORTH
, SOUTH
, EAST
,
WEST
, NORTHEAST
, NORTHWEST
,
SOUTHEAST
, SOUTHWEST
, CENTER
or
AUTO
.public int getAnchor()
Anchor
property.
This property determines the position of the
label relative to the its attachment location.
NORTH
, SOUTH
, EAST
,
WEST
, NORTHWEST
, SOUTHWEST
,
NORTHEAST
, SOUTHEAST
, CENTER
or
AUTO
.public void setAttachMethod(int newMethod)
newMethod
- one of ATTACH_NONE
, ATTACH_COORD
,
ATTACH_DATACOORD
, or ATTACH_DATAINDEX
.
ATTACH_NONE
means the label is not shown.
ATTACH_COORD
means the label is attached is screen (pixel)
coordinates relative to the chart.
ATTACH_DATACOORD
means the label is attached in axis
coordinates relative to the associated data view.
ATTACH_DATAINDEX
means the label is attached to a data item.
IllegalArgumentException
- If the anchor value is not one
of ATTACH_NONE
, ATTACH_COORD
,
ATTACH_DATACOORD
, ATTACH_DATAINDEX
.public int getAttachMethod()
ATTACH_NONE
, ATTACH_COORD
,
ATTACH_DATACOORD
, or ATTACH_DATAINDEX
public void setCoord(Point p)
attachMethod
is
ATTACH_COORD
.
p
- the point in chart pixel coordinates where the label is attachedpublic Point getCoord()
public void setDataView(com.klg.jclass.chart.ChartDataView dv)
ATTACH_DATACOORD
AttachMethod
will be attached to. It also specifies
the backup data view to use when a label using the
ATTACH_DATAINDEX
AttachMethod
does not
specify an AttachDataIndex
or does not specify a data
view within the AttachDataIndex
. Data views used to
determine the correct axes against which to position the label.
dv
- the ChartDataView
relative to which the label is
attachedpublic com.klg.jclass.chart.ChartDataView getDataView()
ChartDataView
relative to which
the label is attachedpublic com.klg.jclass.chart.ChartDataView getSetDataView()
ChartDataView
previously set by calling
setDataView. This value may be null.public com.klg.jclass.chart.ChartDataView getEffectiveDataView()
AttachMethod
and AttachDataIndex
properties. The returned value may be
null.
If the label is using an AttachMethod
of
ATTACH_DATAINDEX
, the effective data view is the data
view specified in the AttachDataIndex
property. If this
data view is null or if the label is using another AttachMethod
,
the effective data view is the data view previously set with the
setDataView() method. If this value is also null, the effective
data view is the first data view of the parent chart.
ChartDataView
currently being used to attach
this label. The value may be null.public void setDataCoord(com.klg.jclass.chart.JCDataCoord p)
attachMethod
is ATTACH_DATACOORD
.
p
- the coordinate in chart axis coordinates where the label is attachedpublic com.klg.jclass.chart.JCDataCoord getDataCoord()
attachMethod
is ATTACH_DATACOORD
.
public void setDataIndex(com.klg.jclass.chart.JCDataIndex di)
attachMethod
is
ATTACH_DATAINDEX
.
di
- the data index the label is attached topublic com.klg.jclass.chart.JCDataIndex getDataIndex()
public void setOffset(Point point)
attachMethod
.
point
- the x and y adjustments applied to the calculated
locationpublic Point getOffset()
attachMethod
.
public void setConnected(boolean b)
ATTACH_DATACOORD
or
ATTACH_DATAINDEX
.
b
- if true
, a line is drawn from the chart
label to the attachement position; if false
, the line
will not be drawnpublic boolean isConnected()
true
if this is a connected label; false
if this
is not a connected labelpublic void setDwellLabel(boolean b)
b
- if true
, this is a transient label which will be
displayed only when the mouse is over the data item; if false
,
the label will always be displayedpublic boolean isDwellLabel()
true
if this is a transient label; false
if this
is a 'permanent' labelpublic boolean shouldPopupHere(com.klg.jclass.chart.JCDataIndex di)
JCChart
to determine when the mouse is over a dwell label.
di
-
protected void addConnectedLine()
JCChartLabel
line component associated with this chart
label to the chart at the appropriate position, right after the component
associated with this chart label.
protected void removeConnectedLine()
JCChartLabel
line component associated with this
chart label from the chart.
public void setChanged(boolean c, int cf)
Changed
property and updates the
parent object.
The Changed
property determines whether the object needs
to be recalculated.
setChanged
in interface Changeable
setChanged
in class TrackChange
c
- new value for Changed
cf
- public void setChanged(boolean n, int cf, boolean updateParent)
TrackChange
Changed
property. The Changed
property determines whether the object needs to be recalculated.
setChanged
in interface Changeable
setChanged
in class TrackChange
n
- new value for Changed
cf
- the value with which to update the changed flagupdateParent
- if true
, the parent is updated; otherwise, the parent
is not updated (the "update" semantics are up to the implementor)protected void getDefaultLabel()
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |