use of com.zhan_dui.utils.m3u8.Element in project JMRI by JMRI.
the class PerformScriptModelXml method store.
/**
* Default implementation for storing the model contents
*
* @param o Object to store, of type PerformActonModel
* @return Element containing the complete info
*/
@Override
public Element store(Object o) {
Element e = new Element("perform");
PerformScriptModel g = (PerformScriptModel) o;
e.setAttribute("name", FileUtil.getPortableFilename(g.getFileName()));
e.setAttribute("type", "ScriptFile");
e.setAttribute("class", this.getClass().getName());
return e;
}
use of com.zhan_dui.utils.m3u8.Element in project JMRI by JMRI.
the class FileLocationPaneXml method storeUserFilesLocation.
private void storeUserFilesLocation(Element locations, String value) {
Element userLocation = new Element("fileLocation");
userLocation.setAttribute("defaultUserLocation", FileUtil.getPortableFilename(value, true, false));
locations.addContent(userLocation);
}
use of com.zhan_dui.utils.m3u8.Element in project JMRI by JMRI.
the class GuiLafConfigPaneXml method store.
/**
* Default implementation for storing the static contents of the Swing LAF
*
* @param o Object to store, of type GuiLafConfigPane
* @return Element containing the complete info
*/
@Override
public Element store(Object o) {
Element e = new Element("gui");
GuiLafConfigPane g = (GuiLafConfigPane) o;
String lafClassName = g.getClassName();
e.setAttribute("LAFclass", lafClassName);
e.setAttribute("class", this.getClass().getName());
Locale l = g.getLocale();
e.setAttribute("LocaleLanguage", l.getLanguage());
e.setAttribute("LocaleCountry", l.getCountry());
e.setAttribute("LocaleVariant", l.getVariant());
GuiLafPreferencesManager manager = InstanceManager.getDefault(GuiLafPreferencesManager.class);
if (manager.getFontSize() != manager.getDefaultFontSize()) {
e.setAttribute("fontsize", Integer.toString(manager.getFontSize()));
}
e.setAttribute("nonStandardMouseEvent", (g.mouseEvent.isSelected() ? "yes" : "no"));
e.setAttribute("graphicTableState", (g.graphicStateDisplay.isSelected() ? "yes" : "no"));
return e;
}
use of com.zhan_dui.utils.m3u8.Element in project JMRI by JMRI.
the class CreateButtonModelXml method store.
/**
* Default implementation for storing the model contents
*
* @param o Object to store, of type CreateButtonModel
* @return Element containing the complete info
*/
@Override
public Element store(Object o) {
Element element = new Element("perform");
CreateButtonModel g = (CreateButtonModel) o;
element.setAttribute("name", g.getClassName());
element.setAttribute("type", "Button");
element.setAttribute("class", this.getClass().getName());
// NOI18N
Element property = new Element("property");
// NOI18N
property.setAttribute("name", "systemPrefix");
property.setAttribute("value", g.getSystemPrefix());
element.addContent(property);
return element;
}
use of com.zhan_dui.utils.m3u8.Element in project JMRI by JMRI.
the class SystemConsoleConfigPanelXml method store.
/**
* Arrange for console settings to be stored
*
* @param o Object to store, of type SystemConsole
* @return Element containing the complete info
*/
@Override
public Element store(Object o) {
Element e = new Element("console");
e.setAttribute("class", this.getClass().getName());
SystemConsolePreferencesManager manager = InstanceManager.getDefault(SystemConsolePreferencesManager.class);
e.setAttribute("scheme", "" + manager.getScheme());
e.setAttribute("fontfamily", "" + manager.getFontFamily());
e.setAttribute("fontsize", "" + manager.getFontSize());
e.setAttribute("fontstyle", "" + manager.getFontStyle());
e.setAttribute("wrapstyle", "" + manager.getWrapStyle());
return e;
}
Aggregations