|
||||||||
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 |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.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(GLEventListener listener)
Creates new form GLJFrame |
|
GLJFrame(java.lang.String title,
GLEventListener listener)
Creates new form GLJFrame |
|
GLJFrame(java.lang.String title,
GLEventListener listener,
GLCapabilities capabilities)
Creates new form GLJFrame |
|
GLJFrame(java.lang.String title,
GLEventListener listener,
GLCapabilities capabilities,
GLContext contextToShareWith)
Creates new form GLJFrame |
Method Summary | |
---|---|
void |
addInputMethodListener(java.awt.event.InputMethodListener l)
Adds the specified input method listener to receive input method events from this component and the GLCanvas. |
void |
addKeyListener(java.awt.event.KeyListener l)
Adds the specified key listener to receive key events from this component and the GLCanvas. |
void |
addMouseListener(java.awt.event.MouseListener l)
Adds the specified mouse listener to receive mouse events from this component and the GLCanvas. |
void |
addMouseMotionListener(java.awt.event.MouseMotionListener l)
Adds the specified mouse motion listener to receive mouse motion events from this component and the GLCanvas. |
void |
addMouseWheelListener(java.awt.event.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. |
GLContext |
getContext()
Retrieves the GLContext associated with the GLCanvas on this GLJFrame |
GL |
getGL()
Gets the GL pipeline for the canvas in this GLJPane. |
GLCapabilities |
getGLCapabilities()
The GLCapabilities used with the GLCanvas. |
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(java.awt.event.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(java.awt.event.KeyListener l)
Removes the specified key listener so that it no longer receives key events from this component and the GLCanvas. |
void |
removeMouseListener(java.awt.event.MouseListener l)
Removes the specified mouse listener so that it no longer receives mouse events from this component and the GLCanvas. |
void |
removeMouseMotionListener(java.awt.event.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(java.awt.event.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(GL gl)
Sets the GL pipeline for the canvas in this GLJPane. |
void |
setGLCapabilities(GLCapabilities caps)
Rebuilds the GLCanvas with the specified capbilities. |
void |
setGLEventListener(GLEventListener listener)
Sets the event listener attached to the GLcanvas. |
void |
setSize(java.awt.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 javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
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.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
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(GLEventListener listener)
listener
- the GLEventListener to attach to the GLCanvaspublic GLJFrame(java.lang.String title, GLEventListener listener)
title
- the title for the windowlistener
- the GLEventListener to attach to the GLCanvaspublic GLJFrame(java.lang.String title, GLEventListener listener, GLCapabilities capabilities)
title
- title for the windowlistener
- the GLEventListener to attach to the GLCanvascapabilities
- the GLCapabilities to request for the GLCanvaspublic GLJFrame(java.lang.String title, GLEventListener listener, GLCapabilities capabilities, GLContext contextToShareWith)
title
- title for the windowlistener
- the GLEventListener to attach to the GLCanvascapabilities
- the GLCapabilities to request for 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)
Method Detail |
---|
public void setGLEventListener(GLEventListener listener)
listener
- the GLEventListener to attach to the GLCanvaspublic 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 java.awt.Component
width
- the new horizontal size for the GLCanvass in pixelsheight
- the new vertical size for the GLCanvass in pixelspublic void setSize(java.awt.Dimension d)
setSize
in class java.awt.Component
d
- the new size for the GLCanvass in pixelspublic boolean isFullscreen()
public GLCapabilities getGLCapabilities()
GLCapabilities
used with the GLCanvas.
public void setGLCapabilities(GLCapabilities caps)
caps
- the capabilities to be copied into this GLJFramepublic void repaint()
repaint
in class java.awt.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(java.awt.event.KeyListener l)
removeKeyListener
in class java.awt.Component
l
- the key listener.public void addKeyListener(java.awt.event.KeyListener l)
addKeyListener
in class java.awt.Component
l
- the key listener.public void removeMouseListener(java.awt.event.MouseListener l)
removeMouseListener
in class java.awt.Component
l
- the mouse listenerpublic void addMouseListener(java.awt.event.MouseListener l)
addMouseListener
in class java.awt.Component
l
- the mouse listenerpublic void removeMouseWheelListener(java.awt.event.MouseWheelListener l)
removeMouseWheelListener
in class java.awt.Component
l
- the mouse wheel listenerpublic void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
removeMouseMotionListener
in class java.awt.Component
l
- the mouse motion listener.public void addMouseWheelListener(java.awt.event.MouseWheelListener l)
MouseWheelEvent
.
If l is null, no exception is thrown and no action is performed.
addMouseWheelListener
in class java.awt.Component
l
- the mouse wheel listenerpublic void addMouseMotionListener(java.awt.event.MouseMotionListener l)
addMouseMotionListener
in class java.awt.Component
l
- the mouse motion listener.public void removeInputMethodListener(java.awt.event.InputMethodListener l)
removeInputMethodListener
in class java.awt.Component
l
- the input method listenerpublic void addInputMethodListener(java.awt.event.InputMethodListener l)
addInputMethodListener
in class java.awt.Component
l
- the input method listenerpublic GL getGL()
javax.media.opengl.GLCanvas#getGL()
public void setGL(GL gl)
gl
- The pipeline to attach to this GLCanvasjavax.media.opengl.GLCanvas#setGL(javax.media.opengl.GL)
public GLContext getContext()
javax.media.opengl.GLCanvas#getContext()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |