Changeset 34655 in osm for applications/editors/josm
- Timestamp:
- 2018-09-15T14:19:12+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/SavePictureCalibrationToWorldAction.java
r34544 r34655 7 7 import java.io.BufferedWriter; 8 8 import java.io.File; 9 import java.io.FileWriter;10 9 import java.io.IOException; 10 import java.nio.charset.StandardCharsets; 11 import java.nio.file.Files; 11 12 12 13 import javax.swing.JFileChooser; … … 16 17 import org.openstreetmap.josm.gui.MainApplication; 17 18 import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerAbstract; 19 import org.openstreetmap.josm.tools.Logging; 18 20 19 21 /** … … 73 75 file = new File(path + "." + wext); 74 76 } 75 try (BufferedWriter bw = new BufferedWriter(new FileWriter(file))) {77 try (BufferedWriter bw = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { 76 78 for (int i = 0; i < 6; i++) { 77 79 bw.write(Double.toString(values[i])); … … 81 83 } 82 84 } catch (IOException e) { 83 // Error 84 e.printStackTrace(); 85 Logging.error(e); 85 86 JOptionPane.showMessageDialog(MainApplication.getMainFrame(), 86 87 tr("Saving file failed: {0}", e.getMessage()), tr("Problem occurred"), JOptionPane.WARNING_MESSAGE); -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/command/TransformCommand.java
r34544 r34655 77 77 afterTransform = extractTransform(); 78 78 79 boolean changed = ! (beforeTransform.getTransform().equals(afterTransform.getTransform())) ||80 ! (beforeTransform.getOriginPoints().equals(afterTransform.getOriginPoints())) ||81 ! (beforeTransform.getImagePosition().equals(afterTransform.getImagePosition()));79 boolean changed = !beforeTransform.getTransform().equals(afterTransform.getTransform()) || 80 !beforeTransform.getOriginPoints().equals(afterTransform.getOriginPoints()) || 81 !beforeTransform.getImagePosition().equals(afterTransform.getImagePosition()); 82 82 if (changed && !alreadyAdded) { 83 83 UndoRedoHandler.getInstance().add(this); -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java
r34544 r34655 146 146 EastNorth center = MainApplication.getMap().mapView.getCenter(); 147 147 148 // imagePosition = new EastNorth(center.east(), center.north());149 148 transformer.setImagePosition(new EastNorth(center.east(), center.north())); 150 // initialImagePosition = new EastNorth(imagePosition.east(), imagePosition.north());151 149 // Initial scale at which the image was loaded 152 150 initialImageScale = MainApplication.getMap().mapView.getDist100Pixel(); … … 161 159 } 162 160 // Load image completely 163 (new ImageIcon(image)).getImage();161 new ImageIcon(image).getImage(); 164 162 165 163 lookForCalibration(); -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/kml/KMLReader.java
r34544 r34655 3 3 4 4 import java.io.File; 5 import java.io.FileReader;6 5 import java.io.IOException; 6 import java.nio.charset.StandardCharsets; 7 import java.nio.file.Files; 7 8 import java.util.List; 8 9 … … 27 28 XMLReader xr = XMLReaderFactory.createXMLReader(); 28 29 xr.setContentHandler(handler); 29 xr.parse(new InputSource( new FileReader(file)));30 xr.parse(new InputSource(Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8))); 30 31 } catch (SAXException | IOException e) { 31 32 Logging.error(e); -
applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/transform/Matrix3D.java
r33822 r34655 59 59 double s = 1/det; 60 60 61 invert.a[0][0] = (s)* (a[1][1] * a[2][2] - a[1][2] * a[2][1]);62 invert.a[1][0] = (s)* (a[1][2] * a[2][0] - a[1][0] * a[2][2]);63 invert.a[2][0] = (s)* (a[1][0] * a[2][1] - a[1][1] * a[2][0]);64 invert.a[0][1] = (s)* (a[0][2] * a[2][1] - a[0][1] * a[2][2]);65 invert.a[1][1] = (s)* (a[0][0] * a[2][2] - a[0][2] * a[2][0]);66 invert.a[2][1] = (s)* (a[0][1] * a[2][0] - a[0][0] * a[2][1]);67 invert.a[0][2] = (s)* (a[0][1] * a[1][2] - a[0][2] * a[1][1]);68 invert.a[1][2] = (s)* (a[0][2] * a[1][0] - a[0][0] * a[1][2]);69 invert.a[2][2] = (s)* (a[0][0] * a[1][1] - a[0][1] * a[1][0]);61 invert.a[0][0] = s * (a[1][1] * a[2][2] - a[1][2] * a[2][1]); 62 invert.a[1][0] = s * (a[1][2] * a[2][0] - a[1][0] * a[2][2]); 63 invert.a[2][0] = s * (a[1][0] * a[2][1] - a[1][1] * a[2][0]); 64 invert.a[0][1] = s * (a[0][2] * a[2][1] - a[0][1] * a[2][2]); 65 invert.a[1][1] = s * (a[0][0] * a[2][2] - a[0][2] * a[2][0]); 66 invert.a[2][1] = s * (a[0][1] * a[2][0] - a[0][0] * a[2][1]); 67 invert.a[0][2] = s * (a[0][1] * a[1][2] - a[0][2] * a[1][1]); 68 invert.a[1][2] = s * (a[0][2] * a[1][0] - a[0][0] * a[1][2]); 69 invert.a[2][2] = s * (a[0][0] * a[1][1] - a[0][1] * a[1][0]); 70 70 71 71 return invert;
Note:
See TracChangeset
for help on using the changeset viewer.