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.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty for unselecting a stationstatic final Stringname of default mapstatic final StringID labelstatic final Stringlatitude labelstatic final Stringlongitude labelstatic final StringName labelstatic final StringProperty for selecting a stationstatic final StringProperty to use the station ID for the station labelstatic final Stringtemplate for namestatic final Stringtemplate for name and idstatic final StringProperty 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_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.StationLocationMap(boolean multipleSelect) Construct a newStationLocationMapusing the specified station selection type.StationLocationMap(boolean multipleSelect, String defaultMap) Construct a newStationLocationMapusing the specified station selection type and map.StationLocationMap(boolean multipleSelect, String defaultMap, String template) Construct a newStationLocationMapusing 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 newStationLocationMapusing the specified label type. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a property change listener.voidaddPropertyChangeListener(String name, PropertyChangeListener listener) Adds a property change listener for a named property.voidConvenience method to clear out the data in the station rendererprotected voidProcess thePickEvent.booleanDetermine whether decluttering is on for this map.Get the map renderer for this objectbooleanSee 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 stationsbooleanSee if a double click happened.booleanGet the isFocusTransverable propertybooleanSee if this map allows multiple station selectionstatic voidtest with ucar.unidata.view.station.StationLocationMapvoidredraw()Redraw the graphics on the screen.voidRemoves a property change listener.voidremovePropertyChangeListener(String name, PropertyChangeListener listener) Removes a property change listener for a named property.protected voidSelect all visible stations.voidsetDeclutter(boolean declut) Change the state of declutteringvoidSet the map renderer for this objectvoidsetProjectionImpl(ucar.unidata.geoloc.ProjectionImpl p) Set the projection to use for this map.voidsetSelectedStations(List stns) Set the list of selected stations.voidSet the station location renderer.voidsetStations(List stns) Set the list of stations to be displayed.voidsetStations(List stns, boolean declutter) Set the list of stations to be displayed.voidsetStations(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, updateUIMethods 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, updateMethods 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, validateTreeMethods 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 newStationLocationMapusing 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 newStationLocationMapusing the specified station selection type. Use default labeling and map.- Parameters:
multipleSelect- true to allow multiple station selections
-
StationLocationMap
Construct a newStationLocationMapusing the specified station selection type and map. Use default labeling.- Parameters:
multipleSelect- true to allow multiple station selectionsdefaultMap- map to use
-
StationLocationMap
Construct a newStationLocationMapusing 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-PickEventto process
-
isFocusable
public boolean isFocusable()Get the isFocusTransverable property- Overrides:
isFocusablein 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:
Listof 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-Listof 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:
addPropertyChangeListenerin classContainer- Parameters:
listener- The property change listener.
-
removePropertyChangeListener
Removes a property change listener.- Overrides:
removePropertyChangeListenerin classComponent- Parameters:
listener- The property change listener.
-
addPropertyChangeListener
Adds a property change listener for a named property.- Overrides:
addPropertyChangeListenerin classContainer- Parameters:
name- The name of the property.listener- The property change listener.
-
removePropertyChangeListener
Removes a property change listener for a named property.- Overrides:
removePropertyChangeListenerin 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
-