ucar.unidata.idv.ui
Class LegendPanel

java.lang.Object
  extended by 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 Summary
protected  JPanel contents
          The overall contents
protected  JComponent extraRight
          If non-null shown at the top to the right of the topLabel
 
Constructor Summary
LegendPanel()
          Create me with no top components.
LegendPanel(JComponent topLabel, boolean makeBorder, JComponent extraLeft, JComponent extraRight)
          Create me with the given top components
LegendPanel(JComponent topLabel, JComponent extraLeft, JComponent extraRight)
          Create me with the given top components
 
Method Summary
 void add(JComponent c)
          Add the component into the innerPanel.
 void add(JComponent c, boolean doBorder)
          Add the component into the innerPanel.
 void clear()
          Clear the inner panel
 void doDrop(Object object)
           
protected  void doMakeContents()
          Create the GUI.
 boolean dropOk(Object object)
           
 JComponent getContents()
          Create, if needed, and return the overall GUI contents.
 boolean getInnerVisible()
          Get the InnerVisible property.
 boolean makeDropPanel()
           
 void reInitialize()
          Clear all components in the innerPanel
protected  void setComponents(JComponent topLabel, JComponent extraLeft, JComponent extraRight)
          Set the top components
protected  void setInnerVisible(boolean b)
          Show or hide the inner panel.
protected  void toggleInnerVisible()
          Show or hide the inner panel.
static void walkMe(JComponent comp, String tab)
          For debugging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 Detail

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 Detail

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()

dropOk

public boolean dropOk(Object object)

doDrop

public void doDrop(Object object)

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.