import jalview.renderer.OverviewRenderer;
import jalview.renderer.OverviewResColourFinder;
import jalview.viewmodel.OverviewDimensions;
+import jalview.viewmodel.seqfeatures.FeatureRendererModel;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
-import javax.swing.JComponent;
+import javax.swing.JPanel;
-public class OverviewCanvas extends JComponent
+public class OverviewCanvas extends JPanel
{
private static final Color TRANS_GREY = new Color(100, 100, 100, 25);
* the renderer to transfer feature colouring from
*/
public void draw(boolean showSequenceFeatures, boolean showAnnotation,
- FeatureRenderer transferRenderer)
+ FeatureRendererModel transferRenderer)
{
miniMe = null;
{
mg.translate(0, od.getSequencesHeight());
or.drawGraph(mg, av.getAlignmentConservationAnnotation(),
- av.getCharWidth(), od.getGraphHeight(),
- od.getColumns(av.getAlignment()));
+ od.getGraphHeight(), od.getColumns(av.getAlignment()));
mg.translate(0, -od.getSequencesHeight());
}
- System.gc();
or.removePropertyChangeListener(progressPanel);
or = null;
@Override
public void paintComponent(Graphics g)
{
+ // super.paintComponent(g);
+
if (restart)
{
if (lastMiniMe == null)
&& ((getWidth() != od.getWidth())
|| (getHeight() != od.getHeight())))
{
- // if there is annotation, scale the alignment and annotation separately
- if (od.getGraphHeight() > 0)
+ // if there is annotation, scale the alignment and annotation
+ // separately
+ if (od.getGraphHeight() > 0 && od.getSequencesHeight() > 0 // BH 2019
+ )
{
BufferedImage topImage = lastMiniMe.getSubimage(0, 0,
od.getWidth(), od.getSequencesHeight());
od.setHeight(getHeight());
}
- // scale lastMiniMe to the new size
- g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
-
// make sure the box is in the right place
od.setBoxPosition(av.getAlignment().getHiddenSequences(),
av.getAlignment().getHiddenColumns());
}
- else // not a resize
- {
- // fall back to normal behaviour
- g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
- }
+ // fall back to normal behaviour
+ g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
+ }
+ else
+ {
+ g.drawImage(lastMiniMe, 0, 0, getWidth(), getHeight(), this);
}
// draw the box
public void dispose()
{
dispose = true;
+ od = null;
synchronized (this)
{
restart = true;