From: Jim Procter Date: Tue, 16 Oct 2018 15:38:10 +0000 (+0100) Subject: JAL-3127 use AlignViewportI.addGroup to create & propagate groups to complement view... X-Git-Tag: Release_2_11_0~17^2~46^2~14 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6c2b68627777b6731f3e1081fb7437b9678c9670;p=jalview.git JAL-3127 use AlignViewportI.addGroup to create & propagate groups to complement view and update structure views accordingly --- diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java index d992e4e..a5a3591 100644 --- a/src/jalview/controller/AlignViewController.java +++ b/src/jalview/controller/AlignViewController.java @@ -35,6 +35,7 @@ import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.io.DataSourceType; import jalview.io.FeaturesFile; +import jalview.schemes.ColourSchemeI; import jalview.util.MessageManager; import java.awt.Color; @@ -97,19 +98,23 @@ public class AlignViewController implements AlignViewControllerI viewport.getAlignment().deleteAllGroups(); viewport.clearSequenceColours(); viewport.setSelectionGroup(null); + ColourSchemeI colours = viewport.getGlobalColourScheme(); // set view properties for each group for (int g = 0; g < gps.length; g++) { // gps[g].setShowunconserved(viewport.getShowUnconserved()); gps[g].setshowSequenceLogo(viewport.isShowSequenceLogo()); viewport.getAlignment().addGroup(gps[g]); - Color col = new Color((int) (Math.random() * 255), - (int) (Math.random() * 255), (int) (Math.random() * 255)); - col = col.brighter(); - for (SequenceI sq : gps[g].getSequences(null)) + if (colours != null) { - viewport.setSequenceColour(sq, col); + gps[g].setColourScheme(colours.getInstance(viewport, gps[g], + viewport.getHiddenRepSequences())); } + Color col = new Color((int) (Math.random() * 255), + (int) (Math.random() * 255), (int) (Math.random() * 255)); + gps[g].idColour = col; + viewport.setUpdateStructures(true); + viewport.addSequenceGroup(gps[g]); } return true; } diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 4d1f800..0c8c8a6 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -5285,7 +5285,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { PaintRefresher.Refresh(this, viewport.getSequenceSetId()); alignPanel.updateAnnotation(); - alignPanel.paintAlignment(true, true); + alignPanel.paintAlignment(true, + viewport.needToUpdateStructureViews()); } }