com.esri.arcgis.display
Class RgbColor

java.lang.Object
  extended by com.esri.arcgis.display.RgbColor
All Implemented Interfaces:
IColor, IRgbColor, com.esri.arcgis.interop.RemoteObjRef, IClone, IPersist, IPersistStream, IXMLSerialize, Externalizable, Serializable

public class RgbColor
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IRgbColor, IColor, IClone, IPersist, IPersistStream, IXMLSerialize, Externalizable

A color in the RGB(Red Green Blue) color system.

Description

Use RgbColor to create colors that are defined by the Red, Green, and Blue color model.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
RgbColor()
          Constructs a RgbColor using ArcGIS Engine.
RgbColor(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
RgbColor theRgbColor = (RgbColor) obj;
 
Method Summary
 void assign(IClone src)
          Assigns the properties of src to the receiver.
 void deserialize(IXMLSerializeData data)
          Deserializes an object from XML.
 boolean equals(Object o)
          Compare this object with another
 IClone esri_clone()
          Clones the receiver and assigns the result to *clone.
 int getBlue()
          The blue component of an IRgbColor (0-255).
 void getCIELAB(double[] l, double[] a, double[] b)
          The CIELAB value of color.
 void getClassID(GUID[] pClassID)
          getClassID
static String getClsid()
          getClsid.
 int getCMYK()
          The CMYK value of color.
 int getGreen()
          The green component of an IRgbColor (0-255).
 int getRed()
          The red component of an IRgbColor (0-255).
 int getRGB()
          The RGB value of color.
 void getSizeMax(_ULARGE_INTEGER[] pcbSize)
          getSizeMax
 byte getTransparency()
          The Alpha Blending value.
 int hashCode()
          the hashcode for this object
 void isDirty()
          isDirty
 boolean isEqual(IClone other)
          Indicates if the receiver and other have the same properties.
 boolean isIdentical(IClone other)
          Indicates if the receiver and other are the same object.
 boolean isNullColor()
          Indicates whether this color is null.
 boolean isUseWindowsDithering()
          Indicates if colors should be dithered to simulate colors that aren't supported by the display.
 void load(IStream pstm)
          load
 void readExternal(ObjectInput in)
           
 void save(IStream pstm, int fClearDirty)
          save
 void serialize(IXMLSerializeData data)
          Serializes an object to XML.
 void setBlue(int blue)
          The blue component of an IRgbColor (0-255).
 void setCIELAB(double l, double a, double b)
          The CIELAB value of color.
 void setCMYK(int cMYK)
          The CMYK value of color.
 void setGreen(int green)
          The green component of an IRgbColor (0-255).
 void setNullColor(boolean flag)
          Indicates whether this color is null.
 void setRed(int red)
          The red component of an IRgbColor (0-255).
 void setRGB(int rGB)
          The RGB value of color.
 void setTransparency(byte alphaValue)
          The Alpha Blending value.
 void setUseWindowsDithering(boolean useDithering)
          Indicates if colors should be dithered to simulate colors that aren't supported by the display.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

RgbColor

public RgbColor()
         throws IOException,
                UnknownHostException
Constructs a RgbColor using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

RgbColor

public RgbColor(Object obj)
         throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
RgbColor theRgbColor = (RgbColor) obj;

Construct a RgbColor using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to RgbColor.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

setRed

public void setRed(int red)
            throws IOException,
                   AutomationException
The red component of an IRgbColor (0-255).

Description

Red is the value of the red component of a RGBColor object. The valid value range is 0-255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setRed in interface IRgbColor
Parameters:
red - The red (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRed

public int getRed()
           throws IOException,
                  AutomationException
The red component of an IRgbColor (0-255).

Description

Red is the value of the red component of a RGBColor object. The valid value range is 0-255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getRed in interface IRgbColor
Returns:
The red
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setGreen

public void setGreen(int green)
              throws IOException,
                     AutomationException
The green component of an IRgbColor (0-255).

Description

Green is the value of the green component of a RGBColor object. The valid value range is 0-255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setGreen in interface IRgbColor
Parameters:
green - The green (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGreen

public int getGreen()
             throws IOException,
                    AutomationException
The green component of an IRgbColor (0-255).

Description

Green is the value of the green component of a RGBColor object. The valid value range is 0-255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getGreen in interface IRgbColor
Returns:
The green
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setBlue

public void setBlue(int blue)
             throws IOException,
                    AutomationException
The blue component of an IRgbColor (0-255).

Description

Blue is the value of the blue component of a RGBColor object. The valid value range is 0-255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setBlue in interface IRgbColor
Parameters:
blue - The blue (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getBlue

public int getBlue()
            throws IOException,
                   AutomationException
The blue component of an IRgbColor (0-255).

Description

Blue is the value of the blue component of a RGBColor object. The valid value range is 0-255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getBlue in interface IRgbColor
Returns:
The blue
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setRGB

public void setRGB(int rGB)
            throws IOException,
                   AutomationException
The RGB value of color.

Description

RGB returns Long (ASCII) number calculated from the Red, Green and Blue color attributes.

Remarks

Set the UseWindowsDithering to TRUE to match the returned value from VB's RGB() function.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setRGB in interface IColor
Parameters:
rGB - The rGB (A COM typedef) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:

It is easiest to specify the rgb values in hexadecimal. The following code creates an RGBColor for black -

RGBColor black = new RGBColor();

black.setRGB(0xFFFFFF);


getRGB

public int getRGB()
           throws IOException,
                  AutomationException
The RGB value of color.

Description

RGB returns the Long (ASCII) number calculated from the Red, Green and Blue color attributes.

Remarks

Set the UseWindowsDithering to TRUE to match the returned value from VB's RGB() function.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getRGB in interface IColor
Returns:
The rGB (A COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCMYK

public void setCMYK(int cMYK)
             throws IOException,
                    AutomationException
The CMYK value of color.

Description

CMYK returns the Long (ASCII) number calculated from the Cyan, Magenta, Yellow and Black color attributes.

Remarks

C = 0 - 100 ;M = 0 - 100; Y = 0 - 100; K = 0 - 100

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setCMYK in interface IColor
Parameters:
cMYK - The cMYK (A COM typedef) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCMYK

public int getCMYK()
            throws IOException,
                   AutomationException
The CMYK value of color.

Description

CMYK returns the Long (ASCII) number calculated from the Cyan, Magenta, Yellow and Black color attributes.

Remarks

C = 0 - 100 ;M = 0 - 100; Y = 0 - 100; K = 0 - 100

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getCMYK in interface IColor
Returns:
The cMYK (A COM typedef)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setUseWindowsDithering

public void setUseWindowsDithering(boolean useDithering)
                            throws IOException,
                                   AutomationException
Indicates if colors should be dithered to simulate colors that aren't supported by the display. This only applies on displays that have 256 or fewer colors.

Remarks

Set UseWindowsDithering to TRUE to match the returned value from VB's RGB() function.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setUseWindowsDithering in interface IColor
Parameters:
useDithering - The useDithering (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isUseWindowsDithering

public boolean isUseWindowsDithering()
                              throws IOException,
                                     AutomationException
Indicates if colors should be dithered to simulate colors that aren't supported by the display. This only applies on displays that have 256 or fewer colors.

Remarks

Set UseWindowsDithering to TRUE to match the returned value from VB's RGB() function.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isUseWindowsDithering in interface IColor
Returns:
The useDithering
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCIELAB

public void setCIELAB(double l,
                      double a,
                      double b)
               throws IOException,
                      AutomationException
The CIELAB value of color.

Description

This method converts the color attributes to device independent color.

Remarks

l = 0 to 100, a = -120 to 120, b = -120 to 120

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setCIELAB in interface IColor
Parameters:
l - The l (in)
a - The a (in)
b - The b (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCIELAB

public void getCIELAB(double[] l,
                      double[] a,
                      double[] b)
               throws IOException,
                      AutomationException
The CIELAB value of color.

Description

This method retrieves the color, for exmaple from StyleGallery, and convert it to device independent color attributes.

Remarks

l = 0 to 100, a = -120 to 120, b = -120 to 120

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getCIELAB in interface IColor
Parameters:
l - The l (out: use single element array)
a - The a (out: use single element array)
b - The b (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setTransparency

public void setTransparency(byte alphaValue)
                     throws IOException,
                            AutomationException
The Alpha Blending value. (0 for transparent, 255 for opaque).

Description

Transparency is the degree to which a color is opaque. True transparency is only supported at the layer level. For graphic elements, 0 for transparent and 255 for opaque are the only supported values. Use either the ILayerEffects or ITransparencyRenderer interfaces to set layer transparency. For layer transparency to work properly the display device must be set to "True Color (32 bit)".

Remarks

Setting this property has no effect when defining transparency for a GeometryMaterial participating in a MultiPatch generated via IGeneralMultiPatchCreator. Use the Transparency property exposed by IGeometryMaterial instead.

The default value is 255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setTransparency in interface IColor
Parameters:
alphaValue - An unsigned byte (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTransparency

public byte getTransparency()
                     throws IOException,
                            AutomationException
The Alpha Blending value. (0 for transparent, 255 for opaque).

Description

Transparency is the degree to which a color is opaque. True transparency is only supported at the layer level. For graphic elements, 0 for transparent and 255 for opaque are the only supported values. Use either the ILayerEffects or ITransparencyRenderer interfaces to set layer transparency. For layer transparency to work properly the display device must be set to "True Color (32 bit)".

Remarks

The default value is 255.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getTransparency in interface IColor
Returns:
An unsigned byte
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setNullColor

public void setNullColor(boolean flag)
                  throws IOException,
                         AutomationException
Indicates whether this color is null.

Description

Boolean indicator that specifies if the color will be Null or Transparent. The default for NullColor is False.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setNullColor in interface IColor
Parameters:
flag - The flag (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isNullColor

public boolean isNullColor()
                    throws IOException,
                           AutomationException
Indicates whether this color is null.

Description

Boolean indicator that specifies if the color will be Null or Transparent. The default for NullColor is False.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isNullColor in interface IColor
Returns:
The flag
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

esri_clone

public IClone esri_clone()
                  throws IOException,
                         AutomationException
Clones the receiver and assigns the result to *clone.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
esri_clone in interface IClone
Returns:
A reference to a com.esri.arcgis.system.IClone
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

assign

public void assign(IClone src)
            throws IOException,
                   AutomationException
Assigns the properties of src to the receiver.

Description

Use Assign method to assign the properties of source object to receiver object. Both objects need to have the same CLSIDs. Both source and receiver objects need to be instantiated.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
assign in interface IClone
Parameters:
src - A reference to a com.esri.arcgis.system.IClone (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isEqual

public boolean isEqual(IClone other)
                throws IOException,
                       AutomationException
Indicates if the receiver and other have the same properties.

Description

IsEqual returns True if the receiver and the source have the same properties. Note, this does not imply that the receiver and the source reference the same object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isEqual in interface IClone
Parameters:
other - A reference to a com.esri.arcgis.system.IClone (in)
Returns:
The equal
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isIdentical

public boolean isIdentical(IClone other)
                    throws IOException,
                           AutomationException
Indicates if the receiver and other are the same object.

Description

IsIdentical returns true if the receiver and the source reference the same object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isIdentical in interface IClone
Parameters:
other - A reference to a com.esri.arcgis.system.IClone (in)
Returns:
The identical
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClassID

public void getClassID(GUID[] pClassID)
                throws IOException,
                       AutomationException
getClassID

Description

IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getClassID in interface IPersist
Parameters:
pClassID - A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isDirty

public void isDirty()
             throws IOException,
                    AutomationException
isDirty

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isDirty in interface IPersistStream
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

load

public void load(IStream pstm)
          throws IOException,
                 AutomationException
load

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
load in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

save

public void save(IStream pstm,
                 int fClearDirty)
          throws IOException,
                 AutomationException
save

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
save in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
fClearDirty - The fClearDirty (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSizeMax

public void getSizeMax(_ULARGE_INTEGER[] pcbSize)
                throws IOException,
                       AutomationException
getSizeMax

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSizeMax in interface IPersistStream
Parameters:
pcbSize - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

serialize

public void serialize(IXMLSerializeData data)
               throws IOException,
                      AutomationException
Serializes an object to XML.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
serialize in interface IXMLSerialize
Parameters:
data - A reference to a com.esri.arcgis.system.IXMLSerializeData (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deserialize

public void deserialize(IXMLSerializeData data)
                 throws IOException,
                        AutomationException
Deserializes an object from XML.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
deserialize in interface IXMLSerialize
Parameters:
data - A reference to a com.esri.arcgis.system.IXMLSerializeData (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException