X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Frenderer%2FOverviewRenderer.java;h=1ff032bf890b296848724b8bf830bad9ab9e6aa0;hb=7cfe01e2f50e0be1965741ebde2e02cacc6aafa2;hp=f36461ac0b782ed88eb90adb16d7436b885e1859;hpb=f5c3e4c114f383442f8a551f0239415d397da2cd;p=jalview.git diff --git a/src/jalview/renderer/OverviewRenderer.java b/src/jalview/renderer/OverviewRenderer.java index f36461a..1ff032b 100644 --- a/src/jalview/renderer/OverviewRenderer.java +++ b/src/jalview/renderer/OverviewRenderer.java @@ -44,8 +44,6 @@ public class OverviewRenderer // transparency of hidden cols/seqs overlay private final float TRANSPARENCY = 0.5f; - private final Color HIDDEN_COLOUR = Color.DARK_GRAY.darker(); - public static final String UPDATE = "OverviewUpdate"; private static final int MAX_PROGRESS = 100; @@ -78,8 +76,8 @@ public class OverviewRenderer private OverviewResColourFinder resColFinder; public OverviewRenderer(FeatureRenderer fr, OverviewDimensions od, - AlignmentI alignment, - ResidueShaderI resshader, OverviewResColourFinder colFinder) + AlignmentI alignment, ResidueShaderI resshader, + OverviewResColourFinder colFinder) { finder = new FeatureColourFinder(fr); resColFinder = colFinder; @@ -122,7 +120,7 @@ public class OverviewRenderer { break; } - + // get details of this alignment row SequenceI seq = rows.getSequence(alignmentRow); @@ -132,7 +130,7 @@ public class OverviewRenderer // calculate where this row extends to in pixels int endRow = Math.min(Math.round((seqIndex + 1) * pixelsPerSeq) - 1, miniMe.getHeight() - 1); - + int colIndex = 0; int pixelCol = 0; for (int alignmentCol : cols) @@ -141,19 +139,19 @@ public class OverviewRenderer { break; } - + // calculate where this column extends to in pixels int endCol = Math.min(Math.round((colIndex + 1) * pixelsPerCol) - 1, miniMe.getWidth() - 1); - + // don't do expensive colour determination if we're not going to use it // NB this is important to avoid performance issues in the overview // panel if (pixelCol <= endCol) { rgbcolor = getColumnColourFromSequence(allGroups, seq, - alignmentCol, finder); - + alignmentCol); + // fill in the appropriate number of pixels for (int row = pixelRow; row <= endRow; ++row) { @@ -216,26 +214,23 @@ public class OverviewRenderer } /* - * Find the colour of a sequence at a specified column position + * Find the RGB value of the colour of a sequence at a specified column position * * @param seq * sequence to get colour for * @param lastcol * column position to get colour for - * @param fcfinder - * FeatureColourFinder to use * @return colour of sequence at this position, as RGB */ - private int getColumnColourFromSequence(SequenceGroup[] allGroups, - jalview.datamodel.SequenceI seq, - int lastcol, FeatureColourFinder fcfinder) + int getColumnColourFromSequence(SequenceGroup[] allGroups, SequenceI seq, + int lastcol) { - Color color = resColFinder.GAP_COLOUR; + Color color = resColFinder.gapColour; if ((seq != null) && (seq.getLength() > lastcol)) { color = resColFinder.getResidueColour(true, shader, allGroups, seq, - lastcol, fcfinder); + lastcol, finder); } return color.getRGB(); @@ -293,8 +288,8 @@ public class OverviewRenderer Graphics2D g2d = (Graphics2D) hiddenImage.getGraphics(); // set background to transparent - g2d.setComposite(AlphaComposite.Clear); - g2d.fillRect(0, 0, width, height); + // g2d.setComposite(AlphaComposite.Clear); + // g2d.fillRect(0, 0, width, height); // set next colour to opaque g2d.setComposite(AlphaComposite.Src); @@ -358,15 +353,13 @@ public class OverviewRenderer * the graphics object to draw on * @param anno * alignment annotation information - * @param charWidth - * alignment character width value * @param y * y-position for the annotation graph * @param cols * the collection of columns used in the overview panel */ - public void drawGraph(Graphics g, AlignmentAnnotation anno, int charWidth, - int y, AlignmentColsCollectionI cols) + public void drawGraph(Graphics g, AlignmentAnnotation anno, int y, + AlignmentColsCollectionI cols) { Annotation[] annotations = anno.annotations; g.setColor(Color.white);