public class NewtSwingGlimpseCanvas extends JPanel implements NewtGlimpseCanvas
NewtCanvasAWT. This is the default GlimpseCanvas
which should be used for most Swing applications. The underlying NewtCanvasAWT is
being actively developed, whereas the underlying canvas for SwingGlimpseCanvas is
no longer supported and has fewer features.JComponent.AccessibleJComponentComponent.BaselineResizeBehaviorTOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
NewtSwingGlimpseCanvas() |
NewtSwingGlimpseCanvas(javax.media.opengl.GLContext context) |
NewtSwingGlimpseCanvas(javax.media.opengl.GLProfile glProfile) |
NewtSwingGlimpseCanvas(javax.media.opengl.GLProfile glProfile,
javax.media.opengl.GLContext context)
Deprecated.
Use
NewtSwingGlimpseCanvas(GLContext) instead. The context implicitly provides a GLProfile. |
NewtSwingGlimpseCanvas(String profile) |
NewtSwingGlimpseCanvas(String glProfile,
javax.media.opengl.GLContext context)
Deprecated.
Use
NewtSwingGlimpseCanvas(GLContext) instead. The context implicitly provides a GLProfile. |
| Modifier and Type | Method and Description |
|---|---|
void |
addDisposeListener(javax.media.opengl.GLRunnable runnable)
Called when
GLEventListener.dispose(GLAutoDrawable) event is fired by the GLAutoDrawable associated with the
GlimpseCanvas. |
void |
addLayout(GlimpseLayout layout)
Adds a sub-layout to this GlimpseTarget which will only paint in a region of this GlimpseTarget
based on its layout constraints.
|
void |
addLayout(GlimpseLayout layout,
int zOrder) |
void |
destroy()
Destroys the native surface which this canvas draws to.
|
void |
dispose()
A convenience method which is equivalent to:
disposeAttached( );
destroy( );
|
void |
disposeAttached()
Disposes native resources of GlimpseLayouts and GlimpsePainters associated with the GlimpseCanvas.
|
void |
disposePainter(GlimpsePainter painter)
Calls
GlimpsePainter.dispose(GlimpseContext) the next time the GLContext associated with
this GlimpseCanvas is active. |
com.jogamp.newt.awt.NewtCanvasAWT |
getCanvas() |
Dimension |
getDimension() |
javax.media.opengl.GLContext |
getGLContext() |
javax.media.opengl.GLAutoDrawable |
getGLDrawable() |
GlimpseContext |
getGlimpseContext() |
javax.media.opengl.GLProfile |
getGLProfile() |
com.jogamp.newt.opengl.GLWindow |
getGLWindow() |
int[] |
getSurfaceScale()
Returns the scale factors needed to convert the _native_ pixel coordinates to
the _window_ pixel coordinates.
|
GlimpseBounds |
getTargetBounds() |
GlimpseBounds |
getTargetBounds(GlimpseTargetStack stack)
Returns the cached or calculated bounds of this GlimpseTarget for a particular context.
|
List<GlimpseTarget> |
getTargetChildren() |
boolean |
isDestroyed() |
boolean |
isEventConsumer()
Sets whether this GlimpseTarget hides events from GlimpseTargets under it.
|
boolean |
isEventGenerator()
Sets whether this GlimpseTarget generates GlimpseMouseEvents.
|
void |
paint()
Lays out any
GlimpseLayout instances
attached to the GlimpseCanvas and paints all
GlimpsePainter instances attached
to the GlimpseLayouts. |
void |
removeAllLayouts()
Clears the canvas, removing all attached GlimpseLayouts.
|
void |
removeLayout(GlimpseLayout layout)
Removes a previously added layout from this GlimpseTarget.
|
void |
setEventConsumer(boolean consume)
Set whether or not this GlimpseTarget will consume or pass through mouse events.
|
void |
setEventGenerator(boolean generate)
Set whether or not this GlimpseTarget will generate GlimpseMouseEvents.
|
void |
setLookAndFeel(LookAndFeel laf)
Sets the LookAndFeel for this GlimpseTarget and all child GlimpseTargets.
|
void |
setZOrder(GlimpseLayout layout,
int zOrder) |
String |
toString() |
getAccessibleContext, getUI, getUIClassID, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycleequals, getClass, hashCode, notify, notifyAll, wait, wait, waitisVisible@Deprecated public NewtSwingGlimpseCanvas(String glProfile, javax.media.opengl.GLContext context)
NewtSwingGlimpseCanvas(GLContext) instead. The context implicitly provides a GLProfile.@Deprecated public NewtSwingGlimpseCanvas(javax.media.opengl.GLProfile glProfile, javax.media.opengl.GLContext context)
NewtSwingGlimpseCanvas(GLContext) instead. The context implicitly provides a GLProfile.public NewtSwingGlimpseCanvas(javax.media.opengl.GLProfile glProfile)
public NewtSwingGlimpseCanvas(String profile)
public NewtSwingGlimpseCanvas(javax.media.opengl.GLContext context)
public NewtSwingGlimpseCanvas()
public javax.media.opengl.GLProfile getGLProfile()
getGLProfile in interface GlimpseCanvaspublic com.jogamp.newt.awt.NewtCanvasAWT getCanvas()
public javax.media.opengl.GLAutoDrawable getGLDrawable()
getGLDrawable in interface GlimpseCanvaspublic com.jogamp.newt.opengl.GLWindow getGLWindow()
getGLWindow in interface NewtGlimpseCanvaspublic GlimpseContext getGlimpseContext()
getGlimpseContext in interface GlimpseCanvaspublic void setLookAndFeel(LookAndFeel laf)
GlimpseTargetsetLookAndFeel in interface GlimpseTargetpublic void addLayout(GlimpseLayout layout)
GlimpseTargetaddLayout in interface GlimpseTargetpublic void addLayout(GlimpseLayout layout, int zOrder)
addLayout in interface GlimpseTargetpublic void setZOrder(GlimpseLayout layout, int zOrder)
setZOrder in interface GlimpseTargetpublic void removeLayout(GlimpseLayout layout)
GlimpseTargetremoveLayout in interface GlimpseTargetpublic void removeAllLayouts()
GlimpseTargetremoveAllLayouts in interface GlimpseTargetpublic List<GlimpseTarget> getTargetChildren()
getTargetChildren in interface GlimpseTargetpublic Dimension getDimension()
public GlimpseBounds getTargetBounds(GlimpseTargetStack stack)
GlimpseTargetgetTargetBounds in interface GlimpseTargetpublic GlimpseBounds getTargetBounds()
getTargetBounds in interface GlimpseCanvaspublic void paint()
GlimpseCanvasGlimpseLayout instances
attached to the GlimpseCanvas and paints all
GlimpsePainter instances attached
to the GlimpseLayouts.paint in interface GlimpseCanvaspublic javax.media.opengl.GLContext getGLContext()
getGLContext in interface GlimpseCanvaspublic boolean isEventConsumer()
GlimpseTargetisEventConsumer in interface GlimpseTargetpublic void setEventConsumer(boolean consume)
GlimpseTargetsetEventConsumer in interface GlimpseTargetpublic boolean isEventGenerator()
GlimpseTargetGlimpseTarget.isEventConsumer()).isEventGenerator in interface GlimpseTargetpublic void setEventGenerator(boolean generate)
GlimpseTargetsetEventGenerator in interface GlimpseTargetpublic void destroy()
GlimpseCanvas#disposeAttached().destroy in interface GlimpseCanvasGlimpseCanvas.disposeAttached()public boolean isDestroyed()
isDestroyed in interface GlimpseCanvas#dispose() has been successfully called. Once true, this GlimpseCanvas is no longer valid for rendering.public void addDisposeListener(javax.media.opengl.GLRunnable runnable)
GlimpseCanvasGLEventListener.dispose(GLAutoDrawable) event is fired by the GLAutoDrawable associated with the
GlimpseCanvas. This can happen for reasons other than the window containing the GlimpseCanvas being closed (for example, moving
the window between physical monitors or moving the container between docks in a docking framework). Thus, GlimpsePainters and
GlimpseLayouts attached to this GlimpseCanvas should generally not be disposed when this callback occurs.addDisposeListener in interface GlimpseCanvaspublic void dispose()
GlimpseCanvas
disposeAttached( );
destroy( );
dispose in interface GlimpseCanvaspublic void disposeAttached()
GlimpseCanvasdisposeAttached in interface GlimpseCanvasGlimpseCanvas.destroy()public void disposePainter(GlimpsePainter painter)
GlimpseCanvasCalls GlimpsePainter.dispose(GlimpseContext) the next time the GLContext associated with
this GlimpseCanvas is active. Generally this call is equivalent to:
this.getGLDrawable( ).invoke( false, new GLRunnable( )
{disposePainter in interface GlimpseCanvaspublic int[] getSurfaceScale()
GlimpseCanvasgetSurfaceScale in interface GlimpseCanvasCopyright © 2020 Metron, Inc.. All rights reserved.