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-4059 Tidy getting the namespace, and save the namespace in the Jalview instance...
[jalview.git]
/
src
/
jalview
/
gui
/
IdCanvas.java
diff --git
a/src/jalview/gui/IdCanvas.java
b/src/jalview/gui/IdCanvas.java
index
8e49e59
..
3ee3316
100755
(executable)
--- a/
src/jalview/gui/IdCanvas.java
+++ b/
src/jalview/gui/IdCanvas.java
@@
-199,7
+199,7
@@
public class IdCanvas extends JPanel implements ViewportListenerI
gg.translate(0, transY);
gg.translate(0, transY);
- drawIds(gg, av, ss, es, searchResults,true);
+ drawIds(gg, av, ss, es, searchResults, true, getWidth());
gg.translate(0, -transY);
gg.translate(0, -transY);
@@
-256,7
+256,7
@@
public class IdCanvas extends JPanel implements ViewportListenerI
gg.fillRect(0, 0, getWidth(), imgHeight);
drawIds(gg, av, av.getRanges().getStartSeq(),
gg.fillRect(0, 0, getWidth(), imgHeight);
drawIds(gg, av, av.getRanges().getStartSeq(),
- av.getRanges().getEndSeq(), searchResults,true);
+ av.getRanges().getEndSeq(), searchResults, true, getWidth());
gg.dispose();
gg.dispose();
@@
-274,9
+274,16
@@
public class IdCanvas extends JPanel implements ViewportListenerI
* @param startSeq
* @param endSeq
* @param selection
* @param startSeq
* @param endSeq
* @param selection
+ * @param forGUI
+ * when false rendering for print
+ * @param panelWidth
+ * width used to calculate righthand margin - usually
+ * idCanvas.getWidth()
+ *
*/
void drawIds(Graphics2D g, AlignViewport alignViewport,
*/
void drawIds(Graphics2D g, AlignViewport alignViewport,
- final int startSeq, final int endSeq, List<SequenceI> selection, boolean forGUI)
+ final int startSeq, final int endSeq, List<SequenceI> selection,
+ boolean forGUI, int panelWidth)
{
Font font = alignViewport.getFont();
if (alignViewport.isSeqNameItalics())
{
Font font = alignViewport.getFont();
if (alignViewport.isSeqNameItalics())
@@
-304,12
+311,12
@@
public class IdCanvas extends JPanel implements ViewportListenerI
if (alignViewport.getWrapAlignment())
{
if (alignViewport.getWrapAlignment())
{
- drawIdsWrapped(g, alignViewport, startSeq, getHeight());
+ drawIdsWrapped(g, alignViewport, startSeq, getHeight(),
+ manuallyAdjusted ? panelWidth : -1, forGUI);
return;
}
// Now draw the id strings
return;
}
// Now draw the id strings
- int panelWidth = getWidth();
int xPos = 0;
// Now draw the id strings
int xPos = 0;
// Now draw the id strings
@@
-388,6
+395,7
@@
public class IdCanvas extends JPanel implements ViewportListenerI
/**
* render sequence IDs and annotation labels when wrapped - without GUI junk
/**
* render sequence IDs and annotation labels when wrapped - without GUI junk
+ *
* @param g
* @param av2
* @param i
* @param g
* @param av2
* @param i
@@
-396,10
+404,10
@@
public class IdCanvas extends JPanel implements ViewportListenerI
public void drawIdsWrappedNoGUI(Graphics2D g, AlignViewport av2, int i,
int totalHeight)
{
public void drawIdsWrappedNoGUI(Graphics2D g, AlignViewport av2, int i,
int totalHeight)
{
- drawIdsWrapped(g, av2, totalHeight, totalHeight, i,false);
+ drawIdsWrapped(g, av2, totalHeight, totalHeight, i, false);
}
}
- void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
+ public void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
int startSeq, int pageHeight, int idWidth, boolean forGUI)
{
int alignmentWidth = alignViewport.getAlignment().getWidth();
int startSeq, int pageHeight, int idWidth, boolean forGUI)
{
int alignmentWidth = alignViewport.getAlignment().getWidth();
@@
-416,6
+424,9
@@
public class IdCanvas extends JPanel implements ViewportListenerI
AnnotationLabels labels = null;
if (alignViewport.isShowAnnotation())
{
AnnotationLabels labels = null;
if (alignViewport.isShowAnnotation())
{
+ // in wrapped mode, no alignPanel reference is available
+ // FIXME: make the renderer not create a new object in wrapped mode
+ // everytime!
labels = new AnnotationLabels(alignViewport);
}
labels = new AnnotationLabels(alignViewport);
}
@@
-451,10
+462,10
@@
public class IdCanvas extends JPanel implements ViewportListenerI
int getWidth = getWidth();
int thisIdWidth = getWidth;
g.translate(0, ypos + (alheight * charHeight));
int getWidth = getWidth();
int thisIdWidth = getWidth;
g.translate(0, ypos + (alheight * charHeight));
- if (!manuallyAdjusted())
+ if (!isManuallyAdjusted())
{
{
- int getAnnotationsIdWidth = labels.drawLabels(g, false, -1, false,forGUI,
- null, false);
+ int getAnnotationsIdWidth = labels.drawLabels(g, false, -1, false,
+ forGUI, null, false);
thisIdWidth = idWidth < 0 ? getAnnotationsIdWidth : idWidth;
if (thisIdWidth > getWidth)
{
thisIdWidth = idWidth < 0 ? getAnnotationsIdWidth : idWidth;
if (thisIdWidth > getWidth)
{
@@
-623,7
+634,7
@@
public class IdCanvas extends JPanel implements ViewportListenerI
private boolean manuallyAdjusted = false;
private boolean manuallyAdjusted = false;
- public boolean manuallyAdjusted()
+ public boolean isManuallyAdjusted()
{
return manuallyAdjusted;
}
{
return manuallyAdjusted;
}