public void drawRect(int x, int y, int width, int height){ Rectangle rect = new Rectangle(x, y, width, height); draw(rect); }
Color bgcolor, ImageObserver observer){ return drawImage(img, x, y, img.getWidth(null), img.getHeight(null), bgcolor, observer);
/** * Draws the text given by the specified string, using this * graphics context's current font and color. The baseline of the * first character is at position (<i>x</i>, <i>y</i>) in this * graphics context's coordinate system. * @param str the string to be drawn. * @param x the <i>x</i> coordinate. * @param y the <i>y</i> coordinate. * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawChars */ public void drawString(String str, int x, int y){ drawString(str, (float)x, (float)y); }
/** * Fills the specified rectangle. * The left and right edges of the rectangle are at * <code>x</code> and <code>x + width - 1</code>. * The top and bottom edges are at * <code>y</code> and <code>y + height - 1</code>. * The resulting rectangle covers an area * <code>width</code> pixels wide by * <code>height</code> pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the <i>x</i> coordinate * of the rectangle to be filled. * @param y the <i>y</i> coordinate * of the rectangle to be filled. * @param width the width of the rectangle to be filled. * @param height the height of the rectangle to be filled. * @see java.awt.Graphics#clearRect * @see java.awt.Graphics#drawRect */ public void fillRect(int x, int y, int width, int height){ Rectangle rect = new Rectangle(x, y, width, height); fill(rect); }
/** * Clears the specified rectangle by filling it with the background * color of the current drawing surface. This operation does not * use the current paint mode. * <p> * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should * use <code>setColor</code> followed by <code>fillRect</code> to * ensure that an offscreen image is cleared to a specific color. * @param x the <i>x</i> coordinate of the rectangle to clear. * @param y the <i>y</i> coordinate of the rectangle to clear. * @param width the width of the rectangle to clear. * @param height the height of the rectangle to clear. * @see java.awt.Graphics#fillRect(int, int, int, int) * @see java.awt.Graphics#drawRect * @see java.awt.Graphics#setColor(java.awt.Color) * @see java.awt.Graphics#setPaintMode * @see java.awt.Graphics#setXORMode(java.awt.Color) */ public void clearRect(int x, int y, int width, int height){ Paint paint = gc.getPaint(); gc.setColor(gc.getBackground()); fillRect(x, y, width, height); gc.setPaint(paint); }
/** * Fills a closed polygon defined by * arrays of <i>x</i> and <i>y</i> coordinates. * <p> * This method draws the polygon defined by <code>nPoint</code> line * segments, where the first <code>nPoint - 1</code> * line segments are line segments from * <code>(xPoints[i - 1], yPoints[i - 1])</code> * to <code>(xPoints[i], yPoints[i])</code>, for * 1 ≤ <i>i</i> ≤ <code>nPoints</code>. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. * <p> * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. * @param xPoints a an array of <code>x</code> coordinates. * @param yPoints a an array of <code>y</code> coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) */ public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints){ Polygon polygon = new Polygon(xPoints, yPoints, nPoints); fill(polygon); }
/** * Clears the specified rectangle by filling it with the background * color of the current drawing surface. This operation does not * use the current paint mode. * <p> * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should * use <code>setColor</code> followed by <code>fillRect</code> to * ensure that an offscreen image is cleared to a specific color. * @param x the <i>x</i> coordinate of the rectangle to clear. * @param y the <i>y</i> coordinate of the rectangle to clear. * @param width the width of the rectangle to clear. * @param height the height of the rectangle to clear. * @see java.awt.Graphics#fillRect(int, int, int, int) * @see java.awt.Graphics#drawRect * @see java.awt.Graphics#setColor(java.awt.Color) * @see java.awt.Graphics#setPaintMode * @see java.awt.Graphics#setXORMode(java.awt.Color) */ public void clearRect(int x, int y, int width, int height){ Paint paint = gc.getPaint(); gc.setColor(gc.getBackground()); fillRect(x, y, width, height); gc.setPaint(paint); }
public void drawRect(int x, int y, int width, int height){ Rectangle rect = new Rectangle(x, y, width, height); draw(rect); }
/** * Fills the specified rectangle. * The left and right edges of the rectangle are at * <code>x</code> and <code>x + width - 1</code>. * The top and bottom edges are at * <code>y</code> and <code>y + height - 1</code>. * The resulting rectangle covers an area * <code>width</code> pixels wide by * <code>height</code> pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the <i>x</i> coordinate * of the rectangle to be filled. * @param y the <i>y</i> coordinate * of the rectangle to be filled. * @param width the width of the rectangle to be filled. * @param height the height of the rectangle to be filled. * @see java.awt.Graphics#clearRect * @see java.awt.Graphics#drawRect */ public void fillRect(int x, int y, int width, int height){ Rectangle rect = new Rectangle(x, y, width, height); fill(rect); }
Color bgcolor, ImageObserver observer){ return drawImage(img, x, y, img.getWidth(null), img.getHeight(null), bgcolor, observer);
/** * Draws the text given by the specified string, using this * graphics context's current font and color. The baseline of the * first character is at position (<i>x</i>, <i>y</i>) in this * graphics context's coordinate system. * @param str the string to be drawn. * @param x the <i>x</i> coordinate. * @param y the <i>y</i> coordinate. * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawChars */ public void drawString(String str, int x, int y){ drawString(str, (float)x, (float)y); }
/** * Clears the specified rectangle by filling it with the background * color of the current drawing surface. This operation does not * use the current paint mode. * <p> * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should * use <code>setColor</code> followed by <code>fillRect</code> to * ensure that an offscreen image is cleared to a specific color. * @param x the <i>x</i> coordinate of the rectangle to clear. * @param y the <i>y</i> coordinate of the rectangle to clear. * @param width the width of the rectangle to clear. * @param height the height of the rectangle to clear. * @see java.awt.Graphics#fillRect(int, int, int, int) * @see java.awt.Graphics#drawRect * @see java.awt.Graphics#setColor(java.awt.Color) * @see java.awt.Graphics#setPaintMode * @see java.awt.Graphics#setXORMode(java.awt.Color) */ public void clearRect(int x, int y, int width, int height){ Paint paint = gc.getPaint(); gc.setColor(gc.getBackground()); fillRect(x, y, width, height); gc.setPaint(paint); }
public void drawRect(int x, int y, int width, int height){ Rectangle rect = new Rectangle(x, y, width, height); draw(rect); }
/** * Fills a closed polygon defined by * arrays of <i>x</i> and <i>y</i> coordinates. * <p> * This method draws the polygon defined by <code>nPoint</code> line * segments, where the first <code>nPoint - 1</code> * line segments are line segments from * <code>(xPoints[i - 1], yPoints[i - 1])</code> * to <code>(xPoints[i], yPoints[i])</code>, for * 1 ≤ <i>i</i> ≤ <code>nPoints</code>. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. * <p> * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. * @param xPoints a an array of <code>x</code> coordinates. * @param yPoints a an array of <code>y</code> coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) */ public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints){ Polygon polygon = new Polygon(xPoints, yPoints, nPoints); fill(polygon); }
Color bgcolor, ImageObserver observer){ return drawImage(img, x, y, img.getWidth(null), img.getHeight(null), bgcolor, observer);
/** * Draws the text given by the specified string, using this * graphics context's current font and color. The baseline of the * first character is at position (<i>x</i>, <i>y</i>) in this * graphics context's coordinate system. * @param str the string to be drawn. * @param x the <i>x</i> coordinate. * @param y the <i>y</i> coordinate. * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawChars */ public void drawString(String str, int x, int y){ drawString(str, (float)x, y); }