Search in sources :

Example 6 with IManualValueChangeListener

use of org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener in project yamcs-studio by yamcs.

the class ImageBoolButtonEditPart method doCreateFigure.

/**
 * {@inheritDoc}
 */
@Override
protected IFigure doCreateFigure() {
    ImageBoolButtonModel model = getWidgetModel();
    // create AND initialize the view properly
    final ImageBoolButtonFigure figure = new ImageBoolButtonFigure();
    initializeCommonFigureProperties(figure, model);
    SymbolImageProperties sip = new SymbolImageProperties();
    sip.setStretch(model.isStretch());
    sip.setAutoSize(model.isAutoSize());
    sip.setAnimationDisabled(model.isStopAnimation());
    sip.setAlignedToNearestSecond(model.isAlignedToNearestSecond());
    sip.setBackgroundColor(new Color(Display.getDefault(), model.getBackgroundColor()));
    figure.setSymbolProperties(sip, model);
    figure.setImageLoadedListener(new IImageListener() {

        @Override
        public void imageResized(IFigure figure) {
            ImageBoolButtonFigure symbolFigure = (ImageBoolButtonFigure) figure;
            autoSizeWidget(symbolFigure);
        }
    });
    figure.addManualValueChangeListener(new IManualValueChangeListener() {

        @Override
        public void manualValueChanged(double newValue) {
            if (getExecutionMode() == ExecutionMode.RUN_MODE)
                autoSizeWidget(figure);
        }
    });
    figure.setOnImagePath(model.getOnImagePath());
    figure.setOffImagePath(model.getOffImagePath());
    return figure;
}
Also used : IManualValueChangeListener(org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener) SymbolImageProperties(org.csstudio.swt.widgets.symbol.SymbolImageProperties) ImageBoolButtonModel(org.csstudio.opibuilder.widgets.model.ImageBoolButtonModel) Color(org.eclipse.swt.graphics.Color) ImageBoolButtonFigure(org.csstudio.opibuilder.widgets.figures.ImageBoolButtonFigure) IImageListener(org.csstudio.swt.widgets.symbol.util.IImageListener) IFigure(org.eclipse.draw2d.IFigure)

Example 7 with IManualValueChangeListener

use of org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener in project yamcs-studio by yamcs.

the class ScaledSliderEditPart method doCreateFigure.

/**
 * {@inheritDoc}
 */
@Override
protected IFigure doCreateFigure() {
    final ScaledSliderModel model = getWidgetModel();
    ScaledSliderFigure slider = new ScaledSliderFigure();
    initializeCommonFigureProperties(slider, model);
    slider.setFillColor(model.getFillColor());
    slider.setEffect3D(model.isEffect3D());
    slider.setFillBackgroundColor(model.getFillbackgroundColor());
    slider.setThumbColor(model.getThumbColor());
    slider.setHorizontal(model.isHorizontal());
    slider.setStepIncrement(model.getStepIncrement());
    slider.setPageIncrement(model.getPageIncrement());
    slider.addManualValueChangeListener(new IManualValueChangeListener() {

        public void manualValueChanged(double newValue) {
            if (getExecutionMode() == ExecutionMode.RUN_MODE)
                setPVValue(ScaledSliderModel.PROP_PVNAME, newValue);
        }
    });
    markAsControlPV(ScaledSliderModel.PROP_PVNAME, AbstractPVWidgetModel.PROP_PVVALUE);
    return slider;
}
Also used : IManualValueChangeListener(org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener) ScaledSliderModel(org.csstudio.opibuilder.widgets.model.ScaledSliderModel) ScaledSliderFigure(org.csstudio.swt.widgets.figures.ScaledSliderFigure)

Example 8 with IManualValueChangeListener

use of org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener in project yamcs-studio by yamcs.

the class ScrollbarEditPart method doCreateFigure.

@Override
protected IFigure doCreateFigure() {
    ScrollbarFigure scrollBar = new ScrollbarFigure();
    ScrollBarModel model = getWidgetModel();
    scrollBar.setMaximum(model.getMaximum());
    scrollBar.setMinimum(model.getMinimum());
    scrollBar.setStepIncrement(model.getStepIncrement());
    scrollBar.setPageIncrement(model.getPageIncrement());
    scrollBar.setExtent(model.getBarLength());
    scrollBar.setShowValueTip(model.isShowValueTip());
    scrollBar.setHorizontal(model.isHorizontal());
    if (getExecutionMode() == ExecutionMode.RUN_MODE) {
        scrollBar.addManualValueChangeListener(new IManualValueChangeListener() {

            public void manualValueChanged(double newValue) {
                setPVValue(ScrollBarModel.PROP_PVNAME, newValue);
            }
        });
    }
    markAsControlPV(AbstractPVWidgetModel.PROP_PVNAME, AbstractPVWidgetModel.PROP_PVVALUE);
    return scrollBar;
}
Also used : IManualValueChangeListener(org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener) ScrollBarModel(org.csstudio.opibuilder.widgets.model.ScrollBarModel) ScrollbarFigure(org.csstudio.swt.widgets.figures.ScrollbarFigure)

Example 9 with IManualValueChangeListener

use of org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener in project yamcs-studio by yamcs.

the class AbstractBoolControlFigure method fireManualValueChange.

/**
 * Inform all boolean control listeners, that the manual value has changed.
 *
 * @param newManualValue
 *            the new manual value
 */
protected void fireManualValueChange(final boolean newManualValue) {
    booleanValue = newManualValue;
    updateValue();
    if (runMode) {
        for (IManualValueChangeListener l : boolControlListeners) {
            l.manualValueChanged(value);
        }
    }
}
Also used : IManualValueChangeListener(org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener)

Example 10 with IManualValueChangeListener

use of org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener in project yamcs-studio by yamcs.

the class CheckBoxFigure method fireManualValueChange.

/**
 * Inform all boolean control listeners, that the manual value has changed.
 *
 * @param newManualValue
 *            the new manual value
 */
protected void fireManualValueChange(final boolean newManualValue) {
    boolValue = newManualValue;
    updateValue();
    for (IManualValueChangeListener l : boolControlListeners) {
        l.manualValueChanged(value);
    }
}
Also used : IManualValueChangeListener(org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener)

Aggregations

IManualValueChangeListener (org.csstudio.swt.widgets.datadefinition.IManualValueChangeListener)10 ImageBoolButtonFigure (org.csstudio.opibuilder.widgets.figures.ImageBoolButtonFigure)1 ArrayModel (org.csstudio.opibuilder.widgets.model.ArrayModel)1 ImageBoolButtonModel (org.csstudio.opibuilder.widgets.model.ImageBoolButtonModel)1 KnobModel (org.csstudio.opibuilder.widgets.model.KnobModel)1 ScaledSliderModel (org.csstudio.opibuilder.widgets.model.ScaledSliderModel)1 ScrollBarModel (org.csstudio.opibuilder.widgets.model.ScrollBarModel)1 ArrayFigure (org.csstudio.swt.widgets.figures.ArrayFigure)1 CheckBoxFigure (org.csstudio.swt.widgets.figures.CheckBoxFigure)1 ITextFigure (org.csstudio.swt.widgets.figures.ITextFigure)1 KnobFigure (org.csstudio.swt.widgets.figures.KnobFigure)1 ScaledSliderFigure (org.csstudio.swt.widgets.figures.ScaledSliderFigure)1 ScrollbarFigure (org.csstudio.swt.widgets.figures.ScrollbarFigure)1 SpinnerFigure (org.csstudio.swt.widgets.figures.SpinnerFigure)1 TextFigure (org.csstudio.swt.widgets.figures.TextFigure)1 SymbolImageProperties (org.csstudio.swt.widgets.symbol.SymbolImageProperties)1 IImageListener (org.csstudio.swt.widgets.symbol.util.IImageListener)1 IFigure (org.eclipse.draw2d.IFigure)1 Color (org.eclipse.swt.graphics.Color)1