com.jogamp.newt
Class NewtFactory

java.lang.Object
  extended by com.jogamp.newt.NewtFactory

public abstract class NewtFactory
extends Object


Constructor Summary
NewtFactory()
           
 
Method Summary
static Display createDisplay(String name)
          Create a Display entity, incl native creation
static Display createDisplay(String type, String name)
          Create a Display entity using the given implementation type, incl native creation
static Screen createScreen(Display display, int index)
          Create a Screen entity, incl native creation
static Screen createScreen(String type, Display display, int index)
          Create a Screen entity using the given implementation type, incl native creation
static Window createWindow(long parentWindowHandle, Screen screen, Capabilities caps)
           
static Window createWindow(long parentWindowHandle, Screen screen, Capabilities caps, boolean undecorated)
          Create a child Window entity attached to the given parent, incl native creation
static Window createWindow(Object[] cstrArguments, Screen screen, Capabilities caps, boolean undecorated)
          Ability to try a Window type with a construnctor argument, if supported ..
static Window createWindow(Object parentWindowObject, Screen screen, Capabilities caps)
           
static Window createWindow(Object parentWindowObject, Screen screen, Capabilities caps, boolean undecorated)
          Create a child Window entity attached to the given parent, incl native creation
static Window createWindow(Screen screen, Capabilities caps)
          Create a top level Window entity, incl native creation
static Window createWindow(Screen screen, Capabilities caps, boolean undecorated)
          Create a top level Window entity, incl native creation
static Window createWindow(String type, Object[] cstrArguments, Screen screen, Capabilities caps, boolean undecorated)
           
static Window createWindow(String type, Screen screen, Capabilities caps, boolean undecorated)
          Create a Window entity using the given implementation type, incl native creation
static void setUseEDT(boolean onoff)
          Toggles the usage of an EventDispatchThread while creating a Display.
The default is enabled.
The EventDispatchThread is thread local to the Display instance.
static boolean useEDT()
           
static Display wrapDisplay(String name, AbstractGraphicsDevice device)
          Instantiate a Display entity using the native handle.
static Screen wrapScreen(Display display, AbstractGraphicsScreen screen)
          Instantiate a Screen entity using the native handle.
static Window wrapWindow(Screen screen, AbstractGraphicsConfiguration config, long windowHandle, boolean fullscreen, boolean visible, int x, int y, int width, int height)
          Instantiate a Window entity using the native handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewtFactory

public NewtFactory()
Method Detail

setUseEDT

public static void setUseEDT(boolean onoff)
Toggles the usage of an EventDispatchThread while creating a Display.
The default is enabled.
The EventDispatchThread is thread local to the Display instance.


useEDT

public static boolean useEDT()
See Also:
setUseEDT(boolean)

createDisplay

public static Display createDisplay(String name)
Create a Display entity, incl native creation


createDisplay

public static Display createDisplay(String type,
                                    String name)
Create a Display entity using the given implementation type, incl native creation


createScreen

public static Screen createScreen(Display display,
                                  int index)
Create a Screen entity, incl native creation


createScreen

public static Screen createScreen(String type,
                                  Display display,
                                  int index)
Create a Screen entity using the given implementation type, incl native creation


createWindow

public static Window createWindow(Screen screen,
                                  Capabilities caps)
Create a top level Window entity, incl native creation


createWindow

public static Window createWindow(Screen screen,
                                  Capabilities caps,
                                  boolean undecorated)
Create a top level Window entity, incl native creation


createWindow

public static Window createWindow(Object parentWindowObject,
                                  Screen screen,
                                  Capabilities caps,
                                  boolean undecorated)
Create a child Window entity attached to the given parent, incl native creation

In case parentWindowObject is a NativeWindow,
we create a child Window, utilizing createWindow(long, com.jogamp.newt.Screen, javax.media.nativewindow.Capabilities, boolean) passing the parent's native window handle retrieved via NativeWindow.getWindowHandle().

In case parentWindowObject is even a Window, the following applies:
WindowEvent.EVENT_WINDOW_RESIZED is not propagated to the child window for e.g. layout
, you have to add an appropriate WindowListener for this use case.
However, WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY is propagated to the child window, so it will be closed properly.
In case parentWindowObject is a different implementation,
you have to handle all events appropriatly.

In case parentWindowObject is a Component,
we utilize the com.jogamp.newt.impl.awt.AWTNewtFactory#createNativeChildWindow(Object, com.jogamp.newt.Screen, com.jogamp.newt.Capabilities, boolean) factory method.
The factory adds a WindowListener to propagate WindowEvent's so your NEWT Window integrates into the AWT layout.

Parameters:
parentWindowObject - either a NativeWindow or java.awt.Component
undecorated - only impacts if the window is in top-level state, while attached to a parent window it's rendered undecorated always
See Also:
createWindow(long, com.jogamp.newt.Screen, javax.media.nativewindow.Capabilities, boolean), com.jogamp.newt.impl.awt.AWTNewtFactory#createNativeChildWindow(java.lang.Object, com.jogamp.newt.Screen, javax.media.nativewindow.Capabilities, boolean)

createWindow

public static Window createWindow(Object parentWindowObject,
                                  Screen screen,
                                  Capabilities caps)

createWindow

public static Window createWindow(long parentWindowHandle,
                                  Screen screen,
                                  Capabilities caps,
                                  boolean undecorated)
Create a child Window entity attached to the given parent, incl native creation

Parameters:
parentWindowObject - the native parent window handle
undecorated - only impacts if the window is in top-level state, while attached to a parent window it's rendered undecorated always

createWindow

public static Window createWindow(long parentWindowHandle,
                                  Screen screen,
                                  Capabilities caps)

createWindow

public static Window createWindow(Object[] cstrArguments,
                                  Screen screen,
                                  Capabilities caps,
                                  boolean undecorated)
Ability to try a Window type with a construnctor argument, if supported ..

Currently only valid is AWTWindow(Frame frame) , to support an external created AWT Frame, ie the browsers embedded frame.

Parameters:
undecorated - only impacts if the window is in top-level state, while attached to a parent window it's rendered undecorated always

createWindow

public static Window createWindow(String type,
                                  Screen screen,
                                  Capabilities caps,
                                  boolean undecorated)
Create a Window entity using the given implementation type, incl native creation

Parameters:
undecorated - only impacts if the window is in top-level state, while attached to a parent window it's rendered undecorated always

createWindow

public static Window createWindow(String type,
                                  Object[] cstrArguments,
                                  Screen screen,
                                  Capabilities caps,
                                  boolean undecorated)

wrapDisplay

public static Display wrapDisplay(String name,
                                  AbstractGraphicsDevice device)
Instantiate a Display entity using the native handle.


wrapScreen

public static Screen wrapScreen(Display display,
                                AbstractGraphicsScreen screen)
Instantiate a Screen entity using the native handle.


wrapWindow

public static Window wrapWindow(Screen screen,
                                AbstractGraphicsConfiguration config,
                                long windowHandle,
                                boolean fullscreen,
                                boolean visible,
                                int x,
                                int y,
                                int width,
                                int height)
Instantiate a Window entity using the native handle.



Copyright 2010 JogAmp Community.