|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.interop.Dispatch com.esri.arcgis.framework.IApplicationProxy
public class IApplicationProxy
Provides access to members that query or modify the application.
The Application object is the core object in the ArcMap and ArcCatalog applications. This object represents the application itself and acts as the central point where access is gained to other objects in the system. The Application object's primary interface is IApplication. This interface provides access to the Document object, the extensions, the StatusBar object, the Templates object, the currently selected tool, and the Visual Basic Editor. There are several methods that allow you to open, save, and print documents, lock and unlock the application from user customizations, display dialogs, and exit the application.
ICommand.onCreate(java.lang.Object)
,
IDocument.getParent()
,
com.esri.arcgis.arcmapUI.IMxApplication
,
Serialized FormField Summary | |
---|---|
boolean |
noncastable
|
Fields inherited from class com.esri.arcgis.interop.Dispatch |
---|
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef |
Constructor Summary | |
---|---|
|
IApplicationProxy()
|
|
IApplicationProxy(Object obj)
|
protected |
IApplicationProxy(Object obj,
String iid)
|
Method Summary | |
---|---|
void |
addListener(String iidStr,
Object theListener,
Object theSource)
|
IExtension |
findExtensionByCLSID(IUID extensionCLSID)
Finds an extension by its CLSID. |
IExtension |
findExtensionByName(String extensionName)
Finds an extension by its name. |
String |
getCaption()
The caption of this application. |
ICommandItem |
getCurrentTool()
The currently selected tool. |
IDocument |
getDocument()
The document that is currently loaded in the application. |
int |
getHWnd()
The handle of the application's window. |
String |
getName()
The name of this application. |
IStatusBar |
getStatusBar()
The statusbar of this application. |
ITemplates |
getTemplates()
The templates collection. |
Object |
getVBE()
The Visual Basic Environment. |
boolean |
isDialogVisible(int dialogID)
Indicates if the specified dialog is visible in the application. |
boolean |
isVisible()
Indicates if the application window is visible. |
void |
lockCustomization(String password,
ICustomizationFilter custFilter)
Locks the application's user interface against any customizations. |
void |
newDocument(boolean selectTemplate,
String templatePath)
Creates a new document in this application. |
void |
openDocument(String path)
Opens a document in this application. |
void |
printDocument()
Displays the Print dialog. |
void |
printPreview()
Displays how the document will look like when it is printed. |
void |
refreshWindow()
Redraws the application window. |
void |
removeListener(String iidStr,
Object theListener)
|
void |
saveAsDocument(String saveAsPath,
boolean saveAsCopy)
Saves the document that is currently open in this application to a different file. |
void |
saveDocument(String saveAsPath)
Saves the document that is currently open in this application. |
void |
setCaption(String caption)
The caption of this application. |
void |
setCurrentToolByRef(ICommandItem tool)
The currently selected tool. |
void |
setVisible(boolean visible)
Indicates if the application window is visible. |
Object |
showDialog(int dialogID,
Object bShow)
Displays the specified dialog in the application. |
void |
shutdown()
Terminates the application. |
void |
unlockCustomization(String password)
Unlocks previous user interface customization lock. |
Methods inherited from class com.esri.arcgis.interop.Dispatch |
---|
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean noncastable
Constructor Detail |
---|
public IApplicationProxy()
public IApplicationProxy(Object obj) throws IOException
IOException
protected IApplicationProxy(Object obj, String iid) throws IOException
IOException
Method Detail |
---|
public void addListener(String iidStr, Object theListener, Object theSource) throws IOException
addListener
in class com.esri.arcgis.interop.Dispatch
IOException
public void removeListener(String iidStr, Object theListener) throws IOException
removeListener
in class com.esri.arcgis.interop.Dispatch
IOException
public String getName() throws IOException, AutomationException
Returns the string ArcMap for the ArcMap application.
Returns the string ArcCatalog for the ArcCatalog application.
getName
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IDocument getDocument() throws IOException, AutomationException
In ArcMap, the Document is the currently loaded document.
In ArcCatalog, the Document is the Normal template.
Both ArcMap and ArcCatalog applications are composed of several things including a document. The document is an object which controls the representation of data. In ArcMap, the document object is the MxDocument CoClass and in ArcCatalog it is the GxDocument CoClass. Access to these CoClasses is provided through this property.
getDocument
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDocument
,
GxDocument
,
com.esri.arcgis.arcmapUI.MxDocument
public IStatusBar getStatusBar() throws IOException, AutomationException
The status bar is the horizontal area at the bottom of an ArcGIS application window. It provides information about the selected command. For example, if you select a layer in the table of contents in ArcMap, the status bar will tell you how many features are currently selected. It may also display a progress bar while something is being processed.
The IStatusBar interface allows you to set the properties of the status bar.
getStatusBar
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IStatusBar
public Object showDialog(int dialogID, Object bShow) throws IOException, AutomationException
Refer to the esriMxDlgIDs Constants help topic for a listing of the dialog ids in ArcMap.
Refer to the esriGxDlgIDs Constants help topic for a listing of the dialog ids in ArcCatalog.
This example shows the TOC in ArcMap if it is not already visible. You would get m_app from the hook in ICommand::OnCreate().
showDialog
in interface IApplication
dialogID
- The dialogID (in)bShow
- A Variant (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.com.esri.arcgis.arcmapUI.esriMxDlgIDs
,
com.esri.arcgis.arccatalogui.esriGxDlgIDs
public boolean isDialogVisible(int dialogID) throws IOException, AutomationException
Refer to the esriMxDlgIDs Constants help topic for a listing of the dialog ids in ArcMap.
Refer to the esriGxDlgIDs Constants help topic for a listing of the dialog ids in ArcCatalog.
isDialogVisible
in interface IApplication
dialogID
- The dialogID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.com.esri.arcgis.arcmapUI.esriMxDlgIDs
,
com.esri.arcgis.arccatalogui.esriGxDlgIDs
public ICommandItem getCurrentTool() throws IOException, AutomationException
getCurrentTool
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ICommandItem
public void setCurrentToolByRef(ICommandItem tool) throws IOException, AutomationException
This VBA macro makes the Identify tool the currently selected tool in ArcMap.
Public Sub SetCurrentTool()
Dim pItem As ICommandItem
' Use the built-in ArcId module to find unique identifier
' for the Identify tool
Set pItem = CommandBars.Find(arcid.Query_Identify)
Set Application.CurrentTool = pItem
End Sub
setCurrentToolByRef
in interface IApplication
tool
- A reference to a com.esri.arcgis.framework.ICommandItem (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ICommandItem
public Object getVBE() throws IOException, AutomationException
The VBE is the root object that provides access to all other objects represented in Visual Basic for Applications that is embedded in the application.
getVBE
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void newDocument(boolean selectTemplate, String templatePath) throws IOException, AutomationException
selectTemplate Specify True if you want the New document dialog to be opened to allow the user to select a template. [Optional]
templatePath is a string representing the path and filename of the template to base the new document on if selectTemplate is False. [Optional]
If selectTemplate is True, the New document dialog is displayed.
If templatePath is not specified, the New document dialog is displayed regardless of the value of selectTemplate.
Note, this method does not work in ArcCatalog.
The following example creates a new document in ArcMap using the Normal template. You would get m_app from the hook in ICommand::OnCreate().
newDocument
in interface IApplication
selectTemplate
- The selectTemplate (in, optional, pass false if not required)templatePath
- The templatePath (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void openDocument(String path) throws IOException, AutomationException
Path is a string representing the path and filename of the document to be opened. [Optional]
If no Path is specified, the Open dialog is displayed.
Note, this method does not work in ArcCatalog.
openDocument
in interface IApplication
path
- The path (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void saveDocument(String saveAsPath) throws IOException, AutomationException
saveAsPath is a string representing a path and filename for the document that is being saved. [Optional]
If this document is a new document that has not been saved yet and a saveAsPath is not specified, the Save As dialog will be displayed.
saveDocument
in interface IApplication
saveAsPath
- The saveAsPath (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void saveAsDocument(String saveAsPath, boolean saveAsCopy) throws IOException, AutomationException
saveAsPath is a string representing a new path and filename for the document that is being saved. [Optional]
saveAsCopy specify True if you want to save a copy of the document to a new filename but keep the original document open in the application; otherwise False. [Optional]
Note, this method does not work in ArcCatalog.
saveAsDocument
in interface IApplication
saveAsPath
- The saveAsPath (in, optional, pass null if not required)saveAsCopy
- The saveAsCopy (in, optional, pass false if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void printPreview() throws IOException, AutomationException
Note, this method does not work in ArcCatalog.
printPreview
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void printDocument() throws IOException, AutomationException
Note, this method does not work in ArcCatalog.
printDocument
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void lockCustomization(String password, ICustomizationFilter custFilter) throws IOException, AutomationException
password is a string representing a password. The string must be at least five characters long.
custFilter is a customization filter object which implements the ICustomizationFilter interface. [Optional]
lockCustomization
in interface IApplication
password
- The password (in)custFilter
- A reference to a com.esri.arcgis.framework.ICustomizationFilter (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ICustomizationFilter
public void unlockCustomization(String password) throws IOException, AutomationException
password is a string representing the password that was used to lock customization. The string must be at least five characters long.
unlockCustomization
in interface IApplication
password
- The password (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void refreshWindow() throws IOException, AutomationException
refreshWindow
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public ITemplates getTemplates() throws IOException, AutomationException
The Templates object is a collection of the templates that are currently loaded in the application. In ArcCatalog, the Normal template, Normal.gxt, is the only template that is ever loaded. In ArcMap, there is either two or three templates loaded. The Normal template, Normal.mxt, is always loaded. Also, the document is considered a template is this case; there is always a document loaded in ArcMap. Optionally, the document can be based on another template referred to as a base template.
getTemplates
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.ITemplates
public int getHWnd() throws IOException, AutomationException
getHWnd
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IExtension findExtensionByName(String extensionName) throws IOException, AutomationException
extensionName specifies the name of an extension as a string.
To find the Name of an ESRI extension, refer to the following technical document:
ArcGIS Developer Help > Technical Documents > Names and IDs > Extensions
If an extension is registered as a Just-In-Time extension, FindExtensionByName may return nothing. The safest way to get a reference to any extension is to use FindExtensionByCLSID.
findExtensionByName
in interface IApplication
extensionName
- The extensionName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IExtension
public IExtension findExtensionByCLSID(IUID extensionCLSID) throws IOException, AutomationException
ExtensionCLSID specifies the unique identifier (UID) of an extension.
COM coclasses are identified by a globally unique identifier (GUID). There are two formats for the GUID for a coclass: a class ID (CLSID) and a ProgID. The ProgID is a text alias for a CLSID. The UID coclass can be used to represent the GUID of an extension object. You can set the IUID.Value property to either the CLSID or the ProgID.
To find the CLSID and ProgID of an ESRI extension, refer to the following technical document:
ArcGIS Developer Help > Technical Documents > Names and IDs > Extensions
For your custom extensions, the ProgID is a string composed of the name of your project used to make the extension and the class name of the extension. For example if you have a Visual Basic project called MyCustomExt and there is a class module for your extension called clsMyExtension in that project, then the ProgID for this command would be "MyCustomExt.clsMyExtension". To find the CLSID for this command, you could search the system registry for this ProgID.
findExtensionByCLSID
in interface IApplication
extensionCLSID
- A reference to a com.esri.arcgis.system.IUID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IExtension
,
IUID
public void shutdown() throws IOException, AutomationException
shutdown
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isVisible() throws IOException, AutomationException
Set the Visible property to True to make the application window visible.
isVisible
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setVisible(boolean visible) throws IOException, AutomationException
Set the Visible property to True to make the application window visible.
setVisible
in interface IApplication
visible
- The visible (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setCaption(String caption) throws IOException, AutomationException
Public Sub SetCaption()
Application.Caption = "My Custom Application"
End Sub
setCaption
in interface IApplication
caption
- The caption (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getCaption() throws IOException, AutomationException
The Caption is the string that appears as the title of the application's main window.
getCaption
in interface IApplication
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |