Package ucar.unidata.idv.ui
Class LegendPanel
java.lang.Object
ucar.unidata.idv.ui.LegendPanel
- Direct Known Subclasses:
SideLegend.CategoryPanel
Class LegendPanel provides a generic panel that displays some GUI content
and can be closed/opened.
- Author:
- IDV development team
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JPanelThe overall contentsprotected JComponentIf non-null shown at the top to the right of the topLabel -
Constructor Summary
ConstructorsConstructorDescriptionCreate me with no top components.LegendPanel(JComponent topLabel, boolean makeBorder, JComponent extraLeft, JComponent extraRight) Create me with the given top componentsLegendPanel(JComponent topLabel, JComponent extraLeft, JComponent extraRight) Create me with the given top components -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(JComponent c) Add the component into the innerPanel.voidadd(JComponent c, boolean doBorder) Add the component into the innerPanel.voidclear()Clear the inner panelvoid_more_protected voidCreate the GUI.boolean_more_Create, if needed, and return the overall GUI contents._more_booleanGet the InnerVisible property.boolean_more_voidClear all components in the innerPanelprotected voidsetComponents(JComponent topLabel, JComponent extraLeft, JComponent extraRight) Set the top componentsprotected voidsetInnerVisible(boolean b) Show or hide the inner panel.protected voidShow or hide the inner panel.static voidwalkMe(JComponent comp, String tab) For debugging
-
Field Details
-
contents
The overall contents -
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 withsetComponents(JComponent, JComponent, JComponent) -
LegendPanel
Create me with the given top components- Parameters:
topLabel- Label shown at the topextraLeft- If non-null shown at the top to the left of the topLabelextraRight- 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 topmakeBorder- If true then we also create a borderextraLeft- If non-null shown at the top to the left of the topLabelextraRight- If non-null shown at the top to the right of the topLabel
-
-
Method Details
-
getExtraRight
_more_- Returns:
- _more_
-
setComponents
Set the top components- Parameters:
topLabel- Label shown at the topextraLeft- If non-null shown at the top to the left of the topLabelextraRight- If non-null shown at the top to the right of the topLabel
-
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
For debugging- Parameters:
comp- comptab- 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
_more_- Parameters:
object- _more_- Returns:
- _more_
-
doDrop
_more_- Parameters:
object- _more_
-
add
Add the component into the innerPanel.- Parameters:
c- The component to add
-
add
Add the component into the innerPanel.- Parameters:
c- The component to adddoBorder- 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.
-