com.esri.arcgis.display
Class SimpleTextParser

java.lang.Object
  extended by com.esri.arcgis.display.SimpleTextParser
All Implemented Interfaces:
ITextParser, com.esri.arcgis.interop.RemoteObjRef, IPersist, Serializable

public class SimpleTextParser
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ITextParser, IPersist

Simple text parser object.

Description

The text parser used in ArcMap. This object changes the formatting of all or part of a text string.

Remarks

The following table describes the supported tags and their syntax. See the ArcGIS for Desktop Help for more information.

Tag

Syntax
Font

<FNT name="Arial" size="18">My text</FNT>

<FNT name="Arial" scale="200">My text</FNT>

Color <CLR red="255" green="255" blue="255">My text</CLR>
Bold <BOL>My text</BOL>
Italic <ITA>My text</ITA>
Underline <UND>My text</UND>
All Caps <ACP>My text</ACP>
Small Caps <SCP>My text</SCP>
Superscript <SUP>My text</SUP>
Character spacing (0%=regular) <CHR spacing="25">My text</CHR>
Character width (100%=regular) <CHR width="150">My text</CHR>
Word spacing (100%=regular) <WRD spacing="150">My text</WRD>
Leading (0 pts=regular) <LIN leading="12">My text</LIN>
Un-Italic <_ITA>My text</_ITA>
Un-Underline <_UND>My text</_UND>
Un-Superscript <_SUP>My text</_SUP>
Un-Bold <_BOL>My text</_BOL>

When the SimpleTextParser is used to parse text in a labeling expression, tag syntax varies slightly. Read more about this in the ArcGIS for Desktop Help under the index entry "labeling, expressions."

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
SimpleTextParser()
          Constructs a SimpleTextParser using ArcGIS Engine.
SimpleTextParser(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
SimpleTextParser theSimpleTextParser = (SimpleTextParser) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 void getClassID(GUID[] pClassID)
          getClassID
static String getClsid()
          getClsid.
 String getText()
          Text to parse.
 ITextSymbol getTextSymbol()
          The text symbol.
 int hashCode()
          the hashcode for this object
 void hasTags(boolean[] hasTags)
          Returns true if the text contains tags and false if it does not.
 void next()
          Parses the next tag and string and sets the TextSymbol accordingly.
 void reset()
          Resets the text string tag sequence to the beginning.
 void setText(String text)
          Text to parse.
 void setTextSymbolByRef(ITextSymbol textSym)
          The text symbol.
 
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

SimpleTextParser

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

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

SimpleTextParser

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

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

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

getTextSymbol

public ITextSymbol getTextSymbol()
                          throws IOException,
                                 AutomationException
The text symbol.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setTextSymbolByRef

public void setTextSymbolByRef(ITextSymbol textSym)
                        throws IOException,
                               AutomationException
The text symbol.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getText

public String getText()
               throws IOException,
                      AutomationException
Text to parse.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getText in interface ITextParser
Returns:
The text
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setText

public void setText(String text)
             throws IOException,
                    AutomationException
Text to parse.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

hasTags

public void hasTags(boolean[] hasTags)
             throws IOException,
                    AutomationException
Returns true if the text contains tags and false if it does not.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

next

public void next()
          throws IOException,
                 AutomationException
Parses the next tag and string and sets the TextSymbol accordingly.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
next in interface ITextParser
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

reset

public void reset()
           throws IOException,
                  AutomationException
Resets the text string tag sequence to the beginning.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
reset in interface ITextParser
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClassID

public void getClassID(GUID[] pClassID)
                throws IOException,
                       AutomationException
getClassID

Description

IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getClassID in interface IPersist
Parameters:
pClassID - A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.