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
JAL-3390 pull-up refactoring towards functional changes...
[jalview.git]
/
src
/
jalview
/
gui
/
AlignmentPanel.java
diff --git
a/src/jalview/gui/AlignmentPanel.java
b/src/jalview/gui/AlignmentPanel.java
index
82e2113
..
3948f6d
100644
(file)
--- a/
src/jalview/gui/AlignmentPanel.java
+++ b/
src/jalview/gui/AlignmentPanel.java
@@
-532,7
+532,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
addNotify();
// TODO: many places call this method and also paintAlignment with various
// different settings. this means multiple redraws are triggered...
addNotify();
// TODO: many places call this method and also paintAlignment with various
// different settings. this means multiple redraws are triggered...
- paintAlignment(true, false);
+ paintAlignment(true, av.needToUpdateStructureViews());
}
/**
}
/**
@@
-637,16
+637,9
@@
public class AlignmentPanel extends GAlignmentPanel implements
}
else
{
}
else
{
- int width = av.getAlignment().getWidth();
+ int width = av.getAlignment().getVisibleWidth();
int height = av.getAlignment().getHeight();
int height = av.getAlignment().getHeight();
- if (av.hasHiddenColumns())
- {
- // reset the width to exclude hidden columns
- width = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(width);
- }
-
hextent = getSeqPanel().seqCanvas.getWidth() / av.getCharWidth();
vextent = getSeqPanel().seqCanvas.getHeight() / av.getCharHeight();
hextent = getSeqPanel().seqCanvas.getWidth() / av.getCharWidth();
vextent = getSeqPanel().seqCanvas.getHeight() / av.getCharHeight();
@@
-958,8
+951,8
@@
public class AlignmentPanel extends GAlignmentPanel implements
final int totalSeq = (pageHeight - scaleHeight) / charHeight - 1;
final int totalSeq = (pageHeight - scaleHeight) / charHeight - 1;
- final int alignmentWidth = av.getAlignment().getWidth();
- final int pagesWide = (alignmentWidth / totalRes) + 1;
+ final int alignmentWidth = av.getAlignment().getVisibleWidth();
+ int pagesWide = (alignmentWidth / totalRes) + 1;
final int startRes = (pageIndex % pagesWide) * totalRes;
final int endRes = Math.min(startRes + totalRes - 1,
final int startRes = (pageIndex % pagesWide) * totalRes;
final int endRes = Math.min(startRes + totalRes - 1,
@@
-1059,6
+1052,8
@@
public class AlignmentPanel extends GAlignmentPanel implements
public int printWrappedAlignment(int pageWidth, int pageHeight, int pageNumber,
Graphics g) throws PrinterException
{
public int printWrappedAlignment(int pageWidth, int pageHeight, int pageNumber,
Graphics g) throws PrinterException
{
+ getSeqPanel().seqCanvas.calculateWrappedGeometry(getWidth(),
+ getHeight());
int annotationHeight = 0;
if (av.isShowAnnotation())
{
int annotationHeight = 0;
if (av.isShowAnnotation())
{
@@
-1076,15
+1071,11
@@
public class AlignmentPanel extends GAlignmentPanel implements
int idWidth = getVisibleIdWidth(false);
int idWidth = getVisibleIdWidth(false);
- int maxwidth = av.getAlignment().getWidth();
- if (av.hasHiddenColumns())
- {
- maxwidth = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(maxwidth) - 1;
- }
+ int maxwidth = av.getAlignment().getVisibleWidth();
int resWidth = getSeqPanel().seqCanvas
.getWrappedCanvasWidth(pageWidth - idWidth);
int resWidth = getSeqPanel().seqCanvas
.getWrappedCanvasWidth(pageWidth - idWidth);
+ av.getRanges().setViewportStartAndWidth(0, resWidth);
int totalHeight = cHeight * (maxwidth / resWidth + 1);
int totalHeight = cHeight * (maxwidth / resWidth + 1);
@@
-1096,8
+1087,8
@@
public class AlignmentPanel extends GAlignmentPanel implements
/*
* method: print the whole wrapped alignment, but with a clip region that
* is restricted to the requested page; this supports selective print of
/*
* method: print the whole wrapped alignment, but with a clip region that
* is restricted to the requested page; this supports selective print of
- * single pages or ranges, (at the cost of some repeated processing in
- * the 'normal' case, when all pages are printed)
+ * single pages or ranges, (at the cost of repeated processing in the
+ * 'normal' case, when all pages are printed)
*/
g.translate(0, -pageNumber * pageHeight);
*/
g.translate(0, -pageNumber * pageHeight);
@@
-1243,12
+1234,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
public AlignmentDimension getAlignmentDimension()
{
public AlignmentDimension getAlignmentDimension()
{
- int maxwidth = av.getAlignment().getWidth();
- if (av.hasHiddenColumns())
- {
- maxwidth = av.getAlignment().getHiddenColumns()
- .absoluteToVisibleColumn(maxwidth);
- }
+ int maxwidth = av.getAlignment().getVisibleWidth();
int height = ((av.getAlignment().getHeight() + 1) * av.getCharHeight())
+ getScalePanel().getHeight();
int height = ((av.getAlignment().getHeight() + 1) * av.getCharHeight())
+ getScalePanel().getHeight();
@@
-1431,6
+1417,12
@@
public class AlignmentPanel extends GAlignmentPanel implements
}
}
+ /**
+ * Answers the height of the entire alignment in pixels, assuming it is in
+ * wrapped mode
+ *
+ * @return
+ */
int getWrappedHeight()
{
int seqPanelWidth = getSeqPanel().seqCanvas.getWidth();
int getWrappedHeight()
{
int seqPanelWidth = getSeqPanel().seqCanvas.getWidth();
@@
-1455,6
+1447,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
int annotationHeight = 0;
if (av.isShowAnnotation())
{
int annotationHeight = 0;
if (av.isShowAnnotation())
{
+ hgap += SeqCanvas.SEQS_ANNOTATION_GAP;
annotationHeight = getAnnotationPanel().adjustPanelHeight();
}
annotationHeight = getAnnotationPanel().adjustPanelHeight();
}
@@
-1781,4
+1774,10
@@
public class AlignmentPanel extends GAlignmentPanel implements
{
return calculationDialog;
}
{
return calculationDialog;
}
+
+ @Override
+ public String getTitle()
+ {
+ return alignFrame == null ? null : alignFrame.getTitle();
+ }
}
}