Class FWCustomizableLayoutProvider

java.lang.Object
net.simplace.ui.customize.FWCustomizableLayoutProvider
Direct Known Subclasses:
XMLLayoutProvider

public abstract class FWCustomizableLayoutProvider extends Object
Provides the customizing of the client layout: settings, problem report, systems, functions, menus, toolbar, state bar, forms, layout properties, chart styles and map styles. Subclasses read the customizing from a concrete source (see XMLLayoutProvider).

Settings, problem report, forms and layout properties are initialized in the constructor, systems, functions, menus etc. in initializeStructure().

Author:
aenders
  • Field Details

    • iLocalePrefix

      protected String iLocalePrefix
      prefix for the locale keys of captions
    • iContentObject

      protected Object iContentObject
      not used
    • iSettingModel

      protected FWSettingModel iSettingModel
      the setting model, null if none is defined
    • iProblemReportModel

      protected FWProblemReportModel iProblemReportModel
      the problem report model, null if none is defined
    • iSystemMap

      protected Map<String, FWSystemModel> iSystemMap
      the system models by system id
    • iFunctionMap

      protected Map<String, FWFunctionalityModel> iFunctionMap
      the global function models by function id
    • iMenuMap

      protected Map<String, FWMenuItem> iMenuMap
      the menu items by id (in menu order); null values are separators
    • iToolMap

      protected Map<String, FWToolbarButton> iToolMap
      the toolbar buttons by id (in toolbar order); null values are separators
    • iStateBarMap

      protected Map<String,Object> iStateBarMap
      the state bar definitions by id (in order)
    • iFormMap

      protected Map<String, org.jdom2.Element> iFormMap
      the form definitions by form id
    • iLayoutPropertiesMap

      protected Map<String,String> iLayoutPropertiesMap
      the layout properties
    • iChartStyleMap

      protected Map<String, ChartStyle> iChartStyleMap
      the global chart styles by id
    • shouldAddKeyworkPanel

      protected boolean shouldAddKeyworkPanel
      if the keyword (project) tree panel is shown
    • shouldAddSimComponentPanel

      protected boolean shouldAddSimComponentPanel
      if the sim component tree panel is shown
    • shouldAddAtlasPanel

      protected boolean shouldAddAtlasPanel
      if the atlas tree panel is shown
    • shouldAddScenarioPanel

      protected boolean shouldAddScenarioPanel
      if the scenario tree panel is shown
    • iFeatureStyleMap

      protected Map<String, org.jdom2.Element> iFeatureStyleMap
      Holds the predefined display styles for GeoTools Feature and FeatureCollection objects.
    • iGridStyleMap

      protected Map<String, org.jdom2.Element> iGridStyleMap
      Holds the predefined display styles for GeoTools GridCoverage2D objects.
  • Constructor Details

    • FWCustomizableLayoutProvider

      public FWCustomizableLayoutProvider(Object aObjectFillingStructure)
      Reads the customizing and initializes forms, problem report, settings and layout properties.
      Parameters:
      aObjectFillingStructure - the source of the customizing, depends on the subclass
  • Method Details

    • initializeStructure

      public void initializeStructure()
      Initializes systems, functions, chart, feature and grid styles, menus, state bar and toolbar.
    • reInitializeStructure

      public void reInitializeStructure()
      Clears and reinitializes forms, menus, state bar, toolbar, chart, feature and grid styles (e.g. after the customizing changed).
    • reInitializeSystems

      public void reInitializeSystems()
      Clears and reinitializes the system models.
    • initSystemMap

      protected abstract void initSystemMap()
      Fills the iSystemMap with the system models.
    • initProblemReportModel

      protected abstract void initProblemReportModel()
    • initSettingModel

      protected abstract void initSettingModel()
      Sets the iSettingModel.
    • initToolMap

      protected abstract void initToolMap()
      Fills the iToolMap with the toolbar buttons of existing functions and the separators.
    • initStateBarFunctions

      protected abstract void initStateBarFunctions()
      Fills the iStateBarMap with the state bar definitions.
    • initFunctionMap

      protected abstract void initFunctionMap()
      Fills the iFunctionMap with the global function models.
    • initFormMap

      protected abstract void initFormMap()
      Fills the iFormMap with the form definitions.
    • initChartStyleMap

      protected abstract void initChartStyleMap()
      Fills the iChartStyleMap with the global chart styles.
    • initFeatureStyleMap

      protected abstract void initFeatureStyleMap()
      Fills the iFeatureStyleMap with the predefined display styles for GeoTools Feature or FeatureCollection objects.
    • initGridStyleMap

      protected abstract void initGridStyleMap()
      Fills the iGridStyleMap with the predefined display styles for GeoTools GridCoverage2D objects.
    • initMenuMap

      protected abstract void initMenuMap()
      Fills the iMenuMap with the menu items of existing functions and the separators.
    • initLayoutPropertiesMap

      protected abstract void initLayoutPropertiesMap()
      Fills the iLayoutPropertiesMap, sets the iLocalePrefix and the flags for the tree panels.
    • getSystemModel

      public FWSystemModel getSystemModel(String aID)
      Parameters:
      aID - the system id
      Returns:
      a clone of the system model, or null if the system is unknown
    • getOriginalSystemModel

      public FWSystemModel getOriginalSystemModel(String aID)
      Parameters:
      aID - the system id
      Returns:
      the original (not cloned) system model; null if unknown
    • getSystemModels

      public Map<String, FWSystemModel> getSystemModels()
      Returns:
      the system models by system id (the internal map, not cloned)
    • getSettingModel

      public FWSettingModel getSettingModel()
      Returns:
      the setting model, or null if none is defined
    • getProblemReportModel

      public FWProblemReportModel getProblemReportModel()
      Returns:
      the problem report model, or null if none is defined
    • getDefaultSystemSettings

      public Map<String,Object> getDefaultSystemSettings()
      Returns:
      the parameters of the setting model, empty if there is none
    • getFunctionModel

      public FWFunctionalityModel getFunctionModel(String aSystemID, String aFunctionID)
      Looks up a function model in this order: the function of the system (or its start function if both ids are the same), the start function of the system aFunctionID, the global function map.
      Parameters:
      aSystemID - the system id, may be empty
      aFunctionID - the function id
      Returns:
      the function model (the global one cloned), or null if not found
    • getMenuMap

      public Map<String, FWMenuItem> getMenuMap()
      Returns:
      the menu items by id (in menu order); null values are separators
    • getToolMap

      public Map<String, FWToolbarButton> getToolMap()
      Returns:
      the toolbar buttons by id (in toolbar order); null values are separators
    • getLayoutPropertiesMap

      public Map<String,String> getLayoutPropertiesMap()
      Returns:
      the layout properties
    • getLocalePrefix

      public String getLocalePrefix()
      Returns:
      the prefix for the locale keys of captions
    • getLayoutProperty

      public String getLayoutProperty(String aKey)
      Parameters:
      aKey - the key of the layout property
      Returns:
      the layout property, or null if not defined
    • getChartStyle

      public ChartStyle getChartStyle(String aKey, net.simplace.core.FWObservable aObservable)
      Looks up a chart style first in the system of the observable, then in the global chart styles, and sets the observable on the found style.
      Parameters:
      aKey - id of the chart style
      aObservable - the observable providing the system id and the parameters, may be null
      Returns:
      the chart style, or null if the key is empty or not found
    • getStateBarFunctions

      public Map<String,Object> getStateBarFunctions()
      Returns:
      the state bar definitions by id (in order)
    • isShouldAddKeyworkPanel

      public boolean isShouldAddKeyworkPanel()
      Returns:
      true if the keyword (project) tree panel is shown
    • setShouldAddKeyworkPanel

      public void setShouldAddKeyworkPanel(boolean aShouldAddKeyworkPanel)
      Parameters:
      aShouldAddKeyworkPanel - true to show the keyword (project) tree panel
    • isShouldAddSimComponentPanel

      public boolean isShouldAddSimComponentPanel()
      Returns:
      true if the sim component tree panel is shown
    • setShouldAddSimComponentPanel

      public void setShouldAddSimComponentPanel(boolean aShouldAddSimComponentPanel)
      Parameters:
      aShouldAddSimComponentPanel - true to show the sim component tree panel
    • isShouldAddAtlasPanel

      public boolean isShouldAddAtlasPanel()
      Returns:
      true if the atlas tree panel is shown
    • setShouldAddAtlasPanel

      public void setShouldAddAtlasPanel(boolean aShouldAddAtlasPanel)
      Parameters:
      aShouldAddAtlasPanel - true to show the atlas tree panel
    • isShouldAddScenarioPanel

      public boolean isShouldAddScenarioPanel()
      Returns:
      true if the scenario tree panel is shown
    • setShouldAddScenarioPanel

      public void setShouldAddScenarioPanel(boolean aShouldAddScenarioPanel)
      Parameters:
      aShouldAddScenarioPanel - true to show the scenario tree panel
    • isAccessable

      public boolean isAccessable(String aID)
      Checks if a system or function exists: ids starting with system always do, otherwise a system or a global function with the id must be defined.
      Parameters:
      aID - the system or function id
      Returns:
      true if it exists, false for unknown ids (a warning is logged)
    • isDeveloppmentMode

      public boolean isDeveloppmentMode()
      Returns:
      true if the layout property developpmentmode is true
    • getForm

      public org.jdom2.Element getForm(String aFormID)
      Parameters:
      aFormID - the form id
      Returns:
      the form definition, or null if not defined
    • getChildObject

      public abstract Object getChildObject(String aName)
      Parameters:
      aName - name of the part of the customizing (e.g. projects, simcomponents)
      Returns:
      the part of the customizing, type depends on the subclass; null if not defined