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; } }