Example #1
0
  /** Return the state upon which the given x and y coordinates are placed */
  private StateInterval findState(int x, int y) {
    int dIndex = y / eachDispHt;

    if (((Integer) dtypeV.elementAt(dIndex)).intValue() != CONST.TIMELINES) return null;

    int index = findIndex(y % eachDispHt);

    y = y % eachDispHt;

    if (index != -1) {
      StateGroup currProc = (StateGroup) (all_states.visible.elementAt(index));
      if (currProc.dispStatus) {
        Enumeration e = currProc.elements();
        while (e.hasMoreElements()) {
          StateInterval currState = (StateInterval) e.nextElement();
          // Determining using position (less accurate)
          if (currState.info.stateDef.checkbox.isSelected()
              && (getEvtXCord(currState.info.begT - currImg.begT) <= cursorPos)
              && (cursorPos <= getEvtXCord(currState.info.endT - currImg.begT))
              && checkLevel(currState, y)) return currState;
        }
      }
    }
    return null;
  }