public void run()\r
{\r
PrinterJob printJob = PrinterJob.getPrinterJob();\r
+ // printJob.\r
PageFormat pf = printJob.pageDialog(printJob.defaultPage());\r
printJob.setPrintable(alignPanel, pf);\r
if (printJob.printDialog())\r
\r
protected void colourTextMenuItem_actionPerformed(ActionEvent e)\r
{\r
- viewport.setColourText( colourTextMenuItem.isSelected() );\r
- alignPanel.RefreshPanels();\r
+ updateResidueView();\r
}\r
\r
void SetFont()\r
\r
protected void wrapMenuItem_actionPerformed(ActionEvent e)\r
{\r
- viewport.setWrapAlignment( wrapMenuItem.isSelected() );\r
- alignPanel.setWrapAlignment( wrapMenuItem.isSelected() );\r
+ updateResidueView();\r
}\r
\r
\r
public void viewBoxesMenuItem_actionPerformed(ActionEvent e)\r
{\r
- viewport.setShowBoxes( viewBoxesMenuItem.isSelected() );\r
- alignPanel.RefreshPanels();\r
+ updateResidueView();\r
}\r
\r
public void viewTextMenuItem_actionPerformed(ActionEvent e)\r
{\r
- viewport.setShowText( viewTextMenuItem.isSelected() );\r
+ updateResidueView();\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