protected int scrollCol = -1;
protected int scrollRow = -1;
+ protected int alwidth;
+
+ protected int alheight;
+
public OverviewDimensions(ViewportRanges ranges,
boolean showAnnotationPanel)
{
return boxHeight;
}
- public void setWidth(int w)
- {
- width = w;
- }
-
- public void setHeight(int h)
- {
- sequencesHeight = h - graphHeight;
- }
-
public int getWidth()
{
return width;
return graphHeight;
}
+ public float getPixelsPerCol()
+ {
+ return (float) width / alwidth;
+ }
+
+ public float getPixelsPerSeq()
+ {
+ return (float) sequencesHeight / alheight;
+ }
+
+ public void setWidth(int w)
+ {
+ width = w;
+ }
+
+ public void setHeight(int h)
+ {
+ sequencesHeight = h - graphHeight;
+ }
+
public abstract void updateViewportFromMouse(int mousex, int mousey,
HiddenSequences hiddenSeqs, ColumnSelection hiddenCols,
ViewportRanges ranges);
public abstract AlignmentRowsCollectionI getRows(
ViewportRanges ranges, AlignmentI al);
-
- public abstract float getPixelsPerCol();
-
- public abstract float getPixelsPerSeq();
}
\ No newline at end of file
public class OverviewDimensionsAllVisible extends OverviewDimensions
{
- private float pixelsPerCol;
-
- private float pixelsPerSeq;
-
public OverviewDimensionsAllVisible(ViewportRanges ranges,
boolean showAnnotationPanel)
{
super(ranges, showAnnotationPanel);
- int alwidth = ranges.getVisibleAlignmentWidth();
- int alheight = ranges.getVisibleAlignmentHeight();
-
- pixelsPerCol = (float) width / alwidth;
- pixelsPerSeq = (float) sequencesHeight / alheight;
+ alwidth = ranges.getVisibleAlignmentWidth();
+ alheight = ranges.getVisibleAlignmentHeight();
}
@Override
int x = mousex;
int y = mousey;
- int alwidth = ranges.getVisibleAlignmentWidth();
- int alheight = ranges.getVisibleAlignmentHeight();
+ alwidth = ranges.getVisibleAlignmentWidth();
+ alheight = ranges.getVisibleAlignmentHeight();
if (x < 0)
{
public void setBoxPosition(HiddenSequences hiddenSeqs,
ColumnSelection hiddenCols, ViewportRanges ranges)
{
- int alwidth = ranges.getVisibleAlignmentWidth();
- int alheight = ranges.getVisibleAlignmentHeight();
+ alwidth = ranges.getVisibleAlignmentWidth();
+ alheight = ranges.getVisibleAlignmentHeight();
// work with visible values of startRes and endRes
int startRes = ranges.getStartRes();
return new AllRowsCollection(0,
ranges.getVisibleAlignmentHeight() - 1, al);
}
-
- @Override
- public float getPixelsPerCol()
- {
- return pixelsPerCol;
- }
-
- @Override
- public float getPixelsPerSeq()
- {
- return pixelsPerSeq;
- }
}
public class OverviewDimensionsWithHidden extends OverviewDimensions
{
- private float pixelsPerCol;
-
- private float pixelsPerSeq;
-
/**
* Create an OverviewDimensions object
*
{
super(ranges, showAnnotationPanel);
- int alwidth = ranges.getAbsoluteAlignmentWidth();
- int alheight = ranges.getAbsoluteAlignmentHeight();
-
- pixelsPerCol = (float) width / alwidth;
- pixelsPerSeq = (float) sequencesHeight / alheight;
+ alwidth = ranges.getAbsoluteAlignmentWidth();
+ alheight = ranges.getAbsoluteAlignmentHeight();
}
/**
int x = mousex;
int y = mousey;
- int alwidth = ranges.getAbsoluteAlignmentWidth();
- int alheight = ranges.getAbsoluteAlignmentHeight();
+ alwidth = ranges.getAbsoluteAlignmentWidth();
+ alheight = ranges.getAbsoluteAlignmentHeight();
if (x < 0)
{
public void setBoxPosition(HiddenSequences hiddenSeqs,
ColumnSelection hiddenCols, ViewportRanges ranges)
{
- int alwidth = ranges.getAbsoluteAlignmentWidth();
- int alheight = ranges.getAbsoluteAlignmentHeight();
+ alwidth = ranges.getAbsoluteAlignmentWidth();
+ alheight = ranges.getAbsoluteAlignmentHeight();
// work with absolute values of startRes and endRes
int startRes = hiddenCols.adjustForHiddenColumns(ranges.getStartRes());
ranges.getAbsoluteAlignmentHeight() - 1,
al);
}
-
- @Override
- public float getPixelsPerCol()
- {
- return pixelsPerCol;
- }
-
- @Override
- public float getPixelsPerSeq()
- {
- return pixelsPerSeq;
- }
}