Search in sources :

Example 1 with SymbolImageProperties

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;
}
Also used : SymbolImageProperties(org.csstudio.swt.widgets.symbol.SymbolImageProperties) Color(org.eclipse.swt.graphics.Color) ImageBoolButtonFigure(org.csstudio.opibuilder.widgets.figures.ImageBoolButtonFigure)

Example 2 with SymbolImageProperties

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;
}
Also used : SymbolImageProperties(org.csstudio.swt.widgets.symbol.SymbolImageProperties) Color(org.eclipse.swt.graphics.Color) ImageFigure(org.csstudio.opibuilder.widgets.figures.ImageFigure)

Example 3 with SymbolImageProperties

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;
}
Also used : SymbolImageProperties(org.csstudio.swt.widgets.symbol.SymbolImageProperties) Color(org.eclipse.swt.graphics.Color) ImageBoolButtonFigure(org.csstudio.opibuilder.widgets.figures.ImageBoolButtonFigure)

Aggregations

SymbolImageProperties (org.csstudio.swt.widgets.symbol.SymbolImageProperties)3 Color (org.eclipse.swt.graphics.Color)3 ImageBoolButtonFigure (org.csstudio.opibuilder.widgets.figures.ImageBoolButtonFigure)2 ImageFigure (org.csstudio.opibuilder.widgets.figures.ImageFigure)1