X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAppJmol.java;h=a1846bc75695384dbd950a69c3353da00dda744e;hb=ce26ffcae5e876cf4127173c92f0eddffc9830da;hp=dcd4f7d7782cee5f3bab77555d4e4fb121942e75;hpb=2373f90e6077de127c55ec6cb7671d8ba2436684;p=jalview.git diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index dcd4f7d..a1846bc 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -174,7 +174,8 @@ public class AppJmol extends StructureViewerBase _alignwith = new Vector(); } - seqColourBy = new ViewSelectionMenu(MessageManager.getString("label.colour_by"), this, _colourwith, + seqColourBy = new ViewSelectionMenu( + MessageManager.getString("label.colour_by"), this, _colourwith, new ItemListener() { @@ -194,7 +195,8 @@ public class AppJmol extends StructureViewerBase }); viewMenu.add(seqColourBy); final ItemListener handler; - JMenu alpanels = new ViewSelectionMenu(MessageManager.getString("label.superpose_with"), this, + JMenu alpanels = new ViewSelectionMenu( + MessageManager.getString("label.superpose_with"), this, _alignwith, handler = new ItemListener() { @@ -205,8 +207,8 @@ public class AppJmol extends StructureViewerBase alignStructs.setToolTipText(MessageManager .formatMessage( "label.align_structures_using_linked_alignment_views", - new String[] - { new Integer(_alignwith.size()).toString() })); + new String[] { new Integer(_alignwith + .size()).toString() })); } }); handler.itemStateChanged(null); @@ -381,6 +383,7 @@ public class AppJmol extends StructureViewerBase command = ""; } jmb.evalStateCommand(command); + jmb.evalStateCommand("set hoverDelay=0.1"); jmb.setFinishedInit(true); } @@ -395,6 +398,7 @@ public class AppJmol extends StructureViewerBase MessageManager.getString("label.all")); menuItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent evt) { allChainsSelected = true; @@ -417,6 +421,7 @@ public class AppJmol extends StructureViewerBase menuItem = new JCheckBoxMenuItem(chain, true); menuItem.addItemListener(new ItemListener() { + @Override public void itemStateChanged(ItemEvent evt) { if (!allChainsSelected) @@ -449,6 +454,7 @@ public class AppJmol extends StructureViewerBase jmb.centerViewer(toshow); } + @Override public void closeViewer(boolean closeExternalViewer) { // Jmol does not use an external viewer @@ -465,6 +471,7 @@ public class AppJmol extends StructureViewerBase jmb = null; } + @Override public void run() { _started = true; @@ -488,7 +495,8 @@ public class AppJmol extends StructureViewerBase long hdl = pdbid.hashCode() - System.currentTimeMillis(); if (progressBar != null) { - progressBar.setProgressBar(MessageManager.formatMessage("status.fetching_pdb", new String[]{pdbid}), hdl); + progressBar.setProgressBar(MessageManager.formatMessage( + "status.fetching_pdb", new String[] { pdbid }), hdl); } try { @@ -503,7 +511,8 @@ public class AppJmol extends StructureViewerBase } if (progressBar != null) { - progressBar.setProgressBar(MessageManager.getString("label.state_completed"), hdl); + progressBar.setProgressBar( + MessageManager.getString("label.state_completed"), hdl); } if (pdbseq != null) { @@ -554,9 +563,8 @@ public class AppJmol extends StructureViewerBase JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager .formatMessage("label.pdb_entries_couldnt_be_retrieved", - new String[] - { errormsgs.toString() }), MessageManager - .getString("label.couldnt_load_file"), + new String[] { errormsgs.toString() }), + MessageManager.getString("label.couldnt_load_file"), JOptionPane.ERROR_MESSAGE); } @@ -623,10 +631,11 @@ public class AppJmol extends StructureViewerBase jmb.updateColours(ap); } // do superposition if asked to - if (alignAddedStructures) + if (Cache.getDefault("AUTOSUPERIMPOSE", true) && alignAddedStructures) { javax.swing.SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { if (jmb.viewer.isScriptExecuting()) @@ -674,8 +683,7 @@ public class AppJmol extends StructureViewerBase try { // TODO: cope with multiple PDB files in view - in = new BufferedReader(new FileReader( - jmb.getPdbFile()[0])); + in = new BufferedReader(new FileReader(jmb.getPdbFile()[0])); File outFile = chooser.getSelectedFile(); PrintWriter out = new PrintWriter(new FileOutputStream(outFile)); @@ -749,22 +757,21 @@ public class AppJmol extends StructureViewerBase if (type == jalview.util.ImageMaker.TYPE.PNG) { im = new jalview.util.ImageMaker(this, - jalview.util.ImageMaker.TYPE.PNG, - "Make PNG image from view", width, height, null, null); + jalview.util.ImageMaker.TYPE.PNG, "Make PNG image from view", + width, height, null, null, null, 0, false); } else if (type == jalview.util.ImageMaker.TYPE.EPS) { im = new jalview.util.ImageMaker(this, - jalview.util.ImageMaker.TYPE.EPS, - "Make EPS file from view", width, height, null, - this.getTitle()); + jalview.util.ImageMaker.TYPE.EPS, "Make EPS file from view", + width, height, null, this.getTitle(), null, 0, false); } else { im = new jalview.util.ImageMaker(this, jalview.util.ImageMaker.TYPE.SVG, "Make SVG file from PCA", - width, height, null, this.getTitle()); + width, height, null, this.getTitle(), null, 0, false); } if (im.getGraphics() != null) @@ -889,8 +896,9 @@ public class AppJmol extends StructureViewerBase @Override public void backGround_actionPerformed(ActionEvent actionEvent) { - java.awt.Color col = JColorChooser.showDialog(this, - MessageManager.getString("label.select_backgroud_colour"), null); + java.awt.Color col = JColorChooser + .showDialog(this, MessageManager + .getString("label.select_backgroud_colour"), null); if (col != null) { jmb.setBackgroundColour(col); @@ -1067,6 +1075,7 @@ public class AppJmol extends StructureViewerBase } + @Override public void setJalviewColourScheme(ColourSchemeI ucs) { jmb.setJalviewColourScheme(ucs);