Colour etc is now globally set
authoramwaterhouse <Andrew Waterhouse>
Fri, 10 Dec 2004 14:32:06 +0000 (14:32 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 10 Dec 2004 14:32:06 +0000 (14:32 +0000)
src/jalview/gui/AlignFrame.java

index 67995b2..ab5fb17 100755 (executable)
@@ -70,7 +70,7 @@ public class AlignFrame extends GAlignFrame
 \r
   protected void htmlMenuItem_actionPerformed(ActionEvent e)\r
   {\r
-    HTMLOutput htmlOutput = new HTMLOutput(viewport.getAlignment(), alignPanel.seqPanel.getColourScheme());\r
+    HTMLOutput htmlOutput = new HTMLOutput(viewport);\r
     htmlOutput = null;\r
   }\r
 \r
@@ -453,43 +453,6 @@ public class AlignFrame extends GAlignFrame
   }\r
 \r
 \r
- /* void updateResidueView()\r
-  {\r
-    if (viewport.getSelection().size() == 0)\r
-     {\r
-       for (int i = 0; i < viewport.alignment.getGroups().size(); i++)\r
-       {\r
-         SequenceGroup sg = (SequenceGroup) viewport.alignment.getGroups().elementAt(i);\r
-         sg.setDisplayBoxes( viewBoxesMenuItem.isSelected() );\r
-         sg.setDisplayText( viewTextMenuItem.isSelected() );\r
-         sg.setColourText( colourTextMenuItem.isSelected() );\r
-       }\r
-     }\r
-     else\r
-     {\r
-       SequenceGroup sg = viewport.alignment.findGroup( (Sequence) viewport.sel.sequenceAt(0));\r
-       if (alignPanel.seqPanel.isNewSelection(sg))\r
-       {\r
-         sg = viewport.getAlignment().addGroup();\r
-         for (int i = 0; i < viewport.getSelection().size(); i++)\r
-         {\r
-           viewport.alignment.removeFromGroup(viewport.alignment.findGroup( (\r
-               Sequence) viewport.sel.sequenceAt(i)),\r
-                                              (Sequence) viewport.sel.sequenceAt(\r
-               i));\r
-           viewport.alignment.addToGroup(sg,\r
-                                         (Sequence) viewport.sel.sequenceAt(i));\r
-         }\r
-       }\r
-\r
-       sg.setDisplayBoxes(viewBoxesMenuItem.isSelected());\r
-       sg.setDisplayText(viewTextMenuItem.isSelected());\r
-       sg.setColourText(colourTextMenuItem.isSelected());\r
-     }\r
-    alignPanel.RefreshPanels();\r
-  }*/\r
-\r
-\r
   public void consensusGraphMenuItem_actionPerformed(ActionEvent e)\r
   {\r
     alignPanel.setGraphPanelVisible( consensusGraphMenuItem.isSelected() );\r
@@ -526,7 +489,8 @@ public class AlignFrame extends GAlignFrame
 \r
   protected void noColourmenuItem_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme(null, false);\r
+    viewport.setGlobalColourScheme( null );\r
+    alignPanel.setColourScheme();\r
   }\r
 \r
 \r
@@ -537,52 +501,58 @@ public class AlignFrame extends GAlignFrame
 \r
   public void zappoColour_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme( new ZappoColourScheme(), conservationMenuItem.isSelected() );\r
+    viewport.setGlobalColourScheme(new ZappoColourScheme() );\r
+    alignPanel.setColourScheme(  );\r
   }\r
 \r
   public void taylorColour_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme( new TaylorColourScheme(),conservationMenuItem.isSelected() );\r
+    viewport.setGlobalColourScheme(new TaylorColourScheme() );\r
+    alignPanel.setColourScheme(  );\r
   }\r
 \r
 \r
   public void hydrophobicityColour_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme( new HydrophobicColourScheme(),conservationMenuItem.isSelected() );\r
+    viewport.setGlobalColourScheme( new HydrophobicColourScheme() );\r
+    alignPanel.setColourScheme( );\r
   }\r
 \r
   public void helixColour_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme( new HelixColourScheme(),conservationMenuItem.isSelected() );\r
+    viewport.setGlobalColourScheme( new HelixColourScheme()  );\r
+    alignPanel.setColourScheme();\r
   }\r
 \r
 \r
   public void strandColour_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme( new StrandColourScheme() ,conservationMenuItem.isSelected() );\r
+    viewport.setGlobalColourScheme(new StrandColourScheme() );\r
+    alignPanel.setColourScheme(  );\r
   }\r
 \r
 \r
   public void turnColour_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme( new TurnColourScheme() ,conservationMenuItem.isSelected() );\r
+    viewport.setGlobalColourScheme(new TurnColourScheme() );\r
+    alignPanel.setColourScheme(  );\r
   }\r
 \r
 \r
   public void buriedColour_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme( new BuriedColourScheme() ,conservationMenuItem.isSelected() );\r
+    viewport.setGlobalColourScheme( new BuriedColourScheme() );\r
+    alignPanel.setColourScheme( );\r
   }\r
 \r
 \r
   protected  void conservationMenuItem_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme ( alignPanel.seqPanel.getColourScheme(),conservationMenuItem.isSelected() );\r
+    viewport.setConservationSelected(conservationMenuItem.isSelected());\r
     conservationColourIncMenuItem.setEnabled( conservationMenuItem.isSelected() );\r
+    alignPanel.setColourScheme();\r
   }\r
 \r
-\r
-\r
   public void conservationColourIncMenuItem_actionPerformed(ActionEvent e)\r
  {\r
    ConservationIncrementPanel cip = new ConservationIncrementPanel(viewport, alignPanel);\r
@@ -595,14 +565,15 @@ public class AlignFrame extends GAlignFrame
 \r
   public void abovePIDColour_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme( new PIDColourScheme() ,conservationMenuItem.isSelected() );\r
+    viewport.setGlobalColourScheme(new PIDColourScheme());\r
+    alignPanel.setColourScheme( );\r
   }\r
 \r
 \r
   public void userDefinedColour_actionPerformed(ActionEvent e)\r
   {\r
     JInternalFrame frame = new JInternalFrame();\r
-    UserDefinedColours chooser = new UserDefinedColours( frame, alignPanel.seqPanel );\r
+    UserDefinedColours chooser = new UserDefinedColours( frame, viewport );\r
     frame.setContentPane(chooser);\r
     Desktop.addInternalFrame(frame,"User defined colours", 450,540 );\r
     frame.setResizable(false);\r
@@ -612,20 +583,22 @@ public class AlignFrame extends GAlignFrame
 \r
   public void PIDColour_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme( new PIDColourScheme(),conservationMenuItem.isSelected() );\r
+    viewport.setGlobalColourScheme(new PIDColourScheme() );\r
+    alignPanel.setColourScheme( );\r
   }\r
 \r
 \r
   public void BLOSUM62Colour_actionPerformed(ActionEvent e)\r
   {\r
-    alignPanel.setColourScheme( new Blosum62ColourScheme(viewport) ,conservationMenuItem.isSelected() );\r
+    viewport.setGlobalColourScheme( new Blosum62ColourScheme(viewport)  );\r
+    alignPanel.setColourScheme();\r
   }\r
 \r
 \r
 \r
   protected void schemeKeyMenuItem_actionPerformed(ActionEvent e)\r
   {\r
-    ColourKey colourKey = new ColourKey( alignPanel.seqPanel.getColourScheme() );\r
+    ColourKey colourKey = new ColourKey( viewport.getGlobalColourScheme() );\r
     Desktop.addInternalFrame(colourKey, "Colour scheme key", 400, 320);\r
   }\r
 \r