Class SharedDisplayContainer
java.lang.Object
megamek.client.ui.dialogs.unitDisplay.SharedDisplayContainer
- All Implemented Interfaces:
UnitDisplayContainer
A UnitDisplayContainer implementation that provides a singleton dialog and display. This container maintains a single
instance of UnitDisplayDialog and UnitDisplay that persists across multiple access attempts. The dialog is hidden
rather than disposed when closed, allowing it to be reused.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the shared dialog windowstatic SharedDisplayContainergetInstance(JFrame frame) Returns the singleton instance of SharedDisplayContainer, creating it if necessary.Returns a UnitDisplay instance
-
Method Details
-
getInstance
Returns the singleton instance of SharedDisplayContainer, creating it if necessary. If the instance or its components are null, a new instance is created.- Parameters:
frame- the parent frame for the dialog- Returns:
- the shared container instance
-
getUnitDisplay
Description copied from interface:UnitDisplayContainerReturns a UnitDisplay instance- Specified by:
getUnitDisplayin interfaceUnitDisplayContainer- Returns:
- the UnitDisplay component
-
getDialog
Returns the shared dialog window- Specified by:
getDialogin interfaceUnitDisplayContainer- Returns:
- the JDialog instance
-