this.axisTickCalculator = getAxisTickCalculator(bounds.getWidth()); axisTitle.paint(g); axisTick.paint(g);
double width = bounds.getWidth(); leftStart += paddingBetweenAxes + width + tickMargin; leftYAxisBounds.width += width; double width = bounds.getWidth(); leftStart += paddingBetweenAxes + width + tickMargin; leftYAxisBounds.width += width; double aproxWidth = bounds.getWidth(); double xOffset = rightEnd - aproxWidth; bounds.x = xOffset; yAxis.preparePaint(); Rectangle2D.Double bounds = (java.awt.geom.Rectangle2D.Double) yAxis.getBounds(); double aproxWidth = bounds.getWidth(); double xOffset = rightEnd - aproxWidth; bounds.x = xOffset;
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); } }
/** * @return Text bounds as a path in local coordinates, which is useful * if you need to transform to global coordinates */ public Path2D.Double getBoundsAsPath() { Rectangle2D.Double rect = getTextBounds(); double w = rect.getWidth(); double h = rect.getHeight(); Path2D.Double bounds = new Path2D.Double(); bounds.moveTo(0, 0); bounds.lineTo(w, 0); bounds.lineTo(w, h); bounds.lineTo(0, h); bounds.lineTo(0, 0); return bounds; }
@Override public synchronized Rectangle2D cellRectangle(Graphics2D gs, CellContext context) { if( gs==null )throw new IllegalArgumentException("gs == null"); if( context==null )throw new IllegalArgumentException("context == null"); FlatBlock tb = prepare(gs, context); Pair<Double,Double> pos = evalPosition(context, tb); Rectangle2D.Double rect = tb.getBounds(); double x = pos.A()+paddingLeft; double y = pos.B()+paddingTop; rect = new Rectangle2D.Double(x-paddingLeft, y-paddingTop, rect.getWidth()+paddingLeft+paddingRight, rect.getHeight()+paddingTop+paddingBottom); return rect; }
/** * Creates an MArea based on a double precision Rectangle previously * constructed * * @param rectangle from which we are going to construct this MArea * @param ID identification for this MArea * @see Rectangle2D.Double */ public MArea(Rectangle2D.Double rectangle, int ID) { super(rectangle); this.area = rectangle.getWidth() * rectangle.getHeight(); this.ID = ID; rotation = 0; }
private Rectangle2D.Double createRectangle(Rectangle2D.Double rectangularShape) { return new Rectangle2D.Double(rectangularShape.getX(), rectangularShape.getY(), rectangularShape.getWidth(), rectangularShape.getHeight()); }
private Rectangle2D.Double createRectangle(Rectangle2D.Double rectangularShape) { return new Rectangle2D.Double(rectangularShape.getX(), rectangularShape.getY(), rectangularShape.getWidth(), rectangularShape.getHeight()); }
@Test public void testCorrectBoundsIfNecessary_correction_negative_x() { final Rectangle2D.Double toCorrect = new Rectangle2D.Double(-185.499991, -90.0, 360.0, 180.0); RegionSelectableWorldMapPane.correctBoundsIfNecessary(toCorrect); assertEquals(-180.0, toCorrect.getMinX(), 1e-8); assertEquals(174.50000899999895, toCorrect.getMaxX(), 1e-8); assertEquals(-90.0, toCorrect.getMinY(), 1e-8); assertEquals(90.0, toCorrect.getMaxY(), 1e-8); assertTrue(toCorrect.getMinX() + toCorrect.getWidth() <= 180.0); assertTrue(toCorrect.getMinY() + toCorrect.getHeight() <= 90.0); } }
public final void insert(final Rectangle2D.Double rect, final T sampled) { samplesRTree.insert(new float[]{(float) rect.getX(), (float) rect.getY()}, new float[]{(float) rect.getWidth(), (float) rect.getHeight()}, sampled); }
private void clearPathGraphics(Rectangle2D.Double bounds, Graphics2D gfx) throws IOException { Color transparent = new Color(255, 255, 255, 0); gfx.setColor(transparent); gfx.fillRect(0, 0, (int) bounds.getWidth() * 2, (int) bounds.getHeight() * 2); Color fill = pdfColorToColor(state.getNonStrokingColor()); Color stroke = pdfColorToColor(state.getStrokingColor()); // crop off rendered path whitespace gfx.translate(-bounds.getX(), -bounds.getY()); gfx.setPaint(stroke); gfx.setColor(fill); }
public void align(double xalign){ synchronized(sync){ Rectangle2D.Double rect = getBounds(); for( FlatString fstr : this ){ double wstr = fstr.getWidth(); double wtot = rect.getWidth(); double wdiff = wtot - wstr; fstr.setX(wdiff*xalign); } } } }
public void align(FlatString fstr,double xalign){ if( fstr==null )throw new IllegalArgumentException("fstr == null"); synchronized(sync){ Rectangle2D.Double rect = getBounds(); double wstr = fstr.getWidth(); double wtot = rect.getWidth(); double wdiff = wtot - wstr; fstr.setX(wdiff*xalign); } } public void align(double xalign){
public double getSurf() { if (max == null) { return 0; } return max.getWidth() * max.getHeight(); }
@Test public void testCorrectBoundsIfNecessary_correction_positive_x() { final Rectangle2D.Double toCorrect = new Rectangle2D.Double(-175.499991, -90.0, 360.0, 180.0); RegionSelectableWorldMapPane.correctBoundsIfNecessary(toCorrect); assertEquals(-175.499991, toCorrect.getMinX(), 1e-8); assertEquals(180.0, toCorrect.getMaxX(), 1e-8); assertEquals(-90.0, toCorrect.getMinY(), 1e-8); assertEquals(90.0, toCorrect.getMaxY(), 1e-8); assertTrue(toCorrect.getMinX() + toCorrect.getWidth() <= 180.0); assertTrue(toCorrect.getMinY() + toCorrect.getHeight() <= 90.0); }
public void run(final Network network) { Collection<? extends Node> nodes; if (this.travelZone.getHeight() == 0 || this.travelZone.getWidth() == 0) { nodes = network.getNodes().values(); } else { nodes = getNodesInTravelZone(network); } run(nodes); }
/** * @return Text bounds as a path in local coordinates, which is useful * if you need to transform to global coordinates */ public Path2D.Double getBoundsAsPath() { Rectangle2D.Double rect = getTextBounds(); double w = rect.getWidth(); double h = rect.getHeight(); Path2D.Double bounds = new Path2D.Double(); bounds.moveTo(0, 0); bounds.lineTo(w, 0); bounds.lineTo(w, h); bounds.lineTo(0, h); bounds.lineTo(0, 0); return bounds; }
public double getSurf() { if (max == null) { return 0; } return max.getWidth() * max.getHeight(); }