|
Eclipse Platform 2.0 |
||||||||||
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.Tracker
Instances of this class implement rubber banding rectangles that are
drawn onto a parent Composite
or Display
.
These rectangles can be specified to respond to mouse and key events
by either moving or resizing themselves accordingly. Trackers are
typically used to represent window geometries in a lightweight manner.
Note: Rectangle move behavior is assumed unless RESIZE is specified.
IMPORTANT: This class is not intended to be subclassed.
Constructor Summary | |
Tracker(Composite parent,
int style)
Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
|
Tracker(Display display,
int style)
Constructs a new instance of this class given the display to create it on and a style value describing its behavior and appearance. |
Method Summary | |
void |
addControlListener(ControlListener listener)
Adds the listener to the collection of listeners who will be notified when the control is moved or resized, by sending it one of the messages defined in the ControlListener
interface. |
void |
close()
Stops displaying the tracker rectangles. |
Display |
getDisplay()
Returns the Display that is associated with
the receiver. |
Rectangle[] |
getRectangles()
Returns the bounds that are being drawn, expressed relative to the parent widget. |
boolean |
getStippled()
Returns true if the rectangles are drawn with a stippled line, false otherwise. |
boolean |
open()
Displays the Tracker rectangles for manipulation by the user. |
void |
removeControlListener(ControlListener listener)
Removes the listener from the collection of listeners who will be notified when the control is moved or resized. |
void |
setCursor(Cursor newCursor)
Sets the Cursor of the Tracker. |
void |
setRectangles(Rectangle[] rectangles)
Specifies the rectangles that should be drawn, expressed relative to the parent widget. |
void |
setStippled(boolean stippled)
Changes the appearance of the line used to draw the rectangles. |
Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkSubclass, checkWidget, dispose, getData, getData, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Tracker(Composite parent, int style)
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.
parent
- a widget which will be the parent of the new instance (cannot be null)style
- the style of widget to construct
IllegalArgumentException
- SWTException
- SWT.LEFT
,
SWT.RIGHT
,
SWT.UP
,
SWT.DOWN
,
SWT.RESIZE
,
Widget.checkSubclass()
,
Widget.getStyle()
public Tracker(Display display, int style)
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.
Note: Currently, null can be passed in for the display argument. This has the effect of creating the tracker on the currently active display if there is one. If there is no current display, the tracker is created on a "default" display. Passing in null as the display argument is not considered to be good coding style, and may not be supported in a future release of SWT.
display
- the display to create the tracker onstyle
- the style of control to construct
SWTException
- SWT.LEFT
,
SWT.RIGHT
,
SWT.UP
,
SWT.DOWN
Method Detail |
public void addControlListener(ControlListener listener)
ControlListener
interface.
listener
- the listener which should be notified
IllegalArgumentException
- SWTException
- ControlListener
,
removeControlListener(org.eclipse.swt.events.ControlListener)
public void close()
SWTException
- public Display getDisplay()
Widget
Display
that is associated with
the receiver.
A widget's display is either provided when it is created
(for example, top level Shell
s) or is the
same as its parent's display.
getDisplay
in class Widget
public Rectangle[] getRectangles()
Display
then these are screen
coordinates.
SWTException
- public boolean getStippled()
true
if the rectangles are drawn with a stippled line, false
otherwise.
SWTException
- public boolean open()
true
if the user did not cancel the Tracker, false
otherwise
SWTException
- public void removeControlListener(ControlListener listener)
listener
- the listener which should be notified
IllegalArgumentException
- SWTException
- ControlListener
,
addControlListener(org.eclipse.swt.events.ControlListener)
public void setCursor(Cursor newCursor)
Cursor
of the Tracker. If this cursor is null
then the cursor reverts to the default.
newCursor
- the new Cursor
to display
SWTException
- public void setRectangles(Rectangle[] rectangles)
rectangles
- the bounds of the rectangles to be drawn
SWTException
- public void setStippled(boolean stippled)
stippled
- true
if rectangle should appear stippled
SWTException
-
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |