Frequently asked question

What major changes are required to upgrade MapObjects-Java 1.x applications to MapObjects-Java 2.x?

Last Published: April 25, 2020


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 FeatureLayer should now implement the searchable interface of the package instead to directly search data.

Package com.esri.mo2.ui.tb:

· 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.

Toolbar changes:

· 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.

Icon changes:

· 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.

<b>Package com.esri.mo2.client.aims</b>
· FeatureServer and ImageServer

<b>Package com.esri.mo2.client.sde</b>

<b>Package com.esri.mo2.file.shp </b>
· DbfWorkspace and ShapefileFolder

· Layerinfo, LayerSource, and WorkSpaceLayerSource
· BaseLayerinfo, BaseLayerSource, and BaseWorkSpaceLayerSource

· ImageLayerSource, BaseImageDirectory, BaseImageLayerSource, and ImageDirectoryFolder

· MemoryLayerSource

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:

<b>Package </b>
· AuthHttpURLHandler—Use instead.
· Login.

· Fields—getNumFields method has been deprecated; use size method instead.

· SimpleFillSymbol—Use instead.
· TextmarkerSymbol—Use instead.

<b>Package com.esri.mo2.ui.bean</b>
· Layerhandler—Consult the classes in the package.
· ArcIMSLayerChooser—Replaced by com.esri.mo2.ui.src.ContentChooser.
· CustomDatasetEditor—Replaced by com.esri.mo2.ui.src.ContentChooser.

Article ID:000006413

  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic