X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;h=ac295a1dcec256d7744c1201f3414360a221f46b;hb=4a3def9f59cefe629c9a33d87483283aee085928;hp=3c520e39690f88bb3c2b02edd69197f2fc2344fa;hpb=1f029391e9e263b132a62eaefcc2fe68badacfd6;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 3c520e3..ac295a1 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -29,6 +29,7 @@ import jalview.api.FeatureSettingsModelI; import jalview.api.FeaturesDisplayedI; import jalview.api.ViewStyleI; import jalview.bin.Cache; +import jalview.bin.Console; import jalview.commands.CommandI; import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.Alignment; @@ -123,14 +124,14 @@ public class AlignViewport extends AlignmentViewport sequenceSetID = seqsetid; viewId = viewid; // TODO remove these once 2.4.VAMSAS release finished - if (Cache.log != null && Cache.log.isDebugEnabled() && seqsetid != null) + if (seqsetid != null) { - Cache.log.debug( + Console.debug( "Setting viewport's sequence set id : " + sequenceSetID); } - if (Cache.log != null && Cache.log.isDebugEnabled() && viewId != null) + if (viewId != null) { - Cache.log.debug("Setting viewport's view id : " + viewId); + Console.debug("Setting viewport's view id : " + viewId); } init(); @@ -185,14 +186,14 @@ public class AlignViewport extends AlignmentViewport sequenceSetID = seqsetid; viewId = viewid; // TODO remove these once 2.4.VAMSAS release finished - if (Cache.log != null && Cache.log.isDebugEnabled() && seqsetid != null) + if (seqsetid != null) { - Cache.log.debug( + Console.debug( "Setting viewport's sequence set id : " + sequenceSetID); } - if (Cache.log != null && Cache.log.isDebugEnabled() && viewId != null) + if (viewId != null) { - Cache.log.debug("Setting viewport's view id : " + viewId); + Console.debug("Setting viewport's view id : " + viewId); } if (hiddenColumns != null) @@ -290,8 +291,8 @@ public class AlignViewport extends AlignmentViewport schemeName = Cache.getDefault(Preferences.DEFAULT_COLOUR, ResidueColourScheme.NONE); } - ColourSchemeI colourScheme = ColourSchemeProperty - .getColourScheme(this, alignment, schemeName); + ColourSchemeI colourScheme = ColourSchemeProperty.getColourScheme(this, + alignment, schemeName); residueShading = new ResidueShader(colourScheme); if (colourScheme instanceof UserColourScheme) @@ -519,7 +520,6 @@ public class AlignViewport extends AlignmentViewport * return the alignPanel containing the given viewport. Use this to get the * components currently handling the given viewport. * - * @param av * @return null or an alignPanel guaranteed to have non-null alignFrame * reference */ @@ -594,7 +594,7 @@ public class AlignViewport extends AlignmentViewport // calculator.getRegisteredWorkersOfClass(settings.getWorkerClass()) if (needsUpdate) { - Cache.log.debug("trigger update for " + calcId); + Console.debug("trigger update for " + calcId); } } @@ -740,7 +740,7 @@ public class AlignViewport extends AlignmentViewport final String question = JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.open_split_window?")); final AlignViewport us = this; - + /* * options No, Split Window, New Window correspond to * dialog responses 0, 1, 2 (even though JOptionPane shows them @@ -752,7 +752,7 @@ public class AlignViewport extends AlignmentViewport @Override public void run() { - addDataToAlignment(al); + addDataToAlignment(al); } }).setResponseHandler(1, new Runnable() { @@ -769,7 +769,7 @@ public class AlignViewport extends AlignmentViewport us.openLinkedAlignmentAs(al, title, false); } }); - dialog.showDialog(question, + dialog.showDialog(question, MessageManager.getString("label.open_split_window"), JvOptionPane.DEFAULT_OPTION, JvOptionPane.PLAIN_MESSAGE, null, options, options[0]); @@ -777,7 +777,7 @@ public class AlignViewport extends AlignmentViewport protected void openLinkedAlignmentAs(AlignmentI al, String title, boolean newWindowOrSplitPane) - { + { /* * Identify protein and dna alignments. Make a copy of this one if opening * in a new split pane. @@ -823,8 +823,7 @@ public class AlignViewport extends AlignmentViewport try { - newAlignFrame.setMaximum( - jalview.bin.Cache.getDefault("SHOW_FULLSCREEN", false)); + newAlignFrame.setMaximum(Cache.getDefault("SHOW_FULLSCREEN", false)); } catch (java.beans.PropertyVetoException ex) { } @@ -990,10 +989,10 @@ public class AlignViewport extends AlignmentViewport } /** - * Applies the supplied feature settings descriptor to currently known features. - * This supports an 'initial configuration' of feature colouring based on a - * preset or user favourite. This may then be modified in the usual way using - * the Feature Settings dialogue. + * Applies the supplied feature settings descriptor to currently known + * features. This supports an 'initial configuration' of feature colouring + * based on a preset or user favourite. This may then be modified in the usual + * way using the Feature Settings dialogue. * * @param featureSettings */ @@ -1006,8 +1005,8 @@ public class AlignViewport extends AlignmentViewport /** * when mergeOnly is set, then group and feature visibility or feature colours * are not modified for features and groups already known to the feature - * renderer. Feature ordering is always adjusted, and transparency is always set - * regardless. + * renderer. Feature ordering is always adjusted, and transparency is always + * set regardless. * * @param featureSettings * @param mergeOnly @@ -1019,12 +1018,13 @@ public class AlignViewport extends AlignmentViewport { return; } - + FeatureRenderer fr = getAlignPanel().getSeqPanel().seqCanvas .getFeatureRenderer(); List origRenderOrder = new ArrayList<>(); List origGroups = new ArrayList<>(); - // preserve original render order - allows differentiation between user configured colours and autogenerated ones + // preserve original render order - allows differentiation between user + // configured colours and autogenerated ones origRenderOrder.addAll(fr.getRenderOrder()); origGroups.addAll(fr.getFeatureGroups()); @@ -1056,7 +1056,8 @@ public class AlignViewport extends AlignmentViewport && origColour.getColour().equals( ColorUtils.createColourFromName(type))))) { - // if we are merging, only update if there wasn't already a colour defined for + // if we are merging, only update if there wasn't already a colour + // defined for // this type if (preferredColour != null) { @@ -1080,7 +1081,8 @@ public class AlignViewport extends AlignmentViewport { if (!mergeOnly || !origGroups.contains(group)) { - // when merging, display groups only if the aren't already marked as not visible + // when merging, display groups only if the aren't already marked as not + // visible fr.setGroupVisibility(group, featureSettings.isGroupDisplayed(group)); } @@ -1098,6 +1100,8 @@ public class AlignViewport extends AlignmentViewport fr.orderFeatures(featureSettings); } fr.setTransparency(featureSettings.getTransparency()); + + fr.notifyFeaturesChanged(); } public String getViewName()