_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();