Skip to content

Commit

Permalink
- NEW: Added a new column to the Features table to track coverage val…
Browse files Browse the repository at this point in the history
…ues (for single point features). Refs #10.
  • Loading branch information
imilne committed Oct 14, 2020
1 parent 1c7cc70 commit ffb84b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions res/text/tablet.properties
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ gui.FeaturesTableModel.col1 = Type
gui.FeaturesTableModel.col2 = Name
gui.FeaturesTableModel.col3 = Start
gui.FeaturesTableModel.col4 = End
gui.FeaturesTableModel.col4 = Coverage

gui.FindPanel.guiWarnSearchLimitExceeded = For the sake of performance, Tablet \
stops searching after {0} matches have been found.
Expand Down
12 changes: 11 additions & 1 deletion src/tablet/gui/FeaturesTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ class FeaturesTableModel extends AbstractTableModel
String col2 = RB.getString("gui.FeaturesTableModel.col2");
String col3 = RB.getString("gui.FeaturesTableModel.col3");
String col4 = RB.getString("gui.FeaturesTableModel.col4");
String col5 = RB.getString("gui.FeaturesTableModel.col5");

columnNames = new String[] { col1, col2, col3, col4 };
columnNames = new String[] { col1, col2, col3, col4, col5 };
}

void setContig(Contig contig)
Expand Down Expand Up @@ -81,6 +82,12 @@ public Object getValueAt(int row, int col)
case 1: return feature.getName();
case 2: return feature.getDataPS()+1; // +1 back into consensus space
case 3: return feature.getDataPE()+1; // +1 back into consensus space
case 4: {
if (feature.getDataPS() == feature.getDataPE())
return DisplayData.getCoverageAt(feature.getDataPS());
else
return null;
}
}

return null;
Expand All @@ -105,6 +112,9 @@ public Component getTableCellRendererComponent(JTable table, Object value,
super.getTableCellRendererComponent(table, value, isSel, hasFocus,
row, column);

if (value == null)
return this;

Contig contig = ((FeaturesTableModel)table.getModel()).getContig();

setForeground(isSel ? Color.white : Color.black);
Expand Down

0 comments on commit ffb84b2

Please sign in to comment.