org.apache.pivot.wtk
Class DesktopApplicationContext

java.lang.Object
  extended by org.apache.pivot.wtk.ApplicationContext
      extended by org.apache.pivot.wtk.DesktopApplicationContext

public final class DesktopApplicationContext
extends ApplicationContext

Application context used to execute applications in a native frame window.


Nested Class Summary
static interface DesktopApplicationContext.DisplayListener
          Display listener interface.
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.ApplicationContext
ApplicationContext.DisplayHost, ApplicationContext.QueuedCallback, ApplicationContext.ResourceCacheDictionary, ApplicationContext.ScheduledCallback
 
Field Summary
static String CENTER_ARGUMENT
           
static String DEFAULT_HOST_WINDOW_TITLE
           
static String FULL_SCREEN_ARGUMENT
           
static String HEIGHT_ARGUMENT
           
static String MAXIMIZED_ARGUMENT
           
static String ORIGIN_ARGUMENT
           
static String PRESERVE_SPLASH_SCREEN_ARGUMENT
           
static String RESIZABLE_ARGUMENT
           
static String UNDECORATED_ARGUMENT
           
static String WIDTH_ARGUMENT
           
static String X_ARGUMENT
           
static String Y_ARGUMENT
           
 
Fields inherited from class org.apache.pivot.wtk.ApplicationContext
applications, displays, origin
 
Constructor Summary
DesktopApplicationContext()
           
 
Method Summary
static Display createDisplay(int width, int height, int x, int y, boolean modal, boolean resizable, boolean undecorated, Window owner, DesktopApplicationContext.DisplayListener displayCloseListener)
          Creates a new secondary display.
static void exit()
          Terminates the application context.
static boolean exit(boolean optional)
          Terminates the application context.
static boolean isActive()
           
static boolean isFullScreen()
          Returns the full-screen mode flag.
static void main(Class<? extends Application> applicationClass, String[] applicationArgs)
          Utility method to make it easier to define main() entry-points into applications.
static void main(String[] args)
          Primary application entry point.
static void replaceSplashScreen(Display display)
          Gets the window hosting the specified Display and makes it visible.
static void setFullScreen(boolean fullScreen)
          Sets the full-screen mode flag.
static void sizeHostToFit(Window window)
          Sizes the window's native host frame to match its preferred size.
 
Methods inherited from class org.apache.pivot.wtk.ApplicationContext
applyStylesheet, createTimer, defaultUncaughtExceptionHandler, destroyTimer, getDisplays, getJavaVersion, getJVMVersion, getOrigin, getPivotVersion, getResourceCache, handleUncaughtException, invalidateDisplays, queueCallback, queueCallback, scheduleCallback, scheduleRecurringCallback, scheduleRecurringCallback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HOST_WINDOW_TITLE

public static final String DEFAULT_HOST_WINDOW_TITLE
See Also:
Constant Field Values

X_ARGUMENT

public static final String X_ARGUMENT
See Also:
Constant Field Values

Y_ARGUMENT

public static final String Y_ARGUMENT
See Also:
Constant Field Values

WIDTH_ARGUMENT

public static final String WIDTH_ARGUMENT
See Also:
Constant Field Values

HEIGHT_ARGUMENT

public static final String HEIGHT_ARGUMENT
See Also:
Constant Field Values

CENTER_ARGUMENT

public static final String CENTER_ARGUMENT
See Also:
Constant Field Values

RESIZABLE_ARGUMENT

public static final String RESIZABLE_ARGUMENT
See Also:
Constant Field Values

MAXIMIZED_ARGUMENT

public static final String MAXIMIZED_ARGUMENT
See Also:
Constant Field Values

UNDECORATED_ARGUMENT

public static final String UNDECORATED_ARGUMENT
See Also:
Constant Field Values

FULL_SCREEN_ARGUMENT

public static final String FULL_SCREEN_ARGUMENT
See Also:
Constant Field Values

PRESERVE_SPLASH_SCREEN_ARGUMENT

public static final String PRESERVE_SPLASH_SCREEN_ARGUMENT
See Also:
Constant Field Values

ORIGIN_ARGUMENT

public static final String ORIGIN_ARGUMENT
See Also:
Constant Field Values
Constructor Detail

DesktopApplicationContext

public DesktopApplicationContext()
Method Detail

isActive

public static boolean isActive()

exit

public static void exit()
Terminates the application context. this call is the same as exit(true)


exit

public static boolean exit(boolean optional)
Terminates the application context.

Parameters:
optional - If true, shutdown is optional and may be cancelled. If false, shutdown cannot be cancelled.

main

public static void main(String[] args)
Primary application entry point.

Parameters:
args -

isFullScreen

public static boolean isFullScreen()
Returns the full-screen mode flag.


setFullScreen

public static void setFullScreen(boolean fullScreen)
Sets the full-screen mode flag.

Parameters:
fullScreen -

replaceSplashScreen

public static void replaceSplashScreen(Display display)
Gets the window hosting the specified Display and makes it visible.
This will cause a visible SplashScreen to be closed.
It is intended to be called one time when the Pivot application has initialized its UI and the SplashScreen is ready to be dismissed, but can be safely called regardless of whether there is now, or used to be, a visible SplashScreen.

Parameters:
display - Display to make visible
See Also:
SplashScreen

sizeHostToFit

public static void sizeHostToFit(Window window)
Sizes the window's native host frame to match its preferred size.

Parameters:
window -

createDisplay

public static Display createDisplay(int width,
                                    int height,
                                    int x,
                                    int y,
                                    boolean modal,
                                    boolean resizable,
                                    boolean undecorated,
                                    Window owner,
                                    DesktopApplicationContext.DisplayListener displayCloseListener)
Creates a new secondary display.

Parameters:
width -
height -
x -
y -
modal -
owner -

main

public static final void main(Class<? extends Application> applicationClass,
                              String[] applicationArgs)
Utility method to make it easier to define main() entry-points into applications. For example: public class MyApp implements Application { public static void main(String[] args) throws Exception { DesktopApplicationContext.main(MyApp.class, args); } }

Parameters:
applicationClass -
applicationArgs -