Package lupos.gui.operatorgraph.visualeditor.ruleeditor.operators

Examples of lupos.gui.operatorgraph.visualeditor.ruleeditor.operators.AbstractRuleOperator


    JSONObject saveObject = new JSONObject();

    JSONObject connectionsObject = new JSONObject();

    for(GraphWrapper gw : this.boxes.keySet()) {
      AbstractRuleOperator op = (AbstractRuleOperator) gw.getElement();

      saveObject.put(op.getName(), op.toJSON(connectionsObject));
    }

    if(connectionsObject.length() > 0) {
      saveObject.put("connections", connectionsObject);
    }
View Full Code Here


        continue;
      }

      JSONObject ruleOpLoadObject = loadObject.getJSONObject(ruleOpName);

      AbstractRuleOperator op;

      if(ruleOpLoadObject.has("op type") && ruleOpLoadObject.getString("op type").equals("JumpOverOperator")) {
        op = new JumpOverOperator(ruleOpName, ruleOpLoadObject);
      }
      else {
View Full Code Here

      getNextString = ".getPrecedingOperators().get(0)";

      buffer.append(spaces + this.variableList_left.get(jumpOp.getName() + "_end").assign_variable(opName));

      for(Operator tmpOp : jumpOp.getPrecedingOperators()) {
        AbstractRuleOperator tmpOp2 = (AbstractRuleOperator) tmpOp;

        if(tmpOp2.alsoSubClasses()) {
          Class<?> clazz = jumpOp.getClassType().getOpClass().getSuperclass();

          boolean moreGeneric = false;

          while(clazz != Object.class) {
            if(clazz == tmpOp2.getClassType().getOpClass()) {
              moreGeneric = true;
              break;
            }

            clazz = clazz.getSuperclass();
          }

          if(moreGeneric) {
            if(jumpOp.alsoSubClasses()) {
              condition.append("_searchIndex_" + runNumber + "_" + i + " instanceof " + jumpOp.getClassType().getOpClass().getName());
            }
            else {
              condition.append("_searchIndex_" + runNumber + "_" + i + ".getClass() == " + jumpOp.getClassType().getOpClass().getName() + ".class");
            }
          }
          else {
            condition.append("!(_searchIndex_" + runNumber + "_" + i + " instanceof " + tmpOp2.getClassType().getOpClass().getName() + ")");
          }
        }
        else {
          condition.append("_searchIndex_" + runNumber + "_" + i + ".getClass() != " + tmpOp2.getClassType().getOpClass().getName() + ".class");
        }

        condition.append(" || ");
      }
    }
    else {
      getNextString = ".getSucceedingOperators().get(0).getOperator()";

      buffer.append(spaces + this.variableList_left.get(jumpOp.getName() + "_begin").assign_variable(opName));

      for(OperatorIDTuple<Operator> tmpOp : jumpOp.getSucceedingOperators()) {
        AbstractRuleOperator tmpOp2 = (AbstractRuleOperator) tmpOp.getOperator();

        if(tmpOp2.alsoSubClasses()) {
          Class<?> clazz = jumpOp.getClassType().getOpClass().getSuperclass();

          boolean moreGeneric = false;

          while(clazz != Object.class) {
            if(clazz == tmpOp2.getClassType().getOpClass()) {
              moreGeneric = true;
              break;
            }

            clazz = clazz.getSuperclass();
          }

          if(moreGeneric) {
            if(jumpOp.alsoSubClasses()) {
              condition.append("_searchIndex_" + runNumber + "_" + i + " instanceof " + jumpOp.getClassType().getOpClass().getName());
            }
            else {
              condition.append("_searchIndex_" + runNumber + "_" + i + ".getClass() == " + jumpOp.getClassType().getOpClass().getName() + ".class");
            }
          }
          else {
            condition.append("!(_searchIndex_" + runNumber + "_" + i + " instanceof " + tmpOp2.getClassType().getOpClass().getName() + ")");
          }
        }
        else {
          condition.append("_searchIndex_" + runNumber + "_" + i + ".getClass() != " + tmpOp2.getClassType().getOpClass().getName() + ".class");
        }

        condition.append(" || ");
      }
    }
View Full Code Here

TOP

Related Classes of lupos.gui.operatorgraph.visualeditor.ruleeditor.operators.AbstractRuleOperator

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.