From be0ebdb58f73968ae968799cb67acf32e150463d Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 1 May 2006 13:24:10 +0000 Subject: [PATCH] If Mac, use the fillRoundRect method --- src/jalview/gui/AnnotationPanel.java | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index f64843a..fc7232e 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -61,6 +61,8 @@ public class AnnotationPanel extends JPanel implements MouseListener, int max; //used by mouseDragged to see if user boolean mouseDragging = false; + boolean MAC = false; + /** * Creates a new AnnotationPanel object. * @@ -68,6 +70,10 @@ public class AnnotationPanel extends JPanel implements MouseListener, */ public AnnotationPanel(AlignmentPanel ap) { + + if(System.getProperty("os.name").startsWith("Mac")) + MAC = true; + ToolTipManager.sharedInstance().registerComponent(this); ToolTipManager.sharedInstance().setInitialDelay(0); ToolTipManager.sharedInstance().setDismissDelay(10000); @@ -787,11 +793,21 @@ public class AnnotationPanel extends JPanel implements MouseListener, { 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+1, 7, 90,180) ; @@ -854,12 +870,22 @@ public class AnnotationPanel extends JPanel implements MouseListener, { 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+1, 7, 90,180) ; @@ -972,7 +998,6 @@ public class AnnotationPanel extends JPanel implements MouseListener, if(sRes>aa.annotations.length) return; - eRes = Math.min(eRes, aa.annotations.length); int x = 0; @@ -980,6 +1005,8 @@ public class AnnotationPanel extends JPanel implements MouseListener, if(eRes