package cn.com.tenlion.buildingpictures.util;

import java.util.Arrays;

/**
 * 套版生成实体类
 * @类 名 : CreateImageBean
 * @功能描述 : TODO
 * @作者信息 : CBC
 * @修改备注 :
 */
public class CreateImageBean {

	private Integer fontLength = 0;// 限制长度, 0不限制
	
	private Integer fontSize = 35;// type为string的时候,为自定义文本内容
	
	private String type = "1"; // string||image

	private String center = "1";// 1居左, 2居中, 3居右
	
	private String content = "";// type为image的时候,为本地图片路径,type为string的时候,为文本内容
	
	private Integer height = 0;// 高度 (type为image的时候,为图片的高度)
	
	private Integer width = 0; // 宽度 (type为image的时候,为图片的宽度,type为string的时候,为文本范围的宽度并计算居中)

	private int[] color = {0 , 0 , 0 ,1};

	private String fontFamily = "Default";

	private Integer fontBold = 0;

	private Integer x = 0;// 距离左部的像素
	
	private Integer y = 0;// 距离顶部的像素

	public Integer getFontLength() {
		return fontLength;
	}

	public void setFontLength(Integer fontLength) {
		this.fontLength = fontLength;
	}

	public String getCenter() {
		return center == null ? "" : center;
	}

	public void setCenter(String center) {
		this.center = center;
	}

	public int[] getColor() {
		return color;
	}

	public void setColor(int[] color) {
		this.color = color;
	}

	public String getFontFamily() {
		return fontFamily == null ? "" : fontFamily;
	}

	public void setFontFamily(String fontFamily) {
		this.fontFamily = fontFamily;
	}

	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder("{");
		sb.append("\"fontSize\":")
				.append(fontSize);
		sb.append(",\"type\":\"")
				.append(type).append('\"');
		sb.append(",\"center\":")
				.append(center);
		sb.append(",\"content\":\"")
				.append(content).append('\"');
		sb.append(",\"height\":")
				.append(height);
		sb.append(",\"width\":")
				.append(width);
		sb.append(",\"color\":")
				.append(Arrays.toString(color));
		sb.append(",\"fontFamily\":\"")
				.append(fontFamily).append('\"');
		sb.append(",\"fontBold\":")
				.append(fontBold);
		sb.append(",\"x\":")
				.append(x);
		sb.append(",\"y\":")
				.append(y);
		sb.append('}');
		return sb.toString();
	}

	public Integer getFontBold() {
		return fontBold;
	}

	public void setFontBold(Integer fontBold) {
		this.fontBold = fontBold;
	}

	public CreateImageBean() {
		super();
	}

	public CreateImageBean(String type, String content, Integer x, Integer y, Integer height,
						   Integer width, Integer fontSize) {
		super();
		this.type = type;
		this.content = content;
		this.height = height;
		this.width = width;
		this.x = x;
		this.y = y;
		this.fontSize = fontSize;
	}
	
	public CreateImageBean(String type, String content, Integer x, Integer y, Integer height,
			Integer width) {
		super();
		this.type = type;
		this.content = content;
		this.height = height;
		this.width = width;
		this.x = x;
		this.y = y;
	}
	
	public Integer getFontSize() {
		return fontSize;
	}

	public void setFontSize(Integer fontSize) {
		this.fontSize = fontSize;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Integer getHeight() {
		return height;
	}

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

	public Integer getWidth() {
		return width;
	}

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

	public Integer getX() {
		return x;
	}

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

	public Integer getY() {
		return y;
	}

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








