|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
megamek.client.ui.swing.ClientGUI
public class ClientGUI
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
IBoardView |
bv
|
(package private) ChatterBox |
cb
|
(package private) ChatterBox2 |
cb2
|
ChatLounge |
chatlounge
|
protected javax.swing.JComponent |
curPanel
|
javax.swing.JFrame |
frame
|
(package private) GameOptionsDialog |
gameOptionsDialog
|
MechDisplay |
mechD
|
javax.swing.JDialog |
mechW
|
protected CommonMenuBar |
menuBar
|
MiniMap |
minimap
|
javax.swing.JDialog |
minimapW
|
(package private) java.util.HashMap<java.lang.String,javax.swing.JComponent> |
phaseComponents
Map phase component names to phase component objects. |
static java.lang.String |
VIEW_LOS_SETTING
|
static java.lang.String |
VIEW_MEK_DISPLAY
|
static java.lang.String |
VIEW_MINI_MAP
|
static java.lang.String |
VIEW_TOGGLE_ISOMETRIC
|
static java.lang.String |
VIEW_UNIT_OVERVIEW
|
static java.lang.String |
VIEW_ZOOM_IN
|
static java.lang.String |
VIEW_ZOOM_OUT
|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ClientGUI(Client client)
Construct a client which will display itself in a new frame. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Implement the ActionListener interface. |
(package private) void |
bing()
Make a "bing" sound. |
void |
boardHexHighlighted(BoardViewEvent b)
Sent when Hex is highlighted. |
(package private) void |
die()
Shuts down threads and sockets |
void |
doAlertDialog(java.lang.String title,
java.lang.String message)
Pops up a dialog box showing an alert |
int[] |
doChoiceDialog(java.lang.String title,
java.lang.String question,
java.lang.String[] choices)
Pops up a dialog box giving the player a series of choices that are not mutually exclusive. |
ConfirmDialog |
doYesNoBotherDialog(java.lang.String title,
java.lang.String question)
Pops up a dialog box asking a yes/no question The player will be given a chance to not show the dialog again. |
boolean |
doYesNoDialog(java.lang.String title,
java.lang.String question)
Pops up a dialog box asking a yes/no question |
void |
finishedMovingUnits(BoardViewEvent b)
Sent when moving units is finished. |
void |
firstLOSHex(BoardViewEvent b)
Sent when firstLOS is set. |
IBoardView |
getBoardView()
|
java.util.Map<java.lang.String,Client> |
getBots()
|
Client |
getClient()
|
CustomFighterSquadronDialog |
getCustomFSDialog()
|
javax.swing.JFrame |
getFrame()
|
GameOptionsDialog |
getGameOptionsDialog()
|
MechSelectorDialog |
getMechSelectorDialog()
|
CommonMenuBar |
getMenuBar()
Get the menu bar for this client. |
PlanetaryConditionsDialog |
getPlanetaryConditionsDialog()
|
RandomArmyDialog |
getRandomArmyDialog()
|
RandomSkillDialog |
getRandomSkillDialog()
|
int |
getSelectedEntityNum()
|
StartingPositionDialog |
getStartingPositionDialog()
|
void |
hexCursor(BoardViewEvent b)
Sent when BoardView 'cursor' is set to Hex. |
void |
hexMoused(BoardViewEvent b)
Sent when user clicks, double clicks or drags hex. |
void |
hexSelected(BoardViewEvent b)
Sent when Hex is selected. |
void |
initialize()
Have the client register itself as a listener wherever it's needed. |
protected void |
loadListFile()
Allow the player to select a MegaMek Unit List file to load. |
void |
loadPreviewImage(javax.swing.JLabel bp,
Entity entity)
|
void |
loadPreviewImage(javax.swing.JLabel bp,
Entity entity,
Player player)
|
protected void |
saveListFile(java.util.ArrayList<Entity> unitList)
Allow the player to save a list of entities to a MegaMek Unit List file. |
(package private) void |
saveSettings()
Saves the current settings to the cfg file. |
void |
secondLOSHex(BoardViewEvent b,
Coords c)
Sent when secondLOS is set. |
void |
setDisplayVisible(boolean visible)
Sets the visibility of the entity display window |
(package private) void |
setMapVisible(boolean visible)
Sets the visibility of the minimap window |
void |
setSelectedEntityNum(int selectedEntityNum)
|
protected void |
showBoardPopup(Coords c)
|
(package private) void |
switchPanel(IGame.Phase phase)
|
void |
systemMessage(java.lang.String message)
Display a system message in the chat box. |
void |
unitSelected(BoardViewEvent b)
Sent when Unit is selected. |
void |
windowActivated(java.awt.event.WindowEvent windowEvent)
|
void |
windowClosed(java.awt.event.WindowEvent windowEvent)
|
void |
windowClosing(java.awt.event.WindowEvent windowEvent)
|
void |
windowDeactivated(java.awt.event.WindowEvent windowEvent)
|
void |
windowDeiconified(java.awt.event.WindowEvent windowEvent)
|
void |
windowIconified(java.awt.event.WindowEvent windowEvent)
|
void |
windowOpened(java.awt.event.WindowEvent windowEvent)
|
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VIEW_MEK_DISPLAY
public static final java.lang.String VIEW_MINI_MAP
public static final java.lang.String VIEW_LOS_SETTING
public static final java.lang.String VIEW_UNIT_OVERVIEW
public static final java.lang.String VIEW_ZOOM_IN
public static final java.lang.String VIEW_ZOOM_OUT
public static final java.lang.String VIEW_TOGGLE_ISOMETRIC
public javax.swing.JFrame frame
protected CommonMenuBar menuBar
ChatterBox cb
ChatterBox2 cb2
public IBoardView bv
public javax.swing.JDialog mechW
public MechDisplay mechD
public javax.swing.JDialog minimapW
public MiniMap minimap
protected javax.swing.JComponent curPanel
public ChatLounge chatlounge
GameOptionsDialog gameOptionsDialog
java.util.HashMap<java.lang.String,javax.swing.JComponent> phaseComponents
| Constructor Detail |
|---|
public ClientGUI(Client client)
| Method Detail |
|---|
public IBoardView getBoardView()
public void systemMessage(java.lang.String message)
message - the String message to be shown.public void initialize()
Client
is created.
public CommonMenuBar getMenuBar()
CommonMenuBar of this client.public void actionPerformed(java.awt.event.ActionEvent event)
ActionListener interface.
actionPerformed in interface java.awt.event.ActionListenervoid saveSettings()
void die()
public GameOptionsDialog getGameOptionsDialog()
public MechSelectorDialog getMechSelectorDialog()
public CustomFighterSquadronDialog getCustomFSDialog()
public StartingPositionDialog getStartingPositionDialog()
public PlanetaryConditionsDialog getPlanetaryConditionsDialog()
void switchPanel(IGame.Phase phase)
protected void showBoardPopup(Coords c)
public void setDisplayVisible(boolean visible)
void setMapVisible(boolean visible)
public int[] doChoiceDialog(java.lang.String title,
java.lang.String question,
java.lang.String[] choices)
title - the String title of the dialog box.question - the String question that has a "Yes" or "No"
answer. The question will be split across multiple line on the
'\n' characters.choices - the array of String choices that the player can
select from.
int indexes of the from the input
array that match the selected choices. If no choices were
available, if the player did not select a choice, or if the
player canceled the choice, a null value is
returned.
public void doAlertDialog(java.lang.String title,
java.lang.String message)
public boolean doYesNoDialog(java.lang.String title,
java.lang.String question)
title - the String title of the dialog box.question - the String question that has a "Yes" or "No"
answer. The question will be split across multiple line on the
'\n' characters.
true if yes
public ConfirmDialog doYesNoBotherDialog(java.lang.String title,
java.lang.String question)
title - the String title of the dialog box.question - the String question that has a "Yes" or "No"
answer. The question will be split across multiple line on the
'\n' characters.
ConfirmDialog containing the player's responses.
The dialog will already have been shown to the player, and is
only being returned so the calling function can see the answer to
the question and the state of the "Show again?" question.protected void loadListFile()
Entitys in the file will replace any that the player has
already selected. As such, this method should only be called in the chat
lounge. The file can record damage sustained, non- standard munitions
selected, and ammunition expended in a prior engagement.
protected void saveListFile(java.util.ArrayList<Entity> unitList)
unitList - - the Vector of Entitys to be saved
to a file. If this value is null or empty, the
"Save As" dialog will not be displayed.public void windowActivated(java.awt.event.WindowEvent windowEvent)
windowActivated in interface java.awt.event.WindowListenerpublic void windowClosed(java.awt.event.WindowEvent windowEvent)
windowClosed in interface java.awt.event.WindowListenerpublic void windowClosing(java.awt.event.WindowEvent windowEvent)
windowClosing in interface java.awt.event.WindowListenerpublic void windowDeactivated(java.awt.event.WindowEvent windowEvent)
windowDeactivated in interface java.awt.event.WindowListenerpublic void windowDeiconified(java.awt.event.WindowEvent windowEvent)
windowDeiconified in interface java.awt.event.WindowListenerpublic void windowIconified(java.awt.event.WindowEvent windowEvent)
windowIconified in interface java.awt.event.WindowListenerpublic void windowOpened(java.awt.event.WindowEvent windowEvent)
windowOpened in interface java.awt.event.WindowListenerpublic javax.swing.JFrame getFrame()
public void loadPreviewImage(javax.swing.JLabel bp,
Entity entity)
public void loadPreviewImage(javax.swing.JLabel bp,
Entity entity,
Player player)
void bing()
public Client getClient()
public java.util.Map<java.lang.String,Client> getBots()
public int getSelectedEntityNum()
public void setSelectedEntityNum(int selectedEntityNum)
selectedEntityNum - The selectedEntityNum to set.public RandomArmyDialog getRandomArmyDialog()
public RandomSkillDialog getRandomSkillDialog()
public void hexMoused(BoardViewEvent b)
BoardViewListener
hexMoused in interface BoardViewListenerb - an eventpublic void hexCursor(BoardViewEvent b)
BoardViewListener
hexCursor in interface BoardViewListenerb - an eventpublic void boardHexHighlighted(BoardViewEvent b)
BoardViewListener
boardHexHighlighted in interface BoardViewListenerb - an eventpublic void hexSelected(BoardViewEvent b)
BoardViewListener
hexSelected in interface BoardViewListenerb - an eventpublic void firstLOSHex(BoardViewEvent b)
BoardViewListener
firstLOSHex in interface BoardViewListenerb - an event
public void secondLOSHex(BoardViewEvent b,
Coords c)
BoardViewListener
secondLOSHex in interface BoardViewListenerb - an eventpublic void finishedMovingUnits(BoardViewEvent b)
BoardViewListener
finishedMovingUnits in interface BoardViewListenerb - an eventpublic void unitSelected(BoardViewEvent b)
BoardViewListener
unitSelected in interface BoardViewListenerb - an event
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||