示例#1
0
  public void initActivity(Activity.Panel actPanel) {

    this.actPanel = actPanel;

    if (formKeyboard.isVisible()) {
      formKeyboard.setVisible(false);
    }

    activityWithKeyboard = false;

    activityType = actPanel.getActivity().getShortClassName();

    // Clear data
    // WARNING: Avoid the use of fixed-length arrays!
    for (int i = 0; i < MAX_SCANNING_ZONES; i++) {
      zonePoints[i] = -1;
      for (int n = 0; n < MAX_POINTS_PER_ZONE; n++) {
        px[i][n] = 0;
        py[i][n] = 0;
        sll[i][n] = "";
      }
    }

    currentZone = 0; // Start scanning only buttons
    place = 0;
    oldActPanelRectangle.setBounds(0, 0, 0, 0);
    activityFinished = false;
    activityWithKeyboard = actPanel.getActivity().needsKeyboard();

    if (formKeyboard != null && activityWithKeyboard && showKeyboard && isScanning) {
      formKeyboard.isHorizontalScanning = false;
      formKeyboard.xPos = 0;
      formKeyboard.yPos = -1;
      formKeyboard.setVisible(true);
      formKeyboard.calcFrameSize();
      numberOfZones = 1;
      clickNumber = 1;
      currentZone = 1;
    }

    actPanel.calcScanPoints();

    if (autoAutoScan) {
      if (autoScanActivationTimer == null) {
        enableAutoScanTimer();
      }
    } else if (weAreAtTheStart) {
      if (autoScanOnStart) {
        enableAutoScan();
      } else if (directedScanOnStart) {
        enableDirectedScan();
      }
    }

    weAreAtTheStart = false;

    if (isAutoScanning) {
      startScanTimer();
    }
  }
示例#2
0
  /**
   * ****************************************************************************************************
   */
  public void startScanning() {

    if (actPanel != null) {
      zonePoints[0] = -1;
      zonePoints[1] = -1;
      zonePoints[2] = -1;
      if (withChangeZoneButton && formExchange != null) {
        formExchange.setVisible(true);
      }
      place = 0;
      isFirstScreen = true;
      isScanning = true;
      isAutoScanning = false;
      isDirectedScanning = false;

      actPanel.calcScanPoints();

      // WARNING: isScanning was just initialized, so it always will be "true":
      if (formKeyboard != null && activityWithKeyboard && showKeyboard && isScanning) {
        formKeyboard.isHorizontalScanning = false;
        formKeyboard.xPos = 0;
        formKeyboard.yPos = -1;
        formKeyboard.setVisible(true);
        formKeyboard.calcFrameSize();
        numberOfZones = 1;
        clickNumber = 1;
        currentZone = 1;
      }
    }
  }