com.esri.arcgis.display
Class HsvColor

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

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

A color in the HSV (Hue, Saturation, Value) color system.

Description

Use HsvColor to create color objects that are defined by the Hue, Saturation, and Value color model.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
HsvColor()
          Constructs a HsvColor using ArcGIS Engine.
HsvColor(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
HsvColor theHsvColor = (HsvColor) 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.
 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 getHue()
          The hue component of an IhsvColor (0-360).
 int getRGB()
          The RGB value of color.
 int getSaturation()
          The saturation component of an IhsvColor (0-100).
 void getSizeMax(_ULARGE_INTEGER[] pcbSize)
          getSizeMax
 byte getTransparency()
          The Alpha Blending value.
 int getValue()
          The value component of an IhsvColor (0-100).
 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 setCIELAB(double l, double a, double b)
          The CIELAB value of color.
 void setCMYK(int cMYK)
          The CMYK value of color.
 void setHue(int hue)
          The hue component of an IhsvColor (0-360).
 void setNullColor(boolean flag)
          Indicates whether this color is null.
 void setRGB(int rGB)
          The RGB value of color.
 void setSaturation(int saturation)
          The saturation component of an IhsvColor (0-100).
 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 setValue(int value)
          The value component of an IhsvColor (0-100).
 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

HsvColor

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

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

HsvColor

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

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

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

setHue

public void setHue(int hue)
            throws IOException,
                   AutomationException
The hue component of an IhsvColor (0-360).

Description

Hue is the value of the hue component of a HsvColor object. The valid value range is 0-360.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getHue

public int getHue()
           throws IOException,
                  AutomationException
The hue component of an IhsvColor (0-360).

Description

Hue is the value of the hue component of a HsvColor object. The valid value range is 0-360.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getHue in interface IHsvColor
Returns:
The hue
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSaturation

public void setSaturation(int saturation)
                   throws IOException,
                          AutomationException
The saturation component of an IhsvColor (0-100).

Description

Saturation is the value of the saturation component of a HsvColor object. The valid value range is 0-100.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getSaturation

public int getSaturation()
                  throws IOException,
                         AutomationException
The saturation component of an IhsvColor (0-100).

Description

Saturation is the value of the saturation component of a HsvColor object. The valid value range is 0-100.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSaturation in interface IHsvColor
Returns:
The saturation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setValue

public void setValue(int value)
              throws IOException,
                     AutomationException
The value component of an IhsvColor (0-100).

Description

Value is the value of the value component of a HsvColor object. The valid value range is 0-100.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getValue

public int getValue()
             throws IOException,
                    AutomationException
The value component of an IhsvColor (0-100).

Description

Value is the value of the value component of a HsvColor object. The valid value range is 0-100.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getValue in interface IHsvColor
Returns:
The value
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