Class PrintDropship

All Implemented Interfaces:
Printable, IdConstants
Direct Known Subclasses:
PrintCapitalShip

public class PrintDropship extends PrintAero
Record sheet layout for Dropships, base class for other large craft
  • Field Details

    • MAX_SINGLE_PAGE_LINES

      public static final int MAX_SINGLE_PAGE_LINES
      The maximum number of inventory lines to print as a single page. Ideally this would be determined by the space allocated by the svg template, but we need to determine how many pages we are printing before the template is loaded so we predetermine the value.
      See Also:
    • PREFERRED_SINGLE_PAGE_LINES

      public static final int PREFERRED_SINGLE_PAGE_LINES
      The maximum number of lines to put on the first page if there has to be a second. This is lower than the maximum to avoid having to scale down the text too much on the first page while having empty space on the second.
      See Also:
  • Constructor Details

    • PrintDropship

      public PrintDropship(megamek.common.Aero ship, int startPage, RecordSheetOptions options)
      Creates an SVG object for the record sheet
      Parameters:
      ship - The ship to print
      startPage - The print job page number for this sheet
      options - Overrides the global options for which elements are printed
    • PrintDropship

      public PrintDropship(megamek.common.Aero ship, int startPage)
      Creates an SVG object for the record sheet using the global printing options
      Parameters:
      ship - The ship to print
      startPage - The print job page number for this sheet
  • Method Details

    • getEntity

      public megamek.common.Entity getEntity()
      Overrides:
      getEntity in class PrintAero
    • getPageCount

      public int getPageCount()
      Overrides:
      getPageCount in class PrintRecordSheet
      Returns:
      The number of pages required to print this record sheet
    • getSVGFileName

      protected String getSVGFileName(int pageNumber)
      Overrides:
      getSVGFileName in class PrintAero
      Parameters:
      pageNumber - The page number in the current record sheet, where the first page is numbered zero.
      Returns:
      The file name for the current page in the record sheet image directory
    • getRecordSheetTitle

      protected String getRecordSheetTitle()
      Overrides:
      getRecordSheetTitle in class PrintAero
      Returns:
      The title to use for the record sheet
    • processImage

      public void processImage(int pageNum, PageFormat pageFormat)
      Description copied from class: PrintRecordSheet
      Renders the sheet to the Graphics object.
      Overrides:
      processImage in class PrintAero
      Parameters:
      pageNum - Indicates which page of multi-page sheets to print. The first page is 0.
    • writeTextFields

      protected void writeTextFields()
      Overrides:
      writeTextFields in class PrintAero
    • writeEquipment

      protected void writeEquipment(org.w3c.dom.svg.SVGRectElement svgRect)
      Description copied from class: PrintEntity
      Fills in the weapons and inventory section of the record sheet.
      Overrides:
      writeEquipment in class PrintEntity
      Parameters:
      svgRect - The bounds of the text region
    • formatFeatures

      public String formatFeatures()
      Description copied from class: PrintEntity
      Space for misc equipment such as cargo space and SV chassis mods.
      Overrides:
      formatFeatures in class PrintAero
      Returns:
      A list of misc equipment, or an empty String if none
    • supportsAlternateArmorGrouping

      public boolean supportsAlternateArmorGrouping()
      Overrides:
      supportsAlternateArmorGrouping in class PrintAero