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-2388 Minor refactoring
[jalview.git]
/
src
/
jalview
/
gui
/
OverviewPanel.java
diff --git
a/src/jalview/gui/OverviewPanel.java
b/src/jalview/gui/OverviewPanel.java
index
fc3cc4b
..
d87285c
100755
(executable)
--- a/
src/jalview/gui/OverviewPanel.java
+++ b/
src/jalview/gui/OverviewPanel.java
@@
-36,7
+36,8
@@
import java.awt.image.BufferedImage;
import javax.swing.JPanel;
/**
import javax.swing.JPanel;
/**
- * DOCUMENT ME!
+ * Panel displaying an overview of the full alignment, with an interactive box
+ * representing the viewport onto the alignment.
*
* @author $author$
* @version $Revision$
*
* @author $author$
* @version $Revision$
@@
-73,19
+74,19
@@
public class OverviewPanel extends JPanel implements Runnable
/**
* Creates a new OverviewPanel object.
*
/**
* Creates a new OverviewPanel object.
*
- * @param ap
+ * @param alPanel
* The alignment panel which is shown in the overview panel
*/
* The alignment panel which is shown in the overview panel
*/
- public OverviewPanel(AlignmentPanel ap)
+ public OverviewPanel(AlignmentPanel alPanel)
{
{
- this.av = ap.av;
- this.ap = ap;
+ this.av = alPanel.av;
+ this.ap = alPanel;
setLayout(null);
sr = new SequenceRenderer(av);
sr.renderGaps = false;
sr.forOverview = true;
setLayout(null);
sr = new SequenceRenderer(av);
sr.renderGaps = false;
sr.forOverview = true;
- fr = new FeatureRenderer(ap);
+ fr = new FeatureRenderer(alPanel);
od = new OverviewDimensions(av);
od = new OverviewDimensions(av);
@@
-111,9
+112,8
@@
public class OverviewPanel extends JPanel implements Runnable
{
// TODO: feature: jv2.5 detect shift drag and update selection from
// it.
{
// TODO: feature: jv2.5 detect shift drag and update selection from
// it.
- od.setBoxX(evt.getX());
- od.setBoxY(evt.getY());
- checkValid();
+ od.setBoxPositionByMouse(evt.getX(), evt.getY());
+ ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
}
}
});
}
}
});
@@
-125,9
+125,8
@@
public class OverviewPanel extends JPanel implements Runnable
{
if (!av.getWrapAlignment())
{
{
if (!av.getWrapAlignment())
{
- od.setBoxX(evt.getX());
- od.setBoxY(evt.getY());
- checkValid();
+ od.setBoxPositionByMouse(evt.getX(), evt.getY());
+ ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
}
}
});
}
}
});
@@
-136,16
+135,6
@@
public class OverviewPanel extends JPanel implements Runnable
}
/**
}
/**
- * Check box dimensions and scroll positions and correct if necessary
- */
- private void checkValid()
- {
- od.checkValid();
- ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
-
- }
-
- /**
* Updates the overview image when the related alignment panel is updated
*/
public void updateOverviewImage()
* Updates the overview image when the related alignment panel is updated
*/
public void updateOverviewImage()
@@
-391,9
+380,6
@@
public class OverviewPanel extends JPanel implements Runnable
}
// TODO: render selected regions
g.setColor(Color.red);
}
// TODO: render selected regions
g.setColor(Color.red);
- g.drawRect(od.getBoxX(), od.getBoxY(), od.getBoxWidth(),
- od.getBoxHeight());
- g.drawRect(od.getBoxX() + 1, od.getBoxY() + 1, od.getBoxWidth() - 2,
- od.getBoxHeight() - 2);
+ od.drawBox(g);
}
}
}
}