public abstract class AbstractOverlayListPanel
extends javax.swing.JPanel
AbstractOverlayListPanel
class is the abstract
parent of all overlay list panels. It allows the user to add new
overlays via a set of buttons, remove overlays from the current
list, edit a specific overlay using an overlay property chooser,
and rearrange the overlay layers within the list. Child classes
must implement the getAddButtons()
method which
returns a list of the "add overlay" buttons, and the
getTitle()
method which determine the title for parts
of the panel. Child classes may also override the
getCustomPanel()
method to supply a custom panel that
is inserted between the add button panel and the overlay list.
The overlay list panel signals an add/remove in the overlay list by
firing a property change event whose property name is given by the
OVERLAY_PROPERTY
constant, and old value (if non-null)
contains an overlay to remove from the view, and new value (if
non-null) contains an overlay to add to the view. If the overlay
to add already exists in the view, then the overlay's internal
properties have changed and the view should be re-rendered.
Additionally, a selection change in the overlay list is signaled by
firing a property change event whose property name is given by the
SELECTION_PROPERTY
constant. The selection value is
the currently selected EarthDataOverlay
object, or
null if none is selected. If multiple overlays are selected, no
event is fired.
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
OVERLAY_PROPERTY
The overlay property for change events.
|
protected ComponentList<VisualOverlay> |
overlayList
The list of overlays.
|
static java.lang.String |
SELECTION_PROPERTY
The selection property for change events.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Modifier | Constructor and Description |
---|---|
protected |
AbstractOverlayListPanel()
Creates a new list panel, showing the Remove/Edit/Up/Down buttons.
|
protected |
AbstractOverlayListPanel(boolean showRemove,
boolean showEdit,
boolean showArrange,
boolean showVisibility,
boolean showGroup)
Creates a new list panel with the specified buttons.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addOverlay(EarthDataOverlay overlay)
Adds an overlay to the list.
|
protected void |
addOverlays(java.util.List overlays)
Adds a set of overlays to the list.
|
protected abstract java.util.List |
getAddButtons()
Gets the list of add overlay buttons.
|
protected java.lang.String |
getButtonTitle()
Gets the title that will be used to annotate the button panel.
|
protected javax.swing.JPanel |
getCustomPanel()
Gets a custom panel to be placed between the add overlay button
panel and the overlay list.
|
protected java.lang.String |
getGroupTitle()
Gets the title that will be used to annotate the groups panel.
|
protected java.lang.String |
getListTitle()
Gets the title that will be used to annotate the list panel.
|
protected int |
getOverlayCount(java.lang.Object overlayKey)
Gets and increments the current count of overlays created with
the specified key.
|
java.util.List |
getOverlayList()
Gets the list of overlays.
|
protected abstract java.lang.String |
getTitle()
Gets the title that will be used to annotate the button and list
panels.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
protected void |
removeOverlays()
Removes all overlays from the list.
|
void |
setBaseLayer(int baseLayer)
Sets the base layer.
|
void |
setDataSource(EarthDataReader reader,
java.util.List variableList)
Sets the data source for bitmask grid data.
|
void |
setVisibleRowCount(int rows)
Sets the preferred number of visible overlay list rows.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static java.lang.String OVERLAY_PROPERTY
public static java.lang.String SELECTION_PROPERTY
protected ComponentList<VisualOverlay> overlayList
protected AbstractOverlayListPanel()
protected AbstractOverlayListPanel(boolean showRemove, boolean showEdit, boolean showArrange, boolean showVisibility, boolean showGroup)
showRemove
- if true, shows the remove overlay button.showEdit
- if true, shows the edit selected overlay button.showArrange
- if true, shows the up and down overlay buttons.showVisibility
- if true, shows the visibility modifier buttons.showGroup
- if true, shows the overlay group panel.public void setDataSource(EarthDataReader reader, java.util.List variableList)
reader
- the reader to use for data variables.variableList
- the list of allowed data variable names.OverlayGroupManager
protected javax.swing.JPanel getCustomPanel()
public void setVisibleRowCount(int rows)
rows
- the number of visible rows.public void setBaseLayer(int baseLayer)
baseLayer
- the base layer for the initial overlay.protected void removeOverlays()
protected void addOverlays(java.util.List overlays)
overlays
- the initial set of overlays.protected void addOverlay(EarthDataOverlay overlay)
overlay
- the overlay to add.protected abstract java.util.List getAddButtons()
addOverlay()
method.protected abstract java.lang.String getTitle()
protected java.lang.String getButtonTitle()
protected java.lang.String getListTitle()
protected java.lang.String getGroupTitle()
protected int getOverlayCount(java.lang.Object overlayKey)
overlayKey
- the overlay key used to uniquely identify a
set of overlays.public java.util.List getOverlayList()
public static void main(java.lang.String[] argv)
argv
- the array of arguments (ignored).