X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Frenderer%2FAnnotationRenderer.java;h=3fdcb3b7f548e080a804d25cee8de8d80f6dfaf1;hb=refs%2Fheads%2Freleases%2FRelease_2_10_0_Branch;hp=82f6ffb3bf7353990fa96bf106ec9dc34a5c793f;hpb=4ed0cd5f8477ba52a9f5b19b021f8f6183f9dd61;p=jalview.git diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 82f6ffb..3fdcb3b 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -30,6 +30,7 @@ import jalview.datamodel.Annotation; import jalview.datamodel.ColumnSelection; import jalview.schemes.ColourSchemeI; import jalview.schemes.ResidueProperties; +import jalview.util.Platform; import java.awt.BasicStroke; import java.awt.Color; @@ -57,6 +58,70 @@ public class AnnotationRenderer */ private final boolean debugRedraw; + private int charWidth, endRes, charHeight; + + private boolean validCharWidth, hasHiddenColumns; + + private FontMetrics fm; + + private final boolean MAC = Platform.isAMac(); + + boolean av_renderHistogram = true, av_renderProfile = true, + av_normaliseProfile = false; + + ColourSchemeI profcolour = null; + + private ColumnSelection columnSelection; + + private Hashtable[] hconsensus; + + private Hashtable[] complementConsensus; + + private Hashtable[] hStrucConsensus; + + private boolean av_ignoreGapsConsensus; + + /** + * attributes set from AwtRenderPanelI + */ + /** + * old image used when data is currently being calculated and cannot be + * rendered + */ + private Image fadedImage; + + /** + * panel being rendered into + */ + private ImageObserver annotationPanel; + + /** + * width of image to render in panel + */ + private int imgWidth; + + /** + * offset to beginning of visible area + */ + private int sOffset; + + /** + * offset to end of visible area + */ + private int visHeight; + + /** + * indicate if the renderer should only render the visible portion of the + * annotation given the current view settings + */ + private boolean useClip = true; + + /** + * master flag indicating if renderer should ever try to clip. not enabled for + * jalview 2.8.1 + */ + private boolean canClip = false; + public AnnotationRenderer() { this(false); @@ -74,9 +139,21 @@ public class AnnotationRenderer this.debugRedraw = debugRedraw; } - void drawStemAnnot(Graphics g, Annotation[] row_annotations, - int lastSSX, int x, int y, int iconOffset, int startRes, - int column, boolean validRes, boolean validEnd) + /** + * Remove any references and resources when this object is no longer required + */ + public void dispose() + { + hconsensus = null; + complementConsensus = null; + hStrucConsensus = null; + fadedImage = null; + annotationPanel = null; + } + + void drawStemAnnot(Graphics g, Annotation[] row_annotations, int lastSSX, + int x, int y, int iconOffset, int startRes, int column, + boolean validRes, boolean validEnd) { g.setColor(STEM_COLOUR); int sCol = (lastSSX / charWidth) + startRes; @@ -134,70 +211,6 @@ public class AnnotationRenderer g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 7); } - private int charWidth, endRes, charHeight; - - private boolean validCharWidth, hasHiddenColumns; - - private FontMetrics fm; - - private final boolean MAC = jalview.util.Platform.isAMac(); - - boolean av_renderHistogram = true, av_renderProfile = true, - av_normaliseProfile = false; - - ColourSchemeI profcolour = null; - - private ColumnSelection columnSelection; - - private Hashtable[] hconsensus; - - private Hashtable[] complementConsensus; - - private Hashtable[] hStrucConsensus; - - private boolean av_ignoreGapsConsensus; - - /** - * attributes set from AwtRenderPanelI - */ - /** - * old image used when data is currently being calculated and cannot be - * rendered - */ - private Image fadedImage; - - /** - * panel being rendered into - */ - private ImageObserver annotationPanel; - - /** - * width of image to render in panel - */ - private int imgWidth; - - /** - * offset to beginning of visible area - */ - private int sOffset; - - /** - * offset to end of visible area - */ - private int visHeight; - - /** - * indicate if the renderer should only render the visible portion of the - * annotation given the current view settings - */ - private boolean useClip = true; - - /** - * master flag indicating if renderer should ever try to clip. not enabled for - * jalview 2.8.1 - */ - private boolean canClip = false; - void drawNotCanonicalAnnot(Graphics g, Color nonCanColor, Annotation[] row_annotations, int lastSSX, int x, int y, int iconOffset, int startRes, int column, boolean validRes, @@ -1072,8 +1085,8 @@ public class AnnotationRenderer private Color sdNOTCANONICAL_COLOUR; - void drawGlyphLine(Graphics g, Annotation[] row, int lastSSX, - int x, int y, int iconOffset, int startRes, int column, + void drawGlyphLine(Graphics g, Annotation[] row, int lastSSX, int x, + int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd) { g.setColor(GLYPHLINE_COLOR); @@ -1104,8 +1117,8 @@ public class AnnotationRenderer } - void drawHelixAnnot(Graphics g, Annotation[] row, int lastSSX, - int x, int y, int iconOffset, int startRes, int column, + void drawHelixAnnot(Graphics g, Annotation[] row, int lastSSX, int x, + int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd) { g.setColor(HELIX_COLOUR);