public class JCanvas3D extends JPanel implements AncestorListener
30 Math.max(20.0, getView().getMinimumFrameCycleTime() )
getLightweightComponent()
,
setResizeValidationDelay()
,
setResizeMode()
,
Serialized FormJPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static int |
RESIZE_DELAYED
Resizing the canvas or component will be done if no resizing
occurs after expiration of a certain delay.
|
static int |
RESIZE_IMMEDIATELY
Resizing the canvas or component will be done immediately.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
JCanvas3D()
Constructs and initializes a new JCanvas3D object that Java 3D
can render into.
|
JCanvas3D(GraphicsConfigTemplate3D template)
Constructs and initializes a new Canvas3D object that Java 3D
can render into, using the specified template.
|
JCanvas3D(GraphicsConfigTemplate3D template,
GraphicsDevice device)
Constructs and initializes a new Canvas3D object that Java 3D
can render into, using the specified template and graphics device.
|
JCanvas3D(GraphicsDevice device)
Constructs and initializes a new Canvas3D object that Java 3D
can render into, using the specified graphics device.
|
Modifier and Type | Method and Description |
---|---|
void |
ancestorAdded(AncestorEvent event) |
void |
ancestorMoved(AncestorEvent event) |
void |
ancestorRemoved(AncestorEvent event) |
Canvas3D |
getOffscreenCanvas3D()
Returns the offscreen heavyweight canvas of that lightweight
component.
|
int |
getResizeMode()
Retrieves the resize mode for that component.
|
int |
getResizeValidationDelay()
Retrieves the validation delay for that canvas, whatever the
resize mode is set to.
|
void |
paintComponent(Graphics g)
Paints the result of the rendering.
|
protected void |
processComponentKeyEvent(KeyEvent e)
Redirects event to canvas and to superclass.
|
protected void |
processFocusEvent(FocusEvent e)
Redirects event to canvas and to superclass.
|
protected void |
processInputMethodEvent(InputMethodEvent e)
Redirects event to canvas and to superclass.
|
protected void |
processKeyEvent(KeyEvent e)
Redirects event to canvas and to superclass.
|
protected void |
processMouseEvent(MouseEvent e)
Redirects event to canvas and to superclass.
|
protected void |
processMouseMotionEvent(MouseEvent e)
Redirects event to canvas and to superclass.
|
protected void |
processMouseWheelEvent(MouseWheelEvent e)
Redirects event to canvas and to superclass.
|
void |
setBounds(int x,
int y,
int width,
int height) |
void |
setResizeMode(int resizeMode)
Sets resize mode to be used on this component.
|
void |
setResizeValidationDelay(int resizeValidationDelay)
Sets the validation delay for the component.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public static final int RESIZE_IMMEDIATELY
setResizeMode()
,
Constant Field Valuespublic static final int RESIZE_DELAYED
setResizeMode()
,
Constant Field Valuespublic JCanvas3D()
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
,
which might not be the one you should use if you are in a multiscreen environment.
The JCanvas3D is constructed using the following default parameters:public JCanvas3D(GraphicsDevice device)
device
- the screen graphics device that will be used to construct
a GraphicsConfiguration.public JCanvas3D(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 JCanvas3D(GraphicsConfigTemplate3D template, 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.public void ancestorAdded(AncestorEvent event)
ancestorAdded
in interface AncestorListener
event
- public void ancestorMoved(AncestorEvent event)
ancestorMoved
in interface AncestorListener
event
- public void ancestorRemoved(AncestorEvent event)
ancestorRemoved
in interface AncestorListener
event
- public Canvas3D getOffscreenCanvas3D()
public int getResizeMode()
public int getResizeValidationDelay()
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- protected void processComponentKeyEvent(KeyEvent e)
processComponentKeyEvent
in class JComponent
e
- protected void processFocusEvent(FocusEvent e)
processFocusEvent
in class Component
e
- protected void processInputMethodEvent(InputMethodEvent e)
processInputMethodEvent
in class Component
e
- protected void processKeyEvent(KeyEvent e)
processKeyEvent
in class JComponent
e
- protected void processMouseEvent(MouseEvent e)
processMouseEvent
in class JComponent
e
- protected void processMouseMotionEvent(MouseEvent e)
processMouseMotionEvent
in class JComponent
e
- protected void processMouseWheelEvent(MouseWheelEvent e)
processMouseWheelEvent
in class Component
e
- public void setBounds(int x, int y, int width, int height)
public void setResizeMode(int resizeMode)
resizeMode
- can be one of RESIZE_IMMEDIATELY or RESIZE_DELAYEDRESIZE_IMMEDIATELY
,
RESIZE_DELAYED
public void setResizeValidationDelay(int resizeValidationDelay)
resizeValidationDelay
- the delay before a real resize would occur.RESIZE_IMMEDIATELY
,
RESIZE_DELAYED
Copyright © 2016–2022 SciJava. All rights reserved.