From: amwaterhouse Date: Thu, 3 May 2007 14:40:57 +0000 (+0000) Subject: optimize repaints X-Git-Tag: Release_2_3~68 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fd618c7346eab858aa0039376872820aca37783a;p=jalview.git optimize repaints --- diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index 2996c98..3418270 100755 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -276,7 +276,7 @@ public class AlignViewport { if (ap != null) { - ap.paintAlignment(true); + ap.paintAlignment(false); } Thread.sleep(200); } @@ -454,7 +454,7 @@ public class AlignViewport { if (ap != null) { - ap.paintAlignment(true); + ap.paintAlignment(false); } Thread.sleep(200); diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index 53115d2..538d177 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -471,6 +471,7 @@ public class AppletJmol extends Frame } FeatureRenderer fr; + String lastCommand; public void colourBySequence(AlignmentPanel ap) { if(!colourBySequence) @@ -482,7 +483,7 @@ public class AppletJmol extends Frame if (mapping.length < 1) return; - SequenceRenderer sr = ap.seqPanel.seqCanvas.getSequenceRenderer(); + SequenceRenderer sr = new SequenceRenderer(ap.av); boolean showFeatures = false; if (ap.av.showSequenceFeatures) @@ -549,7 +550,10 @@ public class AppletJmol extends Frame } } - viewer.evalStringQuiet(command.toString()); + if (lastCommand != null && !lastCommand.equals(command.toString())) + viewer.evalStringQuiet(command.toString()); + + lastCommand = command.toString(); } StringBuffer condenseCommand(String command, int pos) diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index b68008a..cbb19fb 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -300,7 +300,7 @@ public class AlignViewport { if (ap != null) { - ap.paintAlignment(true); + ap.paintAlignment(false); } Thread.sleep(200); } @@ -496,7 +496,7 @@ public class AlignViewport { if (ap != null) { - ap.paintAlignment(true); + ap.paintAlignment(false); } Thread.sleep(200); @@ -1466,7 +1466,7 @@ public class AlignViewport } /** - * This method returns an array of new SequenceI objects + * This method returns an array of new SequenceI objects * derived from the whole alignment or just the current * selection with start and end points adjusted * @note if you need references to the actual SequenceI objects in the alignment or currently selected then use getSequenceSelection() @@ -1479,7 +1479,7 @@ public class AlignViewport if (selectionGroup == null) { sequences = alignment.getSequencesArray(); - AlignmentAnnotation[] annots = alignment.getAlignmentAnnotation(); + AlignmentAnnotation[] annots = alignment.getAlignmentAnnotation(); for (int i=0; i