import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.Annotation;
import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.ProfileI;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ResidueProperties;
+import jalview.util.Platform;
import java.awt.BasicStroke;
import java.awt.Color;
*/
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 ProfileI[] 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);
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;
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,
|| !dc.equals(row_annotations[column].displayCharacter);
// System.out.println("Column "+column+" diff up: "+diffupstream+" down:"+diffdownstream);
// If a closing base pair half of the stem, display a backward arrow
- if (column > 0 && Rna.isClosingParenthesis(dc.charAt(0)))
+ if (column > 0 && Rna.isClosingParenthesis(dc))
{
if (diffupstream)
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);
}
- 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);