|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.javasoft.swing.JComponentGroup
public class JComponentGroup
A JComponentGroup groups components such that they can coordinate their sizes. The preferred, minimum and maximum size properties of grouped components are reconciled. If one of the reconciled sizes changes, this class is notified and the size is stored for the concerned component. All components of the group are then notified and the corresponding size is set to the largest value of all components (includes the component which just changed its size).
| Nested Class Summary | |
|---|---|
static class |
JComponentGroup.Binding
|
| Constructor Summary | |
|---|---|
JComponentGroup(JComponentGroup.Binding binding)
Creates a component group with the given binding constraints |
|
| Method Summary | |
|---|---|
JComponent |
addComponent(JComponent component)
Adds the specified component to this component group. |
JComponent |
addComponentNoStretching(JComponent component)
Adds the component in a panel, such that the component itself is not stretched. |
JComponent |
addComponentNoStretching(JComponent component,
int align)
Adds the component in a panel, such that the component itself is not stretched. |
static JComponentGroup |
bind(JComponentGroup.Binding binding,
JComponent... components)
Creates a component group with the specified binding constraints, adding the given components to this component group |
static JComponentGroup |
bind(JComponent label,
JComponent control)
Creates a component group with y binding for the specified controls |
boolean |
doBindX()
True for BIND_X and BIND_BOTH |
boolean |
doBindY()
True for BIND_Y and BIND_BOTH |
protected void |
fireComponentChanged(String event,
JComponent component)
The given component has changed, meaning been added, removed, hidden, shown or resized. |
protected void |
fireSizeChanged(JComponent component,
ComponentSizeType sizeType)
The specified size of the given component changed. |
JComponentGroup.Binding |
getBinding()
Returns the binding as specified when invoking the constructor |
protected Dimension |
getMaximumSize(JComponent component)
Returns the maximum group size. |
protected Dimension |
getMinimumSize(JComponent component)
Returns the minimum group size. |
protected Dimension |
getPreferredSize(JComponent component)
Returns the preferred group size. |
protected Dimension |
getSize(JComponent component,
ComponentSizeType sizeType)
Returns the specified group size. |
protected boolean |
log()
Return true if you want to have calls to log(String),
false (default) otherwise |
protected void |
log(String msg)
Logs to system output. |
JComponent |
removeComponent(JComponent component)
Removes the specified component from this component group. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JComponentGroup(JComponentGroup.Binding binding)
binding - the binding constraints| Method Detail |
|---|
public static JComponentGroup bind(JComponentGroup.Binding binding,
JComponent... components)
binding - the binding constraintscomponents - the components to add to this component group
public static JComponentGroup bind(JComponent label,
JComponent control)
label - the label componentcontrol - the control component, for instance a text field
belonging to the given label componentpublic JComponent addComponent(JComponent component)
component - the component to add
public JComponent removeComponent(JComponent component)
component - the component to remove
public JComponent addComponentNoStretching(JComponent component)
To remove the component from this component group, the returned panel must be passed to the remove method.
component - the component to add
public JComponent addComponentNoStretching(JComponent component,
int align)
component - the component to addalign - the alignment as specified by SwingConstants
public JComponentGroup.Binding getBinding()
public boolean doBindX()
public boolean doBindY()
protected void fireComponentChanged(String event,
JComponent component)
fireSizeChanged(JComponent, ComponentSizeType)
for preferred, minimum and maximum size.
event - the cause for the call to this method (for logging only)component - the component which changed
protected void fireSizeChanged(JComponent component,
ComponentSizeType sizeType)
protected Dimension getPreferredSize(JComponent component)
component - The component to take the size from if the axis is not
bound
protected Dimension getMinimumSize(JComponent component)
component - The component to take the size from if the axis is not
bound
protected Dimension getMaximumSize(JComponent component)
component - The component to take the size from if the axis is not
bound
protected Dimension getSize(JComponent component,
ComponentSizeType sizeType)
component - The component to take the size from if the axis is not
bound
protected boolean log()
log(String),
false (default) otherwise
protected void log(String msg)
log() returns true
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||