com.miami.romeo.main
Class Romeo

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

public class Romeo
extends javax.swing.JPanel
implements java.awt.KeyEventDispatcher

Title: Romeo

Description: This is a Java frontend for M.A.M.E.. The mame ports supported by this application are XMame and the Windows command line. XMame is the Unix/X11 port of the mame project. This port makes mame available on *ix machines using the X11R6 X-Window System (and SVGAlib/ggi/XF86-DGA/OpenGL/SDL too).

Copyright: Copyright (c) 2002-2003 by Stefano Bolli. All Rights Reserved.

Company:

Created 2002/11/24

Version:
$Revision: 1.11 $Date: 2003/12/30 01:31:46 $
Author:
$Author: stefanobolli $
See Also:
Serialized Form

Nested Class Summary
protected  class Romeo.ToggleButtonToolBar
          This class extends JToolBar to create toggle buttons.
 
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
 Games games
           
protected  javax.help.HelpBroker helpBroker
           
protected  javax.help.HelpSet helpSet
           
 Info info
           
 Options options
           
 javax.swing.JProgressBar progressBar
           
 javax.swing.JPanel statusbarPanel
           
 javax.swing.JTextField statusField
           
 javax.swing.JTextField statusField2
           
 javax.swing.JTextField statusField3
           
 javax.swing.JTextField statusField4
           
 javax.swing.JPanel statusPanel
           
 
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
Romeo()
          The constructor initializes all components and shows the proggy.
 
Method Summary
protected  void addContextHelp()
          This method adds the context sensitive help.
 void checkNewRelease()
          This method verifies if a new version of Romeo has been released.
 javax.swing.JMenuItem createCheckBoxMenuItem(javax.swing.JMenu menu, java.lang.String label, java.lang.String mnemonic, java.lang.String accessibleDescription, boolean selected, javax.swing.Action action)
          This method creates a generic JCheckBoxMenuItem.
 javax.swing.JFrame createFrame()
          This method creates a frame for Romeo to reside in.
protected  void createHelp()
          This method creates the help system.
 javax.swing.JMenuItem createLafMenuItem(javax.swing.JMenu menu, java.lang.String label, java.lang.String mnemonic, java.lang.String accessibleDescription, java.lang.String laf)
          This method creates a JRadioButtonMenuItem for the Look and Feel menu.
 javax.swing.JMenuItem createLinkMenuItem(javax.swing.JMenu menu, java.lang.String label, java.lang.String address)
          This method creates a generic JMenuItem to list internet links.
 javax.swing.JMenuItem createMenuItem(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 JMenuItem.
 javax.swing.JMenuBar createMenus()
          This method creates and returns all menus.
 javax.swing.JPanel createStatusBar()
          This method creates the status bar.
 javax.swing.JMenuItem createThemesMenuItem(javax.swing.JMenu menu, java.lang.String label, java.lang.String mnemonic, java.lang.String accessibleDescription, javax.swing.plaf.metal.DefaultMetalTheme theme)
          This method creates a JRadioButtonMenuItem for the Themes menu.
 void createToggleButtons()
          This method creates JToggleButtons for the first tool bar.
 void createToggleButtons2()
          This method creates a JToggleButton and some other components for the second tool bar.
 boolean dispatchKeyEvent(java.awt.event.KeyEvent e)
          This method is called by the current KeyboardFocusManager requesting that this KeyEventDispatcher dispatch the specified event on its behalf.
 boolean gamesTabIsSelected()
          This method returns true if the first tab of the JtabbedPane is selected, false otherwise.
 java.awt.Container getContentPane()
          This method returns the content pane.
static javax.swing.JFrame getFrame()
          This method returns the frame instance.
 javax.swing.JMenuBar getJMenuBar()
          This method returns the menubar.
 javax.swing.JTabbedPane getTabbedPane()
          This method returns the tabbed pane.
 Romeo.ToggleButtonToolBar getToolBar()
          This method returns the tool bar.
 Romeo.ToggleButtonToolBar getToolBar2()
          This method returns the second tool bar.
 javax.swing.ButtonGroup getToolBarGroup()
          This method returns the tool bar button group.
 javax.swing.ButtonGroup getToolBarGroup2()
          This method returns the second tool bar button group.
 void initializeRomeo()
          This method initializes all components.
protected  boolean isAvailableLookAndFeel(java.lang.String laf)
          An utility function that layers on top of the LookAndFeel's isSupportedLookAndFeel() method.
static void main(java.lang.String[] args)
          Romeo main.
 void printInfo()
          This method prints a few human readable informations about Romeo.
protected  void saveComponents()
          Before the J2SE 1.4 release, all Swing components have included the advisory that "A future release of Swing will provide support for long term persistence."
 void search(java.lang.String keyword)
          This method searchs for a description or name in the list of games.
 boolean searchFieldHasFocus(javax.swing.JTextField m_editor)
          This method returns true if the search field has focus, false otherwise.
 void setLocked(boolean locked, java.awt.Container c)
          This method locks/unlocks all container' s components.
 void setLookAndFeel(java.lang.String laf)
          This method stores the current L&F, and calls updateLookAndFeel().
 void setSkinTheme(java.lang.String skin)
          This method sets the skin.
 void setStartupSkin()
          This method loads a skin on startup.
 void setStatusFieldMessage()
          This method tells the user to press key F3 to highlight results found by void search().
 void showRomeo()
          This method brings up Romeo by showing the frame.
 void showSplash()
          This method creates and shows the splash screen.
 void updateLookAndFeel()
          This method sets the current L&F on each frame.
 void updateSkinTheme(java.lang.String newSkin, boolean useSkin)
          This method loads/unloads a skin.
 
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

statusField

public javax.swing.JTextField statusField

statusField2

public javax.swing.JTextField statusField2

statusField3

public javax.swing.JTextField statusField3

statusField4

public javax.swing.JTextField statusField4

progressBar

public javax.swing.JProgressBar progressBar

statusPanel

public javax.swing.JPanel statusPanel

statusbarPanel

public javax.swing.JPanel statusbarPanel

games

public Games games

info

public Info info

options

public Options options

helpSet

protected javax.help.HelpSet helpSet

helpBroker

protected javax.help.HelpBroker helpBroker
Constructor Detail

Romeo

public Romeo()
The constructor initializes all components and shows the proggy.

See Also:
printInfo(), createFrame(), initializeRomeo(), showSplash(), showRomeo(), Games.initGames(), checkNewRelease()
Method Detail

main

public static void main(java.lang.String[] args)
Romeo main. Called cause we' re an application. This should never be invoked directly.

Parameters:
args - The command line arguments

printInfo

public void printInfo()
This method prints a few human readable informations about Romeo.


showSplash

public void showSplash()
This method creates and shows the splash screen.

Since:
0.1a

initializeRomeo

public void initializeRomeo()
This method initializes all components.

See Also:
createHelp(), createMenus(), createToggleButtons(), createToggleButtons2(), createStatusBar(), addContextHelp()

createHelp

protected void createHelp()
This method creates the help system. Since version 0.1.3pre1 the documentation is JavaHelp based.

Since:
0.1.3pre1

createMenus

public javax.swing.JMenuBar createMenus()
This method creates and returns all menus.

Returns:
Menus
See Also:
createMenuItem(JMenu, String, String, String, String, Action), createCheckBoxMenuItem(JMenu, String, String, String, boolean, Action), createLafMenuItem(JMenu, String, String, String, String), createThemesMenuItem(JMenu, String, String, String, DefaultMetalTheme), createLinkMenuItem(JMenu, String, String)

createMenuItem

public javax.swing.JMenuItem createMenuItem(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 JMenuItem.

Parameters:
menu - The 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:
A JMenuItem for the menu

createCheckBoxMenuItem

public javax.swing.JMenuItem createCheckBoxMenuItem(javax.swing.JMenu menu,
                                                    java.lang.String label,
                                                    java.lang.String mnemonic,
                                                    java.lang.String accessibleDescription,
                                                    boolean selected,
                                                    javax.swing.Action action)
This method creates a generic JCheckBoxMenuItem.

Parameters:
menu - The 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
selected - True if the component is selected, false otherwise
action - The Action for the ActionEvent source
Returns:
A JCheckBoxMenuItem for the menu

createLafMenuItem

public javax.swing.JMenuItem createLafMenuItem(javax.swing.JMenu menu,
                                               java.lang.String label,
                                               java.lang.String mnemonic,
                                               java.lang.String accessibleDescription,
                                               java.lang.String laf)
This method creates a JRadioButtonMenuItem for the Look and Feel menu.

Parameters:
menu - The menu to add the JRadioButtonMenuItem to
label - The components' s text
mnemonic - The keyboard mnemonic on the current component
accessibleDescription - The accessible description of this object
laf - The look and feel
Returns:
A JRadioButtonMenuItem for the LnF menu

createThemesMenuItem

public javax.swing.JMenuItem createThemesMenuItem(javax.swing.JMenu menu,
                                                  java.lang.String label,
                                                  java.lang.String mnemonic,
                                                  java.lang.String accessibleDescription,
                                                  javax.swing.plaf.metal.DefaultMetalTheme theme)
This method creates a JRadioButtonMenuItem for the Themes menu.

Parameters:
menu - The menu to add the JRadioButtonMenuItem to
label - The components' s text
mnemonic - The keyboard mnemonic on the current component
accessibleDescription - The accessible description of this object
theme - The theme to load
Returns:
A JRadioButtonMenuItem for the Themes menu

createLinkMenuItem

public javax.swing.JMenuItem createLinkMenuItem(javax.swing.JMenu menu,
                                                java.lang.String label,
                                                java.lang.String address)
This method creates a generic JMenuItem to list internet links.

Parameters:
menu - The menu to add the JMenuItem to
label - The components' s text
address - The internet address of the link
Returns:
A JMenuItem for the Links menu
Since:
0.1.3pre1

createToggleButtons

public void createToggleButtons()
This method creates JToggleButtons for the first tool bar.


createToggleButtons2

public void createToggleButtons2()
This method creates a JToggleButton and some other components for the second tool bar. With these components it' s possible to search a keyword in the list of games.


createStatusBar

public javax.swing.JPanel createStatusBar()
This method creates the status bar.

Returns:
JPanel

showRomeo

public void showRomeo()
This method brings up Romeo by showing the frame.

See Also:
setStartupSkin()

setStartupSkin

public void setStartupSkin()
This method loads a skin on startup.

See Also:
setSkinTheme(String)

updateSkinTheme

public void updateSkinTheme(java.lang.String newSkin,
                            boolean useSkin)
This method loads/unloads a skin.

Parameters:
newSkin - The path to the new skin to load
useSkin - True if a skin has to be loaded, false if the the skin has to be unloaded
See Also:
updateLookAndFeel()

setSkinTheme

public void setSkinTheme(java.lang.String skin)
This method sets the skin.

Parameters:
skin - The skin to load

isAvailableLookAndFeel

protected boolean isAvailableLookAndFeel(java.lang.String laf)
An utility function that layers on top of the LookAndFeel's isSupportedLookAndFeel() method. Returns true if the LookAndFeel is supported. Returns false if the LookAndFeel is not supported and/or if there is any kind of error checking if the LookAndFeel is supported. The L&F menu will use this method to detemine whether the various L&F options should be active or inactive.

Parameters:
laf - The look and feel
Returns:
True if the LookAndFeel is supported; false otherwise.

setLookAndFeel

public void setLookAndFeel(java.lang.String laf)
This method stores the current L&F, and calls updateLookAndFeel().

Parameters:
laf - The LnF
See Also:
updateLookAndFeel()

updateLookAndFeel

public void updateLookAndFeel()
This method sets the current L&F on each frame.


getFrame

public static javax.swing.JFrame getFrame()
This method returns the frame instance.

Returns:
JFrame

getJMenuBar

public javax.swing.JMenuBar getJMenuBar()
This method returns the menubar.

Returns:
JMenuBar

getToolBar

public Romeo.ToggleButtonToolBar getToolBar()
This method returns the tool bar.

Returns:
ToggleButtonToolBar

getToolBarGroup

public javax.swing.ButtonGroup getToolBarGroup()
This method returns the tool bar button group.

Returns:
ButtonGroup

getToolBar2

public Romeo.ToggleButtonToolBar getToolBar2()
This method returns the second tool bar.

Returns:
ToggleButtonToolBar

getToolBarGroup2

public javax.swing.ButtonGroup getToolBarGroup2()
This method returns the second tool bar button group.

Returns:
ButtonGroup

getTabbedPane

public javax.swing.JTabbedPane getTabbedPane()
This method returns the tabbed pane.

Returns:
JTabbedPane

getContentPane

public java.awt.Container getContentPane()
This method returns the content pane.

Returns:
Container

createFrame

public javax.swing.JFrame createFrame()
This method creates a frame for Romeo to reside in.


setLocked

public void setLocked(boolean locked,
                      java.awt.Container c)
This method locks/unlocks all container' s components.

Parameters:
locked - If true unlocks all components; else locks them.
c - The container containing the components to lock/unlock

dispatchKeyEvent

public boolean dispatchKeyEvent(java.awt.event.KeyEvent e)
This method is called by the current KeyboardFocusManager requesting that this KeyEventDispatcher dispatch the specified event on its behalf. This KeyEventDispatcher is free to retarget the event, consume it, dispatch it itself, or make other changes. This capability is typically used to deliver KeyEvents to Components other than the focus owner. This can be useful when navigating children of non-focusable Windows in an accessible environment, for example. Note that if a KeyEventDispatcher dispatches the KeyEvent itself, it must use redispatchEvent to prevent the current KeyboardFocusManager from recursively requesting that this KeyEventDispatcher dispatch the event again. If an implementation of this method returns false, then the KeyEvent is passed to the next KeyEventDispatcher in the chain, ending with the current KeyboardFocusManager. If an implementation returns true, the KeyEvent is assumed to have been dispatched (although this need not be the case), and the current KeyboardFocusManager will take no further action with regard to the KeyEvent. In such a case, KeyboardFocusManager.dispatchEvent should return true as well. If an implementation consumes the KeyEvent, but returns false, the consumed event will still be passed to the next KeyEventDispatcher in the chain. It is important for developers to check whether the KeyEvent has been consumed before dispatching it to a target. By default, the current KeyboardFocusManager will not dispatch a consumed KeyEvent. The addition of the KeyEventDispatcher class and the focus manager allows the Java 1.4 program to work the same way it did in its Java 1.3 version.

Specified by:
dispatchKeyEvent in interface java.awt.KeyEventDispatcher
Parameters:
e - The KeyEvent to dispatch
Returns:
true if the key event has been consumed by this method and false if it has not.
Since:
0.1.3pre1
See Also:
Games.highlightRow(JTable, int, int), search(String)

gamesTabIsSelected

public boolean gamesTabIsSelected()
This method returns true if the first tab of the JtabbedPane is selected, false otherwise.

Returns:
True if the first tab of the JtabbedPane is selected, false otherwise.

searchFieldHasFocus

public boolean searchFieldHasFocus(javax.swing.JTextField m_editor)
This method returns true if the search field has focus, false otherwise.

Parameters:
m_editor - The combo box' s editor
Returns:
True if the search field has focus, false otherwise.

addContextHelp

protected void addContextHelp()
This method adds the context sensitive help.

Since:
0.1.3pre1

checkNewRelease

public void checkNewRelease()
This method verifies if a new version of Romeo has been released.


search

public void search(java.lang.String keyword)
This method searchs for a description or name in the list of games.

Parameters:
keyword - The keyword to search

setStatusFieldMessage

public void setStatusFieldMessage()
This method tells the user to press key F3 to highlight results found by void search().

Since:
0.1.3pre1
See Also:
search(String)

saveComponents

protected void saveComponents()
                       throws java.lang.Exception
Before the J2SE 1.4 release, all Swing components have included the advisory that "A future release of Swing will provide support for long term persistence." This has been replaced with the notice that "As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package." The XMLEncoder class in the java.beans package allows us to persist a JavaBean in an XML file. Among other things, this provides a way to save Swing components. After we save a Swing component, we can reconstitute the component with the XMLDecoder class in the the java.beans package. this method instantiates an XMLEncoder object, and then uses it to store an XML representation of the JFrame in the file Romeo.xml.

Throws:
Exception - DOCUMENT ME!
java.lang.Exception
Since:
0.1.3pre2