Class Tracker
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.
 - Styles:
- LEFT, RIGHT, UP, DOWN, RESIZE
- Events:
- Move, Resize
Note: Rectangle move behavior is assumed unless RESIZE is specified.
IMPORTANT: This class is not intended to be subclassed.
- See Also:
- Restriction:
- This class is not intended to be subclassed by clients.
- 
Field SummaryFields inherited from class org.eclipse.swt.widgets.WidgetnativeZoom
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new instance of this class given its parent and a style value describing its behavior and appearance.Constructs a new instance of this class given the display to create it on and a style value describing its behavior and appearance.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddControlListener(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 theControlListenerinterface.voidaddKeyListener(KeyListener listener) Adds the listener to the collection of listeners who will be notified when keys are pressed and released on the system keyboard, by sending it one of the messages defined in theKeyListenerinterface.voidclose()Stops displaying the tracker rectangles.Returns the bounds that are being drawn, expressed relative to the parent widget.booleanReturnstrueif the rectangles are drawn with a stippled line,falseotherwise.booleanopen()Displays the Tracker rectangles for manipulation by the user.voidremoveControlListener(ControlListener listener) Removes the listener from the collection of listeners who will be notified when the control is moved or resized.voidremoveKeyListener(KeyListener listener) Removes the listener from the collection of listeners who will be notified when keys are pressed and released on the system keyboard.voidSets theCursorof the Tracker.voidsetRectangles(Rectangle[] rectangles) Specifies the rectangles that should be drawn, expressed relative to the parent widget.voidsetStippled(boolean stippled) Changes the appearance of the line used to draw the rectangles.Methods inherited from class org.eclipse.swt.widgets.WidgetaddDisposeListener, addListener, addTypedListener, checkSubclass, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setData, toString
- 
Constructor Details- 
TrackerConstructs 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 widget which will be the parent of the new instance (cannot be null)
- style- the style of widget 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:
 
- 
TrackerConstructs a new instance of this class given the display to create it on 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.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. - Parameters:
- display- the display to create the tracker on
- style- the style of control to construct
- Throws:
- 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:
 
 
- 
- 
Method Details- 
addControlListenerAdds 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 theControlListenerinterface.- 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
 
- See Also:
 
- 
addKeyListenerAdds the listener to the collection of listeners who will be notified when keys are pressed and released on the system keyboard, by sending it one of the messages defined in theKeyListenerinterface.- 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
 
- See Also:
 
- 
closepublic void close()Stops displaying the tracker rectangles. Note that this is not considered to be a cancelation by the user.- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
getRectanglesReturns the bounds that are being drawn, expressed relative to the parent widget. If the parent is aDisplaythen these are screen coordinates.- Returns:
- the bounds of the Rectangles being drawn
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
getStippledpublic boolean getStippled()Returnstrueif the rectangles are drawn with a stippled line,falseotherwise.- Returns:
- the stippled effect of the rectangles
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
openpublic boolean open()Displays the Tracker rectangles for manipulation by the user. Returns when the user has either finished manipulating the rectangles or has cancelled the Tracker.- Returns:
- trueif the user did not cancel the Tracker,- falseotherwise
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
removeControlListenerRemoves the listener from the collection of listeners who will be notified when the control is moved or resized.- 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
 
- See Also:
 
- 
removeKeyListenerRemoves the listener from the collection of listeners who will be notified when keys are pressed and released on the system keyboard.- 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
 
- See Also:
 
- 
setCursorSets theCursorof the Tracker. If this cursor isnullthen the cursor reverts to the default.- Parameters:
- newCursor- the new- Cursorto display
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setRectanglesSpecifies the rectangles that should be drawn, expressed relative to the parent widget. If the parent is a Display then these are screen coordinates.- Parameters:
- rectangles- the bounds of the rectangles to be drawn
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the set of rectangles is null or contains a null rectangle
 
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setStippledpublic void setStippled(boolean stippled) Changes the appearance of the line used to draw the rectangles.- Parameters:
- stippled-- trueif rectangle should appear stippled
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
 
-