X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAppJmol.java;h=f71cd3077ee666176e11d98e472016cd44b2d9cb;hb=f8efe615d1c7d5c23fd838c1abcd77be542b154c;hp=9d68c1bcb047b2a1e3860422b350c48b379fdd2b;hpb=a65993fd311b1a53617c5df3c84abfb78740a900;p=jalview.git diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 9d68c1b..f71cd30 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -153,6 +153,15 @@ public class AppJmol extends GStructureViewer implements Runnable, { seqColour.setSelected(jmb.isColourBySequence()); jmolColour.setSelected(!jmb.isColourBySequence()); + if (_colourwith==null) + { + _colourwith=new Vector(); + } + if (_alignwith==null) + { + _alignwith=new Vector(); + } + seqColourBy = new ViewSelectionMenu("Colour by ..", this, _colourwith, new ItemListener() { @@ -210,30 +219,7 @@ public class AppJmol extends GStructureViewer implements Runnable, } }); - colourMenu.addMenuListener(new MenuListener() - { - - @Override - public void menuSelected(MenuEvent arg0) - { - - handlingGuiEvents=true; - } - - @Override - public void menuDeselected(MenuEvent arg0) - { - handlingGuiEvents=false; - } - - @Override - public void menuCanceled(MenuEvent arg0) - { - handlingGuiEvents=false; - } - }); } - IProgressIndicator progressBar = null; public AppJmol(PDBEntry pdbentry, SequenceI[] seq, String[] chains, @@ -374,13 +360,13 @@ public class AppJmol extends GStructureViewer implements Runnable, /** * list of alignment panels to use for superposition */ - ArrayList _alignwith = new ArrayList(); + Vector _alignwith = new Vector(); /** * list of alignment panels that are used for colouring structures by aligned * sequences */ - ArrayList _colourwith = new ArrayList(); + Vector _colourwith = new Vector(); /** * set the primary alignmentPanel reference and add another alignPanel to the @@ -658,13 +644,6 @@ public class AppJmol extends GStructureViewer implements Runnable, */ private boolean _started = false; - /** - * state flag indicating if the GUI is active when a particular button event - * takes place (e.g. when a stateChange occurs on a checkbox - this could be - * programmatic or due to the user doing something) - */ - private boolean handlingGuiEvents=false; - public void run() { _started = true; @@ -954,15 +933,15 @@ public class AppJmol extends GStructureViewer implements Runnable, jmb.setColourBySequence(seqColour.isSelected()); if (_colourwith == null) { - _colourwith = new ArrayList(); + _colourwith = new Vector(); } if (jmb.isColourBySequence()) { - if (!jmb.isLoadingFromArchive() && handlingGuiEvents) + if (!jmb.isLoadingFromArchive()) { - if (ap!=null) { - // Make the currently displayed alignment panel the associated view - _colourwith.add(ap.alignFrame.alignPanel); + if (_colourwith.size()==0 && ap!=null) { + // Make the currently displayed alignment panel the associated view + _colourwith.add(ap.alignFrame.alignPanel); } } // Set the colour using the current view for the associated alignframe @@ -1173,7 +1152,7 @@ public class AppJmol extends GStructureViewer implements Runnable, { if (_alignwith == null) { - _alignwith = new ArrayList(); + _alignwith = new Vector(); } if (_alignwith.size() == 0 && ap != null) {