public void run()\r
{\r
PrinterJob printJob = PrinterJob.getPrinterJob();\r
- // printJob.\r
PageFormat pf = printJob.pageDialog(printJob.defaultPage());\r
printJob.setPrintable(alignPanel, pf);\r
if (printJob.printDialog())\r
\r
public void setGapCharMenuItem_actionPerformed(ActionEvent e)\r
{\r
- String thisChar = "-";\r
- String nextChar = ".";\r
- if(viewport.getGapCharacter().equals("-"))\r
+ char thisChar = '-';\r
+ char nextChar = '.';\r
+ if(viewport.getGapCharacter()=='-')\r
{\r
- thisChar = ".";\r
- nextChar = "-";\r
+ thisChar = '.';\r
+ nextChar = '-';\r
}\r
setGapCharMenuItem.setText("Set gap character to \""+nextChar+"\"");\r
viewport.setGapCharacter(thisChar);\r
+ alignPanel.RefreshPanels();\r
}\r
\r
+ public void findMenuItem_actionPerformed(ActionEvent e)\r
+ {\r
+ JOptionPane op = new JOptionPane();\r
+ JInternalFrame frame = op.createInternalFrame(this, "Find");\r
+ Finder finder = new Finder(viewport, alignPanel, frame);\r
+ frame.setContentPane(finder);\r
+ frame.setSize(300,110);\r
+ frame.setVisible(true);\r
+ }\r
+\r
+\r
\r
public void fontNameMenuItem_actionPerformed(ActionEvent e)\r
{\r
String fonts[] = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();\r
\r
\r
- String selection = JOptionPane.showInputDialog(this,\r
+ String selection = JOptionPane.showInternalInputDialog(this,\r
"Select font",\r
"Font selection",\r
JOptionPane.QUESTION_MESSAGE,\r
\r
public void fontSizeMenuItem_actionPerformed(ActionEvent e)\r
{\r
- String selection = JOptionPane.showInputDialog(this,\r
+ String selection = JOptionPane.showInternalInputDialog(this,\r
"Select font size",\r
"Font size",\r
JOptionPane.QUESTION_MESSAGE,\r
\r
public void fontStyleMenuItem_actionPerformed(ActionEvent e)\r
{\r
- String selection = JOptionPane.showInputDialog(this,\r
+ String selection = JOptionPane.showInternalInputDialog(this,\r
"Select font style",\r
"Font style",\r
JOptionPane.QUESTION_MESSAGE,\r
updateResidueView();\r
}\r
\r
+\r
+ protected void renderGapsMenuItem_actionPerformed(ActionEvent e)\r
+ {\r
+ viewport.setRenderGaps(renderGapsMenuItem.isSelected());\r
+ alignPanel.RefreshPanels();\r
+ }\r
+\r
+\r
void updateResidueView()\r
{\r
if (viewport.getSelection().size() == 0)\r
\r
}catch(java.lang.OutOfMemoryError ex)\r
{\r
- JOptionPane.showMessageDialog(this, "Sequence alignment too large to\nproduce overview image!!"\r
+ JOptionPane.showInternalMessageDialog(this, "Sequence alignment too large to\nproduce overview image!!"\r
+"\nTry reducing the font size.",\r
"Out of memory", JOptionPane.WARNING_MESSAGE);\r
}\r
public void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)\r
{\r
if(viewport.getSelection().size()<2)\r
- JOptionPane.showMessageDialog(this, "You must select at least 2 sequences.", "Invalid Selection", JOptionPane.WARNING_MESSAGE);\r
+ JOptionPane.showInternalMessageDialog(this, "You must select at least 2 sequences.", "Invalid Selection", JOptionPane.WARNING_MESSAGE);\r
else\r
{\r
JInternalFrame frame = new JInternalFrame();\r
if( (viewport.getSelection().size()<4 && viewport.getSelection().size()>0)\r
|| viewport.getAlignment().getHeight()<4)\r
{\r
- JOptionPane.showMessageDialog(this, "Principal component analysis must take\n"\r
+ JOptionPane.showInternalMessageDialog(this, "Principal component analysis must take\n"\r
+"at least 4 input sequences.",\r
"Sequence selection insufficient",\r
JOptionPane.WARNING_MESSAGE);\r
Desktop.addInternalFrame(frame, "Principal component analysis", 400, 400);\r
}catch(java.lang.OutOfMemoryError ex)\r
{\r
- JOptionPane.showMessageDialog(this, "Too many sequences selected\nfor Principal Component Analysis!!",\r
+ JOptionPane.showInternalMessageDialog(this, "Too many sequences selected\nfor Principal Component Analysis!!",\r
"Out of memory", JOptionPane.WARNING_MESSAGE);\r
}\r
\r
\r
public void clustalAlignMenuItem_actionPerformed(ActionEvent e)\r
{\r
- JOptionPane.showMessageDialog(this, "Jalview is currently being reengineered"\r
+ JOptionPane.showInternalMessageDialog(this, "Jalview is currently being reengineered"\r
+"\nwithin the Barton Group, Dundee University."\r
+"\nThis will be available as a web service 2005",\r
"Web service", JOptionPane.INFORMATION_MESSAGE);\r
\r
public void pdbTest_actionPerformed(ActionEvent e)\r
{\r
- String reply = JOptionPane.showInputDialog(this, "Enter pdb code", "PDB test viewer", JOptionPane.QUESTION_MESSAGE);\r
+ String reply = JOptionPane.showInternalInputDialog(this, "Enter pdb code", "PDB test viewer", JOptionPane.QUESTION_MESSAGE);\r
\r
String url = "http://www.ebi.ac.uk/cgi-bin/pdbfetch?id=1a4u";\r
if (reply.length()>1)\r
\r
}\r
\r
+\r
+ public void doKeyPressed(KeyEvent evt)\r
+ {\r
+\r
+ System.out.println(evt.getKeyChar());\r
+ if(evt.isControlDown() && evt.getKeyChar()=='f')\r
+ findMenuItem_actionPerformed(null);\r
+\r
+ }\r
+\r
+\r
}\r