harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Irlyanov (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-4481) [classlib][swing] Slider code is probably uneffective
Date Tue, 17 Jul 2007 13:05:07 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-4481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dmitry Irlyanov closed HARMONY-4481.
------------------------------------


> [classlib][swing] Slider code is probably uneffective
> -----------------------------------------------------
>
>                 Key: HARMONY-4481
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4481
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Dmitry Irlyanov
>            Assignee: Alexey Petrenko
>            Priority: Trivial
>         Attachments: H4481-BasicSliderUI.patch
>
>
> JSlider code is quite uneffective.
> Let's see for example the following function:
> protected void calculateTrackBuffer() {
>         if (slider.getPaintLabels()) {
>             if ((slider.getOrientation() == JSlider.HORIZONTAL)) {
>                 trackBuffer = getWidthOfHighValueLabel() > getWidthOfLowValueLabel()
>                                                 ? getWidthOfHighValueLabel() / 2
>                                                 : getWidthOfLowValueLabel() / 2;
>            /**skipped**/
>     }
> it calls getWidthOfHighValueLabel() twice. getWidthOfHighValueLabel() in it's turn calls
getHighestValueLabel() twice:
> protected int getWidthOfHighValueLabel() {
>         return getHighestValueLabel() == null ? 0 : getHighestValueLabel().getWidth();
> }
> Of course, without performance test results it's nothing. But performance test results
definitely won't become worse if my patch have been applied.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message