Class StationRenderer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
com.bbn.openmap.Layer
org.ka2ddo.yaac.gui.StationRenderer
All Implemented Interfaces:
com.bbn.openmap.event.MapMouseListener, com.bbn.openmap.event.ProjectionListener, com.bbn.openmap.ProjectionPainter, com.bbn.openmap.PropertyConsumer, ActionListener, ComponentListener, ImageObserver, MenuContainer, BeanContextChild, BeanContextMembershipListener, Serializable, EventListener, Observer, TrackerListener, FilterChangeListener, FontChangeListener

public class StationRenderer extends com.bbn.openmap.Layer implements TrackerListener, com.bbn.openmap.event.MapMouseListener, FilterChangeListener, ComponentListener, FontChangeListener, Observer
This class draws APRS station symbols on a OpenMap MapBean object.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Field Details

    • CONTEXT_MENU_ACTION

      public final AbstractAction CONTEXT_MENU_ACTION
      Action to launch a geographical map specific popup menu.
  • Constructor Details

    • StationRenderer

      public StationRenderer(GeoMapGuiIfc geoMap)
      Create the StationRenderer layer for the map.
      Parameters:
      geoMap - GeographicalMap containing this StationRenderer
  • Method Details

    • isDrawAllTrackStripes

      public boolean isDrawAllTrackStripes()
      Indicate whether all moving stations should have track stripes plotted.
      Returns:
      boolean true if all moving stations should have track stripes
    • setDrawAllTrackStripes

      public void setDrawAllTrackStripes(boolean drawAllTrackStripes)
      Specify whether all moving stations should have track stripes plotted.
      Parameters:
      drawAllTrackStripes - boolean true if all moving stations should have track stripes
    • clearAllSpecificTrackStripes

      public void clearAllSpecificTrackStripes()
      Clear the plotting of all specific station/object track stripes.
    • addSpecificTrackStripe

      public void addSpecificTrackStripe(String identifier)
      Add the identifier of a single station or object whose track stripe is to be plotted.
      Parameters:
      identifier - String station or object identifier
    • removeSpecificTrackStripe

      public boolean removeSpecificTrackStripe(String identifier)
      Remove the identifier of a single station or object whose track stripe is no longer to be plotted.
      Parameters:
      identifier - String station or object identifier
      Returns:
      boolean true if identifier was removed
    • isSpecificallyTracked

      public static boolean isSpecificallyTracked(String identifier)
      Test if a given identifier is on the tracking list.
      Parameters:
      identifier - String station or object identifier
      Returns:
      boolean true if this identifier is marked for track stripe display
    • isSpecificallyTracking

      public static boolean isSpecificallyTracking()
      Test if any identifiers are on the tracking list.
      Returns:
      boolean true if any stations are specifically tagged for tracking
    • getMaxTrackDuration

      public long getMaxTrackDuration()
      Get the maximum duration of a track stripe in milliseconds.
      Returns:
      maximum plotted track duration in milliseconds
    • setMaxTrackDuration

      public void setMaxTrackDuration(long maxTrackDuration)
      Set the maximum duration of a track stripe in milliseconds.
      Parameters:
      maxTrackDuration - maximum plotted track duration in milliseconds
    • isDrawRangeCircles

      public boolean isDrawRangeCircles()
      Report whether radio range circles are being drawn for stations reporting or implying transmission range limits.
      Returns:
      boolean true if range circles are being drawn
    • setDrawRangeCircles

      public void setDrawRangeCircles(boolean drawRangeCircles)
      Specify whether range circles should be drawn around stations reporting or implying transmission range limits.
      Parameters:
      drawRangeCircles - boolean true if range circles should be drawn
    • isDrawMicEStatusCircles

      public boolean isDrawMicEStatusCircles()
      Report whether color-coded circles indicating Mic-E status codes are be drawn around stations reporting those codes.
      Returns:
      boolean true if Mic-E status color circles are drawn
    • setDrawMicEStatusCircles

      public void setDrawMicEStatusCircles(boolean drawMicEStsCircles)
      Specify whether color-coded circles indicating Mic-E status codes should be drawn around stations reporting those codes.
      Parameters:
      drawMicEStsCircles - boolean true if Mic-E status color circles should be drawn
    • isDrawSelf

      public boolean isDrawSelf()
      Report whether the local station is plotted on the map.
      Returns:
      boolean true if local station is drawn
    • setDrawSelf

      public void setDrawSelf(boolean drawSelf)
      Specify whether the local station should be plotted on the map.
      Parameters:
      drawSelf - boolean true if local station should be drawn
    • isDrawSelfLikeOther

      public boolean isDrawSelfLikeOther()
      Report whether local station is drawn like any other station (using its APRS symbol icon) or as crosshairs or a pointer making it obvious where the station is on the map.
      Returns:
      boolean true to use APRS symbol, or false to use crosshairs for fixed station or pointer arrowhead for moving station
      See Also:
    • setDrawSelfLikeOther

      public void setDrawSelfLikeOther(boolean drawSelfLikeOther)
      Specify whether local station should be drawn like any other station (using its APRS symbol icon) or as crosshairs or a pointer making it obvious where the station is on the map.
      Parameters:
      drawSelfLikeOther - boolean true to use APRS symbol, or false to use crosshairs for fixed station or pointer arrowhead for moving station
      See Also:
    • isDrawWeatherAsWeather

      public boolean isDrawWeatherAsWeather()
      Report whether weather stations are drawn as old-style weather map circles with a flagged barb indicating wind direction and speed.
      Returns:
      boolean true if weather stations should be plotted with weather map symbols, false if using APRS icon
    • setDrawWeatherAsWeather

      public void setDrawWeatherAsWeather(boolean drawWeatherAsWeather)
      Specify whether weather stations should be drawn as old-style weather map circles with a flagged barb indicating wind direction and speed.
      Parameters:
      drawWeatherAsWeather - boolean true if weather stations should be plotted with weather map symbols, false if using APRS icon
    • isDrawAge

      public boolean isDrawAge()
      Report whether the time interval since last receipt of a message from or about a station or object is plotted below the station/object's name.
      Returns:
      boolean true if age is to be plotted
    • setDrawAge

      public void setDrawAge(boolean drawAge)
      Specify whether the time interval since last receipt of a message from or about a station or object should be plotted below the station/object's name.
      Parameters:
      drawAge - boolean true if age is to be plotted
    • isDrawSpeed

      public boolean isDrawSpeed()
      Report whether the motion speed and bearing of a station or object is plotted below the station/object's name.
      Returns:
      boolean true if age is to be plotted
    • setDrawSpeed

      public void setDrawSpeed(boolean drawSpeed)
      Specify whether the motion speed and bearing of a station or object should be plotted below the station/object's name.
      Parameters:
      drawSpeed - boolean true if age is to be plotted
    • isDrawDeadObjects

      public boolean isDrawDeadObjects()
      Report whether Objects that have been "killed" are plotted on the map.
      Returns:
      boolean true if "killed" Objects are plotted
    • setDrawDeadObjects

      public void setDrawDeadObjects(boolean drawDeadObjects)
      Specify whether Objects that have been "killed" should still be plotted on the map.
      Parameters:
      drawDeadObjects - boolean true if "killed" Objects should be plotted
    • isDrawAlohaCircle

      public boolean isDrawAlohaCircle()
      Report whether aloha circles (optimal maximum RF transmission range for the local station before causing excessive collisions) are plotted on the map.
      Returns:
      boolean true if aloha circles are drawn
    • setDrawAlohaCircle

      public void setDrawAlohaCircle(boolean drawAlohaCircle)
      Specify whether aloha circles (optimal maximum RF transmission range for the local station before causing excessive collisions) should be plotted on the map. Note these will only appear if the local station has RF ports that can have collisions.
      Parameters:
      drawAlohaCircle - boolean true if aloha circles should be drawn
    • isDrawItemStatus

      public boolean isDrawItemStatus()
      Report whether a color-coded "halo" is drawn around each station or object icon indicating its status as one of the APRSdos categories: fixed, mobile, deadreckoned, old, emergency-reporting, locally-controlled Object, or other station's Object.
      Returns:
      boolean true if status halo is drawm
      See Also:
    • setDrawItemStatus

      public void setDrawItemStatus(boolean drawItemStatus)
      Specify whether a color-coded "halo" should be drawn around each station or object icon indicating its status as one of the APRSdos categories: fixed, mobile, deadreckoned, old, emergency-reporting, locally-controlled Object, or other station's Object.
      Parameters:
      drawItemStatus - boolean true if status halo should be drawm
      See Also:
    • isDrawAmbiguityCircle

      public boolean isDrawAmbiguityCircle()
      Report whether a translucent ambiguity circle is drawn behind each station or object to indicate the area over which it could be located, given the precision of the position information reported.
      Returns:
      boolean true if ambiguity circles are plotted
    • setDrawAmbiguityCircle

      public void setDrawAmbiguityCircle(boolean drawAmbiguityCircle)
      Specify whether a translucent ambiguity circle should be drawn behind each station or object to indicate the area over which it could be located, given the precision of the position information reported.
      Parameters:
      drawAmbiguityCircle - boolean true if ambiguity circles should be plotted
    • isDrawDeadReckoning

      public boolean isDrawDeadReckoning()
      Report whether deadreckoning position updates for moving stations and objects are calculated and the positions offset and deadreckoning vectors plotted when the stations and objecfts are drawn.
      Returns:
      boolean true if deadreckoning is plotted
    • setDrawDeadReckoning

      public void setDrawDeadReckoning(boolean drawDeadReckoning)
      Specify whether deadreckoning position updates for moving stations and objects should be calculated and the positions offset and deadreckoning vectors plotted when the stations and objecfts are drawn.
      Parameters:
      drawDeadReckoning - boolean true if deadreckoning should be plotted
    • getMaxAgeDRStation

      public long getMaxAgeDRStation()
      Get the maximum time that dead reckoning will be projected for a station (self-transmitter).
      Returns:
      maximum dead reckon interval in milliseconds
    • setMaxAgeDRStation

      public void setMaxAgeDRStation(long maxAgeDRStation)
      Set the maximum time that dead reckoning will be projected for a station (self-transmitter).
      Parameters:
      maxAgeDRStation - maximum dead reckon interval in milliseconds
    • getMaxAgeDRObject

      public long getMaxAgeDRObject()
      Get the maximum time that dead reckoning will be projected for an object (non-self-transmitter).
      Returns:
      maximum dead reckon interval in milliseconds
    • setMaxAgeDRObject

      public void setMaxAgeDRObject(long maxAgeDRObject)
      Set the maximum time that dead reckoning will be projected for an object (non-self-transmitter).
      Parameters:
      maxAgeDRObject - maximum dead reckon interval in milliseconds
    • getMaxAgeDRSpecialObject

      public long getMaxAgeDRSpecialObject()
    • setMaxAgeDRSpecialObject

      public void setMaxAgeDRSpecialObject(long maxAgeDRSpecialObject)
    • isDrawDF

      public boolean isDrawDF()
      Report whether direction-finding cones are plotted from stations reporting DFS vector information
      Returns:
      boolean true if direction-finding cones are drawm
    • setDrawDF

      public void setDrawDF(boolean drawDF)
      Specify whether direction-finding cones should be plotted from stations reporting DFS vector information
      Parameters:
      drawDF - boolean true if direction-finding cones should be drawm
    • isDrawNWSMultiLine

      public boolean isDrawNWSMultiLine()
      Report whether encoded polylines (generally used for National Weather Service severe weather regions) are plotted on the map.
      Returns:
      boolean true if multilines are plotted
    • setDrawNWSMultiLine

      public void setDrawNWSMultiLine(boolean drawNWSMultiLine)
      Specify whether encoded polylines (generally used for National Weather Service severe weather regions) should be plotted on the map.
      Parameters:
      drawNWSMultiLine - boolean true if multilines should be plotted
    • isDrawCallsign

      public boolean isDrawCallsign()
      Report whether callsign label should be drawn for each station/object.
      Returns:
      boolean true if callsign label should be drawn on map
    • setDrawCallsign

      public void setDrawCallsign(boolean drawCallsign)
      Specify whether callsign labels should be drawn for each station/object.
      Parameters:
      drawCallsign - boolean true if callsign label should be drawn on map
    • isDrawAliasInsteadOfCallsign

      public boolean isDrawAliasInsteadOfCallsign()
      Report whether alias should be drawn instead of callsign should be drawn for each station/object if an alias is defined for the station/object..
      Returns:
      boolean true if alias should be drawn instead of callsign
    • setDrawAliasInsteadOfCallsign

      public void setDrawAliasInsteadOfCallsign(boolean drawAliasInsteadOfCallsign)
      Specify whether alias should be drawn instead of callsign should be drawn for each station/object if an alias is defined for the station/object..
      Parameters:
      drawAliasInsteadOfCallsign - boolean true if alias should be drawn instead of callsign
    • isDontRotateIcons

      public boolean isDontRotateIcons()
      Report whether mobile station icons should be rotated to indicate the direction of station travel (bearing).
      Returns:
      boolean true if icons should not be rotated
    • setDontRotateIcons

      public void setDontRotateIcons(boolean dontRotateIcons)
      Specify whether mobile station icons should be rotated to indicate the direction of station travel (bearing).
      Parameters:
      dontRotateIcons - boolean true if icons should not be rotated
    • isKeepSpecificallyTrackedStationsOnScreen

      public boolean isKeepSpecificallyTrackedStationsOnScreen()
      Report whether the map should auto-pan to keep specifically tracked mobile stations on the map.
      Returns:
      boolean true if map should pan to keep tracked stations on the map
    • setKeepSpecificallyTrackedStationsOnScreen

      public void setKeepSpecificallyTrackedStationsOnScreen(boolean keepSpecificallyTrackedStationsOnScreen)
      Specify whether the map should auto-pan to keep specifically tracked mobile stations on the map.
      Parameters:
      keepSpecificallyTrackedStationsOnScreen - boolean true if map should pan to keep tracked stations on the map
    • isDrawDoubleSizedSymbols

      public boolean isDrawDoubleSizedSymbols()
      Report if symbols are being drawn double-sized.
      Returns:
      boolean true if symbols are rendered double-size
    • setDrawDoubleSizedSymbols

      public void setDrawDoubleSizedSymbols(boolean drawDoubleSizedSymbols)
      Specify whether symbols should be drawn double-sized (32x32 pixels) instead of single-sized (16x16).
      Parameters:
      drawDoubleSizedSymbols - boolean true if symbols should be rendered double-size
    • isDrawDigipeatHops

      public boolean isDrawDigipeatHops()
      Report if digipeater hop paths are drawn for stations.
      Returns:
      boolean true if digipeater hop paths are drawn for stations
    • setDrawDigipeatHops

      public void setDrawDigipeatHops(boolean drawDigipeatHops)
      Specify whether digipeater hop paths should be drawn for stations.
      Parameters:
      drawDigipeatHops - boolean true if digipeater hop paths should be drawn for stations
    • isUseLargeMenuFont

      public boolean isUseLargeMenuFont()
      Report whether popup menus will use enlarged fonts.
      Returns:
      boolean true if fonts will be enlarged
    • setUseLargeMenuFont

      public void setUseLargeMenuFont(boolean useLargeMenuFont)
      Specify whether popup menus will use enlarged fonts.
      Parameters:
      useLargeMenuFont - boolean true if fonts will be enlarged
    • startLineOfSight

      public void startLineOfSight()
      Enable defining a line of sight between two points on the map; the user presses the mouse at the starting point, drags to the ending position, and releases.
    • reallyStartLineOfSight

      protected void reallyStartLineOfSight()
    • addAlert

      public void addAlert(AttentionAlert aa)
      Add another AttentionAlert to the map.
      Parameters:
      aa - AttentionAlert to display
    • update

      public void update(Observable o, Object arg)
      This method is called whenever the observed object (an AttentionAlert) is changed. An application calls an Observable object's notifyObservers method to have all the object's observers notified of the change (time to flash or expired).
      Specified by:
      update in interface Observer
      Parameters:
      o - the observable object.
      arg - an argument passed to the notifyObservers method.
    • projectionChanged

      public void projectionChanged(com.bbn.openmap.event.ProjectionEvent e)
      Invoked when there has been a fundamental change to the Map.

      Layers are expected to recompute their graphics (if this makes sense), and then repaint() themselves.

      Specified by:
      projectionChanged in interface com.bbn.openmap.event.ProjectionListener
      Parameters:
      e - ProjectionEvent
    • paint

      public void paint(Graphics g)
      Render this layer's content into the MapBean. Note that we reproject on every draw to deal with moving stations or map pans/zooms.
      Overrides:
      paint in class JComponent
      Parameters:
      g - Graphics object to use for rendering
    • messageAdded

      public void messageAdded(StationState ss, int index, AX25Message msg)
      Called when a AX25Message is added to the history for a station in the tracker.
      Specified by:
      messageAdded in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
      index - zero-based integer sequence number for this station in the StationTracker
      msg - APRS Message object being added to the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here
    • messageDeleted

      public void messageDeleted(StationState ss, int index, AX25Message msg)
      Called when a AX25Message is deleted from the history for a station in the tracker.
      Specified by:
      messageDeleted in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information; the initial Message will already be removed from the StationState object
      index - zero-based index of the message removed from the StationState object
      msg - APRS Message object being removed from the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here
    • stationAdded

      public void stationAdded(StationState ss, int index)
      Called when a new station is initially added to the tracker.
      Specified by:
      stationAdded in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
      index - zero-based integer sequence number for this station in the StationTracker
    • stationUpdated

      public void stationUpdated(StationState ss)
      Called when an existing station is updated with new information in the tracker.
      Specified by:
      stationUpdated in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
    • stationDeleted

      public void stationDeleted(StationState ss, int index)
      Called when an existing station is deleted from the tracker.
      Specified by:
      stationDeleted in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
      index - zero-based integer sequence number for this station in the StationTracker
    • getMapMouseListener

      public com.bbn.openmap.event.MapMouseListener getMapMouseListener()
      Overrides:
      getMapMouseListener in class com.bbn.openmap.Layer
    • getMouseModeServiceList

      public String[] getMouseModeServiceList()
      Specified by:
      getMouseModeServiceList in interface com.bbn.openmap.event.MapMouseListener
    • mouseClicked

      public boolean mouseClicked(MouseEvent e)
      Specified by:
      mouseClicked in interface com.bbn.openmap.event.MapMouseListener
    • mouseDragged

      public boolean mouseDragged(MouseEvent e)
      Specified by:
      mouseDragged in interface com.bbn.openmap.event.MapMouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Specified by:
      mouseEntered in interface com.bbn.openmap.event.MapMouseListener
    • mouseExited

      public void mouseExited(MouseEvent e)
      Specified by:
      mouseExited in interface com.bbn.openmap.event.MapMouseListener
    • mouseMoved

      public void mouseMoved()
      Specified by:
      mouseMoved in interface com.bbn.openmap.event.MapMouseListener
    • mouseMoved

      public boolean mouseMoved(MouseEvent e)
      Specified by:
      mouseMoved in interface com.bbn.openmap.event.MapMouseListener
    • mousePressed

      public boolean mousePressed(MouseEvent e)
      Specified by:
      mousePressed in interface com.bbn.openmap.event.MapMouseListener
    • mouseReleased

      public boolean mouseReleased(MouseEvent e)
      Specified by:
      mouseReleased in interface com.bbn.openmap.event.MapMouseListener
    • filterSettingsChanged

      public void filterSettingsChanged(Filter changedFilter, boolean changedByUser)
      Called when any of the filters' matching criteria have been changed.
      Specified by:
      filterSettingsChanged in interface FilterChangeListener
      Parameters:
      changedFilter - specific Filter that has changed
      changedByUser - boolean true if change was manually made by user, false if change was made automatically by dynamic filter logic
    • componentResized

      public void componentResized(ComponentEvent e)
      Invoked when the component's size changes.
      Specified by:
      componentResized in interface ComponentListener
    • componentMoved

      public void componentMoved(ComponentEvent e)
      Invoked when the component's position changes.
      Specified by:
      componentMoved in interface ComponentListener
    • componentShown

      public void componentShown(ComponentEvent e)
      Invoked when the component has been made visible.
      Specified by:
      componentShown in interface ComponentListener
    • componentHidden

      public void componentHidden(ComponentEvent e)
      Invoked when the component has been made invisible.
      Specified by:
      componentHidden in interface ComponentListener
    • conditionalRepaint

      public void conditionalRepaint()
      Say this layer needs repainting, but don't rush it if lots of requests come in.
    • repaint

      public void repaint()
      Repaints the StationRenderer if it needs it and it hasn't been too little time since the last repaint.
      Overrides:
      repaint in class Component
    • fontChanged

      public void fontChanged(String category, Font newFont)
      Report that the font choice for the specified category has changed.
      Specified by:
      fontChanged in interface FontChangeListener
      Parameters:
      category - String font family name (as defined by Font class)
      newFont - actual font instance
    • getLastElapsedPaintTime

      public long getLastElapsedPaintTime()
      Return the amount of time (in milliseconds) for the last station render.
      Returns:
      elapsed time in milliseconds for last StationRenderer run
    • getLastNumDrawnObjects

      public int getLastNumDrawnObjects()
      Return the number of Objects (non-transmitters) rendered in the last station render.
      Returns:
      count of rendered Objects
    • getLastNumDrawnStations

      public int getLastNumDrawnStations()
      Return the number of stations (transmitters) rendered in the last station render.
      Returns:
      count of rendered stations