Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
Building Desktop Applications with JavaBuilding Desktop Applications with Java
Eric BaderEric BaderVishal AgarwalVishal Agarwal
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?
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
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
Some User ApplicationsSome User Applications
ArchitectureArchitecture
ArcObjects
Java Visual Beans and utilitiesJava Visual Beans and utilities
Windows / Solaris / Linux
Java Proxy ObjectsJava Proxy 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
Java Beans Java Beans –– Drag and Drop developmentDrag and Drop development
•• MapBeanMapBean•• PageLayoutBeanPageLayoutBean•• ToolbarBeanToolbarBean•• TOCBeanTOCBean•• ReaderBeanReaderBean•• SceneBeanSceneBean•• GlobeBeanGlobeBean
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
Things to NoteThings to Note
•• Post InstallPost Install•• InitializationInitialization
–– EngineInitializerEngineInitializer -- initializeVisualBeansinitializeVisualBeans•• Licensing Licensing
–– AoInitializeAoInitialize –– initialize() AND initialize() AND checkoutExtensioncheckoutExtension()()•• Shutting DownShutting Down
–– AoInitializeAoInitialize
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);
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
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}});}});
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
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);
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.
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
ArcGIS 9.2 FeaturesArcGIS 9.2 Features
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’
API ImprovementsAPI Improvements
• Support for Casting and InstanceOf– No QI or Proxy calls
• Hand Crafted Geo-Processing API• Javadoc improvements
– No unnecessary constructors, methods
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
SamplesSamples
• Reflect API improvements• Better Structure
– Easy to navigate– HTML Readme
• Easier to Run – Executable Jars– Simple Import into IDEs
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
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
IDE IntegrationIDE Integration
• ArcGIS Eclipse Plug-ins – Java Help System– Samples– Templates– Code shortcuts– Geo-Processing Tool Generator– Local update site
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.
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
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