- <!-- JAL-4086 --> Highlight aligned positions on all associated structures when mousing over a column
- <!-- JAL-4221 --> sequence descriptions are updated from database reference sources if not already defined
+- <!-- JAL-4273 --> Visible adjuster marks to grab and adjust annotation panel height and id width
### Improved support for working with computationally determined models
if (Jalview.isHeadlessMode())
{
AnnotationLabels aal = getAlabels();
- int stringWidth = aal.drawLabels(null, false, idWidth, false, fm);
+ int stringWidth = aal.drawLabels(null, false, idWidth, false, false, fm);
idWidth = Math.max(idWidth, stringWidth);
}
else
List<SequenceI> selection = av.getSelectionGroup() == null ? null
: av.getSelectionGroup().getSequences(null);
idCanvas.drawIds((Graphics2D) idGraphics, av, startSeq, endSeq - 1,
- selection);
+ selection, false);
idGraphics.setFont(av.getFont());
idGraphics.translate(0, -scaleHeight);
int offset = getAlabels().getScrollOffset();
idGraphics.translate(0, -offset);
idGraphics.translate(0, alignmentDrawnHeight);
- getAlabels().drawComponent(idGraphics, idWidth);
+ getAlabels().drawComponentNotGUI(idGraphics, idWidth);
idGraphics.translate(0, -alignmentDrawnHeight);
/*
* draw sequence ids and annotation labels (if shown)
*/
IdCanvas idCanvas = getIdPanel().getIdCanvas();
- idCanvas.drawIdsWrapped((Graphics2D) g, av, 0, totalHeight);
+ idCanvas.drawIdsWrappedNoGUI((Graphics2D) g, av, 0, totalHeight);
g.translate(idWidth, 0);
RenderingHints.VALUE_ANTIALIAS_ON);
}
- drawComponent(g2, true, width);
+ drawComponent(g2, true, width, true);
}
/**
*/
public void drawComponent(Graphics g, int width)
{
- drawComponent(g, false, width);
+ drawComponent(g, false, width, true);
}
/**
* @param width
* Width for scaling labels
*/
- public void drawComponent(Graphics g, boolean clip, int givenWidth)
+ public void drawComponent(Graphics g, boolean clip, int givenWidth, boolean forGUI)
{
int width = givenWidth;
IdwidthAdjuster iwa = null;
{
Graphics2D g2d = (Graphics2D) g;
Graphics dummy = g2d.create();
- int newAnnotationIdWidth = drawLabels(dummy, clip, width, false,
+ int newAnnotationIdWidth = drawLabels(dummy, clip, width, false, forGUI,
null);
dummy.dispose();
Dimension d = ap.calculateDefaultAlignmentIdWidth();
}
else
{
- int newAnnotationIdWidth = drawLabels(g, clip, width, false, null);
+ int newAnnotationIdWidth = drawLabels(g, clip, width, false, forGUI, null);
width = Math.max(newAnnotationIdWidth, givenWidth);
}
- drawLabels(g, clip, width, true, null);
+ drawLabels(g, clip, width, true, forGUI, null);
}
/**
* Returns the width of the annotation labels.
*
* @param g
- * Graphics2D instance (needed for font scaling)
+ * Graphics2D instance (used for rendering and font scaling if no fmetrics supplied)
* @param clip
* - true indicates that only current visible area needs to be
* rendered
* @param width
* Width for scaling labels
+ * @param actuallyDraw - when false, no graphics are rendered to g0
+ * @param forGUI - when false, GUI relevant marks like indicators for dragging annotation panel height are not rendered
* @param fmetrics
* FontMetrics if Graphics object g is null
*/
public int drawLabels(Graphics g0, boolean clip, int width,
- boolean actuallyDraw, FontMetrics fmetrics)
+ boolean actuallyDraw, boolean forGUI, FontMetrics fmetrics)
{
if (clip)
{
g.fillRect(0, 0, getWidth(), getHeight());
if (!Cache.getDefault(RESIZE_MARGINS_MARK_PREF, false)
- && !av.getWrapAlignment())
+ && !av.getWrapAlignment() && forGUI)
{
g.setColor(Color.LIGHT_GRAY);
g.drawLine(0, HEIGHT_ADJUSTER_HEIGHT / 4, HEIGHT_ADJUSTER_WIDTH / 4,
public void mouseEntered(MouseEvent e)
{
}
+
+ public void drawComponentNotGUI(Graphics idGraphics, int idWidth)
+ {
+ drawComponent(idGraphics, false, idWidth, false);
+ }
}
gg.translate(0, transY);
- drawIds(gg, av, ss, es, searchResults);
+ drawIds(gg, av, ss, es, searchResults,true);
gg.translate(0, -transY);
gg.fillRect(0, 0, getWidth(), imgHeight);
drawIds(gg, av, av.getRanges().getStartSeq(),
- av.getRanges().getEndSeq(), searchResults);
+ av.getRanges().getEndSeq(), searchResults,true);
gg.dispose();
* @param selection
*/
void drawIds(Graphics2D g, AlignViewport alignViewport,
- final int startSeq, final int endSeq, List<SequenceI> selection)
+ final int startSeq, final int endSeq, List<SequenceI> selection, boolean forGUI)
{
Font font = alignViewport.getFont();
if (alignViewport.isSeqNameItalics())
void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
int startSeq, int pageHeight)
{
- drawIdsWrapped(g, alignViewport, startSeq, pageHeight, -1);
+ drawIdsWrapped(g, alignViewport, startSeq, pageHeight, -1, true);
+ }
+
+ /**
+ * render sequence IDs and annotation labels when wrapped - without GUI junk
+ * @param g
+ * @param av2
+ * @param i
+ * @param totalHeight
+ */
+ public void drawIdsWrappedNoGUI(Graphics2D g, AlignViewport av2, int i,
+ int totalHeight)
+ {
+ drawIdsWrapped(g, av2, totalHeight, totalHeight, i,false);
}
void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
- int startSeq, int pageHeight, int idWidth)
+ int startSeq, int pageHeight, int idWidth, boolean forGUI)
{
int alignmentWidth = alignViewport.getAlignment().getWidth();
final int alheight = alignViewport.getAlignment().getHeight();
g.translate(0, ypos + (alheight * charHeight));
if (!manuallyAdjusted())
{
- int getAnnotationsIdWidth = labels.drawLabels(g, false, -1, false,
+ int getAnnotationsIdWidth = labels.drawLabels(g, false, -1, false,forGUI,
null);
thisIdWidth = idWidth < 0 ? getAnnotationsIdWidth : idWidth;
if (thisIdWidth > getWidth)
alignViewport.setIdWidth(thisIdWidth);
}
}
- labels.drawComponent(g, false, thisIdWidth);
+ labels.drawComponent(g, false, thisIdWidth, forGUI);
g.translate(0, -ypos - (alheight * charHeight));
}
{
manuallyAdjusted = b;
}
+
}