Skip to content

Commit 550eb3a

Browse files
committed
Automatically open final photo
1 parent d540637 commit 550eb3a

File tree

10 files changed

+11
-3
lines changed

10 files changed

+11
-3
lines changed

bin/finra/Main.class

175 Bytes
Binary file not shown.

bin/finra/photoOutput.class

27 Bytes
Binary file not shown.

coords.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1973
2-
2460
1+
2183
2+
1834

images/NYC2.jpg

-11.5 MB
Binary file not shown.
File renamed without changes.

images/output

-3.23 MB
Binary file not shown.

images/output.jpg

13.8 KB
Loading

param1.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
minLat,maxLat,minLong,maxLong,photoX,photoY,squareRadius(m)
2-
40.7012694,40.815425,-74.087647,-73.864114,4800,3122,400
2+
40.7012694,40.815425,-74.087647,-73.864114,4800,3122,350

src/finra/Main.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package finra;
22

3+
import java.awt.Desktop;
4+
import java.io.File;
35
import java.io.IOException;
46
import java.util.ArrayList;
57

@@ -19,5 +21,7 @@ public static void main(String[] args) throws IOException {
1921
System.out.println("calculated trip endpoints");
2022
photoOutput.createPicture(startPoints);
2123
System.out.println("saved map to file");
24+
25+
Desktop.getDesktop().open(new File("images/output.jpg"));
2226
}
2327
}

src/finra/photoOutput.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ static void createPicture(ArrayList<ArrayList<Integer>> pixels) throws IOExcepti
2626
Scanner sc = new Scanner(c);
2727
x = Integer.parseInt(sc.nextLine());
2828
y = Integer.parseInt(sc.nextLine());
29+
sc.close();
2930
} catch (Exception e) {
3031
System.out.println("error gathering points from coords.txt");
3132
}
3233

34+
3335
for (int i = 0; i < taxi.getWidth(); i++) {
3436
for (int j = 0; j < taxi.getHeight(); j++) {
3537
try {
@@ -40,5 +42,7 @@ static void createPicture(ArrayList<ArrayList<Integer>> pixels) throws IOExcepti
4042
}
4143
}
4244
ImageIO.write(b, "jpg", new File("images/output.jpg"));
45+
46+
4347
}
4448
}

0 commit comments

Comments
 (0)