public class RgbColorConverter extends DefaultObjectConverter<javafx.scene.paint.Color> implements ColorConverter
If alpha value is included, converts Color to/from "XXX, XXX, XXX, XXX" format. For example "0, 0, 0, 255" is Color(0, 0, 0, 255) and "255, 0, 255, 100" is Color(255, 0, 255, 100).
CONTEXT_HEX, CONTEXT_HEX_WITH_ALPHA, CONTEXT_RGB, CONTEXT_RGBA, CONTEXT_WEB| Constructor and Description |
|---|
RgbColorConverter()
Creates a RgbColorConverter.
|
RgbColorConverter(boolean opacityIncluded)
Creates a RgbColorConverter.
|
| Modifier and Type | Method and Description |
|---|---|
javafx.scene.paint.Color |
fromString(java.lang.String string,
ConverterContext context)
Return null in most cases unless the generic type T is also a String.
|
boolean |
isOpacityIncluded()
Get the flag if this converter should consider alpha value.
|
void |
setOpacityIncluded(boolean opacityIncluded)
Set the flag if this converter should consider alpha value.
|
java.lang.String |
toString(javafx.scene.paint.Color color,
ConverterContext context)
Converts the value to String.
|
fromString, getObjectConverterManager, toString, toStringConverterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringConverterpublic RgbColorConverter()
public RgbColorConverter(boolean opacityIncluded)
opacityIncluded - the flag if alpha value will be included in this converterpublic boolean isOpacityIncluded()
If you use default constructor, the default value of this flag is false.
RgbColorConverterpublic void setOpacityIncluded(boolean opacityIncluded)
opacityIncluded - the flag if this converter should consider alpha value.isOpacityIncluded()public java.lang.String toString(javafx.scene.paint.Color color,
ConverterContext context)
DefaultObjectConvertertoString in interface ObjectConverter<javafx.scene.paint.Color>toString in class DefaultObjectConverter<javafx.scene.paint.Color>color - the value to be concerted.context - converter context to be usedpublic javafx.scene.paint.Color fromString(java.lang.String string,
ConverterContext context)
DefaultObjectConverterfromString in interface ObjectConverter<javafx.scene.paint.Color>fromString in class DefaultObjectConverter<javafx.scene.paint.Color>string - the stringcontext - context to be converted