- protected AlignViewport av;\r
-\r
- protected boolean showScores = true;\r
-\r
- protected int maxIdLength = -1;\r
- protected String maxIdStr = null;\r
- BufferedImage image;\r
- Graphics2D gg;\r
- int imgHeight=0;\r
- boolean fastPaint = false;\r
-\r
- public IdCanvas(AlignViewport av)\r
- {\r
- setLayout(new BorderLayout());\r
- this.av = av;\r
- PaintRefresher.Register(this);\r
- }\r
-\r
- public void drawIdString(Graphics2D gg,SequenceI s,int i, int starty, int ypos) {\r
- int charHeight = av.getCharHeight();\r
-\r
-\r
- if (av.getSelectionGroup()!=null && av.getSelectionGroup().sequences.contains(s)) {\r
- gg.setColor(Color.lightGray);\r
- gg.fillRect(0,AlignmentUtil.getPixelHeight(starty,i,charHeight)+ ypos,getWidth(),charHeight);\r
- gg.setColor(Color.white);\r
- } else {\r
- gg.setColor(s.getColor());\r
- gg.fillRect(0,AlignmentUtil.getPixelHeight(starty,i,charHeight)+ ypos,getWidth(),charHeight);\r
- gg.setColor(Color.black);\r
- }\r
+ protected AlignViewport av;\r
+ protected boolean showScores = true;\r
+ protected int maxIdLength = -1;\r
+ protected String maxIdStr = null;\r
+ BufferedImage image;\r
+ Graphics2D gg;\r
+ int imgHeight = 0;\r
+ boolean fastPaint = false;\r
+ java.util.Vector searchResults;\r
+ FontMetrics fm;\r
+ AnnotationLabels labels = null;\r
+ AnnotationPanel ap;\r
+\r
+ /**\r
+ * Creates a new IdCanvas object.\r
+ *\r
+ * @param av DOCUMENT ME!\r
+ */\r
+ public IdCanvas(AlignViewport av)\r
+ {\r
+ setLayout(new BorderLayout());\r
+ this.av = av;\r
+ PaintRefresher.Register(this, av.getSequenceSetId());\r
+ }\r
+\r
+ /**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @param gg DOCUMENT ME!\r
+ * @param s DOCUMENT ME!\r
+ * @param i DOCUMENT ME!\r
+ * @param starty DOCUMENT ME!\r
+ * @param ypos DOCUMENT ME!\r
+ */\r
+ public void drawIdString(Graphics2D gg, SequenceI s, int i, int starty, int ypos)\r
+ {\r
+ int xPos = 0;\r
+ int panelWidth = getWidth();\r
+ int charHeight = av.charHeight;\r
+\r
+ if ((searchResults != null) && searchResults.contains(s))\r
+ {\r
+ gg.setColor(Color.black);\r
+ gg.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(),\r
+ charHeight);\r
+ gg.setColor(Color.white);\r
+ }\r
+ else if ((av.getSelectionGroup() != null) &&\r
+ av.getSelectionGroup().getSequences(null).contains(s))\r
+ {\r
+ gg.setColor(Color.lightGray);\r
+ gg.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(),\r
+ charHeight);\r
+ gg.setColor(Color.white);\r
+ }\r
+ else\r
+ {\r
+ gg.setColor(av.getSequenceColour(s));\r
+ gg.fillRect(0, ((i - starty) * charHeight) + ypos, getWidth(),\r
+ charHeight);\r
+ gg.setColor(Color.black);\r
+ }\r
+\r
+ if (av.rightAlignIds)\r
+ {\r
+ xPos = panelWidth - fm.stringWidth(\r
+ s.getDisplayId(av.getShowJVSuffix())\r
+ ) - 4;\r
+ }\r
+\r
+ gg.drawString( s.getDisplayId(av.getShowJVSuffix()),\r
+ xPos, (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));\r
+\r
+ if (av.hasHiddenRows && av.showHiddenMarkers)\r
+ drawMarker(i, starty, ypos);\r