Class FWClientController

java.lang.Object
net.simplace.ui.FWClientController

public class FWClientController extends Object
Singleton controller of the GUI client: dispatches action commands of menus and toolbars to system actions or functionalities (pipeline steps of a system) and runs, advances (go/back), cancels and closes them. One running functionality is kept per system id.
Author:
Andreas Enders
  • Constructor Details

    • FWClientController

      public FWClientController()
  • Method Details

    • getInstance

      public static FWClientController getInstance()
      Returns a Reference to the Identity instance (if there is no one yet it creates one)
      Returns:
      the Instance
    • call

      public void call(int aClickCount, String aActionCommand)
      Handles an action command without parameters, see call(int, String, Map).
      Parameters:
      aClickCount - number of clicks (only logged)
      aActionCommand - the action command
    • call

      public void call(int aClickCount, String aFunction, Map<String,Object> aParameterMap)
      Handles an action command: system.xxx runs a system action (exit, copy, settings, ...), simcomponent.class shows the fields of a SimComponent, otherwise the functionality is looked up in the system model (the start function if the command is the system id) and run with the given parameters.
      Parameters:
      aClickCount - number of clicks (only logged)
      aFunction - the action command (function or system id)
      aParameterMap - parameters for the functionality, may contain SYSTEM_ID; may be null
    • getCurrentFunctionality

      public FWAbstractFunctionality getCurrentFunctionality(String aSystemID)
      Parameters:
      aSystemID - the system id
      Returns:
      the running functionality of the system, or null
    • callChar

      public void callChar(char aKeyCommand)
      Handles a key command; currently only logged.
      Parameters:
      aKeyCommand - the key
    • callMouse

      public void callMouse(int aClickCount, Object aEventObject)
      Handles a mouse event; currently only logged.
      Parameters:
      aClickCount - number of clicks
      aEventObject - the event source
    • autostartFunction

      public void autostartFunction(String aAutostartFunction)
      Runs the autostart function of the layout or user.
      Parameters:
      aAutostartFunction - the action command
    • go

      public void go(FWAbstractFunctionality aFunctionality)
      Runs the next function of a functionality.
      Parameters:
      aFunctionality - the current functionality
    • go

      public void go(FWAbstractFunctionality aFunctionality, String aFunctionToRun)
      Runs a function of the system of a functionality with a copy of its observable.
      Parameters:
      aFunctionality - the current functionality
      aFunctionToRun - id of the function to run, or empty for the next function
    • back

      public void back(FWAbstractFunctionality aFunctionality)
      Stops a functionality and runs its previous function (if it exists).
      Parameters:
      aFunctionality - the current functionality
    • switchTo

      public void switchTo(FWAbstractFunctionality aFunctionality, String aFunctionToRun)
      Runs a function chosen by a switch point (RuleFunctionality) in the direction the switch point was reached (parameter FWAbstractFunctionality.DIRECTION), so that chained switch points keep the direction.
      Parameters:
      aFunctionality - the switch point
      aFunctionToRun - id of the function to run
    • cancel

      public void cancel(FWAbstractFunctionality aFunctionality)
      Closes the functionality of the system without closing its view, see closeFunction(String, boolean).
      Parameters:
      aFunctionality - the current functionality
    • closeFunction

      public void closeFunction(String aId, boolean aShouldCloseView)
      Stops and removes the running functionality of a system and starts its finalize function, if defined.
      Parameters:
      aId - the system id
      aShouldCloseView - true to close the view of the system as well
    • saveProblemReport

      public static void saveProblemReport()
      Shows the problem report dialog and saves a ZIP file with screenshot, log file and the current parameters to a file chosen by the user. Errors are logged.