public void switchFullscreenMode() {
dispose();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
if(isFullScreenMode()) {
// switch back from fullscreen
device.setFullScreenWindow(null);
setUndecorated(false);
setBounds(mXPos, mYPos, mWidth, mHeight);
if(mMenuBar != null) {
mMenuBar.setFullscreenItemChecked(false);
mMenuBar.setVisible(true);
}
if(mToolBarPanel != null) {
mToolBarPanel.setVisible(Settings.propIsToolbarVisible.getBoolean());
}
if(mStatusBar != null) {
mStatusBar.setVisible(Settings.propIsStatusbarVisible.getBoolean());
}
if(mChannelChooser != null) {
mChannelChooser.setVisible(Settings.propShowChannels.getBoolean());
}
if(mFinderPanel != null) {
mFinderPanel.getComponent().setVisible(Settings.propShowDatelist.getBoolean());
}
setVisible(true);
setShowPluginOverview(Settings.propShowPluginView.getBoolean(),false);
setShowTimeButtons(Settings.propShowTimeButtons.getBoolean(), false);
setShowDatelist(Settings.propShowDatelist.getBoolean(), false);
setShowChannellist(Settings.propShowChannels.getBoolean(), false);
}
else {
// switch into fullscreen
mXPos = getX();
mYPos = getY();
mWidth = getWidth();
mHeight = getHeight();
setShowPluginOverview(false, false);
setShowTimeButtons(false, false);
setShowDatelist(false, false);
setShowChannellist(false, false);
if(mStatusBar != null) {
mMenuBar.setFullscreenItemChecked(true);
mStatusBar.setVisible(false);
}
if(mChannelChooser != null) {
mChannelChooser.setVisible(false);
}
if(mMenuBar != null) {
mMenuBar.setVisible(false);
}
if(mToolBarPanel != null) {
mToolBarPanel.setVisible(false);
}
if(mFinderPanel != null) {
mFinderPanel.getComponent().setVisible(false);
}
setUndecorated(true);
final Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
if(device.isFullScreenSupported() && OperatingSystem.isMacOs()) {
device.setFullScreenWindow(MainFrame.getInstance());
}
else {
setLocation(0,0);
setSize(screen);
}