示例#1
0
  @Override
  public void mouseClicked(MouseEvent e) {
    if (e.getClickCount() == 1 && !e.isPopupTrigger()) {
      EStoryState nextState = null; // mCurrentState;
      boolean matchingStateFound = false;
      for (SelectStateAction action : _actionList) {
        if (action.mStoryState == mCurrentState) {
          matchingStateFound = true;
        } else if (matchingStateFound) {
          nextState = action.mStoryState; // will never be null, since that is always the first one
          break;
        }
      }
      if (matchingStateFound && nextState == null) {
        // at the end, so select first.
        if (_includeNull && _actionList.size() > 1) {
          nextState = _actionList.get(1).mStoryState;
        } else if (!_includeNull && _actionList.size() > 0) {
          nextState = _actionList.get(0).mStoryState;
        }
      }

      if (nextState != null) {
        setStoryState(nextState);
      }
    }
    super.mouseClicked(e);
  }
示例#2
0
 @Override
 public void mousePressed(MouseEvent e) {
   doPopup(e);
   super.mousePressed(e);
 }