git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'alpha/update_2_12_for_2_11_2_series_merge^2' into HEAD
[jalview.git]
/
src
/
jalview
/
gui
/
IdCanvas.java
diff --git
a/src/jalview/gui/IdCanvas.java
b/src/jalview/gui/IdCanvas.java
index
1a8e79f
..
20df084
100755
(executable)
--- a/
src/jalview/gui/IdCanvas.java
+++ b/
src/jalview/gui/IdCanvas.java
@@
-20,6
+20,10
@@
*/
package jalview.gui;
*/
package jalview.gui;
+import jalview.datamodel.SequenceI;
+import jalview.viewmodel.ViewportListenerI;
+import jalview.viewmodel.ViewportRanges;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
@@
-33,10
+37,6
@@
import java.util.List;
import javax.swing.JPanel;
import javax.swing.JPanel;
-import jalview.datamodel.SequenceI;
-import jalview.viewmodel.ViewportListenerI;
-import jalview.viewmodel.ViewportRanges;
-
/**
* DOCUMENT ME!
*
/**
* DOCUMENT ME!
*
@@
-59,7
+59,7
@@
public class IdCanvas extends JPanel implements ViewportListenerI
int imgHeight = 0;
int imgHeight = 0;
- boolean fastPaint = false;
+ private boolean fastPaint = false;
List<SequenceI> searchResults;
List<SequenceI> searchResults;
@@
-67,6
+67,8
@@
public class IdCanvas extends JPanel implements ViewportListenerI
private Font idfont;
private Font idfont;
+ private boolean allowFastPaint;
+
/**
* Creates a new IdCanvas object.
*
/**
* Creates a new IdCanvas object.
*
@@
-137,6
+139,7
@@
public class IdCanvas extends JPanel implements ViewportListenerI
g.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos,
(((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));
g.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos,
(((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));
+ // JAL-3253-applet was just hiddenRows here. ccfc48e (gmungoc) added getShowHiddenMarkers test
if (hiddenRows && av.getShowHiddenMarkers())
{
drawMarker(g, av, i, starty, ypos);
if (hiddenRows && av.getShowHiddenMarkers())
{
drawMarker(g, av, i, starty, ypos);
@@
-221,10
+224,15
@@
public class IdCanvas extends JPanel implements ViewportListenerI
@Override
public void paintComponent(Graphics g)
{
@Override
public void paintComponent(Graphics g)
{
+ if (av.getAlignPanel().getHoldRepaint())
+ {
+ return;
+ }
+
g.setColor(Color.white);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Color.white);
g.fillRect(0, 0, getWidth(), getHeight());
- if (fastPaint)
+ if (allowFastPaint && fastPaint)
{
fastPaint = false;
g.drawImage(image, 0, 0, this);
{
fastPaint = false;
g.drawImage(image, 0, 0, this);
@@
-244,7
+252,7
@@
public class IdCanvas extends JPanel implements ViewportListenerI
if (oldHeight != imgHeight || image.getWidth(this) != getWidth())
{
if (oldHeight != imgHeight || image.getWidth(this) != getWidth())
{
- image = new BufferedImage(getWidth(), imgHeight,
+ image = new BufferedImage(getWidth(), imgHeight,
BufferedImage.TYPE_INT_RGB);
}
BufferedImage.TYPE_INT_RGB);
}
@@
-385,20
+393,49
@@
public class IdCanvas extends JPanel implements ViewportListenerI
int alignmentWidth = alignViewport.getAlignment().getWidth();
final int alheight = alignViewport.getAlignment().getHeight();
int alignmentWidth = alignViewport.getAlignment().getWidth();
final int alheight = alignViewport.getAlignment().getHeight();
- /*
+
+// int annotationHeight = 0;
+
+ /* (former)
* assumption: SeqCanvas.calculateWrappedGeometry has been called
* assumption: SeqCanvas.calculateWrappedGeometry has been called
+ *
+ * was based on the fact that SeqCanvas was added as a child prior to IdCanvas,
+ * and children are processed in order of addition.
+ *
+ * It's probably fine. But...
+ *
*/
SeqCanvas seqCanvas = alignViewport.getAlignPanel()
.getSeqPanel().seqCanvas;
*/
SeqCanvas seqCanvas = alignViewport.getAlignPanel()
.getSeqPanel().seqCanvas;
+ // ...better: let's call it now
+ seqCanvas.calculateWrappedGeometry();
final int charHeight = alignViewport.getCharHeight();
AnnotationLabels labels = null;
if (alignViewport.isShowAnnotation())
{
final int charHeight = alignViewport.getCharHeight();
AnnotationLabels labels = null;
if (alignViewport.isShowAnnotation())
{
+ // BH when was ap == null?
+ if (ap == null)
+ {
+ ap = new AnnotationPanel(alignViewport);
+ }
+// annotationHeight = ap.adjustPanelHeight();
labels = new AnnotationLabels(alignViewport);
}
labels = new AnnotationLabels(alignViewport);
}
+// int hgap = charHeight;
+// if (alignViewport.getScaleAboveWrapped())
+// {
+// hgap += charHeight;
+// }
+//
+// /*
+// * height of alignment + gap + annotations (if shown)
+// */
+// int cHeight = alheight * charHeight + hgap
+// + annotationHeight;
+//
ViewportRanges ranges = alignViewport.getRanges();
int rowSize = ranges.getViewportWidth();
ViewportRanges ranges = alignViewport.getRanges();
int rowSize = ranges.getViewportWidth();
@@
-569,20
+606,34
@@
public class IdCanvas extends JPanel implements ViewportListenerI
public void propertyChange(PropertyChangeEvent evt)
{
String propertyName = evt.getPropertyName();
public void propertyChange(PropertyChangeEvent evt)
{
String propertyName = evt.getPropertyName();
- if (propertyName.equals(ViewportRanges.STARTSEQ)
- || (av.getWrapAlignment()
- && propertyName.equals(ViewportRanges.STARTRES)))
+ switch (propertyName)
{
{
+ case ViewportRanges.STARTSEQ:
fastPaint((int) evt.getNewValue() - (int) evt.getOldValue());
fastPaint((int) evt.getNewValue() - (int) evt.getOldValue());
- }
- else if (propertyName.equals(ViewportRanges.STARTRESANDSEQ))
- {
+ break;
+ case ViewportRanges.STARTRES:
+ if (av.getWrapAlignment())
+ {
+ fastPaint((int) evt.getNewValue() - (int) evt.getOldValue());
+ }
+ break;
+ case ViewportRanges.STARTRESANDSEQ:
fastPaint(((int[]) evt.getNewValue())[1]
- ((int[]) evt.getOldValue())[1]);
fastPaint(((int[]) evt.getNewValue())[1]
- ((int[]) evt.getOldValue())[1]);
- }
- else if (propertyName.equals(ViewportRanges.MOVE_VIEWPORT))
- {
+ break;
+ case ViewportRanges.MOVE_VIEWPORT:
repaint();
repaint();
+ break;
+ default:
}
}
}
}
+
+ /**
+ * Clears the flag that allows a 'fast paint' on the next repaint, so
+ * requiring a full repaint
+ */
+ public void setNoFastPaint()
+ {
+ allowFastPaint = false;
+ }
}
}