Package ucar.unidata.view.station
Class StationLocationRenderer
java.lang.Object
ucar.unidata.view.station.StationLocationRenderer
- All Implemented Interfaces:
Renderer
Implements the Renderer interface for collections of
Station-s.
Plots a station location as a name and circle for a marker:
Boulder
o
- Author:
- Don Murray
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassSpecialized station class used by this Renderer. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.StationLocationRenderer(boolean multipleSelect) Create aStationLocationRendererusing the selection type defined and the default labeling type.StationLocationRenderer(boolean multipleSelect, String template) Create aStationLocationRendererusing the selection type and the labeling type defined.StationLocationRenderer(String template) Create aStationLocationRendererusing single station selection and the labeling type defined. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(Graphics2D g, AffineTransform normal2Device) render the stations.Find a station that is closest to the pickPt.getColor()Get the color used for rendering stations.booleanGet whether station should be decluttered or not.ucar.unidata.geoloc.LatLonRectGet the preferred area to be displayed.Get theStationModelViewused by this Renderer.Return the (cloned) list of Stations held by this renderer.voidSet the color for rendering unselected stations.voidsetDeclutter(boolean declut) Set whether station should be decluttered or not.voidsetProjection(ucar.unidata.geoloc.ProjectionImpl project) Set the projection used by this renderer.voidsetSelectedStations(List selectedStations) Set selected stations.voidsetStations(List stns, boolean declut) Set the stations to be displayed by this renderer.voidsetStations(List stns, List selectedStations, boolean declut) Set the stations to be displayed by this renderer.
-
Constructor Details
-
StationLocationRenderer
public StationLocationRenderer()Default constructor. Uses default label type and allows only single station selection. -
StationLocationRenderer
Create aStationLocationRendererusing single station selection and the labeling type defined.- Parameters:
template- The String template to use for displaying station labels.
-
StationLocationRenderer
public StationLocationRenderer(boolean multipleSelect) Create aStationLocationRendererusing the selection type defined and the default labeling type.- Parameters:
multipleSelect- allow selection of multiple stations
-
StationLocationRenderer
Create aStationLocationRendererusing the selection type and the labeling type defined.- Parameters:
multipleSelect- allow selection of multiple stationstemplate- The String template to use for displaying station labels.
-
-
Method Details
-
setColor
Set the color for rendering unselected stations. -
getColor
Get the color used for rendering stations. -
getPreferredArea
public ucar.unidata.geoloc.LatLonRect getPreferredArea()Get the preferred area to be displayed.- Specified by:
getPreferredAreain interfaceRenderer- Returns:
- null
-
setStations
Set the stations to be displayed by this renderer.- Parameters:
stns-ListofStationobjectsdeclut- true to declutter stations.
-
setStations
Set the stations to be displayed by this renderer. Set the stations in the selected list to be selected.- Parameters:
stns-ListofStationobjectsselectedStations-Listof selected stationsdeclut- true to declutter stations.
-
getStations
Return the (cloned) list of Stations held by this renderer.- Returns:
- The list of Stations.
-
setSelectedStations
Set selected stations.- Parameters:
selectedStations-Listof selected stations
-
setDeclutter
public void setDeclutter(boolean declut) Set whether station should be decluttered or not.- Parameters:
declut- true to declutter
-
getDeclutter
public boolean getDeclutter()Get whether station should be decluttered or not.- Returns:
- true if decluttering
-
draw
render the stations. -
setProjection
public void setProjection(ucar.unidata.geoloc.ProjectionImpl project) Set the projection used by this renderer.- Specified by:
setProjectionin interfaceRenderer- Parameters:
project- projection to use
-
getStationModelView
Get theStationModelViewused by this Renderer.- Returns:
- the station model view
-
find
Find a station that is closest to the pickPt.- Parameters:
pickPt- point where user clicked.- Returns:
- closest station.
-