com.esri.arcgis.framework
Class ColorPalette

java.lang.Object
  extended by com.esri.arcgis.framework.ColorPalette
All Implemented Interfaces:
IColorPalette, ICustomColorPalette, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class ColorPalette
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IColorPalette, ICustomColorPalette

ESRI Color Palette object.

Description

The ColorPalette is a popup menu displaying a choice of the colors defined by your currently selected Styles or, alternatively, a set of colors you specify.

The ColorPalette coclass defines a popup menu that can be used to allow interactive selection of colors. The colors included in the menu include all the colors in the Styles currently referenced by the StyleGallery. By selecting the More Colors option on the menu, the ColorSelector will be displayed.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
ColorPalette()
          Constructs a ColorPalette using ArcGIS Engine.
ColorPalette(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ColorPalette theColorPalette = (ColorPalette) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 IColor getColor()
          The Selected Color.
 int hashCode()
          the hashcode for this object
 void setColorSetByRef(ISet rhs1)
          The Color Objects.
 boolean trackPopupMenu(tagRECT rect, IColor currentColor, boolean orientation, int hParentWnd)
          Show Color Palette.
 
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

ColorPalette

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

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

ColorPalette

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

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

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

trackPopupMenu

public boolean trackPopupMenu(tagRECT rect,
                              IColor currentColor,
                              boolean orientation,
                              int hParentWnd)
                       throws IOException,
                              AutomationException
Show Color Palette.

Description

The TrackPopupMenu method displays the ColorPalette dialog on the screen.

Remarks

The TrackPopupMenu method controls the display of the palette with four parameters.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
trackPopupMenu in interface IColorPalette
Parameters:
rect - A Structure: com.esri.arcgis.system.tagRECT (in)
currentColor - A reference to a com.esri.arcgis.display.IColor (in)
orientation - The orientation (in)
hParentWnd - The hParentWnd (A COM typedef) (in)
Returns:
The ok
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getColor

public IColor getColor()
                throws IOException,
                       AutomationException
The Selected Color.

Description

The Color property of the IColorPalette interface returns the color selected during the TrackPopupMenu method.

Remarks

The Color property may return the IColor interface of either an RgbColor, HsvColor, HlsColor, CmykColor or GrayColor coclass.

If the user selects a specific color, the Color property will return that selected color. If the user selects the More Colors option and selects a color from the ColorSelector that is then displayed, the IColorPalette Color property will return that color.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getColor in interface IColorPalette
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.
See Also:
IColorPalette.trackPopupMenu(com.esri.arcgis.system.tagRECT, com.esri.arcgis.display.IColor, boolean, int)

setColorSetByRef

public void setColorSetByRef(ISet rhs1)
                      throws IOException,
                             AutomationException
The Color Objects.

Remarks

Set the ColorSet to a Set coclass. The Set coclass, which supports the ISet interface required by the ColorSet property, should contain the Color objects you wish to display.

Note that since the ISet.Add method passes the item by reference, youmust create a new color object to pass into the method each time.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

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