use of org.csstudio.swt.widgets.symbol.SymbolImageProperties in project yamcs-studio by yamcs.
the class ImageBoolIndicatorEditPart method doCreateFigure.
@Override
protected IFigure doCreateFigure() {
var model = getWidgetModel();
// create AND initialize the view properly
var figure = new ImageBoolButtonFigure(true);
initializeCommonFigureProperties(figure, model);
var props = new SymbolImageProperties();
props.setStretch(model.isStretch());
props.setAutoSize(model.isAutoSize());
props.setAnimationDisabled(model.isStopAnimation());
props.setAlignedToNearestSecond(model.isAlignedToNearestSecond());
props.setBackgroundColor(new Color(Display.getDefault(), model.getBackgroundColor()));
figure.setSymbolProperties(props, model);
figure.setImageLoadedListener(figure1 -> {
var symbolFigure = (ImageBoolButtonFigure) figure1;
autoSizeWidget(symbolFigure);
});
figure.setOnImagePath(model.getOnImagePath());
figure.setOffImagePath(model.getOffImagePath());
return figure;
}
use of org.csstudio.swt.widgets.symbol.SymbolImageProperties in project yamcs-studio by yamcs.
the class ImageEditPart method doCreateFigure.
@Override
protected IFigure doCreateFigure() {
var model = getWidgetModel();
// create AND initialize the view properly
var figure = new ImageFigure();
// Resize when new image is loaded
figure.setImageLoadedListener(figure1 -> {
var imageFigure = (ImageFigure) figure1;
autoSizeWidget(imageFigure);
});
// Image default parameters
var props = new SymbolImageProperties();
props.setTopCrop(model.getTopCrop());
props.setBottomCrop(model.getBottomCrop());
props.setLeftCrop(model.getLeftCrop());
props.setRightCrop(model.getRightCrop());
props.setStretch(model.getStretch());
props.setAutoSize(model.isAutoSize());
props.setMatrix(model.getPermutationMatrix());
props.setAlignedToNearestSecond(model.isAlignedToNearestSecond());
props.setBackgroundColor(new Color(Display.getDefault(), model.getBackgroundColor()));
props.setAnimationDisabled(model.isStopAnimation());
figure.setSymbolProperties(props, model);
figure.setFilePath(model.getFilename());
return figure;
}
use of org.csstudio.swt.widgets.symbol.SymbolImageProperties in project yamcs-studio by yamcs.
the class ImageBoolButtonEditPart method doCreateFigure.
@Override
protected IFigure doCreateFigure() {
var model = getWidgetModel();
// create AND initialize the view properly
var figure = new ImageBoolButtonFigure();
initializeCommonFigureProperties(figure, model);
var props = new SymbolImageProperties();
props.setStretch(model.isStretch());
props.setAutoSize(model.isAutoSize());
props.setAnimationDisabled(model.isStopAnimation());
props.setAlignedToNearestSecond(model.isAlignedToNearestSecond());
props.setBackgroundColor(new Color(Display.getDefault(), model.getBackgroundColor()));
figure.setSymbolProperties(props, model);
figure.setImageLoadedListener(figure1 -> {
var symbolFigure = (ImageBoolButtonFigure) figure1;
autoSizeWidget(symbolFigure);
});
figure.addManualValueChangeListener(newValue -> {
if (getExecutionMode() == ExecutionMode.RUN_MODE) {
autoSizeWidget(figure);
}
});
figure.setOnImagePath(model.getOnImagePath());
figure.setOffImagePath(model.getOffImagePath());
return figure;
}
Aggregations