org.jfree.chart.block

Class LabelBlock

public class LabelBlock extends AbstractBlock implements Block, PublicCloneable

A block containing a label.
Field Summary
static PaintDEFAULT_PAINT
The default color.
Constructor Summary
LabelBlock(String label)
Creates a new label block.
LabelBlock(String text, Font font)
Creates a new label block.
LabelBlock(String text, Font font, Paint paint)
Creates a new label block.
Method Summary
Size2Darrange(Graphics2D g2, RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and returns the block size.
Objectclone()
Returns a clone of this LabelBlock instance.
voiddraw(Graphics2D g2, Rectangle2D area)
Draws the block.
Objectdraw(Graphics2D g2, Rectangle2D area, Object params)
Draws the block within the specified area.
booleanequals(Object obj)
Tests this LabelBlock for equality with an arbitrary object.
FontgetFont()
Returns the font.
PaintgetPaint()
Returns the paint.
StringgetToolTipText()
Returns the tool tip text.
StringgetURLText()
Returns the URL text.
voidsetFont(Font font)
Sets the font and regenerates the label.
voidsetPaint(Paint paint)
Sets the paint and regenerates the label.
voidsetToolTipText(String text)
Sets the tool tip text.
voidsetURLText(String text)
Sets the URL text.

Field Detail

DEFAULT_PAINT

public static final Paint DEFAULT_PAINT
The default color.

Constructor Detail

LabelBlock

public LabelBlock(String label)
Creates a new label block.

Parameters: label the label (null not permitted).

LabelBlock

public LabelBlock(String text, Font font)
Creates a new label block.

Parameters: text the text for the label (null not permitted). font the font (null not permitted).

LabelBlock

public LabelBlock(String text, Font font, Paint paint)
Creates a new label block.

Parameters: text the text for the label (null not permitted). font the font (null not permitted). paint the paint (null not permitted).

Method Detail

arrange

public Size2D arrange(Graphics2D g2, RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and returns the block size.

Parameters: g2 the graphics device. constraint the constraint (null not permitted).

Returns: The block size (in Java2D units, never null).

clone

public Object clone()
Returns a clone of this LabelBlock instance.

Returns: A clone.

Throws: CloneNotSupportedException if there is a problem cloning.

draw

public void draw(Graphics2D g2, Rectangle2D area)
Draws the block.

Parameters: g2 the graphics device. area the area.

draw

public Object draw(Graphics2D g2, Rectangle2D area, Object params)
Draws the block within the specified area.

Parameters: g2 the graphics device. area the area. params ignored (null permitted).

Returns: Always null.

equals

public boolean equals(Object obj)
Tests this LabelBlock for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getFont

public Font getFont()
Returns the font.

Returns: The font (never null).

See Also: setFont

getPaint

public Paint getPaint()
Returns the paint.

Returns: The paint (never null).

See Also: setPaint

getToolTipText

public String getToolTipText()
Returns the tool tip text.

Returns: The tool tip text (possibly null).

See Also: setToolTipText

getURLText

public String getURLText()
Returns the URL text.

Returns: The URL text (possibly null).

See Also: setURLText

setFont

public void setFont(Font font)
Sets the font and regenerates the label.

Parameters: font the font (null not permitted).

See Also: getFont

setPaint

public void setPaint(Paint paint)
Sets the paint and regenerates the label.

Parameters: paint the paint (null not permitted).

See Also: getPaint

setToolTipText

public void setToolTipText(String text)
Sets the tool tip text.

Parameters: text the text (null permitted).

See Also: getToolTipText

setURLText

public void setURLText(String text)
Sets the URL text.

Parameters: text the text (null permitted).

See Also: getURLText