com.esri.arcgis.carto
Class DynamicGlyphFactory

java.lang.Object
  extended by com.esri.arcgis.carto.DynamicGlyphFactory
All Implemented Interfaces:
IDynamicGlyphFactory, IDynamicGlyphFactory2, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class DynamicGlyphFactory
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IDynamicGlyphFactory, IDynamicGlyphFactory2

Dynamic glyph factory class.

Description

This object is new at ArcGIS 9.3.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
DynamicGlyphFactory()
          Constructs a DynamicGlyphFactory using ArcGIS Engine.
DynamicGlyphFactory(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
DynamicGlyphFactory theDynamicGlyphFactory = (DynamicGlyphFactory) obj;
 
Method Summary
 IDynamicGlyph createDynamicGlyph(ISymbol symbol)
          Creates a dynamic glyph from a symbol.
 IDynamicGlyph createDynamicGlyphFromBitmap(int glyphType, int hBmp, boolean preserveAlphaChannel, IColor transparencyColor)
          Create a dynamic glyph from a bitmap handle.
 IDynamicGlyph createDynamicGlyphFromFile(int glyphType, String fileName, IColor transparencyColor)
          Creates a dynamic glyph from a file.
 void deleteDynamicGlyph(IDynamicGlyph glyph)
          Deletes the dynamic glyph's resource.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 void getCreatedDynamicGlyphSize(int glyphType, int[] sizeX, int[] sizeY)
          Indicates the texture size of the created dynamic glyph.
 IDynamicGlyph getDynamicGlyph(int groupId, int glyphType, int index)
          Retrieves a dynamic glyph from a glyph group.
 int hashCode()
          the hashcode for this object
 void init(IScreenDisplay screenDisplay)
          Initialize the dynamic glyph factory.
 int loadDynamicGlyphsGroup(String fileName)
          Loads a dynamic glyph group from files.
 void setCreatedDynamicGlyphSize(int glyphType, int sizeX, int sizeY)
          Indicates the texture size of the created dynamic glyph.
 void unloadDynamicGlyphsGroup(int groupId)
          Unloads a dynamic glyph group, and any corresponding resources.
 
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

DynamicGlyphFactory

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

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

DynamicGlyphFactory

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

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

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

init

public void init(IScreenDisplay screenDisplay)
          throws IOException,
                 AutomationException
Initialize the dynamic glyph factory.

Remarks

This method should only be used after co-creating a Dynamic Glyph Factory. There is no need to init a Dynamic Glyph Factory that was retrieved from a Dynamic Display object.

Product Availability

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

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

createDynamicGlyph

public IDynamicGlyph createDynamicGlyph(ISymbol symbol)
                                 throws IOException,
                                        AutomationException
Creates a dynamic glyph from a symbol.

Remarks

For monochromatic symbols (symbols that consist of only one color and might even have fixed black pixels), it is advisable to set the Symbol color to white before passing it into the method. When rendering the Dynamic Symbol, using the Dynamic Glyph created using this method, you should then set the color to the desired color. That will result in coloring the white pixels to the desired color, while leaving the black colors black.

Product Availability

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

Specified by:
createDynamicGlyph in interface IDynamicGlyphFactory
Parameters:
symbol - A reference to a com.esri.arcgis.display.ISymbol (in)
Returns:
A reference to a com.esri.arcgis.display.IDynamicGlyph
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteDynamicGlyph

public void deleteDynamicGlyph(IDynamicGlyph glyph)
                        throws IOException,
                               AutomationException
Deletes the dynamic glyph's resource.

Remarks

It is important to call this method in order to release the Dynamic Glyph’s resources. A Dynamic Glyph object that is destroyed without calling this method might result in memory leaks on the graphic card memory. Also, it is recommended to delete unused Dynamic Glyphs in order to free up Graphic Card memory.

Product Availability

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

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

createDynamicGlyphFromFile

public IDynamicGlyph createDynamicGlyphFromFile(int glyphType,
                                                String fileName,
                                                IColor transparencyColor)
                                         throws IOException,
                                                AutomationException
Creates a dynamic glyph from a file.

Remarks

Creates a dynamic glyph from an image file. If the image file consists of an alpha channel, the method will honor the alpha values in the alpha channel, otherwise the alpha values will be set to be opaque (255). If the transparency color is not NULL, each pixel that matches the transparencyColor parameter will be transparent (its alpha values in the glyph will be set to 0).

Product Availability

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

Specified by:
createDynamicGlyphFromFile in interface IDynamicGlyphFactory
Parameters:
glyphType - A com.esri.arcgis.display.esriDynamicGlyphType constant (in)
fileName - The fileName (in)
transparencyColor - A reference to a com.esri.arcgis.display.IColor (in)
Returns:
A reference to a com.esri.arcgis.display.IDynamicGlyph
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

loadDynamicGlyphsGroup

public int loadDynamicGlyphsGroup(String fileName)
                           throws IOException,
                                  AutomationException
Loads a dynamic glyph group from files.

Remarks

The fileName points to an XML file. This XML file holds information regarding the image files that should be used in order to load the group image, and a database that describes the identity, location, and size of the glyphs in the group.

On success, the method returns the ID of the loaded group. This ID can be used to get a dynamic glyph from the group, using the get property IDynamicGlyphFactory.DynamicGlyph, or unload the glyphs group, using the method IDynamicGlyphFactory.UnloadDynamicGlyphsGroup.

Product Availability

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

Specified by:
loadDynamicGlyphsGroup in interface IDynamicGlyphFactory
Parameters:
fileName - The fileName (in)
Returns:
The groupId
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

unloadDynamicGlyphsGroup

public void unloadDynamicGlyphsGroup(int groupId)
                              throws IOException,
                                     AutomationException
Unloads a dynamic glyph group, and any corresponding resources.

Remarks

When the Dynamic Glyphs Group is no longer needed, it is important to call this method in order to release the Group’s resources.

Unused Dynamic Glyph Groups that are not unloaded might result in memory leaks on the graphic card memory.

Product Availability

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

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

getDynamicGlyph

public IDynamicGlyph getDynamicGlyph(int groupId,
                                     int glyphType,
                                     int index)
                              throws IOException,
                                     AutomationException
Retrieves a dynamic glyph from a glyph group.

Product Availability

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

Specified by:
getDynamicGlyph in interface IDynamicGlyphFactory
Parameters:
groupId - The groupId (in)
glyphType - A com.esri.arcgis.display.esriDynamicGlyphType constant (in)
index - The index (in)
Returns:
A reference to a com.esri.arcgis.display.IDynamicGlyph
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCreatedDynamicGlyphSize

public void getCreatedDynamicGlyphSize(int glyphType,
                                       int[] sizeX,
                                       int[] sizeY)
                                throws IOException,
                                       AutomationException
Indicates the texture size of the created dynamic glyph.

Remarks

The Created Dynamic Glyph Size values determine the size of the texture that will be created when the CreateDynamicGlyph method will be used. These values need to be a power of two (2, 4, 8, 16, 32, 64, 128, 256, etc). If they are not a power of two, the values will be snapped to the lower power of two values. For example, a value of 33 will be adjusted to be 32.

Product Availability

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

Specified by:
getCreatedDynamicGlyphSize in interface IDynamicGlyphFactory2
Parameters:
glyphType - A com.esri.arcgis.display.esriDynamicGlyphType constant (in)
sizeX - The sizeX (in/out: use single element array)
sizeY - The sizeY (in/out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setCreatedDynamicGlyphSize

public void setCreatedDynamicGlyphSize(int glyphType,
                                       int sizeX,
                                       int sizeY)
                                throws IOException,
                                       AutomationException
Indicates the texture size of the created dynamic glyph.

Remarks

The Created Dynamic Glyph Size values determine the size of the texture that will be created when the CreateDynamicGlyph method will be used. These values need to be a power of two (2, 4, 8, 16, 32, 64, 128, 256, etc). If they are not a power of two, the values will be snapped to the lower power of two values. For example, a value of 33 will be adjusted to be 32.

Product Availability

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

Specified by:
setCreatedDynamicGlyphSize in interface IDynamicGlyphFactory2
Parameters:
glyphType - A com.esri.arcgis.display.esriDynamicGlyphType constant (in)
sizeX - The sizeX (in)
sizeY - The sizeY (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createDynamicGlyphFromBitmap

public IDynamicGlyph createDynamicGlyphFromBitmap(int glyphType,
                                                  int hBmp,
                                                  boolean preserveAlphaChannel,
                                                  IColor transparencyColor)
                                           throws IOException,
                                                  AutomationException
Create a dynamic glyph from a bitmap handle.

Remarks

Creates a dynamic glyph from a handle to a bitmap. If preserveAlphaChannel parameter is set, the method will honor the alpha values in the alpha channel, otherwise the alpha values will be set to to be opaque (255). If the transparency color parameter is not NULL, each pixel that matches the transparencyColor will be transparent (its alpha values in the glyph will be set to 0).

Product Availability

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

To get a handle to the bitmap (hBmp) you can use RasterPicture::loadPicture() or BasicRasterPicture::loadPicture(). These methods return an IPicture which has a getHandle() method that can be used to get the handle.

Specified by:
createDynamicGlyphFromBitmap in interface IDynamicGlyphFactory2
Parameters:
glyphType - A com.esri.arcgis.display.esriDynamicGlyphType constant (in)
hBmp - The hBmp (A COM typedef) (in)
preserveAlphaChannel - The preserveAlphaChannel (in)
transparencyColor - A reference to a com.esri.arcgis.display.IColor (in)
Returns:
A reference to a com.esri.arcgis.display.IDynamicGlyph
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.