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
Handle configuration for display.PositionableLabel objects
-
Nested Class Summary
Nested classes/interfaces inherited from class jmri.configurexml.AbstractXmlAdapter
AbstractXmlAdapter.EnumIO<T extends Enum<T>>, AbstractXmlAdapter.EnumIoMapped<T extends Enum<T>>, AbstractXmlAdapter.EnumIoNames<T extends Enum<T>>, AbstractXmlAdapter.EnumIoNamesNumbers<T extends Enum<T>>, AbstractXmlAdapter.EnumIoOrdinals<T extends Enum<T>> -
Field Summary
Fields inherited from class jmri.configurexml.AbstractXmlAdapter
STR_FALSE, STR_NO, STR_TRUE, STR_YES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected NamedIcongetNamedIcon(String childName, org.jdom2.Element element, String name, Editor ed) voidCreate a PositionableLabel, then add to a target JLayeredPanebooleanload(org.jdom2.Element shared, org.jdom2.Element perNode) Create a set of configured objects from their XML description.voidloadCommonAttributes(Positionable l, int defaultLevel, org.jdom2.Element element) loadIcon(PositionableLabel l, String attrName, org.jdom2.Element element, String name, Editor ed) voidloadLogixNG_Data(Positionable p, org.jdom2.Element element) protected voidloadTextInfo(Positionable l, org.jdom2.Element element) (package private) StringsimplifyFontname(String fontname, int style) Remove verbose and redundant information from fontname field unless that's been disabled in preferencesorg.jdom2.ElementDefault implementation for storing the contents of a PositionableLabelvoidstoreCommonAttributes(Positionable p, org.jdom2.Element element) Default implementation for storing the common contents of an Iconorg.jdom2.ElementvoidstoreLogixNG_Data(Positionable p, org.jdom2.Element element) protected voidstoreTextInfo(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 Details
-
PositionableLabelXml
public PositionableLabelXml()
-
-
Method Details
-
store
Default implementation for storing the contents of a PositionableLabel- Parameters:
o- Object to store, of type PositionableLabel- Returns:
- Element containing the complete info
-
storeTextInfo
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
Default implementation for storing the common contents of an Icon- Parameters:
p- the icon to storeelement- the XML representation of the icon
-
storeIcon
-
storeLogixNG_Data
-
load
Description copied from class:AbstractXmlAdapterCreate a set of configured objects from their XML description.- Specified by:
loadin interfaceXmlAdapter- Overrides:
loadin 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
Create a PositionableLabel, then add to a target JLayeredPane- Specified by:
loadin interfaceXmlAdapter- Overrides:
loadin 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
-
loadCommonAttributes
public void loadCommonAttributes(Positionable l, int defaultLevel, org.jdom2.Element element) throws JmriConfigureXmlException - Throws:
JmriConfigureXmlException
-
simplifyFontname
Remove verbose and redundant information from fontname field unless that's been disabled in preferences- Parameters:
fontname- The system-specific font name with a possible trailing .plain, etcstyle- From the Font class static style values- Returns:
- A font name without trailing modifiers
-
loadIcon
-
getNamedIcon
protected NamedIcon getNamedIcon(String childName, org.jdom2.Element element, String name, Editor ed) -
loadLogixNG_Data
-