public class SignatureField extends com.vaadin.v7.ui.CustomField<String>
Field
to capture user signatures as data url String
.StringToDataUrlConverter
that converts the String value to
DataUrl
that allows access to the binary contents of the data url.
StringToDataUrlConverter
,
DataUrl
,
signature_pad,
Serialized Formcom.vaadin.v7.ui.AbstractField.FocusShortcut, com.vaadin.v7.ui.AbstractField.ReadOnlyStatusChangeEvent
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
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
com.vaadin.server.Sizeable.Unit
com.vaadin.v7.ui.Field.ValueChangeEvent
com.vaadin.v7.data.Buffered.SourceException
com.vaadin.v7.data.Property.Editor, com.vaadin.v7.data.Property.ReadOnlyException, com.vaadin.v7.data.Property.ReadOnlyStatusChangeListener, com.vaadin.v7.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.v7.data.Property.Transactional<T>, com.vaadin.v7.data.Property.ValueChangeListener, com.vaadin.v7.data.Property.ValueChangeNotifier, com.vaadin.v7.data.Property.Viewer
Constructor and Description |
---|
SignatureField()
Creates a new SignatureField instance
|
SignatureField(com.vaadin.v7.data.Property<?> dataSource)
Creates a new SignatureField instance with a data source
|
SignatureField(String caption)
Creates a new SignatureField instance with a caption
|
SignatureField(String caption,
com.vaadin.v7.data.Property<?> dataSource)
Creates a new SignatureField instance with a caption and data source
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the field.
|
String |
getBackgroundColor()
Gets the color used to clear the background.
|
protected com.vaadin.ui.Component |
getContent()
Allways returns
null |
protected Collection<String> |
getCustomAttributes() |
Double |
getDotSize()
Gets the radius of a single dot.
|
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.
|
Class<? extends String> |
getType() |
double |
getVelocityFilterWeight()
Gets the velocity filter weight
|
protected com.vaadin.ui.Component |
initContent()
Allways returns
null |
boolean |
isClearButtonEnabled()
Gets the visibility of the clear button
|
boolean |
isEmpty()
Is the field empty?
The field is considered empty if its value is null |
void |
readDesign(org.jsoup.nodes.Element design,
com.vaadin.ui.declarative.DesignContext designContext) |
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) |
protected void |
setInternalValue(String newValue)
Sets the internal field value.
|
protected void |
setInternalValue(String newValue,
boolean repaintIsNotNeeded)
Sets the internal field value.
|
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) |
void |
setVelocityFilterWeight(double velocityFilterWeight)
Sets the velocity filter weight
|
SignatureField |
withBackgroundColor(String backgroundColor)
Sets the color used to clear the background.
|
SignatureField |
withClearButtonEnabled(boolean clearButtonEnabled)
Sets the visibility of the clear button
|
SignatureField |
withConversionError(String valueConversionError)
Sets the error that is shown if the field value cannot be converted to
the data source type.
|
SignatureField |
withConverter(com.vaadin.v7.data.util.converter.Converter<String,?> converter)
Sets the converter used to convert the field value to property data
source type.
|
SignatureField |
withDotSize(Double dotSize)
Sets the radius of a single dot.
|
SignatureField |
withFullHeight()
Sets the height of the object to "100%".
|
SignatureField |
withFullWidth()
Sets the width of the object to "100%".
|
SignatureField |
withHeight(float height,
com.vaadin.server.Sizeable.Unit unit)
Sets the height of the object.
|
SignatureField |
withHeight(String height)
Sets the height of the component using String presentation.
|
SignatureField |
withMaxWidth(double maxWidth)
Sets the maximum width of a line.
|
SignatureField |
withMimeType(MimeType mimeType)
Sets the
MimeType of generated images |
SignatureField |
withMinWidth(double minWidth)
Sets the minimum width of a line.
|
SignatureField |
withPenColor(String penColor)
Sets the color used to draw the lines.
|
SignatureField |
withReadOnly(boolean readOnly)
Changes the readonly state and throw read-only status change events.
|
SignatureField |
withValidator(com.vaadin.v7.data.Validator validator)
Adds a new validator for the field's value.
|
SignatureField |
withVelocityFilterWeight(double velocityFilterWeight)
Sets the velocity filter weight
|
SignatureField |
withWidth(float width,
com.vaadin.server.Sizeable.Unit unit)
Sets the width of the object.
|
SignatureField |
withWidth(String width)
Sets the width of the component using String presentation.
|
void |
writeDesign(org.jsoup.nodes.Element design,
com.vaadin.ui.declarative.DesignContext designContext) |
attach, focus, getTabIndex, iterator, setFocusDelegate, setHeight, setTabIndex, setWidth
addListener, addListener, addReadOnlyStatusChangeListener, addValidator, addValueChangeListener, beforeClientResponse, commit, detach, discard, fireReadOnlyStatusChange, fireValueChange, getConversionError, getConversionError, getConvertedValue, getConverter, getCurrentBufferedSourceException, getErrorMessage, getInternalValue, getModelType, getPropertyDataSource, getRequiredError, getState, getState, getValidators, getValue, isBuffered, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isRequired, isValid, isValidationVisible, readOnlyStatusChange, removeAllValidators, removeListener, removeListener, removeReadOnlyStatusChangeListener, removeValidator, removeValueChangeListener, setBuffered, setConversionError, setConvertedValue, setConverter, setConverter, setCurrentBufferedSourceException, setInvalidAllowed, setInvalidCommitted, setLocale, setPropertyDataSource, setRequired, setRequiredError, setValidationVisible, setValue, setValue, setValue, shouldHideErrors, validate, validate, valueChange
getExplicitImmediateValue, isImmediate
addContextClickListener, addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setParent, setPrimaryStyleName, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setVisible
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidthUndefined
forEach, spliterator
public SignatureField()
public SignatureField(String caption)
caption
- Field captionpublic SignatureField(com.vaadin.v7.data.Property<?> dataSource)
dataSource
- Property data sourcepublic SignatureField(String caption, com.vaadin.v7.data.Property<?> dataSource)
caption
- Field captiondataSource
- Property data sourceprotected final com.vaadin.ui.Component initContent()
null
initContent
in class com.vaadin.v7.ui.CustomField<String>
null
protected com.vaadin.ui.Component getContent()
null
getContent
in class com.vaadin.v7.ui.CustomField<String>
null
public void setReadOnly(boolean readOnly)
public void setImmediate(boolean immediate)
setImmediate
in class com.vaadin.v7.ui.AbstractLegacyComponent
public boolean isEmpty()
null
protected void setInternalValue(String newValue)
setInternalValue
in class com.vaadin.v7.ui.AbstractField<String>
newValue
- the new value to be set.protected void setInternalValue(String newValue, boolean repaintIsNotNeeded)
newValue
- the new value to be set.repaintIsNotNeeded
- the new value should not be send to the client-sidepublic void clear()
public void readDesign(org.jsoup.nodes.Element design, com.vaadin.ui.declarative.DesignContext designContext)
readDesign
in interface com.vaadin.ui.Component
readDesign
in class com.vaadin.v7.ui.AbstractField<String>
public void writeDesign(org.jsoup.nodes.Element design, com.vaadin.ui.declarative.DesignContext designContext)
writeDesign
in interface com.vaadin.ui.Component
writeDesign
in class com.vaadin.v7.ui.AbstractField<String>
protected Collection<String> getCustomAttributes()
getCustomAttributes
in class com.vaadin.v7.ui.AbstractField<String>
public Double getDotSize()
public void setDotSize(Double dotSize)
dotSize
- Radius of a single dot.public SignatureField withDotSize(Double dotSize)
dotSize
- Radius of a single dot.SignatureField
public double getMinWidth()
public void setMinWidth(double minWidth)
minWidth
- Minimum width of a line.public SignatureField withMinWidth(double minWidth)
minWidth
- Minimum width of a line.SignatureField
public double getMaxWidth()
public void setMaxWidth(double maxWidth)
maxWidth
- Maximum width of a line.public SignatureField withMaxWidth(double maxWidth)
maxWidth
- Maximum width of a line.SignatureField
public String getBackgroundColor()
SampleColors
public void setBackgroundColor(String backgroundColor)
SampleColors
backgroundColor
- Color used to clear the background.public SignatureField withBackgroundColor(String backgroundColor)
SampleColors
backgroundColor
- Color used to clear the background.SignatureField
public String getPenColor()
SampleColors
public void setPenColor(String penColor)
SampleColors
penColor
- The color used to draw the lines.public SignatureField withPenColor(String penColor)
SampleColors
penColor
- The color used to draw the lines.SignatureField
public double getVelocityFilterWeight()
public void setVelocityFilterWeight(double velocityFilterWeight)
velocityFilterWeight
- The velocity filter weightpublic SignatureField withVelocityFilterWeight(double velocityFilterWeight)
velocityFilterWeight
- The velocity filter weightSignatureField
public MimeType getMimeType()
MimeType
of generated imagesMimeType
of generated imagespublic void setMimeType(MimeType mimeType)
MimeType
of generated imagesmimeType
- The MimeType
of generated imagespublic SignatureField withMimeType(MimeType mimeType)
MimeType
of generated imagesmimeType
- The MimeType
of generated imagesSignatureField
public boolean isClearButtonEnabled()
SignatureField
public void setClearButtonEnabled(boolean clearButtonEnabled)
clearButtonEnabled
- Should show a clear button in the
SignatureField
public SignatureField withClearButtonEnabled(boolean clearButtonEnabled)
clearButtonEnabled
- Should show a clear button in the
SignatureField
SignatureField
public SignatureField withConversionError(String valueConversionError)
valueConversionError
- Message to be shown when conversion of the
value failsSignatureField
AbstractField.setConversionError(java.lang.String)
,
setImmediate(boolean)
public SignatureField withConverter(com.vaadin.v7.data.util.converter.Converter<String,?> converter)
converter
- The new converter to use.SignatureField
#setConverter(com.vaadin.data.util.converter.Converter)
,
setImmediate(boolean)
public SignatureField withFullWidth()
SignatureField
CustomField.setWidth(float, com.vaadin.server.Sizeable.Unit)
public SignatureField withFullHeight()
SignatureField
CustomField.setHeight(float, com.vaadin.server.Sizeable.Unit)
public SignatureField withReadOnly(boolean readOnly)
readOnly
- a boolean value specifying whether the component is put
read-only mode or notSignatureField
setReadOnly(boolean)
public SignatureField withValidator(com.vaadin.v7.data.Validator validator)
validator
- the new validator to be added.SignatureField
AbstractField.addValidator(com.vaadin.v7.data.Validator)
public SignatureField withWidth(float width, com.vaadin.server.Sizeable.Unit unit)
width
- the width of the object.unit
- the unit used for the width.SignatureField
CustomField.setWidth(float, com.vaadin.server.Sizeable.Unit)
public SignatureField withWidth(String width)
width
- in CSS style string representation, null or empty string to
resetSignatureField
AbstractComponent.setWidth(java.lang.String)
public SignatureField withHeight(float height, com.vaadin.server.Sizeable.Unit unit)
height
- the height of the object.unit
- the unit used for the width.SignatureField
CustomField.setHeight(float, com.vaadin.server.Sizeable.Unit)
public SignatureField withHeight(String height)
height
- Height of the componentSignatureField
AbstractComponent.setHeight(java.lang.String)
Copyright © 2017 Max Schuster. All Rights Reserved.