Class FWSystemModel
java.lang.Object
net.simplace.pipe.system.FWSystemModel
Model of a system of the GUI framework (a group of functions, chart/feature/grid styles and scenarios), read
from its
system element. The functions can be defined in the element itself or in a separate
client configuration (attribute clientconfig, class path resource or file). Scenarios are stored in
<cache dir>/<system id>/scenario_config.xml.- Author:
- Andreas Enders
-
Constructor Summary
ConstructorsConstructorDescriptionFWSystemModel(org.jdom2.Element aSystemElement) Reads the system element and, if needed, the client configuration. -
Method Summary
Modifier and TypeMethodDescriptionclone()booleandoesScenarioNameExist(String aName) getChartStyle(String aKey, net.simplace.core.FWObservable aObservable) voidReplaces the system element by the client configuration (class path resource or file), if one is given and the system element has nofunctions; id and info attribute are kept.org.jdom2.ElementgetFeatureStyle(String aKey) Returns a feature style of the system.getFunction(String aID) org.jdom2.ElementgetGridStyle(String aKey) Returns a grid style of the system.getID()getOID()org.jdom2.ElementgetScenarioByName(String aName) intvoidLoads the scenario configuration from the cache directory (or creates an empty one) and fills the scenario map by OID (attributeOIDor parameterOID/scenarioOID); does nothing if scenarios are already loaded.voidremoveScenario(String aOID) Removes a scenario, runs the remove function of the system (if any), saves the configuration and updates the scenario tree.voidsaveScenario(Map<String, Object> aParameterMap) Creates a scenario from the parameters (OID fromscenarioOIDor new, name and description fromscenarioname/scenariodescwith tokens replaced, current date) and adds it.voidWrites the scenario configuration to<cache dir>/<system id>/scenario_config.xml.
-
Constructor Details
-
FWSystemModel
Reads the system element and, if needed, the client configuration.- Parameters:
aSystemElement- thesystemelement- Throws:
SystemNotFoundException- if the client configuration cannot be found or parsed
-
-
Method Details
-
clone
-
getID
- Returns:
- the id of the system
-
getParameterMap
-
getFunction
- Parameters:
aID- id of the function- Returns:
- the model of the function (
functions/function[@id]), ornull
-
getChartStyle
- Parameters:
aKey- id of the chart style (charts/style[@id])aObservable- parameters for the style- Returns:
- the chart style, or
nullif not found or invalid
-
getScenarioByName
- Parameters:
aName- name of the scenario (attributescenarioname)- Returns:
- the scenario element, or
null
-
getFeatureStyle
Returns a feature style of the system.- Parameters:
aKey- id of the style (features/featurestyle[@id])- Returns:
- the style element, or
null
-
getGridStyle
Returns a grid style of the system.- Parameters:
aKey- id of the style (grids/gridstyle[@id])- Returns:
- the style element, or
null
-
getStartFunctionModel
- Returns:
- the model of the function
<system id>.start, ornull
-
getRemoveFunctionModel
- Returns:
- the model of the function
<system id>.remove, ornull
-
getScenarioFunctionModel
- Returns:
- the model of the function
<system id>.scenario(or.start), ornull
-
getResultsFunctionModel
- Returns:
- the model of the function
<system id>.results, ornull
-
getOID
- Returns:
- the object id of the system (currently always
null)
-
getRessourcPartList
-
getClientConfigName
- Returns:
- the name of the client configuration, or
null
-
getInfoLocation
- Returns:
- the URL leading to Infos to the System
-
getClientConfigElement
Replaces the system element by the client configuration (class path resource or file), if one is given and the system element has nofunctions; id and info attribute are kept.- Throws:
SystemNotFoundException- if the client configuration cannot be found or parsed
-
initScenarioConfig
public void initScenarioConfig()Loads the scenario configuration from the cache directory (or creates an empty one) and fills the scenario map by OID (attributeOIDor parameterOID/scenarioOID); does nothing if scenarios are already loaded. -
getScenarioCount
public int getScenarioCount()- Returns:
- the number of scenarios in system
-
saveScenarioConfig
public void saveScenarioConfig()Writes the scenario configuration to<cache dir>/<system id>/scenario_config.xml. -
saveScenario
Creates a scenario from the parameters (OID fromscenarioOIDor new, name and description fromscenarioname/scenariodescwith tokens replaced, current date) and adds it.- Parameters:
aParameterMap- parameters of the scenario- Throws:
AlreadyExistingException- if a scenario with the OID exists
-
removeScenario
Removes a scenario, runs the remove function of the system (if any), saves the configuration and updates the scenario tree.- Parameters:
aOID- OID of the scenario
-
getScenarioMap
-
doesScenarioNameExist
- Parameters:
aName- scenario name- Returns:
trueif a scenario with this name exists
-