/** * Sets this graphics context's current color to the specified * color. All subsequent graphics operations using this graphics * context use this specified color. * @param c the new rendering color. * @see java.awt.Color * @see java.awt.Graphics#getColor */ public void setColor(Color c){ if(c == null) return; if(paint != c) setPaint(c); }
/** * Sets the <code>Paint</code> attribute for the * <code>Graphics2D</code> context. Calling this method * with a <code>null</code> <code>Paint</code> object does * not have any effect on the current <code>Paint</code> attribute * of this <code>Graphics2D</code>. * @param paint the <code>Paint</code> object to be used to generate * color during the rendering process, or <code>null</code> * @see java.awt.Graphics#setColor */ public void setPaint(Paint paint) { gc.setPaint(paint); }
/** * Sets this graphics context's current color to the specified * color. All subsequent graphics operations using this graphics * context use this specified color. * @param c the new rendering color. * @see java.awt.Color * @see java.awt.Graphics#getColor */ public void setColor(Color c){ if(c == null) return; if(paint != c) setPaint(c); }
/** * Sets the <code>Paint</code> attribute for the * <code>Graphics2D</code> context. Calling this method * with a <code>null</code> <code>Paint</code> object does * not have any effect on the current <code>Paint</code> attribute * of this <code>Graphics2D</code>. * @param paint the <code>Paint</code> object to be used to generate * color during the rendering process, or <code>null</code> * @see java.awt.Graphics#setColor */ public void setPaint(Paint paint) { gc.setPaint(paint); }
/** * Sets the <code>Paint</code> attribute for the * <code>Graphics2D</code> context. Calling this method * with a <code>null</code> <code>Paint</code> object does * not have any effect on the current <code>Paint</code> attribute * of this <code>Graphics2D</code>. * @param paint the <code>Paint</code> object to be used to generate * color during the rendering process, or <code>null</code> * @see java.awt.Graphics#setColor */ public void setPaint(Paint paint) { gc.setPaint(paint); }
/** * Sets this graphics context's current color to the specified * color. All subsequent graphics operations using this graphics * context use this specified color. * @param c the new rendering color. * @see java.awt.Color * @see java.awt.Graphics#getColor */ public void setColor(Color c){ if(c == null) return; if(paint != c) setPaint(c); }
/** * 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); }
/** * 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); }
/** * 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); }
gc.setPaint(gcDefaults.getPaint());
gc.setPaint(gcDefaults.getPaint());