g.fillRect(0, 0, getSize().width, getSize().height);
g.setColor(Color.black);
g.setFont(new Font("Verdana", Font.BOLD, 14));
- g.drawString(MessageManager.getString("label.error_loading_pdb_data"), 50, getSize().height / 2);
+ g.drawString(
+ MessageManager.getString("label.error_loading_pdb_data"), 50,
+ getSize().height / 2);
return;
}
{
g.setColor(Color.black);
g.setFont(new Font("Verdana", Font.BOLD, 14));
- g.drawString(MessageManager.getString("label.fetching_pdb_data"), 50, getSize().height / 2);
+ g.drawString(MessageManager.getString("label.fetching_pdb_data"), 50,
+ getSize().height / 2);
return;
}
false, null);
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.pdb_sequence_mapping"),
- 500, 600);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.pdb_sequence_mapping"), 500,
+ 600);
cap.setText(pdbcanvas.mappingDetails.toString());
}
chain.addActionListener(this);
seqButton.setLabel(MessageManager.getString("action.by_sequence"));
seqButton.addActionListener(this);
- allchains.setLabel(MessageManager.getString("label.all_chains_visible"));
+ allchains
+ .setLabel(MessageManager.getString("label.all_chains_visible"));
allchains.addItemListener(this);
viewMenu.setLabel(MessageManager.getString("action.view"));
zappo.setLabel(MessageManager.getString("label.zappo"));
}
});
viewMenu.setText(MessageManager.getString("action.view"));
- background.setText(MessageManager.getString("label.background_colour") + "...");
+ background.setText(MessageManager.getString("label.background_colour")
+ + "...");
background.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
int option = JOptionPane.showInternalConfirmDialog(
jalview.gui.Desktop.desktop,
- MessageManager.getString("label.remove_from_default_list"),
- MessageManager.getString("label.remove_user_defined_colour"),
+ MessageManager
+ .getString("label.remove_from_default_list"),
+ MessageManager
+ .getString("label.remove_user_defined_colour"),
JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION)
{
try
{
cap.setText(pdbcanvas.mappingDetails.toString());
- Desktop.addInternalFrame(cap, MessageManager.getString("label.pdb_sequence_mapping"), 550, 600);
+ Desktop.addInternalFrame(cap,
+ MessageManager.getString("label.pdb_sequence_mapping"), 550,
+ 600);
} catch (OutOfMemoryError oom)
{
new OOMWarning("Opening sequence to structure mapping report", oom);
public void user_actionPerformed(ActionEvent e)
{
- if (e.getActionCommand().equals(MessageManager.getString("action.user_defined")))
+ if (e.getActionCommand().equals(
+ MessageManager.getString("action.user_defined")))
{
// new UserDefinedColours(pdbcanvas, null);
}
public void background_actionPerformed(ActionEvent e)
{
java.awt.Color col = JColorChooser.showDialog(this,
- MessageManager.getString("label.select_backgroud_colour"), pdbcanvas.backgroundColour);
+ MessageManager.getString("label.select_backgroud_colour"),
+ pdbcanvas.backgroundColour);
if (col != null)
{
id = safeName(getDataName());
chains = new Vector();
- ArrayList<SequenceI> rna=new ArrayList<SequenceI>(), prot=new ArrayList<SequenceI>();
+ ArrayList<SequenceI> rna = new ArrayList<SequenceI>(), prot = new ArrayList<SequenceI>();
PDBChain tmpchain;
String line = null;
boolean modelFlag = false;
PDBEntry entry = new PDBEntry();
entry.setId(id);
entry.setProperty(new Hashtable());
- if (((PDBChain)chains.elementAt(i)).id!=null) {
- entry.getProperty().put("CHAIN", ((PDBChain)chains.elementAt(i)).id);
+ if (((PDBChain) chains.elementAt(i)).id != null)
+ {
+ entry.getProperty().put("CHAIN",
+ ((PDBChain) chains.elementAt(i)).id);
}
if (inFile != null)
{
// maintain reference to
// dataset
seqs.addElement(chainseq);
- if(isRNA(chainseq)==true)
- {
- rna.add(chainseq);
- } else {
- prot.add(chainseq);
- }
-
+ if (isRNA(chainseq) == true)
+ {
+ rna.add(chainseq);
+ }
+ else
+ {
+ prot.add(chainseq);
+ }
+
AlignmentAnnotation[] chainannot = chainseq.getAnnotation();
-
+
if (chainannot != null)
{
for (int ai = 0; ai < chainannot.length; ai++)
{
-
+
chainannot[ai].visible = VisibleChainAnnotation;
annotations.addElement(chainannot[ai]);
}
}
}
- if (rna.size()>0)
- try {
- processPdbFileWithAnnotate3d(rna);
- } catch (Exception x)
- {
- System.err.println("Exceptions when dealing with RNA in pdb file");
- x.printStackTrace();
-
- };
- if (prot.size()>0)
- try {
- processPdbFileWithJmol(prot);
- } catch (Exception x)
- {
- System.err.println("Exceptions when dealing with RNA in pdb file");
- x.printStackTrace();
-
- };
- if (prot.size()>0)
- try {
- processPdbFileWithJmol(prot);
- } catch (Exception x)
- {
- System.err.println("Exceptions when dealing with RNA in pdb file");
- x.printStackTrace();
-
- };
+ if (rna.size() > 0)
+ try
+ {
+ processPdbFileWithAnnotate3d(rna);
+ } catch (Exception x)
+ {
+ System.err
+ .println("Exceptions when dealing with RNA in pdb file");
+ x.printStackTrace();
+
+ }
+ ;
+ if (prot.size() > 0)
+ try
+ {
+ processPdbFileWithJmol(prot);
+ } catch (Exception x)
+ {
+ System.err
+ .println("Exceptions when dealing with RNA in pdb file");
+ x.printStackTrace();
+
+ }
+ ;
+ if (prot.size() > 0)
+ try
+ {
+ processPdbFileWithJmol(prot);
+ } catch (Exception x)
+ {
+ System.err
+ .println("Exceptions when dealing with RNA in pdb file");
+ x.printStackTrace();
+
+ }
+ ;
} catch (OutOfMemoryError er)
{
System.out.println("OUT OF MEMORY LOADING PDB FILE");
}
}
}
- private void processPdbFileWithJmol(ArrayList<SequenceI> prot) throws Exception
+
+ private void processPdbFileWithJmol(ArrayList<SequenceI> prot)
+ throws Exception
{
- try {
+ try
+ {
Class cl = Class.forName("jalview.ext.jmol.PDBFileWithJmol");
- if (cl!=null)
+ if (cl != null)
{
- Object jmf = cl.getConstructor(new Class[] {FileParse.class}).newInstance(new Object[] {new FileParse(getDataName(),type)});
- Alignment al = new Alignment((SequenceI[]) cl.getMethod("getSeqsAsArray", new Class[] {}).invoke(jmf));
- cl.getMethod("addAnnotations",new Class[] {Alignment.class}).invoke(jmf, al);
+ Object jmf = cl.getConstructor(new Class[]
+ { FileParse.class }).newInstance(new Object[]
+ { new FileParse(getDataName(), type) });
+ Alignment al = new Alignment((SequenceI[]) cl.getMethod(
+ "getSeqsAsArray", new Class[]
+ {}).invoke(jmf));
+ cl.getMethod("addAnnotations", new Class[]
+ { Alignment.class }).invoke(jmf, al);
replaceMatchingSeqsWith(prot, al, AlignSeq.PEP);
}
} catch (ClassNotFoundException q)
- {}
- }
- private void processPdbFileWithAnnotate3d(ArrayList<SequenceI> rna) throws Exception {
-// System.out.println("this is a PDB format and RNA sequence");
- // note: we use reflection here so that the applet can compile and run without the HTTPClient bits and pieces needed for accessing Annotate3D web service
- try {
- Class cl = Class.forName("jalview.ws.jws1.Annotate3D");
- if (cl!=null)
{
- // TODO: use the PDB ID of the structure if one is available, to save bandwidth and avoid uploading the whole structure to the service
- Object annotate3d = cl.getConstructor(new Class[] {}).newInstance(new Object[] {});
- AlignmentI al = ((AlignmentI) cl.getMethod("getRNAMLFor", new Class[] { FileParse.class}).invoke(annotate3d, new Object[] { new FileParse(getDataName(),type)}));
- replaceMatchingSeqsWith(rna, al, AlignSeq.DNA);
}
+ }
+
+ private void processPdbFileWithAnnotate3d(ArrayList<SequenceI> rna)
+ throws Exception
+ {
+ // System.out.println("this is a PDB format and RNA sequence");
+ // note: we use reflection here so that the applet can compile and run
+ // without the HTTPClient bits and pieces needed for accessing Annotate3D
+ // web service
+ try
+ {
+ Class cl = Class.forName("jalview.ws.jws1.Annotate3D");
+ if (cl != null)
+ {
+ // TODO: use the PDB ID of the structure if one is available, to save
+ // bandwidth and avoid uploading the whole structure to the service
+ Object annotate3d = cl.getConstructor(new Class[]
+ {}).newInstance(new Object[]
+ {});
+ AlignmentI al = ((AlignmentI) cl.getMethod("getRNAMLFor",
+ new Class[]
+ { FileParse.class }).invoke(annotate3d, new Object[]
+ { new FileParse(getDataName(), type) }));
+ replaceMatchingSeqsWith(rna, al, AlignSeq.DNA);
+ }
} catch (ClassNotFoundException x)
{
- //ignore classnotfounds - occurs in applet
- };
+ // ignore classnotfounds - occurs in applet
+ }
+ ;
}
- private void replaceMatchingSeqsWith(ArrayList<SequenceI> ochains, AlignmentI al, String dnaOrProtein)
+
+ private void replaceMatchingSeqsWith(ArrayList<SequenceI> ochains,
+ AlignmentI al, String dnaOrProtein)
{
- if (al!=null && al.getHeight()>0)
+ if (al != null && al.getHeight() > 0)
{
- ArrayList<SequenceI> matches=new ArrayList<SequenceI>();
- ArrayList<AlignSeq> aligns=new ArrayList<AlignSeq>();
-
- for (SequenceI sq:ochains)
+ ArrayList<SequenceI> matches = new ArrayList<SequenceI>();
+ ArrayList<AlignSeq> aligns = new ArrayList<AlignSeq>();
+
+ for (SequenceI sq : ochains)
{
- SequenceI bestm=null;
- AlignSeq bestaseq=null;
- int bestscore=0;
- for (SequenceI msq:al.getSequences())
+ SequenceI bestm = null;
+ AlignSeq bestaseq = null;
+ int bestscore = 0;
+ for (SequenceI msq : al.getSequences())
{
- AlignSeq aseq = AlignSeq.doGlobalNWAlignment(msq, sq, dnaOrProtein);
- if (bestm==null || aseq.getMaxScore()>bestscore)
+ AlignSeq aseq = AlignSeq.doGlobalNWAlignment(msq, sq,
+ dnaOrProtein);
+ if (bestm == null || aseq.getMaxScore() > bestscore)
{
- bestscore=aseq.getMaxScore();
- bestaseq= aseq;
- bestm=msq;
+ bestscore = aseq.getMaxScore();
+ bestaseq = aseq;
+ bestm = msq;
}
}
- System.out.println("Best Score for "+(matches.size()+1)+" :"+bestscore);
+ System.out.println("Best Score for " + (matches.size() + 1) + " :"
+ + bestscore);
matches.add(bestm);
aligns.add(bestaseq);
al.deleteSequence(bestm);
}
- for (int p=0,pSize=seqs.size();p<pSize;p++)
+ for (int p = 0, pSize = seqs.size(); p < pSize; p++)
{
- SequenceI sq,sp=seqs.get(p);
+ SequenceI sq, sp = seqs.get(p);
int q;
- if ((q=ochains.indexOf(sp))>-1)
+ if ((q = ochains.indexOf(sp)) > -1)
{
- seqs.set(p, sq=matches.get(q));
+ seqs.set(p, sq = matches.get(q));
sq.setName(sp.getName());
sq.setDescription(sp.getDescription());
sq.transferAnnotation(sp, aligns.get(q).getMappingFromS1(false));
- int inspos=-1;
- for (int ap=0;ap<annotations.size();)
+ int inspos = -1;
+ for (int ap = 0; ap < annotations.size();)
{
- if (((AlignmentAnnotation)annotations.get(ap)).sequenceRef==sp) {
- if (inspos==-1)
+ if (((AlignmentAnnotation) annotations.get(ap)).sequenceRef == sp)
+ {
+ if (inspos == -1)
{
- inspos=ap;
+ inspos = ap;
}
annotations.remove(ap);
- } else {
+ }
+ else
+ {
ap++;
}
}
- if (sq.getAnnotation()!=null) {
+ if (sq.getAnnotation() != null)
+ {
annotations.addAll(inspos, Arrays.asList(sq.getAnnotation()));
}
}
}
}
}
+
/**
* make a friendly ID string.
*
1.0f / (float) i, .4f, 1.0f));
}
}
+
public boolean isRNA(SequenceI seqs)
{
- for (int i=0;i<seqs.getLength();i++){
- if((seqs.getCharAt(i)!='A') &&(seqs.getCharAt(i)!='C')&&(seqs.getCharAt(i)!='G')&&(seqs.getCharAt(i)!='U'))
- {
- return false;
- }
- }
-
- return true;
-
-
+ for (int i = 0; i < seqs.getLength(); i++)
+ {
+ if ((seqs.getCharAt(i) != 'A') && (seqs.getCharAt(i) != 'C')
+ && (seqs.getCharAt(i) != 'G') && (seqs.getCharAt(i) != 'U'))
+ {
+ return false;
+ }
+ }
+
+ return true;
+
}
}
Hashtable residueHash;
int maxCount, nongap, i, j, v, jSize = sequences.length;
String maxResidue;
- char c='-';
+ char c = '-';
float percentage;
int[] values = new int[255];
maxResidue = "";
nongap = 0;
values = new int[255];
-
+
for (j = 0; j < jSize; j++)
{
if (sequences[j] == null)
values['-']++;
}
}
- if (jSize==1)
+ if (jSize == 1)
{
maxResidue = String.valueOf(c);
- maxCount=1;
- } else {for (v = 'A'; v < 'Z'; v++)
+ maxCount = 1;
+ }
+ else
{
- if (values[v] < 2 || values[v] < maxCount)
+ for (v = 'A'; v < 'Z'; v++)
{
- continue;
- }
+ if (values[v] < 2 || values[v] < maxCount)
+ {
+ continue;
+ }
- if (values[v] > maxCount)
- {
- maxResidue = String.valueOf((char) v);
- }
- else if (values[v] == maxCount)
- {
- maxResidue += String.valueOf((char) v);
+ if (values[v] > maxCount)
+ {
+ maxResidue = String.valueOf((char) v);
+ }
+ else if (values[v] == maxCount)
+ {
+ maxResidue += String.valueOf((char) v);
+ }
+ maxCount = values[v];
}
- maxCount = values[v];
- }
}
if (maxResidue.length() == 0)
{
percentage = ((float) maxCount * 100) / jSize;
residueHash.put(PID_GAPS, new Float(percentage));
- if (nongap>0) {
+ if (nongap > 0)
+ {
// calculate for non-gapped too
percentage = ((float) maxCount * 100) / nongap;
}
residueHash.put(PID_NOGAPS, new Float(percentage));
-
+
result[i] = residueHash;
}
}
* @param width
* @param ignoreGapsInConsensusCalculation
* @param includeAllConsSymbols
- * @param nseq
+ * @param nseq
*/
public static void completeConsensus(AlignmentAnnotation consensus,
Hashtable[] hconsensus, int iStart, int width,
boolean includeAllConsSymbols, long nseq)
{
completeConsensus(consensus, hconsensus, iStart, width,
- ignoreGapsInConsensusCalculation, includeAllConsSymbols, null, nseq); // new
- // char[]
+ ignoreGapsInConsensusCalculation, includeAllConsSymbols, null,
+ nseq); // new
+ // char[]
// { 'A', 'C', 'G', 'T', 'U' });
}
// initialised properly
return;
}
- String fmtstr="%3.1f";
- int precision=0;
- while (nseq>=10) {
+ String fmtstr = "%3.1f";
+ int precision = 0;
+ while (nseq >= 10)
+ {
precision++;
- nseq/=10;
+ nseq /= 10;
}
final Format fmt;
- if (precision>1)
+ if (precision > 1)
{
- //if (precision>2)
+ // if (precision>2)
{
- fmtstr = "%"+(2+precision)+"."+(precision)+"f";
+ fmtstr = "%" + (2 + precision) + "." + (precision) + "f";
}
fmt = new Format(fmtstr);
- } else {
+ }
+ else
+ {
fmt = null;
}
for (int i = iStart; i < width; i++)
tval = profile[0][alphabet[c]] * 100f
/ profile[1][ignoreGapsInConsensusCalculation ? 1 : 0];
mouseOver += ((c == 0) ? "" : "; ") + alphabet[c] + " "
- + ((fmt!=null) ? fmt.form(tval) : ((int) tval)) + "%";
+ + ((fmt != null) ? fmt.form(tval) : ((int) tval)) + "%";
}
}
else
* 100f
/ profile[1][ignoreGapsInConsensusCalculation ? 1 : 0];
mouseOver += ((p == 0) ? "" : "; ") + ((char[]) ca[c])[0]
- + " " + ((fmt!=null) ? fmt.form(tval) : ((int) tval)) + "%";
+ + " "
+ + ((fmt != null) ? fmt.form(tval) : ((int) tval))
+ + "%";
p++;
}
}
else
{
- mouseOver += ((fmt!=null) ? fmt.form(value) : ((int) value)) + "%";
+ mouseOver += ((fmt != null) ? fmt.form(value) : ((int) value))
+ + "%";
}
consensus.annotations[i] = new Annotation(maxRes, mouseOver, ' ',
value);
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.analysis;
+
import java.util.*;
import java.awt.*;
/**
* Construct score matrix for sequences with standard DNA or PEPTIDE matrix
- * @param s1 - sequence 1
- * @param string1 - string to use for s1
- * @param s2 - sequence 2
- * @param string2 - string to use for s2
+ *
+ * @param s1
+ * - sequence 1
+ * @param string1
+ * - string to use for s1
+ * @param s2
+ * - sequence 2
+ * @param string2
+ * - string to use for s2
* @param type
* DNA or PEPTIDE
*/
/**
* Construct score matrix for sequences with custom substitution matrix
- * @param s1 - sequence 1
- * @param string1 - string to use for s1
- * @param s2 - sequence 2
- * @param string2 - string to use for s2
- * @param scoreMatrix - substitution matrix to use for alignment
+ *
+ * @param s1
+ * - sequence 1
+ * @param string1
+ * - string to use for s1
+ * @param s2
+ * - sequence 2
+ * @param string2
+ * - string to use for s2
+ * @param scoreMatrix
+ * - substitution matrix to use for alignment
*/
public void SeqInit(SequenceI s1, String string1, SequenceI s2,
String string2, ScoreMatrix scoreMatrix)
* construct score matrix for string1 and string2 (after removing any existing
* gaps
*
- * @param string1
+ * @param string1
* @param string2
*/
private void SeqInit(String string1, String string2)
{
lastmatch = true;
// extend mapping interval.
- if (lp1 + 1 != alignpos || lp2+1 !=pdbpos)
+ if (lp1 + 1 != alignpos || lp2 + 1 != pdbpos)
{
as1.add(Integer.valueOf(alignpos));
as2.add(Integer.valueOf(pdbpos));
import jalview.datamodel.AlignmentI;
/**
- * grab bag of useful alignment manipulation operations
- * Expect these to be refactored elsewhere at some point.
+ * grab bag of useful alignment manipulation operations Expect these to be
+ * refactored elsewhere at some point.
+ *
* @author jimp
- *
+ *
*/
public class AlignmentUtils
{
/**
- * given an existing alignment, create a new alignment including all, or up to flankSize additional symbols from each sequence's dataset sequence
+ * given an existing alignment, create a new alignment including all, or up to
+ * flankSize additional symbols from each sequence's dataset sequence
+ *
* @param core
* @param flankSize
* @return AlignmentI
{
List<SequenceI> sq = new ArrayList<SequenceI>();
int maxoffset = 0;
- for (SequenceI s:core.getSequences())
+ for (SequenceI s : core.getSequences())
{
SequenceI newSeq = s.deriveSequence();
- if (newSeq.getStart()>maxoffset && newSeq.getDatasetSequence().getStart()<s.getStart())
+ if (newSeq.getStart() > maxoffset
+ && newSeq.getDatasetSequence().getStart() < s.getStart())
{
maxoffset = newSeq.getStart();
}
sq.add(newSeq);
}
- if (flankSize>-1) {
+ if (flankSize > -1)
+ {
maxoffset = flankSize;
}
// now add offset to create a new expanded alignment
- for (SequenceI s:sq)
+ for (SequenceI s : sq)
{
SequenceI ds = s;
- while (ds.getDatasetSequence()!=null) {
- ds=ds.getDatasetSequence();
+ while (ds.getDatasetSequence() != null)
+ {
+ ds = ds.getDatasetSequence();
}
- int s_end = s.findPosition(s.getStart()+s.getLength());
+ int s_end = s.findPosition(s.getStart() + s.getLength());
// find available flanking residues for sequence
- int ustream_ds=s.getStart()-ds.getStart(),dstream_ds=ds.getEnd()-s_end;
-
+ int ustream_ds = s.getStart() - ds.getStart(), dstream_ds = ds
+ .getEnd() - s_end;
+
// build new flanked sequence
-
+
// compute gap padding to start of flanking sequence
- int offset=maxoffset - ustream_ds;
-
+ int offset = maxoffset - ustream_ds;
+
// padding is gapChar x ( maxoffset - min(ustream_ds, flank)
- if (flankSize>=0) {
- if (flankSize<ustream_ds)
+ if (flankSize >= 0)
+ {
+ if (flankSize < ustream_ds)
{
- // take up to flankSize residues
- offset = maxoffset-flankSize;
- ustream_ds = flankSize;
- }
- if (flankSize<dstream_ds)
+ // take up to flankSize residues
+ offset = maxoffset - flankSize;
+ ustream_ds = flankSize;
+ }
+ if (flankSize < dstream_ds)
{
- dstream_ds=flankSize;
+ dstream_ds = flankSize;
}
}
- char[] upstream = new String(ds.getSequence(s.getStart()-1-ustream_ds, s.getStart()-1)).toLowerCase().toCharArray();
- char[] downstream = new String(ds.getSequence(s_end-1,s_end+1+dstream_ds)).toLowerCase().toCharArray();
- char[] coreseq=s.getSequence();
- char[] nseq = new char[offset+upstream.length+downstream.length+coreseq.length];
+ char[] upstream = new String(ds.getSequence(s.getStart() - 1
+ - ustream_ds, s.getStart() - 1)).toLowerCase().toCharArray();
+ char[] downstream = new String(ds.getSequence(s_end - 1, s_end + 1
+ + dstream_ds)).toLowerCase().toCharArray();
+ char[] coreseq = s.getSequence();
+ char[] nseq = new char[offset + upstream.length + downstream.length
+ + coreseq.length];
char c = core.getGapCharacter();
// TODO could lowercase the flanking regions
- int p=0;
- for (; p<offset;p++)
+ int p = 0;
+ for (; p < offset; p++)
{
nseq[p] = c;
}
-// s.setSequence(new String(upstream).toLowerCase()+new String(coreseq) + new String(downstream).toLowerCase());
+ // s.setSequence(new String(upstream).toLowerCase()+new String(coreseq) +
+ // new String(downstream).toLowerCase());
System.arraycopy(upstream, 0, nseq, p, upstream.length);
- System.arraycopy(coreseq, 0, nseq, p+upstream.length, coreseq.length);
- System.arraycopy(downstream, 0, nseq, p+coreseq.length+upstream.length, downstream.length);
+ System.arraycopy(coreseq, 0, nseq, p + upstream.length,
+ coreseq.length);
+ System.arraycopy(downstream, 0, nseq, p + coreseq.length
+ + upstream.length, downstream.length);
s.setSequence(new String(nseq));
- s.setStart(s.getStart()-ustream_ds);
- s.setEnd(s_end+downstream.length);
+ s.setStart(s.getStart() - ustream_ds);
+ s.setEnd(s_end + downstream.length);
}
- AlignmentI newAl = new jalview.datamodel.Alignment(sq.toArray(new SequenceI[0]));
+ AlignmentI newAl = new jalview.datamodel.Alignment(
+ sq.toArray(new SequenceI[0]));
newAl.setDataset(core.getDataset());
return newAl;
}
{
SequenceI newseq = translateCodingRegion(selection[s], seqstring[s],
viscontigs, codons, gapCharacter,
- (product != null) ? product[s] : null, false); // possibly anonymous
+ (product != null) ? product[s] : null, false); // possibly
+ // anonymous
// product
if (newseq != null)
{
* Definition of global ORF alignment reference frame
* @param gapCharacter
* @return sequence ready to be added to alignment.
- * @deprecated Use {@link #translateCodingRegion(SequenceI,String,int[],AlignedCodonFrame,char,DBRefEntry,boolean)} instead
+ * @deprecated Use
+ * {@link #translateCodingRegion(SequenceI,String,int[],AlignedCodonFrame,char,DBRefEntry,boolean)}
+ * instead
*/
public static SequenceI translateCodingRegion(SequenceI selection,
String seqstring, int[] viscontigs, AlignedCodonFrame codons,
* @param codons
* Definition of global ORF alignment reference frame
* @param gapCharacter
- * @param starForStop when true stop codons will translate as '*', otherwise as 'X'
+ * @param starForStop
+ * when true stop codons will translate as '*', otherwise as 'X'
* @return sequence ready to be added to alignment.
*/
public static SequenceI translateCodingRegion(SequenceI selection,
// edit scontigs
skipint[0] = vismapping.shift(skipint[0]);
skipint[1] = vismapping.shift(skipint[1]);
- for (vc = 0; vc < scontigs.length; )
+ for (vc = 0; vc < scontigs.length;)
{
if (scontigs[vc + 1] < skipint[0])
{
vc += 2;
continue;
}
- if (scontigs[vc]>skipint[1])
+ if (scontigs[vc] > skipint[1])
{
// finished editing so
break;
}
- // Edit the contig list to include the skipped region which did not translate
+ // Edit the contig list to include the skipped region which did
+ // not translate
int[] t;
// from : s1 e1 s2 e2 s3 e3
- // to s: s1 e1 s2 k0 k1 e2 s3 e3
- // list increases by one unless one boundary (s2==k0 or e2==k1) matches, and decreases by one if skipint intersects whole visible contig
+ // to s: s1 e1 s2 k0 k1 e2 s3 e3
+ // list increases by one unless one boundary (s2==k0 or e2==k1)
+ // matches, and decreases by one if skipint intersects whole
+ // visible contig
if (scontigs[vc] <= skipint[0])
{
if (skipint[0] == scontigs[vc])
if (scontigs[vc + 1] > skipint[1])
{
scontigs[vc] = skipint[1];
- vc+=2;
+ vc += 2;
}
else
{
- if (scontigs[vc+1]==skipint[1])
+ if (scontigs[vc + 1] == skipint[1])
{
// remove the contig
t = new int[scontigs.length - 2];
if (vc + 2 < t.length)
{
System.arraycopy(scontigs, vc + 2, t, vc, t.length
- - vc + 2);
+ - vc + 2);
}
- scontigs=t;
- } else {
+ scontigs = t;
+ }
+ else
+ {
// truncate contig to before the skipint region
- scontigs[vc+1] = skipint[0]-1;
- vc+=2;
+ scontigs[vc + 1] = skipint[0] - 1;
+ vc += 2;
}
}
}
else
{
// scontig starts before start of skipint
- if (scontigs[vc+1]<skipint[1]) {
+ if (scontigs[vc + 1] < skipint[1])
+ {
// skipint truncates end of scontig
- scontigs[vc+1] = skipint[0]-1;
- vc+=2;
- } else {
+ scontigs[vc + 1] = skipint[0] - 1;
+ vc += 2;
+ }
+ else
+ {
// divide region to new contigs
t = new int[scontigs.length + 2];
- System.arraycopy(scontigs, 0, t, 0, vc +1);
- t[vc+1] = skipint[0];
- t[vc+2] = skipint[1];
- System.arraycopy(scontigs, vc + 1, t, vc+3, scontigs.length-(vc+1));
- scontigs=t;
- vc+=4;
+ System.arraycopy(scontigs, 0, t, 0, vc + 1);
+ t[vc + 1] = skipint[0];
+ t[vc + 2] = skipint[1];
+ System.arraycopy(scontigs, vc + 1, t, vc + 3,
+ scontigs.length - (vc + 1));
+ scontigs = t;
+ vc += 4;
}
}
}
protein.toString());
if (rf != 0)
{
- if (jalview.bin.Cache.log!=null) {
- jalview.bin.Cache.log.debug("trimming contigs for incomplete terminal codon.");
- } else {
- System.err.println("trimming contigs for incomplete terminal codon.");
+ if (jalview.bin.Cache.log != null)
+ {
+ jalview.bin.Cache.log
+ .debug("trimming contigs for incomplete terminal codon.");
+ }
+ else
+ {
+ System.err
+ .println("trimming contigs for incomplete terminal codon.");
}
// map and trim contigs to ORF region
vc = scontigs.length - 1;
private static void transferCodedFeatures(SequenceI dna, SequenceI pep,
MapList map, Hashtable featureTypes, Hashtable featureGroups)
{
- SequenceFeature[] sf = (dna.getDatasetSequence()!=null ? dna.getDatasetSequence() : dna).getSequenceFeatures();
+ SequenceFeature[] sf = (dna.getDatasetSequence() != null ? dna
+ .getDatasetSequence() : dna).getSequenceFeatures();
Boolean fgstate;
jalview.datamodel.DBRefEntry[] dnarefs = jalview.util.DBRefUtils
.selectRefs(dna.getDBRef(),
*/
public float[][] findDistances()
{
-
+
float[][] distance = new float[noseqs][noseqs];
- // Pairwise substitution score (with no gap penalties)
- ScoreModelI _pwmatrix = ResidueProperties.getScoreModel(pwtype);
- if (_pwmatrix == null)
- {
- _pwmatrix = ResidueProperties.getScoreMatrix("BLOSUM62");
- }
- distance = _pwmatrix.findDistances(seqData);
+ // Pairwise substitution score (with no gap penalties)
+ ScoreModelI _pwmatrix = ResidueProperties.getScoreModel(pwtype);
+ if (_pwmatrix == null)
+ {
+ _pwmatrix = ResidueProperties.getScoreMatrix("BLOSUM62");
+ }
+ distance = _pwmatrix.findDistances(seqData);
return distance;
-
}
/**
{
this(s, nucleotides, null);
}
+
public PCA(String[] s, boolean nucleotides, String s_m)
{
BinarySequence[] bs2 = new BinarySequence[s.length];
ii = 0;
ScoreMatrix smtrx = null;
- String sm=s_m;
- if (sm!=null)
+ String sm = s_m;
+ if (sm != null)
{
smtrx = ResidueProperties.getScoreMatrix(sm);
}
- if (smtrx==null)
+ if (smtrx == null)
{
- // either we were given a non-existent score matrix or a scoremodel that isn't based on a pairwise symbol score matrix
- smtrx = ResidueProperties.getScoreMatrix(sm=(nucleotides ? "DNA" : "BLOSUM62"));
+ // either we were given a non-existent score matrix or a scoremodel that
+ // isn't based on a pairwise symbol score matrix
+ smtrx = ResidueProperties.getScoreMatrix(sm = (nucleotides ? "DNA"
+ : "BLOSUM62"));
}
details.append("PCA calculation using " + sm
+ " sequence similarity matrix\n========\n\n");
}
};
- try {
- details.append("PCA Calculation Mode is "
- + (jvCalcMode ? "Jalview variant" : "Original SeqSpace") + "\n");
- Matrix mt = m.transpose();
-
- details.append(" --- OrigT * Orig ---- \n");
- if (!jvCalcMode)
- {
- eigenvector = mt.preMultiply(m); // standard seqspace comparison matrix
- }
- else
+ try
{
- eigenvector = mt.preMultiply(m2); // jalview variation on seqsmace method
- }
+ details.append("PCA Calculation Mode is "
+ + (jvCalcMode ? "Jalview variant" : "Original SeqSpace")
+ + "\n");
+ Matrix mt = m.transpose();
- eigenvector.print(ps);
+ details.append(" --- OrigT * Orig ---- \n");
+ if (!jvCalcMode)
+ {
+ eigenvector = mt.preMultiply(m); // standard seqspace comparison matrix
+ }
+ else
+ {
+ eigenvector = mt.preMultiply(m2); // jalview variation on seqsmace
+ // method
+ }
- symm = eigenvector.copy();
+ eigenvector.print(ps);
- eigenvector.tred();
+ symm = eigenvector.copy();
- details.append(" ---Tridiag transform matrix ---\n");
- details.append(" --- D vector ---\n");
- eigenvector.printD(ps);
- ps.println();
- details.append("--- E vector ---\n");
- eigenvector.printE(ps);
- ps.println();
+ eigenvector.tred();
+
+ details.append(" ---Tridiag transform matrix ---\n");
+ details.append(" --- D vector ---\n");
+ eigenvector.printD(ps);
+ ps.println();
+ details.append("--- E vector ---\n");
+ eigenvector.printE(ps);
+ ps.println();
- // Now produce the diagonalization matrix
- eigenvector.tqli();
+ // Now produce the diagonalization matrix
+ eigenvector.tqli();
} catch (Exception q)
{
q.printStackTrace();
- details.append("\n*** Unexpected exception when performing PCA ***\n"+q.getLocalizedMessage());
+ details.append("\n*** Unexpected exception when performing PCA ***\n"
+ + q.getLocalizedMessage());
details.append("*** Matrices below may not be fully diagonalised. ***\n");
}
package jalview.analysis;
-
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Stack;
import java.util.Vector;
-
import jalview.analysis.SecStrConsensus.SimpleBP;
import jalview.datamodel.SequenceFeature;
public class Rna
{
-
- static Hashtable<Integer, Integer> pairHash = new Hashtable();
-
- private static final Character[] openingPars = {'(','[','{','<','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
- private static final Character[] closingPars = {')',']','}','>','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
-
- private static HashSet<Character> openingParsSet = new HashSet<Character>(Arrays.asList(openingPars));
- private static HashSet<Character> closingParsSet = new HashSet<Character>(Arrays.asList(closingPars));
- private static Hashtable<Character,Character> closingToOpening = new Hashtable<Character,Character>()
+
+ static Hashtable<Integer, Integer> pairHash = new Hashtable();
+
+ private static final Character[] openingPars =
+ { '(', '[', '{', '<', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
+ 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
+ 'Y', 'Z' };
+
+ private static final Character[] closingPars =
+ { ')', ']', '}', '>', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+ 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
+ 'y', 'z' };
+
+ private static HashSet<Character> openingParsSet = new HashSet<Character>(
+ Arrays.asList(openingPars));
+
+ private static HashSet<Character> closingParsSet = new HashSet<Character>(
+ Arrays.asList(closingPars));
+
+ private static Hashtable<Character, Character> closingToOpening = new Hashtable<Character, Character>()
// Initializing final data structure
{
- private static final long serialVersionUID = 1L;
- {
- for(int i=0;i<openingPars.length;i++)
- {
- System.out.println(closingPars[i]+"->"+openingPars[i]);
- put(closingPars[i],openingPars[i]);
- }
- }};
-
+ private static final long serialVersionUID = 1L;
+ {
+ for (int i = 0; i < openingPars.length; i++)
+ {
+ System.out.println(closingPars[i] + "->" + openingPars[i]);
+ put(closingPars[i], openingPars[i]);
+ }
+ }
+ };
+
private static boolean isOpeningParenthesis(char c)
{
- return openingParsSet.contains(c);
+ return openingParsSet.contains(c);
}
-
+
private static boolean isClosingParenthesis(char c)
{
- return closingParsSet.contains(c);
+ return closingParsSet.contains(c);
}
- private static char matchingOpeningParenthesis(char closingParenthesis) throws WUSSParseException
+ private static char matchingOpeningParenthesis(char closingParenthesis)
+ throws WUSSParseException
{
- if (!isClosingParenthesis(closingParenthesis))
- {
- throw new WUSSParseException("Querying matching opening parenthesis for non-closing parenthesis character "+closingParenthesis, -1);
- }
-
- return closingToOpening.get(closingParenthesis);
+ if (!isClosingParenthesis(closingParenthesis))
+ {
+ throw new WUSSParseException(
+ "Querying matching opening parenthesis for non-closing parenthesis character "
+ + closingParenthesis, -1);
+ }
+
+ return closingToOpening.get(closingParenthesis);
}
-
+
/**
* Based off of RALEE code ralee-get-base-pairs. Keeps track of open bracket
* positions in "stack" vector. When a close bracket is reached, pair this
* @return Array of SequenceFeature; type = RNA helix, begin is open base
* pair, end is close base pair
*/
- public static Vector<SimpleBP> GetSimpleBPs(CharSequence line) throws WUSSParseException
+ public static Vector<SimpleBP> GetSimpleBPs(CharSequence line)
+ throws WUSSParseException
{
System.out.println(line);
- Hashtable<Character,Stack<Integer>> stacks = new Hashtable<Character,Stack<Integer>>();
+ Hashtable<Character, Stack<Integer>> stacks = new Hashtable<Character, Stack<Integer>>();
Vector<SimpleBP> pairs = new Vector<SimpleBP>();
int i = 0;
while (i < line.length())
{
char base = line.charAt(i);
-
+
if (isOpeningParenthesis(base))
{
- if (!stacks.containsKey(base)){
- stacks.put(base, new Stack<Integer>());
- }
+ if (!stacks.containsKey(base))
+ {
+ stacks.put(base, new Stack<Integer>());
+ }
stacks.get(base).push(i);
-
+
}
else if (isClosingParenthesis(base))
{
-
- char opening = matchingOpeningParenthesis(base);
-
- if (!stacks.containsKey(opening)){
- throw new WUSSParseException("Mismatched (unseen) closing character "+base, i);
- }
-
- Stack<Integer> stack = stacks.get(opening);
+
+ char opening = matchingOpeningParenthesis(base);
+
+ if (!stacks.containsKey(opening))
+ {
+ throw new WUSSParseException(
+ "Mismatched (unseen) closing character " + base, i);
+ }
+
+ Stack<Integer> stack = stacks.get(opening);
if (stack.isEmpty())
{
// error whilst parsing i'th position. pass back
- throw new WUSSParseException("Mismatched closing character "+base, i);
+ throw new WUSSParseException("Mismatched closing character "
+ + base, i);
}
int temp = stack.pop();
-
- pairs.add(new SimpleBP(temp,i));
+
+ pairs.add(new SimpleBP(temp, i));
}
i++;
}
- for(char opening: stacks.keySet())
+ for (char opening : stacks.keySet())
{
- Stack<Integer> stack = stacks.get(opening);
- if (!stack.empty())
- {
- throw new WUSSParseException("Mismatched opening character "+opening+" at "+stack.pop(), i);
- }
+ Stack<Integer> stack = stacks.get(opening);
+ if (!stack.empty())
+ {
+ throw new WUSSParseException("Mismatched opening character "
+ + opening + " at " + stack.pop(), i);
+ }
}
return pairs;
}
-
- public static SequenceFeature[] GetBasePairs(CharSequence line) throws WUSSParseException
+
+ public static SequenceFeature[] GetBasePairs(CharSequence line)
+ throws WUSSParseException
{
- Vector<SimpleBP> bps = GetSimpleBPs(line);
- SequenceFeature[] outPairs = new SequenceFeature[bps.size()];
+ Vector<SimpleBP> bps = GetSimpleBPs(line);
+ SequenceFeature[] outPairs = new SequenceFeature[bps.size()];
for (int p = 0; p < bps.size(); p++)
{
- SimpleBP bp = bps.elementAt(p);
- outPairs[p] = new SequenceFeature("RNA helix", "", "", bp.getBP5(),bp.getBP3(), "");
+ SimpleBP bp = bps.elementAt(p);
+ outPairs[p] = new SequenceFeature("RNA helix", "", "", bp.getBP5(),
+ bp.getBP3(), "");
}
return outPairs;
}
-
-
- public static ArrayList<SimpleBP> GetModeleBP(CharSequence line) throws WUSSParseException
+
+ public static ArrayList<SimpleBP> GetModeleBP(CharSequence line)
+ throws WUSSParseException
{
- Vector<SimpleBP> bps = GetSimpleBPs(line);
- return new ArrayList<SimpleBP>(bps);
+ Vector<SimpleBP> bps = GetSimpleBPs(line);
+ return new ArrayList<SimpleBP>(bps);
}
-
-
+
/**
* Function to get the end position corresponding to a given start position
- * @param indice - start position of a base pair
+ *
+ * @param indice
+ * - start position of a base pair
* @return - end position of a base pair
*/
- /*makes no sense at the moment :(
- public int findEnd(int indice){
- //TODO: Probably extend this to find the start to a given end?
- //could be done by putting everything twice to the hash
- ArrayList<Integer> pair = new ArrayList<Integer>();
- return pairHash.get(indice);
- }*/
-
+ /*
+ * makes no sense at the moment :( public int findEnd(int indice){ //TODO:
+ * Probably extend this to find the start to a given end? //could be done by
+ * putting everything twice to the hash ArrayList<Integer> pair = new
+ * ArrayList<Integer>(); return pairHash.get(indice); }
+ */
/**
* Figures out which helix each position belongs to and stores the helix
}
}
}
-
import java.util.ArrayList;
import java.util.Hashtable;
+public class SecStrConsensus
+{
-public class SecStrConsensus {
-
-
- /**
- * Internal class to represent a simple base-pair.
- * @author Yawn
- * [JBPNote: ^^ is that Anne Menard or Ya(w)nn Ponty, I wonder ! ]
- */
- public static class SimpleBP{
- int bp5;
- int bp3;
-
- public SimpleBP()
- {
-
- }
- public SimpleBP(int i5, int i3)
- {
- bp5=i5;
- bp3=i3;
- }
- public void setBP5(int i5)
- {
- bp5=i5;
- }
-
- public void setBP3(int i3)
- {
- bp3=i3;
- }
-
- public int getBP5()
- {
- return bp5;
- }
-
- public int getBP3()
- {
- return bp3;
- }
-
- public String toString()
- {
- return "("+bp5+","+bp3+")";
- }
-
- }
-
- public static int[] extractConsensus(ArrayList<ArrayList<SimpleBP>> bps)
- {
- // We do not currently know the length of the alignment
- // => Estimate it as the biggest index of a base-pair plus one.
- int maxlength = 0;
- for (ArrayList<SimpleBP> strs : bps)
- {
- for (SimpleBP bp : strs)
- {
-
- maxlength = Math.max(1+Math.max(bp.bp5, bp.bp3), maxlength);
+ /**
+ * Internal class to represent a simple base-pair.
+ *
+ * @author Yawn [JBPNote: ^^ is that Anne Menard or Ya(w)nn Ponty, I wonder !
+ * ]
+ */
+ public static class SimpleBP
+ {
+ int bp5;
+
+ int bp3;
+
+ public SimpleBP()
+ {
+
+ }
+
+ public SimpleBP(int i5, int i3)
+ {
+ bp5 = i5;
+ bp3 = i3;
+ }
+
+ public void setBP5(int i5)
+ {
+ bp5 = i5;
+ }
+
+ public void setBP3(int i3)
+ {
+ bp3 = i3;
+ }
+
+ public int getBP5()
+ {
+ return bp5;
+ }
+
+ public int getBP3()
+ {
+ return bp3;
+ }
+
+ public String toString()
+ {
+ return "(" + bp5 + "," + bp3 + ")";
+ }
- }
}
- // Now we have a good estimate for length, allocate and initialize data
- // to be fed to the dynamic programming procedure.
- ArrayList<Hashtable<Integer,Double>> seq = new ArrayList<Hashtable<Integer,Double>>();
- for (int i=0;i<maxlength;i++)
- { seq.add(new Hashtable<Integer,Double>()); }
- for (ArrayList<SimpleBP> strs : bps)
+
+ public static int[] extractConsensus(ArrayList<ArrayList<SimpleBP>> bps)
{
- for (SimpleBP bp : strs)
- {
- int i = bp.bp5;
- int j = bp.bp3;
- Hashtable<Integer,Double> h = seq.get(i);
- if (!h.containsKey(j))
+ // We do not currently know the length of the alignment
+ // => Estimate it as the biggest index of a base-pair plus one.
+ int maxlength = 0;
+ for (ArrayList<SimpleBP> strs : bps)
+ {
+ for (SimpleBP bp : strs)
+ {
+
+ maxlength = Math.max(1 + Math.max(bp.bp5, bp.bp3), maxlength);
+
+ }
+ }
+ // Now we have a good estimate for length, allocate and initialize data
+ // to be fed to the dynamic programming procedure.
+ ArrayList<Hashtable<Integer, Double>> seq = new ArrayList<Hashtable<Integer, Double>>();
+ for (int i = 0; i < maxlength; i++)
+ {
+ seq.add(new Hashtable<Integer, Double>());
+ }
+ for (ArrayList<SimpleBP> strs : bps)
+ {
+ for (SimpleBP bp : strs)
+ {
+ int i = bp.bp5;
+ int j = bp.bp3;
+ Hashtable<Integer, Double> h = seq.get(i);
+ if (!h.containsKey(j))
+ {
+ h.put(j, 0.0);
+ }
+ h.put(j, h.get(j) + 1.);
+ }
+ }
+ // At this point, seq contains, at each position i, a hashtable which
+ // associates,
+ // to each possible end j, the number of time a base-pair (i,j) occurs in
+ // the alignment
+
+ // We can now run the dynamic programming procedure on this data
+ double[][] mat = fillMatrix(seq);
+ ArrayList<SimpleBP> res = backtrack(mat, seq);
+
+ // Convert it to an array, ie finalres[i] = j >= 0 iff a base-pair (i,j) is
+ // present
+ // in the consensus, or -1 otherwise
+ int[] finalres = new int[seq.size()];
+ for (int i = 0; i < seq.size(); i++)
+ {
+ finalres[i] = -1;
+ }
+ for (SimpleBP bp : res)
{
- h.put(j, 0.0);
+ finalres[bp.bp5] = bp.bp3;
+ finalres[bp.bp3] = bp.bp5;
}
- h.put(j, h.get(j)+1.);
- }
+
+ return finalres;
}
- // At this point, seq contains, at each position i, a hashtable which associates,
- // to each possible end j, the number of time a base-pair (i,j) occurs in the alignment
-
- // We can now run the dynamic programming procedure on this data
- double[][] mat = fillMatrix(seq);
- ArrayList<SimpleBP> res = backtrack(mat,seq);
-
- // Convert it to an array, ie finalres[i] = j >= 0 iff a base-pair (i,j) is present
- // in the consensus, or -1 otherwise
- int[] finalres = new int[seq.size()];
- for (int i=0;i<seq.size();i++)
- { finalres[i] = -1; }
- for (SimpleBP bp : res)
+
+ private static boolean canBasePair(
+ ArrayList<Hashtable<Integer, Double>> seq, int i, int k)
{
- finalres[bp.bp5] = bp.bp3;
- finalres[bp.bp3] = bp.bp5;
+ return seq.get(i).containsKey(k);
}
-
- return finalres;
- }
-
- private static boolean canBasePair(ArrayList<Hashtable<Integer,Double>> seq, int i, int k)
- {
- return seq.get(i).containsKey(k);
- }
-
- // Returns the score of a potential base-pair, ie the number of structures in which it is found.
- private static double basePairScore(ArrayList<Hashtable<Integer,Double>> seq, int i, int k)
- {
- return seq.get(i).get(k);
- }
-
-
- private static double[][] fillMatrix(ArrayList<Hashtable<Integer,Double>> seq)
+
+ // Returns the score of a potential base-pair, ie the number of structures in
+ // which it is found.
+ private static double basePairScore(
+ ArrayList<Hashtable<Integer, Double>> seq, int i, int k)
{
- int n = seq.size();
- double[][] tab = new double[n][n];
- for(int m=1;m<=n;m++)
+ return seq.get(i).get(k);
+ }
+
+ private static double[][] fillMatrix(
+ ArrayList<Hashtable<Integer, Double>> seq)
{
- for(int i=0;i<n-m+1;i++)
- {
- int j = i+m-1;
- tab[i][j] = 0;
- if (i<j)
- {
- tab[i][j] = Math.max(tab[i][j], tab[i+1][j]);
- for (int k=i+1;k<=j;k++)
- {
- if (canBasePair(seq,i,k))
+ int n = seq.size();
+ double[][] tab = new double[n][n];
+ for (int m = 1; m <= n; m++)
+ {
+ for (int i = 0; i < n - m + 1; i++)
{
- double fact1 = 0;
- if (k>i+1)
- {
- fact1 = tab[i+1][k-1];
- }
- double fact2 = 0;
- if (k<j)
- {
- fact2 = tab[k+1][j];
- }
- tab[i][j] = Math.max(tab[i][j],basePairScore(seq,i,k)+fact1+fact2);
- }
- }
- }
- }
+ int j = i + m - 1;
+ tab[i][j] = 0;
+ if (i < j)
+ {
+ tab[i][j] = Math.max(tab[i][j], tab[i + 1][j]);
+ for (int k = i + 1; k <= j; k++)
+ {
+ if (canBasePair(seq, i, k))
+ {
+ double fact1 = 0;
+ if (k > i + 1)
+ {
+ fact1 = tab[i + 1][k - 1];
+ }
+ double fact2 = 0;
+ if (k < j)
+ {
+ fact2 = tab[k + 1][j];
+ }
+ tab[i][j] = Math.max(tab[i][j], basePairScore(seq, i, k)
+ + fact1 + fact2);
+ }
+ }
+ }
+ }
+ }
+ return tab;
}
- return tab;
- }
-
- private static ArrayList<SimpleBP> backtrack(double[][] tab,ArrayList<Hashtable<Integer,Double>> seq)
+
+ private static ArrayList<SimpleBP> backtrack(double[][] tab,
+ ArrayList<Hashtable<Integer, Double>> seq)
{
- return backtrack(tab,seq,0,seq.size()-1);
+ return backtrack(tab, seq, 0, seq.size() - 1);
}
-
- private static ArrayList<SimpleBP> backtrack(double[][] tab,ArrayList<Hashtable<Integer,Double>> seq, int i, int j)
+
+ private static ArrayList<SimpleBP> backtrack(double[][] tab,
+ ArrayList<Hashtable<Integer, Double>> seq, int i, int j)
{
- ArrayList<SimpleBP> result = new ArrayList<SimpleBP>();
- if (i<j)
- {
- ArrayList<Integer> indices = new ArrayList<Integer>();
- indices.add(-1);
- for (int k=i+1;k<=j;k++)
- {
- indices.add(k);
- }
- for (int k : indices)
- {
- if (k==-1)
- {
- if (tab[i][j] == tab[i+1][j])
+ ArrayList<SimpleBP> result = new ArrayList<SimpleBP>();
+ if (i < j)
+ {
+ ArrayList<Integer> indices = new ArrayList<Integer>();
+ indices.add(-1);
+ for (int k = i + 1; k <= j; k++)
{
- result = backtrack(tab, seq, i+1,j);
+ indices.add(k);
}
- }
- else
- {
- if (canBasePair(seq,i,k))
+ for (int k : indices)
{
- double fact1 = 0;
- if (k>i+1)
- {
- fact1 = tab[i+1][k-1];
- }
- double fact2 = 0;
- if (k<j)
- {
- fact2 = tab[k+1][j];
- }
- if (tab[i][j]==basePairScore(seq,i,k)+fact1+fact2)
- {
- result = backtrack(tab, seq, i+1,k-1);
- result.addAll(backtrack(tab, seq, k+1,j));
- result.add(new SimpleBP(i,k));
- }
- }
- }
- }
- }
- else if (i==j)
- {
-
- }
- else
- {
-
- }
- return result;
- }
-
+ if (k == -1)
+ {
+ if (tab[i][j] == tab[i + 1][j])
+ {
+ result = backtrack(tab, seq, i + 1, j);
+ }
+ }
+ else
+ {
+ if (canBasePair(seq, i, k))
+ {
+ double fact1 = 0;
+ if (k > i + 1)
+ {
+ fact1 = tab[i + 1][k - 1];
+ }
+ double fact2 = 0;
+ if (k < j)
+ {
+ fact2 = tab[k + 1][j];
+ }
+ if (tab[i][j] == basePairScore(seq, i, k) + fact1 + fact2)
+ {
+ result = backtrack(tab, seq, i + 1, k - 1);
+ result.addAll(backtrack(tab, seq, k + 1, j));
+ result.add(new SimpleBP(i, k));
+ }
+ }
+ }
+ }
+ }
+ else if (i == j)
+ {
+ }
+ else
+ {
+
+ }
+ return result;
+ }
}
// initialised properly
return;
}
- String fmtstr="%3.1f";
- int precision=2;
- while (nseq>100) {
+ String fmtstr = "%3.1f";
+ int precision = 2;
+ while (nseq > 100)
+ {
precision++;
- nseq/=10;
+ nseq /= 10;
}
- if (precision>2)
+ if (precision > 2)
{
- fmtstr = "%"+(2+precision)+"."+precision+"f";
+ fmtstr = "%" + (2 + precision) + "." + precision + "f";
}
Format fmt = new Format(fmtstr);
-
+
for (int i = iStart; i < width; i++)
{
Hashtable hci;
tval = (vl[c] * 100f / profile[1][ignoreGapsInConsensusCalculation ? 1
: 0]);
mouseOver += ((p == 0) ? "" : "; ") + (char) ((int[]) ca[c])[0]
- + (char) ((int[]) ca[c])[1] + " " + fmt.form(tval) + "%";
+ + (char) ((int[]) ca[c])[1] + " " + fmt.form(tval)
+ + "%";
p++;
}
@Override
public float[][] findDistances(AlignmentView seqData)
{
- SequenceI[] sequenceString = seqData
- .getVisibleAlignment(Comparison.GapChars.charAt(0)).getSequencesArray();
+ SequenceI[] sequenceString = seqData.getVisibleAlignment(
+ Comparison.GapChars.charAt(0)).getSequencesArray();
int noseqs = sequenceString.length;
float[][] distance = new float[noseqs][noseqs];
-
- float max = -1;
-
- for (int i = 0; i < (noseqs - 1); i++) { for (int j = i; j < noseqs; j++)
- { AlignSeq as = new AlignSeq(sequenceString[i], sequenceString[j], seqData.isNa() ? "dna" : "pep");
- as.calcScoreMatrix(); as.traceAlignment(); as.printAlignment(System.out);
- distance[i][j] = (float) as.maxscore;
-
- if (max < distance[i][j]) { max = distance[i][j]; } } }
-
- for (int i = 0; i < (noseqs - 1); i++) { for (int j = i; j < noseqs; j++)
- { distance[i][j] = max - distance[i][j]; distance[j][i] = distance[i][j];
- } }
-
+
+ float max = -1;
+
+ for (int i = 0; i < (noseqs - 1); i++)
+ {
+ for (int j = i; j < noseqs; j++)
+ {
+ AlignSeq as = new AlignSeq(sequenceString[i], sequenceString[j],
+ seqData.isNa() ? "dna" : "pep");
+ as.calcScoreMatrix();
+ as.traceAlignment();
+ as.printAlignment(System.out);
+ distance[i][j] = (float) as.maxscore;
+
+ if (max < distance[i][j])
+ {
+ max = distance[i][j];
+ }
+ }
+ }
+
+ for (int i = 0; i < (noseqs - 1); i++)
+ {
+ for (int j = i; j < noseqs; j++)
+ {
+ distance[i][j] = max - distance[i][j];
+ distance[j][i] = distance[i][j];
+ }
+ }
+
return distance;
}
{
return "Smith Waterman Score";
}
+
@Override
public boolean isDNA()
{
return true;
}
+
@Override
public boolean isProtein()
{
return true;
}
- public String toString() {
+
+ public String toString()
+ {
return "Score between two sequences aligned with Smith Waterman with default Peptide/Nucleotide matrix";
}
}
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.api;
+
/**
- * Interface implemented by gui implementations managing a Jalview Alignment View
+ * Interface implemented by gui implementations managing a Jalview Alignment
+ * View
+ *
* @author jimp
- *
+ *
*/
public interface AlignViewControllerGuiI
{
/**
* display the given string in the GUI's status bar
+ *
* @param string
*/
void setStatus(String string);
/**
* prototype abstract controller for a Jalview alignment view
+ *
* @author jimp
*
- * All operations should return true if the view has changed as a result of the operation
+ * All operations should return true if the view has changed as a result
+ * of the operation
* @param <ViewportI>
- *
+ *
*/
public interface AlignViewControllerI<ViewportI>
{
public boolean deleteGroups();
- public void setViewportAndAlignmentPanel(AlignViewportI viewport, AlignmentViewPanel alignPanel);
+ public void setViewportAndAlignmentPanel(AlignViewportI viewport,
+ AlignmentViewPanel alignPanel);
/**
- * Mark columns in the current column selection according to positions of sequence features
- * @param invert - when set, mark all but columns containing given type
- * @param extendCurrent - when set, do not clear existing column selection
- * @param toggle - rather than explicitly set, toggle selection state
- * @param featureType - feature type string
+ * Mark columns in the current column selection according to positions of
+ * sequence features
+ *
+ * @param invert
+ * - when set, mark all but columns containing given type
+ * @param extendCurrent
+ * - when set, do not clear existing column selection
+ * @param toggle
+ * - rather than explicitly set, toggle selection state
+ * @param featureType
+ * - feature type string
* @return true if operation affected state
*/
- boolean markColumnsContainingFeatures(boolean invert, boolean extendCurrent, boolean clearColumns, String featureType);
+ boolean markColumnsContainingFeatures(boolean invert,
+ boolean extendCurrent, boolean clearColumns, String featureType);
}
void setConservation(Conservation cons);
-
}
Menu editMenu = new Menu(MessageManager.getString("action.edit"));
- MenuItem copy = new MenuItem(MessageManager.getString("label.jalview_copy"));
+ MenuItem copy = new MenuItem(
+ MessageManager.getString("label.jalview_copy"));
MenuItem cut = new MenuItem(MessageManager.getString("label.jalview_cut"));
- MenuItem toUpper = new MenuItem(MessageManager.getString("label.to_upper_case"));
+ MenuItem toUpper = new MenuItem(
+ MessageManager.getString("label.to_upper_case"));
- MenuItem toLower = new MenuItem(MessageManager.getString("label.to_lower_case"));
+ MenuItem toLower = new MenuItem(
+ MessageManager.getString("label.to_lower_case"));
- MenuItem toggleCase = new MenuItem(MessageManager.getString("label.toggle_case"));
+ MenuItem toggleCase = new MenuItem(
+ MessageManager.getString("label.toggle_case"));
Menu outputmenu = new Menu();
MenuItem repGroup = new MenuItem();
- MenuItem sequenceName = new MenuItem(MessageManager.getString("label.edit_name_description"));
+ MenuItem sequenceName = new MenuItem(
+ MessageManager.getString("label.edit_name_description"));
- MenuItem sequenceFeature = new MenuItem(MessageManager.getString("label.create_sequence_feature"));
+ MenuItem sequenceFeature = new MenuItem(
+ MessageManager.getString("label.create_sequence_feature"));
- MenuItem editSequence = new MenuItem(MessageManager.getString("label.edit_sequence"));
+ MenuItem editSequence = new MenuItem(
+ MessageManager.getString("label.edit_sequence"));
- MenuItem sequenceDetails = new MenuItem(MessageManager.getString("label.sequence_details") + "...");
+ MenuItem sequenceDetails = new MenuItem(
+ MessageManager.getString("label.sequence_details") + "...");
- MenuItem selSeqDetails = new MenuItem(MessageManager.getString("label.sequence_details") + "...");
+ MenuItem selSeqDetails = new MenuItem(
+ MessageManager.getString("label.sequence_details") + "...");
Sequence seq;
if (sg != null && sg.getSize() > 0)
{
- editGroupName.setLabel(MessageManager.formatMessage("label.name_param", new String[]{sg.getName()}));
+ editGroupName.setLabel(MessageManager.formatMessage(
+ "label.name_param", new String[]
+ { sg.getName() }));
showText.setState(sg.getDisplayText());
showColourText.setState(sg.getColourText());
showBoxes.setState(sg.getDisplayBoxes());
{
menu1.setLabel(MessageManager.getString("action.edit_new_group"));
groupMenu.remove(unGroupMenuItem);
- } else {
+ }
+ else
+ {
menu1.setLabel(MessageManager.getString("action.edit_group"));
groupMenu.remove(createGroupMenuItem);
}
if (seq != null)
{
seqMenu.setLabel(seq.getName());
- repGroup.setLabel(MessageManager.formatMessage("label.represent_group_with", new String[]{seq.getName()}));
+ repGroup.setLabel(MessageManager.formatMessage(
+ "label.represent_group_with", new String[]
+ { seq.getName() }));
}
else
{
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame,
- MessageManager.formatMessage("label.selection_output_command", new String[]{e.getActionCommand()}),600, 500);
+ jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage(
+ "label.selection_output_command", new String[]
+ { e.getActionCommand() }), 600, 500);
// JBPNote: getSelectionAsNewSequence behaviour has changed - this method
// now returns a full copy of sequence data
// TODO consider using getSequenceSelection instead here
StringBuffer contents = new StringBuffer();
for (SequenceI seq : sequences)
{
- contents.append(MessageManager.formatMessage("label.annotation_for_displayid",new String[]{seq.getDisplayId(true)}));
+ contents.append(MessageManager.formatMessage(
+ "label.annotation_for_displayid", new String[]
+ { seq.getDisplayId(true) }));
new SequenceAnnotationReport(null)
.createSequenceAnnotationReport(
contents,
jalview.bin.JalviewLite.addFrame(frame, "Sequence Details for "
+ (sequences.length == 1 ? sequences[0].getDisplayId(true)
: "Selection"), 600, 500);
- cap.setText(MessageManager.formatMessage("label.html_content", new String[]{contents.toString()}));
+ cap.setText(MessageManager.formatMessage("label.html_content",
+ new String[]
+ { contents.toString() }));
}
void editName()
cap.setPDBImport(seq);
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame,
- MessageManager.formatMessage("label.paste_pdb_file_for_sequence", new String[]{seq.getName()}), 400, 300);
+ jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage(
+ "label.paste_pdb_file_for_sequence", new String[]
+ { seq.getName() }), 400, 300);
}
}
sequenceFeature.addActionListener(this);
editGroupName.addActionListener(this);
- unGroupMenuItem.setLabel(MessageManager.getString("action.remove_group"));
+ unGroupMenuItem.setLabel(MessageManager
+ .getString("action.remove_group"));
unGroupMenuItem.addActionListener(this);
- createGroupMenuItem.setLabel(MessageManager.getString("action.create_group"));
+ createGroupMenuItem.setLabel(MessageManager
+ .getString("action.create_group"));
createGroupMenuItem.addActionListener(this);
- nucleotideMenuItem.setLabel(MessageManager.getString("label.nucleotide"));
+ nucleotideMenuItem.setLabel(MessageManager
+ .getString("label.nucleotide"));
nucleotideMenuItem.addActionListener(this);
conservationMenuItem.addItemListener(this);
abovePIDColour.addItemListener(this);
sequenceName.addActionListener(this);
sequenceDetails.addActionListener(this);
selSeqDetails.addActionListener(this);
- displayNonconserved.setLabel(MessageManager.getString("label.show_non_conversed"));
+ displayNonconserved.setLabel(MessageManager
+ .getString("label.show_non_conversed"));
displayNonconserved.setState(false);
displayNonconserved.addItemListener(this);
showText.setLabel(MessageManager.getString("action.text"));
seqMenu.setLabel(MessageManager.getString("label.sequence"));
pdb.setLabel(MessageManager.getString("label.view_pdb_structure"));
hideSeqs.setLabel(MessageManager.getString("action.hide_sequences"));
- repGroup.setLabel(MessageManager.formatMessage("label.represent_group_with", new String[]{""}));
+ repGroup.setLabel(MessageManager.formatMessage(
+ "label.represent_group_with", new String[]
+ { "" }));
revealAll.setLabel(MessageManager.getString("action.reveal_all"));
revealSeq.setLabel(MessageManager.getString("action.reveal_sequences"));
- menu1.setLabel(MessageManager.getString("label.group")+":");
+ menu1.setLabel(MessageManager.getString("label.group") + ":");
add(groupMenu);
this.add(seqMenu);
this.add(hideSeqs);
ItemListener, KeyListener, AlignViewControllerGuiI
{
public AlignViewControllerI avc;
+
public AlignmentPanel alignPanel;
public AlignViewport viewport;
}
viewport = new AlignViewport(al, applet);
alignPanel = new AlignmentPanel(this, viewport);
- avc = new jalview.controller.AlignViewController(this, viewport, alignPanel);
+ avc = new jalview.controller.AlignViewController(this, viewport,
+ alignPanel);
viewport.updateConservation(alignPanel);
viewport.updateConsensus(alignPanel);
showSequenceLogo.setState(viewport.isShowSequenceLogo());
normSequenceLogo.setState(viewport.isNormaliseSequenceLogo());
applyToAllGroups.setState(viewport.getColourAppliesToAllGroups());
-
+
seqLimits.setState(viewport.showJVSuffix);
if (applet != null)
viewport.featureSettings.refreshTable();
}
alignPanel.paintAlignment(true);
- statusBar.setText(MessageManager.getString("label.successfully_added_features_alignment"));
+ statusBar.setText(MessageManager
+ .getString("label.successfully_added_features_alignment"));
}
return featuresFile;
}
case KeyEvent.VK_F2:
viewport.cursorMode = !viewport.cursorMode;
- statusBar.setText(MessageManager.formatMessage("label.keyboard_editing_mode", new String[]{(viewport.cursorMode ? "on" : "off")}));
+ statusBar.setText(MessageManager.formatMessage(
+ "label.keyboard_editing_mode", new String[]
+ { (viewport.cursorMode ? "on" : "off") }));
if (viewport.cursorMode)
{
alignPanel.seqPanel.seqCanvas.cursorX = viewport.startRes;
}
}
break;
-
+
case KeyEvent.VK_U:
if (evt.isControlDown())
{
cap.setText(contents.toString());
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage("label.alignment_properties", new String[]{getTitle()}),
- 400, 250);
+ jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage(
+ "label.alignment_properties", new String[]
+ { getTitle() }), 400, 250);
}
else if (source == overviewMenuItem)
{
CutAndPasteTransfer cap = new CutAndPasteTransfer(true, this);
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.input_cut_paste"), 500, 500);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.input_cut_paste"), 500, 500);
}
protected void outputText_actionPerformed(ActionEvent e)
CutAndPasteTransfer cap = new CutAndPasteTransfer(true, this);
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame,
- MessageManager.formatMessage("label.alignment_output_command", new String[]{e.getActionCommand()}),600, 500);
+ jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage(
+ "label.alignment_output_command", new String[]
+ { e.getActionCommand() }), 600, 500);
cap.setText(new AppletFormatAdapter().formatSequences(
e.getActionCommand(), viewport.getAlignment(),
viewport.showJVSuffix));
public void loadAnnotations()
{
CutAndPasteTransfer cap = new CutAndPasteTransfer(true, this);
- cap.setText(MessageManager.getString("label.paste_features_annotations_Tcoffee_here"));
+ cap.setText(MessageManager
+ .getString("label.paste_features_annotations_Tcoffee_here"));
cap.setAnnotationImport();
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("action.paste_annotations"), 400, 300);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("action.paste_annotations"), 400, 300);
}
CutAndPasteTransfer cap = new CutAndPasteTransfer(false, this);
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.annotations"), 600, 500);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.annotations"), 600, 500);
cap.setText(annotation);
}
}
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.features"), 600, 500);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.features"), 600, 500);
cap.setText(features);
}
else
{
undoMenuItem.setEnabled(true);
CommandI command = (CommandI) viewport.historyList.peek();
- undoMenuItem.setLabel(MessageManager.formatMessage("label.undo_command", new String[]{command.getDescription()}));
+ undoMenuItem.setLabel(MessageManager.formatMessage(
+ "label.undo_command", new String[]
+ { command.getDescription() }));
}
else
{
redoMenuItem.setEnabled(true);
CommandI command = (CommandI) viewport.redoList.peek();
- redoMenuItem.setLabel(MessageManager.formatMessage("label.redo_command", new String[]{command.getDescription()}));
+ redoMenuItem.setLabel(MessageManager.formatMessage(
+ "label.redo_command", new String[]
+ { command.getDescription() }));
}
else
{
protected void makeGrpsFromSelection_actionPerformed()
{
- if (avc.makeGroupsFromSelection()) {
+ if (avc.makeGroupsFromSelection())
+ {
PaintRefresher.Refresh(this, viewport.getSequenceSetId());
alignPanel.updateAnnotation();
alignPanel.paintAlignment(true);
{
avc.createGroup();
}
+
protected void unGroup_actionPerformed()
{
if (avc.unGroup())
alignPanel.alignmentChanged();
}
}
+
protected void deleteGroups_actionPerformed()
{
if (avc.deleteGroups())
viewport.getSelectionGroup());
}
- statusBar.setText(MessageManager.formatMessage("label.removed_columns", new String[]{Integer.valueOf(trimRegion.getSize()).toString()}));
+ statusBar.setText(MessageManager.formatMessage(
+ "label.removed_columns", new String[]
+ { Integer.valueOf(trimRegion.getSize()).toString() }));
addHistoryItem(trimRegion);
for (SequenceGroup sg : viewport.getAlignment().getGroups())
addHistoryItem(removeGapCols);
- statusBar.setText(MessageManager.formatMessage("label.removed_empty_columns", new String[]{Integer.valueOf(removeGapCols.getSize()).toString()}));
+ statusBar.setText(MessageManager.formatMessage(
+ "label.removed_empty_columns", new String[]
+ { Integer.valueOf(removeGapCols.getSize()).toString() }));
// This is to maintain viewport position on first residue
// of first sequence
OverviewPanel overview = new OverviewPanel(alignPanel);
frame.add(overview);
// +50 must allow for applet frame window
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage("label.overview_params", new String[]{this.getTitle()}),
- overview.getPreferredSize().width,
+ jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage(
+ "label.overview_params", new String[]
+ { this.getTitle() }), overview.getPreferredSize().width,
overview.getPreferredSize().height + 50);
frame.pack();
{
if (viewport.getAbovePIDThreshold())
{
- viewport.setThreshold(SliderPanel.setPIDSliderSource(alignPanel, cs,
- "Background"));
- }
+ viewport.setThreshold(SliderPanel.setPIDSliderSource(alignPanel,
+ cs, "Background"));
+ }
if (viewport.getConservationSelected())
{
{
Frame frame = new Frame();
frame.add(new PairwiseAlignPanel(alignPanel));
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("action.pairwise_alignment"), 600,
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("action.pairwise_alignment"), 600,
500);
}
}
cap.setTreeImport();
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.paste_newick_file"), 400, 300);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.paste_newick_file"), 400, 300);
}
public void loadTree(jalview.io.NewickFile tree, String treeFile)
{
- TreePanel tp = new TreePanel(alignPanel, treeFile, MessageManager.getString("label.load_tree_from_file"), tree);
+ TreePanel tp = new TreePanel(alignPanel, treeFile,
+ MessageManager.getString("label.load_tree_from_file"), tree);
jalview.bin.JalviewLite.addFrame(tp, treeFile, 600, 500);
addTreeMenuItem(tp, treeFile);
}
.sortByTree(viewport.getAlignment(), treePanel.getTree());
// addHistoryItem(new HistoryItem("Sort", viewport.alignment,
// HistoryItem.SORT));
- addHistoryItem(new OrderCommand(MessageManager.formatMessage("label.order_by_params", new String[]{title}), oldOrder,
- viewport.getAlignment()));
+ addHistoryItem(new OrderCommand(MessageManager.formatMessage(
+ "label.order_by_params", new String[]
+ { title }), oldOrder, viewport.getAlignment()));
alignPanel.paintAlignment(true);
}
// TODO: update this text for each release or centrally store it for
// lite and application
g.setFont(new Font("Helvetica", Font.BOLD, 14));
- g.drawString(MessageManager.formatMessage("label.jalviewLite_release", new String[]{version}), x, y += fh);
+ g.drawString(MessageManager.formatMessage(
+ "label.jalviewLite_release", new String[]
+ { version }), x, y += fh);
g.setFont(new Font("Helvetica", Font.BOLD, 12));
- g.drawString(MessageManager.formatMessage("label.jaview_build_date", new String[]{builddate}), x, y += fh);
+ g.drawString(MessageManager.formatMessage(
+ "label.jaview_build_date", new String[]
+ { builddate }), x, y += fh);
g.setFont(new Font("Helvetica", Font.PLAIN, 12));
- g.drawString(
- MessageManager.getString("label.jalview_authors_1"),
+ g.drawString(MessageManager.getString("label.jalview_authors_1"),
x, y += fh * 1.5);
- g.drawString(MessageManager.getString("label.jalview_authors_2"), x + 50, y += fh+8);
- g.drawString(
- MessageManager.getString("label.jalview_dev_managers"),
- x, y += fh);
+ g.drawString(MessageManager.getString("label.jalview_authors_2"),
+ x + 50, y += fh + 8);
g.drawString(
- MessageManager.getString("label.jalview_distribution_lists"),
- x, y += fh);
- g.drawString(MessageManager.getString("label.jalview_please_cite"), x, y += fh + 8);
+ MessageManager.getString("label.jalview_dev_managers"), x,
+ y += fh);
+ g.drawString(MessageManager
+ .getString("label.jalview_distribution_lists"), x, y += fh);
+ g.drawString(MessageManager.getString("label.jalview_please_cite"),
+ x, y += fh + 8);
g.drawString(
MessageManager.getString("label.jalview_cite_1_authors"),
x, y += fh);
g.drawString(
- MessageManager.getString("label.jalview_cite_1_title"),
- x, y += fh);
+ MessageManager.getString("label.jalview_cite_1_title"), x,
+ y += fh);
g.drawString(MessageManager.getString("label.jalview_cite_1_ref"),
x, y += fh);
}
Frame frame = new Frame();
frame.add(new AboutPanel(JalviewLite.getVersion(), JalviewLite
.getBuildDate()));
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.jalview"), 580, 220);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.jalview"), 580, 220);
}
Menu fileMenu = new Menu(MessageManager.getString("action.file"));
- MenuItem loadApplication = new MenuItem(MessageManager.getString("label.view_full_application"));
+ MenuItem loadApplication = new MenuItem(
+ MessageManager.getString("label.view_full_application"));
- MenuItem loadTree = new MenuItem(MessageManager.getString("label.load_associated_tree"));
+ MenuItem loadTree = new MenuItem(
+ MessageManager.getString("label.load_associated_tree"));
- MenuItem loadAnnotations = new MenuItem(MessageManager.getString("label.load_features_annotations"));
+ MenuItem loadAnnotations = new MenuItem(
+ MessageManager.getString("label.load_features_annotations"));
- MenuItem outputFeatures = new MenuItem(MessageManager.getString("label.export_features"));
+ MenuItem outputFeatures = new MenuItem(
+ MessageManager.getString("label.export_features"));
- MenuItem outputAnnotations = new MenuItem(MessageManager.getString("label.export_annotations"));
+ MenuItem outputAnnotations = new MenuItem(
+ MessageManager.getString("label.export_annotations"));
- MenuItem closeMenuItem = new MenuItem(MessageManager.getString("action.close"));
+ MenuItem closeMenuItem = new MenuItem(
+ MessageManager.getString("action.close"));
Menu editMenu = new Menu(MessageManager.getString("action.edit"));
Menu colourMenu = new Menu(MessageManager.getString("action.colour"));
- Menu calculateMenu = new Menu(MessageManager.getString("action.calculate"));
+ Menu calculateMenu = new Menu(
+ MessageManager.getString("action.calculate"));
- MenuItem selectAllSequenceMenuItem = new MenuItem(MessageManager.getString("action.select_all"));
+ MenuItem selectAllSequenceMenuItem = new MenuItem(
+ MessageManager.getString("action.select_all"));
- MenuItem deselectAllSequenceMenuItem = new MenuItem(MessageManager.getString("action.deselect_all"));
+ MenuItem deselectAllSequenceMenuItem = new MenuItem(
+ MessageManager.getString("action.deselect_all"));
- MenuItem invertSequenceMenuItem = new MenuItem(MessageManager.getString("action.invert_selection"));
+ MenuItem invertSequenceMenuItem = new MenuItem(
+ MessageManager.getString("action.invert_selection"));
MenuItem remove2LeftMenuItem = new MenuItem();
CheckboxMenuItem displayNonconservedMenuItem = new CheckboxMenuItem();
- MenuItem alProperties = new MenuItem(MessageManager.getString("label.alignment_props"));
+ MenuItem alProperties = new MenuItem(
+ MessageManager.getString("label.alignment_props"));
MenuItem overviewMenuItem = new MenuItem();
selectAllSequenceMenuItem.addActionListener(this);
deselectAllSequenceMenuItem.addActionListener(this);
invertSequenceMenuItem.addActionListener(this);
- remove2LeftMenuItem.setLabel(MessageManager.getString("action.remove_left"));
+ remove2LeftMenuItem.setLabel(MessageManager
+ .getString("action.remove_left"));
remove2LeftMenuItem.addActionListener(this);
- remove2RightMenuItem.setLabel(MessageManager.getString("action.remove_right"));
+ remove2RightMenuItem.setLabel(MessageManager
+ .getString("action.remove_right"));
remove2RightMenuItem.addActionListener(this);
- removeGappedColumnMenuItem.setLabel(MessageManager.getString("action.remove_empty_columns"));
+ removeGappedColumnMenuItem.setLabel(MessageManager
+ .getString("action.remove_empty_columns"));
removeGappedColumnMenuItem.addActionListener(this);
- removeAllGapsMenuItem.setLabel(MessageManager.getString("action.remove_all_gaps"));
+ removeAllGapsMenuItem.setLabel(MessageManager
+ .getString("action.remove_all_gaps"));
removeAllGapsMenuItem.addActionListener(this);
viewBoxesMenuItem.setLabel(MessageManager.getString("action.boxes"));
viewBoxesMenuItem.setState(true);
viewTextMenuItem.setLabel(MessageManager.getString("action.text"));
viewTextMenuItem.setState(true);
viewTextMenuItem.addItemListener(this);
- sortPairwiseMenuItem.setLabel(MessageManager.getString("action.by_pairwise_id"));
+ sortPairwiseMenuItem.setLabel(MessageManager
+ .getString("action.by_pairwise_id"));
sortPairwiseMenuItem.addActionListener(this);
sortIDMenuItem.setLabel(MessageManager.getString("action.by_id"));
sortIDMenuItem.addActionListener(this);
- sortLengthMenuItem.setLabel(MessageManager.getString("action.by_length"));
+ sortLengthMenuItem.setLabel(MessageManager
+ .getString("action.by_length"));
sortLengthMenuItem.addActionListener(this);
sortGroupMenuItem.setLabel(MessageManager.getString("action.by_group"));
sortGroupMenuItem.addActionListener(this);
- removeRedundancyMenuItem.setLabel(MessageManager.getString("action.remove_redundancy"));
+ removeRedundancyMenuItem.setLabel(MessageManager
+ .getString("action.remove_redundancy"));
removeRedundancyMenuItem.addActionListener(this);
- pairwiseAlignmentMenuItem.setLabel(MessageManager.getString("action.pairwise_alignment"));
+ pairwiseAlignmentMenuItem.setLabel(MessageManager
+ .getString("action.pairwise_alignment"));
pairwiseAlignmentMenuItem.addActionListener(this);
- PCAMenuItem.setLabel(MessageManager.getString("label.principal_component_analysis"));
+ PCAMenuItem.setLabel(MessageManager
+ .getString("label.principal_component_analysis"));
PCAMenuItem.addActionListener(this);
- averageDistanceTreeMenuItem
- .setLabel(MessageManager.getString("label.average_distance_identity"));
+ averageDistanceTreeMenuItem.setLabel(MessageManager
+ .getString("label.average_distance_identity"));
averageDistanceTreeMenuItem.addActionListener(this);
- neighbourTreeMenuItem.setLabel(MessageManager.getString("label.neighbour_joining_identity"));
+ neighbourTreeMenuItem.setLabel(MessageManager
+ .getString("label.neighbour_joining_identity"));
neighbourTreeMenuItem.addActionListener(this);
statusBar.setBackground(Color.white);
statusBar.setFont(new java.awt.Font("Verdana", 0, 11));
statusBar.setText(MessageManager.getString("label.status_bar"));
- outputTextboxMenu.setLabel(MessageManager.getString("label.out_to_textbox"));
+ outputTextboxMenu.setLabel(MessageManager
+ .getString("label.out_to_textbox"));
clustalColour.setLabel(MessageManager.getString("label.clustalx"));
clustalColour.addActionListener(this);
zappoColour.addActionListener(this);
taylorColour.setLabel(MessageManager.getString("label.taylor"));
taylorColour.addActionListener(this);
- hydrophobicityColour.setLabel(MessageManager.getString("label.hydrophobicity"));
+ hydrophobicityColour.setLabel(MessageManager
+ .getString("label.hydrophobicity"));
hydrophobicityColour.addActionListener(this);
- helixColour.setLabel(MessageManager.getString("label.helix_propensity"));
+ helixColour
+ .setLabel(MessageManager.getString("label.helix_propensity"));
helixColour.addActionListener(this);
- strandColour.setLabel(MessageManager.getString("label.strand_propensity"));
+ strandColour.setLabel(MessageManager
+ .getString("label.strand_propensity"));
strandColour.addActionListener(this);
turnColour.setLabel(MessageManager.getString("label.turn_propensity"));
turnColour.addActionListener(this);
buriedColour.setLabel(MessageManager.getString("label.buried_index"));
buriedColour.addActionListener(this);
- purinePyrimidineColour.setLabel(MessageManager.getString("label.purine_pyrimidine"));
+ purinePyrimidineColour.setLabel(MessageManager
+ .getString("label.purine_pyrimidine"));
purinePyrimidineColour.addActionListener(this);
- RNAInteractionColour.setLabel(MessageManager.getString("label.rna_interaction"));
+ RNAInteractionColour.setLabel(MessageManager
+ .getString("label.rna_interaction"));
RNAInteractionColour.addActionListener(this);
- RNAHelixColour.setLabel(MessageManager.getString("action.by_rna_helixes"));
+ RNAHelixColour.setLabel(MessageManager
+ .getString("action.by_rna_helixes"));
RNAHelixColour.addActionListener(this);
- userDefinedColour.setLabel(MessageManager.getString("action.user_defined"));
+ userDefinedColour.setLabel(MessageManager
+ .getString("action.user_defined"));
userDefinedColour.addActionListener(this);
- PIDColour.setLabel(MessageManager.getString("label.percentage_identity"));
+ PIDColour.setLabel(MessageManager
+ .getString("label.percentage_identity"));
PIDColour.addActionListener(this);
- BLOSUM62Colour.setLabel(MessageManager.getString("label.blosum62_score"));
+ BLOSUM62Colour.setLabel(MessageManager
+ .getString("label.blosum62_score"));
BLOSUM62Colour.addActionListener(this);
- tcoffeeColour.setLabel(MessageManager.getString("label.tcoffee_scores"));
+ tcoffeeColour
+ .setLabel(MessageManager.getString("label.tcoffee_scores"));
tcoffeeColour.setEnabled(false); // it will enabled only if a score file is
// provided
tcoffeeColour.addActionListener(this);
- avDistanceTreeBlosumMenuItem
- .setLabel(MessageManager.getString("label.average_distance_bloslum62"));
+ avDistanceTreeBlosumMenuItem.setLabel(MessageManager
+ .getString("label.average_distance_bloslum62"));
avDistanceTreeBlosumMenuItem.addActionListener(this);
- njTreeBlosumMenuItem.setLabel(MessageManager.getString("label.neighbour_blosum62"));
+ njTreeBlosumMenuItem.setLabel(MessageManager
+ .getString("label.neighbour_blosum62"));
njTreeBlosumMenuItem.addActionListener(this);
- annotationPanelMenuItem.setLabel(MessageManager.getString("label.show_annotations"));
+ annotationPanelMenuItem.setLabel(MessageManager
+ .getString("label.show_annotations"));
annotationPanelMenuItem.addItemListener(this);
- colourTextMenuItem.setLabel(MessageManager.getString("label.colour_text"));
+ colourTextMenuItem.setLabel(MessageManager
+ .getString("label.colour_text"));
colourTextMenuItem.addItemListener(this);
- displayNonconservedMenuItem.setLabel(MessageManager.getString("label.show_non_conversed"));
+ displayNonconservedMenuItem.setLabel(MessageManager
+ .getString("label.show_non_conversed"));
displayNonconservedMenuItem.addItemListener(this);
alProperties.addActionListener(this);
- overviewMenuItem.setLabel(MessageManager.getString("label.overview_window"));
+ overviewMenuItem.setLabel(MessageManager
+ .getString("label.overview_window"));
overviewMenuItem.addActionListener(this);
undoMenuItem.setEnabled(false);
undoMenuItem.setLabel(MessageManager.getString("action.undo"));
redoMenuItem.setEnabled(false);
redoMenuItem.setLabel(MessageManager.getString("action.redo"));
redoMenuItem.addActionListener(this);
- conservationMenuItem.setLabel(MessageManager.getString("action.by_conservation"));
+ conservationMenuItem.setLabel(MessageManager
+ .getString("action.by_conservation"));
conservationMenuItem.addItemListener(this);
noColourmenuItem.setLabel(MessageManager.getString("label.none"));
noColourmenuItem.addActionListener(this);
wrapMenuItem.setLabel(MessageManager.getString("action.wrap"));
wrapMenuItem.addItemListener(this);
- renderGapsMenuItem.setLabel(MessageManager.getString("action.show_gaps"));
+ renderGapsMenuItem.setLabel(MessageManager
+ .getString("action.show_gaps"));
renderGapsMenuItem.setState(true);
renderGapsMenuItem.addItemListener(this);
findMenuItem.setLabel(MessageManager.getString("action.find"));
findMenuItem.addActionListener(this);
- abovePIDThreshold.setLabel(MessageManager.getString("label.above_identity_threshold"));
+ abovePIDThreshold.setLabel(MessageManager
+ .getString("label.above_identity_threshold"));
abovePIDThreshold.addItemListener(this);
nucleotideColour.setLabel(MessageManager.getString("label.nucleotide"));
nucleotideColour.addActionListener(this);
- deleteGroups.setLabel(MessageManager.getString("action.undefine_groups"));
+ deleteGroups.setLabel(MessageManager
+ .getString("action.undefine_groups"));
deleteGroups.addActionListener(this);
- grpsFromSelection.setLabel(MessageManager.getString("action.make_groups_selection"));
+ grpsFromSelection.setLabel(MessageManager
+ .getString("action.make_groups_selection"));
grpsFromSelection.addActionListener(this);
createGroup.setLabel(MessageManager.getString("action.create_group"));
unGroup.setLabel(MessageManager.getString("action.remove_group"));
pasteNew.addActionListener(this);
pasteThis.setLabel(MessageManager.getString("label.to_this_alignment"));
pasteThis.addActionListener(this);
- applyToAllGroups.setLabel(MessageManager.getString("label.apply_colour_to_all_groups"));
+ applyToAllGroups.setLabel(MessageManager
+ .getString("label.apply_colour_to_all_groups"));
applyToAllGroups.setState(true);
applyToAllGroups.addItemListener(this);
font.setLabel(MessageManager.getString("action.font"));
scaleRight.setState(true);
scaleRight.setLabel(MessageManager.getString("action.scale_right"));
scaleRight.addItemListener(this);
- modifyPID.setLabel(MessageManager.getString("label.modify_identity_thereshold"));
+ modifyPID.setLabel(MessageManager
+ .getString("label.modify_identity_thereshold"));
modifyPID.addActionListener(this);
- modifyConservation.setLabel(MessageManager.getString("label.modify_conservation_thereshold"));
+ modifyConservation.setLabel(MessageManager
+ .getString("label.modify_conservation_thereshold"));
modifyConservation.addActionListener(this);
- sortByTreeMenu.setLabel(MessageManager.getString("action.by_tree_order"));
+ sortByTreeMenu.setLabel(MessageManager
+ .getString("action.by_tree_order"));
sort.setLabel(MessageManager.getString("action.sort"));
calculate.setLabel(MessageManager.getString("action.calculate_tree"));
autoCalculate.addItemListener(this);
sortByTree.addItemListener(this);
- inputText.setLabel(MessageManager.getString("label.input_from_textbox"));
+ inputText
+ .setLabel(MessageManager.getString("label.input_from_textbox"));
inputText.addActionListener(this);
- centreColumnLabelFlag.setLabel(MessageManager.getString("label.centre_column_labels"));
+ centreColumnLabelFlag.setLabel(MessageManager
+ .getString("label.centre_column_labels"));
centreColumnLabelFlag.addItemListener(this);
- followMouseOverFlag.setLabel(MessageManager.getString("label.automatic_scrolling"));
+ followMouseOverFlag.setLabel(MessageManager
+ .getString("label.automatic_scrolling"));
followMouseOverFlag.addItemListener(this);
helpMenu.setLabel(MessageManager.getString("action.help"));
documentation.setLabel(MessageManager.getString("label.documentation"));
about.setLabel(MessageManager.getString("label.about"));
about.addActionListener(this);
seqLimits.setState(true);
- seqLimits.setLabel(MessageManager.getString("label.show_sequence_limits"));
+ seqLimits.setLabel(MessageManager
+ .getString("label.show_sequence_limits"));
seqLimits.addItemListener(this);
- featureSettings.setLabel(MessageManager.getString("label.feature_settings"));
+ featureSettings.setLabel(MessageManager
+ .getString("label.feature_settings"));
featureSettings.addActionListener(this);
- sequenceFeatures.setLabel(MessageManager.getString("label.sequence_features"));
+ sequenceFeatures.setLabel(MessageManager
+ .getString("label.sequence_features"));
sequenceFeatures.addItemListener(this);
sequenceFeatures.setState(false);
- annotationColour.setLabel(MessageManager.getString("action.by_annotation"));
+ annotationColour.setLabel(MessageManager
+ .getString("action.by_annotation"));
annotationColour.addActionListener(this);
- invertSequenceMenuItem.setLabel(MessageManager.getString("action.invert_sequence_selection"));
- invertColSel.setLabel(MessageManager.getString("action.invert_column_selection"));
+ invertSequenceMenuItem.setLabel(MessageManager
+ .getString("action.invert_sequence_selection"));
+ invertColSel.setLabel(MessageManager
+ .getString("action.invert_column_selection"));
menu1.setLabel(MessageManager.getString("action.show"));
showColumns.setLabel(MessageManager.getString("label.all_columns"));
showSeqs.setLabel(MessageManager.getString("label.all_sequences"));
menu2.setLabel(MessageManager.getString("action.hide"));
- hideColumns.setLabel(MessageManager.getString("label.selected_columns"));
- hideSequences.setLabel(MessageManager.getString("label.selected_sequences"));
- hideAllButSelection.setLabel(MessageManager.getString("label.all_but_selected_region"));
- hideAllSelection.setLabel(MessageManager.getString("label.selected_region"));
- showAllHidden.setLabel(MessageManager.getString("label.all_sequences_columns"));
- showGroupConsensus.setLabel(MessageManager.getString("label.group_consensus"));
- showGroupConservation.setLabel(MessageManager.getString("label.group_conservation"));
- showConsensusHistogram.setLabel(MessageManager.getString("label.show_consensus_histogram"));
- showSequenceLogo.setLabel(MessageManager.getString("label.show_consensus_logo"));
- normSequenceLogo.setLabel(MessageManager.getString("label.norm_consensus_logo"));
- applyAutoAnnotationSettings.setLabel(MessageManager.getString("label.apply_all_groups"));
+ hideColumns
+ .setLabel(MessageManager.getString("label.selected_columns"));
+ hideSequences.setLabel(MessageManager
+ .getString("label.selected_sequences"));
+ hideAllButSelection.setLabel(MessageManager
+ .getString("label.all_but_selected_region"));
+ hideAllSelection.setLabel(MessageManager
+ .getString("label.selected_region"));
+ showAllHidden.setLabel(MessageManager
+ .getString("label.all_sequences_columns"));
+ showGroupConsensus.setLabel(MessageManager
+ .getString("label.group_consensus"));
+ showGroupConservation.setLabel(MessageManager
+ .getString("label.group_conservation"));
+ showConsensusHistogram.setLabel(MessageManager
+ .getString("label.show_consensus_histogram"));
+ showSequenceLogo.setLabel(MessageManager
+ .getString("label.show_consensus_logo"));
+ normSequenceLogo.setLabel(MessageManager
+ .getString("label.norm_consensus_logo"));
+ applyAutoAnnotationSettings.setLabel(MessageManager
+ .getString("label.apply_all_groups"));
applyAutoAnnotationSettings.setState(true);
- autoAnnMenu.setLabel(MessageManager.getString("label.autocalculated_annotation"));
+ autoAnnMenu.setLabel(MessageManager
+ .getString("label.autocalculated_annotation"));
invertColSel.addActionListener(this);
showColumns.addActionListener(this);
colourMenu.add(buriedColour);
colourMenu.add(nucleotideColour);
colourMenu.add(purinePyrimidineColour);
- // colourMenu.add(RNAInteractionColour);
+ // colourMenu.add(RNAInteractionColour);
colourMenu.add(tcoffeeColour);
colourMenu.add(userDefinedColour);
colourMenu.addSeparator();
}
-
- public void setStatus(String string) {
+ public void setStatus(String string)
+ {
statusBar.setText(string);
};
{
annotationSpaceFillerHolder.setVisible(b);
annotationPanelHolder.setVisible(b);
- } else {
+ }
+ else
+ {
annotationSpaceFillerHolder.setVisible(false);
annotationPanelHolder.setVisible(false);
}
if (adjustPanelHeight)
{
- // NOTE: this logic is different in the application. Need a better algorithm to define behaviour
+ // NOTE: this logic is different in the application. Need a better
+ // algorithm to define behaviour
// sets initial preferred height
// try and set height according to alignment
- float sscaling = (float) ((av.getCharHeight() * av.getAlignment().getHeight())/(1.0*mheight));
+ float sscaling = (float) ((av.getCharHeight() * av.getAlignment()
+ .getHeight()) / (1.0 * mheight));
if (sscaling > 0.5)
{
// if the alignment is too big then
}
else
{
- // otherwise just set the panel so that one row of sequence is visible
+ // otherwise just set the panel so that one row of sequence is visible
height = -av.getCharHeight() * 1
+ (int) (seqandannot * (1 - sscaling));
}
annotationPanelHolder.setVisible(true);
annotationSpaceFillerHolder.setVisible(true);
}
-
+
idSpaceFillerPanel1.setVisible(!wrap);
fontChanged(); // This is so that the scalePanel is resized correctly
seqPanel.seqCanvas.repaint();
idPanel.idCanvas.repaint();
- if (!av.wrapAlignment)
+ if (!av.wrapAlignment)
{
if (av.showAnnotation)
{
}
scalePanel.repaint();
}
-
+
}
protected Panel sequenceHolderPanel = new Panel();
if (oldcs instanceof AnnotationColourGradient)
{
AnnotationColourGradient acg = (AnnotationColourGradient) oldcs;
- currentColours.setState(acg.isPredefinedColours() || acg.getBaseColour()!=null);
- if (!acg.isPredefinedColours() && acg.getBaseColour()==null)
+ currentColours.setState(acg.isPredefinedColours()
+ || acg.getBaseColour() != null);
+ if (!acg.isPredefinedColours() && acg.getBaseColour() == null)
{
minColour.setBackground(acg.getMinColour());
maxColour.setBackground(acg.getMaxColour());
// seqAssociated.setState(acg.isSeqAssociated());
}
-
Vector list = new Vector();
int index = 1;
for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
annotations.addItem(list.elementAt(i).toString());
}
- threshold.addItem(MessageManager.getString("label.threshold_feature_no_thereshold"));
- threshold.addItem(MessageManager.getString("label.threshold_feature_above_thereshold"));
- threshold.addItem(MessageManager.getString("label.threshold_feature_below_thereshold"));
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_no_thereshold"));
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_above_thereshold"));
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_below_thereshold"));
if (oldcs instanceof AnnotationColourGradient)
{
frame = new Frame();
frame.add(this);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.colour_by_annotation"), 560,
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.colour_by_annotation"), 560,
175);
validate();
}
thresholdValue.setEnabled(false);
thresholdValue.setColumns(5);
currentColours.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- currentColours.setLabel(MessageManager.getString("label.use_original_colours"));
+ currentColours.setLabel(MessageManager
+ .getString("label.use_original_colours"));
currentColours.addItemListener(this);
thresholdIsMin.setBackground(Color.white);
- thresholdIsMin.setLabel(MessageManager.getString("label.threshold_minmax"));
+ thresholdIsMin.setLabel(MessageManager
+ .getString("label.threshold_minmax"));
this.setLayout(borderLayout1);
.getSelectedIndex()];
int aboveThreshold = -1;
- if (threshold.getSelectedIndex()==1)
+ if (threshold.getSelectedIndex() == 1)
{
aboveThreshold = AnnotationColourGradient.ABOVE_THRESHOLD;
}
- else if (threshold.getSelectedIndex()==2)
+ else if (threshold.getSelectedIndex() == 2)
{
aboveThreshold = AnnotationColourGradient.BELOW_THRESHOLD;
}
if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
{
- PopupMenu popup = new PopupMenu(MessageManager.getString("label.annotations"));
+ PopupMenu popup = new PopupMenu(
+ MessageManager.getString("label.annotations"));
MenuItem item = new MenuItem(ADDNEW);
item.addActionListener(this);
{
g.setColor(Color.black);
g.drawString(MessageManager.getString("label.right_click"), 2, 8);
- g.drawString(MessageManager.getString("label.to_add_annotation"), 2, 18);
+ g.drawString(MessageManager.getString("label.to_add_annotation"), 2,
+ 18);
}
}
}
aa[activeRow].hasText = true;
if (evt.getActionCommand().equals(STEM))
{
- aa[activeRow].showAllColLabels=true;
+ aa[activeRow].showAllColLabels = true;
}
}
return;
}
- PopupMenu pop = new PopupMenu(MessageManager.getString("label.structure_type"));
+ PopupMenu pop = new PopupMenu(
+ MessageManager.getString("label.structure_type"));
MenuItem item;
/*
* Just display the needed structure options
g.setColor(Color.black);
if (av.validCharWidth)
{
- g.drawString(MessageManager.getString("label.alignment_has_no_annotations"), 20, 15);
+ g.drawString(MessageManager
+ .getString("label.alignment_has_no_annotations"), 20, 15);
}
return;
{
return imgWidth;
}
+
private int[] bounds = new int[2];
+
@Override
public int[] getVisibleVRange()
{
- if (ap!=null && ap.alabels!=null)
+ if (ap != null && ap.alabels != null)
{
- int sOffset=-ap.alabels.scrollOffset;
- int visHeight = sOffset+ap.annotationPanelHolder.getHeight();
- bounds[0] = sOffset; bounds[1]=visHeight;
- return bounds;
- } else return null;
+ int sOffset = -ap.alabels.scrollOffset;
+ int visHeight = sOffset + ap.annotationPanelHolder.getHeight();
+ bounds[0] = sOffset;
+ bounds[1] = visHeight;
+ return bounds;
+ }
+ else
+ return null;
}
}
Menu helpMenu = new Menu(MessageManager.getString("action.help"));
- MenuItem mappingMenuItem = new MenuItem(MessageManager.getString("label.view_mapping"));
+ MenuItem mappingMenuItem = new MenuItem(
+ MessageManager.getString("label.view_mapping"));
- CheckboxMenuItem seqColour = new CheckboxMenuItem(MessageManager.getString("action.by_sequence"), true);
+ CheckboxMenuItem seqColour = new CheckboxMenuItem(
+ MessageManager.getString("action.by_sequence"), true);
- CheckboxMenuItem jmolColour = new CheckboxMenuItem(MessageManager.getString("action.using_jmol"), false);
+ CheckboxMenuItem jmolColour = new CheckboxMenuItem(
+ MessageManager.getString("action.using_jmol"), false);
MenuItem chain = new MenuItem(MessageManager.getString("action.by_chain"));
- MenuItem charge = new MenuItem(MessageManager.getString("label.charge_cysteine"));
+ MenuItem charge = new MenuItem(
+ MessageManager.getString("label.charge_cysteine"));
MenuItem zappo = new MenuItem(MessageManager.getString("label.zappo"));
MenuItem taylor = new MenuItem(MessageManager.getString("label.taylor"));
- MenuItem hydro = new MenuItem(MessageManager.getString("label.hydrophobicity"));
+ MenuItem hydro = new MenuItem(
+ MessageManager.getString("label.hydrophobicity"));
- MenuItem helix = new MenuItem(MessageManager.getString("label.helix_propensity"));
+ MenuItem helix = new MenuItem(
+ MessageManager.getString("label.helix_propensity"));
- MenuItem strand = new MenuItem(MessageManager.getString("label.strand_propensity"));
+ MenuItem strand = new MenuItem(
+ MessageManager.getString("label.strand_propensity"));
- MenuItem turn = new MenuItem(MessageManager.getString("label.turn_propensity"));
+ MenuItem turn = new MenuItem(
+ MessageManager.getString("label.turn_propensity"));
- MenuItem buried = new MenuItem(MessageManager.getString("label.buried_index"));
+ MenuItem buried = new MenuItem(
+ MessageManager.getString("label.buried_index"));
- MenuItem purinepyrimidine = new MenuItem(MessageManager.getString("label.purine_pyrimidine"));
+ MenuItem purinepyrimidine = new MenuItem(
+ MessageManager.getString("label.purine_pyrimidine"));
- MenuItem user = new MenuItem(MessageManager.getString("label.user_defined_colours"));
+ MenuItem user = new MenuItem(
+ MessageManager.getString("label.user_defined_colours"));
- MenuItem jmolHelp = new MenuItem(MessageManager.getString("label.jmol_help"));
+ MenuItem jmolHelp = new MenuItem(
+ MessageManager.getString("label.jmol_help"));
Panel scriptWindow;
.println("Out of memory when trying to create dialog box with sequence-structure mapping.");
return;
}
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.pdb_sequence_mapping"),
- 550, 600);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.pdb_sequence_mapping"), 550,
+ 600);
}
else if (evt.getSource() == charge)
{
g.fillRect(0, 0, currentSize.width, currentSize.height);
g.setColor(Color.white);
g.setFont(new Font("Verdana", Font.BOLD, 14));
- g.drawString(MessageManager.getString("label.retrieving_pdb_data"), 20, currentSize.height / 2);
+ g.drawString(MessageManager.getString("label.retrieving_pdb_data"),
+ 20, currentSize.height / 2);
}
else
{
{
// TODO: JAL-1102 - should have a warning message in dialog, not simply
// overwrite the broken input data with the exception
- textarea.setText(MessageManager.formatMessage("label.could_not_parse_newick_file", new String[]{ex.getMessage()}));
+ textarea.setText(MessageManager.formatMessage(
+ "label.could_not_parse_newick_file", new String[]
+ { ex.getMessage() }));
return;
}
}
alignFrame.changeColour(new TCoffeeColourScheme(
alignFrame.viewport.getAlignment()));
alignFrame.statusBar
- .setText(MessageManager.getString("label.successfully_pasted_tcoffee_scores_to_alignment"));
+ .setText(MessageManager
+ .getString("label.successfully_pasted_tcoffee_scores_to_alignment"));
}
else
{
// file valid but didn't get added to alignment for some reason
- alignFrame.statusBar.setText(MessageManager.formatMessage("label.failed_add_tcoffee_scores", new String[]{(tcf.getWarningMessage() != null ? tcf.getWarningMessage() : "")}));
+ alignFrame.statusBar.setText(MessageManager.formatMessage(
+ "label.failed_add_tcoffee_scores",
+ new String[]
+ { (tcf.getWarningMessage() != null ? tcf
+ .getWarningMessage() : "") }));
}
}
else
alignFrame.alignPanel.fontChanged();
alignFrame.alignPanel.setScrollValues(0, 0);
alignFrame.statusBar
- .setText(MessageManager.getString("label.successfully_pasted_annotation_to_alignment"));
+ .setText(MessageManager
+ .getString("label.successfully_pasted_annotation_to_alignment"));
}
else
jalview.io.AppletFormatAdapter.PASTE))
{
alignFrame.statusBar
- .setText(MessageManager.getString("label.couldnt_parse_pasted_text_as_valid_annotation_feature_GFF_tcoffee_file"));
+ .setText(MessageManager
+ .getString("label.couldnt_parse_pasted_text_as_valid_annotation_feature_GFF_tcoffee_file"));
}
}
}
{
AlignFrame af = new AlignFrame(al, alignFrame.viewport.applet,
"Cut & Paste input - " + format, false);
- af.statusBar.setText(MessageManager.getString("label.successfully_pasted_annotation_to_alignment"));
+ af.statusBar
+ .setText(MessageManager
+ .getString("label.successfully_pasted_annotation_to_alignment"));
}
else
{
alignFrame.addSequences(al.getSequencesArray());
- alignFrame.statusBar
- .setText(MessageManager.getString("label.successfully_pasted_alignment_file"));
+ alignFrame.statusBar.setText(MessageManager
+ .getString("label.successfully_pasted_alignment_file"));
}
}
}
private void jbInit() throws Exception
{
textarea.setFont(new java.awt.Font("Monospaced", Font.PLAIN, 10));
- textarea.setText(MessageManager.getString("label.paste_your_alignment_file"));
+ textarea.setText(MessageManager
+ .getString("label.paste_your_alignment_file"));
textarea.addMouseListener(this);
this.setLayout(borderLayout1);
accept.addActionListener(this);
public void mousePressed(MouseEvent evt)
{
- if (textarea.getText().startsWith(MessageManager.getString("label.paste_your")))
+ if (textarea.getText().startsWith(
+ MessageManager.getString("label.paste_your")))
{
textarea.setText("");
}
slider.addAdjustmentListener(this);
slider.addMouseListener(this);
owner = (af != null) ? af : fs.frame;
- frame = new JVDialog(owner, MessageManager.formatMessage("label.graduated_color_for_params", new String[]{type}),
- true, 480, 248);
+ frame = new JVDialog(owner, MessageManager.formatMessage(
+ "label.graduated_color_for_params", new String[]
+ { type }), true, 480, 248);
frame.setMainPanel(this);
validate();
frame.setVisible(true);
private void jbInit() throws Exception
{
- Label minLabel = new Label(MessageManager.getString("label.min")), maxLabel = new Label(MessageManager.getString("label.max"));
+ Label minLabel = new Label(MessageManager.getString("label.min")), maxLabel = new Label(
+ MessageManager.getString("label.max"));
minLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
maxLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
// minColour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
jPanel2.setBackground(Color.white);
jPanel4.setBackground(Color.white);
threshold.addItemListener(this);
- threshold.addItem(MessageManager.getString("label.threshold_feature_no_thereshold"));
- threshold.addItem(MessageManager.getString("label.threshold_feature_above_thereshold"));
- threshold.addItem(MessageManager.getString("label.threshold_feature_below_thereshold"));
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_no_thereshold"));
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_above_thereshold"));
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_below_thereshold"));
thresholdValue.addActionListener(this);
slider.setBackground(Color.white);
slider.setEnabled(false);
jPanel3.setBackground(Color.white);
colourFromLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 11));
- colourFromLabel.setLabel(MessageManager.getString("label.colour_by_label"));
+ colourFromLabel.setLabel(MessageManager
+ .getString("label.colour_by_label"));
colourFromLabel.setSize(new Dimension(139, 22));
// threshold.setBounds(new Rectangle(11, 3, 139, 22));
thresholdIsMin.setBackground(Color.white);
- thresholdIsMin.setLabel(MessageManager.getString("label.threshold_minmax"));
+ thresholdIsMin.setLabel(MessageManager
+ .getString("label.threshold_minmax"));
thresholdIsMin.setSize(new Dimension(135, 23));
// thresholdIsMin.setBounds(new Rectangle(328, 3, 135, 23));
jPanel1.add(minLabel);
}
int aboveThreshold = AnnotationColourGradient.NO_THRESHOLD;
- if (threshold.getSelectedIndex()==1)
+ if (threshold.getSelectedIndex() == 1)
{
aboveThreshold = AnnotationColourGradient.ABOVE_THRESHOLD;
}
- else if (threshold.getSelectedIndex()==2)
+ else if (threshold.getSelectedIndex() == 2)
{
aboveThreshold = AnnotationColourGradient.BELOW_THRESHOLD;
}
height = Math.max(200, height);
height = Math.min(400, height);
int width = 300;
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.feature_settings"), width,
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.feature_settings"), width,
height);
}
public void paint(Graphics g)
{
g.setColor(Color.black);
- g.drawString(MessageManager.getString("label.no_features_added_to_this_alignment"), 10, 20);
- g.drawString(MessageManager.getString("label.features_can_be_added_from_searches_1"), 10, 40);
- g.drawString(MessageManager.getString("label.features_can_be_added_from_searches_2"), 10, 60);
+ g.drawString(MessageManager
+ .getString("label.no_features_added_to_this_alignment"), 10, 20);
+ g.drawString(MessageManager
+ .getString("label.features_can_be_added_from_searches_1"), 10,
+ 40);
+ g.drawString(MessageManager
+ .getString("label.features_can_be_added_from_searches_2"), 10,
+ 60);
}
protected void popupSort(final MyCheckbox check, final Hashtable minmax,
{
final String type = check.type;
final Object typeCol = fr.getFeatureStyle(type);
- java.awt.PopupMenu men = new PopupMenu(MessageManager.formatMessage("label.settings_for_type", new String[]{type}));
- java.awt.MenuItem scr = new MenuItem(MessageManager.getString("label.sort_by_score"));
+ java.awt.PopupMenu men = new PopupMenu(MessageManager.formatMessage(
+ "label.settings_for_type", new String[]
+ { type }));
+ java.awt.MenuItem scr = new MenuItem(
+ MessageManager.getString("label.sort_by_score"));
men.add(scr);
final FeatureSettings me = this;
scr.addActionListener(new ActionListener()
}
});
- MenuItem dens = new MenuItem(MessageManager.getString("label.sort_by_density"));
+ MenuItem dens = new MenuItem(
+ MessageManager.getString("label.sort_by_density"));
dens.addActionListener(new ActionListener()
{
this.ap = ap;
frame = new Frame();
frame.add(this);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("action.find"), 340, 120);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("action.find"), 340, 120);
frame.repaint();
frame.addWindowListener(new WindowAdapter()
{
// 'SelectRegion' selection
if (!haveResults)
{
- ap.alignFrame.statusBar.setText(MessageManager.getString("label.finished_searching"));
+ ap.alignFrame.statusBar.setText(MessageManager
+ .getString("label.finished_searching"));
resIndex = -1;
seqIndex = 0;
}
{
message += searchResults.getSize() + " subsequence matches.";
}
- ap.alignFrame.statusBar.setText(MessageManager.formatMessage("label.search_results", new String[] {searchString, message}));
+ ap.alignFrame.statusBar.setText(MessageManager.formatMessage(
+ "label.search_results", new String[]
+ { searchString, message }));
}
else
{
// TODO: indicate sequence and matching position in status bar
- ap.alignFrame.statusBar.setText(MessageManager.formatMessage("label.found_match_for", new String[]{searchString}));
+ ap.alignFrame.statusBar.setText(MessageManager.formatMessage(
+ "label.found_match_for", new String[]
+ { searchString }));
}
}
}
Frame frame = new Frame();
this.frame = frame;
frame.add(this);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("action.change_font"), 440, 115);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("action.change_font"), 440, 115);
init = false;
}
fontName.select(lastSelected.getName());
fontStyle.select(lastSelStyle);
fontSize.select("" + lastSelSize);
- JVDialog d = new JVDialog(this.frame, MessageManager.getString("label.invalid_font"), true, 350, 200);
+ JVDialog d = new JVDialog(this.frame,
+ MessageManager.getString("label.invalid_font"), true, 350,
+ 200);
Panel mp = new Panel();
d.cancel.setVisible(false);
mp.setLayout(new FlowLayout());
embedMenuIfNeeded(rc);
add(rc, BorderLayout.CENTER);
- jalview.bin.JalviewLite.addFrame(this, MessageManager.getString("label.principal_component_analysis"),
+ jalview.bin.JalviewLite.addFrame(this,
+ MessageManager.getString("label.principal_component_analysis"),
475, 400);
Thread worker = new Thread(this);
CutAndPasteTransfer cap = new CutAndPasteTransfer(false, null);
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.pca_details"), 500, 500);
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.pca_details"), 500, 500);
cap.setText(pcaModel.getDetails());
}
values.setLabel(MessageManager.getString("label.output_values"));
values.addActionListener(this);
inputData.setLabel(MessageManager.getString("label.input_data"));
- nuclSetting.setLabel(MessageManager.getString("label.nucleotide_matrix"));
+ nuclSetting.setLabel(MessageManager
+ .getString("label.nucleotide_matrix"));
nuclSetting.addItemListener(this);
protSetting.setLabel(MessageManager.getString("label.protein_matrix"));
protSetting.addItemListener(this);
textarea.setFont(new java.awt.Font("Monospaced", 0, 12));
textarea.setText("");
viewInEditorButton.setFont(new java.awt.Font("Verdana", 0, 12));
- viewInEditorButton.setLabel(MessageManager.getString("label.view_alignment_editor"));
+ viewInEditorButton.setLabel(MessageManager
+ .getString("label.view_alignment_editor"));
viewInEditorButton.addActionListener(this);
this.add(scrollPane, BorderLayout.CENTER);
scrollPane.add(textarea);
applyButton.setVisible(true);
allGroupsCheck.setVisible(false);
- label.setText(MessageManager.getString("label.enter_redundancy_threshold"));
+ label.setText(MessageManager
+ .getString("label.enter_redundancy_threshold"));
valueField.setText("100");
slider.setVisibleAmount(1);
frame = new Frame();
frame.add(this);
- jalview.bin.JalviewLite.addFrame(frame,
- MessageManager.getString("label.redundancy_threshold_selection"), 400, 100);
+ jalview.bin.JalviewLite.addFrame(frame, MessageManager
+ .getString("label.redundancy_threshold_selection"), 400, 100);
frame.addWindowListener(this);
redundancy = AlignSeq.computeRedundancyMatrix(originalSequences,
omitHidden, start, end, false);
- label.setText(MessageManager.getString("label.enter_redundancy_threshold"));
+ label.setText(MessageManager
+ .getString("label.enter_redundancy_threshold"));
slider.setVisible(true);
applyButton.setEnabled(true);
valueField.setVisible(true);
if (points == null)
{
g.setFont(new Font("Verdana", Font.PLAIN, 18));
- g.drawString(MessageManager.getString("label.calculating_pca") + "....", 20, getSize().height / 2);
+ g.drawString(MessageManager.getString("label.calculating_pca")
+ + "....", 20, getSize().height / 2);
}
else
{
PopupMenu pop = new PopupMenu();
if (reveal != null)
{
- MenuItem item = new MenuItem(MessageManager.getString("label.reveal"));
+ MenuItem item = new MenuItem(
+ MessageManager.getString("label.reveal"));
item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
else if (av.getColumnSelection().contains(res))
{
- MenuItem item = new MenuItem(MessageManager.getString("label.hide_columns"));
+ MenuItem item = new MenuItem(
+ MessageManager.getString("label.hide_columns"));
item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
if (reveal != null && reveal[0] > startx && reveal[0] < endx)
{
- gg.drawString(MessageManager.getString("label.reveal_columns"), reveal[0] * av.charWidth, 0);
+ gg.drawString(MessageManager.getString("label.reveal_columns"),
+ reveal[0] * av.charWidth, 0);
}
}
keyboardNo1.append(value);
}
}
+
int getKeyboardNo1()
{
- try {
- if (keyboardNo1 != null)
+ try
{
- int value = Integer.parseInt(keyboardNo1.toString());
- keyboardNo1 = null;
- return value;
- }
+ if (keyboardNo1 != null)
+ {
+ int value = Integer.parseInt(keyboardNo1.toString());
+ keyboardNo1 = null;
+ return value;
+ }
} catch (Exception x)
- {}
+ {
+ }
keyboardNo1 = null;
return 1;
}
int getKeyboardNo2()
{
- try {
- if (keyboardNo2!=null){
- int value = Integer.parseInt(keyboardNo2.toString());
- keyboardNo2 = null;
- return value;
- }
+ try
+ {
+ if (keyboardNo2 != null)
+ {
+ int value = Integer.parseInt(keyboardNo2.toString());
+ keyboardNo2 = null;
+ return value;
+ }
} catch (Exception x)
- {}
+ {
+ }
keyboardNo2 = null;
return 1;
}
-
+
void setStatusMessage(SequenceI sequence, int res, int seq)
{
StringBuffer text = new StringBuffer("Sequence " + (seq + 1) + " ID: "
applyButton.setVisible(false);
if (forConservation)
{
- label.setText(MessageManager.getString("label.modify_conservation_visibility"));
+ label.setText(MessageManager
+ .getString("label.modify_conservation_visibility"));
slider.setMinimum(0);
slider.setMaximum(50 + slider.getVisibleAmount());
slider.setUnitIncrement(1);
}
else
{
- label.setText(MessageManager.getString("label.colour_residues_above_occurence"));
+ label.setText(MessageManager
+ .getString("label.colour_residues_above_occurence"));
slider.setMinimum(0);
slider.setMaximum(100 + slider.getVisibleAmount());
slider.setBlockIncrement(1);
slider.setOrientation(0);
valueField.setFont(new java.awt.Font("Verdana", 0, 11));
valueField.setText(" ");
- valueField.addActionListener(this);
+ valueField.addActionListener(this);
valueField.setColumns(3);
label.setFont(new java.awt.Font("Verdana", 0, 11));
label.setText(MessageManager.getString("label.set_this_label_text"));
undoButton.addActionListener(this);
allGroupsCheck.setEnabled(false);
allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));
- allGroupsCheck.setLabel(MessageManager.getString("action.apply_threshold_all_groups"));
- allGroupsCheck.setName(MessageManager.getString("action.apply_all_groups"));
+ allGroupsCheck.setLabel(MessageManager
+ .getString("action.apply_threshold_all_groups"));
+ allGroupsCheck.setName(MessageManager
+ .getString("action.apply_all_groups"));
this.setBackground(Color.white);
this.setForeground(Color.black);
jPanel2.add(label, null);
jMenu2.setLabel(MessageManager.getString("action.view"));
fontSize.setLabel(MessageManager.getString("action.font"));
fontSize.addActionListener(this);
- bootstrapMenu.setLabel(MessageManager.getString("label.show_bootstrap_values"));
+ bootstrapMenu.setLabel(MessageManager
+ .getString("label.show_bootstrap_values"));
bootstrapMenu.addItemListener(this);
distanceMenu.setLabel(MessageManager.getString("label.show_distances"));
distanceMenu.addItemListener(this);
- placeholdersMenu.setLabel(MessageManager.getString("label.mark_unassociated_leaves"));
+ placeholdersMenu.setLabel(MessageManager
+ .getString("label.mark_unassociated_leaves"));
placeholdersMenu.addItemListener(this);
fitToWindow.setState(true);
fitToWindow.setLabel(MessageManager.getString("label.fit_to_window"));
}
frame = new Frame();
frame.add(this);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.user_defined_colours"), 420,
+ jalview.bin.JalviewLite.addFrame(frame,
+ MessageManager.getString("label.user_defined_colours"), 420,
345);
if (seqGroup != null)
}
});
}
+
/**
* Put protein=true for get a protein example
*/
- private static boolean protein=false;
-
+ private static boolean protein = false;
/**
* main class for Jalview application
+ "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n");
System.exit(0);
}
- if (aparser.contains("nodisplay") || aparser.contains("nogui") || aparser.contains("headless"))
+ if (aparser.contains("nodisplay") || aparser.contains("nogui")
+ || aparser.contains("headless"))
{
System.setProperty("java.awt.headless", "true");
- headless=true;
+ headless = true;
}
Cache.loadProperties(aparser.getValue("props")); // must do this before
// anything else!
{
headless = true;
}
- System.setProperty("http.agent", "Jalview Desktop/"+Cache.getDefault("VERSION", "Unknown"));
+ System.setProperty("http.agent",
+ "Jalview Desktop/" + Cache.getDefault("VERSION", "Unknown"));
try
{
Cache.initLogger();
// We'll only open the default file if the desktop is visible.
// And the user
// ////////////////////
-
-
-
-
-
-
if (!headless && file == null && vamsasImport == null
- && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true) && protein == true)
+ && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true)
+ && protein == true)
{
file = jalview.bin.Cache.getDefault(
"STARTUP_FILE",
desktop.setInBatchMode(false);
}
}
-
-
+
private static void startUsageStats(final Desktop desktop)
{
/**
*
*/
-class rnabuttonlistener implements ActionListener{
- public void actionPerformed(ActionEvent arg0) {
- System.out.println("Good idea ! ");
+class rnabuttonlistener implements ActionListener
+{
+ public void actionPerformed(ActionEvent arg0)
+ {
+ System.out.println("Good idea ! ");
- }
+ }
}
-class pbuttonlistener implements ActionListener{
- public void actionPerformed(ActionEvent arg0) {
-
-
- }
+class pbuttonlistener implements ActionListener
+{
+ public void actionPerformed(ActionEvent arg0)
+ {
+
+ }
}
class ArgsParser
{
return queued == 0 && running == 0;
}
-
-
-
+
};
callInitCallback();
}
}
+
private void initLiveConnect()
{
// try really hard to get the liveConnect thing working
- boolean notFailed=false;
- int tries=0;
- while (!notFailed && tries<10) {
- if (tries>0)
+ boolean notFailed = false;
+ int tries = 0;
+ while (!notFailed && tries < 10)
+ {
+ if (tries > 0)
{
System.err.println("LiveConnect request thread going to sleep.");
}
- try {
- Thread.sleep(700*(1+tries));
+ try
+ {
+ Thread.sleep(700 * (1 + tries));
+ } catch (InterruptedException q)
+ {
}
- catch (InterruptedException q) {};
- if (tries++>0)
+ ;
+ if (tries++ > 0)
{
System.err.println("LiveConnect request thread woken up.");
}
- try {
+ try
+ {
JSObject scriptObject = JSObject.getWindow(this);
- if (scriptObject.eval("navigator")!=null)
+ if (scriptObject.eval("navigator") != null)
{
- notFailed=true;
+ notFailed = true;
}
} catch (JSException jsex)
{
- System.err.println("Attempt "+tries+" to access LiveConnect javascript failed.");
+ System.err.println("Attempt " + tries
+ + " to access LiveConnect javascript failed.");
}
}
}
+
private void callInitCallback()
{
String initjscallback = getParameter("oninit");
{
}
;
- // try really hard to let the browser plugin know we want liveconnect
+ // try really hard to let the browser plugin know we want liveconnect
initLiveConnect();
if (scriptObject != null)
g.setColor(Color.cyan);
g.fillRect(0, 0, getSize().width, getSize().height);
g.setColor(Color.red);
- g.drawString(MessageManager.getString("label.jalview_cannot_open_file"), 5, 15);
+ g.drawString(
+ MessageManager.getString("label.jalview_cannot_open_file"),
+ 5, 15);
g.drawString("\"" + file + "\"", 5, 30);
}
else if (embedded)
{
g.setColor(Color.black);
g.setFont(new Font("Arial", Font.BOLD, 24));
- g.drawString(MessageManager.getString("label.jalview_applet"), 50, getSize().height / 2 - 30);
- g.drawString(MessageManager.getString("label.loading_data") + "...", 50, getSize().height / 2);
+ g.drawString(MessageManager.getString("label.jalview_applet"), 50,
+ getSize().height / 2 - 30);
+ g.drawString(MessageManager.getString("label.loading_data") + "...",
+ 50, getSize().height / 2);
}
}
if (protocol == jalview.io.AppletFormatAdapter.PASTE)
{
- newAlignFrame.setTitle(MessageManager.formatMessage("label.sequences_from", new String[]{applet.getDocumentBase().toString()}));
+ newAlignFrame.setTitle(MessageManager.formatMessage(
+ "label.sequences_from", new String[]
+ { applet.getDocumentBase().toString() }));
}
- newAlignFrame.statusBar.setText(MessageManager.formatMessage("label.successfully_loaded_file", new String []{file}));
+ newAlignFrame.statusBar.setText(MessageManager.formatMessage(
+ "label.successfully_loaded_file", new String[]
+ { file }));
String treeFile = applet.getParameter("tree");
if (treeFile == null)
public class AlignViewController implements AlignViewControllerI
{
- AlignViewportI viewport=null;
- AlignmentViewPanel alignPanel=null;
+ AlignViewportI viewport = null;
+
+ AlignmentViewPanel alignPanel = null;
+
/**
* the GUI container that is handling interactions with the user
*/
private AlignViewControllerGuiI avcg;
+
@Override
- protected void finalize() throws Throwable {
+ protected void finalize() throws Throwable
+ {
viewport = null;
alignPanel = null;
avcg = null;
};
-
- public AlignViewController(AlignViewControllerGuiI alignFrame, AlignViewportI viewport,
- AlignmentViewPanel alignPanel)
+
+ public AlignViewController(AlignViewControllerGuiI alignFrame,
+ AlignViewportI viewport, AlignmentViewPanel alignPanel)
{
this.avcg = alignFrame;
- this.viewport=viewport;
+ this.viewport = viewport;
this.alignPanel = alignPanel;
}
+
@Override
- public void setViewportAndAlignmentPanel(AlignViewportI viewport,AlignmentViewPanel alignPanel)
+ public void setViewportAndAlignmentPanel(AlignViewportI viewport,
+ AlignmentViewPanel alignPanel)
{
this.alignPanel = alignPanel;
this.viewport = viewport;
-
+
}
+
@Override
public boolean makeGroupsFromSelection()
{
return true;
}
return false;
-}
+ }
+
@Override
public boolean createGroup()
{
SequenceGroup sg = viewport.getSelectionGroup();
- if (sg!=null)
+ if (sg != null)
{
- viewport.getAlignment().addGroup(sg);
- return true;
- }
+ viewport.getAlignment().addGroup(sg);
+ return true;
+ }
return false;
}
+
@Override
public boolean unGroup()
{
SequenceGroup sg = viewport.getSelectionGroup();
- if (sg!=null)
+ if (sg != null)
{
- viewport.getAlignment().deleteGroup(sg);
- return true;
+ viewport.getAlignment().deleteGroup(sg);
+ return true;
}
return false;
}
+
@Override
public boolean deleteGroups()
{
- if (viewport.getAlignment().getGroups()!=null && viewport.getAlignment().getGroups().size()>0)
+ if (viewport.getAlignment().getGroups() != null
+ && viewport.getAlignment().getGroups().size() > 0)
{
- viewport.getAlignment().deleteAllGroups();
- viewport.clearSequenceColours();
- viewport.setSelectionGroup(null);
- return true;
+ viewport.getAlignment().deleteAllGroups();
+ viewport.clearSequenceColours();
+ viewport.setSelectionGroup(null);
+ return true;
}
return false;
}
-
+
@Override
- public boolean markColumnsContainingFeatures(boolean invert, boolean extendCurrent, boolean toggle, String featureType)
+ public boolean markColumnsContainingFeatures(boolean invert,
+ boolean extendCurrent, boolean toggle, String featureType)
{
// JBPNote this routine could also mark rows, not just columns.
// need a decent query structure to allow all types of feature searches
BitSet bs = new BitSet();
- int alw,alStart;
- SequenceCollectionI sqcol = (viewport.getSelectionGroup() == null ? viewport.getAlignment() : viewport.getSelectionGroup());
+ int alw, alStart;
+ SequenceCollectionI sqcol = (viewport.getSelectionGroup() == null ? viewport
+ .getAlignment() : viewport.getSelectionGroup());
alStart = sqcol.getStartRes();
- alw = sqcol.getEndRes()+1;
+ alw = sqcol.getEndRes() + 1;
List<SequenceI> seqs = sqcol.getSequences();
int nseq = 0;
for (SequenceI sq : seqs)
{
int ist = sq.findIndex(sq.getStart());
int iend = sq.findIndex(sq.getEnd());
- if (iend < alStart || ist> alw)
+ if (iend < alStart || ist > alw)
{
// sequence not in region
continue;
int i = sq.findIndex(sfpos.getBegin());
int j = sq.findIndex(sfpos.getEnd());
- if (j<alStart || i>alw)
+ if (j < alStart || i > alw)
{
// feature is outside selected region
continue;
{
i = alStart;
}
- if (i< ist) {
+ if (i < ist)
+ {
i = ist;
}
if (j > alw)
if (cs == null)
{
cs = new ColumnSelection();
- } else {
+ }
+ else
+ {
if (!extendCurrent)
{
cs.clear();
if (ibs < 0 || i < ibs)
{
if (toggle && cs.contains(i))
- {
- cs.removeElement(i++);
- } else
- {
- cs.addElement(i++);
- }
+ {
+ cs.removeElement(i++);
+ }
+ else
+ {
+ cs.addElement(i++);
+ }
}
else
{
}
else
{
- for (int i = bs.nextSetBit(alStart); i >= alStart; i = bs.nextSetBit(i + 1))
+ for (int i = bs.nextSetBit(alStart); i >= alStart; i = bs
+ .nextSetBit(i + 1))
{
if (toggle && cs.contains(i))
{
cs.removeElement(i);
- } else
+ }
+ else
{
cs.addElement(i);
}
}
viewport.setColumnSelection(cs);
alignPanel.paintAlignment(true);
- avcg.setStatus((toggle ? "Toggled ": "Marked ")
- + (invert ? (alw-alStart) - bs.cardinality() : bs.cardinality())
- + " columns "+(invert ? "not " : "") + "containing features of type " + featureType
- + " across " + nseq + " sequence(s)");
+ avcg.setStatus((toggle ? "Toggled " : "Marked ")
+ + (invert ? (alw - alStart) - bs.cardinality() : bs
+ .cardinality()) + " columns "
+ + (invert ? "not " : "") + "containing features of type "
+ + featureType + " across " + nseq + " sequence(s)");
return true;
}
else
{
avcg.setStatus("No features of type " + featureType + " found.");
- if (!extendCurrent && cs!=null)
+ if (!extendCurrent && cs != null)
{
cs.clear();
alignPanel.paintAlignment(true);
if (aspos < aaWidth)
{
aaWidth++;
- System.arraycopy(codons, aspos, codons, aspos + 1, codons.length - aspos - 1);
+ System.arraycopy(codons, aspos, codons, aspos + 1, codons.length
+ - aspos - 1);
codons[aspos] = null; // clear so new codon position can be marked.
}
}
{
removeAnnotationForGroup(null);
}
- for (SequenceGroup sg:groups) {
+ for (SequenceGroup sg : groups)
+ {
sg.setContext(null);
}
groups.clear();
}
}
- @Override
- public void validateAnnotation(AlignmentAnnotation alignmentAnnotation)
- {
- alignmentAnnotation.validateRangeAndDisplay();
- if (isNucleotide() && alignmentAnnotation.isValidStruc())
- {
- hasRNAStructure = true;
- }
- }
- @Override
-public int getEndRes()
-{
- return getWidth()-1;
-}@Override
-public int getStartRes()
-{
- return 0;
-}
-/* In the case of AlignmentI - returns the dataset for the alignment, if set
- * (non-Javadoc)
- * @see jalview.datamodel.AnnotatedCollectionI#getContext()
- */
-@Override
-public AnnotatedCollectionI getContext()
-{
- return dataset;
-}
+ @Override
+ public void validateAnnotation(AlignmentAnnotation alignmentAnnotation)
+ {
+ alignmentAnnotation.validateRangeAndDisplay();
+ if (isNucleotide() && alignmentAnnotation.isValidStruc())
+ {
+ hasRNAStructure = true;
+ }
+ }
+
+ @Override
+ public int getEndRes()
+ {
+ return getWidth() - 1;
+ }
+
+ @Override
+ public int getStartRes()
+ {
+ return 0;
+ }
+
+ /*
+ * In the case of AlignmentI - returns the dataset for the alignment, if set
+ * (non-Javadoc)
+ *
+ * @see jalview.datamodel.AnnotatedCollectionI#getContext()
+ */
+ @Override
+ public AnnotatedCollectionI getContext()
+ {
+ return dataset;
+ }
}
/** DOCUMENT ME!! */
public Annotation[] annotations;
-
-
- public ArrayList<SimpleBP> bps=null;
+ public ArrayList<SimpleBP> bps = null;
+
/**
* RNA secondary structure contact positions
*/
*/
private void _updateRnaSecStr(CharSequence RNAannot)
{
- try {
- _rnasecstr = Rna.GetBasePairs(RNAannot);
- bps = Rna.GetModeleBP(RNAannot);
- invalidrnastruc=-1;
- }
- catch (WUSSParseException px)
+ try
+ {
+ _rnasecstr = Rna.GetBasePairs(RNAannot);
+ bps = Rna.GetModeleBP(RNAannot);
+ invalidrnastruc = -1;
+ } catch (WUSSParseException px)
{
// DEBUG System.out.println(px);
- invalidrnastruc=px.getProblemPos();
+ invalidrnastruc = px.getProblemPos();
}
if (invalidrnastruc > -1)
{
return NO_GRAPH;
}
}
- // JBPNote: what does this do ?
+
+ // JBPNote: what does this do ?
public void ConcenStru(CharSequence RNAannot) throws WUSSParseException
{
- bps = Rna.GetModeleBP(RNAannot);
+ bps = Rna.GetModeleBP(RNAannot);
}
+
/**
* Creates a new AlignmentAnnotation object.
*
else
// Check for RNA secondary structure
{
- //System.out.println(annotations[i].secondaryStructure);
+ // System.out.println(annotations[i].secondaryStructure);
if (annotations[i].secondaryStructure == '('
- || annotations[i].secondaryStructure == '['
- || annotations[i].secondaryStructure == '<'
- || annotations[i].secondaryStructure == '{'
- || annotations[i].secondaryStructure == 'A'
- || annotations[i].secondaryStructure == 'B'
- || annotations[i].secondaryStructure == 'C'
- || annotations[i].secondaryStructure == 'D'
- || annotations[i].secondaryStructure == 'E'
- || annotations[i].secondaryStructure == 'F'
- || annotations[i].secondaryStructure == 'G'
- || annotations[i].secondaryStructure == 'H'
- || annotations[i].secondaryStructure == 'I'
- || annotations[i].secondaryStructure == 'J'
- || annotations[i].secondaryStructure == 'K'
- || annotations[i].secondaryStructure == 'L'
- || annotations[i].secondaryStructure == 'M'
- || annotations[i].secondaryStructure == 'N'
- || annotations[i].secondaryStructure == 'O'
- || annotations[i].secondaryStructure == 'P'
- || annotations[i].secondaryStructure == 'Q'
- || annotations[i].secondaryStructure == 'R'
- || annotations[i].secondaryStructure == 'S'
- || annotations[i].secondaryStructure == 'T'
- || annotations[i].secondaryStructure == 'U'
- || annotations[i].secondaryStructure == 'V'
- || annotations[i].secondaryStructure == 'W'
- || annotations[i].secondaryStructure == 'X'
- || annotations[i].secondaryStructure == 'Y'
- || annotations[i].secondaryStructure == 'Z')
+ || annotations[i].secondaryStructure == '['
+ || annotations[i].secondaryStructure == '<'
+ || annotations[i].secondaryStructure == '{'
+ || annotations[i].secondaryStructure == 'A'
+ || annotations[i].secondaryStructure == 'B'
+ || annotations[i].secondaryStructure == 'C'
+ || annotations[i].secondaryStructure == 'D'
+ || annotations[i].secondaryStructure == 'E'
+ || annotations[i].secondaryStructure == 'F'
+ || annotations[i].secondaryStructure == 'G'
+ || annotations[i].secondaryStructure == 'H'
+ || annotations[i].secondaryStructure == 'I'
+ || annotations[i].secondaryStructure == 'J'
+ || annotations[i].secondaryStructure == 'K'
+ || annotations[i].secondaryStructure == 'L'
+ || annotations[i].secondaryStructure == 'M'
+ || annotations[i].secondaryStructure == 'N'
+ || annotations[i].secondaryStructure == 'O'
+ || annotations[i].secondaryStructure == 'P'
+ || annotations[i].secondaryStructure == 'Q'
+ || annotations[i].secondaryStructure == 'R'
+ || annotations[i].secondaryStructure == 'S'
+ || annotations[i].secondaryStructure == 'T'
+ || annotations[i].secondaryStructure == 'U'
+ || annotations[i].secondaryStructure == 'V'
+ || annotations[i].secondaryStructure == 'W'
+ || annotations[i].secondaryStructure == 'X'
+ || annotations[i].secondaryStructure == 'Y'
+ || annotations[i].secondaryStructure == 'Z')
{
hasIcons |= true;
isrna |= true;
// annotations[i].displayCharacter.charAt(0)==annotations[i].secondaryStructure
firstChar != ' '
&& firstChar != '$'
- && firstChar != '�' // JBPNote should explicitly express as unicode number to avoid source code translation problems
+ && firstChar != '�' // JBPNote should explicitly express as
+ // unicode number to avoid source code
+ // translation problems
&& firstChar != '('
&& firstChar != '['
&& firstChar != '>'
{
if (annotations[i] == null)
annotations[i] = new Annotation(String.valueOf(gapchar), null,
- ' ', 0f,null);
+ ' ', 0f, null);
else if (annotations[i].displayCharacter == null
|| annotations[i].displayCharacter.equals(" "))
annotations[i].displayCharacter = String.valueOf(gapchar);
Map<SequenceI, SequenceCollectionI> map, boolean up);
/**
- * validate annotation after an edit and update any alignment state flags accordingly
+ * validate annotation after an edit and update any alignment state flags
+ * accordingly
+ *
* @param alignmentAnnotation
*/
public void validateAnnotation(AlignmentAnnotation alignmentAnnotation);
*/
private Vector scGroups;
- private boolean isNa=false;
+ private boolean isNa = false;
+
/**
* false if the view concerns peptides
+ *
* @return
*/
public boolean isNa()
/**
* context for this annotated collection
- * @return null or the collection upon which this collection is defined (e.g. alignment, parent group).
+ *
+ * @return null or the collection upon which this collection is defined (e.g.
+ * alignment, parent group).
*/
AnnotatedCollectionI getContext();
}
/** Score for the position - used in histograms, line graphs and for shading */
public float value;
-
+
/** Colour for position */
public Color colour;
description = desc;
secondaryStructure = ss;
value = val;
-
+
}
/**
*/
public Annotation(float val)
{
- this(null, null, ' ', val,null);
+ this(null, null, ' ', val, null);
}
/**
* human readable representation of an annotation row element.
- *
+ *
* Format is 'display Char','secondary Structure
* Char',"description",score,[colourstring]
- *
+ *
* fields may be missing if they are null, whitespace, or equivalent to
* Float.NaN
*/
displayed = from.displayed;
}
}
+
@Override
public boolean equals(Object obj)
{
- if (obj!=null && obj instanceof GraphLine)
+ if (obj != null && obj instanceof GraphLine)
{
GraphLine other = (GraphLine) obj;
return displayed == other.displayed
public class SecondaryStructureAnnotation extends AlignmentAnnotation
{
-
- private static RNA _rna = null;
- public SecondaryStructureAnnotation (RNA rna)
- {
- super("Secondary Structure", "Un truc trop cool",getAnnotation(rna));
-
-
- _rna = rna;
- }
-
- public RNA getRNA()
- {
- return _rna;
- }
- public static Annotation[] getAnnotation(RNA rna)
- {
- Annotation[] ann = new Annotation[rna.getSize()];
- for(int i=0;i<ann.length;i++)
- {
- ann[i] = new Annotation(_rna.getStructDBN(true), "", ' ', 0f);;
- }
- return ann;
- }
+ private static RNA _rna = null;
+
+ public SecondaryStructureAnnotation(RNA rna)
+ {
+ super("Secondary Structure", "Un truc trop cool", getAnnotation(rna));
+
+ _rna = rna;
+ }
+
+ public RNA getRNA()
+ {
+ return _rna;
+ }
+
+ public static Annotation[] getAnnotation(RNA rna)
+ {
+ Annotation[] ann = new Annotation[rna.getSize()];
+ for (int i = 0; i < ann.length; i++)
+ {
+ ann[i] = new Annotation(_rna.getStructDBN(true), "", ' ', 0f);
+ ;
+ }
+ return ann;
+ }
}
String vamsasId;
DBRefEntry[] dbrefs;
-
+
RNA rna;
/**
{
tmp = new char[i];
System.arraycopy(sequence, 0, tmp, 0, i);
- j=sequence.length;
+ j = sequence.length;
}
else
{
{
index = value;
}
-
- public void setRNA(RNA r){rna=r;}
-
- public RNA getRNA() { return rna; }
-
+
+ public void setRNA(RNA r)
+ {
+ rna = r;
+ }
+
+ public RNA getRNA()
+ {
+ return rna;
+ }
+
}
int getWidth();
- /**
- * @return the first column included in this collection. Runs from 0<=i<N_cols
- */
+ /**
+ * @return the first column included in this collection. Runs from 0<=i<N_cols
+ */
int getStartRes();
-
/**
*
}
/**
- * Max Gaps Threshold (percent) for performing a conservation calculation
+ * Max Gaps Threshold (percent) for performing a conservation calculation
*/
private int consPercGaps = 25;
/**
* set Max Gaps Threshold (percent) for performing a conservation calculation
- * @param consPercGaps
+ *
+ * @param consPercGaps
*/
public void setConsPercGaps(int consPercGaps)
{
}
if (cs != null)
{
- cs.alignmentChanged(context!=null ? context : this, null);
+ cs.alignmentChanged(context != null ? context : this, null);
}
} catch (java.lang.OutOfMemoryError err)
{
consensus.annotations = new Annotation[aWidth]; // should be alignment width
AAFrequency.completeConsensus(consensus, cnsns, startRes, endRes + 1,
- ignoreGapsInConsensus, showSequenceLogo, nseq); // TODO: setting container
- // for
- // ignoreGapsInConsensusCalculation);
+ ignoreGapsInConsensus, showSequenceLogo, nseq); // TODO: setting
+ // container
+ // for
+ // ignoreGapsInConsensusCalculation);
}
/**
{
sequences.clear();
}
+
private AnnotatedCollectionI context;
+
/**
* set the alignment or group context for this group
+ *
* @param context
*/
public void setContext(AnnotatedCollectionI context)
{
- this.context = context;
+ this.context = context;
}
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see jalview.datamodel.AnnotatedCollectionI#getContext()
*/
@Override
*/
package jalview.datamodel;
-
import java.util.Vector;
import fr.orsay.lri.varna.models.rna.RNA;
* @return The index of the sequence in the alignment
*/
public int getIndex();
-
+
/**
* @return The RNA of the sequence in the alignment
*/
-
+
public RNA getRNA();
-
+
/**
- * @param rna The RNA.
+ * @param rna
+ * The RNA.
*/
public void setRNA(RNA rna);
-
}
* time.
*/
private boolean loadingFromArchive = false;
-
+
/**
* second flag to indicate if the jmol viewer should ignore sequence colouring
* events from the structure manager because the GUI is still setting up
String[] files = getPdbFile();
// check to see if we are still waiting for Jmol files
- long starttime=System.currentTimeMillis();
- boolean waiting=true;
- do {
- waiting=false;
- for (String file:files)
+ long starttime = System.currentTimeMillis();
+ boolean waiting = true;
+ do
+ {
+ waiting = false;
+ for (String file : files)
{
- try {
+ try
+ {
// HACK - in Jalview 2.8 this call may not be threadsafe so we catch
// every possible exception
StructureMapping[] sm = ssm.getMapping(file);
}
}
// we wait around for a reasonable time before we give up
- } while (waiting && System.currentTimeMillis()<(10000+1000*files.length+starttime));
+ } while (waiting
+ && System.currentTimeMillis() < (10000 + 1000 * files.length + starttime));
if (waiting)
{
- System.err.println("RUNTIME PROBLEM: Jmol seems to be taking a long time to process all the structures.");
+ System.err
+ .println("RUNTIME PROBLEM: Jmol seems to be taking a long time to process all the structures.");
return;
}
StringBuffer selectioncom = new StringBuffer();
// Jmol callback has completed.
if (mapping == null || mapping.length < 1)
{
- throw new Error("Implementation error - Jmol seems to be still working on getting its data - report at http://issues.jalview.org/browse/JAL-1016");
+ throw new Error(
+ "Implementation error - Jmol seems to be still working on getting its data - report at http://issues.jalview.org/browse/JAL-1016");
}
int lastPos = -1;
for (int s = 0; s < sequence[pdbfnum].length; s++)
}
}
}
-
+
// TODO: consider bailing if nmatched less than 4 because superposition
// not
// well defined.
{
selectioncom.append("|");
}
- } else {
+ }
+ else
+ {
selcom[pdbfnum] = null;
}
}
}
for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)
{
- if (pdbfnum == refStructure || selcom[pdbfnum]==null || selcom[refStructure]==null)
+ if (pdbfnum == refStructure || selcom[pdbfnum] == null
+ || selcom[refStructure] == null)
{
continue;
}
command.append(chainNames[pdbfnum]);
command.append(") against reference (");
command.append(chainNames[refStructure]);
- command.append(")\";\ncompare "+nSeconds);
+ command.append(")\";\ncompare " + nSeconds);
command.append("{");
command.append(1 + pdbfnum);
command.append(".1} {");
{
this.loadingFromArchive = loadingFromArchive;
}
-
+
/**
*
- * @return true if Jmol is still restoring state or loading is still going on (see setFinsihedLoadingFromArchive)
+ * @return true if Jmol is still restoring state or loading is still going on
+ * (see setFinsihedLoadingFromArchive)
*/
public boolean isLoadingFromArchive()
{
}
/**
- * modify flag which controls if sequence colouring events are honoured by the binding.
- * Should be true for normal operation
+ * modify flag which controls if sequence colouring events are honoured by the
+ * binding. Should be true for normal operation
+ *
* @param finishedLoading
*/
public void setFinishedLoadingFromArchive(boolean finishedLoading)
Viewer viewer = null;
- public PDBFileWithJmol(String inFile, String type)
- throws IOException
+ public PDBFileWithJmol(String inFile, String type) throws IOException
{
super(inFile, type);
}
-
public PDBFileWithJmol(FileParse fp) throws IOException
{
pdbe.setId(getDataName());
sq.addPDBId(pdbe);
pdbe.setProperty(new Hashtable());
- pdbe.getProperty().put("CHAIN",""+_lastChainId);
+ pdbe.getProperty().put("CHAIN", "" + _lastChainId);
seqs.add(sq);
if (!(biopoly.isDna() || biopoly.isRna()))
{
public class Annotate3D
{
private static String twoDtoolsURL = "http://arn-ibmc.in2p3.fr/api/compute/2d";
+
private static ContentHandler createContentHandler()
{
- ContentHandler ch = new ContentHandler() {
+ ContentHandler ch = new ContentHandler()
+ {
@Override
public void startJSON() throws ParseException, IOException
{
// TODO Auto-generated method stub
-
+
}
@Override
public void endJSON() throws ParseException, IOException
{
// TODO Auto-generated method stub
-
+
}
@Override
// TODO Auto-generated method stub
return false;
}
-
+
};
return ch;
}
+
public static Iterator<Reader> getRNAMLForPDBFileAsString(String pdbfile)
throws Exception
{
vals.add(new BasicNameValuePair("tool", "rnaview"));
vals.add(new BasicNameValuePair("data", pdbfile));
vals.add(new BasicNameValuePair("output", "rnaml"));
- // return processJsonResponseFor(HttpClientUtils.doHttpUrlPost(twoDtoolsURL, vals));
+ // return processJsonResponseFor(HttpClientUtils.doHttpUrlPost(twoDtoolsURL,
+ // vals));
ArrayList<Reader> readers = new ArrayList<Reader>();
readers.add(HttpClientUtils.doHttpUrlPost(twoDtoolsURL, vals));
return readers.iterator();
}
- public static Iterator<Reader> processJsonResponseFor(Reader respons) throws Exception
+
+ public static Iterator<Reader> processJsonResponseFor(Reader respons)
+ throws Exception
{
org.json.simple.parser.JSONParser jp = new org.json.simple.parser.JSONParser();
- try {
+ try
+ {
final JSONArray responses = (JSONArray) jp.parse(respons);
final Iterator rvals = responses.iterator();
- return new Iterator<Reader>()
+ return new Iterator<Reader>()
+ {
+ @Override
+ public boolean hasNext()
{
- @Override
- public boolean hasNext()
- {
- return rvals.hasNext();
- }
- @Override
- public Reader next()
- {
- JSONObject val=(JSONObject) rvals.next();
-
- Object sval = null;
- try {
- sval = val.get("2D");
- } catch (Exception x) {x.printStackTrace();};
- if (sval==null)
- {
- System.err.println("DEVELOPER WARNING: Annotate3d didn't return a '2D' tag in its response. Consider checking output of server. Response was :"+val.toString());
-
- sval = "";
- }
- return new StringReader((sval instanceof JSONObject) ? ((JSONObject)sval).toString():sval.toString());
-
- }@Override
- public void remove()
+ return rvals.hasNext();
+ }
+
+ @Override
+ public Reader next()
+ {
+ JSONObject val = (JSONObject) rvals.next();
+
+ Object sval = null;
+ try
{
- throw new Error("Remove: Not implemented");
-
- }@Override
- protected Object clone() throws CloneNotSupportedException
+ sval = val.get("2D");
+ } catch (Exception x)
{
- throw new CloneNotSupportedException("Clone: Not implemented");
- }@Override
- public boolean equals(Object obj)
+ x.printStackTrace();
+ }
+ ;
+ if (sval == null)
{
- return super.equals(obj);
- }@Override
- protected void finalize() throws Throwable
+ System.err
+ .println("DEVELOPER WARNING: Annotate3d didn't return a '2D' tag in its response. Consider checking output of server. Response was :"
+ + val.toString());
+
+ sval = "";
+ }
+ return new StringReader(
+ (sval instanceof JSONObject) ? ((JSONObject) sval)
+ .toString() : sval.toString());
+
+ }
+
+ @Override
+ public void remove()
+ {
+ throw new Error("Remove: Not implemented");
+
+ }
+
+ @Override
+ protected Object clone() throws CloneNotSupportedException
+ {
+ throw new CloneNotSupportedException("Clone: Not implemented");
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return super.equals(obj);
+ }
+
+ @Override
+ protected void finalize() throws Throwable
+ {
+ while (rvals.hasNext())
{
- while (rvals.hasNext())
- {
- rvals.next();
- }
- super.finalize();
+ rvals.next();
}
- };
+ super.finalize();
+ }
+ };
} catch (Exception foo)
{
- throw new Exception("Couldn't parse response from Annotate3d server.",foo);
+ throw new Exception(
+ "Couldn't parse response from Annotate3d server.", foo);
}
-
-
+
}
- public static Iterator<Reader> getRNAMLForPDBId(String pdbid) throws Exception
+ public static Iterator<Reader> getRNAMLForPDBId(String pdbid)
+ throws Exception
{
List<NameValuePair> vals = new ArrayList<NameValuePair>();
vals.add(new BasicNameValuePair("tool", "rnaview"));
vals.add(new BasicNameValuePair("pdbid", pdbid));
vals.add(new BasicNameValuePair("output", "rnaml"));
- java.net.URL geturl = new URL(twoDtoolsURL+"?tool=rnaview&pdbid="+pdbid+"&output=rnaml");
- //return processJsonResponseFor(new InputStreamReader(geturl.openStream()));
+ java.net.URL geturl = new URL(twoDtoolsURL + "?tool=rnaview&pdbid="
+ + pdbid + "&output=rnaml");
+ // return processJsonResponseFor(new
+ // InputStreamReader(geturl.openStream()));
ArrayList<Reader> readers = new ArrayList<Reader>();
readers.add(new InputStreamReader(geturl.openStream()));
return readers.iterator();
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.ext.varna;
+
import java.awt.event.*;
import jalview.api.SequenceStructureBinding;
public AlignmentPanel alignPanel;
AlignViewport viewport;
-
+
public AlignViewControllerI avc;
-
Vector alignPanels = new Vector();
*/
void init()
{
- avc = new jalview.controller.AlignViewController(this, viewport, alignPanel);
+ avc = new jalview.controller.AlignViewController(this, viewport,
+ alignPanel);
if (viewport.getAlignmentConservationAnnotation() == null)
{
BLOSUM62Colour.setEnabled(false);
}
addKeyListener();
-
+
}
/**
case KeyEvent.VK_F2:
viewport.cursorMode = !viewport.cursorMode;
- statusBar.setText(MessageManager.formatMessage("label.keyboard_editing_mode", new String[]{(viewport.cursorMode ? "on" : "off")}));
+ statusBar.setText(MessageManager.formatMessage(
+ "label.keyboard_editing_mode", new String[]
+ { (viewport.cursorMode ? "on" : "off") }));
if (viewport.cursorMode)
{
alignPanel.seqPanel.seqCanvas.cursorX = viewport.startRes;
public void addAlignmentPanel(final AlignmentPanel ap, boolean newPanel)
{
ap.alignFrame = this;
- avc = new jalview.controller.AlignViewController(this, viewport, alignPanel);
+ avc = new jalview.controller.AlignViewController(this, viewport,
+ alignPanel);
alignPanels.addElement(ap);
final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
if (handler.canCancel())
{
- JButton cancel = new JButton(MessageManager.getString("action.cancel"));
+ JButton cancel = new JButton(
+ MessageManager.getString("action.cancel"));
final IProgressIndicator us = this;
cancel.addActionListener(new ActionListener()
{
}
@Override
- public void setStatus(String text) {
+ public void setStatus(String text)
+ {
statusBar.setText(text);
};
+
/*
* Added so Castor Mapping file can obtain Jalview Version
*/
currentFileFormat = chooser.getSelectedFormat();
if (currentFileFormat == null)
{
- JOptionPane.showInternalMessageDialog(Desktop.desktop,
- MessageManager.getString("label.select_file_format_before_saving"),
- MessageManager.getString("label.file_format_not_specified"), JOptionPane.WARNING_MESSAGE);
+ JOptionPane
+ .showInternalMessageDialog(
+ Desktop.desktop,
+ MessageManager
+ .getString("label.select_file_format_before_saving"),
+ MessageManager
+ .getString("label.file_format_not_specified"),
+ JOptionPane.WARNING_MESSAGE);
value = chooser.showSaveDialog(this);
return;
}
success = new Jalview2XML().SaveAlignment(this, file, shortName);
- statusBar.setText(MessageManager.formatMessage("label.successfully_saved_to_file_in_format",new String[]{fileName, format}));
-
+ statusBar.setText(MessageManager.formatMessage(
+ "label.successfully_saved_to_file_in_format", new String[]
+ { fileName, format }));
}
else
int reply = JOptionPane
.showInternalConfirmDialog(
Desktop.desktop,
- MessageManager.getString("label.alignment_contains_hidden_columns"),
- MessageManager.getString("action.save_omit_hidden_columns"),
+ MessageManager
+ .getString("label.alignment_contains_hidden_columns"),
+ MessageManager
+ .getString("action.save_omit_hidden_columns"),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
out.print(output);
out.close();
this.setTitle(file);
- statusBar.setText(MessageManager.formatMessage("label.successfully_saved_to_file_in_format",new String[]{fileName, format}));
+ statusBar.setText(MessageManager.formatMessage(
+ "label.successfully_saved_to_file_in_format",
+ new String[]
+ { fileName, format }));
} catch (Exception ex)
{
success = false;
if (!success)
{
- JOptionPane.showInternalMessageDialog(this, MessageManager.formatMessage("label.couldnt_save_file", new String[]{fileName}),
- MessageManager.getString("label.error_saving_file"), JOptionPane.WARNING_MESSAGE);
+ JOptionPane.showInternalMessageDialog(this, MessageManager
+ .formatMessage("label.couldnt_save_file", new String[]
+ { fileName }), MessageManager
+ .getString("label.error_saving_file"),
+ JOptionPane.WARNING_MESSAGE);
}
return success;
int reply = JOptionPane
.showInternalConfirmDialog(
Desktop.desktop,
- MessageManager.getString("label.alignment_contains_hidden_columns"),
- MessageManager.getString("action.save_omit_hidden_columns"),
+ MessageManager
+ .getString("label.alignment_contains_hidden_columns"),
+ MessageManager
+ .getString("action.save_omit_hidden_columns"),
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
viewport.getAlignment(), omitHidden,
viewport.getColumnSelection()));
- Desktop.addInternalFrame(cap,
- MessageManager.formatMessage("label.alignment_output_command", new String[]{e.getActionCommand()}), 600, 500);
+ Desktop.addInternalFrame(cap, MessageManager.formatMessage(
+ "label.alignment_output_command", new String[]
+ { e.getActionCommand() }), 600, 500);
} catch (OutOfMemoryError oom)
{
new OOMWarning("Outputting alignment as " + e.getActionCommand(), oom);
JalviewFileChooser chooser = new JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
- chooser.setDialogTitle(MessageManager.getString("label.load_jalview_annotations"));
- chooser.setToolTipText(MessageManager.getString("label.load_jalview_annotations"));
+ chooser.setDialogTitle(MessageManager
+ .getString("label.load_jalview_annotations"));
+ chooser.setToolTipText(MessageManager
+ .getString("label.load_jalview_annotations"));
int value = chooser.showOpenDialog(null);
{
undoMenuItem.setEnabled(true);
CommandI command = (CommandI) viewport.historyList.peek();
- undoMenuItem.setText(MessageManager.formatMessage("label.undo_command", new String[]{command.getDescription()}));
+ undoMenuItem.setText(MessageManager.formatMessage(
+ "label.undo_command", new String[]
+ { command.getDescription() }));
}
else
{
redoMenuItem.setEnabled(true);
CommandI command = (CommandI) viewport.redoList.peek();
- redoMenuItem.setText(MessageManager.formatMessage("label.redo_command", new String[]{command.getDescription()}));
+ redoMenuItem.setText(MessageManager.formatMessage(
+ "label.redo_command", new String[]
+ { command.getDescription() }));
}
else
{
Desktop.jalviewClipboard = new Object[]
{ seqs, viewport.getAlignment().getDataset(), hiddenColumns };
- statusBar.setText(MessageManager.formatMessage("label.copied_sequences_to_clipboard", new String[]{Integer.valueOf(seqs.length).toString()}));
+ statusBar.setText(MessageManager.formatMessage(
+ "label.copied_sequences_to_clipboard", new String[]
+ { Integer.valueOf(seqs.length).toString() }));
}
/**
}
}
+
@Override
protected void expand_newalign(ActionEvent e)
{
- try {
- AlignmentI alignment = AlignmentUtils.expandContext(getViewport().getAlignment(), -1);
- AlignFrame af = new AlignFrame(alignment, DEFAULT_WIDTH,
- DEFAULT_HEIGHT);
- String newtitle = new String("Flanking alignment");
-
- if (Desktop.jalviewClipboard != null
- && Desktop.jalviewClipboard[2] != null)
+ try
{
- Vector hc = (Vector) Desktop.jalviewClipboard[2];
- for (int i = 0; i < hc.size(); i++)
+ AlignmentI alignment = AlignmentUtils.expandContext(getViewport()
+ .getAlignment(), -1);
+ AlignFrame af = new AlignFrame(alignment, DEFAULT_WIDTH,
+ DEFAULT_HEIGHT);
+ String newtitle = new String("Flanking alignment");
+
+ if (Desktop.jalviewClipboard != null
+ && Desktop.jalviewClipboard[2] != null)
{
- int[] region = (int[]) hc.elementAt(i);
- af.viewport.hideColumns(region[0], region[1]);
+ Vector hc = (Vector) Desktop.jalviewClipboard[2];
+ for (int i = 0; i < hc.size(); i++)
+ {
+ int[] region = (int[]) hc.elementAt(i);
+ af.viewport.hideColumns(region[0], region[1]);
+ }
}
- }
- // >>>This is a fix for the moment, until a better solution is
- // found!!<<<
- af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer()
- .transferSettings(
- alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
+ // >>>This is a fix for the moment, until a better solution is
+ // found!!<<<
+ af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer()
+ .transferSettings(
+ alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
- // TODO: maintain provenance of an alignment, rather than just make the
- // title a concatenation of operations.
- {
- if (title.startsWith("Copied sequences"))
- {
- newtitle = title;
- }
- else
+ // TODO: maintain provenance of an alignment, rather than just make the
+ // title a concatenation of operations.
{
- newtitle = newtitle.concat("- from " + title);
+ if (title.startsWith("Copied sequences"))
+ {
+ newtitle = title;
+ }
+ else
+ {
+ newtitle = newtitle.concat("- from " + title);
+ }
}
- }
- Desktop.addInternalFrame(af, newtitle, DEFAULT_WIDTH,
- DEFAULT_HEIGHT);
+ Desktop.addInternalFrame(af, newtitle, DEFAULT_WIDTH, DEFAULT_HEIGHT);
} catch (Exception ex)
{
ex.printStackTrace();
System.out.println("Exception whilst pasting: " + ex);
// could be anything being pasted in here
- }
- catch (OutOfMemoryError oom)
+ } catch (OutOfMemoryError oom)
{
new OOMWarning("Viewing flanking region of alignment", oom);
}
}
+
/**
* DOCUMENT ME!
*
@Override
protected void deleteGroups_actionPerformed(ActionEvent e)
{
- if (avc.deleteGroups()) {
+ if (avc.deleteGroups())
+ {
PaintRefresher.Refresh(this, viewport.getSequenceSetId());
alignPanel.updateAnnotation();
alignPanel.paintAlignment(true);
viewport.getSelectionGroup());
}
- statusBar.setText(MessageManager.formatMessage("label.removed_columns", new String[]{Integer.valueOf(trimRegion.getSize()).toString()}));
+ statusBar.setText(MessageManager.formatMessage(
+ "label.removed_columns", new String[]
+ { Integer.valueOf(trimRegion.getSize()).toString() }));
addHistoryItem(trimRegion);
addHistoryItem(removeGapCols);
- statusBar.setText(MessageManager.formatMessage("label.removed_empty_columns", new String[]{Integer.valueOf(removeGapCols.getSize()).toString()}));
+ statusBar.setText(MessageManager.formatMessage(
+ "label.removed_empty_columns", new String[]
+ { Integer.valueOf(removeGapCols.getSize()).toString() }));
// This is to maintain viewport position on first residue
// of first sequence
addAlignmentPanel(newap, true);
newap.alignmentChanged();
-
+
if (alignPanels.size() == 2)
{
viewport.gatherViewsHere = true;
editPane.setEditable(false);
StringBuffer contents = new AlignmentProperties(viewport.getAlignment())
.formatAsHtml();
- editPane.setText(MessageManager.formatMessage("label.html_content", new String[]{contents.toString()}));
+ editPane.setText(MessageManager.formatMessage("label.html_content",
+ new String[]
+ { contents.toString() }));
JInternalFrame frame = new JInternalFrame();
frame.getContentPane().add(new JScrollPane(editPane));
- Desktop.instance.addInternalFrame(frame, MessageManager.formatMessage("label.alignment_properties", new String[]{getTitle()}), 500, 400);
+ Desktop.instance.addInternalFrame(frame, MessageManager.formatMessage(
+ "label.alignment_properties", new String[]
+ { getTitle() }), 500, 400);
}
/**
JInternalFrame frame = new JInternalFrame();
OverviewPanel overview = new OverviewPanel(alignPanel);
frame.setContentPane(overview);
- Desktop.addInternalFrame(frame, MessageManager.formatMessage("label.overview_params", new String[]{this.getTitle()}),
- frame.getWidth(), frame.getHeight());
+ Desktop.addInternalFrame(frame, MessageManager.formatMessage(
+ "label.overview_params", new String[]
+ { this.getTitle() }), frame.getWidth(), frame.getHeight());
frame.pack();
frame.setLayer(JLayeredPane.PALETTE_LAYER);
frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
@Override
public void userDefinedColour_actionPerformed(ActionEvent e)
{
- if (e.getActionCommand().equals(MessageManager.getString("action.user_defined")))
+ if (e.getActionCommand().equals(
+ MessageManager.getString("action.user_defined")))
{
new UserDefinedColours(alignPanel, null);
}
int option = JOptionPane.showInternalConfirmDialog(
jalview.gui.Desktop.desktop,
- MessageManager.getString("label.remove_from_default_list"),
- MessageManager.getString("label.remove_user_defined_colour"),
+ MessageManager
+ .getString("label.remove_from_default_list"),
+ MessageManager
+ .getString("label.remove_user_defined_colour"),
JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION)
{
if ((viewport.getSelectionGroup() == null)
|| (viewport.getSelectionGroup().getSize() < 2))
{
- JOptionPane.showInternalMessageDialog(this,
- MessageManager.getString("label.you_must_select_least_two_sequences"), MessageManager.getString("label.invalid_selection"),
+ JOptionPane.showInternalMessageDialog(this, MessageManager
+ .getString("label.you_must_select_least_two_sequences"),
+ MessageManager.getString("label.invalid_selection"),
JOptionPane.WARNING_MESSAGE);
}
else
{
JInternalFrame frame = new JInternalFrame();
frame.setContentPane(new PairwiseAlignPanel(viewport));
- Desktop.addInternalFrame(frame, MessageManager.getString("action.pairwise_alignment"), 600, 500);
+ Desktop.addInternalFrame(frame,
+ MessageManager.getString("action.pairwise_alignment"), 600,
+ 500);
}
}
.getSelectionGroup().getSize() > 0))
|| (viewport.getAlignment().getHeight() < 4))
{
- JOptionPane.showInternalMessageDialog(this,
- MessageManager.getString("label.principal_component_analysis_must_take_least_four_input_sequences"),
- MessageManager.getString("label.sequence_selection_insufficient"),
- JOptionPane.WARNING_MESSAGE);
+ JOptionPane
+ .showInternalMessageDialog(
+ this,
+ MessageManager
+ .getString("label.principal_component_analysis_must_take_least_four_input_sequences"),
+ MessageManager
+ .getString("label.sequence_selection_insufficient"),
+ JOptionPane.WARNING_MESSAGE);
return;
}
JOptionPane
.showMessageDialog(
Desktop.desktop,
- MessageManager.getString("label.you_need_more_two_sequences_selected_build_tree"),
- MessageManager.getString("label.not_enough_sequences"), JOptionPane.WARNING_MESSAGE);
+ MessageManager
+ .getString("label.you_need_more_two_sequences_selected_build_tree"),
+ MessageManager
+ .getString("label.not_enough_sequences"),
+ JOptionPane.WARNING_MESSAGE);
return;
}
JOptionPane
.showMessageDialog(
Desktop.desktop,
- MessageManager.getString("label.selected_region_to_tree_may_only_contain_residues_or_gaps"),
- MessageManager.getString("label.sequences_selection_not_aligned"),
+ MessageManager
+ .getString("label.selected_region_to_tree_may_only_contain_residues_or_gaps"),
+ MessageManager
+ .getString("label.sequences_selection_not_aligned"),
JOptionPane.WARNING_MESSAGE);
return;
JOptionPane
.showMessageDialog(
Desktop.desktop,
- MessageManager.getString("label.sequences_must_be_aligned_before_creating_tree"),
- MessageManager.getString("label.sequences_not_aligned"),
+ MessageManager
+ .getString("label.sequences_must_be_aligned_before_creating_tree"),
+ MessageManager
+ .getString("label.sequences_not_aligned"),
JOptionPane.WARNING_MESSAGE);
return;
{
calculateTree.removeAll();
// build the calculate menu
-
- for (final String type:new String[] {"NJ", "AV"})
+
+ for (final String type : new String[]
+ { "NJ", "AV" })
{
- String treecalcnm = MessageManager.getString("label.tree_calc_"+type.toLowerCase());
- for (final Object pwtype: ResidueProperties.scoreMatrices.keySet())
+ String treecalcnm = MessageManager.getString("label.tree_calc_"
+ + type.toLowerCase());
+ for (final Object pwtype : ResidueProperties.scoreMatrices.keySet())
{
JMenuItem tm = new JMenuItem();
ScoreModelI sm = ResidueProperties.scoreMatrices.get(pwtype);
- if (sm.isProtein()==!viewport.getAlignment().isNucleotide())
+ if (sm.isProtein() == !viewport.getAlignment().isNucleotide())
{
String smn = MessageManager.getStringOrReturn(
"label.score_model_", sm.getName());
JalviewFileChooser chooser = new JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
- chooser.setDialogTitle(MessageManager.getString("label.select_newick_like_tree_file"));
+ chooser.setDialogTitle(MessageManager
+ .getString("label.select_newick_like_tree_file"));
chooser.setToolTipText(MessageManager.getString("label.load_tree_file"));
int value = chooser.showOpenDialog(null);
viewport.setCurrentTree(ShowNewickTree(fin, choice).getTree());
} catch (Exception ex)
{
- JOptionPane.showMessageDialog(Desktop.desktop, ex.getMessage(),
- MessageManager.getString("label.problem_reading_tree_file"), JOptionPane.WARNING_MESSAGE);
+ JOptionPane
+ .showMessageDialog(
+ Desktop.desktop,
+ ex.getMessage(),
+ MessageManager
+ .getString("label.problem_reading_tree_file"),
+ JOptionPane.WARNING_MESSAGE);
ex.printStackTrace();
}
if (fin != null && fin.hasWarningMessage())
{
- JOptionPane.showMessageDialog(Desktop.desktop,
- fin.getWarningMessage(), MessageManager.getString("label.possible_problem_with_tree_file"),
+ JOptionPane.showMessageDialog(Desktop.desktop, fin
+ .getWarningMessage(), MessageManager
+ .getString("label.possible_problem_with_tree_file"),
JOptionPane.WARNING_MESSAGE);
}
}
@Override
public void run()
{
- final List<JMenuItem> legacyItems=new ArrayList<JMenuItem>();
+ final List<JMenuItem> legacyItems = new ArrayList<JMenuItem>();
try
{
System.err.println("Building ws menu again "
// be
// stored or retrieved from elsewhere
// No MSAWS used any more:
- // Vector msaws = null; // (Vector) Discoverer.services.get("MsaWS");
+ // Vector msaws = null; // (Vector)
+ // Discoverer.services.get("MsaWS");
Vector secstrpr = (Vector) Discoverer.services
.get("SecStrPred");
if (secstrpr != null)
.get(i);
jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
.getServiceClient(sh);
- int p=secstrmenu.getItemCount();
+ int p = secstrmenu.getItemCount();
impl.attachWSMenuEntry(secstrmenu, me);
- int q=secstrmenu.getItemCount();
- for (int litm=p;litm<q; litm++)
+ int q = secstrmenu.getItemCount();
+ for (int litm = p; litm < q; litm++)
{
legacyItems.add(secstrmenu.getItem(litm));
}
}
}
}
-
+
// Add all submenus in the order they should appear on the web
// services menu
wsmenu.add(msawsmenu);
webService.add(me.webServiceNoServices);
}
// TODO: move into separate menu builder class.
- boolean new_sspred=false;
+ boolean new_sspred = false;
if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
{
Jws2Discoverer jws2servs = Jws2Discoverer.getDiscoverer();
if (jws2servs.hasServices())
{
jws2servs.attachWSMenuEntry(webService, me);
- for (Jws2Instance sv:jws2servs.getServices()) {
+ for (Jws2Instance sv : jws2servs.getServices())
+ {
if (sv.description.toLowerCase().contains("jpred"))
{
- for (JMenuItem jmi:legacyItems)
+ for (JMenuItem jmi : legacyItems)
{
jmi.setVisible(false);
}
}
}
-
+
}
if (jws2servs.isRunning())
{
JOptionPane
.showMessageDialog(
Desktop.desktop,
- MessageManager.getString("label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation"),
- MessageManager.getString("label.translation_failed"), JOptionPane.WARNING_MESSAGE);
+ MessageManager
+ .getString("label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation"),
+ MessageManager.getString("label.translation_failed"),
+ JOptionPane.WARNING_MESSAGE);
}
else
{
AlignFrame af = new AlignFrame(al, DEFAULT_WIDTH, DEFAULT_HEIGHT);
- Desktop.addInternalFrame(af, MessageManager.formatMessage("label.translation_of_params", new String[]{this.getTitle()}),
- DEFAULT_WIDTH, DEFAULT_HEIGHT);
+ Desktop.addInternalFrame(af, MessageManager.formatMessage(
+ "label.translation_of_params", new String[]
+ { this.getTitle() }), DEFAULT_WIDTH, DEFAULT_HEIGHT);
}
}
} catch (Exception ex)
{
al = null;
- jalview.bin.Cache.log.error("Exception during translation. Please report this !", ex);
+ jalview.bin.Cache.log.error(
+ "Exception during translation. Please report this !", ex);
JOptionPane
- .showMessageDialog(
- Desktop.desktop,
- MessageManager.getString("label.error_when_translating_sequences_submit_bug_report"),
- MessageManager.getString("label.implementation_error") + MessageManager.getString("translation_failed"), JOptionPane.ERROR_MESSAGE);
+ .showMessageDialog(
+ Desktop.desktop,
+ MessageManager
+ .getString("label.error_when_translating_sequences_submit_bug_report"),
+ MessageManager
+ .getString("label.implementation_error")
+ + MessageManager
+ .getString("translation_failed"),
+ JOptionPane.ERROR_MESSAGE);
return;
}
if (al == null)
JOptionPane
.showMessageDialog(
Desktop.desktop,
- MessageManager.getString("label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation"),
- MessageManager.getString("label.translation_failed"), JOptionPane.WARNING_MESSAGE);
+ MessageManager
+ .getString("label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation"),
+ MessageManager.getString("label.translation_failed"),
+ JOptionPane.WARNING_MESSAGE);
}
else
{
AlignFrame af = new AlignFrame(al, DEFAULT_WIDTH, DEFAULT_HEIGHT);
- Desktop.addInternalFrame(af, MessageManager.formatMessage("label.translation_of_params", new String[]{this.getTitle()}),
- DEFAULT_WIDTH, DEFAULT_HEIGHT);
+ Desktop.addInternalFrame(af, MessageManager.formatMessage(
+ "label.translation_of_params", new String[]
+ { this.getTitle() }), DEFAULT_WIDTH, DEFAULT_HEIGHT);
}
}
|| JOptionPane
.showConfirmDialog(
this,
- MessageManager.formatMessage("label.automatically_associate_pdb_files_with_sequences_same_name",
- new String[]{Integer.valueOf(filesmatched.size()).toString()}),
- MessageManager.getString("label.automatically_associate_pdb_files_by_name"),
+ MessageManager
+ .formatMessage(
+ "label.automatically_associate_pdb_files_with_sequences_same_name",
+ new String[]
+ { Integer.valueOf(
+ filesmatched
+ .size())
+ .toString() }),
+ MessageManager
+ .getString("label.automatically_associate_pdb_files_by_name"),
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
{
"AUTOASSOCIATE_PDBANDSEQS_IGNOREOTHERS", false) || JOptionPane
.showConfirmDialog(
this,
- MessageManager.formatMessage("label.ignore_unmatched_dropped_files_info", new String[]{Integer.valueOf(filesnotmatched.size()).toString()}),
- MessageManager.getString("label.ignore_unmatched_dropped_files"),
+ MessageManager
+ .formatMessage(
+ "label.ignore_unmatched_dropped_files_info",
+ new String[]
+ { Integer.valueOf(
+ filesnotmatched
+ .size())
+ .toString() }),
+ MessageManager
+ .getString("label.ignore_unmatched_dropped_files"),
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION))
{
return;
tcoffeeColour.setSelected(true);
changeColour(new TCoffeeColourScheme(viewport.getAlignment()));
isAnnotation = true;
- statusBar.setText(MessageManager.getString("label.successfully_pasted_tcoffee_scores_to_alignment"));
+ statusBar
+ .setText(MessageManager
+ .getString("label.successfully_pasted_tcoffee_scores_to_alignment"));
}
else
{
JOptionPane
.showMessageDialog(
Desktop.desktop,
- tcf.getWarningMessage() == null ? MessageManager.getString("label.check_file_matches_sequence_ids_alignment")
+ tcf.getWarningMessage() == null ? MessageManager
+ .getString("label.check_file_matches_sequence_ids_alignment")
: tcf.getWarningMessage(),
- MessageManager.getString("label.problem_reading_tcoffee_score_file"),
+ MessageManager
+ .getString("label.problem_reading_tcoffee_score_file"),
JOptionPane.WARNING_MESSAGE);
}
}
if (SwingUtilities.isRightMouseButton(e))
{
String reply = JOptionPane.showInternalInputDialog(this,
- MessageManager.getString("label.enter_view_name"), MessageManager.getString("label.enter_view_name"),
+ MessageManager.getString("label.enter_view_name"),
+ MessageManager.getString("label.enter_view_name"),
JOptionPane.QUESTION_MESSAGE);
if (reply != null)
// TODO We probably want to store a sequence database checklist in
// preferences and have checkboxes.. rather than individual sources selected
// here
- final JMenu rfetch = new JMenu(MessageManager.getString("action.fetch_db_references"));
- rfetch.setToolTipText(MessageManager.getString("label.retrieve_parse_sequence_database_records_alignment_or_selected_sequences"));
+ final JMenu rfetch = new JMenu(
+ MessageManager.getString("action.fetch_db_references"));
+ rfetch.setToolTipText(MessageManager
+ .getString("label.retrieve_parse_sequence_database_records_alignment_or_selected_sequences"));
webService.add(rfetch);
- final JCheckBoxMenuItem trimrs = new JCheckBoxMenuItem(MessageManager.getString("option.trim_retrieved_seqs"));
- trimrs.setToolTipText(MessageManager.getString("label.trim_retrieved_sequences"));
+ final JCheckBoxMenuItem trimrs = new JCheckBoxMenuItem(
+ MessageManager.getString("option.trim_retrieved_seqs"));
+ trimrs.setToolTipText(MessageManager
+ .getString("label.trim_retrieved_sequences"));
trimrs.setSelected(Cache.getDefault("TRIM_FETCHED_DATASET_SEQS", true));
trimrs.addActionListener(new ActionListener()
{
- public void actionPerformed(ActionEvent e) {
- trimrs.setSelected(trimrs.isSelected());
- Cache.setProperty("TRIM_FETCHED_DATASET_SEQS", Boolean.valueOf(trimrs.isSelected()).toString());
- };
+ public void actionPerformed(ActionEvent e)
+ {
+ trimrs.setSelected(trimrs.isSelected());
+ Cache.setProperty("TRIM_FETCHED_DATASET_SEQS",
+ Boolean.valueOf(trimrs.isSelected()).toString());
+ };
});
rfetch.add(trimrs);
- JMenuItem fetchr = new JMenuItem(MessageManager.getString("label.standard_databases"));
- fetchr.setToolTipText(MessageManager.getString("label.fetch_embl_uniprot"));
+ JMenuItem fetchr = new JMenuItem(
+ MessageManager.getString("label.standard_databases"));
+ fetchr.setToolTipText(MessageManager
+ .getString("label.fetch_embl_uniprot"));
fetchr.addActionListener(new ActionListener()
{
.toArray(new DbSourceProxy[0]);
// fetch all entry
DbSourceProxy src = otherdb.get(0);
- fetchr = new JMenuItem(MessageManager.formatMessage("label.fetch_all_param", new String[]{src.getDbSource()}));
+ fetchr = new JMenuItem(MessageManager.formatMessage(
+ "label.fetch_all_param", new String[]
+ { src.getDbSource() }));
fetchr.addActionListener(new ActionListener()
{
@Override
++i;
if (++icomp >= mcomp || i == (otherdb.size()))
{
- ifetch.setText(MessageManager.formatMessage("label.source_to_target",imname,sname));
+ ifetch.setText(MessageManager.formatMessage(
+ "label.source_to_target", imname, sname));
dfetch.add(ifetch);
ifetch = new JMenu();
imname = null;
++dbi;
if (comp >= mcomp || dbi >= (dbclasses.length))
{
- dfetch.setText(MessageManager.formatMessage("label.source_to_target",mname,dbclass));
+ dfetch.setText(MessageManager.formatMessage(
+ "label.source_to_target", mname, dbclass));
rfetch.add(dfetch);
dfetch = new JMenu();
mname = null;
@Override
protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
{
- if (avc.makeGroupsFromSelection()) {
+ if (avc.makeGroupsFromSelection())
+ {
PaintRefresher.Refresh(this, viewport.getSequenceSetId());
alignPanel.updateAnnotation();
alignPanel.paintAlignment(true);
centreColumnLabels = centrecolumnlabels;
}
-
/**
* enable or disable the display of Database Cross References in the sequence
* ID tooltip
protected void validateAnnotationDimensions(boolean adjustPanelHeight)
{
int height = annotationPanel.adjustPanelHeight();
-
- int theight = av.getCharHeight() * (av.getAlignment().getHeight() + (!av.hasHiddenRows() ? 0 : av.getAlignment().getHiddenSequences().getSize()));
- float sscaling = (float) (theight/(1.0*theight+height));
- float ascaling=(float)(height*1.0/alignFrame.getHeight());
+
+ int theight = av.getCharHeight()
+ * (av.getAlignment().getHeight() + (!av.hasHiddenRows() ? 0
+ : av.getAlignment().getHiddenSequences().getSize()));
+ float sscaling = (float) (theight / (1.0 * theight + height));
+ float ascaling = (float) (height * 1.0 / alignFrame.getHeight());
int rheight = alignFrame.getHeight() - height - av.getCharHeight();
if (adjustPanelHeight)
{
- // NOTE: this logic is different in the applet. Need a better algorithm to define behaviour
+ // NOTE: this logic is different in the applet. Need a better algorithm to
+ // define behaviour
// try and set height according to alignment
- if (ascaling>0 && sscaling < 0.5)
+ if (ascaling > 0 && sscaling < 0.5)
{
// if the alignment is too big then
// default is 0.5 split
}
else
{
- // if space for more than one sequence row left when annotation is fully displayed then set height to annotation height
- // otherwise, leave at least two lines of sequence shown.
- height = (rheight>av.getCharHeight()) ? height : (-av.getCharHeight() * 3
- + (int) (alignFrame.getHeight() * (1 - sscaling)));
+ // if space for more than one sequence row left when annotation is fully
+ // displayed then set height to annotation height
+ // otherwise, leave at least two lines of sequence shown.
+ height = (rheight > av.getCharHeight()) ? height
+ : (-av.getCharHeight() * 3 + (int) (alignFrame.getHeight() * (1 - sscaling)));
}
}
else
seqPanel.seqCanvas.fastPaint(scrollX, scrollY);
scalePanel.repaint();
- if (av.getShowAnnotation() && scrollX!=0)
+ if (av.getShowAnnotation() && scrollX != 0)
{
annotationPanel.fastPaint(scrollX);
}
void makeAlignmentImage(int type, File file)
{
long progress = System.currentTimeMillis();
- boolean headless = (System.getProperty("java.awt.headless") != null
- && System.getProperty("java.awt.headless").equals("true"));
+ boolean headless = (System.getProperty("java.awt.headless") != null && System
+ .getProperty("java.awt.headless").equals("true"));
if (alignFrame != null && !headless)
{
alignFrame.setProgressBar("Saving "
jalview.datamodel.AlignmentAnnotation currentAnnotation;
boolean adjusting = false;
+
/**
- * enabled if the user is dragging the slider - try to keep updates to a minimun
+ * enabled if the user is dragging the slider - try to keep updates to a
+ * minimun
*/
boolean sliderDragging = false;
frame = new JInternalFrame();
frame.setContentPane(this);
frame.setLayer(JLayeredPane.PALETTE_LAYER);
- Desktop.addInternalFrame(frame, MessageManager.getString("label.colour_by_annotation"), 520, 215);
+ Desktop.addInternalFrame(frame,
+ MessageManager.getString("label.colour_by_annotation"), 520,
+ 215);
slider.addChangeListener(new ChangeListener()
{
@Override
public void mousePressed(MouseEvent e)
{
- sliderDragging=true;
+ sliderDragging = true;
super.mousePressed(e);
}
@Override
public void mouseDragged(MouseEvent e)
{
- sliderDragging=true;
+ sliderDragging = true;
super.mouseDragged(e);
}
+
public void mouseReleased(MouseEvent evt)
{
if (sliderDragging)
{
- sliderDragging=false;
+ sliderDragging = false;
valueChanged(true);
}
ap.paintAlignment(true);
if (oldcs instanceof AnnotationColourGradient)
{
AnnotationColourGradient acg = (AnnotationColourGradient) oldcs;
- currentColours.setSelected(acg.isPredefinedColours() || acg.getBaseColour()!=null);
- if (!acg.isPredefinedColours() && acg.getBaseColour()==null)
+ currentColours.setSelected(acg.isPredefinedColours()
+ || acg.getBaseColour() != null);
+ if (!acg.isPredefinedColours() && acg.getBaseColour() == null)
{
minColour.setBackground(acg.getMinColour());
maxColour.setBackground(acg.getMaxColour());
}
seqAssociated.setSelected(acg.isSeqAssociated());
-
+
}
annotations = new JComboBox(
getAnnotationItems(seqAssociated.isSelected()));
- threshold.addItem(MessageManager.getString("label.threshold_feature_no_thereshold"));
- threshold.addItem(MessageManager.getString("label.threshold_feature_above_thereshold"));
- threshold.addItem(MessageManager.getString("label.threshold_feature_below_thereshold"));
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_no_thereshold"));
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_above_thereshold"));
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_below_thereshold"));
if (oldcs instanceof AnnotationColourGradient)
{
System.arraycopy(anmap, 0, annmap, 0, annmap.length);
return list;
}
+
private void setDefaultMinMax()
{
minColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MIN",
});
defColours.setOpaque(false);
defColours.setText(MessageManager.getString("action.set_defaults"));
- defColours
- .setToolTipText(MessageManager.getString("label.reset_min_max_colours_to_defaults"));
+ defColours.setToolTipText(MessageManager
+ .getString("label.reset_min_max_colours_to_defaults"));
defColours.addActionListener(new ActionListener()
{
thresholdValue.setColumns(7);
currentColours.setFont(JvSwingUtils.getLabelFont());
currentColours.setOpaque(false);
- currentColours.setText(MessageManager.getString("label.use_original_colours"));
+ currentColours.setText(MessageManager
+ .getString("label.use_original_colours"));
currentColours.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
thresholdIsMin.setBackground(Color.white);
thresholdIsMin.setFont(JvSwingUtils.getLabelFont());
- thresholdIsMin.setText(MessageManager.getString("label.threshold_minmax"));
+ thresholdIsMin.setText(MessageManager
+ .getString("label.threshold_minmax"));
thresholdIsMin.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
});
seqAssociated.setBackground(Color.white);
seqAssociated.setFont(JvSwingUtils.getLabelFont());
- seqAssociated.setText(MessageManager.getString("label.per_sequence_only"));
+ seqAssociated.setText(MessageManager
+ .getString("label.per_sequence_only"));
seqAssociated.addActionListener(new ActionListener()
{
.getSelectedIndex()]];
int aboveThreshold = -1;
- if (threshold.getSelectedIndex()==1)
+ if (threshold.getSelectedIndex() == 1)
{
aboveThreshold = AnnotationColourGradient.ABOVE_THRESHOLD;
}
- else if (threshold.getSelectedIndex()==2)
+ else if (threshold.getSelectedIndex() == 2)
{
aboveThreshold = AnnotationColourGradient.BELOW_THRESHOLD;
}
{
return;
}
- // TODO: JAL-1327 only update visible annotation thresholds if allAnnotation is false, since we only need to provide a quick visual indicator
+ // TODO: JAL-1327 only update visible annotation thresholds if allAnnotation
+ // is false, since we only need to provide a quick visual indicator
float thr = currentAnnotation.threshold.value;
for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
try
{
cap.setText(text);
- Desktop.addInternalFrame(cap, (features ? MessageManager.formatMessage("label.features_for_params", new String[]{ap.alignFrame.getTitle()})
- : MessageManager.formatMessage("label.annotations_for_params", new String[]{ap.alignFrame.getTitle()})), 600, 500);
+ Desktop.addInternalFrame(
+ cap,
+ (features ? MessageManager.formatMessage(
+ "label.features_for_params", new String[]
+ { ap.alignFrame.getTitle() }) : MessageManager
+ .formatMessage("label.annotations_for_params",
+ new String[]
+ { ap.alignFrame.getTitle() })), 600, 500);
} catch (OutOfMemoryError oom)
{
- new OOMWarning((features ? MessageManager.formatMessage("label.generating_features_for_params", new String[]{ap.alignFrame.getTitle()}) : MessageManager.formatMessage("label.generating_annotations_for_params", new String[]{ap.alignFrame.getTitle()}))
- , oom);
+ new OOMWarning((features ? MessageManager.formatMessage(
+ "label.generating_features_for_params", new String[]
+ { ap.alignFrame.getTitle() }) : MessageManager.formatMessage(
+ "label.generating_annotations_for_params", new String[]
+ { ap.alignFrame.getTitle() })), oom);
cap.dispose();
}
return;
}
- JPopupMenu pop = new JPopupMenu(MessageManager.getString("label.annotations"));
+ JPopupMenu pop = new JPopupMenu(
+ MessageManager.getString("label.annotations"));
JMenuItem item = new JMenuItem(ADDNEW);
item.addActionListener(this);
pop.add(item);
}
/**
- * Draw the full set of annotation Labels for the alignment at the given cursor
+ * Draw the full set of annotation Labels for the alignment at the given
+ * cursor
+ *
+ * @param g
+ * Graphics2D instance (needed for font scaling)
+ * @param width
+ * Width for scaling labels
*
- * @param g Graphics2D instance (needed for font scaling)
- * @param width Width for scaling labels
- *
*/
public void drawComponent(Graphics g, int width)
{
}
private final boolean debugRedraw = false;
+
/**
- * Draw the full set of annotation Labels for the alignment at the given cursor
+ * Draw the full set of annotation Labels for the alignment at the given
+ * cursor
*
- * @param g Graphics2D instance (needed for font scaling)
- * @param clip - true indicates that only current visible area needs to be rendered
- * @param width Width for scaling labels
+ * @param g
+ * Graphics2D instance (needed for font scaling)
+ * @param clip
+ * - true indicates that only current visible area needs to be
+ * rendered
+ * @param width
+ * Width for scaling labels
*/
public void drawComponent(Graphics g, boolean clip, int width)
{
g.translate(0, scrollOffset);
g.setColor(Color.black);
-
+
AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
int fontHeight = g.getFont().getSize();
int y = 0;
Font baseFont = g.getFont();
FontMetrics baseMetrics = fm;
int ofontH = fontHeight;
- int sOffset=0;
+ int sOffset = 0;
int visHeight = 0;
- int[] visr = (ap!=null && ap.annotationPanel!=null) ? ap.annotationPanel.getVisibleVRange() : null;
- if (clip && visr!=null){
- sOffset = visr[0];
+ int[] visr = (ap != null && ap.annotationPanel != null) ? ap.annotationPanel
+ .getVisibleVRange() : null;
+ if (clip && visr != null)
+ {
+ sOffset = visr[0];
visHeight = visr[1];
}
- boolean visible = true,before=false,after=false;
+ boolean visible = true, before = false, after = false;
if (aa != null)
{
hasHiddenRows = false;
- int olY=0;
+ int olY = 0;
for (int i = 0; i < aa.length; i++)
{
visible = true;
hasHiddenRows = true;
continue;
}
- olY=y;
+ olY = y;
y += aa[i].height;
- if (clip) {if (y<sOffset)
+ if (clip)
{
- if (!before)
+ if (y < sOffset)
{
- if (debugRedraw) {
- System.out.println("before vis: "+i);
+ if (!before)
+ {
+ if (debugRedraw)
+ {
+ System.out.println("before vis: " + i);
+ }
+ before = true;
}
- before=true;
+ // don't draw what isn't visible
+ continue;
}
- // don't draw what isn't visible
- continue;
- }
- if (olY>visHeight)
- {
-
- if (!after)
+ if (olY > visHeight)
{
- if (debugRedraw) {
- System.out.println("Scroll offset: "+sOffset+" after vis: "+i);
+
+ if (!after)
+ {
+ if (debugRedraw)
+ {
+ System.out.println("Scroll offset: " + sOffset
+ + " after vis: " + i);
+ }
+ after = true;
}
- after=true;
+ // don't draw what isn't visible
+ continue;
}
- // don't draw what isn't visible
- continue;
- }}
+ }
g.setColor(Color.black);
offset = -aa[i].height / 2;
if (aa[i].graphGroup > -1)
{
int groupSize = 0;
- // TODO: JAL-1291 revise rendering model so the graphGroup map is computed efficiently for all visible labels
+ // TODO: JAL-1291 revise rendering model so the graphGroup map is
+ // computed efficiently for all visible labels
for (int gg = 0; gg < aa.length; gg++)
{
if (aa[gg].graphGroup == aa[i].graphGroup)
if (!av.wrapAlignment && ((aa == null) || (aa.length < 1)))
{
g.drawString(MessageManager.getString("label.right_click"), 2, 8);
- g.drawString(MessageManager.getString("label.to_add_annotation"), 2, 18);
+ g.drawString(MessageManager.getString("label.to_add_annotation"), 2,
+ 18);
}
}
}
else if (evt.getActionCommand().equals(LABEL))
{
String exMesg = collectAnnotVals(anot, av.getColumnSelection(), LABEL);
- String label = JOptionPane.showInputDialog(this, MessageManager.getString("label.enter_label"),
- exMesg);
+ String label = JOptionPane.showInputDialog(this,
+ MessageManager.getString("label.enter_label"), exMesg);
if (label == null)
{
aa[activeRow].hasIcons = true;
}
- String label = JOptionPane.showInputDialog(
- MessageManager.getString("label.enter_label_for_the_structure"), symbol);
+ String label = JOptionPane.showInputDialog(MessageManager
+ .getString("label.enter_label_for_the_structure"), symbol);
if (label == null)
{
aa[activeRow].hasText = true;
if (evt.getActionCommand().equals(STEM))
{
- aa[activeRow].showAllColLabels=true;
+ aa[activeRow].showAllColLabels = true;
}
}
for (int i = 0; i < av.getColumnSelection().size(); i++)
anot[index].secondaryStructure = type;
anot[index].displayCharacter = label;
-
+
}
}
av.getAlignment().validateAnnotation(aa[activeRow]);
ap.alignmentChanged();
-
+
adjustPanelHeight();
repaint();
return;
}
- JPopupMenu pop = new JPopupMenu(MessageManager.getString("label.structure_type"));
+ JPopupMenu pop = new JPopupMenu(
+ MessageManager.getString("label.structure_type"));
JMenuItem item;
/*
* Just display the needed structure options
&& aa[row].annotations[res].description != null
&& aa[row].annotations[res].description.length() > 0)
{
- this.setToolTipText("<html>"+JvSwingUtils.wrapTooltip(aa[row].annotations[res].description)+"</html>");
+ this.setToolTipText("<html>"
+ + JvSwingUtils
+ .wrapTooltip(aa[row].annotations[res].description)
+ + "</html>");
}
else
{
@Override
public void mouseClicked(MouseEvent evt)
{
-// if (activeRow != -1)
-// {
-// AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
-// AlignmentAnnotation anot = aa[activeRow];
-// }
+ // if (activeRow != -1)
+ // {
+ // AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
+ // AlignmentAnnotation anot = aa[activeRow];
+ // }
}
// TODO mouseClicked-content and drawCursor are quite experimental!
imageFresh = false;
g.drawImage(image, 0, 0, this);
}
+
/**
* set true to enable redraw timing debug output on stderr
*/
private final boolean debugRedraw = false;
+
/**
* non-Thread safe repaint
*
repaint();
return;
}
- long stime=System.currentTimeMillis();
+ long stime = System.currentTimeMillis();
gg.copyArea(0, 0, imgWidth, getHeight(), -horizontal * av.charWidth, 0);
- long mtime=System.currentTimeMillis();
+ long mtime = System.currentTimeMillis();
int sr = av.startRes;
int er = av.endRes + 1;
int transX = 0;
drawComponent(gg, sr, er);
gg.translate(-transX, 0);
- long dtime=System.currentTimeMillis();
+ long dtime = System.currentTimeMillis();
fastPaint = true;
repaint();
- long rtime=System.currentTimeMillis();
- if (debugRedraw) {
- System.err.println("Scroll:\t"+horizontal+"\tCopyArea:\t"+(mtime-stime)+"\tDraw component:\t"+(dtime-mtime)+"\tRepaint call:\t"+(rtime-dtime));
+ long rtime = System.currentTimeMillis();
+ if (debugRedraw)
+ {
+ System.err.println("Scroll:\t" + horizontal + "\tCopyArea:\t"
+ + (mtime - stime) + "\tDraw component:\t" + (dtime - mtime)
+ + "\tRepaint call:\t" + (rtime - dtime));
}
}
}
fadedImage = null;
}
-
+
g.setColor(Color.white);
g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getHeight());
g.setColor(Color.black);
if (av.validCharWidth)
{
- g.drawString(MessageManager.getString("label.alignment_has_no_annotations"), 20, 15);
+ g.drawString(MessageManager
+ .getString("label.alignment_has_no_annotations"), 20, 15);
}
return;
{
return imgWidth;
}
+
private int[] bounds = new int[2];
+
@Override
public int[] getVisibleVRange()
{
- if (ap!=null && ap.alabels!=null)
+ if (ap != null && ap.alabels != null)
{
- int sOffset=-ap.alabels.scrollOffset;
- int visHeight = sOffset+ap.annotationSpaceFillerHolder.getHeight();
- bounds[0] = sOffset; bounds[1]=visHeight;
- return bounds;
- } else return null;
+ int sOffset = -ap.alabels.scrollOffset;
+ int visHeight = sOffset + ap.annotationSpaceFillerHolder.getHeight();
+ bounds[0] = sOffset;
+ bounds[1] = visHeight;
+ return bounds;
+ }
+ else
+ return null;
}
}
public void itemStateChanged(ItemEvent e)
{
alignStructs.setEnabled(_alignwith.size() > 0);
- alignStructs.setToolTipText(MessageManager.formatMessage("label.align_structures_using_linked_alignment_views", new String[] {new Integer(_alignwith.size()).toString()}));
+ alignStructs.setToolTipText(MessageManager
+ .formatMessage(
+ "label.align_structures_using_linked_alignment_views",
+ new String[]
+ { new Integer(_alignwith.size()).toString() }));
}
});
handler.itemStateChanged(null);
if (alreadyMapped != null)
{
int option = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
- MessageManager.formatMessage("label.pdb_entry_is_already_displayed", new String[]{pdbentry.getId()}),
- MessageManager.formatMessage("label.map_sequences_to_visible_window", new String[]{pdbentry.getId()}),
- JOptionPane.YES_NO_OPTION);
+ MessageManager.formatMessage(
+ "label.pdb_entry_is_already_displayed", new String[]
+ { pdbentry.getId() }), MessageManager.formatMessage(
+ "label.map_sequences_to_visible_window", new String[]
+ { pdbentry.getId() }), JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION)
{
{
AppJmol topJmol = (AppJmol) jm.nextElement();
// TODO: highlight topJmol in view somehow
- int option = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
- MessageManager.formatMessage("label.add_pdbentry_to_view", new String[]{pdbentry.getId(),topJmol.getTitle()}),
- MessageManager.getString("label.align_to_existing_structure_view"),
- JOptionPane.YES_NO_OPTION);
+ int option = JOptionPane
+ .showInternalConfirmDialog(
+ Desktop.desktop,
+ MessageManager.formatMessage(
+ "label.add_pdbentry_to_view", new String[]
+ { pdbentry.getId(), topJmol.getTitle() }),
+ MessageManager
+ .getString("label.align_to_existing_structure_view"),
+ JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION)
{
topJmol.useAlignmentPanelForSuperposition(ap);
{
return;
}
- JMenuItem menuItem = new JMenuItem(MessageManager.getString("label.all"));
+ JMenuItem menuItem = new JMenuItem(
+ MessageManager.getString("label.all"));
menuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent evt)
if (errormsgs.length() > 0)
{
- JOptionPane.showInternalMessageDialog(Desktop.desktop,
- MessageManager.formatMessage("label.pdb_entries_couldnt_be_retrieved", new String[]{errormsgs.toString()}),
- MessageManager.getString("label.couldnt_load_file"), JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager
+ .formatMessage("label.pdb_entries_couldnt_be_retrieved",
+ new String[]
+ { errormsgs.toString() }), MessageManager
+ .getString("label.couldnt_load_file"),
+ JOptionPane.ERROR_MESSAGE);
}
long lastnotify = jmb.getLoadNotifiesHandled();
// need to wait around until script has finished
while (addingStructures ? lastnotify >= jmb.getLoadNotifiesHandled()
- : (jmb.isFinishedInit() && jmb.getPdbFile()!=null && jmb.getPdbFile().length != jmb.pdbentry.length))
+ : (jmb.isFinishedInit() && jmb.getPdbFile() != null && jmb
+ .getPdbFile().length != jmb.pdbentry.length))
{
try
{
cap.dispose();
return;
}
- jalview.gui.Desktop.addInternalFrame(cap, MessageManager.getString("label.pdb_sequence_mapping"),
- 550, 600);
+ jalview.gui.Desktop.addInternalFrame(cap,
+ MessageManager.getString("label.pdb_sequence_mapping"), 550,
+ 600);
}
/**
g.fillRect(0, 0, currentSize.width, currentSize.height);
g.setColor(Color.white);
g.setFont(new Font("Verdana", Font.BOLD, 14));
- g.drawString(MessageManager.getString("label.error_loading_file") + "...", 20, currentSize.height / 2);
+ g.drawString(MessageManager.getString("label.error_loading_file")
+ + "...", 20, currentSize.height / 2);
StringBuffer sb = new StringBuffer();
int lines = 0;
for (int e = 0; e < jmb.pdbentry.length; e++)
g.fillRect(0, 0, currentSize.width, currentSize.height);
g.setColor(Color.white);
g.setFont(new Font("Verdana", Font.BOLD, 14));
- g.drawString(MessageManager.getString("label.retrieving_pdb_data"), 20, currentSize.height / 2);
+ g.drawString(MessageManager.getString("label.retrieving_pdb_data"),
+ 20, currentSize.height / 2);
}
else
{
String struc, String name, AlignmentPanel ap)
{
-// System.out.println("1:"+sname);
-// System.out.println("2:"+seq);
-// System.out.println("3:"+strucseq);
-// System.out.println("4:"+struc);
-// System.out.println("5:"+name);
-// System.out.println("6:"+ap);
+ // System.out.println("1:"+sname);
+ // System.out.println("2:"+seq);
+ // System.out.println("3:"+strucseq);
+ // System.out.println("4:"+struc);
+ // System.out.println("5:"+name);
+ // System.out.println("6:"+ap);
this.ap = ap;
ArrayList<RNA> rnaList = new ArrayList<RNA>();
RNA rna1 = new RNA(name);
{
rna1.setRNA(strucseq, replaceOddGaps(struc));
-// System.out.println("The sequence is :"+rna1.getSeq());
-// System.out.println("The sequence is:"+struc);
-// System.out.println("The sequence is:"+replaceOddGaps(struc).toString());
+ // System.out.println("The sequence is :"+rna1.getSeq());
+ // System.out.println("The sequence is:"+struc);
+ // System.out.println("The sequence is:"+replaceOddGaps(struc).toString());
} catch (ExceptionUnmatchedClosingParentheses e2)
{
e2.printStackTrace();
RNA trim = trimRNA(rna1, "trimmed " + sname);
rnaList.add(trim);
rnaList.add(rna1);
-
+
rnas.put(seq, rna1);
rnas.put(seq, trim);
rna1.setName(sname + " (with gaps)");
{
seqs.put(trim, seq);
seqs.put(rna1, seq);
-
+
/**
* if (false || seq.getStart()!=1) { for (RNA rshift:rnaList) { ShiftList
* shift=offsets.get(rshift); if (shift==null) { offsets.put(rshift,
// vab = new AppVarnaBinding(seq,struc);
this.name = sname + " trimmed to " + name;
initVarna();
-
+
ssm = ap.getStructureSelectionManager();
- //System.out.println(ssm.toString());
+ // System.out.println(ssm.toString());
ssm.addStructureViewerListener(this);
ssm.addSelectionListener(this);
}
public void initVarna()
{
-
+
// vab.setFinishedInit(false);
varnaPanel = vab.get_varnaPanel();
setBackground(Color.white);
// getContentPane().add(vab.getTools(), BorderLayout.NORTH);
varnaPanel.addVARNAListener(this);
varnaPanel.addSelectionListener(this);
- jalview.gui.Desktop.addInternalFrame(this, MessageManager.formatMessage("label.varna_params", new String[]{name}),
- getBounds().width, getBounds().height);
+ jalview.gui.Desktop.addInternalFrame(this,
+ MessageManager.formatMessage("label.varna_params", new String[]
+ { name }), getBounds().width, getBounds().height);
this.pack();
showPanel(true);
-
+
}
public String replaceOddGaps(String oldStr)
public RNA trimRNA(RNA rna, String name)
{
ShiftList offset = new ShiftList();
-
+
RNA rnaTrim = new RNA(name);
try
{
public void onTranslationChanged()
{
// TODO Auto-generated method stub
-
+
}
@Override
public void onZoomLevelChanged()
{
// TODO Auto-generated method stub
-
+
}
}
private JTextField _seq = new JTextField();
- private JLabel _strLabel = new JLabel(MessageManager.getString("label.str"));
+ private JLabel _strLabel = new JLabel(
+ MessageManager.getString("label.str"));
- private JLabel _seqLabel = new JLabel(MessageManager.getString("label.seq"));
+ private JLabel _seqLabel = new JLabel(
+ MessageManager.getString("label.seq"));
- private JButton _createButton = new JButton(MessageManager.getString("action.create"));
+ private JButton _createButton = new JButton(
+ MessageManager.getString("action.create"));
- private JButton _updateButton = new JButton(MessageManager.getString("action.update"));
+ private JButton _updateButton = new JButton(
+ MessageManager.getString("action.update"));
- private JButton _deleteButton = new JButton(MessageManager.getString("action.delete"));
+ private JButton _deleteButton = new JButton(
+ MessageManager.getString("action.delete"));
- private JButton _duplicateButton = new JButton(MessageManager.getString("action.snapshot"));
+ private JButton _duplicateButton = new JButton(
+ MessageManager.getString("action.snapshot"));
protected JPanel _listPanel = new JPanel();
{
// super("VARNA in Jalview");
initVarna(seq, struc);
-
+
}
public AppVarnaBinding(ArrayList<RNA> rnaList)
private void initVarna(String seq, String str)
{
-
+
DefaultListModel dlm = new DefaultListModel();
DefaultListSelectionModel m = new DefaultListSelectionModel();
try
{
-
+
vp = new VARNAPanel("0", ".");
_RNA1.setRNA(seq, str);
_RNA1.drawRNARadiate(vp.getConfig());
private void initVarnaEdit(ArrayList<RNA> rnaInList)
{
-
+
DefaultListModel dlm = new DefaultListModel();
int marginTools = 40;
FullBackup sel = (FullBackup) _sideList.getSelectedValue();
Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
.getSize(), sel.rna.getSize());
- //vp.showRNAInterpolated(sel.rna, sel.config, map);
+ // vp.showRNAInterpolated(sel.rna, sel.config, map);
vp.showRNA(sel.rna, sel.config);
// _seq.setText(sel.rna.getSeq());
_str.setText(sel.rna.getStructDBN());
try
{
-
+
vp = new VARNAPanel("0", ".");
for (int i = 0; i < rnaInList.size(); i++)
{
rnaInList.get(i).drawRNARadiate(vp.getConfig());
-
+
}
} catch (ExceptionNonEqualLength e)
{
ops.add(_deleteButton);
ops.add(_duplicateButton);
- JLabel j = new JLabel(MessageManager.getString("label.structures_manager"), JLabel.CENTER);
+ JLabel j = new JLabel(
+ MessageManager.getString("label.structures_manager"),
+ JLabel.CENTER);
_listPanel.setLayout(new BorderLayout());
// _listPanel.add(ops, BorderLayout.SOUTH);
public void onUINewStructure(VARNAConfig v, RNA r)
{
// patch to fix infinite loop
- // The problem is that onUINewStructure is called when user clicks
+ // The problem is that onUINewStructure is called when user clicks
// check with Yann about whether Jalview should do anything with this event.
- // e.g. if user has used VARNA's menu to import a structure .. Jalview may need to be told which structure is displayed.
-
+ // e.g. if user has used VARNA's menu to import a structure .. Jalview may
+ // need to be told which structure is displayed.
+
// _rnaList.add(v, r, "", true);
}
public void onZoomLevelChanged()
{
// TODO Auto-generated method stub
-
+
}
@Override
public void onTranslationChanged()
{
// TODO Auto-generated method stub
-
+
}
}
if (prompt)
{
- reply = JOptionPane
- .showInternalInputDialog(
- Desktop.desktop,
- MessageManager.getString("label.couldnt_find_pdb_id_in_file"),
- MessageManager.getString("label.no_pdb_id_in_file"), JOptionPane.QUESTION_MESSAGE);
+ reply = JOptionPane.showInternalInputDialog(Desktop.desktop,
+ MessageManager
+ .getString("label.couldnt_find_pdb_id_in_file"),
+ MessageManager.getString("label.no_pdb_id_in_file"),
+ JOptionPane.QUESTION_MESSAGE);
}
if (reply == null)
{
if (value instanceof Channel)
{
Channel channel = (Channel) value;
- component.setText(MessageManager.formatMessage("label.channel_title_item_count", new String[]{channel.getTitle(),Integer.valueOf(channel.getUnreadItemCount()).toString()}));
+ component
+ .setText(MessageManager.formatMessage(
+ "label.channel_title_item_count",
+ new String[]
+ {
+ channel.getTitle(),
+ Integer.valueOf(channel.getUnreadItemCount())
+ .toString() }));
component.setToolTipText(channel.getURL());
}
return component;
Item item = (Item) value;
if (item.getPublishDate() != null)
{
- component.setText(MessageManager.formatMessage("label.blog_item_published_on_date", new String[]{DateFormat.getDateInstance(DateFormat.LONG, MessageManager.getLocale()).format(item.getPublishDate()).toString(),item.getTitle()}));
+ component.setText(MessageManager.formatMessage(
+ "label.blog_item_published_on_date",
+ new String[]
+ {
+ DateFormat
+ .getDateInstance(DateFormat.LONG,
+ MessageManager.getLocale())
+ .format(item.getPublishDate()).toString(),
+ item.getTitle() }));
}
component.setToolTipText(item.getLink());
if (!item.isRead())
{
if (SwingUtilities.isRightMouseButton(e))
{
- JPopupMenu popup = new JPopupMenu(MessageManager.getString("action.edit"));
- JMenuItem item = new JMenuItem(MessageManager.getString("action.copy"));
+ JPopupMenu popup = new JPopupMenu(
+ MessageManager.getString("action.edit"));
+ JMenuItem item = new JMenuItem(
+ MessageManager.getString("action.copy"));
item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
} catch (java.io.IOException ex)
{
JOptionPane.showInternalMessageDialog(Desktop.desktop,
- MessageManager.formatMessage("label.couldnt_read_pasted_text", new String[]{ex.toString()}),
- MessageManager.getString("label.error_parsing_text"), JOptionPane.WARNING_MESSAGE);
+ MessageManager.formatMessage(
+ "label.couldnt_read_pasted_text", new String[]
+ { ex.toString() }), MessageManager
+ .getString("label.error_parsing_text"),
+ JOptionPane.WARNING_MESSAGE);
}
}
AlignFrame af = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
af.currentFileFormat = format;
- Desktop.addInternalFrame(af, MessageManager.formatMessage("label.input_cut_paste_params", new String[]{format}),
- AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
- af.statusBar.setText(MessageManager.getString("label.successfully_pasted_alignment_file"));
+ Desktop.addInternalFrame(af, MessageManager.formatMessage(
+ "label.input_cut_paste_params", new String[]
+ { format }), AlignFrame.DEFAULT_WIDTH,
+ AlignFrame.DEFAULT_HEIGHT);
+ af.statusBar.setText(MessageManager
+ .getString("label.successfully_pasted_alignment_file"));
try
{
{
if (SwingUtilities.isRightMouseButton(e))
{
- JPopupMenu popup = new JPopupMenu(MessageManager.getString("action.edit"));
- JMenuItem item = new JMenuItem(MessageManager.getString("action.copy"));
+ JPopupMenu popup = new JPopupMenu(
+ MessageManager.getString("action.edit"));
+ JMenuItem item = new JMenuItem(
+ MessageManager.getString("action.copy"));
item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
if (nickName == null)
{
- fullDetails.setText(text + MessageManager.getString("label.select_das_service_from_table"));
+ fullDetails.setText(text
+ + MessageManager
+ .getString("label.select_das_service_from_table"));
return;
}
JTextField nametf = new JTextField(nickname, 40);
JTextField urltf = new JTextField(url, 40);
- JCheckBox seqs = new JCheckBox(MessageManager.getString("label.sequence_source"));
+ JCheckBox seqs = new JCheckBox(
+ MessageManager.getString("label.sequence_source"));
seqs.setSelected(seqsrc);
JPanel panel = new JPanel(new BorderLayout());
JPanel pane12 = new JPanel(new BorderLayout());
- pane12.add(new JLabel(MessageManager.getString("label.structure_manager")), BorderLayout.CENTER);
+ pane12.add(
+ new JLabel(MessageManager.getString("label.structure_manager")),
+ BorderLayout.CENTER);
pane12.add(nametf, BorderLayout.EAST);
panel.add(pane12, BorderLayout.NORTH);
pane12 = new JPanel(new BorderLayout());
- pane12.add(new JLabel(MessageManager.getString("label.url")), BorderLayout.NORTH);
+ pane12.add(new JLabel(MessageManager.getString("label.url")),
+ BorderLayout.NORTH);
pane12.add(seqs, BorderLayout.SOUTH);
pane12.add(urltf, BorderLayout.EAST);
panel.add(pane12, BorderLayout.SOUTH);
int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
- panel, MessageManager.getString("label.enter_local_das_source"),
+ panel,
+ MessageManager.getString("label.enter_local_das_source"),
JOptionPane.OK_CANCEL_OPTION);
if (reply != JOptionPane.OK_OPTION)
if (!sourceRegistry.getSource(nickname).isLocal())
{
- JOptionPane.showInternalMessageDialog(Desktop.desktop,
- MessageManager.getString("label.you_can_only_edit_or_remove_local_das_sources"),
- MessageManager.getString("label.public_das_source"),
- JOptionPane.WARNING_MESSAGE);
+ JOptionPane
+ .showInternalMessageDialog(
+ Desktop.desktop,
+ MessageManager
+ .getString("label.you_can_only_edit_or_remove_local_das_sources"),
+ MessageManager.getString("label.public_das_source"),
+ JOptionPane.WARNING_MESSAGE);
return;
}
void showPasteMenu(int x, int y)
{
JPopupMenu popup = new JPopupMenu();
- JMenuItem item = new JMenuItem(MessageManager.getString("label.paste_new_window"));
+ JMenuItem item = new JMenuItem(
+ MessageManager.getString("label.paste_new_window"));
item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent evt)
// A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
// IF JALVIEW IS RUNNING HEADLESS
// ///////////////////////////////////////////////
- if (instance == null || (System.getProperty("java.awt.headless") != null
- && System.getProperty("java.awt.headless").equals("true")))
+ if (instance == null
+ || (System.getProperty("java.awt.headless") != null && System
+ .getProperty("java.awt.headless").equals("true")))
{
return;
}
*/
public void drop(DropTargetDropEvent evt)
{
- boolean success=true;
+ boolean success = true;
Transferable t = evt.getTransferable();
java.util.List files = null;
java.util.List protocols = null;
}
} catch (Exception e)
{
- success=false;
+ success = false;
}
if (files != null)
}
} catch (Exception ex)
{
- success=false;
+ success = false;
}
}
- evt.dropComplete(success); // need this to ensure input focus is properly transfered to any new windows created
+ evt.dropComplete(success); // need this to ensure input focus is properly
+ // transfered to any new windows created
}
/**
jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
chooser.setFileView(new JalviewFileView());
- chooser.setDialogTitle(MessageManager.getString("label.open_local_file"));
+ chooser.setDialogTitle(MessageManager
+ .getString("label.open_local_file"));
chooser.setToolTipText(MessageManager.getString("action.open"));
int value = chooser.showOpenDialog(this);
.getSelectedFile().getParent());
String format = null;
- if (chooser.getSelectedFormat()!=null && chooser.getSelectedFormat().equals("Jalview"))
+ if (chooser.getSelectedFormat() != null
+ && chooser.getSelectedFormat().equals("Jalview"))
{
format = "Jalview";
}
{
// This construct allows us to have a wider textfield
// for viewing
- JLabel label = new JLabel(MessageManager.getString("label.input_file_url"));
+ JLabel label = new JLabel(
+ MessageManager.getString("label.input_file_url"));
final JComboBox history = new JComboBox();
JPanel panel = new JPanel(new GridLayout(2, 1));
}
int reply = JOptionPane.showInternalConfirmDialog(desktop, panel,
- MessageManager.getString("label.input_alignment_from_url"), JOptionPane.OK_CANCEL_OPTION);
+ MessageManager.getString("label.input_alignment_from_url"),
+ JOptionPane.OK_CANCEL_OPTION);
if (reply != JOptionPane.OK_OPTION)
{
{
JalviewFileChooser chooser = new JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
- { "jvp","jar" }, new String[]
- { "Jalview Project", "Jalview Project (old)" }, "Jalview Project");
+ { "jvp", "jar" }, new String[]
+ { "Jalview Project", "Jalview Project (old)" },
+ "Jalview Project");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Restore state");
{
if (progressPanel != null)
{
- synchronized(progressPanel) {
- progressPanel.remove(progbar);
- GridLayout gl = (GridLayout) progressPanel.getLayout();
- gl.setRows(gl.getRows() - 1);
- if (--totalProgressCount < 1)
+ synchronized (progressPanel)
{
- this.getContentPane().remove(progressPanel);
- progressPanel = null;
- }
+ progressPanel.remove(progbar);
+ GridLayout gl = (GridLayout) progressPanel.getLayout();
+ gl.setRows(gl.getRows() - 1);
+ if (--totalProgressCount < 1)
+ {
+ this.getContentPane().remove(progressPanel);
+ progressPanel = null;
+ }
}
}
validate();
fileLoadingCount--;
if (fileLoadingCount < 1)
{
- while (fileLoadingPanels.size()>0)
+ while (fileLoadingPanels.size() > 0)
{
removeProgressPanel(fileLoadingPanels.remove(0));
}
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Open a saved VAMSAS session");
- chooser.setToolTipText(MessageManager.getString("label.select_vamsas_session_opened_as_new_vamsas_session"));
+ chooser.setToolTipText(MessageManager
+ .getString("label.select_vamsas_session_opened_as_new_vamsas_session"));
int value = chooser.showOpenDialog(this);
String fle = chooser.getSelectedFile().toString();
if (!vamsasImport(chooser.getSelectedFile()))
{
- JOptionPane.showInternalMessageDialog(Desktop.desktop,
- MessageManager.formatMessage("label.couldnt_import_as_vamsas_session", new String[]{fle}),
- MessageManager.getString("label.vamsas_document_import_failed"),
- JOptionPane.ERROR_MESSAGE);
+ JOptionPane
+ .showInternalMessageDialog(
+ Desktop.desktop,
+ MessageManager.formatMessage(
+ "label.couldnt_import_as_vamsas_session",
+ new String[]
+ { fle }),
+ MessageManager
+ .getString("label.vamsas_document_import_failed"),
+ JOptionPane.ERROR_MESSAGE);
}
}
}
vamsasSave.setVisible(false);
vamsasStop.setVisible(false);
vamsasImport.setVisible(true);
- vamsasStart.setText(MessageManager.getString("label.new_vamsas_session"));
+ vamsasStart.setText(MessageManager
+ .getString("label.new_vamsas_session"));
}
public void vamsasStop_actionPerformed(ActionEvent e)
{
JMenuItem sessit = new JMenuItem();
sessit.setText(sess[i]);
- sessit.setToolTipText(MessageManager.formatMessage("label.connect_to_session", new String[]{sess[i]}));
+ sessit.setToolTipText(MessageManager.formatMessage(
+ "label.connect_to_session", new String[]
+ { sess[i] }));
final Desktop dsktp = this;
final String mysesid = sess[i];
sessit.addActionListener(new ActionListener()
FontMetrics fm = g.getFontMetrics();
if (fm != null)
{
- g.drawString(
- MessageManager.formatMessage("label.memory_stats", new String[]{df.format(totalFreeMemory),df.format(maxMemory),df.format(percentUsage)}), 10,
+ g.drawString(MessageManager.formatMessage(
+ "label.memory_stats",
+ new String[]
+ { df.format(totalFreeMemory), df.format(maxMemory),
+ df.format(percentUsage) }), 10,
getHeight() - fm.getHeight());
}
}
final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
if (handler.canCancel())
{
- JButton cancel = new JButton(MessageManager.getString("action.cancel"));
+ JButton cancel = new JButton(
+ MessageManager.getString("action.cancel"));
final IProgressIndicator us = this;
cancel.addActionListener(new ActionListener()
{
// JAL-940 - JALVIEW 1 services are now being EOLed as of JABA 2.1 release
if (true)
{
- // todo: changesupport handlers need to be transferred
- if (discoverer == null)
- {
- discoverer = new jalview.ws.jws1.Discoverer();
- // register PCS handler for desktop.
- discoverer.addPropertyChangeListener(changeSupport);
- }
- // JAL-940 - disabled JWS1 service configuration - always start discoverer
- // until we phase out completely
+ // todo: changesupport handlers need to be transferred
+ if (discoverer == null)
+ {
+ discoverer = new jalview.ws.jws1.Discoverer();
+ // register PCS handler for desktop.
+ discoverer.addPropertyChangeListener(changeSupport);
+ }
+ // JAL-940 - disabled JWS1 service configuration - always start discoverer
+ // until we phase out completely
(t0 = new Thread(discoverer)).start();
}
}
});
jLabel1.setFont(JvSwingUtils.getLabelFont());
- jLabel1.setText(MessageManager.getString("label.select_eps_character_rendering_style"));
+ jLabel1.setText(MessageManager
+ .getString("label.select_eps_character_rendering_style"));
this.setLayout(borderLayout1);
jPanel3.setBorder(BorderFactory.createEtchedBorder());
jPanel2.add(text);
threshold_actionPerformed(e);
}
});
- threshold.setToolTipText(MessageManager.getString("label.threshold_feature_display_by_score"));
- threshold.addItem(MessageManager.getString("label.threshold_feature_no_thereshold")); // index 0
- threshold.addItem(MessageManager.getString("label.threshold_feature_above_thereshold")); // index 1
- threshold.addItem(MessageManager.getString("label.threshold_feature_below_thereshold")); // index 2
+ threshold.setToolTipText(MessageManager
+ .getString("label.threshold_feature_display_by_score"));
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_no_thereshold")); // index 0
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_above_thereshold")); // index 1
+ threshold.addItem(MessageManager
+ .getString("label.threshold_feature_below_thereshold")); // index 2
jPanel3.setLayout(flowLayout2);
thresholdValue.addActionListener(new ActionListener()
{
slider.setEnabled(false);
slider.setOpaque(false);
slider.setPreferredSize(new Dimension(100, 32));
- slider.setToolTipText(MessageManager.getString("label.adjust_thereshold"));
+ slider.setToolTipText(MessageManager
+ .getString("label.adjust_thereshold"));
thresholdValue.setEnabled(false);
thresholdValue.setColumns(7);
jPanel3.setBackground(Color.white);
thresholdIsMin.setBackground(Color.white);
- thresholdIsMin.setText(MessageManager.getString("label.threshold_minmax"));
- thresholdIsMin
- .setToolTipText(MessageManager.getString("label.toggle_absolute_relative_display_threshold"));
+ thresholdIsMin.setText(MessageManager
+ .getString("label.threshold_minmax"));
+ thresholdIsMin.setToolTipText(MessageManager
+ .getString("label.toggle_absolute_relative_display_threshold"));
thresholdIsMin.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
}
});
colourByLabel.setBackground(Color.white);
- colourByLabel.setText(MessageManager.getString("label.colour_by_label"));
colourByLabel
- .setToolTipText(MessageManager.getString("label.display_features_same_type_different_label_using_different_colour"));
+ .setText(MessageManager.getString("label.colour_by_label"));
+ colourByLabel
+ .setToolTipText(MessageManager
+ .getString("label.display_features_same_type_different_label_using_different_colour"));
colourByLabel.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
public void minColour_actionPerformed()
{
Color col = JColorChooser.showDialog(this,
- MessageManager.getString("label.select_colour_minimum_value"), minColour.getBackground());
+ MessageManager.getString("label.select_colour_minimum_value"),
+ minColour.getBackground());
if (col != null)
{
minColour.setBackground(col);
public void maxColour_actionPerformed()
{
Color col = JColorChooser.showDialog(this,
- MessageManager.getString("label.select_colour_maximum_value"), maxColour.getBackground());
+ MessageManager.getString("label.select_colour_maximum_value"),
+ maxColour.getBackground());
if (col != null)
{
maxColour.setBackground(col);
}
int aboveThreshold = AnnotationColourGradient.NO_THRESHOLD;
- if (threshold.getSelectedIndex()==1)
+ if (threshold.getSelectedIndex() == 1)
{
aboveThreshold = AnnotationColourGradient.ABOVE_THRESHOLD;
}
- else if (threshold.getSelectedIndex()==2)
+ else if (threshold.getSelectedIndex() == 2)
{
aboveThreshold = AnnotationColourGradient.BELOW_THRESHOLD;
}
this.transparency = fr.transparency;
this.featureOrder = fr.featureOrder;
}
+
/**
* update from another feature renderer
- * @param fr settings to copy
+ *
+ * @param fr
+ * settings to copy
*/
public void transferSettings(FeatureRenderer fr)
{
tmp = new JPanel();
panel.add(tmp);
- tmp.add(new JLabel(MessageManager.getString("label.group")+":", JLabel.RIGHT));
+ tmp.add(new JLabel(MessageManager.getString("label.group") + ":",
+ JLabel.RIGHT));
tmp.add(source);
tmp = new JPanel();
panel.add(tmp);
- tmp.add(new JLabel(MessageManager.getString("label.colour"), JLabel.RIGHT));
+ tmp.add(new JLabel(MessageManager.getString("label.colour"),
+ JLabel.RIGHT));
tmp.add(colour);
colour.setPreferredSize(new Dimension(150, 15));
colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 9));
bigPanel.add(panel, BorderLayout.NORTH);
panel = new JPanel();
- panel.add(new JLabel(MessageManager.getString("label.description"), JLabel.RIGHT));
+ panel.add(new JLabel(MessageManager.getString("label.description"),
+ JLabel.RIGHT));
description.setFont(JvSwingUtils.getTextAreaFont());
description.setLineWrap(true);
panel.add(new JScrollPane(description));
bigPanel.add(panel, BorderLayout.SOUTH);
panel = new JPanel();
- panel.add(new JLabel(MessageManager.getString("label.start"), JLabel.RIGHT));
+ panel.add(new JLabel(MessageManager.getString("label.start"),
+ JLabel.RIGHT));
panel.add(start);
- panel.add(new JLabel(MessageManager.getString("label.end"), JLabel.RIGHT));
+ panel.add(new JLabel(MessageManager.getString("label.end"),
+ JLabel.RIGHT));
panel.add(end);
bigPanel.add(panel, BorderLayout.CENTER);
}
else if (evt.getClickCount() == 2)
{
fr.ap.alignFrame.avc.markColumnsContainingFeatures(
- evt.isAltDown(),evt.isShiftDown() || evt.isMetaDown(), evt.isMetaDown(),
+ evt.isAltDown(), evt.isShiftDown() || evt.isMetaDown(),
+ evt.isMetaDown(),
(String) table.getValueAt(selectedRow, 0));
}
}
}
}
});
- table.setToolTipText("<html>"+JvSwingUtils
- .wrapTooltip("Click/drag feature types up or down to change render order.<br/>Double click to select columns containing feature in alignment/current selection<br/>Pressing Alt will select columns outside features rather than inside<br/>Pressing Shift to modify current selection (rather than clear current selection)<br/>Press CTRL or Command/Meta to toggle columns in/outside features<br/>")+"</html>");
+ table.setToolTipText("<html>"
+ + JvSwingUtils
+ .wrapTooltip("Click/drag feature types up or down to change render order.<br/>Double click to select columns containing feature in alignment/current selection<br/>Pressing Alt will select columns outside features rather than inside<br/>Pressing Shift to modify current selection (rather than clear current selection)<br/>Press CTRL or Command/Meta to toggle columns in/outside features<br/>")
+ + "</html>");
scrollPane.setViewportView(table);
dassourceBrowser = new DasSourceBrowser(this);
frame.setContentPane(this);
if (new jalview.util.Platform().isAMac())
{
- Desktop.addInternalFrame(frame, MessageManager.getString("label.sequence_feature_settings"), 475, 480);
+ Desktop.addInternalFrame(frame,
+ MessageManager.getString("label.sequence_feature_settings"),
+ 475, 480);
}
else
{
- Desktop.addInternalFrame(frame, MessageManager.getString("label.sequence_feature_settings"), 400, 450);
+ Desktop.addInternalFrame(frame,
+ MessageManager.getString("label.sequence_feature_settings"),
+ 400, 450);
}
frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
protected void popupSort(final int selectedRow, final String type,
final Object typeCol, final Hashtable minmax, int x, int y)
{
- JPopupMenu men = new JPopupMenu(MessageManager.formatMessage("label.settings_for_param", new String[]{type}));
- JMenuItem scr = new JMenuItem(MessageManager.getString("label.sort_by_score"));
+ JPopupMenu men = new JPopupMenu(MessageManager.formatMessage(
+ "label.settings_for_param", new String[]
+ { type }));
+ JMenuItem scr = new JMenuItem(
+ MessageManager.getString("label.sort_by_score"));
men.add(scr);
final FeatureSettings me = this;
scr.addActionListener(new ActionListener()
}
});
- JMenuItem dens = new JMenuItem(MessageManager.getString("label.sort_by_density"));
+ JMenuItem dens = new JMenuItem(
+ MessageManager.getString("label.sort_by_density"));
dens.addActionListener(new ActionListener()
{
});
}
}
- JMenuItem selCols = new JMenuItem(MessageManager.getString("label.select_columns_containing"));
+ JMenuItem selCols = new JMenuItem(
+ MessageManager.getString("label.select_columns_containing"));
selCols.addActionListener(new ActionListener()
{
-
+
@Override
public void actionPerformed(ActionEvent arg0)
{
- fr.ap.alignFrame.avc.markColumnsContainingFeatures(false, false, false, type);
+ fr.ap.alignFrame.avc.markColumnsContainingFeatures(false, false,
+ false, type);
}
});
- JMenuItem clearCols = new JMenuItem(MessageManager.getString("label.select_columns_not_containing"));
+ JMenuItem clearCols = new JMenuItem(
+ MessageManager.getString("label.select_columns_not_containing"));
clearCols.addActionListener(new ActionListener()
{
-
+
@Override
public void actionPerformed(ActionEvent arg0)
{
- fr.ap.alignFrame.avc.markColumnsContainingFeatures(true, false, false, type);
+ fr.ap.alignFrame.avc.markColumnsContainingFeatures(true, false,
+ false, type);
}
});
men.add(selCols);
}
});
sortByScore.setFont(JvSwingUtils.getLabelFont());
- sortByScore.setText(MessageManager.getString("label.seq_sort_by_score"));
+ sortByScore
+ .setText(MessageManager.getString("label.seq_sort_by_score"));
sortByScore.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
sortByDens.setFont(JvSwingUtils.getLabelFont());
- sortByDens.setText(MessageManager.getString("label.sequence_sort_by_density"));
+ sortByDens.setText(MessageManager
+ .getString("label.sequence_sort_by_density"));
sortByDens.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
if (!valid)
{
return null;
- } else {
+ }
+ else
+ {
gps = new String[_gps.size()];
_gps.toArray(gps);
}
public void noDasSourceActive()
{
complete();
- JOptionPane.showInternalConfirmDialog(Desktop.desktop,
- MessageManager.getString("label.no_das_sources_selected_warn"),
- MessageManager.getString("label.no_das_sources_selected_title"), JOptionPane.DEFAULT_OPTION,
- JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane
+ .showInternalConfirmDialog(
+ Desktop.desktop,
+ MessageManager
+ .getString("label.no_das_sources_selected_warn"),
+ MessageManager
+ .getString("label.no_das_sources_selected_title"),
+ JOptionPane.DEFAULT_OPTION,
+ JOptionPane.INFORMATION_MESSAGE);
}
// ///////////////////////////////////////////////////////////////////////
// 'SelectRegion' selection
if (!haveResults)
{
- JOptionPane.showInternalMessageDialog(this, MessageManager.getString("label.finished_searching"),
- null, JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane.showInternalMessageDialog(this,
+ MessageManager.getString("label.finished_searching"), null,
+ JOptionPane.INFORMATION_MESSAGE);
resIndex = -1;
seqIndex = 0;
- } else {
+ }
+ else
+ {
if (findAll)
{
// then we report the matches that were found
if (tp != null)
{
- Desktop.addInternalFrame(frame, MessageManager.getString("action.change_font_tree_panel"), 340, 170,
- false);
+ Desktop.addInternalFrame(frame,
+ MessageManager.getString("action.change_font_tree_panel"),
+ 340, 170, false);
}
else
{
- Desktop.addInternalFrame(frame, MessageManager.getString("action.change_font"), 340, 170, false);
+ Desktop.addInternalFrame(frame,
+ MessageManager.getString("action.change_font"), 340, 170,
+ false);
}
frame.setLayer(JLayeredPane.PALETTE_LAYER);
JButton getDatabaseSelectorButton()
{
- final JButton viewdbs = new JButton(MessageManager.getString("action.select_ddbb"));
+ final JButton viewdbs = new JButton(
+ MessageManager.getString("action.select_ddbb"));
viewdbs.addActionListener(new ActionListener()
{
}
else
{
- srcs.add(sfetcher.getSourceProxy((String) dmt
- .getUserObject()).get(0));
+ srcs.add(sfetcher
+ .getSourceProxy((String) dmt.getUserObject()).get(0));
forcedFirstChild = true;
}
}
if (allowMultiSelections)
{
- dbstatus.setText(MessageManager.formatMessage("label.selected_database_to_fetch_from", new String[]{Integer.valueOf(srcs.size()).toString(),(srcs.size() == 1 ? "" : "s"),(srcs.size() > 0 ? " with " + x + " test quer" + (x == 1 ? "y" : "ies") : ".")}));
+ dbstatus.setText(MessageManager.formatMessage(
+ "label.selected_database_to_fetch_from", new String[]
+ {
+ Integer.valueOf(srcs.size()).toString(),
+ (srcs.size() == 1 ? "" : "s"),
+ (srcs.size() > 0 ? " with " + x + " test quer"
+ + (x == 1 ? "y" : "ies") : ".") }));
dbstatex.setText(" ");
}
else
{
if (nm.length() > 0)
{
- dbstatus.setText(MessageManager.formatMessage("label.database_param",new String[]{nm}));
+ dbstatus.setText(MessageManager.formatMessage(
+ "label.database_param", new String[]
+ { nm }));
if (qr.length() > 0)
{
- dbstatex.setText(MessageManager.formatMessage("label.example_param", new String[]{qr}));
+ dbstatex.setText(MessageManager.formatMessage(
+ "label.example_param", new String[]
+ { qr }));
}
else
{
/**
*
- * @param supported - minimum version we are comparing against
- * @param version - version of data being processsed.
+ * @param supported
+ * - minimum version we are comparing against
+ * @param version
+ * - version of data being processsed.
* @return true if version is development/null or evaluates to the same or
* later X.Y.Z (where X,Y,Z are like [0-9]+b?[0-9]*)
*/
private boolean isVersionStringLaterThan(String supported, String version)
{
if (version == null || version.equalsIgnoreCase("DEVELOPMENT BUILD")
- || version.equalsIgnoreCase("Test") || version.equalsIgnoreCase("AUTOMATED BUILD"))
+ || version.equalsIgnoreCase("Test")
+ || version.equalsIgnoreCase("AUTOMATED BUILD"))
{
System.err.println("Assuming project file with "
+ (version == null ? "null" : version)
System.err.println("Couldn't locate Jalview XML file : " + ex
+ "\n");
JOptionPane.showInternalMessageDialog(Desktop.desktop,
- MessageManager.formatMessage("label.couldnt_locate", new String[]{file}),
- MessageManager.getString("label.url_not_found"),
+ MessageManager.formatMessage("label.couldnt_locate",
+ new String[]
+ { file }), MessageManager
+ .getString("label.url_not_found"),
JOptionPane.WARNING_MESSAGE);
}
});
return "<table width=350 border=0><tr><td>" + ttext
+ "</td></tr></table>";
}
- }
+ }
+
public static JButton makeButton(String label, String tooltip,
ActionListener action)
{
enabled.setToolTipText("<html>"
+ JvSwingUtils
- .wrapTooltip(((desc == null || desc.trim().length()==0) ? "see further details by right-clicking"
+ .wrapTooltip(((desc == null || desc.trim().length() == 0) ? "see further details by right-clicking"
: desc)
+ "<br><img src=\"" + linkImageURL + "\"/>")
+ "</html>");
}
else
{
- if (desc != null && desc.trim().length()>0)
+ if (desc != null && desc.trim().length() > 0)
{
enabled.setToolTipText("<html>"
+ JvSwingUtils.wrapTooltip(opt.getDescription())
}
-
public void resetToDefault(boolean setDefaultParams)
{
enabled.setSelected(false);
- if (option.isRequired() || (setDefaultParams && option.getValue()!=null))
+ if (option.isRequired()
+ || (setDefaultParams && option.getValue() != null))
{
// Apply default value
selectOption(option, option.getValue());
initVal = (initEnabled) ? (String) val.getSelectedItem() : null;
}
}
-
+
}
public class ParamBox extends JPanel implements ChangeListener,
{
slider.getModel().setRangeProperties(iVal, 1,
validator.getMin().intValue(),
- validator.getMax().intValue()+1, true);
+ validator.getMax().intValue() + 1, true);
}
else
{
{
slider.getModel().setRangeProperties((int) (fVal * 1000f), 1,
(int) (validator.getMin().floatValue() * 1000f),
- 1+(int) (validator.getMax().floatValue() * 1000f), true);
+ 1 + (int) (validator.getMax().floatValue() * 1000f),
+ true);
}
else
{
{
JPopupMenu mnu = new JPopupMenu();
- JMenuItem mitem = new JMenuItem(MessageManager.formatMessage("label.view_params", new String[]{finfo}));
+ JMenuItem mitem = new JMenuItem(MessageManager.formatMessage(
+ "label.view_params", new String[]
+ { finfo }));
mitem.addActionListener(new ActionListener()
{
Thread worker = new Thread(this);
worker.start();
}
+
@Override
protected void scoreMatrix_menuSelected()
{
scoreMatrixMenu.removeAll();
- for (final String sm:ResidueProperties.scoreMatrices.keySet())
+ for (final String sm : ResidueProperties.scoreMatrices.keySet())
{
if (ResidueProperties.getScoreMatrix(sm) != null)
{
}
}
}
+
public void bgcolour_actionPerformed(ActionEvent e)
{
Color col = JColorChooser.showDialog(this, "Select Background Colour",
if (getParent() == null)
{
addKeyListener(rc);
- Desktop.addInternalFrame(this, MessageManager.getString("label.principal_component_analysis"), 475,
- 450);
+ Desktop.addInternalFrame(this, MessageManager
+ .getString("label.principal_component_analysis"), 475, 450);
}
}
try
{
cap.setText(pcaModel.getDetails());
- Desktop.addInternalFrame(cap, MessageManager.getString("label.pca_details"), 500, 500);
+ Desktop.addInternalFrame(cap,
+ MessageManager.getString("label.pca_details"), 500, 500);
} catch (OutOfMemoryError oom)
{
new OOMWarning("opening PCA details", oom);
// af.addSortByOrderMenuItem(ServiceName + " Ordering",
// msaorder);
- Desktop.addInternalFrame(af, MessageManager.formatMessage("label.original_data_for_params", new String[]{this.title}),
- AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
+ Desktop.addInternalFrame(af, MessageManager.formatMessage(
+ "label.original_data_for_params", new String[]
+ { this.title }), AlignFrame.DEFAULT_WIDTH,
+ AlignFrame.DEFAULT_HEIGHT);
}
}
/*
}
}
-
public void viewMenu_menuSelected()
{
buildAssociatedViewMenu();
cap.setText(pcaModel.getPointsasCsv(false,
xCombobox.getSelectedIndex(), yCombobox.getSelectedIndex(),
zCombobox.getSelectedIndex()));
- Desktop.addInternalFrame(cap, MessageManager.formatMessage("label.points_for_params", new String[]{this.getTitle()}), 500, 500);
+ Desktop.addInternalFrame(cap, MessageManager.formatMessage(
+ "label.points_for_params", new String[]
+ { this.getTitle() }), 500, 500);
} catch (OutOfMemoryError oom)
{
new OOMWarning("exporting PCA points", oom);
cap.setText(pcaModel.getPointsasCsv(true,
xCombobox.getSelectedIndex(), yCombobox.getSelectedIndex(),
zCombobox.getSelectedIndex()));
- Desktop.addInternalFrame(cap, MessageManager.formatMessage("label.transformed_points_for_params", new String[]{this.getTitle()}),
- 500, 500);
+ Desktop.addInternalFrame(cap, MessageManager.formatMessage(
+ "label.transformed_points_for_params", new String[]
+ { this.getTitle() }), 500, 500);
} catch (OutOfMemoryError oom)
{
new OOMWarning("exporting transformed PCA points", oom);
final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
if (handler.canCancel())
{
- JButton cancel = new JButton(MessageManager.getString("action.cancel"));
+ JButton cancel = new JButton(
+ MessageManager.getString("action.cancel"));
final IProgressIndicator us = this;
cancel.addActionListener(new ActionListener()
{
import jalview.datamodel.*;
/**
- * Route datamodel/view update events for a sequence set to any display components involved
- * TODO: JV3 refactor to abstract gui/view package
+ * Route datamodel/view update events for a sequence set to any display
+ * components involved TODO: JV3 refactor to abstract gui/view package
*
* @author $author$
* @version $Revision$
AlignFrame af = new AlignFrame(new Alignment(seq),
AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
- Desktop.addInternalFrame(af, MessageManager.getString("label.pairwise_aligned_sequences"),
+ Desktop.addInternalFrame(af,
+ MessageManager.getString("label.pairwise_aligned_sequences"),
AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
}
}
protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
+
protected JRadioButtonMenuItem RNAInteractionColour = new JRadioButtonMenuItem();
// protected JRadioButtonMenuItem covariationColour = new
JMenuItem sequenceSelDetails = new JMenuItem();
SequenceI sequence;
+
JMenuItem createGroupMenuItem = new JMenuItem();
+
JMenuItem unGroupMenuItem = new JMenuItem();
JMenuItem outline = new JMenuItem();
JMenu pdbMenu = new JMenu();
JMenuItem pdbFromFile = new JMenuItem();
- // JBPNote: Commented these out - Should add these services via the web services menu system.
- // JMenuItem ContraFold = new JMenuItem();
-
- // JMenuItem RNAFold = new JMenuItem();
-
+
+ // JBPNote: Commented these out - Should add these services via the web
+ // services menu system.
+ // JMenuItem ContraFold = new JMenuItem();
+
+ // JMenuItem RNAFold = new JMenuItem();
+
JMenuItem enterPDB = new JMenuItem();
JMenuItem discoverPDB = new JMenuItem();
final String rnastruc = aa[i].getRNAStruc();
final String structureLine = aa[i].label;
menuItem = new JMenuItem();
- menuItem.setText(MessageManager.formatMessage("label.2d_rna_structure_line", new String[]{structureLine}));
+ menuItem.setText(MessageManager.formatMessage(
+ "label.2d_rna_structure_line", new String[]
+ { structureLine }));
menuItem.addActionListener(new java.awt.event.ActionListener()
-
+
{
public void actionPerformed(ActionEvent e)
{
- //System.out.println("1:"+structureLine);
- System.out.println("1:sname"+seq.getName());
- System.out.println("2:seq"+seq);
-
- //System.out.println("3:"+seq.getSequenceAsString());
- System.out.println("3:strucseq"+rnastruc);
- //System.out.println("4:struc"+seq.getRNA());
- System.out.println("5:name"+seq.getName());
- System.out.println("6:ap"+ap);
- new AppVarna(structureLine, seq, seq.getSequenceAsString(), rnastruc, seq
- .getName(), ap);
- //new AppVarna(seq.getName(),seq,rnastruc,seq.getRNA(), seq.getName(), ap);
- System.out.println("end");
+ // System.out.println("1:"+structureLine);
+ System.out.println("1:sname" + seq.getName());
+ System.out.println("2:seq" + seq);
+
+ // System.out.println("3:"+seq.getSequenceAsString());
+ System.out.println("3:strucseq" + rnastruc);
+ // System.out.println("4:struc"+seq.getRNA());
+ System.out.println("5:name" + seq.getName());
+ System.out.println("6:ap" + ap);
+ new AppVarna(structureLine, seq, seq.getSequenceAsString(),
+ rnastruc, seq.getName(), ap);
+ // new AppVarna(seq.getName(),seq,rnastruc,seq.getRNA(),
+ // seq.getName(), ap);
+ System.out.println("end");
}
});
viewStructureMenu.add(menuItem);
// TODO: make rnastrucF a bit more nice
menuItem = new JMenuItem();
- menuItem.setText(MessageManager.formatMessage("label.2d_rna_sequence_name", new String[]{seq.getName()}));
+ menuItem.setText(MessageManager.formatMessage(
+ "label.2d_rna_sequence_name", new String[]
+ { seq.getName() }));
menuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
{
// TODO: VARNA does'nt print gaps in the sequence
-
+
new AppVarna(seq.getName() + " structure", seq, seq
.getSequenceAsString(), rnastruc, seq.getName(),
ap);
}
- menuItem = new JMenuItem(MessageManager.getString("action.hide_sequences"));
+ menuItem = new JMenuItem(
+ MessageManager.getString("action.hide_sequences"));
menuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
if (ap.av.getSelectionGroup() != null
&& ap.av.getSelectionGroup().getSize() > 1)
{
- menuItem = new JMenuItem(MessageManager.formatMessage("label.represent_group_with", new String[]{seq.getName()}));
+ menuItem = new JMenuItem(MessageManager.formatMessage(
+ "label.represent_group_with", new String[]
+ { seq.getName() }));
menuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
if (ap.av.adjustForHiddenSeqs(index)
- ap.av.adjustForHiddenSeqs(index - 1) > 1)
{
- menuItem = new JMenuItem(MessageManager.getString("action.reveal_sequences"));
+ menuItem = new JMenuItem(
+ MessageManager.getString("action.reveal_sequences"));
menuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
if (ap.av.hasHiddenRows())
{
{
- menuItem = new JMenuItem(MessageManager.getString("action.reveal_all"));
+ menuItem = new JMenuItem(
+ MessageManager.getString("action.reveal_all"));
menuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
SequenceGroup sg = ap.av.getSelectionGroup();
- boolean isDefinedGroup = (sg!=null) ? ap.av.getAlignment().getGroups().contains(sg) : false;
+ boolean isDefinedGroup = (sg != null) ? ap.av.getAlignment()
+ .getGroups().contains(sg) : false;
if (sg != null && sg.getSize() > 0)
- {
- groupName.setText(MessageManager.formatMessage("label.name_param", new String[]{sg.getName()}));
- groupName.setText(MessageManager.getString("label.edit_name_and_description_current_group"));
+ {
+ groupName.setText(MessageManager.formatMessage("label.name_param",
+ new String[]
+ { sg.getName() }));
+ groupName.setText(MessageManager
+ .getString("label.edit_name_and_description_current_group"));
if (sg.cs instanceof ZappoColourScheme)
{
{
purinePyrimidineColour.setSelected(true);
}
-
-
+
/*
* else if (sg.cs instanceof CovariationColourScheme) {
* covariationColour.setSelected(true); }
buildGroupURLMenu(sg, groupLinks);
}
// Add a 'show all structures' for the current selection
- Hashtable<String, PDBEntry> pdbe = new Hashtable<String, PDBEntry>(),reppdb=new Hashtable<String,PDBEntry>();
+ Hashtable<String, PDBEntry> pdbe = new Hashtable<String, PDBEntry>(), reppdb = new Hashtable<String, PDBEntry>();
SequenceI sqass = null;
for (SequenceI sq : ap.av.getSequenceSelection())
{
.getPDBId();
if (pes != null)
{
- reppdb.put(pes.get(0).getId(),pes.get(0));
+ reppdb.put(pes.get(0).getId(), pes.get(0));
for (PDBEntry pe : pes)
{
pdbe.put(pe.getId(), pe);
if (pdbe.size() > 0)
{
final PDBEntry[] pe = pdbe.values().toArray(
- new PDBEntry[pdbe.size()]),pr = reppdb.values().toArray(
- new PDBEntry[reppdb.size()]);
- final JMenuItem gpdbview,rpdbview;
+ new PDBEntry[pdbe.size()]), pr = reppdb.values().toArray(
+ new PDBEntry[reppdb.size()]);
+ final JMenuItem gpdbview, rpdbview;
if (pdbe.size() == 1)
{
- structureMenu.add(gpdbview = new JMenuItem(MessageManager.formatMessage("label.view_structure_for", new String[]{sqass.getDisplayId(false)})));
+ structureMenu.add(gpdbview = new JMenuItem(MessageManager
+ .formatMessage("label.view_structure_for", new String[]
+ { sqass.getDisplayId(false) })));
}
else
{
- structureMenu.add(gpdbview = new JMenuItem(MessageManager.formatMessage("label.view_all_structures", new String[]{new Integer(pdbe.size()).toString()})));
+ structureMenu.add(gpdbview = new JMenuItem(MessageManager
+ .formatMessage("label.view_all_structures", new String[]
+ { new Integer(pdbe.size()).toString() })));
}
- gpdbview.setToolTipText(MessageManager.getString("label.open_new_jmol_view_with_all_structures_associated_current_selection_superimpose_using_alignment"));
+ gpdbview.setToolTipText(MessageManager
+ .getString("label.open_new_jmol_view_with_all_structures_associated_current_selection_superimpose_using_alignment"));
gpdbview.addActionListener(new ActionListener()
{
new AppJmol(ap, pe, ap.av.collateForPDB(pe));
}
});
- if (reppdb.size()>1 && reppdb.size()<pdbe.size())
+ if (reppdb.size() > 1 && reppdb.size() < pdbe.size())
{
- structureMenu.add(rpdbview = new JMenuItem(MessageManager.formatMessage("label.view_all_representative_structures", new String[]{new Integer(reppdb.size()).toString()})));
- rpdbview.setToolTipText(MessageManager.getString("label.open_new_jmol_view_with_all_representative_structures_associated_current_selection_superimpose_using_alignment"));
+ structureMenu.add(rpdbview = new JMenuItem(MessageManager
+ .formatMessage(
+ "label.view_all_representative_structures",
+ new String[]
+ { new Integer(reppdb.size()).toString() })));
+ rpdbview.setToolTipText(MessageManager
+ .getString("label.open_new_jmol_view_with_all_representative_structures_associated_current_selection_superimpose_using_alignment"));
rpdbview.addActionListener(new ActionListener()
{
createGroupMenuItem.setVisible(true);
unGroupMenuItem.setVisible(false);
jMenu1.setText(MessageManager.getString("action.edit_new_group"));
- } else {
+ }
+ else
+ {
createGroupMenuItem.setVisible(false);
unGroupMenuItem.setVisible(true);
jMenu1.setText(MessageManager.getString("action.edit_group"));
// menu appears asap
// sequence only URLs
// ID/regex match URLs
- groupLinksMenu = new JMenu(MessageManager.getString("action.group_link"));
+ groupLinksMenu = new JMenu(
+ MessageManager.getString("action.group_link"));
JMenu[] linkMenus = new JMenu[]
- { null, new JMenu(MessageManager.getString("action.ids")), new JMenu(MessageManager.getString("action.sequences")),
- new JMenu(MessageManager.getString("action.ids_sequences")) }; // three types of url that might be
- // created.
+ { null, new JMenu(MessageManager.getString("action.ids")),
+ new JMenu(MessageManager.getString("action.sequences")),
+ new JMenu(MessageManager.getString("action.ids_sequences")) }; // three
+ // types
+ // of url
+ // that
+ // might
+ // be
+ // created.
SequenceI[] seqs = ap.av.getSelectionAsNewSequence();
String[][] idandseqs = GroupUrlLink.formStrings(seqs);
Hashtable commonDbrefs = new Hashtable();
}
if (addMenu)
{
- groupLinksMenu = new JMenu(MessageManager.getString("action.group_link"));
+ groupLinksMenu = new JMenu(
+ MessageManager.getString("action.group_link"));
for (int m = 0; m < linkMenus.length; m++)
{
if (linkMenus[m] != null
private void addshowLink(JMenu linkMenu, String label, final String url)
{
JMenuItem item = new JMenuItem(label);
- item.setToolTipText(MessageManager.formatMessage("label.open_url_param", new String[]{url}));
+ item.setToolTipText(MessageManager.formatMessage(
+ "label.open_url_param", new String[]
+ { url }));
item.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
final GroupUrlLink urlgenerator, final Object[] urlstub)
{
JMenuItem item = new JMenuItem(label);
- item.setToolTipText(MessageManager.formatMessage("label.open_url_seqs_param", new Object[]{urlgenerator.getUrl_prefix(),urlgenerator.getNumberInvolved(urlstub)}));
+ item.setToolTipText(MessageManager.formatMessage(
+ "label.open_url_seqs_param",
+ new Object[]
+ { urlgenerator.getUrl_prefix(),
+ urlgenerator.getNumberInvolved(urlstub) }));
// TODO: put in info about what is being sent.
item.addActionListener(new java.awt.event.ActionListener()
{
}
});
sequenceMenu.setText(MessageManager.getString("label.sequence"));
- sequenceName.setText(MessageManager.getString("label.edit_name_description"));
+ sequenceName.setText(MessageManager
+ .getString("label.edit_name_description"));
sequenceName.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
sequenceName_actionPerformed();
}
});
- sequenceDetails.setText(MessageManager.getString("label.sequence_details") + "...");
+ sequenceDetails.setText(MessageManager
+ .getString("label.sequence_details") + "...");
sequenceDetails.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
sequenceDetails_actionPerformed();
}
});
- sequenceSelDetails.setText(MessageManager.getString("label.sequence_details") + "...");
+ sequenceSelDetails.setText(MessageManager
+ .getString("label.sequence_details") + "...");
sequenceSelDetails
.addActionListener(new java.awt.event.ActionListener()
{
}
});
PIDColour.setFocusPainted(false);
- unGroupMenuItem.setText(MessageManager.getString("action.remove_group"));
+ unGroupMenuItem
+ .setText(MessageManager.getString("action.remove_group"));
unGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
unGroupMenuItem_actionPerformed();
}
});
- createGroupMenuItem.setText(MessageManager.getString("action.create_group"));
- createGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- createGroupMenuItem_actionPerformed();
- }
- });
+ createGroupMenuItem.setText(MessageManager
+ .getString("action.create_group"));
+ createGroupMenuItem
+ .addActionListener(new java.awt.event.ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ createGroupMenuItem_actionPerformed();
+ }
+ });
outline.setText(MessageManager.getString("action.border_colour"));
outline.addActionListener(new java.awt.event.ActionListener()
outline_actionPerformed();
}
});
- nucleotideMenuItem.setText(MessageManager.getString("label.nucleotide"));
+ nucleotideMenuItem
+ .setText(MessageManager.getString("label.nucleotide"));
nucleotideMenuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
showColourText_actionPerformed();
}
});
- displayNonconserved.setText(MessageManager.getString("label.show_non_conversed"));
+ displayNonconserved.setText(MessageManager
+ .getString("label.show_non_conversed"));
displayNonconserved.setState(true);
displayNonconserved.addActionListener(new ActionListener()
{
changeCase(e);
}
});
- pdbMenu.setText(MessageManager.getString("label.associate_structure_with_sequence"));
+ pdbMenu.setText(MessageManager
+ .getString("label.associate_structure_with_sequence"));
pdbFromFile.setText(MessageManager.getString("label.from_file"));
pdbFromFile.addActionListener(new ActionListener()
{
pdbFromFile_actionPerformed();
}
});
-// RNAFold.setText("From RNA Fold with predict2D");
-// RNAFold.addActionListener(new ActionListener()
-// {
-// public void actionPerformed(ActionEvent e)
-// {
-// try {
-// RNAFold_actionPerformed();
-// } catch (Exception e1) {
-// // TODO Auto-generated catch block
-// e1.printStackTrace();
-// }
-// }
-// });
-// ContraFold.setText("From Contra Fold with predict2D");
-// ContraFold.addActionListener(new ActionListener()
-// {
-// public void actionPerformed(ActionEvent e)
-// {
-// try {
-// ContraFold_actionPerformed();
-// } catch (Exception e1) {
-// // TODO Auto-generated catch block
-// e1.printStackTrace();
-// }
-// }
-// });
+ // RNAFold.setText("From RNA Fold with predict2D");
+ // RNAFold.addActionListener(new ActionListener()
+ // {
+ // public void actionPerformed(ActionEvent e)
+ // {
+ // try {
+ // RNAFold_actionPerformed();
+ // } catch (Exception e1) {
+ // // TODO Auto-generated catch block
+ // e1.printStackTrace();
+ // }
+ // }
+ // });
+ // ContraFold.setText("From Contra Fold with predict2D");
+ // ContraFold.addActionListener(new ActionListener()
+ // {
+ // public void actionPerformed(ActionEvent e)
+ // {
+ // try {
+ // ContraFold_actionPerformed();
+ // } catch (Exception e1) {
+ // // TODO Auto-generated catch block
+ // e1.printStackTrace();
+ // }
+ // }
+ // });
enterPDB.setText(MessageManager.getString("label.enter_pdb_id"));
enterPDB.addActionListener(new ActionListener()
{
discoverPDB_actionPerformed();
}
});
- outputMenu.setText(MessageManager.getString("label.out_to_textbox") + "...");
- sequenceFeature.setText(MessageManager.getString("label.create_sequence_feature"));
+ outputMenu.setText(MessageManager.getString("label.out_to_textbox")
+ + "...");
+ sequenceFeature.setText(MessageManager
+ .getString("label.create_sequence_feature"));
sequenceFeature.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
jMenu1.setText(MessageManager.getString("label.group"));
structureMenu.setText(MessageManager.getString("label.structure"));
- viewStructureMenu.setText(MessageManager.getString("label.view_structure"));
+ viewStructureMenu.setText(MessageManager
+ .getString("label.view_structure"));
// colStructureMenu.setText("Colour By Structure");
- editSequence.setText(MessageManager.getString("label.edit_sequence") + "...");
+ editSequence.setText(MessageManager.getString("label.edit_sequence")
+ + "...");
editSequence.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
colourMenu.add(turnColour);
colourMenu.add(buriedColour);
colourMenu.add(nucleotideMenuItem);
- if (ap.getAlignment().isNucleotide()) {
- // JBPNote - commented since the colourscheme isn't functional
- // colourMenu.add(RNAInteractionColour);
- colourMenu.add(purinePyrimidineColour);
+ if (ap.getAlignment().isNucleotide())
+ {
+ // JBPNote - commented since the colourscheme isn't functional
+ // colourMenu.add(RNAInteractionColour);
+ colourMenu.add(purinePyrimidineColour);
}
// colourMenu.add(covariationColour);
colourMenu.add(userDefinedColour);
editMenu.add(lowerCase);
editMenu.add(toggle);
pdbMenu.add(pdbFromFile);
- // JBPNote: These shouldn't be added here - should appear in a generic 'apply web service to this sequence menu'
- // pdbMenu.add(RNAFold);
- // pdbMenu.add(ContraFold);
+ // JBPNote: These shouldn't be added here - should appear in a generic
+ // 'apply web service to this sequence menu'
+ // pdbMenu.add(RNAFold);
+ // pdbMenu.add(ContraFold);
pdbMenu.add(enterPDB);
pdbMenu.add(discoverPDB);
jMenu1.add(groupName);
}
});
- clustalColour.setText(MessageManager.getString("label.clustalx_colours"));
+ clustalColour.setText(MessageManager
+ .getString("label.clustalx_colours"));
clustalColour.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
taylorColour_actionPerformed();
}
});
- hydrophobicityColour.setText(MessageManager.getString("label.hydrophobicity"));
+ hydrophobicityColour.setText(MessageManager
+ .getString("label.hydrophobicity"));
hydrophobicityColour
.addActionListener(new java.awt.event.ActionListener()
{
helixColour_actionPerformed();
}
});
- strandColour.setText(MessageManager.getString("label.strand_propensity"));
+ strandColour.setText(MessageManager
+ .getString("label.strand_propensity"));
strandColour.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
buriedColour_actionPerformed();
}
});
- abovePIDColour.setText(MessageManager.getString("label.above_identity_percentage"));
+ abovePIDColour.setText(MessageManager
+ .getString("label.above_identity_percentage"));
abovePIDColour.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
abovePIDColour_actionPerformed();
}
});
- userDefinedColour.setText(MessageManager.getString("action.user_defined"));
+ userDefinedColour.setText(MessageManager
+ .getString("action.user_defined"));
userDefinedColour.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
userDefinedColour_actionPerformed(e);
}
});
- PIDColour.setText(MessageManager.getString("label.percentage_identity"));
+ PIDColour
+ .setText(MessageManager.getString("label.percentage_identity"));
PIDColour.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
BLOSUM62Colour_actionPerformed();
}
});
- purinePyrimidineColour.setText(MessageManager.getString("label.purine_pyrimidine"));
+ purinePyrimidineColour.setText(MessageManager
+ .getString("label.purine_pyrimidine"));
purinePyrimidineColour
.addActionListener(new java.awt.event.ActionListener()
{
purinePyrimidineColour_actionPerformed();
}
});
-
-
+
/*
* covariationColour.addActionListener(new java.awt.event.ActionListener() {
* public void actionPerformed(ActionEvent e) {
* covariationColour_actionPerformed(); } });
*/
- conservationMenuItem.setText(MessageManager.getString("label.conservation"));
+ conservationMenuItem.setText(MessageManager
+ .getString("label.conservation"));
conservationMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
StringBuffer contents = new StringBuffer();
for (SequenceI seq : sequences)
{
- contents.append("<p><h2>" + MessageManager.formatMessage("label.create_sequence_details_report_annotation_for", new String[]{seq.getDisplayId(true)})
- + "</h2></p><p>");
+ contents.append("<p><h2>"
+ + MessageManager
+ .formatMessage(
+ "label.create_sequence_details_report_annotation_for",
+ new String[]
+ { seq.getDisplayId(true) }) + "</h2></p><p>");
new SequenceAnnotationReport(null)
.createSequenceAnnotationReport(
contents,
}
cap.setText("<html>" + contents.toString() + "</html>");
- Desktop.instance.addInternalFrame(cap, MessageManager.formatMessage("label.sequece_details_for", (sequences.length == 1 ? new String[]{sequences[0].getDisplayId(true)}: new String[]{MessageManager.getString("label.selection")}))
- ,500, 400);
+ Desktop.instance.addInternalFrame(cap, MessageManager.formatMessage(
+ "label.sequece_details_for",
+ (sequences.length == 1 ? new String[]
+ { sequences[0].getDisplayId(true) } : new String[]
+ { MessageManager.getString("label.selection") })), 500, 400);
}
refresh();
}
-
/*
* protected void covariationColour_actionPerformed() { getGroup().cs = new
* CovariationColourScheme(sequence.getAnnotation()[0]); refresh(); }
if (conservationMenuItem.isSelected())
{
- // JBPNote: Conservation name shouldn't be i18n translated
+ // JBPNote: Conservation name shouldn't be i18n translated
Conservation c = new Conservation("Group",
ResidueProperties.propHash, 3, sg.getSequences(ap.av
.getHiddenRepSequences()), sg.getStartRes(),
SequenceGroup sg = getGroup();
EditNameDialog dialog = new EditNameDialog(sg.getName(),
- sg.getDescription(), " " + MessageManager.getString("label.group_name") + " ",
- MessageManager.getString("label.group_description") + " ", MessageManager.getString("label.edit_group_name_description"),
+ sg.getDescription(), " "
+ + MessageManager.getString("label.group_name") + " ",
+ MessageManager.getString("label.group_description") + " ",
+ MessageManager.getString("label.edit_group_name_description"),
ap.alignFrame);
if (!dialog.accept)
void sequenceName_actionPerformed()
{
EditNameDialog dialog = new EditNameDialog(sequence.getName(),
- sequence.getDescription(), " " + MessageManager.getString("label.sequence_name") + " ",
- MessageManager.getString("label.sequence_description") + " ", MessageManager.getString("label.edit_sequence_name_description"),
+ sequence.getDescription(),
+ " " + MessageManager.getString("label.sequence_name")
+ + " ",
+ MessageManager.getString("label.sequence_description") + " ",
+ MessageManager
+ .getString("label.edit_sequence_name_description"),
ap.alignFrame);
if (!dialog.accept)
{
if (dialog.getName().indexOf(" ") > -1)
{
- JOptionPane.showMessageDialog(ap,
- MessageManager.getString("label.spaces_converted_to_backslashes"),
- MessageManager.getString("label.no_spaces_allowed_sequence_name"),
- JOptionPane.WARNING_MESSAGE);
+ JOptionPane
+ .showMessageDialog(
+ ap,
+ MessageManager
+ .getString("label.spaces_converted_to_backslashes"),
+ MessageManager
+ .getString("label.no_spaces_allowed_sequence_name"),
+ JOptionPane.WARNING_MESSAGE);
}
sequence.setName(dialog.getName().replace(' ', '_'));
ap.av.setSelectionGroup(null);
refresh();
}
+
void createGroupMenuItem_actionPerformed()
{
- getGroup(); // implicitly creates group - note - should apply defaults / use standard alignment window logic for this
+ getGroup(); // implicitly creates group - note - should apply defaults / use
+ // standard alignment window logic for this
refresh();
}
protected void outline_actionPerformed()
{
SequenceGroup sg = getGroup();
- Color col = JColorChooser.showDialog(this, MessageManager.getString("label.select_outline_colour"),
+ Color col = JColorChooser.showDialog(this,
+ MessageManager.getString("label.select_outline_colour"),
Color.BLUE);
if (col != null)
jalview.util.BrowserLauncher.openURL(url);
} catch (Exception ex)
{
- JOptionPane
- .showInternalMessageDialog(
- Desktop.desktop,
- MessageManager.getString("label.web_browser_not_found_unix"),
- MessageManager.getString("label.web_browser_not_found"), JOptionPane.WARNING_MESSAGE);
+ JOptionPane.showInternalMessageDialog(Desktop.desktop,
+ MessageManager.getString("label.web_browser_not_found_unix"),
+ MessageManager.getString("label.web_browser_not_found"),
+ JOptionPane.WARNING_MESSAGE);
ex.printStackTrace();
}
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
cap.setForInput(null);
- Desktop.addInternalFrame(cap,
- MessageManager.formatMessage("label.alignment_output_command", new String[]{e.getActionCommand()}), 600, 500);
+ Desktop.addInternalFrame(cap, MessageManager.formatMessage(
+ "label.alignment_output_command", new String[]
+ { e.getActionCommand() }), 600, 500);
String[] omitHidden = null;
jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new jalview.io.JalviewFileView());
- chooser.setDialogTitle(MessageManager.formatMessage("label.select_pdb_file_for", new String[]{sequence.getDisplayId(false)}));
- chooser.setToolTipText(MessageManager.formatMessage("label.load_pdb_file_associate_with_sequence", new String[]{new Integer(sequence.getDisplayId(false)).toString()}));
+ chooser.setDialogTitle(MessageManager.formatMessage(
+ "label.select_pdb_file_for", new String[]
+ { sequence.getDisplayId(false) }));
+ chooser.setToolTipText(MessageManager.formatMessage(
+ "label.load_pdb_file_associate_with_sequence", new String[]
+ { new Integer(sequence.getDisplayId(false)).toString() }));
int value = chooser.showOpenDialog(null);
}
}
- // JBNote: commented out - these won't be instantiated here...!
-// public void RNAFold_actionPerformed() throws Exception
-// {
-// Predict2D P2D = new Predict2D();
-// P2D.getStructure2DFromRNAFold("toto");
-// }
-//
-// public void ContraFold_actionPerformed() throws Exception
-// {
-// Predict2D P2D = new Predict2D();
-// P2D.getStructure2DFromContraFold("toto");
-// }
+
+ // JBNote: commented out - these won't be instantiated here...!
+ // public void RNAFold_actionPerformed() throws Exception
+ // {
+ // Predict2D P2D = new Predict2D();
+ // P2D.getStructure2DFromRNAFold("toto");
+ // }
+ //
+ // public void ContraFold_actionPerformed() throws Exception
+ // {
+ // Predict2D P2D = new Predict2D();
+ // P2D.getStructure2DFromContraFold("toto");
+ // }
public void enterPDB_actionPerformed()
{
String id = JOptionPane.showInternalInputDialog(Desktop.desktop,
- MessageManager.getString("label.enter_pdb_id"), MessageManager.getString("label.enter_pdb_id"), JOptionPane.QUESTION_MESSAGE);
+ MessageManager.getString("label.enter_pdb_id"),
+ MessageManager.getString("label.enter_pdb_id"),
+ JOptionPane.QUESTION_MESSAGE);
if (id != null && id.length() > 0)
{
EditNameDialog dialog = new EditNameDialog(
sequence.getSequenceAsString(sg.getStartRes(),
- sg.getEndRes() + 1), null, MessageManager.getString("label.edit_sequence"), null,
- MessageManager.getString("label.edit_sequence"), ap.alignFrame);
+ sg.getEndRes() + 1), null,
+ MessageManager.getString("label.edit_sequence"), null,
+ MessageManager.getString("label.edit_sequence"),
+ ap.alignFrame);
if (dialog.accept)
{
- EditCommand editCommand = new EditCommand(MessageManager.getString("label.edit_sequences"),
+ EditCommand editCommand = new EditCommand(
+ MessageManager.getString("label.edit_sequences"),
EditCommand.REPLACE, dialog.getName().replace(' ',
ap.av.getGapCharacter()),
sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
.indexOf("SRS|http://srs.ebi.ac.uk/srsbin/cgi-bin/wgetz?-newId+(([uniprot-all:$SEQUENCE_ID$]))+-view+SwissEntry");
if (srsPos > -1)
{
- sequenceURLLinks.setElementAt(
- "EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$",
- srsPos);
+ sequenceURLLinks
+ .setElementAt(
+ "EMBL-EBI Search|http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$",
+ srsPos);
}
}
height = 460;
}
- Desktop.addInternalFrame(frame, MessageManager.getString("label.preferences"), width, height);
+ Desktop.addInternalFrame(frame,
+ MessageManager.getString("label.preferences"), width, height);
frame.setMinimumSize(new Dimension(width, height));
seqLimit.setSelected(Cache.getDefault("SHOW_JVSUFFIX", true));
while (!valid)
{
if (JOptionPane.showInternalConfirmDialog(Desktop.desktop, link,
- MessageManager.getString("label.new_sequence_url_link"), JOptionPane.OK_CANCEL_OPTION, -1,
- null) == JOptionPane.OK_OPTION)
+ MessageManager.getString("label.new_sequence_url_link"),
+ JOptionPane.OK_CANCEL_OPTION, -1, null) == JOptionPane.OK_OPTION)
{
if (link.checkValid())
{
if (index == -1)
{
JOptionPane.showInternalMessageDialog(Desktop.desktop,
- MessageManager.getString("label.no_link_selected"), MessageManager.getString("label.no_link_selected"),
+ MessageManager.getString("label.no_link_selected"),
+ MessageManager.getString("label.no_link_selected"),
JOptionPane.WARNING_MESSAGE);
return;
}
{
if (JOptionPane.showInternalConfirmDialog(Desktop.desktop, link,
- MessageManager.getString("label.new_sequence_url_link"), JOptionPane.OK_CANCEL_OPTION, -1,
- null) == JOptionPane.OK_OPTION)
+ MessageManager.getString("label.new_sequence_url_link"),
+ JOptionPane.OK_CANCEL_OPTION, -1, null) == JOptionPane.OK_OPTION)
{
if (link.checkValid())
{
if (index == -1)
{
JOptionPane.showInternalMessageDialog(Desktop.desktop,
- MessageManager.getString("label.no_link_selected"), MessageManager.getString("label.no_link_selected"),
+ MessageManager.getString("label.no_link_selected"),
+ MessageManager.getString("label.no_link_selected"),
JOptionPane.WARNING_MESSAGE);
return;
}
frame = new JInternalFrame();
frame.setContentPane(this);
- Desktop.addInternalFrame(frame, MessageManager.getString("label.redundancy_threshold_selection"), 400,
- 100, false);
+ Desktop.addInternalFrame(frame, MessageManager
+ .getString("label.redundancy_threshold_selection"), 400, 100,
+ false);
frame.addInternalFrameListener(new InternalFrameAdapter()
{
public void internalFrameClosing(InternalFrameEvent evt)
final int rdatasel = rdata.getSelectedIndex();
if (rdatasel > -1)
{
- JPopupMenu popup = new JPopupMenu(MessageManager.getString("label.select_return_type"));
+ JPopupMenu popup = new JPopupMenu(
+ MessageManager.getString("label.select_return_type"));
for (final JvDataType type : JvDataType.values())
{
popup.add(new JMenuItem(type.name())).addActionListener(
}
else
{
- parseRes.setText(MessageManager.formatMessage("label.parsing_failed_syntax_errors_shown_below_param", new String[]{rsd.getInvalidMessage()}));
+ parseRes.setText(MessageManager
+ .formatMessage(
+ "label.parsing_failed_syntax_errors_shown_below_param",
+ new String[]
+ { rsd.getInvalidMessage() }));
parseWarnings.setVisible(true);
}
} catch (Throwable e)
{
e.printStackTrace();
- parseRes.setText(MessageManager.formatMessage("label.parsing_failed_unrecoverable_exception_thrown_param", new String[]{e.toString()}));
+ parseRes.setText(MessageManager
+ .formatMessage(
+ "label.parsing_failed_unrecoverable_exception_thrown_param",
+ new String[]
+ { e.toString() }));
parseWarnings.setVisible(true);
}
}
if (points == null)
{
g.setFont(new Font("Verdana", Font.PLAIN, 18));
- g.drawString(MessageManager.getString("label.calculating_pca")+ "....", 20, getHeight() / 2);
+ g.drawString(MessageManager.getString("label.calculating_pca")
+ + "....", 20, getHeight() / 2);
}
else
{
JPopupMenu pop = new JPopupMenu();
if (reveal != null)
{
- JMenuItem item = new JMenuItem(MessageManager.getString("label.reveal"));
+ JMenuItem item = new JMenuItem(
+ MessageManager.getString("label.reveal"));
item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
if (av.getColumnSelection().getHiddenColumns().size() > 1)
{
- item = new JMenuItem(MessageManager.getString("action.reveal_all"));
+ item = new JMenuItem(
+ MessageManager.getString("action.reveal_all"));
item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
else if (av.getColumnSelection().contains(res))
{
- JMenuItem item = new JMenuItem(MessageManager.getString("label.hide_columns"));
+ JMenuItem item = new JMenuItem(
+ MessageManager.getString("label.hide_columns"));
item.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
reveal = region;
ToolTipManager.sharedInstance().registerComponent(this);
- this.setToolTipText(MessageManager.getString("label.reveal_hidden_columns"));
+ this.setToolTipText(MessageManager
+ .getString("label.reveal_hidden_columns"));
break;
}
else
if (reveal != null && reveal[0] > startx && reveal[0] < endx)
{
- gg.drawString(MessageManager.getString("label.reveal_columns"), reveal[0] * av.charWidth, 0);
+ gg.drawString(MessageManager.getString("label.reveal_columns"),
+ reveal[0] * av.charWidth, 0);
}
}
int getKeyboardNo1()
{
- try {
- if (keyboardNo1 != null)
+ try
{
- int value = Integer.parseInt(keyboardNo1.toString());
- keyboardNo1 = null;
- return value;
- }
+ if (keyboardNo1 != null)
+ {
+ int value = Integer.parseInt(keyboardNo1.toString());
+ keyboardNo1 = null;
+ return value;
+ }
} catch (Exception x)
- {}
+ {
+ }
keyboardNo1 = null;
return 1;
}
int getKeyboardNo2()
{
- try {
- if (keyboardNo2!=null){
- int value = Integer.parseInt(keyboardNo2.toString());
- keyboardNo2 = null;
- return value;
- }
+ try
+ {
+ if (keyboardNo2 != null)
+ {
+ int value = Integer.parseInt(keyboardNo2.toString());
+ keyboardNo2 = null;
+ return value;
+ }
} catch (Exception x)
- {}
+ {
+ }
keyboardNo2 = null;
return 1;
}
if (av.wrapAlignment && seq > av.getAlignment().getHeight())
{
- JOptionPane.showInternalMessageDialog(Desktop.desktop,
- MessageManager.getString("label.cannot_edit_annotations_in_wrapped_view"),
- MessageManager.getString("label.wrapped_view_no_edit"), JOptionPane.WARNING_MESSAGE);
+ JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager
+ .getString("label.cannot_edit_annotations_in_wrapped_view"),
+ MessageManager.getString("label.wrapped_view_no_edit"),
+ JOptionPane.WARNING_MESSAGE);
return;
}
dbeg.setFont(new java.awt.Font("Verdana", Font.BOLD, 11));
jLabel1.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
- jLabel1.setText(MessageManager.getString("label.separate_multiple_accession_ids"));
+ jLabel1.setText(MessageManager
+ .getString("label.separate_multiple_accession_ids"));
replacePunctuation.setHorizontalAlignment(SwingConstants.CENTER);
replacePunctuation
.setFont(new java.awt.Font("Verdana", Font.ITALIC, 11));
- replacePunctuation.setText(MessageManager.getString("label.replace_commas_semicolons"));
+ replacePunctuation.setText(MessageManager
+ .getString("label.replace_commas_semicolons"));
ok.setText(MessageManager.getString("action.ok"));
ok.addActionListener(new ActionListener()
{
+ database.getSelectedSources().size()
+ " others)" : ""));
String eq = database.getExampleQueries();
- dbeg.setText(MessageManager.formatMessage("label.example_query_param", new String[]{eq}));
+ dbeg.setText(MessageManager.formatMessage(
+ "label.example_query_param", new String[]
+ { eq }));
boolean enablePunct = !(eq != null && eq.indexOf(",") > -1);
for (DbSourceProxy dbs : database.getSelectedSources())
{
Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
- af.statusBar.setText(MessageManager.getString("label.successfully_pasted_alignment_file"));
+ af.statusBar.setText(MessageManager
+ .getString("label.successfully_pasted_alignment_file"));
try
{
public void run()
{
JOptionPane.showInternalMessageDialog(Desktop.desktop, error,
- MessageManager.getString("label.error_retrieving_data"), JOptionPane.WARNING_MESSAGE);
+ MessageManager.getString("label.error_retrieving_data"),
+ JOptionPane.WARNING_MESSAGE);
}
});
}
if (forConservation)
{
- label.setText(MessageManager.getString("label.enter_value_increase_conservation_visibility"));
+ label.setText(MessageManager
+ .getString("label.enter_value_increase_conservation_visibility"));
slider.setMinimum(0);
slider.setMaximum(100);
}
else
{
- label.setText(MessageManager.getString("label.enter_percentage_identity_above_which_colour_residues"));
+ label.setText(MessageManager
+ .getString("label.enter_percentage_identity_above_which_colour_residues"));
slider.setMinimum(0);
slider.setMaximum(100);
}
if (tree == null)
{
- g.drawString(MessageManager.getString("label.calculating_tree") + "....", 20, getHeight() / 2);
+ g.drawString(MessageManager.getString("label.calculating_tree")
+ + "....", 20, getHeight() / 2);
}
else
{
g2.fillRect(0, 0, width, height);
g2.setFont(font);
- if (longestName==null || tree ==null)
+ if (longestName == null || tree == null)
{
- g2.drawString("Calculating tree.",20,20);
+ g2.drawString("Calculating tree.", 20, 20);
}
offy = font.getSize() + 10;
if (ob instanceof SequenceNode)
{
highlightNode = (SequenceNode) ob;
- this.setToolTipText("<html>" + MessageManager.getString("label.highlightnode"));
+ this.setToolTipText("<html>"
+ + MessageManager.getString("label.highlightnode"));
repaint();
}
// af.addSortByOrderMenuItem(ServiceName + " Ordering",
// msaorder);
- Desktop.addInternalFrame(af, MessageManager.formatMessage("label.original_data_for_params", new String[]{this.title}),
- AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
+ Desktop.addInternalFrame(af, MessageManager.formatMessage(
+ "label.original_data_for_params", new String[]
+ { this.title }), AlignFrame.DEFAULT_WIDTH,
+ AlignFrame.DEFAULT_HEIGHT);
}
}
}
colorChooser.getSelectionModel().addChangeListener(this);
frame = new JInternalFrame();
frame.setContentPane(this);
- Desktop.addInternalFrame(frame, MessageManager.getString("label.user_defined_colours"), 720, 370, true);
+ Desktop.addInternalFrame(frame,
+ MessageManager.getString("label.user_defined_colours"), 720,
+ 370, true);
if (seqGroup != null)
{
{ "jc" }, new String[]
{ "Jalview User Colours" }, "Jalview User Colours");
chooser.setFileView(new jalview.io.JalviewFileView());
- chooser.setDialogTitle(MessageManager.getString("label.load_colour_scheme"));
+ chooser.setDialogTitle(MessageManager
+ .getString("label.load_colour_scheme"));
chooser.setToolTipText(MessageManager.getString("action.load"));
int value = chooser.showOpenDialog(this);
{
if (schemeName.getText().trim().length() < 1)
{
- JOptionPane.showInternalMessageDialog(Desktop.desktop,
- MessageManager.getString("label.user_colour_scheme_must_have_name"),
- MessageManager.getString("label.no_name_colour_scheme"), JOptionPane.WARNING_MESSAGE);
+ JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager
+ .getString("label.user_colour_scheme_must_have_name"),
+ MessageManager.getString("label.no_name_colour_scheme"),
+ JOptionPane.WARNING_MESSAGE);
return;
}
if (userColourSchemes != null
&& userColourSchemes.containsKey(schemeName.getText()))
{
- int reply = JOptionPane.showInternalConfirmDialog(
- Desktop.desktop,
- MessageManager.formatMessage("label.colour_scheme_exists_overwrite", new String[]{schemeName.getText(),schemeName.getText()}),
- MessageManager.getString("label.duplicate_scheme_name"), JOptionPane.YES_NO_OPTION);
+ int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
+ MessageManager.formatMessage(
+ "label.colour_scheme_exists_overwrite", new String[]
+ { schemeName.getText(), schemeName.getText() }),
+ MessageManager.getString("label.duplicate_scheme_name"),
+ JOptionPane.YES_NO_OPTION);
if (reply != JOptionPane.YES_OPTION)
{
return;
+ qid + "&rid=" + rid;
jalview.bin.Cache.log.info("Prompting user for questionnaire at "
+ qurl);
- int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
- MessageManager.getString("label.jalview_new_questionnaire"),
- MessageManager.getString("label.jalview_user_survey"), JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE);
+ int reply = JOptionPane
+ .showInternalConfirmDialog(Desktop.desktop, MessageManager
+ .getString("label.jalview_new_questionnaire"),
+ MessageManager
+ .getString("label.jalview_user_survey"),
+ JOptionPane.YES_NO_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
if (reply == JOptionPane.YES_OPTION)
{
// ensure we update menu state to reflect external selection list state
append = append || _selectedviews.size() > 1;
toggleview = new JCheckBoxMenuItem("Select many views", append);
- toggleview
- .setToolTipText(MessageManager.getString("label.toggle_enabled_views"));
+ toggleview.setToolTipText(MessageManager
+ .getString("label.toggle_enabled_views"));
toggleview.addItemListener(new ItemListener()
{
});
add(toggleview);
- add(selectAll = new JMenuItem(MessageManager.getString("label.select_all_views")));
+ add(selectAll = new JMenuItem(
+ MessageManager.getString("label.select_all_views")));
selectAll.addActionListener(new ActionListener()
{
}
}
});
- add(invertSel = new JMenuItem(MessageManager.getString("label.invert_selection")));
+ add(invertSel = new JMenuItem(
+ MessageManager.getString("label.invert_selection")));
invertSel.addActionListener(new ActionListener()
{
switch (currentStatus)
{
case STATE_QUEUING:
- g.drawString(title.concat(" - ").concat(MessageManager.getString("label.state_queueing")), 60, 30);
+ g.drawString(
+ title.concat(" - ").concat(
+ MessageManager.getString("label.state_queueing")),
+ 60, 30);
break;
case STATE_RUNNING:
- g.drawString(title.concat(" - ").concat(MessageManager.getString("label.state_running")), 60, 30);
+ g.drawString(
+ title.concat(" - ").concat(
+ MessageManager.getString("label.state_running")),
+ 60, 30);
break;
case STATE_STOPPED_OK:
- g.drawString(title.concat(" - ").concat(MessageManager.getString("label.state_completed")), 60, 30);
+ g.drawString(
+ title.concat(" - ").concat(
+ MessageManager.getString("label.state_completed")),
+ 60, 30);
break;
case STATE_CANCELLED_OK:
- g.drawString(title.concat(" - ").concat(MessageManager.getString("label.state_job_cancelled")), 60, 30);
+ g.drawString(
+ title.concat(" - ").concat(
+ MessageManager
+ .getString("label.state_job_cancelled")),
+ 60, 30);
break;
case STATE_STOPPED_ERROR:
- g.drawString(title.concat(" - ").concat(MessageManager.getString("label.state_job_error")), 60, 30);
+ g.drawString(
+ title.concat(" - ").concat(
+ MessageManager.getString("label.state_job_error")),
+ 60, 30);
break;
case STATE_STOPPED_SERVERERROR:
- g.drawString(title.concat(" - ").concat(MessageManager.getString("label.server_error_try_later")), 60, 30);
+ g.drawString(
+ title.concat(" - ").concat(
+ MessageManager
+ .getString("label.server_error_try_later")),
+ 60, 30);
break;
}
final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
if (handler.canCancel())
{
- JButton cancel = new JButton(MessageManager.getString("action.cancel"));
+ JButton cancel = new JButton(
+ MessageManager.getString("action.cancel"));
final IProgressIndicator us = this;
cancel.addActionListener(new ActionListener()
{
}
});
- updatepref = JvSwingUtils.makeButton(MessageManager.getString("action.update"),
+ updatepref = JvSwingUtils.makeButton(
+ MessageManager.getString("action.update"),
MessageManager.getString("label.update_user_parameter_set"),
new ActionListener()
{
update_actionPerformed(e);
}
});
- deletepref = JvSwingUtils.makeButton(MessageManager.getString("action.delete"),
+ deletepref = JvSwingUtils.makeButton(
+ MessageManager.getString("action.delete"),
MessageManager.getString("label.delete_user_parameter_set"),
new ActionListener()
{
delete_actionPerformed(e);
}
});
- createpref = JvSwingUtils.makeButton(MessageManager.getString("action.create"),
+ createpref = JvSwingUtils.makeButton(
+ MessageManager.getString("action.create"),
MessageManager.getString("label.create_user_parameter_set"),
new ActionListener()
{
create_actionPerformed(e);
}
});
- revertpref = JvSwingUtils.makeButton(MessageManager.getString("action.revert"),
- MessageManager.getString("label.revert_changes_user_parameter_set"),
+ revertpref = JvSwingUtils.makeButton(MessageManager
+ .getString("action.revert"), MessageManager
+ .getString("label.revert_changes_user_parameter_set"),
new ActionListener()
{
revert_actionPerformed(e);
}
});
- startjob = JvSwingUtils.makeButton(MessageManager.getString("action.start_job"),
- MessageManager.getString("label.start_job_current_settings"), new ActionListener()
+ startjob = JvSwingUtils.makeButton(
+ MessageManager.getString("action.start_job"),
+ MessageManager.getString("label.start_job_current_settings"),
+ new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
startjob_actionPerformed(e);
}
});
- canceljob = JvSwingUtils.makeButton(MessageManager.getString("action.cancel_job"),
- MessageManager.getString("label.cancel_job_close_dialog"), new ActionListener()
+ canceljob = JvSwingUtils.makeButton(
+ MessageManager.getString("action.cancel_job"),
+ MessageManager.getString("label.cancel_job_close_dialog"),
+ new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
}
});
- setDetails.setBorder(new TitledBorder(MessageManager.getString("label.details")));
+ setDetails.setBorder(new TitledBorder(MessageManager
+ .getString("label.details")));
setDetails.setLayout(new BorderLayout());
setDescr.setColumns(40);
setDescr.setWrapStyleWord(true);
setDescr.setBackground(getBackground());
setDescr.setEditable(true);
setDescr.getDocument().addDocumentListener(this);
- setDescr.setToolTipText(MessageManager.getString("label.edit_notes_parameter_set"));
+ setDescr.setToolTipText(MessageManager
+ .getString("label.edit_notes_parameter_set"));
JScrollPane setDescrView = new JScrollPane();
// setDescrView.setPreferredSize(new Dimension(350, 200));
setDescrView.getViewport().setView(setDescr);
GridBagLayout gbl = new GridBagLayout();
SetNamePanel.setLayout(gbl);
- JLabel setNameLabel = new JLabel(MessageManager.getString("label.current_parameter_set_name"));
+ JLabel setNameLabel = new JLabel(
+ MessageManager.getString("label.current_parameter_set_name"));
setNameLabel.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
setNameInfo.add(setNameLabel);
// paramPane.setPreferredSize(new Dimension(360, 400));
// paramPane.setPreferredSize(null);
- jobOptions.setBorder(new TitledBorder(MessageManager.getString("label.options")));
+ jobOptions.setBorder(new TitledBorder(MessageManager
+ .getString("label.options")));
jobOptions.setOpaque(true);
- paramList.setBorder(new TitledBorder(MessageManager.getString("label.parameters")));
+ paramList.setBorder(new TitledBorder(MessageManager
+ .getString("label.parameters")));
paramList.setOpaque(true);
JPanel bjo = new JPanel(new BorderLayout()), bjp = new JPanel(
new BorderLayout());
@SuppressWarnings("unchecked")
private void updateTable(WsParamSetI p, List<ArgumentI> jobArgset)
{
- boolean setDefaultParams=false;
+ boolean setDefaultParams = false;
if (lastParmSet == null)
{
isUserPreset = false;
// First call - so provide Service default settings
setName.setSelectedItem(lastSetName = SVC_DEF);
}
- if (p==null && SVC_DEF.equals(""+setName.getSelectedItem()))
+ if (p == null && SVC_DEF.equals("" + setName.getSelectedItem()))
{
// indicate that service defaults should be set if available
- setDefaultParams=true;
+ setDefaultParams = true;
}
// populate table from default parameter set.
List<ArgumentI> args = paramStore.getServiceParameters();
// split to params and required arguments
{
int cw = 0;
- boolean optset=false;
+ boolean optset = false;
for (ArgumentI myarg : args)
- {
+ {
// Ideally, Argument would implement isRequired !
if (myarg instanceof ParameterI)
{
JTextField urltf = new JTextField(url, 40);
JPanel panel = new JPanel(new BorderLayout());
JPanel pane12 = new JPanel(new BorderLayout());
- pane12.add(new JLabel(MessageManager.getString("label.url")), BorderLayout.CENTER);
+ pane12.add(new JLabel(MessageManager.getString("label.url")),
+ BorderLayout.CENTER);
pane12.add(urltf, BorderLayout.EAST);
panel.add(pane12, BorderLayout.NORTH);
boolean valid = false;
*/
public AlignFile()
{
- // Shouldn't we init data structures (JBPNote: not sure - initData is for initialising the structures used for reading from a datasource, and the bare constructor hasn't got any datasource)
- initData();
+ // Shouldn't we init data structures (JBPNote: not sure - initData is for
+ // initialising the structures used for reading from a datasource, and the
+ // bare constructor hasn't got any datasource)
+ initData();
}
/**
StringBuffer colours = new StringBuffer();
StringBuffer graphLine = new StringBuffer();
StringBuffer rowprops = new StringBuffer();
- Hashtable<Integer,String> graphGroup = new Hashtable<Integer,String>();
- Hashtable<Integer, Object[]> graphGroup_refs = new Hashtable<Integer,Object[]>();
+ Hashtable<Integer, String> graphGroup = new Hashtable<Integer, String>();
+ Hashtable<Integer, Object[]> graphGroup_refs = new Hashtable<Integer, Object[]>();
BitSet graphGroupSeen = new BitSet();
java.awt.Color color;
{
row = annotations[i];
- if (!row.visible && !row.hasScore() && !(row.graphGroup>-1 && graphGroupSeen.get(row.graphGroup)))
+ if (!row.visible
+ && !row.hasScore()
+ && !(row.graphGroup > -1 && graphGroupSeen
+ .get(row.graphGroup)))
{
continue;
}
color = null;
oneColour = true;
-
+
// mark any sequence references for the row
- writeSequence_Ref(refSeq ,row.sequenceRef);
+ writeSequence_Ref(refSeq, row.sequenceRef);
refSeq = row.sequenceRef;
// mark any group references for the row
writeGroup_Ref(refGroup, row.groupRef);
if (graphGroup.containsKey(key))
{
graphGroup.put(key, graphGroup.get(key) + "\t" + row.label);
-
+
}
else
{
- graphGroup_refs.put(key, new Object[] { refSeq, refGroup});
+ graphGroup_refs.put(key, new Object[]
+ { refSeq, refGroup });
graphGroup.put(key, row.label);
}
}
rowprops.append(row.centreColLabels);
rowprops.append(newline);
}
- if (graphLine.length()>0) {
+ if (graphLine.length() > 0)
+ {
text.append(graphLine.toString());
graphLine.setLength(0);
}
{
SequenceI oldRefSeq = refSeq;
SequenceGroup oldRefGroup = refGroup;
- for (Map.Entry<Integer, String> combine_statement:graphGroup.entrySet())
- {
- Object[] seqRefAndGroup=graphGroup_refs.get(combine_statement.getKey());
-
- writeSequence_Ref(refSeq, (SequenceI)seqRefAndGroup[0]);
- refSeq = (SequenceI)seqRefAndGroup[0];
-
- writeGroup_Ref(refGroup, (SequenceGroup)seqRefAndGroup[1]);
- refGroup = (SequenceGroup)seqRefAndGroup[1];
+ for (Map.Entry<Integer, String> combine_statement : graphGroup
+ .entrySet())
+ {
+ Object[] seqRefAndGroup = graphGroup_refs.get(combine_statement
+ .getKey());
+
+ writeSequence_Ref(refSeq, (SequenceI) seqRefAndGroup[0]);
+ refSeq = (SequenceI) seqRefAndGroup[0];
+
+ writeGroup_Ref(refGroup, (SequenceGroup) seqRefAndGroup[1]);
+ refGroup = (SequenceGroup) seqRefAndGroup[1];
text.append("COMBINE\t");
text.append(combine_statement.getValue());
text.append(newline);
}
writeSequence_Ref(refSeq, oldRefSeq);
refSeq = oldRefSeq;
-
+
writeGroup_Ref(refGroup, oldRefGroup);
refGroup = oldRefGroup;
}
return text.toString();
}
- private Object writeGroup_Ref(SequenceGroup refGroup, SequenceGroup next_refGroup)
+ private Object writeGroup_Ref(SequenceGroup refGroup,
+ SequenceGroup next_refGroup)
{
if (next_refGroup == null)
{
return true;
}
}
- return false;
+ return false;
}
-
+
private boolean writeSequence_Ref(SequenceI refSeq, SequenceI next_refSeq)
{
- if (next_refSeq==null)
+ if (next_refSeq == null)
{
if (refSeq != null)
{
{
ex.printStackTrace();
System.out.println("Problem reading annotation file: " + ex);
- if (nlinesread>0) {
- System.out.println("Last read line "+nlinesread+": '"+lastread+"' (first 80 chars) ...");
+ if (nlinesread > 0)
+ {
+ System.out.println("Last read line " + nlinesread + ": '"
+ + lastread + "' (first 80 chars) ...");
}
return false;
}
return false;
}
- long nlinesread=0;
- String lastread="";
- private static String GRAPHLINE="GRAPHLINE", COMBINE="COMBINE";
+
+ long nlinesread = 0;
+
+ String lastread = "";
+
+ private static String GRAPHLINE = "GRAPHLINE", COMBINE = "COMBINE";
+
public boolean parseAnnotationFrom(AlignmentI al, BufferedReader in)
throws Exception
{
boolean jvAnnotationFile = false;
while ((line = in.readLine()) != null)
{
- nlinesread++;lastread = new String(line);
+ nlinesread++;
+ lastread = new String(line);
if (line.indexOf("#") == 0)
{
continue;
while ((line = in.readLine()) != null)
{
- nlinesread++;lastread = new String(line);
+ nlinesread++;
+ lastread = new String(line);
if (line.indexOf("#") == 0
|| line.indexOf("JALVIEW_ANNOTATION") > -1
|| line.length() == 0)
else if (token.equalsIgnoreCase(COMBINE))
{
// keep a record of current state and resolve groupRef at end
- combineAnnotation_calls.add(new Object[] { st, refSeq, groupRef});
+ combineAnnotation_calls.add(new Object[]
+ { st, refSeq, groupRef });
modified = true;
continue;
}
else if (token.equalsIgnoreCase(GRAPHLINE))
{
// resolve at end
- deferredAnnotation_calls.add(new Object[] { GRAPHLINE, st, refSeq, groupRef});
+ deferredAnnotation_calls.add(new Object[]
+ { GRAPHLINE, st, refSeq, groupRef });
modified = true;
continue;
}
else if (token.equalsIgnoreCase("SEQUENCE_GROUP"))
{
addGroup(al, st);
- modified=true;
+ modified = true;
continue;
}
modified = true;
}
// Resolve the groupRefs
- Hashtable <String,SequenceGroup> groupRefLookup=new Hashtable<String,SequenceGroup>();
+ Hashtable<String, SequenceGroup> groupRefLookup = new Hashtable<String, SequenceGroup>();
Enumeration en = groupRefRows.keys();
while (en.hasMoreElements())
{
matched = true;
Vector rowset = (Vector) groupRefRows.get(groupRef);
- groupRefLookup.put(groupRef, theGroup);
+ groupRefLookup.put(groupRef, theGroup);
if (rowset != null && rowset.size() > 0)
{
AlignmentAnnotation alan = null;
// group, or null
);
}
- }
+ }
// finally, combine all the annotation rows within each context.
/**
- * number of combine statements in this annotation file. Used to create new groups for combined annotation graphs without disturbing existing ones
+ * number of combine statements in this annotation file. Used to create
+ * new groups for combined annotation graphs without disturbing existing
+ * ones
*/
int combinecount = 0;
- for (Object[] _combine_args:combineAnnotation_calls) {
- combineAnnotations(al,
+ for (Object[] _combine_args : combineAnnotation_calls)
+ {
+ combineAnnotations(al,
++combinecount,
(StringTokenizer) _combine_args[0], // st
(SequenceI) _combine_args[1], // refSeq
- (_combine_args[2]==null) ? null : groupRefLookup.get((String)_combine_args[2]) // the reference group, or null
- );
+ (_combine_args[2] == null) ? null : groupRefLookup
+ .get((String) _combine_args[2]) // the reference group,
+ // or null
+ );
}
}
return modified;
}
}
- void combineAnnotations(AlignmentI al, int combineCount, StringTokenizer st, SequenceI seqRef, SequenceGroup groupRef)
+ void combineAnnotations(AlignmentI al, int combineCount,
+ StringTokenizer st, SequenceI seqRef, SequenceGroup groupRef)
{
String group = st.nextToken();
// First make sure we are not overwriting the graphIndex
- int graphGroup=0;
+ int graphGroup = 0;
if (al.getAlignmentAnnotation() != null)
{
for (int i = 0; i < al.getAlignmentAnnotation().length; i++)
{
AlignmentAnnotation aa = al.getAlignmentAnnotation()[i];
-
- if (aa.graphGroup>graphGroup)
+
+ if (aa.graphGroup > graphGroup)
{
// try to number graphGroups in order of occurence.
- graphGroup=aa.graphGroup+1;
+ graphGroup = aa.graphGroup + 1;
}
- if (aa.sequenceRef==seqRef && aa.groupRef==groupRef && aa.label.equalsIgnoreCase(group))
+ if (aa.sequenceRef == seqRef && aa.groupRef == groupRef
+ && aa.label.equalsIgnoreCase(group))
{
- if (aa.graphGroup>-1)
+ if (aa.graphGroup > -1)
{
graphGroup = aa.graphGroup;
- } else {
+ }
+ else
+ {
if (graphGroup <= combineCount)
{
- graphGroup=combineCount+1;
+ graphGroup = combineCount + 1;
}
aa.graphGroup = graphGroup;
}
for (int i = 0; i < al.getAlignmentAnnotation().length; i++)
{
AlignmentAnnotation aa = al.getAlignmentAnnotation()[i];
- if (aa.sequenceRef==seqRef && aa.groupRef==groupRef && aa.label.equalsIgnoreCase(group))
+ if (aa.sequenceRef == seqRef && aa.groupRef == groupRef
+ && aa.label.equalsIgnoreCase(group))
{
aa.graphGroup = graphGroup;
break;
}
}
- void addLine(AlignmentI al, StringTokenizer st, SequenceI seqRef, SequenceGroup groupRef)
+ void addLine(AlignmentI al, StringTokenizer st, SequenceI seqRef,
+ SequenceGroup groupRef)
{
String group = st.nextToken();
AlignmentAnnotation annotation = null, alannot[] = al
{
for (int i = 0; i < alannot.length; i++)
{
- if (alannot[i].label.equalsIgnoreCase(group) && (seqRef==null || alannot[i].sequenceRef==seqRef) && (groupRef==null || alannot[i].groupRef==groupRef))
+ if (alannot[i].label.equalsIgnoreCase(group)
+ && (seqRef == null || alannot[i].sequenceRef == seqRef)
+ && (groupRef == null || alannot[i].groupRef == groupRef))
{
alannot[i].setThreshold(new GraphLine(value, label, colour));
}
*/
public static final String[] READABLE_FORMATS = new String[]
{ "BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "STH",
- "PDB", "JnetFile" , "RNAML"}; // , "SimpleBLAST" };
+ "PDB", "JnetFile", "RNAML" }; // , "SimpleBLAST" };
/**
* List of valid format strings for use by callers of the formatSequences
* that are writable by the application.
*/
public static final String[] WRITABLE_EXTENSIONS = new String[]
- { "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jvp",
- "sto,stk", "jar" };
+ { "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa",
+ "jvp", "sto,stk", "jar" };
/**
* List of writable formats by the application. Order must correspond with the
* corresponding to READABLE_FNAMES
*/
public static final String[] READABLE_EXTENSIONS = new String[]
- { "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "jar,jvp",
- "sto,stk", "xml,rnaml" }; // ".blast"
+ { "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa",
+ "jar,jvp", "sto,stk", "xml,rnaml" }; // ".blast"
/**
* List of readable formats by application in order corresponding to
*/
public static final String[] READABLE_FNAMES = new String[]
{ "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Jalview",
- "Stockholm","RNAML" };// ,
+ "Stockholm", "RNAML" };// ,
// "SimpleBLAST"
// };
}
else if (format.equals("PDB"))
{
- afile = new MCview.PDBfile(inFile, type);
+ afile = new MCview.PDBfile(inFile, type);
// Uncomment to test Jmol data based PDB processing: JAL-1213
// afile = new jalview.ext.jmol.PDBFileWithJmol(inFile, type);
}
{
afile = new RnamlFile(inFile, type);
}
-
+
Alignment al = new Alignment(afile.getSeqsAsArray());
afile.addAnnotations(al);
{
afile = new RnamlFile();
}
-
+
else
{
throw new Exception(
import java.io.*;
-
import jalview.datamodel.*;
/**
StringBuffer sb = new StringBuffer();
boolean firstLine = true;
- String line,uline;
+ String line, uline;
Sequence seq = null;
boolean annotation = false;
seqs.addElement(seq);
}
}
+
private AlignmentAnnotation makeAnnotation(SequenceI seq, StringBuffer sb)
{
Annotation[] anots = new Annotation[sb.length()];
char cb;
- for (int i=0;i<anots.length;i++)
+ for (int i = 0; i < anots.length; i++)
{
char cn = sb.charAt(i);
if (cn != ' ')
{
- anots[i] = new Annotation(""+cn, null,
- ' ', Float.NaN);
+ anots[i] = new Annotation("" + cn, null, ' ', Float.NaN);
}
}
AlignmentAnnotation aa = new AlignmentAnnotation(seq.getName()
.substring(2), seq.getDescription(), anots);
return aa;
}
+
/**
* called by AppletFormatAdapter to generate an annotated alignment, rather
* than bare sequences.
error = format + "\n" + error;
}
}
-
+
if ((al != null) && (al.getHeight() > 0))
{
if (viewport != null)
alignFrame = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
- alignFrame.statusBar.setText(MessageManager.formatMessage("label.successfully_loaded_file", new String[]{title}));
+ alignFrame.statusBar.setText(MessageManager.formatMessage(
+ "label.successfully_loaded_file", new String[]
+ { title }));
if (!protocol.equals(AppletFormatAdapter.PASTE))
alignFrame.setFileName(file, format);
if (raiseGUI)
{
// add the window to the GUI
- // note - this actually should happen regardless of raiseGUI status in Jalview 3
- // TODO: define 'virtual desktop' for benefit of headless scripts that perform queries to find the 'current working alignment'
+ // note - this actually should happen regardless of raiseGUI
+ // status in Jalview 3
+ // TODO: define 'virtual desktop' for benefit of headless scripts
+ // that perform queries to find the 'current working alignment'
Desktop.addInternalFrame(alignFrame, title,
AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
}
public void run()
{
JOptionPane.showInternalMessageDialog(Desktop.desktop,
- errorMessage, MessageManager.getString("label.error_loading_file"),
+ errorMessage, MessageManager
+ .getString("label.error_loading_file"),
JOptionPane.WARNING_MESSAGE);
}
});
public void run()
{
javax.swing.JOptionPane.showInternalMessageDialog(
- Desktop.desktop, MessageManager.formatMessage("label.problems_opening_file", new String[]{file}),
- MessageManager.getString("label.file_open_error"),
+ Desktop.desktop, MessageManager.formatMessage(
+ "label.problems_opening_file", new String[]
+ { file }), MessageManager
+ .getString("label.file_open_error"),
javax.swing.JOptionPane.WARNING_MESSAGE);
}
});
}
;
}
-
+
dataIn = new BufferedReader(new FileReader(fileStr));
dataName = fileStr;
}
return error;
}
- private BufferedReader tryAsGzipSource(InputStream inputStream) throws Exception
+
+ private BufferedReader tryAsGzipSource(InputStream inputStream)
+ throws Exception
{
- BufferedReader inData = new BufferedReader(new InputStreamReader(new GZIPInputStream(inputStream)));
+ BufferedReader inData = new BufferedReader(new InputStreamReader(
+ new GZIPInputStream(inputStream)));
inData.mark(2048);
inData.read();
inData.reset();
return inData;
}
+
private boolean checkURLSource(String fileStr) throws IOException,
MalformedURLException
{
errormessage = "URL NOT FOUND";
URL url = new URL(fileStr);
//
- // GZIPInputStream code borrowed from Aquaria (soon to be open sourced) via Kenny Sabir
- Exception e=null;
- if (fileStr.toLowerCase().endsWith(".gz")) {
- try {
- InputStream inputStream = url.openStream();
- dataIn = tryAsGzipSource(inputStream);
- dataName = fileStr;
- return false;
- } catch (Exception ex) {
- e=ex;
+ // GZIPInputStream code borrowed from Aquaria (soon to be open sourced) via
+ // Kenny Sabir
+ Exception e = null;
+ if (fileStr.toLowerCase().endsWith(".gz"))
+ {
+ try
+ {
+ InputStream inputStream = url.openStream();
+ dataIn = tryAsGzipSource(inputStream);
+ dataName = fileStr;
+ return false;
+ } catch (Exception ex)
+ {
+ e = ex;
}
}
- try {
+ try
+ {
dataIn = new BufferedReader(new InputStreamReader(url.openStream()));
- } catch (IOException q) {
- if (e!=null)
+ } catch (IOException q)
+ {
+ if (e != null)
{
throw new IOException("Failed to resolve GZIP stream", e);
}
{
// TODO consider using AlignmentView to prune to visible region
// TODO prune sequence annotation and groups to visible region
- // TODO: JAL-1486 - set start and end for output correctly. basically, AlignmentView.getVisibleContigs does this.
+ // TODO: JAL-1486 - set start and end for output correctly. basically,
+ // AlignmentView.getVisibleContigs does this.
Alignment alv = new Alignment(replaceStrings(
alignment.getSequencesArray(), omitHidden));
AlignmentAnnotation[] ala = alignment.getAlignmentAnnotation();
break;
}
-
+
if ((data.indexOf("<") > -1))
{
reply = "RNAML";
-
+
break;
}
break;
}
-
-
+
else if (data.indexOf(">") > -1)
{
// FASTA, PIR file or BLC file
starterm = (data1 != null && data1.indexOf("*") > -1)
|| (data2 != null && data2.indexOf("*") > -1);
}
- if (data2 != null && (c1=data.indexOf("*")) > -1)
+ if (data2 != null && (c1 = data.indexOf("*")) > -1)
{
- if (c1==0 && c1 == data2.indexOf("*"))
+ if (c1 == 0 && c1 == data2.indexOf("*"))
{
reply = "BLC";
- } else {
- reply = "FASTA"; // possibly a bad choice - may be recognised as PIR
+ }
+ else
+ {
+ reply = "FASTA"; // possibly a bad choice - may be recognised as
+ // PIR
}
// otherwise can still possibly be a PIR file
}
super();
setDataName(dataName);
dataIn = new BufferedReader(new InputStreamReader(is));
- error=false;
+ error = false;
}
+
public InputStreamParser(Reader isreader, String dataName)
throws IOException
{
super();
setDataName(dataName);
dataIn = new BufferedReader(isreader);
- error=false;
+ error = false;
}
-
@Override
protected void finalize() throws Throwable
{
* @param args
* DOCUMENT ME!
*/
- public static void main(String[] args)
+ public static void main(String[] args)
{
try
{
static
{
- // TODO: these names should come from the FormatAdapter lists for readable/writable extensions
+ // TODO: these names should come from the FormatAdapter lists for
+ // readable/writable extensions
alignSuffix.put("amsa", "AMSA file");
alignSuffix.put("fasta", "Fasta file");
alignSuffix.put("fa", "Fasta file");
int nextcp = 0;
int ncp = cp;
- boolean parsednodename=false;
+ boolean parsednodename = false;
while (majorsyms.searchFrom(nf, cp) && (Error == null))
{
int fcp = majorsyms.matchedFrom();
nodename = new String(qnodename.stringMatched().substring(1,
nl - 1));
// unpack any escaped colons
- com.stevesoft.pat.Regex xpandquotes = com.stevesoft.pat.Regex.perlCode("s/''/'/");
+ com.stevesoft.pat.Regex xpandquotes = com.stevesoft.pat.Regex
+ .perlCode("s/''/'/");
String widernodename = xpandquotes.replaceAll(nodename);
- nodename=widernodename;
+ nodename = widernodename;
// jump to after end of quoted nodename
nextcp = fcp + nl + 1;
- parsednodename=true;
+ parsednodename = true;
}
else
{
com.stevesoft.pat.Regex ndist = new com.stevesoft.pat.Regex(
":([-0-9Ee.+]+)");
- if (!parsednodename && uqnodename.search(fstring)
+ if (!parsednodename
+ && uqnodename.search(fstring)
&& ((uqnodename.matchedFrom(1) == 0) || (fstring
.charAt(uqnodename.matchedFrom(1) - 1) != ':'))) // JBPNote
// HACK!
distance = DefDistance;
bootstrap = DefBootstrap;
commentString2 = null;
- parsednodename=false;
+ parsednodename = false;
}
if (nextcp == 0)
{
import java.io.*;
import java.util.*;
-
import jalview.datamodel.*;
import jalview.util.*;
*
* @throws IOException
* DOCUMENT ME!
-
*/
public PileUpfile(String inFile, String type) throws IOException
{
*
* @author bsb at sanger.ac.uk
* @author Natasha Shersnev (Dundee, UK) (Stockholm file writer)
- * @author Lauren Lui (UCSC, USA) (RNA secondary structure annotation import as stockholm)
+ * @author Lauren Lui (UCSC, USA) (RNA secondary structure annotation import as
+ * stockholm)
* @author Anne Menard (Paris, FR) (VARNA parsing of Stockholm file data)
* @version 0.3 + jalview mods
*
{
// static Logger logger = Logger.getLogger("jalview.io.StockholmFile");
protected ArrayList<RNA> result;
+
StringBuffer out; // output buffer
AlignmentI al;
{
super.initData();
}
+
/**
* Parse a file in Stockholm format into Jalview's data model using VARNA
*
// DEBUG System.out.println("this is the secondary scructure:"
// +result.size());
SequenceI[] seqs = new SequenceI[result.size()];
- String id=null;
+ String id = null;
for (int i = 0; i < result.size(); i++)
{
// DEBUG System.err.println("Processing i'th sequence in Stockholm file")
}
-
/**
* Parse a file in Stockholm format into Jalview's data model. The file has to
* be passed at construction time
*/
public void parse() throws IOException
{
- StringBuffer treeString = new StringBuffer();
- String treeName = null;
- // --------------- Variable Definitions -------------------
- String line;
- String version;
+ StringBuffer treeString = new StringBuffer();
+ String treeName = null;
+ // --------------- Variable Definitions -------------------
+ String line;
+ String version;
// String id;
- Hashtable seqAnn = new Hashtable(); // Sequence related annotations
- Hashtable seqs = new Hashtable();
- Regex p, r, rend, s, x;
- // Temporary line for processing RNA annotation
- // String RNAannot = "";
-
- // ------------------ Parsing File ----------------------
- // First, we have to check that this file has STOCKHOLM format, i.e. the
- // first line must match
-
-
- r = new Regex("# STOCKHOLM ([\\d\\.]+)");
- if (!r.search(nextLine()))
- {
- throw new IOException(
- "This file is not in valid STOCKHOLM format: First line does not contain '# STOCKHOLM'");
- }
- else
- {
- version = r.stringMatched(1);
-
- // logger.debug("Stockholm version: " + version);
- }
-
- // We define some Regexes here that will be used regularily later
- rend = new Regex("^\\s*\\/\\/"); // Find the end of an alignment
- p = new Regex("(\\S+)\\/(\\d+)\\-(\\d+)"); // split sequence id in
- // id/from/to
- s = new Regex("(\\S+)\\s+(\\S*)\\s+(.*)"); // Parses annotation subtype
- r = new Regex("#=(G[FSRC]?)\\s+(.*)"); // Finds any annotation line
- x = new Regex("(\\S+)\\s+(\\S+)"); // split id from sequence
-
- // Convert all bracket types to parentheses (necessary for passing to VARNA)
- Regex openparen = new Regex("(<|\\[)", "(");
- Regex closeparen = new Regex("(>|\\])", ")");
-
- // Detect if file is RNA by looking for bracket types
- Regex detectbrackets = new Regex("(<|>|\\[|\\]|\\(|\\))");
-
- rend.optimize();
- p.optimize();
- s.optimize();
- r.optimize();
- x.optimize();
- openparen.optimize();
- closeparen.optimize();
-
- while ((line = nextLine()) != null)
- {
- if (line.length() == 0)
- {
- continue;
- }
- if (rend.search(line))
- {
- // End of the alignment, pass stuff back
+ Hashtable seqAnn = new Hashtable(); // Sequence related annotations
+ Hashtable seqs = new Hashtable();
+ Regex p, r, rend, s, x;
+ // Temporary line for processing RNA annotation
+ // String RNAannot = "";
+
+ // ------------------ Parsing File ----------------------
+ // First, we have to check that this file has STOCKHOLM format, i.e. the
+ // first line must match
+
+ r = new Regex("# STOCKHOLM ([\\d\\.]+)");
+ if (!r.search(nextLine()))
+ {
+ throw new IOException(
+ "This file is not in valid STOCKHOLM format: First line does not contain '# STOCKHOLM'");
+ }
+ else
+ {
+ version = r.stringMatched(1);
+
+ // logger.debug("Stockholm version: " + version);
+ }
+
+ // We define some Regexes here that will be used regularily later
+ rend = new Regex("^\\s*\\/\\/"); // Find the end of an alignment
+ p = new Regex("(\\S+)\\/(\\d+)\\-(\\d+)"); // split sequence id in
+ // id/from/to
+ s = new Regex("(\\S+)\\s+(\\S*)\\s+(.*)"); // Parses annotation subtype
+ r = new Regex("#=(G[FSRC]?)\\s+(.*)"); // Finds any annotation line
+ x = new Regex("(\\S+)\\s+(\\S+)"); // split id from sequence
+
+ // Convert all bracket types to parentheses (necessary for passing to VARNA)
+ Regex openparen = new Regex("(<|\\[)", "(");
+ Regex closeparen = new Regex("(>|\\])", ")");
+
+ // Detect if file is RNA by looking for bracket types
+ Regex detectbrackets = new Regex("(<|>|\\[|\\]|\\(|\\))");
+
+ rend.optimize();
+ p.optimize();
+ s.optimize();
+ r.optimize();
+ x.optimize();
+ openparen.optimize();
+ closeparen.optimize();
+
+ while ((line = nextLine()) != null)
+ {
+ if (line.length() == 0)
+ {
+ continue;
+ }
+ if (rend.search(line))
+ {
+ // End of the alignment, pass stuff back
this.noSeqs = seqs.size();
-
- String seqdb,dbsource = null;
+
+ String seqdb, dbsource = null;
Regex pf = new Regex("PF[0-9]{5}(.*)"); // Finds AC for Pfam
Regex rf = new Regex("RF[0-9]{5}(.*)"); // Finds AC for Rfam
if (getAlignmentProperty("AC") != null)
dbsource = "RFAM";
}
}
- // logger.debug("Number of sequences: " + this.noSeqs);
- Enumeration accs = seqs.keys();
- while (accs.hasMoreElements())
- {
- String acc = (String) accs.nextElement();
- // logger.debug("Processing sequence " + acc);
- String seq = (String) seqs.remove(acc);
- if (maxLength < seq.length())
- {
- maxLength = seq.length();
- }
- int start = 1;
- int end = -1;
- String sid = acc;
- /*
+ // logger.debug("Number of sequences: " + this.noSeqs);
+ Enumeration accs = seqs.keys();
+ while (accs.hasMoreElements())
+ {
+ String acc = (String) accs.nextElement();
+ // logger.debug("Processing sequence " + acc);
+ String seq = (String) seqs.remove(acc);
+ if (maxLength < seq.length())
+ {
+ maxLength = seq.length();
+ }
+ int start = 1;
+ int end = -1;
+ String sid = acc;
+ /*
* Retrieve hash of annotations for this accession Associate
* Annotation with accession
- */
- Hashtable accAnnotations = null;
-
- if (seqAnn != null && seqAnn.containsKey(acc))
- {
- accAnnotations = (Hashtable) seqAnn.remove(acc);
- //TODO: add structures to sequence
- }
-
- // Split accession in id and from/to
- if (p.search(acc))
- {
- sid = p.stringMatched(1);
- start = Integer.parseInt(p.stringMatched(2));
- end = Integer.parseInt(p.stringMatched(3));
- }
- // logger.debug(sid + ", " + start + ", " + end);
-
- Sequence seqO = new Sequence(sid, seq, start, end);
- // Add Description (if any)
- if (accAnnotations != null && accAnnotations.containsKey("DE"))
- {
- String desc = (String) accAnnotations.get("DE");
- seqO.setDescription((desc == null) ? "" : desc);
- }
- // Add DB References (if any)
- if (accAnnotations != null && accAnnotations.containsKey("DR"))
- {
- String dbr = (String) accAnnotations.get("DR");
- if (dbr != null && dbr.indexOf(";") > -1)
- {
- String src = dbr.substring(0, dbr.indexOf(";"));
- String acn = dbr.substring(dbr.indexOf(";") + 1);
- jalview.util.DBRefUtils.parseToDbRef(seqO, src, "0", acn);
- }
- }
+ */
+ Hashtable accAnnotations = null;
+
+ if (seqAnn != null && seqAnn.containsKey(acc))
+ {
+ accAnnotations = (Hashtable) seqAnn.remove(acc);
+ // TODO: add structures to sequence
+ }
+
+ // Split accession in id and from/to
+ if (p.search(acc))
+ {
+ sid = p.stringMatched(1);
+ start = Integer.parseInt(p.stringMatched(2));
+ end = Integer.parseInt(p.stringMatched(3));
+ }
+ // logger.debug(sid + ", " + start + ", " + end);
+
+ Sequence seqO = new Sequence(sid, seq, start, end);
+ // Add Description (if any)
+ if (accAnnotations != null && accAnnotations.containsKey("DE"))
+ {
+ String desc = (String) accAnnotations.get("DE");
+ seqO.setDescription((desc == null) ? "" : desc);
+ }
+ // Add DB References (if any)
+ if (accAnnotations != null && accAnnotations.containsKey("DR"))
+ {
+ String dbr = (String) accAnnotations.get("DR");
+ if (dbr != null && dbr.indexOf(";") > -1)
+ {
+ String src = dbr.substring(0, dbr.indexOf(";"));
+ String acn = dbr.substring(dbr.indexOf(";") + 1);
+ jalview.util.DBRefUtils.parseToDbRef(seqO, src, "0", acn);
+ }
+ }
if (accAnnotations != null && accAnnotations.containsKey("AC"))
{
{
String dbr = (String) accAnnotations.get("AC");
if (dbr != null)
- {
- // we could get very clever here - but for now - just try to guess accession type from source of alignment plus structure of accession
+ {
+ // we could get very clever here - but for now - just try to
+ // guess accession type from source of alignment plus structure
+ // of accession
guessDatabaseFor(seqO, dbr, dbsource);
-
- }
- }
- // else - do what ? add the data anyway and prompt the user to specify what references these are ?
+
+ }
+ }
+ // else - do what ? add the data anyway and prompt the user to
+ // specify what references these are ?
}
-
- Hashtable features = null;
- // We need to adjust the positions of all features to account for gaps
- try
- {
- features = (Hashtable) accAnnotations.remove("features");
- } catch (java.lang.NullPointerException e)
- {
- // loggerwarn("Getting Features for " + acc + ": " +
- // e.getMessage());
- // continue;
- }
- // if we have features
- if (features != null)
- {
- int posmap[] = seqO.findPositionMap();
- Enumeration i = features.keys();
- while (i.hasMoreElements())
- {
- // TODO: parse out secondary structure annotation as annotation
- // row
- // TODO: parse out scores as annotation row
- // TODO: map coding region to core jalview feature types
- String type = i.nextElement().toString();
- Hashtable content = (Hashtable) features.remove(type);
+
+ Hashtable features = null;
+ // We need to adjust the positions of all features to account for gaps
+ try
+ {
+ features = (Hashtable) accAnnotations.remove("features");
+ } catch (java.lang.NullPointerException e)
+ {
+ // loggerwarn("Getting Features for " + acc + ": " +
+ // e.getMessage());
+ // continue;
+ }
+ // if we have features
+ if (features != null)
+ {
+ int posmap[] = seqO.findPositionMap();
+ Enumeration i = features.keys();
+ while (i.hasMoreElements())
+ {
+ // TODO: parse out secondary structure annotation as annotation
+ // row
+ // TODO: parse out scores as annotation row
+ // TODO: map coding region to core jalview feature types
+ String type = i.nextElement().toString();
+ Hashtable content = (Hashtable) features.remove(type);
// add alignment annotation for this feature
String key = type2id(type);
}
}
- Enumeration j = content.keys();
- while (j.hasMoreElements())
- {
- String desc = j.nextElement().toString();
- String ns = content.get(desc).toString();
- char[] byChar = ns.toCharArray();
- for (int k = 0; k < byChar.length; k++)
- {
- char c = byChar[k];
- if (!(c == ' ' || c == '_' || c == '-' || c == '.')) // PFAM
- // uses
- // '.'
- // for
- // feature
- // background
- {
- int new_pos = posmap[k]; // look up nearest seqeunce
- // position to this column
- SequenceFeature feat = new SequenceFeature(type, desc,
- new_pos, new_pos, 0f, null);
-
- seqO.addSequenceFeature(feat);
- }
- }
- }
-
- }
-
- }
- // garbage collect
-
- // logger.debug("Adding seq " + acc + " from " + start + " to " + end
- // + ": " + seq);
- this.seqs.addElement(seqO);
- }
- return; // finished parsing this segment of source
- }
- else if (!r.search(line))
- {
- // System.err.println("Found sequence line: " + line);
-
- // Split sequence in sequence and accession parts
- if (!x.search(line))
- {
- // logger.error("Could not parse sequence line: " + line);
- throw new IOException("Could not parse sequence line: " + line);
- }
- String ns = (String) seqs.get(x.stringMatched(1));
- if (ns == null)
- {
- ns = "";
- }
- ns += x.stringMatched(2);
-
- seqs.put(x.stringMatched(1), ns);
- }
- else
- {
- String annType = r.stringMatched(1);
- String annContent = r.stringMatched(2);
-
- // System.err.println("type:" + annType + " content: " + annContent);
-
- if (annType.equals("GF"))
- {
- /*
- * Generic per-File annotation, free text Magic features: #=GF NH
- * <tree in New Hampshire eXtended format> #=GF TN <Unique identifier
- * for the next tree> Pfam descriptions: 7. DESCRIPTION OF FIELDS
- *
- * Compulsory fields: ------------------
- *
- * AC Accession number: Accession number in form PFxxxxx.version or
- * PBxxxxxx. ID Identification: One word name for family. DE
- * Definition: Short description of family. AU Author: Authors of the
- * entry. SE Source of seed: The source suggesting the seed members
- * belong to one family. GA Gathering method: Search threshold to
- * build the full alignment. TC Trusted Cutoff: Lowest sequence score
- * and domain score of match in the full alignment. NC Noise Cutoff:
- * Highest sequence score and domain score of match not in full
- * alignment. TP Type: Type of family -- presently Family, Domain,
- * Motif or Repeat. SQ Sequence: Number of sequences in alignment. AM
- * Alignment Method The order ls and fs hits are aligned to the model
- * to build the full align. // End of alignment.
- *
- * Optional fields: ----------------
- *
- * DC Database Comment: Comment about database reference. DR Database
- * Reference: Reference to external database. RC Reference Comment:
- * Comment about literature reference. RN Reference Number: Reference
- * Number. RM Reference Medline: Eight digit medline UI number. RT
- * Reference Title: Reference Title. RA Reference Author: Reference
- * Author RL Reference Location: Journal location. PI Previous
- * identifier: Record of all previous ID lines. KW Keywords: Keywords.
- * CC Comment: Comments. NE Pfam accession: Indicates a nested domain.
- * NL Location: Location of nested domains - sequence ID, start and
- * end of insert.
- *
- * Obsolete fields: ----------- AL Alignment method of seed: The
- * method used to align the seed members.
- */
- // Let's save the annotations, maybe we'll be able to do something
- // with them later...
- Regex an = new Regex("(\\w+)\\s*(.*)");
- if (an.search(annContent))
- {
- if (an.stringMatched(1).equals("NH"))
- {
- treeString.append(an.stringMatched(2));
- }
- else if (an.stringMatched(1).equals("TN"))
- {
- if (treeString.length() > 0)
- {
- if (treeName == null)
- {
- treeName = "Tree " + (getTreeCount() + 1);
- }
- addNewickTree(treeName, treeString.toString());
- }
- treeName = an.stringMatched(2);
- treeString = new StringBuffer();
- }
- setAlignmentProperty(an.stringMatched(1), an.stringMatched(2));
- }
- }
- else if (annType.equals("GS"))
- {
- // Generic per-Sequence annotation, free text
- /*
- * Pfam uses these features: Feature Description ---------------------
- * ----------- AC <accession> ACcession number DE <freetext>
- * DEscription DR <db>; <accession>; Database Reference OS <organism>
- * OrganiSm (species) OC <clade> Organism Classification (clade, etc.)
- * LO <look> Look (Color, etc.)
- */
- if (s.search(annContent))
- {
- String acc = s.stringMatched(1);
- String type = s.stringMatched(2);
- String content = s.stringMatched(3);
- // TODO: store DR in a vector.
- // TODO: store AC according to generic file db annotation.
- Hashtable ann;
- if (seqAnn.containsKey(acc))
- {
- ann = (Hashtable) seqAnn.get(acc);
- }
- else
- {
- ann = new Hashtable();
- }
- ann.put(type, content);
- seqAnn.put(acc, ann);
- }
- else
- {
- throw new IOException("Error parsing " + line);
- }
- }
- else if (annType.equals("GC"))
- {
- // Generic per-Column annotation, exactly 1 char per column
- // always need a label.
- if (x.search(annContent))
- {
- // parse out and create alignment annotation directly.
- parseAnnotationRow(annotations, x.stringMatched(1),
- x.stringMatched(2));
- }
- }
- else if (annType.equals("GR"))
- {
- // Generic per-Sequence AND per-Column markup, exactly 1 char per
- // column
- /*
- * Feature Description Markup letters ------- -----------
- * -------------- SS Secondary Structure [HGIEBTSCX] SA Surface
- * Accessibility [0-9X] (0=0%-10%; ...; 9=90%-100%) TM TransMembrane
- * [Mio] PP Posterior Probability [0-9*] (0=0.00-0.05; 1=0.05-0.15;
- * *=0.95-1.00) LI LIgand binding [*] AS Active Site [*] IN INtron (in
- * or after) [0-2]
- */
- if (s.search(annContent))
- {
- String acc = s.stringMatched(1);
- String type = s.stringMatched(2);
- String seq = new String(s.stringMatched(3));
- String description = null;
- // Check for additional information about the current annotation
- // We use a simple string tokenizer here for speed
- StringTokenizer sep = new StringTokenizer(seq, " \t");
- description = sep.nextToken();
- if (sep.hasMoreTokens())
- {
- seq = sep.nextToken();
- }
- else
- {
- seq = description;
- description = new String();
- }
- // sequence id with from-to fields
-
- Hashtable ann;
- // Get an object with all the annotations for this sequence
- if (seqAnn.containsKey(acc))
- {
- // logger.debug("Found annotations for " + acc);
- ann = (Hashtable) seqAnn.get(acc);
- }
- else
- {
- // logger.debug("Creating new annotations holder for " + acc);
- ann = new Hashtable();
- seqAnn.put(acc, ann);
- }
+ Enumeration j = content.keys();
+ while (j.hasMoreElements())
+ {
+ String desc = j.nextElement().toString();
+ String ns = content.get(desc).toString();
+ char[] byChar = ns.toCharArray();
+ for (int k = 0; k < byChar.length; k++)
+ {
+ char c = byChar[k];
+ if (!(c == ' ' || c == '_' || c == '-' || c == '.')) // PFAM
+ // uses
+ // '.'
+ // for
+ // feature
+ // background
+ {
+ int new_pos = posmap[k]; // look up nearest seqeunce
+ // position to this column
+ SequenceFeature feat = new SequenceFeature(type, desc,
+ new_pos, new_pos, 0f, null);
+
+ seqO.addSequenceFeature(feat);
+ }
+ }
+ }
+
+ }
+
+ }
+ // garbage collect
+
+ // logger.debug("Adding seq " + acc + " from " + start + " to " + end
+ // + ": " + seq);
+ this.seqs.addElement(seqO);
+ }
+ return; // finished parsing this segment of source
+ }
+ else if (!r.search(line))
+ {
+ // System.err.println("Found sequence line: " + line);
+
+ // Split sequence in sequence and accession parts
+ if (!x.search(line))
+ {
+ // logger.error("Could not parse sequence line: " + line);
+ throw new IOException("Could not parse sequence line: " + line);
+ }
+ String ns = (String) seqs.get(x.stringMatched(1));
+ if (ns == null)
+ {
+ ns = "";
+ }
+ ns += x.stringMatched(2);
+
+ seqs.put(x.stringMatched(1), ns);
+ }
+ else
+ {
+ String annType = r.stringMatched(1);
+ String annContent = r.stringMatched(2);
+
+ // System.err.println("type:" + annType + " content: " + annContent);
+
+ if (annType.equals("GF"))
+ {
+ /*
+ * Generic per-File annotation, free text Magic features: #=GF NH
+ * <tree in New Hampshire eXtended format> #=GF TN <Unique identifier
+ * for the next tree> Pfam descriptions: 7. DESCRIPTION OF FIELDS
+ *
+ * Compulsory fields: ------------------
+ *
+ * AC Accession number: Accession number in form PFxxxxx.version or
+ * PBxxxxxx. ID Identification: One word name for family. DE
+ * Definition: Short description of family. AU Author: Authors of the
+ * entry. SE Source of seed: The source suggesting the seed members
+ * belong to one family. GA Gathering method: Search threshold to
+ * build the full alignment. TC Trusted Cutoff: Lowest sequence score
+ * and domain score of match in the full alignment. NC Noise Cutoff:
+ * Highest sequence score and domain score of match not in full
+ * alignment. TP Type: Type of family -- presently Family, Domain,
+ * Motif or Repeat. SQ Sequence: Number of sequences in alignment. AM
+ * Alignment Method The order ls and fs hits are aligned to the model
+ * to build the full align. // End of alignment.
+ *
+ * Optional fields: ----------------
+ *
+ * DC Database Comment: Comment about database reference. DR Database
+ * Reference: Reference to external database. RC Reference Comment:
+ * Comment about literature reference. RN Reference Number: Reference
+ * Number. RM Reference Medline: Eight digit medline UI number. RT
+ * Reference Title: Reference Title. RA Reference Author: Reference
+ * Author RL Reference Location: Journal location. PI Previous
+ * identifier: Record of all previous ID lines. KW Keywords: Keywords.
+ * CC Comment: Comments. NE Pfam accession: Indicates a nested domain.
+ * NL Location: Location of nested domains - sequence ID, start and
+ * end of insert.
+ *
+ * Obsolete fields: ----------- AL Alignment method of seed: The
+ * method used to align the seed members.
+ */
+ // Let's save the annotations, maybe we'll be able to do something
+ // with them later...
+ Regex an = new Regex("(\\w+)\\s*(.*)");
+ if (an.search(annContent))
+ {
+ if (an.stringMatched(1).equals("NH"))
+ {
+ treeString.append(an.stringMatched(2));
+ }
+ else if (an.stringMatched(1).equals("TN"))
+ {
+ if (treeString.length() > 0)
+ {
+ if (treeName == null)
+ {
+ treeName = "Tree " + (getTreeCount() + 1);
+ }
+ addNewickTree(treeName, treeString.toString());
+ }
+ treeName = an.stringMatched(2);
+ treeString = new StringBuffer();
+ }
+ setAlignmentProperty(an.stringMatched(1), an.stringMatched(2));
+ }
+ }
+ else if (annType.equals("GS"))
+ {
+ // Generic per-Sequence annotation, free text
+ /*
+ * Pfam uses these features: Feature Description ---------------------
+ * ----------- AC <accession> ACcession number DE <freetext>
+ * DEscription DR <db>; <accession>; Database Reference OS <organism>
+ * OrganiSm (species) OC <clade> Organism Classification (clade, etc.)
+ * LO <look> Look (Color, etc.)
+ */
+ if (s.search(annContent))
+ {
+ String acc = s.stringMatched(1);
+ String type = s.stringMatched(2);
+ String content = s.stringMatched(3);
+ // TODO: store DR in a vector.
+ // TODO: store AC according to generic file db annotation.
+ Hashtable ann;
+ if (seqAnn.containsKey(acc))
+ {
+ ann = (Hashtable) seqAnn.get(acc);
+ }
+ else
+ {
+ ann = new Hashtable();
+ }
+ ann.put(type, content);
+ seqAnn.put(acc, ann);
+ }
+ else
+ {
+ throw new IOException("Error parsing " + line);
+ }
+ }
+ else if (annType.equals("GC"))
+ {
+ // Generic per-Column annotation, exactly 1 char per column
+ // always need a label.
+ if (x.search(annContent))
+ {
+ // parse out and create alignment annotation directly.
+ parseAnnotationRow(annotations, x.stringMatched(1),
+ x.stringMatched(2));
+ }
+ }
+ else if (annType.equals("GR"))
+ {
+ // Generic per-Sequence AND per-Column markup, exactly 1 char per
+ // column
+ /*
+ * Feature Description Markup letters ------- -----------
+ * -------------- SS Secondary Structure [HGIEBTSCX] SA Surface
+ * Accessibility [0-9X] (0=0%-10%; ...; 9=90%-100%) TM TransMembrane
+ * [Mio] PP Posterior Probability [0-9*] (0=0.00-0.05; 1=0.05-0.15;
+ * *=0.95-1.00) LI LIgand binding [*] AS Active Site [*] IN INtron (in
+ * or after) [0-2]
+ */
+ if (s.search(annContent))
+ {
+ String acc = s.stringMatched(1);
+ String type = s.stringMatched(2);
+ String seq = new String(s.stringMatched(3));
+ String description = null;
+ // Check for additional information about the current annotation
+ // We use a simple string tokenizer here for speed
+ StringTokenizer sep = new StringTokenizer(seq, " \t");
+ description = sep.nextToken();
+ if (sep.hasMoreTokens())
+ {
+ seq = sep.nextToken();
+ }
+ else
+ {
+ seq = description;
+ description = new String();
+ }
+ // sequence id with from-to fields
+
+ Hashtable ann;
+ // Get an object with all the annotations for this sequence
+ if (seqAnn.containsKey(acc))
+ {
+ // logger.debug("Found annotations for " + acc);
+ ann = (Hashtable) seqAnn.get(acc);
+ }
+ else
+ {
+ // logger.debug("Creating new annotations holder for " + acc);
+ ann = new Hashtable();
+ seqAnn.put(acc, ann);
+ }
// TODO test structure, call parseAnnotationRow with vector from
// hashtable for specific sequence
- Hashtable features;
- // Get an object with all the content for an annotation
- if (ann.containsKey("features"))
- {
- // logger.debug("Found features for " + acc);
- features = (Hashtable) ann.get("features");
- }
- else
- {
- // logger.debug("Creating new features holder for " + acc);
- features = new Hashtable();
- ann.put("features", features);
- }
-
- Hashtable content;
- if (features.containsKey(this.id2type(type)))
- {
- // logger.debug("Found content for " + this.id2type(type));
- content = (Hashtable) features.get(this.id2type(type));
- }
- else
- {
- // logger.debug("Creating new content holder for " +
- // this.id2type(type));
- content = new Hashtable();
- features.put(this.id2type(type), content);
- }
- String ns = (String) content.get(description);
- if (ns == null)
- {
- ns = "";
- }
- ns += seq;
- content.put(description, ns);
-
-// if(type.equals("SS")){
- Hashtable strucAnn;
- if (seqAnn.containsKey(acc))
- {
- strucAnn = (Hashtable) seqAnn.get(acc);
- }
- else
- {
- strucAnn = new Hashtable();
- }
-
- Vector newStruc=new Vector();
- parseAnnotationRow(newStruc, type,ns);
-
- strucAnn.put(type, newStruc);
- seqAnn.put(acc, strucAnn);
- }
-// }
- else
- {
- System.err
- .println("Warning - couldn't parse sequence annotation row line:\n"
- + line);
- // throw new IOException("Error parsing " + line);
- }
- }
- else
- {
- throw new IOException("Unknown annotation detected: " + annType
- + " " + annContent);
- }
- }
- }
- if (treeString.length() > 0)
- {
- if (treeName == null)
- {
- treeName = "Tree " + (1 + getTreeCount());
- }
- addNewickTree(treeName, treeString.toString());
- }
- }
+ Hashtable features;
+ // Get an object with all the content for an annotation
+ if (ann.containsKey("features"))
+ {
+ // logger.debug("Found features for " + acc);
+ features = (Hashtable) ann.get("features");
+ }
+ else
+ {
+ // logger.debug("Creating new features holder for " + acc);
+ features = new Hashtable();
+ ann.put("features", features);
+ }
-/**
- * Demangle an accession string and guess the originating sequence database for a given sequence
- * @param seqO sequence to be annotated
- * @param dbr Accession string for sequence
- * @param dbsource source database for alignment (PFAM or RFAM)
+ Hashtable content;
+ if (features.containsKey(this.id2type(type)))
+ {
+ // logger.debug("Found content for " + this.id2type(type));
+ content = (Hashtable) features.get(this.id2type(type));
+ }
+ else
+ {
+ // logger.debug("Creating new content holder for " +
+ // this.id2type(type));
+ content = new Hashtable();
+ features.put(this.id2type(type), content);
+ }
+ String ns = (String) content.get(description);
+ if (ns == null)
+ {
+ ns = "";
+ }
+ ns += seq;
+ content.put(description, ns);
+
+ // if(type.equals("SS")){
+ Hashtable strucAnn;
+ if (seqAnn.containsKey(acc))
+ {
+ strucAnn = (Hashtable) seqAnn.get(acc);
+ }
+ else
+ {
+ strucAnn = new Hashtable();
+ }
+
+ Vector newStruc = new Vector();
+ parseAnnotationRow(newStruc, type, ns);
+
+ strucAnn.put(type, newStruc);
+ seqAnn.put(acc, strucAnn);
+ }
+ // }
+ else
+ {
+ System.err
+ .println("Warning - couldn't parse sequence annotation row line:\n"
+ + line);
+ // throw new IOException("Error parsing " + line);
+ }
+ }
+ else
+ {
+ throw new IOException("Unknown annotation detected: " + annType
+ + " " + annContent);
+ }
+ }
+ }
+ if (treeString.length() > 0)
+ {
+ if (treeName == null)
+ {
+ treeName = "Tree " + (1 + getTreeCount());
+ }
+ addNewickTree(treeName, treeString.toString());
+ }
+ }
+
+ /**
+ * Demangle an accession string and guess the originating sequence database
+ * for a given sequence
+ *
+ * @param seqO
+ * sequence to be annotated
+ * @param dbr
+ * Accession string for sequence
+ * @param dbsource
+ * source database for alignment (PFAM or RFAM)
*/
private void guessDatabaseFor(Sequence seqO, String dbr, String dbsource)
{
- DBRefEntry dbrf=null;
- List<DBRefEntry> dbrs=new ArrayList<DBRefEntry>();
- String seqdb="Unknown",sdbac=""+dbr;
- int st=-1,en=-1,p;
- if ((st=sdbac.indexOf("/"))>-1)
+ DBRefEntry dbrf = null;
+ List<DBRefEntry> dbrs = new ArrayList<DBRefEntry>();
+ String seqdb = "Unknown", sdbac = "" + dbr;
+ int st = -1, en = -1, p;
+ if ((st = sdbac.indexOf("/")) > -1)
{
- String num,range=sdbac.substring(st+1);
- sdbac = sdbac.substring(0,st);
- if ((p=range.indexOf("-"))>-1)
+ String num, range = sdbac.substring(st + 1);
+ sdbac = sdbac.substring(0, st);
+ if ((p = range.indexOf("-")) > -1)
{
p++;
- if (p<range.length())
- {
- num = range.substring(p).trim();
- try {
- en = Integer.parseInt(num);
- } catch (NumberFormatException x)
+ if (p < range.length())
{
- // could warn here that index is invalid
- en = -1;
- }
+ num = range.substring(p).trim();
+ try
+ {
+ en = Integer.parseInt(num);
+ } catch (NumberFormatException x)
+ {
+ // could warn here that index is invalid
+ en = -1;
+ }
}
- } else {
- p=range.length();
}
- num=range.substring(0,p).trim();
- try {
+ else
+ {
+ p = range.length();
+ }
+ num = range.substring(0, p).trim();
+ try
+ {
st = Integer.parseInt(num);
} catch (NumberFormatException x)
{
st = -1;
}
}
- if (dbsource.equals("PFAM")) {
+ if (dbsource.equals("PFAM"))
+ {
seqdb = "UNIPROT";
- if (sdbac.indexOf(".")>-1)
+ if (sdbac.indexOf(".") > -1)
{
// strip of last subdomain
- sdbac = sdbac.substring(0,sdbac.indexOf("."));
- dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, seqdb, dbsource, sdbac);
- if (dbrf!=null)
+ sdbac = sdbac.substring(0, sdbac.indexOf("."));
+ dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, seqdb, dbsource,
+ sdbac);
+ if (dbrf != null)
{
dbrs.add(dbrf);
}
}
- dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, dbsource, dbsource, dbr);
- if (dbr!=null)
+ dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, dbsource, dbsource,
+ dbr);
+ if (dbr != null)
{
dbrs.add(dbrf);
}
- } else {
- seqdb = "EMBL"; // total guess - could be ENA, or something else these days
- if (sdbac.indexOf(".")>-1)
+ }
+ else
+ {
+ seqdb = "EMBL"; // total guess - could be ENA, or something else these
+ // days
+ if (sdbac.indexOf(".") > -1)
{
// strip off last subdomain
- sdbac = sdbac.substring(0,sdbac.indexOf("."));
- dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, seqdb, dbsource, sdbac);
- if (dbrf!=null)
+ sdbac = sdbac.substring(0, sdbac.indexOf("."));
+ dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, seqdb, dbsource,
+ sdbac);
+ if (dbrf != null)
{
dbrs.add(dbrf);
}
}
-
- dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, dbsource, dbsource, dbr);
- if (dbrf!=null)
+
+ dbrf = jalview.util.DBRefUtils.parseToDbRef(seqO, dbsource, dbsource,
+ dbr);
+ if (dbrf != null)
{
dbrs.add(dbrf);
}
}
- if (st!=-1 && en!=-1)
+ if (st != -1 && en != -1)
{
- for (DBRefEntry d:dbrs)
+ for (DBRefEntry d : dbrs)
{
- jalview.util.MapList mp = new jalview.util.MapList(new int[] { seqO.getStart(),seqO.getEnd()},new int[] { st,en},1,1);
+ jalview.util.MapList mp = new jalview.util.MapList(new int[]
+ { seqO.getStart(), seqO.getEnd() }, new int[]
+ { st, en }, 1, 1);
jalview.datamodel.Mapping mping = new Mapping(mp);
d.setMap(mping);
}
seq += ch;
}
else if (ch.length() > 1)
- {
+ {
seq += ch.charAt(1);
}
}
+ type);
return key;
}
+
/**
* make a friendly ID string.
*
* @author Paolo Di Tommaso
*
*/
-public class TCoffeeScoreFile extends AlignFile {
+public class TCoffeeScoreFile extends AlignFile
+{
public TCoffeeScoreFile(String inFile, String type) throws IOException
{
super(inFile, type);
}
}
- static Pattern SCORES_WITH_RESIDUE_NUMS = Pattern.compile("^\\d+\\s([^\\s]+)\\s+\\d+$");
-
+ static Pattern SCORES_WITH_RESIDUE_NUMS = Pattern
+ .compile("^\\d+\\s([^\\s]+)\\s+\\d+$");
+
/**
* Read a scores block ihe provided stream.
*
String val = line.substring(p + 1).trim();
Matcher m = SCORES_WITH_RESIDUE_NUMS.matcher(val);
- if( m.matches() ) {
- val = m.group(1);
+ if (m.matches())
+ {
+ val = m.group(1);
}
-
+
result.items.put(id, val);
} while ((line = reader.nextLine()) != null);
{
if (al.getHeight() != getHeight() || al.getWidth() != getWidth())
{
- String info = String.format("align w: %s, h: %s; score: w: %s; h: %s ", al.getWidth(), al.getHeight(), getWidth(), getHeight() );
- warningMessage = "Alignment shape does not match T-Coffee score file shape -- " + info;
+ String info = String.format(
+ "align w: %s, h: %s; score: w: %s; h: %s ", al.getWidth(),
+ al.getHeight(), getWidth(), getHeight());
+ warningMessage = "Alignment shape does not match T-Coffee score file shape -- "
+ + info;
return false;
}
boolean added = false;
{
this.ap = ap;
this.al = al;
- output.setText(MessageManager.getString("label.wswublast_client_credits"));
+ output.setText(MessageManager
+ .getString("label.wswublast_client_credits"));
- Desktop.addInternalFrame(output,
- MessageManager.getString("label.blasting_for_unidentified_sequence"), 800, 300);
+ Desktop.addInternalFrame(output, MessageManager
+ .getString("label.blasting_for_unidentified_sequence"), 800,
+ 300);
for (int i = 0; i < ids.size(); i++)
{
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.javascript;
+
public interface JsCallBack
{
public jalview.appletgui.AlignFrame getAlignFrame();
protected JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
-
+
protected JRadioButtonMenuItem RNAInteractionColour = new JRadioButtonMenuItem();
// protected JRadioButtonMenuItem covariationColour = new
public JCheckBoxMenuItem showSeqFeaturesHeight = new JCheckBoxMenuItem();
JMenuItem deleteGroups = new JMenuItem();
-
+
JMenuItem createGroup = new JMenuItem();
+
JMenuItem unGroup = new JMenuItem();
JMenuItem delete = new JMenuItem();
protected JMenuItem showTranslation = new JMenuItem();
protected JMenuItem extractScores = new JMenuItem();
-
+
protected JMenuItem expandAlignment = new JMenuItem();
protected JMenu showProducts = new JMenu();
int option = JOptionPane.showInternalConfirmDialog(
jalview.gui.Desktop.desktop,
- MessageManager.getString("label.remove_from_default_list"),
- MessageManager.getString("label.remove_user_defined_colour"),
+ MessageManager
+ .getString("label.remove_from_default_list"),
+ MessageManager
+ .getString("label.remove_user_defined_colour"),
JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION)
{
purinePyrimidineColour.setSelected(true);
break;
-
+
case ColourSchemeProperty.RNAINTERACTION:
- RNAInteractionColour.setSelected(true);
+ RNAInteractionColour.setSelected(true);
- break;
+ break;
/*
* case ColourSchemeProperty.COVARIATION:
* covariationColour.setSelected(true);
colourMenu.setText(MessageManager.getString("action.colour"));
calculateMenu.setText(MessageManager.getString("action.calculate"));
webService.setText(MessageManager.getString("action.web_service"));
- selectAllSequenceMenuItem.setText(MessageManager.getString("action.select_all"));
+ selectAllSequenceMenuItem.setText(MessageManager
+ .getString("action.select_all"));
selectAllSequenceMenuItem.setAccelerator(javax.swing.KeyStroke
.getKeyStroke(java.awt.event.KeyEvent.VK_A, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask(), false));
selectAllSequenceMenuItem_actionPerformed(e);
}
});
- deselectAllSequenceMenuItem.setText(MessageManager.getString("action.deselect_all"));
+ deselectAllSequenceMenuItem.setText(MessageManager
+ .getString("action.deselect_all"));
deselectAllSequenceMenuItem.setAccelerator(javax.swing.KeyStroke
.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0, false));
deselectAllSequenceMenuItem
deselectAllSequenceMenuItem_actionPerformed(e);
}
});
- invertSequenceMenuItem.setText(MessageManager.getString("action.invert_sequence_selection"));
+ invertSequenceMenuItem.setText(MessageManager
+ .getString("action.invert_sequence_selection"));
invertSequenceMenuItem.setAccelerator(javax.swing.KeyStroke
.getKeyStroke(java.awt.event.KeyEvent.VK_I, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask(), false));
invertSequenceMenuItem_actionPerformed(e);
}
});
- grpsFromSelection.setText(MessageManager.getString("action.make_groups_selection"));
+ grpsFromSelection.setText(MessageManager
+ .getString("action.make_groups_selection"));
grpsFromSelection.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
makeGrpsFromSelection_actionPerformed(e);
}
});
- expandAlignment.setText(MessageManager.getString("action.view_flanking_regions"));
- expandAlignment.setToolTipText(MessageManager.getString("label.view_flanking_regions"));
- expandAlignment.addActionListener(new java.awt.event.ActionListener() {
+ expandAlignment.setText(MessageManager
+ .getString("action.view_flanking_regions"));
+ expandAlignment.setToolTipText(MessageManager
+ .getString("label.view_flanking_regions"));
+ expandAlignment.addActionListener(new java.awt.event.ActionListener()
+ {
@Override
public void actionPerformed(ActionEvent e)
{
expand_newalign(e);
}
});
- remove2LeftMenuItem.setText(MessageManager.getString("action.remove_left"));
+ remove2LeftMenuItem.setText(MessageManager
+ .getString("action.remove_left"));
remove2LeftMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
java.awt.event.KeyEvent.VK_L, Toolkit.getDefaultToolkit()
.getMenuShortcutKeyMask(), false));
remove2LeftMenuItem_actionPerformed(e);
}
});
- remove2RightMenuItem.setText(MessageManager.getString("action.remove_right"));
+ remove2RightMenuItem.setText(MessageManager
+ .getString("action.remove_right"));
remove2RightMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
java.awt.event.KeyEvent.VK_R, Toolkit.getDefaultToolkit()
.getMenuShortcutKeyMask(), false));
remove2RightMenuItem_actionPerformed(e);
}
});
- removeGappedColumnMenuItem.setText(MessageManager.getString("action.remove_empty_columns"));
+ removeGappedColumnMenuItem.setText(MessageManager
+ .getString("action.remove_empty_columns"));
removeGappedColumnMenuItem.setAccelerator(javax.swing.KeyStroke
.getKeyStroke(java.awt.event.KeyEvent.VK_E, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask(), false));
removeGappedColumnMenuItem_actionPerformed(e);
}
});
- removeAllGapsMenuItem.setText(MessageManager.getString("action.remove_all_gaps"));
+ removeAllGapsMenuItem.setText(MessageManager
+ .getString("action.remove_all_gaps"));
removeAllGapsMenuItem.setAccelerator(javax.swing.KeyStroke
.getKeyStroke(java.awt.event.KeyEvent.VK_E, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask()
removeAllGapsMenuItem_actionPerformed(e);
}
});
- justifyLeftMenuItem.setText(MessageManager.getString("action.left_justify_alignment"));
+ justifyLeftMenuItem.setText(MessageManager
+ .getString("action.left_justify_alignment"));
justifyLeftMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
justifyLeftMenuItem_actionPerformed(e);
}
});
- justifyRightMenuItem.setText(MessageManager.getString("action.right_justify_alignment"));
+ justifyRightMenuItem.setText(MessageManager
+ .getString("action.right_justify_alignment"));
justifyRightMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
viewTextMenuItem_actionPerformed(e);
}
});
- showNonconservedMenuItem.setText(MessageManager.getString("label.show_non_conversed"));
+ showNonconservedMenuItem.setText(MessageManager
+ .getString("label.show_non_conversed"));
showNonconservedMenuItem.setState(false);
showNonconservedMenuItem
.addActionListener(new java.awt.event.ActionListener()
showUnconservedMenuItem_actionPerformed(e);
}
});
- sortPairwiseMenuItem.setText(MessageManager.getString("action.by_pairwise_id"));
+ sortPairwiseMenuItem.setText(MessageManager
+ .getString("action.by_pairwise_id"));
sortPairwiseMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
sortIDMenuItem_actionPerformed(e);
}
});
- sortLengthMenuItem.setText(MessageManager.getString("action.by_length"));
+ sortLengthMenuItem
+ .setText(MessageManager.getString("action.by_length"));
sortLengthMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
sortGroupMenuItem_actionPerformed(e);
}
});
- removeRedundancyMenuItem.setText(MessageManager.getString("action.remove_redundancy"));
+ removeRedundancyMenuItem.setText(MessageManager
+ .getString("action.remove_redundancy"));
removeRedundancyMenuItem.setAccelerator(javax.swing.KeyStroke
.getKeyStroke(java.awt.event.KeyEvent.VK_D, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask(), false));
removeRedundancyMenuItem_actionPerformed(e);
}
});
- pairwiseAlignmentMenuItem.setText(MessageManager.getString("action.pairwise_alignment"));
+ pairwiseAlignmentMenuItem.setText(MessageManager
+ .getString("action.pairwise_alignment"));
pairwiseAlignmentMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
pairwiseAlignmentMenuItem_actionPerformed(e);
}
});
- PCAMenuItem.setText(MessageManager.getString("label.principal_component_analysis"));
+ PCAMenuItem.setText(MessageManager
+ .getString("label.principal_component_analysis"));
PCAMenuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
PCAMenuItem_actionPerformed(e);
}
});
- averageDistanceTreeMenuItem
- .setText(MessageManager.getString("label.average_distance_identity"));
+ averageDistanceTreeMenuItem.setText(MessageManager
+ .getString("label.average_distance_identity"));
averageDistanceTreeMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
averageDistanceTreeMenuItem_actionPerformed(e);
}
});
- neighbourTreeMenuItem.setText(MessageManager.getString("label.neighbour_joining_identity"));
+ neighbourTreeMenuItem.setText(MessageManager
+ .getString("label.neighbour_joining_identity"));
neighbourTreeMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
statusBar.setFont(new java.awt.Font("Verdana", 0, 11));
statusBar.setBorder(BorderFactory.createLineBorder(Color.black));
statusBar.setText(MessageManager.getString("label.status_bar"));
- outputTextboxMenu.setText(MessageManager.getString("label.out_to_textbox"));
+ outputTextboxMenu.setText(MessageManager
+ .getString("label.out_to_textbox"));
clustalColour.setText(MessageManager.getString("label.clustalx"));
clustalColour.addActionListener(new java.awt.event.ActionListener()
taylorColour_actionPerformed(e);
}
});
- hydrophobicityColour.setText(MessageManager.getString("label.hydrophobicity"));
+ hydrophobicityColour.setText(MessageManager
+ .getString("label.hydrophobicity"));
hydrophobicityColour
.addActionListener(new java.awt.event.ActionListener()
{
helixColour_actionPerformed(e);
}
});
- strandColour.setText(MessageManager.getString("label.strand_propensity"));
+ strandColour.setText(MessageManager
+ .getString("label.strand_propensity"));
strandColour.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
buriedColour_actionPerformed(e);
}
});
- userDefinedColour.setText(MessageManager.getString("action.user_defined"));
+ userDefinedColour.setText(MessageManager
+ .getString("action.user_defined"));
userDefinedColour.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
userDefinedColour_actionPerformed(e);
}
});
- PIDColour.setText(MessageManager.getString("label.percentage_identity"));
+ PIDColour
+ .setText(MessageManager.getString("label.percentage_identity"));
PIDColour.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
PIDColour_actionPerformed(e);
}
});
- BLOSUM62Colour.setText(MessageManager.getString("label.blosum62_score"));
+ BLOSUM62Colour
+ .setText(MessageManager.getString("label.blosum62_score"));
BLOSUM62Colour.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
- purinePyrimidineColour.setText(MessageManager.getString("label.purine_pyrimidine"));
+ purinePyrimidineColour.setText(MessageManager
+ .getString("label.purine_pyrimidine"));
purinePyrimidineColour
.addActionListener(new java.awt.event.ActionListener()
{
purinePyrimidineColour_actionPerformed(e);
}
});
-
+
RNAInteractionColour.setText("RNA Interaction type");
- RNAInteractionColour.addActionListener(new java.awt.event.ActionListener()
+ RNAInteractionColour
+ .addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
{
- RNAInteractionColour_actionPerformed(e);
+ RNAInteractionColour_actionPerformed(e);
}
});
/*
* covariationColour_actionPerformed(e); } });
*/
- avDistanceTreeBlosumMenuItem.setText(MessageManager.getString("label.average_distance_bloslum62"));
+ avDistanceTreeBlosumMenuItem.setText(MessageManager
+ .getString("label.average_distance_bloslum62"));
avDistanceTreeBlosumMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
avTreeBlosumMenuItem_actionPerformed(e);
}
});
- njTreeBlosumMenuItem.setText(MessageManager.getString("label.neighbour_blosum62"));
+ njTreeBlosumMenuItem.setText(MessageManager
+ .getString("label.neighbour_blosum62"));
njTreeBlosumMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
}
});
annotationPanelMenuItem.setActionCommand("");
- annotationPanelMenuItem.setText(MessageManager.getString("label.show_annotations"));
+ annotationPanelMenuItem.setText(MessageManager
+ .getString("label.show_annotations"));
annotationPanelMenuItem.setState(jalview.bin.Cache.getDefault(
"SHOW_ANNOTATIONS", true));
annotationPanelMenuItem
annotationPanelMenuItem_actionPerformed(e);
}
});
- colourTextMenuItem.setText(MessageManager.getString("label.colour_text"));
+ colourTextMenuItem.setText(MessageManager
+ .getString("label.colour_text"));
colourTextMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
htmlMenuItem_actionPerformed(e);
}
});
- overviewMenuItem.setText(MessageManager.getString("label.overview_window"));
+ overviewMenuItem.setText(MessageManager
+ .getString("label.overview_window"));
overviewMenuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
redoMenuItem_actionPerformed(e);
}
});
- conservationMenuItem.setText(MessageManager.getString("action.by_conservation"));
+ conservationMenuItem.setText(MessageManager
+ .getString("action.by_conservation"));
conservationMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
printMenuItem_actionPerformed(e);
}
});
- renderGapsMenuItem.setText(MessageManager.getString("action.show_gaps"));
+ renderGapsMenuItem
+ .setText(MessageManager.getString("action.show_gaps"));
renderGapsMenuItem.setState(true);
renderGapsMenuItem
.addActionListener(new java.awt.event.ActionListener()
findMenuItem_actionPerformed(e);
}
});
- abovePIDThreshold.setText(MessageManager.getString("label.above_identity_threshold"));
+ abovePIDThreshold.setText(MessageManager
+ .getString("label.above_identity_threshold"));
abovePIDThreshold.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
abovePIDThreshold_actionPerformed(e);
}
});
- showSeqFeatures.setText(MessageManager.getString("label.show_sequence_features"));
+ showSeqFeatures.setText(MessageManager
+ .getString("label.show_sequence_features"));
showSeqFeatures.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
* void actionPerformed(ActionEvent actionEvent) {
* showSeqFeaturesHeight_actionPerformed(actionEvent); } });
*/
- showDbRefsMenuitem.setText(MessageManager.getString("label.show_database_refs"));
+ showDbRefsMenuitem.setText(MessageManager
+ .getString("label.show_database_refs"));
showDbRefsMenuitem.addActionListener(new ActionListener()
{
}
});
- showNpFeatsMenuitem.setText(MessageManager.getString("label.show_non_positional_features"));
+ showNpFeatsMenuitem.setText(MessageManager
+ .getString("label.show_non_positional_features"));
showNpFeatsMenuitem.addActionListener(new ActionListener()
{
}
});
- showGroupConservation.setText(MessageManager.getString("label.group_conservation"));
+ showGroupConservation.setText(MessageManager
+ .getString("label.group_conservation"));
showGroupConservation.addActionListener(new ActionListener()
{
});
- showGroupConsensus.setText(MessageManager.getString("label.group_consensus"));
+ showGroupConsensus.setText(MessageManager
+ .getString("label.group_consensus"));
showGroupConsensus.addActionListener(new ActionListener()
{
}
});
- showConsensusHistogram.setText(MessageManager.getString("label.show_consensus_histogram"));
+ showConsensusHistogram.setText(MessageManager
+ .getString("label.show_consensus_histogram"));
showConsensusHistogram.addActionListener(new ActionListener()
{
}
});
- showSequenceLogo.setText(MessageManager.getString("label.show_consensus_logo"));
+ showSequenceLogo.setText(MessageManager
+ .getString("label.show_consensus_logo"));
showSequenceLogo.addActionListener(new ActionListener()
{
}
});
- normaliseSequenceLogo.setText(MessageManager.getString("label.norm_consensus_logo"));
+ normaliseSequenceLogo.setText(MessageManager
+ .getString("label.norm_consensus_logo"));
normaliseSequenceLogo.addActionListener(new ActionListener()
{
}
});
- applyAutoAnnotationSettings.setText(MessageManager.getString("label.apply_all_groups"));
+ applyAutoAnnotationSettings.setText(MessageManager
+ .getString("label.apply_all_groups"));
applyAutoAnnotationSettings.setState(false);
applyAutoAnnotationSettings.setVisible(true);
applyAutoAnnotationSettings.addActionListener(new ActionListener()
}
});
- deleteGroups.setText(MessageManager.getString("action.undefine_groups"));
+ deleteGroups
+ .setText(MessageManager.getString("action.undefine_groups"));
deleteGroups.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
java.awt.event.KeyEvent.VK_U, Toolkit.getDefaultToolkit()
.getMenuShortcutKeyMask(), false));
});
unGroup.setText(MessageManager.getString("action.remove_group"));
unGroup.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
- java.awt.event.KeyEvent.VK_G,Toolkit.getDefaultToolkit()
- .getMenuShortcutKeyMask() | java.awt.event.KeyEvent.SHIFT_MASK, false));
+ java.awt.event.KeyEvent.VK_G, Toolkit.getDefaultToolkit()
+ .getMenuShortcutKeyMask()
+ | java.awt.event.KeyEvent.SHIFT_MASK, false));
unGroup.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
pasteThis_actionPerformed(e);
}
});
- applyToAllGroups.setText(MessageManager.getString("label.apply_colour_to_all_groups"));
+ applyToAllGroups.setText(MessageManager
+ .getString("label.apply_colour_to_all_groups"));
applyToAllGroups.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
createPNG(null);
}
});
- createPNG.setActionCommand(MessageManager.getString("label.save_png_image"));
+ createPNG.setActionCommand(MessageManager
+ .getString("label.save_png_image"));
createPNG.setText("PNG");
font.setText(MessageManager.getString("action.font"));
font.addActionListener(new java.awt.event.ActionListener()
}
});
- seqLimits.setText(MessageManager.getString("label.show_sequence_limits"));
+ seqLimits.setText(MessageManager
+ .getString("label.show_sequence_limits"));
seqLimits.setState(jalview.bin.Cache.getDefault("SHOW_JVSUFFIX", true));
seqLimits.addActionListener(new java.awt.event.ActionListener()
{
createEPS(null);
}
});
- LoadtreeMenuItem.setActionCommand(MessageManager.getString("label.load_tree_for_sequence_set"));
- LoadtreeMenuItem.setText(MessageManager.getString("label.load_associated_tree"));
+ LoadtreeMenuItem.setActionCommand(MessageManager
+ .getString("label.load_tree_for_sequence_set"));
+ LoadtreeMenuItem.setText(MessageManager
+ .getString("label.load_associated_tree"));
LoadtreeMenuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
});
centreColumnLabelsMenuItem.setVisible(true);
centreColumnLabelsMenuItem.setState(false);
- centreColumnLabelsMenuItem.setText(MessageManager.getString("label.centre_column_labels"));
+ centreColumnLabelsMenuItem.setText(MessageManager
+ .getString("label.centre_column_labels"));
centreColumnLabelsMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
});
followHighlightMenuItem.setVisible(true);
followHighlightMenuItem.setState(true);
- followHighlightMenuItem.setText(MessageManager.getString("label.automatic_scrolling"));
+ followHighlightMenuItem.setText(MessageManager
+ .getString("label.automatic_scrolling"));
followHighlightMenuItem.addActionListener(new ActionListener()
{
});
- modifyPID.setText(MessageManager.getString("label.modify_identity_thereshold"));
+ modifyPID.setText(MessageManager
+ .getString("label.modify_identity_thereshold"));
modifyPID.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
modifyPID_actionPerformed(e);
}
});
- modifyConservation.setText(MessageManager.getString("label.modify_conservation_thereshold"));
+ modifyConservation.setText(MessageManager
+ .getString("label.modify_conservation_thereshold"));
modifyConservation
.addActionListener(new java.awt.event.ActionListener()
{
modifyConservation_actionPerformed(e);
}
});
- sortByTreeMenu.setText(MessageManager.getString("action.by_tree_order"));
+ sortByTreeMenu
+ .setText(MessageManager.getString("action.by_tree_order"));
sort.setText(MessageManager.getString("action.sort"));
sort.addMenuListener(new MenuListener()
{
{
}
});
- sortByAnnotScore.setText(MessageManager.getString("label.sort_by_score"));
+ sortByAnnotScore.setText(MessageManager
+ .getString("label.sort_by_score"));
sort.add(sortByAnnotScore);
sortByAnnotScore.addMenuListener(new javax.swing.event.MenuListener()
{
});
sortByAnnotScore.setVisible(false);
- calculateTree.setText(MessageManager.getString("action.calculate_tree"));
+ calculateTree
+ .setText(MessageManager.getString("action.calculate_tree"));
jMenu2.setText(MessageManager.getString("label.export_image"));
padGapsMenuitem.setText(MessageManager.getString("label.pad_gaps"));
vamsasStore_actionPerformed(e);
}
});
- showTranslation.setText(MessageManager.getString("label.translate_cDNA"));
+ showTranslation.setText(MessageManager
+ .getString("label.translate_cDNA"));
showTranslation.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
showTranslation_actionPerformed(e);
}
});
- extractScores.setText(MessageManager.getString("label.extract_scores") + "...");
+ extractScores.setText(MessageManager.getString("label.extract_scores")
+ + "...");
extractScores.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
* public void actionPerformed(ActionEvent e) {
* showProducts_actionPerformed(e); } });
*/
- openFeatureSettings.setText(MessageManager.getString("label.feature_settings"));
+ openFeatureSettings.setText(MessageManager
+ .getString("label.feature_settings"));
openFeatureSettings.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
featureSettings_actionPerformed(e);
}
});
- fetchSequence.setText(MessageManager.getString("label.fetch_sequences"));
+ fetchSequence
+ .setText(MessageManager.getString("label.fetch_sequences"));
fetchSequence.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
- annotationColour.setText(MessageManager.getString("action.by_annotation"));
+ annotationColour.setText(MessageManager
+ .getString("action.by_annotation"));
annotationColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
- rnahelicesColour.setText(MessageManager.getString("action.by_rna_helixes"));
+ rnahelicesColour.setText(MessageManager
+ .getString("action.by_rna_helixes"));
rnahelicesColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
- associatedData.setText(MessageManager.getString("label.load_features_annotations"));
+ associatedData.setText(MessageManager
+ .getString("label.load_features_annotations"));
associatedData.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
associatedData_actionPerformed(e);
}
});
- autoCalculate.setText(MessageManager.getString("label.autocalculate_consensus"));
+ autoCalculate.setText(MessageManager
+ .getString("label.autocalculate_consensus"));
autoCalculate.setState(jalview.bin.Cache.getDefault(
"AUTO_CALC_CONSENSUS", true));
autoCalculate.addActionListener(new ActionListener()
autoCalculate_actionPerformed(e);
}
});
- sortByTree.setText(MessageManager.getString("label.sort_alignment_new_tree"));
+ sortByTree.setText(MessageManager
+ .getString("label.sort_alignment_new_tree"));
sortByTree
- .setToolTipText("<html>" + MessageManager.getString("label.enable_automatically_sort_alignment_when_open_new_tree"));
+ .setToolTipText("<html>"
+ + MessageManager
+ .getString("label.enable_automatically_sort_alignment_when_open_new_tree"));
sortByTree
.setState(jalview.bin.Cache.getDefault("SORT_BY_TREE", false));
sortByTree.addActionListener(new ActionListener()
}
});
- listenToViewSelections.setText(MessageManager.getString("label.listen_for_selections"));
+ listenToViewSelections.setText(MessageManager
+ .getString("label.listen_for_selections"));
listenToViewSelections
- .setToolTipText("<html>" + MessageManager.getString("label.selections_mirror_selections_made_same_sequences_other_views"));
+ .setToolTipText("<html>"
+ + MessageManager
+ .getString("label.selections_mirror_selections_made_same_sequences_other_views"));
listenToViewSelections.setState(false);
listenToViewSelections.addActionListener(new ActionListener()
{
}
});
- addSequenceMenu.setText(MessageManager.getString("label.add_sequences"));
+ addSequenceMenu
+ .setText(MessageManager.getString("label.add_sequences"));
addFromFile.setText(MessageManager.getString("label.from_file"));
addFromFile.addActionListener(new ActionListener()
{
addFromURL_actionPerformed(e);
}
});
- exportFeatures.setText(MessageManager.getString("label.export_features"));
+ exportFeatures.setText(MessageManager
+ .getString("label.export_features"));
exportFeatures.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
exportFeatures_actionPerformed(e);
}
});
- exportAnnotations.setText(MessageManager.getString("label.export_annotations"));
+ exportAnnotations.setText(MessageManager
+ .getString("label.export_annotations"));
exportAnnotations.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
statusPanel.setLayout(gridLayout1);
jMenu3.setText(MessageManager.getString("action.show"));
showAllSeqs.setText(MessageManager.getString("label.all_sequences"));
- showAllSeqs.setToolTipText(MessageManager.getString("label.toggle_sequence_visibility"));
+ showAllSeqs.setToolTipText(MessageManager
+ .getString("label.toggle_sequence_visibility"));
showAllSeqs.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
showAllColumns.setText(MessageManager.getString("label.all_columns"));
- showAllColumns.setToolTipText(MessageManager.getString("label.toggle_columns_visibility"));
+ showAllColumns.setToolTipText(MessageManager
+ .getString("label.toggle_columns_visibility"));
showAllColumns.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
hideMenu.setText(MessageManager.getString("action.hide"));
- hideSelSequences.setText(MessageManager.getString("label.selected_sequences"));
- hideSelSequences.setToolTipText(MessageManager.getString("label.toggle_sequence_visibility"));
+ hideSelSequences.setText(MessageManager
+ .getString("label.selected_sequences"));
+ hideSelSequences.setToolTipText(MessageManager
+ .getString("label.toggle_sequence_visibility"));
hideSelSequences.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
hideSelSequences_actionPerformed(e);
}
});
- hideSelColumns.setText(MessageManager.getString("label.selected_columns"));
- hideSelColumns.setToolTipText(MessageManager.getString("label.toggle_columns_visibility"));
+ hideSelColumns.setText(MessageManager
+ .getString("label.selected_columns"));
+ hideSelColumns.setToolTipText(MessageManager
+ .getString("label.toggle_columns_visibility"));
hideSelColumns.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
hideSelColumns_actionPerformed(e);
}
});
- hideAllSelection.setText(MessageManager.getString("label.selected_region"));
+ hideAllSelection.setText(MessageManager
+ .getString("label.selected_region"));
hideAllSelection.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
// TODO: should be hidden if no selection exists.
- hideAllButSelection.setText(MessageManager.getString("label.all_but_selected_region"));
+ hideAllButSelection.setText(MessageManager
+ .getString("label.all_but_selected_region"));
hideAllButSelection.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
hideAllButSelection_actionPerformed(e);
}
});
- showAllhidden.setText(MessageManager.getString("label.all_sequences_columns"));
- showAllhidden
- .setToolTipText(MessageManager.getString("label.toggles_visibility_hidden_selected_regions"));
+ showAllhidden.setText(MessageManager
+ .getString("label.all_sequences_columns"));
+ showAllhidden.setToolTipText(MessageManager
+ .getString("label.toggles_visibility_hidden_selected_regions"));
showAllhidden.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
- hiddenMarkers.setText(MessageManager.getString("action.show_hidden_markers"));
+ hiddenMarkers.setText(MessageManager
+ .getString("action.show_hidden_markers"));
hiddenMarkers.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
hiddenMarkers_actionPerformed(e);
}
});
- invertColSel.setText(MessageManager.getString("action.invert_column_selection"));
+ invertColSel.setText(MessageManager
+ .getString("action.invert_column_selection"));
invertColSel.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
java.awt.event.KeyEvent.VK_I, Toolkit.getDefaultToolkit()
.getMenuShortcutKeyMask()
newView_actionPerformed(e);
}
});
- tabbedPane.setToolTipText("<html><i>" + MessageManager.getString("label.rename_tab_eXpand_reGroup") + "</i></html>");
- textColour.setText(MessageManager.getString("label.colour_text") + "...");
+ tabbedPane.setToolTipText("<html><i>"
+ + MessageManager.getString("label.rename_tab_eXpand_reGroup")
+ + "</i></html>");
+ textColour.setText(MessageManager.getString("label.colour_text")
+ + "...");
textColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
formatMenu.setText(MessageManager.getString("action.format"));
selectMenu.setText(MessageManager.getString("action.select"));
- idRightAlign.setText(MessageManager.getString("label.right_align_sequence_id"));
+ idRightAlign.setText(MessageManager
+ .getString("label.right_align_sequence_id"));
idRightAlign.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
expandViews_actionPerformed(e);
}
});
- pageSetup.setText(MessageManager.getString("action.page_setup") + "...");
+ pageSetup
+ .setText(MessageManager.getString("action.page_setup") + "...");
pageSetup.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
pageSetup_actionPerformed(e);
}
});
- alignmentProperties.setText(MessageManager.getString("label.alignment_props") + "...");
+ alignmentProperties.setText(MessageManager
+ .getString("label.alignment_props") + "...");
alignmentProperties.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
alignmentProperties();
}
});
- tooltipSettingsMenu.setText(MessageManager.getString("label.sequence_id_tooltip"));
- autoAnnMenu.setText(MessageManager.getString("label.autocalculated_annotation"));
+ tooltipSettingsMenu.setText(MessageManager
+ .getString("label.sequence_id_tooltip"));
+ autoAnnMenu.setText(MessageManager
+ .getString("label.autocalculated_annotation"));
alignFrameMenuBar.add(fileMenu);
alignFrameMenuBar.add(editMenu);
alignFrameMenuBar.add(selectMenu);
colourMenu.add(abovePIDThreshold);
colourMenu.add(modifyPID);
colourMenu.add(annotationColour);
- colourMenu.add(rnahelicesColour);
+ colourMenu.add(rnahelicesColour);
calculateMenu.add(sort);
calculateMenu.add(calculateTree);
calculateMenu.addSeparator();
calculateMenu.add(sortByTree);
calculateMenu.addSeparator();
calculateMenu.add(extractScores);
- webServiceNoServices = new JMenuItem(MessageManager.getString("label.no_services"));
+ webServiceNoServices = new JMenuItem(
+ MessageManager.getString("label.no_services"));
webService.add(webServiceNoServices);
pasteMenu.add(pasteNew);
pasteMenu.add(pasteThis);
protected void purinePyrimidineColour_actionPerformed(ActionEvent e)
{
}
-
+
protected void RNAInteractionColour_actionPerformed(ActionEvent e)
{
}
-
/*
* protected void covariationColour_actionPerformed(ActionEvent e) { }
protected void deleteGroups_actionPerformed(ActionEvent e)
{
}
-
+
protected void createGroup_actionPerformed(ActionEvent e)
{
}
-
+
protected void unGroup_actionPerformed(ActionEvent e)
{
}
protected void expand_newalign(ActionEvent e)
{
// TODO Auto-generated method stub
-
+
}
}
copyItem_actionPerformed(e);
}
});
- displaySource.setText(MessageManager.getString("action.show_html_source"));
- displaySource
- .setToolTipText(MessageManager.getString("label.select_copy_raw_html"));
+ displaySource.setText(MessageManager
+ .getString("action.show_html_source"));
+ displaySource.setToolTipText(MessageManager
+ .getString("label.select_copy_raw_html"));
displaySource.addActionListener(new ActionListener()
{
private void jbInit() throws Exception
{
this.setLayout(gridBagLayout1);
- refresh.setText(MessageManager.getString("label.refresh_available_sources"));
+ refresh.setText(MessageManager
+ .getString("label.refresh_available_sources"));
refresh.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
protected JEditorPane fullDetails = new JEditorPane("text/html", "");
- TitledBorder titledBorder1 = new TitledBorder(MessageManager.getString("label.available_das_sources"));
+ TitledBorder titledBorder1 = new TitledBorder(
+ MessageManager.getString("label.available_das_sources"));
protected JButton refresh = new JButton();
protected JScrollPane scrollPane = new JScrollPane();
- TitledBorder titledBorder2 = new TitledBorder(MessageManager.getString("label.full_details"));
+ TitledBorder titledBorder2 = new TitledBorder(
+ MessageManager.getString("label.full_details"));
protected JScrollPane fullDetailsScrollpane = new JScrollPane();
GridBagLayout gridBagLayout1 = new GridBagLayout();
- TitledBorder titledBorder3 = new TitledBorder(MessageManager.getString("label.authority") + ":");
+ TitledBorder titledBorder3 = new TitledBorder(
+ MessageManager.getString("label.authority") + ":");
- TitledBorder titledBorder4 = new TitledBorder(MessageManager.getString("label.type") + ":");
+ TitledBorder titledBorder4 = new TitledBorder(
+ MessageManager.getString("label.type") + ":");
- TitledBorder titledBorder5 = new TitledBorder(MessageManager.getString("label.label") + ":");
+ TitledBorder titledBorder5 = new TitledBorder(
+ MessageManager.getString("label.label") + ":");
JButton reset = new JButton();
*/
private void jbInit() throws Exception
{
-
+
FileMenu.setText(MessageManager.getString("action.file"));
HelpMenu.setText(MessageManager.getString("action.help"));
VamsasMenu.setText("Vamsas");
- VamsasMenu.setToolTipText(MessageManager.getString("label.share_data_vamsas_applications"));
+ VamsasMenu.setToolTipText(MessageManager
+ .getString("label.share_data_vamsas_applications"));
VamsasStMenu.setText(MessageManager.getString("label.connect_to"));
- VamsasStMenu.setToolTipText(MessageManager.getString("label.join_existing_vamsas_session"));
- inputLocalFileMenuItem.setText(MessageManager.getString("label.load_tree_from_file"));
+ VamsasStMenu.setToolTipText(MessageManager
+ .getString("label.join_existing_vamsas_session"));
+ inputLocalFileMenuItem.setText(MessageManager
+ .getString("label.load_tree_from_file"));
inputLocalFileMenuItem.setAccelerator(javax.swing.KeyStroke
.getKeyStroke(java.awt.event.KeyEvent.VK_O, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask(), false));
inputURLMenuItem_actionPerformed(null);
}
});
- inputTextboxMenuItem.setText(MessageManager.getString("label.from_textbox"));
+ inputTextboxMenuItem.setText(MessageManager
+ .getString("label.from_textbox"));
inputTextboxMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
aboutMenuItem_actionPerformed(e);
}
});
- documentationMenuItem.setText(MessageManager.getString("label.documentation"));
+ documentationMenuItem.setText(MessageManager
+ .getString("label.documentation"));
documentationMenuItem.setAccelerator(javax.swing.KeyStroke
.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0, false));
documentationMenuItem
});
this.getContentPane().setLayout(flowLayout1);
windowMenu.setText(MessageManager.getString("label.window"));
- preferences.setText(MessageManager.getString("label.preferences") + "...");
+ preferences.setText(MessageManager.getString("label.preferences")
+ + "...");
preferences.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
inputMenu.setText(MessageManager.getString("label.input_alignment"));
- vamsasStart.setText(MessageManager.getString("label.new_vamsas_session") + "...");
+ vamsasStart.setText(MessageManager
+ .getString("label.new_vamsas_session") + "...");
vamsasStart.setVisible(false);
vamsasStart.addActionListener(new ActionListener()
{
vamsasStart_actionPerformed(e);
}
});
- vamsasImport.setText(MessageManager.getString("label.load_vamsas_session") + "...");
+ vamsasImport.setText(MessageManager
+ .getString("label.load_vamsas_session") + "...");
vamsasImport.setVisible(false);
vamsasImport.addActionListener(new ActionListener()
{
vamsasImport_actionPerformed(e);
}
});
- vamsasSave.setText(MessageManager.getString("label.save_vamsas_session") + "...");
+ vamsasSave.setText(MessageManager
+ .getString("label.save_vamsas_session") + "...");
vamsasSave.setVisible(false);
vamsasSave.addActionListener(new ActionListener()
{
vamsasSave_actionPerformed(e);
}
});
- inputSequence.setText(MessageManager.getString("label.fetch_sequences") + "...");
+ inputSequence.setText(MessageManager.getString("label.fetch_sequences")
+ + "...");
inputSequence.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
inputSequence_actionPerformed(e);
}
});
- vamsasStop.setText(MessageManager.getString("label.stop_vamsas_session"));
+ vamsasStop.setText(MessageManager
+ .getString("label.stop_vamsas_session"));
vamsasStop.setVisible(false);
vamsasStop.addActionListener(new ActionListener()
{
closeAll_actionPerformed(e);
}
});
- raiseRelated.setText(MessageManager.getString("action.raise_associated_windows"));
+ raiseRelated.setText(MessageManager
+ .getString("action.raise_associated_windows"));
raiseRelated.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
raiseRelated_actionPerformed(e);
}
});
- minimizeAssociated.setText(MessageManager.getString("action.minimize_associated_windows"));
+ minimizeAssociated.setText(MessageManager
+ .getString("action.minimize_associated_windows"));
minimizeAssociated.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
minimizeAssociated_actionPerformed(e);
}
});
- garbageCollect.setText(MessageManager.getString("label.collect_garbage"));
+ garbageCollect.setText(MessageManager
+ .getString("label.collect_garbage"));
garbageCollect.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
garbageCollect_actionPerformed(e);
}
});
- showMemusage.setText(MessageManager.getString("label.show_memory_usage"));
+ showMemusage.setText(MessageManager
+ .getString("label.show_memory_usage"));
showMemusage.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
showMemusage_actionPerformed(e);
}
});
- showConsole.setText(MessageManager.getString("label.show_java_console"));
+ showConsole
+ .setText(MessageManager.getString("label.show_java_console"));
showConsole.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
monospaced.setEnabled(false);
monospaced.setFont(JvSwingUtils.getLabelFont());
monospaced.setOpaque(false);
- monospaced.setToolTipText(MessageManager.getString("label.monospaced_fonts_faster_to_render"));
+ monospaced.setToolTipText(MessageManager
+ .getString("label.monospaced_fonts_faster_to_render"));
monospaced.setText(MessageManager.getString("label.monospaced_font"));
jPanel4.setOpaque(false);
jPanel4.setBounds(new Rectangle(24, 92, 259, 35));
JMenu fileMenu = new JMenu();
JMenu saveMenu = new JMenu();
-
+
protected JMenu scoreMatrixMenu = new JMenu();
JMenuItem eps = new JMenuItem();
outputPoints_actionPerformed(e);
}
});
- outputProjPoints.setText(MessageManager.getString("label.output_transformed_points") + "...");
+ outputProjPoints.setText(MessageManager
+ .getString("label.output_transformed_points") + "...");
outputProjPoints.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
}
});
- scoreMatrixMenu.setText(MessageManager.getString("label.select_score_model"));
+ scoreMatrixMenu.setText(MessageManager
+ .getString("label.select_score_model"));
scoreMatrixMenu.addMenuListener(new MenuListener()
{
public void menuSelected(MenuEvent e)
}
});
print.setText(MessageManager.getString("action.print"));
- bgcolour.setText(MessageManager.getString("label.background_colour") + "...");
+ bgcolour.setText(MessageManager.getString("label.background_colour")
+ + "...");
bgcolour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
originalSeqData_actionPerformed(e);
}
});
- associateViewsMenu.setText(MessageManager.getString("label.associate_nodes_with"));
+ associateViewsMenu.setText(MessageManager
+ .getString("label.associate_nodes_with"));
calcSettings.setText(MessageManager.getString("action.change_params"));
- nuclSetting.setText(MessageManager.getString("label.nucleotide_matrix"));
+ nuclSetting
+ .setText(MessageManager.getString("label.nucleotide_matrix"));
protSetting.setText(MessageManager.getString("label.protein_matrix"));
nuclSetting.addActionListener(new ActionListener()
{
protSetting_actionPerfomed(arg0);
}
});
- jvVersionSetting.setText(MessageManager.getString("label.jalview_pca_calculation"));
+ jvVersionSetting.setText(MessageManager
+ .getString("label.jalview_pca_calculation"));
jvVersionSetting.addActionListener(new ActionListener()
{
@Override
protected void scoreMatrix_menuSelected()
{
// TODO Auto-generated method stub
-
+
}
protected void resetButton_actionPerformed(ActionEvent e)
textarea.setText("");
textarea.setWrapStyleWord(false);
viewInEditorButton.setFont(new java.awt.Font("Verdana", 0, 12));
- viewInEditorButton.setText(MessageManager.getString("label.view_alignment_editor"));
+ viewInEditorButton.setText(MessageManager
+ .getString("label.view_alignment_editor"));
viewInEditorButton
.addActionListener(new java.awt.event.ActionListener()
{
JPanel jPanel1 = new JPanel();
- TitledBorder titledBorder1 = new TitledBorder(MessageManager.getString("label.proxy_server"));
+ TitledBorder titledBorder1 = new TitledBorder(
+ MessageManager.getString("label.proxy_server"));
- TitledBorder titledBorder2 = new TitledBorder(MessageManager.getString("label.file_output"));
+ TitledBorder titledBorder2 = new TitledBorder(
+ MessageManager.getString("label.file_output"));
GridBagLayout gridBagLayout2 = new GridBagLayout();
quality.setHorizontalTextPosition(SwingConstants.LEFT);
quality.setSelected(true);
quality.setText(MessageManager.getString("label.quality"));
- visualTab.setBorder(new TitledBorder(MessageManager.getString("action.open_new_aligmnent")));
+ visualTab.setBorder(new TitledBorder(MessageManager
+ .getString("action.open_new_aligmnent")));
visualTab.setLayout(null);
- visual2Tab.setBorder(new TitledBorder(MessageManager.getString("action.open_new_aligmnent")));
+ visual2Tab.setBorder(new TitledBorder(MessageManager
+ .getString("action.open_new_aligmnent")));
visual2Tab.setLayout(new FlowLayout());
fullScreen.setFont(verdana11);
fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
showGroupbits.setFont(verdana11);
showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
showGroupbits.setHorizontalTextPosition(SwingConstants.LEFT);
- showGroupbits.setText(MessageManager.getString("action.show_group") + ":");
+ showGroupbits.setText(MessageManager.getString("action.show_group")
+ + ":");
showConsensbits.setFont(verdana11);
showConsensbits.setHorizontalAlignment(SwingConstants.RIGHT);
showConsensbits.setHorizontalTextPosition(SwingConstants.LEFT);
- showConsensbits.setText(MessageManager.getString("label.consensus") + ":");
+ showConsensbits.setText(MessageManager.getString("label.consensus")
+ + ":");
showConsensHistogram.setEnabled(false);
showConsensHistogram.setFont(verdana11);
showConsensHistogram.setHorizontalAlignment(SwingConstants.RIGHT);
showConsensHistogram.setHorizontalTextPosition(SwingConstants.LEFT);
showConsensHistogram.setSelected(true);
- showConsensHistogram.setText(MessageManager.getString("label.histogram"));
+ showConsensHistogram.setText(MessageManager
+ .getString("label.histogram"));
showConsensLogo.setEnabled(false);
showConsensLogo.setFont(verdana11);
showConsensLogo.setHorizontalAlignment(SwingConstants.RIGHT);
showGroupConservation.setHorizontalAlignment(SwingConstants.RIGHT);
showGroupConservation.setHorizontalTextPosition(SwingConstants.LEFT);
showGroupConservation.setSelected(true);
- showGroupConservation.setText(MessageManager.getString("label.conservation"));
+ showGroupConservation.setText(MessageManager
+ .getString("label.conservation"));
showNpTooltip.setEnabled(true);
showNpTooltip.setFont(verdana11);
showNpTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
showNpTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
showNpTooltip.setSelected(true);
- showNpTooltip.setText(MessageManager.getString("label.non_positional_features"));
+ showNpTooltip.setText(MessageManager
+ .getString("label.non_positional_features"));
showDbRefTooltip.setEnabled(true);
showDbRefTooltip.setFont(verdana11);
showDbRefTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
showDbRefTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
showDbRefTooltip.setSelected(true);
- showDbRefTooltip.setText(MessageManager.getString("label.database_references"));
+ showDbRefTooltip.setText(MessageManager
+ .getString("label.database_references"));
annotations.setFont(verdana11);
annotations.setHorizontalAlignment(SwingConstants.RIGHT);
annotations.setHorizontalTextPosition(SwingConstants.LEADING);
showUnconserved.setHorizontalAlignment(SwingConstants.RIGHT);
showUnconserved.setHorizontalTextPosition(SwingConstants.LEFT);
showUnconserved.setSelected(true);
- showUnconserved.setText(MessageManager.getString("action.show_unconserved"));
+ showUnconserved.setText(MessageManager
+ .getString("action.show_unconserved"));
showUnconserved.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
shareSelections.setHorizontalAlignment(SwingConstants.RIGHT);
shareSelections.setHorizontalTextPosition(SwingConstants.LEFT);
shareSelections.setSelected(true);
- shareSelections.setText(MessageManager.getString("label.share_selection_across_views"));
+ shareSelections.setText(MessageManager
+ .getString("label.share_selection_across_views"));
followHighlight.setFont(verdana11);
followHighlight.setHorizontalAlignment(SwingConstants.RIGHT);
followHighlight.setHorizontalTextPosition(SwingConstants.LEFT);
// showUnconserved.setBounds(new Rectangle(169, 40, 200, 23));
followHighlight.setSelected(true);
- followHighlight.setText(MessageManager.getString("label.scroll_highlighted_regions"));
+ followHighlight.setText(MessageManager
+ .getString("label.scroll_highlighted_regions"));
gapLabel.setFont(verdana11);
gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);
colour.setBounds(new Rectangle(172, 225, 155, 21));
colourLabel.setFont(verdana11);
colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
- colourLabel.setText(MessageManager.getString("label.alignment_colour") + " ");
+ colourLabel.setText(MessageManager.getString("label.alignment_colour")
+ + " ");
fontLabel.setFont(verdana11);
fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);
fontLabel.setText(MessageManager.getString("label.font"));
portLabel.setText(MessageManager.getString("label.port"));
browserLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
browserLabel.setHorizontalAlignment(SwingConstants.TRAILING);
- browserLabel.setText(MessageManager.getString("label.default_browser_unix"));
+ browserLabel.setText(MessageManager
+ .getString("label.default_browser_unix"));
defaultBrowser.setFont(verdana11);
defaultBrowser.setText("");
- usagestats.setText(MessageManager.getString("label.send_usage_statistics"));
+ usagestats.setText(MessageManager
+ .getString("label.send_usage_statistics"));
usagestats.setFont(verdana11);
usagestats.setHorizontalAlignment(SwingConstants.RIGHT);
usagestats.setHorizontalTextPosition(SwingConstants.LEADING);
- questionnaire.setText(MessageManager.getString("label.check_for_questionnaires"));
+ questionnaire.setText(MessageManager
+ .getString("label.check_for_questionnaires"));
questionnaire.setFont(verdana11);
questionnaire.setHorizontalAlignment(SwingConstants.RIGHT);
questionnaire.setHorizontalTextPosition(SwingConstants.LEADING);
- versioncheck.setText(MessageManager.getString("label.check_for_latest_version"));
+ versioncheck.setText(MessageManager
+ .getString("label.check_for_latest_version"));
versioncheck.setFont(verdana11);
versioncheck.setHorizontalAlignment(SwingConstants.RIGHT);
versioncheck.setHorizontalTextPosition(SwingConstants.LEADING);
});
linkScrollPane.setBorder(null);
- linkPanel.setBorder(new TitledBorder(MessageManager.getString("label.url_linkfrom_sequence_id")));
+ linkPanel.setBorder(new TitledBorder(MessageManager
+ .getString("label.url_linkfrom_sequence_id")));
linkPanel.setLayout(borderLayout2);
editLinkButtons.setLayout(gridLayout1);
gridLayout1.setRows(3);
clustaljv.setText(MessageManager.getString("label.clustal") + " ");
blcjv.setText(MessageManager.getString("label.blc") + " ");
fastajv.setText(MessageManager.getString("label.fasta") + " ");
- msfjv.setText(MessageManager.getString("label.msf")+ " ");
+ msfjv.setText(MessageManager.getString("label.msf") + " ");
pfamjv.setText(MessageManager.getString("label.pfam") + " ");
pileupjv.setText(MessageManager.getString("label.pileup") + " ");
msfjv.setFont(verdana11);
smoothFont.setText(MessageManager.getString("label.smooth_font"));
calcTab.setLayout(null);
autoCalculateConsCheck.setFont(JvSwingUtils.getLabelFont());
- autoCalculateConsCheck.setText(MessageManager.getString("label.autocalculate_consensus"));
+ autoCalculateConsCheck.setText(MessageManager
+ .getString("label.autocalculate_consensus"));
autoCalculateConsCheck.setBounds(new Rectangle(21, 52, 209, 23));
padGaps.setFont(JvSwingUtils.getLabelFont());
padGaps.setText(MessageManager.getString("label.pad_gaps_when_editing"));
padGaps.setBounds(new Rectangle(22, 94, 168, 23));
sortByTree.setFont(JvSwingUtils.getLabelFont());
- sortByTree.setText(MessageManager.getString("label.sort_with_new_tree"));
sortByTree
- .setToolTipText(MessageManager.getString("label.any_trees_calculated_or_loaded_alignment_automatically_sort"));
+ .setText(MessageManager.getString("label.sort_with_new_tree"));
+ sortByTree
+ .setToolTipText(MessageManager
+ .getString("label.any_trees_calculated_or_loaded_alignment_automatically_sort"));
sortByTree.setBounds(new Rectangle(22, 136, 168, 23));
autoIdWidth.setFont(JvSwingUtils.getLabelFont());
- autoIdWidth.setText(MessageManager.getString("label.automatically_set_id_width"));
+ autoIdWidth.setText(MessageManager
+ .getString("label.automatically_set_id_width"));
autoIdWidth
.setToolTipText("<html>"
+ JvSwingUtils
}
});
userIdWidthlabel.setFont(JvSwingUtils.getLabelFont());
- userIdWidthlabel.setText(MessageManager.getString("label.figure_id_column_width"));
+ userIdWidthlabel.setText(MessageManager
+ .getString("label.figure_id_column_width"));
userIdWidth
.setToolTipText("<html>"
+ JvSwingUtils
}
});
modellerOutput.setFont(JvSwingUtils.getLabelFont());
- modellerOutput.setText(MessageManager.getString("label.use_modeller_output"));
+ modellerOutput.setText(MessageManager
+ .getString("label.use_modeller_output"));
modellerOutput.setBounds(new Rectangle(228, 226, 168, 23));
dasPanel.setLayout(borderLayout4);
idItalics.setFont(JvSwingUtils.getLabelFont());
idItalics.setHorizontalAlignment(SwingConstants.RIGHT);
idItalics.setHorizontalTextPosition(SwingConstants.LEADING);
- idItalics.setText(MessageManager.getString("label.sequence_name_italics"));
+ idItalics.setText(MessageManager
+ .getString("label.sequence_name_italics"));
openoverv.setFont(JvSwingUtils.getLabelFont());
- openoverv.setActionCommand(MessageManager.getString("label.open_overview"));
+ openoverv.setActionCommand(MessageManager
+ .getString("label.open_overview"));
openoverv.setHorizontalAlignment(SwingConstants.RIGHT);
openoverv.setHorizontalTextPosition(SwingConstants.LEFT);
openoverv.setText(MessageManager.getString(("label.open_overview")));
autoAnnotSettings3.add(showConsensLogo);
JPanel tooltipSettings = new JPanel();
- tooltipSettings.setBorder(new TitledBorder(MessageManager.getString("label.sequence_id_tooltip")));
+ tooltipSettings.setBorder(new TitledBorder(MessageManager
+ .getString("label.sequence_id_tooltip")));
tooltipSettings.setBounds(173, 130, 200, 62);
tooltipSettings.setLayout(new GridLayout(2, 1));
tooltipSettings.add(showDbRefTooltip);
tooltipSettings.add(showNpTooltip);
visualTab.add(tooltipSettings);
visualTab.add(jPanel2);
- JvSwingUtils.addtoLayout(visual2Tab,
- MessageManager.getString("label.default_colour_scheme_for_alignment"), colourLabel, colour);
+ JvSwingUtils.addtoLayout(visual2Tab, MessageManager
+ .getString("label.default_colour_scheme_for_alignment"),
+ colourLabel, colour);
JPanel annotationShding = new JPanel();
- annotationShding.setBorder(new TitledBorder(
- MessageManager.getString("label.annotation_shading_default")));
+ annotationShding.setBorder(new TitledBorder(MessageManager
+ .getString("label.annotation_shading_default")));
annotationShding.setLayout(new GridLayout(1, 2));
- JvSwingUtils.addtoLayout(annotationShding,
- MessageManager.getString("label.default_minimum_colour_annotation_shading"),
+ JvSwingUtils.addtoLayout(annotationShding, MessageManager
+ .getString("label.default_minimum_colour_annotation_shading"),
mincolourLabel, minColour);
- JvSwingUtils.addtoLayout(annotationShding,
- MessageManager.getString("label.default_maximum_colour_annotation_shading"),
+ JvSwingUtils.addtoLayout(annotationShding, MessageManager
+ .getString("label.default_maximum_colour_annotation_shading"),
maxcolourLabel, maxColour);
visual2Tab.add(annotationShding); // , FlowLayout.LEFT);
tabbedPane.add(visualTab, MessageManager.getString("label.visual"));
tabbedPane.add(visual2Tab, MessageManager.getString("label.colours"));
- tabbedPane.add(connectTab, MessageManager.getString("label.connections"));
+ tabbedPane.add(connectTab,
+ MessageManager.getString("label.connections"));
tabbedPane.add(exportTab, MessageManager.getString("label.output"));
jPanel11.add(jLabel1);
jPanel11.add(blcjv);
calcTab.add(padGaps);
calcTab.add(sortByTree);
- tabbedPane.add(dasPanel, MessageManager.getString("label.das_settings"));
+ tabbedPane
+ .add(dasPanel, MessageManager.getString("label.das_settings"));
tabbedPane.add(wsPanel, MessageManager.getString("label.web_services"));
exportTab.add(epsLabel);
optionsPanel = new JPanel(new MigLayout("", "[fill]", "[fill]"));
JScrollPane optionView = new JScrollPane();
optionView.setViewportView(options);
- JvSwingUtils.mgAddtoLayout(dpane, MessageManager.getString("label.input_parameter_name"), new JLabel(
- MessageManager.getString("label.name")), tok, "grow,spanx 3,wrap");
+ JvSwingUtils.mgAddtoLayout(dpane,
+ MessageManager.getString("label.input_parameter_name"),
+ new JLabel(MessageManager.getString("label.name")), tok,
+ "grow,spanx 3,wrap");
JPanel paramsType = new JPanel(new MigLayout("", "[grow 100,fill]",
"[grow 100,fill]"));
- paramsType.setBorder(new TitledBorder(MessageManager.getString("label.select_input_type")));
+ paramsType.setBorder(new TitledBorder(MessageManager
+ .getString("label.select_input_type")));
JScrollPane jlistScroller = new JScrollPane();
jlistScroller.setViewportView(typeList);
paramsType.add(jlistScroller, "spanx 2,spany 2");
dpane.add(paramsType);
- optionsPanel.setBorder(new TitledBorder(MessageManager.getString("label.set_options_for_type")));
+ optionsPanel.setBorder(new TitledBorder(MessageManager
+ .getString("label.set_options_for_type")));
optionsPanel.add(optionView);
dpane.add(optionsPanel, "wrap");
okcancel = new JPanel(new MigLayout("", "[center][center]", "[]"));
cpanel = details;
name = new JTextArea(1, 12);
- JvSwingUtils.mgAddtoLayout(cpanel,
- MessageManager.getString("label.short_descriptive_name_for_service"), new JLabel(MessageManager.getString("label.name")),
- name, "wrap");
+ JvSwingUtils.mgAddtoLayout(cpanel, MessageManager
+ .getString("label.short_descriptive_name_for_service"),
+ new JLabel(MessageManager.getString("label.name")), name,
+ "wrap");
action = new JComboBox();
- JvSwingUtils
- .mgAddtoLayout(
- cpanel,
- MessageManager.getString("label.function_service_performs"),
- new JLabel(MessageManager.getString("label.service_action")), action, "wrap");
+ JvSwingUtils.mgAddtoLayout(cpanel,
+ MessageManager.getString("label.function_service_performs"),
+ new JLabel(MessageManager.getString("label.service_action")),
+ action, "wrap");
descr = new JTextArea(4, 60);
descrVp = new JScrollPane();
descrVp.setViewportView(descr);
- JvSwingUtils.mgAddtoLayout(cpanel, MessageManager.getString("label.brief_description_service"),
- new JLabel(MessageManager.getString("label.description")), descrVp, "wrap");
+ JvSwingUtils.mgAddtoLayout(cpanel,
+ MessageManager.getString("label.brief_description_service"),
+ new JLabel(MessageManager.getString("label.description")),
+ descrVp, "wrap");
url = new JTextArea(2, 60);
urlVp = new JScrollPane();
urlVp.setViewportView(url);
- JvSwingUtils
- .mgAddtoLayout(
- cpanel,
- MessageManager.getString("label.url_post_data_service"),
- new JLabel(MessageManager.getString("label.post_url")), urlVp, "wrap");
+ JvSwingUtils.mgAddtoLayout(cpanel,
+ MessageManager.getString("label.url_post_data_service"),
+ new JLabel(MessageManager.getString("label.post_url")), urlVp,
+ "wrap");
urlsuff = new JTextArea();
urlsuff.setColumns(60);
- JvSwingUtils
- .mgAddtoLayout(
- cpanel,
- MessageManager.getString("label.optional_suffix"),
- new JLabel(MessageManager.getString("label.url_suffix")), urlsuff, "wrap");
+ JvSwingUtils.mgAddtoLayout(cpanel, MessageManager
+ .getString("label.optional_suffix"),
+ new JLabel(MessageManager.getString("label.url_suffix")),
+ urlsuff, "wrap");
// input options
// details.add(cpanel = new JPanel(), BorderLayout.CENTER);
}
});
- vSeparable = new JCheckBox(MessageManager.getString("label.result_vertically_separable"));
+ vSeparable = new JCheckBox(
+ MessageManager.getString("label.result_vertically_separable"));
vSeparable
.setToolTipText("<html>"
+ JvSwingUtils
});
gapChar = new JComboBox();
JvSwingUtils.mgAddtoLayout(cpanel,
- MessageManager.getString("label.preferred_gap_character"), new JLabel(
- MessageManager.getString("label.gap_character") + ":"), gapChar, "wrap");
+ MessageManager.getString("label.preferred_gap_character"),
+ new JLabel(MessageManager.getString("label.gap_character")
+ + ":"), gapChar, "wrap");
cpanel.add(hSeparable);
cpanel.add(vSeparable);
// Input and Output lists
// Inputparams
JPanel iprmsList = new JPanel();
- iprmsList.setBorder(new TitledBorder(MessageManager.getString("label.data_input_parameters")));
+ iprmsList.setBorder(new TitledBorder(MessageManager
+ .getString("label.data_input_parameters")));
iprmsList.setLayout(new MigLayout("", "[grow 90, fill][]"));
iprmVp = new JScrollPane();
iprmVp.getViewport().setView(iprms = new JList());
JPanel iprmButs = new JPanel();
iprmButs.setLayout(new MigLayout());
- iprmsAdd = JvSwingUtils.makeButton("+", MessageManager.getString("action.add_input_parameter"),
+ iprmsAdd = JvSwingUtils.makeButton("+",
+ MessageManager.getString("action.add_input_parameter"),
new ActionListener()
{
}
});
iprmsRem = JvSwingUtils.makeButton("-",
- MessageManager.getString("action.remove_input_parameter"), new ActionListener()
+ MessageManager.getString("action.remove_input_parameter"),
+ new ActionListener()
{
@Override
// Return Parameters
- rdataAdd = JvSwingUtils.makeButton("+", MessageManager.getString("action.add_return_datatype"),
+ rdataAdd = JvSwingUtils.makeButton("+",
+ MessageManager.getString("action.add_return_datatype"),
new ActionListener()
{
}
});
- rdataRem = JvSwingUtils.makeButton("-", MessageManager.getString("action.remove_return_datatype"),
+ rdataRem = JvSwingUtils.makeButton("-",
+ MessageManager.getString("action.remove_return_datatype"),
new ActionListener()
{
}
});
- rdataNup = JvSwingUtils.makeButton(MessageManager.getString("action.move_up"),
- MessageManager.getString("label.move_return_type_up_order"), new ActionListener()
+ rdataNup = JvSwingUtils.makeButton(
+ MessageManager.getString("action.move_up"),
+ MessageManager.getString("label.move_return_type_up_order"),
+ new ActionListener()
{
@Override
}
});
- rdataNdown = JvSwingUtils.makeButton(MessageManager.getString("action.move_down"),
- MessageManager.getString("label.move_return_type_down_order"), new ActionListener()
+ rdataNdown = JvSwingUtils.makeButton(
+ MessageManager.getString("action.move_down"),
+ MessageManager.getString("label.move_return_type_down_order"),
+ new ActionListener()
{
@Override
});
JPanel rparamList = new JPanel();
- rparamList.setBorder(new TitledBorder(MessageManager.getString("label.data_returned_by_service")));
+ rparamList.setBorder(new TitledBorder(MessageManager
+ .getString("label.data_returned_by_service")));
rparamList.setLayout(new MigLayout("", "[grow 90, fill][]"));
rdata = new JList();
- rdata.setToolTipText(MessageManager.getString("label.right_click_to_edit_currently_selected_parameter"));
+ rdata.setToolTipText(MessageManager
+ .getString("label.right_click_to_edit_currently_selected_parameter"));
rdata.addMouseListener(new MouseListener()
{
JPanel urldescPane = new JPanel();
urldescPane.setLayout(new MigLayout("", "[grow 100, fill]",
"[grow 100, fill]"));
- urldescPane.setBorder(new TitledBorder(MessageManager.getString("label.rsbs_encoded_service")));
+ urldescPane.setBorder(new TitledBorder(MessageManager
+ .getString("label.rsbs_encoded_service")));
urldescPane.add(urldescVp, "span");
paste.add(urldescPane, "span");
urldescPane
parseRes.setColumns(60);
parseWarnings = new JPanel(new MigLayout("", "[grow 100, fill]",
"[grow 100, fill]"));
- parseWarnings.setBorder(new TitledBorder(MessageManager.getString("label.parsing_errors")));
+ parseWarnings.setBorder(new TitledBorder(MessageManager
+ .getString("label.parsing_errors")));
parseWarnings
.setToolTipText("<html>"
+ JvSwingUtils
paste.add(parseWarnings, "span");
setLayout(new BorderLayout());
add(panels, BorderLayout.CENTER);
- okButton = JvSwingUtils.makeButton(MessageManager.getString("action.ok"), "", new ActionListener()
- {
+ okButton = JvSwingUtils.makeButton(
+ MessageManager.getString("action.ok"), "", new ActionListener()
+ {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- ok_actionPerformed();
- }
- });
- cancelButton = JvSwingUtils.makeButton(MessageManager.getString("action.cancel"), "",
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ ok_actionPerformed();
+ }
+ });
+ cancelButton = JvSwingUtils.makeButton(
+ MessageManager.getString("action.cancel"), "",
new ActionListener()
{
allGroupsCheck.setEnabled(false);
allGroupsCheck.setFont(new java.awt.Font("Verdana", 0, 11));
allGroupsCheck.setOpaque(false);
- allGroupsCheck.setText(MessageManager.getString("action.apply_all_groups"));
+ allGroupsCheck.setText(MessageManager
+ .getString("action.apply_all_groups"));
allGroupsCheck.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
viewMenu.setText(MessageManager.getString("action.view"));
chainMenu.setText(MessageManager.getString("action.show_chain"));
colourMenu.setText(MessageManager.getString("label.colours"));
- backGround.setText(MessageManager.getString("label.background_colour") + "...");
+ backGround.setText(MessageManager.getString("label.background_colour")
+ + "...");
backGround.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
hydroColour_actionPerformed(actionEvent);
}
});
- strandColour.setText(MessageManager.getString("label.strand_propensity"));
+ strandColour.setText(MessageManager
+ .getString("label.strand_propensity"));
strandColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
buriedColour_actionPerformed(actionEvent);
}
});
- purinePyrimidineColour.setText(MessageManager.getString("label.purine_pyrimidine"));
+ purinePyrimidineColour.setText(MessageManager
+ .getString("label.purine_pyrimidine"));
purinePyrimidineColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
});
jmolColour.setSelected(false);
jmolColour.setText(MessageManager.getString("label.colour_with_jmol"));
- jmolColour.setToolTipText(MessageManager.getString("label.let_jmol_manage_structure_colours"));
+ jmolColour.setToolTipText(MessageManager
+ .getString("label.let_jmol_manage_structure_colours"));
jmolColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
jmolHelp_actionPerformed(actionEvent);
}
});
- alignStructs.setText(MessageManager.getString("label.align_structures"));
+ alignStructs
+ .setText(MessageManager.getString("label.align_structures"));
alignStructs.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent actionEvent)
{
}
});
- sortAssocViews.setText(MessageManager.getString("label.sort_alignment_by_tree"));
+ sortAssocViews.setText(MessageManager
+ .getString("label.sort_alignment_by_tree"));
sortAssocViews.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
font_actionPerformed(e);
}
});
- bootstrapMenu.setText(MessageManager.getString("label.show_bootstrap_values"));
+ bootstrapMenu.setText(MessageManager
+ .getString("label.show_bootstrap_values"));
bootstrapMenu.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
});
saveAsMenu.setText(MessageManager.getString("action.save_as"));
placeholdersMenu
- .setToolTipText(MessageManager.getString("label.marks_leaves_tree_not_associated_with_sequence"));
- placeholdersMenu.setText(MessageManager.getString("label.mark_unlinked_leaves"));
+ .setToolTipText(MessageManager
+ .getString("label.marks_leaves_tree_not_associated_with_sequence"));
+ placeholdersMenu.setText(MessageManager
+ .getString("label.mark_unlinked_leaves"));
placeholdersMenu.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
placeholdersMenu_actionPerformed(e);
}
});
- textbox.setText(MessageManager.getString("label.out_to_textbox") + "...");
+ textbox.setText(MessageManager.getString("label.out_to_textbox")
+ + "...");
textbox.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
originalSeqData_actionPerformed(e);
}
});
- associateLeavesMenu.setText(MessageManager.getString("label.associate_leaves_with"));
+ associateLeavesMenu.setText(MessageManager
+ .getString("label.associate_leaves_with"));
this.getContentPane().add(scrollPane, BorderLayout.CENTER);
jMenuBar1.add(fileMenu);
jMenuBar1.add(viewMenu);
label.setFont(new java.awt.Font("Verdana", Font.ITALIC, 10));
label.setOpaque(false);
label.setPreferredSize(new Dimension(260, 34));
- label.setText(MessageManager.formatMessage("label.html_content", new String[]{MessageManager.getString("label.save_colour_scheme_with_unique_name_added_to_colour_menu")}));
+ label.setText(MessageManager.formatMessage(
+ "label.html_content",
+ new String[]
+ { MessageManager
+ .getString("label.save_colour_scheme_with_unique_name_added_to_colour_menu") }));
caseSensitive.setText(MessageManager.getString("label.case_sensitive"));
caseSensitive.addActionListener(new ActionListener()
{
caseSensitive_actionPerformed(e);
}
});
- lcaseColour.setText(MessageManager.getString("label.lower_case_colour"));
+ lcaseColour
+ .setText(MessageManager.getString("label.lower_case_colour"));
lcaseColour.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
buttonPanel.setLayout(gridBagLayout1);
buttonPanel.setOpaque(false);
- showResultsNewFrame.setText(MessageManager.getString("label.new_window"));
+ showResultsNewFrame.setText(MessageManager
+ .getString("label.new_window"));
mergeResults.setText(MessageManager.getString("action.merge_results"));
this.setBackground(Color.white);
this.add(jPanel1, BorderLayout.NORTH);
protected JList sbrsList = new JList();
protected TitledBorder sbrsListTitleBorder = new TitledBorder(
- MessageManager.getString("label.simple_bioinformatics_rest_services"));
+ MessageManager
+ .getString("label.simple_bioinformatics_rest_services"));
protected JButton newSbrsUrl = new JButton();
});
indexByHost.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
indexByHost.setText(MessageManager.getString("label.index_by_host"));
- indexByHost
- .setToolTipText(MessageManager.getString("label.index_web_services_menu_by_host_site"));
+ indexByHost.setToolTipText(MessageManager
+ .getString("label.index_web_services_menu_by_host_site"));
indexByHost.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
enableJws2Services
.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- enableJws2Services.setText(MessageManager.getString("label.enable_jabaws_services"));
+ enableJws2Services.setText(MessageManager
+ .getString("label.enable_jabaws_services"));
enableJws2Services.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
displayWsWarning.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- displayWsWarning.setText(MessageManager.getString("label.display_warnings"));
+ displayWsWarning.setText(MessageManager
+ .getString("label.display_warnings"));
displayWsWarning
- .setToolTipText("<html>" + MessageManager.getString("label.option_want_informed_web_service_URL_cannot_be_accessed_jalview_when_starts_up"));
+ .setToolTipText("<html>"
+ + MessageManager
+ .getString("label.option_want_informed_web_service_URL_cannot_be_accessed_jalview_when_starts_up"));
displayWsWarning.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
deleteWsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- deleteWsUrl.setText(MessageManager.getString("label.delete_service_url"));
+ deleteWsUrl.setText(MessageManager
+ .getString("label.delete_service_url"));
deleteWsUrl.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
moveWsUrlUp.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
moveWsUrlUp.setText(MessageManager.getString("action.move_up"));
- moveWsUrlUp.setToolTipText(MessageManager.getString("label.move_url_up"));
+ moveWsUrlUp.setToolTipText(MessageManager
+ .getString("label.move_url_up"));
moveWsUrlUp.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
moveWsUrlDown.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
moveWsUrlDown.setText(MessageManager.getString("action.move_down"));
- moveWsUrlDown.setToolTipText(MessageManager.getString("label.move_url_down"));
+ moveWsUrlDown.setToolTipText(MessageManager
+ .getString("label.move_url_down"));
moveWsUrlDown.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
newSbrsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- newSbrsUrl.setText(MessageManager.getString("label.add_sbrs_definition"));
+ newSbrsUrl.setText(MessageManager
+ .getString("label.add_sbrs_definition"));
newSbrsUrl.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
editSbrsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- editSbrsUrl.setText(MessageManager.getString("label.edit_sbrs_definition"));
+ editSbrsUrl.setText(MessageManager
+ .getString("label.edit_sbrs_definition"));
editSbrsUrl.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
});
deleteSbrsUrl.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10));
- deleteSbrsUrl.setText(MessageManager.getString("label.delete_sbrs_definition"));
+ deleteSbrsUrl.setText(MessageManager
+ .getString("label.delete_sbrs_definition"));
deleteSbrsUrl.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
public double[] e; // off diagonal
/**
- * maximum number of iterations for tqli
+ * maximum number of iterations for tqli
*
*/
int maxIter = 45; // fudge - add 15 iterations, just in case
}
}
}
-
+
/**
* DOCUMENT ME!
*/
if (iter == maxIter)
{
- throw new Exception("Too many iterations in tqli ("+maxIter+")");
+ throw new Exception("Too many iterations in tqli (" + maxIter
+ + ")");
}
else
{
if (iter == maxIter)
{
- throw new Exception ("Too many iterations in tqli2 (max is "+maxIter+")");
+ throw new Exception("Too many iterations in tqli2 (max is "
+ + maxIter + ")");
}
else
{
{
this(false);
}
+
/**
* Create a new annotation Renderer
- * @param debugRedraw flag indicating if timing and redraw parameter info should be output
+ *
+ * @param debugRedraw
+ * flag indicating if timing and redraw parameter info should be
+ * output
*/
public AnnotationRenderer(boolean debugRedraw)
{
- this.debugRedraw=debugRedraw;
+ this.debugRedraw = debugRedraw;
}
public void drawStemAnnot(Graphics g, Annotation[] row_annotations,
// If a closing base pair half of the stem, display a backward arrow
if (column > 0 && closeparen.search(dc))
{
-
+
if (diffupstream)
// if (validRes && column>1 && row_annotations[column-2]!=null &&
// dc.equals(row_annotations[column-2].displayCharacter))
}
else
{
-
+
// display a forward arrow
if (diffdownstream)
{
* width of image to render in panel
*/
private int imgWidth;
+
/**
* offset to beginning of visible area
*/
private int sOffset;
+
/**
* offset to end of visible area
*/
private int visHeight;
+
/**
- * indicate if the renderer should only render the visible portion of the annotation given the current view settings
+ * indicate if the renderer should only render the visible portion of the
+ * annotation given the current view settings
*/
- private boolean useClip=true;
+ private boolean useClip = true;
+
/**
- * master flag indicating if renderer should ever try to clip. not enabled for jalview 2.8.1
+ * master flag indicating if renderer should ever try to clip. not enabled for
+ * jalview 2.8.1
*/
- private boolean canClip=false;
+ private boolean canClip = false;
-
- public void drawNotCanonicalAnnot(Graphics g, Color nonCanColor, Annotation[] row_annotations,
- int lastSSX, int x, int y, int iconOffset, int startRes,
- int column, boolean validRes, boolean validEnd)
+ public void drawNotCanonicalAnnot(Graphics g, Color nonCanColor,
+ Annotation[] row_annotations, int lastSSX, int x, int y,
+ int iconOffset, int startRes, int column, boolean validRes,
+ boolean validEnd)
{
- //System.out.println(nonCanColor);
-
+ // System.out.println(nonCanColor);
+
g.setColor(nonCanColor);
int sCol = (lastSSX / charWidth) + startRes;
int x1 = lastSSX;
int x2 = (x * charWidth);
Regex closeparen = new Regex("}|]|<|[a-z]");
-
+
String dc = (column == 0 || row_annotations[column - 1] == null) ? ""
: row_annotations[column - 1].displayCharacter;
|| !dc.equals(row_annotations[column].displayCharacter);
// System.out.println("Column "+column+" diff up: "+diffupstream+" down:"+diffdownstream);
// If a closing base pair half of the stem, display a backward arrow
- if (column > 0 && closeparen.search(dc))// closeletter_b.search(dc)||closeletter_c.search(dc)||closeletter_d.search(dc)||closecrochet.search(dc)) )
+ if (column > 0 && closeparen.search(dc))// closeletter_b.search(dc)||closeletter_c.search(dc)||closeletter_d.search(dc)||closecrochet.search(dc))
+ // )
{
-
+
if (diffupstream)
// if (validRes && column>1 && row_annotations[column-2]!=null &&
// dc.equals(row_annotations[column-2].displayCharacter))
}
else
{
-
+
// display a forward arrow
if (diffdownstream)
{
// draw arrow body
g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 7);
}
+
// public void updateFromAnnotationPanel(FontMetrics annotFM, AlignViewportI
// av)
public void updateFromAwtRenderPanel(AwtRenderPanelI annotPanel,
fadedImage = annotPanel.getFadedImage();
imgWidth = annotPanel.getFadedImageWidth();
// visible area for rendering
- int[] bounds=annotPanel.getVisibleVRange();
- if (bounds!=null)
+ int[] bounds = annotPanel.getVisibleVRange();
+ if (bounds != null)
{
sOffset = bounds[0];
visHeight = bounds[1];
- if (visHeight==0)
+ if (visHeight == 0)
+ {
+ useClip = false;
+ }
+ else
{
- useClip=false;
- } else {
- useClip=canClip;
+ useClip = canClip;
}
- } else {
- useClip=false;
+ }
+ else
+ {
+ useClip = false;
}
updateFromAlignViewport(av);
AlignViewportI av, Graphics g, int activeRow, int startRes,
int endRes)
{
- long stime=System.currentTimeMillis();
+ long stime = System.currentTimeMillis();
boolean usedFaded = false;
// NOTES:
// AnnotationPanel needs to implement: ImageObserver, access to
fm = g.getFontMetrics();
AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
int temp = 0;
- if (aa==null)
+ if (aa == null)
{
return false;
}
boolean centreColLabels, centreColLabelsDef = av
.getCentreColumnLabels();
boolean scaleColLabel = false;
- AlignmentAnnotation consensusAnnot=av.getAlignmentConsensusAnnotation(),structConsensusAnnot=av.getAlignmentStrucConsensusAnnotation();
+ AlignmentAnnotation consensusAnnot = av
+ .getAlignmentConsensusAnnotation(), structConsensusAnnot = av
+ .getAlignmentStrucConsensusAnnotation();
boolean renderHistogram = true, renderProfile = true, normaliseProfile = false;
BitSet graphGroupDrawn = new BitSet();
Font ofont = g.getFont();
// \u03B2 \u03B1
// debug ints
- int yfrom=0,f_i=0,yto=0,f_to=0;
- boolean clipst=false,clipend=false;
+ int yfrom = 0, f_i = 0, yto = 0, f_to = 0;
+ boolean clipst = false, clipend = false;
for (int i = 0; i < aa.length; i++)
{
AlignmentAnnotation row = aa[i];
{
- // check if this is a consensus annotation row and set the display settings appropriately
+ // check if this is a consensus annotation row and set the display
+ // settings appropriately
// TODO: generalise this to have render styles for consensus/profile
// data
if (row.groupRef != null && row == row.groupRef.getConsensus())
renderHistogram = av_renderHistogram;
renderProfile = av_renderProfile;
normaliseProfile = av_normaliseProfile;
- } else {
+ }
+ else
+ {
renderHistogram = true;
- // don't need to set render/normaliseProfile since they are not currently used in any other annotation track renderer
+ // don't need to set render/normaliseProfile since they are not
+ // currently used in any other annotation track renderer
}
}
Annotation[] row_annotations = row.annotations;
scaleColLabel = row.scaleColLabel;
lastSS = ' ';
lastSSX = 0;
-
- if (!useClip || ((y-charHeight)<visHeight && (y+row.height+charHeight*2)>=sOffset))
+
+ if (!useClip
+ || ((y - charHeight) < visHeight && (y + row.height + charHeight * 2) >= sOffset))
{// if_in_visible_region
if (!clipst)
{
- clipst=true;
- yfrom=y;
- f_i=i;
+ clipst = true;
+ yfrom = y;
+ f_i = i;
}
yto = y;
- f_to=i;
- if (row.graph > 0)
- {
- if (row.graphGroup > -1 && graphGroupDrawn.get(row.graphGroup)) {
- continue;
- }
-
- // this is so that we draw the characters below the graph
- y += row.height;
-
- if (row.hasText)
+ f_to = i;
+ if (row.graph > 0)
{
- iconOffset = charHeight - fm.getDescent();
- y -= charHeight;
- }
- }
- else if (row.hasText)
- {
- iconOffset = charHeight - fm.getDescent();
-
- }
- else
- {
- iconOffset = 0;
- }
-
- if (row.autoCalculated && av.isCalculationInProgress(row))
- {
- y += charHeight;
- usedFaded = true;
- g.drawImage(fadedImage, 0, y - row.height, imgWidth, y, 0, y
- - row.height, imgWidth, y, annotationPanel);
- g.setColor(Color.black);
- // g.drawString("Calculating "+aa[i].label+"....",20, y-row.height/2);
+ if (row.graphGroup > -1 && graphGroupDrawn.get(row.graphGroup))
+ {
+ continue;
+ }
- continue;
- }
+ // this is so that we draw the characters below the graph
+ y += row.height;
- /*
- * else if (annotationPanel.av.updatingConservation &&
- * aa[i].label.equals("Conservation")) {
- *
- * y += charHeight; g.drawImage(annotationPanel.fadedImage, 0, y -
- * row.height, annotationPanel.imgWidth, y, 0, y - row.height,
- * annotationPanel.imgWidth, y, annotationPanel);
- *
- * g.setColor(Color.black); //
- * g.drawString("Calculating Conservation.....",20, y-row.height/2);
- *
- * continue; } else if (annotationPanel.av.updatingConservation &&
- * aa[i].label.equals("Quality")) {
- *
- * y += charHeight; g.drawImage(annotationPanel.fadedImage, 0, y -
- * row.height, annotationPanel.imgWidth, y, 0, y - row.height,
- * annotationPanel.imgWidth, y, annotationPanel); g.setColor(Color.black);
- * // / g.drawString("Calculating Quality....",20, y-row.height/2);
- *
- * continue; }
- */
- // first pass sets up state for drawing continuation from left-hand column
- // of startRes
- x = (startRes == 0) ? 0 : -1;
- while (x < endRes - startRes)
- {
- if (hasHiddenColumns)
- {
- column = columnSelection.adjustForHiddenColumns(startRes + x);
- if (column > row_annotations.length - 1)
+ if (row.hasText)
{
- break;
+ iconOffset = charHeight - fm.getDescent();
+ y -= charHeight;
}
}
- else
+ else if (row.hasText)
{
- column = startRes + x;
- }
+ iconOffset = charHeight - fm.getDescent();
- if ((row_annotations == null) || (row_annotations.length <= column)
- || (row_annotations[column] == null))
- {
- validRes = false;
}
else
{
- validRes = true;
+ iconOffset = 0;
}
- if (x > -1)
+
+ if (row.autoCalculated && av.isCalculationInProgress(row))
{
- if (activeRow == i)
- {
- g.setColor(Color.red);
+ y += charHeight;
+ usedFaded = true;
+ g.drawImage(fadedImage, 0, y - row.height, imgWidth, y, 0, y
+ - row.height, imgWidth, y, annotationPanel);
+ g.setColor(Color.black);
+ // g.drawString("Calculating "+aa[i].label+"....",20, y-row.height/2);
- if (columnSelection != null)
- {
- for (int n = 0; n < columnSelection.size(); n++)
- {
- int v = columnSelection.columnAt(n);
+ continue;
+ }
- if (v == column)
- {
- g.fillRect(x * charWidth, y, charWidth, charHeight);
- }
- }
+ /*
+ * else if (annotationPanel.av.updatingConservation &&
+ * aa[i].label.equals("Conservation")) {
+ *
+ * y += charHeight; g.drawImage(annotationPanel.fadedImage, 0, y -
+ * row.height, annotationPanel.imgWidth, y, 0, y - row.height,
+ * annotationPanel.imgWidth, y, annotationPanel);
+ *
+ * g.setColor(Color.black); //
+ * g.drawString("Calculating Conservation.....",20, y-row.height/2);
+ *
+ * continue; } else if (annotationPanel.av.updatingConservation &&
+ * aa[i].label.equals("Quality")) {
+ *
+ * y += charHeight; g.drawImage(annotationPanel.fadedImage, 0, y -
+ * row.height, annotationPanel.imgWidth, y, 0, y - row.height,
+ * annotationPanel.imgWidth, y, annotationPanel);
+ * g.setColor(Color.black); // /
+ * g.drawString("Calculating Quality....",20, y-row.height/2);
+ *
+ * continue; }
+ */
+ // first pass sets up state for drawing continuation from left-hand
+ // column
+ // of startRes
+ x = (startRes == 0) ? 0 : -1;
+ while (x < endRes - startRes)
+ {
+ if (hasHiddenColumns)
+ {
+ column = columnSelection.adjustForHiddenColumns(startRes + x);
+ if (column > row_annotations.length - 1)
+ {
+ break;
}
}
- if (!row.isValidStruc())
+ else
{
- g.setColor(Color.orange);
- g.fillRect((int) row.getInvalidStrucPos() * charWidth, y,
- charWidth, charHeight);
+ column = startRes + x;
}
- if (validCharWidth
- && validRes
- && row_annotations[column].displayCharacter != null
- && (row_annotations[column].displayCharacter.length() > 0))
- {
- if (centreColLabels || scaleColLabel)
+ if ((row_annotations == null)
+ || (row_annotations.length <= column)
+ || (row_annotations[column] == null))
+ {
+ validRes = false;
+ }
+ else
+ {
+ validRes = true;
+ }
+ if (x > -1)
+ {
+ if (activeRow == i)
{
- fmWidth = fm.charsWidth(
- row_annotations[column].displayCharacter
- .toCharArray(), 0,
- row_annotations[column].displayCharacter.length());
+ g.setColor(Color.red);
- if (scaleColLabel)
+ if (columnSelection != null)
{
- // justify the label and scale to fit in column
- if (fmWidth > charWidth)
+ for (int n = 0; n < columnSelection.size(); n++)
{
- // scale only if the current font isn't already small enough
- fmScaling = charWidth;
- fmScaling /= fmWidth;
- g.setFont(ofont.deriveFont(AffineTransform
- .getScaleInstance(fmScaling, 1.0)));
- // and update the label's width to reflect the scaling.
- fmWidth = charWidth;
+ int v = columnSelection.columnAt(n);
+
+ if (v == column)
+ {
+ g.fillRect(x * charWidth, y, charWidth, charHeight);
+ }
}
}
}
- else
+ if (!row.isValidStruc())
{
- fmWidth = fm
- .charWidth(row_annotations[column].displayCharacter
- .charAt(0));
+ g.setColor(Color.orange);
+ g.fillRect((int) row.getInvalidStrucPos() * charWidth, y,
+ charWidth, charHeight);
}
- charOffset = (int) ((charWidth - fmWidth) / 2f);
+ if (validCharWidth
+ && validRes
+ && row_annotations[column].displayCharacter != null
+ && (row_annotations[column].displayCharacter.length() > 0))
+ {
- if (row_annotations[column].colour == null)
- g.setColor(Color.black);
- else
- g.setColor(row_annotations[column].colour);
+ if (centreColLabels || scaleColLabel)
+ {
+ fmWidth = fm.charsWidth(
+ row_annotations[column].displayCharacter
+ .toCharArray(), 0,
+ row_annotations[column].displayCharacter.length());
- if (column == 0 || row.graph > 0)
- {
- g.drawString(row_annotations[column].displayCharacter,
- (x * charWidth) + charOffset, y + iconOffset);
- }
- else if (row_annotations[column - 1] == null
- || (labelAllCols
- || !row_annotations[column].displayCharacter
- .equals(row_annotations[column - 1].displayCharacter) || (row_annotations[column].displayCharacter
- .length() < 2 && row_annotations[column].secondaryStructure == ' ')))
- {
- g.drawString(row_annotations[column].displayCharacter
- , x
- * charWidth + charOffset, y + iconOffset);
+ if (scaleColLabel)
+ {
+ // justify the label and scale to fit in column
+ if (fmWidth > charWidth)
+ {
+ // scale only if the current font isn't already small enough
+ fmScaling = charWidth;
+ fmScaling /= fmWidth;
+ g.setFont(ofont.deriveFont(AffineTransform
+ .getScaleInstance(fmScaling, 1.0)));
+ // and update the label's width to reflect the scaling.
+ fmWidth = charWidth;
+ }
+ }
+ }
+ else
+ {
+ fmWidth = fm
+ .charWidth(row_annotations[column].displayCharacter
+ .charAt(0));
+ }
+ charOffset = (int) ((charWidth - fmWidth) / 2f);
+
+ if (row_annotations[column].colour == null)
+ g.setColor(Color.black);
+ else
+ g.setColor(row_annotations[column].colour);
+
+ if (column == 0 || row.graph > 0)
+ {
+ g.drawString(row_annotations[column].displayCharacter,
+ (x * charWidth) + charOffset, y + iconOffset);
+ }
+ else if (row_annotations[column - 1] == null
+ || (labelAllCols
+ || !row_annotations[column].displayCharacter
+ .equals(row_annotations[column - 1].displayCharacter) || (row_annotations[column].displayCharacter
+ .length() < 2 && row_annotations[column].secondaryStructure == ' ')))
+ {
+ g.drawString(row_annotations[column].displayCharacter, x
+ * charWidth + charOffset, y + iconOffset);
+ }
+ g.setFont(ofont);
}
- g.setFont(ofont);
}
- }
- if (row.hasIcons)
- {
- char ss = validRes ? row_annotations[column].secondaryStructure
- : '-';
-
- if (ss == '(')
+ if (row.hasIcons)
{
- // distinguish between forward/backward base-pairing
- if (row_annotations[column].displayCharacter.indexOf(')') > -1)
+ char ss = validRes ? row_annotations[column].secondaryStructure
+ : '-';
+
+ if (ss == '(')
{
-
- ss = ')';
-
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf(')') > -1)
+ {
+
+ ss = ')';
+
+ }
}
- }
- if (ss == '[')
- {
- if ((row_annotations[column].displayCharacter.indexOf(']') > -1))
+ if (ss == '[')
{
+ if ((row_annotations[column].displayCharacter.indexOf(']') > -1))
+ {
ss = ']';
-
-
+
+ }
}
- }
- if (ss == '{')
- {
- // distinguish between forward/backward base-pairing
- if (row_annotations[column].displayCharacter.indexOf('}') > -1)
- {
- ss = '}';
-
-
- }
- }
- if (ss == '<')
- {
- // distinguish between forward/backward base-pairing
- if (row_annotations[column].displayCharacter.indexOf('<') > -1)
- {
- ss = '>';
-
-
- }
- }
- if (ss >=65)
- {
- // distinguish between forward/backward base-pairing
- if (row_annotations[column].displayCharacter.indexOf(ss+32) > -1)
- {
-
- ss = (char) (ss+32);
-
-
- }
- }
-
-
- if (!validRes || (ss != lastSS))
- {
-
-
- if (x > -1)
- {
-
-
- int nb_annot=x-temp;
- //System.out.println("\t type :"+lastSS+"\t x :"+x+"\t nbre annot :"+nb_annot);
- switch (lastSS)
- {
-
- case '$':
- drawHelixAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
- column, validRes, validEnd);
- break;
-
- case '�':
- drawSheetAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
- column, validRes, validEnd);
- break;
-
- case '(': // Stem case for RNA secondary structure
- case ')': // and opposite direction
- drawStemAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
- column, validRes, validEnd);
- temp=x;
- break;
- case '{':
- case '}':
- case '[':
- case ']':
- case '>':
- case '<':
- case 'A':
- case 'a':
- case 'B':
- case 'b':
- case 'C':
- case 'c':
- case 'D':
- case 'd':
- case 'E':
- case 'e':
- case 'F':
- case 'f':
- case 'G':
- case 'g':
- case 'H':
- case 'h':
- case 'I':
- case 'i':
- case 'J':
- case 'j':
- case 'K':
- case 'k':
- case 'L':
- case 'l':
- case 'M':
- case 'm':
- case 'N':
- case 'n':
- case 'O':
- case 'o':
- case 'P':
- case 'p':
- case 'Q':
- case 'q':
- case 'R':
- case 'r':
- case 'S':
- case 's':
- case 'T':
- case 't':
- case 'U':
- case 'u':
- case 'V':
- case 'v':
- case 'W':
- case 'w':
- case 'X':
- case 'x':
- case 'Y':
- case 'y':
- case 'Z':
- case 'z':
-
- Color nonCanColor= getNotCanonicalColor(lastSS);
- drawNotCanonicalAnnot(g, nonCanColor, row_annotations, lastSSX, x, y, iconOffset, startRes,
- column, validRes, validEnd);
- temp=x;
- break;
- default:
- g.setColor(Color.gray);
- g.fillRect(lastSSX, y + 6 + iconOffset, (x * charWidth)
- - lastSSX, 2);
- temp=x;
- break;
+ if (ss == '{')
+ {
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('}') > -1)
+ {
+ ss = '}';
+
}
}
- if (validRes)
+ if (ss == '<')
{
- lastSS = ss;
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf('<') > -1)
+ {
+ ss = '>';
+
+ }
}
- else
+ if (ss >= 65)
{
- lastSS = ' ';
+ // distinguish between forward/backward base-pairing
+ if (row_annotations[column].displayCharacter.indexOf(ss + 32) > -1)
+ {
+
+ ss = (char) (ss + 32);
+
+ }
}
- if (x > -1)
+
+ if (!validRes || (ss != lastSS))
{
- lastSSX = (x * charWidth);
+
+ if (x > -1)
+ {
+
+ int nb_annot = x - temp;
+ // System.out.println("\t type :"+lastSS+"\t x :"+x+"\t nbre annot :"+nb_annot);
+ switch (lastSS)
+ {
+
+ case '$':
+ drawHelixAnnot(g, row_annotations, lastSSX, x, y,
+ iconOffset, startRes, column, validRes, validEnd);
+ break;
+
+ case '�':
+ drawSheetAnnot(g, row_annotations, lastSSX, x, y,
+ iconOffset, startRes, column, validRes, validEnd);
+ break;
+
+ case '(': // Stem case for RNA secondary structure
+ case ')': // and opposite direction
+ drawStemAnnot(g, row_annotations, lastSSX, x, y,
+ iconOffset, startRes, column, validRes, validEnd);
+ temp = x;
+ break;
+ case '{':
+ case '}':
+ case '[':
+ case ']':
+ case '>':
+ case '<':
+ case 'A':
+ case 'a':
+ case 'B':
+ case 'b':
+ case 'C':
+ case 'c':
+ case 'D':
+ case 'd':
+ case 'E':
+ case 'e':
+ case 'F':
+ case 'f':
+ case 'G':
+ case 'g':
+ case 'H':
+ case 'h':
+ case 'I':
+ case 'i':
+ case 'J':
+ case 'j':
+ case 'K':
+ case 'k':
+ case 'L':
+ case 'l':
+ case 'M':
+ case 'm':
+ case 'N':
+ case 'n':
+ case 'O':
+ case 'o':
+ case 'P':
+ case 'p':
+ case 'Q':
+ case 'q':
+ case 'R':
+ case 'r':
+ case 'S':
+ case 's':
+ case 'T':
+ case 't':
+ case 'U':
+ case 'u':
+ case 'V':
+ case 'v':
+ case 'W':
+ case 'w':
+ case 'X':
+ case 'x':
+ case 'Y':
+ case 'y':
+ case 'Z':
+ case 'z':
+
+ Color nonCanColor = getNotCanonicalColor(lastSS);
+ drawNotCanonicalAnnot(g, nonCanColor, row_annotations,
+ lastSSX, x, y, iconOffset, startRes, column,
+ validRes, validEnd);
+ temp = x;
+ break;
+ default:
+ g.setColor(Color.gray);
+ g.fillRect(lastSSX, y + 6 + iconOffset, (x * charWidth)
+ - lastSSX, 2);
+ temp = x;
+ break;
+ }
+ }
+ if (validRes)
+ {
+ lastSS = ss;
+ }
+ else
+ {
+ lastSS = ' ';
+ }
+ if (x > -1)
+ {
+ lastSSX = (x * charWidth);
+ }
}
}
+ column++;
+ x++;
+ }
+ if (column >= row_annotations.length)
+ {
+ column = row_annotations.length - 1;
+ validEnd = false;
+ }
+ else
+ {
+ validEnd = true;
+ }
+ if ((row_annotations == null) || (row_annotations.length <= column)
+ || (row_annotations[column] == null))
+ {
+ validRes = false;
+ }
+ else
+ {
+ validRes = true;
}
- column++;
- x++;
- }
- if (column >= row_annotations.length)
- {
- column = row_annotations.length - 1;
- validEnd = false;
- }
- else
- {
- validEnd = true;
- }
- if ((row_annotations == null) || (row_annotations.length <= column)
- || (row_annotations[column] == null))
- {
- validRes = false;
- }
- else
- {
- validRes = true;
- }
- // x ++;
+ // x ++;
- if (row.hasIcons)
- {
- switch (lastSS)
+ if (row.hasIcons)
{
- case '$':
- drawHelixAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
- column, validRes, validEnd);
- break;
-
- case '�':
- drawSheetAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
- column, validRes, validEnd);
- break;
- case 's':
- case 'S': // Stem case for RNA secondary structure
-
- drawStemAnnot(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
- column, validRes, validEnd);
-
- break;
- case '{':
- case '}':
- case '[':
- case ']':
- case '>':
- case '<':
- case 'A':
- case 'a':
- case 'B':
- case 'b':
- case 'C':
- case 'c':
- case 'D':
- case 'd':
- case 'E':
- case 'e':
- case 'F':
- case 'f':
- case 'G':
- case 'g':
- case 'H':
- case 'h':
- case 'I':
- case 'i':
- case 'J':
- case 'j':
- case 'K':
- case 'k':
- case 'L':
- case 'l':
- case 'M':
- case 'm':
- case 'N':
- case 'n':
- case 'O':
- case 'o':
- case 'P':
- case 'p':
- case 'Q':
- case 'q':
- case 'R':
- case 'r':
- case 'T':
- case 't':
- case 'U':
- case 'u':
- case 'V':
- case 'v':
- case 'W':
- case 'w':
- case 'X':
- case 'x':
- case 'Y':
- case 'y':
- case 'Z':
- case 'z':
- //System.out.println(lastSS);
- Color nonCanColor = getNotCanonicalColor(lastSS);
- drawNotCanonicalAnnot(g,nonCanColor, row_annotations, lastSSX, x, y, iconOffset, startRes,
- column, validRes, validEnd);
- break;
- default:
- drawGlyphLine(g, row_annotations, lastSSX, x, y, iconOffset, startRes,
- column, validRes, validEnd);
- break;
+ switch (lastSS)
+ {
+ case '$':
+ drawHelixAnnot(g, row_annotations, lastSSX, x, y, iconOffset,
+ startRes, column, validRes, validEnd);
+ break;
+
+ case '�':
+ drawSheetAnnot(g, row_annotations, lastSSX, x, y, iconOffset,
+ startRes, column, validRes, validEnd);
+ break;
+ case 's':
+ case 'S': // Stem case for RNA secondary structure
+
+ drawStemAnnot(g, row_annotations, lastSSX, x, y, iconOffset,
+ startRes, column, validRes, validEnd);
+
+ break;
+ case '{':
+ case '}':
+ case '[':
+ case ']':
+ case '>':
+ case '<':
+ case 'A':
+ case 'a':
+ case 'B':
+ case 'b':
+ case 'C':
+ case 'c':
+ case 'D':
+ case 'd':
+ case 'E':
+ case 'e':
+ case 'F':
+ case 'f':
+ case 'G':
+ case 'g':
+ case 'H':
+ case 'h':
+ case 'I':
+ case 'i':
+ case 'J':
+ case 'j':
+ case 'K':
+ case 'k':
+ case 'L':
+ case 'l':
+ case 'M':
+ case 'm':
+ case 'N':
+ case 'n':
+ case 'O':
+ case 'o':
+ case 'P':
+ case 'p':
+ case 'Q':
+ case 'q':
+ case 'R':
+ case 'r':
+ case 'T':
+ case 't':
+ case 'U':
+ case 'u':
+ case 'V':
+ case 'v':
+ case 'W':
+ case 'w':
+ case 'X':
+ case 'x':
+ case 'Y':
+ case 'y':
+ case 'Z':
+ case 'z':
+ // System.out.println(lastSS);
+ Color nonCanColor = getNotCanonicalColor(lastSS);
+ drawNotCanonicalAnnot(g, nonCanColor, row_annotations, lastSSX,
+ x, y, iconOffset, startRes, column, validRes, validEnd);
+ break;
+ default:
+ drawGlyphLine(g, row_annotations, lastSSX, x, y, iconOffset,
+ startRes, column, validRes, validEnd);
+ break;
+ }
}
- }
- if (row.graph > 0 && row.graphHeight > 0)
- {
- if (row.graph == AlignmentAnnotation.LINE_GRAPH)
+ if (row.graph > 0 && row.graphHeight > 0)
{
- if (row.graphGroup > -1 && !graphGroupDrawn.get(row.graphGroup))
+ if (row.graph == AlignmentAnnotation.LINE_GRAPH)
{
- // TODO: JAL-1291 revise rendering model so the graphGroup map is computed efficiently for all visible labels
- float groupmax = -999999, groupmin = 9999999;
- for (int gg = 0; gg < aa.length; gg++)
+ if (row.graphGroup > -1 && !graphGroupDrawn.get(row.graphGroup))
{
- if (aa[gg].graphGroup != row.graphGroup)
+ // TODO: JAL-1291 revise rendering model so the graphGroup map is
+ // computed efficiently for all visible labels
+ float groupmax = -999999, groupmin = 9999999;
+ for (int gg = 0; gg < aa.length; gg++)
{
- continue;
- }
+ if (aa[gg].graphGroup != row.graphGroup)
+ {
+ continue;
+ }
- if (aa[gg] != row)
- {
- aa[gg].visible = false;
- }
- if (aa[gg].graphMax > groupmax)
- {
- groupmax = aa[gg].graphMax;
+ if (aa[gg] != row)
+ {
+ aa[gg].visible = false;
+ }
+ if (aa[gg].graphMax > groupmax)
+ {
+ groupmax = aa[gg].graphMax;
+ }
+ if (aa[gg].graphMin < groupmin)
+ {
+ groupmin = aa[gg].graphMin;
+ }
}
- if (aa[gg].graphMin < groupmin)
+
+ for (int gg = 0; gg < aa.length; gg++)
{
- groupmin = aa[gg].graphMin;
+ if (aa[gg].graphGroup == row.graphGroup)
+ {
+ drawLineGraph(g, aa[gg], aa[gg].annotations, startRes,
+ endRes, y, groupmin, groupmax, row.graphHeight);
+ }
}
- }
- for (int gg = 0; gg < aa.length; gg++)
+ graphGroupDrawn.set(row.graphGroup);
+ }
+ else
{
- if (aa[gg].graphGroup == row.graphGroup)
- {
- drawLineGraph(g, aa[gg], aa[gg].annotations, startRes, endRes, y, groupmin,
- groupmax, row.graphHeight);
- }
+ drawLineGraph(g, row, row_annotations, startRes, endRes, y,
+ row.graphMin, row.graphMax, row.graphHeight);
}
-
- graphGroupDrawn.set(row.graphGroup);
}
- else
+ else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
{
- drawLineGraph(g, row, row_annotations, startRes, endRes, y, row.graphMin,
- row.graphMax, row.graphHeight);
+ drawBarGraph(g, row, row_annotations, startRes, endRes,
+ row.graphMin, row.graphMax, y, renderHistogram,
+ renderProfile, normaliseProfile);
}
}
- else if (row.graph == AlignmentAnnotation.BAR_GRAPH)
- {
- drawBarGraph(g, row, row_annotations, startRes, endRes,
- row.graphMin, row.graphMax, y, renderHistogram,renderProfile,normaliseProfile);
- }
}
- } else {
- if (clipst && !clipend)
+ else
{
- clipend = true;
- }
- }// end if_in_visible_region
+ if (clipst && !clipend)
+ {
+ clipend = true;
+ }
+ }// end if_in_visible_region
if (row.graph > 0 && row.hasText)
{
y += charHeight;
private final Color HELIX_COLOUR = Color.red;
private final Color STEM_COLOUR = Color.blue;
-
- private Color sdNOTCANONICAL_COLOUR;
- public void drawGlyphLine(Graphics g, Annotation[] row,
- int lastSSX, int x, int y, int iconOffset, int startRes,
- int column, boolean validRes, boolean validEnd)
+ private Color sdNOTCANONICAL_COLOUR;
+
+ public void drawGlyphLine(Graphics g, Annotation[] row, int lastSSX,
+ int x, int y, int iconOffset, int startRes, int column,
+ boolean validRes, boolean validEnd)
{
g.setColor(GLYPHLINE_COLOR);
g.fillRect(lastSSX, y + 6 + iconOffset, (x * charWidth) - lastSSX, 2);
public void drawSheetAnnot(Graphics g, Annotation[] row,
- int lastSSX, int x, int y, int iconOffset, int startRes,
- int column, boolean validRes, boolean validEnd)
+ int lastSSX, int x, int y, int iconOffset, int startRes, int column,
+ boolean validRes, boolean validEnd)
{
g.setColor(SHEET_COLOUR);
public void drawBarGraph(Graphics g, AlignmentAnnotation _aa,
Annotation[] aa_annotations, int sRes, int eRes, float min,
- float max, int y, boolean renderHistogram,boolean renderProfile,boolean normaliseProfile)
+ float max, int y, boolean renderHistogram, boolean renderProfile,
+ boolean normaliseProfile)
{
if (sRes > aa_annotations.length)
{
}
}
-
Color getNotCanonicalColor(char lastss)
- {
- switch (lastss)
- {
- case '{':
- case '}':
- return new Color(255,125,5);
-
- case '[':
- case ']':
- return new Color(245,115,10);
-
- case '>':
- case '<':
- return new Color(235,135,15);
-
- case 'A':
- case 'a':
- return new Color(225,105,20);
-
- case 'B':
- case 'b':
- return new Color(215,145,30);
-
- case 'C':
- case 'c':
- return new Color(205,95,35);
-
- case 'D':
- case 'd':
- return new Color(195,155,45);
-
- case 'E':
- case 'e':
- return new Color(185,85,55);
-
- case 'F':
- case 'f':
- return new Color(175,165,65);
-
- case 'G':
- case 'g':
- return new Color(170,75,75);
-
- case 'H':
- case 'h':
- return new Color(160,175,85);
-
- case 'I':
- case 'i':
- return new Color(150,65,95);
-
- case 'J':
- case 'j':
- return new Color(140,185,105);
-
- case 'K':
- case 'k':
- return new Color(130,55,110);
-
- case 'L':
- case 'l':
- return new Color(120,195,120);
-
- case 'M':
- case 'm':
- return new Color(110,45,130);
-
- case 'N':
- case 'n':
- return new Color(100,205,140);
-
- case 'O':
- case 'o':
- return new Color(90,35,150);
-
- case 'P':
- case 'p':
- return new Color(85,215,160);
-
- case 'Q':
- case 'q':
- return new Color(75,25,170);
-
- case 'R':
- case 'r':
- return new Color(65,225,180);
-
- case 'S':
- case 's':
- return new Color(55,15,185);
-
- case 'T':
- case 't':
- return new Color(45,235,195);
-
- case 'U':
- case 'u':
- return new Color(35,5,205);
-
- case 'V':
- case 'v':
- return new Color(25,245,215);
-
- case 'W':
- case 'w':
- return new Color(15,0,225);
-
- case 'X':
- case 'x':
- return new Color(10,255,235);
-
- case 'Y':
- case 'y':
- return new Color(5,150,245);
-
- case 'Z':
- case 'z':
- return new Color(0,80,255);
-
- default :
- System.out.println("This is not a interaction : "+lastss);
- return null;
-
- }
- }
-}
+ {
+ switch (lastss)
+ {
+ case '{':
+ case '}':
+ return new Color(255, 125, 5);
+
+ case '[':
+ case ']':
+ return new Color(245, 115, 10);
-
-
+ case '>':
+ case '<':
+ return new Color(235, 135, 15);
+
+ case 'A':
+ case 'a':
+ return new Color(225, 105, 20);
+
+ case 'B':
+ case 'b':
+ return new Color(215, 145, 30);
+
+ case 'C':
+ case 'c':
+ return new Color(205, 95, 35);
+
+ case 'D':
+ case 'd':
+ return new Color(195, 155, 45);
+
+ case 'E':
+ case 'e':
+ return new Color(185, 85, 55);
+
+ case 'F':
+ case 'f':
+ return new Color(175, 165, 65);
+
+ case 'G':
+ case 'g':
+ return new Color(170, 75, 75);
+
+ case 'H':
+ case 'h':
+ return new Color(160, 175, 85);
+
+ case 'I':
+ case 'i':
+ return new Color(150, 65, 95);
+
+ case 'J':
+ case 'j':
+ return new Color(140, 185, 105);
+
+ case 'K':
+ case 'k':
+ return new Color(130, 55, 110);
+
+ case 'L':
+ case 'l':
+ return new Color(120, 195, 120);
+
+ case 'M':
+ case 'm':
+ return new Color(110, 45, 130);
+
+ case 'N':
+ case 'n':
+ return new Color(100, 205, 140);
+
+ case 'O':
+ case 'o':
+ return new Color(90, 35, 150);
+
+ case 'P':
+ case 'p':
+ return new Color(85, 215, 160);
+
+ case 'Q':
+ case 'q':
+ return new Color(75, 25, 170);
+
+ case 'R':
+ case 'r':
+ return new Color(65, 225, 180);
+
+ case 'S':
+ case 's':
+ return new Color(55, 15, 185);
+
+ case 'T':
+ case 't':
+ return new Color(45, 235, 195);
+
+ case 'U':
+ case 'u':
+ return new Color(35, 5, 205);
+
+ case 'V':
+ case 'v':
+ return new Color(25, 245, 215);
+
+ case 'W':
+ case 'w':
+ return new Color(15, 0, 225);
+
+ case 'X':
+ case 'x':
+ return new Color(10, 255, 235);
+
+ case 'Y':
+ case 'y':
+ return new Color(5, 150, 245);
+
+ case 'Z':
+ case 'z':
+ return new Color(0, 80, 255);
+
+ default:
+ System.out.println("This is not a interaction : " + lastss);
+ return null;
+
+ }
+ }
+}
/**
* height of visible area on to the image - used to draw only what is visible.
+ *
* @return [start, end of visible region]
*/
int[] getVisibleVRange();
private boolean seqAssociated = false;
IdentityHashMap<SequenceI, AlignmentAnnotation> seqannot = null;
+
@Override
public ColourSchemeI applyTo(AnnotatedCollectionI sg,
Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
{
- AnnotationColourGradient acg = new AnnotationColourGradient(annotation, colourScheme, aboveAnnotationThreshold);
+ AnnotationColourGradient acg = new AnnotationColourGradient(annotation,
+ colourScheme, aboveAnnotationThreshold);
acg.thresholdIsMinMax = thresholdIsMinMax;
- acg.annotationThreshold = (annotationThreshold==null) ? null : new GraphLine(annotationThreshold);
+ acg.annotationThreshold = (annotationThreshold == null) ? null
+ : new GraphLine(annotationThreshold);
acg.r1 = r1;
acg.g1 = g1;
acg.b1 = b1;
acg.db = db;
acg.predefinedColours = predefinedColours;
acg.seqAssociated = seqAssociated;
-
+
return acg;
}
+
/**
* Creates a new AnnotationColourGradient object.
*/
seqannot = new IdentityHashMap<SequenceI, AlignmentAnnotation>();
}
// resolve the context containing all the annotation for the sequence
- AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment : alignment.getContext();
+ AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment
+ : alignment.getContext();
for (AlignmentAnnotation alan : alcontext.findAnnotation(annotation
.getCalcId()))
{
}
if ((threshold == 0) || aboveThreshold(c, j))
{
- if (annotation.annotations!=null && j < annotation.annotations.length
+ if (annotation.annotations != null
+ && j < annotation.annotations.length
&& annotation.annotations[j] != null
&& !jalview.util.Comparison.isGap(c))
{
{
currentColour = colourScheme.findColour(c, j, seq);
}
- else
+ else
{
dr = rr * range + r1;
dg = gg * range + g1;
return currentColour;
}
+
@Override
public ColourSchemeI applyTo(AnnotatedCollectionI sg,
Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
- {
+ {
ColourSchemeI newcs = super.applyTo(sg, hiddenRepSequences);
return newcs;
}
{
this.includeGaps = includeGaps;
}
+
@Override
public ColourSchemeI applyTo(AnnotatedCollectionI sg,
Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
{
- ClustalxColourScheme css= new ClustalxColourScheme(sg, hiddenRepSequences);
+ ClustalxColourScheme css = new ClustalxColourScheme(sg,
+ hiddenRepSequences);
css.includeGaps = includeGaps;
return css;
}
/**
*
- * @param c - sequence symbol or gap
- * @param j - position in seq
- * @param seq - sequence being coloured
- * @return context dependent colour for the given symbol at the position in the given sequence
+ * @param c
+ * - sequence symbol or gap
+ * @param j
+ * - position in seq
+ * @param seq
+ * - sequence being coloured
+ * @return context dependent colour for the given symbol at the position in
+ * the given sequence
*/
public Color findColour(char c, int j, SequenceI seq);
/**
* assign the given conservation to the colourscheme
+ *
* @param c
*/
public void setConservation(jalview.analysis.Conservation c);
/**
* enable or disable conservation shading for this colourscheme
- * @param conservationApplied
+ *
+ * @param conservationApplied
*/
public void setConservationApplied(boolean conservationApplied);
+
/**
*
* @return true if conservation shading is enabled for this colourscheme
/**
* set scale factor for bleaching of colour in unconserved regions
+ *
* @param i
*/
public void setConservationInc(int i);
/**
*
- * @return scale factor for bleaching colour in unconserved regions
+ * @return scale factor for bleaching colour in unconserved regions
*/
public int getConservationInc();
public int getThreshold();
/**
- * set percentage identity threshold and type of %age identity calculation for shading
- * @param ct 0..100 percentage identity for applying this colourscheme
- * @param ignoreGaps when true, calculate PID without including gapped positions
+ * set percentage identity threshold and type of %age identity calculation for
+ * shading
+ *
+ * @param ct
+ * 0..100 percentage identity for applying this colourscheme
+ * @param ignoreGaps
+ * when true, calculate PID without including gapped positions
*/
public void setThreshold(int ct, boolean ignoreGaps);
/**
- * recalculate dependent data using the given sequence collection, taking account of hidden rows
+ * recalculate dependent data using the given sequence collection, taking
+ * account of hidden rows
+ *
* @param alignment
* @param hiddenReps
*/
Map<SequenceI, SequenceCollectionI> hiddenReps);
/**
- * create a new instance of the colourscheme configured to colour the given connection
+ * create a new instance of the colourscheme configured to colour the given
+ * connection
+ *
* @param sg
* @param hiddenRepSequences
* @return copy of current scheme with any inherited settings transfered
public static final int COVARIATION = 14;
public static final int TCOFFEE = 15;
-
+
public static final int RNAHELIX = 16;
public static final int RNAINTERACTION = 17;
ret = "T-Coffee Scores";
break;
-
+
case RNAINTERACTION:
- ret = "RNA Interaction type";
+ ret = "RNA Interaction type";
- break;
+ break;
case RNAHELIX:
ret = "RNA Helices";
case TCOFFEE:
cs = new TCoffeeColourScheme(coll);
break;
-
+
case RNAHELIX:
cs = new RNAHelicesColour(coll);
break;
-
- // case COVARIATION:
- // cs = new CovariationColourScheme(annotation);
+
+ // case COVARIATION:
+ // cs = new CovariationColourScheme(annotation);
// break;
case USER_DEFINED:
/**
* Colourscheme that takes its colours from some other colourscheme
+ *
* @author jimp
- *
+ *
*/
public class FollowerColourScheme extends ResidueColourScheme
{
@Override
public void setConsensus(Hashtable[] consensus)
{
- if (colourScheme!=null)
+ if (colourScheme != null)
{
colourScheme.setConsensus(consensus);
}
@Override
public void setConservation(Conservation cons)
{
- if (colourScheme!=null)
+ if (colourScheme != null)
{
colourScheme.setConservation(cons);
}
@Override
public void setConservationInc(int i)
{
- if (colourScheme!=null)
+ if (colourScheme != null)
{
colourScheme.setConservationInc(i);
}
this.annotation = annotation;
refresh();
}
+
public RNAHelicesColour(AnnotatedCollectionI alignment)
{
super(ResidueProperties.nucleotideIndex);
{
// This loop will find the first rna structure annotation by which to colour
- // the sequences.
+ // the sequences.
AlignmentAnnotation[] annotations = alignment.getAlignmentAnnotation();
- for (int i = 0; i < annotations.length; i++) {
-
- // is this a sensible way of determining type of annotation?
- if (annotations[i].getRNAStruc() != null) {
- annotation = annotations[i];
- break;
- }
+ for (int i = 0; i < annotations.length; i++)
+ {
+
+ // is this a sensible way of determining type of annotation?
+ if (annotations[i].getRNAStruc() != null)
+ {
+ annotation = annotations[i];
+ break;
+ }
}
refresh();
}
+
private long lastrefresh = -1;
public void refresh()
{
-
- if (annotation!=null && ((annotation._rnasecstr == null
- || lastrefresh != annotation._rnasecstr.hashCode())
- && annotation.isValidStruc()))
+
+ if (annotation != null
+ && ((annotation._rnasecstr == null || lastrefresh != annotation._rnasecstr
+ .hashCode()) && annotation.isValidStruc()))
{
annotation.getRNAStruc();
lastrefresh = annotation._rnasecstr.hashCode();
* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
- package jalview.schemes;
+package jalview.schemes;
import jalview.datamodel.SequenceI;
import java.awt.Color;
+public class RNAInteractionColourScheme extends ResidueColourScheme
+{
+ public RNAInteractionColourScheme()
+ {
+ super();
+ }
-public class RNAInteractionColourScheme extends ResidueColourScheme{
- public RNAInteractionColourScheme()
- {
- super();
- }
+ /**
+ * DOCUMENT ME!
+ *
+ * @param n
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ @Override
+ public Color findColour(char c)
+ {
+ // System.out.println("called"); log.debug
+ return colors[ResidueProperties.nucleotideIndex[c]];
+ }
- /**
- * DOCUMENT ME!
- *
- * @param n
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- @Override
- public Color findColour(char c)
- {
- // System.out.println("called"); log.debug
- return colors[ResidueProperties.nucleotideIndex[c]];
- }
+ /**
+ * DOCUMENT ME!
+ *
+ * @param n
+ * DOCUMENT ME!
+ * @param j
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
+ @Override
+ public Color findColour(char c, int j, SequenceI seq)
+ {
+ Color currentColour;
+ if ((threshold == 0) || aboveThreshold(c, j))
+ {
+ try
+ {
+ currentColour = colors[ResidueProperties.nucleotideIndex[c]];
+ } catch (Exception ex)
+ {
+ return Color.white;
+ }
+ }
+ else
+ {
+ return Color.white;
+ }
- /**
- * DOCUMENT ME!
- *
- * @param n
- * DOCUMENT ME!
- * @param j
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
- */
- @Override
- public Color findColour(char c, int j, SequenceI seq)
- {
- Color currentColour;
- if ((threshold == 0) || aboveThreshold(c, j))
- {
- try
- {
- currentColour = colors[ResidueProperties.nucleotideIndex[c]];
- } catch (Exception ex)
- {
- return Color.white;
- }
- }
- else
- {
- return Color.white;
- }
+ if (conservationColouring)
+ {
+ currentColour = applyConservation(currentColour, j);
+ }
- if (conservationColouring)
- {
- currentColour = applyConservation(currentColour, j);
- }
-
- return currentColour;
- }
- }
+ return currentColour;
+ }
+}
{
return conservationColouring;
}
+
@Override
public void setConservationApplied(boolean conservationApplied)
{
public ColourSchemeI applyTo(AnnotatedCollectionI sg,
Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
{
- try {
+ try
+ {
return getClass().newInstance();
- }
- catch (Exception q)
+ } catch (Exception q)
{
- throw new Error("Serious implementation error: cannot duplicate colourscheme "+getClass().getName(), q);
+ throw new Error(
+ "Serious implementation error: cannot duplicate colourscheme "
+ + getClass().getName(), q);
}
}
}
public class ResidueProperties
{
- public static Hashtable<String,ScoreModelI> scoreMatrices = new Hashtable();
+ public static Hashtable<String, ScoreModelI> scoreMatrices = new Hashtable();
// Stores residue codes/names and colours and other things
public static final int[] aaIndex; // aaHash version 2.1.1 and below
}
/**
- * Nucleotide Ambiguity Codes
+ * Nucleotide Ambiguity Codes
*/
- public static final Hashtable<String,String[]> ambiguityCodes=new Hashtable<String,String[]>();
+ public static final Hashtable<String, String[]> ambiguityCodes = new Hashtable<String, String[]>();
+
/**
- * Codon triplets with additional symbols for unambiguous codons that include ambiguity codes
+ * Codon triplets with additional symbols for unambiguous codons that include
+ * ambiguity codes
*/
- public static final Hashtable<String,String> codonHash2 = new Hashtable<String,String>();
-
+ public static final Hashtable<String, String> codonHash2 = new Hashtable<String, String>();
+
/**
* all ambiguity codes for a given base
*/
- public final static Hashtable<String,List<String>> _ambiguityCodes = new Hashtable<String,List<String>>();
-
+ public final static Hashtable<String, List<String>> _ambiguityCodes = new Hashtable<String, List<String>>();
static
{
codonHash2.put("TTC", "F");
codonHash2.put("TTT", "F");
-
+
buildAmbiguityCodonSet();
}
-
+
/**
* programmatic generation of codons including ambiguity codes
*/
}
// and programmatically add in the ambiguity codes that yield the same amino
// acid
- String[] unambcodons = codonHash2.keySet().toArray(new String[codonHash2.size()]);
+ String[] unambcodons = codonHash2.keySet().toArray(
+ new String[codonHash2.size()]);
for (String codon : unambcodons)
{
String residue = codonHash2.get(codon);
char _anuc;
for (ipos = 0; ipos < tpos.length; ipos++)
{
- if (acodon[ipos].length==0 || tpos[ipos] < 0)
+ if (acodon[ipos].length == 0 || tpos[ipos] < 0)
{
_acodon += codon.charAt(ipos);
allres[ipos] = new char[]
_codon += allres[j][cpos[j]];
}
String tr = codonHash2.get(_codon);
- if (valid = (tr!=null && tr.equals(residue)))
+ if (valid = (tr != null && tr.equals(residue)))
{
// advance to next combination
ipos = acodon.length - 1;
if (valid)
{
// Add this to the set of codons we will translate
-// System.out.println("Adding ambiguity codon: " + _acodon + " for "
-// + residue);
+ // System.out.println("Adding ambiguity codon: " + _acodon + " for "
+ // + residue);
codonHash2.put(_acodon, residue);
}
else
{
-// System.err.println("Rejecting ambiguity codon: " + _acodon
-// + " for " + residue);
+ // System.err.println("Rejecting ambiguity codon: " + _acodon
+ // + " for " + residue);
}
// next combination
ipos = acodon.length - 1;
}
static
{
- int[][] propMatrixF = new int[maxProteinIndex][maxProteinIndex],
- propMatrixPos = new int[maxProteinIndex][maxProteinIndex],
- propMatrixEpos = new int[maxProteinIndex][maxProteinIndex];
- for (int i=0;i<maxProteinIndex;i++)
+ int[][] propMatrixF = new int[maxProteinIndex][maxProteinIndex], propMatrixPos = new int[maxProteinIndex][maxProteinIndex], propMatrixEpos = new int[maxProteinIndex][maxProteinIndex];
+ for (int i = 0; i < maxProteinIndex; i++)
{
- int maxF=0,maxP=0,maxEP=0;
- String ic="";
- if (aa.length>i) {
- ic+=aa[i];
+ int maxF = 0, maxP = 0, maxEP = 0;
+ String ic = "";
+ if (aa.length > i)
+ {
+ ic += aa[i];
}
- else {ic = "-";}
- for (int j=i+1;j<maxProteinIndex; j++)
+ else
{
- String jc="";
- if (aa.length>j) {
- jc+=aa[j];
+ ic = "-";
+ }
+ for (int j = i + 1; j < maxProteinIndex; j++)
+ {
+ String jc = "";
+ if (aa.length > j)
+ {
+ jc += aa[j];
}
- else {jc = "-";}
- propMatrixF[i][j]=0;
- propMatrixPos[i][j]=0;
- propMatrixEpos[i][j]=0;
- for (Enumeration<String> en= (Enumeration<String>)propHash.keys(); en.hasMoreElements(); )
+ else
+ {
+ jc = "-";
+ }
+ propMatrixF[i][j] = 0;
+ propMatrixPos[i][j] = 0;
+ propMatrixEpos[i][j] = 0;
+ for (Enumeration<String> en = (Enumeration<String>) propHash.keys(); en
+ .hasMoreElements();)
{
String ph = en.nextElement();
- Map<String,Integer> pph=(Map<String,Integer>)propHash.get(ph);
- if (pph.get(ic)!=null && pph.get(jc)!=null) {
- int icp=pph.get(ic).intValue(),jcp=pph.get(jc).intValue();
+ Map<String, Integer> pph = (Map<String, Integer>) propHash
+ .get(ph);
+ if (pph.get(ic) != null && pph.get(jc) != null)
+ {
+ int icp = pph.get(ic).intValue(), jcp = pph.get(jc).intValue();
// Still working on these definitions.
- propMatrixPos[i][j] += icp == jcp && icp>0 ? 2 : 0;
- propMatrixPos[j][i] += icp == jcp && icp>0 ? 2 : 0;
+ propMatrixPos[i][j] += icp == jcp && icp > 0 ? 2 : 0;
+ propMatrixPos[j][i] += icp == jcp && icp > 0 ? 2 : 0;
propMatrixF[i][j] += icp == jcp ? 2 : 0;
propMatrixF[j][i] += icp == jcp ? 2 : 0;
- propMatrixEpos[i][j] += icp == jcp ? (1+icp * 2) : 0;
- propMatrixEpos[j][i] += icp == jcp ? (1+icp * 2) : 0;
- }}
- if (maxF<propMatrixF[i][j])
+ propMatrixEpos[i][j] += icp == jcp ? (1 + icp * 2) : 0;
+ propMatrixEpos[j][i] += icp == jcp ? (1 + icp * 2) : 0;
+ }
+ }
+ if (maxF < propMatrixF[i][j])
{
- maxF=propMatrixF[i][j];
+ maxF = propMatrixF[i][j];
}
- if (maxP<propMatrixPos[i][j])
+ if (maxP < propMatrixPos[i][j])
{
- maxP=propMatrixPos[i][j];
+ maxP = propMatrixPos[i][j];
}
- if (maxEP<propMatrixEpos[i][j])
+ if (maxEP < propMatrixEpos[i][j])
{
- maxEP=propMatrixEpos[i][j];
+ maxEP = propMatrixEpos[i][j];
}
}
- propMatrixF[i][i]=maxF;
- propMatrixPos[i][i]=maxP;
- propMatrixEpos[i][i]=maxEP;
+ propMatrixF[i][i] = maxF;
+ propMatrixPos[i][i] = maxP;
+ propMatrixEpos[i][i] = maxEP;
}
// JAL-1512 comment out physicochemical score matrices for 2.8.1 release
- //scoreMatrices.put("Conservation Pos", new ScoreMatrix("Conservation Pos",propMatrixPos,0));
- //scoreMatrices.put("Conservation Both", new ScoreMatrix("Conservation Both",propMatrixF,0));
- //scoreMatrices.put("Conservation EnhPos", new ScoreMatrix("Conservation EnhPos",propMatrixEpos,0));
+ // scoreMatrices.put("Conservation Pos", new
+ // ScoreMatrix("Conservation Pos",propMatrixPos,0));
+ // scoreMatrices.put("Conservation Both", new
+ // ScoreMatrix("Conservation Both",propMatrixF,0));
+ // scoreMatrices.put("Conservation EnhPos", new
+ // ScoreMatrix("Conservation EnhPos",propMatrixEpos,0));
scoreMatrices.put("PID", new PIDScoreModel());
}
return _codonTranslate(lccodon);
}
String cdn = codonHash2.get(lccodon.toUpperCase());
- if (cdn!=null && cdn.equals("*"))
+ if (cdn != null && cdn.equals("*"))
{
return "STOP";
}
return cdn;
}
+
public static String _codonTranslate(String lccodon)
{
String codon = lccodon.toUpperCase();
}
return null;
}
+
/**
* get a ScoreModel based on its string name
*
public static Hashtable toRNAssState;
static
{
- toRNAssState = new Hashtable<String,String>();
+ toRNAssState = new Hashtable<String, String>();
toRNAssState.put(")", "(");
toRNAssState.put("(", "(");
toRNAssState.put("]", "[");
toRNAssState.put("y", "Y");
toRNAssState.put("Z", "Z");
toRNAssState.put("z", "Z");
-
+
}
/**
import jalview.analysis.scoremodels.PairwiseSeqScoreModel;
import jalview.api.analysis.ScoreModelI;
-public class ScoreMatrix extends PairwiseSeqScoreModel implements ScoreModelI
+public class ScoreMatrix extends PairwiseSeqScoreModel implements
+ ScoreModelI
{
String name;
-
+
@Override
public String getName()
{
* 0 for Protein Score matrix. 1 for dna score matrix
*/
int type;
+
/**
*
- * @param name Unique, human readable name for the matrix
- * @param matrix Pairwise scores indexed according to appropriate symbol alphabet
- * @param type 0 for Protein, 1 for NA
+ * @param name
+ * Unique, human readable name for the matrix
+ * @param matrix
+ * Pairwise scores indexed according to appropriate symbol alphabet
+ * @param type
+ * 0 for Protein, 1 for NA
*/
ScoreMatrix(String name, int[][] matrix, int type)
{
{
return type == 1;
}
+
@Override
public boolean isProtein()
{
// Search alignment to get all tcoffee annotation and pick one set of
// annotation to use to colour seqs.
seqMap = new IdentityHashMap<SequenceI, Color[]>();
- AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment : alignment.getContext();
+ AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment
+ : alignment.getContext();
int w = 0;
for (AlignmentAnnotation al : alcontext
.findAnnotation(TCoffeeScoreFile.TCOFFEE_SCORE))
}
return cols[j];
}
-
+
@Override
public ColourSchemeI applyTo(AnnotatedCollectionI sg,
Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
super(ResidueProperties.aaIndex);
colors = newColors;
}
+
@Override
public ColourSchemeI applyTo(AnnotatedCollectionI sg,
Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
{
UserColourScheme usc = new UserColourScheme(colors);
- if (lowerCaseColours!=null) {
+ if (lowerCaseColours != null)
+ {
usc.schemeName = new String(schemeName);
usc.lowerCaseColours = new Color[lowerCaseColours.length];
- System.arraycopy(lowerCaseColours, 0, usc.lowerCaseColours, 0, lowerCaseColours.length);
+ System.arraycopy(lowerCaseColours, 0, usc.lowerCaseColours, 0,
+ lowerCaseColours.length);
}
return usc;
}
+
public UserColourScheme(String colour)
{
super(ResidueProperties.aaIndex);
public void parseAppletParameter(String paramValue)
{
- // TODO: need a function to generate appletParameter colour string from a UCS
+ // TODO: need a function to generate appletParameter colour string from a
+ // UCS
StringTokenizer st = new StringTokenizer(paramValue, ";");
StringTokenizer st2;
String token = null, colour, residues;
}
Hashtable mappingData = new Hashtable();
+
private static StructureSelectionManager nullProvider = null;
+
public static StructureSelectionManager getStructureSelectionManager(
StructureSelectionManagerProvider context)
{
- if (context==null) {
+ if (context == null)
+ {
if (nullProvider == null)
{
if (instances != null)
StructureSelectionManager instance = instances.get(context);
if (instance == null)
{
- if (nullProvider!=null)
+ if (nullProvider != null)
{
instance = nullProvider;
- } else {
+ }
+ else
+ {
instance = new StructureSelectionManager();
}
instances.put(context, instance);
ref = new DBRefEntry(locsrc, version, pdbid + chaincode);
PDBEntry pdbr = new PDBEntry();
pdbr.setId(pdbid);
- pdbr.getProperty().put("CHAIN",chaincode);
+ pdbr.getProperty().put("CHAIN", chaincode);
seq.addPDBId(pdbr);
}
}
* @author David Roldan Martinez
* @author Thomas Abeel
*
- *
+ *
*/
-public class MessageManager {
+public class MessageManager
+{
- private static ResourceBundle rb;
-
- private static Logger log=Logger.getLogger(MessageManager.class.getCanonicalName());
-
- private static Locale loc;
-
-
-
- static{
- try {
- /* Localize Java dialogs */
- loc = Locale.getDefault();
- // Locale.setDefault(loc);
- /* Getting messages for GV */
- log.info("Getting messages for lang: "+loc);
- rb = ResourceBundle.getBundle("lang.Messages", loc);
- if (log.isLoggable(Level.FINEST)) {
- // this might take a while, so we only do it if it will be shown
- log.finest("Language keys: "+rb.keySet());
- }
- } catch (Exception q) {
- log.warning("Exception when initting Locale for i18n messages\n"+q.getMessage());
- q.printStackTrace();
- }
- catch (Error v)
+ private static ResourceBundle rb;
+
+ private static Logger log = Logger.getLogger(MessageManager.class
+ .getCanonicalName());
+
+ private static Locale loc;
+
+ static
+ {
+ try
+ {
+ /* Localize Java dialogs */
+ loc = Locale.getDefault();
+ // Locale.setDefault(loc);
+ /* Getting messages for GV */
+ log.info("Getting messages for lang: " + loc);
+ rb = ResourceBundle.getBundle("lang.Messages", loc);
+ if (log.isLoggable(Level.FINEST))
{
- log.warning("Error when initting Locale for i18n messages\n"+v.getMessage());
- v.printStackTrace();
+ // this might take a while, so we only do it if it will be shown
+ log.finest("Language keys: " + rb.keySet());
}
-
-
+ } catch (Exception q)
+ {
+ log.warning("Exception when initting Locale for i18n messages\n"
+ + q.getMessage());
+ q.printStackTrace();
+ } catch (Error v)
+ {
+ log.warning("Error when initting Locale for i18n messages\n"
+ + v.getMessage());
+ v.printStackTrace();
}
-
- public static String getString(String key){
- String value = "[missing key] " + key;
- try{
- value = rb.getString(key);
- }catch(Exception e){
- log.warning("I18N missing: "+loc+"\t"+key);
- }
- return value;
+
+ }
+
+ public static String getString(String key)
+ {
+ String value = "[missing key] " + key;
+ try
+ {
+ value = rb.getString(key);
+ } catch (Exception e)
+ {
+ log.warning("I18N missing: " + loc + "\t" + key);
}
-
- public static Locale getLocale() {
- return loc;
- }
- public static String formatMessage(String key, Object... params){
- return MessageFormat.format(rb.getString(key), (Object[]) params);
- }
+ return value;
+ }
+
+ public static Locale getLocale()
+ {
+ return loc;
+ }
+
+ public static String formatMessage(String key, Object... params)
+ {
+ return MessageFormat.format(rb.getString(key), (Object[]) params);
+ }
/**
- * lookup and return a key given a root and a human-readable(ish) name that when combined might resolve to an i18n string.
- * If the key doesn't resolve, then name is returned.if the key doesn't exist.
- * Use this for programatically constructed keys that have have a human readable alternative used in the program (e.g. BLOSUM62 and label.score_blosum62)
+ * lookup and return a key given a root and a human-readable(ish) name that
+ * when combined might resolve to an i18n string. If the key doesn't resolve,
+ * then name is returned.if the key doesn't exist. Use this for
+ * programatically constructed keys that have have a human readable
+ * alternative used in the program (e.g. BLOSUM62 and label.score_blosum62)
+ *
* @param keyroot
* @param name
* @return
*/
public static String getStringOrReturn(String keyroot, String name)
{
- String smkey = keyroot
- + name.toLowerCase().replaceAll(" ", "");
- try {
- name = rb.getString(smkey);
- }
- catch (Exception x) {
- log.finest("I18N missing key with root "+keyroot+": "+loc+"\t"+smkey);
+ String smkey = keyroot + name.toLowerCase().replaceAll(" ", "");
+ try
+ {
+ name = rb.getString(smkey);
+ } catch (Exception x)
+ {
+ log.finest("I18N missing key with root " + keyroot + ": " + loc
+ + "\t" + smkey);
}
return name;
}
// calculation till later or to do all calculations in thread.
// via changecolour
globalColourScheme = cs;
- boolean recalc=false;
- if (cs!=null)
+ boolean recalc = false;
+ if (cs != null)
{
cs.setConservationApplied(recalc = getConservationSelected());
- if (getAbovePIDThreshold() || cs instanceof PIDColourScheme || cs instanceof Blosum62ColourScheme)
+ if (getAbovePIDThreshold() || cs instanceof PIDColourScheme
+ || cs instanceof Blosum62ColourScheme)
{
recalc = true;
cs.setThreshold(threshold, ignoreGapsInConsensusCalculation);
- } else {
+ }
+ else
+ {
cs.setThreshold(0, ignoreGapsInConsensusCalculation);
}
if (recalc)
|| cs instanceof Blosum62ColourScheme)
{
sg.cs.setThreshold(threshold, getIgnoreGapsConsensus());
- recalc=true;
+ recalc = true;
}
else
{
if (getConservationSelected())
{
sg.cs.setConservationApplied(true);
- recalc=true;
+ recalc = true;
}
else
{
sg.cs.setConservation(null);
// sg.cs.setThreshold(0, getIgnoreGapsConsensus());
}
- if (recalc) {
+ if (recalc)
+ {
sg.recalcConservation();
- } else {
+ }
+ else
+ {
sg.cs.alignmentChanged(sg, hiddenRepSequences);
}
}
* view
*/
protected Hashtable[] hStrucConsensus = null;
-
+
protected Conservation hconservation = null;
+
@Override
public void setConservation(Conservation cons)
{
hconservation = cons;
}
+
/**
* percentage gaps allowed in a column before all amino acid properties should
* be considered unconserved
{
conservation = new AlignmentAnnotation("Conservation",
"Conservation of total alignment less than "
- + getConsPercGaps() + "% gaps",
- new Annotation[1], 0f, 11f,
- AlignmentAnnotation.BAR_GRAPH);
+ + getConsPercGaps() + "% gaps", new Annotation[1],
+ 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
conservation.hasText = true;
conservation.autoCalculated = true;
alignment.addAnnotation(conservation);
}
}
}
+
private void initQuality()
{
if (showQuality)
{
quality = new AlignmentAnnotation("Quality",
"Alignment Quality based on Blosum62 scores",
- new Annotation[1], 0f, 11f,
- AlignmentAnnotation.BAR_GRAPH);
+ new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
quality.hasText = true;
quality.autoCalculated = true;
alignment.addAnnotation(quality);
}
}
}
+
private void initRNAStructure()
{
- if (alignment.hasRNAStructure() && strucConsensus==null)
+ if (alignment.hasRNAStructure() && strucConsensus == null)
{
strucConsensus = new AlignmentAnnotation("StrucConsensus", "PID",
- new Annotation[1], 0f, 100f,
- AlignmentAnnotation.BAR_GRAPH);
+ new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
strucConsensus.hasText = true;
strucConsensus.autoCalculated = true;
}
}
}
+
/*
* (non-Javadoc)
*
if (aan[an].autoCalculated && aan[an].groupRef != null)
{
oldrfs.add(aan[an].groupRef);
- alignment.deleteAnnotation(aan[an],false);
+ alignment.deleteAnnotation(aan[an], false);
}
}
}
@Override
public Color getSequenceColour(SequenceI seq)
{
- Color sqc=Color.white;
+ Color sqc = Color.white;
if (sequenceColours != null)
{
sqc = (Color) sequenceColours.get(seq);
- if (sqc == null) {
+ if (sqc == null)
+ {
sqc = Color.white;
}
}
AlignmentView seqstrings;
SequenceI[] seqs;
-
+
/**
* Score matrix used to calculate PC
*/
public void run()
{
- pca = new PCA(seqstrings.getSequenceStrings(' '), nucleotide, score_matrix);
+ pca = new PCA(seqstrings.getSequenceStrings(' '), nucleotide,
+ score_matrix);
pca.setJvCalcMode(jvCalcMode);
pca.run();
{
this.score_matrix = score_matrix;
}
-
+
}
public class ConsensusThread extends AlignCalcWorker implements
AlignCalcWorkerI
{
- private long nseq=-1;
+ private long nseq = -1;
public ConsensusThread(AlignViewportI alignViewport,
AlignmentViewPanel alignPanel)
{
SequenceI aseqs[] = alignment.getSequencesArray();
nseq = aseqs.length;
- AAFrequency.calculate(aseqs, 0,
- alignment.getWidth(), hconsensus, true);
+ AAFrequency.calculate(aseqs, 0, alignment.getWidth(), hconsensus,
+ true);
} catch (ArrayIndexOutOfBoundsException x)
{
// this happens due to a race condition -
Hashtable[] hStrucConsensus;
- private long nseq=-1;
+ private long nseq = -1;
@Override
public void run()
try
{
- final SequenceI[] arr=
- alignment.getSequencesArray();
+ final SequenceI[] arr = alignment.getSequencesArray();
nseq = arr.length;
- jalview.analysis.StructureFrequency.calculate(arr, 0, alignment.getWidth(),
- hStrucConsensus, true, rnaStruc);
+ jalview.analysis.StructureFrequency.calculate(arr, 0,
+ alignment.getWidth(), hStrucConsensus, true, rnaStruc);
} catch (ArrayIndexOutOfBoundsException x)
{
calcMan.workerComplete(this);
private SequenceI[] alseqs;
/**
- * when true - retrieved sequences will be trimmed to cover longest derived alignment sequence
+ * when true - retrieved sequences will be trimmed to cover longest derived
+ * alignment sequence
*/
- private boolean trimDsSeqs=true;
+ private boolean trimDsSeqs = true;
public DBRefFetcher()
{
this.dataset = ds;
// TODO Jalview 2.5 lots of this code should be in the gui package!
sfetcher = jalview.gui.SequenceFetcher.getSequenceFetcherSingleton(af);
- // set default behaviour for transferring excess sequence data to the dataset
+ // set default behaviour for transferring excess sequence data to the
+ // dataset
trimDsSeqs = Cache.getDefault("TRIM_FETCHED_DATASET_SEQS", true);
if (sources == null)
{
if (retrieved != null)
{
transferReferences(sdataset, dbsource.getDbSource(),
- retrieved,trimDsSeqs);
+ retrieved, trimDsSeqs);
}
}
else
} // all databases have been queries.
if (sbuffer.length() > 0)
{
- output.setText(MessageManager.getString("label.your_sequences_have_been_verified")
+ output.setText(MessageManager
+ .getString("label.your_sequences_have_been_verified")
+ sbuffer.toString());
- Desktop.addInternalFrame(output, MessageManager.getString("label.sequence_names_updated"), 600, 300);
+ Desktop.addInternalFrame(output,
+ MessageManager.getString("label.sequence_names_updated"),
+ 600, 300);
// The above is the dataset, we must now find out the index
// of the viewed sequence
}
- af.setProgressBar(MessageManager.getString("label.dbref_search_completed"), startTime);
+ af.setProgressBar(
+ MessageManager.getString("label.dbref_search_completed"),
+ startTime);
// promptBeforeBlast();
running = false;
/**
* Verify local sequences in seqRefs against the retrieved sequence database
* records.
- * @param trimDatasetSeqs
+ *
+ * @param trimDatasetSeqs
*
*/
void transferReferences(Vector sdataset, String dbSource,
AlignmentI retrievedAl, boolean trimDatasetSeqs) // File
// file)
{
- System.out.println("trimming ? "+trimDatasetSeqs);
+ System.out.println("trimming ? " + trimDatasetSeqs);
if (retrievedAl == null || retrievedAl.getHeight() == 0)
{
return;
// unknownSequences.remove(sequence);
int absEnd = absStart + nonGapped.length();
absStart += 1;
- if (!trimDatasetSeqs) {
+ if (!trimDatasetSeqs)
+ {
// insert full length sequence from record
sequence.setSequence(entry.getSequenceAsString());
sequence.setStart(entry.getStart());
if (updateRefFrame)
{
// finally, update local sequence reference frame if we're allowed
- if (trimDatasetSeqs) {
+ if (trimDatasetSeqs)
+ {
// just fix start/end
sequence.setStart(absStart);
sequence.setEnd(absEnd);
* Lightweight runnable to discover dynamic 'one way' group URL services
*
* as of Jalview 2.8.1 this class is mothballed and will be dropped in v3.
+ *
* @author JimP
* @deprecated
*
/**
* Helpful procedures for working with services via HTTPClient
+ *
* @author jimp
- *
+ *
*/
public class HttpClientUtils
{
}
public static BufferedReader doHttpMpartFilePost(String postUrl,
- List<NameValuePair> vals, String fparm,File file, String mtype) throws ClientProtocolException,
- IOException
+ List<NameValuePair> vals, String fparm, File file, String mtype)
+ throws ClientProtocolException, IOException
{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(postUrl);
- MultipartEntity mpe = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
- for (NameValuePair nvp:vals)
+ MultipartEntity mpe = new MultipartEntity(
+ HttpMultipartMode.BROWSER_COMPATIBLE);
+ for (NameValuePair nvp : vals)
{
mpe.addPart(nvp.getName(), new StringBody(nvp.getValue()));
}
-
- FileBody fb = new FileBody(file, mtype!=null ? mtype : "application/octet-stream");
+
+ FileBody fb = new FileBody(file, mtype != null ? mtype
+ : "application/octet-stream");
mpe.addPart(fparm, fb);
UrlEncodedFormEntity ue = new UrlEncodedFormEntity(vals, "UTF-8");
httppost.setEntity(ue);
return null;
}
}
+
public static BufferedReader doHttpMpartInputstreamPost(String postUrl,
- List<NameValuePair> vals, String fparm,String fname, InputStream is, String mtype) throws ClientProtocolException,
+ List<NameValuePair> vals, String fparm, String fname,
+ InputStream is, String mtype) throws ClientProtocolException,
IOException
{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(postUrl);
MultipartEntity mpe = new MultipartEntity(HttpMultipartMode.STRICT);
- for (NameValuePair nvp:vals)
+ for (NameValuePair nvp : vals)
{
mpe.addPart(nvp.getName(), new StringBody(nvp.getValue()));
}
-
- InputStreamBody fb = (mtype!=null) ? new InputStreamBody(is, fname, mtype) : new InputStreamBody(is, fname);
+
+ InputStreamBody fb = (mtype != null) ? new InputStreamBody(is, fname,
+ mtype) : new InputStreamBody(is, fname);
mpe.addPart(fparm, fb);
UrlEncodedFormEntity ue = new UrlEncodedFormEntity(vals, "UTF-8");
httppost.setEntity(ue);
{
if (j.cancelled)
{
- cancelled++;
- j.subjobComplete=true;
- wsInfo.setStatus(j.jobnum, WebserviceInfo.STATE_CANCELLED_OK);
- return;
- }
+ cancelled++;
+ j.subjobComplete = true;
+ wsInfo.setStatus(j.jobnum, WebserviceInfo.STATE_CANCELLED_OK);
+ return;
+ }
if (j.submitted)
{
String progheader = "";
{
this(true);
}
+
public SequenceFetcher(boolean addDas)
{
addDBRefSourceImpl(jalview.ws.dbsources.EmblSource.class);
// PFAM
addDBRefSourceImpl(jalview.ws.dbsources.RfamFull.class);
addDBRefSourceImpl(jalview.ws.dbsources.RfamSeed.class);
- if (addDas) {
+ if (addDas)
+ {
registerDasSequenceSources();
}
}
+ "With one argument, the argument will be resolved to one or more db sources and each will be queried with their test accession only.\n"
+ "If given two arguments, SequenceFetcher will try to find the DbFetcher corresponding to <DBNAME> and retrieve <ACCNO> from it.\n"
+ "The -nodas option will exclude DAS sources from the database fetchers Jalview will try to use.";
- boolean withDas=true;
- if (argv!=null && argv.length>0 && argv[0].toLowerCase().startsWith("-nodas"))
+ boolean withDas = true;
+ if (argv != null && argv.length > 0
+ && argv[0].toLowerCase().startsWith("-nodas"))
{
- withDas=false;
- String targs[] = new String[argv.length-1];
+ withDas = false;
+ String targs[] = new String[argv.length - 1];
System.arraycopy(argv, 1, targs, 0, targs.length);
- argv=targs;
+ argv = targs;
}
if (argv != null && argv.length > 0)
{
AlignmentI al = null;
try
{
- al = sp.getSequenceRecords(argv.length>1 ? argv[1] : sp.getTestQuery());
+ al = sp.getSequenceRecords(argv.length > 1 ? argv[1] : sp
+ .getTestQuery());
} catch (Exception e)
{
e.printStackTrace();
- System.err.println("Error when retrieving " + (argv.length>1 ? argv[1] : sp.getTestQuery())
+ System.err.println("Error when retrieving "
+ + (argv.length > 1 ? argv[1] : sp.getTestQuery())
+ " from " + argv[0] + "\nUsage: " + usage);
}
SequenceI[] prod = al.getSequencesArray();
*/
package jalview.ws.dbsources;
-
import com.stevesoft.pat.Regex;
import jalview.datamodel.AlignmentI;
{
return "GeneDB"; // getDbSource();
}
+
@Override
public int getTier()
{
jalview.io.AppletFormatAdapter.FILE, "PDB");
if (pdbfile != null)
{
- List<SequenceI> toremove=new ArrayList<SequenceI>();
+ List<SequenceI> toremove = new ArrayList<SequenceI>();
for (SequenceI pdbcs : pdbfile.getSequences())
{
String chid = null;
}
else
{
- // mark this sequence to be removed from the alignment
+ // mark this sequence to be removed from the alignment
// - since it's not from the right chain
toremove.add(pdbcs);
}
}
- // now remove marked sequences
- for (SequenceI pdbcs:toremove) {
+ // now remove marked sequences
+ for (SequenceI pdbcs : toremove)
+ {
pdbfile.deleteSequence(pdbcs);
}
}
-
+
if (pdbfile == null || pdbfile.getHeight() < 1)
{
throw new Exception("No PDB Records for " + id + " chain "
*/
package jalview.ws.dbsources;
-
import com.stevesoft.pat.Regex;
import jalview.datamodel.AlignmentI;
return null;
}
- @Override
+ @Override
public int getTier()
{
return 0;
/**
* test if the source is a reference source for the authority
+ *
* @return
*/
boolean isReferenceSource();
protected MultipleConnectionPropertyProviderI connprops = null;
/**
- * DAS sources are tier 1 - if we have a direct DB connection then we should prefer it
+ * DAS sources are tier 1 - if we have a direct DB connection then we should
+ * prefer it
*/
- private int tier=1;
+ private int tier = 1;
/**
* create a new DbSource proxy for a DAS 1 source
throw new Exception("Source " + source.getTitle()
+ " does not support the sequence command.");
}
- this.tier = 1+((jsrc.isLocal() || jsrc.isReferenceSource()) ? 0 : 1);
+ this.tier = 1 + ((jsrc.isLocal() || jsrc.isReferenceSource()) ? 0 : 1);
this.source = source;
this.dbname = dbname;
this.dbrefname = dbrefname.toUpperCase();
@Override
public boolean isReferenceSource()
{
- // TODO check source object for indication that we are the primary for a DAS coordinate system
+ // TODO check source object for indication that we are the primary for a DAS
+ // coordinate system
return false;
}
}
return null;
} finally
{
- //System.err.println("Took " + (System.currentTimeMillis() - time)
- // / 1000 + " secs for one call.");
+ // System.err.println("Took " + (System.currentTimeMillis() - time)
+ // / 1000 + " secs for one call.");
}
return null;
}
}
-
}
Iterator<Reader> r = jalview.ext.paradise.Annotate3D
.getRNAMLForPDBFileAsString(sb.toString());
- AlignmentI al=null;
+ AlignmentI al = null;
while (r.hasNext())
{
FileParse fp = new InputStreamParser(r.next(), source.getDataName());
AlignmentI nal = new FormatAdapter().readFromFile(fp, "RNAML");
- if (al==null)
+ if (al == null)
{
al = nal;
- } else {
+ }
+ else
+ {
al.append(nal);
}
}
{
return CALC_ID;
}
- private static String CALC_ID="jabaws2.AACon";
+
+ private static String CALC_ID = "jabaws2.AACon";
public static AlignAnalysisUIText getAlignAnalysisUITest()
{
{
private static final String THRESHOLD = "THRESHOLD";
+
private static final String RANGE = "RANGE";
String typeName;
amap.get("Dydx").put(THRESHOLD, new double[]
{ 1, 0 });
amap.get("Dydx").put(RANGE, new float[]
- { -1, +1 });
+ { -1, +1 });
amap.put("SmoothedScore", new HashMap<String, Object>());
amap.get("SmoothedScore").put(INVISIBLE, INVISIBLE);
amap.get("COILS").put(THRESHOLD, new double[]
{ 1, 0.516 });
amap.get("COILS").put(RANGE, new float[]
- { 0, 1 });
+ { 0, 1 });
amap.get("HOTLOOPS").put(THRESHOLD, new double[]
{ 1, 0.6 });
amap.get("HOTLOOPS").put(RANGE, new float[]
- { 0, 1 });
+ { 0, 1 });
amap.get("REM465").put(THRESHOLD, new double[]
{ 1, 0.1204 });
amap.get("REM465").put(RANGE, new float[]
- { 0, 1 });
-
+ { 0, 1 });
annotMap.put(compbio.ws.client.Services.IUPredWS.toString(),
amap = new HashMap<String, Map<String, Object>>());
amap.get("Long").put(THRESHOLD, new double[]
{ 1, 0.5 });
amap.get("Long").put(RANGE, new float[]
- { 0, 1 });
+ { 0, 1 });
amap.get("Short").put(THRESHOLD, new double[]
{ 1, 0.5 });
amap.get("Short").put(RANGE, new float[]
- { 0, 1 });
+ { 0, 1 });
annotMap.put(compbio.ws.client.Services.JronnWS.toString(),
amap = new HashMap<String, Map<String, Object>>());
amap.put("JRonn", new HashMap<String, Object>());
amap.get("JRonn").put(THRESHOLD, new double[]
{ 1, 0.5 });
amap.get("JRonn").put(RANGE, new float[]
- { 0, 1 });
+ { 0, 1 });
}
@Override
{
boolean sameGroup = false;
SequenceI dseq, aseq, seq = seqNames.get(seqId);
- int base = seq.findPosition(start)-1;
+ int base = seq.findPosition(start) - 1;
aseq = seq;
while ((dseq = seq).getDatasetSequence() != null)
{
seq = seq.getDatasetSequence();
}
ScoreHolder scores = null;
- try {
+ try
+ {
scores = scoremanager.getAnnotationForSequence(seqId);
} catch (Exception q)
{
.info("Couldn't recover disorder prediction for sequence "
+ seq.getName()
+ "(Prediction name was "
- + seqId+")"
+ + seqId
+ + ")"
+ "\nSee http://issues.jalview.org/browse/JAL-1319 for one possible reason why disorder predictions might fail.");
}
float last = Float.NaN, val = Float.NaN;
int lastAnnot = ourAnnot.size();
- if (scores!=null && scores.scores!=null) {
+ if (scores != null && scores.scores != null)
+ {
for (Score scr : scores.scores)
{
service.getServiceTypeURI() + "/" + scr.getMethod(),
aseq, base + 1, scr);
annot.graph = AlignmentAnnotation.LINE_GRAPH;
-
- Map<String,Object> styleMap = (annotTypeMap == null) ? null : annotTypeMap.get(scr.getMethod());
-
+
+ Map<String, Object> styleMap = (annotTypeMap == null) ? null
+ : annotTypeMap.get(scr.getMethod());
+
annot.visible = (styleMap == null || styleMap.get(INVISIBLE) == null);
- double[] thrsh = (styleMap==null) ? null
- : (double[]) styleMap.get(
- THRESHOLD);
- float[] range = (styleMap==null) ? null : (float[]) styleMap.get(
- RANGE);
- if (range!=null)
+ double[] thrsh = (styleMap == null) ? null
+ : (double[]) styleMap.get(THRESHOLD);
+ float[] range = (styleMap == null) ? null
+ : (float[]) styleMap.get(RANGE);
+ if (range != null)
{
annot.graphMin = range[0];
annot.graphMax = range[1];
}
- if (styleMap==null || styleMap.get(DONTCOMBINE) == null)
+ if (styleMap == null || styleMap.get(DONTCOMBINE) == null)
{
{
if (!sameGroup)
String[] rgssorton = rgnames.toArray(new String[rgs.size()]);
jalview.util.QuickSort.sort(rgssorton, rgssort);
ArgumentI tmp1;
- int i=0;
- while (rgssort.length-i>i)
+ int i = 0;
+ while (rgssort.length - i > i)
{
- tmp1=rgssort[rgssort.length-i-1];
- rgssort[rgssort.length-i-1] = rgssort[i];
- rgssort[i++]=tmp1;
+ tmp1 = rgssort[rgssort.length - i - 1];
+ rgssort[rgssort.length - i - 1] = rgssort[i];
+ rgssort[i++] = tmp1;
}
return Arrays.asList(rgssort);
}
jabasws2 = true;
srv_set = registry.getSupportedServices();
-
+
// dan test
- System.out.println("registry.getSupportedServices: " + srv_set.toString());
-
+ System.out.println("registry.getSupportedServices: "
+ + srv_set.toString());
+
svccategories = registry.getServiceCategories();
-
+
// dan test
-// System.out.println("registry.getServiceCategories: " + svccategories.toString());
+ // System.out.println("registry.getServiceCategories: " +
+ // svccategories.toString());
}
} catch (Exception ex)
String description = registry.getServiceDescription(srv);
- svc = Jws2InstanceFactory.newJws2Instance(jwsservers, srv.toString(),
- cat.name, description, service);
+ svc = Jws2InstanceFactory.newJws2Instance(jwsservers,
+ srv.toString(), cat.name, description, service);
}
if (svc == null)
{
- svc = Jws2InstanceFactory.newJws2Instance(jwsservers, srv.toString(),
- cat.name, "JABAWS 1 Alignment Service", service);
+ svc = Jws2InstanceFactory.newJws2Instance(jwsservers,
+ srv.toString(), cat.name,
+ "JABAWS 1 Alignment Service", service);
}
jws2Discoverer.addService(jwsservers, svc);
}
{
super(alignViewport, alignPanel);
}
-
-
-
-
+
public JabawsAlignCalcWorker(Jws2Instance service, AlignFrame alignFrame,
WsParamSetI preset, List<Argument> paramset)
{
}
/**
- * Recover any existing parameters for this service
+ * Recover any existing parameters for this service
*/
protected void initViewportParams()
{
*/
public abstract String getCalcId();
-
-
-
@Override
- public void updateParameters(WsParamSetI newpreset, java.util.List<Argument> newarguments)
+ public void updateParameters(WsParamSetI newpreset,
+ java.util.List<Argument> newarguments)
{
super.updateParameters(newpreset, newarguments);
initViewportParams();
{
protected Jws2Instance service;
+
@SuppressWarnings("unchecked")
protected SequenceAnnotation aaservice;
+
protected ScoreManager scoremanager;
+
protected WsParamSetI preset;
+
protected List<Argument> arguments;
+
protected IProgressIndicator guiProgress;
public JabawsCalcWorker(AlignViewportI alignViewport,
* @param newpreset
* @param newarguments
*/
- public void updateParameters(final WsParamSetI newpreset, final List<Argument> newarguments)
+ public void updateParameters(final WsParamSetI newpreset,
+ final List<Argument> newarguments)
{
preset = newpreset;
arguments = newarguments;
return;
}
long progressId = -1;
-
+
int serverErrorsLeft = 3;
-
+
String rslt = "JOB NOT DEFINED";
StringBuffer msg = new StringBuffer();
try
{
return;
}
- List<compbio.data.sequence.FastaSequence> seqs = getInputSequences(alignViewport
- .getAlignment(), bySequence ? alignViewport.getSelectionGroup() : null);
-
+ List<compbio.data.sequence.FastaSequence> seqs = getInputSequences(
+ alignViewport.getAlignment(),
+ bySequence ? alignViewport.getSelectionGroup() : null);
+
if (seqs == null)
{
calcMan.workerComplete(this);
return;
}
-
+
AlignmentAnnotation[] aa = alignViewport.getAlignment()
.getAlignmentAnnotation();
if (guiProgress != null)
{
throw new JobSubmissionException(
"Invalid parameter set. Check Jalview implementation.", x);
-
+
}
}
boolean finished = false;
{
System.err.println("FAILED TO CANCEL AACon job: " + rslt);
}
-
+
} catch (Exception x)
{
-
+
}
-
+
return;
}
long cpos;
stats = aaservice.pullExecStatistics(rslt, rpos);
} catch (Exception x)
{
-
+
if (x.getMessage().contains(
"Position in a file could not be negative!"))
{
rpos = stats.getNextPosition();
}
} while (stats != null && rpos > cpos);
-
+
if (!finished && status.equals(JobStatus.FAILED))
{
try
}
}
}
-
+
catch (JobSubmissionException x)
{
-
+
System.err.println("submission error with " + getServiceActionText()
+ " :");
x.printStackTrace();
System.err.println("collection error:\nJob ID: " + rslt);
x.printStackTrace();
calcMan.workerCannotRun(this);
-
+
} catch (OutOfMemoryError error)
{
calcMan.workerCannotRun(this);
-
+
// consensus = null;
// hconsensus = null;
ap.raiseOOMWarning(getServiceActionText(), error);
} catch (Exception x)
{
calcMan.workerCannotRun(this);
-
+
// consensus = null;
// hconsensus = null;
System.err
x.printStackTrace();
} finally
{
-
+
calcMan.workerComplete(this);
if (ap != null)
{
*/
}
}
-
+
}
@Override
public abstract String getServiceActionText();
protected boolean submitGaps = true;
+
protected boolean alignedSeqs = true;
+
protected boolean nucleotidesAllowed = false;
+
protected boolean proteinAllowed = false;
+
/**
* record sequences for mapping result back to afterwards
*/
protected boolean bySequence = false;
+
protected Map<String, SequenceI> seqNames;
+
protected boolean[] gapMap;
+
int realw;
- int start,end;
- public List<FastaSequence> getInputSequences(AlignmentI alignment, AnnotatedCollectionI inputSeqs)
+ int start, end;
+
+ public List<FastaSequence> getInputSequences(AlignmentI alignment,
+ AnnotatedCollectionI inputSeqs)
{
if (alignment == null || alignment.getWidth() <= 0
- || alignment.getSequences() == null
- || alignment.isNucleotide() ? !nucleotidesAllowed
+ || alignment.getSequences() == null || alignment.isNucleotide() ? !nucleotidesAllowed
: !proteinAllowed)
{
return null;
}
- if (inputSeqs==null || inputSeqs.getWidth()<=0 || inputSeqs.getSequences()==null || inputSeqs.getSequences().size()<1)
+ if (inputSeqs == null || inputSeqs.getWidth() <= 0
+ || inputSeqs.getSequences() == null
+ || inputSeqs.getSequences().size() < 1)
{
inputSeqs = alignment;
}
-
+
List<compbio.data.sequence.FastaSequence> seqs = new ArrayList<compbio.data.sequence.FastaSequence>();
int minlen = 10;
seqNames = new HashMap<String, SequenceI>();
}
gapMap = new boolean[0];
- start=inputSeqs.getStartRes();
- end=inputSeqs.getEndRes();
-
+ start = inputSeqs.getStartRes();
+ end = inputSeqs.getEndRes();
for (SequenceI sq : ((List<SequenceI>) inputSeqs.getSequences()))
{
- if (bySequence ? sq.findPosition(end+1) -sq.findPosition(start+1) > minlen - 1 : sq.getEnd() - sq.getStart() > minlen - 1)
+ if (bySequence ? sq.findPosition(end + 1)
+ - sq.findPosition(start + 1) > minlen - 1 : sq.getEnd()
+ - sq.getStart() > minlen - 1)
{
String newname = SeqsetUtils.unique_name(seqs.size() + 1);
// make new input sequence with or without gaps
{
seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,
AlignSeq.extractGaps(jalview.util.Comparison.GapChars,
- sq.getSequenceAsString(start,end+1))));
+ sq.getSequenceAsString(start, end + 1))));
}
if (seq.getSequence().length() > ln)
{
{
ap.paintAlignment(false);
}
-
+
Thread.sleep(200);
} catch (Exception ex)
{
return false;
}
- protected void createAnnotationRowsForScores(List<AlignmentAnnotation> ourAnnot, String calcId,
- int alWidth, Score scr)
+ protected void createAnnotationRowsForScores(
+ List<AlignmentAnnotation> ourAnnot, String calcId, int alWidth,
+ Score scr)
{
// simple annotation row
AlignmentAnnotation annotation = alignViewport.getAlignment()
}
}
- protected AlignmentAnnotation createAnnotationRowsForScores(List<AlignmentAnnotation> ourAnnot, String typeName,
+ protected AlignmentAnnotation createAnnotationRowsForScores(
+ List<AlignmentAnnotation> ourAnnot, String typeName,
String calcId, SequenceI dseq, int base, Score scr)
{
System.out.println("Creating annotation on dseq:" + dseq.getStart()
return annotation;
}
- private void constructAnnotationFromScore(AlignmentAnnotation annotation, int base,
- int alWidth, Score scr)
+ private void constructAnnotationFromScore(AlignmentAnnotation annotation,
+ int base, int alWidth, Score scr)
{
Annotation[] elm = new Annotation[alWidth];
Iterator<Float> vals = scr.getScores().iterator();
}
elm[i] = new Annotation("", "" + val, ' ', val);
}
-
+
annotation.annotations = elm;
annotation.belowAlignment = true;
if (x < 0)
}
}
our.clear();
-
+
ap.adjustAnnotationHeight();
}
}
: new WsJobParameters(sh, preset);
if (adjustingExisting)
{
- jobParams.setName(MessageManager.getString("label.adjusting_parameters_for_calculation"));
+ jobParams.setName(MessageManager
+ .getString("label.adjusting_parameters_for_calculation"));
}
if (!jobParams.showRunDialog())
{
Cache.log.debug("Old discovery thread has finished.");
}
running = true;
-
+
// first set up exclusion list if needed
final Set<String> ignoredServices = new HashSet<String>();
- for (String ignored:jalview.bin.Cache.getDefault("IGNORED_JABAWS_SERVICETYPES", Services.JpredWS.toString()).split("\\|"))
+ for (String ignored : jalview.bin.Cache.getDefault(
+ "IGNORED_JABAWS_SERVICETYPES", Services.JpredWS.toString())
+ .split("\\|"))
{
ignoredServices.add(ignored);
}
-
changeSupport.firePropertyChange("services", services, new Vector());
oldthread = Thread.currentThread();
try
;
for (JabaWsServerQuery squery : qrys)
{
- if (squery.isRunning()){
- finished=false;
+ if (squery.isRunning())
+ {
+ finished = false;
}
}
if (aborted)
if (submitGaps == true)
{
action = "Realign ";
- msawsmenu = new JMenu(MessageManager.formatMessage("label.realign_with_params", new String[]{svcname}));
- msawsmenu
- .setToolTipText(MessageManager.getString("label.align_sequences_to_existing_alignment"));
+ msawsmenu = new JMenu(MessageManager.formatMessage(
+ "label.realign_with_params", new String[]
+ { svcname }));
+ msawsmenu.setToolTipText(MessageManager
+ .getString("label.align_sequences_to_existing_alignment"));
rmsawsmenu.add(msawsmenu);
}
final boolean withGaps = submitGaps;
- JMenuItem method = new JMenuItem(MessageManager.formatMessage("label.calcname_with_default_settings", new String[]{calcName}));
- method.setToolTipText(MessageManager.formatMessage("label.action_with_default_settings", new String[]{action}));
+ JMenuItem method = new JMenuItem(MessageManager.formatMessage(
+ "label.calcname_with_default_settings", new String[]
+ { calcName }));
+ method.setToolTipText(MessageManager.formatMessage(
+ "label.action_with_default_settings", new String[]
+ { action }));
method.addActionListener(new ActionListener()
{
{
// only add these menu options if the service has user-modifiable
// arguments
- method = new JMenuItem(MessageManager.getString("label.edit_settings_and_run"));
- method.setToolTipText(MessageManager.getString("label.view_and_change_parameters_before_alignment"));
+ method = new JMenuItem(
+ MessageManager.getString("label.edit_settings_and_run"));
+ method.setToolTipText(MessageManager
+ .getString("label.view_and_change_parameters_before_alignment"));
method.addActionListener(new ActionListener()
{
List<WsParamSetI> presets = service.getParamStore().getPresets();
if (presets != null && presets.size() > 0)
{
- JMenu presetlist = new JMenu(MessageManager.formatMessage("label.run_with_preset_params", new String[]{calcName}));
+ JMenu presetlist = new JMenu(MessageManager.formatMessage(
+ "label.run_with_preset_params", new String[]
+ { calcName }));
for (final WsParamSetI preset : presets)
{
}
wsInfo.setProgressText(jobs[job].getJobnum(), OutputHeader
+ cancelledMessage + "\n");
- } else {
+ }
+ else
+ {
// if we hadn't submitted then just mark the job as cancelled.
jobs[job].setSubjobComplete(true);
- wsInfo.setStatus(jobs[job].getJobnum(), WebserviceInfo.STATE_CANCELLED_OK);
-
+ wsInfo.setStatus(jobs[job].getJobnum(),
+ WebserviceInfo.STATE_CANCELLED_OK);
+
}
}
if (cancelled)
/**
* Client for the JABA RNA Alifold Service
+ *
* @author daluke - Daniel Barton
- *
+ *
*/
public class RNAalifoldClient extends JabawsAlignCalcWorker implements
{
super(sh, alignFrame, preset, paramset);
- //if (arguments == null)
- // arguments = new ArrayList<Argument>();
+ // if (arguments == null)
+ // arguments = new ArrayList<Argument>();
af = alignFrame;
methodName = sh.serviceType;
- alignedSeqs=true;
- submitGaps=true;
+ alignedSeqs = true;
+ submitGaps = true;
nucleotidesAllowed = true;
proteinAllowed = false;
initViewportParams();
}
-
+
public String getCalcId()
{
return CALC_ID;
}
- private static String CALC_ID="jalview.ws.jws2.RNAalifoldClient";
+
+ private static String CALC_ID = "jalview.ws.jws2.RNAalifoldClient";
public static AlignAnalysisUIText getAlignAnalysisUITest()
{
private AlignmentAnnotation constructAnnotationFromScoreHolder(
AlignmentAnnotation annotation, String struct, TreeSet<Score> data)
{
- Annotation[] anns = new Annotation[gapMap!= null ? gapMap.length+1 : struct.length()];
+ Annotation[] anns = new Annotation[gapMap != null ? gapMap.length + 1
+ : struct.length()];
if (data != null
&& data.size() > 1
basePairs.put(score.getRanges().first(), new Float(score
.getScores().get(0)));
}
-
- for (int i = 0,ri=0,iEnd=struct.length();i<iEnd; i++,ri++)
+
+ for (int i = 0, ri = 0, iEnd = struct.length(); i < iEnd; i++, ri++)
{
- if (gapMap!=null)
+ if (gapMap != null)
{
// skip any gapped columns in the input data
while (!gapMap[ri])
}
else if (data == null || data.size() == 1)
{
- for (int i = 0,ri=0,iEnd=struct.length();i<iEnd; i++,ri++)
+ for (int i = 0, ri = 0, iEnd = struct.length(); i < iEnd; i++, ri++)
{
- if (gapMap!=null)
+ if (gapMap != null)
{
// skip any gapped columns in the input data
- while (!gapMap[ri] && ri<gapMap.length)
+ while (!gapMap[ri] && ri < gapMap.length)
{
ri++;
}
- if (ri==gapMap.length)
+ if (ri == gapMap.length)
{
break;
}
initSequenceAnnotationWSClient(sh, alignFrame, preset, editParams);
}
- // dan think. Do I need to change this method to run RNAalifold through the GUI
-
+ // dan think. Do I need to change this method to run RNAalifold through the
+ // GUI
+
public void initSequenceAnnotationWSClient(final Jws2Instance sh,
AlignFrame alignFrame, WsParamSetI preset, boolean editParams)
{
- // dan changed! dan test. comment out if conditional
-// if (alignFrame.getViewport().getAlignment().isNucleotide())
-// {
-// JOptionPane.showMessageDialog(Desktop.desktop, sh.serviceType
-// + " can only be used\nfor amino acid alignments.",
-// "Wrong type of sequences!", JOptionPane.WARNING_MESSAGE);
-// return;
-//
-// }
+ // dan changed! dan test. comment out if conditional
+ // if (alignFrame.getViewport().getAlignment().isNucleotide())
+ // {
+ // JOptionPane.showMessageDialog(Desktop.desktop, sh.serviceType
+ // + " can only be used\nfor amino acid alignments.",
+ // "Wrong type of sequences!", JOptionPane.WARNING_MESSAGE);
+ // return;
+ //
+ // }
AlignAnalysisUIText aaui = sh.getAlignAnalysisUI();
- if (aaui!=null)
+ if (aaui != null)
{
Class clientClass = aaui.getClient();
-
+
// Build an AACon style client - take alignment, return annotation for
// columns
List<AlignCalcWorkerI> clnts = alignFrame.getViewport()
- .getCalcManager()
- .getRegisteredWorkersOfClass(clientClass);
+ .getCalcManager().getRegisteredWorkersOfClass(clientClass);
JabawsAlignCalcWorker worker;
if (clnts == null || clnts.size() == 0)
{
{
return;
}
- try {
- worker = (JabawsAlignCalcWorker) (clientClass.getConstructor(
- new Class[] { Jws2Instance.class,
- AlignFrame.class, WsParamSetI.class,
- List.class }).newInstance(new Object[] { sh, alignFrame, this.preset, paramset}));
+ try
+ {
+ worker = (JabawsAlignCalcWorker) (clientClass
+ .getConstructor(new Class[]
+ { Jws2Instance.class, AlignFrame.class,
+ WsParamSetI.class, List.class })
+ .newInstance(new Object[]
+ { sh, alignFrame, this.preset, paramset }));
} catch (Exception x)
{
x.printStackTrace();
- throw new Error("Implementation error",x);
+ throw new Error("Implementation error", x);
}
- alignFrame
- .getViewport()
- .getCalcManager()
- .registerWorker(
- worker);
+ alignFrame.getViewport().getCalcManager().registerWorker(worker);
alignFrame.getViewport().getCalcManager().startWorker(worker);
}
public void attachWSMenuEntry(JMenu wsmenu, final Jws2Instance service,
final AlignFrame alignFrame)
{
- if (registerAAConWSInstance(wsmenu, service, alignFrame)) {
+ if (registerAAConWSInstance(wsmenu, service, alignFrame))
+ {
// Alignment dependent analysis calculation WS gui
return;
}
String calcName = service.serviceType.substring(0,
service.serviceType.length() - 2);
- JMenuItem annotservice = new JMenuItem(MessageManager.formatMessage("label.calcname_with_default_settings", new String[]{calcName}));
+ JMenuItem annotservice = new JMenuItem(MessageManager.formatMessage(
+ "label.calcname_with_default_settings", new String[]
+ { calcName }));
annotservice.addActionListener(new ActionListener()
{
{
// only add these menu options if the service has user-modifiable
// arguments
- annotservice = new JMenuItem(MessageManager.getString("label.edit_settings_and_run"));
+ annotservice = new JMenuItem(
+ MessageManager.getString("label.edit_settings_and_run"));
annotservice
- .setToolTipText(MessageManager.getString("label.view_and_change_parameters_before_running_calculation"));
+ .setToolTipText(MessageManager
+ .getString("label.view_and_change_parameters_before_running_calculation"));
annotservice.addActionListener(new ActionListener()
{
}
else
{
- annotservice = new JMenuItem(MessageManager.getString("label.view_documentation"));
+ annotservice = new JMenuItem(
+ MessageManager.getString("label.view_documentation"));
if (service.docUrl != null)
{
annotservice.addActionListener(new ActionListener()
}
}
-
private boolean registerAAConWSInstance(final JMenu wsmenu,
final Jws2Instance service, final AlignFrame alignFrame)
{
- final AlignAnalysisUIText aaui = service.getAlignAnalysisUI(); // null ; // AlignAnalysisUIText.aaConGUI.get(service.serviceType.toString());
- if (aaui==null)
+ final AlignAnalysisUIText aaui = service.getAlignAnalysisUI(); // null ; //
+ // AlignAnalysisUIText.aaConGUI.get(service.serviceType.toString());
+ if (aaui == null)
{
// not an instantaneous calculation GUI type service
return false;
}
- // create the instaneous calculation GUI bits and update state if existing GUI elements already present
-
+ // create the instaneous calculation GUI bits and update state if existing
+ // GUI elements already present
+
JCheckBoxMenuItem _aaConEnabled = null;
for (int i = 0; i < wsmenu.getItemCount(); i++)
{
.getRegisteredWorkersOfClass(aaui.getClient());
if (aaconClient != null && aaconClient.size() > 0)
{
- JabawsAlignCalcWorker worker = (JabawsAlignCalcWorker) aaconClient.get(0);
+ JabawsAlignCalcWorker worker = (JabawsAlignCalcWorker) aaconClient
+ .get(0);
if (!worker.service.hosturl.equals(service.hosturl))
{
// javax.swing.SwingUtilities.invokeLater(new Runnable()
aaui.getAAconToggle());
aaConEnabled.setToolTipText("<html><p>"
- + JvSwingUtils.wrapTooltip(aaui.getAAconToggleTooltip() + "</p>")
- + "</html>");
+ + JvSwingUtils.wrapTooltip(aaui.getAAconToggleTooltip()
+ + "</p>") + "</html>");
aaConEnabled.addActionListener(new ActionListener()
{
@Override
wsmenu.add(aaConEnabled);
final JMenuItem modifyParams = new JMenuItem(aaui.getAAeditSettings());
modifyParams.setToolTipText("<html><p>"
- + JvSwingUtils.wrapTooltip(aaui.getAAeditSettingsTooltip() + "</p>")
- + "</html>");
+ + JvSwingUtils.wrapTooltip(aaui.getAAeditSettingsTooltip()
+ + "</p>") + "</html>");
modifyParams.addActionListener(new ActionListener()
{
public void menuSelected(MenuEvent arg0)
{
// TODO: refactor to the implementing class.
- if (alignFrame.getViewport().getAlignment()
- .isNucleotide() ? aaui.isNa() : aaui.isPr()) {
+ if (alignFrame.getViewport().getAlignment().isNucleotide() ? aaui
+ .isNa() : aaui.isPr())
+ {
aaConEnabled.setEnabled(true);
modifyParams.setEnabled(true);
}
- else {
+ else
+ {
aaConEnabled.setEnabled(false);
modifyParams.setEnabled(false);
}
return true;
}
- private static void showAAConAnnotationSettingsFor(final AlignAnalysisUIText aaui, AlignFrame alignFrame)
+ private static void showAAConAnnotationSettingsFor(
+ final AlignAnalysisUIText aaui, AlignFrame alignFrame)
{
/*
* preferred settings Whether AACon is automatically recalculated Which
}
- private static void buildCurrentAAConWorkerFor(final AlignAnalysisUIText aaui, AlignFrame alignFrame)
+ private static void buildCurrentAAConWorkerFor(
+ final AlignAnalysisUIText aaui, AlignFrame alignFrame)
{
buildCurrentAAConWorkerFor(aaui, alignFrame, null);
}
- private static void buildCurrentAAConWorkerFor(final AlignAnalysisUIText aaui, AlignFrame alignFrame,
+ private static void buildCurrentAAConWorkerFor(
+ final AlignAnalysisUIText aaui, AlignFrame alignFrame,
Jws2Instance service)
{
/*
new SequenceAnnotationWSClient(fave, alignFrame, false);
}
- private static AAConSettings createDefaultAAConSettings(AlignAnalysisUIText aaui)
+ private static AAConSettings createDefaultAAConSettings(
+ AlignAnalysisUIText aaui)
{
return createDefaultAAConSettings(aaui, null);
}
- private static AAConSettings createDefaultAAConSettings(AlignAnalysisUIText aaui,
- Jws2Instance service)
+ private static AAConSettings createDefaultAAConSettings(
+ AlignAnalysisUIText aaui, Jws2Instance service)
{
if (service != null)
{
return new AAConSettings(true, service, null, null);
}
- private static void removeCurrentAAConWorkerFor(AlignAnalysisUIText aaui, AlignFrame alignFrame)
+ private static void removeCurrentAAConWorkerFor(AlignAnalysisUIText aaui,
+ AlignFrame alignFrame)
{
alignFrame.getViewport().getCalcManager()
.removeRegisteredWorkersOfClass(aaui.getClient());
@Override
public URL getFurtherDetails()
{
- try {
- return new URL(opt.getBasicURL().toExternalForm()+"/"+opt.getFurtherDetails());
- }
- catch (NullPointerException q) {}
- catch (MalformedURLException q)
+ try
+ {
+ return new URL(opt.getBasicURL().toExternalForm() + "/"
+ + opt.getFurtherDetails());
+ } catch (NullPointerException q)
{
-
+ } catch (MalformedURLException q)
+ {
+
}
return null;
}
/**
*
- * @param hosturl Service endpoint
- * @param serviceType Category for this service's analysis
- * @param action text describing their action that service performs (eg 'aligning', 'analysing')
- * @param description Description from JABAWS registry
- * @param service JABAWS registry ID for service
+ * @param hosturl
+ * Service endpoint
+ * @param serviceType
+ * Category for this service's analysis
+ * @param action
+ * text describing their action that service performs (eg 'aligning',
+ * 'analysing')
+ * @param description
+ * Description from JABAWS registry
+ * @param service
+ * JABAWS registry ID for service
*/
public Jws2Instance(String hosturl, String serviceType, String action,
String description, JABAService service)
{
return "java:" + serviceType;
}
+
jalview.ws.uimodel.AlignAnalysisUIText aaui;
+
public jalview.ws.uimodel.AlignAnalysisUIText getAlignAnalysisUI()
{
return aaui;
public class Jws2InstanceFactory
{
private static HashMap<String, AlignAnalysisUIText> aaConGUI;
+
private static String category_rewrite(String cat_name)
{
- return (cat_name != null && cat_name.equals("Prediction")) ? "Secondary Structure Prediction" : cat_name;
+ return (cat_name != null && cat_name.equals("Prediction")) ? "Secondary Structure Prediction"
+ : cat_name;
}
+
private static void init()
{
if (aaConGUI == null)
JABAService service)
{
init();
- Jws2Instance svc = new Jws2Instance(jwsservers, serviceType, category_rewrite(name),
- description, service);
-
+ Jws2Instance svc = new Jws2Instance(jwsservers, serviceType,
+ category_rewrite(name), description, service);
+
svc.aaui = aaConGUI.get(serviceType.toString());
return svc;
}
*/
package jalview.ws.params;
-
/**
* Interface implemented by classes for maintaining user's parameters in a
* Jalview session
{
this(service2, alignFrame, false);
}
+
boolean headless = false;
- public RestClient(RestServiceDescription service2, AlignFrame alignFrame, boolean nogui)
+
+ public RestClient(RestServiceDescription service2, AlignFrame alignFrame,
+ boolean nogui)
{
service = service2;
af = alignFrame;
* informative name for results
*/
public String viewTitle;
+
protected void constructJob()
{
service.setInvolvesFlags();
if (jobsthread.isValid())
{
setWebserviceInfo(headless);
- if (!headless) {
+ if (!headless)
+ {
wsInfo.setthisService(this);
jobsthread.setWebServiceInfo(wsInfo);
}
// get sequences for the alignmentI
// get groups trimmed to alignment columns
// get any annotation trimmed to start/end columns, too.
- squniq = jalview.analysis.SeqsetUtils.uniquify(_input.getSequencesArray(), true);
+ squniq = jalview.analysis.SeqsetUtils.uniquify(
+ _input.getSequencesArray(), true);
// prepare input
// form alignment+groups+annotation,preprocess and then record references
// for formatters
ArrayList<InputType> alinp = new ArrayList<InputType>();
int paramsWithData = 0;
- // TODO: JAL-715 - generalise the following validation logic for all parameter types
+ // TODO: JAL-715 - generalise the following validation logic for all
+ // parameter types
// we cheat for moment - since we know a-priori what data is available and
// what inputs we have implemented so far
for (Map.Entry<String, InputType> prm : rsd.inputParams.entrySet())
&& _input.getGroups() != null
&& _input.getGroups().size() >= -1 + prm.getValue().min)
{
- // the test above is not rigorous but fixes JAL-1298, since submission will fail if the partition set doesn't contain at least one partition
+ // the test above is not rigorous but fixes JAL-1298, since
+ // submission will fail if the partition set doesn't contain at
+ // least one partition
alinp.add(prm.getValue());
}
else
// assume that alignment is properly ordered so groups form consecutive
// blocks
ArrayList<int[]> gl = new ArrayList<int[]>();
- int p = 0,lowest=al.getHeight(), highest=0;
+ int p = 0, lowest = al.getHeight(), highest = 0;
List<SequenceGroup> sgs;
synchronized (sgs = al.getGroups())
{
for (SequenceI sq : sg.getSequencesInOrder(al))
{
p = al.findIndex(sq);
- if (lowest>p)
+ if (lowest > p)
{
- lowest=p;
+ lowest = p;
}
- if (highest<p)
+ if (highest < p)
{
- highest=p;
+ highest = p;
}
if (se == null)
{
// remaining group ? - these might be at the start or the end
if (gl.size() > 0)
{
- if (lowest-1>minsize)
+ if (lowest - 1 > minsize)
{
gl.add(0, new int[]
- { 0, lowest-2});
+ { 0, lowest - 2 });
}
- if ((al.getHeight()-1-highest)>minsize)
+ if ((al.getHeight() - 1 - highest) > minsize)
{
- gl.add(new int[] { highest+1, al.getHeight()-1});
+ gl.add(new int[]
+ { highest + 1, al.getHeight() - 1 });
}
}
else
DbSourceProxy[] l = dblist.values().toArray(new DbSourceProxy[0]);
int i = 0;
String[] nm = new String[l.length];
- // make sure standard dbs appear first, followed by reference das sources, followed by anything else.
+ // make sure standard dbs appear first, followed by reference das sources,
+ // followed by anything else.
for (DbSourceProxy s : l)
{
- nm[i++] = ""+s.getTier()+s.getDbName().toLowerCase();
+ nm[i++] = "" + s.getTier() + s.getDbName().toLowerCase();
}
jalview.util.QuickSort.sort(nm, l);
dbs = new ArrayList<DbSourceProxy>();
/**
* Tier for this data source
- *
+ *
* @return 0 - primary datasource, 1 - das primary source, 2 - secondary
*/
public int getTier();
+ "GCTACAACCATCCCTTCAGACAGGATCAGAAGAACTTAAATCATTATATAATACAGTAGCAACCCTCTATTG\n"
+ "TGTACATCAAAGGATAGAGATAAAAGACACCAAGGAAGCTTTAGAA\n";
-
@Test
public void translationWithUntranslatableCodonsTest()
{
jalview.datamodel.AlignmentI alf = null;
try
{
- alf = new jalview.io.FormatAdapter().readFile(JAL_1312_example_align_fasta,
- jalview.io.FormatAdapter.PASTE, "FASTA");
+ alf = new jalview.io.FormatAdapter().readFile(
+ JAL_1312_example_align_fasta, jalview.io.FormatAdapter.PASTE,
+ "FASTA");
} catch (IOException x)
{
x.printStackTrace();
/**
* Test the alignment -> Mapping routines
+ *
* @author jimp
- *
+ *
*/
public class TestAlignSeq
{
- SequenceI s1,s2,s3;
+ SequenceI s1, s2, s3;
+
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception
{
- s1 = new Sequence("Seq1","ASDFAQQQRRRSSS");
+ s1 = new Sequence("Seq1", "ASDFAQQQRRRSSS");
s1.setStart(3);
- s2 = new Sequence("Seq2","ASDFA");
+ s2 = new Sequence("Seq2", "ASDFA");
s2.setStart(5);
- s3 = new Sequence("Seq1","SDFAQQQSSS");
+ s3 = new Sequence("Seq1", "SDFAQQQSSS");
}
*/
public void TestGetMappingForS1()
{
- jalview.analysis.AlignSeq as = jalview.analysis.AlignSeq.doGlobalNWAlignment(s1, s2, AlignSeq.PEP);
- System.out.println("s1: "+as.getAStr1());
- System.out.println("s2: "+as.getAStr2());
-
- Mapping s1tos2=as.getMappingFromS1(false);
+ jalview.analysis.AlignSeq as = jalview.analysis.AlignSeq
+ .doGlobalNWAlignment(s1, s2, AlignSeq.PEP);
+ System.out.println("s1: " + as.getAStr1());
+ System.out.println("s2: " + as.getAStr2());
+
+ Mapping s1tos2 = as.getMappingFromS1(false);
System.out.println(s1tos2.getMap().toString());
- for (int i=s2.getStart();i<s2.getEnd();i++)
+ for (int i = s2.getStart(); i < s2.getEnd(); i++)
{
- System.out.println("Position in s2: "+i +" maps to position in s1: "+s1tos2.getPosition(i));
- assertTrue("",s2.getCharAt(i)==s1.getCharAt(s1tos2.getPosition(i)));
+ System.out.println("Position in s2: " + i
+ + " maps to position in s1: " + s1tos2.getPosition(i));
+ assertTrue("", s2.getCharAt(i) == s1.getCharAt(s1tos2.getPosition(i)));
}
}
public static void tearDownAfterClass() throws Exception
{
}
-/***
- * from http://stackoverflow.com/questions/808276/how-to-add-a-timeout-value-when-using-javas-runtime-exec
- * @author jimp
- *
- */
-private static class Worker extends Thread {
- private final Process process;
- private Integer exit;
- private Worker(Process process) {
- this.process = process;
- }
- public void run() {
- try {
- exit = process.waitFor();
- } catch (InterruptedException ignore) {
- return;
+
+ /***
+ * from
+ * http://stackoverflow.com/questions/808276/how-to-add-a-timeout-value-when
+ * -using-javas-runtime-exec
+ *
+ * @author jimp
+ *
+ */
+ private static class Worker extends Thread
+ {
+ private final Process process;
+
+ private Integer exit;
+
+ private Worker(Process process)
+ {
+ this.process = process;
+ }
+
+ public void run()
+ {
+ try
+ {
+ exit = process.waitFor();
+ } catch (InterruptedException ignore)
+ {
+ return;
+ }
}
}
-}
-private Worker jalviewDesktopRunner(boolean withAwt, String cmd, int timeout) throws InterruptedException, IOException
+
+ private Worker jalviewDesktopRunner(boolean withAwt, String cmd,
+ int timeout) throws InterruptedException, IOException
{
- String _cmd = "java "+(withAwt ? "-Djava.awt.headless=true":"")+" -Djava.ext.dirs=./lib -classpath ./classes jalview.bin.Jalview ";
- System.out.println("###############Jalview CMD: " + _cmd+cmd);
- Process ls2_proc = Runtime.getRuntime().exec(_cmd+cmd);
+ String _cmd = "java "
+ + (withAwt ? "-Djava.awt.headless=true" : "")
+ + " -Djava.ext.dirs=./lib -classpath ./classes jalview.bin.Jalview ";
+ System.out.println("###############Jalview CMD: " + _cmd + cmd);
+ Process ls2_proc = Runtime.getRuntime().exec(_cmd + cmd);
BufferedReader outputReader = new BufferedReader(new InputStreamReader(
ls2_proc.getInputStream()));
}
return worker;
}
+
@Test
public void testHeadlessModeEPS() throws Exception
{
- String[] headlessArgs=new String[] { "nodisplay","headless","nogui"};
- for (String _harg:headlessArgs)
+ String[] headlessArgs = new String[]
+ { "nodisplay", "headless", "nogui" };
+ for (String _harg : headlessArgs)
{
- boolean _switch=false,withAwt=false;
- do {
+ boolean _switch = false, withAwt = false;
+ do
+ {
if (_switch)
{
- withAwt=true;
+ withAwt = true;
+ }
+ _switch = true;
+ String jalview_input = "examples/uniref50.fa";
+ String jalview_output = "test_uniref50_out.eps";
+ String cmd = "" + _harg + " -open " + jalview_input + " -eps "
+ + jalview_output;
+ String harg = _harg
+ + (withAwt ? "-Djava.awt.headless=true"
+ : " NO AWT.HEADLESS");
+ System.out.println("Testing with Headless argument: '" + harg
+ + "'\n");
+ Worker worker = jalviewDesktopRunner(withAwt, cmd, 9000);
+ assertTrue("Didn't create an output EPS file.[" + harg + "]",
+ new File("test_uniref50_out.eps").exists());
+ assertTrue("Didn't create an EPS file with any content[" + harg
+ + "]", new File("test_uniref50_out.eps").length() > 4096);
+ if (worker.exit == null)
+ {
+ worker.interrupt();
+ Thread.currentThread().interrupt();
+ worker.process.destroy();
+ fail("Jalview did not exit after EPS generation (try running test again to verify - timeout at 9000ms). ["
+ + harg + "]");
}
- _switch=true;
- String jalview_input = "examples/uniref50.fa";
- String jalview_output = "test_uniref50_out.eps";
- String cmd = ""+_harg+" -open "+ jalview_input + " -eps " + jalview_output;
- String harg = _harg+(withAwt ? "-Djava.awt.headless=true":" NO AWT.HEADLESS");
- System.out.println("Testing with Headless argument: '"+harg+"'\n");
- Worker worker = jalviewDesktopRunner(withAwt, cmd, 9000);
- assertTrue("Didn't create an output EPS file.["+harg+"]", new File("test_uniref50_out.eps").exists());
- assertTrue("Didn't create an EPS file with any content["+harg+"]", new File("test_uniref50_out.eps").length()>4096);
- if (worker.exit == null){
- worker.interrupt();
- Thread.currentThread().interrupt();
- worker.process.destroy();
- fail("Jalview did not exit after EPS generation (try running test again to verify - timeout at 9000ms). ["+harg+"]");
+ } while (!withAwt);
}
- } while (!withAwt);
- }
}
-// @Test
-// public void testJalview2XMLDataset() throws Exception
-// {
-// String jalview_input = "examples/uniref50.fa";
-// String jalview_output = "test_uniref50_out.eps";
-// String cmd = ""+" -open "+ jalview_input + " -eps " + jalview_output;
-// //String harg = _harg+(withAwt ? "-Djava.awt.headless=true":" NO AWT.HEADLESS");
-// System.out.println("Testing with Headless argument: '"+harg+"'\n");
-// Worker worker = jalviewDesktopRunner(withAwt, cmd, 9000);
-// assertTrue("Didn't create an output EPS file.["+harg+"]", new File("test_uniref50_out.eps").exists());
-// assertTrue("Didn't create an EPS file with any content["+harg+"]", new File("test_uniref50_out.eps").length()>4096);
-// if (worker.exit == null){
-// worker.interrupt();
-// Thread.currentThread().interrupt();
-// worker.process.destroy();
-// fail("Jalview did not exit after EPS generation (try running test again to verify - timeout at 9000ms). ["+harg+"]");
-// }
-// }
+ // @Test
+ // public void testJalview2XMLDataset() throws Exception
+ // {
+ // String jalview_input = "examples/uniref50.fa";
+ // String jalview_output = "test_uniref50_out.eps";
+ // String cmd = ""+" -open "+ jalview_input + " -eps " + jalview_output;
+ // //String harg = _harg+(withAwt ?
+ // "-Djava.awt.headless=true":" NO AWT.HEADLESS");
+ // System.out.println("Testing with Headless argument: '"+harg+"'\n");
+ // Worker worker = jalviewDesktopRunner(withAwt, cmd, 9000);
+ // assertTrue("Didn't create an output EPS file.["+harg+"]", new
+ // File("test_uniref50_out.eps").exists());
+ // assertTrue("Didn't create an EPS file with any content["+harg+"]", new
+ // File("test_uniref50_out.eps").length()>4096);
+ // if (worker.exit == null){
+ // worker.interrupt();
+ // Thread.currentThread().interrupt();
+ // worker.process.destroy();
+ // fail("Jalview did not exit after EPS generation (try running test again to verify - timeout at 9000ms). ["+harg+"]");
+ // }
+ // }
}
/**
* @author jimp
- *
+ *
*/
public class PDBFileWithJmolTest
{
@Test
public void test() throws Exception
{
- PDBFileWithJmol jtest=new PDBFileWithJmol("./examples/1GAQ.txt", jalview.io.AppletFormatAdapter.FILE);
- Vector<SequenceI> seqs=jtest.getSeqs();
-
- assertTrue("No sequences extracted from testfile\n"+(jtest.hasWarningMessage() ? jtest.getWarningMessage(): "(No warnings raised)"), seqs!=null && seqs.size()>0);
- for (SequenceI sq:seqs)
+ PDBFileWithJmol jtest = new PDBFileWithJmol("./examples/1GAQ.txt",
+ jalview.io.AppletFormatAdapter.FILE);
+ Vector<SequenceI> seqs = jtest.getSeqs();
+
+ assertTrue(
+ "No sequences extracted from testfile\n"
+ + (jtest.hasWarningMessage() ? jtest.getWarningMessage()
+ : "(No warnings raised)"),
+ seqs != null && seqs.size() > 0);
+ for (SequenceI sq : seqs)
{
- AlignmentI al = new Alignment(new SequenceI[] { sq});
+ AlignmentI al = new Alignment(new SequenceI[]
+ { sq });
if (!al.isNucleotide())
{
- assertTrue("No secondary structure assigned for protein sequence.",sq.getAnnotation()!=null && sq.getAnnotation().length>=1 && sq.getAnnotation()[0].hasIcons);
+ assertTrue(
+ "No secondary structure assigned for protein sequence.",
+ sq.getAnnotation() != null
+ && sq.getAnnotation().length >= 1
+ && sq.getAnnotation()[0].hasIcons);
}
}
}
@Test
public void test1GIDbyId() throws Exception
{
- // use same ID as standard tests given at https://bitbucket.org/fjossinet/pyrna-rest-clients
+ // use same ID as standard tests given at
+ // https://bitbucket.org/fjossinet/pyrna-rest-clients
Iterator<Reader> ids = Annotate3D.getRNAMLForPDBId("1GID");
assertTrue("Didn't retrieve 1GID by id.", ids != null);
- testRNAMLcontent(ids,null);
+ testRNAMLcontent(ids, null);
}
@Test
assertTrue("No data returned by Annotate3D", sb.length() > 0);
AlignmentI al = new FormatAdapter().readFile(sb.toString(),
FormatAdapter.PASTE, "RNAML");
- if (al==null || al.getHeight()==0) {
+ if (al == null || al.getHeight() == 0)
+ {
System.out.println(sb.toString());
}
assertTrue("No alignment returned.", al != null);
public static void tearDownAfterClass() throws Exception
{
}
- volatile boolean finish=false;
+
+ volatile boolean finish = false;
@Test
public void test()
Cache.initLogger();
// final Desktop foo = new Desktop();
final JFrame cfoo = new JFrame("Crash Java");
- final JDesktopPane foo=new JDesktopPane();
- foo.setPreferredSize(new Dimension(600,800));
+ final JDesktopPane foo = new JDesktopPane();
+ foo.setPreferredSize(new Dimension(600, 800));
cfoo.setSize(600, 800);
final JInternalFrame cont = new JInternalFrame("My Frame");
JTextArea evt;
cont.setPreferredSize(new Dimension(400, 300));
- cont.add(evt=new JTextArea("Click here and drag text over this window to freeze java.\n\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\n"));
+ cont.add(evt = new JTextArea(
+ "Click here and drag text over this window to freeze java.\n\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\n"));
cont.pack();
- foo.add("A frame",cont);
+ foo.add("A frame", cont);
foo.setVisible(true);
foo.setEnabled(true);
foo.doLayout();
cfoo.add(foo);
final JMenu jm = new JMenu("Do");
- JMenuItem jmi=new JMenuItem("this");
+ JMenuItem jmi = new JMenuItem("this");
jm.add(jmi);
evt.addMouseListener(new MouseListener()
{
-
+
@Override
public void mouseReleased(MouseEvent e)
{
}
-
+
@Override
public void mousePressed(MouseEvent e)
{
// TODO Auto-generated method stub
-
+
}
-
+
@Override
public void mouseExited(MouseEvent e)
{
// TODO Auto-generated method stub
-
+
}
-
+
@Override
public void mouseEntered(MouseEvent e)
{
// TODO Auto-generated method stub
-
+
}
-
+
@Override
public void mouseClicked(MouseEvent e)
{
-// JFrame parent = new JFrame();
-// parent.setBounds(foo.getBounds());
-// JPanel oo = new JPanel();
-// parent.add(oo);
-// oo.setVisible(true);
-// parent.setVisible(true);
- EditNameDialog end =new EditNameDialog("Sequence Name", "Sequence Description","label 1", "Label 2", "Try and drag between the two text fields", foo);//);cont.getRootPane());
- assert(end!=null);
- finish=true;
+ // JFrame parent = new JFrame();
+ // parent.setBounds(foo.getBounds());
+ // JPanel oo = new JPanel();
+ // parent.add(oo);
+ // oo.setVisible(true);
+ // parent.setVisible(true);
+ EditNameDialog end = new EditNameDialog("Sequence Name",
+ "Sequence Description", "label 1", "Label 2",
+ "Try and drag between the two text fields", foo);// );cont.getRootPane());
+ assert (end != null);
+ finish = true;
}
});
cont.setVisible(true);
jmi.addActionListener(new ActionListener()
{
-
+
@Override
public void actionPerformed(ActionEvent arg0)
{
- EditNameDialog end =new EditNameDialog("Sequence Name", "Sequence Description","label 1", "Label 2", "Try and drag between the two text fields", cont);
- assert(end!=null);
- finish=true;
+ EditNameDialog end = new EditNameDialog("Sequence Name",
+ "Sequence Description", "label 1", "Label 2",
+ "Try and drag between the two text fields", cont);
+ assert (end != null);
+ finish = true;
}
});
foo.setVisible(true);
cfoo.setVisible(true);
while (!finish)
{
- try {
+ try
+ {
Thread.sleep(100);
- } catch (InterruptedException x) {}
+ } catch (InterruptedException x)
+ {
+ }
}
}
@Test
public void exampleAnnotationFileIO() throws Exception
{
- for (String[] testPair:TestFiles)
+ for (String[] testPair : TestFiles)
{
- testAnnotationFileIO(testPair[0], new File(testPair[1]), new File(testPair[2]));
+ testAnnotationFileIO(testPair[0], new File(testPair[1]), new File(
+ testPair[2]));
}
}
AlignmentI al = rf.readFile(ff, AppletFormatAdapter.FILE,
new IdentifyFile().Identify(ff, AppletFormatAdapter.FILE));
-
+
// make sure dataset is initialised ? not sure about this
for (int i = 0; i < al.getSequencesArray().length; ++i)
{
- al.getSequenceAt(i).setDatasetSequence(al.getSequenceAt(i).createDatasetSequence());
+ al.getSequenceAt(i).setDatasetSequence(
+ al.getSequenceAt(i).createDatasetSequence());
}
assertNotNull("Couldn't read supplied alignment data.", al);
return al;
{
e.printStackTrace();
}
- fail("Couln't read the alignment in file '"+f.toString()+"'");
+ fail("Couln't read the alignment in file '" + f.toString() + "'");
return null;
}
+
/**
* test alignment data in given file can be imported, exported and reimported
* with no dataloss
* - label for IO class used to write and read back in the data from
* f
*/
- public static void testAnnotationFileIO(String testname, File f, File annotFile)
+ public static void testAnnotationFileIO(String testname, File f,
+ File annotFile)
{
- System.out.println("Test: "+testname+"\nReading annotation file '"+annotFile+"' onto : " + f);
+ System.out.println("Test: " + testname + "\nReading annotation file '"
+ + annotFile + "' onto : " + f);
String af = annotFile.getPath();
try
{
AlignmentI al = readAlignmentFile(f);
-
- assertTrue("Test "+testname+"\nAlignment was not annotated - annotation file not imported.",new AnnotationFile().readAnnotationFile(al, af, FormatAdapter.FILE));
-
- String anfileout = new AnnotationFile().printAnnotations(al.getAlignmentAnnotation(), al.getGroups(), al.getProperties());
- assertTrue("Test "+testname+"\nAlignment annotation file was not regenerated. Null string",anfileout!=null);
- assertTrue("Test "+testname+"\nAlignment annotation file was not regenerated. Empty string",anfileout.length()>"JALVIEW_ANNOTATION".length());
- System.out.println("Output annotation file:\n"+anfileout+"\n<<EOF\n");
-
+ assertTrue(
+ "Test "
+ + testname
+ + "\nAlignment was not annotated - annotation file not imported.",
+ new AnnotationFile().readAnnotationFile(al, af,
+ FormatAdapter.FILE));
+
+ String anfileout = new AnnotationFile().printAnnotations(
+ al.getAlignmentAnnotation(), al.getGroups(),
+ al.getProperties());
+ assertTrue(
+ "Test "
+ + testname
+ + "\nAlignment annotation file was not regenerated. Null string",
+ anfileout != null);
+ assertTrue(
+ "Test "
+ + testname
+ + "\nAlignment annotation file was not regenerated. Empty string",
+ anfileout.length() > "JALVIEW_ANNOTATION".length());
+
+ System.out.println("Output annotation file:\n" + anfileout
+ + "\n<<EOF\n");
+
AlignmentI al_new = readAlignmentFile(f);
- assertTrue("Test "+testname+"\nregenerated annotation file did not annotate alignment.",new AnnotationFile().readAnnotationFile(al_new, anfileout, FormatAdapter.PASTE));
-
+ assertTrue(
+ "Test "
+ + testname
+ + "\nregenerated annotation file did not annotate alignment.",
+ new AnnotationFile().readAnnotationFile(al_new, anfileout,
+ FormatAdapter.PASTE));
+
// test for consistency in io
StockholmFileTest.testAlignmentEquivalence(al, al_new);
return;
{
e.printStackTrace();
}
- fail("Test "+testname+"\nCouldn't complete Annotation file roundtrip input/output/input test for '"+annotFile+"'.");
+ fail("Test "
+ + testname
+ + "\nCouldn't complete Annotation file roundtrip input/output/input test for '"
+ + annotFile + "'.");
}
}
/**
* @author jimp
- *
+ *
*/
public class FileIOTester
{
public static void tearDownAfterClass() throws Exception
{
}
+
// TODO: make a better/more comprehensive test harness for identify/io
-
- final static File ALIGN_FILE = new File("test/jalview/io/test_gz_fasta.gz");
- final static File NOTGZALIGN_FILE = new File("test/jalview/io/test_gz_fasta_notgz.gz");
- final static File STARS_FA_FILE1 = new File("test/jalview/io/test_fasta_stars.fa");
- final static File STARS_FA_FILE2 = new File("test/jalview/io/test_fasta_stars2.fa");
+
+ final static File ALIGN_FILE = new File(
+ "test/jalview/io/test_gz_fasta.gz");
+
+ final static File NOTGZALIGN_FILE = new File(
+ "test/jalview/io/test_gz_fasta_notgz.gz");
+
+ final static File STARS_FA_FILE1 = new File(
+ "test/jalview/io/test_fasta_stars.fa");
+
+ final static File STARS_FA_FILE2 = new File(
+ "test/jalview/io/test_fasta_stars2.fa");
private void assertValidFormat(String fmt, String src, FileParse fp)
{
- assertTrue("Couldn't resolve "+src+" as a valid file",fp.isValid());
+ assertTrue("Couldn't resolve " + src + " as a valid file", fp.isValid());
String type = new IdentifyFile().Identify(fp);
- assertTrue("Data from '"+src+"' Expected to be '"+fmt+"' identified as '"+type+"'",type.equalsIgnoreCase(fmt));
+ assertTrue("Data from '" + src + "' Expected to be '" + fmt
+ + "' identified as '" + type + "'", type.equalsIgnoreCase(fmt));
}
+
@Test
public void testStarsInFasta1() throws IOException
{
String uri;
- FileParse fp = new FileParse(uri=STARS_FA_FILE1.getAbsoluteFile().toString(),AppletFormatAdapter.FILE);
+ FileParse fp = new FileParse(uri = STARS_FA_FILE1.getAbsoluteFile()
+ .toString(), AppletFormatAdapter.FILE);
assertValidFormat("FASTA", uri, fp);
}
+
@Test
public void testStarsInFasta2() throws IOException
{
String uri;
- FileParse fp = new FileParse(uri=STARS_FA_FILE2.getAbsoluteFile().toString(),AppletFormatAdapter.FILE);
+ FileParse fp = new FileParse(uri = STARS_FA_FILE2.getAbsoluteFile()
+ .toString(), AppletFormatAdapter.FILE);
assertValidFormat("FASTA", uri, fp);
}
+
@Test
public void testGzipIo() throws IOException
- {
+ {
String uri;
- FileParse fp = new FileParse(uri=ALIGN_FILE.getAbsoluteFile().toURI().toString(),AppletFormatAdapter.URL);
+ FileParse fp = new FileParse(uri = ALIGN_FILE.getAbsoluteFile().toURI()
+ .toString(), AppletFormatAdapter.URL);
assertValidFormat("FASTA", uri, fp);
}
public void testGziplocalFileIO() throws IOException
{
String filepath;
- FileParse fp = new FileParse(filepath=ALIGN_FILE.getAbsoluteFile().toString(), AppletFormatAdapter.FILE);
- assertValidFormat("FASTA",filepath, fp);
+ FileParse fp = new FileParse(filepath = ALIGN_FILE.getAbsoluteFile()
+ .toString(), AppletFormatAdapter.FILE);
+ assertValidFormat("FASTA", filepath, fp);
}
+
@Test
public void testNonGzipURLIO() throws IOException
{
String uri;
- FileParse fp = new FileParse(uri=NOTGZALIGN_FILE.getAbsoluteFile().toURI().toString(),AppletFormatAdapter.URL);
- assertValidFormat("FASTA",uri, fp);
+ FileParse fp = new FileParse(uri = NOTGZALIGN_FILE.getAbsoluteFile()
+ .toURI().toString(), AppletFormatAdapter.URL);
+ assertValidFormat("FASTA", uri, fp);
}
+
@Test
public void testNonGziplocalFileIO() throws IOException
{
String filepath;
- FileParse fp = new FileParse(filepath=NOTGZALIGN_FILE.getAbsoluteFile().toString(), AppletFormatAdapter.FILE);
- assertValidFormat("FASTA",filepath, fp);
+ FileParse fp = new FileParse(filepath = NOTGZALIGN_FILE
+ .getAbsoluteFile().toString(), AppletFormatAdapter.FILE);
+ assertValidFormat("FASTA", filepath, fp);
}
}
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
- jalview.bin.Jalview.main(new String[] {"-props","test/src/jalview/io/testProps.jvprops"});
+ jalview.bin.Jalview.main(new String[]
+ { "-props", "test/src/jalview/io/testProps.jvprops" });
}
/**
public static void tearDownAfterClass() throws Exception
{
jalview.gui.Desktop.instance.closeAll_actionPerformed(null);
-
+
}
+
public int countDsAnn(jalview.viewmodel.AlignmentViewport avp)
{
- int numdsann=0;
- for (SequenceI sq: avp.getAlignment().getDataset().getSequences()) {
+ int numdsann = 0;
+ for (SequenceI sq : avp.getAlignment().getDataset().getSequences())
+ {
if (sq.getAnnotation() != null)
{
for (AlignmentAnnotation dssa : sq.getAnnotation())
}
return numdsann;
}
+
@Test
public void testRNAStructureRecovery() throws Exception
{
String inFile = "examples/RF00031_folded.stk";
- String tfile = File.createTempFile("JalviewTest", ".jvp").getAbsolutePath();
- AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(inFile, FormatAdapter.FILE);
- assertTrue("Didn't read input file "+inFile, af!=null);
- int olddsann=countDsAnn(af.getViewport());
- assertTrue("Didn't find any dataset annotations",olddsann>0);
+ String tfile = File.createTempFile("JalviewTest", ".jvp")
+ .getAbsolutePath();
+ AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
+ inFile, FormatAdapter.FILE);
+ assertTrue("Didn't read input file " + inFile, af != null);
+ int olddsann = countDsAnn(af.getViewport());
+ assertTrue("Didn't find any dataset annotations", olddsann > 0);
af.rnahelicesColour_actionPerformed(null);
- assertTrue("Couldn't apply RNA helices colourscheme",af.getViewport().getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
- assertTrue("Failed to store as a project.",af.saveAlignment(tfile, "Jalview"));
+ assertTrue(
+ "Couldn't apply RNA helices colourscheme",
+ af.getViewport().getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
+ assertTrue("Failed to store as a project.",
+ af.saveAlignment(tfile, "Jalview"));
af.closeMenuItem_actionPerformed(true);
- af=null;
- af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile, FormatAdapter.FILE);
- assertTrue("Failed to import new project", af!=null);
- int newdsann=countDsAnn(af.getViewport());
- assertTrue("Differing numbers of dataset sequence annotation\nOriginally "+olddsann+" and now "+newdsann,olddsann==newdsann);
- System.out.println("Read in same number of annotations as originally present ("+olddsann+")");
- assertTrue("RNA helices colourscheme was not applied on import.",af.getViewport().getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
+ af = null;
+ af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile,
+ FormatAdapter.FILE);
+ assertTrue("Failed to import new project", af != null);
+ int newdsann = countDsAnn(af.getViewport());
+ assertTrue(
+ "Differing numbers of dataset sequence annotation\nOriginally "
+ + olddsann + " and now " + newdsann,
+ olddsann == newdsann);
+ System.out
+ .println("Read in same number of annotations as originally present ("
+ + olddsann + ")");
+ assertTrue(
+ "RNA helices colourscheme was not applied on import.",
+ af.getViewport().getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
}
+
@Test
public void testTCoffeeScores() throws Exception
{
- String inFile = "examples/uniref50.fa",inAnnot="examples/uniref50.score_ascii";
- String tfile = File.createTempFile("JalviewTest", ".jvp").getAbsolutePath();
- AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(inFile, FormatAdapter.FILE);
- assertTrue("Didn't read input file "+inFile, af!=null);
- af.loadJalviewDataFile(inAnnot, FormatAdapter.FILE, null,null);
+ String inFile = "examples/uniref50.fa", inAnnot = "examples/uniref50.score_ascii";
+ String tfile = File.createTempFile("JalviewTest", ".jvp")
+ .getAbsolutePath();
+ AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
+ inFile, FormatAdapter.FILE);
+ assertTrue("Didn't read input file " + inFile, af != null);
+ af.loadJalviewDataFile(inAnnot, FormatAdapter.FILE, null, null);
assertTrue(
"Didn't set T-coffee colourscheme",
af.getViewport().getGlobalColourScheme().getClass()
jalview.schemes.ColourSchemeProperty.getColourName(af
.getViewport().getGlobalColourScheme())) != null);
- assertTrue("Failed to store as a project.",af.saveAlignment(tfile, "Jalview"));
+ assertTrue("Failed to store as a project.",
+ af.saveAlignment(tfile, "Jalview"));
af.closeMenuItem_actionPerformed(true);
- af=null;
- af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile, FormatAdapter.FILE);
- assertTrue("Failed to import new project", af!=null);
- assertTrue("Didn't set T-coffee colourscheme for imported project.",af.getViewport().getGlobalColourScheme().getClass().equals(jalview.schemes.TCoffeeColourScheme.class));
- System.out.println("T-Coffee score shading successfully recovered from project.");
+ af = null;
+ af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile,
+ FormatAdapter.FILE);
+ assertTrue("Failed to import new project", af != null);
+ assertTrue(
+ "Didn't set T-coffee colourscheme for imported project.",
+ af.getViewport().getGlobalColourScheme().getClass()
+ .equals(jalview.schemes.TCoffeeColourScheme.class));
+ System.out
+ .println("T-Coffee score shading successfully recovered from project.");
}
+
@Test
public void testColourByAnnotScores() throws Exception
{
- String inFile = "examples/uniref50.fa",inAnnot="examples/testdata/uniref50_iupred.jva";
- String tfile = File.createTempFile("JalviewTest", ".jvp").getAbsolutePath();
- AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(inFile, FormatAdapter.FILE);
- assertTrue("Didn't read input file "+inFile, af!=null);
- af.loadJalviewDataFile(inAnnot, FormatAdapter.FILE, null,null);
- AlignmentAnnotation[] aa = af.getViewport().getAlignment().getSequenceAt(0).getAnnotation("IUPredWS (Short)");
- assertTrue("Didn't find any IUPred annotation to use to shade alignment.",aa!=null && aa.length>0);
- AnnotationColourGradient cs = new jalview.schemes.AnnotationColourGradient(aa[0], null, AnnotationColourGradient.ABOVE_THRESHOLD);
- AnnotationColourGradient gcs = new jalview.schemes.AnnotationColourGradient(aa[0], null, AnnotationColourGradient.BELOW_THRESHOLD);
+ String inFile = "examples/uniref50.fa", inAnnot = "examples/testdata/uniref50_iupred.jva";
+ String tfile = File.createTempFile("JalviewTest", ".jvp")
+ .getAbsolutePath();
+ AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
+ inFile, FormatAdapter.FILE);
+ assertTrue("Didn't read input file " + inFile, af != null);
+ af.loadJalviewDataFile(inAnnot, FormatAdapter.FILE, null, null);
+ AlignmentAnnotation[] aa = af.getViewport().getAlignment()
+ .getSequenceAt(0).getAnnotation("IUPredWS (Short)");
+ assertTrue(
+ "Didn't find any IUPred annotation to use to shade alignment.",
+ aa != null && aa.length > 0);
+ AnnotationColourGradient cs = new jalview.schemes.AnnotationColourGradient(
+ aa[0], null, AnnotationColourGradient.ABOVE_THRESHOLD);
+ AnnotationColourGradient gcs = new jalview.schemes.AnnotationColourGradient(
+ aa[0], null, AnnotationColourGradient.BELOW_THRESHOLD);
cs.setSeqAssociated(true);
gcs.setSeqAssociated(true);
af.changeColour(cs);
sg.addSequence(af.getViewport().getAlignment().getSequenceAt(1), false);
sg.addSequence(af.getViewport().getAlignment().getSequenceAt(2), true);
af.alignPanel.alignmentChanged();
- assertTrue("Failed to store as a project.",af.saveAlignment(tfile, "Jalview"));
+ assertTrue("Failed to store as a project.",
+ af.saveAlignment(tfile, "Jalview"));
af.closeMenuItem_actionPerformed(true);
- af=null;
- af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile, FormatAdapter.FILE);
- assertTrue("Failed to import new project", af!=null);
-
+ af = null;
+ af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile,
+ FormatAdapter.FILE);
+ assertTrue("Failed to import new project", af != null);
+
// check for group and alignment colourschemes
-
- ColourSchemeI _rcs=af.getViewport().getGlobalColourScheme();
- ColourSchemeI _rgcs=af.getViewport().getAlignment().getGroups().get(0).cs;
- assertTrue("Didn't recover global colourscheme",_rcs!=null);
- assertTrue("Didn't recover annotation colour global scheme",_rcs instanceof AnnotationColourGradient);
+
+ ColourSchemeI _rcs = af.getViewport().getGlobalColourScheme();
+ ColourSchemeI _rgcs = af.getViewport().getAlignment().getGroups()
+ .get(0).cs;
+ assertTrue("Didn't recover global colourscheme", _rcs != null);
+ assertTrue("Didn't recover annotation colour global scheme",
+ _rcs instanceof AnnotationColourGradient);
AnnotationColourGradient __rcs = (AnnotationColourGradient) _rcs;
- assertTrue("Annotation colourscheme wasn't sequence associated",__rcs.isSeqAssociated());
+ assertTrue("Annotation colourscheme wasn't sequence associated",
+ __rcs.isSeqAssociated());
-
- boolean diffseqcols=false,diffgseqcols=false;
- SequenceI[] sqs=af.getViewport().getAlignment().getSequencesArray();
- for (int p=0,pSize=af.getViewport().getAlignment().getWidth();p<pSize && (!diffseqcols || !diffgseqcols);p++)
+ boolean diffseqcols = false, diffgseqcols = false;
+ SequenceI[] sqs = af.getViewport().getAlignment().getSequencesArray();
+ for (int p = 0, pSize = af.getViewport().getAlignment().getWidth(); p < pSize
+ && (!diffseqcols || !diffgseqcols); p++)
{
- if (_rcs.findColour(sqs[0].getCharAt(p), p, sqs[0])!=_rcs.findColour(sqs[5].getCharAt(p), p, sqs[5]))
+ if (_rcs.findColour(sqs[0].getCharAt(p), p, sqs[0]) != _rcs
+ .findColour(sqs[5].getCharAt(p), p, sqs[5]))
{
diffseqcols = true;
}
}
assertTrue("Got Different sequence colours", diffseqcols);
- System.out.println("Per sequence colourscheme (Background) successfully applied and recovered.");
-
- assertTrue("Didn't recover group colourscheme",_rgcs!=null);
- assertTrue("Didn't recover annotation colour group colourscheme",_rgcs instanceof AnnotationColourGradient);
+ System.out
+ .println("Per sequence colourscheme (Background) successfully applied and recovered.");
+
+ assertTrue("Didn't recover group colourscheme", _rgcs != null);
+ assertTrue("Didn't recover annotation colour group colourscheme",
+ _rgcs instanceof AnnotationColourGradient);
__rcs = (AnnotationColourGradient) _rgcs;
- assertTrue("Group Annotation colourscheme wasn't sequence associated",__rcs.isSeqAssociated());
-
- for (int p=0,pSize=af.getViewport().getAlignment().getWidth();p<pSize && (!diffseqcols || !diffgseqcols);p++)
+ assertTrue("Group Annotation colourscheme wasn't sequence associated",
+ __rcs.isSeqAssociated());
+
+ for (int p = 0, pSize = af.getViewport().getAlignment().getWidth(); p < pSize
+ && (!diffseqcols || !diffgseqcols); p++)
{
- if (_rgcs.findColour(sqs[1].getCharAt(p), p, sqs[1])!=_rgcs.findColour(sqs[2].getCharAt(p), p, sqs[2]))
+ if (_rgcs.findColour(sqs[1].getCharAt(p), p, sqs[1]) != _rgcs
+ .findColour(sqs[2].getCharAt(p), p, sqs[2]))
{
diffgseqcols = true;
}
}
assertTrue("Got Different group sequence colours", diffgseqcols);
- System.out.println("Per sequence (Group) colourscheme successfully applied and recovered.");
+ System.out
+ .println("Per sequence (Group) colourscheme successfully applied and recovered.");
}
+
@Test
public void gatherViewsHere() throws Exception
{
int origCount = Desktop.getAlignframes().length;
- AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded("examples/exampleFile_2_7.jar", FormatAdapter.FILE);
- assertTrue("Didn't read in the example file correctly.",af!=null);
- assertTrue("Didn't gather the views in the example file.", Desktop.getAlignframes().length==1+origCount);
-
+ AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
+ "examples/exampleFile_2_7.jar", FormatAdapter.FILE);
+ assertTrue("Didn't read in the example file correctly.", af != null);
+ assertTrue("Didn't gather the views in the example file.",
+ Desktop.getAlignframes().length == 1 + origCount);
+
}
}
return Arrays
.asList(new Object[][]
{
-
+
new String[]
{
"Simple uniref50 newick",
@Test
public void testRnamlToStockholmIO()
{
- StockholmFileTest.testFileIOwithFormat(new File("examples/rna-alignment.xml"),"STH");
-
+ StockholmFileTest.testFileIOwithFormat(new File(
+ "examples/rna-alignment.xml"), "STH");
+
}
}
{
testFileIOwithFormat(new File(PfamFile), "STH");
}
+
@Test
public void pfamFileDataExtraction() throws Exception
- { AppletFormatAdapter af = new AppletFormatAdapter();
+ {
+ AppletFormatAdapter af = new AppletFormatAdapter();
AlignmentI al = af.readFile(PfamFile, af.FILE,
new IdentifyFile().Identify(PfamFile, af.FILE));
int numpdb = 0;
al.getSequenceAt(i).setDatasetSequence(al.getSequenceAt(i));
}
String outputfile = rf.formatSequences(ioformat, al, true);
- System.out.println("Output file in '"+ioformat+"':\n"+outputfile+"\n<<EOF\n");
+ System.out.println("Output file in '" + ioformat + "':\n"
+ + outputfile + "\n<<EOF\n");
// test for consistency in io
Alignment al_input = new AppletFormatAdapter().readFile(outputfile,
AppletFormatAdapter.PASTE, ioformat);
// we might want to revise this in future
int aa_new_size = (aa_new == null ? 0 : aa_new.length), aa_original_size = (aa_original == null ? 0
: aa_original.length);
- Map<Integer,java.util.BitSet> orig_groups=new HashMap<Integer,java.util.BitSet>(),new_groups=new HashMap<Integer,java.util.BitSet>();
+ Map<Integer, java.util.BitSet> orig_groups = new HashMap<Integer, java.util.BitSet>(), new_groups = new HashMap<Integer, java.util.BitSet>();
if (aa_new != null && aa_original != null)
{
for (int i = 0; i < aa_original.length; i++)
{
- if (aa_new.length>i) {
- assertTrue("Different alignment annotation at position "+i,
- equalss(aa_original[i], aa_new[i]));
+ if (aa_new.length > i)
+ {
+ assertTrue("Different alignment annotation at position " + i,
+ equalss(aa_original[i], aa_new[i]));
// compare graphGroup or graph properties - needed to verify JAL-1299
- assertTrue("Graph type not identical.",aa_original[i].graph==aa_new[i].graph);
- assertTrue("Visibility not identical.", aa_original[i].visible==aa_new[i].visible);
+ assertTrue("Graph type not identical.",
+ aa_original[i].graph == aa_new[i].graph);
+ assertTrue("Visibility not identical.",
+ aa_original[i].visible == aa_new[i].visible);
assertTrue(
"Threshold line not identical.",
aa_original[i].threshold == null ? aa_new[i].threshold == null
: aa_original[i].threshold
.equals(aa_new[i].threshold));
// graphGroup may differ, but pattern should be the same
- Integer o_ggrp=new Integer(aa_original[i].graphGroup+2),n_ggrp=new Integer(aa_new[i].graphGroup+2);
- BitSet orig_g=orig_groups.get(o_ggrp),new_g=new_groups.get(n_ggrp);
- if (orig_g==null) {
- orig_groups.put(o_ggrp,orig_g= new BitSet());
+ Integer o_ggrp = new Integer(aa_original[i].graphGroup + 2), n_ggrp = new Integer(
+ aa_new[i].graphGroup + 2);
+ BitSet orig_g = orig_groups.get(o_ggrp), new_g = new_groups
+ .get(n_ggrp);
+ if (orig_g == null)
+ {
+ orig_groups.put(o_ggrp, orig_g = new BitSet());
}
- if (new_g==null) {
- new_groups.put(n_ggrp, new_g=new BitSet());
+ if (new_g == null)
+ {
+ new_groups.put(n_ggrp, new_g = new BitSet());
}
- assertTrue("Graph Group pattern differs at annotation "+i, orig_g.equals(new_g));
- orig_g.set(i); new_g.set(i);
- } else {
- System.err.println("No matching annotation row for "+aa_original[i].toString());
+ assertTrue("Graph Group pattern differs at annotation " + i,
+ orig_g.equals(new_g));
+ orig_g.set(i);
+ new_g.set(i);
+ }
+ else
+ {
+ System.err.println("No matching annotation row for "
+ + aa_original[i].toString());
}
}
}
{
if (annot_or.annotations.length != annot_new.annotations.length)
{
- System.err.println("Different lengths for annotation row elements: "+annot_or.annotations.length +"!="+ annot_new.annotations.length);
+ System.err.println("Different lengths for annotation row elements: "
+ + annot_or.annotations.length + "!="
+ + annot_new.annotations.length);
return false;
}
for (int i = 0; i < annot_or.annotations.length; i++)
{
- Annotation an_or=annot_or.annotations[i],an_new=annot_new.annotations[i];
- if (an_or != null
- && an_new!= null)
+ Annotation an_or = annot_or.annotations[i], an_new = annot_new.annotations[i];
+ if (an_or != null && an_new != null)
{
- if (!an_or.displayCharacter.trim()
- .equals(an_new.displayCharacter.trim())
- || !(""+an_or.secondaryStructure).trim().equals((""+an_new.secondaryStructure).trim())
+ if (!an_or.displayCharacter.trim().equals(
+ an_new.displayCharacter.trim())
+ || !("" + an_or.secondaryStructure).trim().equals(
+ ("" + an_new.secondaryStructure).trim())
|| (an_or.description != an_new.description && (an_or.description == null
|| an_new.description == null || !an_or.description
.equals(an_new.description))))
{
- System.err.println("Annotation Element Mismatch\nElement "+i+" in original: "+annot_or.annotations[i].toString()+"\nElement "+i+" in new: "+annot_new.annotations[i].toString());
+ System.err.println("Annotation Element Mismatch\nElement " + i
+ + " in original: " + annot_or.annotations[i].toString()
+ + "\nElement " + i + " in new: "
+ + annot_new.annotations[i].toString());
return false;
}
}
}
else
{
- System.err.println("Annotation Element Mismatch\nElement "+i+" in original: "+(annot_or.annotations[i]==null ? "is null" : annot_or.annotations[i].toString())+"\nElement "+i+" in new: "+(annot_new.annotations[i] == null ? "is null" : annot_new.annotations[i].toString()));
+ System.err.println("Annotation Element Mismatch\nElement "
+ + i
+ + " in original: "
+ + (annot_or.annotations[i] == null ? "is null"
+ : annot_or.annotations[i].toString())
+ + "\nElement "
+ + i
+ + " in new: "
+ + (annot_new.annotations[i] == null ? "is null"
+ : annot_new.annotations[i].toString()));
return false;
}
}
import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
-public class TCoffeeScoreFileTest {
-
- final static File SCORE_FILE = new File("test/jalview/io/tcoffee.score_ascii");
- final static File ALIGN_FILE = new File("test/jalview/io/tcoffee.fasta_aln");
-
- @Test
- public void testReadHeader() throws IOException {
-
- TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),AppletFormatAdapter.FILE);
- assertTrue(scoreFile.getWarningMessage(),scoreFile.isValid());
-
- Header header = scoreFile.header;
- assertNotNull(header);
- assertEquals( "T-COFFEE, Version_9.02.r1228 (2012-02-16 18:15:12 - Revision 1228 - Build 336)", header.head );
- assertEquals( 90, header.score );
- assertEquals( 89, header.getScoreFor("1PHT") );
- assertEquals( 90, header.getScoreFor("1BB9") );
- assertEquals( 94, header.getScoreFor("1UHC") );
- assertEquals( 94, header.getScoreFor("1YCS") );
- assertEquals( 93, header.getScoreFor("1OOT") );
- assertEquals( 94, header.getScoreFor("1ABO") );
- assertEquals( 94, header.getScoreFor("1FYN") );
- assertEquals( 94, header.getScoreFor("1QCF") );
- assertEquals( 90, header.getScoreFor("cons") );
- }
-
-
- @Test
- public void testWrongFile() {
- try {
- TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(), FormatAdapter.FILE);
- assertFalse(result.isValid());
- }
- catch (IOException x)
- {
- assertTrue("File not found exception thrown",x instanceof FileNotFoundException);
- }
- }
-
- @Test
- public void testHeightAndWidth() throws IOException {
- TCoffeeScoreFile result = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE);
- assertTrue(result.isValid());
- assertEquals( 8, result.getHeight() );
- assertEquals( 83, result.getWidth() );
- }
-
- @Test
- public void testReadBlock( ) throws IOException {
-
- String BLOCK = "\n" +
- "\n" +
- "\n" +
- "1PHT 999999999999999999999999998762112222543211112134\n" +
- "1BB9 99999999999999999999999999987-------4322----2234 \n" +
- "1UHC 99999999999999999999999999987-------5321----2246\n" +
- "1YCS 99999999999999999999999999986-------4321----1-35\n" +
- "1OOT 999999999999999999999999999861-------3------1135 \n" +
- "1ABO 99999999999999999999999999986-------422-------34\n" +
- "1FYN 99999999999999999999999999985-------32--------35\n" +
- "1QCF 99999999999999999999999999974-------2---------24\n" +
- "cons 999999999999999999999999999851000110321100001134\n" +
- "\n" +
- "\n";
- FileParse source=new FileParse(BLOCK, FormatAdapter.PASTE);
- Block block = TCoffeeScoreFile.readBlock(source, 0);
-
- assertNotNull(block);
- assertEquals( "999999999999999999999999998762112222543211112134", block.getScoresFor("1PHT") );
- assertEquals( "99999999999999999999999999987-------4322----2234", block.getScoresFor("1BB9") );
- assertEquals( "99999999999999999999999999987-------5321----2246", block.getScoresFor("1UHC") );
- assertEquals( "99999999999999999999999999986-------4321----1-35", block.getScoresFor("1YCS") );
- assertEquals( "999999999999999999999999999861-------3------1135", block.getScoresFor("1OOT") );
- assertEquals( "99999999999999999999999999986-------422-------34", block.getScoresFor("1ABO") );
- assertEquals( "99999999999999999999999999985-------32--------35", block.getScoresFor("1FYN") );
- assertEquals( "99999999999999999999999999974-------2---------24", block.getScoresFor("1QCF") );
- assertEquals( "999999999999999999999999999851000110321100001134", block.getConsensus() );
- }
-
- @Test
- public void testParse() throws IOException {
-
- TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(), FormatAdapter.FILE);
-
- assertEquals( "999999999999999999999999998762112222543211112134----------5666642367889999999999889", parser.getScoresFor("1PHT") );
- assertEquals( "99999999999999999999999999987-------4322----22341111111111676653-355679999999999889", parser.getScoresFor("1BB9") );
- assertEquals( "99999999999999999999999999987-------5321----2246----------788774--66789999999999889", parser.getScoresFor("1UHC") );
- assertEquals( "99999999999999999999999999986-------4321----1-35----------78777--356789999999999889", parser.getScoresFor("1YCS") );
- assertEquals( "999999999999999999999999999861-------3------1135----------78877--356789999999997-67", parser.getScoresFor("1OOT") );
- assertEquals( "99999999999999999999999999986-------422-------34----------687774--56779999999999889", parser.getScoresFor("1ABO") );
- assertEquals( "99999999999999999999999999985-------32--------35----------6888842356789999999999889", parser.getScoresFor("1FYN") );
- assertEquals( "99999999999999999999999999974-------2---------24----------6878742356789999999999889", parser.getScoresFor("1QCF") );
- assertEquals( "99999999999999999999999999985100011032110000113400100000006877641356789999999999889", parser.getScoresFor("cons") );
- }
-
-
- @Test
- public void testGetAsList() throws IOException {
-
- TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE);
- assertTrue(parser.getWarningMessage(),parser.isValid());
- List<String> scores = parser.getScoresList();
- assertEquals( "999999999999999999999999998762112222543211112134----------5666642367889999999999889", scores.get(0) );
- assertEquals( "99999999999999999999999999987-------4322----22341111111111676653-355679999999999889", scores.get(1) );
- assertEquals( "99999999999999999999999999987-------5321----2246----------788774--66789999999999889", scores.get(2) );
- assertEquals( "99999999999999999999999999986-------4321----1-35----------78777--356789999999999889", scores.get(3) );
- assertEquals( "999999999999999999999999999861-------3------1135----------78877--356789999999997-67", scores.get(4) );
- assertEquals( "99999999999999999999999999986-------422-------34----------687774--56779999999999889", scores.get(5) );
- assertEquals( "99999999999999999999999999985-------32--------35----------6888842356789999999999889", scores.get(6) );
- assertEquals( "99999999999999999999999999974-------2---------24----------6878742356789999999999889", scores.get(7) );
- assertEquals( "99999999999999999999999999985100011032110000113400100000006877641356789999999999889", scores.get(8) );
-
- }
-
-
- @Test
- public void testGetAsArray() throws IOException {
-
- TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),FormatAdapter.FILE);
- assertTrue(parser.getWarningMessage(),parser.isValid());
- byte[][] scores = parser.getScoresArray();
-
- assertEquals( 9, scores[0][0] );
- assertEquals( 9, scores[1][0] );
- assertEquals( 9, scores[2][0] );
- assertEquals( 9, scores[3][0] );
- assertEquals( 9, scores[4][0] );
- assertEquals( 9, scores[5][0] );
- assertEquals( 9, scores[6][0] );
- assertEquals( 9, scores[7][0] );
- assertEquals( 9, scores[8][0] );
-
- assertEquals( 5, scores[0][36] );
- assertEquals( 4, scores[1][36] );
- assertEquals( 5, scores[2][36] );
- assertEquals( 4, scores[3][36] );
- assertEquals( -1, scores[4][36] );
- assertEquals( 4, scores[5][36] );
- assertEquals( 3, scores[6][36] );
- assertEquals( 2, scores[7][36] );
- assertEquals( 3, scores[8][36] );
-
- }
-
- @Test
- public void testHeightAndWidthWithResidueNumbers() throws Exception {
- String file = "test/jalview/io/tcoffee.score_ascii_with_residue_numbers";
- TCoffeeScoreFile result = new TCoffeeScoreFile(file, FormatAdapter.FILE);
- assertTrue(result.isValid());
- assertEquals( 5, result.getHeight() );
- assertEquals( 84, result.getWidth() );
- }
-
-
-
+public class TCoffeeScoreFileTest
+{
+
+ final static File SCORE_FILE = new File(
+ "test/jalview/io/tcoffee.score_ascii");
+
+ final static File ALIGN_FILE = new File(
+ "test/jalview/io/tcoffee.fasta_aln");
+
+ @Test
+ public void testReadHeader() throws IOException
+ {
+
+ TCoffeeScoreFile scoreFile = new TCoffeeScoreFile(SCORE_FILE.getPath(),
+ AppletFormatAdapter.FILE);
+ assertTrue(scoreFile.getWarningMessage(), scoreFile.isValid());
+
+ Header header = scoreFile.header;
+ assertNotNull(header);
+ assertEquals(
+ "T-COFFEE, Version_9.02.r1228 (2012-02-16 18:15:12 - Revision 1228 - Build 336)",
+ header.head);
+ assertEquals(90, header.score);
+ assertEquals(89, header.getScoreFor("1PHT"));
+ assertEquals(90, header.getScoreFor("1BB9"));
+ assertEquals(94, header.getScoreFor("1UHC"));
+ assertEquals(94, header.getScoreFor("1YCS"));
+ assertEquals(93, header.getScoreFor("1OOT"));
+ assertEquals(94, header.getScoreFor("1ABO"));
+ assertEquals(94, header.getScoreFor("1FYN"));
+ assertEquals(94, header.getScoreFor("1QCF"));
+ assertEquals(90, header.getScoreFor("cons"));
+ }
+
+ @Test
+ public void testWrongFile()
+ {
+ try
+ {
+ TCoffeeScoreFile result = new TCoffeeScoreFile(ALIGN_FILE.getPath(),
+ FormatAdapter.FILE);
+ assertFalse(result.isValid());
+ } catch (IOException x)
+ {
+ assertTrue("File not found exception thrown",
+ x instanceof FileNotFoundException);
+ }
+ }
+
+ @Test
+ public void testHeightAndWidth() throws IOException
+ {
+ TCoffeeScoreFile result = new TCoffeeScoreFile(SCORE_FILE.getPath(),
+ FormatAdapter.FILE);
+ assertTrue(result.isValid());
+ assertEquals(8, result.getHeight());
+ assertEquals(83, result.getWidth());
+ }
+
+ @Test
+ public void testReadBlock() throws IOException
+ {
+
+ String BLOCK = "\n" + "\n" + "\n"
+ + "1PHT 999999999999999999999999998762112222543211112134\n"
+ + "1BB9 99999999999999999999999999987-------4322----2234 \n"
+ + "1UHC 99999999999999999999999999987-------5321----2246\n"
+ + "1YCS 99999999999999999999999999986-------4321----1-35\n"
+ + "1OOT 999999999999999999999999999861-------3------1135 \n"
+ + "1ABO 99999999999999999999999999986-------422-------34\n"
+ + "1FYN 99999999999999999999999999985-------32--------35\n"
+ + "1QCF 99999999999999999999999999974-------2---------24\n"
+ + "cons 999999999999999999999999999851000110321100001134\n"
+ + "\n" + "\n";
+ FileParse source = new FileParse(BLOCK, FormatAdapter.PASTE);
+ Block block = TCoffeeScoreFile.readBlock(source, 0);
+
+ assertNotNull(block);
+ assertEquals("999999999999999999999999998762112222543211112134",
+ block.getScoresFor("1PHT"));
+ assertEquals("99999999999999999999999999987-------4322----2234",
+ block.getScoresFor("1BB9"));
+ assertEquals("99999999999999999999999999987-------5321----2246",
+ block.getScoresFor("1UHC"));
+ assertEquals("99999999999999999999999999986-------4321----1-35",
+ block.getScoresFor("1YCS"));
+ assertEquals("999999999999999999999999999861-------3------1135",
+ block.getScoresFor("1OOT"));
+ assertEquals("99999999999999999999999999986-------422-------34",
+ block.getScoresFor("1ABO"));
+ assertEquals("99999999999999999999999999985-------32--------35",
+ block.getScoresFor("1FYN"));
+ assertEquals("99999999999999999999999999974-------2---------24",
+ block.getScoresFor("1QCF"));
+ assertEquals("999999999999999999999999999851000110321100001134",
+ block.getConsensus());
+ }
+
+ @Test
+ public void testParse() throws IOException
+ {
+
+ TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
+ FormatAdapter.FILE);
+
+ assertEquals(
+ "999999999999999999999999998762112222543211112134----------5666642367889999999999889",
+ parser.getScoresFor("1PHT"));
+ assertEquals(
+ "99999999999999999999999999987-------4322----22341111111111676653-355679999999999889",
+ parser.getScoresFor("1BB9"));
+ assertEquals(
+ "99999999999999999999999999987-------5321----2246----------788774--66789999999999889",
+ parser.getScoresFor("1UHC"));
+ assertEquals(
+ "99999999999999999999999999986-------4321----1-35----------78777--356789999999999889",
+ parser.getScoresFor("1YCS"));
+ assertEquals(
+ "999999999999999999999999999861-------3------1135----------78877--356789999999997-67",
+ parser.getScoresFor("1OOT"));
+ assertEquals(
+ "99999999999999999999999999986-------422-------34----------687774--56779999999999889",
+ parser.getScoresFor("1ABO"));
+ assertEquals(
+ "99999999999999999999999999985-------32--------35----------6888842356789999999999889",
+ parser.getScoresFor("1FYN"));
+ assertEquals(
+ "99999999999999999999999999974-------2---------24----------6878742356789999999999889",
+ parser.getScoresFor("1QCF"));
+ assertEquals(
+ "99999999999999999999999999985100011032110000113400100000006877641356789999999999889",
+ parser.getScoresFor("cons"));
+ }
+
+ @Test
+ public void testGetAsList() throws IOException
+ {
+
+ TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
+ FormatAdapter.FILE);
+ assertTrue(parser.getWarningMessage(), parser.isValid());
+ List<String> scores = parser.getScoresList();
+ assertEquals(
+ "999999999999999999999999998762112222543211112134----------5666642367889999999999889",
+ scores.get(0));
+ assertEquals(
+ "99999999999999999999999999987-------4322----22341111111111676653-355679999999999889",
+ scores.get(1));
+ assertEquals(
+ "99999999999999999999999999987-------5321----2246----------788774--66789999999999889",
+ scores.get(2));
+ assertEquals(
+ "99999999999999999999999999986-------4321----1-35----------78777--356789999999999889",
+ scores.get(3));
+ assertEquals(
+ "999999999999999999999999999861-------3------1135----------78877--356789999999997-67",
+ scores.get(4));
+ assertEquals(
+ "99999999999999999999999999986-------422-------34----------687774--56779999999999889",
+ scores.get(5));
+ assertEquals(
+ "99999999999999999999999999985-------32--------35----------6888842356789999999999889",
+ scores.get(6));
+ assertEquals(
+ "99999999999999999999999999974-------2---------24----------6878742356789999999999889",
+ scores.get(7));
+ assertEquals(
+ "99999999999999999999999999985100011032110000113400100000006877641356789999999999889",
+ scores.get(8));
+
+ }
+
+ @Test
+ public void testGetAsArray() throws IOException
+ {
+
+ TCoffeeScoreFile parser = new TCoffeeScoreFile(SCORE_FILE.getPath(),
+ FormatAdapter.FILE);
+ assertTrue(parser.getWarningMessage(), parser.isValid());
+ byte[][] scores = parser.getScoresArray();
+
+ assertEquals(9, scores[0][0]);
+ assertEquals(9, scores[1][0]);
+ assertEquals(9, scores[2][0]);
+ assertEquals(9, scores[3][0]);
+ assertEquals(9, scores[4][0]);
+ assertEquals(9, scores[5][0]);
+ assertEquals(9, scores[6][0]);
+ assertEquals(9, scores[7][0]);
+ assertEquals(9, scores[8][0]);
+
+ assertEquals(5, scores[0][36]);
+ assertEquals(4, scores[1][36]);
+ assertEquals(5, scores[2][36]);
+ assertEquals(4, scores[3][36]);
+ assertEquals(-1, scores[4][36]);
+ assertEquals(4, scores[5][36]);
+ assertEquals(3, scores[6][36]);
+ assertEquals(2, scores[7][36]);
+ assertEquals(3, scores[8][36]);
+
+ }
+
+ @Test
+ public void testHeightAndWidthWithResidueNumbers() throws Exception
+ {
+ String file = "test/jalview/io/tcoffee.score_ascii_with_residue_numbers";
+ TCoffeeScoreFile result = new TCoffeeScoreFile(file, FormatAdapter.FILE);
+ assertTrue(result.isValid());
+ assertEquals(5, result.getHeight());
+ assertEquals(84, result.getWidth());
+ }
+
}
@Test
public void testAmbiguityCodeGeneration()
{
- assertTrue(ResidueProperties.ambiguityCodes.size()>0);
+ assertTrue(ResidueProperties.ambiguityCodes.size() > 0);
}
+
@Test
- public void testAmbiguityCodon() {
- for (String ac:ResidueProperties.ambiguityCodes.keySet())
+ public void testAmbiguityCodon()
+ {
+ for (String ac : ResidueProperties.ambiguityCodes.keySet())
{
- assertTrue("Couldn't resolve GGN as glycine codon",ResidueProperties.codonHash2.get("GG"+ac).equals("G"));
+ assertTrue("Couldn't resolve GGN as glycine codon",
+ ResidueProperties.codonHash2.get("GG" + ac).equals("G"));
}
}
+
@Test
- public void regenerateCodonTable() {
- for (Map.Entry<String, String> codon:ResidueProperties.codonHash2.entrySet())
+ public void regenerateCodonTable()
+ {
+ for (Map.Entry<String, String> codon : ResidueProperties.codonHash2
+ .entrySet())
{
- System.out.println("ResidueProperties.codonHash2.set(\""+codon.getKey()+"\", \""+codon.getValue()+"\");");
+ System.out.println("ResidueProperties.codonHash2.set(\""
+ + codon.getKey() + "\", \"" + codon.getValue() + "\");");
}
}
+
@Test
- public void checkOldCodonagainstNewCodonTable() {
- // note - this test will be removed once the old codon table (including Vectors) is removed
- String additional="",failtrans="",differentTr="";
- for (Object aa:ResidueProperties.codonHash.keySet())
+ public void checkOldCodonagainstNewCodonTable()
+ {
+ // note - this test will be removed once the old codon table (including
+ // Vectors) is removed
+ String additional = "", failtrans = "", differentTr = "";
+ for (Object aa : ResidueProperties.codonHash.keySet())
{
- String amacid=(String) aa;
- for (Object codons:((Vector)ResidueProperties.codonHash.get(amacid)))
+ String amacid = (String) aa;
+ for (Object codons : ((Vector) ResidueProperties.codonHash
+ .get(amacid)))
{
String codon = (String) codons;
String trans = ResidueProperties.codonTranslate(codon);
String oldtrans = ResidueProperties._codonTranslate(codon);
- if (trans==null) {
- additional+="\nOld translation table includes additional codons for "+amacid+" : "+codon;
+ if (trans == null)
+ {
+ additional += "\nOld translation table includes additional codons for "
+ + amacid + " : " + codon;
}
- if (oldtrans==null) {
- failtrans+=("\nold translation routine failed for old translation entry (aa was "+amacid+" codon was "+codon+")");
+ if (oldtrans == null)
+ {
+ failtrans += ("\nold translation routine failed for old translation entry (aa was "
+ + amacid + " codon was " + codon + ")");
}
if (!oldtrans.equals(trans))
{
- differentTr+=("\nDifferent translation for old and new routines: "+amacid+" "+codon+" => expected "+oldtrans+" and got "+trans);
+ differentTr += ("\nDifferent translation for old and new routines: "
+ + amacid
+ + " "
+ + codon
+ + " => expected "
+ + oldtrans
+ + " and got " + trans);
}
}
}
- assertTrue(""+additional+"\n"+failtrans+"\n"+differentTr,additional.length()==0 && failtrans.length()==0 && differentTr.length()==0);
+ assertTrue("" + additional + "\n" + failtrans + "\n" + differentTr,
+ additional.length() == 0 && failtrans.length() == 0
+ && differentTr.length() == 0);
}
}
import org.junit.Test;
-
-public class ScoreMatrixPrinter
+public class ScoreMatrixPrinter
{
@Test
public void printAllMatrices()
{
- for (Map.Entry<String,ScoreModelI> sm: ResidueProperties.scoreMatrices.entrySet())
+ for (Map.Entry<String, ScoreModelI> sm : ResidueProperties.scoreMatrices
+ .entrySet())
{
- System.out.println("Matrix "+sm.getKey());
+ System.out.println("Matrix " + sm.getKey());
System.out.println(sm.getValue().toString());
}
}
+
@Test
public void printHTMLMatrices()
{
- for (Map.Entry<String,ScoreModelI> _sm: ResidueProperties.scoreMatrices.entrySet())
+ for (Map.Entry<String, ScoreModelI> _sm : ResidueProperties.scoreMatrices
+ .entrySet())
{
if (_sm.getValue() instanceof ScoreMatrix)
{
ScoreMatrix sm = (ScoreMatrix) _sm.getValue();
- System.out.println("Matrix "+_sm.getKey());
+ System.out.println("Matrix " + _sm.getKey());
System.out.println(sm.outputMatrix(true));
}
}
{
SequenceFetcher sf;
+
@Before
public void setUp() throws Exception
{
@Test
public void testPdbPerChainRetrieve() throws Exception
{
- List<DbSourceProxy> sps = sf
- .getSourceProxy("PDB");
+ List<DbSourceProxy> sps = sf.getSourceProxy("PDB");
AlignmentI response = sps.get(0).getSequenceRecords("1QIPA");
- assertTrue(response!=null);
- assertTrue(response.getHeight()==1);
+ assertTrue(response != null);
+ assertTrue(response.getHeight() == 1);
}
+
@Test
public void testRnaSeqRetrieve() throws Exception
{
- List<DbSourceProxy> sps = sf
- .getSourceProxy("PDB");
+ List<DbSourceProxy> sps = sf.getSourceProxy("PDB");
AlignmentI response = sps.get(0).getSequenceRecords("2GIS");
- assertTrue(response!=null);
- assertTrue(response.getHeight()==1);
- for (SequenceI sq:response.getSequences())
+ assertTrue(response != null);
+ assertTrue(response.getHeight() == 1);
+ for (SequenceI sq : response.getSequences())
{
- assertTrue("No annotation transfered to sequence.",sq.getAnnotation().length>0);
- assertTrue("No PDBEntry on sequence.",sq.getPDBId().size()>0);
- assertTrue("No RNA annotation on sequence.", sq.getRNA()!=null);
+ assertTrue("No annotation transfered to sequence.",
+ sq.getAnnotation().length > 0);
+ assertTrue("No PDBEntry on sequence.", sq.getPDBId().size() > 0);
+ assertTrue("No RNA annotation on sequence.", sq.getRNA() != null);
}
}
serviceTests.add("AAConWS".toLowerCase());
}
- public static Jws2Discoverer disc=null;
+ public static Jws2Discoverer disc = null;
+
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
disc = JalviewJabawsTestUtils.getJabawsDiscoverer();
-
+
}
+
@Test
public void testJws2Gui()
{
;
} while (af.getViewport().getCalcManager().isWorking());
AlignmentI orig_alig = af.getViewport().getAlignment();
- // NOTE: Consensus annotation row cannot be exported and reimported faithfully - so we remove them
+ // NOTE: Consensus annotation row cannot be exported and reimported
+ // faithfully - so we remove them
List<AlignmentAnnotation> toremove = new ArrayList<AlignmentAnnotation>();
- for (AlignmentAnnotation aa:orig_alig.getAlignmentAnnotation())
+ for (AlignmentAnnotation aa : orig_alig.getAlignmentAnnotation())
{
if (aa.autoCalculated)
{
toremove.add(aa);
}
}
- for (AlignmentAnnotation aa:toremove)
+ for (AlignmentAnnotation aa : toremove)
{
orig_alig.deleteAnnotation(aa);
}
public class JalviewJabawsTestUtils
{
-
+
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
fail("Not yet implemented");
}
- public static jalview.ws.jws2.Jws2Discoverer getJabawsDiscoverer() {
+ public static jalview.ws.jws2.Jws2Discoverer getJabawsDiscoverer()
+ {
jalview.ws.jws2.Jws2Discoverer disc = jalview.ws.jws2.Jws2Discoverer
.getDiscoverer();
int p = 0;
- String svcurls="";
+ String svcurls = "";
Vector<String> services = new Vector<String>();
for (String url : JalviewJabawsTestUtils.serviceUrls)
{
- svcurls+=url+"; ";
+ svcurls += url + "; ";
services.add(url);
}
;
Jws2Discoverer.setServiceUrls(services);
-
+
try
{
disc.run();
} catch (Exception e)
{
e.printStackTrace();
- fail("Aborting. Problem discovering services. Tried "+svcurls);
+ fail("Aborting. Problem discovering services. Tried " + svcurls);
}
- assertTrue("Failed to discover any services at ",
- disc.getServices().size() > 0);
+ assertTrue("Failed to discover any services at ", disc.getServices()
+ .size() > 0);
return disc;
}
}
}
alifoldClient = new RNAalifoldClient(rnaalifoldws, af, null, opts);
-
+
af.getViewport().getCalcManager().startWorker(alifoldClient);
-
+
do
{
try
}
;
} while (af.getViewport().getCalcManager().isWorking());
- AutoCalcSetting oldacs = af.getViewport().getCalcIdSettingsFor(alifoldClient.getCalcId());
+ AutoCalcSetting oldacs = af.getViewport().getCalcIdSettingsFor(
+ alifoldClient.getCalcId());
String oldsettings = oldacs.getWsParamFile();
// write out parameters
- jalview.gui.AlignFrame nalf=null;
- assertTrue("Couldn't write out the Jar file",new Jalview2XML(false).SaveAlignment(af, "testRnalifold_param.jar","trial parameter writeout"));
- assertTrue("Couldn't read back the Jar file",(nalf = new Jalview2XML(false).LoadJalviewAlign("testRnalifold_param.jar"))!=null);
- if (nalf!=null)
+ jalview.gui.AlignFrame nalf = null;
+ assertTrue("Couldn't write out the Jar file",
+ new Jalview2XML(false).SaveAlignment(af,
+ "testRnalifold_param.jar", "trial parameter writeout"));
+ assertTrue("Couldn't read back the Jar file", (nalf = new Jalview2XML(
+ false).LoadJalviewAlign("testRnalifold_param.jar")) != null);
+ if (nalf != null)
{
- AutoCalcSetting acs = af.getViewport().getCalcIdSettingsFor(alifoldClient.getCalcId());
- assertTrue("Calc ID settings not recovered from viewport stash", acs.equals(oldacs));
- assertTrue("Serialised Calc ID settings not identical to those recovered from viewport stash", acs.getWsParamFile().equals(oldsettings));
- JMenu nmenu=new JMenu();
- new SequenceAnnotationWSClient().attachWSMenuEntry(nmenu, rnaalifoldws, af);
- assertTrue("Couldn't get menu entry for service",nmenu.getItemCount()>0);
- for (Component itm: nmenu.getMenuComponents())
+ AutoCalcSetting acs = af.getViewport().getCalcIdSettingsFor(
+ alifoldClient.getCalcId());
+ assertTrue("Calc ID settings not recovered from viewport stash",
+ acs.equals(oldacs));
+ assertTrue(
+ "Serialised Calc ID settings not identical to those recovered from viewport stash",
+ acs.getWsParamFile().equals(oldsettings));
+ JMenu nmenu = new JMenu();
+ new SequenceAnnotationWSClient().attachWSMenuEntry(nmenu,
+ rnaalifoldws, af);
+ assertTrue("Couldn't get menu entry for service",
+ nmenu.getItemCount() > 0);
+ for (Component itm : nmenu.getMenuComponents())
{
if (itm instanceof JMenuItem)
{
JMenuItem i = (JMenuItem) itm;
- if (i.getText().equals(rnaalifoldws.getAlignAnalysisUI().getAAconToggle()))
- {
+ if (i.getText().equals(
+ rnaalifoldws.getAlignAnalysisUI().getAAconToggle()))
+ {
i.doClick();
break;
- }
+ }
}
}
while (af.getViewport().isCalcInProgress())
{
- try { Thread.sleep(200);
- } catch (Exception x) {};
+ try
+ {
+ Thread.sleep(200);
+ } catch (Exception x)
+ {
+ }
+ ;
}
- AutoCalcSetting acs2 = af.getViewport().getCalcIdSettingsFor(alifoldClient.getCalcId());
- assertTrue("Calc ID settings after recalculation has not been recovered.", acs2.getWsParamFile().equals(oldsettings));
+ AutoCalcSetting acs2 = af.getViewport().getCalcIdSettingsFor(
+ alifoldClient.getCalcId());
+ assertTrue(
+ "Calc ID settings after recalculation has not been recovered.",
+ acs2.getWsParamFile().equals(oldsettings));
}
}
}
"foo=',',min='foo',max='1,2,3',fa=','", ",").length == 4);
assertTrue("separatorListToArray is faulty.",
RestServiceDescription.separatorListToArray(
- "minsize='2', sep=','", ",").length != 2); // probably should come as 2
+ "minsize='2', sep=','", ",").length != 2); // probably
+ // should come as
+ // 2
}
@Test
testRsdExchange("Test using default Shmmr service",
RestClient.makeShmmrRestClient().service));
}
+
@Test
public void testShmmrServiceDataprep() throws Exception
{
RestClient _rc = RestClient.makeShmmrRestClient();
assertNotNull(_rc);
- AlignFrame alf = new jalview.io.FileLoader(false).LoadFileWaitTillLoaded("examples/testdata/smad.fa", jalview.io.FormatAdapter.FILE);
- assertNotNull("Couldn't find test data.",alf);
+ AlignFrame alf = new jalview.io.FileLoader(false)
+ .LoadFileWaitTillLoaded("examples/testdata/smad.fa",
+ jalview.io.FormatAdapter.FILE);
+ assertNotNull("Couldn't find test data.", alf);
alf.loadJalviewDataFile("examples/testdata/smad_groups.jva",
jalview.io.FormatAdapter.FILE, null, null);
- assertTrue("Couldn't load the test data's annotation file (should be 5 groups but found "+alf.getViewport().getAlignment().getGroups().size()+").", alf.getViewport().getAlignment().getGroups().size()==5);
-
+ assertTrue(
+ "Couldn't load the test data's annotation file (should be 5 groups but found "
+ + alf.getViewport().getAlignment().getGroups().size()
+ + ").", alf.getViewport().getAlignment().getGroups()
+ .size() == 5);
+
RestClient rc = new RestClient(_rc.service, alf, true);
-
-
-
- assertNotNull("Couldn't creat RestClient job.",rc);
+
+ assertNotNull("Couldn't creat RestClient job.", rc);
jalview.bin.Cache.initLogger();
- RestJob rjb = new RestJob(0, new RestJobThread(rc),rc.av.getAlignment(),null);
- rjb.setAlignmentForInputs(rc.service.getInputParams().values(), rc.av.getAlignment());
- for (Map.Entry<String,InputType> e:rc.service.getInputParams().entrySet()) {
- System.out.println("For Input '"+e.getKey()+":\n"+e.getValue().formatForInput(rjb).getContentLength());
+ RestJob rjb = new RestJob(0, new RestJobThread(rc),
+ rc.av.getAlignment(), null);
+ rjb.setAlignmentForInputs(rc.service.getInputParams().values(),
+ rc.av.getAlignment());
+ for (Map.Entry<String, InputType> e : rc.service.getInputParams()
+ .entrySet())
+ {
+ System.out.println("For Input '" + e.getKey() + ":\n"
+ + e.getValue().formatForInput(rjb).getContentLength());
}
}
/**
* @author jimp
- *
+ *
*/
public class DbRefFetcherTest
{
public void testStandardProtDbs()
{
String[] defdb = DBRefSource.PROTEINDBS;
- List<DbSourceProxy> srces = new ArrayList<DbSourceProxy>();
- for (String ddb : defdb)
- {
- SequenceFetcher sfetcher= new SequenceFetcher();
- List<DbSourceProxy> srcesfordb = sfetcher.getSourceProxy(ddb);
-
- if (srcesfordb != null)
- {
- srces.addAll(srcesfordb);
- }
- }
- DbSourceProxy uniprot=null;
- int i=0;
- // append the selected sequence sources to the default dbs
- for (DbSourceProxy s:srces)
- {
- if (s.getDbSource().equalsIgnoreCase(DBRefSource.UNIPROT))
+ List<DbSourceProxy> srces = new ArrayList<DbSourceProxy>();
+ for (String ddb : defdb)
{
- i++;
+ SequenceFetcher sfetcher = new SequenceFetcher();
+ List<DbSourceProxy> srcesfordb = sfetcher.getSourceProxy(ddb);
+
+ if (srcesfordb != null)
+ {
+ srces.addAll(srcesfordb);
+ }
}
-
- if (s instanceof jalview.ws.dbsources.Uniprot)
+ DbSourceProxy uniprot = null;
+ int i = 0;
+ // append the selected sequence sources to the default dbs
+ for (DbSourceProxy s : srces)
{
- uniprot = s;
- break;
+ if (s.getDbSource().equalsIgnoreCase(DBRefSource.UNIPROT))
+ {
+ i++;
+ }
+
+ if (s instanceof jalview.ws.dbsources.Uniprot)
+ {
+ uniprot = s;
+ break;
+ }
}
- }
-
- assertTrue("Failed to find Uniprot source as first source amongst "+srces.size()+" sources (source was at position "+i+")", uniprot!=null && i<2);
+
+ assertTrue("Failed to find Uniprot source as first source amongst "
+ + srces.size() + " sources (source was at position " + i + ")",
+ uniprot != null && i < 2);
}
}