Package charva.awt.event

Examples of charva.awt.event.ScrollEvent


  Toolkit term = Toolkit.getDefaultToolkit();
  EventQueue evtqueue = term.getSystemEventQueue();

  // First scroll the list DOWN so that index 0 is visible.
  evtqueue.postEvent(
          new ScrollEvent(this, ScrollEvent.DOWN,
    new Point(0, 0)));

  // Then (if necessary) scroll it UP so that the specified index
  // is not below the bottom of the viewport.
  evtqueue.postEvent(
          new ScrollEvent(this, ScrollEvent.UP,
    new Point(0, index_)));
    }
View Full Code Here


     */
    if (_currentRow >= _listModel.getSize() -1)
        return;

    evtqueue.postEvent(
        new ScrollEvent(this, ScrollEvent.UP,
      new Point(0, ++_currentRow)));
    break;

      case KeyEvent.VK_PAGE_DOWN:
    _currentRow += _visibleRows;
    if (_currentRow >= _listModel.getSize())
        _currentRow = _listModel.getSize() -1;

    evtqueue.postEvent(
        new ScrollEvent(this, ScrollEvent.UP,
      new Point(0, _currentRow)));
    break;

      case KeyEvent.VK_END:
    _currentRow = _listModel.getSize() - 1;
    evtqueue.postEvent(new ScrollEvent(
            this, ScrollEvent.UP, new Point(0, _currentRow)));
    break;

      case KeyEvent.VK_UP:
    /* If we are already at the top of the list, ignore
     * this keystroke.
     */
    if (_currentRow < 1)
        return;

    evtqueue.postEvent(new ScrollEvent(
            this, ScrollEvent.DOWN, new Point(0, --_currentRow)));
    break;

      case KeyEvent.VK_PAGE_UP:
    _currentRow -= _visibleRows;
    if (_currentRow < 0)
        _currentRow = 0;

    evtqueue.postEvent(new ScrollEvent(this, ScrollEvent.DOWN,
      new Point(0, _currentRow)));
    break;

      case KeyEvent.VK_ENTER:
    _doSelect();
View Full Code Here

        toolkit.setCursor( origin );

        StringBuffer charBuffer = new StringBuffer();
        /* Scan through the entire document, drawing each character in it.
         */
        ScrollEvent scrollevent = null;
        int row = 0, col = 0;
        // outerloop:
            for( int i = 0; i < super._document.length(); i++ ) {

                /* At some point during the scan of the document, the
View Full Code Here

            }
            else {
                direction = ScrollEvent.RIGHT;
            }
        }
        return new ScrollEvent( this, direction, col_row_ );

    }
View Full Code Here

    _currentRow--;
    int x=0;
    for (int i=0; i<_currentColumn; i++)
        x += getColumnWidth(i) + 1;
    evtqueue.postEvent(
        new ScrollEvent(this, ScrollEvent.DOWN,
      new Point(x, _currentRow+1)));
      }
  }
  else if (key == KeyEvent.VK_DOWN) {
      if (_currentRow == _model.getRowCount() - 1)
    term.beep();
      else {
    _currentRow++;
    int x=0;
    for (int i=0; i<_currentColumn; i++)
        x += getColumnWidth(i) + 1;
    evtqueue.postEvent(
        new ScrollEvent(this, ScrollEvent.UP,
      new Point(x, _currentRow+2)));
      }
  }
  else if (key == KeyEvent.VK_LEFT) {
      if (_currentColumn == 0)
    term.beep();
      else {
    _currentColumn--;
    int x=0;
    for (int i=0; i<_currentColumn; i++)
        x += getColumnWidth(i) + 1;
    evtqueue.postEvent(
        new ScrollEvent(this, ScrollEvent.RIGHT,
      new Point(x, _currentRow)));
      }
  }
  else if (key == KeyEvent.VK_RIGHT) {
      if (_currentColumn == _model.getColumnCount() - 1)
    term.beep();
      else {
    _currentColumn++;
    int x=0;
    for (int i=0; i<=_currentColumn; i++)
        x += getColumnWidth(i) + 1;
    evtqueue.postEvent(
        new ScrollEvent(this, ScrollEvent.LEFT,
      new Point(x, _currentRow)));
      }
  }
  else if (key == KeyEvent.VK_HOME) {
      int x=0;
      for (int i=0; i<_currentColumn; i++)
    x += getColumnWidth(i) + 1;
      evtqueue.postEvent(
        new ScrollEvent(this, ScrollEvent.RIGHT,
      new Point(x, _currentRow)));
  }
  else if (key == KeyEvent.VK_END) {
      int x=0;
      for (int i=0; i<=_currentColumn; i++)
    x += getColumnWidth(i) + 1;
      evtqueue.postEvent(
        new ScrollEvent(this, ScrollEvent.LEFT,
      new Point(x, _currentRow)));
  }
  else if (key == KeyEvent.VK_ENTER) {
      if (getColumnSelectionAllowed())
    selectCurrentColumn();
View Full Code Here

                    int sri = setData(s, "/" + n);
                    int dir = _currentRow < sri ? ScrollEvent.UP : ScrollEvent.DOWN;
                    if (sri > -1)
                        _currentRow = sri;
                    setSelectedIndex(_currentRow);
                    evtqueue.postEvent(new ScrollEvent(this, dir, new Point(0, _currentRow)));
                    ke.consume();
                } else if (keyCode == KeyEvent.VK_HOME) {
                    _currentRow = 0;
                    evtqueue.postEvent(new ScrollEvent(
                        this, ScrollEvent.DOWN, new Point(0, _currentRow)));
                }
                super.processKeyEvent(ke);
                if (keyCode == KeyEvent.VK_UP ||
                    keyCode == KeyEvent.VK_DOWN ||
View Full Code Here

                    }
                    int dir = _currentRow < index ? ScrollEvent.UP : ScrollEvent.DOWN;
                    _currentRow = index;
                    setSelectedIndex(_currentRow);
                    Toolkit.getDefaultToolkit().getSystemEventQueue().
                        postEvent(new ScrollEvent(this, dir, new Point(0, _currentRow)));
                }
            }
View Full Code Here

TOP

Related Classes of charva.awt.event.ScrollEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.