java.lang.Object
org.jfree.chart3d.table.AbstractTableElement
org.jfree.chart3d.table.FlowElement
- All Implemented Interfaces:
Serializable
,ContainerElement
,TableElement
A table element that displays a list of sub-elements in a flow layout.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- See Also:
-
Field Summary
Fields inherited from interface org.jfree.chart3d.table.TableElement
CLASS
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance (equivalent tonew FlowElement(HAlign.CENTER, 2)
).FlowElement
(HAlign alignment, int hgap) Creates a new instance with the specified attributes. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(TableElement element) Adds a sub-element to the list.void
draw
(Graphics2D g2, Rectangle2D bounds) Draws the element within the specified bounds.void
draw
(Graphics2D g2, Rectangle2D bounds, TableElementOnDraw onDrawHandler) Draws the element within the specified bounds.boolean
Tests this element for equality with an arbitrary object.Returns a (new) list containing the elements in this flow layout.int
getHGap()
Returns the horizontal gap between elements, specified in Java2D units.Returns the horizontal alignment of items within rows.layoutElements
(Graphics2D g2, Rectangle2D bounds, Map<String, Object> constraints) Calculates the layout of the elements for the given bounds and constraints.preferredSize
(Graphics2D g2, Rectangle2D bounds, Map<String, Object> constraints) Returns the preferred size of the element (including insets).void
receive
(TableElementVisitor visitor) Receives a visitor.void
setHGap
(int gap) Sets the horizontal gap between elements.void
setHorizontalAlignment
(HAlign alignment) Sets the horizontal alignment.Methods inherited from class org.jfree.chart3d.table.AbstractTableElement
getBackground, getInsets, getProperty, getRefPoint, getTag, preferredSize, setBackground, setBackgroundColor, setInsets, setProperty, setRefPoint, setTag
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.chart3d.table.TableElement
getProperty, getRefPoint, preferredSize, setProperty
-
Constructor Details
-
FlowElement
public FlowElement()Creates a new instance (equivalent tonew FlowElement(HAlign.CENTER, 2)
). -
FlowElement
Creates a new instance with the specified attributes.- Parameters:
alignment
- the horizontal alignment of the elements within each row (null
not permitted).hgap
- the gap between elements.- Since:
- 1.1
-
-
Method Details
-
getHGap
Returns the horizontal gap between elements, specified in Java2D units. The default value is2
.- Returns:
- The horizontal gap.
-
setHGap
Sets the horizontal gap between elements.- Parameters:
gap
- the gap (in Java2D units).
-
getHorizontalAlignment
Returns the horizontal alignment of items within rows. The default value isHAlign.CENTER
.- Returns:
- The horizontal alignment (never
null
). - Since:
- 1.1
-
setHorizontalAlignment
Sets the horizontal alignment.- Parameters:
alignment
- the alignment (null
not permitted).- Since:
- 1.1
-
getElements
Returns a (new) list containing the elements in this flow layout.- Returns:
- A list containing the elements (possibly empty, but never
null
).
-
addElement
Adds a sub-element to the list.- Specified by:
addElement
in interfaceContainerElement
- Parameters:
element
- the element (null
not permitted).
-
receive
Receives a visitor. The implementation ensures that the vistor visits all the elements belonging to the flow.- Specified by:
receive
in interfaceTableElement
- Parameters:
visitor
- the visitor (null
not permitted).- Since:
- 1.2
-
preferredSize
Returns the preferred size of the element (including insets).- Specified by:
preferredSize
in interfaceTableElement
- Specified by:
preferredSize
in classAbstractTableElement
- Parameters:
g2
- the graphics target.bounds
- the bounds.constraints
- the constraints (ignored for now).- Returns:
- The preferred size.
-
layoutElements
public List<Rectangle2D> layoutElements(Graphics2D g2, Rectangle2D bounds, Map<String, Object> constraints) Calculates the layout of the elements for the given bounds and constraints.- Specified by:
layoutElements
in interfaceTableElement
- Parameters:
g2
- the graphics target (null
not permitted).bounds
- the bounds (null
not permitted).constraints
- the constraints (not used here).- Returns:
- A list of positions for the sub-elements.
-
draw
Draws the element within the specified bounds.- Specified by:
draw
in interfaceTableElement
- Parameters:
g2
- the graphics target (null
not permitted).bounds
- the bounds (null
not permitted).
-
draw
Draws the element within the specified bounds.- Specified by:
draw
in interfaceTableElement
- Parameters:
g2
- the graphics target (null
not permitted).bounds
- the bounds (null
not permitted).onDrawHandler
- an object that will receive notification before and after the element is drawn (null
permitted).- Since:
- 1.3
-
equals
Tests this element for equality with an arbitrary object.- Overrides:
equals
in classAbstractTableElement
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-