use of org.eclipse.draw2d.FocusListener in project yamcs-studio by yamcs.
the class ScrollbarFigure method initializeListeners.
/**
*/
private void initializeListeners() {
addKeyListener(new KeyListener() {
@Override
public void keyPressed(KeyEvent ke) {
if ((ke.keycode == SWT.ARROW_UP && !isHorizontal()) || (ke.keycode == SWT.ARROW_LEFT && isHorizontal()))
stepUp();
else if ((ke.keycode == SWT.ARROW_DOWN && !isHorizontal()) || (ke.keycode == SWT.ARROW_RIGHT && isHorizontal()))
stepDown();
else if ((ke.keycode == SWT.PAGE_DOWN && !isHorizontal()) || (ke.keycode == SWT.PAGE_UP && isHorizontal()))
pageDown();
else if ((ke.keycode == SWT.PAGE_UP && !isHorizontal()) || (ke.keycode == SWT.PAGE_DOWN && isHorizontal()))
pageUp();
}
@Override
public void keyReleased(KeyEvent ke) {
}
});
addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent fe) {
repaint();
}
@Override
public void focusLost(FocusEvent fe) {
repaint();
}
});
}
Aggregations