Class PrintCompositeTankSheet

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

public class PrintCompositeTankSheet extends PrintRecordSheet
Creates a single-page record sheet for two vehicles. If only one vehicle is provided, the bottom half of the sheet contains tables.
  • Constructor Details

    • PrintCompositeTankSheet

      public PrintCompositeTankSheet(megamek.common.units.Tank tank1, @Nullable megamek.common.units.Tank tank2, int startPage, RecordSheetOptions options)
      Create a record sheet for two vehicles, or one vehicle and tables.
      Parameters:
      tank1 - The first vehicle
      tank2 - The second vehicle; if null, fills the bottom half of the page with tables.
      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
    • loadTemplate

      @Nullable protected Document loadTemplate(int pageIndex, PageFormat pageFormat, boolean useUnitTestTemplateDirectory)
      Description copied from class: PrintRecordSheet
      Creates the base template document. This is usually loaded from a file, but some composite record sheets override this to create a document in memory which is then filled in using the individual record sheet templates.
      Overrides:
      loadTemplate in class PrintRecordSheet
      Parameters:
      pageIndex - The index of this page in the print job
      pageFormat - The page format selected by the user
      useUnitTestTemplateDirectory - true if the unit test template directory should be used
      Returns:
      An SVG document for one page of the print job
    • 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.