dk.brics.bisim.view
Class OptionsView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by dk.brics.bisim.view.OptionsView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class OptionsView
extends javax.swing.JPanel

The view for selecting game options.

Author:
Martin Mosegaard martinm@daimi.au.dk
See Also:
Serialized Form

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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 javax.swing.JButton applyButton
           
private static java.lang.String applyString
           
 javax.swing.JRadioButton attackerRadioButton
           
private static java.lang.String attackerString
           
private  javax.swing.ButtonGroup bisimulationButtonGroup
           
private  javax.swing.JPanel bisimulationPanel
           
static java.lang.String bisimulationString
           
private static java.lang.String browseString
           
private  javax.swing.JPanel buttonPanel
           
 javax.swing.JRadioButton clientRadioButton
           
private  javax.swing.border.TitledBorder clientServerBorder
           
private  javax.swing.ButtonGroup clientServerButtonGroup
           
private  javax.swing.JPanel clientServerPanel
           
private static java.lang.String clientServerString
           
private static java.lang.String clientString
           
private  java.io.File currentDir
           
 javax.swing.JRadioButton defenderRadioButton
           
private static java.lang.String defenderString
           
 javax.swing.JButton exitButton
           
private static java.lang.String exitString
           
private  javax.swing.JPanel gameTypePanel
           
private static java.lang.String gameTypeString
           
private  javax.swing.JLabel hostLabel
           
private static java.lang.String hostString
           
 javax.swing.JTextField hostTextField
           
private static int hostTextFieldSize
           
private  javax.swing.ImageIcon icon
           
private  java.awt.Image image
           
private  javax.swing.JLabel imageLabel
           
private  javax.swing.JPanel imagePanel
          The image panel to the left.
 javax.swing.JButton leftLTSBrowseButton
           
private  javax.swing.JLabel leftLTSLabel
           
private  javax.swing.JPanel leftLTSPanel
           
private static java.lang.String leftLTSString
           
private  javax.swing.JTextField leftLTSTextField
           
private  javax.swing.border.Border loweredetched
           
private  javax.swing.JPanel lowerPanel
          The status panel underneath the tabbed pane.
private  javax.swing.JPanel ltsPanel
           
static java.lang.String ltsString
           
private static int ltsTextFieldSize
           
private  javax.swing.JPanel mainPanel
          The main panel of the options view.
 javax.swing.JRadioButton onePlayerRadioButton
           
private static java.lang.String onePlayerString
           
private  javax.swing.border.TitledBorder playersBorder
           
private  javax.swing.ButtonGroup playersButtonGroup
           
private  javax.swing.JPanel playersPanel
           
private static java.lang.String playersString
           
 javax.swing.JButton rightLTSBrowseButton
           
private  javax.swing.JLabel rightLTSLabel
           
private  javax.swing.JPanel rightLTSPanel
           
private static java.lang.String rightLTSString
           
private  javax.swing.JTextField rightLTSTextField
           
private  javax.swing.border.TitledBorder roleBorder
           
private  javax.swing.ButtonGroup roleButtonGroup
           
private  javax.swing.JPanel rolePanel
           
private static java.lang.String roleString
           
private static long serialVersionUID
           
 javax.swing.JRadioButton serverRadioButton
           
private  javax.swing.border.TitledBorder serverSettingsBorder
           
private  javax.swing.JPanel serverSettingsPanel
           
private static java.lang.String serverSettingsString
           
private static java.lang.String serverString
           
 javax.swing.JButton startButton
           
private static java.lang.String startString
           
private  javax.swing.JLabel statusLabel
           
private  javax.swing.JPanel statusPanel
           
 javax.swing.JRadioButton strongRadioButton
           
private static java.lang.String strongString
           
private  javax.swing.JTabbedPane tabbedPane
          The tabbed pane to the right.
 javax.swing.JRadioButton twoPlayerLocalRadioButton
           
private static java.lang.String twoPlayerLocalString
           
 javax.swing.JRadioButton twoPlayerRemoteRadioButton
           
private static java.lang.String twoPlayerRemoteString
           
 javax.swing.JRadioButton weakRadioButton
           
private static java.lang.String weakString
           
 
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
OptionsView()
           
 
Method Summary
 java.io.File chooseLTS()
          Open a file chooser and return the file path.
private  void createBisimulationPanel()
           
private  void createGameTypePanel()
           
private  void createImagePanel()
           
private  void createLowerPanel()
           
private  void createLTSPanel()
           
private  void createTabbedPane()
           
 void displayStatus(java.lang.String mes)
          Display a status in the lower panel.
 java.util.ArrayList<javax.swing.AbstractButton> getButtons()
          Purpose: To return all buttons that need an action listener.
 java.util.ArrayList<javax.swing.JTextField> getTextFields()
          Purpose: To return all text fields that need an action listener.
 void setHostPanelEnabled(boolean enable)
          Enable/disable components inside the host panel.
 void setLeftLTSPath(java.lang.String path)
          Set the path to the left LTS.
 void setRemotePanelEnabled(boolean enable)
          Enable/disable text fields and buttons for remote settings.
 void setRightLTSPath(java.lang.String path)
          Set the path to the right LTS.
 void setRolePanelEnabled(boolean enable)
          Enable buttons inside role panel.
 void setTabEnabled(java.lang.String tabTitle, boolean enable)
          Enable/disable a tab in the tabbed pane.
 
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, 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, getWidth, getVisibleRect, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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, transferFocusBackward, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

mainPanel

private javax.swing.JPanel mainPanel
The main panel of the options view.


imagePanel

private javax.swing.JPanel imagePanel
The image panel to the left.


tabbedPane

private javax.swing.JTabbedPane tabbedPane
The tabbed pane to the right.


lowerPanel

private javax.swing.JPanel lowerPanel
The status panel underneath the tabbed pane.


imageLabel

private javax.swing.JLabel imageLabel

image

private java.awt.Image image

icon

private javax.swing.ImageIcon icon

gameTypePanel

private javax.swing.JPanel gameTypePanel

gameTypeString

private static final java.lang.String gameTypeString
See Also:
Constant Field Values

playersPanel

private javax.swing.JPanel playersPanel

playersString

private static final java.lang.String playersString
See Also:
Constant Field Values

playersButtonGroup

private javax.swing.ButtonGroup playersButtonGroup

onePlayerString

private static final java.lang.String onePlayerString
See Also:
Constant Field Values

onePlayerRadioButton

public javax.swing.JRadioButton onePlayerRadioButton

twoPlayerLocalString

private static final java.lang.String twoPlayerLocalString
See Also:
Constant Field Values

twoPlayerLocalRadioButton

public javax.swing.JRadioButton twoPlayerLocalRadioButton

twoPlayerRemoteString

private static final java.lang.String twoPlayerRemoteString
See Also:
Constant Field Values

twoPlayerRemoteRadioButton

public javax.swing.JRadioButton twoPlayerRemoteRadioButton

clientServerPanel

private javax.swing.JPanel clientServerPanel

clientServerString

private static final java.lang.String clientServerString
See Also:
Constant Field Values

clientServerButtonGroup

private javax.swing.ButtonGroup clientServerButtonGroup

serverString

private static final java.lang.String serverString
See Also:
Constant Field Values

serverRadioButton

public javax.swing.JRadioButton serverRadioButton

clientString

private static final java.lang.String clientString
See Also:
Constant Field Values

clientRadioButton

public javax.swing.JRadioButton clientRadioButton

serverSettingsPanel

private javax.swing.JPanel serverSettingsPanel

serverSettingsString

private static final java.lang.String serverSettingsString
See Also:
Constant Field Values

hostString

private static final java.lang.String hostString
See Also:
Constant Field Values

hostLabel

private javax.swing.JLabel hostLabel

hostTextField

public javax.swing.JTextField hostTextField

hostTextFieldSize

private static final int hostTextFieldSize
See Also:
Constant Field Values

applyString

private static final java.lang.String applyString
See Also:
Constant Field Values

applyButton

public javax.swing.JButton applyButton

rolePanel

private javax.swing.JPanel rolePanel

roleString

private static final java.lang.String roleString
See Also:
Constant Field Values

roleButtonGroup

private javax.swing.ButtonGroup roleButtonGroup

attackerString

private static final java.lang.String attackerString
See Also:
Constant Field Values

attackerRadioButton

public javax.swing.JRadioButton attackerRadioButton

defenderString

private static final java.lang.String defenderString
See Also:
Constant Field Values

defenderRadioButton

public javax.swing.JRadioButton defenderRadioButton

loweredetched

private javax.swing.border.Border loweredetched

playersBorder

private javax.swing.border.TitledBorder playersBorder

roleBorder

private javax.swing.border.TitledBorder roleBorder

serverSettingsBorder

private javax.swing.border.TitledBorder serverSettingsBorder

clientServerBorder

private javax.swing.border.TitledBorder clientServerBorder

ltsPanel

private javax.swing.JPanel ltsPanel

ltsString

public static final java.lang.String ltsString
See Also:
Constant Field Values

browseString

private static final java.lang.String browseString
See Also:
Constant Field Values

ltsTextFieldSize

private static final int ltsTextFieldSize
See Also:
Constant Field Values

leftLTSString

private static final java.lang.String leftLTSString
See Also:
Constant Field Values

leftLTSLabel

private javax.swing.JLabel leftLTSLabel

leftLTSPanel

private javax.swing.JPanel leftLTSPanel

leftLTSTextField

private javax.swing.JTextField leftLTSTextField

leftLTSBrowseButton

public javax.swing.JButton leftLTSBrowseButton

rightLTSString

private static final java.lang.String rightLTSString
See Also:
Constant Field Values

rightLTSLabel

private javax.swing.JLabel rightLTSLabel

rightLTSPanel

private javax.swing.JPanel rightLTSPanel

rightLTSTextField

private javax.swing.JTextField rightLTSTextField

rightLTSBrowseButton

public javax.swing.JButton rightLTSBrowseButton

bisimulationPanel

private javax.swing.JPanel bisimulationPanel

bisimulationString

public static final java.lang.String bisimulationString
See Also:
Constant Field Values

bisimulationButtonGroup

private javax.swing.ButtonGroup bisimulationButtonGroup

strongString

private static final java.lang.String strongString
See Also:
Constant Field Values

strongRadioButton

public javax.swing.JRadioButton strongRadioButton

weakString

private static final java.lang.String weakString
See Also:
Constant Field Values

weakRadioButton

public javax.swing.JRadioButton weakRadioButton

statusPanel

private javax.swing.JPanel statusPanel

statusLabel

private javax.swing.JLabel statusLabel

buttonPanel

private javax.swing.JPanel buttonPanel

startString

private static final java.lang.String startString
See Also:
Constant Field Values

startButton

public javax.swing.JButton startButton

exitString

private static final java.lang.String exitString
See Also:
Constant Field Values

exitButton

public javax.swing.JButton exitButton

currentDir

private java.io.File currentDir
Constructor Detail

OptionsView

public OptionsView()
Method Detail

createImagePanel

private void createImagePanel()

createTabbedPane

private void createTabbedPane()

createGameTypePanel

private void createGameTypePanel()

createLTSPanel

private void createLTSPanel()

createBisimulationPanel

private void createBisimulationPanel()

createLowerPanel

private void createLowerPanel()

getButtons

public java.util.ArrayList<javax.swing.AbstractButton> getButtons()
Purpose: To return all buttons that need an action listener.

Returns:
An ArrayList of buttons

getTextFields

public java.util.ArrayList<javax.swing.JTextField> getTextFields()
Purpose: To return all text fields that need an action listener.

Returns:
An ArrayList of text fields

setLeftLTSPath

public void setLeftLTSPath(java.lang.String path)
Set the path to the left LTS.

Parameters:
path - A path name

setRightLTSPath

public void setRightLTSPath(java.lang.String path)
Set the path to the right LTS.

Parameters:
path - A path name

chooseLTS

public java.io.File chooseLTS()
Open a file chooser and return the file path.


setRolePanelEnabled

public void setRolePanelEnabled(boolean enable)
Enable buttons inside role panel.

Parameters:
enable - Whether or not to enable

setRemotePanelEnabled

public void setRemotePanelEnabled(boolean enable)
Enable/disable text fields and buttons for remote settings.

Parameters:
enable - Whether or not to enable

setHostPanelEnabled

public void setHostPanelEnabled(boolean enable)
Enable/disable components inside the host panel.

Parameters:
enable - Whether or not to enable

setTabEnabled

public void setTabEnabled(java.lang.String tabTitle,
                          boolean enable)
Enable/disable a tab in the tabbed pane.

Parameters:
tabTitle - Title of the tab
enable - Whether or not to enable

displayStatus

public void displayStatus(java.lang.String mes)
Display a status in the lower panel.

Parameters:
mes - A status message