Package com.metsci.glimpse.core.canvas
Class SwingGlimpseCanvas
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- com.metsci.glimpse.core.canvas.SwingGlimpseCanvas
-
- All Implemented Interfaces:
GlimpseCanvas
,GlimpseTarget
,ImageObserver
,MenuContainer
,Serializable
,Accessible
@Deprecated public class SwingGlimpseCanvas extends JPanel implements GlimpseCanvas
Deprecated.A Swing GlimpseCanvas implementation which draws to aGLCanvas
. This Canvas implementation is not as well supported as the newer JOGLNewtCanvasAWT
. For this reason,NewtSwingGlimpseCanvas
should generally be preferred over this class.- Author:
- ulman
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
-
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
Constructors Constructor Description SwingGlimpseCanvas()
Deprecated.SwingGlimpseCanvas(boolean setNoEraseBackgroundProperty, com.jogamp.opengl.GLProfile glProfile, com.jogamp.opengl.GLContext context)
Deprecated.UseSwingGlimpseCanvas(GLContext)
instead.SwingGlimpseCanvas(boolean setNoEraseBackgroundProperty, String profile, com.jogamp.opengl.GLContext context)
Deprecated.UseSwingGlimpseCanvas(GLContext)
instead.SwingGlimpseCanvas(com.jogamp.opengl.GLContext context)
Deprecated.SwingGlimpseCanvas(com.jogamp.opengl.GLProfile glProfile)
Deprecated.SwingGlimpseCanvas(com.jogamp.opengl.GLProfile glProfile, com.jogamp.opengl.GLContext context)
Deprecated.UseSwingGlimpseCanvas(GLContext)
instead.SwingGlimpseCanvas(String profile, com.jogamp.opengl.GLContext context)
Deprecated.UseSwingGlimpseCanvas(GLContext)
instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addDisposeListener(com.jogamp.opengl.GLRunnable runnable)
Deprecated.Called whenGLEventListener.dispose(GLAutoDrawable)
event is fired by theGLAutoDrawable
associated with the GlimpseCanvas.void
addKeyListener(KeyListener listener)
Deprecated.void
addLayout(GlimpseLayout layout)
Deprecated.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)
Deprecated.void
addMouseListener(MouseListener listener)
Deprecated.void
addMouseMotionListener(MouseMotionListener listener)
Deprecated.void
addMouseWheelListener(MouseWheelListener listener)
Deprecated.void
destroy()
Deprecated.Destroys the native surface which this canvas draws to.void
dispose()
Deprecated.A convenience method which is equivalent to:disposeAttached( ); destroy( );
void
disposeAttached()
Deprecated.Disposes native resources of GlimpseLayouts and GlimpsePainters associated with the GlimpseCanvas.void
disposePainter(GlimpsePainter painter)
Deprecated.CallsGlimpsePainter.dispose(GlimpseContext)
the next time the GLContext associated with this GlimpseCanvas is active.Dimension
getDimension()
Deprecated.com.jogamp.opengl.GLContext
getGLContext()
Deprecated.com.jogamp.opengl.GLAutoDrawable
getGLDrawable()
Deprecated.GlimpseContext
getGlimpseContext()
Deprecated.com.jogamp.opengl.GLProfile
getGLProfile()
Deprecated.float[]
getSurfaceScale()
Deprecated.Returns the scale factors needed to convert the _native_ pixel coordinates to the _window_ pixel coordinates.GlimpseBounds
getTargetBounds()
Deprecated.GlimpseBounds
getTargetBounds(GlimpseTargetStack stack)
Deprecated.Returns the cached or calculated bounds of this GlimpseTarget for a particular context.List<GlimpseTarget>
getTargetChildren()
Deprecated.boolean
isDestroyed()
Deprecated.boolean
isEventConsumer()
Deprecated.Sets whether this GlimpseTarget hides events from GlimpseTargets under it.boolean
isEventGenerator()
Deprecated.Sets whether this GlimpseTarget generates GlimpseMouseEvents.void
paint()
Deprecated.Lays out anyGlimpseLayout
instances attached to the GlimpseCanvas and paints allGlimpsePainter
instances attached to the GlimpseLayouts.void
removeAllLayouts()
Deprecated.Clears the canvas, removing all attached GlimpseLayouts.void
removeKeyListener(KeyListener listener)
Deprecated.void
removeLayout(GlimpseLayout layout)
Deprecated.Removes a previously added layout from this GlimpseTarget.void
removeMouseListener(MouseListener listener)
Deprecated.void
removeMouseMotionListener(MouseMotionListener listener)
Deprecated.void
removeMouseWheelListener(MouseWheelListener listener)
Deprecated.void
setEventConsumer(boolean consume)
Deprecated.Set whether or not this GlimpseTarget will consume or pass through mouse events.void
setEventGenerator(boolean generate)
Deprecated.Set whether or not this GlimpseTarget will generate GlimpseMouseEvents.void
setLookAndFeel(LookAndFeel laf)
Deprecated.Sets the LookAndFeel for this GlimpseTarget and all child GlimpseTargets.void
setZOrder(GlimpseLayout layout, int zOrder)
Deprecated.String
toString()
Deprecated.-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
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
-
Methods inherited from class java.awt.Container
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
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, 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, 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, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.metsci.glimpse.core.canvas.GlimpseCanvas
getDpi
-
Methods inherited from interface com.metsci.glimpse.core.context.GlimpseTarget
isVisible
-
-
-
-
Constructor Detail
-
SwingGlimpseCanvas
public SwingGlimpseCanvas()
Deprecated.
-
SwingGlimpseCanvas
public SwingGlimpseCanvas(com.jogamp.opengl.GLContext context)
Deprecated.
-
SwingGlimpseCanvas
public SwingGlimpseCanvas(com.jogamp.opengl.GLProfile glProfile)
Deprecated.
-
SwingGlimpseCanvas
public SwingGlimpseCanvas(com.jogamp.opengl.GLProfile glProfile, com.jogamp.opengl.GLContext context)
Deprecated.UseSwingGlimpseCanvas(GLContext)
instead. The context implicitly provides a GLProfile.
-
SwingGlimpseCanvas
public SwingGlimpseCanvas(String profile, com.jogamp.opengl.GLContext context)
Deprecated.UseSwingGlimpseCanvas(GLContext)
instead. The context implicitly provides a GLProfile.
-
SwingGlimpseCanvas
public SwingGlimpseCanvas(boolean setNoEraseBackgroundProperty, String profile, com.jogamp.opengl.GLContext context)
Deprecated.UseSwingGlimpseCanvas(GLContext)
instead. The context implicitly provides a GLProfile.
-
SwingGlimpseCanvas
public SwingGlimpseCanvas(boolean setNoEraseBackgroundProperty, com.jogamp.opengl.GLProfile glProfile, com.jogamp.opengl.GLContext context)
Deprecated.UseSwingGlimpseCanvas(GLContext)
instead. The context implicitly provides a GLProfile.
-
-
Method Detail
-
addMouseListener
public void addMouseListener(MouseListener listener)
Deprecated.- Overrides:
addMouseListener
in classComponent
-
addMouseMotionListener
public void addMouseMotionListener(MouseMotionListener listener)
Deprecated.- Overrides:
addMouseMotionListener
in classComponent
-
addMouseWheelListener
public void addMouseWheelListener(MouseWheelListener listener)
Deprecated.- Overrides:
addMouseWheelListener
in classComponent
-
removeMouseListener
public void removeMouseListener(MouseListener listener)
Deprecated.- Overrides:
removeMouseListener
in classComponent
-
removeMouseMotionListener
public void removeMouseMotionListener(MouseMotionListener listener)
Deprecated.- Overrides:
removeMouseMotionListener
in classComponent
-
removeMouseWheelListener
public void removeMouseWheelListener(MouseWheelListener listener)
Deprecated.- Overrides:
removeMouseWheelListener
in classComponent
-
addKeyListener
public void addKeyListener(KeyListener listener)
Deprecated.- Overrides:
addKeyListener
in classComponent
-
removeKeyListener
public void removeKeyListener(KeyListener listener)
Deprecated.- Overrides:
removeKeyListener
in classComponent
-
getGLProfile
public com.jogamp.opengl.GLProfile getGLProfile()
Deprecated.- Specified by:
getGLProfile
in interfaceGlimpseCanvas
-
getGLDrawable
public com.jogamp.opengl.GLAutoDrawable getGLDrawable()
Deprecated.- Specified by:
getGLDrawable
in interfaceGlimpseCanvas
-
getGlimpseContext
public GlimpseContext getGlimpseContext()
Deprecated.- Specified by:
getGlimpseContext
in interfaceGlimpseCanvas
-
setLookAndFeel
public void setLookAndFeel(LookAndFeel laf)
Deprecated.Description copied from interface:GlimpseTarget
Sets the LookAndFeel for this GlimpseTarget and all child GlimpseTargets.- Specified by:
setLookAndFeel
in interfaceGlimpseTarget
-
addLayout
public void addLayout(GlimpseLayout layout)
Deprecated.Description copied from interface:GlimpseTarget
Adds a sub-layout to this GlimpseTarget which will only paint in a region of this GlimpseTarget based on its layout constraints. This same GlimpseLayout may be a child of any number of different GlimpseTargets.- Specified by:
addLayout
in interfaceGlimpseTarget
-
addLayout
public void addLayout(GlimpseLayout layout, int zOrder)
Deprecated.- Specified by:
addLayout
in interfaceGlimpseTarget
-
setZOrder
public void setZOrder(GlimpseLayout layout, int zOrder)
Deprecated.- Specified by:
setZOrder
in interfaceGlimpseTarget
-
removeLayout
public void removeLayout(GlimpseLayout layout)
Deprecated.Description copied from interface:GlimpseTarget
Removes a previously added layout from this GlimpseTarget.- Specified by:
removeLayout
in interfaceGlimpseTarget
-
removeAllLayouts
public void removeAllLayouts()
Deprecated.Description copied from interface:GlimpseTarget
Clears the canvas, removing all attached GlimpseLayouts.- Specified by:
removeAllLayouts
in interfaceGlimpseTarget
-
getTargetChildren
public List<GlimpseTarget> getTargetChildren()
Deprecated.- Specified by:
getTargetChildren
in interfaceGlimpseTarget
- Returns:
- the list of children added through addLayout( GlimpseLayout ).
-
getDimension
public Dimension getDimension()
Deprecated.
-
getTargetBounds
public GlimpseBounds getTargetBounds(GlimpseTargetStack stack)
Deprecated.Description copied from interface:GlimpseTarget
Returns the cached or calculated bounds of this GlimpseTarget for a particular context.- Specified by:
getTargetBounds
in interfaceGlimpseTarget
- Returns:
- the bounds for the given stack
-
getTargetBounds
public GlimpseBounds getTargetBounds()
Deprecated.- Specified by:
getTargetBounds
in interfaceGlimpseCanvas
-
paint
public void paint()
Deprecated.Description copied from interface:GlimpseCanvas
Lays out anyGlimpseLayout
instances attached to the GlimpseCanvas and paints allGlimpsePainter
instances attached to the GlimpseLayouts.- Specified by:
paint
in interfaceGlimpseCanvas
-
getGLContext
public com.jogamp.opengl.GLContext getGLContext()
Deprecated.- Specified by:
getGLContext
in interfaceGlimpseCanvas
-
isEventConsumer
public boolean isEventConsumer()
Deprecated.Description copied from interface:GlimpseTarget
Sets whether this GlimpseTarget hides events from GlimpseTargets under it. This value does not determine whether or not the GlimpseTarget will generate GlimpseMouseEvents (see {@link #isEventGenerator()).- Specified by:
isEventConsumer
in interfaceGlimpseTarget
- Returns:
- whether this target hides events from targets under it
-
setEventConsumer
public void setEventConsumer(boolean consume)
Deprecated.Description copied from interface:GlimpseTarget
Set whether or not this GlimpseTarget will consume or pass through mouse events.- Specified by:
setEventConsumer
in interfaceGlimpseTarget
-
isEventGenerator
public boolean isEventGenerator()
Deprecated.Description copied from interface:GlimpseTarget
Sets whether this GlimpseTarget generates GlimpseMouseEvents. This value does not determine whether or not GlimpseTargets underneath this GlimpseTarget will also generate GlimpseMouseEvents (seeGlimpseTarget.isEventConsumer()
).- Specified by:
isEventGenerator
in interfaceGlimpseTarget
- Returns:
- whether this target will generate GlimpseMouseEvents
-
setEventGenerator
public void setEventGenerator(boolean generate)
Deprecated.Description copied from interface:GlimpseTarget
Set whether or not this GlimpseTarget will generate GlimpseMouseEvents.- Specified by:
setEventGenerator
in interfaceGlimpseTarget
-
isDestroyed
public boolean isDestroyed()
Deprecated.- Specified by:
isDestroyed
in interfaceGlimpseCanvas
- Returns:
- whether or not
#dispose()
has been successfully called. Once true, this GlimpseCanvas is no longer valid for rendering.
-
destroy
public void destroy()
Deprecated.Description copied from interface:GlimpseCanvas
Destroys the native surface which this canvas draws to. Does not dispose of GL resources associated with GlimpsePainters and GlimpseLayouts attached to the GlimpseCanvas (as these may be attached to other GlimpseCanvases as well). Disposing of Glimpse resources can be done via#disposeAttached()
.- Specified by:
destroy
in interfaceGlimpseCanvas
- See Also:
GlimpseCanvas.disposeAttached()
-
addDisposeListener
public void addDisposeListener(com.jogamp.opengl.GLRunnable runnable)
Deprecated.Description copied from interface:GlimpseCanvas
Called whenGLEventListener.dispose(GLAutoDrawable)
event is fired by theGLAutoDrawable
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.- Specified by:
addDisposeListener
in interfaceGlimpseCanvas
-
dispose
public void dispose()
Deprecated.Description copied from interface:GlimpseCanvas
A convenience method which is equivalent to:disposeAttached( ); destroy( );
- Specified by:
dispose
in interfaceGlimpseCanvas
-
disposeAttached
public void disposeAttached()
Deprecated.Description copied from interface:GlimpseCanvas
Disposes native resources of GlimpseLayouts and GlimpsePainters associated with the GlimpseCanvas.- Specified by:
disposeAttached
in interfaceGlimpseCanvas
- See Also:
GlimpseCanvas.destroy()
-
disposePainter
public void disposePainter(GlimpsePainter painter)
Deprecated.Description copied from interface: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( ) {
- Specified by:
disposePainter
in interfaceGlimpseCanvas
-
getSurfaceScale
public float[] getSurfaceScale()
Deprecated.Description copied from interface:GlimpseCanvas
Returns the scale factors needed to convert the _native_ pixel coordinates to the _window_ pixel coordinates. This only really matters on displays like like Macbook Retina.- Specified by:
getSurfaceScale
in interfaceGlimpseCanvas
- Returns:
- the scale factors as {scaleX, scaleY}
-
-