public abstract class SVGButtonBase extends SVGWidget implements com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.dom.client.HasAllMouseHandlers, com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.dom.client.MouseUpHandler, com.google.gwt.event.dom.client.MouseOverHandler, com.google.gwt.event.dom.client.MouseOutHandler, com.google.gwt.event.dom.client.ClickHandler, ISVGStylable
SVG buttons consists in an SVG element and a collection of six predefined faces
Each face consists in a list of changes which are applied to the main SVG element (currently, CSS style changes but other changes are possible). You do not need to specify all faces for a button. In case a face is missing, the widget will attempt to use another face for the button.
Modifier and Type | Class and Description |
---|---|
static class |
SVGButtonBase.SVGFace
Class to represent an SVG button face.
|
static class |
SVGButtonBase.SVGFaceChange
Base class to represent the changes occurring
to an SVG button when it enters a new state.
|
static class |
SVGButtonBase.SVGFaceName
Enum to represent the possible states of an SVG button
|
static class |
SVGButtonBase.SVGStyleChange
Class to represent a style change as an SVG
button enters a new state.
|
Modifier and Type | Field and Description |
---|---|
protected SVGButtonBase.SVGFaceName |
currentFaceName
The name of the face currently displayed by this button
|
protected Map<SVGButtonBase.SVGFaceName,SVGButtonBase.SVGFace> |
faces
A map associating button face names to button faces
|
protected OMSVGSVGElement |
svgElement
The
OMSVGSVGElement representing
this button |
Modifier | Constructor and Description |
---|---|
protected |
SVGButtonBase()
No-arg constructor.
|
protected |
SVGButtonBase(OMSVGSVGElement svgElement,
Map<SVGButtonBase.SVGFaceName,SVGButtonBase.SVGFace> faces)
Constructor
|
protected |
SVGButtonBase(SVGResource resource,
Map<SVGButtonBase.SVGFaceName,SVGButtonBase.SVGFace> faces)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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) |
SVGButtonBase.SVGFace |
addFace(SVGButtonBase.SVGFaceName faceName,
SVGButtonBase.SVGFace face)
Adds a new faces to the button
|
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) |
OMSVGAnimatedString |
getClassName()
Returns the CSS class name of this element.
|
SVGButtonBase.SVGFaceName |
getCurrentFaceName()
Returns the name of the face currently displayed by this button
|
SVGButtonBase.SVGFace |
getFace(SVGButtonBase.SVGFaceName faceName)
Returns the face associated with a face name
|
OMSVGStyle |
getStyle()
Returns the CSS style of this element
|
OMSVGSVGElement |
getSvgElement()
Returns the SVG element defining the button
|
boolean |
isEnabled()
Returns true if this button is enabled, false otherwise
|
void |
onClick(com.google.gwt.event.dom.client.ClickEvent event) |
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 |
setEnabled(boolean enabled)
Sets whether this button is enabled
|
void |
setResource(SVGResource resource)
Sets the SVG resource defining the button
|
void |
setSvgElement(OMSVGSVGElement svgElement)
Sets the SVG element defining the button
|
void |
showFace(SVGButtonBase.SVGFaceName faceName)
Forces the button to display the specified face
|
getUiBinderField
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
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
protected OMSVGSVGElement svgElement
OMSVGSVGElement
representing
this buttonprotected SVGButtonBase.SVGFaceName currentFaceName
protected Map<SVGButtonBase.SVGFaceName,SVGButtonBase.SVGFace> faces
protected SVGButtonBase()
setResource(SVGResource)
or setSvgElement(OMSVGSVGElement)
before using the widget.protected SVGButtonBase(OMSVGSVGElement svgElement, Map<SVGButtonBase.SVGFaceName,SVGButtonBase.SVGFace> faces)
svgElement
- The SVG element defining the buttonfaces
- A collection of facesprotected SVGButtonBase(SVGResource resource, Map<SVGButtonBase.SVGFaceName,SVGButtonBase.SVGFace> faces)
resource
- An SVG resource to use for the SVG element defining the buttonfaces
- The SVG element defining the buttonpublic SVGButtonBase.SVGFace addFace(SVGButtonBase.SVGFaceName faceName, SVGButtonBase.SVGFace face)
faceName
- The face nameface
- The facepublic SVGButtonBase.SVGFace getFace(SVGButtonBase.SVGFaceName faceName)
faceName
- The face namepublic void setResource(SVGResource resource)
resource
- An SVG resourcepublic OMSVGSVGElement getSvgElement()
public void setSvgElement(OMSVGSVGElement svgElement)
svgElement
- the SVG element defining the buttonpublic SVGButtonBase.SVGFaceName getCurrentFaceName()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- true to enable the button, false to disable itpublic void showFace(SVGButtonBase.SVGFaceName faceName)
faceName
- The name of the face to displaypublic com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
addClickHandler
in interface com.google.gwt.event.dom.client.HasClickHandlers
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.HasMouseDownHandlers
public com.google.gwt.event.shared.HandlerRegistration addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler handler)
addMouseUpHandler
in interface com.google.gwt.event.dom.client.HasMouseUpHandlers
public com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler)
addMouseOutHandler
in interface com.google.gwt.event.dom.client.HasMouseOutHandlers
public com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler)
addMouseOverHandler
in interface com.google.gwt.event.dom.client.HasMouseOverHandlers
public com.google.gwt.event.shared.HandlerRegistration addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler handler)
addMouseMoveHandler
in interface com.google.gwt.event.dom.client.HasMouseMoveHandlers
public com.google.gwt.event.shared.HandlerRegistration addMouseWheelHandler(com.google.gwt.event.dom.client.MouseWheelHandler handler)
addMouseWheelHandler
in interface com.google.gwt.event.dom.client.HasMouseWheelHandlers
public OMSVGStyle getStyle()
ISVGStylable
getStyle
in interface ISVGStylable
public final OMSVGAnimatedString getClassName()
ISVGStylable
getClassName
in interface ISVGStylable
public final void addClassNameBaseVal(String className)
ISVGStylable
addClassNameBaseVal
in interface ISVGStylable
className
- the class name to addpublic final void removeClassNameBaseVal(String className)
ISVGStylable
removeClassNameBaseVal
in interface ISVGStylable
className
- the class name to removepublic final void replaceClassNameBaseVal(String oldClassName, String newClassName)
ISVGStylable
replaceClassNameBaseVal
in interface ISVGStylable
oldClassName
- the class name to replacenewClassName
- the replacement class namepublic final void setClassNameBaseVal(String className)
ISVGStylable
setClassNameBaseVal
in interface ISVGStylable
className
- the class namepublic void onClick(com.google.gwt.event.dom.client.ClickEvent event)
onClick
in interface com.google.gwt.event.dom.client.ClickHandler
Copyright © 2018. All Rights Reserved.