| | |
| | | private static final long serialVersionUID = 8941374689175404431L; |
| | | private JPanel panel; |
| | | private JComponent child; |
| | | private Category category; |
| | | |
| | | private CategoryButton expandButton; |
| | | private boolean expanded = true; |
| | |
| | | expandButton.addChangeListener(new CollapseListener()); |
| | | add(expandButton, BorderLayout.NORTH); |
| | | |
| | | this.category = category; |
| | | |
| | | setBorder(categoryBorder); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the category associated with this panel. |
| | | * @return the category associated with this panel. |
| | | */ |
| | | public Category getCategory() |
| | | { |
| | | return category; |
| | | } |
| | | |
| | | /** |
| | | * Returns the component that must be displayed by this panel if its |
| | | * CategoryButton is in a certain state. |
| | | * @return the component that must be displayed by this panel if its |
| | | * CategoryButton is in a certain state. |
| | | */ |
| | | public JComponent getChild() |
| | | { |
| | | return child; |
| | | } |
| | | |
| | | /** |
| | | * Returns <CODE>true</CODE> if the panel is extended and <CODE>false</CODE> |
| | | * otherwise. |
| | | * @return <CODE>true</CODE> if the panel is extended and <CODE>false</CODE> |