|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Window
|
+--java.awt.Dialog
|
+--javax.swing.JDialog
|
+--VASSAL.build.module.map.BoardPicker
This class is responsible for maintaining the Boards on a
Map. As a CommandEncoder, it recognizes Commands that specify the set of boards to be used on a map. As a
GameComponent it reacts to the start of a game by prompting
the player to select boards if none have been specified
| Inner Class Summary | |
static class |
BoardPicker.SetBoards
|
| Inner classes inherited from class javax.swing.JDialog |
javax.swing.JDialog.AccessibleJDialog |
| Inner classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
| Inner classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| Field Summary | |
protected boolean |
allowMultiple
|
protected javax.swing.JButton |
cancelButton
|
protected javax.swing.JToolBar |
controls
|
protected java.util.Vector |
currentBoards
|
protected java.lang.String |
defaultSetup
|
static java.lang.String |
ID
|
protected Map |
map
|
protected java.util.Vector |
multipleButtons
|
protected int |
nx
|
protected int |
ny
|
protected java.util.Vector |
possibleBoards
|
java.lang.String |
SCALE
|
java.lang.String |
SETUP
|
java.lang.String |
SLOT_HEIGHT
|
java.lang.String |
SLOT_WIDTH
|
protected javax.swing.JPanel |
slotPanel
|
protected javax.swing.JTextField |
status
|
protected java.lang.String |
title
|
protected java.lang.String |
version
|
| Fields inherited from class javax.swing.JDialog |
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface VASSAL.build.Configurable |
NAME_PROPERTY |
| Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
BoardPicker()
|
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
add(Buildable b)
Add a board to the list of those available for the user to choose from |
protected javax.swing.JButton |
addButton(java.lang.String s)
|
protected javax.swing.JButton |
addButton(java.lang.String s,
int index)
|
protected void |
addColumn()
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a PropertyChangeListener. |
protected void |
addRow()
|
void |
addTo(Buildable b)
Adds this component to its parent. |
void |
build(org.w3c.dom.Element e)
Build the object |
Command |
decode(java.lang.String command)
Translate a String into a Command |
java.lang.String |
encode(Command c)
Translate a Command into a String |
java.lang.String[] |
getAllowableBoardNames()
|
java.lang.Class[] |
getAllowableConfigureComponents()
Return a list of valid sub-component Classes. |
Board |
getBoard(java.lang.String boardName)
|
java.lang.String |
getBoardDelimiter()
|
org.w3c.dom.Element |
getBuildElement(org.w3c.dom.Document doc)
|
int |
getColumnCount()
|
Configurable[] |
getConfigureComponents()
|
java.lang.String |
getConfigureName()
The name of this Configurable Object |
Configurer |
getConfigurer()
Return a Configurer object which can be used to set the
attributes of this object |
static java.lang.String |
getConfigureTypeName()
|
java.util.Enumeration |
getCurrentBoards()
|
java.awt.Dimension |
getDefaultSlotSize()
|
HelpFile |
getHelpFile()
|
BoardSlot |
getNeighbor(BoardSlot slot,
int dx,
int dy)
|
Command |
getRestoreCommand()
The restore command of a BoardPicker, when executed, sets the boards of its Map to getCurrentBoards() |
int |
getRowCount()
|
BoardSlot |
getSlot(int i)
|
double |
getSlotScale()
|
protected void |
initComponents()
|
boolean |
isAllowMultiple()
|
void |
pack()
|
java.util.Vector |
pickBoards()
|
void |
remove(Buildable b)
Remove a board from the list of those available for the user to choose from |
protected void |
removeAllBoards()
|
void |
removeFrom(Buildable parent)
Remove this component from its parent |
void |
repaintAll()
|
void |
reset()
|
protected void |
selectBoards()
|
void |
setAllowMultiple(boolean val)
|
void |
setBoards(java.util.Enumeration bdEnum)
|
void |
setup(boolean show)
When starting a game, check to see if any boards have been specified (via an encoded Command. |
void |
warn(java.lang.String s)
|
| Methods inherited from class javax.swing.JDialog |
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle, show |
| Methods inherited from class java.awt.Window |
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, postEvent, processEvent, removeWindowListener, setCursor, toBack, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, 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, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String ID
protected java.util.Vector possibleBoards
protected java.util.Vector currentBoards
protected javax.swing.JTextField status
protected javax.swing.JButton cancelButton
protected Map map
protected javax.swing.JPanel slotPanel
protected java.lang.String version
protected int nx
protected int ny
protected javax.swing.JToolBar controls
protected boolean allowMultiple
protected java.lang.String title
protected java.lang.String defaultSetup
protected java.util.Vector multipleButtons
public final java.lang.String SCALE
public final java.lang.String SLOT_HEIGHT
public final java.lang.String SLOT_WIDTH
public final java.lang.String SETUP
| Constructor Detail |
public BoardPicker()
| Method Detail |
protected void initComponents()
public java.awt.Dimension getDefaultSlotSize()
public double getSlotScale()
public void warn(java.lang.String s)
public void addTo(Buildable b)
BuildableaddTo in interface Buildablepublic void build(org.w3c.dom.Element e)
Buildablebuild in interface BuildableVASSAL.build.Buildablee - the XML element containing the object datapublic void add(Buildable b)
add in interface Buildablepublic void remove(Buildable b)
remove in interface Configurablepublic void removeFrom(Buildable parent)
ConfigurableremoveFrom in interface Configurablepublic static java.lang.String getConfigureTypeName()
public java.lang.String getConfigureName()
ConfigurablegetConfigureName in interface Configurablepublic java.lang.String getBoardDelimiter()
public HelpFile getHelpFile()
getHelpFile in interface ConfigurableVASSAL.build.Configurablepublic Configurer getConfigurer()
ConfigurableConfigurer object which can be used to set the
attributes of this objectgetConfigurer in interface Configurablepublic Configurable[] getConfigureComponents()
getConfigureComponents in interface ConfigurableVASSAL.build.Configurablepublic java.lang.Class[] getAllowableConfigureComponents()
ConfigurablegetAllowableConfigureComponents in interface Configurablepublic void addPropertyChangeListener(java.beans.PropertyChangeListener l)
ConfigurableConfigurable.NAME_PROPERTY when the value returned from
Configurable.getConfigureName() has changedaddPropertyChangeListener in interface ConfigurableaddPropertyChangeListener in class java.awt.Componentpublic void setBoards(java.util.Enumeration bdEnum)
public void pack()
pack in class java.awt.Windowprotected void selectBoards()
public java.util.Enumeration getCurrentBoards()
public java.lang.String[] getAllowableBoardNames()
public Board getBoard(java.lang.String boardName)
public void setup(boolean show)
Command. If not, show a
dialog to prompt the user for boards. When ending a game,
clear the selected boardssetup in interface GameComponentVASSAL.build.module.GameComponentgameStarting - if true, a game is starting. If false, then a game is endingpublic Command getRestoreCommand()
Map to getCurrentBoards()getRestoreCommand in interface GameComponentprotected javax.swing.JButton addButton(java.lang.String s)
protected javax.swing.JButton addButton(java.lang.String s,
int index)
protected void addRow()
protected void addColumn()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic java.util.Vector pickBoards()
public void reset()
public int getRowCount()
public int getColumnCount()
public BoardSlot getNeighbor(BoardSlot slot,
int dx,
int dy)
public BoardSlot getSlot(int i)
public void repaintAll()
protected void removeAllBoards()
public boolean isAllowMultiple()
public void setAllowMultiple(boolean val)
public org.w3c.dom.Element getBuildElement(org.w3c.dom.Document doc)
getBuildElement in interface BuildableVASSAL.build.Buildablepublic Command decode(java.lang.String command)
CommandEncoderCommanddecode in interface CommandEncoderpublic java.lang.String encode(Command c)
CommandEncoderCommand into a Stringencode in interface CommandEncoder
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||