SRJRCFrames
v0.1.296

de.schwarzrot.ui.support
Class AbstractDesktop

java.lang.Object
  extended by de.schwarzrot.ui.support.AbstractDesktop
All Implemented Interfaces:
Desktop, RootWindowHandler, ApplicationEventPublisher
Direct Known Subclasses:
DockDesktop, MDIDesktop, MWIDesktop, SWIDesktop

public abstract class AbstractDesktop
extends Object
implements Desktop

implementation of common stuff for Desktop implementations.

Author:
Reinhard Mantey
See Also:
Desktop

Field Summary
protected static TransactionFactory taFactory
           
 
Fields inherited from interface de.schwarzrot.ui.Desktop
defaultStartupSize, ID_DESKTOP, ID_TITLE
 
Constructor Summary
AbstractDesktop(String appName)
           
 
Method Summary
 void addApplication(Application<?> app)
           
 JMenuBar createMenuBar()
           
 JMenuBar createMenuBar(Application<?> app)
           
 JToolBar createToolBar()
           
 JToolBar createToolBar(Application<?> app)
           
 int decOpenedFramesCounter()
           
 void doAbout(ActionEvent e)
          pops up the about dialog
 void doCloseApp(MainFrame f)
          close applications "top" window, which need not be a real top window.
 void doCloseApp(WindowEvent e)
          default handling for desktops, that have only one top window.
 boolean doConfig(String mode)
          pops up the preferences dialog
 void doEditMappings(JComponent parent)
           
 void doExit(ActionEvent e)
          terminate all applications
 void doHelp(ActionEvent e)
          pops up the help browser
 DesktopActionHandler getActionHandler()
           
 JarExtension getArchiveInfo()
          returns the archive info (result from verifyArchive)
 LookAndFeelConfig getConfig()
           
 JComponent getConfigPage()
          returns the desktops configuration page.
 String getCurApp()
          returns the name of the current active application
 Application<?> getDefaultApp()
          returns the default application, which is the application, that should be opened first
 Window getMainWindow()
           
 String getName()
          returns the name of the implementing class
 int getOpenedFramesCounter()
           
 ProgressMonitor getProgressMonitor()
           
 JComponent getServicesPage()
           
 String getVersionString()
          returns the version as string
 int getXOffset()
           
 int getYOffset()
           
 int incOpenedFramesCounter()
           
 void init(List<Application<?>> knownApplications)
          first stage of initialization
 void publishEvent(ApplicationEvent ae)
           
 void setActionHandler(DesktopActionHandler handler)
          setter for the DesktopActionHandler, which handles the user-actions common to all applications, like application-switching or exiting of the entire application.
 void setArchiveInfo(JarExtension archiveInfo)
          sets the archive info (result from verifyArchive)
 void setConfig(DesktopConfig config)
          sets the configuration instance
 void setCurApp(Application<?> curApp)
          sets the current active application
 void setCurApp(String curApp)
          sets the current active application
 void setDefaultApp(Application<?> defaultApp)
          sets the default application
 void setDefaultApp(String defaultApp)
          sets the default application
 void setName(String appName)
          sets the name of the desktop implementation
 void setProgressMonitor(ProgressMonitor pm)
           
 void setupFrom(Desktop other)
          method to support user configurable desktop environment.
 void setVersionBuild(String rawVer)
           
 void setVersionMajor(int ver)
           
 void setVersionMinor(int ver)
           
abstract  void start()
          second stage of application setup and start of the game
 void validateUser()
          validates a user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.schwarzrot.ui.Desktop
createMainFrame, doSwitch
 

Field Detail

taFactory

protected static TransactionFactory taFactory
Constructor Detail

AbstractDesktop

public AbstractDesktop(String appName)
Method Detail

addApplication

public final void addApplication(Application<?> app)

createMenuBar

public JMenuBar createMenuBar()

createMenuBar

public JMenuBar createMenuBar(Application<?> app)

createToolBar

public JToolBar createToolBar()

createToolBar

public JToolBar createToolBar(Application<?> app)

decOpenedFramesCounter

public final int decOpenedFramesCounter()

doAbout

public void doAbout(ActionEvent e)
Description copied from interface: Desktop
pops up the about dialog

Specified by:
doAbout in interface Desktop
Parameters:
e - - action event

doCloseApp

public void doCloseApp(MainFrame f)
close applications "top" window, which need not be a real top window. The desktop and the application frame stays alive.

Parameters:
f - - the frame that was closed

doCloseApp

public void doCloseApp(WindowEvent e)
default handling for desktops, that have only one top window. All applications will be closed and the applications frame will be terminated

Parameters:
e - - the window event

doConfig

public boolean doConfig(String mode)
Description copied from interface: Desktop
pops up the preferences dialog

Specified by:
doConfig in interface Desktop
Parameters:
mode - - should be null for standard operation. If there's an error on application startup, the mode may be "init" to change into initial setup mode.
Returns:
- true if the dialog has been approved, otherwise false

doEditMappings

public void doEditMappings(JComponent parent)

doExit

public void doExit(ActionEvent e)
Description copied from interface: Desktop
terminate all applications

Specified by:
doExit in interface Desktop
Parameters:
e - - action event

doHelp

public void doHelp(ActionEvent e)
Description copied from interface: Desktop
pops up the help browser

Specified by:
doHelp in interface Desktop
Parameters:
e - - action event

getActionHandler

public final DesktopActionHandler getActionHandler()

getArchiveInfo

public final JarExtension getArchiveInfo()
Description copied from interface: Desktop
returns the archive info (result from verifyArchive)

Specified by:
getArchiveInfo in interface Desktop
Returns:
- archive info

getConfig

public final LookAndFeelConfig getConfig()

getConfigPage

public JComponent getConfigPage()
Description copied from interface: Desktop
returns the desktops configuration page. This page will show an editor for common preferences

Specified by:
getConfigPage in interface Desktop
Returns:
- the editor page

getCurApp

public final String getCurApp()
Description copied from interface: Desktop
returns the name of the current active application

Specified by:
getCurApp in interface Desktop
Returns:
- an application name

getDefaultApp

public final Application<?> getDefaultApp()
Description copied from interface: Desktop
returns the default application, which is the application, that should be opened first

Specified by:
getDefaultApp in interface Desktop
Returns:
- an application

getMainWindow

public Window getMainWindow()
Specified by:
getMainWindow in interface RootWindowHandler

getName

public final String getName()
Description copied from interface: Desktop
returns the name of the implementing class

Specified by:
getName in interface Desktop
Returns:
- name of desktop implementation

getOpenedFramesCounter

public final int getOpenedFramesCounter()

getProgressMonitor

public final ProgressMonitor getProgressMonitor()
Specified by:
getProgressMonitor in interface RootWindowHandler

getServicesPage

public JComponent getServicesPage()

getVersionString

public final String getVersionString()
Description copied from interface: Desktop
returns the version as string

Specified by:
getVersionString in interface Desktop
Returns:
- the version as string

getXOffset

public final int getXOffset()

getYOffset

public final int getYOffset()

incOpenedFramesCounter

public final int incOpenedFramesCounter()

init

public void init(List<Application<?>> knownApplications)
Description copied from interface: Desktop
first stage of initialization

Specified by:
init in interface Desktop
Parameters:
knownApplications - - list of loaded applications

publishEvent

public final void publishEvent(ApplicationEvent ae)
Specified by:
publishEvent in interface ApplicationEventPublisher

setActionHandler

public final void setActionHandler(DesktopActionHandler handler)
Description copied from interface: Desktop
setter for the DesktopActionHandler, which handles the user-actions common to all applications, like application-switching or exiting of the entire application.

In order to allow switching of the desktop interface, the handling of the actions is separated from the desktop implementations.

Specified by:
setActionHandler in interface Desktop
Parameters:
handler - - the handler for desktop actions

setArchiveInfo

public final void setArchiveInfo(JarExtension archiveInfo)
Description copied from interface: Desktop
sets the archive info (result from verifyArchive)

Specified by:
setArchiveInfo in interface Desktop
Parameters:
archiveInfo - - the archive info

setConfig

public final void setConfig(DesktopConfig config)
Description copied from interface: Desktop
sets the configuration instance

Specified by:
setConfig in interface Desktop
Parameters:
config - - the configuration instance

setCurApp

public final void setCurApp(Application<?> curApp)
Description copied from interface: Desktop
sets the current active application

Specified by:
setCurApp in interface Desktop
Parameters:
curApp - - an application

setCurApp

public final void setCurApp(String curApp)
Description copied from interface: Desktop
sets the current active application

Specified by:
setCurApp in interface Desktop
Parameters:
curApp - - the name of an application

setDefaultApp

public final void setDefaultApp(Application<?> defaultApp)
Description copied from interface: Desktop
sets the default application

Specified by:
setDefaultApp in interface Desktop
Parameters:
defaultApp - - an application

setDefaultApp

public final void setDefaultApp(String defaultApp)
Description copied from interface: Desktop
sets the default application

Specified by:
setDefaultApp in interface Desktop
Parameters:
defaultApp - - an application name

setName

public final void setName(String appName)
Description copied from interface: Desktop
sets the name of the desktop implementation

Specified by:
setName in interface Desktop
Parameters:
appName - - name of desktop implementation

setProgressMonitor

public final void setProgressMonitor(ProgressMonitor pm)
Specified by:
setProgressMonitor in interface RootWindowHandler

setupFrom

public void setupFrom(Desktop other)
Description copied from interface: Desktop
method to support user configurable desktop environment. As by default configuration a different class has been setup as desktop class, we need to borrow configuration from that "old" and unused class.

Specified by:
setupFrom in interface Desktop
Parameters:
other - - the probably already configured desktop implementation

setVersionBuild

public final void setVersionBuild(String rawVer)

setVersionMajor

public final void setVersionMajor(int ver)

setVersionMinor

public final void setVersionMinor(int ver)

start

public abstract void start()
Description copied from interface: Desktop
second stage of application setup and start of the game

Specified by:
start in interface Desktop

validateUser

public void validateUser()
Description copied from interface: Desktop
validates a user

Specified by:
validateUser in interface Desktop

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.