X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignFrame.java;h=f05c118472e3217b34fa3af86100407155869a81;hb=45922d35b5dc6c73b3d0c55ef2ab884079723782;hp=36db24818cf9062de61422feda63e1d18156ca51;hpb=116f357c7b1056f7c20dd0f7ecbcb50ea50e4e72;p=jalview.git diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 36db248..f05c118 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -24,6 +24,7 @@ import jalview.analysis.AlignmentSorter; import jalview.analysis.AlignmentUtils; import jalview.analysis.CrossRef; import jalview.analysis.Dna; +import jalview.analysis.GeneticCodeI; import jalview.analysis.ParseProperties; import jalview.analysis.SequenceIdMatcher; import jalview.api.AlignExportSettingI; @@ -32,6 +33,7 @@ import jalview.api.AlignViewControllerI; import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; import jalview.api.FeatureSettingsControllerI; +import jalview.api.FeatureSettingsModelI; import jalview.api.SplitContainerI; import jalview.api.ViewStyleI; import jalview.api.analysis.SimilarityParamsI; @@ -135,6 +137,7 @@ import java.util.Hashtable; import java.util.List; import java.util.Vector; +import javax.swing.ButtonGroup; import javax.swing.JCheckBoxMenuItem; import javax.swing.JEditorPane; import javax.swing.JInternalFrame; @@ -964,10 +967,15 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, return progressBar.operationInProgress(); } + /** + * Sets the text of the status bar. Note that setting a null or empty value + * will cause the status bar to be hidden, with possibly undesirable flicker + * of the screen layout. + */ @Override public void setStatus(String text) { - statusBar.setText(text); + statusBar.setText(text == null || text.isEmpty() ? " " : text); } /* @@ -2085,7 +2093,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, newGraphGroups.add(q, null); } newGraphGroups.set(newann.graphGroup, - new Integer(++fgroup)); + Integer.valueOf(++fgroup)); } newann.graphGroup = newGraphGroups.get(newann.graphGroup) .intValue(); @@ -2132,7 +2140,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, newGraphGroups.add(q, null); } newGraphGroups.set(newann.graphGroup, - new Integer(++fgroup)); + Integer.valueOf(++fgroup)); } newann.graphGroup = newGraphGroups.get(newann.graphGroup) .intValue(); @@ -2413,6 +2421,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, sg.setEndRes(viewport.getAlignment().getWidth() - 1); viewport.setSelectionGroup(sg); + viewport.isSelectionGroupChanged(true); viewport.sendSelection(); // JAL-2034 - should delegate to // alignPanel to decide if overview needs @@ -2734,6 +2743,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, newap.av.setRedoList(viewport.getRedoList()); /* + * copy any visualisation settings that are not saved in the project + */ + newap.av.setColourAppliesToAllGroups( + viewport.getColourAppliesToAllGroups()); + + /* * Views share the same mappings; need to deregister any new mappings * created by copyAlignPanel, and register the new reference to the shared * mappings @@ -3043,6 +3058,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, viewport.expandColSelection(sg, false); viewport.hideAllSelectedSeqs(); viewport.hideSelectedColumns(); + alignPanel.updateLayout(); alignPanel.paintAlignment(true, true); viewport.sendSelection(); } @@ -3067,6 +3083,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, public void hideSelColumns_actionPerformed(ActionEvent e) { viewport.hideSelectedColumns(); + alignPanel.updateLayout(); alignPanel.paintAlignment(true, true); viewport.sendSelection(); } @@ -3088,7 +3105,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, protected void scaleAbove_actionPerformed(ActionEvent e) { viewport.setScaleAboveWrapped(scaleAbove.isSelected()); - // TODO: do we actually need to update overview for scale above change ? + alignPanel.updateLayout(); alignPanel.paintAlignment(true, false); } @@ -3102,6 +3119,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, protected void scaleLeft_actionPerformed(ActionEvent e) { viewport.setScaleLeftWrapped(scaleLeft.isSelected()); + alignPanel.updateLayout(); alignPanel.paintAlignment(true, false); } @@ -3115,6 +3133,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, protected void scaleRight_actionPerformed(ActionEvent e) { viewport.setScaleRightWrapped(scaleRight.isSelected()); + alignPanel.updateLayout(); alignPanel.paintAlignment(true, false); } @@ -3168,6 +3187,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, @Override public void featureSettings_actionPerformed(ActionEvent e) { + showFeatureSettingsUI(); + } + + @Override + public FeatureSettingsControllerI showFeatureSettingsUI() + { if (featureSettings != null) { featureSettings.close(); @@ -3180,6 +3205,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, showSeqFeatures_actionPerformed(null); } featureSettings = new FeatureSettings(this); + return featureSettings; } /** @@ -3336,6 +3362,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * otherwise set the chosen colour scheme (or null for 'None') */ ColourSchemeI cs = ColourSchemes.getInstance().getColourScheme(name, + viewport, viewport.getAlignment(), viewport.getHiddenRepSequences()); changeColour(cs); } @@ -4268,14 +4295,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, * frame's DNA sequences to their aligned protein (amino acid) equivalents. */ @Override - public void showTranslation_actionPerformed(ActionEvent e) + public void showTranslation_actionPerformed(GeneticCodeI codeTable) { AlignmentI al = null; try { Dna dna = new Dna(viewport, viewport.getViewAsVisibleContigs(true)); - al = dna.translateCdna(); + al = dna.translateCdna(codeTable); } catch (Exception ex) { jalview.bin.Cache.log.error( @@ -4304,7 +4331,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, af.setFileFormat(this.currentFileFormat); final String newTitle = MessageManager .formatMessage("label.translation_of_params", new Object[] - { this.getTitle() }); + { this.getTitle(), codeTable.getId() }); af.setTitle(newTitle); if (Cache.getDefault(Preferences.ENABLE_SPLIT_FRAME, true)) { @@ -4472,7 +4499,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, int assocfiles = 0; if (filesmatched.size() > 0) { - boolean autoAssociate = Cache.getDefault("AUTOASSOCIATE_PDBANDSEQS", false); + boolean autoAssociate = Cache + .getDefault("AUTOASSOCIATE_PDBANDSEQS", false); if (!autoAssociate) { String msg = MessageManager.formatMessage( @@ -4915,6 +4943,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, @Override public void finished() { + + for (FeatureSettingsModelI srcSettings : dbRefFetcher + .getFeatureSettingsModels()) + { + + alignPanel.av.mergeFeaturesStyle(srcSettings); + } AlignFrame.this.setMenusForViewport(); } }); @@ -5000,6 +5035,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, @Override public void finished() { + FeatureSettingsModelI srcSettings = dassource[0] + .getFeatureColourScheme(); + alignPanel.av.mergeFeaturesStyle( + srcSettings); AlignFrame.this.setMenusForViewport(); } }); @@ -5292,7 +5331,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { PaintRefresher.Refresh(this, viewport.getSequenceSetId()); alignPanel.updateAnnotation(); - alignPanel.paintAlignment(true, true); + alignPanel.paintAlignment(true, + viewport.needToUpdateStructureViews()); } } @@ -5578,15 +5618,16 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, colourMenu.add(textColour); colourMenu.addSeparator(); - ColourMenuHelper.addMenuItems(colourMenu, this, viewport.getAlignment(), - false); + ButtonGroup bg = ColourMenuHelper.addMenuItems(colourMenu, this, + viewport.getAlignment(), false); + colourMenu.add(annotationColour); + bg.add(annotationColour); colourMenu.addSeparator(); colourMenu.add(conservationMenuItem); colourMenu.add(modifyConservation); colourMenu.add(abovePIDThreshold); colourMenu.add(modifyPID); - colourMenu.add(annotationColour); ColourSchemeI colourScheme = viewport.getGlobalColourScheme(); ColourMenuHelper.setColourSelected(colourMenu, colourScheme);