From: amwaterhouse Date: Tue, 15 Feb 2005 10:45:46 +0000 (+0000) Subject: add applytoallgroups colouring option X-Git-Tag: Release_2_0~660 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d7b6fc2a38b90786ce62ea4e8a418e05b24e5352;p=jalview.git add applytoallgroups colouring option --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 3a38769..686ecbc 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -635,171 +635,187 @@ public class AlignFrame extends GAlignFrame protected void noColourmenuItem_actionPerformed(ActionEvent e) { - viewport.setGlobalColourScheme( null ); - changeColour(); + changeColour( null ); } public void clustalColour_actionPerformed(ActionEvent e) { - viewport.setGlobalColourScheme( - new ClustalxColourScheme(viewport.alignment.getSequences(), viewport.alignment.getWidth())); abovePIDThreshold.setSelected(false); - changeColour(); + changeColour(new ClustalxColourScheme(viewport.alignment.getSequences(), viewport.alignment.getWidth())); } public void zappoColour_actionPerformed(ActionEvent e) { - viewport.setGlobalColourScheme(new ZappoColourScheme() ); - changeColour(); + changeColour(new ZappoColourScheme()); } public void taylorColour_actionPerformed(ActionEvent e) { - viewport.setGlobalColourScheme(new TaylorColourScheme() ); - changeColour(); + changeColour(new TaylorColourScheme()); } public void hydrophobicityColour_actionPerformed(ActionEvent e) { - viewport.setGlobalColourScheme( new HydrophobicColourScheme() ); - changeColour(); + changeColour( new HydrophobicColourScheme() ); } public void helixColour_actionPerformed(ActionEvent e) { - viewport.setGlobalColourScheme( new HelixColourScheme() ); - changeColour(); + changeColour(new HelixColourScheme() ); } public void strandColour_actionPerformed(ActionEvent e) { - viewport.setGlobalColourScheme(new StrandColourScheme() ); - changeColour(); + changeColour(new StrandColourScheme()); } public void turnColour_actionPerformed(ActionEvent e) { - viewport.setGlobalColourScheme(new TurnColourScheme() ); - changeColour(); + changeColour(new TurnColourScheme()); } public void buriedColour_actionPerformed(ActionEvent e) { - viewport.setGlobalColourScheme( new BuriedColourScheme() ); - changeColour(); + changeColour(new BuriedColourScheme() ); } public void nucleotideColour_actionPerformed(ActionEvent e) { - viewport.setGlobalColourScheme( new NucleotideColourScheme() ); - changeColour(); + changeColour(new NucleotideColourScheme()); } - void changeColour() + protected void applyToAllGroups_actionPerformed(ActionEvent e) { - if(abovePIDThreshold.isSelected()) - abovePIDThreshold_actionPerformed(null); - else if(conservationMenuItem.isSelected()) - conservationMenuItem_actionPerformed(null); - - alignPanel.RefreshPanels(); + viewport.setColourAppliesToAllGroups(applyToAllGroups.isSelected()); } - protected void conservationMenuItem_actionPerformed(ActionEvent e) + + void changeColour(ColourSchemeI cs) { - if(abovePIDThreshold.isSelected()) - { - abovePIDThreshold.setSelected(false); - Desktop.hidePIDSlider(); - } - viewport.setConservationSelected(conservationMenuItem.isSelected()); + if(viewport.getColourAppliesToAllGroups()) + { + Vector groups = viewport.alignment.getGroups(); + for(int i=0; i