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 TypeClassDescriptionclass
Specialized station class used by this Renderer. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.StationLocationRenderer
(boolean multipleSelect) Create aStationLocationRenderer
using the selection type defined and the default labeling type.StationLocationRenderer
(boolean multipleSelect, String template) Create aStationLocationRenderer
using the selection type and the labeling type defined.StationLocationRenderer
(String template) Create aStationLocationRenderer
using single station selection and the labeling type defined. -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(Graphics2D g, AffineTransform normal2Device) render the stations.Find a station that is closest to the pickPt.getColor()
Get the color used for rendering stations.boolean
Get whether station should be decluttered or not.ucar.unidata.geoloc.LatLonRect
Get the preferred area to be displayed.Get theStationModelView
used by this Renderer.Return the (cloned) list of Stations held by this renderer.void
Set the color for rendering unselected stations.void
setDeclutter
(boolean declut) Set whether station should be decluttered or not.void
setProjection
(ucar.unidata.geoloc.ProjectionImpl project) Set the projection used by this renderer.void
setSelectedStations
(List selectedStations) Set selected stations.void
setStations
(List stns, boolean declut) Set the stations to be displayed by this renderer.void
setStations
(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 aStationLocationRenderer
using 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 aStationLocationRenderer
using the selection type defined and the default labeling type.- Parameters:
multipleSelect
- allow selection of multiple stations
-
StationLocationRenderer
Create aStationLocationRenderer
using 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:
getPreferredArea
in interfaceRenderer
- Returns:
- null
-
setStations
Set the stations to be displayed by this renderer.- Parameters:
stns
-List
ofStation
objectsdeclut
- 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
-List
ofStation
objectsselectedStations
-List
of 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
-List
of 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:
setProjection
in interfaceRenderer
- Parameters:
project
- projection to use
-
getStationModelView
Get theStationModelView
used 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.
-