X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fviewmodel%2Fseqfeatures%2FFeatureRendererModel.java;h=e812ed58c594ad5c3e890ab872344351800f9869;hp=eb1030c3640b7d400586d6fa6600d76984aca7a4;hb=57738a1f3c19b1c3a00bd3ac5108f8cd0af32f99;hpb=e7338a61f3ce96dadf44ac80b2b32cc5ba4b94c8 diff --git a/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java b/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java index eb1030c..e812ed5 100644 --- a/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java +++ b/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java @@ -314,7 +314,8 @@ public abstract class FeatureRendererModel } @Override - public List findFeaturesAtColumn(SequenceI sequence, int column) + public List findFeaturesAtColumn(SequenceI sequence, + int column) { /* * include features at the position provided their feature type is @@ -408,8 +409,8 @@ public abstract class FeatureRendererModel } if (groupDisplayed) { - Set types = asq.getFeatures().getFeatureTypesForGroups( - true, group); + Set types = asq.getFeatures() + .getFeatureTypesForGroups(true, group); for (String type : types) { if (!allfeatures.contains(type)) // or use HashSet and no test? @@ -488,6 +489,7 @@ public abstract class FeatureRendererModel } } } + protected Boolean firing = Boolean.FALSE; /** @@ -628,8 +630,9 @@ public abstract class FeatureRendererModel */ public boolean showFeatureOfType(String type) { - return type == null ? false : (av.getFeaturesDisplayed() == null ? true - : av.getFeaturesDisplayed().isVisible(type)); + return type == null ? false + : (av.getFeaturesDisplayed() == null ? true + : av.getFeaturesDisplayed().isVisible(type)); } @Override @@ -707,15 +710,15 @@ public abstract class FeatureRendererModel } /** - * Sets the priority order for features, with the highest priority (displayed on - * top) at the start of the data array + * Sets the priority order for features, with the highest priority (displayed + * on top) at the start of the data array * * @param data * an array of { Type, Colour, Filter, Boolean } * @param visibleNew * when true current featureDisplay list will be cleared - * @return true if any visible features have been reordered or recoloured, else - * false (i.e. no need to repaint) + * @return true if any visible features have been reordered or recoloured, + * else false (i.e. no need to repaint) */ public boolean setFeaturePriority(FeatureSettingsBean[] data, boolean visibleNew) @@ -999,8 +1002,7 @@ public abstract class FeatureRendererModel */ public boolean featureGroupNotShown(final SequenceFeature sequenceFeature) { - return featureGroups != null - && sequenceFeature.featureGroup != null + return featureGroups != null && sequenceFeature.featureGroup != null && sequenceFeature.featureGroup.length() != 0 && featureGroups.containsKey(sequenceFeature.featureGroup) && !featureGroups.get(sequenceFeature.featureGroup) @@ -1028,9 +1030,9 @@ public abstract class FeatureRendererModel List visibleFeatures = getDisplayedFeatureTypes(); String[] visibleTypes = visibleFeatures .toArray(new String[visibleFeatures.size()]); - List features = sequence.getFeatures().findFeatures( - fromResNo, toResNo, visibleTypes); - + List features = sequence.getFeatures() + .findFeatures(fromResNo, toResNo, visibleTypes); + for (SequenceFeature sf : features) { if (!featureGroupNotShown(sf) && getColour(sf) != null) @@ -1090,8 +1092,7 @@ public abstract class FeatureRendererModel * (checking type and isContactFeature as a fail-safe here, although * currently they are guaranteed to match in this context) */ - if (lastFeature != null - && sf.getBegin() == lastFeature.getBegin() + if (lastFeature != null && sf.getBegin() == lastFeature.getBegin() && sf.getEnd() == lastFeature.getEnd() && sf.isContactFeature() == lastFeature.isContactFeature() && sf.getType().equals(lastFeature.getType())) @@ -1121,7 +1122,8 @@ public abstract class FeatureRendererModel } @Override - public void setFeatureFilter(String featureType, FeatureMatcherSetI filter) + public void setFeatureFilter(String featureType, + FeatureMatcherSetI filter) { if (filter == null || filter.isEmpty()) { @@ -1159,7 +1161,7 @@ public abstract class FeatureRendererModel { return null; } - + return fc.getColor(sf); } @@ -1250,8 +1252,8 @@ public abstract class FeatureRendererModel int fromRes = match.getStart(); int toRes = match.getEnd(); mapFrom = match.getSequence(); - List fs = findFeaturesAtResidue( - mapFrom, fromRes, toRes); + List fs = findFeaturesAtResidue(mapFrom, fromRes, + toRes); for (SequenceFeature sf : fs) { if (!found.contains(sf)) @@ -1296,8 +1298,9 @@ public abstract class FeatureRendererModel } } } - - return new MappedFeatures(mapping.getMapping(), mapFrom, pos, residue, result); + + return new MappedFeatures(mapping.getMapping(), mapFrom, pos, residue, + result); } @Override