org.eclipse.swt.widgets .Widget org.eclipse.swt.widgets .Control org.eclipse.swt.widgets .Scrollable org.eclipse.swt.widgets .Composite org.eclipse.swt.widgets .Canvas All known Subclasses: org.eclipse.swt.custom .StyledText , org.eclipse.swt.custom .AnimatedProgress , org.eclipse.swt.widgets .Decorations , org.eclipse.swt.custom .TableCursor , org.eclipse.swt.custom .CLabel ,Canvas public class Canvas extends Composite (Code) Instances of this class provide a surface for drawing
arbitrary graphics.
Styles:
(none)
Events:
(none)
This class may be subclassed by custom control implementors
who are building controls that are not constructed
from aggregates of other controls. That is, they are either
painted using SWT graphics calls or are handled by native
methods.
See Also: Composite
Constructor Summary Canvas () Prevents uninitialized instances from being created outside the package.public Canvas (Composite parent, int style) Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
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.
Method Summary void clearArea (int x, int y, int width, int height) public Caret getCaret () Returns the caret.
The caret for the control is automatically hidden
and shown when the control is painted or resized,
when focus is gained or lost and when an the control
is scrolled.
protected voidreleaseWidget () public voidscroll (int destX, int destY, int x, int y, int width, int height, boolean all) Scrolls a rectangular area of the receiver by first copying
the source area to the destination and then causing the area
of the source which is not covered by the destination to
be repainted.public voidsetCaret (Caret caret) Sets the receiver's caret.
The caret for the control is automatically hidden
and shown when the control is painted or resized,
when focus is gained or lost and when an the control
is scrolled.
public voidsetFont (Font font)
Canvas Canvas() (Code) Prevents uninitialized instances from being created outside the package.
Canvas public Canvas(Composite parent, int style)(Code) Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
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. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
Parameters: parent - a composite control which will be the parent of the new instance (cannot be null)Parameters: style - the style of control to constructexception: IllegalArgumentException - ERROR_NULL_ARGUMENT - if the parent is null exception: SWTException - ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent See Also: SWT See Also: Widget.checkSubclass See Also: Widget.getStyle
clearArea void clearArea(int x, int y, int width, int height) (Code)
getCaret public Caret getCaret()(Code) Returns the caret.
The caret for the control is automatically hidden
and shown when the control is painted or resized,
when focus is gained or lost and when an the control
is scrolled. To avoid drawing on top of the caret,
the programmer must hide and show the caret when
drawing in the window any other time.
the caretexception: SWTException - ERROR_WIDGET_DISPOSED - if the receiver has been disposed ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
releaseWidget protected void releaseWidget()(Code)
scroll public void scroll(int destX, int destY, int x, int y, int width, int height, boolean all)(Code) Scrolls a rectangular area of the receiver by first copying
the source area to the destination and then causing the area
of the source which is not covered by the destination to
be repainted. Children that intersect the rectangle are
optionally moved during the operation. In addition, outstanding
paint events are flushed before the source area is copied to
ensure that the contents of the canvas are drawn correctly.
Parameters: destX - the x coordinate of the destinationParameters: destY - the y coordinate of the destinationParameters: x - the x coordinate of the sourceParameters: y - the y coordinate of the sourceParameters: width - the width of the areaParameters: height - the height of the areaParameters: all - true
if children should be scrolled, and false
otherwiseexception: SWTException - ERROR_WIDGET_DISPOSED - if the receiver has been disposed ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
setCaret public void setCaret(Caret caret)(Code) Sets the receiver's caret.
The caret for the control is automatically hidden
and shown when the control is painted or resized,
when focus is gained or lost and when an the control
is scrolled. To avoid drawing on top of the caret,
the programmer must hide and show the caret when
drawing in the window any other time.
Parameters: caret - the new caret for the receiver, may be nullexception: IllegalArgumentException - ERROR_INVALID_ARGUMENT - if the caret has been disposed exception: SWTException - ERROR_WIDGET_DISPOSED - if the receiver has been disposed ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
Methods inherited from org.eclipse.swt.widgets.Composite protected boolean SetWindowPos(Object hWnd, Object hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags)(Code) (Java Doc) protected Control [] _getChildren()(Code) (Java Doc) Control [] _getTabList()(Code) (Java Doc) public void changed(Control [] changed)(Code) (Java Doc) void checkBuffered()(Code) (Java Doc) protected void checkSubclass()(Code) (Java Doc) public Point computeSize(int wHint, int hHint, boolean changed)(Code) (Java Doc) Control [] computeTabList()(Code) (Java Doc) protected Element containerHandle()(Code) (Java Doc) protected void createHandle()(Code) (Java Doc) Menu [] findMenus(Control control)(Code) (Java Doc) void fixChildren(Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus)(Code) (Java Doc) void fixChildrenList(Control control)(Code) (Java Doc) void fixTabList(Control control)(Code) (Java Doc) public int getBorderWidth()(Code) (Java Doc) public Control [] getChildren()(Code) (Java Doc) int getChildrenCount()(Code) (Java Doc) public Layout getLayout()(Code) (Java Doc) public boolean getLayoutDeferred()(Code) (Java Doc) public Control [] getTabList()(Code) (Java Doc) boolean hooksKeys()(Code) (Java Doc) public boolean isLayoutDeferred()(Code) (Java Doc) public void layout()(Code) (Java Doc) public void layout(boolean changed)(Code) (Java Doc) public void layout(boolean changed, boolean all)(Code) (Java Doc) public void layout(Control [] changed)(Code) (Java Doc) void markLayout(boolean changed, boolean all)(Code) (Java Doc) Point minimumSize(int wHint, int hHint, boolean changed)(Code) (Java Doc) void releaseChildren()(Code) (Java Doc) protected void releaseWidget()(Code) (Java Doc) protected void removeControl(Control control)(Code) (Java Doc) void resizeChildren()(Code) (Java Doc) boolean resizeChildren(boolean defer, WINDOWPOS [] pwp)(Code) (Java Doc) boolean setFixedFocus()(Code) (Java Doc) public boolean setFocus()(Code) (Java Doc) public void setLayout(Layout layout)(Code) (Java Doc) public void setLayoutDeferred(boolean defer)(Code) (Java Doc) void setResizeChildren(boolean resize)(Code) (Java Doc) boolean setTabGroupFocus()(Code) (Java Doc) public void setTabList(Control [] tabList)(Code) (Java Doc) void updateLayout(boolean resize, boolean all)(Code) (Java Doc) protected void updateScrollBar(int cx, int cy)(Code) (Java Doc)
Methods inherited from org.eclipse.swt.widgets.Control public void addControlListener(ControlListener listener)(Code) (Java Doc) public void addFocusListener(FocusListener listener)(Code) (Java Doc) public void addHelpListener(HelpListener listener)(Code) (Java Doc) public void addKeyListener(KeyListener listener)(Code) (Java Doc) public void addMouseListener(MouseListener listener)(Code) (Java Doc) public void addMouseMoveListener(MouseMoveListener listener)(Code) (Java Doc) public void addMouseTrackListener(MouseTrackListener listener)(Code) (Java Doc) public void addPaintListener(PaintListener listener)(Code) (Java Doc) public void addTraverseListener(TraverseListener listener)(Code) (Java Doc) Element borderHandle()(Code) (Java Doc) void checkBorder()(Code) (Java Doc) void checkBuffered()(Code) (Java Doc) boolean checkHandle(Element hwnd)(Code) (Java Doc) void checkMirrored()(Code) (Java Doc) public Point computeSize(int wHint, int hHint)(Code) (Java Doc) public Point computeSize(int wHint, int hHint, boolean changed)(Code) (Java Doc) Control computeTabGroup()(Code) (Java Doc) Control [] computeTabList()(Code) (Java Doc) Control computeTabRoot()(Code) (Java Doc) void createHandle()(Code) (Java Doc) void createWidget()(Code) (Java Doc) void deregister()(Code) (Java Doc) void destroyWidget()(Code) (Java Doc) void enableWidget(boolean enabled)(Code) (Java Doc) int findBrush(int pixel)(Code) (Java Doc) Cursor findCursor()(Code) (Java Doc) Menu [] findMenus(Control control)(Code) (Java Doc) protected char findMnemonic(String string)(Code) (Java Doc) Control findThemeControl()(Code) (Java Doc) void fixChildren(Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus)(Code) (Java Doc) void fixFocus(Control focusControl)(Code) (Java Doc) Element fontHandle()(Code) (Java Doc) public boolean forceFocus()(Code) (Java Doc) protected void forceResize()(Code) (Java Doc) public Accessible getAccessible()(Code) (Java Doc) public Color getBackground()(Code) (Java Doc) public int getBorderWidth()(Code) (Java Doc) public Rectangle getBounds()(Code) (Java Doc) public boolean getEnabled()(Code) (Java Doc) public Font getFont()(Code) (Java Doc) public Color getForeground()(Code) (Java Doc) public Object getLayoutData()(Code) (Java Doc) public Point getLocation()(Code) (Java Doc) public Menu getMenu()(Code) (Java Doc) public Monitor getMonitor()(Code) (Java Doc) public Composite getParent()(Code) (Java Doc) Control [] getPath()(Code) (Java Doc) public Shell getShell()(Code) (Java Doc) public Point getSize()(Code) (Java Doc) public String getToolTipText()(Code) (Java Doc) public boolean getVisible()(Code) (Java Doc) boolean hasCursor()(Code) (Java Doc) boolean hasFocus()(Code) (Java Doc) public boolean isEnabled()(Code) (Java Doc) boolean isFocusAncestor(Control control)(Code) (Java Doc) public boolean isFocusControl()(Code) (Java Doc) public boolean isReparentable()(Code) (Java Doc) boolean isShowing()(Code) (Java Doc) boolean isTabGroup()(Code) (Java Doc) boolean isTabItem()(Code) (Java Doc) public boolean isVisible()(Code) (Java Doc) boolean j2sIsActive()(Code) (Java Doc) void mapEvent(Element hwnd, Event event)(Code) (Java Doc) void markLayout(boolean changed, boolean all)(Code) (Java Doc) Decorations menuShell()(Code) (Java Doc) boolean mnemonicHit(char key)(Code) (Java Doc) boolean mnemonicMatch(char key)(Code) (Java Doc) public void moveAbove(Control control)(Code) (Java Doc) public void moveBelow(Control control)(Code) (Java Doc) public void pack()(Code) (Java Doc) public void pack(boolean changed)(Code) (Java Doc) public void redraw()(Code) (Java Doc) public void redraw(int x, int y, int width, int height, boolean all)(Code) (Java Doc) void register()(Code) (Java Doc) protected void releaseChild()(Code) (Java Doc) protected void releaseHandle()(Code) (Java Doc) void releaseWidget()(Code) (Java Doc) public void removeControlListener(ControlListener listener)(Code) (Java Doc) public void removeFocusListener(FocusListener listener)(Code) (Java Doc) public void removeHelpListener(HelpListener listener)(Code) (Java Doc) public void removeKeyListener(KeyListener listener)(Code) (Java Doc) public void removeMouseListener(MouseListener listener)(Code) (Java Doc) public void removeMouseMoveListener(MouseMoveListener listener)(Code) (Java Doc) public void removeMouseTrackListener(MouseTrackListener listener)(Code) (Java Doc) public void removePaintListener(PaintListener listener)(Code) (Java Doc) public void removeTraverseListener(TraverseListener listener)(Code) (Java Doc) boolean sendFocusEvent(int type)(Code) (Java Doc) public void setBackground(Color color)(Code) (Java Doc) public void setBounds(int x, int y, int width, int height)(Code) (Java Doc) void setBounds(int x, int y, int width, int height, int flags)(Code) (Java Doc) void setBounds(int x, int y, int width, int height, int flags, boolean defer)(Code) (Java Doc) public void setBounds(Rectangle rect)(Code) (Java Doc) public void setCapture(boolean capture)(Code) (Java Doc) void setCursor()(Code) (Java Doc) public void setCursor(Cursor cursor)(Code) (Java Doc) void setDefaultFont()(Code) (Java Doc) public void setEnabled(boolean enabled)(Code) (Java Doc) boolean setFixedFocus()(Code) (Java Doc) public boolean setFocus()(Code) (Java Doc) public void setFont(Font font)(Code) (Java Doc) public void setForeground(Color color)(Code) (Java Doc) public void setLayoutData(Object layoutData)(Code) (Java Doc) public void setLocation(int x, int y)(Code) (Java Doc) public void setLocation(Point location)(Code) (Java Doc) public void setMenu(Menu menu)(Code) (Java Doc) public boolean setParent(Composite parent)(Code) (Java Doc) boolean setRadioFocus()(Code) (Java Doc) boolean setRadioSelection(boolean value)(Code) (Java Doc) public void setRedraw(boolean redraw)(Code) (Java Doc) boolean setSavedFocus()(Code) (Java Doc) public void setSize(int width, int height)(Code) (Java Doc) public void setSize(Point size)(Code) (Java Doc) boolean setTabGroupFocus()(Code) (Java Doc) boolean setTabItemFocus()(Code) (Java Doc) public void setToolTipText(String string)(Code) (Java Doc) public void setVisible(boolean visible)(Code) (Java Doc) void showWidget(boolean visible)(Code) (Java Doc) void sort(int[] items)(Code) (Java Doc) public Point toControl(int x, int y)(Code) (Java Doc) public Point toControl(Point point)(Code) (Java Doc) public Point toDisplay(int x, int y)(Code) (Java Doc) public Point toDisplay(Point point)(Code) (Java Doc) Element topHandle()(Code) (Java Doc) boolean traverse(Event event)(Code) (Java Doc) public boolean traverse(int traversal)(Code) (Java Doc) boolean traverseEscape()(Code) (Java Doc) boolean traverseGroup(boolean next)(Code) (Java Doc) boolean traverseItem(boolean next)(Code) (Java Doc) boolean traverseMnemonic(char key)(Code) (Java Doc) boolean traversePage(boolean next)(Code) (Java Doc) boolean traverseReturn()(Code) (Java Doc) public void update()(Code) (Java Doc) void update(boolean all)(Code) (Java Doc) boolean updateFont(Font oldFont, Font newFont)(Code) (Java Doc) void updateLayout(boolean resize, boolean all)(Code) (Java Doc) Element widgetParent()(Code) (Java Doc)
Methods inherited from org.eclipse.swt.widgets.Widget boolean SetWindowPos(Object hWnd, Object hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags)(Code) (Java Doc) protected void _updateOrientation()(Code) (Java Doc) public void addDisposeListener(DisposeListener listener)(Code) (Java Doc) public void addListener(int eventType, Listener listener)(Code) (Java Doc) int callWindowProc(int hwnd, int msg, int wParam, int lParam)(Code) (Java Doc) protected static int checkBits(int style, int int0, int int1, int int2, int int3, int int4, int int5)(Code) (Java Doc) void checkHookType(int eventType)(Code) (Java Doc) void checkOpened()(Code) (Java Doc) void checkOrientation(Widget parent)(Code) (Java Doc) void checkParent(Widget parent)(Code) (Java Doc) protected void checkSubclass()(Code) (Java Doc) protected void checkWidget()(Code) (Java Doc) void destroyWidget()(Code) (Java Doc) public void dispose()(Code) (Java Doc) protected void error(int code)(Code) (Java Doc) boolean filters(int eventType)(Code) (Java Doc) Widget findItem(int id)(Code) (Java Doc) char[] fixMnemonic(String string)(Code) (Java Doc) public Object getData()(Code) (Java Doc) public Object getData(String key)(Code) (Java Doc) public Display getDisplay()(Code) (Java Doc) Menu getMenu()(Code) (Java Doc) String getName()(Code) (Java Doc) String getNameText()(Code) (Java Doc) public int getStyle()(Code) (Java Doc) void hookArm()(Code) (Java Doc) void hookFocusIn()(Code) (Java Doc) void hookFocusOut()(Code) (Java Doc) void hookHelp()(Code) (Java Doc) void hookKeyDown()(Code) (Java Doc) void hookKeyUp()(Code) (Java Doc) void hookMenuDetect()(Code) (Java Doc) void hookModify()(Code) (Java Doc) void hookMouseDoubleClick()(Code) (Java Doc) void hookMouseDown()(Code) (Java Doc) void hookMouseEnter()(Code) (Java Doc) void hookMouseExit()(Code) (Java Doc) void hookMouseMove()(Code) (Java Doc) void hookMouseUp()(Code) (Java Doc) void hookMouseWheel()(Code) (Java Doc) void hookSelection()(Code) (Java Doc) void hookTraverse()(Code) (Java Doc) boolean hooks(int eventType)(Code) (Java Doc) public boolean isDisposed()(Code) (Java Doc) public boolean isListening(int eventType)(Code) (Java Doc) protected boolean isValidSubclass()(Code) (Java Doc) boolean isValidThread()(Code) (Java Doc) void mapEvent(int hwnd, Event event)(Code) (Java Doc) boolean mouseHoverProc(boolean clear)(Code) (Java Doc) public void notifyListeners(int eventType, Event event)(Code) (Java Doc) void postEvent(int eventType)(Code) (Java Doc) void postEvent(int eventType, Event event)(Code) (Java Doc) protected void releaseChild()(Code) (Java Doc) protected void releaseHandle()(Code) (Java Doc) public void releaseResources()(Code) (Java Doc) void releaseWidget()(Code) (Java Doc) public void removeDisposeListener(DisposeListener listener)(Code) (Java Doc) public void removeListener(int eventType, Listener listener)(Code) (Java Doc) protected void removeListener(int eventType, SWTEventListener listener)(Code) (Java Doc) void sendEvent(Event event)(Code) (Java Doc) void sendEvent(int eventType)(Code) (Java Doc) protected void sendEvent(int eventType, Event event)(Code) (Java Doc) void sendEvent(int eventType, Event event, boolean send)(Code) (Java Doc) boolean sendFocusEvent(int type)(Code) (Java Doc) boolean sendKeyEvent(int type, int msg, int wParam, int lParam)(Code) (Java Doc) boolean sendKeyEvent(int type, int msg, int wParam, int lParam, Event event)(Code) (Java Doc) boolean sendMouseEvent(int type, int button, Object hwnd, int x, int y)(Code) (Java Doc) boolean sendMouseEvent(int type, int button, int count, int detail, boolean send, Object hwnd, int x, int y)(Code) (Java Doc) public void setData(Object data)(Code) (Java Doc) public void setData(String key, Object value)(Code) (Java Doc) boolean showMenu(int x, int y)(Code) (Java Doc) public String toString()(Code) (Java Doc)