Package swingtree
Class UILayoutConstants
java.lang.Object
swingtree.UILayoutConstants
- Direct Known Subclasses:
UIFactoryMethods
Essentially just a namespace for static layout constants for
the
This class is not intended to be instantiated!
The constants as well as static factory methods in this class are intended to be used like this:
The
The
The
... and so on.
MigLayout
LayoutManager
type. This class is not intended to be instantiated!
The constants as well as static factory methods in this class are intended to be used like this:
import static swingtree.UI.*;
//...
panel(FILL.and(WRAP(2)))
.withPrefSize(500, 300)
.add(GROW,
panel(FILL_X.and(WRAP(2)),"[shrink][grow]")
.add(label("Username"))
.add(GROW_X,
textField(vm.username())
)
.add(SHRINK_X, label("Password"))
.add(GROW_X,
passwordField(vm.password())
)
)
.add(GROW,
panel(FILL_X.and(WRAP(2)),"[shrink][grow]")
.add(label("Email"))
.add(GROW_X,
textField(vm.email())
)
.add(SHRINK_X, label("Gender"))
.add(GROW_X,
comboBox(vm.gender())
)
)
.add(GROW_X,
panel(FILL_X.and(WRAP(1)))
.add(GROW_X,
checkBox("I accept!", vm.termsAccepted())
)
.add(GROW_X,
button("Register")
.onClick( it -> vm.register() )
)
)
.add(GROW_X,
panel(FILL_X.and(WRAP(1)))
.withBorderTitled("Feedback")
.add(GROW_X,
boldLabel(
vm.feedback()
)
.withForeground(vm.feedbackColor())
)
)
.add(GROW_X.and(SPAN), button("RESET").onClick( it -> vm.reset() ));
In this little example form we can see how the constants are used to
create a form with a grid layout. The
FILL
constant is used to make the panels fill the entire
width of the parent panel. The
WRAP(int)
constant is used to make the panels wrap after
n components have been added to them. The
GROW
constant is used to make the panels grow vertically
to fill the entire height of the parent panel. ... and so on.
-
Field Summary
Modifier and TypeFieldDescriptionstatic AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static LayoutConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static LayoutConstraint
static LayoutConstraint
static LayoutConstraint
static LayoutConstraint
static LayoutConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static LayoutConstraint
static LayoutConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
static AddConstraint
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.miginfocom.layout.AC
AC()
static AddConstraint
static net.miginfocom.layout.CC
CC()
static AddConstraint
static LayoutConstraint
GAP_REL
(int size) static AddConstraint
GROW
(int weight) static AddConstraint
GROW_X
(int weight) static AddConstraint
GROW_Y
(int weight) static AddConstraint
HEIGHT
(int min, int pref, int max) static LayoutConstraint
INS
(int insets) static LayoutConstraint
INS
(int top, int left, int bottom, int right) static LayoutConstraint
INSETS
(int insets) static LayoutConstraint
INSETS
(int top, int left, int bottom, int right) static net.miginfocom.layout.LC
LC()
A factory method for creating aLC
instance.static AddConstraint
PAD
(int size) static AddConstraint
PAD
(int top, int left, int bottom, int right) static AddConstraint
PUSH
(int weight) static AddConstraint
PUSH_X
(int weight) static AddConstraint
PUSH_Y
(int weight) static AddConstraint
SHRINK
(int weight) static AddConstraint
SHRINK_PRIO
(int priority) static AddConstraint
SHRINK_X
(int weight) static AddConstraint
SHRINK_Y
(int weight) static AddConstraint
SKIP
(int cells) static AddConstraint
SPAN
(int times) static AddConstraint
SPAN
(int xTimes, int yTimes) static AddConstraint
SPAN_X
(int times) static AddConstraint
SPAN_Y
(int times) static AddConstraint
SPLIT
(int cells) static AddConstraint
WIDTH
(int min, int pref, int max) static LayoutConstraint
WRAP
(int times)
-
Field Details
-
FILL
-
FILL_X
-
FILL_Y
-
FLOW_X
-
FLOW_Y
-
NO_GRID
-
NO_CACHE
-
DEBUG
-
WRAP
-
SPAN
-
GROW
-
GROW_X
-
GROW_Y
-
SHRINK
-
SHRINK_X
-
SHRINK_Y
-
PUSH
-
PUSH_X
-
PUSH_Y
-
ALIGN_CENTER
-
ALIGN_LEFT
-
ALIGN_RIGHT
-
ALIGN_X_CENTER
-
ALIGN_X_LEFT
-
ALIGN_X_RIGHT
-
ALIGN_Y_CENTER
-
ALIGN_Y_BOTTOM
-
ALIGN_Y_TOP
-
TOP
-
RIGHT
-
BOTTOM
-
LEFT
-
CENTER
-
GAP_LEFT_PUSH
-
GAP_RIGHT_PUSH
-
GAP_TOP_PUSH
-
GAP_BOTTOM_PUSH
-
DOCK_NORTH
-
DOCK_SOUTH
-
DOCK_EAST
-
DOCK_WEST
-
-
Method Details
-
INS
-
INSETS
-
INS
-
INSETS
-
WRAP
-
GAP_REL
-
SPAN
-
SPAN
-
SPAN_X
-
SPAN_Y
-
GROW
-
GROW_X
-
GROW_Y
-
SHRINK
-
SHRINK_X
-
SHRINK_Y
-
SHRINK_PRIO
-
PUSH
-
PUSH_X
-
PUSH_Y
-
SKIP
-
SPLIT
-
WIDTH
-
HEIGHT
-
PAD
-
PAD
-
ALIGN
-
DOCK
-
LC
public static net.miginfocom.layout.LC LC()A factory method for creating aLC
instance.- Returns:
- A
LC
instance.
-
AC
public static net.miginfocom.layout.AC AC() -
CC
public static net.miginfocom.layout.CC CC()
-