|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Canvas
iicm.ge3d.OGLCanvas
public class OGLCanvas
OGLCanvas - window context for GE3D. Copyright (c) 1996,97 IICM. All rights reserved.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Canvas |
---|
java.awt.Canvas.AccessibleAWTCanvas |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected int |
cheight
|
protected int |
cwidth
|
private boolean |
hascontext
|
private boolean |
loadedlib
|
protected int |
mesa_backbuf
|
(package private) static int |
MESABACKBUF_AUTO
|
(package private) static int |
MESABACKBUF_PIXMAP
|
(package private) static int |
MESABACKBUF_XIMAGE
|
private int |
nbuffer
|
private long |
nbufferL
|
private int |
ncanvas
|
private int |
ncolormap
|
private int |
ncontext
|
private long |
ncontextL
|
private int |
noglwindow
|
private int |
nwindow
|
private boolean |
nxactive
|
private int |
nxbuffer
|
private long |
nxbufferL
|
private int |
nxcontext
|
private long |
nxcontextL
|
(package private) java.lang.String |
title
|
protected boolean |
verbose
|
private int |
version_1_0_8
|
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
OGLCanvas(java.lang.String t)
constructor |
Method Summary | |
---|---|
private void |
createContext(int flags)
|
boolean |
hasContext()
check whether native methods are callable |
java.awt.Dimension |
minimumSize()
... and minimum size |
boolean |
mouseEnter(java.awt.Event e,
int x,
int y)
react on mouse enter/exit. |
boolean |
mouseExit(java.awt.Event e,
int x,
int y)
|
private void |
mouseInside(int flag)
|
void |
paint(java.awt.Graphics goofy)
create an OpenGL canvas on first painting. |
java.awt.Dimension |
preferredSize()
my preferred size ... |
protected boolean |
setContext(boolean shading)
activate the context before issuing OpenGL commands in paint |
protected void |
swapBuffers()
when finished with drawing, swap buffers or flush drawings (for double buffering resp. single buffering) |
void |
update(java.awt.Graphics gc)
no need to clear background on graphics update (will be done by 3D drawing) |
Methods inherited from class java.awt.Canvas |
---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private boolean hascontext
private boolean loadedlib
protected boolean verbose
protected int cwidth
protected int cheight
java.lang.String title
private int nwindow
private int ncanvas
private int noglwindow
private int ncontext
private long ncontextL
private int nxcontext
private long nxcontextL
private int ncolormap
private int nbuffer
private long nbufferL
private int nxbuffer
private long nxbufferL
private boolean nxactive
static final int MESABACKBUF_XIMAGE
static final int MESABACKBUF_PIXMAP
static final int MESABACKBUF_AUTO
protected int mesa_backbuf
private int version_1_0_8
Constructor Detail |
---|
public OGLCanvas(java.lang.String t)
t
- window title (needed to identify window)Method Detail |
---|
public java.awt.Dimension preferredSize()
preferredSize
in class java.awt.Component
public java.awt.Dimension minimumSize()
minimumSize
in class java.awt.Component
public void update(java.awt.Graphics gc)
update
in class java.awt.Canvas
public void paint(java.awt.Graphics goofy)
super.paint (gc); // create context on first draw if (!hasContext () || !setContext ()) // no context return; // should clear background in this case // now ready to draw with OpenGL commands // on first draw you should call GE3D.initGE3D () swapBuffers (); // finish drawing
paint
in class java.awt.Canvas
public boolean mouseEnter(java.awt.Event e, int x, int y)
mouseEnter
in class java.awt.Component
public boolean mouseExit(java.awt.Event e, int x, int y)
mouseExit
in class java.awt.Component
mouseEnter(java.awt.Event, int, int)
private void createContext(int flags)
private void mouseInside(int flag)
public boolean hasContext()
protected boolean setContext(boolean shading)
shading
- flag - should be set to true unless wireframe drawings
protected void swapBuffers()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |