Newer
Older
dxcgt / app / src / main / java / com / smartdot / cgt / model / GraphicSelectItemModel.java
wangxitong on 6 Apr 2021 1 KB first commit
package com.smartdot.cgt.model;

import java.text.MessageFormat;

import com.esri.core.map.Graphic;

public class GraphicSelectItemModel {

    private Graphic graphic;

    private String typeField;

    private String codeField;

    /**
     * @return the graphic
     */
    public Graphic getGraphic() {
        return graphic;
    }

    /**
     * @param graphic
     *            the graphic to set
     */
    public void setGraphic(Graphic graphic) {
        this.graphic = graphic;
    }

    public GraphicSelectItemModel(Graphic graphic, String codeField, String typeField) {
        this.graphic = graphic;
        this.typeField = typeField;
        this.codeField = codeField;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        String description = "    请选择";
        if (this.graphic != null) {
            description = MessageFormat.format("    {0}({1})", this.graphic.getAttributeValue(codeField),
                this.graphic.getAttributeValue(typeField));
        }
        return description;
    }

}