com.miami.romeo.main
Class Games

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.miami.romeo.main.Games
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class Games
extends javax.swing.JPanel

Games.
Panel with a single selection tree, the list of games and a message area to show any errors or diagnostics.

Version:
$Revision: 1.21 $Date: 2003/12/29 17:05:53 $
Author:
$Author: Stefano Bolli
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 javax.swing.table.TableColumnModel columnModel1
           
 javax.swing.table.TableColumnModel columnModel2
           
 javax.swing.table.TableColumnModel columnModel3
           
 javax.swing.JButton extTablesColor
           
 javax.swing.JSplitPane horzSplitPane
           
 javax.swing.JLabel interCellSpacingLabel
           
 javax.swing.JSlider interCellSpacingSlider
           
 javax.swing.JButton intTablesColor
           
 IndicatorCellRenderer iRenderer
           
 javax.swing.JTextPane messageArea
           
 javax.swing.JPanel messageAreaPanel
           
 TableRenderer renderer
           
 javax.swing.JPanel rightPanel
           
 java.util.Vector row
           
 javax.swing.JLabel rowHeightLabel
           
 javax.swing.JSlider rowHeightSlider
           
 SortButtonRenderer sbr
           
 javax.swing.JScrollPane scrollMessages
           
 javax.swing.JCheckBox showHorizontalLinesCheckBox
           
 javax.swing.JCheckBox showVerticalLinesCheckBox
           
 javax.swing.JTable table
           
 javax.swing.JTable table2
           
 javax.swing.JTable table3
           
 javax.swing.JPanel tableOptionsPanel
           
 javax.swing.JTree tree
           
 TreeNodeRenderer treeRenderer
           
 javax.swing.JSplitPane vertSplitPane
           
 javax.swing.JComboBox xmameComboBox
           
 
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
Games(Romeo romeo)
          The constructor initializes all components.
 
Method Summary
 void appendMessage(java.lang.String type, java.lang.String message)
          This method appends a line to the message area in this way: date + message.
 void checkCatver()
          This method checks if catver.ini exists: if the file exists it enables any specific tree nodes.
 void checkListOfGames(java.lang.String xmamePath)
          This method checks wheter a list of games has been created for a given xmame executable.
 java.lang.Integer checkMinMax(java.lang.Integer value)
          This method checks min/max values for the progress bars in the main table.
 void checkXmame(java.lang.String xmamePath)
          This method performs any operations if a new xmame executable is selected.
 IndicatorCellRenderer createIndicatorCellRenderer()
          This method returns a renderer for the table cells containing a progress bar.
 void createInfoDialog(java.lang.String title, java.lang.String gameName, java.lang.String cloneOf, java.lang.String[] lines)
          This method creates a dialog box to show info about a game.
 javax.swing.JScrollPane createMessageArea()
          This method creates a scrollable message area to display any errors or diagnostics from subprocesses.
protected  void createNodes(TreeNode top)
          This methods creates tree nodes.
 javax.swing.JCheckBoxMenuItem createPopupCheckBoxMenuItem(javax.swing.JPopupMenu popup, java.lang.String label, java.lang.String mnemonic, java.lang.String accessibleDescription, java.lang.String filename, javax.swing.Action action, int row)
          This method creates a JCheckBoxMenuItem for the popup menu to set a given game as a favorite.
 javax.swing.JPopupMenu createPopupMenu(javax.swing.JTable tableSource, int x, int y, int row, int column)
          This method creates a popup menu for the tables.
 javax.swing.JMenuItem createPopupMenuItem(javax.swing.JPopupMenu popup, java.lang.String label, java.lang.String mnemonic, java.lang.String accessibleDescription, java.lang.String filename, javax.swing.Action action)
          This method creates a generic JMenuItem for the popup menu.
 javax.swing.JMenuItem createPopupSubMenuItem(javax.swing.JMenu menu, java.lang.String label, java.lang.String mnemonic, java.lang.String accessibleDescription, java.lang.String filename, javax.swing.Action action)
          This method creates a generic sub JMenuItem for the popup menu.
 TableRenderer createTableCellRenderer(java.awt.Color background)
          This method returns a new DefaultTableCellRenderer to render table cells containing a label.
 javax.swing.JPanel createTableOptions()
          This method creates a panel containing table options.
 javax.swing.JScrollPane createTables()
          This method creates three tables and then adds them to a a JScrollPane.
 javax.swing.JScrollPane createTree()
          This method create a single selection JTree and then adds it to a JScrollPane.
 javax.swing.JPopupMenu createTreePopupMenu(javax.swing.JTree treeSource, int x, int y)
           
 javax.swing.JComboBox createXmameComboBox()
          This method creates a combo box to list available xmame executables and then adds it to a scroll pane.
 void enableTree()
          This method enables the selection tree.
 boolean gameExists(java.lang.String[] romDir, java.lang.String gameName)
          This method returns true if the given game exists, false otherwise.
 boolean gameIsRunnable(java.lang.String gameName, java.lang.String cloneOf, java.lang.String driver)
          This method returns if a rom is runnable.
 java.lang.String getGamePath(java.lang.String[] romDir, java.lang.String gameName)
          This method returns the rom dir path where the given game has been stored in.
protected  java.lang.String getNameOfList(java.lang.String xmamePath)
          This method returns the name of the list of games.
 javax.swing.JPopupMenu getPopupMenu()
          This method returns the table popup menu.
 java.lang.String[] getRomDirs()
          This method returns the rom dir paths.
protected  java.lang.String getXmamePath()
          This method returns the xmame executable file path.
 java.lang.String getXmameVersion(java.lang.String xmamePath)
          This method returns xmame version.
 void highlightAllGamesNode()
          This method highlights programmatically 'All games' node.
 void highlightRow(javax.swing.JTable table, int row, int column)
          This method highlights a row in the list of games.
 void initGames()
          This method shows the list of all games on startup.
 boolean kickerIsAvailable(java.lang.String[] romDir, java.lang.String gameName, java.lang.String driver)
          This method verifies if the kicker needed by the given game is available.
 boolean kickerOK(java.lang.String[] romDir, java.lang.String kickerName)
          This method returns true if the kicker exists, false otherwise.
 boolean originalGameExists(java.lang.String[] romDir, java.lang.String gameName)
          This method returns true if the given game exists, false otherwise.
 java.lang.String parseURL(java.lang.String url, java.lang.String fileName)
          This method parses an internet url set by the user to download a file (rom, snap etc.), returning a string with all chars '$' substituted by the file name.
 void resize(javax.swing.JComponent comp)
          This method resizes the tables.
 boolean romNeedsKicker(java.lang.String driver)
          This method verifies if the given game needs a kicker.
 void saveListOfGames()
          This method creates a box to show the updating of the list of games.
 void scrollMessageAreaToBottom()
          This method scrolls the message area to the bottom.
 void setCategoryNodeEnabled(javax.swing.JTree tree, boolean enabled)
          This method enables/disables tree categories nodes.
 void setCellSize()
          This method sets table cell height and width.
 void setComponentsLocked(boolean locked)
          This method locks/unlocks some menu items.
 void setNumberOfPlayedMatches(java.lang.String gameName, int MAX)
          This method sets the values for the progress bars contained in the table.
 void setXmameSoundPlugins(java.lang.String xmamePath)
          This method updates sound plugins.
protected  void showListOfGames(java.lang.String selectedNode)
          This method shows the list of games selected by the user.
protected  void showListOfGames(java.net.URL url)
          This method shows the list of games selected by the user.
 void updateRomeo(java.lang.String xmamePath)
          This method updates some components if the list of games has been loaded.
 void updateStatusField(java.lang.String xmamePath)
          This method shows xmame version in the status bar.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

xmameComboBox

public javax.swing.JComboBox xmameComboBox

tree

public javax.swing.JTree tree

treeRenderer

public TreeNodeRenderer treeRenderer

interCellSpacingLabel

public javax.swing.JLabel interCellSpacingLabel

interCellSpacingSlider

public javax.swing.JSlider interCellSpacingSlider

rowHeightLabel

public javax.swing.JLabel rowHeightLabel

rowHeightSlider

public javax.swing.JSlider rowHeightSlider

showHorizontalLinesCheckBox

public javax.swing.JCheckBox showHorizontalLinesCheckBox

showVerticalLinesCheckBox

public javax.swing.JCheckBox showVerticalLinesCheckBox

intTablesColor

public javax.swing.JButton intTablesColor

extTablesColor

public javax.swing.JButton extTablesColor

row

public java.util.Vector row

columnModel1

public javax.swing.table.TableColumnModel columnModel1

columnModel2

public javax.swing.table.TableColumnModel columnModel2

columnModel3

public javax.swing.table.TableColumnModel columnModel3

renderer

public TableRenderer renderer

iRenderer

public IndicatorCellRenderer iRenderer

sbr

public SortButtonRenderer sbr

tableOptionsPanel

public javax.swing.JPanel tableOptionsPanel

rightPanel

public javax.swing.JPanel rightPanel

table

public javax.swing.JTable table

table2

public javax.swing.JTable table2

table3

public javax.swing.JTable table3

messageArea

public javax.swing.JTextPane messageArea

scrollMessages

public javax.swing.JScrollPane scrollMessages

messageAreaPanel

public javax.swing.JPanel messageAreaPanel

horzSplitPane

public javax.swing.JSplitPane horzSplitPane

vertSplitPane

public javax.swing.JSplitPane vertSplitPane
Constructor Detail

Games

public Games(Romeo romeo)
The constructor initializes all components.

Parameters:
romeo - The caller
Method Detail

createXmameComboBox

public javax.swing.JComboBox createXmameComboBox()
This method creates a combo box to list available xmame executables and then adds it to a scroll pane.

Returns:
JComboBox
Since:
0.1.3pre1
See Also:
checkXmame(String)

createTree

public javax.swing.JScrollPane createTree()
This method create a single selection JTree and then adds it to a JScrollPane.

Returns:
JScrollPane
Since:
0.1a
See Also:
createNodes(TreeNode), showListOfGames(String), checkCatver()

createNodes

protected void createNodes(TreeNode top)
This methods creates tree nodes.

Parameters:
top - The root tree node

showListOfGames

protected void showListOfGames(java.net.URL url)
This method shows the list of games selected by the user.

Parameters:
url - The url representing the user selection
See Also:
showListOfGames(String)

createTreePopupMenu

public javax.swing.JPopupMenu createTreePopupMenu(javax.swing.JTree treeSource,
                                                  int x,
                                                  int y)

showListOfGames

protected void showListOfGames(java.lang.String selectedNode)
This method shows the list of games selected by the user.

Parameters:
selectedNode - The name of the selected tree node
See Also:
resize(JComponent), Utils.setProgressBarMaximum(JProgressBar, int), Utils.setProgressBarValue(JProgressBar, int), TableSorter.tableChanged(TableModelEvent)

resize

public void resize(javax.swing.JComponent comp)
This method resizes the tables.

Parameters:
comp - The component to resize
Since:
0.1.3pre3

createTableOptions

public javax.swing.JPanel createTableOptions()
This method creates a panel containing table options.

Returns:
JPanel

createTables

public javax.swing.JScrollPane createTables()
This method creates three tables and then adds them to a a JScrollPane. Table 1 and table 3 will be fixed, (only vert. scroll), table 2 will be scrollable horizontally and vertically. Table 2 will be scrollable behind table 1 and table 3.

Returns:
JScrollPane
Since:
0.1b
See Also:
createTableCellRenderer(Color), createIndicatorCellRenderer(), TableSorter.addMouseListenerToHeaderInTable(JTable, SortButtonRenderer), Romeo.setLocked(boolean, Container), setComponentsLocked(boolean), Options.runMame(), createPopupMenu(JTable, int, int, int, int)

createTableCellRenderer

public TableRenderer createTableCellRenderer(java.awt.Color background)
This method returns a new DefaultTableCellRenderer to render table cells containing a label.

Parameters:
background - The background color to pass to the table renderer
Returns:
TableRenderer

createIndicatorCellRenderer

public IndicatorCellRenderer createIndicatorCellRenderer()
This method returns a renderer for the table cells containing a progress bar.

Returns:
IndicatorCellRenderer
See Also:
JProgressBar.setStringPainted(boolean), JComponent.setBackground(Color), IndicatorCellRenderer.setLimits(Hashtable)

setCellSize

public void setCellSize()
This method sets table cell height and width.


setComponentsLocked

public void setComponentsLocked(boolean locked)
This method locks/unlocks some menu items. boolean locked If true enable these menu items; else disable them.


createPopupMenu

public javax.swing.JPopupMenu createPopupMenu(javax.swing.JTable tableSource,
                                              int x,
                                              int y,
                                              int row,
                                              int column)
This method creates a popup menu for the tables.

Parameters:
tableSource - The component invoker
x - The x coordinate in invoker's coordinate space at which the popup menu is to be displayed
y - The y coordinate in invoker's coordinate space at which the popup menu is to be displayed
row - The table row at the position x,y in the coordinate space of the component invoker
column - The table column at the position x,y in the coordinate space of the component invoker
Returns:
JPopupMenu
Since:
0.1a
See Also:
createPopupMenuItem(JPopupMenu, String, String, String, String, Action), createPopupCheckBoxMenuItem(JPopupMenu, String, String, String, String, Action, int), createPopupSubMenuItem(JMenu, String, String, String, String, Action)

createPopupMenuItem

public javax.swing.JMenuItem createPopupMenuItem(javax.swing.JPopupMenu popup,
                                                 java.lang.String label,
                                                 java.lang.String mnemonic,
                                                 java.lang.String accessibleDescription,
                                                 java.lang.String filename,
                                                 javax.swing.Action action)
This method creates a generic JMenuItem for the popup menu.

Parameters:
popup - The popup menu to add the menu item to
label - The menu item' s text
mnemonic - The keyboard mnemonic on the current component
accessibleDescription - The accessible description of this object
filename - The icon this component will display
action - The Action for the ActionEvent source
Returns:
JMenuItem for the popup menu

createPopupSubMenuItem

public javax.swing.JMenuItem createPopupSubMenuItem(javax.swing.JMenu menu,
                                                    java.lang.String label,
                                                    java.lang.String mnemonic,
                                                    java.lang.String accessibleDescription,
                                                    java.lang.String filename,
                                                    javax.swing.Action action)
This method creates a generic sub JMenuItem for the popup menu.

Parameters:
menu - The menu to add the sub menu item to
label - The menu item' s text
mnemonic - The keyboard mnemonic on the current component
accessibleDescription - The accessible description of this object
filename - The icon this component will display
action - The Action for the ActionEvent source
Returns:
JMenuItem for the popup menu

createPopupCheckBoxMenuItem

public javax.swing.JCheckBoxMenuItem createPopupCheckBoxMenuItem(javax.swing.JPopupMenu popup,
                                                                 java.lang.String label,
                                                                 java.lang.String mnemonic,
                                                                 java.lang.String accessibleDescription,
                                                                 java.lang.String filename,
                                                                 javax.swing.Action action,
                                                                 int row)
This method creates a JCheckBoxMenuItem for the popup menu to set a given game as a favorite.

Parameters:
popup - The popup menu to add the JCheckBoxMenuItem to
label - The components' s text
mnemonic - The keyboard mnemonic on the current component
accessibleDescription - The accessible description of this object
filename - The icon this component will display
action - The Action for the ActionEvent source
row - The table row where to know if the component is enabled
Returns:
JCheckBoxMenuItem for the popup menu

getPopupMenu

public javax.swing.JPopupMenu getPopupMenu()
This method returns the table popup menu.

Returns:
JPopupMenu

createMessageArea

public javax.swing.JScrollPane createMessageArea()
This method creates a scrollable message area to display any errors or diagnostics from subprocesses.

Returns:
JScrollPane
See Also:
appendMessage(String, String)

initGames

public void initGames()
This method shows the list of all games on startup.


checkXmame

public void checkXmame(java.lang.String xmamePath)
This method performs any operations if a new xmame executable is selected.

Parameters:
xmamePath - The path to the xmame executable
See Also:
checkListOfGames(String), appendMessage(String, String)

checkListOfGames

public void checkListOfGames(java.lang.String xmamePath)
This method checks wheter a list of games has been created for a given xmame executable.

Parameters:
xmamePath - The path to the xmame executable
See Also:
saveListOfGames(), DataIO.listOfGamesExists(String, String), DataIO.saveListOfGames(String, String), DataIO.getListOfGames(String, String), appendMessage(String, String)

saveListOfGames

public void saveListOfGames()
This method creates a box to show the updating of the list of games.

See Also:
DataIO.saveListOfGames(String, String), updateRomeo(String)

updateRomeo

public void updateRomeo(java.lang.String xmamePath)
This method updates some components if the list of games has been loaded.

See Also:
updateStatusField(String), enableTree(), checkCatver(), highlightAllGamesNode(), setXmameSoundPlugins(String)

updateStatusField

public void updateStatusField(java.lang.String xmamePath)
This method shows xmame version in the status bar.

Parameters:
xmamePath - The path to the xmame executable
See Also:
getXmameVersion(String)

getXmameVersion

public java.lang.String getXmameVersion(java.lang.String xmamePath)
This method returns xmame version.

Parameters:
xmamePath - The path to the xmame executable
Returns:
String
See Also:
Xmame.getVersion(String)

enableTree

public void enableTree()
This method enables the selection tree.

See Also:
appendMessage(String, String)

setCategoryNodeEnabled

public void setCategoryNodeEnabled(javax.swing.JTree tree,
                                   boolean enabled)
This method enables/disables tree categories nodes.

Parameters:
tree - The tree to enable/disable
enabled - if true enable the tree; else disable it.
See Also:
TreeNode.getChildCount()

checkCatver

public void checkCatver()
This method checks if catver.ini exists: if the file exists it enables any specific tree nodes.

See Also:
setCategoryNodeEnabled(JTree, boolean), appendMessage(String, String)

highlightAllGamesNode

public void highlightAllGamesNode()
This method highlights programmatically 'All games' node.


setXmameSoundPlugins

public void setXmameSoundPlugins(java.lang.String xmamePath)
This method updates sound plugins.

Parameters:
xmamePath - The path to the xmame executable
See Also:
Xmame.setDigitalSoundPlugins(String), Xmame.setSoundMixerPlugins(String)

gameIsRunnable

public boolean gameIsRunnable(java.lang.String gameName,
                              java.lang.String cloneOf,
                              java.lang.String driver)
This method returns if a rom is runnable.

Parameters:
gameName - The game name
cloneOf - The original version of the given game
driver - The driver used by the game
Returns:
True if the game is runnable; false otherwise.
See Also:
getRomDirs(), gameExists(String[], String), Xmame.romIsCorrect(String, String, String), romNeedsKicker(String), kickerIsAvailable(String[], String, String), originalGameExists(String[], String), appendMessage(String, String)

getRomDirs

public java.lang.String[] getRomDirs()
This method returns the rom dir paths.

Returns:
The rom dir paths
Since:
0.1.3pre2
See Also:
Utils.parseValues(String, char)

gameExists

public boolean gameExists(java.lang.String[] romDir,
                          java.lang.String gameName)
This method returns true if the given game exists, false otherwise.

Parameters:
romDir - The rom dirs
gameName - The game name
Returns:
True if the given game exists, false otherwise
Since:
0.1.3pre2

getGamePath

public java.lang.String getGamePath(java.lang.String[] romDir,
                                    java.lang.String gameName)
This method returns the rom dir path where the given game has been stored in.

Parameters:
romDir - The rom dirs
gameName - The game name
Returns:
The path to the given game
Since:
0.1.3pre2

romNeedsKicker

public boolean romNeedsKicker(java.lang.String driver)
This method verifies if the given game needs a kicker.

Parameters:
driver - The driver used by a given game
Returns:
True if the game needs a kicker; false otherwise.
Since:
0.1.3pre1

kickerIsAvailable

public boolean kickerIsAvailable(java.lang.String[] romDir,
                                 java.lang.String gameName,
                                 java.lang.String driver)
This method verifies if the kicker needed by the given game is available.

Parameters:
romDir - The path to the rom dirs
gameName - The game name
driver - The driver used by the game
Returns:
True if the kicker is available; false otherwise.
See Also:
kickerOK(String[], String)

kickerOK

public boolean kickerOK(java.lang.String[] romDir,
                        java.lang.String kickerName)
This method returns true if the kicker exists, false otherwise.

Parameters:
romDir - The rom dirs
kickerName - The kicker name
Returns:
True if the kicker exists, false otherwise
Since:
0.1.3pre2

originalGameExists

public boolean originalGameExists(java.lang.String[] romDir,
                                  java.lang.String gameName)
This method returns true if the given game exists, false otherwise.

Parameters:
romDir - The rom dirs
gameName - The game name
Returns:
True if the given game exists, false otherwise
Since:
0.1.3pre2

getNameOfList

protected java.lang.String getNameOfList(java.lang.String xmamePath)
This method returns the name of the list of games.

Parameters:
xmamePath - The path to the xmame executable
Returns:
String
See Also:
Xmame.getVersion(String)

getXmamePath

protected java.lang.String getXmamePath()
This method returns the xmame executable file path.

Returns:
String

appendMessage

public void appendMessage(java.lang.String type,
                          java.lang.String message)
This method appends a line to the message area in this way: date + message.

Parameters:
type - The type of message to display
message - The message to display
See Also:
scrollMessageAreaToBottom()

scrollMessageAreaToBottom

public void scrollMessageAreaToBottom()
This method scrolls the message area to the bottom.


setNumberOfPlayedMatches

public void setNumberOfPlayedMatches(java.lang.String gameName,
                                     int MAX)
This method sets the values for the progress bars contained in the table.

Parameters:
gameName - The game name
MAX - The maximum value

checkMinMax

public java.lang.Integer checkMinMax(java.lang.Integer value)
This method checks min/max values for the progress bars in the main table.

Parameters:
value - The value to check
Returns:
Integer

parseURL

public java.lang.String parseURL(java.lang.String url,
                                 java.lang.String fileName)
This method parses an internet url set by the user to download a file (rom, snap etc.), returning a string with all chars '$' substituted by the file name.

Parameters:
url - The url to parse
fileName - The file name
Returns:
String

createInfoDialog

public void createInfoDialog(java.lang.String title,
                             java.lang.String gameName,
                             java.lang.String cloneOf,
                             java.lang.String[] lines)
This method creates a dialog box to show info about a game.

Parameters:
title - The box' s caption
gameName - The game name
cloneOf - The original version of a given game
lines - The array of data to show

highlightRow

public void highlightRow(javax.swing.JTable table,
                         int row,
                         int column)
This method highlights a row in the list of games.

Parameters:
table - The table where to highlight the row in
row - The row to highlight
column - The column where to scroll the table