Search in sources :

Example 1 with BoolSwitchFigure

use of org.csstudio.swt.widgets.figures.BoolSwitchFigure in project yamcs-studio by yamcs.

the class BoolSwitchEditPart method doCreateFigure.

@Override
protected IFigure doCreateFigure() {
    final BoolSwitchModel model = getWidgetModel();
    BoolSwitchFigure boolSwitch = new BoolSwitchFigure();
    initializeCommonFigureProperties(boolSwitch, model);
    boolSwitch.setEffect3D(model.isEffect3D());
    return boolSwitch;
}
Also used : BoolSwitchFigure(org.csstudio.swt.widgets.figures.BoolSwitchFigure) BoolSwitchModel(org.csstudio.opibuilder.widgets.model.BoolSwitchModel)

Example 2 with BoolSwitchFigure

use of org.csstudio.swt.widgets.figures.BoolSwitchFigure in project yamcs-studio by yamcs.

the class BoolSwitchEditPart 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) {
            BoolSwitchFigure boolSwitch = (BoolSwitchFigure) refreshableFigure;
            boolSwitch.setEffect3D((Boolean) newValue);
            return true;
        }
    };
    setPropertyChangeHandler(BoolSwitchModel.PROP_EFFECT3D, handler);
}
Also used : BoolSwitchFigure(org.csstudio.swt.widgets.figures.BoolSwitchFigure) IWidgetPropertyChangeHandler(org.csstudio.opibuilder.properties.IWidgetPropertyChangeHandler) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

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