Horus Doc || Java GUI Reference || Doxygen's quick Index  

PropertyPanel Class Reference

List of all members.

Public Methods

 PropertyPanel ()
 PropertyPanel (int vgap)
void addPair (String name, JComponent c)
void addPair (String name, Component c)

Constructor & Destructor Documentation

PropertyPanel::PropertyPanel   [inline]
 

00021 {
00022     this(0);
00023 }

PropertyPanel::PropertyPanel int    vgap [inline]
 

00026 {
00027     setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
00028     setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
00029 
00030     _itemsPanel = new JPanel(new BorderLayout(20,5));
00031 
00032     _labelPanel = new JPanel(new GridLayout(0, 1, 0, vgap));
00033     _fieldPanel = new JPanel(new GridLayout(0, 1, 0, vgap));
00034     _itemsPanel.add(_labelPanel, BorderLayout.WEST);
00035     _itemsPanel.add(_fieldPanel, BorderLayout.CENTER);
00036 
00037     add(_itemsPanel);
00038     add(Box.createVerticalGlue());
00039 }


Member Function Documentation

void PropertyPanel::addPair String    name,
JComponent    c
[inline]
 

00042 {
00043     addPair(name, (Component)c);
00044 }

void PropertyPanel::addPair String    name,
Component    c
[inline]
 

00047 {
00048     if(c == null) c = new JLabel();
00049 
00050     _labelPanel.add(new JLabel(name));
00051     _fieldPanel.add(c);
00052 
00053     Dimension d = _itemsPanel.getPreferredSize();
00054     _itemsPanel.setMaximumSize(new Dimension(Short.MAX_VALUE, d.height));
00055 }


The documentation for this class was generated from the following file:
Generated on Tue Feb 3 14:19:50 2004 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001