[jboss-cvs] jboss-seam/src/main/org/jboss/seam/captcha ...

Gavin King gavin.king at jboss.com
Thu Nov 8 02:00:57 EST 2007


  User: gavin   
  Date: 07/11/08 02:00:57

  Modified:    src/main/org/jboss/seam/captcha    Captcha.java
                        CaptchaResponse.java CaptchaImage.java
  Log:
  various improvements
  
  Revision  Changes    Path
  1.9       +10 -2     jboss-seam/src/main/org/jboss/seam/captcha/Captcha.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Captcha.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/captcha/Captcha.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -r1.8 -r1.9
  --- Captcha.java	8 Nov 2007 06:30:04 -0000	1.8
  +++ Captcha.java	8 Nov 2007 07:00:57 -0000	1.9
  @@ -108,14 +108,22 @@
         BufferedImage challenge = new BufferedImage(70, 20, BufferedImage.TYPE_BYTE_GRAY);
         Graphics graphics = challenge.getGraphics();
         graphics.setColor( getChallengeBackgroundColor() );
  -      graphics.fillRect(0, 0, 70, 20);
  +      graphics.fillRect(0, 0, getChallengeImageWidth(), 20);
         graphics.setColor( getChallengeTextColor() );
  -      graphics.drawString( getChallenge() , 5, 15 );
  +      graphics.drawString( getChallenge(), 5, 15 );
         return challenge;
      }
      
      /**
       * May be overridden by subclasses
  +    * @return the width, in pixels, of the challenge question
  +    */
  +   protected int getChallengeImageWidth() {
  +      return 70;
  +   }
  +   
  +   /**
  +    * May be overridden by subclasses
       * @return the background color of the challenge image
       */
      protected Color getChallengeBackgroundColor()
  
  
  
  1.3       +1 -1      jboss-seam/src/main/org/jboss/seam/captcha/CaptchaResponse.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CaptchaResponse.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/captcha/CaptchaResponse.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CaptchaResponse.java	14 Feb 2007 07:36:27 -0000	1.2
  +++ CaptchaResponse.java	8 Nov 2007 07:00:57 -0000	1.3
  @@ -14,5 +14,5 @@
   @ValidatorClass(CaptchaResponseValidator.class)
   public @interface CaptchaResponse 
   {
  -   String message() default "input characters did not match";
  +   String message() default "incorrect response";
   }
  
  
  
  1.20      +1 -1      jboss-seam/src/main/org/jboss/seam/captcha/CaptchaImage.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CaptchaImage.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/captcha/CaptchaImage.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  
  
  



More information about the jboss-cvs-commits mailing list