Skip to content

Commit

Permalink
Revert "Merge branch 'Cluster-rows-in-HeatMap' of https://github.com/…
Browse files Browse the repository at this point in the history
…sumanthreddy542/MetaOmGraph into Cluster-rows-in-HeatMap"

This reverts commit 581c916, reversing
changes made to 3586607.
  • Loading branch information
SumanthKaliki-Formlabs committed Aug 2, 2021
1 parent 581c916 commit 9577ed8
Showing 1 changed file with 8 additions and 26 deletions.
34 changes: 8 additions & 26 deletions src/edu/iastate/metnet/metaomgraph/ui/DualTablePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,15 @@ private void searchInactiveTab(boolean isFeatureMetaData) {
for (int i = 0; i < queries.length; i++) {

matchingRows.addAll(
getMatchingRow(queries[i].getField(), queries[i].getTerm(), queries[i].isCaseSensitive(),
inactiveTable, queries[i].getMatchType()));
getMatchingRow(queries[i].getField(), queries[i].getTerm(), inactiveTable, queries[i].getMatchType()));
}

} else {
java.util.List<java.util.List<Integer>> tempList = new ArrayList<>();
for (int i = 0; i < queries.length; i++) {
java.util.List<Integer> temp = new ArrayList<>();
temp.addAll(
getMatchingRow(queries[i].getField(), queries[i].getTerm(), queries[i].isCaseSensitive(),
inactiveTable, queries[i].getMatchType()));
getMatchingRow(queries[i].getField(), queries[i].getTerm(), inactiveTable, queries[i].getMatchType()));
tempList.add(temp);
}

Expand Down Expand Up @@ -274,27 +272,19 @@ private void setSelectedRows(JTable tab, java.util.List<Integer> rows) {
}
}

private java.util.List<Integer> getMatchingRow(String colName, String val, boolean matchCase,
JTable tab, SearchMatchType matchType) {
private java.util.List<Integer> getMatchingRow(String colName, String val, JTable tab, SearchMatchType matchType) {
java.util.List<Integer> res = new ArrayList<>();

if(!matchCase) {
val = val.toLowerCase();
}


// special case
if (colName.equals("All Fields")) {
boolean breakFlag = false;
for (int i = 0; i < tab.getRowCount(); i++) {
breakFlag = false;
for (int j = 1; j < tab.getModel().getColumnCount(); j++) {
for (int j = 1; j < tab.getColumnCount(); j++) {
String valAtij = "";
// value can be null for correlations in list which has values for only some rows
if (tab.getModel().getValueAt(i, j) != null) {
valAtij = tab.getModel().getValueAt(i, j).toString();
if(!matchCase) {
valAtij = valAtij.toLowerCase();
}
}
if (matchType == SearchMatchType.IS) {
if (!valAtij.contentEquals(val)) {
Expand Down Expand Up @@ -327,14 +317,11 @@ private java.util.List<Integer> getMatchingRow(String colName, String val, boole
boolean foundFlag = false;
for (int i = 0; i < tab.getRowCount(); i++) {
foundFlag = false;
for (int j = 1; j < tab.getModel().getColumnCount(); j++) {// For each column in that row
for (int j = 1; j < tab.getColumnCount(); j++) {// For each column in that row
String valAtij = "";
// value can be null for correlations in list which has values for only some rows
if (tab.getModel().getValueAt(i, j) != null) {
valAtij = tab.getModel().getValueAt(i, j).toString();
if(!matchCase) {
valAtij = valAtij.toLowerCase();
}
}
if (matchType == SearchMatchType.IS) {
if (valAtij.contentEquals(val)) {
Expand Down Expand Up @@ -371,9 +358,6 @@ private java.util.List<Integer> getMatchingRow(String colName, String val, boole
// rows
if (tab.getModel().getValueAt(i, colIndex) != null) {
valAtij = tab.getModel().getValueAt(i, colIndex).toString();
if(!matchCase) {
valAtij = valAtij.toLowerCase();
}
}
if (matchType == SearchMatchType.IS) {
if (valAtij.contentEquals(val)) {
Expand Down Expand Up @@ -419,17 +403,15 @@ private void searchActiveTab(boolean isFeatureMetaData) {
for (int i = 0; i < queries.length; i++) {

matchingRows.addAll(
getMatchingRow(queries[i].getField(), queries[i].getTerm(), queries[i].isCaseSensitive(),
activeTable, queries[i].getMatchType()));
getMatchingRow(queries[i].getField(), queries[i].getTerm(), activeTable, queries[i].getMatchType()));
}

} else {
java.util.List<java.util.List<Integer>> tempList = new ArrayList<>();
for (int i = 0; i < queries.length; i++) {
java.util.List<Integer> temp = new ArrayList<>();
temp.addAll(
getMatchingRow(queries[i].getField(), queries[i].getTerm(), queries[i].isCaseSensitive(),
activeTable, queries[i].getMatchType()));
getMatchingRow(queries[i].getField(), queries[i].getTerm(), activeTable, queries[i].getMatchType()));
tempList.add(temp);
}

Expand Down

0 comments on commit 9577ed8

Please sign in to comment.