Пример #1
0
    private void previousLine() {
      if (lines == null || currentLine == null) {
        return;
      }

      int index = lines.indexOf(currentLine);

      if (index == -1) {
        return;
      }

      index--;

      if (index < 0) {
        index = lines.size() - 1;
      }

      currentLine = (Line) lines.get(index);
      updateLabel();
      fireLineSelection();
    }
Пример #2
0
    private void nextLine() {
      if (lines == null || currentLine == null) {
        return;
      }

      int index = lines.indexOf(currentLine);

      if (index == -1) {
        return;
      }

      index++;

      if (index >= lines.size()) {
        index = 0;
      }

      currentLine = (Line) lines.get(index);
      updateLabel();
      fireLineSelection();
    }