org.ka2ddo.yaac.gui
Class AttentionAlert

java.lang.Object
  extended by java.util.Observable
      extended by org.ka2ddo.yaac.gui.AttentionAlert
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.util.EventListener

public class AttentionAlert
extends java.util.Observable
implements java.awt.event.ActionListener, java.io.Serializable

This class displays a flashing set of pointers on the map, indicating some location deserves special attention. It can be used for emergency messages, identifying the position of a station on the map, or other purposes.

The flashing is on a 75% duty cycle (75% on, 25% off) until the alert times out. Then the flasher is dequeued.

See Also:
Serialized Form

Field Summary
static int DEFAULT_FLASH_INTERVAL
          This constant specifies the flash interval in milliseconds.
static java.awt.Color EMERGENCY_COLOR
          This constant specifies the color used to identify stations sending emergency traffic.
static java.awt.Color LOCATE_COLOR
          This constant specifies the color used for locate pointer arrows.
static java.awt.Color PRIORITY_COLOR
          This constant specifies the color used to identify stations sending priority traffic.
static java.awt.Color SPECIAL_COLOR
          This constant specifies the color used to identify stations sending priority traffic.
 
Constructor Summary
AttentionAlert(double lat, double lon, java.awt.Color fillColor)
          Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows with a lifespan of 10 flashes.
AttentionAlert(double lat, double lon, java.awt.Color fillColor, int numFlashes)
          Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows.
AttentionAlert(double lat, double lon, java.awt.Color fillColor, int numFlashes, int flashIntervalMsec)
          Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows.
AttentionAlert(StationState ss, java.awt.Color fillColor)
          Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows with a lifespan of 10 flashes.
AttentionAlert(StationState ss, java.awt.Color fillColor, int numFlashes)
          Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows.
AttentionAlert(StationState ss, java.awt.Color fillColor, int numFlashes, int flashIntervalMsec)
          Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          DO NOT CALL: callback for timer events on AttentionAlert.
 void cancelAlert()
          Stop displaying an AttentionAlert on the map.
 boolean equals(java.lang.Object obj)
          Test if this AttentionAlert is the same as some other object.
static AttentionAlert get(double lat, double lon, AX25Message.Precedence precedence)
          If the precedence level reports location flashers, create an AttentionAlert flasher at the specified map coordinates using the default color for the specified precedence to render the arrows with a lifespan of 30 flashes at double speed.
static java.awt.Color getPrecedenceColor(AX25Message.Precedence precedence)
          Get the color that should be used to identify messages or stations of the specified precedence.
 int hashCode()
          Returns a hash code value for the object.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FLASH_INTERVAL

public static final int DEFAULT_FLASH_INTERVAL
This constant specifies the flash interval in milliseconds.

See Also:
Constant Field Values

LOCATE_COLOR

public static final java.awt.Color LOCATE_COLOR
This constant specifies the color used for locate pointer arrows.


SPECIAL_COLOR

public static final java.awt.Color SPECIAL_COLOR
This constant specifies the color used to identify stations sending priority traffic.


PRIORITY_COLOR

public static final java.awt.Color PRIORITY_COLOR
This constant specifies the color used to identify stations sending priority traffic.


EMERGENCY_COLOR

public static final java.awt.Color EMERGENCY_COLOR
This constant specifies the color used to identify stations sending emergency traffic.

Constructor Detail

AttentionAlert

public AttentionAlert(double lat,
                      double lon,
                      java.awt.Color fillColor)
Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows with a lifespan of 10 flashes.

Parameters:
lat - latitude in degrees North
lon - longitude in degrees East
fillColor - java.awt.Color used to fill the flashing arrow symbols

AttentionAlert

public AttentionAlert(double lat,
                      double lon,
                      java.awt.Color fillColor,
                      int numFlashes)
Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows.

Parameters:
lat - latitude in degrees North
lon - longitude in degrees East
fillColor - java.awt.Paint used to fill the flashing arrow symbols
numFlashes - the number of times the arrows should flash before the alert is taken down

AttentionAlert

public AttentionAlert(double lat,
                      double lon,
                      java.awt.Color fillColor,
                      int numFlashes,
                      int flashIntervalMsec)
Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows.

Parameters:
lat - latitude in degrees North
lon - longitude in degrees East
fillColor - java.awt.Color used to fill the flashing arrow symbols
numFlashes - the number of times the arrows should flash before the alert is taken down
flashIntervalMsec - the time period between flashes in milliseconds

AttentionAlert

public AttentionAlert(StationState ss,
                      java.awt.Color fillColor)
Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows with a lifespan of 10 flashes.

Parameters:
ss - the StationState providing the rendering position
fillColor - java.awt.Color used to fill the flashing arrow symbols

AttentionAlert

public AttentionAlert(StationState ss,
                      java.awt.Color fillColor,
                      int numFlashes)
Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows.

Parameters:
ss - the StationState providing the rendering position
fillColor - java.awt.Color used to fill the flashing arrow symbols
numFlashes - the number of times the arrows should flash before the alert is taken down

AttentionAlert

public AttentionAlert(StationState ss,
                      java.awt.Color fillColor,
                      int numFlashes,
                      int flashIntervalMsec)
Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows.

Parameters:
ss - the StationState providing the rendering position
fillColor - java.awt.Color used to fill the flashing arrow symbols
numFlashes - the number of times the arrows should flash before the alert is taken down
flashIntervalMsec - the time period between flashes in milliseconds
Method Detail

get

public static AttentionAlert get(double lat,
                                 double lon,
                                 AX25Message.Precedence precedence)
If the precedence level reports location flashers, create an AttentionAlert flasher at the specified map coordinates using the default color for the specified precedence to render the arrows with a lifespan of 30 flashes at double speed.

Parameters:
lat - latitude in degrees North
lon - longitude in degrees East
precedence - AX25Message.Precedence to specify coloring
Returns:
AttentionAlert if one should be created, or null if this precedence level doesn't get alarms

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
DO NOT CALL: callback for timer events on AttentionAlert.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - ActionEvent identifying the caller

cancelAlert

public void cancelAlert()
Stop displaying an AttentionAlert on the map.


equals

public boolean equals(java.lang.Object obj)
Test if this AttentionAlert is the same as some other object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object to compare
Returns:
boolean true if obj is a duplicate AttentionAlert

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.
See Also:
equals(Object)

getPrecedenceColor

public static java.awt.Color getPrecedenceColor(AX25Message.Precedence precedence)
Get the color that should be used to identify messages or stations of the specified precedence.

Parameters:
precedence - Precedence
Returns:
Color corresponding to the Precedence