Package megamek.client.ui.widget.mapset
Class SimpleUnitMapSet
java.lang.Object
megamek.client.ui.widget.mapset.SimpleUnitMapSet
- All Implemented Interfaces:
DisplayMapSet
A plain armor diagram for units whose shape does not fit a drawn figure: a handheld weapon, a building, a gun
emplacement. It draws one labeled box per location, showing the armor or structure (a building's construction
factor) available there, so these units still get a diagram in the same framed style as the rest, kept simple
rather than trying to picture the unit. The locations differ from one unit to the next, so the boxes are laid out
from the unit each time it is shown rather than fixed in advance.
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleUnitMapSet(JComponent jComponent, LocationSelectListener locationSelectListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidsetCriticalLocations(Set<Integer> criticalLocations) Stripes the given locations to show that they have taken a critical hit.void
-
Constructor Details
-
SimpleUnitMapSet
-
-
Method Details
-
getContentGroup
- Specified by:
getContentGroupin interfaceDisplayMapSet
-
getBackgroundDrawers
- Specified by:
getBackgroundDrawersin interfaceDisplayMapSet
-
setEntity
- Specified by:
setEntityin interfaceDisplayMapSet
-
setCriticalLocations
Description copied from interface:DisplayMapSetStripes the given locations to show that they have taken a critical hit. The locations are colored by how damaged they are, so a critical hit is striped over that color rather than replacing it, and both can be read at once. Called afterDisplayMapSet.setEntity(megamek.common.units.Entity), which is what applies the damage colors.Unit types whose diagram has no per-location areas do nothing, so a caller can offer this for every unit.
- Specified by:
setCriticalLocationsin interfaceDisplayMapSet- Parameters:
criticalLocations- the locations that have taken a critical hit
-