javax.rad.genui
Class UIColor

java.lang.Object
  extended by javax.rad.genui.UIResource<UI>
      extended by javax.rad.genui.UIFactoryResource<IColor>
          extended by javax.rad.genui.UIColor
All Implemented Interfaces:
IColor, IResource

public class UIColor
extends UIFactoryResource<IColor>
implements IColor

Platform and technology independent Color.


Field Summary
static UIColor black
          The color black.
static UIColor blue
          The color blue.
static UIColor controlActiveSelectionBackground
          The color for control active selection background color.
static UIColor controlActiveSelectionForeground
          The color for control active selection foreground color.
static UIColor controlAlternateBackground
          The color for control alternate background color.
static UIColor controlBackground
          The color for control background color.
static UIColor controlForeground
          The color for control foreground color.
static UIColor controlInactiveSelectionBackground
          The color for control inactive selection background color.
static UIColor controlInactiveSelectionForeground
          The color for control inactive selection foreground color.
static UIColor controlMandatoryBackground
          The constant for control mandatory background color.
static UIColor controlReadOnlyBackground
          The constant for control read only background color.
static UIColor cyan
          The color cyan.
static UIColor darkGray
          The color dark gray.
static UIColor gray
          The color gray.
static UIColor green
          The color green.
static UIColor invalidEditorBackground
          The color for invalid editor background color.
static UIColor lightGray
          The color light gray.
static UIColor magenta
          The color magenta.
static UIColor orange
          The color orange.
static UIColor pink
          The color pink.
static UIColor red
          The color red.
static UIColor white
          The color white.
static UIColor yellow
          The color yellow.
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
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
protected UIColor(IColor pColor)
          Creates an UIColor of an IColor for compatibility reasons.
  UIColor(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.
  UIColor(int pRGBA, boolean pHasalpha)
          Creates an 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.
  UIColor(int pR, int pG, int pB)
          Creates an opaque sRGB color with the specified red, green, and blue values in the range (0 - 255).
  UIColor(int pR, int pG, int pB, int pA)
          Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0 - 255).
 
Method Summary
static UIColor createColor(String pValue)
          Creates a color from a list of int values (3(rgb) or 4(rgba) values), comma separated in a string, or in hex representation (#FF00FF).
 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.
static UIColor getSystemColor(String pType)
          This encapsulate symbolic colors representing the color of native GUI objects on a system.
static void setSystemColor(String pType, IColor pSystemColor)
          Sets the given IColor as SystemColor.
 
Methods inherited from class javax.rad.genui.UIFactoryResource
getResource, getUIResource
 
Methods inherited from class javax.rad.genui.UIResource
equals, 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
 

Field Detail

white

public static final UIColor white
The color white. In the default sRGB space.


lightGray

public static final UIColor lightGray
The color light gray. In the default sRGB space.


gray

public static final UIColor gray
The color gray. In the default sRGB space.


darkGray

public static final UIColor darkGray
The color dark gray. In the default sRGB space.


black

public static final UIColor black
The color black. In the default sRGB space.


red

public static final UIColor red
The color red. In the default sRGB space.


pink

public static final UIColor pink
The color pink. In the default sRGB space.


orange

public static final UIColor orange
The color orange. In the default sRGB space.


yellow

public static final UIColor yellow
The color yellow. In the default sRGB space.


green

public static final UIColor green
The color green. In the default sRGB space.


magenta

public static final UIColor magenta
The color magenta. In the default sRGB space.


cyan

public static final UIColor cyan
The color cyan. In the default sRGB space.


blue

public static final UIColor blue
The color blue. In the default sRGB space.


controlBackground

public static final UIColor controlBackground
The color for control background color.


controlAlternateBackground

public static final UIColor controlAlternateBackground
The color for control alternate background color.


controlForeground

public static final UIColor controlForeground
The color for control foreground color.


controlActiveSelectionBackground

public static final UIColor controlActiveSelectionBackground
The color for control active selection background color.


controlActiveSelectionForeground

public static final UIColor controlActiveSelectionForeground
The color for control active selection foreground color.


controlInactiveSelectionBackground

public static final UIColor controlInactiveSelectionBackground
The color for control inactive selection background color.


controlInactiveSelectionForeground

public static final UIColor controlInactiveSelectionForeground
The color for control inactive selection foreground color.


controlMandatoryBackground

public static final UIColor controlMandatoryBackground
The constant for control mandatory background color.


controlReadOnlyBackground

public static final UIColor controlReadOnlyBackground
The constant for control read only background color.


invalidEditorBackground

public static final UIColor invalidEditorBackground
The color for invalid editor background color.

Constructor Detail

UIColor

protected UIColor(IColor pColor)
Creates an UIColor of an IColor for compatibility reasons.

Parameters:
pColor - the IColor.

UIColor

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

UIColor

public UIColor(int pRGBA,
               boolean pHasalpha)
Creates an 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. If the pHasalpha argument is false, alpha is defaulted to 255.

Parameters:
pRGBA - the combined RGBA components
pHasalpha - true if the alpha bits are valid; false otherwise
See Also:
IColor, IColor.getRed(), IColor.getGreen(), IColor.getBlue(), IColor.getAlpha(), IColor.getRGBA()

UIColor

public UIColor(int pR,
               int pG,
               int pB)
Creates an opaque sRGB color with the specified red, green, and blue values in the range (0 - 255). The actual color used in rendering depends on finding the best match given the color space available for a given output device. Alpha is defaulted to 255.

Parameters:
pR - the red component
pG - the green component
pB - the blue component
See Also:
IColor, IColor.getRed(), IColor.getGreen(), IColor.getBlue(), IColor.getRGBA()

UIColor

public UIColor(int pR,
               int pG,
               int pB,
               int pA)
Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0 - 255).

Parameters:
pR - the red component
pG - the green component
pB - the blue component
pA - the alpha component
See Also:
IColor, IColor.getRed(), IColor.getGreen(), IColor.getBlue(), IColor.getAlpha(), IColor.getRGBA()
Method Detail

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

getSystemColor

public static UIColor getSystemColor(String pType)
This encapsulate symbolic colors representing the color of native GUI objects on a system. For systems which support the dynamic update of the system colors (when the user changes the colors) the actual RGB values of these symbolic colors will also change dynamically. In order to compare the "current" RGB value of a SystemColor object with a non-symbolic Color object, getRGB should be used rather than equals.

Note that the way in which these system colors are applied to GUI objects may vary slightly from platform to platform since GUI objects may be rendered differently on each platform.

Parameters:
pType - the type
Returns:
the IColor
See Also:
IColor

setSystemColor

public static void setSystemColor(String pType,
                                  IColor pSystemColor)
Sets the given IColor as SystemColor. If pSystemColor is null the original SystemColor is restored.

Parameters:
pType - the type
pSystemColor - the IColor
See Also:
IColor

createColor

public static UIColor createColor(String pValue)
Creates a color from a list of int values (3(rgb) or 4(rgba) values), comma separated in a string, or in hex representation (#FF00FF).

Parameters:
pValue - the value string
Returns:
the color or null if the color values are invalid


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.