Public Methods | |
| SegmentDescriptionPanel () | |
| SegmentDescriptionItem | addSegmentItem (String segLabel) |
| void | clearSegments () |
|
|
00021 {
00022 setLayout(new BorderLayout());
00023
00024 // labels are placed in a different panel because they don't have
00025 // a fixed size. This other panel keeps them aligned.
00026
00027 _labelPanel = new JPanel();
00028 _labelPanel.setLayout(new BoxLayout(_labelPanel, BoxLayout.Y_AXIS));
00029
00030 _descPanel = new JPanel();
00031 _descPanel.setLayout(new BoxLayout(_descPanel, BoxLayout.Y_AXIS));
00032
00033 add(_labelPanel, BorderLayout.WEST);
00034 add(_descPanel, BorderLayout.CENTER);
00035
00036 }
|
|
|
00039 {
00040 JPanel p = new JPanel();
00041 p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
00042 p.setBorder(BorderFactory.createEmptyBorder(2,5,2,5));
00043
00044 //We use the sizes of a TextField to align the rows of
00045 // _labelPanel and _descPanel.
00046
00047 JLabel l = new JLabel(segLabel);
00048 JTextField t = new JTextField("");
00049 l.setMaximumSize(new Dimension(Short.MAX_VALUE, t.getPreferredSize().height));
00050 p.add(l);
00051
00052 SegmentDescriptionItem item = new SegmentDescriptionItem();
00053 _descPanel.add(item);
00054 _labelPanel.add(p);
00055
00056 revalidate();
00057 repaint();
00058
00059 return item;
00060 }
|
|
|
00063 {
00064 _descPanel.removeAll();
00065 _descPanel.validate();
00066 _descPanel.repaint();
00067
00068 _labelPanel.removeAll();
00069 _labelPanel.validate();
00070 _labelPanel.repaint();
00071 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001