package com.persagy.adm.diagram.core;

import com.persagy.adm.diagram.core.model.Diagram;
import com.persagy.adm.diagram.core.model.base.XY;
import com.persagy.adm.diagram.core.model.template.MainPipe;
import com.persagy.adm.diagram.core.model.DiagramNode;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 系统图展现层结构
 * @author zhaoyk
 */
@Data
public class DiagramView {

	private String id;

	private String name;

	private String type;

	private String system;

	private String templateId;

	private List<DiagramNode> nodes = new ArrayList<>();

	private List lines = new ArrayList();

	private List<MainPipe> mainPipes = new ArrayList<>();

	private String projectId;

	private String systemId;

	private XY size;

	public DiagramView(Diagram diagram) {
		this.id = diagram.getId();
		this.name = diagram.getName();
		this.type = diagram.getType();
		this.system = diagram.getSystem();
		this.templateId = diagram.getTemplateId();
		this.nodes = diagram.getNodes();
		this.lines = diagram.getLines();
		this.mainPipes = diagram.getTemplate().getMainPipes();
		this.projectId = diagram.getProjectId();
		this.systemId = diagram.getSystemId();
		this.size = diagram.getTemplate().getFrame().getSize();
	}

}
