|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WAbstractArea
public class WAbstractArea
Abstract base class for interactive areas in a widget.
Use an WAbstractArea (or rather, one of its concrete implementations), to
define interactivity that applies on a part of a WImage or
WPaintedWidget. The area may be defined using different shapes
through WRectArea, WCircleArea or WPolygonArea.
WImage.addArea(WAbstractArea area),
WPaintedWidget.addArea(WAbstractArea area)| Method Summary | |
|---|---|
void |
addStyleClass(java.lang.String styleClass,
boolean force)
Adds a style class. |
EventSignal1<WMouseEvent> |
clicked()
Event signal emitted when a mouse key was clicked on this widget. |
EventSignal1<WMouseEvent> |
doubleClicked()
Event signal emitted when a mouse key was double clicked on this widget. |
EventSignal |
enterPressed()
Event signal emitted when enter was pressed. |
EventSignal |
escapePressed()
Event signal emitted when escape was pressed. |
WString |
getAlternateText()
Returns the alternate text. |
Cursor |
getCursor()
Returns the cursor. |
WLink |
getLink()
Returns the link. |
java.lang.String |
getRef()
Deprecated. Use getLink() instead. |
WResource |
getResource()
Deprecated. Use getLink() instead. |
java.lang.String |
getStyleClass()
Returns the style class. |
AnchorTarget |
getTarget()
Returns the location where the referred content should be displayed. |
WString |
getToolTip()
Returns the tooltip text. |
boolean |
isHole()
Returns whether this area specifies a hole. |
EventSignal1<WKeyEvent> |
keyPressed()
Event signal emitted when a "character" was entered. |
EventSignal1<WKeyEvent> |
keyWentDown()
Event signal emitted when a keyboard key is pushed down. |
EventSignal1<WKeyEvent> |
keyWentUp()
Event signal emitted when a keyboard key is released. |
EventSignal1<WMouseEvent> |
mouseDragged()
Event signal emitted when the mouse is dragged over this widget. |
EventSignal1<WMouseEvent> |
mouseMoved()
Event signal emitted when the mouse moved over this widget. |
EventSignal1<WMouseEvent> |
mouseWentDown()
Event signal emitted when a mouse key was pushed down on this widget. |
EventSignal1<WMouseEvent> |
mouseWentOut()
Event signal emitted when the mouse went out of this widget. |
EventSignal1<WMouseEvent> |
mouseWentOver()
Event signal emitted when the mouse entered this widget. |
EventSignal1<WMouseEvent> |
mouseWentUp()
Event signal emitted when a mouse key was released on this widget. |
EventSignal1<WMouseEvent> |
mouseWheel()
Event signal emitted when the mouse scroll wheel was used. |
void |
removeStyleClass(java.lang.String styleClass,
boolean force)
Removes a style class. |
void |
setAlternateText(java.lang.CharSequence text)
Sets an alternate text. |
void |
setCursor(Cursor cursor)
Sets the cursor. |
void |
setHole(boolean hole)
Specifies that this area specifies a hole for another area. |
void |
setLink(WLink link)
Sets a link. |
void |
setRef(java.lang.String ref)
Deprecated. Use setLink()
instead. |
void |
setResource(WResource resource)
Deprecated. Use setLink()
instead. |
void |
setStyleClass(java.lang.String styleClass)
Defines a style class. |
void |
setTarget(AnchorTarget target)
Specifies the location where the referred content should be displayed. |
void |
setToolTip(java.lang.CharSequence text)
Sets the tooltip. |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getId, getObjectName, remove, setObjectName, tr |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void setHole(boolean hole)
When set to true, this area will define an area that does
not provide interactivity. When it preceeds other, overlapping, areas, it
acts as if it cuts a hole in those areas.
The default value is false.
isHole()public boolean isHole()
setHole(boolean hole)public void setLink(WLink link)
By setting a link, the area behaves like a WAnchor.
By default, no destination link is set.
Note: Even when no destination link is set, in some
circumstances, an identity URL ('#') will be linked to on the
underlying HTML <area> element (see also
setCursor()).
public WLink getLink()
setLink(WLink link)public void setRef(java.lang.String ref)
setLink()
instead.
By setting a destination URL, the area behaves like a WAnchor.
By default, no destination URL is set (ref = "").
This method should not be used when the area has been pointed to a
dynamically generated resource using
setResource().
Note: Even when no destination URL is set, in some
circumstances, a identity URL ('#') will be set on the
underlying HTML <area> element (see also
{@link WAbstractArea#setCursor(Cursor cursor) setCursor()}).
public java.lang.String getRef()
getLink() instead.
When the area refers to a resource, the current resource URL is returned.
setRef(String ref),
WResource.getUrl()public void setResource(WResource resource)
setLink()
instead.
A resource specifies application-dependent content, which may be generated by your application on demand.
By setting a resource, the area behaves like a WAnchor that links
to the resource resource. The resource may be cleared by
passing resource = null.
The area does not assume ownership of the resource.
setRef(String ref)public WResource getResource()
getLink() instead.
Returns null if no resource has been set.
setResource(WResource resource)public void setTarget(AnchorTarget target)
This configures the location where referred content should be displayed,
that was specified using setRef() or setResource().
By default, the reference is displayed in the application (
AnchorTarget.TargetSelf). When the destination is an HTML
document, the application is replaced with the new document. When the
reference is a document that cannot be displayed in the browser, it is
offered for download or opened using an external program, depending on
browser settings.
By setting target to AnchorTarget.TargetNewWindow,
the destination is displayed in a new browser window or tab.
setRef(String ref),
setResource(WResource resource),
getTarget()public AnchorTarget getTarget()
setTarget(AnchorTarget target)public void setAlternateText(java.lang.CharSequence text)
The alternate text should provide a fallback for browsers that do not display an image. If no sensible fallback text can be provided, an empty text is preferred over nonsense.
This should not be confused with getToolTip() text, which provides additional information that is
displayed when the mouse hovers over the area.
The default alternate text is an empty text ("").
getAlternateText()public WString getAlternateText()
setAlternateText(CharSequence text)public void setToolTip(java.lang.CharSequence text)
The tooltip is displayed when the cursor hovers over the area.
public WString getToolTip()
setToolTip(CharSequence text)public void setStyleClass(java.lang.String styleClass)
Note: Only few CSS declarations are known to affect the look of a image area, the most notable one being the 'cursor'. Other things will simply be ignored.
public java.lang.String getStyleClass()
setStyleClass(String styleClass)
public void addStyleClass(java.lang.String styleClass,
boolean force)
Note: Only few CSS declarations are known to affect the look of a image area, the most notable one being the 'cursor'. Other things will simply be ignored.
public void removeStyleClass(java.lang.String styleClass,
boolean force)
public void setCursor(Cursor cursor)
This sets the mouse cursor that is shown when the mouse pointer is over the area. Most browsers only support PointingHandCursor, which is activated by a non-empty ref.
setRef(String ref)public Cursor getCursor()
setCursor(Cursor cursor)public EventSignal1<WKeyEvent> keyWentDown()
The keyWentDown signal is the first signal emitted when a key is pressed
(before the keyPressed() signal).
Unlike keyPressed() however it is also
emitted for modifier keys (such as "shift",
"control", ...) or keyboard navigation keys that do not have a
corresponding character.
keyPressed(),
keyWentUp()public EventSignal1<WKeyEvent> keyPressed()
The keyPressed signal is emitted when a key is pressed, and a character
is entered. Unlike keyWentDown(), it
is emitted only for key presses that result in a character being entered,
and thus not for modifier keys or keyboard navigation keys.
keyWentDown()public EventSignal1<WKeyEvent> keyWentUp()
This is the counter-part of the keyWentDown() event. Every key-down has its corresponding key-up.
keyWentDown()public EventSignal enterPressed()
This signal is emitted when the Enter or Return key was pressed.
keyPressed(),
Key.Key_Enterpublic EventSignal escapePressed()
This signal is emitted when the Escape key was pressed.
keyPressed(),
Key.Key_Escapepublic EventSignal1<WMouseEvent> clicked()
The event details contains information such as the
button, optional
keyboard modifiers, and mouse
coordinates relative to the widget, the
window window, or the
document.
Note: When JavaScript is disabled, the event details contain invalid information.
public EventSignal1<WMouseEvent> doubleClicked()
The event details contains information such as the
button, optional
keyboard modifiers, and mouse
coordinates relative to the widget, the
window window, or the
document.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseWentDown()
The event details contains information such as the
button, optional
keyboard modifiers, and mouse
coordinates relative to the widget, the
window window, or the
document.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseWentUp()
The event details contains information such as the
button, optional
keyboard modifiers, and mouse
coordinates relative to the widget, the
window window, or the
document.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseWentOut()
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseWentOver()
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseMoved()
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseDragged()
The mouse event contains information on the button(s) currently pressed. If multiple buttons are currently pressed, only the button with smallest enum value is returned.
Note: When JavaScript is disabled, the signal will never fire.
public EventSignal1<WMouseEvent> mouseWheel()
The event details contains information such as the
wheel delta, optional
keyboard modifiers, and mouse
coordinates relative to the widget, the
window window, or the
document.
Note: When JavaScript is disabled, the signal will never fire.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||