fun store(o: Any): Element? { val p: PortalIcon = o as PortalIcon if (!p.isActive()) { return null } val element = Element("PortalIcon") storeCommonAttributes(p, element) element.setAttribute("scale", String.valueOf(p.getScale())) element.setAttribute("rotate", String.valueOf(p.getDegrees())) val portal: Portal = p.getPortal() if (portal == null) { log.info("PortalIcon has no associated Portal.") return null } element.setAttribute("portalName", portal.getName()) if (portal.getToBlock() != null) { element.setAttribute("toBlockName", portal.getToBlockName()) } if (portal.getFromBlockName() != null) { element.setAttribute("fromBlockName", portal.getFromBlockName()) } element.setAttribute("arrowSwitch", "" + if (p.getArrowSwitch()) "yes" else "no") element.setAttribute("arrowHide", "" + if (p.getArrowHide()) "yes" else "no") element.setAttribute( "class", "jmri.jmrit.display.controlPanelEditor.configurexml.PortalIconXml" ) return element }
Default implementation for storing the contents of a PortalIcon