public Rectangle2D getBounds2D() { Rectangle2D rectangle = null; for (Iterator i = shapes.iterator(); i.hasNext();) { Shape shape = (Shape) i.next(); if (rectangle == null) { rectangle = shape.getBounds2D(); } else { rectangle.add(shape.getBounds2D()); } } return rectangle; }
public Rectangle2D getBounds(Iterable<?> objects) { Rectangle2D r = new Rectangle2D.Double(); for (Object o : objects) { if (o instanceof Grob) { r.add(((Grob) o).getBounds().getRectangle2D()); } } return r; }
public static Rectangle2D createRectangle(Point2D[] p) { if (p.length == 0) return null; Rectangle2D result = new Rectangle2D.Double(p[0].getX(),p[0].getY(),0.0,0.0); for (int i = 1; i < p.length; ++i) { //if (p[i] != null) expand(result,p[i]); if (p[i] != null) result.add(p[i]); } return result; }
/** * Called from mouse dragged to update the marquee state during a repaint. */ protected void processMouseDraggedEvent(MouseEvent e) { if (startPoint != null) { currentPoint = e.getPoint(); marqueeBounds = new Rectangle2D.Double(startPoint.getX(), startPoint.getY(), 0, 0); marqueeBounds.add(currentPoint); } }
public Rectangle2D getBounds2D() { Rectangle2D rectangle = null; for (Iterator i = shapes.iterator(); i.hasNext();) { Shape shape = (Shape) i.next(); if (rectangle == null) { rectangle = shape.getBounds2D(); } else { rectangle.add(shape.getBounds2D()); } } return rectangle; }
public Rectangle2D getBounds2D() { Rectangle2D rectangle = null; for (Iterator i = shapes.iterator(); i.hasNext();) { Shape shape = (Shape) i.next(); if (rectangle == null) { rectangle = shape.getBounds2D(); } else { rectangle.add(shape.getBounds2D()); } } return rectangle; }
public static void setValues(Rectangle2D r, Point2D[] p) { if (p==null || p.length==0) return; r.setRect(p[0].getX(), p[0].getY(), 0.0 ,0.0); for (int i=1; i<p.length; ++i) r.add(p[i]); }
public Rectangle2D getBounds2D( BufferedImage src ) { if ( clip ) return new Rectangle(0, 0, src.getWidth(), src.getHeight()); float w = src.getWidth(), h = src.getHeight(); Rectangle2D r = new Rectangle2D.Float(); r.add( getPoint2D( new Point2D.Float(0, 0), null ) ); r.add( getPoint2D( new Point2D.Float(w, 0), null ) ); r.add( getPoint2D( new Point2D.Float(0, h), null ) ); r.add( getPoint2D( new Point2D.Float(w, h), null ) ); return r; }
public Rectangle2D getBounds2D( BufferedImage src ) { if ( clip ) return new Rectangle(0, 0, src.getWidth(), src.getHeight()); float w = src.getWidth(), h = src.getHeight(); Rectangle2D r = new Rectangle2D.Float(); r.add( getPoint2D( new Point2D.Float(0, 0), null ) ); r.add( getPoint2D( new Point2D.Float(w, 0), null ) ); r.add( getPoint2D( new Point2D.Float(0, h), null ) ); r.add( getPoint2D( new Point2D.Float(w, h), null ) ); return r; }
public Rectangle2D getBounds2D( BufferedImage src ) { if ( clip ) return new Rectangle(0, 0, src.getWidth(), src.getHeight()); float w = src.getWidth(), h = src.getHeight(); Rectangle2D r = new Rectangle2D.Float(); r.add( getPoint2D( new Point2D.Float(0, 0), null ) ); r.add( getPoint2D( new Point2D.Float(w, 0), null ) ); r.add( getPoint2D( new Point2D.Float(0, h), null ) ); r.add( getPoint2D( new Point2D.Float(w, h), null ) ); return r; }
private Rectangle2D generateBoundingRect(final Set<GeoPosition> positions, int zoom) { Point2D point1 = getTileFactory().geoToPixel(positions.iterator().next(), zoom); Rectangle2D rect = new Rectangle2D.Double(point1.getX(), point1.getY(),0,0); for(GeoPosition pos : positions) { Point2D point = getTileFactory().geoToPixel(pos, zoom); rect.add(point); } return rect; }
public Rectangle2D getBoundingBox() { Rectangle2D bb = new Rectangle2D.Double(getBase().getX(), getBase().getY(), 0, 0); for (JGroupableNote m_jNote : m_jNotes) { bb.add((/*(JNotePartOfGroup) */m_jNote).getBoundingBox()); } return bb; }
private Rectangle2D generateBoundingRect(final Set<GeoPosition> positions, int zoom) { Point2D point1 = getTileFactory().geoToPixel(positions.iterator().next(), zoom); Rectangle2D rect = new Rectangle2D.Double(point1.getX(), point1.getY(),0,0); for(GeoPosition pos : positions) { Point2D point = getTileFactory().geoToPixel(pos, zoom); rect.add(point); } return rect; }
private Rectangle2D generateBoundingRect(final Set<GeoPosition> positions, int zoom) { Point2D point1 = getTileFactory().geoToPixel(positions.iterator().next(), zoom); Rectangle2D rect = new Rectangle2D.Double(point1.getX(), point1.getY(), 0, 0); for (GeoPosition pos : positions) { Point2D point = getTileFactory().geoToPixel(pos, zoom); rect.add(point); } return rect; }
private Rectangle2D generateBoundingRect(final Set<GeoPosition> positions, int zoom) { Point2D point1 = getTileFactory().geoToPixel(positions.iterator().next(), zoom); Rectangle2D rect = new Rectangle2D.Double(point1.getX(), point1.getY(), 0, 0); for (GeoPosition pos : positions) { Point2D point = getTileFactory().geoToPixel(pos, zoom); rect.add(point); } return rect; }
public void add(String label, Point2D point) { Rectangle2D.Double bounds = new Rectangle2D.Double(point.getX(), point.getY(), 0.0, 0.0); this.childMap.put(label, bounds); if (this.root == null) { this.root = new Rectangle2D.Double(bounds.getMinX(), bounds.getMinY(), bounds.getWidth(), bounds.getHeight()); } else { this.root.add(point); } }
public void growDrawingArea() { IGraph g = getGraph(); Rectangle2D bounds = g.getClipBounds(); bounds.add(getBounds()); g.setBounds(new Double(0, 0, GROW_SCALE_FACTOR * bounds.getWidth(), GROW_SCALE_FACTOR * bounds.getHeight())); invalidate(); repaint(); }