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
  • Constructor Details

  • Method Details

    • store

      public org.jdom2.Element store(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 store
      element - 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 store
      element - the XML representation of the icon
    • storeIcon

      public org.jdom2.Element storeIcon(String elemName, NamedIcon 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 interface XmlAdapter
      Overrides:
      load in class AbstractXmlAdapter
      Parameters:
      shared - Top-level XML element containing the common, multi-node elements of the description
      perNode - 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, Object o) throws JmriConfigureXmlException
      Create a PositionableLabel, then add to a target JLayeredPane
      Specified by:
      load in interface XmlAdapter
      Overrides:
      load in class AbstractXmlAdapter
      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
    • simplifyFontname

      String simplifyFontname(String fontname, int style)
      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, etc
      style - From the Font class static style values
      Returns:
      A font name without trailing modifiers
    • loadIcon

      public NamedIcon loadIcon(PositionableLabel l, String attrName, org.jdom2.Element element, String name, Editor ed)
    • getNamedIcon

      protected NamedIcon getNamedIcon(String childName, org.jdom2.Element element, String name, Editor ed)
    • loadLogixNG_Data

      public void loadLogixNG_Data(Positionable p, org.jdom2.Element element)