|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.eclipse.swt.widgets.Widget
|
+--org.eclipse.swt.widgets.Control
| Field Summary |
| 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 | |
protected |
Control()
Prevents uninitialized instances from being created outside the package. |
| Method Summary | |
Point |
computeSize(int wHint,
int hHint)
Returns the preferred size of the receiver. |
Point |
computeSize(int wHint,
int hHint,
boolean changed)
Returns the preferred size of the receiver. |
Object |
getLayoutData()
Returns layout data which is associated with the receiver. |
boolean |
isFocusControl()
Returns true if the receiver has the user-interface
focus, and false otherwise. |
void |
pack()
Causes the receiver to be resized to its preferred size. |
void |
pack(boolean changed)
Causes the receiver to be resized to its preferred size. |
void |
setBackground(Color color)
Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null. |
void |
setBounds(Rectangle rect)
Sets the receiver's size and location to the rectangular area specified by the argument. |
boolean |
setFocus()
Set the input focus to the widget, and returns whether the focus change was successful. |
void |
setLayoutData(Object layoutData)
Sets the layout data associated with the receiver to the argument. |
void |
setSize(int width,
int height)
Sets the receiver's size to the point specified by the arguments. |
void |
setSize(Point size)
Sets the receiver's size to the point specified by the argument. |
void |
update()
Forces all outstanding paint requests for the widget to be processed before this method returns. |
| 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 class java.lang.Object |
equals, getClass, hashCode, toString |
| Methods inherited from interface org.eclipse.swt.graphics.Drawable |
drawLine, drawRect, drawText, setColor |
| Methods inherited from interface java.lang.Runnable |
run |
| Constructor Detail |
protected Control()
| Method Detail |
public Point computeSize(int wHint,
int hHint)
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.
wHint - the width hint (can be SWT.DEFAULT)hHint - the height hint (can be SWT.DEFAULT)
SWTException - Layout,
Widget.getBorderWidth(),
#getBounds,
#getSize,
pack(),
"computeTrim, getClientArea for controls that implement them"
public Point computeSize(int wHint,
int hHint,
boolean changed)
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.
computeSize in class WidgetwHint - the width hint (can be SWT.DEFAULT)hHint - the height hint (can be SWT.DEFAULT)changed - true if the control's contents have changed, and false otherwise
SWTException - Layout,
Widget.getBorderWidth(),
#getBounds,
#getSize,
pack(),
"computeTrim, getClientArea for controls that implement them"public Object getLayoutData()
SWTException - public boolean isFocusControl()
true if the receiver has the user-interface
focus, and false otherwise.
public void pack()
SWTException - computeSize(int, int)public void pack(boolean changed)
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.
SWTException - computeSize(int, int)public void setBackground(Color color)
color - the new color (or null)
IllegalArgumentException - SWTException - public void setBounds(Rectangle rect)
x and
y fields of the rectangle are relative to
the receiver's parent (or its display if its parent is null).
Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.
rect - the new bounds for the receiver
SWTException - public boolean setFocus()
public void setLayoutData(Object layoutData)
layoutData - the new layout data for the receiver.
SWTException - public void setSize(Point size)
Note: Attempting to set the width or height of the receiver to a negative number will cause them to be set to zero instead.
size - the new size for the receiver
IllegalArgumentException - SWTException -
public void setSize(int width,
int height)
Note: Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead.
width - the new width for the receiverheight - the new height for the receiver
SWTException - public void update()
SWTException -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||