use of org.eclipse.draw2d.Orientable in project yamcs-studio by yamcs.
the class ScrollbarFigure method setDownClickable.
/**
* Sets the Clickable that represents the down arrow of the Scrollbar to <i>down</i>.
*
* @param down
* the down button
* @since 2.0
*/
public void setDownClickable(Clickable down) {
hookFocusListener(down);
if (buttonDown != null) {
remove(buttonDown);
}
buttonDown = down;
if (buttonDown != null) {
if (buttonDown instanceof Orientable)
((Orientable) buttonDown).setDirection(isHorizontal() ? Orientable.EAST : Orientable.SOUTH);
buttonDown.setFiringMethod(Clickable.REPEAT_FIRING);
buttonDown.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
stepDown();
}
});
add(buttonDown, ScrollBarLayout.DOWN_ARROW);
}
}
use of org.eclipse.draw2d.Orientable in project yamcs-studio by yamcs.
the class ScrollbarFigure method setUpClickable.
/**
* Sets the Clickable that represents the up arrow of the Scrollbar to <i>up</i>.
*
* @param up
* the up button
* @since 2.0
*/
public void setUpClickable(Clickable up) {
hookFocusListener(up);
if (buttonUp != null) {
remove(buttonUp);
}
buttonUp = up;
if (up != null) {
if (up instanceof Orientable)
((Orientable) up).setDirection(isHorizontal() ? Orientable.WEST : Orientable.NORTH);
buttonUp.setFiringMethod(Clickable.REPEAT_FIRING);
buttonUp.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
stepUp();
}
});
add(buttonUp, ScrollBarLayout.UP_ARROW);
}
}
Aggregations