Package swifu.main

Examples of swifu.main.FunctionManager


    }
   
   

    private void setUpFunctions(Registry paneRegistry) {
        FunctionManager functionManager = new FunctionManager(this);

        try {
            RulesetFunctionLoader.addFunctions(functionManager,
                    paneRegistry.toSwifuRegistry()
                    .getRuleset("scenarioEditorInfoPaneManager")
                    .getSection("functions"));
        } catch (InvalidInputEventException iiee) {
            CivQuest.showErrorQuitDialog("Input-event " + iiee.getEvent()
                    + " (assigned to function " + iiee.getFunction()
                    + ") has invalid syntax!", iiee);
        } catch (NoSuchFunctionActionException nsfae) {
            CivQuest.showErrorQuitDialog("Nothing known about function "
                    + nsfae.getFunction(), nsfae);
        } catch (InvalidParameterException ipe) {
            CivQuest.showErrorQuitDialog("There is a problem with the "
                    + "parameters", ipe);
        } catch (InvalidRulesetException ire) {
            CivQuest.showErrorQuitDialog("The structure of the " +
                    "ruleset-section specifying the functions is invalid!",
                    ire);
        }

        functionManager.activateAllFunctions(this.mainMapView);
    }
View Full Code Here


    }
  }

  void setUpFunctions(Registry quadRegistry) throws RulesetException {
    Messages messages = Messages.getMessages();
    FunctionManager functionManager = quadMap.getFunctionManager();

    QuadMap.Mode mode = quadMap.getMode();
    String functionSection = null;
    switch (mode) {
    case GAME:
      functionSection = "game";
      break;
    case SCENARIO:
      functionSection = "scenario";
      break;
    }

     try {
      // Set up functions defined by quadMap itself
      RulesetFunctionLoader.addFunctions(functionManager,
                         quadRegistry.toSwifuRegistry().
                         getRuleset("functions").
                         getSection(functionSection));
     } catch (InvalidInputEventException e) {
       messages.err("QuadMap.Config", "civquest.swing.quadmap.Configuration.load says: ");
       messages.err("QuadMap.Config", "Input-event " + e.getEvent() + " (assigned to"
             + " function " + e.getFunction() + ") has "
             + "invalid syntax!");
       messages.err("QuadMap.Config", "===> CivQuest will abort now!");
       System.exit(-1);      
     } catch (NoSuchFunctionActionException e) {
       messages.err("QuadMap.Config", "civquest.swing.quadmap.Configuration.load says: ");
      messages.err("QuadMap.Config", "Nothing known about function " + e.getFunction());
       messages.err("QuadMap.Config", "===> CivQuest will abort now!");
       System.exit(-1);     
    } catch (InvalidParameterException e) {
       messages.err("QuadMap.Config", "civquest.swing.quadmap.Configuration.load says: ");
      messages.err("QuadMap.Config", "There is a problem with the parameters: "
             + e.getMessage());
       messages.err("QuadMap.Config", "===> CivQuest will abort now!");
       System.exit(-1);     
    } catch (InvalidRulesetException e) {
       messages.err("QuadMap.Config", "civquest.swing.quadmap.Configuration.load says: ");
      messages.err("QuadMap.Config", "The structure of the ruleset-section specifying " +
             "the functions is invalid!");
      messages.err("QuadMap.Config", "Reason: " + e);
       messages.err("QuadMap.Config", "===> CivQuest will abort now!");
       System.exit(-1);
    } catch (FunctionException e) {
      // All exceptions that can occur at this time (2004-09-13) are catched above -
      // this catch-block is necessary because of the interface-declaration
      messages.err("QuadMap.Config", "civquest.swing.quadmap.Configuration.load says: ");
      messages.err("QuadMap.Config", "Some error occured: " + e);
       messages.err("QuadMap.Config", "===> CivQuest will abort now!");
       System.exit(-1);     
    }


    functionManager.activateAllFunctions(quadMap);
  }
View Full Code Here

TOP

Related Classes of swifu.main.FunctionManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.