Search in sources :

Example 1 with GraphArea

use of org.csstudio.swt.widgets.figures.IntensityGraphFigure.GraphArea in project yamcs-studio by yamcs.

the class ROIFigure method getGeoBoundsFromROI.

private PrecisionRectangle getGeoBoundsFromROI(Rectangle roiDataBounds) {
    PrecisionPoint lt = ((GraphArea) getParent()).getGeoLocation(roiDataBounds.preciseX() - intensityGraphFigure.getCropLeft(), roiDataBounds.preciseY() - intensityGraphFigure.getCropTop());
    PrecisionPoint rb = ((GraphArea) getParent()).getGeoLocation(roiDataBounds.preciseX() + roiDataBounds.preciseWidth() - intensityGraphFigure.getCropLeft(), roiDataBounds.preciseY() + roiDataBounds.preciseHeight() - intensityGraphFigure.getCropTop());
    return new PrecisionRectangle(lt.preciseX() - getBounds().x, lt.preciseY() - getBounds().y, rb.preciseX() - lt.preciseX(), rb.preciseY() - lt.preciseY());
}
Also used : PrecisionRectangle(org.eclipse.draw2d.geometry.PrecisionRectangle) PrecisionPoint(org.eclipse.draw2d.geometry.PrecisionPoint) GraphArea(org.csstudio.swt.widgets.figures.IntensityGraphFigure.GraphArea)

Example 2 with GraphArea

use of org.csstudio.swt.widgets.figures.IntensityGraphFigure.GraphArea in project yamcs-studio by yamcs.

the class ROIFigure method getROIFromGeoBounds.

private Rectangle getROIFromGeoBounds(PrecisionRectangle roiBounds) {
    PrecisionPoint lt = ((GraphArea) getParent()).getDataLocation(roiBounds.preciseX(), roiBounds.preciseY());
    PrecisionPoint rb = ((GraphArea) getParent()).getDataLocation(roiBounds.preciseX() + roiBounds.preciseWidth(), roiBounds.preciseY() + roiBounds.preciseHeight());
    return new Rectangle((int) Math.round(lt.preciseX()) + intensityGraphFigure.getCropLeft(), (int) Math.round(lt.preciseY()) + intensityGraphFigure.getCropTop(), (int) Math.ceil(rb.preciseX() - lt.preciseX()), (int) Math.ceil(rb.preciseY() - lt.preciseY()));
}
Also used : PrecisionRectangle(org.eclipse.draw2d.geometry.PrecisionRectangle) Rectangle(org.eclipse.draw2d.geometry.Rectangle) PrecisionPoint(org.eclipse.draw2d.geometry.PrecisionPoint) GraphArea(org.csstudio.swt.widgets.figures.IntensityGraphFigure.GraphArea)

Aggregations

GraphArea (org.csstudio.swt.widgets.figures.IntensityGraphFigure.GraphArea)2 PrecisionPoint (org.eclipse.draw2d.geometry.PrecisionPoint)2 PrecisionRectangle (org.eclipse.draw2d.geometry.PrecisionRectangle)2 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1