Arc: Accessing the Framework Dr Andy Evans. Code The code that goes in the addIn is then code to work with the ArcObjects framework. Ask App for Document.

Slides:



Advertisements
Similar presentations
OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
Advertisements

JTX Overview Overview of Job Tracking for ArcGIS (JTX)
Programming for Geographical Information Analysis: Advanced Skills Lecture 2: ArcObjects Framework Dr Andy Evans.
Feature requests for Case Manager By Spar Nord Bank A/S IBM Insight 2014 Spar Nord Bank A/S1.
ESRI Geoportal Extension 10 November 2010 Out-of-the-box capabilities and additional options.
CS 106 Introduction to Computer Science I 04 / 11 / 2008 Instructor: Michael Eckmann.
(C) 2010 Pearson Education, Inc. All rights reserved. Java™ How to Program, 8/e.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Encapsulation, Inheritance & Interfaces CSE 115 Spring 2006 February 27, March 1 & 3, 2006.
Intro to ArcMap Customization with Visual Basic  Create your own toolbars, buttons, interactive tools, and programs  Runs behind the scenes in ArcMap.
Chapter 7 GUI design. So far this semester Have programmed in a stop and wait mode Program displays dialog box and waits for user to respond This was.
Applet class The Applet class provides the essential framework that enables applets to be run by a web browser Applet do not have main method Applet depend.
GISC 6382 Applied GIS UT-Dallas Briggs 1 Customizing ArcGIS Spring 2008.
INTERNATIONAL SUMMER ACADEMIC COURSE UNIVESITY OF NIS ISAC – Android programming.
Arc: Programming Options Dr Andy Evans. Programming ArcGIS ArcGIS: Most popular commercial GIS. Out of the box functionality good, but occasionally: You.
Object Oriented Software Development
Unit 20: Event Driven Programming
Programming for Geographical Information Analysis: Advanced Skills Lecture 4: Arc Data Editing Addin Programming Dr Andy Evans.
CSE 331 Software Design & Implementation Hal Perkins Autumn 2012 Java Classes, Interfaces, and Types 1.
Java Beans.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Inheritance in C++ CS-1030 Dr. Mark L. Hornick.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Arc: AddIns Dr Andy Evans. Java Direct access to ArcObjects Framework inside and outside Arc. Ability to add components to the GUI. Ability to communicate.
DUE Hello World on the Android Platform.
9. Introduction to ArcObjects Most GIS analysis carried out within a GIS consists of a labor- intensive sequence of steps. Automating a GIS makes it possible.
1 Java Inheritance. 2 Inheritance On the surface, inheritance is a code re-use issue. –we can extend code that is already written in a manageable manner.
Applets and Frames CS 21a: Introduction to Computing I First Semester,
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Parallel Programming Dr Andy Evans. Parallel programming Various options, but a popular one is the Message Passing Interface (MPI). This is a standard.
REVIEW On Friday we explored Client-Server Applications with Sockets. Servers must create a ServerSocket object on a specific Port #. They then can wait.
Programming for Geographical Information Analysis: Advanced Skills Lecture 1: Introduction Programming Arc Dr Andy Evans.
Introduction of Geoprocessing Topic 7a 4/10/2007.
Android Security Model that Provide a Base Operating System Presented: Hayder Abdulhameed.
Struts 2 introduction. Struts 2 framework Struts 2 A full-featured web application framework for the Java EE platform The Java Servlet API exposes the.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Arc: Events Dr Andy Evans. Event communication Arc is, plainly, set up for Event Based Programming. You can register listeners with most GUI components.
Introduction of Geoprocessing Lecture 9. Geoprocessing  Geoprocessing is any GIS operation used to manipulate data. A typical geoprocessing operation.
Programming for Geographical Information Analysis: Core Skills Lecture 4: Program Flow II Methods.
Application development with Java Lecture 21. Inheritance Subclasses Overriding Object class.
© 2004 Pearson Addison-Wesley. All rights reserved April 14, 2006 Polymorphism ComS 207: Programming I (in Java) Iowa State University, SPRING 2006 Instructor:
The Natural Heritage Inventory Portal and ArcGIS Server One Model for the Architecture of an ArcGIS Server Application.
Review of Previous Classes Declaring Variables - var myVar:DataType = value Data Types – Number, uint, String, Boolean Functions – parameters, return.
Evolve What is a Component? A component is a unit of software that can be instantiated, and uses interfaces to describe which services it provides and.
Duke CPS DOOM Case Study: Wedgi l Wedgi: Wordbench: Editing with a Graphical Interface  see
Programming for Geographical Information Analysis: Advanced Skills Lecture 3: Arc Data Framework Dr Andy Evans.
Introduction of Geoprocessing Lecture 9 3/24/2008.
Arc: Communications between Addins Dr Andy Evans.
Chapter 4 Request and Response. Servlets are controlled by the container.
Introduction to Android OS Димитър Н. Димитров Astea Solutions AD.
Building KFS using KNS Presented by James SmithJustin Beltran University of ArizonaUniversity of California, Irvine.
Microsoft Foundation Classes MFC
BASIC API ON WEBSITE.
Abstract Factory Pattern
Reactive Android Development
Android Studio, Android System Basics and Git
A3 Redux.
Unit 20: Event Driven Programming
Abstract Factory Pattern
Programming for Geographical Information Analysis: Advanced Skills
Lecture 3 Introducing ArcObjects
Java Programming Language
Android Topics UI Thread and Limited processing resources
Programming for Geographical Information Analysis: Advanced Skills
Arc: Getting Layers Dr Andy Evans.
Access control Many languages have a notion of 'private' variables that can't be accessed from outside an object. For example, if we were sending someone.
Building Add-ins for ArcGIS Desktop in .NET
Device Access Tomas Lukša.
Programming Arc.
Presentation transcript:

Arc: Accessing the Framework Dr Andy Evans

Code The code that goes in the addIn is then code to work with the ArcObjects framework. Ask App for Document Ask Document for Maps Ask Maps for a Map Ask Map for Layers Ask Layers for Layer etc. The running version of Arc is accessed via gatekeeper objects. You then request objects from these, and subsequent objects from the objects you get back.

init(IApplication app) Most addIns come with a init method that can be overridden. This is sent the application as an entry point for the running framework. import com.esri.arcgis.framework.*; private IApplication public void init(IApplication app){ this.app = app; }

Document You can use this to get hold of the current document. This is the current data and GUI. import com.esri.arcgis.arcmapui.*; IMxDocument mxDoc = (IMxDocument)app.getDocument();

API It is then just a matter of finding how to do stuff in the API docs: java/api/arcobjects/index.html

N.B. The code utilises Java Used as a marker for software intending to process the

N.B.II Arc returns objects that implement multiple interfaces. You generally cast the object to a specific interface when using it. IMxDocument mxDoc = (IMxDocument)app.getDocument(); There is nothing to stop you recasting it to another interface to use different methods in it: IDocument iDoc = (IDocument) mxDoc; Infact, it is very common.

The COM In Microsoft languages, this reassignment of interface labels is key. It allows chunks of code to use other chunks of code without knowing anything other than the interface names. It is used to hold together a great deal of the Component Object Model (COM) at the heart of Microsoft software. ArcGIS is built around the COM, so this is a common thing to see.

Interfaces This requires some care. You might think that redefining everything as the right object would be sensible: public void init(IApplication app){ Application a = (Application)app; You could then use all the methods. However, while objects Arc gives you will match the interfaces, they may not do anything sensible.

Interfaces For example, this works in ArcMap: public void init(IApplication app){ Application a = (Application)app; IGxSelection selec = a.getSelection(); JOptionPane.showMessageDialog (null, selec.toString()); } But doesn’t give you anything sensible, as IGxSelection is an ArcCatalog class, and here the Application object is the ArcMap Application object, not the ArcCatalog one.

Interfaces In general, better to get the interface right and keep the object defined by its interfaces. As well as explicitly casting, just attaching the right label works if you are going to a less specific class: IMxDocument mxDoc = app.getDocument(); But generally in the examples you’ll see an explicit cast because it saves looking up the relationship. In the API Docs, in general go for the interface list at the top of the class. Interfaces generally start “I” Then “Mx” for ArcMap, “Gx” for ArcCatalog.

ArcMap IApplication methods newDocument(boolean userPickTemplate?, String path) openDocument(String optionalPath) refreshWindow() saveDocument(String optionalPath) If the paths are null, the usual “new”, “open”, and “save” processes occur.

ArcMap IMXDocument methods Used for getting data: getActiveView() i.e. layout view or data view data. getFocusMap() i.e. currently selected/shown map. getMaps() i.e. all maps. getSelectedItem() i.e. that the user has picked. getSelectedLayer() i.e. that the user has picked. Documents also implement IDocument, the main use of which is programmatically controlling toolbars.