viewport.setAlignment( new Alignment(seq) );\r
updateEditMenuBar();\r
viewport.updateConsensus();\r
- alignPanel.RefreshPanels();\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
public void moveSelectedSequences(boolean up)\r
}\r
}\r
\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
\r
viewport.alignment.getWidth();\r
viewport.updateConservation();\r
viewport.updateConsensus();\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
}catch(Exception ex){}// could be anything being pasted in here\r
}catch(Exception ex){}\r
viewport.updateConservation();\r
viewport.updateConsensus();\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
\r
}\r
\r
viewport.setAlignment( new Alignment(seq) );\r
updateEditMenuBar();\r
viewport.updateConsensus();\r
- alignPanel.RefreshPanels();\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
+ alignPanel.repaint();\r
}\r
\r
\r
viewport.alignment.deleteAllGroups();\r
viewport.setSelectionGroup(null);\r
\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
\r
viewport.alignment.deleteGroup(sg);\r
}\r
\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
}\r
\r
\r
\r
\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
}\r
viewport.getAlignment().removeGaps();\r
viewport.updateConservation();\r
viewport.updateConsensus();\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
public void removeAllGapsMenuItem_actionPerformed(ActionEvent e)\r
}\r
viewport.updateConservation();\r
viewport.updateConsensus();\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
public void setGapCharMenuItem_actionPerformed(ActionEvent e)\r
}\r
setGapCharMenuItem.setText("Set gap character to \""+nextChar+"\"");\r
viewport.setGapCharacter(thisChar);\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
public void findMenuItem_actionPerformed(ActionEvent e)\r
viewport.setShowFullId( fullSeqId.isSelected() );\r
\r
alignPanel.idPanel.idCanvas.setPreferredSize( alignPanel.calculateIdWidth() );\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
protected void colourTextMenuItem_actionPerformed(ActionEvent e)\r
{\r
viewport.setColourText( colourTextMenuItem.isSelected() );\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
protected void wrapMenuItem_actionPerformed(ActionEvent e)\r
scaleAbove.setVisible( wrapMenuItem.isSelected() );\r
scaleLeft.setVisible( wrapMenuItem.isSelected() );\r
scaleRight.setVisible( wrapMenuItem.isSelected() );\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
protected void scaleAbove_actionPerformed(ActionEvent e)\r
public void viewBoxesMenuItem_actionPerformed(ActionEvent e)\r
{\r
viewport.setShowBoxes( viewBoxesMenuItem.isSelected() );\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
public void viewTextMenuItem_actionPerformed(ActionEvent e)\r
{\r
viewport.setShowText( viewTextMenuItem.isSelected() );\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
\r
protected void renderGapsMenuItem_actionPerformed(ActionEvent e)\r
{\r
viewport.setRenderGaps(renderGapsMenuItem.isSelected());\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
public void sequenceFeatures_actionPerformed(ActionEvent evt)\r
AlignmentUtil.fetchSequenceFeatures( viewport.alignment , alignPanel);\r
((Alignment)viewport.alignment).featuresAdded = true;\r
}\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
public void annotationPanelMenuItem_actionPerformed(ActionEvent e)\r
\r
\r
\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
protected void modifyPID_actionPerformed(ActionEvent e)\r
{\r
addHistoryItem("sort");\r
AlignmentSorter.sortByPID(viewport.getAlignment(), viewport.getAlignment().getSequenceAt(0));\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
public void sortIDMenuItem_actionPerformed(ActionEvent e)\r
{\r
addHistoryItem("sort");\r
AlignmentSorter.sortByID( viewport.getAlignment() );\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
public void sortGroupMenuItem_actionPerformed(ActionEvent e)\r
addHistoryItem("sort");\r
AlignmentSorter.sortByGroup(viewport.getAlignment());\r
AlignmentSorter.sortGroups(viewport.getAlignment());\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
\r
public void removeRedundancyMenuItem_actionPerformed(ActionEvent e)\r
{\r
addHistoryItem("sort");\r
AlignmentSorter.sortByTree(viewport.getAlignment(), treePanel.getTree());\r
- alignPanel.RefreshPanels();\r
+ alignPanel.repaint();\r
}\r
});\r
\r
scalePanelHolder.add(scalePanel, BorderLayout.CENTER);\r
seqPanelHolder.add(seqPanel, BorderLayout.CENTER);\r
\r
- javax.swing.SwingUtilities.invokeLater(new Runnable()\r
- {\r
- public void run()\r
- {\r
- invalidate();\r
- setScrollValues(0,0);\r
- Dimension d = calculateIdWidth();\r
- d.setSize( d.width+4, d.height);\r
- idPanel.idCanvas.setPreferredSize( d );\r
- RefreshPanels();\r
- }\r
- });\r
-\r
+ setScrollValues(0, 0);\r
\r
hscroll.addAdjustmentListener(this);\r
vscroll.addAdjustmentListener(this);\r
{\r
public void componentResized(ComponentEvent evt)\r
{\r
- RefreshPanels();\r
+ repaint();\r
}\r
});\r
\r
{\r
case 27: // escape key\r
av.setSelectionGroup(null);\r
- RefreshPanels();\r
+ repaint();\r
break;\r
case KeyEvent.VK_X:\r
if(evt.isControlDown())\r
{\r
annotationSpaceFillerHolder.setVisible(b);\r
annotationScroller.setVisible(b);\r
- javax.swing.SwingUtilities.invokeLater(new Runnable()\r
- {\r
- public void run()\r
- {\r
- RefreshPanels();\r
- }\r
- });\r
-\r
}\r
\r
\r
annotationScroller.setVisible(!wrap);\r
annotationSpaceFillerHolder.setVisible(!wrap);\r
idSpaceFillerPanel1.setVisible(!wrap);\r
- javax.swing.SwingUtilities.invokeLater(new Runnable()\r
- {\r
- public void run()\r
- {\r
- RefreshPanels();\r
- }\r
- });\r
+\r
+ repaint();\r
\r
}\r
\r
\r
}\r
\r
- RefreshPanels();\r
- }\r
-\r
-\r
- public void RefreshPanels()\r
- {\r
-\r
- Dimension d = idPanel.idCanvas.getPreferredSize();\r
- idPanelHolder.setPreferredSize(d);\r
- hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12));\r
-\r
- if (av.getWrapAlignment())\r
- {\r
- int max = av.alignment.getWidth() / seqPanel.seqCanvas.getWrappedCanvasWidth(seqPanel.seqCanvas.getWidth());\r
- vscroll.setValues(0, 1, 0, max);\r
- }\r
- else\r
- {\r
- if (overviewPanel != null)\r
- overviewPanel.updateOverviewImage();\r
- setScrollValues(av.getStartRes(), av.getStartSeq());\r
- }\r
-\r
- validate();\r
repaint();\r
}\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
+\r
+ if (av.getWrapAlignment())\r
+ {\r
+ int max = av.alignment.getWidth() / seqPanel.seqCanvas.getWrappedCanvasWidth(seqPanel.seqCanvas.getWidth());\r
+ vscroll.setMaximum(max);\r
+ vscroll.setUnitIncrement(1);\r
+ }\r
+ else\r
+ {\r
+ if (overviewPanel != null)\r
+ overviewPanel.updateOverviewImage();\r
+ setScrollValues(av.getStartRes(), av.getStartSeq());\r
+ }\r
+\r
+ validate();\r
+\r
+ }\r
+\r
public int print(Graphics pg, PageFormat pf, int pi) throws PrinterException\r
{\r
pg.translate((int)pf.getImageableX(), (int)pf.getImageableY());\r