|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrelativelayout.RelativeLayout
public class RelativeLayout
The main RelativeLayout class. A LayoutManager implementation that uses Bindings and RelativeConstraints to lay out components.
Constructor Summary | |
---|---|
RelativeLayout()
|
Method Summary | |
---|---|
void |
addLayoutComponent(Component theComp,
Object theConstraints)
|
void |
addLayoutComponent(String theName,
Component theComp)
|
static boolean |
getDebug()
Gets the debugging flag. |
float |
getLayoutAlignmentX(Container theTarget)
|
float |
getLayoutAlignmentY(Container theTarget)
|
void |
invalidateLayout(Container theTarget)
|
void |
layoutContainer(Container theParent)
|
Dimension |
maximumLayoutSize(Container theTarget)
|
Dimension |
minimumLayoutSize(Container theParent)
|
Dimension |
preferredLayoutSize(Container theParent)
Returns the preferred size of the given container given the components that are to be laid out inside it. |
void |
removeLayoutComponent(Component theComp)
|
static void |
setDebug(boolean debug)
Sets the debugging flag. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RelativeLayout()
Method Detail |
---|
public static void setDebug(boolean debug)
debug
is set to true
,
RelativeLayout will attempt to validate your entire layout every time a constraint is added
or changed. This takes a long time, reducing the performance of RelativeLayout by over an
order of magnitude on complex layouts, but it will cause any exceptions thrown while laying
out the window to be traceable back to the exact line of code that caused the problem. Due to
the considerable performance penalty, debugging is off by default.
debug
- true
if debugging should be turned on, false
otherwisepublic static boolean getDebug()
setDebug(boolean)
for more information.
true
if the debugging flag is set, false
otherwise.public void addLayoutComponent(Component theComp, Object theConstraints)
addLayoutComponent
in interface LayoutManager2
public void addLayoutComponent(String theName, Component theComp)
addLayoutComponent
in interface LayoutManager
public float getLayoutAlignmentX(Container theTarget)
getLayoutAlignmentX
in interface LayoutManager2
public float getLayoutAlignmentY(Container theTarget)
getLayoutAlignmentY
in interface LayoutManager2
public void invalidateLayout(Container theTarget)
invalidateLayout
in interface LayoutManager2
public void layoutContainer(Container theParent)
layoutContainer
in interface LayoutManager
public Dimension maximumLayoutSize(Container theTarget)
maximumLayoutSize
in interface LayoutManager2
public Dimension minimumLayoutSize(Container theParent)
minimumLayoutSize
in interface LayoutManager
public Dimension preferredLayoutSize(Container theParent)
Window.pack()
method.Window.pack()
method of a window that uses a
RelativeLayout) is a little complicated. If the window has dynamically sized components in it
(that is, anything whose size depends on the size of the window), the window will be
"maximized" -- that is, it will be made as big as possible on the screen. If, however, the
window does not have dynamically sized components (that is, no controls resize if
you resize the window), then the window will be sized to fit its contents precisely. This
will work even if there are controls anchored to the right or bottom of the window, but if
there are, the window may be larger than desired in some cases.Window.pack()
.
preferredLayoutSize
in interface LayoutManager
LayoutManager.preferredLayoutSize(java.awt.Container)
public void removeLayoutComponent(Component theComp)
removeLayoutComponent
in interface LayoutManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |