|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame soc.client.NewGameOptionsFrame
public class NewGameOptionsFrame
This is the dialog for options to set in a new game. Prompt for name and options.
Also used for showing a game's options (read-only) during game play.
If this window already exists and you'd like to make it topmost,
call setVisible(boolean)
instead of Component.requestFocus()
.
Game option "SC" (Scenarios) gets special rendering. Internally it's SOCGameOption.OTYPE_STR
,
but it's presented as a checkbox and Choice
. When a scenario is picked in the Choice,
related options are updated by "SC"'s SOCGameOption.ChangeListener
.
This class also contains the "Scenario Info" popup window, called from
this dialog's Scenario Info button, and from SOCPlayerInterface
when first joining a game with a scenario.
See showScenarioInfoDialog(SOCScenario, Map, int, SOCPlayerClient.GameAwtDisplay, Frame)
.
Nested Class Summary | |
---|---|
class |
NewGameOptionsFrame.IntTextField
A textfield that accepts only nonnegative-integer characters. |
private class |
NewGameOptionsFrame.VersionConfirmDialog
This is the modal dialog to ask user if these options' required minimum client version is OK. |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
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 | |
---|---|
private java.util.Map<java.lang.String,SOCScenario> |
allSc
Scenario info for scenDropdown , if opts contains the "SC" game option, or null. |
private java.util.Map<java.lang.String,java.awt.Checkbox> |
boolOptCheckboxes
Key = SOCGameOption.key ; value = Checkbox if bool/intbool option. |
private java.awt.Button |
cancel
Cancel button; text is "OK" if readOnly |
private java.util.Map<java.awt.Component,SOCGameOption> |
controlsOpts
Key = AWT control; value = SOCGameOption within opts . |
private java.awt.Button |
create
Create Game button; null if readOnly |
private boolean |
forNewGame
Is this NGOF used to set options for a new game, not to show them for an existing one? |
private boolean |
forPractice
should this be sent to the remote tcp server, or local practice server? |
private SOCPlayerClient.GameAwtDisplay |
gameDisplay
|
private java.awt.TextField |
gameName
|
private static java.awt.Color |
HEADER_LABEL_BG
|
private static java.awt.Color |
HEADER_LABEL_FG
|
static int |
INTFIELD_POPUP_MAXRANGE
Maximum range (min-max value) for integer-type options to be rendered using a value popup, instead of a textfield. |
private static java.awt.Color |
LABEL_TXT_COLOR
|
private static double |
LOG_10
Natural log of 10. |
private java.awt.TextField |
msgText
msgText is null if readOnly |
private static java.awt.Color |
NGOF_BG
|
private java.util.Map<java.lang.String,SOCGameOption> |
opts
Contains this game's SOCGameOption s, or null if none. |
private java.util.Map<java.lang.String,java.awt.Component> |
optsControls
AWT control for each gameopt, for handling SOCGameOption.refreshDisplay()
if called by SOCGameOption.ChangeListener s. |
private boolean |
readOnly
is this for display only? |
private javax.swing.JComboBox |
scenDropdown
Scenario choice dropdown if opts contains the "SC" game option, or null. |
private java.awt.Button |
scenInfo
Scenario Info button, for info window about scenDropdown 's selected scenario, or null. |
private static SOCStringManager |
strings
i18n text strings; will use same locale as SOCPlayerClient's string manager. |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
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 | |
---|---|
NewGameOptionsFrame(SOCPlayerClient.GameAwtDisplay gd,
java.lang.String gaName,
java.util.Map<java.lang.String,SOCGameOption> opts,
boolean forPractice,
boolean readOnly)
Creates a new NewGameOptionsFrame. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ae)
React to button clicks |
private void |
clickCancel()
Dismiss the frame |
private void |
clickCreate(boolean checkOptionsMinVers)
"Connect..." from connect setup; check fields, etc |
private void |
clickScenarioInfo()
The "Scenario Info" button was clicked. |
static NewGameOptionsFrame |
createAndShow(SOCPlayerClient.GameAwtDisplay cli,
java.lang.String gaName,
java.util.Map<java.lang.String,SOCGameOption> opts,
boolean forPractice,
boolean readOnly)
Creates and shows a new NewGameOptionsFrame. |
void |
dispose()
Dismiss the frame, and clear client's SOCPlayerClient.GameAwtDisplay.newGameOptsFrame
reference to null if it's to this frame. |
private void |
fireOptionChangeListener(SOCGameOption.ChangeListener cl,
SOCGameOption opt,
java.lang.Object oldValue,
java.lang.Object newValue)
Handle firing a game option's ChangeListener, and refreshing related gameopts' values on-screen if needed. |
private void |
fireUserChangedOptListeners(SOCGameOption opt,
java.lang.Object ctrl,
boolean newBoolValue,
boolean changeBoolValue)
A game option's value widget was changed by the user. |
private void |
initInterface_Opt1(SOCGameOption op,
java.awt.Component oc,
boolean hasCB,
boolean allowPH,
java.awt.Panel bp,
java.awt.GridBagLayout gbl,
java.awt.GridBagConstraints gbc)
Add one GridBagLayout row with this game option (component and label(s)). |
private void |
initInterface_Options(java.awt.Panel bp,
java.awt.GridBagLayout gbl,
java.awt.GridBagConstraints gbc)
Interface setup: Options. |
private void |
initInterface_OptLine(SOCGameOption op,
java.awt.Panel bp,
java.awt.GridBagLayout gbl,
java.awt.GridBagConstraints gbc)
Set up one game option in one line of the panel. |
private void |
initInterfaceElements(java.lang.String gaName)
Interface setup for constructor. |
private java.awt.Choice |
initOption_enum(SOCGameOption op)
Create a popup menu for the choices of this enum. |
private java.awt.Component |
initOption_int(SOCGameOption op)
Based on this game option's type, present its intvalue either as a numeric textfield, or a popup menu if min/max are near each other. |
void |
itemStateChanged(java.awt.event.ItemEvent e)
Called when a Choice or Checkbox value changes (ItemListener). |
void |
keyPressed(java.awt.event.KeyEvent e)
Handle Enter or Esc key (KeyListener) |
void |
keyReleased(java.awt.event.KeyEvent arg0)
Stub required by KeyListener |
void |
keyTyped(java.awt.event.KeyEvent arg0)
Stub required by KeyListener |
void |
mouseClicked(java.awt.event.MouseEvent e)
when an option with a boolValue's label is clicked, toggle its checkbox |
void |
mouseEntered(java.awt.event.MouseEvent e)
required stub for MouseListener |
void |
mouseExited(java.awt.event.MouseEvent e)
required stub for MouseListener |
void |
mousePressed(java.awt.event.MouseEvent e)
required stub for MouseListener |
void |
mouseReleased(java.awt.event.MouseEvent e)
required stub for MouseListener |
private boolean |
readOptsValuesFromControls(boolean checkOptionsMinVers)
Read option values from controls, as prep to request the new game. |
void |
setVisible(boolean b)
When the window is shown, request focus on game name textfield. |
static void |
showScenarioInfoDialog(SOCGame ga,
SOCPlayerClient.GameAwtDisplay cli,
java.awt.Frame parent)
Show a popup window with this game's scenario's description, special rules, and number of victory points to win. |
static void |
showScenarioInfoDialog(SOCScenario sc,
java.util.Map<java.lang.String,SOCGameOption> gameOpts,
int vpWinner,
SOCPlayerClient.GameAwtDisplay cli,
java.awt.Frame parent)
Show a popup window with this scenario's description, special rules, and number of victory points to win. |
void |
textValueChanged(java.awt.event.TextEvent e)
When gamename contents change, enable/disable buttons as appropriate. |
Methods inherited from class java.awt.Frame |
---|
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, isOpaque, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
public static final int INTFIELD_POPUP_MAXRANGE
initOption_int(SOCGameOption)
,
Constant Field Valuesprivate final SOCPlayerClient.GameAwtDisplay gameDisplay
private final boolean forPractice
private final boolean forNewGame
private final boolean readOnly
private java.util.Map<java.lang.String,SOCGameOption> opts
SOCGameOption
s, or null if none.
Unknowns (OTYPE_UNKNOWN) are removed in initInterface_options.
The opts' values are updated from controls when the user hits the Create Game button,
and sent to the server to create the game. If there are SOCGameOption.ChangeListener
s,
they are updated as soon as the user changes them in the controls, then re-updated when
Create is hit.
readOptsValuesFromControls(boolean)
private java.util.Map<java.awt.Component,SOCGameOption> controlsOpts
SOCGameOption
within opts
. Empty if opts is null.
private java.util.Map<java.lang.String,java.awt.Component> optsControls
SOCGameOption.refreshDisplay()
if called by SOCGameOption.ChangeListener
s.
Key = option key; value = Component.
Null if readOnly
.
For game options with 2 input controls (OTYPE_INTBOOL, OTYPE_ENUMBOOL),
the TextField/Choice is found here, and the boolean Checkbox is found in boolOptCheckboxes
.
The scenario dropdown (option "SC"
) uses a JComboBox
control holding
SOCScenario
objects and the string "(none)".
fireOptionChangeListener(soc.game.SOCGameOption.ChangeListener, SOCGameOption, Object, Object)
private java.util.Map<java.lang.String,java.awt.Checkbox> boolOptCheckboxes
SOCGameOption.key
; value = Checkbox
if bool/intbool option.
Empty if none, null if readOnly.
Used to quickly find an option's associated checkbox.
private java.util.Map<java.lang.String,SOCScenario> allSc
scenDropdown
, if opts
contains the "SC"
game option, or null.
Initialized from SOCScenario.getAllKnownScenarios()
during
initInterface_Options(Panel, GridBagLayout, GridBagConstraints)
,
which is called after any server negotiations.
private javax.swing.JComboBox scenDropdown
opts
contains the "SC"
game option, or null.
When an item is selected, actionPerformed(ActionEvent)
reacts specially for this control
to update "SC"
within opts
and enable/disable scenInfo
.
private java.awt.Button scenInfo
scenDropdown
's selected scenario, or null.
clickScenarioInfo()
private java.awt.Button create
readOnly
private java.awt.Button cancel
readOnly
private java.awt.TextField gameName
private java.awt.TextField msgText
private static final java.awt.Color NGOF_BG
private static final java.awt.Color HEADER_LABEL_BG
private static final java.awt.Color HEADER_LABEL_FG
private static final SOCStringManager strings
private static final java.awt.Color LABEL_TXT_COLOR
private static final double LOG_10
initOption_int(SOCGameOption)
, to determine
number of digits needed for the option in a textfield
(not available in java 1.4)
Constructor Detail |
---|
public NewGameOptionsFrame(SOCPlayerClient.GameAwtDisplay gd, java.lang.String gaName, java.util.Map<java.lang.String,SOCGameOption> opts, boolean forPractice, boolean readOnly)
gd
- Game display interfacegaName
- Name of existing game,
or null for new game; will be blank or (forPractice)
to use SOCPlayerClient.DEFAULT_PRACTICE_GAMENAME
.opts
- Set of SOCGameOption
s; its values will be changed when "New Game" button
is pressed, so the next OptionsFrame will default to the values the user has chosen.
To preserve them, call SOCGameOption.cloneOptions(Map)
beforehand.
Null if server doesn't support game options.
Unknown options (SOCGameOption.OTYPE_UNKNOWN
) will be removed.
If not readOnly, each option's userChanged
flag will be cleared, to reset status from any previously shown NewGameOptionsFrame.forPractice
- Will this game be on local practice server, vs remote tcp server?readOnly
- Is this display-only (for use during a game), or can it be changed (making a new game)?Method Detail |
---|
public static NewGameOptionsFrame createAndShow(SOCPlayerClient.GameAwtDisplay cli, java.lang.String gaName, java.util.Map<java.lang.String,SOCGameOption> opts, boolean forPractice, boolean readOnly)
constructor
for notes about opts and other parameters.
gaName
- Name of existing game, or null
to show options for a new game;
see constructor for details
private void initInterfaceElements(java.lang.String gaName)
private void initInterface_Options(java.awt.Panel bp, java.awt.GridBagLayout gbl, java.awt.GridBagConstraints gbc)
When showing options to create a new game, option keys starting with '_' are hidden unless the player nickname is "debug". This prevents unwanted changes to those options, which are set at the server during game creation. When the options are shown read-only during a game, these options are shown and not hidden.
Options which have SOCGameOption.FLAG_INTERNAL_GAME_PROPERTY
are always hidden.
If not readOnly
, they're removed from opts. Unknown opts are always removed.
This is called from constructor, so this is a new NGOF being shown.
If not read-only, clear SOCGameOption.userChanged
flag for
each option in opts
.
If options are null, put a label with "This server version does not support game options" (localized).
private void initInterface_OptLine(SOCGameOption op, java.awt.Panel bp, java.awt.GridBagLayout gbl, java.awt.GridBagConstraints gbc)
initInterface_Opt1(SOCGameOption, Component, boolean, boolean, Panel, GridBagLayout, GridBagConstraints)
.
Special handling: Scenario (option "SC"
) gets a checkbox, label, dropdown, and a second line with
an Info button. (Sets scenDropdown
, scenInfo
).
op
- Option databp
- Add to this panelgbl
- Use this layoutgbc
- Use these constraintsprivate void initInterface_Opt1(SOCGameOption op, java.awt.Component oc, boolean hasCB, boolean allowPH, java.awt.Panel bp, java.awt.GridBagLayout gbl, java.awt.GridBagConstraints gbc)
op
- Option dataoc
- Component with option choices (popup menu, textfield, etc).
If oc is a NewGameOptionsFrame.IntTextField
or Choice
, and hasCB,
changing the component's value will set the checkbox.
oc will be added to optsControls
and controlsOpts
.hasCB
- Add a checkbox? If oc is Checkbox
, set this true;
it won't add a second checkbox.
The checkbox will be added to boolOptCheckboxes
and controlsOpts
.allowPH
- Allow the "#" placeholder within option desc?bp
- Add to this panelgbl
- Use this layoutgbc
- Use these constraints; gridwidth will be set to 1 and then REMAINDERprivate java.awt.Component initOption_int(SOCGameOption op)
INTFIELD_POPUP_MAXRANGE
.
op
- A SOCGameOption with an integer value, that is,
of type OTYPE_INT
or OTYPE_INTBOOL
Choice
(popup menu)private java.awt.Choice initOption_enum(SOCGameOption op)
op
- Game option, of type OTYPE_ENUM
or OTYPE_ENUMBOOL
public void setVisible(boolean b)
setVisible(true)
instead of Component.requestFocus()
.
setVisible
in class java.awt.Window
public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
private void clickCreate(boolean checkOptionsMinVers)
private void clickCancel()
private void clickScenarioInfo()
scenDropdown
.
Calls showScenarioInfoDialog(SOCScenario, Map, int, SOCPlayerClient.GameAwtDisplay, Frame)
.
public void dispose()
SOCPlayerClient.GameAwtDisplay.newGameOptsFrame
reference to null if it's to this frame.
dispose
in class java.awt.Window
private boolean readOptsValuesFromControls(boolean checkOptionsMinVers)
msgText
and set focus on the field.
checkOptionsMinVers
- Warn the user if the options will require a
minimum client version? Won't do so if forPractice
is set,
because this isn't a problem for local practice games.
The warning is skipped if that minimum is an old version
<= Version.versionNumberMaximumNoWarn()
.
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent arg0)
keyReleased
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent arg0)
keyTyped
in interface java.awt.event.KeyListener
public void textValueChanged(java.awt.event.TextEvent e)
SOCGameOption.OTYPE_INTBOOL
textfield/checkbox combos.
Also sets SOCGameOption.userChanged
.
textValueChanged
in interface java.awt.event.TextListener
e
- textevent from gameName
, or from a TextField in controlsOpts
public void itemStateChanged(java.awt.event.ItemEvent e)
SOCGameOption.userChanged
ChangeListener
.
SOCGameOption.OTYPE_INTBOOL
or SOCGameOption.OTYPE_ENUMBOOL
.
"SC"
and the scenInfo
button when a scenario is picked
from scenDropdown
. Other scenario-related updates are handled by this method calling
SOCGameOption.ChangeListener#valueChanged(SOCGameOption, Object, Object, Map)
.
itemStateChanged
in interface java.awt.event.ItemListener
e
- itemevent from a Choice or Checkbox in controlsOpts
private final void fireUserChangedOptListeners(SOCGameOption opt, java.lang.Object ctrl, boolean newBoolValue, boolean changeBoolValue)
SOCGameOption.ChangeListener
, call it with the appropriate old and new values.
Call to update opt
's value fields:
changeBoolValue
, calls opt.setBoolValue(newBoolValue)
ctrl
is a Choice
or JComboBox
, calls
opt.setIntValue
(ctrl.getSelectedIndex()
)
fireOptionChangeListener(soc.game.SOCGameOption.ChangeListener, SOCGameOption, Object, Object)
for the Option's boolean and/or int values.
opt
- Game option changedctrl
- The Checkbox
or Choice
or JComboBox
dropdown changed by the usernewBoolValue
- New value to set for opt.getBoolValue()
changeBoolValue
- True if the user changed the opt's boolean value, false if
the opt's int or string value dropdown was changed but boolean wasn't.private void fireOptionChangeListener(SOCGameOption.ChangeListener cl, SOCGameOption opt, java.lang.Object oldValue, java.lang.Object newValue)
cl
- The ChangeListener; must not be nullopt
- The game optionoldValue
- Old value, string or boxed primitivenewValue
- New value, string or boxed primitivepublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public static void showScenarioInfoDialog(SOCGame ga, SOCPlayerClient.GameAwtDisplay cli, java.awt.Frame parent)
EventQueue.invokeLater(Runnable)
.
ga
- Game to display scenario info for; if game option "SC"
missing or blank, does nothing.cli
- Player client interface, for NotifyDialog
callparent
- Current game's player interface, or another Frame for our parent window,
or null to look for cli
's Frame as parentpublic static void showScenarioInfoDialog(SOCScenario sc, java.util.Map<java.lang.String,SOCGameOption> gameOpts, int vpWinner, SOCPlayerClient.GameAwtDisplay cli, java.awt.Frame parent)
EventQueue.invokeLater(Runnable)
.
sc
- A SOCScenario
, or null
to do nothinggameOpts
- All game options if current game, or null to extract from sc
's SOCScenario.scOpts
vpWinner
- Number of victory points to win, or SOCGame.VP_WINNER_STANDARD
.cli
- Player client interface, required for AskDialog
constructorparent
- Current game's player interface, or another Frame for our parent window,
or null to look for cli
's Frame as parent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |