コード例 #1
0
 public void handlePanelSpecificButtons(ActionEvent e) {
   if (e.getSource() == this.view.getCaptureButton()) {
     // capture button
     String currentPanelName = this.view.getCurrentPanelName();
     if (currentPanelName.equals(SmartTestingView.FACE_LOGIN_PANEL)) {
       this.model.addImageCaptured(facialThread.getFaceFromImage());
       this.view.hideFacialWindow();
     } else if (currentPanelName.equals(SmartTestingView.FACE_REGISTRATION_PANEL)) {
       if (this.model.getImagesCapturedCounter() < REQ_IMAGES_NEEDED) {
         this.model.addImageCaptured(facialThread.getFaceFromImage());
         this.view.setImagesNeededField(
             Integer.toString(REQ_IMAGES_NEEDED - this.model.getImagesCapturedCounter()));
       } else {
         this.view.hideFacialWindow();
       }
     }
   } else if (e.getSource() == this.view.getSubmitButton()) {
     // submit button
     keystrokeProc.submitButtonPressed();
   } else if (e.getSource() == this.view.getResetButton()) {
     keystrokeProc.reset();
   } else if (e.getSource() == this.view.getContinueButton()) {
     generateURL();
     openLink();
     finished = true;
     this.view.setFacialUpdaterParentClosing();
   } else if (e.getSource() == this.view.getLoginButton()) {
     loginProcess = true;
     registrationProcess = false;
     this.view.addLoginCards();
     this.view.goToNextCard();
     this.view.setCaptureButtonAL(this);
     this.view.setResetButtonAL(this);
     this.view.setContinueButtonAL(this);
     this.model.initializeFacesCapturedArray();
     this.keystrokeProc.setUserLoggingIn(true);
     this.view.setInputFieldKeyAdapter(keys);
     enableFlowButtons();
     panelChanged = true;
   } else if (e.getSource() == this.view.getRegisterButton()) {
     registrationProcess = true;
     loginProcess = false;
     this.view.addRegistrationCards();
     this.view.goToNextCard();
     this.view.setCaptureButtonAL(this);
     this.view.setResetButtonAL(this);
     this.view.setContinueButtonAL(this);
     this.model.initializeFacesCapturedArray();
     this.keystrokeProc.setUserLoggingIn(false);
     this.view.setInputFieldKeyAdapter(keys);
     enableFlowButtons();
     panelChanged = true;
   } else if (e.getSource() == this.view.getOkButton()) {
     this.view.closePopupWindow();
   }
 }