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-2611 unit tests
[jalview.git]
/
src
/
jalview
/
viewmodel
/
OverviewDimensions.java
diff --git
a/src/jalview/viewmodel/OverviewDimensions.java
b/src/jalview/viewmodel/OverviewDimensions.java
index
c63fb3c
..
ee3b511
100644
(file)
--- a/
src/jalview/viewmodel/OverviewDimensions.java
+++ b/
src/jalview/viewmodel/OverviewDimensions.java
@@
-58,10
+58,6
@@
public abstract class OverviewDimensions
protected int alheight;
protected int alheight;
- protected int transX;
-
- protected int transY;
-
/**
* Create an OverviewDimensions object
*
/**
* Create an OverviewDimensions object
*
@@
-195,13
+191,42
@@
public abstract class OverviewDimensions
public abstract void updateViewportFromMouse(int mousex, int mousey,
HiddenSequences hiddenSeqs, HiddenColumns hiddenCols);
public abstract void updateViewportFromMouse(int mousex, int mousey,
HiddenSequences hiddenSeqs, HiddenColumns hiddenCols);
+ /**
+ * Update the viewport location from a mouse drag within the overview's box
+ *
+ * @param mousex
+ * x location of mouse
+ * @param mousey
+ * y location of mouse
+ * @param hiddenSeqs
+ * the alignment's hidden sequences
+ * @param hiddenCols
+ * the alignment's hidden columns
+ */
public abstract void adjustViewportFromMouse(int mousex, int mousey,
HiddenSequences hiddenSeqs, HiddenColumns hiddenCols);
public abstract void adjustViewportFromMouse(int mousex, int mousey,
HiddenSequences hiddenSeqs, HiddenColumns hiddenCols);
+ /**
+ * Initialise dragging from the mouse - must be called on initial mouse click
+ * before using adjustViewportFromMouse in drag operations
+ *
+ * @param mousex
+ * x location of mouse
+ * @param mousey
+ * y location of mouse
+ * @param hiddenSeqs
+ * the alignment's hidden sequences
+ * @param hiddenCols
+ * the alignment's hidden columns
+ */
public abstract void setDragPoint(int x, int y,
HiddenSequences hiddenSeqs, HiddenColumns hiddenCols);
public abstract void setDragPoint(int x, int y,
HiddenSequences hiddenSeqs, HiddenColumns hiddenCols);
- protected abstract void updateViewportFromTopLeft(int mousex, int mousey,
+ /*
+ * Move the viewport so that the top left corner of the overview's box
+ * is at the mouse position (leftx, topy)
+ */
+ protected abstract void updateViewportFromTopLeft(int leftx, int topy,
HiddenSequences hiddenSeqs, HiddenColumns hiddenCols);
/**
HiddenSequences hiddenSeqs, HiddenColumns hiddenCols);
/**
@@
-238,6
+263,9
@@
public abstract class OverviewDimensions
*/
protected abstract void resetAlignmentDims();
*/
protected abstract void resetAlignmentDims();
+ /*
+ * Given the box coordinates in residues and sequences, set the box dimensions in the overview window
+ */
protected void setBoxPosition(int startRes, int startSeq, int vpwidth,
int vpheight)
{
protected void setBoxPosition(int startRes, int startSeq, int vpwidth,
int vpheight)
{
@@
-252,8
+280,6
@@
public abstract class OverviewDimensions
// boxHeight is the height in sequences translated to pixels
boxHeight = Math.round((float) vpheight * sequencesHeight / alheight);
// boxHeight is the height in sequences translated to pixels
boxHeight = Math.round((float) vpheight * sequencesHeight / alheight);
-
- System.out.println("Update box: x: " + boxX);
}
/**
}
/**
@@
-271,8
+297,14
@@
public abstract class OverviewDimensions
&& y < boxY + boxHeight);
}
&& y < boxY + boxHeight);
}
+ /*
+ * Given the centre x position, calculate the box's left x position
+ */
protected abstract int getLeftXFromCentreX(int mousex, HiddenColumns hidden);
protected abstract int getLeftXFromCentreX(int mousex, HiddenColumns hidden);
+ /*
+ * Given the centre y position, calculate the box's top y position
+ */
protected abstract int getTopYFromCentreY(int mousey,
HiddenSequences hidden);
protected abstract int getTopYFromCentreY(int mousey,
HiddenSequences hidden);