use of org.csstudio.swt.widgets.figures.ArcFigure in project yamcs-studio by yamcs.
the class ArcEditpart method registerPropertyChangeHandlers.
@Override
protected void registerPropertyChangeHandlers() {
super.registerPropertyChangeHandlers();
// fill
IWidgetPropertyChangeHandler fillHandler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(final Object oldValue, final Object newValue, final IFigure refreshableFigure) {
ArcFigure figure = (ArcFigure) refreshableFigure;
figure.setFill((Boolean) newValue);
return true;
}
};
setPropertyChangeHandler(ArcModel.PROP_FILL, fillHandler);
// start angle
IWidgetPropertyChangeHandler startAngleHandler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(final Object oldValue, final Object newValue, final IFigure refreshableFigure) {
ArcFigure figure = (ArcFigure) refreshableFigure;
figure.setStartAngle((Integer) newValue);
return true;
}
};
setPropertyChangeHandler(ArcModel.PROP_START_ANGLE, startAngleHandler);
// total angle
IWidgetPropertyChangeHandler totalAngleHandler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(final Object oldValue, final Object newValue, final IFigure refreshableFigure) {
ArcFigure figure = (ArcFigure) refreshableFigure;
figure.setTotalAngle((Integer) newValue);
return true;
}
};
setPropertyChangeHandler(ArcModel.PROP_TOTAL_ANGLE, totalAngleHandler);
}
use of org.csstudio.swt.widgets.figures.ArcFigure in project yamcs-studio by yamcs.
the class ArcEditpart method doCreateFigure.
@Override
protected IFigure doCreateFigure() {
ArcFigure figure = new ArcFigure();
ArcModel model = getWidgetModel();
figure.setFill(model.isFill());
figure.setStartAngle(model.getStartAngle());
figure.setTotalAngle(model.getTotalAngle());
return figure;
}
Aggregations