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;
}
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;
}
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;
}
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);
}
}
}
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);
}
}
Aggregations