/** * Fills an oval bounded by the specified rectangle with the * current color. * @param x the <i>x</i> coordinate of the upper left corner * of the oval to be filled. * @param y the <i>y</i> coordinate of the upper left corner * of the oval to be filled. * @param width the width of the oval to be filled. * @param height the height of the oval to be filled. * @see java.awt.Graphics#drawOval */ public void fillOval(int x, int y, int width, int height){ Ellipse2D oval = new Ellipse2D.Double(x, y, width, height); fill(oval); }
/** * 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); }
/** * 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){ java.awt.Polygon polygon = new java.awt.Polygon(xPoints, yPoints, nPoints); fill(polygon); }
/** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle * are at <code>x</code> and <code>x + width - 1</code>, * respectively. The top and bottom edges of the rectangle are at * <code>y</code> and <code>y + height - 1</code>. * @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. * @param arcWidth the horizontal diameter * of the arc at the four corners. * @param arcHeight the vertical diameter * of the arc at the four corners. * @see java.awt.Graphics#drawRoundRect */ public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight){ RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, arcWidth, arcHeight); fill(rect); }
/** * Renders the text of the specified * {@link GlyphVector} using * the <code>Graphics2D</code> context's rendering attributes. * The rendering attributes applied include the <code>Clip</code>, * <code>Transform</code>, <code>Paint</code>, and * <code>Composite</code> attributes. The <code>GlyphVector</code> * specifies individual glyphs from a {@link Font}. * The <code>GlyphVector</code> can also contain the glyph positions. * This is the fastest way to render a set of characters to the * screen. * * @param g the <code>GlyphVector</code> to be rendered * @param x the x position in user space where the glyphs should be * rendered * @param y the y position in user space where the glyphs should be * rendered * * @see java.awt.Font#createGlyphVector(FontRenderContext, char[]) * @see java.awt.font.GlyphVector * @see #setPaint * @see java.awt.Graphics#setColor * @see #setTransform * @see #setComposite * @see #setClip(Shape) */ public void drawGlyphVector(GlyphVector g, float x, float y) { Shape glyphOutline = g.getOutline(x, y); fill(glyphOutline); }
/** * Fills an oval bounded by the specified rectangle with the * current color. * @param x the <i>x</i> coordinate of the upper left corner * of the oval to be filled. * @param y the <i>y</i> coordinate of the upper left corner * of the oval to be filled. * @param width the width of the oval to be filled. * @param height the height of the oval to be filled. * @see java.awt.Graphics#drawOval */ public void fillOval(int x, int y, int width, int height){ Ellipse2D oval = new Ellipse2D.Double(x, y, width, height); fill(oval); }
/** * 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); }
/** * 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){ java.awt.Polygon polygon = new java.awt.Polygon(xPoints, yPoints, nPoints); fill(polygon); }
/** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle * are at <code>x</code> and <code>x + width - 1</code>, * respectively. The top and bottom edges of the rectangle are at * <code>y</code> and <code>y + height - 1</code>. * @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. * @param arcWidth the horizontal diameter * of the arc at the four corners. * @param arcHeight the vertical diameter * of the arc at the four corners. * @see java.awt.Graphics#drawRoundRect */ public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight){ RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, arcWidth, arcHeight); fill(rect); }
/** * Renders the text of the specified * {@link GlyphVector} using * the <code>Graphics2D</code> context's rendering attributes. * The rendering attributes applied include the <code>Clip</code>, * <code>Transform</code>, <code>Paint</code>, and * <code>Composite</code> attributes. The <code>GlyphVector</code> * specifies individual glyphs from a {@link Font}. * The <code>GlyphVector</code> can also contain the glyph positions. * This is the fastest way to render a set of characters to the * screen. * * @param g the <code>GlyphVector</code> to be rendered * @param x the x position in user space where the glyphs should be * rendered * @param y the y position in user space where the glyphs should be * rendered * * @see java.awt.Font#createGlyphVector(FontRenderContext, char[]) * @see java.awt.font.GlyphVector * @see #setPaint * @see java.awt.Graphics#setColor * @see #setTransform * @see #setComposite * @see #setClip(Shape) */ public void drawGlyphVector(GlyphVector g, float x, float y) { Shape glyphOutline = g.getOutline(x, y); fill(glyphOutline); }