Package org.ka2ddo.yaac.gui
Class AttentionAlert
java.lang.Object
java.util.Observable
org.ka2ddo.yaac.gui.AttentionAlert
- All Implemented Interfaces:
ActionListener
,Serializable
,EventListener
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.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
This constant specifies the flash interval in milliseconds.static final Color
This constant specifies the color used to identify stations sending emergency traffic.static final Color
This constant specifies the color used for locate pointer arrows.static final Color
This constant specifies the color used to identify stations sending priority traffic.static final Color
This constant specifies the color used to identify stations sending special traffic.static final Color
This constant specifies the color used for weather alert arrows. -
Constructor Summary
ConstructorDescriptionAttentionAlert
(double lat, double lon, 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, 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, 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, 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, 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, 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
Modifier and TypeMethodDescriptionvoid
DO NOT CALL: callback for timer events on AttentionAlert.void
Stop displaying an AttentionAlert on the map.boolean
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.Get the precedence (if known) for this AttentionAlert.static 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.boolean
isActive()
Indicate whether this AttentionAlert is still active (i.e., not timed out).boolean
isShown()
Indicate whether the AttentionAlert is in the "on" part of its flashing cycle.void
setWasAutoCenter
(boolean wasAutoCenter) Specify what the Auto-Center Map option setting was before this AttentionAlert was activated.Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
DEFAULT_FLASH_INTERVAL
public static final int DEFAULT_FLASH_INTERVALThis constant specifies the flash interval in milliseconds.- See Also:
-
LOCATE_COLOR
This constant specifies the color used for locate pointer arrows. -
WEATHER_COLOR
This constant specifies the color used for weather alert arrows. -
SPECIAL_COLOR
This constant specifies the color used to identify stations sending special traffic. -
PRIORITY_COLOR
This constant specifies the color used to identify stations sending priority traffic. -
EMERGENCY_COLOR
This constant specifies the color used to identify stations sending emergency traffic.
-
-
Constructor Details
-
AttentionAlert
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 Northlon
- longitude in degrees EastfillColor
- java.awt.Color used to fill the flashing arrow symbols
-
AttentionAlert
Establish an AttentionAlert flasher at the specified map coordinates using the specified paint pattern to render the arrows.- Parameters:
lat
- latitude in degrees Northlon
- longitude in degrees EastfillColor
- java.awt.Paint used to fill the flashing arrow symbolsnumFlashes
- the number of times the arrows should flash before the alert is taken down
-
AttentionAlert
public AttentionAlert(double lat, double lon, 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 Northlon
- longitude in degrees EastfillColor
- java.awt.Color used to fill the flashing arrow symbolsnumFlashes
- the number of times the arrows should flash before the alert is taken downflashIntervalMsec
- the time period between flashes in milliseconds
-
AttentionAlert
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 positionfillColor
- java.awt.Color used to fill the flashing arrow symbols
-
AttentionAlert
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 positionfillColor
- java.awt.Color used to fill the flashing arrow symbolsnumFlashes
- the number of times the arrows should flash before the alert is taken down
-
AttentionAlert
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 positionfillColor
- java.awt.Color used to fill the flashing arrow symbolsnumFlashes
- the number of times the arrows should flash before the alert is taken downflashIntervalMsec
- the time period between flashes in milliseconds
-
-
Method Details
-
get
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 Northlon
- longitude in degrees Eastprecedence
- AX25Message.Precedence to specify coloring- Returns:
- AttentionAlert if one should be created, or null if this precedence level doesn't get alarms
-
setWasAutoCenter
public void setWasAutoCenter(boolean wasAutoCenter) Specify what the Auto-Center Map option setting was before this AttentionAlert was activated.- Parameters:
wasAutoCenter
- boolean true if Auto-Center Map was set
-
actionPerformed
DO NOT CALL: callback for timer events on AttentionAlert.- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
e
- ActionEvent identifying the caller
-
isShown
public boolean isShown()Indicate whether the AttentionAlert is in the "on" part of its flashing cycle.- Returns:
- boolean true if alert should be painted
-
isActive
public boolean isActive()Indicate whether this AttentionAlert is still active (i.e., not timed out).- Returns:
- boolean true if alert is still active
-
getPrecedence
Get the precedence (if known) for this AttentionAlert.- Returns:
- Precedence if known, or null if not
-
cancelAlert
public void cancelAlert()Stop displaying an AttentionAlert on the map. -
equals
Test if this AttentionAlert is the same as some other object. -
hashCode
public int hashCode()Returns a hash code value for the object. -
getPrecedenceColor
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
-