PRESENTATION
- The presentation type. Must be compatible with what
AbstractColorConverter.getPresentationType()
returns.MODEL
- The model type. Must be compatible with what
AbstractColorConverter.getModelType()
returns.public abstract class AbstractRgbaColorConverter<PRESENTATION,MODEL> extends AbstractRgbColorConverter<PRESENTATION,MODEL>
Converter
s that convert between CSS rgba() color and Color
Constructor and Description |
---|
AbstractRgbaColorConverter(Class<PRESENTATION> presentationType,
Class<MODEL> modelType) |
Modifier and Type | Method and Description |
---|---|
protected int |
doubleToInt(double alpha) |
protected double |
intToDouble(int alpha) |
protected int |
parseAlpha(String colorString) |
protected String |
serializeColor(com.vaadin.shared.ui.colorpicker.Color color)
Serializes the given
Color as a String . |
protected com.vaadin.shared.ui.colorpicker.Color |
unserializeColor(String string)
Unserializes the given
String as a Color . |
parseColor
getModelType, getPresentationType
public AbstractRgbaColorConverter(Class<PRESENTATION> presentationType, Class<MODEL> modelType)
protected String serializeColor(com.vaadin.shared.ui.colorpicker.Color color) throws com.vaadin.data.util.converter.Converter.ConversionException
AbstractColorConverter
Color
as a String
. The String must
be unserialize by AbstractColorConverter.unserializeColor(java.lang.String)
serializeColor
in class AbstractRgbColorConverter<PRESENTATION,MODEL>
color
- The Color
to serialize. Never null
.Color
serialized as String
com.vaadin.data.util.converter.Converter.ConversionException
protected com.vaadin.shared.ui.colorpicker.Color unserializeColor(String string) throws com.vaadin.data.util.converter.Converter.ConversionException
AbstractColorConverter
String
as a Color
.unserializeColor
in class AbstractRgbColorConverter<PRESENTATION,MODEL>
string
- The String
to unserialize. Never null
.String
unserialized as Color
com.vaadin.data.util.converter.Converter.ConversionException
protected int parseAlpha(String colorString) throws com.vaadin.data.util.converter.Converter.ConversionException
com.vaadin.data.util.converter.Converter.ConversionException
protected double intToDouble(int alpha)
protected int doubleToInt(double alpha)
Copyright © 2015 Max Schuster. All Rights Reserved.