Examples of RulePanel


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

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

    }
    // --- 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

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

  }

  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

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

      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

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

    }
  }

  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

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

  public void initRule() {
    if (this.getDocumentName() == null) {
      this.setDocumentName(this.visualRifEditor.getDocumentContainer().getNameOfActiveElement());
    }
    final RuleContainer ruleContainer = this.visualRifEditor.getRuleContainer();
    final RulePanel rp = ruleContainer.createNewRule(this.getDocumentName(),this.getRuleName());
    this.setRulePanel(rp);
    this.setRuleName(rp.getRuleName());
    this.setInitRule(true);
  }
View Full Code Here

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

    return this.rules.get(ruleName);
  }

  public RulePanel createNewRule(final String documentName){
    final String name = this.checkName("Rule", "Rule", 0);
    this.activeRule = new RulePanel(this.visualRifEditor, name);
    this.rules.put(name, this.activeRule);
    this.visualRifEditor.getTreePane().addNewRule(this.activeRule,documentName);
    this.printRules();
    final TreePath path = this.activeRule.getRulePath();
    this.visualRifEditor.getDocumentContainer().getActiveDocument().getListOfRules().add(name);
View Full Code Here

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

    return this.activeRule;
  }

  public RulePanel createNewRule(final String documentName, final String ruleName){
    final String name = this.checkName(ruleName, ruleName, 0);
    this.activeRule = new RulePanel(this.visualRifEditor, name);
    this.rules.put(name, this.activeRule);
    this.visualRifEditor.getTreePane().addNewRule(this.activeRule,documentName);
    this.printRules();
    final TreePath path = this.activeRule.getRulePath();
    this.visualRifEditor.getDocumentContainer().getActiveDocument().getListOfRules().add(name);
View Full Code Here

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

  }

  @Override
  @SuppressWarnings("unchecked")
  public void removeElement(final String elem, final TreeNode parentNode) {
    final RulePanel ret = this.rules.remove(elem);
    this.activeRule = null;
    this.visualRifEditor.setRightComponent(new JPanel());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.