JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d
Class JCValueLabel

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

public class JCValueLabel
extends Object
implements Cloneable, Serializable

A JCValueLabel is an association between a floating-point axis value and a label.

See Also:
Serialized Form

Field Summary
protected  boolean allowUpdates
          Allow updates (in other words, repaints) on user changes
protected  com.klg.jclass.chart3d.JCAxis axis
          The parent JCAxis who tracks changes in this object.
protected  Color background
          The value label's background color (null means don't draw a background).
protected  Color foreground
          The value label's foreground color (null means use plotcube's foreground).
protected  int index
          The index in the value labels array.
protected  String label
          The text for this value label.
protected  boolean labelDrawn
          Asks if the label drawn is for this value label.
protected  boolean minorTick
          Only a minor tick is drawn for this label if true (if tickDrawn = true).
protected  boolean tickDrawn
          Asks if the tick drawn is for this value label.
protected  double value
          The value on the axis for this label.
 
Constructor Summary
JCValueLabel()
          Default constructor required for Beans.
JCValueLabel(double value, String label)
          Constructor that creates a value label given a value and a String.
JCValueLabel(double value, String label, boolean tickOnly)
          This constructor exists for backwards compatibility only.
JCValueLabel(double value, String label, boolean labelDrawn, boolean tickDrawn, boolean minorTick)
          Constructor that creates a value label given a value, a String, and a boolean minorTick that dictates that no label is to be drawn for this value label, only a minor tick (labelDrawn is set to false).
 
Method Summary
 Object clone()
          Overrides clone in class Object.
 com.klg.jclass.chart3d.JCAxis getAxis()
          Returns the axis to which this value label belongs.
 Color getBackground()
          Returns the background color for this value label.
 Color getForeground()
          Returns the foreground color for this value label.
 int getIndex()
          Gets the index into the internal value labels array for this value label.
 String getLabel()
          Gets the value of the Label property.
 double getValue()
          Gets the value of the Value property.
 boolean isLabelDrawn()
          Asks if the label drawn is for this value label.
 boolean isMinorTick()
          Asks if a major or minor tick is drawn for this value label.
 boolean isTickDrawn()
          Asks if the tick drawn is for this value label.
 boolean isTickOnly()
          Deprecated. As of JClass 6.0. Use the labelDrawn, tickDrawn, and minorTick properties instead.
protected  void setAxis(com.klg.jclass.chart3d.JCAxis axis)
          Sets the axis to which this value label belongs.
 void setBackground(Color background)
          Sets the background color for this value label.
protected  void setChanged(boolean b, int cf)
          Tells the parent (if there is one) that a change has happened.
 void setForeground(Color foreground)
          Sets the foreground color for this value label.
protected  void setIndex(int index)
          Sets the index into the internal value labels array for this value label.
 void setLabel(String label)
          Sets the value of the Label property.
 void setLabelDrawn(boolean labelDrawn)
          Sets whether the label for this value label should be drawn.
 void setMinorTick(boolean minorTick)
          Sets whether a major of minor tick is drawn for this value label.
 void setTickDrawn(boolean tickDrawn)
          Sets whether the tick for this value label should be drawn.
 void setTickOnly(boolean tickOnly)
          Deprecated. As of JClass 6.0. Use the labelDrawn, tickDrawn, and minorTick properties instead.
 void setValue(double value)
          Sets the value of the Value property.
 String toString()
          Overrides the toString method.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected double value
The value on the axis for this label.


label

protected String label
The text for this value label.


tickDrawn

protected boolean tickDrawn
Asks if the tick drawn is for this value label.


labelDrawn

protected boolean labelDrawn
Asks if the label drawn is for this value label.


minorTick

protected boolean minorTick
Only a minor tick is drawn for this label if true (if tickDrawn = true).


background

protected Color background
The value label's background color (null means don't draw a background).


foreground

protected Color foreground
The value label's foreground color (null means use plotcube's foreground).


index

protected int index
The index in the value labels array. User's may not have write access!


axis

protected com.klg.jclass.chart3d.JCAxis axis
The parent JCAxis who tracks changes in this object. User's may not have write access!


allowUpdates

protected boolean allowUpdates
Allow updates (in other words, repaints) on user changes

Constructor Detail

JCValueLabel

public JCValueLabel()
Default constructor required for Beans.


JCValueLabel

public JCValueLabel(double value,
                    String label)
Constructor that creates a value label given a value and a String.

Parameters:
value - floating-point axis value
label - String to use as the value label

JCValueLabel

public JCValueLabel(double value,
                    String label,
                    boolean tickOnly)
This constructor exists for backwards compatibility only. It is better to use the constrcutor that sets the labelDrawn, tickDrawn, and minorTick properties explicitly.

Constructor that creates a value label given a value, a String, and a boolean tickOnly which, if true, dictates that no label and only a minor tick is to be drawn for this value label (in other words, labelDrawn is set to false). If tickOnly is false, a label with a major tick is drawn.

Parameters:
value - floating-point axis value
label - String to use as the value label
tickOnly - If true, only a minor tick is drawn at this value (if tickDrawn is true). If false, a label with a major tick is drawn, depending on the values of labelDrawn and tickDrawn.

JCValueLabel

public JCValueLabel(double value,
                    String label,
                    boolean labelDrawn,
                    boolean tickDrawn,
                    boolean minorTick)
Constructor that creates a value label given a value, a String, and a boolean minorTick that dictates that no label is to be drawn for this value label, only a minor tick (labelDrawn is set to false). To get no label with a major tick, set minorTick to false.

Parameters:
value - floating-point axis value
label - String to use as the value label
labelDrawn - Is the label drawn for this value label?
tickDrawn - Is the tick drawn for this value label?
minorTick - only a minor tick is drawn at this value (if tickDrawn is true)
Method Detail

getAxis

public com.klg.jclass.chart3d.JCAxis getAxis()
Returns the axis to which this value label belongs.

Returns:
the axis to which this value label belongs

setAxis

protected void setAxis(com.klg.jclass.chart3d.JCAxis axis)
Sets the axis to which this value label belongs.
This method should not be called by users. Calling it sets an update relationship between the value label and the axis. This means that any change to the value label from that point on will cause JClass Chart 3D to repaint (even though the value label may not be drawn).

Parameters:
axis - the new axis to which this value label belongs

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 value)
Sets the value of the Value property. The Value property controls the position of a label in data space along a particular axis.

Parameters:
value - data-space value

getLabel

public String getLabel()
Gets the value of the Label property. The Label property specifies the text displayed inside the value label.

Returns:
String representing the text inside the label

setLabel

public void setLabel(String label)
Sets the value of the Label property. The Label property specifies the text displayed inside the value label.

Parameters:
label - String representing the text inside the label

isLabelDrawn

public boolean isLabelDrawn()
Asks if the label drawn is for this value label.

Returns:
the current value of labelDrawn

setLabelDrawn

public void setLabelDrawn(boolean labelDrawn)
Sets whether the label for this value label should be drawn.

Parameters:
labelDrawn - the new value of labelDrawn

isTickDrawn

public boolean isTickDrawn()
Asks if the tick drawn is for this value label.

Returns:
the current value of tickDrawn

setTickDrawn

public void setTickDrawn(boolean tickDrawn)
Sets whether the tick for this value label should be drawn.

Parameters:
tickDrawn - the new value of tickDrawn

isMinorTick

public boolean isMinorTick()
Asks if a major or minor tick is drawn for this value label.

Returns:
The current value of minorTick. Given that the value of tickDrawn is true: if the return value is true, a minor tick is drawn; otherwise a major tick is drawn.

setMinorTick

public void setMinorTick(boolean minorTick)
Sets whether a major of minor tick is drawn for this value label.

Parameters:
minorTick - the new value of minorTick

getBackground

public Color getBackground()
Returns the background color for this value label. If null, no background is drawn for this label.

Returns:
the current background color for this value label

setBackground

public void setBackground(Color background)
Sets the background color for this value label. If null, no background is drawn for this label.

Parameters:
background - the new background color for this value label

getForeground

public Color getForeground()
Returns the foreground color for this value label. If null, the plotcube foreground color is used for this label (if this is null the JCChart3dArea's foreground color is used).

Returns:
the current foreground color for this value label

setForeground

public void setForeground(Color foreground)
Sets the foreground color for this value label. If null, the plotcube foreground color is used for this label (if this is null the JCChart3dArea's foreground color is used).

Parameters:
foreground - the new foreground color for this value label

getIndex

public int getIndex()
Gets the index into the internal value labels array for this value label.

Returns:
the index into the internal value labels array for this value label

setIndex

protected void setIndex(int index)
Sets the index into the internal value labels array for this value label.
Users should not call this method.

Parameters:
index - the new index into the internal value labels array for this value label

isTickOnly

public boolean isTickOnly()
Deprecated. As of JClass 6.0. Use the labelDrawn, tickDrawn, and minorTick properties instead.

This method exists for backwards compatibility only. It is better to query the labelDrawn, tickDrawn, and minorTick properties explicitly.

If a minorTick with no label is drawn, returns true. Returns false otherwise.

Returns:
whether to just draw a minor tick for this value label or not

setTickOnly

public void setTickOnly(boolean tickOnly)
Deprecated. As of JClass 6.0. Use the labelDrawn, tickDrawn, and minorTick properties instead.

This method exists for backwards compatibility only. It is better to set the labelDrawn, tickDrawn, and minorTick properties explicitly.

Sets whether to just draw a minor tick for this label or not. If true, a minor tick is drawn with no label. If false, a major tick is drawn and, if the label is non-null, a label is drawn as well.

Parameters:
tickOnly - true if only a minor tick is to be drawn for this label

setChanged

protected void setChanged(boolean b,
                          int cf)
Tells the parent (if there is one) that a change has happened.

Parameters:
b - Has a change happened?
cf - change mask that determines the type of change

toString

public String toString()
Overrides the toString method.

Overrides:
toString in class Object
Returns:

clone

public Object clone()
Overrides clone in class Object.

Overrides:
clone in class Object
Returns:
a clone of this instance
Throws:
OutOfMemoryError - - if there is not enough memory.
See Also:
Object.clone().

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