X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAppletJmol.java;h=133cc9475cc7348c869a97b5ce1b0d6698e95a54;hb=c3b8fbc19c04c2daec702a2bffdfab5d10555143;hp=c9f275b56d87ef1c7c2dac1c8be98b96198ed1ad;hpb=17e77c3f2949a0729322b4a8d907f3f34b6a9914;p=jalview.git diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index c9f275b..133cc94 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -25,6 +25,7 @@ import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; import jalview.io.AppletFormatAdapter; import jalview.io.FileParse; +import jalview.io.StructureFile; import jalview.schemes.BuriedColourScheme; import jalview.schemes.HelixColourScheme; import jalview.schemes.HydrophobicColourScheme; @@ -59,7 +60,6 @@ import java.awt.event.KeyListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; -import java.util.Hashtable; import java.util.List; import java.util.Vector; @@ -180,7 +180,7 @@ public class AppletJmol extends EmbmenuFrame implements this.ap = ap; jmb = new AppletJmolBinding(this, ap.getStructureSelectionManager(), new PDBEntry[] { pdbentry }, new SequenceI[][] { seq }, - new String[][] { chains }, protocol); + protocol); jmb.setColourBySequence(true); if (pdbentry.getId() == null || pdbentry.getId().length() < 1) { @@ -204,7 +204,7 @@ public class AppletJmol extends EmbmenuFrame implements String alreadyMapped = StructureSelectionManager .getStructureSelectionManager(ap.av.applet) .alreadyMappedToFile(pdbentry.getId()); - MCview.PDBfile reader = null; + StructureFile reader = null; if (alreadyMapped != null) { reader = StructureSelectionManager.getStructureSelectionManager( @@ -283,16 +283,14 @@ public class AppletJmol extends EmbmenuFrame implements this.addWindowListener(new WindowAdapter() { + @Override public void windowClosing(WindowEvent evt) { closeViewer(); } }); - if (pdbentry.getProperty() == null) - { - pdbentry.setProperty(new Hashtable()); - pdbentry.getProperty().put("protocol", protocol); - } + pdbentry.setProperty("protocol", protocol); + if (pdbentry.getFile() != null) { // import structure data from pdbentry.getFile based on given protocol @@ -371,7 +369,7 @@ public class AppletJmol extends EmbmenuFrame implements jmb.loadInline(string); } - void setChainMenuItems(Vector chains) + void setChainMenuItems(List chains) { chainMenu.removeAll(); @@ -415,6 +413,7 @@ public class AppletJmol extends EmbmenuFrame implements this.setVisible(false); } + @Override public void actionPerformed(ActionEvent evt) { if (evt.getSource() == mappingMenuItem) @@ -535,6 +534,7 @@ public class AppletJmol extends EmbmenuFrame implements jmb.setColourBySequence(itm == seqColour); } + @Override public void itemStateChanged(ItemEvent evt) { if (evt.getSource() == jmolColour) @@ -553,6 +553,7 @@ public class AppletJmol extends EmbmenuFrame implements } } + @Override public void keyPressed(KeyEvent evt) { if (evt.getKeyCode() == KeyEvent.VK_ENTER && scriptWindow.isVisible()) @@ -564,10 +565,12 @@ public class AppletJmol extends EmbmenuFrame implements } + @Override public void keyTyped(KeyEvent evt) { } + @Override public void keyReleased(KeyEvent evt) { } @@ -585,7 +588,7 @@ public class AppletJmol extends EmbmenuFrame implements repaint(); return; } - setChainMenuItems(jmb.chainNames); + setChainMenuItems(jmb.getChainNames()); jmb.colourBySequence(ap); setTitle(jmb.getViewerTitle()); @@ -641,11 +644,13 @@ public class AppletJmol extends EmbmenuFrame implements { Dimension currentSize = new Dimension(); + @Override public void update(Graphics g) { paint(g); } + @Override public void paint(Graphics g) { currentSize = this.getSize();