org.jfree.chart.block
Class LabelBlock

java.lang.Object
  extended byorg.jfree.chart.block.AbstractBlock
      extended byorg.jfree.chart.block.LabelBlock
All Implemented Interfaces:
Block, java.io.Serializable

public class LabelBlock
extends AbstractBlock
implements Block

A block containing a label.

See Also:
Serialized Form

Constructor Summary
LabelBlock(java.lang.String label)
          Creates a new label block.
LabelBlock(java.lang.String label, java.awt.Font font)
          Creates a new label block.
 
Method Summary
 Size2D arrange(java.awt.Graphics2D g2, RectangleConstraint constraint)
          Arranges the contents of the block, within the given constraints, and returns the block size.
 void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
          Draws the block.
 
Methods inherited from class org.jfree.chart.block.AbstractBlock
arrange, calculateTotalHeight, calculateTotalWidth, drawBorder, equals, getBorder, getBounds, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBounds, setHeight, setID, setMargin, setPadding, setWidth, toContentConstraint, trimBorder, trimMargin, trimPadding, trimToContentHeight, trimToContentWidth
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.chart.block.Block
arrange, getBounds, getID, setBounds, setID
 

Constructor Detail

LabelBlock

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

Parameters:
label - the label.

LabelBlock

public LabelBlock(java.lang.String label,
                  java.awt.Font font)
Creates a new label block.

Parameters:
label - the label.
font - the font.
Method Detail

arrange

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

Specified by:
arrange in interface Block
Overrides:
arrange in class AbstractBlock
Parameters:
g2 - the graphics device.
constraint - the constraint (null not permitted).
Returns:
The block size (in Java2D units, never null).

draw

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

Parameters:
g2 - the graphics device.
area - the area.