Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.barteo.emulator.app.ui.swt
Class SwtDeviceComponent  view SwtDeviceComponent download SwtDeviceComponent.java

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended byorg.eclipse.swt.widgets.Canvas
                      extended bycom.barteo.emulator.app.ui.swt.SwtDeviceComponent
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class SwtDeviceComponent
extends org.eclipse.swt.widgets.Canvas


Nested Class Summary
private  class SwtDeviceComponent.CreateColorRunnable
           
private  class SwtDeviceComponent.CreateImageRunnable
           
private  class SwtDeviceComponent.GetFontMetricsRunnable
           
private  class SwtDeviceComponent.GetFontRunnable
           
private  class SwtDeviceComponent.StringWidthRunnable
           
 
Field Summary
private  SwtDisplayComponent dc
           
private  org.eclipse.swt.graphics.Image fBuffer
           
private static SwtDeviceComponent instance
           
(package private)  org.eclipse.swt.events.KeyListener keyListener
           
(package private)  org.eclipse.swt.events.MouseAdapter mouseListener
           
(package private)  org.eclipse.swt.events.MouseMoveListener mouseMoveListener
           
private  com.barteo.emulator.device.swt.SwtButton overButton
           
private  com.barteo.emulator.device.swt.SwtButton pressedButton
           
private  com.barteo.emulator.device.swt.SwtButton prevOverButton
           
 
Fields inherited from class org.eclipse.swt.widgets.Canvas
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Scrollable
 
Fields inherited from class org.eclipse.swt.widgets.Control
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
SwtDeviceComponent(org.eclipse.swt.widgets.Composite parent)
           
 
Method Summary
 org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed)
          Returns the preferred size of the receiver.
static org.eclipse.swt.graphics.Color createColor(org.eclipse.swt.graphics.RGB rgb)
           
static org.eclipse.swt.graphics.Image createImage(java.io.InputStream is)
           
static org.eclipse.swt.graphics.Image createImage(java.io.InputStream is, ImageFilter filter)
           
static org.eclipse.swt.graphics.Image createImage(int width, int height)
           
private  com.barteo.emulator.device.swt.SwtButton getButton(int x, int y)
           
private  com.barteo.emulator.device.swt.SwtButton getButton(org.eclipse.swt.events.KeyEvent ev)
           
 com.barteo.emulator.DisplayComponent getDisplayComponent()
           
static org.eclipse.swt.graphics.Font getFont(java.lang.String name, int size, int style)
           
static org.eclipse.swt.graphics.FontMetrics getFontMetrics(org.eclipse.swt.graphics.Font font)
           
 void paintControl(org.eclipse.swt.events.PaintEvent pe)
           
static int stringWidth(org.eclipse.swt.graphics.Font font, java.lang.String str)
           
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBounds, 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, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, 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, dispose, 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
 

Field Detail

instance

private static SwtDeviceComponent instance

dc

private SwtDisplayComponent dc

fBuffer

private org.eclipse.swt.graphics.Image fBuffer

prevOverButton

private com.barteo.emulator.device.swt.SwtButton prevOverButton

overButton

private com.barteo.emulator.device.swt.SwtButton overButton

pressedButton

private com.barteo.emulator.device.swt.SwtButton pressedButton

keyListener

org.eclipse.swt.events.KeyListener keyListener

mouseListener

org.eclipse.swt.events.MouseAdapter mouseListener

mouseMoveListener

org.eclipse.swt.events.MouseMoveListener mouseMoveListener
Constructor Detail

SwtDeviceComponent

public SwtDeviceComponent(org.eclipse.swt.widgets.Composite parent)
Method Detail

getDisplayComponent

public com.barteo.emulator.DisplayComponent getDisplayComponent()

computeSize

public org.eclipse.swt.graphics.Point computeSize(int wHint,
                                                  int hHint,
                                                  boolean changed)
Description copied from class: org.eclipse.swt.widgets.Control
Returns the preferred size of the receiver.

The preferred size of a control is the size that it would best be displayed at. The width hint and height hint arguments allow the caller to ask a control questions such as "Given a particular width, how high does the control need to be to show all of the contents?" To indicate that the caller does not wish to constrain a particular dimension, the constant SWT.DEFAULT is passed for the hint.

If the changed flag is true, it indicates that the receiver's contents have changed, therefore any caches that a layout manager containing the control may have been keeping need to be flushed. When the control is resized, the changed flag will be false, so layout manager caches can be retained.


paintControl

public void paintControl(org.eclipse.swt.events.PaintEvent pe)

getButton

private com.barteo.emulator.device.swt.SwtButton getButton(int x,
                                                           int y)

getButton

private com.barteo.emulator.device.swt.SwtButton getButton(org.eclipse.swt.events.KeyEvent ev)

createImage

public static org.eclipse.swt.graphics.Image createImage(int width,
                                                         int height)

createImage

public static org.eclipse.swt.graphics.Image createImage(java.io.InputStream is)

createImage

public static org.eclipse.swt.graphics.Image createImage(java.io.InputStream is,
                                                         ImageFilter filter)
                                                  throws java.io.IOException

createColor

public static org.eclipse.swt.graphics.Color createColor(org.eclipse.swt.graphics.RGB rgb)

getFont

public static org.eclipse.swt.graphics.Font getFont(java.lang.String name,
                                                    int size,
                                                    int style)

getFontMetrics

public static org.eclipse.swt.graphics.FontMetrics getFontMetrics(org.eclipse.swt.graphics.Font font)

stringWidth

public static int stringWidth(org.eclipse.swt.graphics.Font font,
                              java.lang.String str)