{\r
boolean active = false;\r
AlignmentPanel ap;\r
+ AlignViewport av;\r
boolean resizing = false;\r
int oldY, mouseX;\r
static String ADDNEW = "Add new row";\r
public AnnotationLabels(AlignmentPanel ap)\r
{\r
this.ap = ap;\r
+ this.av = ap.av;\r
setLayout(null);\r
addMouseListener(new MouseAdapter()\r
{\r
});\r
}\r
\r
+ public AnnotationLabels(AlignViewport av)\r
+{\r
+ this.av = av;\r
+}\r
+\r
+\r
public void setScrollOffset(int y)\r
{\r
scrollOffset = y;\r
\r
public void actionPerformed(ActionEvent evt)\r
{\r
- AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();\r
+ AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
\r
if (evt.getActionCommand().equals(HIDE))\r
{\r
\r
public void paint(Graphics g)\r
{\r
- drawComponent(g);\r
+ drawComponent(g, getSize().width);\r
}\r
\r
- public void drawComponent(Graphics g)\r
+ public void drawComponent(Graphics g, int width)\r
{\r
FontMetrics fm = g.getFontMetrics(g.getFont());\r
g.setColor(Color.white);\r
g.translate(0, scrollOffset);\r
g.setColor(Color.black);\r
\r
- AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();\r
+ AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
int y = g.getFont().getSize();\r
int x = 0;\r
\r
continue;\r
}\r
\r
- x = getSize().width - fm.stringWidth(aa[i].label) - 3;\r
+ x = width - fm.stringWidth(aa[i].label) - 3;\r
\r
if (aa[i].isGraph)\r
{\r