Search in sources :

Example 1 with PositionableShape

use of jmri.jmrit.display.controlPanelEditor.shape.PositionableShape in project JMRI by JMRI.

the class PositionableShapeXml method store.

/**
     * Default implementation for storing the contents of a PositionableShape
     *
     * @param o Object to store, of type PositionableShape
     * @return Element containing the complete info
     */
@Override
public Element store(Object o) {
    PositionableShape p = (PositionableShape) o;
    if (!p.isActive()) {
        // if flagged as inactive, don't store
        return null;
    }
    Element element = new Element("PositionableShape");
    storeCommonAttributes(p, element);
    element.setAttribute("class", "jmri.jmrit.display.controlPanelEditor.shape.configurexml.PositionableShapeXml");
    return element;
}
Also used : PositionableShape(jmri.jmrit.display.controlPanelEditor.shape.PositionableShape) Element(org.jdom2.Element)

Example 2 with PositionableShape

use of jmri.jmrit.display.controlPanelEditor.shape.PositionableShape in project JMRI by JMRI.

the class PositionableShapeXml method load.

/**
     * Create a PositionableShape, then add to a target JLayeredPane
     *
     * @param element Top level Element to unpack.
     * @param o       Editor as an Object
     */
@Override
public void load(Element element, Object o) {
    // create the objects
    Editor ed = (Editor) o;
    PositionableShape ps = new PositionableShape(ed);
    ed.putItem(ps);
    // load individual item's option settings after editor has set its global settings
    loadCommonAttributes(ps, Editor.MARKERS, element);
}
Also used : PositionableShape(jmri.jmrit.display.controlPanelEditor.shape.PositionableShape) Editor(jmri.jmrit.display.Editor)

Aggregations

PositionableShape (jmri.jmrit.display.controlPanelEditor.shape.PositionableShape)2 Editor (jmri.jmrit.display.Editor)1 Element (org.jdom2.Element)1