com.esri.arcgis.framework
Class ColorBrowser

java.lang.Object
  extended by com.esri.arcgis.framework.ColorBrowser
All Implemented Interfaces:
IColorBrowser, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class ColorBrowser
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IColorBrowser

Esri Custom Color Dialog.

Description

The ColorBrowser allows the user to select a color by specifying individual RGB, CMYK, HSV, HLS, or gray color properties.

Use the ColorBrowser coclass to display the ArcMap color browser dialog box. Note that this coclass should only be used from within the ArcMap framework.

Remarks

Edit a color by specifying red, green, and blue proportions. The selected color internally uses the RGB color model.

Edit a color by specifying cyan, magenta, yellow, and black proportions. The selected color internally uses the CMYK color model.

Edit a color by specifying hue, saturation, and value proportions. The selected color internally uses the HSV color model.

Edit a color by specifying the depth of grayness. The selected color internally uses the gray color model.

Edit a color by specifying a name selected from a fixed ArcMap color list. The selected color internally uses the HLS color model.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
ColorBrowser()
          Constructs a ColorBrowser using ArcGIS Engine.
ColorBrowser(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ColorBrowser theColorBrowser = (ColorBrowser) obj;
 
Method Summary
 boolean doModal(int hWnd)
          Show the browser.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 IColor getColor()
          Color edited by the browser.
 int hashCode()
          the hashcode for this object
 void setColor(IColor color)
          Color edited by the browser.
 
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

ColorBrowser

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

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

ColorBrowser

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

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

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

setColor

public void setColor(IColor color)
              throws IOException,
                     AutomationException
Color edited by the browser.

Remarks

Set the Color property to an existing IColor object—the type of coclass you use will determine what options the dialog displays for editing the colors (see the pictures in the ColorBrowser topic).

The following code creates an intial color to show in the color browser, displays the color browser, and then sets a new color to the selected color in the color browser. You would get m_app from the hook in ICommand::OnCreate().

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setColor in interface IColorBrowser
Parameters:
color - A reference to a com.esri.arcgis.display.IColor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getColor

public IColor getColor()
                throws IOException,
                       AutomationException
Color edited by the browser.

Remarks

Set the Color property to an existing IColor object—the type of coclass you use will determine what options the dialog displays for editing the colors (see the pictures in the ColorBrowser topic).

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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

doModal

public boolean doModal(int hWnd)
                throws IOException,
                       AutomationException
Show the browser.

Remarks

To display the dialog box, you should call the DoModal method. The method takes one parameter, a handle to the Application object of the ArcMap framework.

The DoModal method returns a Boolean—you should check the result to determine if the user intended to cancel the action (the result is False) or click OK (the result is True).

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
doModal in interface IColorBrowser
Parameters:
hWnd - The hWnd (A COM typedef) (in)
Returns:
The ok
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.