{
menu1 = new Menu(getShell(), SWT.BAR);
getShell().setMenuBar(menu1);
{
lobbyMenuItem = new MenuItem(menu1, SWT.CASCADE);
lobbyMenuItem.setText("Lobby");
{
lobbyMenu = new Menu(lobbyMenuItem);
{
newFileMenuItem = new MenuItem(lobbyMenu, SWT.CASCADE);
newFileMenuItem.setText("Login ...");
newFileMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
logger.debug("newFileMenuItem.widgetSelected, event=" + evt);
// clientCore.login(clientCore., port,
// userName, password)
}
});
}
{
exitMenuItem = new MenuItem(lobbyMenu, SWT.CASCADE);
exitMenuItem.setText("Exit");
exitMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
logger.debug("exitMenuItem.widgetSelected, event=" + evt);
// TODO Leave all open tables
// TODO Log out (via AccountListener??)
exit();
}
});
}
lobbyMenuItem.setMenu(lobbyMenu);
}
}
{
uiMenuItem = new MenuItem(menu1, SWT.CASCADE);
uiMenuItem.setText("Appearance");
//TODO reenable after missing images bug is fixed
uiMenuItem.setEnabled(false);
{
uiMenu = new Menu(uiMenuItem);
uiMenuItem.setMenu(uiMenu);
{
soundMenuItem = new MenuItem(uiMenu, SWT.CHECK);
soundMenuItem.setText("Play Sound");
soundMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
ClientGUI.SOUND_ON = soundMenuItem.getSelection();
Preferences.userRoot().put(User.Prefs.SOUND, Boolean.toString(ClientGUI.SOUND_ON));
}
});
}
{
cardsMenuItem = new MenuItem(uiMenu, SWT.CASCADE);
cardsMenuItem.setText("Cards");
}
cardsMenu = new Menu(cardsMenuItem);
cardsMenuItem.setMenu(cardsMenu);
fourColorDeckMenuItem = new MenuItem(cardsMenu, SWT.RADIO);
fourColorDeckMenuItem.setText("Four Color Deck");
fourColorDeckMenuItem.setSelection(ClientGUI.Resources.ACTIVE_DECK_IMG_FILE
.equals(ClientGUI.Resources.FOUR_COLOR_DECK_IMG_FILE));
fourColorDeckMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
try {
ClientGUI.setActiveCardDeck(ClientGUI.Resources.FOUR_COLOR_DECK_IMG_FILE);
} catch (FileNotFoundException e) {
logger.error("Could not change card deck style", e);
}
}
});
ftpCardsMenuItem = new MenuItem(cardsMenu, SWT.RADIO);
ftpCardsMenuItem.setText("Full Tilt Poker");
ftpCardsMenuItem.setEnabled(ClientGUI.Resources.ADDITIONAL_RESOURCES);
ftpCardsMenuItem.setSelection(ClientGUI.Resources.ACTIVE_DECK_IMG_FILE
.equals(ClientGUI.Resources.FTP_DECK_IMG_FILE));
ftpCardsMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
try {
ClientGUI.setActiveCardDeck(ClientGUI.Resources.FTP_DECK_IMG_FILE);
} catch (FileNotFoundException e) {
logger.error("Could not change card deck style", e);
}
}
});
{
chipsMenuItem = new MenuItem(uiMenu, SWT.CASCADE);
chipsMenuItem.setText("Chips");
chipsMenu = new Menu(chipsMenuItem);
chipsMenuItem.setMenu(chipsMenu);
starsChipsMenuItem = new MenuItem(chipsMenu, SWT.RADIO);
starsChipsMenuItem.setText("Poker Stars");
starsChipsMenuItem.setEnabled(ClientGUI.Resources.ADDITIONAL_RESOURCES);
starsChipsMenuItem.setSelection(ClientGUI.Resources.ACTIVE_CHIP_DIR
.equals(ClientGUI.Resources.STARS_CHIP_IMG_DIR));
starsChipsMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
try {
ClientGUI.setActiveChipsStyle(ClientGUI.Resources.STARS_CHIP_IMG_DIR);
} catch (FileNotFoundException e) {
logger.error("Could not change chip style", e);
}
}
});
eptChipsMenuItem = new MenuItem(chipsMenu, SWT.RADIO);
eptChipsMenuItem.setText("European Poker Tour");
eptChipsMenuItem.setEnabled(ClientGUI.Resources.ADDITIONAL_RESOURCES);
eptChipsMenuItem.setSelection(ClientGUI.Resources.ACTIVE_CHIP_DIR
.equals(ClientGUI.Resources.EPT_CHIP_IMG_DIR));
eptChipsMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
try {
ClientGUI.setActiveChipsStyle(ClientGUI.Resources.EPT_CHIP_IMG_DIR);
} catch (FileNotFoundException e) {
logger.error("Could not change chip style", e);
}
}
});
pokerWikiaChipsMenuItem = new MenuItem(chipsMenu, SWT.RADIO);
pokerWikiaChipsMenuItem.setText("Poker Wikia (Free) Chips");
pokerWikiaChipsMenuItem.setSelection(ClientGUI.Resources.ACTIVE_CHIP_DIR
.equals(ClientGUI.Resources.FREE_CHIPS));
pokerWikiaChipsMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
try {
ClientGUI.setActiveChipsStyle(ClientGUI.Resources.FREE_CHIPS);
} catch (FileNotFoundException e) {
logger.error("Could not change chip style", e);
}
}
});
}
}
}
{
helpMenuItem = new MenuItem(menu1, SWT.CASCADE);
helpMenuItem.setText("Help");
{
helpMenu = new Menu(helpMenuItem);
{
contentsMenuItem = new MenuItem(helpMenu, SWT.CASCADE);
contentsMenuItem.setText("Contents");
}
{
aboutMenuItem = new MenuItem(helpMenu, SWT.CASCADE);
aboutMenuItem.setText("About");
aboutMenuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {