public class Caret extends Widget
IMPORTANT: This class is not intended to be subclassed.
Modifier and Type | Field and Description |
---|---|
(package private) Font |
font |
(package private) int |
height |
(package private) Image |
image |
(package private) boolean |
isVisible |
(package private) boolean |
moved |
(package private) LOGFONT |
oldFont |
(package private) Canvas |
parent |
(package private) boolean |
resized |
(package private) int |
width |
(package private) int |
x |
(package private) int |
y |
CANVAS, data, DEFAULT_HEIGHT, DEFAULT_WIDTH, DISABLED, display, DISPOSE_SENT, DISPOSED, DRAG_DETECT, DRAW_BACKGROUND, eventTable, FOREIGN_HANDLE, HIDDEN, IGNORE_WM_CHANGEUISTATE, KEYED_DATA, LAYOUT_CHANGED, LAYOUT_CHILD, LAYOUT_NEEDED, MAJOR, MINOR, MOVE_DEFERRED, MOVE_OCCURRED, PARENT_BACKGROUND, RELEASED, RESIZE_DEFERRED, RESIZE_OCCURRED, SKIN_NEEDED, state, style, THEME_BACKGROUND, TRACK_MOUSE
Constructor and Description |
---|
Caret(Canvas parent,
int style)
Constructs a new instance of this class given its parent
and a style value describing its behavior and appearance.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
createWidget() |
(package private) int |
defaultFont() |
Rectangle |
getBounds()
Returns a rectangle describing the receiver's size and location
relative to its parent (or its display if its parent is null).
|
Font |
getFont()
Returns the font that the receiver will use to paint textual information.
|
Image |
getImage()
Returns the image that the receiver will use to paint the caret.
|
Point |
getLocation()
Returns a point describing the receiver's location relative
to its parent (or its display if its parent is null).
|
Canvas |
getParent()
Returns the receiver's parent, which must be a
Canvas . |
Point |
getSize()
Returns a point describing the receiver's size.
|
boolean |
getVisible()
Returns
true if the receiver is visible, and
false otherwise. |
(package private) boolean |
hasFocus() |
(package private) boolean |
isFocusCaret() |
boolean |
isVisible()
Returns
true if the receiver is visible and all
of the receiver's ancestors are visible and false
otherwise. |
(package private) void |
killFocus() |
(package private) void |
move() |
(package private) void |
releaseParent() |
(package private) void |
releaseWidget() |
(package private) void |
resize() |
(package private) void |
resizeIME() |
(package private) void |
restoreIMEFont() |
void |
setBounds(int x,
int y,
int width,
int height)
Sets the receiver's size and location to the rectangular
area specified by the arguments.
|
void |
setBounds(Rectangle rect)
Sets the receiver's size and location to the rectangular
area specified by the argument.
|
(package private) void |
setFocus() |
void |
setFont(Font font)
Sets the font that the receiver will use to paint textual information
to the font specified by the argument, or to the default font for that
kind of control if the argument is null.
|
void |
setImage(Image image)
Sets the image that the receiver will use to paint the caret
to the image specified by the argument, or to the default
which is a filled rectangle if the argument is null
|
(package private) void |
setIMEFont() |
void |
setLocation(int x,
int y)
Sets the receiver's location to the point specified by
the arguments which are relative to the receiver's
parent (or its display if its parent is null).
|
void |
setLocation(Point location)
Sets the receiver's location to the point specified by
the argument which is relative to the receiver's
parent (or its display if its parent is null).
|
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 |
setVisible(boolean visible)
Marks the receiver as visible if the argument is
true ,
and marks it invisible otherwise. |
_addListener, addDisposeListener, addListener, callWindowProc, checkBits, checkOpened, checkOrientation, checkParent, checkSubclass, checkWidget, DeferWindowPos, destroyWidget, dispose, dragDetect, error, filters, findItem, fixMnemonic, fixMnemonic, getData, getData, getDisplay, getListeners, getMenu, getName, getNameText, getStyle, hooks, isDisposed, isListening, isValidSubclass, isValidThread, mapEvent, new_GC, notifyListeners, postEvent, postEvent, release, releaseChildren, releaseHandle, removeDisposeListener, removeListener, removeListener, reskin, reskinChildren, reskinWidget, sendDragEvent, sendDragEvent, sendEvent, sendEvent, sendEvent, sendEvent, sendFocusEvent, sendKeyEvent, sendKeyEvent, sendMouseEvent, sendMouseEvent, sendMouseWheelEvent, sendSelectionEvent, sendSelectionEvent, setData, setData, setInputState, setKeyState, setLocationMask, setTabGroupFocus, setTabItemFocus, SetWindowPos, showMenu, showMenu, toString, updateMenuLocation, wmCaptureChanged, wmChar, wmContextMenu, wmIMEChar, wmKeyDown, wmKeyUp, wmKillFocus, wmLButtonDblClk, wmLButtonDown, wmLButtonUp, wmMButtonDblClk, wmMButtonDown, wmMButtonUp, wmMouseHover, wmMouseHWheel, wmMouseLeave, wmMouseMove, wmMouseWheel, wmNCPaint, wmPaint, wmPrint, wmRButtonDblClk, wmRButtonDown, wmRButtonUp, wmSetFocus, wmSysChar, wmSysKeyDown, wmSysKeyUp, wmXButtonDblClk, wmXButtonDown, wmXButtonUp
Canvas parent
int x
int y
int width
int height
boolean moved
boolean resized
boolean isVisible
Image image
Font font
LOGFONT oldFont
public Caret(Canvas 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 composite control which will be the parent of the new instance (cannot be null)style
- the style of control to constructjava.lang.IllegalArgumentException
- SWTException
- SWT
,
Widget.checkSubclass()
,
Widget.getStyle()
void createWidget()
int defaultFont()
public Rectangle getBounds()
SWTException
- public Font getFont()
SWTException
- public Image getImage()
SWTException
- public Point getLocation()
SWTException
- public Canvas getParent()
Canvas
.SWTException
- public Point getSize()
SWTException
- public boolean getVisible()
true
if the receiver is visible, and
false
otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, this method may still indicate that it is considered visible even though it may not actually be showing.
SWTException
- boolean hasFocus()
boolean isFocusCaret()
public boolean isVisible()
true
if the receiver is visible and all
of the receiver's ancestors are visible and false
otherwise.SWTException
- getVisible()
void killFocus()
void move()
void resizeIME()
void releaseParent()
releaseParent
in class Widget
void releaseWidget()
releaseWidget
in class Widget
void resize()
void restoreIMEFont()
public void setBounds(int x, int y, int width, int height)
x
and
y
arguments are relative to the receiver's
parent (or its display if its parent is null).x
- the new x coordinate for the receivery
- the new y coordinate for the receiverwidth
- the new width for the receiverheight
- the new height for the receiverSWTException
- 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).rect
- the new bounds for the receiverSWTException
- void setFocus()
public void setFont(Font font)
font
- the new font (or null)java.lang.IllegalArgumentException
- SWTException
- public void setImage(Image image)
image
- the new image (or null)java.lang.IllegalArgumentException
- SWTException
- void setIMEFont()
public void setLocation(int x, int y)
x
- the new x coordinate for the receivery
- the new y coordinate for the receiverSWTException
- public void setLocation(Point location)
location
- the new location for the receiverSWTException
- public void setSize(int width, int height)
width
- the new width for the receiverheight
- the new height for the receiverSWTException
- public void setSize(Point size)
size
- the new extent for the receiverjava.lang.IllegalArgumentException
- SWTException
- public void setVisible(boolean visible)
true
,
and marks it invisible otherwise.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
visible
- the new visibility stateSWTException
-