28
Building Desktop Applications with Java Building Desktop Applications with Java Eric Bader Eric Bader Vishal Agarwal Vishal Agarwal

Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Building Desktop Applications with JavaBuilding Desktop Applications with Java

Eric BaderEric BaderVishal AgarwalVishal Agarwal

Page 2: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

IntroductionsIntroductions……

•• Who are we?Who are we?–– Core Engine Java dev team members.Core Engine Java dev team members.

•• Who are you?Who are you?–– ArcGIS Desktop developers/users?ArcGIS Desktop developers/users?–– MapObjects Java users?MapObjects Java users?–– Current ArcGIS Engine developers?Current ArcGIS Engine developers?–– Target Platforms?Target Platforms?

Page 3: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

AgendaAgenda

•• OverviewOverview•• Key FeaturesKey Features•• Coarse grain Developer componentsCoarse grain Developer components•• Working with SwingWorking with Swing•• Custom Commands and ToolsCustom Commands and Tools•• WhatWhat’’s new in 9.2s new in 9.2

Page 4: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Overview of ArcGIS Engine JavaOverview of ArcGIS Engine Java

•• Java SDK for developing cross platform Java SDK for developing cross platform desktop GIS Applications.desktop GIS Applications.

•• Collection of numerous java objects called Collection of numerous java objects called ‘‘arcobjectsarcobjects’’ and tools for mapping, and tools for mapping, visualization, data management and GIS visualization, data management and GIS analysis.analysis.

•• Create stand alone GIS apps or Embed GIS Create stand alone GIS apps or Embed GIS functions in existing J2SE applicationsfunctions in existing J2SE applications

Page 5: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Some User ApplicationsSome User Applications

Page 6: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

ArchitectureArchitecture

ArcObjects

Java Visual Beans and utilitiesJava Visual Beans and utilities

Windows / Solaris / Linux

Java Proxy ObjectsJava Proxy Objects

Page 7: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

ArcGIS Engine FunctionalityArcGIS Engine Functionality

•• 2D and 3D visualization2D and 3D visualization•• Read all supported ESRI data formats Read all supported ESRI data formats

including the including the geodatabasesgeodatabases..•• Map authoring (create and edit MXD)Map authoring (create and edit MXD)•• ArcGIS level cartographyArcGIS level cartography•• GeoGeo--coding, query, analysis.coding, query, analysis.•• Simple editing (Simple editing (shpshp and and pGDBpGDB))•• With Extensions:With Extensions:

–– Multi user editing, Spatial, 3D and Network analysisMulti user editing, Spatial, 3D and Network analysis

Page 8: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Java Beans Java Beans –– Drag and Drop developmentDrag and Drop development

•• MapBeanMapBean•• PageLayoutBeanPageLayoutBean•• ToolbarBeanToolbarBean•• TOCBeanTOCBean•• ReaderBeanReaderBean•• SceneBeanSceneBean•• GlobeBeanGlobeBean

Page 9: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

More than100 tools and commands included.More than100 tools and commands included.Utility classes to help you create own custom ToolsUtility classes to help you create own custom Tools

Tools and CommandsTools and Commands

Page 10: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Things to NoteThings to Note

•• Post InstallPost Install•• InitializationInitialization

–– EngineInitializerEngineInitializer -- initializeVisualBeansinitializeVisualBeans•• Licensing Licensing

–– AoInitializeAoInitialize –– initialize() AND initialize() AND checkoutExtensioncheckoutExtension()()•• Shutting DownShutting Down

–– AoInitializeAoInitialize

Page 11: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Why use Proxy Classes?Why use Proxy Classes?

•• They are only for getting a handle to the They are only for getting a handle to the underlying objectunderlying objectPolygon Polygon polygonpolygon = new Polygon();= new Polygon();

NOTNOTIPolygonIPolygon polygon = polygon = new new PolygonProxyPolygonProxy();();

IEnvelopeIEnvelope e = e = geom.getEnvelopegeom.getEnvelope();();ITopologicalOperatorITopologicalOperator topotopo = new = new ITopologicalOperatorProxy(eITopologicalOperatorProxy(e););

topo.buffer(4.0);topo.buffer(4.0);

Page 12: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Bridge and GEN InterfacesBridge and GEN Interfaces

•• Certain ArcObjects do not work properly in Certain ArcObjects do not work properly in Java, we createJava, we create

•• GEN Interfaces:GEN Interfaces:–– These are created to substitute the unThese are created to substitute the un--compatible compatible

interfacesinterfaces–– Ex. Ex. IEnvelopeGENIEnvelopeGEN replaces replaces IEnvelopeIEnvelope..

•• BRIDGE Interfaces:BRIDGE Interfaces:–– For the more basic GIS service, to reduce the For the more basic GIS service, to reduce the

overhead.overhead.–– Ex. Ex. IGeometryBridgeIGeometryBridge

Page 13: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

ArcObjects and SwingArcObjects and Swing

Tips or PopTips or Pop--ups donups don’’t work properly?t work properly?–– JPopupMenu.setLightWeightPopupEnabledJPopupMenu.setLightWeightPopupEnabled

•• Application Freezes?Application Freezes?–– Use 9.1 SP1Use 9.1 SP1–– Use Event Dispatcher threadUse Event Dispatcher thread

javax.swing.SwingUtilities.invokeLatjavax.swing.SwingUtilities.invokeLater(newer(new RunnableRunnable(){ (){

public void run(){ public void run(){ //Code Here//Code Here}});}});

Page 14: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Events and DrawingEvents and Drawing

•• DonDon’’t add Java Event listeners to the Beanst add Java Event listeners to the Beans•• Each Bean has its own event ListenerEach Bean has its own event Listener•• DonDon’’t use the t use the Java.awt.GraphicsJava.awt.Graphics or or

Graphics2D to draw Graphics2D to draw grpahicsgrpahics –– not supportednot supported–– Use Use GraphicsContainerGraphicsContainer of of ActiveViewActiveView–– Several Tools are available.Several Tools are available.–– You need BMP images for your graphic elementsYou need BMP images for your graphic elements–– Use the Graphics draw phase to refresh the map Use the Graphics draw phase to refresh the map ––

Partial RefreshPartial Refresh

Page 15: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Special to JavaSpecial to Java

•• Methods take output as parameters:Methods take output as parameters:IBasicMapIBasicMap basicmapbasicmap [] = {null};[] = {null};

ILayerILayer layer [] = {null};layer [] = {null};Object other [] = {null};Object other [] = {null};intint itemTypeitemType [] = {0};[] = {0};Object Object pIndexpIndex [] = {null [] = {null

};};

toc.hitTest(e.getXtoc.hitTest(e.getX(), (), e.getYe.getY(), (), itemTypeitemType, , basicmapbasicmap, layer, , layer, pIndexpIndex, , other);other);

Page 16: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Custom Commands and ToolsCustom Commands and Tools

•• BaseCommand & BaseTool as helper classesBaseCommand & BaseTool as helper classes•• Key Methods Key Methods –– onCreateonCreate() and the Constructor() and the Constructor•• Use Use HookHelperHookHelper•• Use Use isEnabledisEnabled() to maintain the state() to maintain the state•• Use Swing worker thread to invoke Swing Use Swing worker thread to invoke Swing

components.components.•• You cannot use You cannot use JToolBarJToolBar with our tools.with our tools.

Page 17: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

SummarySummary

•• Runtime OverviewRuntime Overview•• Initialization and licensingInitialization and licensing•• Coarse grained componentsCoarse grained components•• Working with SwingWorking with Swing•• Events and AnimationEvents and Animation•• Custom Commands and ToolsCustom Commands and Tools

Page 18: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

ArcGIS 9.2 FeaturesArcGIS 9.2 Features

Page 19: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

WhatWhat’’s new in 9.2s new in 9.2

• Ready-to-use Out-of-the-Box• Improve Stability• API Improvements• New Packages and Extensions• File GDB• New Visual Components• New Help System and samples• IDE Integration• Support for JDK 1.5• ArcGIS Desktop is ‘Java Enabled’

Page 20: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

API ImprovementsAPI Improvements

• Support for Casting and InstanceOf– No QI or Proxy calls

• Hand Crafted Geo-Processing API• Javadoc improvements

– No unnecessary constructors, methods

Page 21: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

New Visual Beans New Visual Beans –– Shared Code!Shared Code!

• New Controls and Commands– Symbology Control– Several new tools – Identify, measure, editing…

• New Visual Beans for RAD– Attribute Table– Query Selection– Selection by Location– Symbology– Buffer

Page 22: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

SamplesSamples

• Reflect API improvements• Better Structure

– Easy to navigate– HTML Readme

• Easier to Run – Executable Jars– Simple Import into IDEs

Page 23: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Java Help SystemJava Help System

• A central repository for all help content– Better Structure– Easier to get started– Several New docs

• Scenarios• Deployment• Using IDEs• FAQ

Page 24: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

GeoGeo--processing and Trackingprocessing and Tracking

• Refined API• Tool Generator

– Support for models written in ArcGIS Desktop• Supporting Documents• Samples• Developer Scenario

– How to consume custom Routing model– How to Track events and time windows

Page 25: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

IDE IntegrationIDE Integration

• ArcGIS Eclipse Plug-ins – Java Help System– Samples– Templates– Code shortcuts– Geo-Processing Tool Generator– Local update site

Page 26: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Summary Summary –– ArcGIS EngineArcGIS Engine

•• Better API Better API –– 100% Pure Java experience100% Pure Java experience•• Performance and stability improvementsPerformance and stability improvements•• Better user experience:Better user experience:

–– IDE Integration + Help System + samplesIDE Integration + Help System + samples•• More holistic approach for solving GIS More holistic approach for solving GIS

ProblemsProblems–– Out of box components and extended samples.Out of box components and extended samples.

Page 27: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Developer ResourcesDeveloper Resources

•• Engine Developer Kit includesEngine Developer Kit includes–– Help SystemHelp System–– Developer DocumentationDeveloper Documentation–– Sample CodeSample Code–– Detailed Object Model DiagramsDetailed Object Model Diagrams–– Utilities and ToolsUtilities and Tools

•• For Additional Support:For Additional Support:–– EDN EDN –– http://edn.esri.comhttp://edn.esri.com–– User Forum: User Forum: http://forums.esri.comhttp://forums.esri.com

Page 28: Building Desktop Applications with Java · Overview of ArcGIS Engine Java • Java SDK for developing cross platform desktop GIS Applications. • Collection of numerous java objects

Thanks!Thanks!

More Questions?More Questions?

Join us for Join us for Tech TalkTech Talk

2:30 PM 2:30 PM –– 3:00PM Community Center3:00PM Community Center