import java.io.PrintWriter;
import java.util.List;
-import javax.swing.SwingUtilities;
-
/**
- * DOCUMENT ME!
+ * The main panel of an AlignFrame, containing holders for the IdPanel,
+ * SeqPanel, AnnotationLabels (a JPanel), and AnnotationPanel.
+ *
+ * Additional holders contain an IdPanelWidthAdjuster space above the idPanel,
+ * AnnotationScroller (JScrollPane for AnnotationPanel), and vertical and
+ * horizontal scrollbars.
+ *
+ *
*
* @author $author$
* @version $Revision: 1.161 $
ranges.setViewportWidth(widthInRes);
ranges.setViewportHeight(heightInSeq);
+ ViewportRanges.sTest += "AP.resize chht=" + av.getCharHeight()
+ + "canvHt=" + getSeqPanel().seqCanvas.getHeight() + " "
+ + heightInSeq + "\n";
}
}
*/
public void updateLayout()
{
- fontChanged();
+ fontChanged(); // fires repaint
setAnnotationVisible(av.isShowAnnotation());
boolean wrap = av.getWrapAlignment();
ViewportRanges ranges = av.getRanges();
int y = vscroll.getValue();
int height = getSeqPanel().seqCanvas.getHeight() / av.getCharHeight();
+
// if we're scrolling to the position we're already at, stop
// this prevents infinite recursion of events when the scroll/viewport
// ranges values are the same
{
return;
}
+
+ ViewportRanges.sTest += "AP.valChanged chht=" + av.getCharHeight()
+ + "canvHt=" + getSeqPanel().seqCanvas.getHeight() + " "
+ + height + "\n";
+
ranges.setViewportStartAndHeight(y, height);
}
repaint();
// This is only called if file loaded is a jar file that
// was wrapped when saved and user has wrap alignment true
// as preference setting
- SwingUtilities.invokeLater(new Runnable()
+ Jalview.execRunnable(new Runnable()
{
@Override
public void run()
}
if (updateOverview)
{
-
if (overviewPanel != null)
{
overviewPanel.updateOverviewImage();
@Override
public void paintComponent(Graphics g)
{
+
invalidate(); // needed so that the id width adjuster works correctly
Dimension d = getIdPanel().getIdCanvas().getPreferredSize();
public int printWrappedAlignment(int pageWidth, int pageHeight, int pageNumber,
Graphics g) throws PrinterException
{
+
int annotationHeight = 0;
if (av.isShowAnnotation())
{
int totalHeight = cHeight * (maxwidth / resWidth + 1);
+ g = g.create();
+
g.setColor(Color.white);
g.fillRect(0, 0, pageWidth, pageHeight);
g.setFont(av.getFont());
*/
g.translate(0, -pageNumber * pageHeight);
- g.setClip(0, pageNumber * pageHeight, pageWidth, pageHeight);
+ // BH 2020.03.19 avoiding g.setClip
+ g.clipRect(0, pageNumber * pageHeight, pageWidth, pageHeight);
/*
* draw sequence ids and annotation labels (if shown)
getSeqPanel().seqCanvas.drawWrappedPanelForPrinting(g, pageWidth - idWidth,
totalHeight, 0);
+ g.dispose();
if ((pageNumber * pageHeight) < totalHeight)
{
return Printable.PAGE_EXISTS;
return true;
}
+ @Override
+ public void overviewDone(BufferedImage miniMe)
+ {
+ overviewPanel.canvas.finalizeDraw(miniMe);
+ }
+
+
+ private boolean holdRepaint = false;
+
+ public boolean getHoldRepaint()
+ {
+ return holdRepaint;
+ }
+
+ public void setHoldRepaint(boolean b)
+ {
+ if (holdRepaint == b)
+ {
+ return;
+ }
+ holdRepaint = b;
+ if (!b)
+ {
+ repaint();
+ }
+ }
+
+ @Override
+ public void repaint()
+ {
+ if (holdRepaint)
+ {
+ // System.out.println("AP repaint holding");
+ // Platform.stackTrace();
+ return;
+ }
+ super.repaint();
+ }
+
}