package com.persagy.adm.diagram.core.model.base;

import com.google.gson.annotations.Expose;

/**
 * 组件的定位
 * @author zhaoyk
 */
public class PositionData {

	@Expose
	public int minW;

	@Expose
	public int minH;

	@Expose
	public int paddingTop;

	@Expose
	public int paddingRight;

	@Expose
	public int paddingBottom;

	@Expose
	public int paddingLeft;

	/**
	 * 是否为绝对坐标定位
	 */
	@Expose
	private boolean absolute;

	/**
	 * 绝对坐标定位点
	 */
	@Expose
	private XY absolutePoint;

	public boolean isAbsolute() {
		return absolute;
	}

	public void setAbsolute(boolean absolute) {
		this.absolute = absolute;

		if(!absolute) {
			absolutePoint = null;
		}
	}

	public XY getAbsolutePoint() {
		return absolutePoint;
	}

	public void setAbsolutePoint(XY absolutePoint) {
		this.absolutePoint = absolutePoint;
	}

	public int totalPaddingWidth(){
		return paddingLeft + paddingRight;
	}

	public int totalPaddingHeight(){
		return paddingTop + paddingBottom;
	}

}
