{\r
final AlignmentPanel alignPanel;\r
final AlignViewport viewport;\r
+ public static final int NEW_WINDOW_WIDTH = 700;\r
+ public static final int NEW_WINDOW_HEIGHT = 500;\r
+\r
public AlignFrame(AlignmentI al)\r
{\r
+ try{\r
+ String ip = java.net.InetAddress.getLocalHost().getHostAddress();\r
+ if( !ip.startsWith("10."))\r
+ alignMenu.setVisible(false);\r
+ }\r
+ catch(java.net.UnknownHostException e){}\r
viewport = new AlignViewport(al,true,true,false);\r
\r
String fontName = jalview.bin.Cache.getProperty("FONT_NAME");\r
SequenceI[] newSeqs = new SequenceI[seqs.size()];\r
seqs.toArray(newSeqs);\r
AlignFrame af = new AlignFrame(new Alignment(newSeqs));\r
- int newHeight = newSeqs.length * af.viewport.getCharHeight() + 200;\r
- if (newHeight > 500)\r
- newHeight = 500;\r
- Desktop.addInternalFrame(af, "Copied sequences", 700, 500);\r
+ Desktop.addInternalFrame(af, "Copied sequences", NEW_WINDOW_WIDTH, NEW_WINDOW_HEIGHT);\r
}\r
else\r
{\r
\r
public void findMenuItem_actionPerformed(ActionEvent e)\r
{\r
- JInternalFrame frame = new JInternalFrame();\r
- Finder finder = new Finder(viewport, alignPanel, frame);\r
- frame.setContentPane(finder);\r
- Desktop.addInternalFrame(frame, "Find", 340,110);\r
+ JInternalFrame frame = new JInternalFrame();\r
+ Finder finder = new Finder(viewport, alignPanel, frame);\r
+ frame.setContentPane(finder);\r
+ Desktop.addInternalFrame(frame, "Find", 340,110, false);\r
+ frame.setLayer(JLayeredPane.PALETTE_LAYER);\r
\r
}\r
\r
}\r
\r
\r
- if ( viewport.getAbovePIDThreshold())\r
+ if ( viewport.getAbovePIDThreshold() )\r
{\r
- int threshold = 0;\r
- threshold = Desktop.setPIDSliderSource(alignPanel, cs, "Background");\r
+ // int threshold = 0;\r
+ // threshold = Desktop.setPIDSliderSource(alignPanel, cs, "Background");\r
Desktop.hideConservationSlider();\r
\r
- if (cs instanceof ResidueColourScheme)\r
- ( (ResidueColourScheme) cs).setThreshold(threshold);\r
- else if (cs instanceof ScoreColourScheme)\r
- ( (ScoreColourScheme) cs).setThreshold(threshold);\r
+ // if (cs instanceof ResidueColourScheme)\r
+ // ( (ResidueColourScheme) cs).setThreshold(threshold);\r
+ // else if (cs instanceof ScoreColourScheme)\r
+ // ( (ScoreColourScheme) cs).setThreshold(threshold);\r
\r
viewport.setGlobalColourScheme(cs);\r
\r
\r
ccs = new ConservationColourScheme(c, cs);\r
\r
- int threshold = Desktop.setConservationSliderSource(alignPanel, ccs,\r
- "Background");\r
+ // int threshold = Desktop.setConservationSliderSource(alignPanel, ccs, "Background");\r
\r
- ccs.inc = threshold;\r
+ // ccs.inc = threshold;\r
\r
viewport.setGlobalColourScheme(ccs);\r
\r
alignPanel.RefreshPanels();\r
}\r
\r
+ protected void modifyPID_actionPerformed(ActionEvent e)\r
+ {\r
+ Desktop.setPIDSliderSource(alignPanel, viewport.getGlobalColourScheme(), "Background");\r
+ }\r
+\r
+ protected void modifyConservation_actionPerformed(ActionEvent e)\r
+ {\r
+ Desktop.setConservationSliderSource(alignPanel, viewport.globalColourScheme, "Background");\r
+ }\r
+\r
\r
protected void conservationMenuItem_actionPerformed(ActionEvent e)\r
{\r
JInternalFrame frame = new JInternalFrame();\r
UserDefinedColours chooser = new UserDefinedColours( frame, alignPanel, null);\r
frame.setContentPane(chooser);\r
- Desktop.addInternalFrame(frame,"User defined colours", 450,540 );\r
- frame.setResizable(false);\r
- frame.setIconifiable(false);\r
- frame.setMaximizable(false);\r
+ Desktop.addInternalFrame(frame,"User defined colours", 450,540, false );\r
}\r
\r
public void PIDColour_actionPerformed(ActionEvent e)\r
alignPanel.RefreshPanels();\r
}\r
\r
- public void sortTreeOrderMenuItem_actionPerformed(ActionEvent e)\r
- {\r
- addHistoryItem("sort");\r
- if(viewport.getCurrentTree()==null)\r
- return;\r
-\r
- AlignmentSorter.sortByTree(viewport.getAlignment(), viewport.getCurrentTree());\r
- alignPanel.RefreshPanels();\r
- }\r
-\r
public void removeRedundancyMenuItem_actionPerformed(ActionEvent e)\r
{\r
RedundancyPanel sp = new RedundancyPanel(alignPanel);\r
JInternalFrame frame = new JInternalFrame();\r
frame.setContentPane(sp);\r
- Desktop.addInternalFrame(frame, "Redundancy threshold selection", 400, 100);\r
- frame.setMaximizable(false);\r
- frame.setResizable(false);\r
+ Desktop.addInternalFrame(frame, "Redundancy threshold selection", 400, 100, false);\r
\r
}\r
\r
return;\r
}\r
\r
- TreePanel tp=null;\r
- if (viewport.getSelectionGroup() != null && viewport.getSelectionGroup().getSize() > 3)\r
- {\r
- tp = new TreePanel(viewport, viewport.getSelectionGroup().sequences,type, pwType,\r
+ final TreePanel tp;\r
+ if (viewport.getSelectionGroup() != null &&\r
+ viewport.getSelectionGroup().getSize() > 3)\r
+ {\r
+ tp = new TreePanel(viewport, viewport.getSelectionGroup().sequences, type,\r
+ pwType,\r
0, viewport.alignment.getWidth());\r
- }\r
- else\r
- {\r
- tp = new TreePanel(viewport, viewport.getAlignment().getSequences(),\r
- type, pwType, 0, viewport.alignment.getWidth());\r
- }\r
+ }\r
+ else\r
+ {\r
+ tp = new TreePanel(viewport, viewport.getAlignment().getSequences(),\r
+ type, pwType, 0, viewport.alignment.getWidth());\r
+ }\r
+\r
+ addTreeMenuItem(tp, title);\r
\r
Desktop.addInternalFrame(tp, title, 600, 500);\r
}\r
\r
+ void addTreeMenuItem(final TreePanel treePanel, String title)\r
+ {\r
+ final JMenuItem item = new JMenuItem(title);\r
+ sortByTreeMenu.add(item);\r
+ item.addActionListener(new java.awt.event.ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ addHistoryItem("sort");\r
+ AlignmentSorter.sortByTree(viewport.getAlignment(), treePanel.getTree());\r
+ alignPanel.RefreshPanels();\r
+ }\r
+ });\r
+\r
+ treePanel.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()\r
+ {\r
+ public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt)\r
+ {\r
+ sortByTreeMenu.remove(item);\r
+ };\r
+ });\r
\r
+ }\r
\r
\r
public void clustalAlignMenuItem_actionPerformed(ActionEvent e)\r
Thread t = new Thread(ct);\r
t.start();\r
frame.setContentPane(ct);\r
- Desktop.addInternalFrame(frame, title, 300, 80);\r
+ Desktop.addInternalFrame(frame, title, 320, 90);\r
\r
}\r
\r
if (alignment != null)\r
{\r
AlignFrame af = new AlignFrame(new Alignment(alignment));\r
- af.clustalColour.setSelected(true);\r
- af.clustalColour_actionPerformed(null);\r
- Desktop.addInternalFrame(af, getTitle().concat(" - ClustalW Alignment"),\r
- 700, 500); // JBPNote - is there a new window geom. property ?\r
+ Desktop.addInternalFrame(af, getTitle().concat(" - ClustalW Alignment"),NEW_WINDOW_WIDTH, NEW_WINDOW_HEIGHT);\r
+ af.clustalColour_actionPerformed(null);\r
+ af.clustalColour.setSelected(true);\r
}\r
else\r
JOptionPane.showMessageDialog(Desktop.desktop, "Problem obtaining clustal alignment", "Web service error",\r
tp = new TreePanel(viewport, viewport.getAlignment().getSequences(),\r
fin, "FromFile", choice);\r
Desktop.addInternalFrame(tp, title, 600, 500);\r
+ addTreeMenuItem(tp, title);\r
}\r
}\r
catch (Exception ex)\r