}
else
{
- Graphics2D g2d = (Graphics2D) g;
- Graphics dummy = g2d.create();
- int newAnnotationIdWidth = drawLabels(dummy, clip, width, false,
- null);
+ int newAnnotationIdWidth = drawLabels(g, clip, width, false, null);
width = Math.max(newAnnotationIdWidth, givenWidth);
}
drawLabels(g, clip, width, true, null);
* @param fmetrics
* FontMetrics if Graphics object g is null
*/
- public int drawLabels(Graphics g, boolean clip, int width,
+ public int drawLabels(Graphics g0, boolean clip, int width,
boolean actuallyDraw, FontMetrics fmetrics)
{
if (clip)
clip = Cache.getDefault("MOVE_SEQUENCE_ID_WITH_VISIBLE_ANNOTATIONS",
true);
}
+ Graphics g = null;
+ // create a dummy Graphics object if not drawing and one is supplied
+ if (g0 != null)
+ {
+ if (!actuallyDraw)
+ {
+ Graphics2D g2d = (Graphics2D) g0;
+ g = g2d.create();
+ }
+ else
+ {
+ g = g0;
+ }
+ }
int actualWidth = 0;
if (g != null)
{