public class

CenterArrangement

extends Object
implements Serializable Arrangement
java.lang.Object
   ↳ org.jfree.chart.block.CenterArrangement

Class Overview

Arranges a block in the center of its container. This class is immutable.

Summary

Public Constructors
CenterArrangement()
Creates a new instance.
Public Methods
void add(Block block, Object key)
Adds a block to be managed by this instance.
Size2D arrange(BlockContainer container, Graphics2D g2, RectangleConstraint constraint)
Calculates and sets the bounds of all the items in the specified container, subject to the given constraint.
void clear()
Clears any cached information.
boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.
Protected Methods
Size2D arrangeFF(BlockContainer container, Graphics2D g2, RectangleConstraint constraint)
Arranges the blocks in the container with the overall height and width specified as fixed constraints.
Size2D arrangeFN(BlockContainer container, Graphics2D g2, RectangleConstraint constraint)
Arranges the blocks in the container with a fixed width and no height constraint.
Size2D arrangeFR(BlockContainer container, Graphics2D g2, RectangleConstraint constraint)
Arranges the blocks in the container with a fixed with and a range constraint on the height.
Size2D arrangeNF(BlockContainer container, Graphics2D g2, RectangleConstraint constraint)
Arranges the blocks with no width constraint and a fixed height constraint.
Size2D arrangeNN(BlockContainer container, Graphics2D g2)
Arranges the blocks without any constraints.
Size2D arrangeRF(BlockContainer container, Graphics2D g2, RectangleConstraint constraint)
Arranges the blocks in the container with a range constraint on the width and a fixed height.
Size2D arrangeRN(BlockContainer container, Graphics2D g2, RectangleConstraint constraint)
Arranges the block with a range constraint on the width, and no constraint on the height.
Size2D arrangeRR(BlockContainer container, Graphics2D g2, RectangleConstraint constraint)
Arranges the blocks with the overall width and height to fit within specified ranges.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.jfree.chart.block.Arrangement

Public Constructors

public CenterArrangement ()

Creates a new instance.

Public Methods

public void add (Block block, Object key)

Adds a block to be managed by this instance. This method is usually called by the BlockContainer, you shouldn't need to call it directly.

Parameters
block the block.
key a key that controls the position of the block.

public Size2D arrange (BlockContainer container, Graphics2D g2, RectangleConstraint constraint)

Calculates and sets the bounds of all the items in the specified container, subject to the given constraint. The Graphics2D can be used by some items (particularly items containing text) to calculate sizing parameters.

Parameters
container the container whose items are being arranged.
g2 the graphics device.
constraint the size constraint.
Returns
  • The size of the container after arrangement of the contents.

public void clear ()

Clears any cached information.

public boolean equals (Object obj)

Tests this instance for equality with an arbitrary object.

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

Protected Methods

protected Size2D arrangeFF (BlockContainer container, Graphics2D g2, RectangleConstraint constraint)

Arranges the blocks in the container with the overall height and width specified as fixed constraints.

Parameters
container the container.
g2 the graphics device.
constraint the constraint.
Returns
  • The size following the arrangement.

protected Size2D arrangeFN (BlockContainer container, Graphics2D g2, RectangleConstraint constraint)

Arranges the blocks in the container with a fixed width and no height constraint.

Parameters
container the container.
g2 the graphics device.
constraint the constraint.
Returns
  • The size.

protected Size2D arrangeFR (BlockContainer container, Graphics2D g2, RectangleConstraint constraint)

Arranges the blocks in the container with a fixed with and a range constraint on the height.

Parameters
container the container.
g2 the graphics device.
constraint the constraint.
Returns
  • The size following the arrangement.

protected Size2D arrangeNF (BlockContainer container, Graphics2D g2, RectangleConstraint constraint)

Arranges the blocks with no width constraint and a fixed height constraint. This puts all blocks into a single row.

Parameters
container the container.
g2 the graphics device.
constraint the constraint.
Returns
  • The size after the arrangement.

protected Size2D arrangeNN (BlockContainer container, Graphics2D g2)

Arranges the blocks without any constraints. This puts all blocks into a single row.

Parameters
container the container.
g2 the graphics device.
Returns
  • The size after the arrangement.

protected Size2D arrangeRF (BlockContainer container, Graphics2D g2, RectangleConstraint constraint)

Arranges the blocks in the container with a range constraint on the width and a fixed height.

Parameters
container the container.
g2 the graphics device.
constraint the constraint.
Returns
  • The size following the arrangement.

protected Size2D arrangeRN (BlockContainer container, Graphics2D g2, RectangleConstraint constraint)

Arranges the block with a range constraint on the width, and no constraint on the height.

Parameters
container the container.
g2 the graphics device.
constraint the constraint.
Returns
  • The size following the arrangement.

protected Size2D arrangeRR (BlockContainer container, Graphics2D g2, RectangleConstraint constraint)

Arranges the blocks with the overall width and height to fit within specified ranges.

Parameters
container the container.
g2 the graphics device.
constraint the constraint.
Returns
  • The size after the arrangement.