Skip to content

Commit

Permalink
Minor changes that might fix using scripts to automate things
Browse files Browse the repository at this point in the history
  • Loading branch information
GenieTim committed Jul 20, 2024
1 parent 724d735 commit b338d71
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -368,6 +368,9 @@ private boolean saveData() {
* Update the marker on the map
*/
private void updateMap() {
if (textFieldDecimalLat.getText().isEmpty() || textFieldDecimalLong.getText().isEmpty()) {
return;
}
try {
GeoPosition address =
new GeoPosition(Double.parseDouble(textFieldDecimalLat.getText()),
@@ -377,7 +380,7 @@ private void updateMap() {
WaypointPainter<Waypoint> waypointPainter =
new WaypointPainter<Waypoint>();
waypointPainter.setWaypoints(
new HashSet<Waypoint>(Arrays.asList(new DefaultWaypoint(address))));
new HashSet<Waypoint>(List.of(new DefaultWaypoint(address))));

// Create a compound painter that uses both the route-painter and the
// waypoint-painter
Original file line number Diff line number Diff line change
@@ -466,7 +466,7 @@ private boolean save() {

// Elevations
Long min_elev;
if (jTextFieldMinElevation.getText().trim().length() == 0) {
if (jTextFieldMinElevation.getText().trim().isEmpty()) {
min_elev = null;
} else {
try {
@@ -477,7 +477,7 @@ private boolean save() {
}
specimen.setMinimum_elevation(min_elev);
Long max_elev;
if (jTextFieldMaxElevation.getText().trim().length() == 0) {
if (jTextFieldMaxElevation.getText().trim().isEmpty()) {
max_elev = null;
} else {
try {
@@ -547,11 +547,8 @@ private boolean save() {

specimen.setQuestions(jTextFieldQuestions.getText());
try {
// make sure specimen controller does not throw null pointer exception –
// whyever
if (specimenController.getSpecimen() == null) {
specimenController.setSpecimen(specimen);
}
// make sure specimen controller knows about the latest changes
specimenController.setSpecimen(specimen);
specimenController.save(); // save the record
setStateToClean(); // enable the navigation buttons
this.setStatus("Saved"); // inform the user
@@ -1774,7 +1771,7 @@ private JTable getNumberJTable() {
// jTableNumbers.transferFocus();
// }
// };
if (specimen.getNumbers().size() > 0) {
if (!specimen.getNumbers().isEmpty()) {
JTableCellTabbing.setTabMapping(
jTableNumbers, 0, specimen.getNumbers().size(), 0, 2
);

0 comments on commit b338d71

Please sign in to comment.