{
seqColour.setSelected(jmb.isColourBySequence());
jmolColour.setSelected(!jmb.isColourBySequence());
+ if (_colourwith==null)
+ {
+ _colourwith=new Vector<AlignmentPanel>();
+ }
+ if (_alignwith==null)
+ {
+ _alignwith=new Vector<AlignmentPanel>();
+ }
+
seqColourBy = new ViewSelectionMenu("Colour by ..", this, _colourwith,
new ItemListener()
{
}
});
- 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,
/**
* list of alignment panels to use for superposition
*/
- ArrayList<AlignmentPanel> _alignwith = new ArrayList();
+ Vector<AlignmentPanel> _alignwith = new Vector<AlignmentPanel>();
/**
* list of alignment panels that are used for colouring structures by aligned
* sequences
*/
- ArrayList<AlignmentPanel> _colourwith = new ArrayList();
+ Vector<AlignmentPanel> _colourwith = new Vector<AlignmentPanel>();
/**
* set the primary alignmentPanel reference and add another alignPanel to the
*/
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;
jmb.setColourBySequence(seqColour.isSelected());
if (_colourwith == null)
{
- _colourwith = new ArrayList<AlignmentPanel>();
+ _colourwith = new Vector<AlignmentPanel>();
}
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
{
if (_alignwith == null)
{
- _alignwith = new ArrayList<AlignmentPanel>();
+ _alignwith = new Vector<AlignmentPanel>();
}
if (_alignwith.size() == 0 && ap != null)
{