Package com.exedio.cope.pattern
Class ColorField
java.lang.Object
com.exedio.cope.Feature
com.exedio.cope.Pattern
com.exedio.cope.pattern.ColorField
- All Implemented Interfaces:
Copyable
,ColorFunction
,Settable<Color>
,Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy
(CopyMapper mapper) SetValue<?>[]
static Color
fromRGB
(int rgb) Converts a value for fieldgetRGB()
into a color.Returns the exceptions possibly thrown, when setting a value for this settable.Class<?>
getRGB()
Returns the field containing almost the result ofColor.getRGB()
of the persisted color.boolean
If this method returns false, this ColorField allows opaque colors only.boolean
isFinal()
Returns true, if a value for the settable can be specified on the creation of an item only, thus cannot be modified later.boolean
Returns true, if a value for the settable should be specified on the creation of an item.boolean
isNull()
isOpaque()
NOT EQUAL Condition.optional()
void
toFinal()
static int
Returns the value for fieldgetRGB()
representing the given color.Methods inherited from class com.exedio.cope.Pattern
addSource, addSource, addSource, addSource, addSourceFeature, addSourceFeature, addSourceFeature, annotationField, equals, getGeneratedTypes, getSourceFeatures, getSourceFeaturesGather, getSourceFields, getSources, getSourceTypes, getType, hashCode, initialize, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newSourceType, newType, newType, onMount, registerSource
Methods inherited from class com.exedio.cope.Feature
afterModelCreated, getAbstractType, getAnnotation, getID, getLocalizationKeys, getName, getPattern, isAnnotationPresent, isSourceAlready, mount, readResolve, requireMounted, toString, toString, writeReplace
-
Constructor Details
-
ColorField
public ColorField()
-
-
Method Details
-
copy
-
toFinal
-
optional
-
defaultTo
-
allowAlpha
- See Also:
-
isInitial
public boolean isInitial()Description copied from interface:Settable
Returns true, if a value for the settable should be specified on the creation of an item. -
isFinal
public boolean isFinal()Description copied from interface:Settable
Returns true, if a value for the settable can be specified on the creation of an item only, thus cannot be modified later. -
isMandatory
public boolean isMandatory()- Specified by:
isMandatory
in interfaceSettable<Color>
-
getInitialType
- Specified by:
getInitialType
in interfaceSettable<Color>
-
isAlphaAllowed
public boolean isAlphaAllowed()If this method returns false, this ColorField allows opaque colors only. This means, thealpha value
must be 255. If this method returns true, this ColorField allows any colors with anyalpha value
. -
getDefaultConstant
-
getRGB
Returns the field containing almost the result ofColor.getRGB()
of the persisted color. The difference is as follows:For
Color.getRGB()
analpha value
of 255 means that the color is completely opaque and analpha value
of 0 means that the color is completely transparent.Values of the IntegerField returned by this method do have the reverse meaning: An alpha value of 255 means that the color is completely transparent and an alpha value of 0 means that the color is completely opaque.
This transformation ensures, that the persistent value of any opaque
Color
does not depend on whether theColorField
allows alpha
or not. -
getInitialExceptions
Description copied from interface:Settable
Returns the exceptions possibly thrown, when setting a value for this settable.- Specified by:
getInitialExceptions
in interfaceSettable<Color>
-
get
-
set
-
execute
-
toRGB
Returns the value for fieldgetRGB()
representing the given color. -
fromRGB
Converts a value for fieldgetRGB()
into a color. -
bind
-
isNull
- Specified by:
isNull
in interfaceColorFunction
-
isNotNull
- Specified by:
isNotNull
in interfaceColorFunction
-
equal
- Specified by:
equal
in interfaceColorFunction
-
notEqual
NOT EQUAL Condition. Note: according to SQL, a NULL value is evaluated to unknown, so a NOT EQUAL using a non null RHS is false for null values- Specified by:
notEqual
in interfaceColorFunction
-
isOpaque
-
isNotOpaque
-