[mapguide-commits] r9855 - in trunk/MgDev/Doc/samples/javaviewersample: . findaddress theme theme/classes

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Jun 17 08:59:09 PDT 2021


Author: jng
Date: 2021-06-17 08:59:09 -0700 (Thu, 17 Jun 2021)
New Revision: 9855

Modified:
   trunk/MgDev/Doc/samples/javaviewersample/ajaxtiledviewersample.jsp
   trunk/MgDev/Doc/samples/javaviewersample/ajaxviewersample.jsp
   trunk/MgDev/Doc/samples/javaviewersample/dwfviewersample.jsp
   trunk/MgDev/Doc/samples/javaviewersample/findaddress/findaddressfunctions.jsp
   trunk/MgDev/Doc/samples/javaviewersample/findaddress/findaddressmain.jsp
   trunk/MgDev/Doc/samples/javaviewersample/theme/classes/theme.jsp
   trunk/MgDev/Doc/samples/javaviewersample/theme/thememain.jsp
   trunk/MgDev/Doc/samples/javaviewersample/utilityfunctions.jsp
Log:
#2839: Partially fix up the java samples to use MapGuideApiEx.jar

Modified: trunk/MgDev/Doc/samples/javaviewersample/ajaxtiledviewersample.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javaviewersample/ajaxtiledviewersample.jsp	2021-06-17 15:58:40 UTC (rev 9854)
+++ trunk/MgDev/Doc/samples/javaviewersample/ajaxtiledviewersample.jsp	2021-06-17 15:59:09 UTC (rev 9855)
@@ -33,9 +33,9 @@
     MgUserInformation userInfo = new MgUserInformation("Anonymous", "");
     MgSite site = new MgSite();
 
-    site.Open(userInfo);
+    site.open(userInfo);
 
-    String sessionId = site.CreateSession();
+    String sessionId = site.createSession();
     String webLayout = "Library://Samples/Sheboygan/Layouts/SheboyganJspTiled.WebLayout";
 %>
 <html>

Modified: trunk/MgDev/Doc/samples/javaviewersample/ajaxviewersample.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javaviewersample/ajaxviewersample.jsp	2021-06-17 15:58:40 UTC (rev 9854)
+++ trunk/MgDev/Doc/samples/javaviewersample/ajaxviewersample.jsp	2021-06-17 15:59:09 UTC (rev 9855)
@@ -33,9 +33,9 @@
     MgUserInformation userInfo = new MgUserInformation("Anonymous", "");
     MgSite site = new MgSite();
 
-    site.Open(userInfo);
+    site.open(userInfo);
 
-    String sessionId = site.CreateSession();
+    String sessionId = site.createSession();
     String webLayout = "Library://Samples/Sheboygan/Layouts/SheboyganJsp.WebLayout";
 %>
 <html>

Modified: trunk/MgDev/Doc/samples/javaviewersample/dwfviewersample.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javaviewersample/dwfviewersample.jsp	2021-06-17 15:58:40 UTC (rev 9854)
+++ trunk/MgDev/Doc/samples/javaviewersample/dwfviewersample.jsp	2021-06-17 15:59:09 UTC (rev 9855)
@@ -33,9 +33,9 @@
     MgUserInformation userInfo = new MgUserInformation("Anonymous", "");
     MgSite site = new MgSite();
 
-    site.Open(userInfo);
+    site.open(userInfo);
 
-    String sessionId = site.CreateSession();
+    String sessionId = site.createSession();
     String webLayout = "Library://Samples/Sheboygan/Layouts/SheboyganJsp.WebLayout";
 %>
 <html>

Modified: trunk/MgDev/Doc/samples/javaviewersample/findaddress/findaddressfunctions.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javaviewersample/findaddress/findaddressfunctions.jsp	2021-06-17 15:58:40 UTC (rev 9854)
+++ trunk/MgDev/Doc/samples/javaviewersample/findaddress/findaddressfunctions.jsp	2021-06-17 15:59:09 UTC (rev 9855)
@@ -48,22 +48,22 @@
     out.write("<tr><td class=\"SubTitle\">Previous Results</td></tr>");
 
     MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter();
-    MgFeatureReader featureReader = (MgFeatureReader)featureService.SelectFeatures(addressMarkerDataResId, "AddressMarker", null);
+    MgFeatureReader featureReader = (MgFeatureReader)featureService.selectFeatures(addressMarkerDataResId, "AddressMarker", null);
 
-    while (featureReader.ReadNext())
+    while (featureReader.readNext())
     {
-        String address = featureReader.GetString("Address");
-        MgByteReader byteReader = featureReader.GetGeometry("Location");
+        String address = featureReader.getString("Address");
+        MgByteReader byteReader = featureReader.getGeometry("Location");
 
-        MgPoint point = (MgPoint)geometryReaderWriter.Read(byteReader);
-        double x = point.GetCoordinate().GetX();
-        double y = point.GetCoordinate().GetY();
+        MgPoint point = (MgPoint)geometryReaderWriter.read(byteReader);
+        double x = point.getCoordinate().getX();
+        double y = point.getCoordinate().getY();
 
         out.write("<tr><td>");
         out.write("<img src=\"../images/pushpinblue.jpg\">");
         out.write("<a href=\"gotopoint.jsp?X=" + x + "&Y=" + y + "&Scale=2000\" target=\"scriptFrame\">  " + address + "</a></td></tr>");
     }
-    featureReader.Close();
+    featureReader.close();
 
     out.write("</table>");
     out.write("<form action=\"clearaddressresults.jsp\" method=\"get\" target=\"scriptFrame\">");
@@ -80,41 +80,41 @@
     String ll84Wkt = "GEOGCS[\"WGS84 Lat/Long's, Degrees, -180 ==> +180\",DATUM[\"D_WGS_1984]\",SPHEROID[\"World_Geodetic_System_of_1984\",6378137,298.257222932867]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]";
 
     MgClassDefinition addressClass = new MgClassDefinition();
-    addressClass.SetName("AddressMarker");
-    MgPropertyDefinitionCollection properties = addressClass.GetProperties();
+    addressClass.setName("AddressMarker");
+    MgPropertyDefinitionCollection properties = addressClass.getProperties();
 
     MgDataPropertyDefinition idProperty = new MgDataPropertyDefinition("ID");
-    idProperty.SetDataType(MgPropertyType.Int32);
-    idProperty.SetReadOnly(true);
-    idProperty.SetNullable(false);
-    idProperty.SetAutoGeneration(true);
-    properties.Add(idProperty);
+    idProperty.setDataType(MgPropertyType.Int32);
+    idProperty.setReadOnly(true);
+    idProperty.setNullable(false);
+    idProperty.setAutoGeneration(true);
+    properties.add(idProperty);
 
     MgDataPropertyDefinition addressProperty = new MgDataPropertyDefinition("Address");
-    addressProperty.SetDataType(MgPropertyType.String);
-    addressProperty.SetLength(512);
-    properties.Add(addressProperty);
+    addressProperty.setDataType(MgPropertyType.String);
+    addressProperty.setLength(512);
+    properties.add(addressProperty);
 
     MgGeometricPropertyDefinition locationProperty = new MgGeometricPropertyDefinition("Location");
-    locationProperty.SetGeometryTypes(MgGeometryType.Point);
-    locationProperty.SetHasElevation(false);
-    locationProperty.SetHasMeasure(false);
-    locationProperty.SetReadOnly(false);
-    locationProperty.SetSpatialContextAssociation("LL84");
-    properties.Add(locationProperty);
+    locationProperty.setGeometryTypes(MgGeometryType.Point);
+    locationProperty.setHasElevation(false);
+    locationProperty.setHasMeasure(false);
+    locationProperty.setReadOnly(false);
+    locationProperty.setSpatialContextAssociation("LL84");
+    properties.add(locationProperty);
 
-    MgPropertyDefinitionCollection idProperties = addressClass.GetIdentityProperties();
-    idProperties.Add(idProperty);
+    MgPropertyDefinitionCollection idProperties = addressClass.getIdentityProperties();
+    idProperties.add(idProperty);
 
-    addressClass.SetDefaultGeometryPropertyName("Location");
+    addressClass.setDefaultGeometryPropertyName("Location");
 
     MgFeatureSchema addressSchema = new MgFeatureSchema();
-    addressSchema.SetName("AddressMarkerSchema");
-    addressSchema.GetClasses().Add(addressClass);
+    addressSchema.setName("AddressMarkerSchema");
+    addressSchema.getClasses().add(addressClass);
 
     MgFileFeatureSourceParams sdfParams = new MgFileFeatureSourceParams("OSGeo.SDF", "LL84", ll84Wkt, addressSchema);
 
-    featureService.CreateFeatureSource(addressMarkerDataResId, sdfParams);
+    featureService.createFeatureSource(addressMarkerDataResId, sdfParams);
 }
 
 // Create a temporary Layer to display geocode results.
@@ -131,7 +131,7 @@
     Document document = builder.parse(new File(getServletContext().getRealPath("/") + "javaviewersample//findaddress//templates" + File.separator + "addressmarker.xml"));
     NodeList nodes = document.getElementsByTagName("ResourceId");
     Node resNode = nodes.item(0);
-    Node resContent = document.createTextNode(addressMarkerDataResId.ToString());
+    Node resContent = document.createTextNode(addressMarkerDataResId.toString());
     resNode.appendChild(resContent);
 
     // write the modified layer XML definition into a byte stream
@@ -148,20 +148,20 @@
 
     byte[] layerDefinition = bos.toByteArray();
     MgByteSource byteSource = new MgByteSource(layerDefinition, layerDefinition.length);
-    byteSource.SetMimeType(MgMimeType.Xml);
+    byteSource.setMimeType(MgMimeType.Xml);
 
     MgResourceIdentifier tempLayerResId = new MgResourceIdentifier("Session:" + sessionId + "//AddressMarker.LayerDefinition");
 
-    resourceService.SetResource(tempLayerResId, byteSource.GetReader(), null);
+    resourceService.setResource(tempLayerResId, byteSource.getReader(), null);
 
     // Create an MgLayer object based on the new layer definition
     // and return it to the caller.
 
     MgLayer addressLayer = new MgLayer(tempLayerResId, resourceService);
-    addressLayer.SetName("AddressMarker");
-    addressLayer.SetLegendLabel("AddressMarker");
-    addressLayer.SetDisplayInLegend(false);
-    addressLayer.SetSelectable(false);
+    addressLayer.setName("AddressMarker");
+    addressLayer.setLegendLabel("AddressMarker");
+    addressLayer.setDisplayInLegend(false);
+    addressLayer.setSelectable(false);
 
     return addressLayer;
 }

Modified: trunk/MgDev/Doc/samples/javaviewersample/findaddress/findaddressmain.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javaviewersample/findaddress/findaddressmain.jsp	2021-06-17 15:58:40 UTC (rev 9854)
+++ trunk/MgDev/Doc/samples/javaviewersample/findaddress/findaddressmain.jsp	2021-06-17 15:59:09 UTC (rev 9855)
@@ -60,7 +60,7 @@
 
         MgUserInformation userInfo = new MgUserInformation(mgSessionId);
         siteConnection = new MgSiteConnection();
-        siteConnection.Open(userInfo);
+        siteConnection.open(userInfo);
 
         // Create a ReserviceService object and use it to open the Map
         // object from the sessions repository. Use the Map object to
@@ -67,18 +67,18 @@
         // determine if the "AddressMarker" layer is visible.
 
         MgMap map = new MgMap(siteConnection);
-        map.Open("Sheboygan");
+        map.open("Sheboygan");
         MgLayer addressLayer = GetLayerByName(map, "AddressMarker");
 
         if (addressLayer != null)
         {
-            showPreviousResults = addressLayer.GetVisible();
+            showPreviousResults = addressLayer.getVisible();
         }
     }
     catch (MgException e)
     {
-        out.write(e.GetExceptionMessage());
-        out.write(e.GetDetails());
+        out.write(e.getExceptionMessage());
+        out.write(e.getDetails());
     }
 %>
 
@@ -114,7 +114,7 @@
 
     if (showPreviousResults)
     {
-        MgFeatureService featureService = (MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);
+        MgFeatureService featureService = (MgFeatureService)siteConnection.createService(MgServiceType.FeatureService);
         MgResourceIdentifier addressMarkerDataResId = new MgResourceIdentifier("Session:" + mgSessionId + "//AddressMarker.FeatureSource");
 
         EmitAddressResults(out, featureService, addressMarkerDataResId, mgSessionId);

Modified: trunk/MgDev/Doc/samples/javaviewersample/theme/classes/theme.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javaviewersample/theme/classes/theme.jsp	2021-06-17 15:58:40 UTC (rev 9854)
+++ trunk/MgDev/Doc/samples/javaviewersample/theme/classes/theme.jsp	2021-06-17 15:59:09 UTC (rev 9855)
@@ -42,7 +42,7 @@
         {
             this.args = incomingArgs;
             this.site = new MgSiteConnection();
-            this.site.Open(new MgUserInformation(this.args.get("SESSION")));
+            this.site.open(new MgUserInformation(this.args.get("SESSION")));
             this.distNameArray = new String[] {"Individual", "Equal", "Standard Deviation", "Quantile", "Jenks (Natural Breaks)"};
             this.distValueArray = new String[] {"INDIV_DIST", "EQUAL_DIST", "STDEV_DIST", "QUANT_DIST", "JENK_DIST"};
         }
@@ -67,29 +67,29 @@
             return jsonArray.toString();
         }
             
-        public ArrayList<String> GetMapLayerNames() throws MgException
+        public ArrayList<String> getMapLayerNames() throws MgException
         {
-            MgFeatureService featureService = (MgFeatureService)this.site.CreateService(MgServiceType.FeatureService);
+            MgFeatureService featureService = (MgFeatureService)this.site.createService(MgServiceType.FeatureService);
             
             MgMap map = new MgMap(this.site);
-            map.Open(this.args.get("MAPNAME"));
-            MgLayerCollection layers = map.GetLayers();
+            map.open(this.args.get("MAPNAME"));
+            MgLayerCollection layers = map.getLayers();
             ArrayList<String> layerNames = new ArrayList<String>();
 
-            for(int i=0; i<layers.GetCount(); i++)
+            for(int i=0; i<layers.getCount(); i++)
             {
-                MgLayer layer = (MgLayer) layers.GetItem(i);
-                if(!layer.GetName().startsWith("_") && !layer.GetFeatureSourceId().toUpperCase().startsWith("SESSION"))
+                MgLayer layer = (MgLayer) layers.getItem(i);
+                if(!layer.getName().startsWith("_") && !layer.getFeatureSourceId().toUpperCase().startsWith("SESSION"))
                 {
-                    MgClassDefinition classDef = layer.GetClassDefinition();
-                    MgPropertyDefinition propDef = classDef.GetProperties().GetItem(layer.GetFeatureGeometryName());
+                    MgClassDefinition classDef = layer.getClassDefinition();
+                    MgPropertyDefinition propDef = classDef.getProperties().getItem(layer.getFeatureGeometryName());
                     
-                    if(propDef.GetPropertyType() == MgFeaturePropertyType.GeometricProperty)
+                    if(propDef.getPropertyType() == MgFeaturePropertyType.GeometricProperty)
                     {
                         MgGeometricPropertyDefinition geomPropDef = (MgGeometricPropertyDefinition) propDef;
                         
-                        if(geomPropDef.GetGeometryTypes() == MgFeatureGeometricType.Surface)
-                            layerNames.add(layer.GetLegendLabel());
+                        if(geomPropDef.getGeometryTypes() == MgFeatureGeometricType.Surface)
+                            layerNames.add(layer.getLegendLabel());
                     }
                 }
             }
@@ -98,31 +98,31 @@
             return layerNames;
         }
             
-        public LayerInfo GetLayerInfo() throws MgException, ParserConfigurationException, IOException, SAXException
+        public LayerInfo getLayerInfo() throws MgException, ParserConfigurationException, IOException, SAXException
         {
             ArrayList<Property> properties = new ArrayList<Property>();
             ArrayList<String> scaleRanges = new ArrayList<String>();
             
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
+            MgResourceService resourceService = (MgResourceService)this.site.createService(MgServiceType.ResourceService);
             
             MgMap map = new MgMap(this.site);
-            map.Open(this.args.get("MAPNAME"));
-            MgLayer layer = (MgLayer) map.GetLayers().GetItem(this.args.get("LAYERNAME"));
+            map.open(this.args.get("MAPNAME"));
+            MgLayer layer = (MgLayer) map.getLayers().getItem(this.args.get("LAYERNAME"));
 
-            MgClassDefinition classDef = layer.GetClassDefinition();
+            MgClassDefinition classDef = layer.getClassDefinition();
 
-            for(int i=0; i<classDef.GetProperties().GetCount(); i++)
+            for(int i=0; i<classDef.getProperties().getCount(); i++)
             {
-                MgPropertyDefinition propertyDef = classDef.GetProperties().GetItem(i);
+                MgPropertyDefinition propertyDef = classDef.getProperties().getItem(i);
 
-                if(propertyDef.GetPropertyType() == MgFeaturePropertyType.DataProperty)
+                if(propertyDef.getPropertyType() == MgFeaturePropertyType.DataProperty)
                 {
                     MgDataPropertyDefinition propertyDataDef = (MgDataPropertyDefinition) propertyDef;
-                    int dataType = propertyDataDef.GetDataType();
-                    ArrayList<Integer> distroTypes = new ArrayList(this.GetDistributionsForDataType(dataType));
+                    int dataType = propertyDataDef.getDataType();
+                    ArrayList<Integer> distroTypes = new ArrayList(this.getDistributionsForDataType(dataType));
                     if(distroTypes.size() > 0)
                     {
-                        properties.add(new Property(propertyDataDef.GetName(), dataType, distroTypes));
+                        properties.add(new Property(propertyDataDef.getName(), dataType, distroTypes));
                     }
                 }
             }
@@ -129,12 +129,12 @@
             
             // Next get a list of all of the layers scale ranges.
             
-            MgResourceIdentifier layerDefResId = layer.GetLayerDefinition();
-            MgByteReader byteReader = resourceService.GetResourceContent(layerDefResId);
+            MgResourceIdentifier layerDefResId = layer.getLayerDefinition();
+            MgByteReader byteReader = resourceService.getResourceContent(layerDefResId);
             
             DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
             DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
-            Document doc = docBuilder.parse(new InputSource(new StringReader(byteReader.ToString())));
+            Document doc = docBuilder.parse(new InputSource(new StringReader(byteReader.toString())));
             NodeList nodeList = doc.getElementsByTagName("VectorScaleRange");
             
             for(int i=0; i<nodeList.getLength(); i++)
@@ -160,13 +160,13 @@
             return new LayerInfo(properties, scaleRanges);
         }
         
-        public ArrayList<String> GetPropertyMinMaxCount() throws MgException
+        public ArrayList<String> getPropertyMinMaxCount() throws MgException
         {
             ArrayList<String> propertyMinMaxCount = new ArrayList<String>();
             
             MgMap map = new MgMap(this.site);
-            map.Open(this.args.get("MAPNAME"));
-            MgLayer layer = (MgLayer) map.GetLayers().GetItem(this.args.get("LAYERNAME"));
+            map.open(this.args.get("MAPNAME"));
+            MgLayer layer = (MgLayer) map.getLayers().getItem(this.args.get("LAYERNAME"));
             
             String minValue = null;
             String maxValue = null;
@@ -174,13 +174,13 @@
             int count = 0;
             
             MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
-            queryOptions.AddFeatureProperty(this.args.get("PROPERTYNAME"));
+            queryOptions.addFeatureProperty(this.args.get("PROPERTYNAME"));
             
-            MgFeatureReader featureReader = layer.SelectFeatures(queryOptions);
-            while(featureReader.ReadNext())
+            MgFeatureReader featureReader = layer.selectFeatures(queryOptions);
+            while(featureReader.readNext())
             {
-                String value = this.GetFeaturePropertyValue(featureReader, this.args.get("PROPERTYNAME"));
-                int propertyType = featureReader.GetPropertyType(this.args.get("PROPERTYNAME"));
+                String value = this.getFeaturePropertyValue(featureReader, this.args.get("PROPERTYNAME"));
+                int propertyType = featureReader.getPropertyType(this.args.get("PROPERTYNAME"));
                 if(firstTime)
                 {
                     maxValue = value;
@@ -232,7 +232,7 @@
                 }
                 count++;
             }
-            featureReader.Close();
+            featureReader.close();
             
             propertyMinMaxCount.add(minValue.toString());
             propertyMinMaxCount.add(maxValue.toString());
@@ -241,24 +241,24 @@
             return propertyMinMaxCount;
         }
         
-        public String ApplyTheme() throws MgException, ParserConfigurationException, IOException, SAXException, TransformerConfigurationException, TransformerException
+        public String applyTheme() throws MgException, ParserConfigurationException, IOException, SAXException, TransformerConfigurationException, TransformerException
         {
-            MgResourceService resourceService = (MgResourceService)this.site.CreateService(MgServiceType.ResourceService);
+            MgResourceService resourceService = (MgResourceService)this.site.createService(MgServiceType.ResourceService);
 
             MgMap map = new MgMap(this.site);
-            map.Open(this.args.get("MAPNAME"));
-            MgLayerCollection layers = map.GetLayers();
-            MgLayer layer = (MgLayer) layers.GetItem(this.args.get("LAYERNAME"));
+            map.open(this.args.get("MAPNAME"));
+            MgLayerCollection layers = map.getLayers();
+            MgLayer layer = (MgLayer) layers.getItem(this.args.get("LAYERNAME"));
             
-            MgResourceIdentifier resId = new MgResourceIdentifier(layer.GetFeatureSourceId());
-            MgResourceIdentifier layerDefResId = layer.GetLayerDefinition();
-            MgByteReader byteReader = resourceService.GetResourceContent(layerDefResId);
+            MgResourceIdentifier resId = new MgResourceIdentifier(layer.getFeatureSourceId());
+            MgResourceIdentifier layerDefResId = layer.getLayerDefinition();
+            MgByteReader byteReader = resourceService.getResourceContent(layerDefResId);
             
             // Load the Layer Definition and Navigate to the specified <VectorScaleRange>
             
             DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
             DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
-            Document doc = docBuilder.parse(new InputSource(new StringReader(byteReader.ToString())));
+            Document doc = docBuilder.parse(new InputSource(new StringReader(byteReader.toString())));
 
             NodeList nodeList = doc.getElementsByTagName("VectorScaleRange");
                 
@@ -298,13 +298,13 @@
             
             if("INDIV_DIST".equals(this.args.get("DISTRO")))
             {
-                aggregateOptions.AddFeatureProperty(this.args.get("PROPERTYNAME"));
-                aggregateOptions.SelectDistinct(true);
+                aggregateOptions.addFeatureProperty(this.args.get("PROPERTYNAME"));
+                aggregateOptions.selectDistinct(true);
                 
-                MgDataReader dataReader = layer.SelectAggregate(aggregateOptions);
-                while(dataReader.ReadNext())
+                MgDataReader dataReader = layer.selectAggregate(aggregateOptions);
+                while(dataReader.readNext())
                 {
-                    value = this.GetFeaturePropertyValue(dataReader, this.args.get("PROPERTYNAME"));
+                    value = this.getFeaturePropertyValue(dataReader, this.args.get("PROPERTYNAME"));
                     
                     filterText = """ + this.args.get("PROPERTYNAME") + "" = ";
                     if(Integer.valueOf(this.args.get("DATATYPE")) == MgPropertyType.String)
@@ -315,8 +315,8 @@
                     areaRuleXML = String.format(areaRuleTemplate,
                                                 this.args.get("PROPERTYNAME") + ":" + value,
                                                 filterText,
-                                                this.InterpolateColor(portion, this.args.get("FILLFROM"), this.args.get("FILLTO"), Integer.valueOf(this.args.get("FILLTRANS"))),
-                                                this.InterpolateColor(portion, this.args.get("LINEFROM"), this.args.get("LINETO"), 0));
+                                                this.interpolateColor(portion, this.args.get("FILLFROM"), this.args.get("FILLTO"), Integer.valueOf(this.args.get("FILLTRANS"))),
+                                                this.interpolateColor(portion, this.args.get("LINEFROM"), this.args.get("LINETO"), 0));
                     docFactory = DocumentBuilderFactory.newInstance();
                     docBuilder = docFactory.newDocumentBuilder();
                     areaDoc = docBuilder.parse(new InputSource(new StringReader(areaRuleXML))); 
@@ -326,22 +326,22 @@
                     
                     portion = portion + increment;
                 }
-                dataReader.Close();
+                dataReader.close();
             }
             else
             {
                 ArrayList<String> values = new ArrayList<String>();
                 
-                aggregateOptions.AddComputedProperty("THEME_VALUE",
+                aggregateOptions.addComputedProperty("THEME_VALUE",
                     this.args.get("DISTRO") + "(\"" + this.args.get("PROPERTYNAME") + "\"," + this.args.get("NUMRULES") + "," + this.args.get("MINVALUE") + "," + this.args.get("MAXVALUE") + ")");
                 
-                MgDataReader dataReader = layer.SelectAggregate(aggregateOptions);
-                while(dataReader.ReadNext())
+                MgDataReader dataReader = layer.selectAggregate(aggregateOptions);
+                while(dataReader.readNext())
                 {
-                    value = this.GetFeaturePropertyValue(dataReader, "THEME_VALUE");
+                    value = this.getFeaturePropertyValue(dataReader, "THEME_VALUE");
                     values.add(value);
                 }
-                dataReader.Close();
+                dataReader.close();
                 
                 for(int i=0; i<values.size() - 1; i++)
                 {
@@ -354,8 +354,8 @@
                     areaRuleXML = String.format(areaRuleTemplate,
                                                 this.args.get("PROPERTYNAME") + ":" + values.get(i) + " - " + values.get(i+1),
                                                 filterText,
-                                                this.InterpolateColor(portion, this.args.get("FILLFROM"), this.args.get("FILLTO"), Integer.valueOf(this.args.get("FILLTRANS"))),
-                                                this.InterpolateColor(portion, this.args.get("LINEFROM"), this.args.get("LINETO"), 0));
+                                                this.interpolateColor(portion, this.args.get("FILLFROM"), this.args.get("FILLTO"), Integer.valueOf(this.args.get("FILLTRANS"))),
+                                                this.interpolateColor(portion, this.args.get("LINEFROM"), this.args.get("LINETO"), 0));
                     
                     docFactory = DocumentBuilderFactory.newInstance();
                     docBuilder = docFactory.newDocumentBuilder();
@@ -377,8 +377,8 @@
             Transformer transformer = tf.newTransformer();
             transformer.transform(domSource, result);
             String layerDefinition = writer.toString();
-            String uniqueName = this.MakeUniqueLayerName(map, this.args.get("LAYERNAME"), this.args.get("THEMENAME"));
-            String legendLabel = layer.GetLegendLabel();
+            String uniqueName = this.makeUniqueLayerName(map, this.args.get("LAYERNAME"), this.args.get("THEMENAME"));
+            String legendLabel = layer.getLegendLabel();
             if(this.args.get("THEMENAME").trim().length() > 0)
                 legendLabel = legendLabel + " (" + this.args.get("THEMENAME") + ")";
             
@@ -385,22 +385,22 @@
             MgResourceIdentifier layerResId = new MgResourceIdentifier("Session:" + this.args.get("SESSION") + "//" + uniqueName + ".LayerDefinition");
             
             MgByteSource byteSource = new MgByteSource(layerDefinition.getBytes(), layerDefinition.length());
-            resourceService.SetResource(layerResId, byteSource.GetReader(), null);
+            resourceService.setResource(layerResId, byteSource.getReader(), null);
             
             MgLayer newLayer = new MgLayer(layerResId, resourceService);
-            newLayer.SetName(uniqueName);
-            newLayer.SetLegendLabel(legendLabel);
-            newLayer.SetDisplayInLegend(layer.GetDisplayInLegend());
-            newLayer.SetVisible(true);
-            newLayer.SetSelectable(layer.GetSelectable());
-            layers.Insert(layers.IndexOf(layer), newLayer);
+            newLayer.setName(uniqueName);
+            newLayer.setLegendLabel(legendLabel);
+            newLayer.setDisplayInLegend(layer.getDisplayInLegend());
+            newLayer.setVisible(true);
+            newLayer.setSelectable(layer.getSelectable());
+            layers.insert(layers.indexOf(layer), newLayer);
             
-            map.Save();
+            map.save();
 
             return uniqueName;
         }
         
-        private String InterpolateColor(double portion, String startColor, String endColor, int percentTransparent)
+        private String interpolateColor(double portion, String startColor, String endColor, int percentTransparent)
         {
             String result = String.format("%02x", 255*(100-percentTransparent)/100);
             
@@ -407,23 +407,23 @@
             if(startColor.equals(endColor))
                 return result+startColor;
             
-            int red = this.CalculateRGB(portion, startColor.substring(0,2), endColor.substring(0,2));
+            int red = this.calculateRGB(portion, startColor.substring(0,2), endColor.substring(0,2));
             result = (Integer.toHexString(red).length() == 1)? result+"0"+Integer.toHexString(red) : result+Integer.toHexString(red);
-            int green = this.CalculateRGB(portion, startColor.substring(2,4), endColor.substring(2,4));
+            int green = this.calculateRGB(portion, startColor.substring(2,4), endColor.substring(2,4));
             result = (Integer.toHexString(green).length() == 1)? result+"0"+Integer.toHexString(green) : result+Integer.toHexString(green);
-            int blue = this.CalculateRGB(portion, startColor.substring(4,6), endColor.substring(4,6));
+            int blue = this.calculateRGB(portion, startColor.substring(4,6), endColor.substring(4,6));
             result = (Integer.toHexString(blue).length() == 1)? result+"0"+Integer.toHexString(blue) : result+Integer.toHexString(blue);
             
             return result;
         }
         
-        private int CalculateRGB(double portion, String startRGB, String endRGB)
+        private int calculateRGB(double portion, String startRGB, String endRGB)
         {
             double result = Integer.parseInt(startRGB, 16) + portion*(Integer.parseInt(endRGB, 16) - Integer.parseInt(startRGB, 16));
             return (int) result;
         }
         
-        private ArrayList<Integer> GetDistributionsForDataType(int type) throws MgException
+        private ArrayList<Integer> getDistributionsForDataType(int type) throws MgException
         {
             ArrayList<Integer> distroTypes = new ArrayList<Integer>();
             
@@ -461,13 +461,13 @@
             return distroTypes;
         }
         
-        private String MakeUniqueLayerName(MgMap map, String layerName, String themeName) throws MgException
+        private String makeUniqueLayerName(MgMap map, String layerName, String themeName) throws MgException
         {
             String desiredName = "_" + layerName + themeName;
             String uniqueName = desiredName;
             int index = 1;
             
-            while(map.GetLayers().Contains(uniqueName))
+            while(map.getLayers().contains(uniqueName))
             {
                 uniqueName = desiredName + Integer.toString(index);
                 index++;
@@ -475,35 +475,35 @@
             return uniqueName;
         }
         
-        private String GetFeaturePropertyValue(MgReader dataReader, String name) throws MgException
+        private String getFeaturePropertyValue(MgReader dataReader, String name) throws MgException
         {
             String value = null;
-            int propertyType = dataReader.GetPropertyType(name);
+            int propertyType = dataReader.getPropertyType(name);
             switch(propertyType)
             {
                 case MgPropertyType.Boolean :
-                    value = String.valueOf(dataReader.GetBoolean(name));
+                    value = String.valueOf(dataReader.getBoolean(name));
                     break;
                 case MgPropertyType.Byte :
-                    value = String.valueOf(dataReader.GetByte(name));
+                    value = String.valueOf(dataReader.getByte(name));
                     break;
                 case MgPropertyType.Single :
-                    value = String.valueOf(dataReader.GetSingle(name));
+                    value = String.valueOf(dataReader.getSingle(name));
                     break;
                 case MgPropertyType.Double :
-                    value = String.valueOf(dataReader.GetDouble(name));
+                    value = String.valueOf(dataReader.getDouble(name));
                     break;
                 case MgPropertyType.Int16 :
-                    value = String.valueOf(dataReader.GetInt16(name));
+                    value = String.valueOf(dataReader.getInt16(name));
                     break;
                 case MgPropertyType.Int32 :
-                    value = String.valueOf(dataReader.GetInt32(name));
+                    value = String.valueOf(dataReader.getInt32(name));
                     break;
                 case MgPropertyType.Int64 :
-                    value = String.valueOf(dataReader.GetInt64(name));
+                    value = String.valueOf(dataReader.getInt64(name));
                     break;
                 case MgPropertyType.String :
-                    value = dataReader.GetString(name);
+                    value = dataReader.getString(name);
                     break;
                 case MgPropertyType.DateTime :
                 case MgPropertyType.Null :

Modified: trunk/MgDev/Doc/samples/javaviewersample/theme/thememain.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javaviewersample/theme/thememain.jsp	2021-06-17 15:58:40 UTC (rev 9854)
+++ trunk/MgDev/Doc/samples/javaviewersample/theme/thememain.jsp	2021-06-17 15:59:09 UTC (rev 9855)
@@ -46,12 +46,12 @@
     
         theme = new Theme(args);
         
-        layerNames = theme.GetMapLayerNames();
+        layerNames = theme.getMapLayerNames();
     }
     catch (MgException e)
     {
-        errorMsg = e.GetExceptionMessage();
-        errorDetail = e.GetDetails();
+        errorMsg = e.getExceptionMessage();
+        errorDetail = e.getDetails();
     }
 %>
 <html>

Modified: trunk/MgDev/Doc/samples/javaviewersample/utilityfunctions.jsp
===================================================================
--- trunk/MgDev/Doc/samples/javaviewersample/utilityfunctions.jsp	2021-06-17 15:58:40 UTC (rev 9854)
+++ trunk/MgDev/Doc/samples/javaviewersample/utilityfunctions.jsp	2021-06-17 15:59:09 UTC (rev 9855)
@@ -26,7 +26,7 @@
     // Initialize web tier with the site configuration file.  The config
     // file should be in the same folder as this script.
     String configPath =  realpath + "webconfig.ini";
-    MapGuideJavaApi.MgInitializeWebTier( configPath );
+    MapGuideJavaApiEx.MgInitializeWebTier( configPath );
 }
 
 String GetQueryXmlTemplatePath()
@@ -52,10 +52,10 @@
 MgLayer GetLayerByName(MgMap map, String layerName) throws MgException
 {
     MgLayer layer = null;
-    for (int i = 0; i < map.GetLayers().GetCount(); i++)
+    for (int i = 0; i < map.getLayers().getCount(); i++)
     {
-        MgLayer nextLayer = (MgLayer) map.GetLayers().GetItem(i);
-        if (nextLayer.GetName().equals(layerName))
+        MgLayer nextLayer = (MgLayer) map.getLayers().getItem(i);
+        if (nextLayer.getName().equals(layerName))
         {
             layer = nextLayer;
             break;
@@ -69,14 +69,14 @@
     ByteArrayOutputStream bos = new ByteArrayOutputStream();
 
     byte[] byteBuffer = new byte[1024];
-    int numBytes = byteReader.Read(byteBuffer, 1024);
+    int numBytes = byteReader.read(byteBuffer, 1024);
     while(numBytes > 0)
     {
         bos.write(byteBuffer, 0, numBytes);
-        numBytes = byteReader.Read(byteBuffer, 1024);
+        numBytes = byteReader.read(byteBuffer, 1024);
     }
     response.setContentLength(bos.size());
-    response.setContentType(byteReader.GetMimeType());
+    response.setContentType(byteReader.getMimeType());
     response.getOutputStream().write(bos.toByteArray());
 }
 



More information about the mapguide-commits mailing list