package cn.com.qmth.stmms.biz.mark.model;

import java.io.Serializable;

public class SpecialTagDTO implements Serializable {

    private static final long serialVersionUID = -5424015292124065736L;

    private String tagName;

    private Double positionX;

    private Double positionY;

    private Integer offsetIndex;

    private Integer offsetX;

    private Integer offsetY;

    public SpecialTagDTO() {

    }

    public SpecialTagDTO(MarkSpecialTag markSpecialTag) {
        this.tagName = markSpecialTag.getTagName();
        this.positionX = markSpecialTag.getPositionX();
        this.positionY = markSpecialTag.getPositionY();
        this.offsetIndex = markSpecialTag.getOffsetIndex();
        this.offsetX = markSpecialTag.getOffsetX();
        this.offsetY = markSpecialTag.getOffsetY();
    }

    public SpecialTagDTO(TrialTag tag) {
        this.tagName = tag.getContent();
        this.positionX = tag.getPositionX();
        this.positionY = tag.getPositionY();
        this.offsetIndex = tag.getOffsetIndex();
        this.offsetX = tag.getOffsetX();
        this.offsetY = tag.getOffsetY();
    }

    public SpecialTagDTO(HeaderTag tag) {
        this.tagName = tag.getTagName();
        this.positionX = tag.getPositionX();
        this.positionY = tag.getPositionY();
        this.offsetIndex = tag.getOffsetIndex();
        this.offsetX = tag.getOffsetX();
        this.offsetY = tag.getOffsetY();
    }

    public MarkSpecialTag transform(MarkLibrary library) {
        MarkSpecialTag markSpecialTag = new MarkSpecialTag();
        markSpecialTag.setLibraryId(library.getId());
        markSpecialTag.setTagName(tagName);
        markSpecialTag.setPositionX(positionX);
        markSpecialTag.setPositionY(positionY);
        markSpecialTag.setOffsetIndex(offsetIndex);
        markSpecialTag.setOffsetX(offsetX);
        markSpecialTag.setOffsetY(offsetY);
        return markSpecialTag;
    }

    public TrialTag transform(TrialLibrary library) {
        TrialTag tag = new TrialTag();
        tag.setLibraryId(library.getId());
        tag.setMarkerId(library.getMarkerId());
        tag.setContent(tagName);
        tag.setPositionX(positionX);
        tag.setPositionY(positionY);
        tag.setOffsetIndex(offsetIndex);
        tag.setOffsetX(offsetX);
        tag.setOffsetY(offsetY);
        return tag;
    }

    public HeaderTag transform(ArbitrateHistory library) {
        HeaderTag markSpecialTag = new HeaderTag();
        markSpecialTag.setStudentId(library.getStudentId());
        markSpecialTag.setGroupNumber(library.getGroupNumber());
        markSpecialTag.setUserId(library.getUserId());
        markSpecialTag.setTagName(tagName);
        markSpecialTag.setPositionX(positionX);
        markSpecialTag.setPositionY(positionY);
        markSpecialTag.setOffsetIndex(offsetIndex);
        markSpecialTag.setOffsetX(offsetX);
        markSpecialTag.setOffsetY(offsetY);
        return markSpecialTag;
    }

    public String getTagName() {
        return tagName;
    }

    public void setTagName(String tagName) {
        this.tagName = tagName;
    }

    public Double getPositionX() {
        return positionX;
    }

    public void setPositionX(Double positionX) {
        this.positionX = positionX;
    }

    public Double getPositionY() {
        return positionY;
    }

    public void setPositionY(Double positionY) {
        this.positionY = positionY;
    }

    public Integer getOffsetIndex() {
        return offsetIndex;
    }

    public void setOffsetIndex(Integer offsetIndex) {
        this.offsetIndex = offsetIndex;
    }

    public void setOffsetX(Integer offsetX) {
        this.offsetX = offsetX;
    }

    public Integer getOffsetX() {
        return offsetX;
    }

    public Integer getOffsetY() {
        return offsetY;
    }

    public void setOffsetY(Integer offsetY) {
        this.offsetY = offsetY;
    }
}
