Package lupos.gui.operatorgraph.visualeditor.ruleeditor.guielements

Examples of lupos.gui.operatorgraph.visualeditor.ruleeditor.guielements.RulePanel


    // create JMenuITem to add new Rule...
    JMenuItem newRuleMI = new JMenuItem("New Rule");
    newRuleMI.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent ae) {
        RulePanel newRule = that.ruleContainer.createNewRule();
        that.treePane.addNewRule(newRule);
        that.setRightComponent(newRule);
        that.editRuleMenu.setEnabled(true);
        that.generationMenu.setEnabled(true);
      }
View Full Code Here


    }
    // --- rule package description frames - end ---

    // --- rule description frames - begin ---
    for(JTabbedPane rulePane : this.sortElementsRules(this.editor.getRules())) {
      RulePanel rule = (RulePanel) rulePane;
      String ruleName = rule.toString();
      String ruleLink = ruleName.replaceAll(" ", "").toLowerCase() + "Rule.html";
      title = "Rule " + ruleName;

      System.out.println(":: generating " + ruleLink + "...");

      formattedNavi = String.format(this.ruleFrameNavigation.toString(), ruleLink , ruleLink);

      String content = rule.getDocumentationPanel().getContent(this.targetDirectory, null);

      File.writeFile(this.targetDirectory + ruleLink, String.format(this.getTemplate("ruleFrame"), title, title, ruleFrameHeader, formattedNavi, title, content, formattedNavi));
    }
    // --- rule description frames - end ---
View Full Code Here

  }

  public RulePanel createNewRule() {
    String name = this.checkName("new rule", "new rule", 0);

    this.activeRule = new RulePanel(this.editor, name);
    this.rules.put(name, this.activeRule);

    return this.activeRule;
  }
View Full Code Here

      System.out.println(":: loading rule '" + ruleName + "'...");

      ruleName = this.checkName(ruleName, ruleName, 0);

      this.activeRule = new RulePanel(this.editor, ruleName, loadObject.getJSONObject(ruleName));
      this.rules.put(ruleName, this.activeRule);

      this.editor.getTreePane().addNewRule(this.activeRule);
      this.editor.setRightComponent(this.activeRule);
    }
View Full Code Here

    }
  }

  private void generate_rules() {
    for(JTabbedPane rulePane : this.editor.getRules()) {
      RulePanel rule = (RulePanel) rulePane;
      String ruleClassName = this.capitalizeWord(rule.toString().replaceAll(" ", "") + "Rule");
      String ruleClassFileName = ruleClassName + ".java";
      ImplementationPanel rImplementationPanel = rule.getImplementationPanel();

      // -- validating rule - begin --
      Triple<Boolean, HashMap<String, VariableContainer>, HashMap<String, VariableContainer>> resultTriple = this.validateRule(ruleClassName, rule);

      if(!resultTriple.getFirst()) {
        continue;
      }
      // -- validating rule - end --

      System.out.println(":: generating " + ruleClassFileName + "...");

      this.variableList_left = resultTriple.getSecond();
      this.globalCode = new StringBuffer(this.formatCode(rImplementationPanel.getAdditionalGlobalJavaCode(), "    ") + "\n");
      String additionalImportDeclarations = rImplementationPanel.getAdditionalImportDeclarations()+"\n";

      String startNodeClass = this.generate_check_method(rule);
      this.generate_replace_method(rule, resultTriple.getThird());

      String javaCode = String.format(this.getTemplate("ruleClass"), this.packageName, additionalImportDeclarations, ruleClassName, this.globalCode.toString(), ruleClassName, startNodeClass, rule.toString(), this.checkMethodCode.toString(), this.replaceMethodCode.toString());

      File.writeFile(this.targetDirectory + ruleClassFileName, javaCode);
    }
  }
View Full Code Here

TOP

Related Classes of lupos.gui.operatorgraph.visualeditor.ruleeditor.guielements.RulePanel

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.