Class IdvLegend

java.lang.Object
ucar.unidata.idv.ui.IdvLegend
All Implemented Interfaces:
Removable
Direct Known Subclasses:
BottomLegend, SideLegend

public abstract class IdvLegend extends Object implements Removable
An abstract base class used to represents display control legends for view managers.
Author:
IDV development team
  • Field Details

  • Constructor Details

    • IdvLegend

      public IdvLegend()
      Parameterless constructor for xml persistence
    • IdvLegend

      public IdvLegend(ViewManager viewManager)
      Create the legend with the given ViewManager
      Parameters:
      viewManager - The view manager this legend is a part of
  • Method Details

    • setContentsToUse

      public void setContentsToUse(JComponent contents)
      _more_
      Parameters:
      contents - _more_
    • getContents

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

      public void setViewManager(ViewManager viewManager)
      Set the view manager that this legend is part of
      Parameters:
      viewManager - The view manager
    • setTheContainer

      public void setTheContainer(JComponent value)
      Set the Container property. This is the container in the parent ViewManager that this legend is shown in. This method is differently named from the getContainer method so that the value is not persisted when doing xml encoding.
      Parameters:
      value - The new value for Container
    • getContainer

      public JComponent getContainer()
      Get the Container property.
      Returns:
      The Container
    • setColors

      public void setColors(Color foreground, Color background)
      No-op. To be overrode by any subclasses that might use the colors of the ViewManager
      Parameters:
      foreground - The foreground color of the ViewManager
      background - The background color of the ViewManager
    • getFloatButton

      protected JButton getFloatButton()
      Create, if needed, and return the floatButton.
      Returns:
      The float button
    • showLegend

      public void showLegend()
      This will float the legend.
    • doMakeContents

      protected abstract JComponent doMakeContents()
      To be overrode by derived classes to return the actual GUI contents.
      Returns:
      The GUI contents
    • fillLegend

      public final void fillLegend()
      This is called when there is a change to the list of DisplayControls shown in this legend. It simply is a wrapper around fillLegendSafely, synchronizing on a MUTEX lock.
    • fillLegendSafely

      protected abstract void fillLegendSafely()
      To be overrode by derived classes to fill the legend. This is called from fillLegend() within a synchronized block.
    • makePropertiesButton

      protected JButton makePropertiesButton(DisplayControl control)
      Create an icon button for showing the window for the given display control.
      Parameters:
      control - The display control
      Returns:
      The button used to show the window
    • doClose

      public void doClose()
      The ViewManager in which thie legend is a part of has been closed. This method disposes of the floatFrame if it is non-null.
    • doRemove

      public void doRemove()
      _more_
      Specified by:
      doRemove in interface Removable
    • getTitle

      protected String getTitle()
      Get the window title to use.
      Returns:
      The window title
    • unFloatLegend

      public void unFloatLegend()
      _more_
    • floatLegend

      public void floatLegend()
      Float the legend in its own window.