public class FormLayout extends AbstractUnitLayout implements LayoutManager
LayoutManager
organizes elements in rows, maintaining each
element with it's label (this pair is managed as a Unit
). Each
Row
may contain more than one Unit
(if both can fit in it).
Each Row
is justified, ie all Unit
s in each Row
are
extended to occupy the full width provided. The spare space is added to each
Unit
maintaining the ratio of space (minimum or preferred size). Row
is spaced one AbstractUnitLayout.gap
between each other and
also the margin all arround has the same size. gap, HORIZONAL_UNIT_HEIGHT_LIMIT, LABEL_HEIGHT_THRESHOLD, PIXELS_PER_FONT_SIZE, POST_NEWLINE, PRE_NEWLINE
Constructor and Description |
---|
FormLayout()
Create a
FormLayout with a default gap of 5. |
FormLayout(int gap)
Create a
FormLayout witha specific gap. |
Modifier and Type | Method and Description |
---|---|
void |
addLayoutComponent(String name,
Component comp) |
void |
layoutContainer(Container parent) |
Dimension |
minimumLayoutSize(Container parent) |
Dimension |
preferredLayoutSize(Container parent) |
void |
removeLayoutComponent(Component comp) |
getSreenRatio, setNewLineAfter, setNewLineBefore
public FormLayout()
FormLayout
with a default gap of 5.public FormLayout(int gap)
FormLayout
witha specific gap.gap
- the space in pixels to leave between elements and as marginspublic Dimension preferredLayoutSize(Container parent)
preferredLayoutSize
in interface LayoutManager
preferredLayoutSize
in class AbstractUnitLayout
public void layoutContainer(Container parent)
layoutContainer
in interface LayoutManager
layoutContainer
in class AbstractUnitLayout
public Dimension minimumLayoutSize(Container parent)
minimumLayoutSize
in interface LayoutManager
minimumLayoutSize
in class AbstractUnitLayout
public void removeLayoutComponent(Component comp)
removeLayoutComponent
in interface LayoutManager
removeLayoutComponent
in class AbstractUnitLayout
public void addLayoutComponent(String name, Component comp)
addLayoutComponent
in interface LayoutManager
addLayoutComponent
in class AbstractUnitLayout
Copyright © 2018 universAAL Consortium. All rights reserved.