예제 #1
0
 /*
  * @see org.tigris.gef.presentation.Fig#makeSelection()
  */
 @Override
 public Selection makeSelection() {
   Object pstate = getOwner();
   Selection sel = null;
   if (pstate != null) {
     if (Model.getFacade()
         .isAActivityGraph(
             Model.getFacade().getStateMachine(Model.getFacade().getContainer(pstate)))) {
       sel = new SelectionActionState(this);
       ((SelectionActionState) sel).setOutgoingButtonEnabled(false);
     }
     // #if defined(STATEDIAGRAM)
     // @#$LPS-STATEDIAGRAM:GranularityType:Statement
     // @#$LPS-STATEDIAGRAM:Localization:NestedStatement
     // @#$LPS-STATEDIAGRAM:Localization:NestedIfdef-ACTIVITYDIAGRAM
     else {
       sel = new SelectionState(this);
       ((SelectionState) sel).setOutgoingButtonEnabled(false);
     }
     // #endif
   }
   return sel;
 }
예제 #2
0
파일: MoveAND.java 프로젝트: CollabLab/DiET
  public boolean isMoveOK(Participant origin, SelectionState ss, long timeOfReceipt) {
    if (Debug.debugREACT) {
      System.err.println("@SEARCHINGTHROUGHAND:");
      System.err.println("@MOSTRECENTPARTICIPANT:" + origin.getUsername());
      System.err.println("@PA:" + pA.getUsername());
      System.err.println("@PB:" + pB.getUsername());
      System.err.println("@MOSTRECENTSELECTIONA:" + ss.getpAMostRecentSelection());
      System.err.println("@MOSTRECENTSELECTIONB:" + ss.getpBMostRecentSelection());
      System.err.println("@ASELECTIONTIME: " + this.aSelectionTime);
      System.err.println("@BSELECTIONTIME: " + this.bSelectionTime);
    }

    if (aSelectionTime == 0 && bSelectionTime == 0) {
      if (origin == pA && ss.getpAMostRecentSelection().equalsIgnoreCase(a) && !ss.pBPressed) {
        aSelectionTime = timeOfReceipt;
        return true;
      }
      if (origin == pB && ss.getpBMostRecentSelection().equalsIgnoreCase(b) && !ss.pAPressed) {
        bSelectionTime = timeOfReceipt;
        return true;
      }
    } else {
      if (aSelectionTime == 0 && bSelectionTime != 0) {
        if (origin == pA) {
          if (ss.getpAMostRecentSelection().equalsIgnoreCase(a)) {
            if (ss.pBPressed) {
              aSelectionTime = new Date().getTime();
              this.isComplete = true;
              return true;
            } else {
              System.err.println("###BISNOTPRESSED");
            }
          } else {
            System.err.println(
                "###MOSTRECENTSELECTIONISNOT " + a + "...." + ss.getpAMostRecentSelection());
          }
        } else {
          System.err.println("###MOSTRECENTPARTICIPANTISNOT " + pA);
        }
      } else {
        System.err.println("###ASELECTIONTIMEISNT ");
      }

      if (bSelectionTime == 0 && aSelectionTime != 0) {
        if (origin == pB) {
          if (ss.getpBMostRecentSelection().equalsIgnoreCase(b)) {
            if (ss.pAPressed) {
              bSelectionTime = new Date().getTime();
              this.isComplete = true;
              return true;
            } else {
              System.err.println("$$###BISNOTPRESSED");
            }
          } else {
            System.err.println(
                "$$$###MOSTRECENTSELECTIONISNOT " + a + "...." + ss.getpAMostRecentSelection());
          }
        } else {
          System.err.println("$$$###MOSTRECENTPARTICIPANTISNOT " + pA);
        }
      } else {
        System.err.println("$$###ASELECTIONTIMEISNT ");
      }
    }

    /*   else{    //Second half here...second half must be done while first half is pressed
        if(aSelectionTime==0&& ss.mostRecentParticipant==g.rtc.pA && ss.pAMostRecentSelection.equalsIgnoreCase(a)&&ss.pBPressed){
              aSelectionTime = new Date().getTime();
              this.isComplete=true;
              return true;
        }
        if(bSelectionTime==0&& ss.mostRecentParticipant==g.rtc.pB && ss.pAMostRecentSelection.equalsIgnoreCase(b)&&ss.pAPressed){
              bSelectionTime = new Date().getTime();
              this.isComplete=true;
              return true;
        }
    }*/
    // System.exit(-234);
    return false;
  }
예제 #3
0
 void iterateState() {
   setState(state.next());
 }