Package com.ardor3d.framework.jogl.awt
Class JoglAwtWindow
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
com.ardor3d.framework.jogl.awt.JoglAwtWindow
- All Implemented Interfaces:
Canvas
,NativeCanvas
,ImageObserver
,MenuContainer
,Serializable
,Accessible
A canvas implementation for use with AWT JOGL windows.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
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
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
void
void
close()
close
shutdowns and destroys any window contexts.void
draw
(CountDownLatch latch) Ask the canvas to render itself.void
init()
Do work to initialize this canvas, generally setting up the associated CanvasRenderer, etc.boolean
isActive()
isActive
returns true if the display is active.boolean
isClosing
notifies if the window is currently closing.void
moveWindowTo
(int locX, int locY) If running in windowed mode, move the window's position to the given display coordinates in window units.protected void
void
Sets one or more icons for the Canvas.void
setMouseManager
(MouseManager manager) Sets a MouseManager to be associated with this Canvas.void
setVSyncEnabled
(boolean enabled) setVSyncEnabled
attempts to enable or disable monitor vertical synchronization.Methods inherited from class java.awt.Frame
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setBackground, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, 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, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
Methods inherited from interface com.ardor3d.framework.NativeCanvas
setTitle
-
Field Details
-
_manager
-
-
Constructor Details
-
JoglAwtWindow
-
-
Method Details
-
addKeyListener
- Overrides:
addKeyListener
in classComponent
-
addMouseListener
- Overrides:
addMouseListener
in classComponent
-
addMouseMotionListener
- Overrides:
addMouseMotionListener
in classComponent
-
addMouseWheelListener
- Overrides:
addMouseWheelListener
in classComponent
-
addFocusListener
- Overrides:
addFocusListener
in classComponent
-
init
public void init()Description copied from interface:Canvas
Do work to initialize this canvas, generally setting up the associated CanvasRenderer, etc. -
privateInit
protected void privateInit() -
draw
Description copied from interface:Canvas
Ask the canvas to render itself. Note that this may occur in another thread and therefore a latch is given so the caller may know when the draw has completed. -
getCanvasRenderer
- Specified by:
getCanvasRenderer
in interfaceCanvas
- Returns:
- the CanvasRenderer associated with this Canvas.
-
getMouseManager
- Specified by:
getMouseManager
in interfaceCanvas
- Returns:
- the MouseManager associated with this Canvas, if any
-
setMouseManager
Description copied from interface:Canvas
Sets a MouseManager to be associated with this Canvas.- Specified by:
setMouseManager
in interfaceCanvas
- Parameters:
manager
- the manager to associate
-
close
public void close()Description copied from interface:NativeCanvas
close
shutdowns and destroys any window contexts.- Specified by:
close
in interfaceNativeCanvas
-
isActive
public boolean isActive()Description copied from interface:NativeCanvas
isActive
returns true if the display is active.- Specified by:
isActive
in interfaceNativeCanvas
- Overrides:
isActive
in classWindow
- Returns:
- whether the display system is active.
-
isClosing
public boolean isClosing()Description copied from interface:NativeCanvas
isClosing
notifies if the window is currently closing. This could be caused via the application itself or external interrupts such as alt-f4 etc.- Specified by:
isClosing
in interfaceNativeCanvas
- Returns:
- true if the window is closing, false otherwise.
-
moveWindowTo
public void moveWindowTo(int locX, int locY) Description copied from interface:NativeCanvas
If running in windowed mode, move the window's position to the given display coordinates in window units.- Specified by:
moveWindowTo
in interfaceNativeCanvas
- Parameters:
locX
- the x value of the locationlocY
- the y value of the location
-
setIcon
Description copied from interface:NativeCanvas
Sets one or more icons for the Canvas. As a reference for usual platforms on number of icons and their sizes:- On Windows you should supply at least one 16x16 image and one 32x32.
- Linux (and similar platforms) expect one 32x32 image.
- Mac OS X should be supplied one 128x128 image.
Ardor3dException
could be thrown.- Specified by:
setIcon
in interfaceNativeCanvas
- Parameters:
iconImages
- Array of Images to be used as icons.
-
setVSyncEnabled
public void setVSyncEnabled(boolean enabled) Description copied from interface:NativeCanvas
setVSyncEnabled
attempts to enable or disable monitor vertical synchronization. The method is a "best attempt" to change the monitor vertical refresh synchronization, and is not guaranteed to be successful. This is dependent on OS.- Specified by:
setVSyncEnabled
in interfaceNativeCanvas
- Parameters:
enabled
-true
to synchronize,false
to ignore synchronization
-