From: amwaterhouse Date: Mon, 1 May 2006 13:22:22 +0000 (+0000) Subject: If mac, use the fillRoundRect X-Git-Tag: Release_2_08_1~16 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=69ec529c95b2446ce936575676ee7e432293b5f8;p=jalview.git If mac, use the fillRoundRect --- diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index d9b8dd3..daa68d1 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -51,8 +51,13 @@ public class AnnotationPanel public static int GRAPH_HEIGHT = 40; + boolean MAC = false; + public AnnotationPanel(AlignmentPanel ap) { + if (System.getProperty("os.name").startsWith("Mac")) + MAC = true; + this.ap = ap; av = ap.av; this.setLayout(null); @@ -391,11 +396,21 @@ public class AnnotationPanel { case 'H': g.setColor(HELIX_COLOUR); + if (MAC) + { + //Off by 1 offset when drawing rects and ovals + //to offscreen image on the MAC + g.fillRoundRect(lastSSX, y + 4 + iconOffset, + x - lastSSX, 7, 8, 8); + break; + } + int sCol = (lastSSX / av.charWidth) + startRes; int x1 = lastSSX; int x2 = x; - if(row.annotations[sCol-1]==null || + if(sCol==0 || + row.annotations[sCol-1]==null || row.annotations[sCol-1].secondaryStructure!='H') { g.fillArc(lastSSX, y+4+iconOffset, av.charWidth, 8, 90,180) ; @@ -459,12 +474,22 @@ public class AnnotationPanel { case 'H': g.setColor(HELIX_COLOUR); + if (MAC) + { + //Off by 1 offset when drawing rects and ovals + //to offscreen image on the MAC + g.fillRoundRect(lastSSX, y + 4 + iconOffset, + x - lastSSX, 7, 8, 8); + break; + } + int sCol = (lastSSX / av.charWidth) + startRes; int x1 = lastSSX; int x2 = x; - if(row.annotations[sCol-1]==null || + if(sCol==0 || + row.annotations[sCol-1]==null || row.annotations[sCol-1].secondaryStructure!='H') { g.fillArc(lastSSX, y+4+iconOffset, av.charWidth, 8, 90,180) ; @@ -577,7 +602,6 @@ public class AnnotationPanel return; - eRes = Math.min(eRes, aa.annotations.length); int x = 0; @@ -585,6 +609,9 @@ public class AnnotationPanel if(eRes