|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame net.java.joglutils.GLJFrame
public class GLJFrame
A JFrame containing a heavyweight GLCanvas
with a single attached GLEventListener
.
Note: the default close operation has been changed to exit rather than dispose.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
GLJFrame(javax.media.opengl.GLEventListener listener)
Creates new form GLJFrame |
|
GLJFrame(javax.media.opengl.GLEventListener listener,
boolean fullscreen)
Creates new form GLJFrame |
|
GLJFrame(javax.media.opengl.GLEventListener listener,
javax.media.opengl.GLCapabilities capabilities)
Creates new form GLJFrame |
|
GLJFrame(javax.media.opengl.GLEventListener listener,
javax.media.opengl.GLContext contextToShareWith)
Creates new form GLJFrame |
|
GLJFrame(javax.media.opengl.GLEventListener listener,
int width,
int height)
Creates new form GLJFrame |
|
GLJFrame(String title,
javax.media.opengl.GLEventListener listener)
Creates new form GLJFrame |
|
GLJFrame(String title,
javax.media.opengl.GLEventListener listener,
boolean fullscreen)
Creates new form GLJFrame |
|
GLJFrame(String title,
javax.media.opengl.GLEventListener listener,
javax.media.opengl.GLCapabilities capabilities)
Creates new form GLJFrame |
|
GLJFrame(String title,
javax.media.opengl.GLEventListener listener,
javax.media.opengl.GLCapabilities capabilities,
javax.media.opengl.GLCapabilitiesChooser chooser)
Creates new form GLJFrame |
|
GLJFrame(String title,
javax.media.opengl.GLEventListener listener,
javax.media.opengl.GLCapabilities caps,
javax.media.opengl.GLCapabilitiesChooser chooser,
javax.media.opengl.GLContext contextToShareWith)
Creates new form GLJFrame |
|
GLJFrame(String title,
javax.media.opengl.GLEventListener listener,
int width,
int height)
Creates new form GLJFrame |
Method Summary | |
---|---|
void |
addInputMethodListener(InputMethodListener l)
Adds the specified input method listener to receive input method events from this component and the GLCanvas. |
void |
addKeyListener(KeyListener l)
Adds the specified key listener to receive key events from this component and the GLCanvas. |
void |
addMouseListener(MouseListener l)
Adds the specified mouse listener to receive mouse events from this component and the GLCanvas. |
void |
addMouseMotionListener(MouseMotionListener l)
Adds the specified mouse motion listener to receive mouse motion events from this component and the GLCanvas. |
void |
addMouseWheelListener(MouseWheelListener l)
Adds the specified mouse wheel listener to receive mouse wheel events from this component and the GLCanvas. |
void |
clearInputListeners()
Removes InputMethodListeners, KeyListeners,MouseListeners, MouseMotionListeners, and MouseWheelListeners from this and the GLCanvas. |
com.sun.opengl.util.Animator |
generateAnimator()
Generates a new Animator for updating the GLCanvas, and starts it. |
com.sun.opengl.util.Animator |
getAnimator()
Retrieves the attached Animator connected to the GLCanvas. |
javax.media.opengl.GLAutoDrawable |
getAutoDrawable()
Retrieves a GLAutoDrawable view of the associated GLCanvas |
javax.media.opengl.GLContext |
getContext()
Retrieves the GLContext associated with the GLCanvas on this GLJFrame |
javax.media.opengl.GL |
getGL()
Gets the GL pipeline for the canvas in this GLJPane. |
javax.media.opengl.GLCapabilities |
getGLCapabilities()
The GLCapabilities used with the GLCanvas. |
javax.media.opengl.GLEventListener |
getGLEventListener()
Retrieves the event listener for the GLJFrame |
boolean |
isAnimated()
Determines if this GLJFrame is running on an Animator . |
boolean |
isFullscreen()
Determines if the Frame is the Full-Screen Exclusive Mode window. |
void |
removeAnimator()
Stops and removes the Animator . |
void |
removeInputMethodListener(InputMethodListener l)
Removes the specified input method listener so that it no longer receives input method events from this component and the GLCanvas. |
void |
removeKeyListener(KeyListener l)
Removes the specified key listener so that it no longer receives key events from this component and the GLCanvas. |
void |
removeMouseListener(MouseListener l)
Removes the specified mouse listener so that it no longer receives mouse events from this component and the GLCanvas. |
void |
removeMouseMotionListener(MouseMotionListener l)
Removes the specified mouse motion listener so that it no longer receives mouse motion events from this component and the GLCanvas. |
void |
removeMouseWheelListener(MouseWheelListener l)
Removes the specified mouse wheel listener so that it no longer receives mouse wheel events from this component and the GLCanvas. |
void |
repaint()
Repaint the JFrame and render the GLCanvas if no animator is present. |
void |
setAnimator(com.sun.opengl.util.Animator anim)
Specifies an Animator for updating the GLCanvas, and starts it. |
void |
setAnimator(com.sun.opengl.util.Animator anim,
boolean start)
Specifies an Animator for updating the GLCanvas, and optionally starts it. |
boolean |
setFullscreen(boolean fs)
Sets the fullscreen status of this window. |
void |
setGL(javax.media.opengl.GL gl)
Sets the GL pipeline for the canvas in this GLJPane. |
void |
setGLCapabilities(javax.media.opengl.GLCapabilities caps)
Rebuilds the GLCanvas with the specified capbilities. |
void |
setGLEventListener(javax.media.opengl.GLEventListener listener)
Sets the event listener attached to the GLcanvas. |
void |
setSize(Dimension d)
Resizes this GLJFrame to match a GLCanvas of the specified size. |
void |
setSize(int width,
int height)
Resizes this GLJFrame to match a GLCanvas of the specified size. |
Methods inherited from class java.awt.Frame |
---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Constructor Detail |
---|
public GLJFrame(javax.media.opengl.GLEventListener listener)
listener
- the GLEventListener to attach to the GLCanvaspublic GLJFrame(String title, javax.media.opengl.GLEventListener listener)
title
- the title for the windowlistener
- the GLEventListener to attach to the GLCanvaspublic GLJFrame(String title, javax.media.opengl.GLEventListener listener, javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, javax.media.opengl.GLContext contextToShareWith)
caps
- the GLCapabilities to request for the GLCanvaschooser
- the capabilities chooser to use in creating the GLCanvas on this frametitle
- the title for the windowlistener
- the GLEventListener to attach to the GLCanvascontextToShareWith
- the context to share withpublic GLJFrame(String title, javax.media.opengl.GLEventListener listener, javax.media.opengl.GLCapabilities capabilities)
title
- title for the windowlistener
- the GLEventListener to attach to the GLCanvascapabilities
- the GLCapabilities to request for the GLCanvaspublic GLJFrame(String title, javax.media.opengl.GLEventListener listener, javax.media.opengl.GLCapabilities capabilities, javax.media.opengl.GLCapabilitiesChooser chooser)
title
- title for the windowlistener
- the GLEventListener to attach to the GLCanvascapabilities
- the GLCapabilities to request for the GLCanvaschooser
- the capabilities chooser to use in creating the GLCanvas on this framepublic GLJFrame(javax.media.opengl.GLEventListener listener, javax.media.opengl.GLContext contextToShareWith)
listener
- the GLEventListener to attach to the GLCanvascontextToShareWith
- the context to share withjavax.media.opengl.GLCanvas#javax.media.opengl.GLCanvas(javax.media.opengl.GLCapabilities,javax.media.opengl.GLCapabilitiesChooser,javax.media.opengl.GLContext,javax.media.opengl.GraphicsDevice)
public GLJFrame(javax.media.opengl.GLEventListener listener, javax.media.opengl.GLCapabilities capabilities)
listener
- the GLEventListener to attach to the GLCanvascapabilities
- the GLCapabilities to request for the GLCanvaspublic GLJFrame(javax.media.opengl.GLEventListener listener, int width, int height)
listener
- the GLEventListener to attach to the GLCanvaswidth
- the horizontal size for the GLCanvas in pixelsheight
- the vertical size for the GLCanvas in pixelspublic GLJFrame(String title, javax.media.opengl.GLEventListener listener, int width, int height)
title
- the title for the windowlistener
- the GLEventListener to attach to the GLCanvaswidth
- the horizontal size for the GLCanvas in pixelsheight
- the vertical size for the GLCanvas in pixelspublic GLJFrame(javax.media.opengl.GLEventListener listener, boolean fullscreen)
listener
- the GLEventListener to attach to the GLCanvasfullscreen
- if true, this window is generated in fullscreen modepublic GLJFrame(String title, javax.media.opengl.GLEventListener listener, boolean fullscreen)
title
- the title for the windowlistener
- the GLEventListener to attach to the GLCanvasfullscreen
- if true, this window is generated in fullscreen modeMethod Detail |
---|
public void setGLEventListener(javax.media.opengl.GLEventListener listener)
listener
- the GLEventListener to attach to the GLCanvaspublic javax.media.opengl.GLEventListener getGLEventListener()
public boolean setFullscreen(boolean fs)
fs
- the mode to set this window to - true for full screen, false for windowed mode
public void setSize(int width, int height)
setSize
in class Component
width
- the new horizontal size for the GLCanvass in pixelsheight
- the new vertical size for the GLCanvass in pixelspublic void setSize(Dimension d)
setSize
in class Component
d
- the new size for the GLCanvass in pixelspublic boolean isFullscreen()
public javax.media.opengl.GLCapabilities getGLCapabilities()
GLCapabilities
used with the GLCanvas.
public void setGLCapabilities(javax.media.opengl.GLCapabilities caps)
caps
- the capabilities to be copied into this GLJFramepublic void repaint()
repaint
in class Component
public void clearInputListeners()
public com.sun.opengl.util.Animator generateAnimator()
Animator
for updating the GLCanvas, and starts it.
public com.sun.opengl.util.Animator getAnimator()
public void setAnimator(com.sun.opengl.util.Animator anim)
Animator
for updating the GLCanvas, and starts it.
anim
- Animator to use to animate the GLCanvaspublic void setAnimator(com.sun.opengl.util.Animator anim, boolean start)
Animator
for updating the GLCanvas, and optionally starts it.
anim
- Animator to use to animate the GLCanvasstart
- starts the animator if true, just sets it if notpublic void removeAnimator()
Animator
.
public boolean isAnimated()
Animator
.
public void removeKeyListener(KeyListener l)
removeKeyListener
in class Component
l
- the key listener.public void addKeyListener(KeyListener l)
addKeyListener
in class Component
l
- the key listener.public void removeMouseListener(MouseListener l)
removeMouseListener
in class Component
l
- the mouse listenerpublic void addMouseListener(MouseListener l)
addMouseListener
in class Component
l
- the mouse listenerpublic void removeMouseWheelListener(MouseWheelListener l)
removeMouseWheelListener
in class Component
l
- the mouse wheel listenerpublic void removeMouseMotionListener(MouseMotionListener l)
removeMouseMotionListener
in class Component
l
- the mouse motion listener.public void addMouseWheelListener(MouseWheelListener l)
MouseWheelEvent
.
If l is null, no exception is thrown and no action is performed.
addMouseWheelListener
in class Component
l
- the mouse wheel listenerpublic void addMouseMotionListener(MouseMotionListener l)
addMouseMotionListener
in class Component
l
- the mouse motion listener.public void removeInputMethodListener(InputMethodListener l)
removeInputMethodListener
in class Component
l
- the input method listenerpublic void addInputMethodListener(InputMethodListener l)
addInputMethodListener
in class Component
l
- the input method listenerpublic javax.media.opengl.GL getGL()
GLCanvas.getGL()
public void setGL(javax.media.opengl.GL gl)
gl
- The pipeline to attach to this GLCanvasGLCanvas.setGL(javax.media.opengl.GL)
public javax.media.opengl.GLContext getContext()
GLCanvas.getContext()
public javax.media.opengl.GLAutoDrawable getAutoDrawable()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |