org.salespointframework.desktop
Class JOptionPanel.OptionLayout

java.lang.Object
  extended by org.salespointframework.desktop.JOptionPanel.OptionLayout
All Implemented Interfaces:
java.awt.LayoutManager
Enclosing class:
JOptionPanel

private class JOptionPanel.OptionLayout
extends java.lang.Object
implements java.awt.LayoutManager

A LayoutManager for positioning components in the way wished for. This could also be done using several components and - for example - BoxLayout. But there are some disadvantages concerning exact positioning. Also here we can correctly handle "filling cases", e.g. components using all the space that is possibly left (both horizontally and vertically). Alignment (e.g. putting all stuff in the center) can be done quite easily that way, too.

Author:
Thomas Ryssel

Field Summary
private  int m_nHgap
          The horizontal gap (between titles and components).
private  int m_nHorizontalAlign
          The horizontal alignment.
private  int m_nVerticalAlign
          The vertical alignment.
private  int n_nVgap
          The vertical gap.
 
Constructor Summary
JOptionPanel.OptionLayout(int hgap, int vgap, int horiz, int vert)
          Create a new OptionLayout.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Add a special layout component.
 void layoutContainer(java.awt.Container parent)
          Do the actual layout work.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Get the minimum Dimension of the layout.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Get the preferred Dimension of the layout.
 void removeLayoutComponent(java.awt.Component comp)
          Remove a special layout component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_nHgap

private int m_nHgap
The horizontal gap (between titles and components).


n_nVgap

private int n_nVgap
The vertical gap.


m_nHorizontalAlign

private int m_nHorizontalAlign
The horizontal alignment.


m_nVerticalAlign

private int m_nVerticalAlign
The vertical alignment.

Constructor Detail

JOptionPanel.OptionLayout

public JOptionPanel.OptionLayout(int hgap,
                                 int vgap,
                                 int horiz,
                                 int vert)
Create a new OptionLayout.

Parameters:
hgap - Horizontal gap.
vgap - Vertical gap.
horiz - Horizontal alignment.
vert - Vertical alignment.
Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Add a special layout component. Not used in this implementation.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Remove a special layout component. Not used in this implementation.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Get the preferred Dimension of the layout.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Get the minimum Dimension of the layout.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container parent)
Do the actual layout work.

Specified by:
layoutContainer in interface java.awt.LayoutManager