public class FlowElement extends AbstractTableElement implements ContainerElement, java.io.Serializable
CLASS| Constructor and Description |
|---|
FlowElement()
Creates a new instance (equivalent to
new FlowElement(HAlign.CENTER, 2)). |
FlowElement(HAlign alignment,
int hgap)
Creates a new instance with the specified attributes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(TableElement element)
Adds a sub-element to the list.
|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds)
Draws the element within the specified bounds.
|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds,
TableElementOnDraw onDrawHandler)
Draws the element within the specified bounds.
|
boolean |
equals(java.lang.Object obj)
Tests this element for equality with an arbitrary object.
|
java.util.List<TableElement> |
getElements()
Returns a (new) list containing the elements in this flow layout.
|
int |
getHGap()
Returns the horizontal gap between elements, specified in Java2D units.
|
HAlign |
getHorizontalAlignment()
Returns the horizontal alignment of items within rows.
|
java.util.List<java.awt.geom.Rectangle2D> |
layoutElements(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds,
java.util.Map<java.lang.String,java.lang.Object> constraints)
Calculates the layout of the elements for the given bounds and
constraints.
|
java.awt.geom.Dimension2D |
preferredSize(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds,
java.util.Map<java.lang.String,java.lang.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.
|
getBackground, getInsets, getProperty, getRefPoint, getTag, preferredSize, setBackground, setBackgroundColor, setInsets, setProperty, setRefPoint, setTagclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProperty, getRefPoint, preferredSize, setPropertypublic FlowElement()
new FlowElement(HAlign.CENTER, 2)).public FlowElement(HAlign alignment, int hgap)
alignment - the horizontal alignment of the elements within
each row (null not permitted).hgap - the gap between elements.public int getHGap()
2.public void setHGap(int gap)
gap - the gap (in Java2D units).public HAlign getHorizontalAlignment()
HAlign.CENTER.null).public void setHorizontalAlignment(HAlign alignment)
alignment - the alignment (null not permitted).public java.util.List<TableElement> getElements()
null).public void addElement(TableElement element)
addElement in interface ContainerElementelement - the element (null not permitted).public void receive(TableElementVisitor visitor)
receive in interface TableElementvisitor - the visitor (null not permitted).public java.awt.geom.Dimension2D preferredSize(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, java.util.Map<java.lang.String,java.lang.Object> constraints)
preferredSize in interface TableElementpreferredSize in class AbstractTableElementg2 - the graphics target.bounds - the bounds.constraints - the constraints (ignored for now).public java.util.List<java.awt.geom.Rectangle2D> layoutElements(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, java.util.Map<java.lang.String,java.lang.Object> constraints)
layoutElements in interface TableElementg2 - the graphics target (null not permitted).bounds - the bounds (null not permitted).constraints - the constraints (not used here).public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds)
draw in interface TableElementg2 - the graphics target (null not permitted).bounds - the bounds (null not permitted).public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, TableElementOnDraw onDrawHandler)
draw in interface TableElementg2 - 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).public boolean equals(java.lang.Object obj)
equals in class AbstractTableElementobj - the object (null permitted).