|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
org.vectomatic.dom.svg.ui.SVGWidget
org.vectomatic.dom.svg.ui.SVGImage
@ElementParserToUse(className="org.vectomatic.dev.svg.impl.gen.SVGImageParser") public class SVGImage
A widget which contains a single OMSVGSVGElement.
The class bridges event subscription methods and forwards
them to the underlying OMSVGSVGElement.
The class integrates with GWT Widget hierarchy.
You can define an SVGImage using UiBinder templates.
Depending on your needs, you can either define the SVG inline.
This can be convenient if you want to
localize the button label, or use styles defined in the template.
Or you can use an SVGResource with the resource attribute,
if your SVG is large or if you want to keep your template more readable.
The following section shows a sample UiBinder template. Notice
that you can bind tags inside the template to java variables. One
of the <g> tag is bound to a java variable
eyes of type OMSVGGElement
and one of the <path> tag is bound to a java variable
mouth of type OMSVGPathElement.
<svgui:SVGImage>
<svg width="100" height="100" viewBox="80 190 140 130" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<path d="m 208,146.86218 a 63,63.5 0 1 1 -126,0 63,63.5 0 1 1 126,0 z" style="fill:#ffff00;stroke:#000000;" transform="translate(3.9895924,108.83705)" />
<g ui:field="eyes" transform="translate(10.960155,103.59114)">
<path d="m 124,133.36218 c 0,4.97057 -4.02944,9 -9,9 -4.97056,0 -9,-4.02943 -9,-9 0,-4.97056 4.02944,-9 9,-9 4.97056,0 9,4.02944 9,9 z" class="{style.eye}" />
<path d="m 124,133.36218 c 0,4.97057 -4.02944,9 -9,9 -4.97056,0 -9,-4.02943 -9,-9 0,-4.97056 4.02944,-9 9,-9 4.97056,0 9,4.02944 9,9 z" class="{style.eye}" transform="translate(44,0)" />
</g>
<path ui:field="mouth" d="m 118.88908,286.15612 5,10 10,5 30,0 10,-5 5,-10 -5,5 -10,5 -30,0 -10,-5 -5,-5 z" class="{style.mouth}" />
</svg>
</svgui:SVGImage>
Note that by default SVGImages are validated against the SVG 1.1 XSD schema.
You can opt out of validation by setting the validated="false"
attribute on the SVGImages.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary | |
|---|---|
protected OMSVGSVGElement |
svgElement
|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
SVGImage()
No-arg constructor. |
|
SVGImage(OMSVGSVGElement svgElement)
|
|
SVGImage(SVGResource resource)
|
|
| Method Summary | |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addActivateHandler(ActivateHandler handler)
Adds a ActivateHandler handler. |
void |
addClassNameBaseVal(String className)
Adds the specified class name to the baseVal CSS class name of this element |
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addFocusInHandler(FocusInHandler handler)
Adds a FocusInHandler handler. |
com.google.gwt.event.shared.HandlerRegistration |
addFocusOutHandler(FocusOutHandler handler)
Adds a FocusOutHandler handler. |
com.google.gwt.event.shared.HandlerRegistration |
addLoadHandler(com.google.gwt.event.dom.client.LoadHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseWheelHandler(com.google.gwt.event.dom.client.MouseWheelHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addScrollHandler(com.google.gwt.event.dom.client.ScrollHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addSVGZoomHandler(SVGZoomHandler handler)
Adds a SVGZoomHandler handler. |
OMSVGAnimatedString |
getClassName()
Returns the CSS class name of this element. |
OMSVGStyle |
getStyle()
Returns the CSS style of this element |
OMSVGSVGElement |
getSvgElement()
|
void |
removeClassNameBaseVal(String className)
Removes the specified class name from the baseVal CSS class name of this element |
void |
replaceClassNameBaseVal(String oldClassName,
String newClassName)
Replaces the specified class name in the baseVal CSS class name of this element with a new class name |
void |
setClassNameBaseVal(String className)
Sets the baseVal CSS class name of this element to the specified value |
void |
setResource(SVGResource resource)
|
void |
setSvgElement(OMSVGSVGElement svgElement)
|
| Methods inherited from class org.vectomatic.dom.svg.ui.SVGWidget |
|---|
getUiBinderField |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Field Detail |
|---|
protected OMSVGSVGElement svgElement
| Constructor Detail |
|---|
public SVGImage()
setResource(SVGResource) or setSvgElement(OMSVGSVGElement)
before using the widget.
public SVGImage(SVGResource resource)
public SVGImage(OMSVGSVGElement svgElement)
| Method Detail |
|---|
public OMSVGSVGElement getSvgElement()
public void setResource(SVGResource resource)
public void setSvgElement(OMSVGSVGElement svgElement)
public com.google.gwt.event.shared.HandlerRegistration addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler handler)
addMouseDownHandler in interface com.google.gwt.event.dom.client.HasMouseDownHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler handler)
addMouseUpHandler in interface com.google.gwt.event.dom.client.HasMouseUpHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler)
addMouseOutHandler in interface com.google.gwt.event.dom.client.HasMouseOutHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler)
addMouseOverHandler in interface com.google.gwt.event.dom.client.HasMouseOverHandlerspublic com.google.gwt.event.shared.HandlerRegistration addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler handler)
addMouseMoveHandler in interface com.google.gwt.event.dom.client.HasMouseMoveHandlerspublic com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlerspublic com.google.gwt.event.shared.HandlerRegistration addLoadHandler(com.google.gwt.event.dom.client.LoadHandler handler)
addLoadHandler in interface com.google.gwt.event.dom.client.HasLoadHandlerspublic com.google.gwt.event.shared.HandlerRegistration addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler)
addResizeHandler in interface com.google.gwt.event.logical.shared.HasResizeHandlerspublic com.google.gwt.event.shared.HandlerRegistration addScrollHandler(com.google.gwt.event.dom.client.ScrollHandler handler)
addScrollHandler in interface com.google.gwt.event.dom.client.HasScrollHandlerspublic com.google.gwt.event.shared.HandlerRegistration addSVGZoomHandler(SVGZoomHandler handler)
HasSVGZoomHandlersSVGZoomHandler handler.
addSVGZoomHandler in interface HasSVGZoomHandlershandler - the zoom handler
HandlerRegistration used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addFocusInHandler(FocusInHandler handler)
HasFocusInHandlersFocusInHandler handler.
addFocusInHandler in interface HasFocusInHandlershandler - the focusin handler
HandlerRegistration used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addFocusOutHandler(FocusOutHandler handler)
HasFocusOutHandlersFocusOutHandler handler.
addFocusOutHandler in interface HasFocusOutHandlershandler - the focusout handler
HandlerRegistration used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addActivateHandler(ActivateHandler handler)
HasActivateHandlersActivateHandler handler.
addActivateHandler in interface HasActivateHandlershandler - the activate handler
HandlerRegistration used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addMouseWheelHandler(com.google.gwt.event.dom.client.MouseWheelHandler handler)
addMouseWheelHandler in interface com.google.gwt.event.dom.client.HasMouseWheelHandlerspublic OMSVGStyle getStyle()
ISVGStylable
getStyle in interface ISVGStylablepublic final OMSVGAnimatedString getClassName()
ISVGStylable
getClassName in interface ISVGStylablepublic final void addClassNameBaseVal(String className)
ISVGStylable
addClassNameBaseVal in interface ISVGStylableclassName - the class name to addpublic final void removeClassNameBaseVal(String className)
ISVGStylable
removeClassNameBaseVal in interface ISVGStylableclassName - the class name to remove
public final void replaceClassNameBaseVal(String oldClassName,
String newClassName)
ISVGStylable
replaceClassNameBaseVal in interface ISVGStylableoldClassName - the class name to replacenewClassName - the replacement class namepublic final void setClassNameBaseVal(String className)
ISVGStylable
setClassNameBaseVal in interface ISVGStylableclassName - the class name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||