I'm making a geoprocessing tool with the ArcObjects SDK Java 10.2. I need to modify labeling colors of a layer of the current map. Is it possible from the execute function to access the map currently opened in ArcMap ? I need to get the current IMapDocument or IMap in order to set up parameters of the layers (IGeoFeatureLayer). How can I do that please ?
If you need to specify rendering of an output layer, I believe the correct way to do that is to implement IGPFunction2.getRenderer() method on your GP function class.
.Net function to return the current active IMap, not sure if you can adapt this for java... good luck!
Public Function GetMapFromArcMap(ByVal application As ESRI.ArcGIS.Framework.IApplication) As ESRI.ArcGIS.Carto.IMap Dim mxDocument As ESRI.ArcGIS.ArcMapUI.IMxDocument = CType(application.Document, ESRI.ArcGIS.ArcMapUI.IMxDocument) ' Explicit Cast Dim activeView As ESRI.ArcGIS.Carto.IActiveView = mxDocument.ActiveView Dim map As ESRI.ArcGIS.Carto.IMap = activeView.FocusMap Return map End Function