import jalview.api.SequenceStructureBinding;
import jalview.appletgui.AlignFrame;
+import jalview.appletgui.AppletJmol;
import jalview.appletgui.EmbmenuFrame;
import jalview.appletgui.FeatureSettings;
import jalview.datamodel.Alignment;
import java.applet.Applet;
import java.awt.Button;
import java.awt.Color;
+import java.awt.Component;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
public boolean jmolAvailable = false;
+ private boolean alignPdbStructures=false;
+
public static boolean debug = false;
static String builddate = null, version = null;
ex.printStackTrace();
}
}
-
+ /*
+ * <param name="alignpdbfiles" value="false/true"/>
+ * Undocumented for 2.6 - related to JAL-434
+ */
+ applet.setAlignPdbStructures(getDefaultParameter("alignpdbfiles",false));
/*
* <param name="PDBfile" value="1gaq.txt PDB|1GAQ|1GAQ|A PDB|1GAQ|1GAQ|B
* PDB|1GAQ|1GAQ|C">
*
* <param name="PDBfile3" value="1q0o Q45135_9MICO">
*/
-
+
int pdbFileCount = 0;
+ // Accumulate pdbs here if they are heading for the same view (if alignPdbStructures is true)
+ Vector pdbs=new Vector();
do
{
if (pdbFileCount > 0)
}
}
}
-
- newAlignFrame.newStructureView(applet, pdb, seqs, chains,
+
+ if (!alignPdbStructures) {
+ newAlignFrame.newStructureView(applet, pdb, seqs, chains,
protocol);
-
+ } else {
+ pdbs.add(new Object[] { pdb, seqs, chains, new String(protocol)});
+ }
}
}
pdbFileCount++;
} while (pdbFileCount < 10);
-
+ if (pdbs.size()>0)
+ {
+ SequenceI[][] seqs = new SequenceI[pdbs.size()][];
+ PDBEntry[] pdb = new PDBEntry[pdbs.size()];
+ String[][] chains = new String[pdbs.size()][];
+ String[] protocols = new String[pdbs.size()];
+ for (int pdbsi=0,pdbsiSize=pdbs.size(); pdbsi<pdbsiSize;pdbsi++)
+ {
+ Object[] o = (Object[]) pdbs.elementAt(pdbsi);
+ pdb[pdbsi] = (PDBEntry) o[0];
+ seqs[pdbsi] = (SequenceI[]) o[1];
+ chains[pdbsi] = (String[]) o[2];
+ protocols[pdbsi] = (String) o[3];
+ }
+ newAlignFrame.alignedStructureView(applet, pdb, seqs, chains, protocols);
+
+ }
// ///////////////////////////
// modify display of features
//
return alFrame.addPdbFile(sequenceId, pdbEntryString, pdbFile);
}
+ protected void setAlignPdbStructures(boolean alignPdbStructures)
+ {
+ this.alignPdbStructures = alignPdbStructures;
+ }
+
+ public boolean isAlignPdbStructures()
+ {
+ return alignPdbStructures;
+ }
+
+ /**
+ * get all components associated with the applet of the given type
+ * @param class1
+ * @return
+ */
+ public Vector getAppletWindow(Class class1)
+ {
+ Vector wnds = new Vector();
+ Component[] cmp = getComponents();
+ if (cmp!=null)
+ {
+ for (int i=0;i<cmp.length;i++)
+ {
+ if (class1.isAssignableFrom(cmp[i].getClass()))
+ {
+ wnds.addElement(cmp);
+ }
+ }}
+ return wnds;
+ }
+
/**
* bind structures in a viewer to any matching sequences in an alignFrame (use