@ElementParserToUse(className="org.vectomatic.dev.svg.impl.gen.SVGImageParser") public class SVGImage extends SVGWidget implements HasGraphicalHandlers, com.google.gwt.event.dom.client.HasAllMouseHandlers, HasDocumentHandlers, ISVGStylable
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.| Modifier and Type | Field and Description |
|---|---|
protected OMSVGSVGElement |
svgElement |
| Constructor and Description |
|---|
SVGImage()
No-arg constructor.
|
SVGImage(OMSVGSVGElement svgElement) |
SVGImage(SVGResource resource) |
| Modifier and Type | Method and Description |
|---|---|
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 |
addDragEndHandler(com.google.gwt.event.dom.client.DragEndHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragEnterHandler(com.google.gwt.event.dom.client.DragEnterHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragHandler(com.google.gwt.event.dom.client.DragHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragLeaveHandler(com.google.gwt.event.dom.client.DragLeaveHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragOverHandler(com.google.gwt.event.dom.client.DragOverHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDragStartHandler(com.google.gwt.event.dom.client.DragStartHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addDropHandler(com.google.gwt.event.dom.client.DropHandler 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. |
com.google.gwt.event.shared.HandlerRegistration |
addTouchCancelHandler(com.google.gwt.event.dom.client.TouchCancelHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addTouchEndHandler(com.google.gwt.event.dom.client.TouchEndHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addTouchMoveHandler(com.google.gwt.event.dom.client.TouchMoveHandler handler) |
com.google.gwt.event.shared.HandlerRegistration |
addTouchStartHandler(com.google.gwt.event.dom.client.TouchStartHandler 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) |
getUiBinderFieldaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringprotected OMSVGSVGElement svgElement
public SVGImage()
setResource(SVGResource) or setSvgElement(OMSVGSVGElement)
before using the widget.public SVGImage(SVGResource resource)
public SVGImage(OMSVGSVGElement svgElement)
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 final com.google.gwt.event.shared.HandlerRegistration addTouchCancelHandler(com.google.gwt.event.dom.client.TouchCancelHandler handler)
addTouchCancelHandler in interface com.google.gwt.event.dom.client.HasTouchCancelHandlerspublic final com.google.gwt.event.shared.HandlerRegistration addTouchEndHandler(com.google.gwt.event.dom.client.TouchEndHandler handler)
addTouchEndHandler in interface com.google.gwt.event.dom.client.HasTouchEndHandlerspublic final com.google.gwt.event.shared.HandlerRegistration addTouchMoveHandler(com.google.gwt.event.dom.client.TouchMoveHandler handler)
addTouchMoveHandler in interface com.google.gwt.event.dom.client.HasTouchMoveHandlerspublic final com.google.gwt.event.shared.HandlerRegistration addTouchStartHandler(com.google.gwt.event.dom.client.TouchStartHandler handler)
addTouchStartHandler in interface com.google.gwt.event.dom.client.HasTouchStartHandlerspublic final com.google.gwt.event.shared.HandlerRegistration addDragEndHandler(com.google.gwt.event.dom.client.DragEndHandler handler)
addDragEndHandler in interface com.google.gwt.event.dom.client.HasDragEndHandlerspublic final com.google.gwt.event.shared.HandlerRegistration addDragEnterHandler(com.google.gwt.event.dom.client.DragEnterHandler handler)
addDragEnterHandler in interface com.google.gwt.event.dom.client.HasDragEnterHandlerspublic final com.google.gwt.event.shared.HandlerRegistration addDragHandler(com.google.gwt.event.dom.client.DragHandler handler)
addDragHandler in interface com.google.gwt.event.dom.client.HasDragHandlerspublic final com.google.gwt.event.shared.HandlerRegistration addDragLeaveHandler(com.google.gwt.event.dom.client.DragLeaveHandler handler)
addDragLeaveHandler in interface com.google.gwt.event.dom.client.HasDragLeaveHandlerspublic final com.google.gwt.event.shared.HandlerRegistration addDragOverHandler(com.google.gwt.event.dom.client.DragOverHandler handler)
addDragOverHandler in interface com.google.gwt.event.dom.client.HasDragOverHandlerspublic final com.google.gwt.event.shared.HandlerRegistration addDragStartHandler(com.google.gwt.event.dom.client.DragStartHandler handler)
addDragStartHandler in interface com.google.gwt.event.dom.client.HasDragStartHandlerspublic final com.google.gwt.event.shared.HandlerRegistration addDropHandler(com.google.gwt.event.dom.client.DropHandler handler)
addDropHandler in interface com.google.gwt.event.dom.client.HasDropHandlerspublic 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 handlerHandlerRegistration used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addFocusInHandler(FocusInHandler handler)
HasFocusInHandlersFocusInHandler handler.addFocusInHandler in interface HasFocusInHandlershandler - the focusin handlerHandlerRegistration used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addFocusOutHandler(FocusOutHandler handler)
HasFocusOutHandlersFocusOutHandler handler.addFocusOutHandler in interface HasFocusOutHandlershandler - the focusout handlerHandlerRegistration used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addActivateHandler(ActivateHandler handler)
HasActivateHandlersActivateHandler handler.addActivateHandler in interface HasActivateHandlershandler - the activate handlerHandlerRegistration 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()
ISVGStylablegetStyle in interface ISVGStylablepublic final OMSVGAnimatedString getClassName()
ISVGStylablegetClassName in interface ISVGStylablepublic final void addClassNameBaseVal(String className)
ISVGStylableaddClassNameBaseVal in interface ISVGStylableclassName - the class name to addpublic final void removeClassNameBaseVal(String className)
ISVGStylableremoveClassNameBaseVal in interface ISVGStylableclassName - the class name to removepublic final void replaceClassNameBaseVal(String oldClassName, String newClassName)
ISVGStylablereplaceClassNameBaseVal in interface ISVGStylableoldClassName - the class name to replacenewClassName - the replacement class namepublic final void setClassNameBaseVal(String className)
ISVGStylablesetClassNameBaseVal in interface ISVGStylableclassName - the class nameCopyright © 2018. All Rights Reserved.