ucar.unidata.view.station
Class StationLocationRenderer

java.lang.Object
  extended by ucar.unidata.view.station.StationLocationRenderer
All Implemented Interfaces:
Renderer

public class StationLocationRenderer
extends Object
implements 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
 class StationLocationRenderer.SLStation
          Specialized station class used by this Renderer.
 
Constructor Summary
StationLocationRenderer()
          Default constructor.
StationLocationRenderer(boolean multipleSelect)
          Create a StationLocationRenderer using the selection type defined and the default labeling type.
StationLocationRenderer(boolean multipleSelect, String template)
          Create a StationLocationRenderer using the selection type and the labeling type defined.
StationLocationRenderer(String template)
          Create a StationLocationRenderer using single station selection and the labeling type defined.
 
Method Summary
 void draw(Graphics2D g, AffineTransform normal2Device)
          render the stations.
 StationLocationRenderer.SLStation find(Point2D pickPt)
          Find a station that is closest to the pickPt.
 Color getColor()
          Get the color used for rendering stations.
 boolean getDeclutter()
          Get whether station should be decluttered or not.
 ucar.unidata.geoloc.LatLonRect getPreferredArea()
          Get the preferred area to be displayed.
 StationModelView getStationModelView()
          Get the StationModelView used by this Renderer.
 List getStations()
          Return the (cloned) list of Stations held by this renderer.
 void setColor(Color color)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StationLocationRenderer

public StationLocationRenderer()
Default constructor. Uses default label type and allows only single station selection.


StationLocationRenderer

public StationLocationRenderer(String template)
Create a StationLocationRenderer 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 a StationLocationRenderer using the selection type defined and the default labeling type.

Parameters:
multipleSelect - allow selection of multiple stations

StationLocationRenderer

public StationLocationRenderer(boolean multipleSelect,
                               String template)
Create a StationLocationRenderer using the selection type and the labeling type defined.

Parameters:
template - The String template to use for displaying station labels.
multipleSelect - allow selection of multiple stations
Method Detail

setColor

public void setColor(Color color)
Set the color for rendering unselected stations.

Specified by:
setColor in interface Renderer
Parameters:
color - color for rendering.

getColor

public Color getColor()
Get the color used for rendering stations.

Specified by:
getColor in interface Renderer
Returns:
color being used.

getPreferredArea

public ucar.unidata.geoloc.LatLonRect getPreferredArea()
Get the preferred area to be displayed.

Specified by:
getPreferredArea in interface Renderer
Returns:
null

setStations

public void setStations(List stns,
                        boolean declut)
Set the stations to be displayed by this renderer.

Parameters:
stns - List of Station objects
declut - true to declutter stations.

setStations

public void setStations(List stns,
                        List selectedStations,
                        boolean declut)
Set the stations to be displayed by this renderer. Set the stations in the selected list to be selected.

Parameters:
stns - List of Station objects
selectedStations - List of selected stations
declut - true to declutter stations.

getStations

public List getStations()
Return the (cloned) list of Stations held by this renderer.

Returns:
The list of Stations.

setSelectedStations

public void setSelectedStations(List selectedStations)
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

public void draw(Graphics2D g,
                 AffineTransform normal2Device)
render the stations.

Specified by:
draw in interface Renderer
Parameters:
g - Graphics to draw to
normal2Device - transform for data to device coordinates
See Also:
for an example using pixelAT.

setProjection

public void setProjection(ucar.unidata.geoloc.ProjectionImpl project)
Set the projection used by this renderer.

Specified by:
setProjection in interface Renderer
Parameters:
project - projection to use

getStationModelView

public StationModelView getStationModelView()
Get the StationModelView used by this Renderer.

Returns:
the station model view

find

public StationLocationRenderer.SLStation find(Point2D pickPt)
Find a station that is closest to the pickPt.

Parameters:
pickPt - point where user clicked.
Returns:
closest station.