package com.blueland.bpm.manage.web;

public class TreeNode {
	//private String tId; 
	private String id;  
    private String pId;  
    private String name;  
    private boolean checked;  
    private boolean open;
    private boolean isParent;
    private String type;
    private String isAccessTopNode;
    private Integer level;
    private static final String pre_icon_path="/ebpm-process-manage/resource/js/plugins/zTree/";
    private String icon=pre_icon_path+"css/zTreeStyle/img/diy/1_open.png";
    
    //private boolean isMulti;
    public static final String TOPORGIMAGE = pre_icon_path+"css/zTreeStyle/img/diy/home.png";
    public static final String ORGIMAGE = pre_icon_path+"css/zTreeStyle/img/diy/1_open.png";
    public static final String USERIMAGE = pre_icon_path+"css/zTreeStyle/img/diy/1_openUser.png";
    public static final String GROUPIMAGE = pre_icon_path+"css/zTreeStyle/img/diy/1_openGroup.png";
    // 红勾选（流程未结束）
    public static final String TOPNOTFINISH = pre_icon_path+"css/zTreeStyle/img/diy/ico-agree1.png";
    //绿勾选（流程已结束）
    public static final String TOPFINISH = pre_icon_path+"css/zTreeStyle/img/diy/ico-agree.png";
   
    public TreeNode(String id, String pId, String name, boolean checked, boolean open,boolean isParent,String type,String isAccessTopNode,Integer level) {  
        super();  
        this.id = id;  
        //this.tId=id;
        this.pId = pId;  
        this.name = name;  
        this.checked = checked;  
        this.open = open;  
        this.isParent = isParent;  
        this.type=type;
        this.isAccessTopNode=isAccessTopNode;
        if(type.equals("TOPORG")){
        	this.icon=TOPORGIMAGE;
        }else if(type.equals("ORG")){
        	this.icon=ORGIMAGE;
        }else if(type.equals("USER")){
        	this.icon=USERIMAGE;
        }
        this.level=level;
        //this.isMulti=isMulti;
        
    }  
    
    public TreeNode(String id, String pId, String name,boolean isParent,String type) {  
        super();  
        this.id = id;  
        //this.tId=id;
        this.pId = pId;  
        this.name = name;  
        this.checked = false;  
        this.open = true;  
        this.isParent = isParent;  
        this.type=type;
        if(type.equals("TOPORG")){
        	this.icon=TOPORGIMAGE;
        }else if(type.equals("ORG")){
        	this.icon=ORGIMAGE;
        }else if(type.equals("USER")){
        	this.icon=USERIMAGE;
        }else if(type.equals("NODEFINISH")){
        	this.icon=TOPFINISH;
        }else if(type.equals("NODENOTFINISH")){
        	this.icon=TOPNOTFINISH;
        }
       // this.isMulti=isMulti;
        
    }  
    
    public TreeNode() {  
        super();  
    }  
 
	/** 
     * @return the id 
     */  
    public String getId() {  
        return id;  
    }  
    /** 
     * @param id the id to set 
     */  
    public void setId(String id) {  
        this.id = id;  
    }  
   
    /** 
     * @return the name 
     */  
    public String getName() {  
        return name;  
    }  
    /** 
     * @param name the name to set 
     */  
    public void setName(String name) {  
        this.name = name;  
    }  
    /** 
     * @return the checked 
     */  
    public boolean getChecked() {  
        return checked;  
    }  
    /** 
     * @param checked the checked to set 
     */  
    public void setChecked(boolean checked) {  
        this.checked = checked;  
    }  
    /** 
     * @return the open 
     */  
    public boolean isOpen() {  
        return open;  
    }  
    /** 
     * @param open the open to set 
     */  
    public void setOpen(boolean open) {  
        this.open = open;  
    }
	/**
	 * @return the pId
	 */
	public String getpId() {
		return pId;
	}
	/**
	 * @param pId the pId to set
	 */
	public void setpId(String pId) {
		this.pId = pId;
	}
	/**
	 * @return the isParent
	 */
	public boolean getIsParent() {
		return isParent;
	}
	/**
	 * @param isParent the isParent to set
	 */
	public void setIsParent(boolean isParent) {
		this.isParent = isParent;
	}
	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}
	/**
	 * @return the isAccess
	 */
	public String getIsAccessTopNode() {
		return isAccessTopNode;
	}
	/**
	 * @param isAccess the isAccess to set
	 */
	public void setIsAccessTopNode(String isAccessTopNode) {
		this.isAccessTopNode = isAccessTopNode;
	}
	public String getIcon() {
		return icon;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}


	public void setParent(boolean isParent) {
		this.isParent = isParent;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

//	public boolean isMulti() {
//		return isMulti;
//	}
//
//	public void setMulti(boolean isMulti) {
//		this.isMulti = isMulti;
//	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TreeNode other = (TreeNode) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
	
}
