Package org.jfree.chart.block
Class BlockContainer
java.lang.Object
org.jfree.chart.block.AbstractBlock
org.jfree.chart.block.BlockContainer
- All Implemented Interfaces:
Serializable,Cloneable,Block,Drawable,PublicCloneable
- Direct Known Subclasses:
LegendItemBlockContainer
public class BlockContainer
extends AbstractBlock
implements Block, Cloneable, PublicCloneable, Serializable
A container for a collection of
Block objects. The container uses
an Arrangement object to handle the position of each block.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance with default settings.BlockContainer(Arrangement arrangement) Creates a new instance with the specified arrangement. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a block to the container.voidAdds a block to the container.arrange(Graphics2D g2, RectangleConstraint constraint) Arranges the contents of the block, within the given constraints, and returns the block size.booleanEnsures symmetry between super/subclass implementations of equals.voidclear()Clears all the blocks from the container.clone()Returns a clone of the container.voiddraw(Graphics2D g2, Rectangle2D area) Draws the container and all the blocks within it.draw(Graphics2D g2, Rectangle2D area, Object params) Draws the block within the specified area.booleanTests this container for equality with an arbitrary object.Returns the arrangement (layout) manager for the container.Returns an unmodifiable list of theBlockobjects managed by this arrangement.inthashCode()booleanisEmpty()Returnstrueif there are no blocks in the container, andfalseotherwise.voidsetArrangement(Arrangement arrangement) Sets the arrangement (layout) manager.Methods inherited from class org.jfree.chart.block.AbstractBlock
arrange, calculateTotalHeight, calculateTotalWidth, drawBorder, getBounds, getContentXOffset, getContentYOffset, getFrame, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBounds, setFrame, setHeight, setID, setMargin, setMargin, setPadding, setPadding, setWidth, toContentConstraint, trimBorder, trimMargin, trimPadding, trimToContentHeight, trimToContentWidth
-
Constructor Details
-
BlockContainer
public BlockContainer()Creates a new instance with default settings. -
BlockContainer
Creates a new instance with the specified arrangement.- Parameters:
arrangement- the arrangement manager (nullnot permitted).
-
-
Method Details
-
getArrangement
Returns the arrangement (layout) manager for the container.- Returns:
- The arrangement manager (never
null).
-
setArrangement
Sets the arrangement (layout) manager.- Parameters:
arrangement- the arrangement (nullnot permitted).
-
isEmpty
Returnstrueif there are no blocks in the container, andfalseotherwise.- Returns:
- A boolean.
-
getBlocks
Returns an unmodifiable list of theBlockobjects managed by this arrangement.- Returns:
- A list of blocks.
-
add
Adds a block to the container.- Parameters:
block- the block (nullpermitted).
-
add
Adds a block to the container.- Parameters:
block- the block (nullpermitted).key- the key (nullpermitted).
-
clear
Clears all the blocks from the container. -
arrange
Arranges the contents of the block, within the given constraints, and returns the block size.- Specified by:
arrangein interfaceBlock- Overrides:
arrangein classAbstractBlock- Parameters:
g2- the graphics device.constraint- the constraint (nullnot permitted).- Returns:
- The block size (in Java2D units, never
null).
-
draw
Draws the container and all the blocks within it. -
draw
Draws the block within the specified area.- Specified by:
drawin interfaceBlock- Parameters:
g2- the graphics device.area- the area.params- passed on to blocks within the container (nullpermitted).- Returns:
- An instance of
EntityBlockResult, ornull.
-
equals
Tests this container for equality with an arbitrary object.- Overrides:
equalsin classAbstractBlock- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
canEqual
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance.- Overrides:
canEqualin classAbstractBlock- Parameters:
other- Object- Returns:
- true ONLY if the parameter is THIS class type
-
hashCode
- Overrides:
hashCodein classAbstractBlock
-
clone
Returns a clone of the container.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classAbstractBlock- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if there is a problem cloning.
-