FAQ: What major changes are required to upgrade MapObjects-Java 1.x applications to MapObjects-Java 2.x?
What major changes are required to upgrade MapObjects-Java 1.x applications to MapObjects-Java 2.x?
Applications developed with MapObjects—Java 1.x will require some changes to correctly function with MapObjects—Java 2.x JAR files.
The most important step is to change the package names in applications from "mo" to "mo2". The 'RenameMo' utility included under the MOJ20/Utilities folder is provided exactly for this purpose. Reference the "ReadMe.txt" file in the aforementioned directory for instructions on use.
Other major changes are as follows:
· SearchableLayer—This interface has been removed. The com.esri.mo2.map.dpy FeatureLayer should now implement the searchable interface of the com.esri.mo2.data.feat package instead to directly search data.
· BaseToolBar—The getSelectedLayer method has been removed and replaced with a getSelectedLayers method. This method returns an array of com.esri.mo2.dpy.Layer objects instead of a single layer.
· A change related to the fields in com.esri.mo2.ui.tb.ZoomPanToolBar and com.esri.mo2.ui.tb.SelectionToolBar has been introduced at 2.0. At version 1.x, one could directly refer to the individual tools as fields of these classes to customize the toolbars. Now the classes com.esri.mo2.ui.tb.ZoomPanToolBarActions and com.esri.mo2.ui.tb.SelectionToolBarActions exist for this purpose. Refer to the JavaDoc for more details.
· The structure of the various icons has been slightly changed. Custom tools using the icons from com.esri.mo2.util.Resource may not work using 1.x references. A new utility has been included in the MOJ20/Utilities/IconViewer folder to show the package structure of the icons and usage instructions. Refer to this folder for further details.
LayerSource deprecations and the new Content API
· Several classes were deprecated in relation to the old LayerSource API.
· FeatureServer and ImageServer
<b>Package com.esri.mo2.file.shp </b>
· DbfWorkspace and ShapefileFolder
· Layerinfo, LayerSource, and WorkSpaceLayerSource
· BaseLayerinfo, BaseLayerSource, and BaseWorkSpaceLayerSource
· ImageLayerSource, BaseImageDirectory, BaseImageLayerSource, and ImageDirectoryFolder
They have been replaced with the new Content API that defines a framework for accessing GIS objects from diverse data sources. These GIS objects include Layer, FeatureClass, ImageClass, Geocoder, and (nonspatial) Table.
The advantage of the Content API is that it uses the same series of steps to get GIS objects, regardless of the connection type (input) or the objects accessed (output). These steps focus on creating and managing connections to the data sources. Refer to the com.esri.mo2.src.sys package description for more details regarding the Content API.
Other important deprecated classes by package:
· AuthHttpURLHandler—Use com.esri.mo2.client.io.Authenticator instead.
· Fields—getNumFields method has been deprecated; use size method instead.
· SimpleFillSymbol—Use com.esri.mo2.map.draw.SimplePolygonSymbol instead.
· TextmarkerSymbol—Use com.esri.mo2.map.draw.SimpleTextSymbol instead.
· Layerhandler—Consult the classes in the com.esri.mo2.ui.cat package.
· ArcIMSLayerChooser—Replaced by com.esri.mo2.ui.src.ContentChooser.
· CustomDatasetEditor—Replaced by com.esri.mo2.ui.src.ContentChooser.