com.jgoodies.forms.factories
Class DefaultComponentFactory.TitledSeparatorLayout

java.lang.Object
  extended by com.jgoodies.forms.factories.DefaultComponentFactory.TitledSeparatorLayout
All Implemented Interfaces:
java.awt.LayoutManager
Enclosing class:
DefaultComponentFactory

private static final class DefaultComponentFactory.TitledSeparatorLayout
extends java.lang.Object
implements java.awt.LayoutManager

A layout for the title label and separator(s) in titled separators.


Field Summary
private  boolean centerSeparators
           
 
Constructor Summary
private DefaultComponentFactory.TitledSeparatorLayout(boolean centerSeparators)
          Constructs a TitledSeparatorLayout that either centers the separators or aligns them along the font baseline of the title label.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Does nothing.
private  javax.swing.JLabel getLabel(java.awt.Container parent)
           
 void layoutContainer(java.awt.Container parent)
          Lays out the specified container.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Computes and returns the minimum size dimensions for the specified container.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Computes and returns the preferred size dimensions for the specified container.
 void removeLayoutComponent(java.awt.Component comp)
          Does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

centerSeparators

private final boolean centerSeparators
Constructor Detail

DefaultComponentFactory.TitledSeparatorLayout

private DefaultComponentFactory.TitledSeparatorLayout(boolean centerSeparators)
Constructs a TitledSeparatorLayout that either centers the separators or aligns them along the font baseline of the title label.

Parameters:
centerSeparators - true to center, false to align along the font baseline of the title label
Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Does nothing. This layout manager looks up the components from the layout container and used the component's index in the child array to identify the label and separators.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
name - the string to be associated with the component
comp - the component to be added

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Does nothing. This layout manager looks up the components from the layout container and used the component's index in the child array to identify the label and separators.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - the component to be removed

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Computes and returns the minimum size dimensions for the specified container. Forwards this request to #preferredLayoutSize.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
Returns:
the container's minimum size.
See Also:
preferredLayoutSize(Container)

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Computes and returns the preferred size dimensions for the specified container. Returns the title label's preferred size.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
Returns:
the container's preferred size.
See Also:
minimumLayoutSize(Container)

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the specified container.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Parameters:
parent - the container to be laid out

getLabel

private javax.swing.JLabel getLabel(java.awt.Container parent)