public AbstractPathBoundedROI(double x, double y, double width, double height, int c, int z, int t) { super(c, z, t); this.x = x; this.y = y; this.x2 = x + width; this.y2 = y + height; ensureOrder(); }
BoundedHandleAdjuster(T roi) { this.roi = roi; bounds = new Rect(roi.getBoundsX(), roi.getBoundsY(), roi.getBoundsWidth(), roi.getBoundsHeight()); handles.clear(); for (int i = 0; i < 8; i++) handles.add(new MutablePoint(Double.NaN, Double.NaN)); // updateHandles(); }
void updateHandles() { bounds = new Rect(roi.getBoundsX(), roi.getBoundsY(), roi.getBoundsWidth(), roi.getBoundsHeight()); handles.get(TOP_LEFT).setLocation(bounds.getMinX(), bounds.getMinY()); handles.get(TOP_CENTER).setLocation(bounds.getCenterX(), bounds.getMinY()); handles.get(TOP_RIGHT).setLocation(bounds.getMaxX(), bounds.getMinY()); handles.get(CENTER_RIGHT).setLocation(bounds.getMaxX(), bounds.getCenterY()); handles.get(BOTTOM_RIGHT).setLocation(bounds.getMaxX(), bounds.getMaxY()); handles.get(BOTTOM_CENTER).setLocation(bounds.getCenterX(), bounds.getMaxY()); handles.get(BOTTOM_LEFT).setLocation(bounds.getMinX(), bounds.getMaxY()); handles.get(CENTER_LEFT).setLocation(bounds.getMinX(), bounds.getCenterY()); }