From ec8471ebf81b41bcaad3f04a61aea43f3c166385 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 1 Dec 2004 17:13:13 +0000 Subject: [PATCH] showinternal***dialog --- src/jalview/gui/AlignFrame.java | 60 +++++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 4707f3a..63ed59a 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -86,7 +86,6 @@ public class AlignFrame extends GAlignFrame public void run() { PrinterJob printJob = PrinterJob.getPrinterJob(); - // printJob. PageFormat pf = printJob.pageDialog(printJob.defaultPage()); printJob.setPrintable(alignPanel, pf); if (printJob.printDialog()) @@ -332,24 +331,36 @@ public class AlignFrame extends GAlignFrame public void setGapCharMenuItem_actionPerformed(ActionEvent e) { - String thisChar = "-"; - String nextChar = "."; - if(viewport.getGapCharacter().equals("-")) + char thisChar = '-'; + char nextChar = '.'; + if(viewport.getGapCharacter()=='-') { - thisChar = "."; - nextChar = "-"; + thisChar = '.'; + nextChar = '-'; } setGapCharMenuItem.setText("Set gap character to \""+nextChar+"\""); viewport.setGapCharacter(thisChar); + alignPanel.RefreshPanels(); } + public void findMenuItem_actionPerformed(ActionEvent e) + { + JOptionPane op = new JOptionPane(); + JInternalFrame frame = op.createInternalFrame(this, "Find"); + Finder finder = new Finder(viewport, alignPanel, frame); + frame.setContentPane(finder); + frame.setSize(300,110); + frame.setVisible(true); + } + + public void fontNameMenuItem_actionPerformed(ActionEvent e) { String fonts[] = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); - String selection = JOptionPane.showInputDialog(this, + String selection = JOptionPane.showInternalInputDialog(this, "Select font", "Font selection", JOptionPane.QUESTION_MESSAGE, @@ -365,7 +376,7 @@ public class AlignFrame extends GAlignFrame public void fontSizeMenuItem_actionPerformed(ActionEvent e) { - String selection = JOptionPane.showInputDialog(this, + String selection = JOptionPane.showInternalInputDialog(this, "Select font size", "Font size", JOptionPane.QUESTION_MESSAGE, @@ -380,7 +391,7 @@ public class AlignFrame extends GAlignFrame public void fontStyleMenuItem_actionPerformed(ActionEvent e) { - String selection = JOptionPane.showInputDialog(this, + String selection = JOptionPane.showInternalInputDialog(this, "Select font style", "Font style", JOptionPane.QUESTION_MESSAGE, @@ -430,6 +441,14 @@ public class AlignFrame extends GAlignFrame updateResidueView(); } + + protected void renderGapsMenuItem_actionPerformed(ActionEvent e) + { + viewport.setRenderGaps(renderGapsMenuItem.isSelected()); + alignPanel.RefreshPanels(); + } + + void updateResidueView() { if (viewport.getSelection().size() == 0) @@ -493,7 +512,7 @@ public class AlignFrame extends GAlignFrame }catch(java.lang.OutOfMemoryError ex) { - JOptionPane.showMessageDialog(this, "Sequence alignment too large to\nproduce overview image!!" + JOptionPane.showInternalMessageDialog(this, "Sequence alignment too large to\nproduce overview image!!" +"\nTry reducing the font size.", "Out of memory", JOptionPane.WARNING_MESSAGE); } @@ -647,7 +666,7 @@ public class AlignFrame extends GAlignFrame public void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e) { if(viewport.getSelection().size()<2) - JOptionPane.showMessageDialog(this, "You must select at least 2 sequences.", "Invalid Selection", JOptionPane.WARNING_MESSAGE); + JOptionPane.showInternalMessageDialog(this, "You must select at least 2 sequences.", "Invalid Selection", JOptionPane.WARNING_MESSAGE); else { JInternalFrame frame = new JInternalFrame(); @@ -661,7 +680,7 @@ public class AlignFrame extends GAlignFrame if( (viewport.getSelection().size()<4 && viewport.getSelection().size()>0) || viewport.getAlignment().getHeight()<4) { - JOptionPane.showMessageDialog(this, "Principal component analysis must take\n" + JOptionPane.showInternalMessageDialog(this, "Principal component analysis must take\n" +"at least 4 input sequences.", "Sequence selection insufficient", JOptionPane.WARNING_MESSAGE); @@ -675,7 +694,7 @@ public class AlignFrame extends GAlignFrame Desktop.addInternalFrame(frame, "Principal component analysis", 400, 400); }catch(java.lang.OutOfMemoryError ex) { - JOptionPane.showMessageDialog(this, "Too many sequences selected\nfor Principal Component Analysis!!", + JOptionPane.showInternalMessageDialog(this, "Too many sequences selected\nfor Principal Component Analysis!!", "Out of memory", JOptionPane.WARNING_MESSAGE); } @@ -727,7 +746,7 @@ public class AlignFrame extends GAlignFrame public void clustalAlignMenuItem_actionPerformed(ActionEvent e) { - JOptionPane.showMessageDialog(this, "Jalview is currently being reengineered" + JOptionPane.showInternalMessageDialog(this, "Jalview is currently being reengineered" +"\nwithin the Barton Group, Dundee University." +"\nThis will be available as a web service 2005", "Web service", JOptionPane.INFORMATION_MESSAGE); @@ -735,7 +754,7 @@ public class AlignFrame extends GAlignFrame public void pdbTest_actionPerformed(ActionEvent e) { - String reply = JOptionPane.showInputDialog(this, "Enter pdb code", "PDB test viewer", JOptionPane.QUESTION_MESSAGE); + String reply = JOptionPane.showInternalInputDialog(this, "Enter pdb code", "PDB test viewer", JOptionPane.QUESTION_MESSAGE); String url = "http://www.ebi.ac.uk/cgi-bin/pdbfetch?id=1a4u"; if (reply.length()>1) @@ -763,4 +782,15 @@ public class AlignFrame extends GAlignFrame } + + public void doKeyPressed(KeyEvent evt) + { + + System.out.println(evt.getKeyChar()); + if(evt.isControlDown() && evt.getKeyChar()=='f') + findMenuItem_actionPerformed(null); + + } + + } -- 1.7.10.2