All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.atomtool.captcha.text.renderer.TextCharacter Maven / Gradle / Ivy

The newest version!
package cn.atomtool.captcha.text.renderer;

import java.awt.*;
import java.awt.font.TextAttribute;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;

public class TextCharacter {

	private double x;
	private double y;
	private double width;
	private double height;
	private double ascent;
	private double descent;
	private char character;
	private Font font;
	private Color color;

	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}

	public double getWidth() {
		return width;
	}

	public void setWidth(double width) {
		this.width = width;
	}

	public double getHeight() {
		return height;
	}

	public void setHeight(double height) {
		this.height = height;
	}

	public char getCharacter() {
		return character;
	}

	public void setCharacter(char character) {
		this.character = character;
	}

	public Font getFont() {
		return font;
	}

	public void setFont(Font font) {
		this.font = font;
	}

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public double getAscent() {
		return ascent;
	}

	public void setAscent(double ascent) {
		this.ascent = ascent;
	}

	public double getDescent() {
		return descent;
	}

	public void setDescent(double descent) {
		this.descent = descent;
	}

	public AttributedCharacterIterator iterator() {
		AttributedString aString = new AttributedString(String
				.valueOf(character));
		aString.addAttribute(TextAttribute.FONT, font, 0, 1);
		return aString.getIterator();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy