X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FIdCanvas.java;fp=src%2Fjalview%2Fgui%2FIdCanvas.java;h=68a7a1efa69aadd697f0b6e75050d7b96993254e;hb=009800c1f9a3d5aa973d931ec72b35a8742a7c29;hp=e284bbe0638cb409f5e080cebbf7c23815c4e74e;hpb=31714b90648bba773f68736b8c1700ae53805eee;p=jalview.git diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index e284bbe..68a7a1e 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -321,11 +321,11 @@ public class IdCanvas extends JPanel implements ViewportListenerI int colWid = 20; int panelWidth = Math.max(fullPanelWidth / 2, fullPanelWidth - (colWid * visible.size())); - int xPos = 0; // Now draw the id strings for (int i = startSeq; i <= endSeq; i++) { + int xPos = 0; SequenceI sequence = alignViewport.getAlignment().getSequenceAt(i); if (sequence == null) @@ -377,28 +377,33 @@ public class IdCanvas extends JPanel implements ViewportListenerI if (visible != null && visible.size() > 0) { - xPos = panelWidth + 2; - for (IdColumn col : visible) + try { - ColumnCell col_cell = id_cols.getCellFor(sequence, col); - if (col_cell == null) - { - g.setColor(Color.gray); - g.fillRect(xPos, (i - startSeq) * charHeight, xPos + colWid - 4, - charHeight); - } - else + xPos = panelWidth + 2; + for (IdColumn col : visible) { - g.setColor(col_cell.bg); - g.fillRect(xPos, (i - startSeq) * charHeight, xPos + colWid - 4, - charHeight); - g.setColor(col_cell.fg); - g.drawString(col_cell.label, xPos, - (((i - startSeq) * charHeight) + charHeight) - - (charHeight / 5)); + ColumnCell col_cell = id_cols.getCellFor(sequence, col); + if (col_cell == null) + { + g.setColor(Color.gray); + g.fillRect(xPos + 1, (i - startSeq) * charHeight, + xPos + colWid - 3, charHeight); + } + else + { + g.setColor(col_cell.bg); + g.fillRect(xPos + 1, (i - startSeq) * charHeight, + xPos + colWid - 3, charHeight); + g.setColor(col_cell.fg); + g.drawString(col_cell.label, xPos, + (((i - startSeq) * charHeight) + charHeight) + - (charHeight / 5)); + } + xPos += colWid; + g.setColor(currentTextColor); } - xPos += colWid; - g.setColor(currentTextColor); + } catch (Exception q) + { } } if (hasHiddenRows && av.getShowHiddenMarkers())