com.sibvisions.rad.ui.web.impl
Class WebColor

java.lang.Object
  extended by com.sibvisions.rad.ui.web.impl.WebResource
      extended by com.sibvisions.rad.ui.web.impl.WebColor
All Implemented Interfaces:
IColor, IResource

public class WebColor
extends WebResource
implements IColor

Web server implementation of IColor.


Field Summary
 
Fields inherited from interface javax.rad.ui.IColor
CONTROL_ACTIVE_SELECTION_BACKGROUND, CONTROL_ACTIVE_SELECTION_FOREGROUND, CONTROL_ALTERNATE_BACKGROUND, CONTROL_BACKGROUND, CONTROL_FOREGROUND, CONTROL_INACTIVE_SELECTION_BACKGROUND, CONTROL_INACTIVE_SELECTION_FOREGROUND, CONTROL_MANDATORY_BACKGROUND, CONTROL_READ_ONLY_BACKGROUND
 
Constructor Summary
WebColor(int pRGBA)
          Creates an opaque sRGB color with the specified combined RGB value consisting of the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7.
 
Method Summary
 int getAlpha()
          Returns the alpha component in the range 0-255.
 String getAsString()
          Gets this Object as String.
 int getBlue()
          Returns the blue component in the range 0-255 in the default sRGB space.
 int getGreen()
          Returns the green component in the range 0-255 in the default sRGB space.
 int getRed()
          Returns the red component in the range 0-255 in the default sRGB space.
 int getRGBA()
          Returns the red, green, blue and alpha component as one integer.
static WebColor getSystemColor(String pType)
          Gets system color.
 void setAsString(String pValue)
          Sets this Object as String.
static void setSystemColor(String pType, WebColor pSystemColor)
          Sets userdefined color as system color.
 
Methods inherited from class com.sibvisions.rad.ui.web.impl.WebResource
getNullableAsString, getResource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

WebColor

public WebColor(int pRGBA)
Creates an opaque sRGB color with the specified combined RGB value consisting of the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7. The actual color used in rendering depends on finding the best match given the color space available for a particular output device. Alpha is defaulted to 255.

Parameters:
pRGBA - the combined RGB components
See Also:
IColor, IColor.getRed(), IColor.getGreen(), IColor.getBlue(), IColor.getRGBA()
Method Detail

getAsString

public String getAsString()
Gets this Object as String.

Specified by:
getAsString in class WebResource
Returns:
the String.

getRed

public int getRed()
Returns the red component in the range 0-255 in the default sRGB space.

Specified by:
getRed in interface IColor
Returns:
the red component.
See Also:
IColor.getRed(), IColor.getGreen(), IColor.getBlue()

getGreen

public int getGreen()
Returns the green component in the range 0-255 in the default sRGB space.

Specified by:
getGreen in interface IColor
Returns:
the green component.
See Also:
IColor.getRed(), IColor.getGreen(), IColor.getBlue()

getBlue

public int getBlue()
Returns the blue component in the range 0-255 in the default sRGB space.

Specified by:
getBlue in interface IColor
Returns:
the blue component.
See Also:
IColor.getRed(), IColor.getGreen(), IColor.getBlue()

getAlpha

public int getAlpha()
Returns the alpha component in the range 0-255.

Specified by:
getAlpha in interface IColor
Returns:
the alpha component.
See Also:
IColor.getRed(), IColor.getGreen(), IColor.getBlue()

getRGBA

public int getRGBA()
Returns the red, green, blue and alpha component as one integer. (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue).

Specified by:
getRGBA in interface IColor
Returns:
the red, green, blue and alpha component as one integer.
See Also:
IColor.getRed(), IColor.getGreen(), IColor.getBlue()

setAsString

public void setAsString(String pValue)
Sets this Object as String.

Overrides:
setAsString in class WebResource
Parameters:
pValue - the String.

getSystemColor

public static WebColor getSystemColor(String pType)
Gets system color.

Parameters:
pType - SystemColor type
Returns:
color definition

setSystemColor

public static void setSystemColor(String pType,
                                  WebColor pSystemColor)
Sets userdefined color as system color.

Parameters:
pType - SystemColor type
pSystemColor - color definition
See Also:
SystemColor


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.