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-2034 flag for triggering redraw of overview window for a view
[jalview.git]
/
src
/
jalview
/
gui
/
AlignmentPanel.java
diff --git
a/src/jalview/gui/AlignmentPanel.java
b/src/jalview/gui/AlignmentPanel.java
index
2c7dd3e
..
f06ca94
100644
(file)
--- a/
src/jalview/gui/AlignmentPanel.java
+++ b/
src/jalview/gui/AlignmentPanel.java
@@
-99,7
+99,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
* Flag set while scrolling to follow complementary cDNA/protein scroll. When
* true, suppresses invoking the same method recursively.
*/
* Flag set while scrolling to follow complementary cDNA/protein scroll. When
* true, suppresses invoking the same method recursively.
*/
- private boolean followingComplementScroll;
+ private boolean dontScrollComplement;
/**
* Creates a new AlignmentPanel object.
/**
* Creates a new AlignmentPanel object.
@@
-137,6
+137,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
final AlignmentPanel ap = this;
av.addPropertyChangeListener(new PropertyChangeListener()
{
final AlignmentPanel ap = this;
av.addPropertyChangeListener(new PropertyChangeListener()
{
+ @Override
public void propertyChange(PropertyChangeEvent evt)
{
if (evt.getPropertyName().equals("alignment"))
public void propertyChange(PropertyChangeEvent evt)
{
if (evt.getPropertyName().equals("alignment"))
@@
-509,6
+510,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
* automatically adjust annotation panel height for new annotation whilst
* ensuring the alignment is still visible.
*/
* automatically adjust annotation panel height for new annotation whilst
* ensuring the alignment is still visible.
*/
+ @Override
public void adjustAnnotationHeight()
{
// TODO: display vertical annotation scrollbar if necessary
public void adjustAnnotationHeight()
{
// TODO: display vertical annotation scrollbar if necessary
@@
-732,7
+734,14
@@
public class AlignmentPanel extends GAlignmentPanel implements
x = 0;
}
x = 0;
}
+ /*
+ * each scroll adjustment triggers adjustmentValueChanged, which resets the
+ * 'do not scroll complement' flag; ensure it is the same for both
+ * operations
+ */
+ boolean flag = isDontScrollComplement();
hscroll.setValues(x, hextent, 0, width);
hscroll.setValues(x, hextent, 0, width);
+ setDontScrollComplement(flag);
vscroll.setValues(y, vextent, 0, height);
}
vscroll.setValues(y, vextent, 0, height);
}
@@
-742,6
+751,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
* @param evt
* DOCUMENT ME!
*/
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void adjustmentValueChanged(AdjustmentEvent evt)
{
int oldX = av.getStartRes();
public void adjustmentValueChanged(AdjustmentEvent evt)
{
int oldX = av.getStartRes();
@@
-775,6
+785,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
// as preference setting
SwingUtilities.invokeLater(new Runnable()
{
// as preference setting
SwingUtilities.invokeLater(new Runnable()
{
+ @Override
public void run()
{
setScrollValues(av.getStartRes(), av.getStartSeq());
public void run()
{
setScrollValues(av.getStartRes(), av.getStartSeq());
@@
-831,9
+842,9
@@
public class AlignmentPanel extends GAlignmentPanel implements
* If there is one, scroll the (Protein/cDNA) complementary alignment to
* match, unless we are ourselves doing that.
*/
* If there is one, scroll the (Protein/cDNA) complementary alignment to
* match, unless we are ourselves doing that.
*/
- if (isFollowingComplementScroll())
+ if (isDontScrollComplement())
{
{
- setFollowingComplementScroll(false);
+ setDontScrollComplement(false);
}
else
{
}
else
{
@@
-845,6
+856,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
* Repaint the alignment including the annotations and overview panels (if
* shown).
*/
* Repaint the alignment including the annotations and overview panels (if
* shown).
*/
+ @Override
public void paintAlignment(boolean updateOverview)
{
final AnnotationSorter sorter = new AnnotationSorter(getAlignment(),
public void paintAlignment(boolean updateOverview)
{
final AnnotationSorter sorter = new AnnotationSorter(getAlignment(),
@@
-871,6
+883,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
* @param g
* DOCUMENT ME!
*/
* @param g
* DOCUMENT ME!
*/
+ @Override
public void paintComponent(Graphics g)
{
invalidate();
public void paintComponent(Graphics g)
{
invalidate();
@@
-880,6
+893,12
@@
public class AlignmentPanel extends GAlignmentPanel implements
hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12));
validate();
hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12));
validate();
+ /*
+ * set scroll bar positions; first suppress this being 'followed' in any
+ * complementary split pane
+ */
+ setDontScrollComplement(true);
+
if (av.getWrapAlignment())
{
int maxwidth = av.getAlignment().getWidth();
if (av.getWrapAlignment())
{
int maxwidth = av.getAlignment().getWidth();
@@
-923,6
+942,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
* @throws PrinterException
* DOCUMENT ME!
*/
* @throws PrinterException
* DOCUMENT ME!
*/
+ @Override
public int print(Graphics pg, PageFormat pf, int pi)
throws PrinterException
{
public int print(Graphics pg, PageFormat pf, int pi)
throws PrinterException
{
@@
-1249,14
+1269,17
@@
public class AlignmentPanel extends GAlignmentPanel implements
void makeAlignmentImage(jalview.util.ImageMaker.TYPE type, File file)
{
void makeAlignmentImage(jalview.util.ImageMaker.TYPE type, File file)
{
- long progress = System.currentTimeMillis();
+ long pSessionId = System.currentTimeMillis();
headless = (System.getProperty("java.awt.headless") != null && System
.getProperty("java.awt.headless").equals("true"));
if (alignFrame != null && !headless)
{
headless = (System.getProperty("java.awt.headless") != null && System
.getProperty("java.awt.headless").equals("true"));
if (alignFrame != null && !headless)
{
- alignFrame.setProgressBar(MessageManager.formatMessage(
+ if (file != null)
+ {
+ alignFrame.setProgressBar(MessageManager.formatMessage(
"status.saving_file", new Object[] { type.getLabel() }),
"status.saving_file", new Object[] { type.getLabel() }),
- progress);
+ pSessionId);
+ }
}
try
{
}
try
{
@@
-1283,7
+1306,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
im = new jalview.util.ImageMaker(this, type, imageAction,
aDimension.getWidth(), aDimension.getHeight(), file,
im = new jalview.util.ImageMaker(this, type, imageAction,
aDimension.getWidth(), aDimension.getHeight(), file,
- imageTitle);
+ imageTitle, alignFrame, pSessionId, headless);
if (av.getWrapAlignment())
{
if (im.getGraphics() != null)
if (av.getWrapAlignment())
{
if (im.getGraphics() != null)
@@
-1302,6
+1325,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
im.writeImage();
}
}
im.writeImage();
}
}
+
} catch (OutOfMemoryError err)
{
// Be noisy here.
} catch (OutOfMemoryError err)
{
// Be noisy here.
@@
-1315,12
+1339,7
@@
public class AlignmentPanel extends GAlignmentPanel implements
}
} finally
{
}
} finally
{
- if (alignFrame != null && !headless)
- {
- alignFrame.setProgressBar(
- MessageManager.getString("status.export_complete"),
- progress);
- }
+
}
}
}
}
@@
-1789,17
+1808,17
@@
public class AlignmentPanel extends GAlignmentPanel implements
}
/**
}
/**
- * Set a flag to say we are scrolling to follow a (cDNA/protein) complement.
+ * Set a flag to say do not scroll any (cDNA/protein) complement.
*
* @param b
*/
*
* @param b
*/
- protected void setFollowingComplementScroll(boolean b)
+ protected void setDontScrollComplement(boolean b)
{
{
- this.followingComplementScroll = b;
+ this.dontScrollComplement = b;
}
}
- protected boolean isFollowingComplementScroll()
+ protected boolean isDontScrollComplement()
{
{
- return this.followingComplementScroll;
+ return this.dontScrollComplement;
}
}
}
}