BufferedImage argbImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); Graphics2D g = argbImg.createGraphics(); g.clipRect(0, 0, width, y); g.drawImage(img, 0, 0, null); g.dispose();
public void clipRect(int x, int y, int width, int height) { delegate.clipRect(x, y, width, height); }
@Override public Graphics2D prepare(Component component, Graphics2D graphics) { graphics.clipRect(x, y, width, height); return graphics; }
@Override public Graphics2D prepare(Component component, Graphics2D graphics) { graphics.clipRect(x, y, width, height); return graphics; }
private void processClipRect(Graphics2D g) { // clipRect(int, int, int, int) g.clipRect(calls.getInt(), calls.getInt(), calls.getInt(), calls.getInt()); }
public void clipRect(int x, int y, int width, int height) { System.out.println( "clipRect(int, int, int, int):" ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); System.out.println( "width = " + width ); System.out.println( "height = " + height ); g2D.clipRect( x, y, width, height ); }
public void clipRect(int x, int y, int width, int height) { System.out.println( "clipRect(int, int, int, int):" ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); System.out.println( "width = " + width ); System.out.println( "height = " + height ); g2D.clipRect( x, y, width, height ); }
public void clipRect(int x, int y, int width, int height) { System.out.println( "clipRect(int, int, int, int):" ); System.out.println( "x = " + x ); System.out.println( "y = " + y ); System.out.println( "width = " + width ); System.out.println( "height = " + height ); g2D.clipRect( x, y, width, height ); }
@Override public void paint(Graphics2D graphics) { graphics.translate(-bounds.x, -bounds.y); graphics.clipRect(bounds.x, bounds.y, bounds.width, bounds.height); tableView.paint(graphics); } }
@Override public void paint(Graphics2D graphics) { graphics.translate(-bounds.x, -bounds.y); graphics.clipRect(bounds.x, bounds.y, bounds.width, bounds.height); tableView.paint(graphics); } }
private void paintVoyageDraw(Graphics g, LotDraw lotDraw, VoyageDraw voyageDraw, Rectangle rect) { Graphics2D g2 = (Graphics2D) g.create(); boolean selected = false; if (currentSelectedPath != null && currentSelectedPath.getVoyageDraw() != null && currentSelectedPath.getVoyageDraw().equals(voyageDraw)) { selected = true; selectedVoyageDraw = true; selectedVoyageDrawRect = rect; } g2.clipRect(rect.x, rect.y, rect.width, rect.height); voyageDraw.getRenderer().paintVoyageDraw(g2, rect, JTriage.this, side, lotDraw, voyageDraw, selected); g2.dispose(); }
@Override public Graphics2D prepare(Component component, Graphics2D graphics) { if (clip) { Bounds decoratedBounds = component.getDecoratedBounds(); graphics.clipRect(decoratedBounds.x - component.getX(), decoratedBounds.y - component.getY(), decoratedBounds.width, decoratedBounds.height); } graphics.translate(x, y); return graphics; }
@Override public Graphics2D prepare(Component component, Graphics2D graphics) { if (clip) { Bounds decoratedBounds = component.getDecoratedBounds(); graphics.clipRect(decoratedBounds.x - component.getX(), decoratedBounds.y - component.getY(), decoratedBounds.width, decoratedBounds.height); } graphics.translate(x, y); return graphics; }
protected void drawConstrainer(Graphics2D g) { Shape clip = g.getClip(); Rectangle r = getCanvasViewBounds(); g.clipRect(r.x, r.y, r.width, r.height); getConstrainer().draw(g, this); g.setClip(clip); }
/** * Restrict the draw area to the valid base coordinate space. */ public void clip() { int x = (int) (projection.canvas.getWidth() * projection.canvas.margin); int y = (int) (projection.canvas.getHeight() * projection.canvas.margin); int w = (int) (projection.canvas.getWidth() * (1 - 2 * projection.canvas.margin)); int h = (int) (projection.canvas.getHeight() * (1 - 2 * projection.canvas.margin)); originalClip = g2d.getClip(); g2d.clipRect(x, y, w, h); }
public Graphics2D getGraphics2D(Rectangle clipRect) { Graphics2D graphics = template.createGraphics(template.getWidth(), template.getHeight()); graphics.translate(origX, template.getHeight() - origY - clipRect.getHeight()); graphics.clipRect(0, 0, (int) clipRect.getWidth(), (int) clipRect.getHeight()); return graphics; }