use of org.csstudio.swt.widgets.figures.EllipseFigure in project yamcs-studio by yamcs.
the class EllipseEditpart method doCreateFigure.
@Override
protected IFigure doCreateFigure() {
EllipseFigure figure = new EllipseFigure();
EllipseModel model = getWidgetModel();
figure.setFill(model.getFillLevel());
figure.setHorizontalFill(model.isHorizontalFill());
figure.setTransparent(model.isTransparent());
figure.setLineColor(model.getLineColor());
figure.setGradient(model.isGradient());
figure.setBackGradientStartColor(model.getBackgroundGradientStartColor());
figure.setForeGradientStartColor(model.getForegroundGradientStartColor());
return figure;
}
use of org.csstudio.swt.widgets.figures.EllipseFigure in project yamcs-studio by yamcs.
the class EllipseEditpart method registerPropertyChangeHandlers.
@Override
protected void registerPropertyChangeHandlers() {
super.registerPropertyChangeHandlers();
// fill
IWidgetPropertyChangeHandler fillHandler = new IWidgetPropertyChangeHandler() {
public boolean handleChange(final Object oldValue, final Object newValue, final IFigure refreshableFigure) {
EllipseFigure ellipseFigure = (EllipseFigure) refreshableFigure;
ellipseFigure.setFill((Double) newValue);
return true;
}
};
setPropertyChangeHandler(AbstractShapeModel.PROP_FILL_LEVEL, fillHandler);
// fill orientaion
IWidgetPropertyChangeHandler fillOrientHandler = new IWidgetPropertyChangeHandler() {
public boolean handleChange(final Object oldValue, final Object newValue, final IFigure refreshableFigure) {
EllipseFigure ellipseFigure = (EllipseFigure) refreshableFigure;
ellipseFigure.setHorizontalFill((Boolean) newValue);
return true;
}
};
setPropertyChangeHandler(AbstractShapeModel.PROP_HORIZONTAL_FILL, fillOrientHandler);
// transparent
IWidgetPropertyChangeHandler transparentHandler = new IWidgetPropertyChangeHandler() {
public boolean handleChange(final Object oldValue, final Object newValue, final IFigure refreshableFigure) {
EllipseFigure ellipseFigure = (EllipseFigure) refreshableFigure;
ellipseFigure.setTransparent((Boolean) newValue);
return true;
}
};
setPropertyChangeHandler(AbstractShapeModel.PROP_TRANSPARENT, transparentHandler);
// line color
IWidgetPropertyChangeHandler lineColorHandler = new IWidgetPropertyChangeHandler() {
public boolean handleChange(final Object oldValue, final Object newValue, final IFigure refreshableFigure) {
((EllipseFigure) refreshableFigure).setLineColor(((OPIColor) newValue).getSWTColor());
return true;
}
};
setPropertyChangeHandler(AbstractShapeModel.PROP_LINE_COLOR, lineColorHandler);
IWidgetPropertyChangeHandler handler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(Object oldValue, Object newValue, IFigure figure) {
((EllipseFigure) figure).setGradient((Boolean) newValue);
return false;
}
};
setPropertyChangeHandler(EllipseModel.PROP_GRADIENT, handler);
handler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(Object oldValue, Object newValue, IFigure figure) {
((EllipseFigure) figure).setBackGradientStartColor(((OPIColor) newValue).getSWTColor());
return false;
}
};
setPropertyChangeHandler(EllipseModel.PROP_BACKGROUND_GRADIENT_START_COLOR, handler);
handler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(Object oldValue, Object newValue, IFigure figure) {
((EllipseFigure) figure).setForeGradientStartColor(((OPIColor) newValue).getSWTColor());
return false;
}
};
setPropertyChangeHandler(EllipseModel.PROP_FOREGROUND_GRADIENT_START_COLOR, handler);
}
Aggregations