rs.sol.soloist.server.builtindomains.builtindatatypes
Class Color

java.lang.Object
  extended by rs.sol.soloist.server.uml.commonimplementation.runtime._ClassifierInstance
      extended by rs.sol.soloist.server.uml.commonimplementation.runtime._DataTypeInstance
          extended by rs.sol.soloist.server.javaimpl.runtime.SOLoistDataTypeInstance
              extended by rs.sol.soloist.server.builtindomains.builtindatatypes.InstanceOfDataType
                  extended by rs.sol.soloist.server.builtindomains.builtindatatypes.InstanceOfPrimitiveType
                      extended by rs.sol.soloist.server.builtindomains.builtindatatypes.Color
All Implemented Interfaces:
rs.sol.soloist.server.uml.concepts.IElement, IClassifierInstance, IDataTypeInstance, IPrimitiveTypeInstance, IRTElement

public class Color
extends InstanceOfPrimitiveType


Nested Class Summary
static class Color.DefaultHandler
          Color is encoded as 32-bit integer (ARGB)
static class Color.DefaultSerializationHandler
           
 
Field Summary
static Color BLACK
           
static IPrimitiveType CLASSIFIER
           
static java.lang.String FQ_TYPE_NAME
           
static int MAX
           
static int MIN
           
static int OPAQUE
           
static Color WHITE
           
 
Constructor Summary
Color()
           
Color(int argb)
           
Color(int red, int green, int blue)
          0 to 255
Color(int red, int green, int blue, int alpha)
          0 to 255
 
Method Summary
static Color ARGB(int argb)
           
 boolean equals(java.lang.Object obj)
           
static Color fromHex(java.lang.String hex)
           
static Color fromSerializable(java.io.Serializable ser)
           
static Color fromString(java.lang.String argbInteger)
          USED BY OLD SQL STUFF ONLY
 int getAlpha()
           
 int getARGB()
           
 int getBlue()
           
 int getGrayLevel()
           
 int getGreen()
           
 int getRed()
           
 int getRGB()
           
 java.lang.Integer getValue()
           
 int hashCode()
           
 boolean isEqualTo(IClassifierInstance ci)
          Is this Classifier Instance equal to the given Classifier Instance?
Semantic rules:
1.
 IClassifierInstance makeClone()
          Clones this Classifier Instance.
 Color opaque()
           
static Color RGB(int rgb)
           
static Color RGB(int red, int green, int blue)
          Value will be limited to valid range (0 to 255).
static Color RGBA(int red, int green, int blue, int alpha)
          Value will be limited to valid range (0 to 255).
 double rgbEuclideanDistance(Color other)
           
 Color rgbInverse()
           
 int rgbManhattanDistance(Color other)
           
 int rgbMaxDeltaDistance(Color other)
           
 java.awt.Color toAWTColor()
           
 java.lang.String toCSSHexColor()
           
 java.lang.String toString()
           
 Color withOpacity(int opacity)
           
 
Methods inherited from class rs.sol.soloist.server.builtindomains.builtindatatypes.InstanceOfPrimitiveType
accept, accept, getSQLString, toSerializable
 
Methods inherited from class rs.sol.soloist.server.javaimpl.runtime.SOLoistDataTypeInstance
addAttributeValue, getAttributeValue, getDataType, getMyID, getSlot, getSlots, setDataType, setMyID
 
Methods inherited from class rs.sol.soloist.server.uml.commonimplementation.runtime._DataTypeInstance
getClassifier, hasIdentity, isClassInstance, isDataTypeInstance, isMarkedAsDeleted, markAsDeleted
 
Methods inherited from class rs.sol.soloist.server.uml.commonimplementation.runtime._ClassifierInstance
conformsTo, constructor, copySlots, copySlots, destroy, destructor, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValues, getClassifierFQName, getClassifierUQName, getFirstCommonGeneralizer, getFirstCommonGeneralizerFQName, getFirstCommonGeneralizerUQName, getMElement, getSlot, getSlot, getSlot, isDirectInstanceOf, isDirectInstanceOf, isInstanceOf, isInstanceOf, isKindOf, isModelElement, isRTElement
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface rs.sol.soloist.server.uml.concepts.runtime.IDataTypeInstance
getDataType
 
Methods inherited from interface rs.sol.soloist.server.uml.concepts.runtime.IClassifierInstance
conformsTo, constructor, copySlots, copySlots, destroy, destructor, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValues, getClassifier, getClassifierFQName, getClassifierUQName, getFirstCommonGeneralizer, getFirstCommonGeneralizerFQName, getFirstCommonGeneralizerUQName, getMyID, getSlot, getSlot, getSlot, getSlot, getSlots, isClassInstance, isDataTypeInstance, isDirectInstanceOf, isDirectInstanceOf, isInstanceOf, isInstanceOf, isMarkedAsDeleted, markAsDeleted
 
Methods inherited from interface rs.sol.soloist.server.uml.concepts.runtime.IRTElement
getMElement, hasIdentity
 
Methods inherited from interface rs.sol.soloist.server.uml.concepts.IElement
isKindOf, isModelElement, isRTElement
 

Field Detail

FQ_TYPE_NAME

public static final java.lang.String FQ_TYPE_NAME
See Also:
Constant Field Values

CLASSIFIER

public static final IPrimitiveType CLASSIFIER

OPAQUE

public static final int OPAQUE
See Also:
Constant Field Values

MIN

public static final int MIN
See Also:
Constant Field Values

MAX

public static final int MAX
See Also:
Constant Field Values

BLACK

public static final Color BLACK

WHITE

public static final Color WHITE
Constructor Detail

Color

public Color()

Color

public Color(int argb)

Color

public Color(int red,
             int green,
             int blue)
0 to 255


Color

public Color(int red,
             int green,
             int blue,
             int alpha)
0 to 255

Method Detail

isEqualTo

public boolean isEqualTo(IClassifierInstance ci)
                  throws rs.sol.soloist.server.uml.exceptions.RequestFailedException
Description copied from interface: IClassifierInstance
Is this Classifier Instance equal to the given Classifier Instance?
Semantic rules:
1. If this and ci are instances of different kinds of Classifiers (one is an instance of a Class, and the other is an instance of a Data Type) they are different (not equal).
2. If this and ci refer to two different instances of Classes, they are different (not equal).
3. If this and ci refer to two instances of Data Types, their equality is checked on value basis (if all of their Slots are equal).

Specified by:
isEqualTo in interface IClassifierInstance
Overrides:
isEqualTo in class rs.sol.soloist.server.javaimpl.runtime.SOLoistDataTypeInstance
Throws:
rs.sol.soloist.server.uml.exceptions.RequestFailedException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

makeClone

public IClassifierInstance makeClone()
                              throws rs.sol.soloist.server.uml.exceptions.ActionExecutionFailedException
Description copied from interface: IClassifierInstance
Clones this Classifier Instance.

Throws:
rs.sol.soloist.server.uml.exceptions.ActionExecutionFailedException

toString

public java.lang.String toString()
Specified by:
toString in interface IDataTypeInstance
Overrides:
toString in class rs.sol.soloist.server.uml.commonimplementation.runtime._ClassifierInstance

getRed

public int getRed()

getGreen

public int getGreen()

getBlue

public int getBlue()

getAlpha

public int getAlpha()

getRGB

public int getRGB()

getARGB

public int getARGB()
Returns:
32-bit value 0xaarrggbb

ARGB

public static Color ARGB(int argb)
Parameters:
argb - - 32-bit value: 0xaarrggbb

RGB

public static Color RGB(int rgb)
Parameters:
rgb - - 24-bit value: 0x00RRGGBB

RGB

public static Color RGB(int red,
                        int green,
                        int blue)
Value will be limited to valid range (0 to 255).
@param red - 0 to 255
@param green - 0 to 255
@param blue - 0 to 255


RGBA

public static Color RGBA(int red,
                         int green,
                         int blue,
                         int alpha)
Value will be limited to valid range (0 to 255).
@param red - 0 to 255
@param green - 0 to 255
@param blue - 0 to 255
@param alpha - 0 (transparent) to 255 (opaque)


fromHex

public static Color fromHex(java.lang.String hex)
Parameters:
hex - - 0xaarrggbb, aarrggbb, rrggbb, #rrggbb, rgb or #rgb

toCSSHexColor

public java.lang.String toCSSHexColor()
Returns:
String in #rrggbb format

opaque

public Color opaque()

rgbInverse

public Color rgbInverse()

rgbEuclideanDistance

public double rgbEuclideanDistance(Color other)
Returns:
0.0 .. 255 * sqrt(3)

rgbMaxDeltaDistance

public int rgbMaxDeltaDistance(Color other)
Returns:
0..255

rgbManhattanDistance

public int rgbManhattanDistance(Color other)
Returns:
0..3*255

getGrayLevel

public int getGrayLevel()
Returns:
0.255

withOpacity

public Color withOpacity(int opacity)

getValue

public java.lang.Integer getValue()
Specified by:
getValue in interface IPrimitiveTypeInstance
Overrides:
getValue in class InstanceOfPrimitiveType

fromSerializable

public static Color fromSerializable(java.io.Serializable ser)

toAWTColor

public java.awt.Color toAWTColor()

fromString

public static Color fromString(java.lang.String argbInteger)
USED BY OLD SQL STUFF ONLY

Parameters:
argbInteger -