Package org.jfree.chart.block
Class FlowArrangement
- java.lang.Object
-
- org.jfree.chart.block.FlowArrangement
-
- All Implemented Interfaces:
java.io.Serializable,Arrangement
public class FlowArrangement extends java.lang.Object implements Arrangement, java.io.Serializable
Arranges blocks in a flow layout. This class is immutable.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FlowArrangement()Creates a new instance.FlowArrangement(org.jfree.ui.HorizontalAlignment hAlign, org.jfree.ui.VerticalAlignment vAlign, double hGap, double vGap)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 be managed by this instance.org.jfree.ui.Size2Darrange(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Calculates and sets the bounds of all the items in the specified container, subject to the given constraint.protected org.jfree.ui.Size2DarrangeFF(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Arranges the blocks in the container with the overall height and width specified as fixed constraints.protected org.jfree.ui.Size2DarrangeFN(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Arranges the blocks in the container with a fixed width and no height constraint.protected org.jfree.ui.Size2DarrangeFR(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Arranges the blocks in the container with a fixed width and a range constraint on the height.protected org.jfree.ui.Size2DarrangeNF(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Arranges the blocks with no width constraint and a fixed height constraint.protected org.jfree.ui.Size2DarrangeNN(BlockContainer container, java.awt.Graphics2D g2)Arranges the blocks without any constraints.protected org.jfree.ui.Size2DarrangeRF(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Arranges the blocks in the container with a range constraint on the width and a fixed height.protected org.jfree.ui.Size2DarrangeRN(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Arranges the block with a range constraint on the width, and no constraint on the height.protected org.jfree.ui.Size2DarrangeRR(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)Arranges the blocks with the overall width and height to fit within specified ranges.voidclear()Clears any cached information.booleanequals(java.lang.Object obj)Tests this instance for equality with an arbitrary object.
-
-
-
Constructor Detail
-
FlowArrangement
public FlowArrangement()
Creates a new instance.
-
FlowArrangement
public FlowArrangement(org.jfree.ui.HorizontalAlignment hAlign, org.jfree.ui.VerticalAlignment vAlign, double hGap, double vGap)
Creates a new instance.- Parameters:
hAlign- the horizontal alignment (currently ignored).vAlign- the vertical alignment (currently ignored).hGap- the horizontal gap.vGap- the vertical gap.
-
-
Method Detail
-
add
public void add(Block block, java.lang.Object key)
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
public org.jfree.ui.Size2D arrange(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)
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.constraint- the size constraint.g2- the graphics device.- Returns:
- The size of the container after arrangement of the contents.
-
arrangeFN
protected org.jfree.ui.Size2D arrangeFN(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)
Arranges the blocks in the container with a fixed width and no height constraint.- Parameters:
container- the container.constraint- the constraint.g2- the graphics device.- Returns:
- The size.
-
arrangeFR
protected org.jfree.ui.Size2D arrangeFR(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)
Arranges the blocks in the container with a fixed width and a range constraint on the height.- Parameters:
container- the container.constraint- the constraint.g2- the graphics device.- Returns:
- The size following the arrangement.
-
arrangeFF
protected org.jfree.ui.Size2D arrangeFF(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)
Arranges the blocks in the container with the overall height and width specified as fixed constraints.- Parameters:
container- the container.constraint- the constraint.g2- the graphics device.- Returns:
- The size following the arrangement.
-
arrangeRR
protected org.jfree.ui.Size2D arrangeRR(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)
Arranges the blocks with the overall width and height to fit within specified ranges.- Parameters:
container- the container.constraint- the constraint.g2- the graphics device.- Returns:
- The size after the arrangement.
-
arrangeRF
protected org.jfree.ui.Size2D arrangeRF(BlockContainer container, java.awt.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.constraint- the constraint.g2- the graphics device.- Returns:
- The size following the arrangement.
-
arrangeRN
protected org.jfree.ui.Size2D arrangeRN(BlockContainer container, java.awt.Graphics2D g2, RectangleConstraint constraint)
Arranges the block with a range constraint on the width, and no constraint on the height.- Parameters:
container- the container.constraint- the constraint.g2- the graphics device.- Returns:
- The size following the arrangement.
-
arrangeNN
protected org.jfree.ui.Size2D arrangeNN(BlockContainer container, java.awt.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.
-
arrangeNF
protected org.jfree.ui.Size2D arrangeNF(BlockContainer container, java.awt.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.constraint- the constraint.g2- the graphics device.- Returns:
- The size after the arrangement.
-
clear
public void clear()
Clears any cached information.- Specified by:
clearin interfaceArrangement
-
equals
public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
-