Skip to content

Commit ef4c711

Browse files
committed
Fix leading edge table cell background color.
Refs #513
1 parent 0e5de15 commit ef4c711

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/heatmap/GSEALeadingEdgeRankingOption.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ public Map<Integer,RankValue> getRanking(Collection<Integer> genes) {
101101
Map<Integer,RankValue> result = new HashMap<>();
102102

103103
int previous = -1;
104-
boolean significant = false;
105104

106105
for (int m = 0; m < ranksSubset.length; m++) {
107106
//if the current gene doesn't have a rank then don't show it
@@ -112,10 +111,10 @@ public Map<Integer,RankValue> getRanking(Collection<Integer> genes) {
112111

113112
previous = ranksSubset[m];
114113

115-
significant = false;
116-
if (ranksSubset[m] <= topRank && !isNegative && topRank != 0 && topRank != -1)
114+
boolean significant = false;
115+
if (!isNegative && ranksSubset[m] <= topRank && topRank != 0 && topRank != -1)
117116
significant = true;
118-
else if (ranksSubset[m] >= topRank && isNegative && topRank != 0 && topRank != -1)
117+
else if (isNegative && ranksSubset[m] >= topRank && topRank != 0 && topRank != -1)
119118
significant = true;
120119

121120
List<Integer> keys = rank2keys.get(ranksSubset[m]);

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/heatmap/table/RankValue.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@
1111
*/
1212
public class RankValue {
1313

14-
public static final RankValue EMPTY = new RankValue(null, null, false);
15-
14+
public static final RankValue EMPTY = new RankValue(null, null, false) {
15+
@Override public String toString() {
16+
return "RankValue[EMPTY]";
17+
}
18+
};
1619

1720
private @Nullable Integer rank;
1821
private @Nullable Double score;
@@ -45,5 +48,11 @@ public void setRank(Integer rank) {
4548
public boolean isSignificant() {
4649
return significant;
4750
}
51+
52+
@Override
53+
public String toString() {
54+
return "RankValue[rank=" + rank + ", score=" + score + ", significant=" + significant + "]";
55+
}
56+
4857

4958
}

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/heatmap/table/RankValueRenderer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ public class RankValueRenderer extends DefaultTableCellRenderer {
1818
@Override
1919
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) {
2020
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
21+
setBackground(table.getBackground());
22+
setText("");
2123

2224
if(value instanceof RankValue) {
2325
RankValue rankValue = (RankValue) value;
2426
setText(ExportTXTTask.getRankText(format, rankValue));
2527

26-
if (rankValue.isSignificant()) {
28+
if(rankValue.isSignificant()) {
2729
setBackground(SIGNIFICANT_COLOR);
28-
setOpaque(true);
2930
}
3031
}
3132

0 commit comments

Comments
 (0)