com.jniwrapper.win32.gdi
Class ColorRef

java.lang.Object
  extended bycom.jniwrapper.Parameter
      extended bycom.jniwrapper.ac
          extended bycom.jniwrapper.UInt32
              extended bycom.jniwrapper.win32.gdi.ColorRef
All Implemented Interfaces:
com.jniwrapper.IntegerParameter

public class ColorRef
extends com.jniwrapper.UInt32

This class represents COLORREF structure.


Field Summary
 
Fields inherited from class com.jniwrapper.Parameter
LICENSE_TYPE, V
 
Constructor Summary
ColorRef()
           
ColorRef(java.awt.Color color)
           
ColorRef(long value)
           
 
Method Summary
static java.awt.Color fromNativeColor(int color)
          Converts a native color to Java color presentation.
 boolean isInvalid()
          Checks return value correctness.
 void setColor(java.awt.Color color)
          Sets a new color value.
static int toBGR(int rgb)
          Converts color value from RGB to BGR colorspace.
 java.awt.Color toColor()
          Returns an instance of Color converted from the native presentation.
static int toNativeColor(java.awt.Color color)
          Converts a Java color to a native color presentation.
static int toRGB(int bgr)
          Converts color value BGR from to RGB colorspace.
 
Methods inherited from class com.jniwrapper.UInt32
clone, getLength, getValue, read, setValue, write
 
Methods inherited from class com.jniwrapper.ac
equals, getDebugInfo, hashCode, toLong, toString
 
Methods inherited from class com.jniwrapper.Parameter
, a, a, acceptIOPerformer, asReturnValue, b, dataBufferAssigned, getAlignedLength, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, indent, pop, push, read, read, setDataBuffer, toByteArray, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColorRef

public ColorRef()

ColorRef

public ColorRef(long value)

ColorRef

public ColorRef(java.awt.Color color)
Method Detail

setColor

public void setColor(java.awt.Color color)
Sets a new color value.

Parameters:
color - new color value.

toColor

public java.awt.Color toColor()
Returns an instance of Color converted from the native presentation.


toBGR

public static int toBGR(int rgb)
Converts color value from RGB to BGR colorspace.

Parameters:
rgb - color value
Returns:
bgr color value

toRGB

public static int toRGB(int bgr)
Converts color value BGR from to RGB colorspace.

Parameters:
bgr - color value
Returns:
rgb color value

toNativeColor

public static int toNativeColor(java.awt.Color color)
Converts a Java color to a native color presentation.

Parameters:
color - is Java color.
Returns:
native color presentation.

fromNativeColor

public static java.awt.Color fromNativeColor(int color)
Converts a native color to Java color presentation.

Parameters:
color - is a native color presentation.
Returns:
Java color.

isInvalid

public boolean isInvalid()
Checks return value correctness.

Returns:
result