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

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


    // create JMenuITem to add new RulePackage...
    JMenuItem newRulePackageMI = new JMenuItem("New Rule Package");
    newRulePackageMI.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent ae) {
        RulePackagePanel newRulePackage = that.rulePackageContainer.createNewRulePackage();
        that.treePane.addNewRulePackage(newRulePackage);
        that.setRightComponent(newRulePackage);
        that.editRuleMenu.setEnabled(true);
        that.generationMenu.setEnabled(true);
      }
View Full Code Here


    System.out.println(":: generating packagesOverviewFrame.html...");

    StringBuffer rulePackageLinks = new StringBuffer();

    for(JTabbedPane rulePackagePane : this.sortElementsRulePackages(this.editor.getRulePackages())) {
      RulePackagePanel rulePackage = (RulePackagePanel) rulePackagePane;
      String rulePackageName = rulePackage.toString();
      String rulePackageLink = rulePackageName.replaceAll(" ", "").toLowerCase();
      DocumentationPanel rPDocumentationPanel = rulePackage.getDocumentationPanel();

      rulePackageLinks.append("<a href=\"" + rulePackageLink + "OverviewFrame.html\" target=\"rulesOverviewFrame\">" + rulePackageName + "</a><br>\n");

      // --- rules overview frames - begin ---
      JTabbedPane[] associatedRulePackages = this.sortElementsRules(rulePackage.getAssociatedRules());
      this.rulePackageAssociations.put(rulePackageName, associatedRulePackages);
      this.generateRulesOverviewFrame(rulePackageName, associatedRulePackages);
      // --- rules overview frames - end ---

      this.ruleFrameNavigation.append(" - <a href=\"" + rulePackageLink + "PackageDescription.html\">" + rulePackageName + "</a>");

      this.allRules_content.append("<h2>Rule Package <a href=\"" + rulePackageLink + "PackageDescription.html\">" + rulePackageName + "</a></h2>\n");
      this.allRules_content.append(rPDocumentationPanel.getShortDescription());
    }

    File.writeFile(this.targetDirectory + "packagesOverviewFrame.html", String.format(this.getTemplate("packagesOverviewFrame"), rulePackageLinks.toString()));

    this.ruleFrameNavigation.append("</td><td align=\"right\"><a href=\"index.html?%s\" target=\"_top\">FRAMES</a> - <a href=\"%s\" target=\"_top\">NO FRAMES</a></td></tr></table>");
    // --- package overview frame - end ---

    // --- all rules overview frame - begin ---
    this.generateRulesOverviewFrame("All Rules", this.sortElementsRules(this.editor.getRules()));
    // --- all rules overview frame - end ---

    // --- packages description frame - begin ---
    System.out.println(":: generating packagesDescriptionFrame.html...");

    String title = "All Rule Packages";

    String formattedNavi = String.format(this.ruleFrameNavigation.toString(), "packagesDescriptionFrame.html", "packagesDescriptionFrame.html");

    File.writeFile(this.targetDirectory + "packagesDescriptionFrame.html", String.format(this.getTemplate("ruleFrame"), title, title, ruleFrameHeader, formattedNavi, title, this.allRules_content.toString(), formattedNavi));
    // --- packages description frame - end ---

    // --- rule package description frames - begin ---
    for(JTabbedPane rulePackagePane : this.sortElementsRulePackages(this.editor.getRulePackages())) {
      RulePackagePanel rulePackage = (RulePackagePanel) rulePackagePane;
      String rulePackageName = rulePackage.toString();
      String rulePackageLink = rulePackageName.replaceAll(" ", "").toLowerCase() + "PackageDescription.html";
      title = "Rule Package " + rulePackageName;

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

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

      String content = rulePackage.getDocumentationPanel().getContent(this.targetDirectory, this.rulePackageAssociations.get(rulePackageName));

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

  }

  public RulePackagePanel createNewRulePackage() {
    String name = this.checkName("new rule package", "new rule package", 0);

    this.activeRulePackage = new RulePackagePanel(this.editor, name);
    this.rulePackages.put(name, this.activeRulePackage);

    return this.activeRulePackage;
  }
View Full Code Here

    this.editor.setRightComponent(this.activeRulePackage);
  }

  @SuppressWarnings("unchecked")
  public void removeElement(String elem, TreeNode parentNode) {
    RulePackagePanel ret = this.rulePackages.remove(elem);

    if(ret == null) {
      this.editor.getAssociationsContainer().remove(parentNode.getUserObject().toString(), elem);
    }
    else {
View Full Code Here

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

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

      this.activeRulePackage = new RulePackagePanel(this.editor, rulePackageName, loadObject.getJSONObject(rulePackageName));
      this.rulePackages.put(rulePackageName, this.activeRulePackage);

      this.editor.getTreePane().addNewRulePackage(this.activeRulePackage);
    }
View Full Code Here

  private void generate_rule_packages() {
    String rulePackageBaseClassName = (this.generateStartMap) ? "RulePackageWithStartNodeMap" : "RulePackage";

    for(JTabbedPane rulePackagePane : this.editor.getRulePackages()) {
      RulePackagePanel rulePackage = (RulePackagePanel) rulePackagePane;
      String rulePackageName = rulePackage.toString();
      String rulePackageClassName = this.capitalizeWord(rulePackageName.replaceAll(" ", "") + "RulePackage");
      String rulePackageClassFileName = rulePackageClassName + ".java";
      RuleContainer ruleContainer = this.editor.getRuleContainer();

      System.out.println(":: generating " + rulePackageClassFileName + "...");
View Full Code Here

TOP

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

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.