public abstract class ImageMediaField extends com.vaadin.ui.CustomField<byte[]> implements MediaField, Scalable
com.vaadin.data.HasValue.ValueChangeEvent<V>, com.vaadin.data.HasValue.ValueChangeListener<V>
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.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_FORMAT |
protected static String |
TEMP_FILE_NAME_BASE |
Constructor and Description |
---|
ImageMediaField() |
Modifier and Type | Method and Description |
---|---|
void |
applyChanges() |
protected abstract com.vaadin.ui.Component |
createImage() |
protected com.vaadin.server.StreamResource |
createResourceFromValue() |
protected InputStream |
createStreamSource(BufferedImage img,
String formatName) |
protected void |
doSetValue(byte[] value) |
void |
execute() |
protected BufferedImage |
executeImageModification() |
protected String |
generateTempFileName() |
byte[] |
getValue() |
protected com.vaadin.ui.Component |
initContent() |
abstract void |
refreshImageSource() |
void |
revertChanges() |
void |
scaleToActualSize() |
void |
scaleToFit() |
attach, focus, getContent, getState, getState, getTabIndex, iterator, setFocusDelegate, setHeight, setTabIndex, setWidth
addValueChangeListener, createValueChange, getCustomAttributes, isDifferentValue, isReadOnly, isRequiredIndicatorVisible, readDesign, setReadOnly, setRequiredIndicatorVisible, setValue, setValue, writeDesign
addContextClickListener, addListener, addShortcutListener, addStyleName, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setResponsive, setSizeFull, setSizeUndefined, 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
addValueChangeListener, clear, getDefaultValidator, getEmptyValue, getOptionalValue, isEmpty, isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible, setValue
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible, writeDesign
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, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
forEach, spliterator
protected static final String DEFAULT_FORMAT
protected static final String TEMP_FILE_NAME_BASE
protected com.vaadin.ui.Component initContent()
initContent
in class com.vaadin.ui.CustomField<byte[]>
protected abstract com.vaadin.ui.Component createImage()
protected void doSetValue(byte[] value)
doSetValue
in class com.vaadin.ui.AbstractField<byte[]>
public byte[] getValue()
getValue
in interface com.vaadin.data.HasValue<byte[]>
public void scaleToActualSize()
scaleToActualSize
in interface Scalable
public void scaleToFit()
scaleToFit
in interface Scalable
public void applyChanges()
applyChanges
in interface MediaField
public void revertChanges()
revertChanges
in interface MediaField
public void execute()
protected BufferedImage executeImageModification() throws IOException
IOException
public abstract void refreshImageSource()
protected String generateTempFileName()
protected com.vaadin.server.StreamResource createResourceFromValue()
protected InputStream createStreamSource(BufferedImage img, String formatName) throws IOException
IOException
Copyright © 2020 Magnolia International Ltd.. All rights reserved.