Class ImageSaver

All Implemented Interfaces:
PropertyChangeListener, EventListener, AutoConfigurable, Buildable, Configurable, GameComponent, PropertyNameSource, ValidityChecker, Translatable, Auditable, ImageSearchTarget, SearchTarget

public class ImageSaver extends AbstractToolbarItem
This allows the user to capture a snapshot of the entire map into a PNG file.
  • Field Details Link icon

  • Constructor Details Link icon

    • ImageSaver Link icon

      public ImageSaver()
    • ImageSaver Link icon

      public ImageSaver(Map m)
  • Method Details Link icon

    • addTo Link icon

      public void addTo(Buildable b)
      Expects to be added to a Map. Adds a button to the map window toolbar that initiates the capture
      Specified by:
      addTo in interface Buildable
      Overrides:
      addTo in class AbstractToolbarItem
      Parameters:
      b - parent Buildable to add this component to as a subcomponent.
    • removeFrom Link icon

      public void removeFrom(Buildable b)
      Description copied from class: AbstractToolbarItem
      Remove from our parent
      Specified by:
      removeFrom in interface Configurable
      Overrides:
      removeFrom in class AbstractToolbarItem
      Parameters:
      b - parent
    • writeMapAsImage Link icon

      public void writeMapAsImage()
      Write a PNG-encoded snapshot of the map.
    • writeMapRectAsImage Link icon

      protected void writeMapRectAsImage(File file, int x, int y, int w, int h)
      Helper method for writing images.
      Parameters:
      file - the file to write
      x - the left edge of the map area to write
      y - the top edge of the map area to write
      w - the width of the map area to write
      h - the height of the map area to write
    • getHelpFile Link icon

      public HelpFile getHelpFile()
      Returns:
      a HelpFile describing how to use and configure * this component
    • getConfigureTypeName Link icon

      public static String getConfigureTypeName()
    • getAllowableConfigureComponents Link icon

      public Class<?>[] getAllowableConfigureComponents()
      Returns:
      a list of valid sub-component Classes. If a Class appears in this list, then instances of that class may be added to this component from the Editor's ConfigureTree window by right-clicking on the component and selecting the appropriate "Add" option.
    • isMandatory Link icon

      public boolean isMandatory()
      Description copied from interface: Buildable
      Is this component a reqired component within its parent?
      Returns:
      true if component is mandatory
    • isUnique Link icon

      public boolean isUnique()
      Description copied from interface: Buildable
      Does this component need to be unique within it's parent?
      Returns: