org.ka2ddo.aprs
Class Symbols

java.lang.Object
  extended by org.ka2ddo.aprs.Symbols

public class Symbols
extends java.lang.Object

This singleton class is a caching container for all the types of station symbols supported by APRS.


Nested Class Summary
static class Symbols.Category
          Indicate the type of station or object associated with a symbol table ID and code tuple.
static class Symbols.SymbolAttr
          Wrapper for all the non-graphics-related attributes for a symbol code, with a pointer to the rendering-related attributes object.
 
Method Summary
static Symbols.Category getCategory(char symTableId, char symbolCode)
          Get the Symbol.Category enum for a given symbol.
static Symbols getInstance()
          Get the singleton instance of the Symbols object.
static java.lang.String getLongestTypeName()
          Gets the longest string naming one of the station types.
static int getMaximumCodeVariations()
          Get the maximum number of overlay variations for any known symbol code.
static Symbols.SymbolAttr getSymbolAttr(char symTableId, char symbolCode)
          Get all the attributes associated with an APRS symbol.
static Symbols.SymbolAttr[] getSymbolsForCode(char symbolCode)
          Get the SymbolAttr objects for all known table IDs and overlays for the specified symbol code character.
static char[][] getTypeCodes()
          Get all known combinations of symbol table ID or overlay with symbol code.
static java.lang.String getTypeName(char symTableId, char symbolCode)
          Get the localized String type name for this symbol.
static boolean isLegalSymTableId(char symTableId, boolean isCompressedEncoding)
          Test if the specified character is a legal APRS symbol table ID (or overlay) character.
static void loadExtendedSymbols()
          Load the non-graphical APRS 1.2 extended symbol attributes,
static void removeExtendedSymbols()
          Delete entries for APRS 1.2 extended symbols, leaving only the APRS 1.0.2 symbols.
static void setAllowIllegalOverlays(boolean allowIllegalOverlays)
          Specify whether any printable character is allowed for an overlay (per the non-standard requirements of the Duchifat-1 satellite).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadExtendedSymbols

public static void loadExtendedSymbols()
Load the non-graphical APRS 1.2 extended symbol attributes,


getInstance

public static Symbols getInstance()
Get the singleton instance of the Symbols object.

Returns:
Symbols instance

removeExtendedSymbols

public static void removeExtendedSymbols()
Delete entries for APRS 1.2 extended symbols, leaving only the APRS 1.0.2 symbols.


getLongestTypeName

public static java.lang.String getLongestTypeName()
Gets the longest string naming one of the station types. This method is useful for initializing JLists, by setting the maximum width needed to display a list of types.

Returns:
the String for a station type name with the most number of characters

getMaximumCodeVariations

public static int getMaximumCodeVariations()
Get the maximum number of overlay variations for any known symbol code. This is primarily useful for sizing tables for displaying symbol codes in multiple columns.

Returns:
int maximum number of overlays/tables for any printable ASCII APRS symbol code

getTypeCodes

public static char[][] getTypeCodes()
Get all known combinations of symbol table ID or overlay with symbol code.

Returns:
variable-length array of 2-character arrays of symbol table ID/overlay and symbol code

getSymbolsForCode

public static Symbols.SymbolAttr[] getSymbolsForCode(char symbolCode)
Get the SymbolAttr objects for all known table IDs and overlays for the specified symbol code character.

Parameters:
symbolCode - ASCII character between '!' and '~'
Returns:
packed array of SymbolAttr objects for the specified code, sorted so the APRS 1.0.1 table IDs come first, followed by the APRS 1.2 overlays

getSymbolAttr

public static Symbols.SymbolAttr getSymbolAttr(char symTableId,
                                               char symbolCode)
Get all the attributes associated with an APRS symbol. If an overlaid symbol is specified (that has not been defined as an APRS 1.2 extension), automatically fall back to the corresponding alternate table symbol.

Parameters:
symTableId - symbol table ID character (can be an overlay)
symbolCode - symbol code character
Returns:
SymbolAttr structure, or null if no match

getTypeName

public static java.lang.String getTypeName(char symTableId,
                                           char symbolCode)
Get the localized String type name for this symbol.

Parameters:
symTableId - char symbol table ID (or overlay code)
symbolCode - char symbol code within the specified table
Returns:
type name String or null if no such symbol

getCategory

public static Symbols.Category getCategory(char symTableId,
                                           char symbolCode)
Get the Symbol.Category enum for a given symbol. If an overlaid symbol is specified (that has not been defined as an APRS 1.2 extension), automatically fall back to the corresponding alternate table symbol.

Parameters:
symTableId - char symbol table ID (or overlay code)
symbolCode - char symbol code within the specified table
Returns:
Category for this symbol

isLegalSymTableId

public static boolean isLegalSymTableId(char symTableId,
                                        boolean isCompressedEncoding)
Test if the specified character is a legal APRS symbol table ID (or overlay) character.

Parameters:
symTableId - character to test
isCompressedEncoding - boolean true if lower-case letters should be used to indicate digit overlays
Returns:
boolean true if permitted character

setAllowIllegalOverlays

public static void setAllowIllegalOverlays(boolean allowIllegalOverlays)
Specify whether any printable character is allowed for an overlay (per the non-standard requirements of the Duchifat-1 satellite).

Parameters:
allowIllegalOverlays - boolean true if any printable ASCII character is allowed for an overlay