Class ExtensionElement

java.lang.Object
VASSAL.build.module.ExtensionElement
All Implemented Interfaces:
Buildable, ImageSearchTarget

public class ExtensionElement extends Object implements Buildable, ImageSearchTarget
An element of a ModuleExtension that extends an individual Buildable component of the GameModule.
  • Field Details

  • Constructor Details

    • ExtensionElement

      public ExtensionElement()
    • ExtensionElement

      public ExtensionElement(Buildable extension, Configurable[] targetPath)
  • Method Details

    • add

      public void add(Buildable child)
      Description copied from interface: Buildable
      Adds a child component. Both this method and Buildable.addTo(VASSAL.build.Buildable) are invoked when adding a child to a parent
      Specified by:
      add in interface Buildable
      Parameters:
      child - Child to attach to this buildable as a subcomponent
    • build

      public void build(Element e)
      Description copied from interface: Buildable
      Build the object from the XML representation of the Buildable
      Specified by:
      build in interface Buildable
      Parameters:
      e - the XML element containing the object data
    • getExtension

      public Buildable getExtension()
    • getTargetPath

      public Configurable[] getTargetPath()
    • getBuildElement

      public Element getBuildElement(Document doc)
      Specified by:
      getBuildElement in interface Buildable
      Parameters:
      doc - XML file
      Returns:
      an XML element from which this component can be built
    • addTo

      public void addTo(Buildable parent)
      Description copied from interface: Buildable
      Adds this component to its parent. In order to make Buildable objects extensible, the child is responsible for adding itself to the parent. That way, Buildable subcomponents can be defined in an extension package without needing to modify the containing class.
      Specified by:
      addTo in interface Buildable
      Parameters:
      parent - parent Buildable to add this component to as a subcomponent.
    • getAllImageNames

      public SortedSet<String> getAllImageNames()
      Specified by:
      getAllImageNames in interface ImageSearchTarget
      Returns:
      names of all images used by the component and any children
    • addImageNamesRecursively

      public void addImageNamesRecursively(Collection<String> s)
      Description copied from interface: ImageSearchTarget
      Adds all images used by this component AND any children to the collection
      Specified by:
      addImageNamesRecursively in interface ImageSearchTarget
      Parameters:
      s - Collection to add image names to
    • getLocalImageNames

      public SortedSet<String> getLocalImageNames()
      Specified by:
      getLocalImageNames in interface ImageSearchTarget
      Returns:
      names of all images used by this item
    • addLocalImageNames

      public void addLocalImageNames(Collection<String> s)
      Description copied from interface: ImageSearchTarget
      Implementing classes should add the names of any image files they use to the collection.
      Specified by:
      addLocalImageNames in interface ImageSearchTarget
      Parameters:
      s - Collection to add image names to