java.lang.Object
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 Implemented Interfaces:
- org.eclipse.swt.graphics.Drawable
- Direct Known Subclasses:
- Decorations
- public class Canvas
- extends Composite
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.
| Fields inherited from class org.eclipse.swt.widgets.Control |
accessible, cursor, drawCount, enableWindow, fixedHandle, font, layoutData, menu, parent, redrawWindow, toolTipText |
| Fields inherited from class org.eclipse.swt.widgets.Widget |
ACTIVATE, BUTTON_PRESS_EVENT, BUTTON_RELEASE_EVENT, CANVAS, CHANGED, CLICKED, COMMIT, CONFIGURE_EVENT, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DELETE_EVENT, DELETE_RANGE, DELETE_TEXT, DISABLED, display, DISPOSED, ENTER_NOTIFY_EVENT, EVENT, EVENT_AFTER, eventTable, EXPOSE_EVENT, FOCUS, FOCUS_IN_EVENT, FOCUS_OUT_EVENT, handle, HANDLE, HIDE, INSERT_TEXT, KEY_PRESS_EVENT, KEY_RELEASE_EVENT, KEYED_DATA, LEAVE_NOTIFY_EVENT, MAP_EVENT, MENU, MNEMONIC_ACTIVATE, MOTION_NOTIFY_EVENT, OBSCURED, POPUP_MENU, PREEDIT_CHANGED, REALIZE, ROW_ACTIVATED, SCROLL_CHILD, SELECT, SHOW, SHOW_HELP, SIZE_ALLOCATE, state, style, STYLE_SET, SWITCH_PAGE, TEST_COLLAPSE_ROW, TEST_EXPAND_ROW, TOGGLED, UNMAP_EVENT, UNREALIZE, VALUE_CHANGED, VISIBILITY_NOTIFY_EVENT, WINDOW_STATE_EVENT |
|
Constructor Summary |
(package private) |
Canvas()
|
|
Canvas(Composite parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance. |
|
Method Summary |
Caret |
getCaret()
Returns the caret. |
(package private) org.eclipse.swt.graphics.Point |
getIMCaretPos()
|
(package private) long |
gtk_expose_event(long widget,
long event)
|
(package private) long |
gtk_focus_in_event(long widget,
long event)
|
(package private) long |
gtk_focus_out_event(long widget,
long event)
|
(package private) void |
redrawWidget(int x,
int y,
int width,
int height,
boolean all)
|
(package private) void |
releaseWidget()
|
void |
scroll(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. |
(package private) boolean |
setBounds(int x,
int y,
int width,
int height,
boolean move,
boolean resize)
|
void |
setCaret(Caret caret)
Sets the receiver's caret. |
void |
setFont(org.eclipse.swt.graphics.Font font)
Sets the font that the receiver will use to paint textual information
to the font specified by the argument, or to the default font for that
kind of control if the argument is null. |
(package private) void |
updateCaret()
|
| Methods inherited from class org.eclipse.swt.widgets.Composite |
_getChildren, _getTabList, checkSubclass, computeSize, computeTabList, createHandle, createHandle, deregister, enableWidget, findMenus, fixChildren, fixTabList, focusHandle, forceFocus, getChildren, getChildrenCount, getLayout, getTabList, gtk_button_press_event, gtk_focus, gtk_key_press_event, gtk_realize, gtk_scroll_child, gtk_style_set, hasBorder, hookEvents, hooksKeys, imHandle, isTabGroup, layout, layout, minimumSize, moveAbove, moveBelow, parentingHandle, register, releaseChildren, removeControl, resizeHandle, setFocus, setLayout, setTabGroupFocus, setTabItemFocus, setTabList, translateMnemonic, translateTraversal, traversalCode |
| Methods inherited from class org.eclipse.swt.widgets.Scrollable |
clientHandle, computeTrim, createScrollBar, createWidget, getBorderWidth, getClientArea, getHorizontalBar, getVerticalBar, hScrollBarWidth, releaseHandle, setOrientation, topHandle, vScrollBarWidth |
| Methods inherited from class org.eclipse.swt.widgets.Control |
_getShell, addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeNativeSize, computeSize, computeTabGroup, computeTabRoot, defaultFont, drawGripper, eventHandle, filterKey, fixFocus, fontHandle, forceFocus, getAccessible, getBackground, getBackgroundColor, getBaseColor, getBgColor, getBounds, getEnabled, getFgColor, getFont, getFontDescription, getForeground, getForegroundColor, getLayoutData, getLocation, getMenu, getMonitor, getParent, getPath, getShell, getSize, getTextColor, getToolTipText, getVisible, gtk_button_release_event, gtk_commit, gtk_enter_notify_event, gtk_event_after, gtk_key_release_event, gtk_leave_notify_event, gtk_mnemonic_activate, gtk_motion_notify_event, gtk_popup_menu, gtk_preedit_changed, gtk_show_help, gtk_unrealize, gtk_visibility_notify_event, hasFocus, hoverProc, internal_dispose_GC, internal_new_GC, isEnabled, isFocusAncestor, isFocusControl, isReparentable, isShowing, isTabItem, isVisible, menuShell, mnemonicHit, mnemonicMatch, moveAbove, moveBelow, moveHandle, pack, pack, paintHandle, paintWindow, redraw, redraw, releaseChild, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, sendFocusEvent, sendHelpEvent, sendIMKeyEvent, sendKeyEvent, sendMouseEvent, setBackground, setBackgroundColor, setBackgroundColor, setBounds, setBounds, setCapture, setCursor, setCursor, setEnabled, setFontDescription, setForeground, setForegroundColor, setInitialSize, setLayoutData, setLocation, setLocation, setMenu, setParent, setRadioSelection, setRedraw, setSize, setSize, setToolTipText, setVisible, setZOrder, setZOrder, showMenu, sort, toControl, toControl, toDisplay, toDisplay, translateMnemonic, traverse, traverse, traverseEscape, traverseGroup, traverseItem, traverseMnemonic, traversePage, traverseReturn, update, update |
| Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkBits, checkOrientation, checkParent, checkWidget, destroyWidget, dispose, error, filterProc, filters, fixMnemonic, fontHeight, getData, getData, getDisplay, getName, getNameText, getStyle, gtk_activate, gtk_changed, gtk_clicked, gtk_configure_event, gtk_delete_event, gtk_delete_range, gtk_delete_text, gtk_event, gtk_hide, gtk_insert_text, gtk_map_event, gtk_row_activated, gtk_select, gtk_show, gtk_size_allocate, gtk_switch_page, gtk_test_collapse_row, gtk_test_expand_row, gtk_timer, gtk_toggled, gtk_unmap_event, gtk_value_changed, gtk_window_state_event, hooks, isDisposed, isListening, isValidSubclass, isValidThread, isValidWidget, menuPositionProc, mnemonicHit, mnemonicMatch, notifyListeners, pixbufCellDataProc, postEvent, postEvent, releaseResources, removeDisposeListener, removeListener, removeListener, sendEvent, sendEvent, sendEvent, sendEvent, setData, setData, setInputState, setKeyState, shellMapProc, textCellDataProc, timerProc, toString, translateTraversal, treeSelectionProc, windowProc, windowProc, windowProc, windowProc |
caret
Caret caret
Canvas
Canvas()
Canvas
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. The class description
lists the style constants that are applicable to the class.
Style bits are also inherited from superclasses.
getCaret
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. To avoid drawing on top of the caret,
the programmer must hide and show the caret when
drawing in the window any other time.
getIMCaretPos
org.eclipse.swt.graphics.Point getIMCaretPos()
- Overrides:
getIMCaretPos in class Control
gtk_expose_event
long gtk_expose_event(long widget,
long event)
- Overrides:
gtk_expose_event in class Composite
gtk_focus_in_event
long gtk_focus_in_event(long widget,
long event)
- Overrides:
gtk_focus_in_event in class Composite
gtk_focus_out_event
long gtk_focus_out_event(long widget,
long event)
- Overrides:
gtk_focus_out_event in class Composite
redrawWidget
void redrawWidget(int x,
int y,
int width,
int height,
boolean all)
- Overrides:
redrawWidget in class Control
releaseWidget
void releaseWidget()
- Overrides:
releaseWidget in class Composite
scroll
public void scroll(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. 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.
setBounds
boolean setBounds(int x,
int y,
int width,
int height,
boolean move,
boolean resize)
- Overrides:
setBounds in class Composite
setCaret
public void setCaret(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. To avoid drawing on top of the caret,
the programmer must hide and show the caret when
drawing in the window any other time.
setFont
public void setFont(org.eclipse.swt.graphics.Font font)
- Description copied from class:
Control
- Sets the font that the receiver will use to paint textual information
to the font specified by the argument, or to the default font for that
kind of control if the argument is null.
- Overrides:
setFont in class Control
updateCaret
void updateCaret()