|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.cmu.relativelayout.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)
|
float |
getLayoutAlignmentX(Container theTarget)
|
float |
getLayoutAlignmentY(Container theTarget)
|
void |
invalidateLayout(Container theTarget)
|
static boolean |
isDebugMode()
Returns whether RelativeLayout is in debugging mode. |
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 |
setDebugMode(boolean debug)
Sets whether RelativeLayout is in debugging mode. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RelativeLayout()
| Method Detail |
|---|
public static boolean isDebugMode()
setDebugMode(boolean) for more
information.
true if the debugging flag is set, false otherwise.public static void setDebugMode(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 otherwise
public void addLayoutComponent(Component theComp,
Object theConstraints)
addLayoutComponent in interface LayoutManager2
public void addLayoutComponent(String theName,
Component theComp)
addLayoutComponent in interface LayoutManagerpublic float getLayoutAlignmentX(Container theTarget)
getLayoutAlignmentX in interface LayoutManager2public float getLayoutAlignmentY(Container theTarget)
getLayoutAlignmentY in interface LayoutManager2public void invalidateLayout(Container theTarget)
invalidateLayout in interface LayoutManager2public void layoutContainer(Container theParent)
layoutContainer in interface LayoutManagerpublic Dimension maximumLayoutSize(Container theTarget)
maximumLayoutSize in interface LayoutManager2public Dimension minimumLayoutSize(Container theParent)
minimumLayoutSize in interface LayoutManagerpublic 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 LayoutManagerLayoutManager.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 | |||||||||