Package jmri.jmrit.display.configurexml
Class PositionableLabelXml
- java.lang.Object
-
- jmri.configurexml.AbstractXmlAdapter
-
- jmri.jmrit.display.configurexml.PositionableLabelXml
-
- All Implemented Interfaces:
XmlAdapter
- Direct Known Subclasses:
AnalogClock2DisplayXml
,AudioIconXml
,BlockContentsIconXml
,GlobalVariableComboIconXml
,GlobalVariableIconXml
,GlobalVariableInputIconXml
,GlobalVariableSpinnerIconXml
,IndicatorTrackIconXml
,IndicatorTurnoutIconXml
,LightIconXml
,LinkingLabelXml
,LocoIconXml
,LogixNGIconXml
,MemoryComboIconXml
,MemoryIconXml
,MemoryInputIconXml
,MemorySpinnerIconXml
,MultiSensorIconXml
,PortalIconXml
,ReporterIconXml
,RpsPositionIconXml
,SensorIconXml
,SignalHeadIconXml
,SignalMastIconXml
,SlipTurnoutIconXml
,TurnoutIconXml
public class PositionableLabelXml extends AbstractXmlAdapter
Handle configuration for display.PositionableLabel objects
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.configurexml.AbstractXmlAdapter
AbstractXmlAdapter.EnumIO<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoMapped<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoNames<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoNamesNumbers<T extends java.lang.Enum<T>>, AbstractXmlAdapter.EnumIoOrdinals<T extends java.lang.Enum<T>>
-
-
Constructor Summary
Constructors Constructor Description PositionableLabelXml()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NamedIcon
getNamedIcon(java.lang.String childName, org.jdom2.Element element, java.lang.String name, Editor ed)
void
load(org.jdom2.Element element, java.lang.Object o)
Create a PositionableLabel, then add to a target JLayeredPaneboolean
load(org.jdom2.Element shared, org.jdom2.Element perNode)
Create a set of configured objects from their XML description.void
loadCommonAttributes(Positionable l, int defaultLevel, org.jdom2.Element element)
NamedIcon
loadIcon(PositionableLabel l, java.lang.String attrName, org.jdom2.Element element, java.lang.String name, Editor ed)
void
loadLogixNG_Data(Positionable p, org.jdom2.Element element)
protected void
loadTextInfo(Positionable l, org.jdom2.Element element)
org.jdom2.Element
store(java.lang.Object o)
Default implementation for storing the contents of a PositionableLabelvoid
storeCommonAttributes(Positionable p, org.jdom2.Element element)
Default implementation for storing the common contents of an Iconorg.jdom2.Element
storeIcon(java.lang.String elemName, NamedIcon icon)
void
storeLogixNG_Data(Positionable p, org.jdom2.Element element)
protected void
storeTextInfo(Positionable p, org.jdom2.Element element)
Store the text formatting information.-
Methods inherited from class jmri.configurexml.AbstractXmlAdapter
getAttributeBooleanValue, getAttributeDoubleValue, getAttributeFloatValue, getAttributeIntegerValue, getExceptionHandler, handleException, load, load, loadDeferred, loadOrder, setExceptionHandler, store
-
-
-
-
Constructor Detail
-
PositionableLabelXml
public PositionableLabelXml()
-
-
Method Detail
-
store
public org.jdom2.Element store(java.lang.Object o)
Default implementation for storing the contents of a PositionableLabel- Parameters:
o
- Object to store, of type PositionableLabel- Returns:
- Element containing the complete info
-
storeTextInfo
protected void storeTextInfo(Positionable p, org.jdom2.Element element)
Store the text formatting information.This is always stored, even if the icon isn't in text mode, because some uses (subclasses) of PositionableLabel flip back and forth between icon and text, and want to remember their formatting.
- Parameters:
p
- the icon to storeelement
- the XML representation of the icon
-
storeCommonAttributes
public void storeCommonAttributes(Positionable p, org.jdom2.Element element)
Default implementation for storing the common contents of an Icon- Parameters:
p
- the icon to storeelement
- the XML representation of the icon
-
storeLogixNG_Data
public void storeLogixNG_Data(Positionable p, org.jdom2.Element element)
-
load
public boolean load(org.jdom2.Element shared, org.jdom2.Element perNode)
Description copied from class:AbstractXmlAdapter
Create a set of configured objects from their XML description.- Specified by:
load
in interfaceXmlAdapter
- Overrides:
load
in classAbstractXmlAdapter
- Parameters:
shared
- Top-level XML element containing the common, multi-node elements of the descriptionperNode
- Top-level XML element containing the private, single-node elements of the description- Returns:
- true if successful
-
load
public void load(org.jdom2.Element element, java.lang.Object o) throws JmriConfigureXmlException
Create a PositionableLabel, then add to a target JLayeredPane- Specified by:
load
in interfaceXmlAdapter
- Overrides:
load
in classAbstractXmlAdapter
- Parameters:
element
- Top level Element to unpack.o
- Editor as an Object- Throws:
JmriConfigureXmlException
- when a error prevents creating the objects as as required by the input XML
-
loadTextInfo
protected void loadTextInfo(Positionable l, org.jdom2.Element element)
-
loadCommonAttributes
public void loadCommonAttributes(Positionable l, int defaultLevel, org.jdom2.Element element) throws JmriConfigureXmlException
- Throws:
JmriConfigureXmlException
-
loadIcon
public NamedIcon loadIcon(PositionableLabel l, java.lang.String attrName, org.jdom2.Element element, java.lang.String name, Editor ed)
-
getNamedIcon
protected NamedIcon getNamedIcon(java.lang.String childName, org.jdom2.Element element, java.lang.String name, Editor ed)
-
loadLogixNG_Data
public void loadLogixNG_Data(Positionable p, org.jdom2.Element element)
-
-