Class Canvas
- Direct Known Subclasses:
- CLabel,- Decorations,- FileUpload
- 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.
- Since:
- 1.0
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddPaintListener(PaintListener listener) Adds the listener to the collection of listeners who will be notified when the receiver needs to be painted, by sending it one of the messages defined in thePaintListenerinterface.<T> TgetAdapter(Class<T> adapter) Implementation of theAdaptableinterface.voidremovePaintListener(PaintListener listener) Removes the listener from the collection of listeners who will be notified when the receiver needs to be painted.Methods inherited from class org.eclipse.swt.widgets.Compositechanged, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabListMethods inherited from class org.eclipse.swt.widgets.ScrollablecomputeTrim, getClientArea, getHorizontalBar, getVerticalBarMethods inherited from class org.eclipse.swt.widgets.ControladdControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addTouchListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCursor, setData, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, updateMethods inherited from class org.eclipse.swt.widgets.WidgetaddDisposeListener, addListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, toString
- 
Constructor Details- 
CanvasConstructs 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 SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle 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)
- style- the style of control to construct
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
 
- SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
 
- See Also:
 
 
- 
- 
Method Details- 
getAdapterDescription copied from class:WidgetImplementation of theAdaptableinterface.IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code. - Specified by:
- getAdapterin interface- Adaptable
- Overrides:
- getAdapterin class- Composite
- Parameters:
- adapter- the lookup class
- Returns:
- an object that can be cast to the given class or nullif there is no adapter associated with the given class.
 
- 
addPaintListenerAdds the listener to the collection of listeners who will be notified when the receiver needs to be painted, by sending it one of the messages defined in thePaintListenerinterface.- Parameters:
- listener- the listener which should be notified
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
- Since:
- 1.3
- See Also:
 
- 
removePaintListenerRemoves the listener from the collection of listeners who will be notified when the receiver needs to be painted.- Parameters:
- listener- the listener which should no longer be notified
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the listener is null
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
- Since:
- 1.3
- See Also:
 
 
-