com.esri.arcgis.framework
Class ColorSelector

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

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

ESRI Color Selector object.

Description

The ColorSelector is a dialog box that can be used to create new color objects. The dialog presents slider bars and check boxes that can be used to precisely set the properties of the new color.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
ColorSelector()
          Constructs a ColorSelector using ArcGIS Engine.
ColorSelector(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ColorSelector theColorSelector = (ColorSelector) 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 initPopupPosition(int parentLeft, int parentTop, int parentRight, int parentBottom, boolean aboveParent)
          Initialize Popup Position.
 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

ColorSelector

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

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

ColorSelector

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

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

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.

initPopupPosition

public void initPopupPosition(int parentLeft,
                              int parentTop,
                              int parentRight,
                              int parentBottom,
                              boolean aboveParent)
                       throws IOException,
                              AutomationException
Initialize Popup Position.

Remarks

The InitPopupPosition method can be used to set the initial display location of the dialog box in screen coordinates.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
initPopupPosition in interface IColorSelector
Parameters:
parentLeft - The parentLeft (in)
parentTop - The parentTop (in)
parentRight - The parentRight (in)
parentBottom - The parentBottom (in)
aboveParent - The aboveParent (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.