|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.swing.layout.splitter.SplitterLayout
public class SplitterLayout
The splitter layout manager arranges several components that are separated by
SplitterBar components.
An intelligent resize algorithm determines the size of the remaining components
when one of the splitter bars is moved.
For each component, its minimum and maximum sizes will be considered when giving
the user a visual feedback when moving the splitter bar, e. g. the splitter bar
won't move to a position that contradicts the constraints of the components.
The splitter layout can be oriented horizontally or Vertically. Any SpliterBars
placed in the container will automatically be oriented.
When adding components to the container, a constraint can be given.
The constraint can be either a SplitterConstraint object or a string.
If the string contains the keyword "fill", or the SplitterConstraint.setFiller(boolean)
property has been set, the component will be used as filler, e. g. it will be used
to fill up any remaining space when layout out the container. In a typical use case
of a graphical editor with tool windows at its sides, the editor workspace
would be defined as filler component. The layout manager will retain the sizes of
the non-filler components if possible.
If there are no filler components at all, all non-SplitterBar components will be
used as fillers, e. g. their sizes will be changed as needed.
| Field Summary | |
|---|---|
static int |
HORIZONTAL
Aligns components horizontally. |
static int |
VERTICAL
Aligns components vertically. |
| Constructor Summary | |
|---|---|
SplitterLayout()
Constructor. |
|
SplitterLayout(int orientation)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Adds the specified component to the layout, using the specified constraint object. |
void |
addLayoutComponent(java.lang.String constraint,
java.awt.Component comp)
Deprecated. replaced by addLayoutComponent(Component,Object) |
float |
getLayoutAlignmentX(java.awt.Container parent)
Returns the alignment along the x axis. |
float |
getLayoutAlignmentY(java.awt.Container parent)
Returns the alignment along the y axis. |
int |
getOrientation()
Gets the orientation of the layout. |
protected SplitterConstraint |
getSplitterConstraint(java.awt.Component c)
Retrieves the constraints of a component. |
void |
invalidateLayout(java.awt.Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
void |
layoutContainer(java.awt.Container container)
Lays out the container argument using this layout. |
java.awt.Dimension |
maximumLayoutSize(java.awt.Container target)
Returns the maximum dimensions for this layout given the components in the specified target container. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container target)
Determines the minimum size of the target container using this layout manager. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container target)
Determines the preferred size of the target container using this layout manager, based on the components in the container. |
void |
processSplitterDrag(SplitterBar splitter,
java.awt.Point pDelta,
boolean updateLayout)
Processes a splitter bar drag event. |
void |
removeLayoutComponent(java.awt.Component comp)
Removes the specified component from this dock layout. |
void |
setOrientation(int orientation)
Sets the orientation of the layout. |
java.lang.String |
toString()
Returns a string representation of the state of this object. |
| 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
| Constructor Detail |
|---|
public SplitterLayout()
public SplitterLayout(int orientation)
orientation - Orientation of the components in the container
(VERTICAL or HORIZONTAL)| Method Detail |
|---|
public int getOrientation()
VERTICAL or HORIZONTAL)public void setOrientation(int orientation)
orientation - The new orientation (VERTICAL or HORIZONTAL)
public final void addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
addLayoutComponent in interface java.awt.LayoutManager2comp - Component to be addedconstraints - Object that specifies how and where
the component is added to the layout.
java.lang.IllegalArgumentException - If the constraint object is not a number
public final void addLayoutComponent(java.lang.String constraint,
java.awt.Component comp)
addLayoutComponent(Component,Object)
addLayoutComponent in interface java.awt.LayoutManagerconstraint - Component constraintcomp - Component to be addedpublic final void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent in interface java.awt.LayoutManagercomp - Component to be removedpublic final void layoutContainer(java.awt.Container container)
layoutContainer in interface java.awt.LayoutManagercontainer - Container in which to do the layout
public void processSplitterDrag(SplitterBar splitter,
java.awt.Point pDelta,
boolean updateLayout)
splitter - Splitter being draggedpDelta - Offset to current splitter bar position.updateLayout - true Update the layout immediately.public final java.awt.Dimension preferredLayoutSize(java.awt.Container target)
preferredLayoutSize in interface java.awt.LayoutManagertarget - Container in which to do the layout
public final java.awt.Dimension minimumLayoutSize(java.awt.Container target)
minimumLayoutSize in interface java.awt.LayoutManagertarget - Container in which to do the layout
public final java.awt.Dimension maximumLayoutSize(java.awt.Container target)
maximumLayoutSize in interface java.awt.LayoutManager2target - Component which needs to be laid out
public float getLayoutAlignmentX(java.awt.Container parent)
getLayoutAlignmentX in interface java.awt.LayoutManager2parent - Container the layout has been applied to
public float getLayoutAlignmentY(java.awt.Container parent)
getLayoutAlignmentY in interface java.awt.LayoutManager2parent - Container the layout has been applied to
public void invalidateLayout(java.awt.Container target)
invalidateLayout in interface java.awt.LayoutManager2target - Container the layout has been applied toprotected SplitterConstraint getSplitterConstraint(java.awt.Component c)
c - Component to look at
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||