public class

BlockContainer

extends AbstractBlock
implements Serializable Cloneable Block
java.lang.Object
   ↳ org.jfree.chart.block.AbstractBlock
     ↳ org.jfree.chart.block.BlockContainer
Known Direct Subclasses

Class Overview

A container for a collection of Block objects. The container uses an Arrangement object to handle the position of each block.

Summary

Public Constructors
BlockContainer()
Creates a new instance with default settings.
BlockContainer(Arrangement arrangement)
Creates a new instance with the specified arrangement.
Public Methods
void add(Block block, Object key)
Adds a block to the container.
void add(Block block)
Adds a block to the container.
Size2D arrange(Graphics2D g2, RectangleConstraint constraint)
Arranges the contents of the block, within the given constraints, and returns the block size.
void clear()
Clears all the blocks from the container.
Object clone()
Returns a clone of the container.
Object draw(Graphics2D g2, Rectangle2D area, Object params)
Draws the block within the specified area.
void draw(Graphics2D g2, Rectangle2D area)
Draws the container and all the blocks within it.
boolean equals(Object obj)
Tests this container for equality with an arbitrary object.
Arrangement getArrangement()
Returns the arrangement (layout) manager for the container.
List getBlocks()
Returns an unmodifiable list of the Block objects managed by this arrangement.
boolean isEmpty()
Returns true if there are no blocks in the container, and false otherwise.
void setArrangement(Arrangement arrangement)
Sets the arrangement (layout) manager.
[Expand]
Inherited Methods
From class org.jfree.chart.block.AbstractBlock
From class java.lang.Object
From interface org.jfree.chart.block.Block

Public Constructors

public BlockContainer ()

Creates a new instance with default settings.

public BlockContainer (Arrangement arrangement)

Creates a new instance with the specified arrangement.

Parameters
arrangement the arrangement manager (null not permitted).

Public Methods

public void add (Block block, Object key)

Adds a block to the container.

Parameters
block the block (null permitted).
key the key (null permitted).

public void add (Block block)

Adds a block to the container.

Parameters
block the block (null permitted).

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 void clear ()

Clears all the blocks from the container.

public Object clone ()

Returns a clone of the container.

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 passed on to blocks within the container (null permitted).
Returns

public void draw (Graphics2D g2, Rectangle2D area)

Draws the container and all the blocks within it.

Parameters
g2 the graphics device.
area the area.

public boolean equals (Object obj)

Tests this container for equality with an arbitrary object.

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

public Arrangement getArrangement ()

Returns the arrangement (layout) manager for the container.

Returns
  • The arrangement manager (never null).

public List getBlocks ()

Returns an unmodifiable list of the Block objects managed by this arrangement.

Returns
  • A list of blocks.

public boolean isEmpty ()

Returns true if there are no blocks in the container, and false otherwise.

Returns
  • A boolean.

public void setArrangement (Arrangement arrangement)

Sets the arrangement (layout) manager.

Parameters
arrangement the arrangement (null not permitted).