net.curre.prefcount.service
Class MainService

java.lang.Object
  extended by net.curre.prefcount.service.MainService

public class MainService
extends java.lang.Object

This service bean is responsible for handling various general tasks such as quitting, printing, etc.

Created date: Jun 15, 2008

Author:
Yevgeny Nyden

Method Summary
static PrefCountMenuBar addMainWindowMenuBar(javax.swing.JFrame frame)
          Creates an appropriate menu bar for the main window and sets it on the mainWindow object.
static PrefCountMenuBar addPlayerDialogMenuBar(javax.swing.JFrame frame)
          Creates a menu bar for the player dialog window and sets it on the mainWindow.playerDialogFrame object.
static void doPrint()
          Sends the game results to the OS printing system.
static void doPrintTemplate(int numberOfPlayers)
          Sends the score board template to the OS printing system.
static void doQuit()
          Disposes all frames and quits the application.
static void doShowHelp(WindowComponent itemEnum)
          Displays help information in a separate window.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doShowHelp

public static void doShowHelp(WindowComponent itemEnum)
Displays help information in a separate window.

Parameters:
itemEnum - help type.

doPrint

public static void doPrint()
Sends the game results to the OS printing system.


doPrintTemplate

public static void doPrintTemplate(int numberOfPlayers)
Sends the score board template to the OS printing system.

Parameters:
numberOfPlayers - number of players for the template.

doQuit

public static void doQuit()
Disposes all frames and quits the application.


addPlayerDialogMenuBar

public static PrefCountMenuBar addPlayerDialogMenuBar(javax.swing.JFrame frame)
Creates a menu bar for the player dialog window and sets it on the mainWindow.playerDialogFrame object. This menu bar is created and added only when running on Mac OS platform.

Parameters:
frame - Reference to the frame to add this menu bar to.
Returns:
Reference to the created PrefCount menu bar or null of running on not Mac OS platform.

addMainWindowMenuBar

public static PrefCountMenuBar addMainWindowMenuBar(javax.swing.JFrame frame)
Creates an appropriate menu bar for the main window and sets it on the mainWindow object. Since sunstance LAF does not work with native Mac menu bar, an awt menu bar is created for the Mac platform; for other platforms, a swing menu bar is created.

Parameters:
frame - Frame to add menu bar to.
Returns:
Reference to the created PrefCount menu bar.


Copyright © 2008. All Rights Reserved.