JIDE 3.5.15

com.jidesoft.chart.annotation
Class AbstractLabel

java.lang.Object
  extended by com.jidesoft.chart.annotation.AbstractAnnotation
      extended by com.jidesoft.chart.annotation.AbstractLabel
All Implemented Interfaces:
Annotation
Direct Known Subclasses:
AutoPositionedLabel, ChartLabel

public abstract class AbstractLabel
extends AbstractAnnotation

A superclass of labels that can be added to a Chart.

The default font is taken from UIManager's Chart.font key value.

The default color is taken from UIManager's Chart.foreground key value

Author:
Simon White (swhite@catalysoft.com)

Constructor Summary
AbstractLabel()
          Construct a label with no text (i.e., the empty string), default color and default font
AbstractLabel(String label)
           
AbstractLabel(String label, Color color)
           
AbstractLabel(String label, Color color, Font font)
           
AbstractLabel(String label, LabelStyle labelStyle)
           
 
Method Summary
 boolean equals(Object obj)
           
 Color getColor()
           
 Font getFont()
           
 String getLabel()
           
protected  JLabel getLabelComponent()
           
 LabelStyle getLabelStyle()
           
 Double getRotation()
           
 int hashCode()
           
 void paint(Graphics g, int x, int y, double rotation)
           
 void paint(Graphics g, int x, int y, Rotation rotation)
           
 void setColor(Color color)
           
 void setFont(Font font)
           
 void setLabel(String label)
           
 void setLabelStyle(LabelStyle labelStyle)
           
 void setRotation(Double rotation)
          Set the rotation of the label in radians, relative to the normal horizontal position; for example Math.PI/2 = 90 degrees clockwise -Math.PI/2 = 90 degrees anticlockwise Math.PI/4 = 45 degrees clockwise -Math.PI/4 = 45 degrees anticlockwise
 Dimension size(Graphics g, Font f)
          This method assumes that the font to be used for the label has already been set on the graphics context.
 String toString()
           
 
Methods inherited from class com.jidesoft.chart.annotation.AbstractAnnotation
getZOrder, setZOrder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractLabel

public AbstractLabel()
Construct a label with no text (i.e., the empty string), default color and default font


AbstractLabel

public AbstractLabel(String label)

AbstractLabel

public AbstractLabel(String label,
                     Color color)

AbstractLabel

public AbstractLabel(String label,
                     Color color,
                     Font font)

AbstractLabel

public AbstractLabel(String label,
                     LabelStyle labelStyle)
Method Detail

getLabel

public String getLabel()

setLabel

public void setLabel(String label)

getLabelComponent

protected JLabel getLabelComponent()

getColor

public Color getColor()

setColor

public void setColor(Color color)

getFont

public Font getFont()

setFont

public void setFont(Font font)

getRotation

public Double getRotation()

setRotation

public void setRotation(Double rotation)
Set the rotation of the label in radians, relative to the normal horizontal position; for example

Parameters:
rotation - the radians to rotate; positive values rotate clockwise, negative values anticlockwise

getLabelStyle

public LabelStyle getLabelStyle()

setLabelStyle

public void setLabelStyle(LabelStyle labelStyle)

size

public Dimension size(Graphics g,
                      Font f)
This method assumes that the font to be used for the label has already been set on the graphics context.

Parameters:
g - - the graphics context for which the size is to be calculated
Returns:
the dimension of the label in the supplied graphics context

paint

public void paint(Graphics g,
                  int x,
                  int y,
                  Rotation rotation)

paint

public void paint(Graphics g,
                  int x,
                  int y,
                  double rotation)
Parameters:
g - the Graphics object onto which the method draws
x - the x coordinate of the centre of the label
y - the y coordinate of the centre of the label
rotation - in radians

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

JIDE 3.5.15