JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class JCValueLabel

java.lang.Object
  |
  +--com.klg.jclass.chart.JCValueLabel
All Implemented Interfaces:
Serializable

public class JCValueLabel
extends Object
implements Serializable

A JCValueLabel is an association between a floating-point axis value and a ChartText. JCValueLabels are used to implement the VALUE_LABELS annotation method, in which axis labels are determined by the axis values the user indicates should be labelled.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.chart.JCAnno anno
           
protected  com.klg.jclass.chart.JCDataIndex dataIndex
           
protected  boolean drawGrid
           
protected  boolean drawLabel
           
protected  boolean drawTick
           
protected  com.klg.jclass.chart.ChartText label
           
protected  double value
           
 
Constructor Summary
  JCValueLabel()
          Default constructor required for JavaBeans.
  JCValueLabel(double val, String lbl)
          Internal constructor that creates a value label given a value and a String.
  JCValueLabel(double val, String lbl, com.klg.jclass.chart.JCAxis axis)
          A smart constructor that creates a ChartText from a generic object.
  JCValueLabel(double val, String lbl, com.klg.jclass.chart.JCAxis axis, boolean drawTick, boolean drawLabel, boolean drawGrid)
          Internal constructor.
  JCValueLabel(com.klg.jclass.chart.JCAnno anno, double val)
          Internal constructor that creates a value Label from a JCAnno object.
protected JCValueLabel(com.klg.jclass.chart.JCAxis parent, double val, int prec)
          Convenience constructor for use within JClass Chart.
protected JCValueLabel(com.klg.jclass.chart.JCAxis parent, int exponent, int prec)
          Convenience constructor used by JClass Chart to create value labels for log values.
 
Method Summary
 com.klg.jclass.chart.JCAnno getAnno()
          Retrieves the JCAnno associated with this JCValueLabel.
 com.klg.jclass.chart.ChartText getChartText()
          Retrieves the ChartText associated with this JCValueLabel.
protected  com.klg.jclass.chart.JCDataIndex getDataIndex()
          Get the stored data index for this value label.
 String getText()
          Gets the value of the Text property.
 double getValue()
          Gets the value of the Value property.
 boolean isDrawGrid()
          Is a grid line drawn for this value label?
 boolean isDrawLabel()
          Ist the label drawn for this value label?
 boolean isDrawTick()
          Is the tick drawn for this value label?
 void setAnno(com.klg.jclass.chart.JCAnno anno)
          Sets the JCAnno property for this JCValueLabel.
protected  void setDataIndex(com.klg.jclass.chart.JCDataIndex dataIndex)
          Set the stored data index for this value label.
 void setDrawGrid(boolean drawGrid)
          Set whether the grid line is drawn for this value label.
 void setDrawLabel(boolean drawLabel)
          Set whether the label is drawn for this value label.
 void setDrawTick(boolean drawTick)
          Set whether the tick is drawn for this value label.
protected  void setParent(com.klg.jclass.chart.JCAxis ax)
          Sets the parent for the JCValueLabel instance.
 void setText(String t)
          Sets the value of the Text property.
 void setValue(double nv)
          Sets the value of the Value property.
 String toString()
          Override toString to return the text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected double value

label

protected com.klg.jclass.chart.ChartText label

drawTick

protected boolean drawTick

drawLabel

protected boolean drawLabel

drawGrid

protected boolean drawGrid

anno

protected com.klg.jclass.chart.JCAnno anno

dataIndex

protected com.klg.jclass.chart.JCDataIndex dataIndex
Constructor Detail

JCValueLabel

public JCValueLabel()
Default constructor required for JavaBeans.


JCValueLabel

public JCValueLabel(double val,
                    String lbl,
                    com.klg.jclass.chart.JCAxis axis)
A smart constructor that creates a ChartText from a generic object.

Parameters:
val - floating-point axis value
lbl - String to use as the value label
axis - axis on which the value label will appear
See Also:
ChartText

JCValueLabel

public JCValueLabel(double val,
                    String lbl,
                    com.klg.jclass.chart.JCAxis axis,
                    boolean drawTick,
                    boolean drawLabel,
                    boolean drawGrid)
Internal constructor.

Parameters:
val - floating-point axis value
lbl - String to use as the value label
axis - axis on which the value label will appear
drawTick - If true, a tick is drawn for this JCValueLabel.
drawLabel - If true, the ChartText will be drawn.
drawGrid - If true, a grid line will be drawn at this label.

JCValueLabel

public JCValueLabel(double val,
                    String lbl)
Internal constructor that creates a value label given a value and a String.

Parameters:
val - floating-point axis value
lbl - string to use as the value label

JCValueLabel

public JCValueLabel(com.klg.jclass.chart.JCAnno anno,
                    double val)
Internal constructor that creates a value Label from a JCAnno object.


JCValueLabel

protected JCValueLabel(com.klg.jclass.chart.JCAxis parent,
                       double val,
                       int prec)
Convenience constructor for use within JClass Chart. Uses the precision to create a formatted String.

Parameters:
parent - pointer to the parent axis object
val -
prec - precision to send to label generator

JCValueLabel

protected JCValueLabel(com.klg.jclass.chart.JCAxis parent,
                       int exponent,
                       int prec)
Convenience constructor used by JClass Chart to create value labels for log values.

Parameters:
parent - pointer to the parent axis object
exponent - power of 10 to be used to generate the label
prec - precision to send to label generator
Method Detail

getChartText

public com.klg.jclass.chart.ChartText getChartText()
Retrieves the ChartText associated with this JCValueLabel.

Returns:
ChartText instance

getAnno

public com.klg.jclass.chart.JCAnno getAnno()
Retrieves the JCAnno associated with this JCValueLabel.

Returns:
JCAnno instance

setAnno

public void setAnno(com.klg.jclass.chart.JCAnno anno)
Sets the JCAnno property for this JCValueLabel.


getValue

public double getValue()
Gets the value of the Value property.

The Value property controls the position of a label in data space along a particular axis.

Returns:
data-space value.

setValue

public void setValue(double nv)
Sets the value of the Value property.

The Value property controls the position of a label in data space along a particular axis.

Parameters:
nv - data-space value

getText

public String getText()
Gets the value of the Text property.

The Text property specifies the text displayed inside the label.

Returns:
String representing the text inside the label. This String can be unparsed text.

setText

public void setText(String t)
Sets the value of the Text property.

The Text property specifies the text displayed inside the label.

Parameters:
t - String representing the text inside the label. This String can be unparsed text.

setParent

protected void setParent(com.klg.jclass.chart.JCAxis ax)
Sets the parent for the JCValueLabel instance. Internal only.

Parameters:
ax - axis on which the value label will appear

toString

public String toString()
Override toString to return the text

Overrides:
toString in class Object
Returns:
The text for this value label.

isDrawTick

public boolean isDrawTick()
Is the tick drawn for this value label?

Returns:
true, if the tick is drawn.

setDrawTick

public void setDrawTick(boolean drawTick)
Set whether the tick is drawn for this value label.

Parameters:
drawTick - The new value of drawTick.

isDrawGrid

public boolean isDrawGrid()
Is a grid line drawn for this value label?

Returns:
true, if a grid line is drawn.

setDrawGrid

public void setDrawGrid(boolean drawGrid)
Set whether the grid line is drawn for this value label.

Parameters:
drawGrid - The new value of drawGrid.

isDrawLabel

public boolean isDrawLabel()
Ist the label drawn for this value label?

Returns:
true, if the label is drawn.

setDrawLabel

public void setDrawLabel(boolean drawLabel)
Set whether the label is drawn for this value label.

Parameters:
drawLabel - The new value of drawLabel.

getDataIndex

protected com.klg.jclass.chart.JCDataIndex getDataIndex()
Get the stored data index for this value label. Used to store the dataView, series, point information to point back to where this label was generated.

Returns:
The current data index object.

setDataIndex

protected void setDataIndex(com.klg.jclass.chart.JCDataIndex dataIndex)
Set the stored data index for this value label. Used to store the dataView, series, point information to point back to where this label was generated.

Parameters:
dataIndex - The new data index object.

Copyright © 2004 Quest Software Inc..
All rights reserved.