Class LegendPanel

java.lang.Object
ucar.unidata.idv.ui.LegendPanel
Direct Known Subclasses:
SideLegend.CategoryPanel

public class LegendPanel extends Object
Class LegendPanel provides a generic panel that displays some GUI content and can be closed/opened.
Author:
IDV development team
  • Field Details

    • contents

      protected JPanel contents
      The overall contents
    • extraRight

      protected JComponent extraRight
      If non-null shown at the top to the right of the topLabel
  • Constructor Details

    • LegendPanel

      public LegendPanel()
      Create me with no top components. These can get set later with setComponents(JComponent, JComponent, JComponent)
    • LegendPanel

      public LegendPanel(JComponent topLabel, JComponent extraLeft, JComponent extraRight)
      Create me with the given top components
      Parameters:
      topLabel - Label shown at the top
      extraLeft - If non-null shown at the top to the left of the topLabel
      extraRight - If non-null shown at the top to the right of the topLabel
    • LegendPanel

      public LegendPanel(JComponent topLabel, boolean makeBorder, JComponent extraLeft, JComponent extraRight)
      Create me with the given top components
      Parameters:
      topLabel - Label shown at the top
      makeBorder - If true then we also create a border
      extraLeft - If non-null shown at the top to the left of the topLabel
      extraRight - If non-null shown at the top to the right of the topLabel
  • Method Details

    • getExtraRight

      public JComponent getExtraRight()
      _more_
      Returns:
      _more_
    • setComponents

      protected void setComponents(JComponent topLabel, JComponent extraLeft, JComponent extraRight)
      Set the top components
      Parameters:
      topLabel - Label shown at the top
      extraLeft - If non-null shown at the top to the left of the topLabel
      extraRight - If non-null shown at the top to the right of the topLabel
    • getContents

      public JComponent getContents()
      Create, if needed, and return the overall GUI contents.
      Returns:
      the contents
    • reInitialize

      public void reInitialize()
      Clear all components in the innerPanel
    • clear

      public void clear()
      Clear the inner panel
    • walkMe

      public static void walkMe(JComponent comp, String tab)
      For debugging
      Parameters:
      comp - comp
      tab - tab _
    • doMakeContents

      protected void doMakeContents()
      Create the GUI. Make a topCenter panel where the top is the toggle button,extraLeft,topLabel,extraRight and the center is the innerPanel.
    • makeDropPanel

      public boolean makeDropPanel()
      _more_
      Returns:
      _more_
    • dropOk

      public boolean dropOk(Object object)
      _more_
      Parameters:
      object - _more_
      Returns:
      _more_
    • doDrop

      public void doDrop(Object object)
      _more_
      Parameters:
      object - _more_
    • add

      public void add(JComponent c)
      Add the component into the innerPanel.
      Parameters:
      c - The component to add
    • add

      public void add(JComponent c, boolean doBorder)
      Add the component into the innerPanel.
      Parameters:
      c - The component to add
      doBorder - Should a border get created around the component.
    • setInnerVisible

      protected void setInnerVisible(boolean b)
      Show or hide the inner panel. Change the icon in the toggle button accordingly.
      Parameters:
      b - Is it visible
    • getInnerVisible

      public boolean getInnerVisible()
      Get the InnerVisible property.
      Returns:
      The InnerVisible
    • toggleInnerVisible

      protected void toggleInnerVisible()
      Show or hide the inner panel. Change the icon in the toggle button accordingly.