raimund@3629: package de.intevation.flys.artifacts.states.minfo; raimund@3629: raimund@3629: import org.w3c.dom.Element; raimund@3629: raimund@3629: import de.intevation.artifacts.Artifact; raimund@3629: import de.intevation.artifacts.CallContext; raimund@3629: import de.intevation.artifacts.CallMeta; raimund@3629: import de.intevation.artifacts.common.utils.XMLUtils; raimund@3629: import de.intevation.flys.artifacts.resources.Resources; raimund@3629: import de.intevation.flys.artifacts.states.DefaultState; raimund@3629: raimund@3629: public class CharDiameter extends DefaultState { raimund@3629: raimund@3629: public static final String UI_PROVIDER = "minfo.bed.char_diameter"; raimund@3629: raimund@3629: private static final String CHAR_DIAMETER_MIN = "calc.bed.dmin"; raimund@3629: private static final String CHAR_DIAMETER_MAX = "calc.bed.dmax"; raimund@3629: private static final String CHAR_DIAMETER_MID = "calc.bed.dmid"; raimund@3629: private static final String CHAR_DIAMETER_90 = "calc.bed.d90"; raimund@3629: private static final String CHAR_DIAMETER_84 = "calc.bed.d84"; raimund@3629: private static final String CHAR_DIAMETER_80 = "calc.bed.d80"; raimund@3629: private static final String CHAR_DIAMETER_75 = "calc.bed.d75"; raimund@3629: private static final String CHAR_DIAMETER_70 = "calc.bed.d70"; raimund@3629: private static final String CHAR_DIAMETER_60 = "calc.bed.d60"; raimund@3629: private static final String CHAR_DIAMETER_50 = "calc.bed.d50"; raimund@3629: private static final String CHAR_DIAMETER_40 = "calc.bed.d40"; raimund@3629: private static final String CHAR_DIAMETER_30 = "calc.bed.d30"; raimund@3629: private static final String CHAR_DIAMETER_25 = "calc.bed.d25"; raimund@3629: private static final String CHAR_DIAMETER_20 = "calc.bed.d20"; raimund@3629: private static final String CHAR_DIAMETER_16 = "calc.bed.d16"; raimund@3629: private static final String CHAR_DIAMETER_10 = "calc.bed.d10"; raimund@3629: raimund@3629: public static final String[] CHAR_DIAMETER = { raimund@3629: CHAR_DIAMETER_10, raimund@3629: CHAR_DIAMETER_16, raimund@3629: CHAR_DIAMETER_20, raimund@3629: CHAR_DIAMETER_25, raimund@3629: CHAR_DIAMETER_30, raimund@3629: CHAR_DIAMETER_40, raimund@3629: CHAR_DIAMETER_50, raimund@3629: CHAR_DIAMETER_60, raimund@3629: CHAR_DIAMETER_70, raimund@3629: CHAR_DIAMETER_75, raimund@3629: CHAR_DIAMETER_80, raimund@3629: CHAR_DIAMETER_84, raimund@3629: CHAR_DIAMETER_90, raimund@3629: CHAR_DIAMETER_MAX, raimund@3629: CHAR_DIAMETER_MID, raimund@3629: CHAR_DIAMETER_MIN raimund@3629: }; raimund@3629: raimund@3629: @Override raimund@3629: public String getUIProvider() { raimund@3629: return UI_PROVIDER; raimund@3629: } raimund@3629: raimund@3629: @Override raimund@3629: protected Element[] createItems( raimund@3629: XMLUtils.ElementCreator cr, raimund@3629: Artifact artifact, raimund@3629: String name, raimund@3629: CallContext context) raimund@3629: { raimund@3629: CallMeta meta = context.getMeta(); raimund@3629: Element[] calcs = new Element[CHAR_DIAMETER.length]; raimund@3629: raimund@3629: for (int i = 0; i < CHAR_DIAMETER.length; ++i) { raimund@3629: String calc = CHAR_DIAMETER[i]; raimund@3629: calcs[i] = createItem( raimund@3629: cr, new String[] { raimund@3629: Resources.getMsg(meta, calc, calc), raimund@3629: calc raimund@3629: }); raimund@3629: } raimund@3629: raimund@3629: return calcs; raimund@3629: } raimund@3629: raimund@3629: }