Revision: 5025
          http://sourceforge.net/p/jump-pilot/code/5025
Author:   michaudm
Date:     2016-09-20 21:42:33 +0000 (Tue, 20 Sep 2016)
Log Message:
-----------
few cleaning

Modified Paths:
--------------
    core/trunk/src/com/vividsolutions/jump/plugin/edit/LineNoderPlugIn.java
    core/trunk/src/com/vividsolutions/jump/plugin/edit/NoderPlugIn.java
    core/trunk/src/com/vividsolutions/jump/plugin/edit/PolygonizerPlugIn.java
    
core/trunk/src/com/vividsolutions/jump/plugin/edit/PrecisionReducerPlugIn.java
    core/trunk/src/com/vividsolutions/jump/plugin/edit/SegmentStringData.java
    
core/trunk/src/com/vividsolutions/jump/plugin/edit/TriPointTransRotScaleBuilder.java
    core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometry.java

Modified: 
core/trunk/src/com/vividsolutions/jump/plugin/edit/LineNoderPlugIn.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/plugin/edit/LineNoderPlugIn.java     
2016-09-20 21:04:45 UTC (rev 5024)
+++ core/trunk/src/com/vividsolutions/jump/plugin/edit/LineNoderPlugIn.java     
2016-09-20 21:42:33 UTC (rev 5025)
@@ -185,8 +185,7 @@
   private void setDialogValues(MultiInputDialog dialog, PlugInContext context) 
{
     dialog.setSideBarImage(new 
ImageIcon(getClass().getResource("Polygonize.png")));
     
dialog.setSideBarDescription(I18N.get("jump.plugin.edit.LineNoderPlugIn.Nodes-the-lines-in-a-layer"));
-    String fieldName = SRC_LAYER;
-    dialog.addLayerComboBox(fieldName, context.getCandidateLayer(0), null, 
context.getLayerManager());
+    dialog.addLayerComboBox(SRC_LAYER, context.getCandidateLayer(0), null, 
context.getLayerManager());
     dialog.addCheckBox(SELECTED_ONLY, useSelected);
   }
 

Modified: core/trunk/src/com/vividsolutions/jump/plugin/edit/NoderPlugIn.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/plugin/edit/NoderPlugIn.java 
2016-09-20 21:04:45 UTC (rev 5024)
+++ core/trunk/src/com/vividsolutions/jump/plugin/edit/NoderPlugIn.java 
2016-09-20 21:42:33 UTC (rev 5025)
@@ -127,7 +127,7 @@
     private Processor polygon_processor = Processor.NODE;
     
     private boolean snap_rounding = false;
-    int snap_rounding_dp = 6;
+    private int snap_rounding_dp = 6;
     
     private boolean interpolate_z = false;
     private int interpolated_z_dp  = 3;
@@ -638,7 +638,7 @@
 
     
     private void commitUpdate(PlugInContext context, final Layer layer,
-                 final Collection inputFeatures, final Collection newFeatures) 
{
+                 final Collection<Feature> inputFeatures, final 
Collection<Feature> newFeatures) {
         
context.getLayerManager().getUndoableEditReceiver().reportNothingToUndoYet();
         UndoableCommand cmd = new UndoableCommand(getName()) {
             public void execute() {

Modified: 
core/trunk/src/com/vividsolutions/jump/plugin/edit/PolygonizerPlugIn.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/plugin/edit/PolygonizerPlugIn.java   
2016-09-20 21:04:45 UTC (rev 5024)
+++ core/trunk/src/com/vividsolutions/jump/plugin/edit/PolygonizerPlugIn.java   
2016-09-20 21:42:33 UTC (rev 5025)
@@ -262,8 +262,7 @@
                        + " " + 
I18N.get("jump.plugin.edit.PolygonizerPlugIn.If-desired-the-input-data-may-be-noded-before-polygonizing-is-performed")
                        + " " + 
I18N.get("jump.plugin.edit.PolygonizerPlugIn.Dangles-Cutlines-and-Invalid-Rings-are-identified")
     );
-    String fieldName = SRC_LAYER;
-    dialog.addLayerComboBox(fieldName, context.getCandidateLayer(0), null, 
context.getLayerManager());
+    dialog.addLayerComboBox(SRC_LAYER, context.getCandidateLayer(0), null, 
context.getLayerManager());
     dialog.addCheckBox(SELECTED_ONLY, useSelected);
     dialog.addCheckBox(NODE_INPUT, nodeInputLines, NODE_INPUT);
   }

Modified: 
core/trunk/src/com/vividsolutions/jump/plugin/edit/PrecisionReducerPlugIn.java
===================================================================
--- 
core/trunk/src/com/vividsolutions/jump/plugin/edit/PrecisionReducerPlugIn.java  
    2016-09-20 21:04:45 UTC (rev 5024)
+++ 
core/trunk/src/com/vividsolutions/jump/plugin/edit/PrecisionReducerPlugIn.java  
    2016-09-20 21:42:33 UTC (rev 5025)
@@ -173,8 +173,7 @@
   private void setDialogValues(MultiInputDialog dialog, PlugInContext context) 
{
     dialog.setSideBarImage(new 
ImageIcon(getClass().getResource("PrecisionReducer.png")));
     
dialog.setSideBarDescription(I18N.get("ui.plugin.edit.PrecisionReducerPlugIn.Reduces-the-precision-of-the-coordinates-in-a-layer"));
-    String fieldName = LAYER;
-    dialog.addLayerComboBox(fieldName, context.getCandidateLayer(0), null, 
context.getLayerManager());
+    dialog.addLayerComboBox(LAYER, context.getCandidateLayer(0), null, 
context.getLayerManager());
 
     scaleFactorField = dialog.addIntegerField(SCALE_FACTOR, scaleFactor, 8,
                
I18N.get("ui.plugin.edit.PrecisionReducerPlugIn.The-scale-factor-to-multiply-by-before-rounding-(-Negative-for-left-of-decimal-point-,-0-if-not-used-)"));
@@ -229,7 +228,7 @@
     scaleFactor = dialog.getInteger(SCALE_FACTOR);
   }
 
-  class DecimalPlacesDocumentListener implements DocumentListener {
+  private class DecimalPlacesDocumentListener implements DocumentListener {
     public void insertUpdate(DocumentEvent e) {
       decimalPlacesChanged();
     }
@@ -240,7 +239,7 @@
       decimalPlacesChanged();
     }
   }
-  class ScaleFactorDocumentListener implements DocumentListener {
+  private class ScaleFactorDocumentListener implements DocumentListener {
     public void insertUpdate(DocumentEvent e) {
       scaleFactorChanged();
     }

Modified: 
core/trunk/src/com/vividsolutions/jump/plugin/edit/SegmentStringData.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/plugin/edit/SegmentStringData.java   
2016-09-20 21:04:45 UTC (rev 5024)
+++ core/trunk/src/com/vividsolutions/jump/plugin/edit/SegmentStringData.java   
2016-09-20 21:42:33 UTC (rev 5025)
@@ -81,164 +81,5 @@
                " Component=" + component + 
                " LinearElement="+linearElement;
     }
-    
-    /**
-     * Build the new noded geometry from the source geometry and the structured
-     * map of SegmentStrings.
-     * @param source the source geometry
-     * @param nodedSegmentStrings the hierarchical map of noded segment strings
-     * @param interpolate whether the z of SegmentString ends must be 
-     *        interpolated or not
-     */
-    //public static Geometry buildGeometry(Geometry source, 
-    //        Map<Integer,Map<Integer,List<SegmentString>>> 
nodedSegmentStrings,
-    //        boolean interpolate) {
-    //    // Number of components
-    //    GeometryFactory gf = source.getFactory();
-    //    Geometry[] geoms = new Geometry[nodedSegmentStrings.size()];
-    //    for (int i = 0 ; i < geoms.length ; i++) {
-    //        Geometry sourceComponent = source.getGeometryN(i);
-    //        Map<Integer,List<SegmentString>> lines = 
nodedSegmentStrings.get(i);
-    //        if (sourceComponent instanceof LineString) {
-    //            geoms[i] = merge(lines.get(0), gf, false);
-    //            if (interpolate) interpolate(lines.get(0), 
(LineString)geoms[i]);
-    //        }
-    //        else if (sourceComponent instanceof Polygon) {
-    //            LinearRing exteriorRing = (LinearRing)merge(lines.get(0), 
gf, true);
-    //            if (interpolate) interpolate(lines.get(0), exteriorRing);
-    //            LinearRing[] holes = new LinearRing[lines.size()-1];
-    //            for (int j = 0 ; j < holes.length ; j++) {
-    //                holes[j] = (LinearRing)merge(lines.get(j+1), gf, true);
-    //                if (interpolate) interpolate(lines.get(0), holes[j]);
-    //            }
-    //            geoms[i] = source.getFactory().createPolygon(exteriorRing, 
holes);
-    //        }
-    //    }
-    //    return source.getFactory().buildGeometry(Arrays.asList(geoms));
-    //}
-    
-    /** 
-     * Merge SegementStrings and return either a LineString or a LinearRing).
-     */
-    //private static LineString merge(List<SegmentString> list,
-    //                                GeometryFactory gf, boolean close) {
-    //    LineMerger lineMerger = new LineMerger();
-    //    for (SegmentString ss : list) {
-    //        lineMerger.add(gf.createLineString(ss.getCoordinates()));
-    //    }
-    //    LineString ls = 
(LineString)lineMerger.getMergedLineStrings().iterator().next();
-    //    if (close) {
-    //        CoordinateList coords = new CoordinateList(ls.getCoordinates());
-    //        coords.closeRing();
-    //        return gf.createLinearRing(coords.toCoordinateArray());
-    //    }
-    //    else {
-    //        return ls;
-    //    }
-    //}
-    
-    //private static void interpolate(List<SegmentString> list, LineString g) {
-    //    System.out.println("interpolate(List<SegmentString> list, LineString 
g)");
-    //    for (SegmentString ss : list) {
-    //        Coordinate[] cc = ss.getCoordinates();
-    //        if (Double.isNaN(cc[0].z)) {
-    //            cc[0].z = interpolate(cc[0], g);
-    //        }
-    //        if (Double.isNaN(cc[cc.length-1].z)) {
-    //            cc[cc.length-1].z = interpolate(cc[cc.length-1], g);
-    //        }
-    //    }
-    //}
-    
-    /**
-     * Interpolate the z of coordinate having indice c between coordinates
-     * having prev and next indices in cc coordinate array.
-     */
-    //private static double interpolate(Coordinate c, LineString line) {
-    //    int prevIndex = -1;
-    //    int index = -1;
-    //    int nextIndex = -1;
-    //    Coordinate[] cc = line.getCoordinates();
-    //    for (int i = 0 ; i < cc.length ; i++) {
-    //        if (index==-1 && c.equals(cc[i])) index = i;
-    //        else if (Double.isNaN(cc[i].z)) continue;
-    //        else if (index==-1) prevIndex = i;
-    //        else {nextIndex = i; break;}
-    //    }
-    //    if (prevIndex > -1 && nextIndex > -1) {
-    //        return interpolate(index, prevIndex, nextIndex, cc);
-    //    }
-    //    else {
-    //        return c.z;
-    //    }
-    //}
-    
-    /**
-     * Interpolate the z of coordinate having indice c between coordinates
-     * having prev and next indices in cc coordinate array.
-     */
-    //private static double interpolate(int c, int prev, int next, 
Coordinate[] cc) {
-    //    double dBefor = 0.0;
-    //    double dAfter = 0.0;
-    //    for (int i = prev ; i < c ; i++) dBefor += cc[i].distance(cc[i+1]);
-    //    for (int i = c ; i < next ; i++) dAfter += cc[i].distance(cc[i+1]);
-    //    return cc[prev].z + (cc[next].z-cc[prev].z) * 
(dBefor/(dBefor+dAfter));
-    //}
-    
-    
-    
-    /**
-     * Creates a hierarchy structure containing all the noded SegmentStrings
-     * derived from Geometry components and linear elements.
-     */
-    //public static Map<Feature,Map<Integer,Map<Integer,List<SegmentString>>>> 
-    //                        createGeometryHierarchy(Collection 
nodedSubstring) {
-    //    // Cr\xE9ation de geomStructureMap, une table regroupant les 
SegmentStrings
-    //    // r\xE9sultant du traitement en fonction du feature, du component, 
-    //    // (GeometryCollection) et de l'\xE9l\xE9ment lin\xE9aire d'origine.
-    //    // geomStructureMap     : 1 Feature --> N components
-    //    // componentMap         : 1 component --> N linearElements
-    //    // segmentString List   : 1 linearElement --> N SegmentStringWithRef
-    //    Map<Feature,Map<Integer,Map<Integer,List<SegmentString>>>> 
geomStructureMap = 
-    //        new 
HashMap<Feature,Map<Integer,Map<Integer,List<SegmentString>>>>();
-    //    for (Object line : nodedSubstring) {
-    //        SegmentString ss = (SegmentString)line;
-    //        SegmentStringData metadata = (SegmentStringData)ss.getData();
-    //        Feature feature = metadata.getFeature();
-    //        int component = metadata.getComponent();
-    //        int linearElement = metadata.getLinearElement();
-    //        // R\xE9cup\xE9rer la table pour ce Feature
-    //        Map<Integer,Map<Integer,List<SegmentString>>> components = 
geomStructureMap.get(feature);
-    //        // Ce Feature n'a pas encore d'entr\xE9e
-    //        if (components == null) {
-    //            components = new 
HashMap<Integer,Map<Integer,List<SegmentString>>>(1);
-    //            Map<Integer,List<SegmentString>> linearElements = new 
HashMap<Integer,List<SegmentString>>(1);
-    //            List<SegmentString> ssl = new ArrayList<SegmentString>(2);
-    //            ssl.add(ss);
-    //            linearElements.put(linearElement, ssl);
-    //            components.put(component, linearElements);
-    //            geomStructureMap.put(feature, components);
-    //        }
-    //        else {
-    //            Map<Integer,List<SegmentString>> linearElements = 
components.get(component);
-    //            if (linearElements == null) {
-    //                linearElements = new 
HashMap<Integer,List<SegmentString>>(1);
-    //                List<SegmentString> ssl = new 
ArrayList<SegmentString>(2);
-    //                ssl.add(ss);
-    //                linearElements.put(linearElement, ssl);
-    //                components.put(component, linearElements);
-    //            }
-    //            else {
-    //                List<SegmentString> ssl = 
linearElements.get(linearElement);
-    //                if (ssl == null) {
-    //                    ssl = new ArrayList<SegmentString>(2);
-    //                }
-    //                ssl.add(ss);
-    //                linearElements.put(linearElement, ssl);
-    //            }
-    //        }
-    //    }
-    //    return geomStructureMap;
-    //}
         
 }

Modified: 
core/trunk/src/com/vividsolutions/jump/plugin/edit/TriPointTransRotScaleBuilder.java
===================================================================
--- 
core/trunk/src/com/vividsolutions/jump/plugin/edit/TriPointTransRotScaleBuilder.java
        2016-09-20 21:04:45 UTC (rev 5024)
+++ 
core/trunk/src/com/vividsolutions/jump/plugin/edit/TriPointTransRotScaleBuilder.java
        2016-09-20 21:42:33 UTC (rev 5025)
@@ -58,10 +58,8 @@
 
   protected void compute(Coordinate[] srcPt, Coordinate[] destPt)
   {
-    /**
-     * For now just extract a Y scale from the third pt.
-     * In future could do shear too.
-     */
+    //For now just extract a Y scale from the third pt.
+    //In future could do shear too.
 
     originX = srcPt[1].x;
     originY = srcPt[1].y;

Modified: core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometry.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometry.java    
2016-09-20 21:04:45 UTC (rev 5024)
+++ core/trunk/src/com/vividsolutions/jump/qa/diff/DiffGeometry.java    
2016-09-20 21:42:33 UTC (rev 5025)
@@ -95,9 +95,8 @@
       Feature f = (Feature) i.next();
       Geometry geom = f.getGeometry();
 
-      Collection list = DiffGeometryIndex.splitGeometry(geom, 
splitIntoComponents);
-      for (Iterator j = list.iterator(); j.hasNext(); ) {
-        Geometry g = (Geometry) j.next();
+      Collection<Geometry> list = DiffGeometryIndex.splitGeometry(geom, 
splitIntoComponents);
+      for (Geometry g : list) {
         if (! diffIndex.hasMatch(g))
           noMatch.add(f);
       }


------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to