Skip to content

Commit

Permalink
Merge branch 'master' of github.com:BernhardWebstudio/DataShot_Deskto…
Browse files Browse the repository at this point in the history
…pApp
  • Loading branch information
GenieTim committed Sep 22, 2024
2 parents 01ef0ae + b338d71 commit f271ba0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
);
Expand Down

0 comments on commit f271ba0

Please sign in to comment.