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.AccessibleJComponent
Component.BaselineResizeBehavior
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
NewtSwingGlimpseCanvas() |
NewtSwingGlimpseCanvas(javax.media.opengl.GLContext context) |
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, updateUI
addAncestorListener, 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, update
add, 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, validate
action, 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, transferFocusUpCycle
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
isVisible
public NewtSwingGlimpseCanvas(String glProfile, javax.media.opengl.GLContext context)
NewtSwingGlimpseCanvas(GLContext)
instead. The context implicitly provides a GLProfile.public NewtSwingGlimpseCanvas(javax.media.opengl.GLProfile glProfile, javax.media.opengl.GLContext context)
NewtSwingGlimpseCanvas(GLContext)
instead. The context implicitly provides a GLProfile.public NewtSwingGlimpseCanvas(String profile)
public NewtSwingGlimpseCanvas(javax.media.opengl.GLContext context)
public NewtSwingGlimpseCanvas()
public javax.media.opengl.GLProfile getGLProfile()
getGLProfile
in interface GlimpseCanvas
public com.jogamp.newt.awt.NewtCanvasAWT getCanvas()
public javax.media.opengl.GLAutoDrawable getGLDrawable()
getGLDrawable
in interface GlimpseCanvas
public com.jogamp.newt.opengl.GLWindow getGLWindow()
getGLWindow
in interface NewtGlimpseCanvas
public GlimpseContext getGlimpseContext()
getGlimpseContext
in interface GlimpseCanvas
public void setLookAndFeel(LookAndFeel laf)
GlimpseTarget
setLookAndFeel
in interface GlimpseTarget
public void addLayout(GlimpseLayout layout)
GlimpseTarget
addLayout
in interface GlimpseTarget
public void addLayout(GlimpseLayout layout, int zOrder)
addLayout
in interface GlimpseTarget
public void setZOrder(GlimpseLayout layout, int zOrder)
setZOrder
in interface GlimpseTarget
public void removeLayout(GlimpseLayout layout)
GlimpseTarget
removeLayout
in interface GlimpseTarget
public void removeAllLayouts()
GlimpseTarget
removeAllLayouts
in interface GlimpseTarget
public List<GlimpseTarget> getTargetChildren()
getTargetChildren
in interface GlimpseTarget
public Dimension getDimension()
public GlimpseBounds getTargetBounds(GlimpseTargetStack stack)
GlimpseTarget
getTargetBounds
in interface GlimpseTarget
public GlimpseBounds getTargetBounds()
getTargetBounds
in interface GlimpseCanvas
public void paint()
GlimpseCanvas
GlimpseLayout
instances
attached to the GlimpseCanvas and paints all
GlimpsePainter
instances attached
to the GlimpseLayouts.paint
in interface GlimpseCanvas
public javax.media.opengl.GLContext getGLContext()
getGLContext
in interface GlimpseCanvas
public boolean isEventConsumer()
GlimpseTarget
isEventConsumer
in interface GlimpseTarget
public void setEventConsumer(boolean consume)
GlimpseTarget
setEventConsumer
in interface GlimpseTarget
public boolean isEventGenerator()
GlimpseTarget
GlimpseTarget.isEventConsumer()
).isEventGenerator
in interface GlimpseTarget
public void setEventGenerator(boolean generate)
GlimpseTarget
setEventGenerator
in interface GlimpseTarget
public void destroy()
GlimpseCanvas
#disposeAttached()
.destroy
in interface GlimpseCanvas
GlimpseCanvas.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)
GlimpseCanvas
GLEventListener.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 GlimpseCanvas
public void dispose()
GlimpseCanvas
disposeAttached( );
destroy( );
dispose
in interface GlimpseCanvas
public void disposeAttached()
GlimpseCanvas
disposeAttached
in interface GlimpseCanvas
GlimpseCanvas.destroy()
public void disposePainter(GlimpsePainter painter)
GlimpseCanvas
Calls 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 GlimpseCanvas
public int[] getSurfaceScale()
GlimpseCanvas
getSurfaceScale
in interface GlimpseCanvas
Copyright © 2016 Metron, Inc.. All rights reserved.