Class MegaMekBorder

All Implemented Interfaces:
Serializable, Border

public class MegaMekBorder extends EtchedBorder
A Border that has an image for each corner as well as images for the line in between each corner (an edge). Edges can consist of multiple possible icon and each possible icon can be tiled or static. The total amount of space taken up by tiled icons is determined by subtracting the space of the static icons and then evenly distributing it amongst each tiled icon.
See Also:
  • Field Details

    • tlCorner

      protected ImageIcon tlCorner
    • trCorner

      protected ImageIcon trCorner
    • blCorner

      protected ImageIcon blCorner
    • brCorner

      protected ImageIcon brCorner
    • leftLine

      protected ArrayList<ImageIcon> leftLine
    • topLine

      protected ArrayList<ImageIcon> topLine
    • rightLine

      protected ArrayList<ImageIcon> rightLine
    • bottomLine

      protected ArrayList<ImageIcon> bottomLine
    • leftShouldTile

      public ArrayList<Boolean> leftShouldTile
    • topShouldTile

      public ArrayList<Boolean> topShouldTile
    • rightShouldTile

      public ArrayList<Boolean> rightShouldTile
    • bottomShouldTile

      public ArrayList<Boolean> bottomShouldTile
    • leftStaticSpace

      protected int leftStaticSpace
    • topStaticSpace

      protected int topStaticSpace
    • rightStaticSpace

      protected int rightStaticSpace
    • bottomStaticSpace

      protected int bottomStaticSpace
    • leftNumTiledIcons

      protected int leftNumTiledIcons
    • topNumTiledIcons

      protected int topNumTiledIcons
    • rightNumTiledIcons

      protected int rightNumTiledIcons
    • bottomNumTiledIcons

      protected int bottomNumTiledIcons
    • insets

      protected Insets insets
  • Constructor Details

    • MegaMekBorder

      public MegaMekBorder(SkinSpecification spec)
    • MegaMekBorder

      public MegaMekBorder(String component)
  • Method Details

    • loadIcons

      public void loadIcons(SkinSpecification skin)
      Use the given skin specification to create ImageIcons for each of the files specified in the skin specification.
      Parameters:
      skin - The skin specification that specifies which icons should be used where
    • paintBorder

      public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
      Paints the border using the loaded corner icons and edge icons.
      Specified by:
      paintBorder in interface Border
      Overrides:
      paintBorder in class EtchedBorder
    • getBorderInsets

      public Insets getBorderInsets(Component c, Insets insets)
      Overrides:
      getBorderInsets in class EtchedBorder