java.lang.Object
org.jfree.chart.block.CenterArrangement
- All Implemented Interfaces:
Serializable,Arrangement
Arranges a block in the center of its container. This class is immutable.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a block to be managed by this instance.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.protected Size2DarrangeFF(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) Arranges the blocks in the container with the overall height and width specified as fixed constraints.protected Size2DarrangeFN(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) Arranges the blocks in the container with a fixed width and no height constraint.protected Size2DarrangeFR(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) Arranges the blocks in the container with a fixed with and a range constraint on the height.protected Size2DarrangeNF(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) Arranges the blocks with no width constraint and a fixed height constraint.protected Size2DarrangeNN(BlockContainer container, Graphics2D g2) Arranges the blocks without any constraints.protected Size2DarrangeRF(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) Arranges the blocks in the container with a range constraint on the width and a fixed height.protected Size2DarrangeRN(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) Arranges the block with a range constraint on the width, and no constraint on the height.protected Size2DarrangeRR(BlockContainer container, Graphics2D g2, RectangleConstraint constraint) Arranges the blocks with the overall width and height to fit within specified ranges.voidclear()Clears any cached information.booleanTests this instance for equality with an arbitrary object.
-
Constructor Details
-
CenterArrangement
public CenterArrangement()Creates a new instance.
-
-
Method Details
-
add
Adds a block to be managed by this instance. This method is usually called by theBlockContainer, you shouldn't need to call it directly.- Specified by:
addin interfaceArrangement- Parameters:
block- the block.key- a key that controls the position of the block.
-
arrange
Calculates and sets the bounds of all the items in the specified container, subject to the given constraint. TheGraphics2Dcan be used by some items (particularly items containing text) to calculate sizing parameters.- Specified by:
arrangein interfaceArrangement- 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.
-
arrangeFN
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.
-
arrangeFR
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.
-
arrangeFF
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.
-
arrangeRR
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.
-
arrangeRF
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.
-
arrangeRN
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.
-
arrangeNN
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.
-
arrangeNF
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.
-
clear
public void clear()Clears any cached information.- Specified by:
clearin interfaceArrangement
-
equals
Tests this instance for equality with an arbitrary object.
-