X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAlignFrame.java;h=f7cfba092f430d4ec32699c7ee203966adf49805;hb=5a15b7773aaad3bba1bb342198e2bcf4cc2cdffe;hp=bad78485fa0fe257bbc247c459f99981c4e5f3b2;hpb=a9514dd266ef856c485fd8f9108a3797b87add3f;p=jalview.git diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index bad7848..f7cfba0 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -30,6 +30,7 @@ import jalview.commands.*; import jalview.datamodel.*; import jalview.io.*; import jalview.schemes.*; +import jalview.structure.StructureSelectionManager; public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemListener, KeyListener @@ -70,6 +71,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, annotationPanelMenuItem.setState(viewport.showAnnotation); displayNonconservedMenuItem.setState(viewport.getShowunconserved()); followMouseOverFlag.setState(viewport.getFollowHighlight()); + showGroupConsensus.setState(viewport.showGroupConsensus); + showGroupConservation.setState(viewport.showGroupConservation); + showConsensusHistogram.setState(viewport.showConsensusHistogram); + showSequenceLogo.setState(viewport.showSequenceLogo); seqLimits.setState(viewport.showJVSuffix); @@ -135,6 +140,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, alignPanel.idPanel.idCanvas.addKeyListener(this); alignPanel.scalePanel.addKeyListener(this); alignPanel.annotationPanel.addKeyListener(this); + alignPanel.annotationPanelHolder.addKeyListener(this); + alignPanel.annotationSpaceFillerHolder.addKeyListener(this); + alignPanel.alabels.addKeyListener(this); createAlignFrameWindow(embedded, title); alignPanel.validate(); alignPanel.paintAlignment(true); @@ -202,6 +210,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { case 27: // escape key deselectAllSequenceMenuItem_actionPerformed(); + + alignPanel.alabels.cancelDrag(); break; case KeyEvent.VK_X: if (evt.isControlDown() || evt.isMetaDown()) @@ -597,7 +607,26 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { mouseOverFlag_stateChanged(); } - + else if (evt.getSource() == showGroupConsensus) + { + showGroupConsensus_actionPerformed(); + } + else if (evt.getSource() == showGroupConservation) + { + showGroupConservation_actionPerformed(); + } + else if (evt.getSource() == showSequenceLogo) + { + showSequenceLogo_actionPerformed(); + } + else if (evt.getSource() == showConsensusHistogram) + { + showConsensusHistogram_actionPerformed(); + } + else if (evt.getSource() == applyAutoAnnotationSettings) + { + applyAutoAnnotationSettings_actionPerformed(); + } alignPanel.paintAlignment(true); } @@ -787,6 +816,26 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, viewport.showAllHiddenSeqs(); alignPanel.paintAlignment(true); } + else if (source == showGroupConsensus) + { + showGroupConsensus_actionPerformed(); + } + else if (source == showGroupConservation) + { + showGroupConservation_actionPerformed(); + } + else if (source == showSequenceLogo) + { + showSequenceLogo_actionPerformed(); + } + else if (source == showConsensusHistogram) + { + showConsensusHistogram_actionPerformed(); + } + else if (source == applyAutoAnnotationSettings) + { + applyAutoAnnotationSettings_actionPerformed(); + } else if (source == featureSettings) { new FeatureSettings(alignPanel); @@ -1641,6 +1690,56 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, viewport.sendSelection(); } + /** + * group consensus toggled + * + */ + protected void showGroupConsensus_actionPerformed() + { + viewport.setShowGroupConsensus(showGroupConsensus.getState()); + alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState()); + + } + + /** + * group conservation toggled. + */ + protected void showGroupConservation_actionPerformed() + { + viewport.setShowGroupConservation(showGroupConservation.getState()); + alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState()); + } + + /* + * (non-Javadoc) + * + * @see + * jalview.jbgui.GAlignFrame#showConsensusHistogram_actionPerformed(java.awt + * .event.ActionEvent) + */ + protected void showConsensusHistogram_actionPerformed() + { + viewport.setShowConsensusHistogram(showConsensusHistogram.getState()); + alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState()); + } + /* + * (non-Javadoc) + * + * @see + * jalview.jbgui.GAlignFrame#showConsensusProfile_actionPerformed(java.awt + * .event.ActionEvent) + */ + protected void showSequenceLogo_actionPerformed() + { + viewport.setShowSequenceLogo(showSequenceLogo.getState()); + alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState()); + } + + protected void applyAutoAnnotationSettings_actionPerformed() + { + alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState()); + } + protected void makeGrpsFromSelection_actionPerformed() { if (viewport.getSelectionGroup() != null) @@ -1668,7 +1767,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, ; } PaintRefresher.Refresh(this, viewport.getSequenceSetId()); - // alignPanel.updateAnnotation(); + alignPanel.updateAnnotation(); alignPanel.paintAlignment(true); } } @@ -2371,7 +2470,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, || (viewport.getSelectionGroup() == null && viewport.alignment .getHeight() > 1)) { - final TreePanel tp = new TreePanel(viewport, type, pwType); + final TreePanel tp = new TreePanel(alignPanel, type, pwType); addTreeMenuItem(tp, title); @@ -2391,7 +2490,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, public void loadTree(jalview.io.NewickFile tree, String treeFile) { - TreePanel tp = new TreePanel(viewport, treeFile, "From File - ", tree); + TreePanel tp = new TreePanel(alignPanel, treeFile, "From File - ", tree); jalview.bin.JalviewLite.addFrame(tp, treeFile, 600, 500); addTreeMenuItem(tp, treeFile); } @@ -2756,8 +2855,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, CheckboxMenuItem seqLimits = new CheckboxMenuItem(); CheckboxMenuItem centreColumnLabelFlag = new CheckboxMenuItem(); - + CheckboxMenuItem followMouseOverFlag = new CheckboxMenuItem(); + Menu autoAnnMenu=new Menu(); + CheckboxMenuItem showSequenceLogo= new CheckboxMenuItem(); + CheckboxMenuItem applyAutoAnnotationSettings = new CheckboxMenuItem(); + CheckboxMenuItem showConsensusHistogram = new CheckboxMenuItem(); + CheckboxMenuItem showGroupConsensus = new CheckboxMenuItem(); + CheckboxMenuItem showGroupConservation = new CheckboxMenuItem(); private void jbInit() throws Exception { @@ -2961,6 +3066,14 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, hideAllButSelection.setLabel("All but Selected Region (Shift+Ctrl+H)"); hideAllSelection.setLabel("Selected Region"); showAllHidden.setLabel("All Sequences and Columns"); + showGroupConsensus.setLabel("Group Consensus"); + showGroupConservation.setLabel("Group Conservation"); + showConsensusHistogram.setLabel("Show Consensus Histogram"); + showSequenceLogo.setLabel("Show Consensus Logo"); + applyAutoAnnotationSettings.setLabel("Apply to all groups"); + applyAutoAnnotationSettings.setState(true); + autoAnnMenu.setLabel("Autocalculated Annotation"); + invertColSel.addActionListener(this); showColumns.addActionListener(this); showSeqs.addActionListener(this); @@ -2969,6 +3082,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, hideAllButSelection.addActionListener(this); hideAllSelection.addActionListener(this); showAllHidden.addActionListener(this); + showGroupConsensus.addItemListener(this); + showGroupConservation.addItemListener(this); + showConsensusHistogram.addItemListener(this); + showSequenceLogo.addItemListener(this); + applyAutoAnnotationSettings.addItemListener(this); formatMenu.setLabel("Format"); selectMenu.setLabel("Select"); newView.setLabel("New View"); @@ -3018,6 +3136,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, viewMenu.addSeparator(); viewMenu.add(followMouseOverFlag); viewMenu.add(annotationPanelMenuItem); + autoAnnMenu.add(applyAutoAnnotationSettings); + autoAnnMenu.add(showConsensusHistogram); + autoAnnMenu.add(showSequenceLogo); + autoAnnMenu.addSeparator(); + autoAnnMenu.add(showGroupConservation); + autoAnnMenu.add(showGroupConsensus); + viewMenu.add(autoAnnMenu); viewMenu.addSeparator(); viewMenu.add(sequenceFeatures); viewMenu.add(featureSettings); @@ -3370,6 +3495,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, return; } } + if (applet.useXtrnalSviewer) + { + // register the association(s) and quit, don't create any windows. + StructureSelectionManager.getStructureSelectionManager().setMapping(seqs, chains, pdb.getFile(), protocol); + return; + } if (applet.isAlignPdbStructures() && applet.jmolAvailable) { // can only do alignments with Jmol