public class CardPanel extends Object
Cards which can be expanded or collapsed.| Constructor and Description |
|---|
CardPanel()
Empty card panel.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCard(Object key,
String title,
JComponent component,
boolean expanded) |
boolean |
addCard(Object key,
String title,
JComponent component,
boolean expanded,
Insets insets)
Add a new
JComponent to the card panel. |
boolean |
addCard(String title,
JComponent component,
boolean expanded) |
boolean |
addCard(String title,
JComponent component,
boolean expanded,
Insets insets)
Add a new
JComponent to the card panel. |
Color |
getCardBackground() |
JComponent |
getComponent() |
Color |
getHeaderBackground() |
Color |
getHeaderForeground() |
int |
indexOf(Object key)
TODO
|
boolean |
isCardExpanded(Object key)
Get expanded state of a card.
|
void |
removeCard(Object key)
Remove a card.
|
void |
setCardBackground(Color bg)
Set the card background color
|
void |
setCardExpanded(Object key,
boolean expanded)
Set open state of a card
|
void |
setHeaderBackground(Color bg)
Set the header background color
|
void |
setHeaderForeground(Color fg)
Set the header foreground color
|
public JComponent getComponent()
public boolean addCard(String title, JComponent component, boolean expanded, Insets insets)
JComponent to the card panel.title - title of the new card. Is shown in the card header.
This is also used as the key of the new card.
If a card with this key already exists, no new card will be added!component - body of the new cardexpanded - state of the cardinsets - insets of card bodypublic boolean addCard(Object key, String title, JComponent component, boolean expanded, Insets insets)
JComponent to the card panel.key - key of the new card.
If a card with this key already exists, no new card will be added!title - title of the new card. Is shown in the card header.component - body of the new cardexpanded - state of the cardinsets - insets of card bodypublic boolean addCard(String title, JComponent component, boolean expanded)
public boolean addCard(Object key, String title, JComponent component, boolean expanded)
public void removeCard(Object key)
key - of the cardpublic int indexOf(Object key)
key - public boolean isCardExpanded(Object key)
key - of the cardpublic void setCardExpanded(Object key, boolean expanded)
key - of the cardexpanded - new statepublic void setCardBackground(Color bg)
public Color getCardBackground()
public void setHeaderBackground(Color bg)
public Color getHeaderBackground()
public void setHeaderForeground(Color fg)
public Color getHeaderForeground()
Copyright © 2015–2021 Fiji. All rights reserved.