/*
* Set Output tab defaults
*/
- epsRendering
-.addItem("Prompt each time");
- epsRendering.addItem(MessageManager.getString("label.lineart"));
- epsRendering.addItem(MessageManager.getString("action.text"));
- epsRendering.setSelectedItem(Cache.getDefault("EPS_RENDERING",
- "Prompt each time"));
+ epsRendering.addItem(new OptionsParam(MessageManager
+ .getString("label.prompt_each_time"), "Prompt each time"));
+ epsRendering.addItem(new OptionsParam(MessageManager
+ .getString("label.lineart"), "Lineart"));
+ epsRendering.addItem(new OptionsParam(MessageManager
+ .getString("action.text"), "Text"));
+ String defaultEPS = Cache.getDefault("EPS_RENDERING",
+ "Prompt each time");
+ if (defaultEPS.equalsIgnoreCase("Text"))
+ {
+ epsRendering.setSelectedItem(new OptionsParam(MessageManager
+ .getString("action.text"), "Text"));
+ }
+ else if (defaultEPS.equalsIgnoreCase("Lineart"))
+ {
+ epsRendering.setSelectedItem(new OptionsParam(MessageManager
+ .getString("label.lineart"), "Lineart"));
+ }
+ else
+ {
+ epsRendering.setSelectedItem(new OptionsParam(MessageManager
+ .getString("label.prompt_each_time"), "Prompt each time"));
+ }
autoIdWidth.setSelected(Cache.getDefault("FIGURE_AUTOIDWIDTH", false));
userIdWidth.setEnabled(!autoIdWidth.isSelected());
userIdWidthlabel.setEnabled(!autoIdWidth.isSelected());
}
else
{
- Cache.applicationProperties.setProperty("EPS_RENDERING", epsRendering
- .getSelectedItem().toString());
+ Cache.applicationProperties.setProperty("EPS_RENDERING",
+ ((OptionsParam) epsRendering.getSelectedItem()).getCode());
}
/*
}
}
+ public class OptionsParam
+ {
+ private String name;
+
+ private String code;
+
+ public OptionsParam(String name, String code)
+ {
+ this.name = name;
+ this.code = code;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getCode()
+ {
+ return code;
+ }
+
+ public void setCode(String code)
+ {
+ this.code = code;
+ }
+
+ @Override
+ public String toString()
+ {
+ return name;
+ }
+
+ @Override
+ public boolean equals(Object that)
+ {
+ if (!(that instanceof OptionsParam))
+ {
+ return false;
+ }
+ return this.code.equalsIgnoreCase(((OptionsParam) that).code);
+ }
+
+ @Override
+ public int hashCode(){
+ return name.hashCode() + code.hashCode();
+ }
+ }
}