Class PrintHandheldWeapon

All Implemented Interfaces:
Printable, IdConstants

public class PrintHandheldWeapon extends PrintEntity
  • Field Details

    • PIP_RADIUS

      public static final double PIP_RADIUS
      Default radius for a pip
      See Also:
    • PIP_MIN_RADIUS

      public static final double PIP_MIN_RADIUS
      Default minimum radius for pip
      See Also:
    • PIP_STROKE_WIDTH

      public static final double PIP_STROKE_WIDTH
      Default stroke width for a pip
      See Also:
    • MIN_PIP_SPACING

      public static final double MIN_PIP_SPACING
      Default minimum spacing between the outer edges of pips
      See Also:
    • OFFSET_FIRST_LABEL

      public static final double OFFSET_FIRST_LABEL
      In case there are labels, offset the first label (and the whole bbox)
      See Also:
    • LABEL_DEFAULT_FONT_SIZE

      public static final double LABEL_DEFAULT_FONT_SIZE
      Default/Fallback font size for labels
      See Also:
    • MIN_MARGIN_ABOVE_LABEL

      public static final double MIN_MARGIN_ABOVE_LABEL
      Minimum margin above an ammo label
      See Also:
    • MAX_MARGIN_ABOVE_LABEL

      public static final double MAX_MARGIN_ABOVE_LABEL
      Maximum margin above an ammo label
      See Also:
    • MARGIN_BELOW_LABEL

      public static final double MARGIN_BELOW_LABEL
      Default margin below an ammo label
      See Also:
    • PIP_MAX_DISTANCE_MULTIPLIER_X

      public static final double PIP_MAX_DISTANCE_MULTIPLIER_X
      Maximum distance between pips relative to pip diameter (Horizontal)
      See Also:
    • PIP_MAX_DISTANCE_MULTIPLIER_Y

      public static final double PIP_MAX_DISTANCE_MULTIPLIER_Y
      Maximum distance between pips relative to pip diameter (Vertical)
      See Also:
    • MIN_ARMOR_PIPS_PER_ROW

      public static final int MIN_ARMOR_PIPS_PER_ROW
      Default minimum amount of pips for a row
      See Also:
    • MAX_ARMOR_PIPS

      public static final int MAX_ARMOR_PIPS
      Maximum amount of pips displayable, after that we leave blank
      See Also:
    • MAX_AMMO_PIPS

      public static final int MAX_AMMO_PIPS
      Maximum amount of pips displayable, after that we leave blank
      See Also:
    • LARGE_LAYOUT_THRESHOLD_ARMOR_PIPS

      public static final int LARGE_LAYOUT_THRESHOLD_ARMOR_PIPS
      Threshold for large layout
      See Also:
    • LARGE_LAYOUT_THRESHOLD_WEAPON_TYPE_COUNT

      public static final int LARGE_LAYOUT_THRESHOLD_WEAPON_TYPE_COUNT
      See Also:
    • LARGE_LAYOUT_THRESHOLD_AMMO_TYPE_COUNT

      public static final int LARGE_LAYOUT_THRESHOLD_AMMO_TYPE_COUNT
      See Also:
    • LARGE_LAYOUT_THRESHOLD_AMMO_AMOUNT1

      public static final int LARGE_LAYOUT_THRESHOLD_AMMO_AMOUNT1
      See Also:
    • LARGE_LAYOUT_THRESHOLD_AMMO_AMOUNT2

      public static final int LARGE_LAYOUT_THRESHOLD_AMMO_AMOUNT2
      See Also:
  • Constructor Details

    • PrintHandheldWeapon

      public PrintHandheldWeapon(megamek.common.HandheldWeapon handheldWeapon, int startPage, RecordSheetOptions options)
      Creates an SVG object for the record sheet
      Parameters:
      handheldWeapon - The handheld weapon to print
      startPage - The print job page number for this sheet
      options - Overrides the global options for which elements are printed
  • Method Details

    • isLargeLayout

      public boolean isLargeLayout()
      Checks if the layout is large based on the number of pips and ammo types
      Returns:
      true if the layout is large, false otherwise
    • 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
    • getEntity

      public megamek.common.Entity getEntity()
      Specified by:
      getEntity in class PrintEntity
    • getRecordSheetTitle

      protected String getRecordSheetTitle()
      Specified by:
      getRecordSheetTitle in class PrintRecordSheet
      Returns:
      The title to use for the record sheet
    • writeTextFields

      protected void writeTextFields()
      Overrides:
      writeTextFields in class PrintEntity
    • drawArmor

      protected void drawArmor()
      Overrides:
      drawArmor in class PrintEntity
    • drawStructure

      protected void drawStructure()
      Overrides:
      drawStructure in class PrintEntity
    • drawArmorStructurePips

      protected void drawArmorStructurePips()
      Description copied from class: PrintEntity
      Add armor and structure pips for each location.
      Overrides:
      drawArmorStructurePips in class PrintEntity
    • supportsAlternateArmorGrouping

      protected boolean supportsAlternateArmorGrouping()
      Specified by:
      supportsAlternateArmorGrouping in class PrintEntity