X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FIdCanvas.java;h=9e64b1ed681b6ddccc903475cba70530bf829fe0;hb=577f505f54fe343e89f581461e780ea8308c20ec;hp=11d99d84d2ec8737afd713104e9015d78b83bf82;hpb=07c25ef5f4631d5d385191bb01630f02fd1e06bb;p=jalview.git diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index 11d99d8..9e64b1e 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -10,7 +10,6 @@ public class IdCanvas extends JPanel { protected AlignViewport av; - public boolean paintFlag = false; protected boolean showScores = true; protected int maxIdLength = -1; @@ -23,28 +22,29 @@ public class IdCanvas extends JPanel PaintRefresher.Register(this); } - public void drawIdString(Graphics gg,SequenceI ds,int i, int starty, int ypos) { + public void drawIdString(Graphics gg,SequenceI s,int i, int starty, int ypos) { int charHeight = av.getCharHeight(); - if (av.getSelection().contains(ds)) { + + if (av.getSelectionGroup()!=null && av.getSelectionGroup().sequences.contains(s)) { gg.setColor(Color.lightGray); gg.fillRect(0,AlignmentUtil.getPixelHeight(starty,i,charHeight)+ ypos,getWidth(),charHeight); gg.setColor(Color.white); } else { - gg.setColor(ds.getColor()); + gg.setColor(s.getColor()); gg.fillRect(0,AlignmentUtil.getPixelHeight(starty,i,charHeight)+ ypos,getWidth(),charHeight); gg.setColor(Color.black); } - String string = ds.getName() + "/" + ds.getStart() + "-" + ds.getEnd(); + String string = s.getName() + "/" + s.getStart() + "-" + s.getEnd(); gg.drawString(string,0,AlignmentUtil.getPixelHeight(starty,i,charHeight) + ypos + charHeight- (charHeight/5)); } public void paintComponent(Graphics gg) { - AlignmentI da = av.getAlignment(); - int charHeight = av.getCharHeight(); + AlignmentI al = av.alignment; + int charHeight = av.charHeight; gg.setFont(av.getFont()); //Fill in the background @@ -56,20 +56,20 @@ public class IdCanvas extends JPanel //Which ids are we printing int starty = av.getStartSeq(); - int endy = da.getHeight(); + int endy = av.endSeq; if (av.getWrapAlignment()) { // Draw the rest of the panels - int chunkHeight = (da.getHeight() + 2)*av.charHeight; + int chunkHeight = (al.getHeight() + 2)*av.charHeight; int row = av.getStartRes() / av.chunkWidth ; for(int ypos=2*av.charHeight; - ypos <= getHeight() && row*av.chunkWidth