annotationScroller.setViewportView(annotationPanel);\r
annotationSpaceFillerHolder.add(alabels, BorderLayout.CENTER);\r
\r
- Dimension d = calculateIdWidth();\r
- d.setSize( d.width+4, d.height);\r
- idPanel.idCanvas.setPreferredSize( d );\r
- hscrollFillerPanel.setPreferredSize( d );\r
+ fontChanged();\r
\r
scalePanelHolder.add(scalePanel, BorderLayout.CENTER);\r
seqPanelHolder.add(seqPanel, BorderLayout.CENTER);\r
hscroll.addAdjustmentListener(this);\r
vscroll.addAdjustmentListener(this);\r
\r
- addComponentListener(new ComponentAdapter()\r
- {\r
- public void componentResized(ComponentEvent evt)\r
- {\r
- repaint();\r
- }\r
- });\r
-\r
setFocusable(true);\r
addKeyListener(new KeyAdapter()\r
{\r
});\r
}\r
\r
+ public void fontChanged()\r
+ {\r
+ // set idCanvas bufferedImage to null\r
+ // to prevent drawing old image\r
+ idPanel.idCanvas.gg = null;\r
+ annotationPanel.adjustPanelHeight();\r
+ Dimension d = calculateIdWidth();\r
+ d.setSize(d.width + 4, d.height);\r
+ idPanel.idCanvas.setPreferredSize(d);\r
+ hscrollFillerPanel.setPreferredSize(d);\r
+ repaint();\r
+ }\r
+\r
+\r
Dimension calculateIdWidth()\r
{\r
Graphics g = this.getGraphics();\r
repaint();\r
else\r
{\r
+ idPanel.idCanvas.fastPaint(av.getStartSeq() - oldY);\r
seqPanel.seqCanvas.fastPaint(av.getStartRes() - oldX,\r
av.getStartSeq() - oldY);\r
- idPanel.idCanvas.fastPaint(av.getStartSeq() - oldY);\r
+\r
scalePanel.repaint();\r
if (av.getShowAnnotation())\r
annotationPanel.fastPaint(av.getStartRes() - oldX);\r
\r
}\r
\r
+\r
public void paintComponent(Graphics g)\r
{\r
invalidate();\r
-\r
Dimension d = idPanel.idCanvas.getPreferredSize();\r
idPanelHolder.setPreferredSize(d);\r
hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12));\r
+ validate();\r
\r
if (av.getWrapAlignment())\r
{\r
setScrollValues(av.getStartRes(), av.getStartSeq());\r
}\r
\r
- validate();\r
+\r
\r
}\r
\r