Package jgl.wt.awt
Class GLCanvas
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Canvas
-
- jgl.wt.awt.GLCanvas
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
- Direct Known Subclasses:
bezcurve
,bezmesh
,bezsurf
,checker
,clip
,colormat
,cube
,doublebuffer
,EmulGLCanvas
,hello
,light
,lines
,list
,material
,mipmap
,model
,movelight
,pickdepth
,picksquare
,planet
,polys
,quadric
,robot
,scene
,select
,simple
,smooth
,stroke
,surface
,tea
,teapots
,texbind
,texgen
,texsub
,texture3d
,texturesurf
,torus
,unproject
public class GLCanvas extends Canvas
GLCanvas is the canvas class of jGL 2.4.- Version:
- 0.1, 18 Apr 2001
- Author:
- Robin Bing-Yu Chen
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected GL
myGL
protected GLU
myGLU
protected GLUT
myUT
-
Fields inherited from class java.awt.Component
accessibleContext, 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
Constructors Constructor Description GLCanvas()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forceRepaint()
Can be used to update image if camera has changed position.GL
getGL()
GLU
getGLU()
GLUT
getGLUT()
protected void
getPixelScaleFromG2D(Graphics2D g2d)
Pixel scale is used to model the pixel ratio introduced by HiDPIvoid
glut_enable_events(long cap, boolean state)
void
paint(Graphics g)
void
processEvent(AWTEvent e)
This override letGLUT.processEvent(AWTEvent)
be informed ofAWTEvent
traversing this canvas (mouse, keyboard, resize).void
setGL(GL gl)
void
update(Graphics g)
-
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, getBaseline, getBaselineResizeBehavior, 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, 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, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
-
-
-
-
Method Detail
-
processEvent
public void processEvent(AWTEvent e)
This override letGLUT.processEvent(AWTEvent)
be informed ofAWTEvent
traversing this canvas (mouse, keyboard, resize). One should registerGLUT.glutDisplayFunc(String)
to register a display callback,GLUT.glutMotionFunc(String)
to register a mouse motion callback, etc. NB : This relies on the fact the GLUT already invoked {@link this#glut_enable_events}.- Overrides:
processEvent
in classComponent
-
glut_enable_events
public void glut_enable_events(long cap, boolean state)
-
getPixelScaleFromG2D
protected void getPixelScaleFromG2D(Graphics2D g2d)
Pixel scale is used to model the pixel ratio introduced by HiDPI
-
getGL
public GL getGL()
-
getGLU
public GLU getGLU()
-
getGLUT
public GLUT getGLUT()
-
setGL
public void setGL(GL gl)
-
forceRepaint
public void forceRepaint()
Can be used to update image if camera has changed position. FIXME : Warning if this is invoked by a thread external to AWT, maybe this will require to redraw GL while GL is already used by AWT.
-
-