Class StationLocationRenderer

java.lang.Object
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
  • Constructor Details

    • 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:
      multipleSelect - allow selection of multiple stations
      template - The String template to use for displaying station labels.
  • Method Details

    • 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:
    • 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

      Find a station that is closest to the pickPt.
      Parameters:
      pickPt - point where user clicked.
      Returns:
      closest station.