Package org.jfree.chart.block
Class BorderArrangement
- java.lang.Object
-
- org.jfree.chart.block.BorderArrangement
-
- All Implemented Interfaces:
java.io.Serializable,Arrangement
public class BorderArrangement extends java.lang.Object implements Arrangement, java.io.Serializable
An arrangement manager that lays out blocks in a similar way to Swing's BorderLayout class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private BlockbottomBlockThe block (if any) at the bottom of the layout.private BlockcenterBlockThe block (if any) at the center of the layout.private BlockleftBlockThe block (if any) at the left of the layout.private BlockrightBlockThe block (if any) at the right of the layout.private static longserialVersionUIDFor serialization.private BlocktopBlockThe block (if any) at the top of the layout.
-
Constructor Summary
Constructors Constructor Description BorderArrangement()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Block block, java.lang.Object key)Adds a block to the arrangement manager at the specified edge.Size2Darrange(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Arranges the items in the specified container, subject to the given constraint.protected Size2DarrangeFF(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Arranges the items within a container.protected Size2DarrangeFN(BlockContainer container, java.awt.Graphics2D g2, double width)Arranges the container width a fixed width and no constraint on the height.protected Size2DarrangeFR(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Performs an arrangement with a fixed width and a range for the height.protected Size2DarrangeNN(BlockContainer container, java.awt.Graphics2D g2)Performs an arrangement without constraints.protected Size2DarrangeRR(BlockContainer container, Range widthRange, Range heightRange, java.awt.Graphics2D g2)Performs an arrangement with range constraints on both the vertical and horizontal sides.voidclear()Clears the layout.booleanequals(java.lang.Object obj)Tests this arrangement for equality with an arbitrary object.inthashCode()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
centerBlock
private Block centerBlock
The block (if any) at the center of the layout.
-
topBlock
private Block topBlock
The block (if any) at the top of the layout.
-
bottomBlock
private Block bottomBlock
The block (if any) at the bottom of the layout.
-
leftBlock
private Block leftBlock
The block (if any) at the left of the layout.
-
rightBlock
private Block rightBlock
The block (if any) at the right of the layout.
-
-
Method Detail
-
add
public void add(Block block, java.lang.Object key)
Adds a block to the arrangement manager at the specified edge. If the key is not an instance ofRectangleEdgethe block will be added in the center.- Specified by:
addin interfaceArrangement- Parameters:
block- the block (nullpermitted).key- the edge (an instance ofRectangleEdge) ornullfor the center block.
-
arrange
public Size2D arrange(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)
Arranges the items in the specified container, subject to the given constraint.- Specified by:
arrangein interfaceArrangement- Parameters:
container- the container.g2- the graphics device.constraint- the constraint.- Returns:
- The block size.
-
arrangeNN
protected Size2D arrangeNN(BlockContainer container, java.awt.Graphics2D g2)
Performs an arrangement without constraints.- Parameters:
container- the container.g2- the graphics device.- Returns:
- The container size after the arrangement.
-
arrangeFR
protected Size2D arrangeFR(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)
Performs an arrangement with a fixed width and a range for the height.- Parameters:
container- the container.g2- the graphics device.constraint- the constraint.- Returns:
- The container size after the arrangement.
-
arrangeFN
protected Size2D arrangeFN(BlockContainer container, java.awt.Graphics2D g2, double width)
Arranges the container width a fixed width and no constraint on the height.- Parameters:
container- the container.g2- the graphics device.width- the fixed width.- Returns:
- The container size after arranging the contents.
-
arrangeRR
protected Size2D arrangeRR(BlockContainer container, Range widthRange, Range heightRange, java.awt.Graphics2D g2)
Performs an arrangement with range constraints on both the vertical and horizontal sides.- Parameters:
container- the container.widthRange- the allowable range for the container width.heightRange- the allowable range for the container height.g2- the graphics device.- Returns:
- The container size.
-
arrangeFF
protected Size2D arrangeFF(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)
Arranges the items within a container.- Parameters:
container- the container.constraint- the constraint.g2- the graphics device.- Returns:
- The container size after the arrangement.
-
clear
public void clear()
Clears the layout.- Specified by:
clearin interfaceArrangement
-
equals
public boolean equals(java.lang.Object obj)
Tests this arrangement for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-