You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2005/09/30 06:19:43 UTC
svn commit: r292622 -
/cocoon/blocks/captcha/trunk/java/org/apache/cocoon/reading/CaptchaReader.java
Author: antonio
Date: Thu Sep 29 21:19:39 2005
New Revision: 292622
URL: http://svn.apache.org/viewcvs?rev=292622&view=rev
Log:
Fix java 1.3 compatibility.
Modified:
cocoon/blocks/captcha/trunk/java/org/apache/cocoon/reading/CaptchaReader.java
Modified: cocoon/blocks/captcha/trunk/java/org/apache/cocoon/reading/CaptchaReader.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/captcha/trunk/java/org/apache/cocoon/reading/CaptchaReader.java?rev=292622&r1=292621&r2=292622&view=diff
==============================================================================
--- cocoon/blocks/captcha/trunk/java/org/apache/cocoon/reading/CaptchaReader.java (original)
+++ cocoon/blocks/captcha/trunk/java/org/apache/cocoon/reading/CaptchaReader.java Thu Sep 29 21:19:39 2005
@@ -151,7 +151,7 @@
/* Retrieve the current operational parameters from Cocoon's sitemap */
final int width = this.parameters.getParameterAsInteger("width", 100);
final int height = this.parameters.getParameterAsInteger("height", 50);
- Color background = this.getColor("background", Color.WHITE);
+ Color background = this.getColor("background", Color.white);
Color foreground = this.getColor("foreground", null);
if (foreground == null) {
int r = (RANDOM.nextInt(64) + 96 + background.getRed()) & 0x0ff;
@@ -201,14 +201,14 @@
/* Prepare the background and the font of the source image */
final Graphics2D sourceGraphics = this.antialiasedGraphics(source);
- sourceGraphics.setColor(Color.BLACK);
+ sourceGraphics.setColor(Color.black);
sourceGraphics.fillRect(0, 0, scaledWidth, scaledHeight);
sourceGraphics.setFont(font);
/* Write the string exactly in the middle of the source image */
float textX = (float) ((scaledWidth - textWidth) / 2);
float textY = (float) ((scaledHeight - textHeight) / 2);
- sourceGraphics.setColor(Color.WHITE);
+ sourceGraphics.setColor(Color.white);
sourceGraphics.drawString(text, textX, textY + sourceMetrics.getAscent());
/* Randomize displacement factors for sine-waves */