Package bdv.ui

Class CardPanel


  • public class CardPanel
    extends Object
    CardPanel handles components in named Cards which can be expanded or collapsed.
    Author:
    Tim-Oliver Buchholz, MPI-CBG CSBD, Dresden, Tobias Pietzsch
    • Constructor Detail

      • CardPanel

        public CardPanel()
        Empty card panel.
    • Method Detail

      • addCard

        public boolean addCard​(String title,
                               JComponent component,
                               boolean expanded,
                               Insets insets)
        Add a new JComponent to 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 card
        expanded - state of the card
        insets - 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 new JComponent to 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 card
        expanded - state of the card
        insets - insets of card body
        Returns:
        if a new card was successfully added
      • addCard

        public boolean addCard​(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 card
        expanded - new state