|
JCanvas3DyUp | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.interactivemesh.j3d.community.gui.FXCanvas3D
public class FXCanvas3D
This class provides Java 3D rendering into a lightweight component which can be added via a reziable JavaFX SwingComponent to a JavaFX Scene.
It allows to run the Java 3D rendering loop in parallel to the JavaFX painting loop with synchronized minimal overlapping.
The following events will be redirected to the underlying heavyweight Canvas3D object:
FXCanvas3DRepainter
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
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.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
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 | |
---|---|
FXCanvas3D()
Constructs and initializes a new FXCanvas3D object that Java 3D can render into. |
|
FXCanvas3D(javax.media.j3d.GraphicsConfigTemplate3D template)
Constructs and initializes a new FXCanvas3D object that Java 3D can render into, using the specified template. |
|
FXCanvas3D(javax.media.j3d.GraphicsConfigTemplate3D template,
java.awt.GraphicsDevice device)
Constructs and initializes a new FXCanvas3D object that Java 3D can render into, using the specified template and graphics device. |
|
FXCanvas3D(java.awt.GraphicsDevice device)
Constructs and initializes a new FXCanvas3D object that Java 3D can render into, using the specified graphics device. |
Method Summary | |
---|---|
void |
ancestorAdded(javax.swing.event.AncestorEvent event)
|
void |
ancestorMoved(javax.swing.event.AncestorEvent event)
|
void |
ancestorRemoved(javax.swing.event.AncestorEvent event)
|
void |
copyOffScreenBuffer()
Copies the 3D rendering image into the 2D painting image while the J3D-Renderer thread is waiting. |
javax.media.j3d.Canvas3D |
getOffscreenCanvas3D()
Returns the offscreen heavyweight canvas of this lightweight component. |
void |
paintComponent(java.awt.Graphics g)
Paints the result of the 3D rendering. |
protected void |
processComponentKeyEvent(java.awt.event.KeyEvent e)
Redirects event to canvas and to superclass. |
protected void |
processFocusEvent(java.awt.event.FocusEvent e)
Redirects event to canvas and to superclass. |
protected void |
processInputMethodEvent(java.awt.event.InputMethodEvent e)
Redirects event to canvas and to superclass. |
protected void |
processKeyEvent(java.awt.event.KeyEvent e)
Redirects event to canvas and to superclass. |
protected void |
processMouseEvent(java.awt.event.MouseEvent e)
Redirects event to canvas and to superclass. |
protected void |
processMouseMotionEvent(java.awt.event.MouseEvent e)
Redirects event to canvas and to superclass. |
protected void |
processMouseWheelEvent(java.awt.event.MouseWheelEvent e)
Redirects event to canvas and to superclass. |
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setRepainter(FXCanvas3DRepainter painter)
Sets the FXCanvas3DRepainter object for this FXCanvas3D. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processKeyBinding, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FXCanvas3D()
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
,
which might not be the one you should use if you are in a multiscreen environment.
The FXCanvas3D is constructed using the following default parameters:
public FXCanvas3D(java.awt.GraphicsDevice device)
device
- the screen graphics device that will be used to construct
a GraphicsConfiguration.public FXCanvas3D(javax.media.j3d.GraphicsConfigTemplate3D template)
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
,
which might not be the one you should use if you are
in a multiscreen environment.
template
- The template that will be used to construct a
GraphicsConfiguration. The stereo and doublebuffer properties
are forced to UNNECESSARY.public FXCanvas3D(javax.media.j3d.GraphicsConfigTemplate3D template, java.awt.GraphicsDevice device)
template
- The template that will be used to construct a
GraphicsConfiguration. The stereo and doublebuffer properties
are forced to UNNECESSARY.device
- the screen graphics device that will be used to construct
a GraphicsConfiguration in conjunction with the template.Method Detail |
---|
public void copyOffScreenBuffer()
public void setRepainter(FXCanvas3DRepainter painter)
painter
- JavaFX class instancepublic void ancestorAdded(javax.swing.event.AncestorEvent event)
ancestorAdded
in interface javax.swing.event.AncestorListener
event
- public void ancestorMoved(javax.swing.event.AncestorEvent event)
ancestorMoved
in interface javax.swing.event.AncestorListener
event
- public void ancestorRemoved(javax.swing.event.AncestorEvent event)
ancestorRemoved
in interface javax.swing.event.AncestorListener
event
- public javax.media.j3d.Canvas3D getOffscreenCanvas3D()
public void setBounds(int x, int y, int width, int height)
setBounds
in class java.awt.Component
x
- y
- width
- height
- public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- protected void processComponentKeyEvent(java.awt.event.KeyEvent e)
processComponentKeyEvent
in class javax.swing.JComponent
e
- protected void processFocusEvent(java.awt.event.FocusEvent e)
processFocusEvent
in class java.awt.Component
e
- protected void processInputMethodEvent(java.awt.event.InputMethodEvent e)
processInputMethodEvent
in class java.awt.Component
e
- protected void processKeyEvent(java.awt.event.KeyEvent e)
processKeyEvent
in class javax.swing.JComponent
e
- protected void processMouseEvent(java.awt.event.MouseEvent e)
processMouseEvent
in class javax.swing.JComponent
e
- protected void processMouseMotionEvent(java.awt.event.MouseEvent e)
processMouseMotionEvent
in class javax.swing.JComponent
e
- protected void processMouseWheelEvent(java.awt.event.MouseWheelEvent e)
processMouseWheelEvent
in class java.awt.Component
e
-
|
JCanvas3DyUp | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |