Search in sources :

Example 1 with BoolButtonFigure

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;
}
Also used : BoolButtonModel(org.csstudio.opibuilder.widgets.model.BoolButtonModel) BoolButtonFigure(org.csstudio.swt.widgets.figures.BoolButtonFigure)

Example 2 with BoolButtonFigure

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);
}
Also used : IWidgetPropertyChangeHandler(org.csstudio.opibuilder.properties.IWidgetPropertyChangeHandler) BoolButtonFigure(org.csstudio.swt.widgets.figures.BoolButtonFigure) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

BoolButtonFigure (org.csstudio.swt.widgets.figures.BoolButtonFigure)2 IWidgetPropertyChangeHandler (org.csstudio.opibuilder.properties.IWidgetPropertyChangeHandler)1 BoolButtonModel (org.csstudio.opibuilder.widgets.model.BoolButtonModel)1 IFigure (org.eclipse.draw2d.IFigure)1