public class SignatureFieldExtension
extends com.vaadin.server.AbstractJavaScriptExtension
SignatureField with the
client-side logic.
signature_pad
by Szymon Nowak (szimek) is used to
capture the signature at the client-side.| Modifier and Type | Class and Description |
|---|---|
static class |
SignatureFieldExtension.SignatureChangeEvent
A signature change event
|
static interface |
SignatureFieldExtension.SignatureChangeListener
Listener that gets called when the signature changes
|
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener| Constructor and Description |
|---|
SignatureFieldExtension(SignatureField target) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSignatureChangeListener(SignatureFieldExtension.SignatureChangeListener listener)
|
void |
beforeClientResponse(boolean initial) |
void |
clear()
Clears the field on the client-side
|
void |
fireSignatureChangeEvent(String signature)
Fires a new
SignatureFieldExtension.SignatureChangeEvent with the given Signature. |
String |
getBackgroundColor()
Gets the color used to clear the background.
|
Double |
getDotSize()
Gets the radius of a single dot.
|
boolean |
getImmediate()
Returns true if the extension is immediate.
|
double |
getMaxWidth()
Gets the maximum width of a line.
|
MimeType |
getMimeType()
Sets the
MimeType of generated images |
double |
getMinWidth()
Gets the minimum width of a line.
|
String |
getPenColor()
Sets the color used to draw the lines.
|
boolean |
getReadOnly()
Returns true if extension is read only.
|
String |
getSignature() |
protected SignatureFieldExtensionState |
getState() |
protected SignatureFieldExtensionState |
getState(boolean markAsDirty) |
double |
getVelocityFilterWeight()
Gets the velocity filter weight
|
boolean |
isClearButtonEnabled()
Gets the visibility of the clear button
|
void |
removeSignatureChangeListener(SignatureFieldExtension.SignatureChangeListener listener)
|
void |
setBackgroundColor(String backgroundColor)
Sets the color used to clear the background.
|
void |
setClearButtonEnabled(boolean clearButtonEnabled)
Sets the visibility of the clear button
|
void |
setDotSize(Double dotSize)
Sets the radius of a single dot.
|
void |
setImmediate(boolean immediate)
Sets the immediate value of this extension.
|
void |
setMaxWidth(double maxWidth)
Sets the maximum width of a line.
|
void |
setMimeType(MimeType mimeType)
Sets the
MimeType of generated images |
void |
setMinWidth(double minWidth)
Sets the minimum width of a line.
|
void |
setPenColor(String penColor)
Sets the color used to draw the lines.
|
void |
setReadOnly(boolean readOnly)
Sets the read only value of this extension.
|
void |
setSignature(String signature)
Set signature current signature value.
|
void |
setSignature(String signature,
boolean repaintIsNotNeeded)
Set signature current signature value.
|
void |
setVelocityFilterWeight(double velocityFilterWeight)
Sets the velocity filter weight
|
protected void |
updateSignature()
Updates the client-side with the current signature value
|
addFunction, callFunction, registerRpcextend, getParent, getSupportedParentType, remove, setParentaddAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResourceclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddAttachListener, addDetachListener, attach, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlerpublic SignatureFieldExtension(SignatureField target)
protected SignatureFieldExtensionState getState()
getState in class com.vaadin.server.AbstractJavaScriptExtensionprotected SignatureFieldExtensionState getState(boolean markAsDirty)
getState in class com.vaadin.server.AbstractClientConnectorpublic void beforeClientResponse(boolean initial)
beforeClientResponse in interface com.vaadin.server.ClientConnectorbeforeClientResponse in class com.vaadin.server.AbstractClientConnectorprotected void updateSignature()
public void clear()
public String getSignature()
public void setSignature(String signature, boolean repaintIsNotNeeded)
signature - SignaturerepaintIsNotNeeded - Repaint is not neededpublic void setSignature(String signature)
signature - Signaturepublic void fireSignatureChangeEvent(String signature)
SignatureFieldExtension.SignatureChangeEvent with the given Signature.signature - New signaturepublic void addSignatureChangeListener(SignatureFieldExtension.SignatureChangeListener listener)
listener - Listener to addpublic void removeSignatureChangeListener(SignatureFieldExtension.SignatureChangeListener listener)
listener - Listener to removepublic boolean getImmediate()
public void setImmediate(boolean immediate)
immediate - New immediate value of this extension.public boolean getReadOnly()
public void setReadOnly(boolean readOnly)
readOnly - Extension is read only.public Double getDotSize()
public void setDotSize(Double dotSize)
dotSize - Radius of a single dot.public double getMinWidth()
public void setMinWidth(double minWidth)
minWidth - Minimum width of a line.public double getMaxWidth()
public void setMaxWidth(double maxWidth)
maxWidth - Maximum width of a line.public String getBackgroundColor()
SampleColorspublic void setBackgroundColor(String backgroundColor)
SampleColorsbackgroundColor - Color used to clear the background.public String getPenColor()
SampleColorspublic void setPenColor(String penColor)
SampleColorspenColor - The color used to draw the lines.public double getVelocityFilterWeight()
public void setVelocityFilterWeight(double velocityFilterWeight)
velocityFilterWeight - The velocity filter weightpublic MimeType getMimeType()
MimeType of generated imagesMimeType of generated imagespublic void setMimeType(MimeType mimeType)
MimeType of generated imagesmimeType - The MimeType of generated imagespublic boolean isClearButtonEnabled()
SignatureFieldExtensionpublic void setClearButtonEnabled(boolean clearButtonEnabled)
clearButtonEnabled - Should show a clear button in the
SignatureFieldExtensionCopyright © 2015 Max Schuster. All Rights Reserved.