Package megamek.client.ui.dialogs
Class LicensingDialog
- All Implemented Interfaces:
WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
Displays licensing, legal, and welcome information about the MegaMek Suite on
application startup. The user must click Acknowledge to proceed.
Includes a "don't show again" checkbox that takes effect when the user acknowledges. Closing the dialog via the X button or Escape key exits the application.
Subclasses in MegaMekLab and MekHQ can override buildHtmlContent()
to customize the displayed text.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class megamek.client.ui.dialogs.abstractDialogs.AbstractDialog
CLOSE_ACTION, resourcesFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsModifierConstructorDescriptionLicensingDialog(JFrame frame) Creates a new licensing dialog with the default MegaMek title.protectedLicensingDialog(JFrame frame, String customTitle) Creates a new licensing dialog with a custom title. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBuilds the HTML content for the licensing dialog.static StringBuilds the shared legal/licensing HTML block used by both the licensing dialog and About dialogs across the suite.protected voidAction performed when the Cancel button is clicked, the dialog is closed by the X button, or the escape key is pressedprotected JPanelprotected ContainerThis is used to create the dialog's center paneprotected voidokAction()Action performed when the Ok button is clicked.static voidshowIfNeeded(JFrame frame) Shows the licensing dialog if the user has not opted out.static voidshowIfNeeded(JFrame frame, String customTitle) Shows the licensing dialog with a custom title if the user has not opted out.voidwindowClosing(WindowEvent evt) Note: Closing the dialog should always allow one to close the dialog.Methods inherited from class megamek.client.ui.dialogs.buttonDialogs.AbstractButtonDialog
getResult, initialize, okButtonActionPerformed, setResult, showDialogMethods inherited from class megamek.client.ui.dialogs.abstractDialogs.AbstractDialog
cancelActionPerformed, finalizeInitialization, fit, fitAndCenter, getFrame, setCustomPreferences, setFrame, setPreferences, setPreferences, windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpenedMethods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBackMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
LicensingDialog
Creates a new licensing dialog with the default MegaMek title.- Parameters:
frame- the parent frame
-
LicensingDialog
Creates a new licensing dialog with a custom title. Used by MegaMekLab and MekHQ to show their own product name and version.- Parameters:
frame- the parent framecustomTitle- the full title string (e.g. "Welcome to MekHQ 0.50.13")
-
-
Method Details
-
windowClosing
Description copied from class:AbstractDialogNote: Closing the dialog should always allow one to close the dialog.- Specified by:
windowClosingin interfaceWindowListener- Overrides:
windowClosingin classAbstractDialog
-
createCenterPane
Description copied from class:AbstractDialogThis is used to create the dialog's center pane- Specified by:
createCenterPanein classAbstractDialog- Returns:
- the center pane of the dialog
-
buildHtmlContent
Builds the HTML content for the licensing dialog. Subclasses can override this method to customize the displayed text.- Returns:
- the HTML string to display
-
buildLegalHtml
Builds the shared legal/licensing HTML block used by both the licensing dialog and About dialogs across the suite.- Returns:
- the legal HTML content (without outer html/body tags)
-
createButtonPanel
- Overrides:
createButtonPanelin classAbstractButtonDialog- Returns:
- the created Button Panel
-
okAction
protected void okAction()Description copied from class:AbstractButtonDialogAction performed when the Ok button is clicked.- Overrides:
okActionin classAbstractButtonDialog
-
cancelAction
protected void cancelAction()Description copied from class:AbstractDialogAction performed when the Cancel button is clicked, the dialog is closed by the X button, or the escape key is pressed- Overrides:
cancelActionin classAbstractDialog
-
showIfNeeded
Shows the licensing dialog if the user has not opted out.- Parameters:
frame- the parent frame
-
showIfNeeded
Shows the licensing dialog with a custom title if the user has not opted out. Used by MegaMekLab and MekHQ to display their own product name.- Parameters:
frame- the parent frame, ornullif no frame exists yetcustomTitle- the full title string (e.g. "Welcome to MekHQ 0.50.13")
-