com.sibvisions.rad.ui.awt.impl
Class AwtColor

java.lang.Object
  extended by com.sibvisions.rad.ui.awt.impl.AwtResource<Color>
      extended by com.sibvisions.rad.ui.awt.impl.AwtColor
All Implemented Interfaces:
IColor, IResource

public class AwtColor
extends AwtResource<Color>
implements IColor

The AwtColor class is used to encapsulate the access to all usable colors for AWT components. It's also used to change or define new colors.


Field Summary
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
resource
 
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, INVALID_EDITOR_BACKGROUND
 
Constructor Summary
AwtColor(Color pColor)
          Creates an instance of AwtColor based on a java.awt.Color.
AwtColor(int pRGBA)
          Creates a sRGB color with the specified combined RGBA value consisting of the alpha component in bits 24-31, 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.
 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.
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
equals, getResource, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

AwtColor

public AwtColor(Color pColor)
Creates an instance of AwtColor based on a java.awt.Color.

Parameters:
pColor - java.awt.Color
See Also:
Color

AwtColor

public AwtColor(int pRGBA)
Creates a sRGB color with the specified combined RGBA value consisting of the alpha component in bits 24-31, the red component in bits 16-23, the green component in bits 8-15, and the blue component in bits 0-7.

Parameters:
pRGBA - the combined RGBA components
See Also:
Color
Method Detail

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()

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()

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()

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()

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()


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.