com.octo.captcha.component.image.textpaster
Class ChangeableAttributedString

java.lang.Object
  extended by com.octo.captcha.component.image.textpaster.ChangeableAttributedString

public class ChangeableAttributedString
extends java.lang.Object

This class is the decomposition of a single AttributedString into its component glyphs. It wouldn't be necessary if Java2D correctly handled spacing issues with fonts changed AffineTransformation -- there is a possibility that it will not be necessary with java 1.5


Constructor Summary
protected ChangeableAttributedString(java.awt.Graphics2D g2, java.text.AttributedString aString, int kerning)
          Given an attributed string and the graphics environment it lives in, pull it apart into its components.
 
Method Summary
 double getAscent(int index)
           
 java.awt.geom.Rectangle2D getBounds(int index)
           
 double getHeight(int index)
           
 java.text.AttributedCharacterIterator getIterator(int i)
           
 double getMaxAscent()
           
 double getMaxDescent()
           
 double getMaxHeight()
           
 double getMaxWidth()
           
 double getMaxX()
           
 double getMaxY()
           
 java.awt.font.LineMetrics getMetric(int index)
           
 double getTotalWidth()
           
 double getWidth(int index)
           
 double getX(int index)
           
 double getY(int index)
           
 int length()
           
protected  void shiftBoundariesToNonLinearLayout(double backgroundWidth, double backgroundHeight)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChangeableAttributedString

protected ChangeableAttributedString(java.awt.Graphics2D g2,
                                     java.text.AttributedString aString,
                                     int kerning)
Given an attributed string and the graphics environment it lives in, pull it apart into its components.

Parameters:
g2 - graphics
aString - attributed String
Method Detail

shiftBoundariesToNonLinearLayout

protected void shiftBoundariesToNonLinearLayout(double backgroundWidth,
                                                double backgroundHeight)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

length

public int length()

getX

public double getX(int index)

getY

public double getY(int index)

getHeight

public double getHeight(int index)

getTotalWidth

public double getTotalWidth()

getWidth

public double getWidth(int index)

getAscent

public double getAscent(int index)

getMaxWidth

public double getMaxWidth()

getMaxAscent

public double getMaxAscent()

getMaxDescent

public double getMaxDescent()

getMaxHeight

public double getMaxHeight()

getMaxX

public double getMaxX()

getMaxY

public double getMaxY()

getBounds

public java.awt.geom.Rectangle2D getBounds(int index)

getMetric

public java.awt.font.LineMetrics getMetric(int index)

getIterator

public java.text.AttributedCharacterIterator getIterator(int i)


Copyright 2003-2009 JCaptcha. All Rights Reserved.