Class PrintSmallUnitSheet

java.lang.Object
megameklab.printing.PrintRecordSheet
megameklab.printing.PrintSmallUnitSheet
All Implemented Interfaces:
Printable, IdConstants

public class PrintSmallUnitSheet extends PrintRecordSheet
Lays out a record sheet for infantry, BA, or protoMeks
  • Constructor Details

    • PrintSmallUnitSheet

      public PrintSmallUnitSheet(Collection<? extends megamek.common.units.Entity> entities, int startPage, RecordSheetOptions options)
      Create a record sheet for two vehicles, or one vehicle and tables.
      Parameters:
      entities - The units to print
      startPage - The index of this page in the print job
      options - Options for printing
  • Method Details

    • getBookmarkNames

      public List<String> getBookmarkNames()
      Description copied from class: PrintRecordSheet
      Used to build an outline of a PDF document
      Specified by:
      getBookmarkNames in class PrintRecordSheet
      Returns:
      Names of outline entries
    • processImage

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

      protected String getSVGFileName(int pageNumber)
      Specified by:
      getSVGFileName in class PrintRecordSheet
      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()
      Specified by:
      getRecordSheetTitle in class PrintRecordSheet
      Returns:
      The title to use for the record sheet
    • includeReferenceCharts

      protected boolean includeReferenceCharts()
      Description copied from class: PrintRecordSheet
      Used to determine whether to scale the record sheet to make room for charts. This depends both on whether the option is selected and on whether the sheet supports reference charts.
      Overrides:
      includeReferenceCharts in class PrintRecordSheet
      Returns:
      Whether to include reference tables
    • getRightSideReferenceTables

      protected List<ReferenceTable> getRightSideReferenceTables()
      Overrides:
      getRightSideReferenceTables in class PrintRecordSheet
    • addReferenceCharts

      protected void addReferenceCharts(PageFormat pageFormat)
      Description copied from class: PrintRecordSheet
      Adds reference charts to the right side of the record sheet.
      Overrides:
      addReferenceCharts in class PrintRecordSheet
      Parameters:
      pageFormat - The document's page format.
    • fillsSheet

      public static boolean fillsSheet(List<? extends megamek.common.units.Entity> entities, RecordSheetOptions options)
    • fillsSheet

      public static boolean fillsSheet(List<? extends megamek.common.units.Entity> entities, RecordSheetOptions options, int desiredExtraEmptySlots)
      Determines if the supplied list of units fills the sheet or if there's room for more
      Parameters:
      entities - The list of entities to place on the sheet
      options - The record sheet options, as reference tables can reduce available space
      Returns:
      true if no more entities can be printed on a single sheet