com.esri.arcgis.display
Interface ITemplate

All Superinterfaces:
Serializable
All Known Implementing Classes:
Template

public interface ITemplate
extends Serializable

Provides access to members that control the template.

Description

ITemplate is the pattern of marks and gaps that are used to draw a line symbol. A mark and gap together are refered to as a pattern element. The pattern element is drawn based on the value of the mark and gap, which is specified in points (approx 1/72 inch). The mark is something that is drawn, hence it can be a marker symbol in a IMarkerLineSymbol , a hash in a IHashLineSymbol , or a dash in a ICartographicLineSymbol . The width of the mark is arbitrary, in that you must specify it (in previous versions of ArcInfo and ArcView, the width of the mark and gap were the same size, and based on the width of the element that was being repeated within the template). The mark that is drawn in the template (marker hash, or dash) will be centered on the mark. Thus, if you have a marker symbol that is size 10, you would likely specify a mark value of 10. Then if you want no gap between the markers, specify the gap to be 0 (zero). But if you wanted a space of 20 points between each marker, then you'd specify the gap to be 20.

If you don't want the mark to be the first element in the line, then you need to use at least two pattern elements. The first one would start with a mark of 0 (zero), which indicates that no mark is to be drawn, and then a gap that matches the distance you want to inset the mark along the line.

Product Availability

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

See Also:
IHashLineSymbol, ILineProperties, ILineSymbol, ITemplate, ICartographicLineSymbol, IMultiLayerLineSymbol, IPictureLineSymbol

Method Summary
 void addPatternElement(double mark, double gap)
          Adds a pattern element.
 void clearPatternElements()
          Clears all pattern elements.
 void deletePatternElement(int index)
          Removes the pattern element at the given index.
 IGeometry getGeometry()
          The pattern geometry.
 double getInterval()
          The interval.
 void getPatternElement(int index, double[] mark, double[] gap)
          Gets pattern element properties for a given index.
 int getPatternElementCount()
          The number of pattern elements.
 void movePatternElement(int fromIndex, int toIndex)
          Moves a pattern element.
 void queryNextLine(IGeometry pGeometry)
          Queries for the next line in the pattern.
 void queryNextPoint(IPoint pPoint, double[] pAngle)
          Queries for the next point in the pattern.
 void reset()
          Resets the enumerator.
 void setGeometryByRef(IGeometry ppGeometry)
          The pattern geometry.
 void setInterval(double interval)
          The interval.
 void setup(int hDC, ITransformation transformation, ILineSymbol lineSym)
          Set up items needed by template.
 

Method Detail

setup

void setup(int hDC,
           ITransformation transformation,
           ILineSymbol lineSym)
           throws IOException,
                  AutomationException
Set up items needed by template.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
hDC - The hDC (A COM typedef) (in)
transformation - A reference to a com.esri.arcgis.geometry.ITransformation (in)
lineSym - A reference to a com.esri.arcgis.display.ILineSymbol (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPatternElementCount

int getPatternElementCount()
                           throws IOException,
                                  AutomationException
The number of pattern elements.

Description

PatternElementCount is the number of pattern elements that have been added to the ITemplate object. A pattern element is one mark and one gap.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPatternElement

void getPatternElement(int index,
                       double[] mark,
                       double[] gap)
                       throws IOException,
                              AutomationException
Gets pattern element properties for a given index.

Description

GetPatternElement returns the pattern element based on the pattern element index you specify.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
index - The index (in)
mark - The mark (out: use single element array)
gap - The gap (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addPatternElement

void addPatternElement(double mark,
                       double gap)
                       throws IOException,
                              AutomationException
Adds a pattern element.

Description

AddPatternElement adds a new pattern element to the ITemplate object. A pattern element is a mark and a gap value.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
mark - The mark (in)
gap - The gap (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deletePatternElement

void deletePatternElement(int index)
                          throws IOException,
                                 AutomationException
Removes the pattern element at the given index.

Description

DeletePatternElement removes the specified pattern element from the ITemplate object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
index - The index (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

movePatternElement

void movePatternElement(int fromIndex,
                        int toIndex)
                        throws IOException,
                               AutomationException
Moves a pattern element.

Description

MovePatternElement moves one pattern element at the specified index in the ITemplate to a different position in the template. Use the PatternElementCount method to verify the number of pattern elements.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
fromIndex - The fromIndex (in)
toIndex - The toIndex (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

clearPatternElements

void clearPatternElements()
                          throws IOException,
                                 AutomationException
Clears all pattern elements.

Description

ClearPatternElements removes all the pattern elements from the ITemplate object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getInterval

double getInterval()
                   throws IOException,
                          AutomationException
The interval.

Description

Interval is the multiplier that determines the width of the marks and gaps in a pattern element. Each mark and gap value is multiplied by the Interval when the line symbol is drawn. The units that the marks and gaps are specified in are points (approx. 1/72 inch).

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The interval
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setInterval

void setInterval(double interval)
                 throws IOException,
                        AutomationException
The interval.

Description

Interval is the multiplier that determines the width of the marks and gaps in a pattern element. Each mark and gap value is multiplied by the Interval when the line symbol is drawn. The initial size of the mark and gap is derived from the MarkSize property (WHICH DOES NOT EXIST YET!!!!)

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
interval - The interval (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGeometry

IGeometry getGeometry()
                      throws IOException,
                             AutomationException
The pattern geometry.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geometry.IGeometry
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setGeometryByRef

void setGeometryByRef(IGeometry ppGeometry)
                      throws IOException,
                             AutomationException
The pattern geometry.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
ppGeometry - A reference to a com.esri.arcgis.geometry.IGeometry (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryNextPoint

void queryNextPoint(IPoint pPoint,
                    double[] pAngle)
                    throws IOException,
                           AutomationException
Queries for the next point in the pattern.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
pPoint - A reference to a com.esri.arcgis.geometry.IPoint (in)
pAngle - The pAngle (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryNextLine

void queryNextLine(IGeometry pGeometry)
                   throws IOException,
                          AutomationException
Queries for the next line in the pattern.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
pGeometry - A reference to a com.esri.arcgis.geometry.IGeometry (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

reset

void reset()
           throws IOException,
                  AutomationException
Resets the enumerator.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.