|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.magelang.splitter.SplitterLayout
SplitterLayout is a layout manager that will layout a container holding other components and SplitterBars.
Each component added to a container to be laid out using SplitterLayout must provide a String containing a "weight" for the component. This weight will be used to determine the initial spacing of all components being laid out. The weight numbers are arbitrary integers. The amount of space initially allocated for a component is
(wc/wt) * (size-insets-splitterSize)
where
If the container being laid out holds no SplitterBars, SplitterLayout acts like a relational-weight layout manager. All components are always laid out based on their proportionate weights.
If the container being laid out holds some SplitterBars, SplitterLayout will initially size all non SplitterBar components based on their weights. Any succesive layouts are computed strictly on the locations of the SplitterBars.
SplitterLayout can be oriented Horizontally or Vertically. Any SpliterBars placed in the container will automatically be oriented.
If a SplitterBar has been modified (adding components to it) you will need to add SplitterSpace components to it. See SplitterBar for more details.
Known Problems:
Use this code at your own risk! MageLang Institute is not responsible for any damage caused directly or indirctly through use of this code.
SOFTWARE RIGHTS
MageLang support classes, version 1.0, MageLang Institute
We reserve no legal rights to this code--it is fully in the public domain. An individual or company may do whatever they wish with source code distributed with it, including including the incorporation of it into commerical software.
However, this code cannot be sold as a standalone product.
We encourage users to develop software with this code. However, we do ask that credit is given to us for developing it By "credit", we mean that if you use these components or incorporate any source code into one of your programs (commercial product, research project, or otherwise) that you acknowledge this fact somewhere in the documentation, research report, etc... If you like these components and have developed a nice tool with the output, please mention that you developed it using these components. In addition, we ask that the headers remain intact in our source code. As long as these guidelines are kept, we expect to continue enhancing this system and expect to make other tools available as they are completed.
The MageLang Support Classes Gang:
SplitterBar
,
SplitterSpace
, Serialized FormField Summary | |
static SplitterBar |
dragee
|
static int |
HORIZONTAL
Aligns components horizontally -- SplitterBars will move left-right |
static int |
VERTICAL
Aligns components vertically -- SplitterBars will move up/down |
Constructor Summary | |
SplitterLayout()
Create a new SplitterLayout -- default orientation is VERTICAL |
|
SplitterLayout(int orientation)
Create a new SplitterLayout |
Method Summary | |
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Adds a component w/ constraints to the layout. |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Adds a component w/ a String constraint to the layout. |
java.awt.Dimension |
checkLayoutSize(java.awt.Container target,
boolean getPrefSize)
|
float |
getLayoutAlignmentX(java.awt.Container parent)
Tells the caller that we prefer to be centered |
float |
getLayoutAlignmentY(java.awt.Container parent)
Tells the caller that we prefer to be centered |
int |
getOrientation()
Gets the orientation property (int) value. |
void |
invalidateLayout(java.awt.Container target)
Does not have any effect (overridden to null the effect) |
void |
layoutContainer(java.awt.Container target)
Lays out the components in the specified container by telling then what their size will be |
java.awt.Dimension |
maximumLayoutSize(java.awt.Container target)
Determines the maximum amount of space that could be used when laying out the components in the specified container. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container target)
Determines the minimum amount of room requested for the layout of components contained in the specified container. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container target)
Determines the preferred amount of room requested for the layout of components contained in the specified container. |
void |
removeLayoutComponent(java.awt.Component comp)
Removes a component from the layout. |
void |
setOrientation(int orientation)
Sets the orientation property (int) value. |
void |
swapOrientation(java.awt.Container container)
|
java.lang.String |
toString()
Returns a String representation of the Layout |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int VERTICAL
public static final int HORIZONTAL
public static SplitterBar dragee
Constructor Detail |
public SplitterLayout()
public SplitterLayout(int orientation)
orientation
- -- VERTICAL or HORIZONTALMethod Detail |
public final void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
addLayoutComponent
in interface java.awt.LayoutManager2
public final void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
public final java.awt.Dimension checkLayoutSize(java.awt.Container target, boolean getPrefSize)
public final float getLayoutAlignmentX(java.awt.Container parent)
getLayoutAlignmentX
in interface java.awt.LayoutManager2
public final float getLayoutAlignmentY(java.awt.Container parent)
getLayoutAlignmentY
in interface java.awt.LayoutManager2
public int getOrientation()
setOrientation(int)
public final void invalidateLayout(java.awt.Container target)
invalidateLayout
in interface java.awt.LayoutManager2
public final void layoutContainer(java.awt.Container target)
layoutContainer
in interface java.awt.LayoutManager
public final java.awt.Dimension maximumLayoutSize(java.awt.Container target)
maximumLayoutSize
in interface java.awt.LayoutManager2
--
- the container being laid outpublic final java.awt.Dimension minimumLayoutSize(java.awt.Container target)
minimumLayoutSize
in interface java.awt.LayoutManager
target
- -- the Container being laid outpublic final java.awt.Dimension preferredLayoutSize(java.awt.Container target)
preferredLayoutSize
in interface java.awt.LayoutManager
target
- -- the Container being laid outpublic final void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
public void setOrientation(int orientation)
orientation
- The new value for the property.getOrientation()
public void swapOrientation(java.awt.Container container)
public final java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |