Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6788483

Synth does not support PRESSED state for ScrollBar Thumb

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6u10, 9
    • client-libs

      FULL PRODUCT VERSION :
      java version "1.6.0_11"
      Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
      Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      The only states I'm seeing in my paintScrollBarThumbBackground method are 1 (ENABLED) and 2 (MOUSE_OVER). There is no way to properly handle the PRESSED state which is quite different from MOUSE_OVER.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      install a custom painter to handle paintScrollBarThumbBackground and note what context.getComponentState() returns while performing normal actions on the scrollbar.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      PRESSED state should be set while dragging the scrollbar thumb.
      ACTUAL -
      Only MOUSE_OVER is set when dragging the scrollbar thumb, since it is also set when the mouse is over the thumb but the mouse button is not pressed (no dragging) there is no way to paint the thumb differently using only images and a Synth XML file.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Instead of using imagePainter in your synth XML you must write Java code for the LnF and use ((JScrollBar)context.getComponent()).getValueIsAdjusting() in the paintScrollBarThumbBackground to synthesize a PRESSED state on your own.

            aghaisas Ajit Ghaisas
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: