Package ucar.unidata.view.station
Class StationLocationMap
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
ucar.unidata.view.station.StationLocationMap
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
A navigated panel with 2 renderers - a map renderer and a
station location renderer.
- Author:
- Don Murray
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Property for unselecting a stationstatic final String
name of default mapstatic final String
ID labelstatic final String
latitude labelstatic final String
longitude labelstatic final String
Name labelstatic final String
Property for selecting a stationstatic final String
Property to use the station ID for the station labelstatic final String
template for namestatic final String
template for name and idstatic final String
Property for unselecting a stationFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.StationLocationMap
(boolean multipleSelect) Construct a newStationLocationMap
using the specified station selection type.StationLocationMap
(boolean multipleSelect, String defaultMap) Construct a newStationLocationMap
using the specified station selection type and map.StationLocationMap
(boolean multipleSelect, String defaultMap, String template) Construct a newStationLocationMap
using the specified station selection type, map and template.StationLocationMap
(boolean multipleSelect, Renderer theMapRender) Create a StationLocationMapStationLocationMap
(boolean multipleSelect, Renderer theMapRender, String template) Create a StationLocationMapStationLocationMap
(String template) Construct a newStationLocationMap
using the specified label type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a property change listener.void
addPropertyChangeListener
(String name, PropertyChangeListener listener) Adds a property change listener for a named property.void
Convenience method to clear out the data in the station rendererprotected void
Process thePickEvent
.boolean
Determine whether decluttering is on for this map.Get the map renderer for this objectboolean
See if this supports multiple station selection.Access to the navigated panel.Get the list of selected stations.Access to the station location rendererGet the list of stationsboolean
See if a double click happened.boolean
Get the isFocusTransverable propertyboolean
See if this map allows multiple station selectionstatic void
test with ucar.unidata.view.station.StationLocationMapvoid
redraw()
Redraw the graphics on the screen.void
Removes a property change listener.void
removePropertyChangeListener
(String name, PropertyChangeListener listener) Removes a property change listener for a named property.protected void
Select all visible stations.void
setDeclutter
(boolean declut) Change the state of declutteringvoid
Set the map renderer for this objectvoid
setProjectionImpl
(ucar.unidata.geoloc.ProjectionImpl p) Set the projection to use for this map.void
setSelectedStations
(List stns) Set the list of selected stations.void
Set the station location renderer.void
setStations
(List stns) Set the list of stations to be displayed.void
setStations
(List stns, boolean declutter) Set the list of stations to be displayed.void
setStations
(List stns, List selectedStations, boolean declutter) Set the list of stations to be displayed.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
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
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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
Methods inherited from class java.awt.Component
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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, 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, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
SELECTED_PROPERTY
Property for selecting a station- See Also:
-
UNSELECTED_PROPERTY
Property for unselecting a station- See Also:
-
ALL_UNSELECTED_PROPERTY
Property for unselecting a station- See Also:
-
DEFAULT_MAP
name of default map- See Also:
-
LABEL_ID
ID label- See Also:
-
LABEL_NAME
Name label- See Also:
-
LABEL_LAT
latitude label- See Also:
-
LABEL_LON
longitude label- See Also:
-
TEMPLATE_ID
Property to use the station ID for the station label- See Also:
-
TEMPLATE_NAME
template for name- See Also:
-
TEMPLATE_NAME_AND_ID
template for name and id- See Also:
-
-
Constructor Details
-
StationLocationMap
public StationLocationMap()Default constructor. Uses default label type and single station selection. -
StationLocationMap
Construct a newStationLocationMap
using the specified label type. Use default station selection and map.- Parameters:
template
- The String template to use for displaying station labels.
-
StationLocationMap
public StationLocationMap(boolean multipleSelect) Construct a newStationLocationMap
using the specified station selection type. Use default labeling and map.- Parameters:
multipleSelect
- true to allow multiple station selections
-
StationLocationMap
Construct a newStationLocationMap
using the specified station selection type and map. Use default labeling.- Parameters:
multipleSelect
- true to allow multiple station selectionsdefaultMap
- map to use
-
StationLocationMap
Construct a newStationLocationMap
using the specified station selection type, map and template.- Parameters:
multipleSelect
- true to allow multiple station selectionsdefaultMap
- map to usetemplate
- The String template to use for displaying station labels.
-
StationLocationMap
Create a StationLocationMap- Parameters:
multipleSelect
- true if multiple selection is allowedtheMapRender
- the renderer for the map
-
StationLocationMap
Create a StationLocationMap- Parameters:
multipleSelect
- true if multiple selection is allowedtheMapRender
- the renderer for the maptemplate
- the template for the display of the data
-
-
Method Details
-
doPickPoint
Process thePickEvent
.- Parameters:
e
-PickEvent
to process
-
isFocusable
public boolean isFocusable()Get the isFocusTransverable property- Overrides:
isFocusable
in classComponent
- Returns:
- true if we can transverse focus
-
selectAll
protected void selectAll()Select all visible stations. -
isMultipleSelect
public boolean isMultipleSelect()See if this map allows multiple station selection- Returns:
- true if allows multiple selection.
-
getSelectedStations
Get the list of selected stations.- Returns:
List
of stations that have been selected.
-
setMapRenderer
Set the map renderer for this object- Parameters:
r
- map renderer
-
getMapRender
Get the map renderer for this object- Returns:
- Map renderer
-
getStationLocationRenderer
Access to the station location renderer- Returns:
- station location renderer
-
setStationRenderer
Set the station location renderer.- Parameters:
r
- station location renderer
-
setSelectedStations
Set the list of selected stations.- Parameters:
stns
-List
of stations to set selected.
-
setStations
Set the list of stations to be displayed. Stations will be decluttered when they are displayed.- Parameters:
stns
- list of stations
-
setStations
Set the list of stations to be displayed. Stations will be decluttered or not based on the value ofdeclutter
- Parameters:
stns
- list of stationsdeclutter
- display will be decluttered if true, not if false
-
setStations
Set the list of stations to be displayed. Stations will be decluttered or not based on the value ofdeclutter
- Parameters:
stns
- list of stationsselectedStations
- already selected stationsdeclutter
- display will be decluttered if true, not if false
-
getStations
Get the list of stations- Returns:
- the list of stations
-
setDeclutter
public void setDeclutter(boolean declut) Change the state of decluttering- Parameters:
declut
- station display will be decluttered if true, not if false
-
clearStations
public void clearStations()Convenience method to clear out the data in the station renderer -
getDeclutter
public boolean getDeclutter()Determine whether decluttering is on for this map.- Returns:
- true if map is being decluttered.
-
setProjectionImpl
public void setProjectionImpl(ucar.unidata.geoloc.ProjectionImpl p) Set the projection to use for this map.- Parameters:
p
- projection to use
-
addPropertyChangeListener
Adds a property change listener.- Overrides:
addPropertyChangeListener
in classContainer
- Parameters:
listener
- The property change listener.
-
removePropertyChangeListener
Removes a property change listener.- Overrides:
removePropertyChangeListener
in classComponent
- Parameters:
listener
- The property change listener.
-
addPropertyChangeListener
Adds a property change listener for a named property.- Overrides:
addPropertyChangeListener
in classContainer
- Parameters:
name
- The name of the property.listener
- The property change listener.
-
removePropertyChangeListener
Removes a property change listener for a named property.- Overrides:
removePropertyChangeListener
in classComponent
- Parameters:
name
- The name of the property.listener
- The property change listener.
-
redraw
public void redraw()Redraw the graphics on the screen. -
getMultipleSelect
public boolean getMultipleSelect()See if this supports multiple station selection.- Returns:
- true if this allows multiple station selection
-
main
test with ucar.unidata.view.station.StationLocationMap- Parameters:
args
-
-
getWasDoubleClick
public boolean getWasDoubleClick()See if a double click happened.- Returns:
- true if a double click happened
-