core
Class BridgeAWT_SWT

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 core.BridgeAWT_SWT
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class BridgeAWT_SWT
extends org.eclipse.swt.widgets.Composite

Class that creates an SWT composite, with scroll bars, that contains SWING/AWT drawing


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
BridgeAWT_SWT(ProjectWindow parent, int style, TabsContainer projectTabs, int awtContainerCompositeWidth, int awtContainerCompositeHeight)
          Constructs a new instance of this class given its parent, a style value describing its behavior and appearance, the tabs that are in use by the parent ProjectWindow, the desired width and height for the SWING/AWT composite
 
Method Summary
 void dispose()
           
 java.awt.image.BufferedImage getCurrentImage()
          Return a copy of the current drawing container's image
 void redrawDrawingContainer()
          Ask the project's drawing container to repaint it's image
 void registerMouseListener(java.awt.event.MouseListener mouseListener)
          Adds the specified mouse listener to receive mouse motion events from the project's drawing container.
 void registerMouseMotionListener(java.awt.event.MouseMotionListener mouseMotionListener)
          Adds the specified mouse motion listener to receive mouse motion events from the project's drawing container.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, 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, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BridgeAWT_SWT

public BridgeAWT_SWT(ProjectWindow parent,
                     int style,
                     TabsContainer projectTabs,
                     int awtContainerCompositeWidth,
                     int awtContainerCompositeHeight)
Constructs a new instance of this class given its parent, a style value describing its behavior and appearance, the tabs that are in use by the parent ProjectWindow, the desired width and height for the SWING/AWT composite

The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants. Style bits are also inherited from superclasses.

Parameters:
parent - the parent project for this new instance (cannot be null)
style - the style of widget to construct
projectTabs - the tabs that are in use by the parent ProjectWindow
awtContainerCompositeWidth - desired SWING/AWT composite width
awtContainerCompositeHeight - desired SWING/AWT composite height
Method Detail

redrawDrawingContainer

public void redrawDrawingContainer()
Ask the project's drawing container to repaint it's image


dispose

public void dispose()
Overrides:
dispose in class org.eclipse.swt.widgets.Widget

getCurrentImage

public java.awt.image.BufferedImage getCurrentImage()
Return a copy of the current drawing container's image

Returns:
BufferedImage with the current drawn image

registerMouseListener

public void registerMouseListener(java.awt.event.MouseListener mouseListener)
Adds the specified mouse listener to receive mouse motion events from the project's drawing container. If listener is null, no exception is thrown and no action is performed.

Parameters:
mouseListener - the mouse listener

registerMouseMotionListener

public void registerMouseMotionListener(java.awt.event.MouseMotionListener mouseMotionListener)
Adds the specified mouse motion listener to receive mouse motion events from the project's drawing container. If listener is null, no exception is thrown and no action is performed.

Parameters:
mouseMotionListener - the mouse motion listener