You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Petrenko (JIRA)" <ji...@apache.org> on 2007/07/17 14:43:06 UTC

[jira] Resolved: (HARMONY-4481) [classlib][swing] Slider code is probably uneffective

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

Alexey Petrenko resolved HARMONY-4481.
--------------------------------------

    Resolution: Fixed

Dmitry,

I've slightly modified and committed your patch.
Please verify.

> [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.