Package org.uengine.kernel

Examples of org.uengine.kernel.And


    if( selected != null){
    //  DefaultMutableTreeNode selected = (DefaultMutableTreeNode)obj;
      DefaultMutableTreeNode newNode;
     
      if( param.equals("And")){
        newNode = new DefaultMutableTreeNode( new And());

      }else if( param.equals("Or")){
        newNode = new DefaultMutableTreeNode( new Or());

      }else{
View Full Code Here


    return newEvaluate;
  }
 
  protected Condition makeCondition( DefaultMutableTreeNode node){
   
    And andCond = null;
    Condition firstCondition;
    //Tree child = (Tree)node.getChildAt(0);
   
    if( node.isLeaf())
      return (Condition)node.getUserObject();
   
    if( node.getUserObject() instanceof And){
     
      andCond = (And)node.getUserObject();
     
      for( int i=0; i< node.getChildCount(); i++){
        andCond.addCondition( makeCondition( (DefaultMutableTreeNode)node.getChildAt( i)));
      }
     
      return andCond;
    }
   
View Full Code Here

      boolean isOtherwise = false;
     
      if(key==null)continue;
      if(!map.containsKey(key)){
        Or or = new Or();
        And and = new And();
        for(int j=START_INDEX;j<cols.size();j++){
          if(cols.get(j) instanceof Otherwise){
            isOtherwise = true;
            break;
          }else if(cols.get(j) instanceof RoleExist){
            RoleExist role = (RoleExist)cols.get(j);
            if(role!=null){
              and.addCondition(role);
            }
          }else{
            Evaluate eval = (Evaluate)cols.get(j);
            if(eval!=null){
              and.addCondition(eval);
            }
          }
        }
        if(!isOtherwise && and.getConditionsVt().size()>0){
          or.addCondition(and);
        }
       
        if(isOtherwise){
          Otherwise otherwise = new Otherwise();
          map.put(key, otherwise);
          otherwise.getDescription().setText(key);
          ors.addCondition(otherwise);
        }else{
          map.put(key, or);
          or.getDescription().setText(key);
          ors.addCondition(or);
        }

      }else{
        And and = new And();
        for(int j=START_INDEX;j<cols.size();j++){
          if(cols.get(j) instanceof Evaluate){
            Evaluate eval = (Evaluate)cols.get(j);
            if(eval!=null){
              and.addCondition(eval);
            }
          }else{
            RoleExist role = (RoleExist)cols.get(j);
            if(role!=null){
              and.addCondition(role);
            }
          }
        }
        if(and.getConditionsVt().size()>0){
          ((Or)map.get(key)).addCondition(and);
        }
       
      }
     
View Full Code Here

       
        if(condition instanceof Evaluate
            || condition instanceof Otherwise
            || condition instanceof RoleExist){//������ ��츸
          Or wrapperOr = new Or();
          And wrapperAnd = new And();
          wrapperOr.addCondition(wrapperAnd);
          wrapperOr.setDescription(condition.getDescription());
                   
          if(condition instanceof Evaluate || condition instanceof RoleExist){
            condition.setDescription(null);
            wrapperAnd.addCondition(condition);
          }else {
            wrapperAnd.addCondition(new Otherwise());
          }
           
          condition = wrapperOr;
        }
       
        Or or = (Or)condition;
        String key = or.getDescription().getText();
       
        Condition[] rows = or.getConditions();
        for(int j=0;j<rows.length;j++){
          And and = (And)rows[j];
         
          Condition[] cols = and.getConditions();
          //Default RowCount�� �Ѿ��츦 '�ؼ� Row Count�� ������� �Ѵ�.
          if(((DefaultTableModel)table.getModel()).getRowCount()<=rowNum)
            ((DefaultTableModel)table.getModel()).setRowCount(rowNum+1);
          for(int k=0;k<cols.length;k++){
            Condition cond = cols[k];
View Full Code Here

    Vector conditions = tableModel.getDataVector();

    Or or = new Or();
    for(int i=0; i<conditions.size(); i++){
      Vector theConditionRow = (Vector)conditions.get(i);
      And and = new And();
     
      for(int j=0; j<theConditionRow.size(); j++){
       
        if(theConditionRow.get(j) instanceof Evaluate){
          Evaluate evaluation = (Evaluate)theConditionRow.get(j);
          if(evaluation!=null)
            and.addCondition(evaluation);
        }else{
          RoleExist roleExist = (RoleExist)theConditionRow.get(j);
          if(roleExist!=null)
            and.addCondition(roleExist);
        }
      }
     
      if(and.getConditionsVt().size()>0){
        or.addCondition(and);
      }
    }
       
    return or;
View Full Code Here

      Or or = (Or)data;
      Condition[] rows = or.getConditions();
      ((DefaultTableModel)table.getModel()).setRowCount(rows.length+1);
     
      for(int i=0;i<rows.length;i++){
        And and = (And)rows[i];
        Condition[] cols = and.getConditions();
        for(int j=0;j<cols.length;j++){
          if(cols[j] instanceof Evaluate){
            Evaluate eval = (Evaluate)cols[j];
            table.setValueAt(eval, i, j+1);
          }else{
View Full Code Here

TOP

Related Classes of org.uengine.kernel.And

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.