use of org.csstudio.swt.widgets.figures.BoolButtonFigure in project yamcs-studio by yamcs.
the class BoolButtonEditPart method doCreateFigure.
@Override
protected IFigure doCreateFigure() {
final BoolButtonModel model = getWidgetModel();
BoolButtonFigure btn = new BoolButtonFigure();
initializeCommonFigureProperties(btn, model);
btn.setEffect3D(model.isEffect3D());
btn.setSquareButton((model.isSquareButton()));
btn.setShowLED(model.isShowLED());
return btn;
}
use of org.csstudio.swt.widgets.figures.BoolButtonFigure in project yamcs-studio by yamcs.
the class BoolButtonEditPart method registerPropertyChangeHandlers.
@Override
protected void registerPropertyChangeHandlers() {
registerCommonPropertyChangeHandlers();
// effect 3D
IWidgetPropertyChangeHandler handler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(final Object oldValue, final Object newValue, final IFigure refreshableFigure) {
BoolButtonFigure btn = (BoolButtonFigure) refreshableFigure;
btn.setEffect3D((Boolean) newValue);
return true;
}
};
setPropertyChangeHandler(BoolButtonModel.PROP_EFFECT3D, handler);
// Square LED
handler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(final Object oldValue, final Object newValue, final IFigure refreshableFigure) {
BoolButtonFigure btn = (BoolButtonFigure) refreshableFigure;
btn.setSquareButton((Boolean) newValue);
return true;
}
};
setPropertyChangeHandler(BoolButtonModel.PROP_SQUARE_BUTTON, handler);
// Show LED
handler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(final Object oldValue, final Object newValue, final IFigure refreshableFigure) {
BoolButtonFigure btn = (BoolButtonFigure) refreshableFigure;
btn.setShowLED((Boolean) newValue);
return true;
}
};
setPropertyChangeHandler(BoolButtonModel.PROP_SHOW_LED, handler);
}
Aggregations