Search in sources :

Example 1 with LEDModel

use of org.csstudio.opibuilder.widgets.model.LEDModel in project yamcs-studio by yamcs.

the class LEDEditPart method doCreateFigure.

@Override
protected IFigure doCreateFigure() {
    final LEDModel model = getWidgetModel();
    LEDFigure led = new LEDFigure();
    initializeCommonFigureProperties(led, model);
    led.setEffect3D(model.isEffect3D());
    led.setSquareLED(model.isSquareLED());
    return led;
}
Also used : LEDFigure(org.csstudio.swt.widgets.figures.LEDFigure) LEDModel(org.csstudio.opibuilder.widgets.model.LEDModel)

Example 2 with LEDModel

use of org.csstudio.opibuilder.widgets.model.LEDModel in project yamcs-studio by yamcs.

the class LEDEditPart method initializeCommonFigureProperties.

@Override
protected void initializeCommonFigureProperties(final AbstractBoolFigure abstractFigure, final AbstractBoolWidgetModel abstractModel) {
    super.initializeCommonFigureProperties(abstractFigure, abstractModel);
    LEDModel model = (LEDModel) abstractModel;
    LEDFigure figure = (LEDFigure) abstractFigure;
    initializeStateBulbBorderColor(model.getBulbBorderColor(), figure, model);
    initializeStateBulbBorderWidth(model.getBulbBorderWidth(), figure, model);
    initializeNStatesProperties(LEDFigure.MAX_NSTATES, model.getNStates(), figure, model);
    initializeStateFallbackLabel(null, model.getStateFallbackLabel(), figure, model);
    initializeStateFallbackColor(null, model.getStateFallbackColor(), figure, model);
    for (int state = 0; state < LEDFigure.MAX_NSTATES; state++) {
        initializeStateColor(state, null, model.getStateColor(state), figure, model);
        initializeStateLabel(state, null, model.getStateLabel(state), figure, model);
        initializeStateValue(state, 0.0, model.getStateValue(state), figure, model);
    }
}
Also used : LEDFigure(org.csstudio.swt.widgets.figures.LEDFigure) LEDModel(org.csstudio.opibuilder.widgets.model.LEDModel)

Aggregations

LEDModel (org.csstudio.opibuilder.widgets.model.LEDModel)2 LEDFigure (org.csstudio.swt.widgets.figures.LEDFigure)2