Package org.ka2ddo.yaac.core.provider
Class CoreProvider
java.lang.Object
org.ka2ddo.yaac.pluginapi.Provider
org.ka2ddo.yaac.core.provider.CoreProvider
This class defines the core functionality to be provided by the
YAAC application. In essence, this is the root plugin that all other plugins
augment and extend. This is the only
Provider
subclass explicitly coded into
YAAC; all others are loaded from JAR files as defined by the Provider
class's
documentation.- Author:
- Andrew Pavlin, KA2DDO
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Helper class for transmitting a locally generated Object or Item Report packet and keeping it registered in the local object list.Nested classes/interfaces inherited from class org.ka2ddo.yaac.pluginapi.Provider
Provider.PortEntry
-
Field Summary
Modifier and TypeFieldDescriptionstatic final AbstractMenuAction
This Action performs the operations needed to cleanly shut down YAAC and free up the system resources it is using.static final String
The menu tag name for View->View Draw Toolbar, so that other closers of the toolbar can inform the menu item to clear its checkbox.static final String[]
The pre-localization hierarchy of sub-menu names for a menu at the top level, made available for use by plugins creating new menus.Fields inherited from class org.ka2ddo.yaac.pluginapi.Provider
PLUGIN_NEEDS_NEWER_YAAC_PROTOCOL, PLUGIN_UNKNOWN_INCOMPATIBILITY, PROVIDER_API_VERSION
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Specify attributions, credits/acknowledgements, and license references to be displayed in the About dialog box.Get any panels needed by this Provider to provision or configure the services offered by the Provider.Get the web server instance associated with the core services of YAAC.Filter[]
Get any filters to add to the main CumulativeBooleanAndFilter in the main class of YAAC.javax.help.HelpSet
Provide the base HelpSet for complete online documentation.Return an icon image associated with this Provider.static CoreProvider
Get the core instance of Provider for YAAC.Get Actions to define new menu items from this Provider.static ChangeSet[]
getOSMChangeSetIds
(boolean getBoth, boolean announceErrors) Get the local and remote OSM ChangeSet records for the versions of the OpenStreetMap data stored locally and available on the tile server website.Get PortConnector drivers provided by this Provider.static ChangeSet
getServerOSMChangeset
(String webTileDir) Query the author's website for the currently available changeset of the pre-imported OpenStreetMap tile files.Return a standard string for identifying this installation of YAAC to a web server in the User-Agent HTTP header property.boolean
hasRXTX()
Report whether this plugin was able to load the (now obsolete) RXTX native library for accessing serial ports.static boolean
Indicate if YAAC is configured to support Internet networks supporting IPv6.boolean
Indicate if YAAC is configured to support Internet networks prohibiting encrypted traffic (such as the Amateur Radio HSMM [High-Speed MultiMedia] networks).static void
Method to allow printing out version of YAAC (alternative toYAAC
class's -version command-line option).void
Execute this function after calling all of the other functions of the CoreProvider.static void
setIPv4Forced
(boolean onlyIPv4) Specify if YAAC is configured to support Internet networks supporting IPv6.void
setNonencryptedHTTPForced
(boolean onlyHTTP) Specify if YAAC is configured to support Internet networks prohibiting encrypted traffic.Methods inherited from class org.ka2ddo.yaac.pluginapi.Provider
buildNewerYaacNeededMsg, consumeXMLPreferenceData, findHelpSet, getAuthor, getInfo, getInitFailureReason, getName, getVersion, runInitializersBefore
-
Field Details
-
TOP_MENU
The pre-localization hierarchy of sub-menu names for a menu at the top level, made available for use by plugins creating new menus. -
EXIT_ACTION
This Action performs the operations needed to cleanly shut down YAAC and free up the system resources it is using. -
MENU_VIEW_DRAW_TOOLBAR
The menu tag name for View->View Draw Toolbar, so that other closers of the toolbar can inform the menu item to clear its checkbox.- See Also:
-
-
Method Details
-
getInstance
Get the core instance of Provider for YAAC.- Returns:
- singleton CoreProvider
-
getPortConnectorTypes
Get PortConnector drivers provided by this Provider.- Overrides:
getPortConnectorTypes
in classProvider
- Returns:
- array of PortEntry objects pairing port type names to drivers
-
getConfigurationPanels
Get any panels needed by this Provider to provision or configure the services offered by the Provider. The class names are expected to have a wildcard '*' in then to indicate where a platform-specific package variation should be plugged in (such as 'gui' for a conventional Java AWT/Swing GUI, or 'android' for an Android configuration view.- Overrides:
getConfigurationPanels
in classProvider
- Returns:
- Map of localized tab names to class names of GUI-displayable components to add to the expert-mode ConfigurationDialog when it is invoked (usually, a LinkedHashMap, so the tabs can be provided in a specific order)
- See Also:
-
getFilters
Get any filters to add to the main CumulativeBooleanAndFilter in the main class of YAAC.- Overrides:
getFilters
in classProvider
- Returns:
- array of Filter implementations
-
getOSMChangeSetIds
Get the local and remote OSM ChangeSet records for the versions of the OpenStreetMap data stored locally and available on the tile server website.- Parameters:
getBoth
- boolean true if both local and server changesets should be obtained, false if only localannounceErrors
- boolean true if this method should raise GUI displays to announce fatal errors- Returns:
- array of local and server ChangeSet records, or null if either the local tile directory is not available or writeable, or the remote webserver won't answer the query for its current changeset
-
getServerOSMChangeset
Query the author's website for the currently available changeset of the pre-imported OpenStreetMap tile files. The subdirectory of the website containing the tileset can be changed from the default with the Java JVM property dated.tile.dir specified as the relative subdirectory name within the website.- Parameters:
webTileDir
- String of subdirectory on webserver where tile files are located, or null to use default of property value of dated.tile.dir property, or just "tiledir"- Returns:
- ChangeSet, or null if server could not be reached or changeset file could not be read
-
getMenuItems
Get Actions to define new menu items from this Provider. Actions define the following properties:- PRE_LOCALIZE_MENU_TAG_NAME - the pre-ResourceBundle.getString() lookup of NAME that potential overriding menu entries can be identified (i.e., "menu.View.Weather.Wind")
- PRE_LOCALIZED_MENU_HIERARCHY - the array of localization tag names for the menu names in hierarchical order to contain this menu entry (i.e., { "menu.View", "menu.View.Weather" })
- SMALL_ICON (optional) - to label the menu entry
- Overrides:
getMenuItems
in classProvider
- Returns:
- array of Action objects
- See Also:
-
getAboutAttributions
Specify attributions, credits/acknowledgements, and license references to be displayed in the About dialog box. This method is called when the Help->About menu choice is selected.- Overrides:
getAboutAttributions
in classProvider
- Returns:
- array of localized Strings, each containing one attribution or acknowledgement
-
getHelpSet
public javax.help.HelpSet getHelpSet()Provide the base HelpSet for complete online documentation.- Overrides:
getHelpSet
in classProvider
- Returns:
- a JavaHelp HelpSet to merge if this Provider has one
-
getImageIconPath
Return an icon image associated with this Provider.- Overrides:
getImageIconPath
in classProvider
- Returns:
- String relative pathname for this Provider's icon image, or null for no icon
-
runInitializersAfter
public void runInitializersAfter()Execute this function after calling all of the other functions of the CoreProvider. This allows any Provider-specific initialization to run after menus and drivers are loaded, such as registering the standard query handlers, starting the mini-webserver, and connecting some of the core event listeners to their\ event generators.- Overrides:
runInitializersAfter
in classProvider
- See Also:
-
getCoreWebServer
Get the web server instance associated with the core services of YAAC.- Returns:
- HttpServer instance
-
hasRXTX
public boolean hasRXTX()Report whether this plugin was able to load the (now obsolete) RXTX native library for accessing serial ports. Note this will only report a meaningful value after the getPortConnectorTypes() method has been called.- Returns:
- boolean true if RXTX native library was loaded successfully
- See Also:
-
getUserAgent
Return a standard string for identifying this installation of YAAC to a web server in the User-Agent HTTP header property. This will provide operating system, Java runtime version, and locale information to the author to help him direct internationalization support for future YAAC development; the personal identity of the user in that country using that operating system will not be reported.- Returns:
- String to specify as the value of User-Agent
-
isNonencryptedHTTPForced
public boolean isNonencryptedHTTPForced()Indicate if YAAC is configured to support Internet networks prohibiting encrypted traffic (such as the Amateur Radio HSMM [High-Speed MultiMedia] networks). If so, only plain HTTP will be used instead of HTTPS; if the requested service only operates over HTTPS, the user will be informed that encrypted requests cannot be made.- Returns:
- boolean true if only unencrypted HTTP may be used for web requests
-
setNonencryptedHTTPForced
public void setNonencryptedHTTPForced(boolean onlyHTTP) Specify if YAAC is configured to support Internet networks prohibiting encrypted traffic. If so, only plain HTTP will be used instead of HTTPS; if the requested service only operates over HTTPS, the user will be informed that encrypted requests cannot be made.- Parameters:
onlyHTTP
- boolean true if only unencrypted HTTP may be used for web requests
-
isIPv4Forced
public static boolean isIPv4Forced()Indicate if YAAC is configured to support Internet networks supporting IPv6. Some Internet Service Providers are not up-to-date and only support IPv4 network addresses and protocols.- Returns:
- boolean true if only IPv4 addresses will be used for socket connections
-
setIPv4Forced
public static void setIPv4Forced(boolean onlyIPv4) Specify if YAAC is configured to support Internet networks supporting IPv6. Some Internet Service Providers are not up-to-date and only support IPv4 network addresses and protocols.- Parameters:
onlyIPv4
- boolean true if only IPv4 addresses will be used for socket connections
-
main
Method to allow printing out version of YAAC (alternative toYAAC
class's -version command-line option).- Parameters:
args
- ignored
-