com.metsci.glimpse.swt.canvas
Class SwtGlimpseCanvas

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.swt.widgets.Canvas
                      extended by org.eclipse.swt.opengl.GLCanvas
                          extended by com.metsci.glimpse.swt.canvas.GLSimpleSwtCanvas
                              extended by com.metsci.glimpse.swt.canvas.SwtGlimpseCanvas
All Implemented Interfaces:
GlimpseCanvas, GlimpseTarget, org.eclipse.swt.graphics.Drawable

public class SwtGlimpseCanvas
extends GLSimpleSwtCanvas
implements GlimpseCanvas


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
SwtGlimpseCanvas(org.eclipse.swt.widgets.Composite _parent)
           
SwtGlimpseCanvas(org.eclipse.swt.widgets.Composite _parent, javax.media.opengl.GLContext _context)
           
SwtGlimpseCanvas(org.eclipse.swt.widgets.Composite _parent, javax.media.opengl.GLContext _context, int options)
           
 
Method Summary
 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 dispose()
          Disposes of the operating system resources associated with the receiver and all its descendants.
 java.awt.Dimension getDimension()
           
 GlimpseContext getGlimpseContext()
           
 GlimpseBounds getTargetBounds()
           
 GlimpseBounds getTargetBounds(GlimpseTargetStack stack)
          Returns the cached or calculated bounds of this GlimpseTarget for a particular context.
 java.util.List<GlimpseTarget> getTargetChildren()
           
 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 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)
           
 void setPlotAreaCursor(org.eclipse.swt.graphics.Cursor cursor)
           
 java.lang.String toString()
          Returns a string containing a concise, human-readable description of the receiver.
 
Methods inherited from class com.metsci.glimpse.swt.canvas.GLSimpleSwtCanvas
addListener, draw, draw, getGLContext, removeListener
 
Methods inherited from class org.eclipse.swt.opengl.GLCanvas
getGLData, isCurrent, setCurrent, swapBuffers
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, computeSize, drawBackground, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, reskin, setData, setData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.metsci.glimpse.canvas.GlimpseCanvas
getGLContext, isDisposed
 

Constructor Detail

SwtGlimpseCanvas

public SwtGlimpseCanvas(org.eclipse.swt.widgets.Composite _parent)

SwtGlimpseCanvas

public SwtGlimpseCanvas(org.eclipse.swt.widgets.Composite _parent,
                        javax.media.opengl.GLContext _context)

SwtGlimpseCanvas

public SwtGlimpseCanvas(org.eclipse.swt.widgets.Composite _parent,
                        javax.media.opengl.GLContext _context,
                        int options)
Method Detail

getGlimpseContext

public GlimpseContext getGlimpseContext()
Specified by:
getGlimpseContext in interface GlimpseCanvas

setLookAndFeel

public void setLookAndFeel(LookAndFeel laf)
Specified by:
setLookAndFeel in interface GlimpseTarget

addLayout

public void addLayout(GlimpseLayout layout)
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 interface GlimpseTarget

removeLayout

public void removeLayout(GlimpseLayout layout)
Description copied from interface: GlimpseTarget
Removes a previously added layout from this GlimpseTarget.

Specified by:
removeLayout in interface GlimpseTarget

getTargetChildren

public java.util.List<GlimpseTarget> getTargetChildren()
Specified by:
getTargetChildren in interface GlimpseTarget
Returns:
the list of children added through addLayout( GlimpseLayout ).

getDimension

public java.awt.Dimension getDimension()

getTargetBounds

public GlimpseBounds getTargetBounds(GlimpseTargetStack stack)
Description copied from interface: GlimpseTarget
Returns the cached or calculated bounds of this GlimpseTarget for a particular context.

Specified by:
getTargetBounds in interface GlimpseTarget
Returns:
the bounds for the given stack

getTargetBounds

public GlimpseBounds getTargetBounds()
Specified by:
getTargetBounds in interface GlimpseCanvas

dispose

public void dispose()
Description copied from class: org.eclipse.swt.widgets.Widget
Disposes of the operating system resources associated with the receiver and all its descendants. After this method has been invoked, the receiver and all descendants will answer true when sent the message isDisposed(). Any internal connections between the widgets in the tree will have been removed to facilitate garbage collection. This method does nothing if the widget is already disposed.

NOTE: This method is not called recursively on the descendants of the receiver. This means that, widget implementers can not detect when a widget is being disposed of by re-implementing this method, but should instead listen for the Dispose event.

Specified by:
dispose in interface GlimpseCanvas
Overrides:
dispose in class GLSimpleSwtCanvas
See Also:
Widget.addDisposeListener(org.eclipse.swt.events.DisposeListener), Widget.removeDisposeListener(org.eclipse.swt.events.DisposeListener), Widget.checkWidget()

paint

public void paint()
Description copied from interface: GlimpseCanvas
Lays out any GlimpseLayout instances attached to the GlimpseCanvas and paints all GlimpsePainter instances attached to the GlimpseLayouts.

Specified by:
paint in interface GlimpseCanvas

setPlotAreaCursor

public void setPlotAreaCursor(org.eclipse.swt.graphics.Cursor cursor)

toString

public java.lang.String toString()
Description copied from class: org.eclipse.swt.widgets.Widget
Returns a string containing a concise, human-readable description of the receiver.

Overrides:
toString in class org.eclipse.swt.widgets.Widget
Returns:
a string representation of the receiver

isEventConsumer

public boolean isEventConsumer()
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 interface GlimpseTarget
Returns:
whether this target hides events from targets under it

setEventConsumer

public void setEventConsumer(boolean consume)
Description copied from interface: GlimpseTarget
Set whether or not this GlimpseTarget will consume or pass through mouse events.

Specified by:
setEventConsumer in interface GlimpseTarget

isEventGenerator

public boolean isEventGenerator()
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 (see GlimpseTarget.isEventConsumer()).

Specified by:
isEventGenerator in interface GlimpseTarget
Returns:
whether this target will generate GlimpseMouseEvents

setEventGenerator

public void setEventGenerator(boolean generate)
Description copied from interface: GlimpseTarget
Set whether or not this GlimpseTarget will generate GlimpseMouseEvents.

Specified by:
setEventGenerator in interface GlimpseTarget


Copyright © 2012 Metron, Inc.. All Rights Reserved.