Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
in dataTable, when both gtfs/osm values are empty, set new value as e…
Browse files Browse the repository at this point in the history
…mpty too
  • Loading branch information
tenzap committed Jul 31, 2023
1 parent 2376e29 commit b10d999
Showing 1 changed file with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,33 @@ private void checkBoxEvent(MouseEvent e) {

// add appropriate data to New Values
String dataValue = (String)dataTable.getValueAt(row, column-1);
if((dataValue!=null) && !(dataValue.equals(""))){
Boolean otherCheckBox;
String otherData, insertData=dataValue;
int otherCheckColumn;
int dataColumn = column - 1;
int otherDataColumn;

Boolean otherCheckBox;
String otherData, insertData = dataValue;
int otherCheckColumn;
int otherDataColumn;

// look at data, checkBox info for other columns
// FIXME: needs some cleaning up for better readability
if (column == StopTableInfo.GTFS_CHECK_COL) {
otherCheckColumn = StopTableInfo.OSM_CHECK_COL;
otherDataColumn = otherCheckColumn - 1;
otherCheckBox = (Boolean) dataTable.getValueAt(row, otherCheckColumn);
otherData = (String) dataTable.getValueAt(row, otherDataColumn);
} else { // column == StopTableInfo.OSM_CHECK_COL
otherCheckColumn = StopTableInfo.GTFS_CHECK_COL;
otherDataColumn = otherCheckColumn - 1;
otherCheckBox = (Boolean) dataTable.getValueAt(row, otherCheckColumn);
otherData = (String) dataTable.getValueAt(row, otherDataColumn);
}

if((dataValue!=null) && !(dataValue.equals(""))){
// look at data, checkBox info for other columns
// FIXME: needs some cleaning up for better readability
if(column==StopTableInfo.GTFS_CHECK_COL) {
otherCheckColumn = StopTableInfo.OSM_CHECK_COL;
otherDataColumn = otherCheckColumn - 1;
otherCheckBox = (Boolean)dataTable.getValueAt(row, otherCheckColumn);
otherData = (String)dataTable.getValueAt(row, otherDataColumn);
if(otherData!=null && !(otherData.equals("")))
insertData = addToOSMMultiValue(dataValue, otherData);
} else { // column == StopTableInfo.OSM_CHECK_COL
otherCheckColumn = StopTableInfo.GTFS_CHECK_COL;
otherDataColumn = otherCheckColumn - 1;
otherCheckBox = (Boolean)dataTable.getValueAt(row, otherCheckColumn);
otherData = (String)dataTable.getValueAt(row, otherDataColumn);
if(otherCheckBox) {
if (otherData!=null && !(otherData.equals("")))
insertData = addToOSMMultiValue(dataValue, otherData);
Expand Down Expand Up @@ -118,6 +124,11 @@ private void checkBoxEvent(MouseEvent e) {
}
}

if ((dataValue == null || dataValue.isBlank()) && (otherData == null || otherData.isBlank())) {
insertData = null;
dataTable.setValueAt(insertData, row, StopTableInfo.NEW_VALUE_DATA_COL);
}

String tagName = (String)dataTable.getValueAt(row, 0);
if (tagName.equals("public_transport:version")) {
reportViewer.PTVersionChanged();
Expand Down

0 comments on commit b10d999

Please sign in to comment.