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 ColorfromRGB(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.booleanIf this method returns false, this ColorField allows opaque colors only.booleanisFinal()Returns true, if a value for the settable can be specified on the creation of an item only, thus cannot be modified later.booleanReturns true, if a value for the settable should be specified on the creation of an item.booleanisNull()isOpaque()NOT EQUAL Condition.optional()voidtoFinal()static intReturns 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, registerSourceMethods 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:SettableReturns true, if a value for the settable should be specified on the creation of an item. -
isFinal
public boolean isFinal()Description copied from interface:SettableReturns 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:
isMandatoryin interfaceSettable<Color>
-
getInitialType
- Specified by:
getInitialTypein interfaceSettable<Color>
-
isAlphaAllowed
public boolean isAlphaAllowed()If this method returns false, this ColorField allows opaque colors only. This means, thealpha valuemust 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 valueof 255 means that the color is completely opaque and analpha valueof 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
Colordoes not depend on whether theColorFieldallows alphaor not. -
getInitialExceptions
Description copied from interface:SettableReturns the exceptions possibly thrown, when setting a value for this settable.- Specified by:
getInitialExceptionsin 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:
isNullin interfaceColorFunction
-
isNotNull
- Specified by:
isNotNullin interfaceColorFunction
-
equal
- Specified by:
equalin 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:
notEqualin interfaceColorFunction
-
isOpaque
-
isNotOpaque
-