org.eclipse.swt.widgets
Class Canvas
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:
- Drawable, Runnable
- 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.
- See Also:
Composite
| Fields inherited from class org.eclipse.swt.widgets.Widget |
h, INCMD_DISPOSE, INCMD_EXTKEY, INCMD_KEY, INCMD_LDOWN, INCMD_LUP, INCMD_MENU, INCMD_POS, UPDATEITEM_ENABLED, UPDATEITEM_NAME, w, x, y |
|
Constructor Summary |
Canvas(Composite parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
| Methods inherited from class org.eclipse.swt.widgets.Control |
computeSize, computeSize, getLayoutData, isFocusControl, pack, setBackground, setBounds, setFocus, setLayoutData, setSize, setSize, update |
| Methods inherited from class org.eclipse.swt.widgets.Widget |
addListener, dispose, focusState, getBorderWidth, getDisplayArea, getSelection, getStyle, getText, isDisposed, removeListener, setBounds, setCursor, stop |
| Methods inherited from interface java.lang.Runnable |
run |
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.
- 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
- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
- See Also:
SWT,
Widget#checkSubclass,
Widget.getStyle()