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

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


    }
  }

  private String generate_check_method(RulePanel rule) {
    ImplementationPanel rImplementationPanel = rule.getImplementationPanel();
    RuleEditorPane rRuleEditorPane = rule.getRuleEditorPane();
    String startNodeClass = "";

    this.checkMethodCode = new StringBuffer();
    this.buffers = new LinkedList<StringBuffer>();

    if(rImplementationPanel.useGeneratedJavaCode_CheckMethod()) {
      RuleOperator startNode = rRuleEditorPane.getStartNode();
      startNodeClass = startNode.getClassType().getOpClass().getName();

      this.count_private = 0;

      int maxDimension = 0;
View Full Code Here


  }

  @SuppressWarnings("unchecked")
  private void generate_replace_method(RulePanel rule, HashMap<String, VariableContainer> variableList_right) {
    ImplementationPanel rImplementationPanel = rule.getImplementationPanel();
    RuleEditorPane rRuleEditorPane = rule.getRuleEditorPane();

    this.replaceMethodCode = new StringBuffer();
    StringBuffer spaces = new StringBuffer("        ");

    if(rImplementationPanel.useGeneratedJavaCode_ReplaceMethod()) {
      VisualGraph<Operator> leftGraph = rRuleEditorPane.getVisualGraphs().get(0);
      VisualGraph<Operator> rightGraph = rRuleEditorPane.getVisualGraphs().get(1);

      HashMap<String, AbstractRuleOperator> leftOperatorsMap = this.getOperatorsMap(leftGraph);
      HashMap<String, AbstractRuleOperator> rightOperatorsMap = this.getOperatorsMap(rightGraph);

      HashSet<String> leftOperators = new HashSet<String>(leftOperatorsMap.keySet());
      HashSet<String> rightOperators = new HashSet<String>(rightOperatorsMap.keySet());

      HashSet<String> originalLeftOperators = (HashSet<String>) leftOperators.clone();

      leftOperators.removeAll(rightOperators); // determine operators which are only on the left side
      rightOperators.removeAll(originalLeftOperators); // determine operators which are only on the right side


      LinkedList<HashSet<ConnectionContainer>> connections = rRuleEditorPane.getConnections();
      HashSet<ConnectionContainer> leftConnections = connections.get(0);
      HashSet<ConnectionContainer> rightConnections = connections.get(1);

      HashSet<ConnectionContainer> originalLeftConnections = (HashSet<ConnectionContainer>) leftConnections.clone();
View Full Code Here

    Triple<Boolean, HashMap<String, VariableContainer>, HashMap<String, VariableContainer>> resultTriple = this.validatedRules.get(ruleName);

    if(resultTriple == null) {
      System.out.print(":: validating rule '" + ruleName + "'... ");

      RuleEditorPane ruleEditorPane = rule.getRuleEditorPane();
      ImplementationPanel implementationPanel = rule.getImplementationPanel();

      resultTriple = ruleEditorPane.validateGraphs();

      if(resultTriple.getFirst()) {
        if(ruleEditorPane.getVisualGraphs().get(0).isEmpty() && ruleEditorPane.getVisualGraphs().get(1).isEmpty()
            && implementationPanel.getAdditionalCheckJavaCode().isEmpty() && implementationPanel.getCheckJavaCode().isEmpty()
            && implementationPanel.getAdditonalReplaceJavaCode().isEmpty() && implementationPanel.getReplaceJavaCode().isEmpty()) {
          JOptionPane.showOptionDialog(this.editor, "The rule '" + ruleName + "' has no visual representation and no code defined.\nIt will therefore be ignored in the code generation", "Warning", JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, null, null);

          resultTriple = new Triple<Boolean, HashMap<String, VariableContainer>, HashMap<String, VariableContainer>>(false, null, null);
View Full Code Here

TOP

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

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.