X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FAlignFrame.java;h=a50e724ec08a957a914b423929c59b37e3c0dbad;hb=27d1490bba5753b3f9c8fac0647cfe8148c53310;hp=304cfb757ea8d90f802c12d56e3ca1c6b52fce88;hpb=f52f7b378972cc884b5d3e5cc250f89667f558f7;p=jalview.git diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 304cfb7..a50e724 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -737,7 +737,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, updateEditMenuBar(); } - + // methods for implementing IProgressIndicator + // need to refactor to a reusable stub class Hashtable progressBars, progressBarHandlers; /* @@ -829,6 +830,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * * @return true if any progress bars are still active */ + @Override public boolean operationInProgress() { if (progressBars != null && progressBars.size() > 0) @@ -1779,6 +1781,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } int alwidth = 0; + ArrayList newGraphGroups=new ArrayList(); + int fgroup=-1; if (newAlignment) { @@ -1846,6 +1850,16 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { newDs.clear(); // tidy up } + if (alignment.getAlignmentAnnotation()!=null) + { + for (AlignmentAnnotation alan:alignment.getAlignmentAnnotation()) + { + if (alan.graphGroup>fgroup) + { + fgroup=alan.graphGroup; + } + } + } if (pastedal.getAlignmentAnnotation() != null) { // Add any annotation attached to alignment. @@ -1856,6 +1870,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (alann[i].sequenceRef == null && !alann[i].autoCalculated) { AlignmentAnnotation newann = new AlignmentAnnotation(alann[i]); + if (newann.graphGroup>-1) + { + if (newGraphGroups.size()<=newann.graphGroup || newGraphGroups.get(newann.graphGroup)==null) + { + for (int q=newGraphGroups.size();q<=newann.graphGroup; q++) + { + newGraphGroups.add(q, null); + } + newGraphGroups.set(newann.graphGroup,new Integer(++fgroup)); + } + newann.graphGroup = newGraphGroups.get(newann.graphGroup).intValue(); + } + newann.padAnnotation(alwidth); alignment.addAnnotation(newann); } @@ -1875,11 +1902,28 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { if (sequences[i].getAnnotation() != null) { + AlignmentAnnotation newann; for (int a = 0; a < sequences[i].getAnnotation().length; a++) { annotationAdded = true; - sequences[i].getAnnotation()[a].adjustForAlignment(); - sequences[i].getAnnotation()[a].padAnnotation(alwidth); + newann=sequences[i].getAnnotation()[a]; + newann.adjustForAlignment(); + newann.padAnnotation(alwidth); + if (newann.graphGroup>-1) + { + if (newann.graphGroup>-1) + { + if (newGraphGroups.size()<=newann.graphGroup || newGraphGroups.get(newann.graphGroup)==null) + { + for (int q=newGraphGroups.size();q<=newann.graphGroup; q++) + { + newGraphGroups.add(q, null); + } + newGraphGroups.set(newann.graphGroup,new Integer(++fgroup)); + } + newann.graphGroup = newGraphGroups.get(newann.graphGroup).intValue(); + } + } alignment.addAnnotation(sequences[i].getAnnotation()[a]); // annotation // was // duplicated @@ -1919,6 +1963,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, newann.padAnnotation(avwidth); alview[avnum].addAnnotation(newann); // annotation was // duplicated earlier + // TODO JAL-1145 graphGroups are not updated for sequence annotation added to several views. This may cause strangeness alview[avnum].setAnnotationIndex(newann, a); } } @@ -1928,6 +1973,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } viewport.firePropertyChange("alignment", null, alignment.getSequences()); + if (alignPanels!=null ) {for (AlignmentPanel ap:((Vector)alignPanels)) + { + ap.validateAnnotationDimensions(false); + }} else { alignPanel.validateAnnotationDimensions(false);} } else @@ -4112,7 +4161,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, "Secondary Structure Prediction"); final JMenu seqsrchmenu = new JMenu("Sequence Database Search"); final JMenu analymenu = new JMenu("Analysis"); - final JMenu dismenu = new JMenu("Disorder"); + final JMenu dismenu = new JMenu("Protein Disorder"); // JAL-940 - only show secondary structure prediction services from // the legacy server if (// Cache.getDefault("SHOW_JWS1_SERVICES", true) @@ -4240,6 +4289,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } } catch (Exception e) { + Cache.log.debug("Exception during web service menu building process.",e); } ; }