From: gmungoc Date: Tue, 21 Mar 2017 10:22:57 +0000 (+0000) Subject: JAL-2438 removed (non-functional) lastSeq, lastSequenceFeatures X-Git-Tag: Release_2_10_2~3^2~151 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6a9ee61dcddf37da47e1f05b544b69587d2b3e7f;p=jalview.git JAL-2438 removed (non-functional) lastSeq, lastSequenceFeatures --- diff --git a/src/jalview/appletgui/FeatureRenderer.java b/src/jalview/appletgui/FeatureRenderer.java index 67ca8e9..b88a1dc 100644 --- a/src/jalview/appletgui/FeatureRenderer.java +++ b/src/jalview/appletgui/FeatureRenderer.java @@ -377,9 +377,6 @@ public class FeatureRenderer extends if (dialog.accept) { - // This ensures that the last sequence - // is refreshed and new features are rendered - lastSeq = null; lastFeatureAdded = name.getText().trim(); lastFeatureGroupAdded = source.getText().trim(); lastDescriptionAdded = description.getText().replace('\n', ' '); diff --git a/src/jalview/gui/FeatureRenderer.java b/src/jalview/gui/FeatureRenderer.java index 86b8eba..f519f99 100644 --- a/src/jalview/gui/FeatureRenderer.java +++ b/src/jalview/gui/FeatureRenderer.java @@ -337,9 +337,6 @@ public class FeatureRenderer extends if (reply == JvOptionPane.OK_OPTION && name.getText().length() > 0) { - // This ensures that the last sequence - // is refreshed and new features are rendered - lastSeq = null; lastFeatureAdded = name.getText().trim(); lastFeatureGroupAdded = source.getText().trim(); lastDescriptionAdded = description.getText().replaceAll("\n", " "); diff --git a/src/jalview/renderer/seqfeatures/FeatureRenderer.java b/src/jalview/renderer/seqfeatures/FeatureRenderer.java index 02cfd05..72ac2c8 100644 --- a/src/jalview/renderer/seqfeatures/FeatureRenderer.java +++ b/src/jalview/renderer/seqfeatures/FeatureRenderer.java @@ -37,12 +37,6 @@ public class FeatureRenderer extends FeatureRendererModel private static final AlphaComposite NO_TRANSPARENCY = AlphaComposite .getInstance(AlphaComposite.SRC_OVER, 1.0f); - protected SequenceI lastSeq; - - private volatile SequenceFeature[] lastSequenceFeatures; - - int sfSize; - /** * Constructor given a viewport * @@ -221,33 +215,13 @@ public class FeatureRenderer extends FeatureRendererModel } SequenceFeature[] sequenceFeatures = seq.getSequenceFeatures(); - if (seq != lastSeq) - { - lastSeq = seq; - lastSequenceFeatures = sequenceFeatures; - if (lastSequenceFeatures != null) - { - sfSize = lastSequenceFeatures.length; - } - } - else - { - if (lastSequenceFeatures != sequenceFeatures) - { - lastSequenceFeatures = sequenceFeatures; - if (lastSequenceFeatures != null) - { - sfSize = lastSequenceFeatures.length; - } - } - } - if (lastSequenceFeatures == null || sfSize == 0) + if (sequenceFeatures == null || sequenceFeatures.length == 0) { return null; } - if (Comparison.isGap(lastSeq.getCharAt(column))) + if (Comparison.isGap(seq.getCharAt(column))) { return Color.white; } @@ -266,7 +240,7 @@ public class FeatureRenderer extends FeatureRendererModel * transparency case - draw all visible features in render order to * build up a composite colour on the graphics context */ - renderedColour = drawSequence(g, lastSeq, column, column, 0, true); + renderedColour = drawSequence(g, seq, column, column, 0, true); } return renderedColour; } @@ -303,13 +277,6 @@ public class FeatureRenderer extends FeatureRendererModel updateFeatures(); - if (lastSeq == null || seq != lastSeq - || sequenceFeatures != lastSequenceFeatures) - { - lastSeq = seq; - lastSequenceFeatures = sequenceFeatures; - } - if (transparency != 1f && g != null) { Graphics2D g2 = (Graphics2D) g; @@ -317,10 +284,10 @@ public class FeatureRenderer extends FeatureRendererModel transparency)); } - int startPos = lastSeq.findPosition(start); - int endPos = lastSeq.findPosition(end); + int startPos = seq.findPosition(start); + int endPos = seq.findPosition(end); - sfSize = lastSequenceFeatures.length; + int sfSize = sequenceFeatures.length; Color drawnColour = null; /* @@ -338,7 +305,7 @@ public class FeatureRenderer extends FeatureRendererModel // current feature to render for (int sfindex = 0; sfindex < sfSize; sfindex++) { - final SequenceFeature sequenceFeature = lastSequenceFeatures[sfindex]; + final SequenceFeature sequenceFeature = sequenceFeatures[sfindex]; if (!sequenceFeature.type.equals(type)) { continue; @@ -449,7 +416,6 @@ public class FeatureRenderer extends FeatureRendererModel @Override public void featuresAdded() { - lastSeq = null; findAllFeatures(); }