- java.lang.Object
-
- bdv.ui.CardPanel
-
public class CardPanel extends Object
CardPanel handles components in namedCards which can be expanded or collapsed.- Author:
- Tim-Oliver Buchholz, MPI-CBG CSBD, Dresden, Tobias Pietzsch
-
-
Constructor Summary
Constructors Constructor Description CardPanel()Empty card panel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddCard(Object key, String title, JComponent component, boolean expanded)booleanaddCard(Object key, String title, JComponent component, boolean expanded, Insets insets)Add a newJComponentto the card panel.booleanaddCard(String title, JComponent component, boolean expanded)booleanaddCard(String title, JComponent component, boolean expanded, Insets insets)Add a newJComponentto the card panel.JComponentgetComponent()intindexOf(Object key)TODObooleanisCardExpanded(Object key)Get expanded state of a card.voidremoveCard(Object key)Remove a card.voidsetCardExpanded(Object key, boolean expanded)Set open state of a card
-
-
-
Method Detail
-
getComponent
public JComponent getComponent()
-
addCard
public boolean addCard(String title, JComponent component, boolean expanded, Insets insets)
Add a newJComponentto the card panel.- Parameters:
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 body- Returns:
- if a new card was successfully added
-
addCard
public boolean addCard(Object key, String title, JComponent component, boolean expanded, Insets insets)
Add a newJComponentto the card panel.- Parameters:
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 body- Returns:
- if a new card was successfully added
-
addCard
public boolean addCard(String title, JComponent component, boolean expanded)
-
addCard
public boolean addCard(Object key, String title, JComponent component, boolean expanded)
-
removeCard
public void removeCard(Object key)
Remove a card. If the card does not exist, nothing happens.- Parameters:
key- of the card
-
indexOf
public int indexOf(Object key)
TODO- Parameters:
key-- Returns:
-
isCardExpanded
public boolean isCardExpanded(Object key)
Get expanded state of a card.- Parameters:
key- of the card- Returns:
- open state
-
setCardExpanded
public void setCardExpanded(Object key, boolean expanded)
Set open state of a card- Parameters:
key- of the cardexpanded- new state
-
-