Search in sources :

Example 6 with AbstractPolyModel

use of org.csstudio.opibuilder.widgets.model.AbstractPolyModel in project yamcs-studio by yamcs.

the class AbstractPolyFeedbackFactory method createDragSourceFeedbackFigure.

/**
 * {@inheritDoc}
 */
@Override
public final IFigure createDragSourceFeedbackFigure(final AbstractWidgetModel model, final Rectangle initalBounds) {
    assert model != null;
    // $NON-NLS-1$
    assert model instanceof AbstractPolyModel : "model instanceof AbstractPolyModel";
    assert initalBounds != null;
    // get the points from the model
    AbstractPolyModel abstractPolyElement = (AbstractPolyModel) model;
    PointList points = abstractPolyElement.getPoints();
    // create feedbackfigure
    // RectangleWithPolyLineFigure r = new
    // RectangleWithPolyLineFigure(points);
    PolyFeedbackFigureWithRectangle feedbackFigure = new PolyFeedbackFigureWithRectangle(createFeedbackFigure(), points);
    return feedbackFigure;
}
Also used : AbstractPolyModel(org.csstudio.opibuilder.widgets.model.AbstractPolyModel) PointList(org.eclipse.draw2d.geometry.PointList)

Aggregations

AbstractPolyModel (org.csstudio.opibuilder.widgets.model.AbstractPolyModel)6 PointList (org.eclipse.draw2d.geometry.PointList)5 ArrayList (java.util.ArrayList)1 PrecisionRectangle (org.eclipse.draw2d.geometry.PrecisionRectangle)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 Handle (org.eclipse.gef.Handle)1 ChangeBoundsRequest (org.eclipse.gef.requests.ChangeBoundsRequest)1