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

import com.google.gson.annotations.Expose;
import com.persagy.adm.diagram.core.model.base.XY;
import com.persagy.adm.diagram.core.model.logic.DataFilter;

import java.util.List;

/**
 * 设备图例
 * @author zhaoyk
 */
public class Legend {

	@Expose(serialize = false)
	private String id;

	@Expose(serialize = false)
	private String code;

	@Expose(serialize = false)
	private String name;

	@Expose(serialize = false)
	private String remark;

	@Expose(serialize = false)
	private String system;

	@Expose
	private int width;

	@Expose
	private int height;

	/**
	 * 支持的设备类型
	 */
	@Expose
	private List<String> equipmentTypes;

	@Expose
	private List<Anchor> anchors;

	/**
	 * 适用的系统图类型，优先逻辑，不做强约束
	 */
	@Expose
	private List<String> diagramTypes;

	/**
	 * 匹配数据的过滤条件
	 */
	@Expose
	private DataFilter dataFilter;

	/**
	 * 轮廓图形
	 */
	@Expose
	private List<List<XY>> outline;

	/**
	 * 默认显示的信息点
	 */
	@Expose
	private List<String> infos;

	public Anchor getAnchor(String code){
		if(anchors != null){
			for(Anchor anchor : anchors) {
				if(anchor.getCode().equals(code)) {
					return anchor;
				}
			}
		}
		return null;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getSystem() {
		return system;
	}

	public void setSystem(String system) {
		this.system = system;
	}

	public int getWidth() {
		return width;
	}

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

	public int getHeight() {
		return height;
	}

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

	public List<String> getEquipmentTypes() {
		return equipmentTypes;
	}

	public void setEquipmentTypes(List<String> equipmentTypes) {
		this.equipmentTypes = equipmentTypes;
	}

	public List<Anchor> getAnchors() {
		return anchors;
	}

	public void setAnchors(List<Anchor> anchors) {
		this.anchors = anchors;
	}

	public List<String> getDiagramTypes() {
		return diagramTypes;
	}

	public void setDiagramTypes(List<String> diagramTypes) {
		this.diagramTypes = diagramTypes;
	}

	public DataFilter getDataFilter() {
		return dataFilter;
	}

	public void setDataFilter(DataFilter dataFilter) {
		this.dataFilter = dataFilter;
	}

	public List<List<XY>> getOutline() {
		return outline;
	}

	public void setOutline(List<List<XY>> outline) {
		this.outline = outline;
	}

	public List<String> getInfos() {
		return infos;
	}

	public void setInfos(List<String> infos) {
		this.infos = infos;
	}

}
