Package ch.autumo.ui.fx
Class BaseApp
java.lang.Object
javafx.application.Application
ch.autumo.ui.fx.BaseApp
- All Implemented Interfaces:
LicensedApplication,SecureApplication,InstallEndListener
public abstract class BaseApp
extends javafx.application.Application
implements LicensedApplication, InstallEndListener
The Java FX application.
In any case you always can use the getters from
ConfigurationManager
to retrieve any configuration parameter.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javafx.application.Application
javafx.application.Application.Parameters -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe base configuration file ('cfg/base.cfg').protected PropertiesThe base configuration properties.protected static final org.slf4j.LoggerLogger.Fields inherited from class javafx.application.Application
STYLESHEET_CASPIAN, STYLESHEET_MODENAFields inherited from interface ch.autumo.commons.application.LicensedApplication
AP_LS_AD_KEY, AP_LS_AK_KEY, BASE_CFG_FILE, BASE_CFG_JAR, CONFIG_DEFAULT_FILE, CONFIG_PATH, FILE_REG_SOURCE, INLINE_CHECKS_KEY, LIC_CHARS, LIC_INFO_FILE, LIC_PATH, LIC_TYPE_KEY, PROD_KEY, RT_TYPE_KEYFields inherited from interface ch.autumo.commons.security.SecureApplication
SEC_KEY_SEED -
Constructor Summary
ConstructorsConstructorDescriptionBaseApp()Because ofSecureApplicationand when console tools such as theEncoderare used.BaseApp(RegistrationVersion regVersion) Because ofLicensedApplicationand when console tools such as theRegisterare used. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecentFile(File file) Add a recent used file.voidClear recent used file list.voidWill be called when the installer is finished.abstract voidfinish(javafx.stage.Stage primaryStage) Finish program.abstract StringGet application title.abstract StringGet application version.abstract StringGet base configuration template file.protected final PropertiesGet base properties (properties from 'cfg/base.ifc').protected final StringGet base properties file ('cfg/base.ifc') for possible modifications; e.g.abstract StringGet base resource path for application.abstract StringGet configuration template file.Get a configuration parameter/value.Get initial fallback value for the configuration file by specified configuration ID.Overwrite if inline-checks are used!abstract StringGet in-memory configuration name.abstract StringGet an internal application name; make sure it is one word with small and/or big letters and no space.Overwrite if you want to use an own internal security key.final Stringfinal StringOverwrite if there's a specific license version; e.g.protected StringManufacturer of this application.javafx.stage.StageGet primary stage.You most likely want to overwrite this method if your application can be registered or is registered and product key is not read and decrypted from 'base.ifc'.Get recent used files.You most likely want to overwrite this method if your application can be registered or is registered.Overwrite if there's a specific runtime version; e.g.final Stringprotected abstract voidinitialize(javafx.stage.Stage primaryStage, Properties p) Initialize the FX GUI -preInitialize(Stage)must have been called before this method! This will show the main view created previously.voidinitializeBaseConfig(String rootFolder) final booleanbooleanChecks if this app has been installed before; Installer has been run.final booleanGet license accepted flag.final voidSet license accepted flag.Load a configuration parameter directly from configuration file.voidLoad recent used files.protected abstract javafx.scene.layout.PanepreInitialize(javafx.stage.Stage primaryStage) Pre-initialize the FX GUI for the installer.voidRemove app configuration from disk.booleanremoveRecentFile(File file) Remove a file from recent used file list.final voidsetAllowed2ReadEnvData(boolean allow) voidstart(javafx.stage.Stage primaryStage) protected voidstartup(javafx.stage.Stage primaryStage) Called before everything else, overwrite if necessary.voidstop()voidStore configuration properties to disk.Methods inherited from class javafx.application.Application
getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOGLogger. -
baseCfgFile
The base configuration file ('cfg/base.cfg'). -
baseProps
The base configuration properties.
-
-
Constructor Details
-
BaseApp
public BaseApp()Because ofSecureApplicationand when console tools such as theEncoderare used. -
BaseApp
Because ofLicensedApplicationand when console tools such as theRegisterare used.- Parameters:
regVersion- injected registration version
-
-
Method Details
-
start
public void start(javafx.stage.Stage primaryStage) - Specified by:
startin classjavafx.application.Application
-
startup
protected void startup(javafx.stage.Stage primaryStage) Called before everything else, overwrite if necessary.- Parameters:
primaryStage- primary stage
-
stop
- Overrides:
stopin classjavafx.application.Application- Throws:
Exception
-
storeProps
public void storeProps()Store configuration properties to disk. -
completed
Description copied from interface:InstallEndListenerWill be called when the installer is finished.- Specified by:
completedin interfaceInstallEndListener- Parameters:
ex- an exception if any or null
-
getConfigurationParameter
Get a configuration parameter/value.- Parameters:
key- key- Returns:
- value or null
-
getPrimaryStage
public javafx.stage.Stage getPrimaryStage()Get primary stage.- Returns:
- primary stage
-
loadConfigurationParamaterFromFile
Load a configuration parameter directly from configuration file.- Parameters:
key- key for value- Returns:
- value if any, otherwise null
-
removeConfig
public void removeConfig()Remove app configuration from disk. -
licenseAccepted
public final void licenseAccepted()Set license accepted flag. -
isLicenseAccepted
public final boolean isLicenseAccepted()Get license accepted flag.- Returns:
- true, if license was accepted by the user during install
-
isInstalled
public boolean isInstalled()Checks if this app has been installed before; Installer has been run.- Returns:
- true if app is installed
-
loadRecentFiles
Load recent used files.- Parameters:
p- configuration properties
-
clearRecentFiles
public void clearRecentFiles()Clear recent used file list. -
getRecentFiles
Get recent used files.- Returns:
- recent files
-
addRecentFile
Add a recent used file.- Parameters:
file- recent file
-
removeRecentFile
Remove a file from recent used file list.- Parameters:
file- file to remove- Returns:
- true if removed, false otherwise
-
getInitConfidParameter
Get initial fallback value for the configuration file by specified configuration ID. This is only used if every other method failed; e.g. missing template configuration.- Parameters:
id- configuration ID- Returns:
- configuration value
-
getBaseConfigTemplateFile
Get base configuration template file. Overwrite this method if you want your application to be licensed.- Returns:
- base configuration template file
-
getConfigTemplateFile
Get configuration template file.- Returns:
- configuration template file
-
getBaseProperties
Get base properties (properties from 'cfg/base.ifc'). Used for optional runtime checks.- Returns:
- base properties
-
getBasePropertiesFile
Get base properties file ('cfg/base.ifc') for possible modifications; e.g. trial period, etc. Used for optional runtime checks.- Returns:
- base properties
-
getManufacturer
Manufacturer of this application. We suggest not using spaces for this information; it is used to group the application's data on the desktop in a directory where all application data of a certain manufacturer is located. Overwrite this and use your own enterprise/company name. Typical locations on systems: - Linux : /home/USER/.APPNAME (no manufacturer name used) - macOS : /Users/USER/Library/Application Support/MANUFACTURER/APPNAME - Windows : C:\Users\USER\AppData\Roaming\MANUFACTURER/APPNAME- Returns:
- manufacturer name
-
preInitialize
protected abstract javafx.scene.layout.Pane preInitialize(javafx.stage.Stage primaryStage) Pre-initialize the FX GUI for the installer. Create the main view here and call UI.setup(...). Run before the installer if any.- Parameters:
primaryStage- primary stage- Returns:
- the main view
-
initialize
Initialize the FX GUI -preInitialize(Stage)must have been called before this method! This will show the main view created previously. Run after the installer if any.- Parameters:
primaryStage- primary stagep- loaded configuration properties
-
getBaseResourcePath
Get base resource path for application.- Returns:
- base resource path for application
-
getInMemoryConfigName
Get in-memory configuration name.- Returns:
- in-memory configuration name
-
getAppVersion
Get application version. It is also used for online upgrade checks, if applied.- Specified by:
getAppVersionin interfaceLicensedApplication- Returns:
- application version
-
getAppTitle
Get application title. Part of the online license check, if applied.- Specified by:
getAppTitlein interfaceLicensedApplication- Returns:
- application title
-
getInternalAppName
Get an internal application name; make sure it is one word with small and/or big letters and no space. It is used for internal purposes, e.g. configuration directory.- Returns:
- application name
-
finish
public abstract void finish(javafx.stage.Stage primaryStage) Finish program.- Parameters:
primaryStage- primary stage
-
getInternalSecurityKey
Overwrite if you want to use an own internal security key. It is only used when this application is licensed through autumo's licensing mechanism that involves an autumo license server. Contact autumo for more information.- Specified by:
getInternalSecurityKeyin interfaceSecureApplication- See Also:
-
getUniqueSecurityKey
- Specified by:
getUniqueSecurityKeyin interfaceSecureApplication- See Also:
-
getPassphrase
- Specified by:
getPassphrasein interfaceSecureApplication- See Also:
-
initializeBaseConfig
- Specified by:
initializeBaseConfigin interfaceLicensedApplication- Throws:
Exception
-
getLicensePath
- Specified by:
getLicensePathin interfaceLicensedApplication
-
getLicInfoTitle
- Specified by:
getLicInfoTitlein interfaceLicensedApplication
-
isAllowed2ReadEnvData
public final boolean isAllowed2ReadEnvData()- Specified by:
isAllowed2ReadEnvDatain interfaceLicensedApplication
-
setAllowed2ReadEnvData
public final void setAllowed2ReadEnvData(boolean allow) - Specified by:
setAllowed2ReadEnvDatain interfaceLicensedApplication
-
getRuntimeType
Overwrite if there's a specific runtime version; e.g. Trial, Full version.- Specified by:
getRuntimeTypein interfaceLicensedApplication- See Also:
-
getLicType
Overwrite if there's a specific license version; e.g. Basic, Professional, Enterprise.- Specified by:
getLicTypein interfaceLicensedApplication
-
getInlineChecks
Overwrite if inline-checks are used!- Specified by:
getInlineChecksin interfaceLicensedApplication
-
getApiKey
- Specified by:
getApiKeyin interfaceLicensedApplication
-
getLicSrvUrl
- Specified by:
getLicSrvUrlin interfaceLicensedApplication
-
getProductKey
You most likely want to overwrite this method if your application can be registered or is registered and product key is not read and decrypted from 'base.ifc'. Must match the product key configured at the autumo product license server. Part of the online license check, if applied.- Specified by:
getProductKeyin interfaceLicensedApplication
-
getRegVersion
You most likely want to overwrite this method if your application can be registered or is registered. Part of the whole licensing mechanism, if applied.- Specified by:
getRegVersionin interfaceLicensedApplication
-