Package megamek.client.ui.widget
Class MegaMekBorder
java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.EtchedBorder
megamek.client.ui.widget.MegaMekBorder
- All Implemented Interfaces:
Serializable
,Border
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBorderInsets
(Component c, Insets insets) boolean
void
loadIcons
(SkinSpecification skin) Use the given skin specification to create ImageIcons for each of the files specified in the skin specification.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.Methods inherited from class javax.swing.border.EtchedBorder
getEtchType, getHighlightColor, getHighlightColor, getShadowColor, getShadowColor
Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
-
Field Details
-
tlCorner
-
trCorner
-
blCorner
-
brCorner
-
leftLine
-
topLine
-
rightLine
-
bottomLine
-
leftShouldTile
-
topShouldTile
-
rightShouldTile
-
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
-
-
Constructor Details
-
MegaMekBorder
-
MegaMekBorder
-
-
Method Details
-
loadIcons
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
Paints the border using the loaded corner icons and edge icons.- Specified by:
paintBorder
in interfaceBorder
- Overrides:
paintBorder
in classEtchedBorder
-
getBorderInsets
- Overrides:
getBorderInsets
in classEtchedBorder
-
isBorderOpaque
public boolean isBorderOpaque()- Specified by:
isBorderOpaque
in interfaceBorder
- Overrides:
isBorderOpaque
in classEtchedBorder
-