Package ucar.unidata.idv.ui
Class IdvLegend
java.lang.Object
ucar.unidata.idv.ui.IdvLegend
- All Implemented Interfaces:
Removable
- Direct Known Subclasses:
BottomLegend,SideLegend
An abstract base class used to represents display control legends
for view managers.
- Author:
- IDV development team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ImageIcon_more_static final ImageIcon_more_protected static ImageIconThe icon used to bring up the display properties windowstatic ImageIconIcon used to remove displaysstatic final String_more_static final String_more_static final String_more_protected ViewManagerTheViewManagerthis legend is part of -
Constructor Summary
ConstructorsConstructorDescriptionParameterless constructor for xml persistenceIdvLegend(ViewManager viewManager) Create the legend with the givenViewManager -
Method Summary
Modifier and TypeMethodDescriptionvoiddoClose()The ViewManager in which thie legend is a part of has been closed.protected abstract JComponentTo be overrode by derived classes to return the actual GUI contents.voiddoRemove()_more_final voidThis is called when there is a change to the list of DisplayControls shown in this legend.protected abstract voidTo be overrode by derived classes to fill the legend.voidFloat the legend in its own window.Get the Container property.Create, if needed, and return the GUI contents.protected JButtonCreate, if needed, and return the floatButton.protected StringgetTitle()Get the window title to use.protected JButtonmakePropertiesButton(DisplayControl control) Create an icon button for showing the window for the given display control.voidNo-op.voidsetContentsToUse(JComponent contents) _more_voidsetTheContainer(JComponent value) Set the Container property.voidsetViewManager(ViewManager viewManager) Set the view manager that this legend is part ofvoidThis will float the legend.void_more_
-
Field Details
-
STATE_HIDDEN
_more_- See Also:
-
STATE_DOCKED
_more_- See Also:
-
STATE_FLOAT
_more_- See Also:
-
ICON_FLOAT
_more_ -
ICON_DOCKED
_more_ -
ICON_PROPERTIES
The icon used to bring up the display properties window -
ICON_REMOVE
Icon used to remove displays -
viewManager
TheViewManagerthis legend is part of
-
-
Constructor Details
-
IdvLegend
public IdvLegend()Parameterless constructor for xml persistence -
IdvLegend
Create the legend with the givenViewManager- Parameters:
viewManager- The view manager this legend is a part of
-
-
Method Details
-
setContentsToUse
_more_- Parameters:
contents- _more_
-
getContents
Create, if needed, and return the GUI contents.- Returns:
- The GUI contents
-
setViewManager
Set the view manager that this legend is part of- Parameters:
viewManager- The view manager
-
setTheContainer
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
Get the Container property.- Returns:
- The Container
-
setColors
No-op. To be overrode by any subclasses that might use the colors of the ViewManager- Parameters:
foreground- The foreground color of the ViewManagerbackground- The background color of the ViewManager
-
getFloatButton
Create, if needed, and return the floatButton.- Returns:
- The float button
-
showLegend
public void showLegend()This will float the legend. -
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 fromfillLegend()within a synchronized block. -
makePropertiesButton
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_ -
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.
-