public class

LabelBlock

extends AbstractBlock
implements Block
java.lang.Object
   ↳ org.jfree.chart.block.AbstractBlock
     ↳ org.jfree.chart.block.LabelBlock

Class Overview

A block containing a label.

Summary

Fields
public static final Paint DEFAULT_PAINT The default color.
Public Constructors
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.
Public Methods
Size2D arrange(Graphics2D g2, RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and returns the block size.
Object clone()
Returns a clone of this LabelBlock instance.
Object draw(Graphics2D g2, Rectangle2D area, Object params)
Draws the block within the specified area.
void draw(Graphics2D g2, Rectangle2D area)
Draws the block.
boolean equals(Object obj)
Tests this LabelBlock for equality with an arbitrary object.
TextBlockAnchor getContentAlignmentPoint()
Returns the content alignment point.
Font getFont()
Returns the font.
Paint getPaint()
Returns the paint.
RectangleAnchor getTextAnchor()
Returns the text anchor (never null).
String getToolTipText()
Returns the tool tip text.
String getURLText()
Returns the URL text.
void setContentAlignmentPoint(TextBlockAnchor anchor)
Sets the content alignment point.
void setFont(Font font)
Sets the font and regenerates the label.
void setPaint(Paint paint)
Sets the paint and regenerates the label.
void setTextAnchor(RectangleAnchor anchor)
Sets the text anchor.
void setToolTipText(String text)
Sets the tool tip text.
void setURLText(String text)
Sets the URL text.
[Expand]
Inherited Methods
From class org.jfree.chart.block.AbstractBlock
From class java.lang.Object
From interface org.jfree.chart.block.Block

Fields

public static final Paint DEFAULT_PAINT

The default color.

Public Constructors

public LabelBlock (String label)

Creates a new label block.

Parameters
label the label (null not permitted).

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).

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).

Public Methods

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).

public Object clone ()

Returns a clone of this LabelBlock instance.

Returns
  • A clone.
Throws
CloneNotSupportedException if there is a problem cloning.

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.

public void draw (Graphics2D g2, Rectangle2D area)

Draws the block.

Parameters
g2 the graphics device.
area the area.

public boolean equals (Object obj)

Tests this LabelBlock for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

public TextBlockAnchor getContentAlignmentPoint ()

Returns the content alignment point.

Returns
  • The content alignment point (never null).

public Font getFont ()

Returns the font.

Returns
  • The font (never null).
See Also

public Paint getPaint ()

Returns the paint.

Returns
  • The paint (never null).
See Also

public RectangleAnchor getTextAnchor ()

Returns the text anchor (never null).

Returns
  • The text anchor.

public String getToolTipText ()

Returns the tool tip text.

Returns
  • The tool tip text (possibly null).

public String getURLText ()

Returns the URL text.

Returns
  • The URL text (possibly null).

public void setContentAlignmentPoint (TextBlockAnchor anchor)

Sets the content alignment point.

Parameters
anchor the anchor used to determine the alignment point (never null).

public void setFont (Font font)

Sets the font and regenerates the label.

Parameters
font the font (null not permitted).
See Also

public void setPaint (Paint paint)

Sets the paint and regenerates the label.

Parameters
paint the paint (null not permitted).
See Also

public void setTextAnchor (RectangleAnchor anchor)

Sets the text anchor.

Parameters
anchor the anchor (null not permitted).

public void setToolTipText (String text)

Sets the tool tip text.

Parameters
text the text (null permitted).
See Also

public void setURLText (String text)

Sets the URL text.

Parameters
text the text (null permitted).
See Also