public class YAAC extends java.lang.Object implements BeaconChangeListener, GpsDataListener
Command-line parameters are of the form "-key value" or "-key" (no value) and correspond to the names used in the Preferences nodes used to persist the values. There are a few special values defined by the core code of the this application, including but not limited to:
FirstWindow
class of the window type to use as the initial window of the GUI.installation_directory/plugins
.
Modifier and Type | Class and Description |
---|---|
static class |
YAAC.PluginContext
Support class for loading plugins that may have circular dependencies.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
OPT_DEBUG
The command line option that specifies turning on debug messages.
|
static java.lang.String |
OPT_GUI
Boolean TRUE or FALSE if GUI is going to be invoked.
|
static java.lang.String |
OPT_GUI_FIRST
String name of first window to use for launching YAAC.
|
static java.lang.String |
OPT_LAST_CHOSEN_PATH
Symbolic ket name for the last chosen digipeat path used for text messaging.
|
static java.lang.String |
OPT_LOG_DIR
Symbolic key name by which the path to the logging file directory is cached in the properties.
|
static java.lang.String |
OPT_MSG_LOG
Symbolic key name by which the path to the message logging directory is cached in the properties.
|
static java.lang.String |
OPT_OSM_TILE_DIR
Symbolic key name by which the path to the map rendering tile directory is cached in the properties.
|
static java.lang.String |
OSARCH
The key value in the YAAC properties for the generic name of the CPU architecture (distilled from value in Java system properties).
|
static java.lang.String |
OSNAME
The key value in the YAAC properties for the generic name of the host operating system (distilled from value in Java system properties).
|
static java.lang.String |
WINDOWS
Symbolic name for Microsoft Windows operating systems, associated with OSNAME key in properties table.
|
Modifier and Type | Method and Description |
---|---|
static void |
addShutdownHandler(ShutdownHandler sh)
Register a ShutdownHandler to be invoked when YAAC is shut down.
|
static void |
addUnitEnumChangeListener(UnitEnumChangeListener l)
Add a UnitEnumChangeListener for being informed of unit changes,
|
void |
beaconChanged(BeaconData beaconData)
This method is called for registered implementors when changed beacon data is
stored to preferences.
|
static AbstractMenuAction |
findMenuAction(java.lang.String preLocalizedTagName)
Find a menu entry with the specified tag name,
|
static java.io.File |
getBaseDir()
Get the root directory of the YAAC installation.
|
static BeaconData |
getBeaconData()
Get the default BeaconData information for this station.
|
static BeaconData |
getBeaconData(java.lang.String beaconName)
Get the BeaconData information for this station.
|
static java.util.Map<java.lang.String,BeaconData> |
getBeaconDataMap()
Return a read-only Map of all the currently defined beacons.
|
static java.lang.String |
getCallsign()
Get the primary callsign set for this station running YAAC.
|
static CheckpointingLogger |
getCheckpointingLogger()
Get the logger used to track YAAC's error messages.
|
static int |
getCoreProviderVersion()
Get the version of the Provider API that this build of YAAC was compiled with.
|
static java.io.File |
getDataDir()
Get the root directory of the per-user YAAC data directory.
|
static DistanceUnit |
getDistanceUnit()
Get the currently set unit for distance display.
|
static CumulativeBooleanAndFilter |
getFilter()
Get the top-level Filter for selectively choosing which Messages to see in the various YAAC
display windows.
|
static GuiIfc |
getGui()
Get the object representing the front-end user interface.
|
static java.lang.ClassLoader |
getLastClassLoader()
Get the last of the daisy-chained list of ClassLoaders for YAAC and all its accepted plugins.
|
static ShutdownHandler |
getLastShutdownHandler()
Pop the most recently remaining registered ShutdownHandler from the stack.
|
static StationState |
getLocalStation()
Get the StationState object containing the status of the local station.
|
static java.util.ArrayList<AbstractMenuAction> |
getMenuBarActionList()
Get a list of all currently defined potential menu items for inclusion in a menubar menu in
the map window.
|
static YAAC.PluginContext |
getMostRecentPlugin()
Ontain the information for the last plugin loaded into the system, or
with the greatest amount of dependencies if called after sorting the
plugin list.
|
static java.lang.String |
getMsg(java.lang.String tagName)
Get the appropriate localized String corresponding to a ResourceBundle tag name in a
specific ResourceBundle.
|
static java.lang.String |
getMsg(java.lang.String bundleBaseName,
java.lang.String tagName)
Get the appropriate localized String corresponding to a ResourceBundle tag name in a
specific ResourceBundle.
|
static java.util.ResourceBundle |
getMsgBundle()
Get the appropriate locale-specific message bundle for YAAC.
|
static java.util.ResourceBundle |
getMsgBundle(java.lang.String altBundleName)
Get the appropriate locale-specific variant of some message bundle in one or more of the
provided plugins.
|
static java.lang.String[] |
getOriginalArguments()
Return the original command-line arguments used to start YAAC.
|
static java.util.ArrayList<AbstractPopupMenuAction> |
getPopupMenuActionList()
Get a list of all currently defined potential menu items for inclusion in a popup menu in
the map window.
|
static java.util.prefs.Preferences |
getPreferences()
Get a handle to the Java Preferences node at the root of the subtree used to store YAAC preferences.
|
static PressureUnit |
getPressureUnit()
Get the currently set unit for pressure display.
|
static java.lang.String |
getProfileName()
Get the name of the profile being used to store configuration data.
|
static java.util.Properties |
getProps()
Get the Properties object used to efficiently cache preferences that are used frequently by YAAC.
|
static Provider |
getProvider(java.lang.Class<? extends Provider> clazz)
Get the instance of the specified Provider subclass currently loaded into YAAC.
|
static Provider |
getProviderByClassName(java.lang.String providerClassName)
Get the instance of the specified Provider subclass currently loaded into YAAC.
|
static Provider |
getProviderByJarName(java.lang.String providerJarName)
Get the instance of the specified Provider subclass currently loaded into YAAC.
|
static Provider |
getProviderByName(java.lang.String providerName)
Get the instance of the specified Provider subclass currently loaded into YAAC.
|
static java.util.List<Provider> |
getProviderList()
Get a List of all the Provider objects loaded into YAAC.
|
static SnifferDataModel |
getSnifferDataModel()
Get the data structure used to cache all received raw AX.25 packets.
|
static MsgEventListener |
getSoundMaker()
Get the object used to produce sound effects.
|
static long |
getStartupTime()
Report the Unix time in milliseconds when YAAC was started.
|
static StatusData |
getStatusData()
Get the StatusData information for this station.
|
static TemperatureUnit |
getTemperatureUnit()
Get the currently set unit for temperature display.
|
static int |
getTimeBeforeInactive()
Set the time interval after which no user action indicates the station is unattended.
|
static RelativeTimeFilter |
getTimeFilter()
Get the Filter controlling the maximum age of displayed message traffic.
|
static java.lang.Enum<? extends UnitEnum> |
getUnit(java.lang.Class<? extends UnitEnum> cls)
Get the current preferred value of the unit-specifying Enum class.
|
static WeightUnit |
getWeightUnit()
Get the currently set unit for weight display.
|
void |
gpsDataUpdated(GPSDistributor distributor,
GpsFix currentFix,
boolean isLocal,
java.lang.String source)
Called by the GPSDistributor when the GPS data has been updated.
|
static boolean |
initOnePlugin(Provider provider,
java.lang.String pluginContainerName)
Activate the features defined by the specified
Provider subclass instance. |
static boolean |
isAutoReply()
Report whether received APRS text messages should be automatically replied to without
human input.
|
static boolean |
isCallsignSet()
Indicate if the local station's callsign has been set.
|
static boolean |
isDebug()
Indicate if debug messages should be printed out.
|
static boolean |
isDebug(java.lang.String categoryName)
Indicate if a specific category of debug messages should be printed out.
|
static boolean |
isLogAPRS()
Efficiently test if APRS packets should be logged to disk.
|
static boolean |
isLogGPS()
Efficiently test if GPS NMEA sentences should be logged to disk.
|
static boolean |
isOperatorPresent(long now)
Test if human user has been active within the tolerance for inactivity.
|
static boolean |
isShowOperatorPresent()
Indicate if beacons should use the 'O' overlay to indicate an operator is present
at the station.
|
static boolean |
isUseExtendedSymbols()
Report whether APRS 1.2 extended symbols are available and will be used if needed.
|
static boolean |
loadOnePlugin(java.io.File pluginJar)
Attempt to load one JAR file as a plugin.
|
static void |
main(java.lang.String[] args)
Main program entry point (normally only used by
YAACBootstrap . |
static void |
moveNewUpgraderToLib()
Upon startup of a freshly upgraded installation of YAAC, move the installed upgrade.jar
file to the directory location it will be executed from for upgrades, so that the new
upgrade.jar and the old executing one will not collide (an operation prohibited by Microsoft
Windows).
|
static void |
operatorActed()
Update last time human user did something on the UI.
|
static void |
putBeaconData(java.lang.String beaconName,
BeaconData bd)
Add a new BeaconData record under a unique name.
|
static boolean |
removeBeaconData(java.lang.String beaconName)
Remove an extra BeaconData record.
|
static void |
removeShutdownHandler(ShutdownHandler sh)
Unregister a ShutdownHandler that is no longer needed.
|
static void |
removeUnitEnumChangeListener(UnitEnumChangeListener l)
Remove a UnitEnumChangeListener from being informed of unit changes,
|
void |
satDataUpdated(GPSDistributor distributor,
SatelliteCatalog satCatalog,
boolean isLocal,
java.lang.String source)
Called when the satellite constellation in use changes.
|
static void |
setAutoReply(boolean autoReply)
Specify whether received APRS text messages should be automatically replied to without
human input.
|
static void |
setDistanceUnit(DistanceUnit distanceUnit)
Change the current unit for scaling distance display, and store the change in the YAAC preferences.
|
static void |
setLastCL(java.lang.ClassLoader lastCL)
Fix the ClassLoader used by YAAC to account for dynamically loaded
plugins.
|
static void |
setLogAPRS(boolean logAPRS)
Remember if APRS packets should be logged to disk.
|
static void |
setLogGPS(boolean logGPS)
Remember if GPS NMEA sentences should be logged to disk.
|
static void |
setPressureUnit(PressureUnit pressureUnit)
Change the current unit for scaling pressure display, and store the change in the YAAC preferences.
|
static void |
setShowOperatorPresent(boolean showOperatorPresent)
Indicate if beacons should use the 'O' overlay to indicate an operator is present
at the station.
|
static void |
setSoundMaker(MsgEventListener soundMaker)
Specify the object used to produce sound effects.
|
static void |
setTemperatureUnit(TemperatureUnit temperatureUnit)
Change the current unit for scaling temperature display, and store the change in the YAAC preferences.
|
static void |
setTimeBeforeInactive(int minutesBeforeInactive)
Set the time interval after which no user action indicates the station is unattended.
|
static void |
setUseExtendedSymbols(boolean useExtendedSymbols)
Specify whether APRS 1.2 extended symbols should be used to render stations reporting known
overlays of alternate table symbols.
|
static void |
setWeightUnit(WeightUnit weightUnit)
Change the current unit for scaling weight display, and store the change in the YAAC preferences.
|
public static final java.lang.String OPT_GUI
public static final java.lang.String OPT_GUI_FIRST
FirstWindow
,
Constant Field Valuespublic static final java.lang.String OPT_DEBUG
public static final java.lang.String OSNAME
getProps()
,
Constant Field Valuespublic static final java.lang.String OSARCH
getProps()
,
Constant Field Valuespublic static final java.lang.String OPT_OSM_TILE_DIR
getProps()
,
Constant Field Valuespublic static final java.lang.String OPT_LOG_DIR
getProps()
,
Constant Field Valuespublic static final java.lang.String OPT_MSG_LOG
getProps()
,
Constant Field Valuespublic static final java.lang.String OPT_LAST_CHOSEN_PATH
getProps()
,
Constant Field Valuespublic static final java.lang.String WINDOWS
OSNAME
,
Constant Field Valuespublic static void main(java.lang.String[] args)
YAACBootstrap
. This
requires that the classpath be properly set up with the platform-appropriate
variant of the JSSC library.args
- command line argumentspublic static void moveNewUpgraderToLib() throws java.io.IOException
java.io.IOException
- if upgrade.jar could not successfully be moved for some reasonpublic void beaconChanged(BeaconData beaconData)
beaconChanged
in interface BeaconChangeListener
beaconData
- BeaconData record that has been changedpublic void gpsDataUpdated(GPSDistributor distributor, GpsFix currentFix, boolean isLocal, java.lang.String source)
gpsDataUpdated
in interface GpsDataListener
distributor
- instance of the GPSDistributorcurrentFix
- current GpsFixisLocal
- boolean true if this is GPS data for the local station, false if for a remote GPS receiversource
- String name assigned to remote GPS receiver, or null if for the local receiverpublic void satDataUpdated(GPSDistributor distributor, SatelliteCatalog satCatalog, boolean isLocal, java.lang.String source)
satDataUpdated
in interface GpsDataListener
distributor
- instance of the GPSDistributorsatCatalog
- updated SatelliteCatalog instanceisLocal
- boolean true if this is GPS data for the local station, false if for a remote GPS receiversource
- String name assigned to remote GPS receiver, or null if for the local receiverpublic static void setLastCL(java.lang.ClassLoader lastCL)
lastCL
- ClassLoader chain to replace chain of ClassLoaderpublic static boolean loadOnePlugin(java.io.File pluginJar)
pluginJar
- File identifying the JAR file assumed to be the root of a pluginProvider.runInitializersBefore(int)
public static YAAC.PluginContext getMostRecentPlugin()
java.lang.InternalError
- if called before any plugins are installedpublic static boolean initOnePlugin(Provider provider, java.lang.String pluginContainerName)
Provider
subclass instance.
Note this Provider's Provider.runInitializersBefore(int)
method must have
returned true, otherwise the behavior is not predictable.provider
- Provider subclass instance to activatepluginContainerName
- the name of the JAR file containing the Providerpublic static AbstractMenuAction findMenuAction(java.lang.String preLocalizedTagName)
preLocalizedTagName
- pre-localized tag name String to search forpublic static java.util.ResourceBundle getMsgBundle()
public static java.util.ResourceBundle getMsgBundle(java.lang.String altBundleName)
altBundleName
- String base name of the ResourceBundle to search forpublic static java.lang.String getMsg(java.lang.String tagName) throws java.util.MissingResourceException
tagName
- String name to look upjava.util.MissingResourceException
- if the tag cannot be foundpublic static java.lang.String getMsg(java.lang.String bundleBaseName, java.lang.String tagName) throws java.util.MissingResourceException
bundleBaseName
- String name of bundle containing the tagtagName
- String name to look upjava.util.MissingResourceException
- if the bundle or tag cannot be foundpublic static java.util.Properties getProps()
public static GuiIfc getGui()
public static java.util.prefs.Preferences getPreferences()
public static CumulativeBooleanAndFilter getFilter()
public static RelativeTimeFilter getTimeFilter()
public static java.util.List<Provider> getProviderList()
public static int getCoreProviderVersion()
Provider.PROVIDER_API_VERSION
explains
what functionality was added to core YAAC for each increment in the version number and is expected to be
there and working for the plugin to use.Provider.PROVIDER_API_VERSION
for this build of YAACProvider.getInitFailureReason()
,
Provider.PLUGIN_NEEDS_NEWER_YAAC_PROTOCOL
public static Provider getProvider(java.lang.Class<? extends Provider> clazz)
clazz
- Class object of the desired Provider or a superclass of the Providerpublic static Provider getProviderByName(java.lang.String providerName)
providerName
- String name of Provider object, as available from the Provider.getName()
methodpublic static Provider getProviderByJarName(java.lang.String providerJarName)
providerJarName
- String name of JAR file containing the plugin providerpublic static Provider getProviderByClassName(java.lang.String providerClassName)
providerClassName
- String name of Provider class, as available from the Class#getName()
or Class#getSimpleName() methodspublic static BeaconData getBeaconData()
public static BeaconData getBeaconData(java.lang.String beaconName)
beaconName
- String name of the BeaconData record to retrievepublic static java.util.Map<java.lang.String,BeaconData> getBeaconDataMap()
public static void putBeaconData(java.lang.String beaconName, BeaconData bd) throws java.lang.IllegalArgumentException
beaconName
- String name of beaconbd
- BeaconData structure to addjava.lang.IllegalArgumentException
- if beaconName already exists in collection of BeaconData structurespublic static boolean removeBeaconData(java.lang.String beaconName)
beaconName
- String name of beaconpublic static boolean isCallsignSet()
public static StatusData getStatusData()
public static java.lang.String getCallsign()
public static SnifferDataModel getSnifferDataModel()
public static java.util.ArrayList<AbstractMenuAction> getMenuBarActionList()
public static java.util.ArrayList<AbstractPopupMenuAction> getPopupMenuActionList()
public static DistanceUnit getDistanceUnit()
public static void setDistanceUnit(DistanceUnit distanceUnit)
distanceUnit
- DistanceUnit to use for all future distance displayspublic static TemperatureUnit getTemperatureUnit()
public static void setTemperatureUnit(TemperatureUnit temperatureUnit)
temperatureUnit
- TemperatureUnit to use for all future temperature displayspublic static PressureUnit getPressureUnit()
public static void setPressureUnit(PressureUnit pressureUnit)
pressureUnit
- PressureUnit to use for all future pressure displayspublic static WeightUnit getWeightUnit()
public static void setWeightUnit(WeightUnit weightUnit)
weightUnit
- WeightUnit to use for all future weight displayspublic static java.lang.Enum<? extends UnitEnum> getUnit(java.lang.Class<? extends UnitEnum> cls)
cls
- subclass of Enum that implements the UnitEnum tag interfacepublic static void addUnitEnumChangeListener(UnitEnumChangeListener l)
l
- UnitEnumChangeListener to registerpublic static void removeUnitEnumChangeListener(UnitEnumChangeListener l)
l
- UnitEnumChangeListener to deregisterpublic static boolean isLogAPRS()
public static boolean isLogGPS()
public static void setLogAPRS(boolean logAPRS)
logAPRS
- boolean true if logging should occur in the futurepublic static void setLogGPS(boolean logGPS)
logGPS
- boolean true if logging should occur in the futurepublic static boolean isDebug()
public static boolean isDebug(java.lang.String categoryName)
categoryName
- String name of category to enable debug logging forpublic static boolean isShowOperatorPresent()
public static void setShowOperatorPresent(boolean showOperatorPresent)
showOperatorPresent
- boolean true if operator-present overlay should be used for alternate set symbolspublic static boolean isAutoReply()
public static void setAutoReply(boolean autoReply)
autoReply
- boolean true if receipt of a text message should cause the auto ack message to
be transmitted in replypublic static boolean isUseExtendedSymbols()
public static void setUseExtendedSymbols(boolean useExtendedSymbols)
useExtendedSymbols
- boolean true if APRS 1.2 extended symbols should be used if neededpublic static int getTimeBeforeInactive()
public static void setTimeBeforeInactive(int minutesBeforeInactive)
minutesBeforeInactive
- time in minutes before inactivitypublic static void operatorActed()
public static boolean isOperatorPresent(long now)
now
- current time in milliseconds since Jan 1 1970 UTCpublic static long getStartupTime()
public static StationState getLocalStation()
public static void addShutdownHandler(ShutdownHandler sh)
sh
- ShutdownHandler to registerpublic static void removeShutdownHandler(ShutdownHandler sh)
sh
- ShutdownHandler to removepublic static ShutdownHandler getLastShutdownHandler()
public static CheckpointingLogger getCheckpointingLogger()
public static java.lang.String getProfileName()
public static java.io.File getBaseDir()
public static java.io.File getDataDir()
public static java.lang.ClassLoader getLastClassLoader()
public static MsgEventListener getSoundMaker()
public static void setSoundMaker(MsgEventListener soundMaker)
soundMaker
- new SoundMaker implementation to provide audio outputspublic static java.lang.String[] getOriginalArguments()