Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 6185 invoked from network); 6 Aug 2007 09:59:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Aug 2007 09:59:54 -0000 Received: (qmail 76737 invoked by uid 500); 6 Aug 2007 09:59:53 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 76646 invoked by uid 500); 6 Aug 2007 09:59:53 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 76637 invoked by uid 99); 6 Aug 2007 09:59:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2007 02:59:53 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2007 09:59:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 21D3B1A981C; Mon, 6 Aug 2007 02:59:31 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r563083 - /harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java Date: Mon, 06 Aug 2007 09:59:30 -0000 To: commits@harmony.apache.org From: odeakin@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070806095931.21D3B1A981C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: odeakin Date: Mon Aug 6 02:59:30 2007 New Revision: 563083 URL: http://svn.apache.org/viewvc?view=rev&rev=563083 Log: Apply patch HARMONY-4482 ([classlib][swing] JSlider track size in Harmony is smaller then in RI) Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java?view=diff&rev=563083&r1=563082&r2=563083 ============================================================================== --- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java (original) +++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java Mon Aug 6 02:59:30 2007 @@ -700,28 +700,36 @@ : heightOfLowValueLabel / 2; } } else { - trackBuffer = (slider.getOrientation() == JSlider.HORIZONTAL) - ? getThumbSize().width / 2 - : getThumbSize().height / 2; + trackBuffer = 0; } } protected void calculateTrackRect() { - if (slider.getOrientation() == JSlider.HORIZONTAL) { - int width = contentRect.width - trackBuffer * 2 - thumbRect.width; - int x = contentRect.x + trackBuffer + thumbRect.width / 2; - int y = contentRect.y + contentRect.height / 2 - (thumbRect.height + labelRect.height + tickRect.height) / 2; - trackRect.setBounds(x, y, width, thumbRect.height); - } else { - int height = contentRect.height - trackBuffer * 2 - thumbRect.height; - int x; + + if (slider.getOrientation() == JSlider.HORIZONTAL) { + int width = contentRect.width - trackBuffer * 2 + - getThumbSize().width; + int x = contentRect.x + trackBuffer + getThumbSize().width / 2; + int y = contentRect.y + (contentRect.height - getThumbSize().height + + labelRect.height + tickRect.height) / 2; + + trackRect.setBounds(x, y, width, getThumbSize().height); + + } else { + int height = contentRect.height - trackBuffer * 2 + - getThumbSize().height; int sizeToCenter = (getThumbSize().width + labelRect.width + tickRect.width) / 2; + int y = contentRect.y + trackBuffer + getThumbSize().height / 2; + int x; + if (slider.getComponentOrientation().isLeftToRight()) { x = contentRect.x + contentRect.width / 2 - sizeToCenter; + } else { - x = contentRect.x + contentRect.width / 2 + sizeToCenter - getThumbSize().width; + x = contentRect.x + contentRect.width / 2 + sizeToCenter + - getThumbSize().width; } - int y = contentRect.y + trackBuffer + thumbRect.height / 2; + trackRect.setBounds(x, y, getThumbSize().width, height); } }