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

Inconsis. of clipping-state when using scroll-wheel inside of ScrollPan. (MAWT)

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      FULL PRODUCT VERSION :
      mustang b75, java-5.0, java-1.4.2

      ADDITIONAL OS VERSION INFORMATION :
      Linux cehost 2.6.15-1.1831_FC4 #1 Tue Feb 7 13:37:42 EST 2006 i686 i686 i386 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      I've some legancy code which uses grahics.getClipBounds() to determine which parts of the scrolled area should be repainted.
      It does this for optimized scrolling and was written way back for Java-1.0 and later ported to java-1.1

      I know this is not how it should be done, and I don't file this bug since I believe Motif-AWTs behaviour is incorrect but rather since I believe at least it should be consistent across all supported platforms. It works with Windows-AWT, X-AWT and Motif-AWT as long as the scrollbars are used for scrolling but does not work with MAWT when scrolling by wheel.
      And some _sometimes_ MAWT does set the "right" clip it looks like a threading bug or something equivivalent.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.) Compile and run the attached sample code once with MAWT and XAWT
      2.) Scroll the area by using the scrollbars -> the set clip rectangle will be related to the actual scrolling position
      3.) Scroll by wheel and the set clip rectangle is like 2.) for WAWT and XAWT, but for MAWT its only sometimes (very seldom) the correct position but most time y:0

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Also when using MAWT the clip should be reported "correctly"
      ACTUAL -
      getClipBounds most time returns y:0 and only very seldom the actual position

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;

      public class ScrollPaneBug extends Frame
      {
      ScrollPane sp;

      public ScrollPaneBug()
      {
      setLayout(new BorderLayout());
      sp = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED);
      sp.add(new ScrolledPane());

      this.add(sp, BorderLayout.CENTER);
      this.setSize(550, 400);
      this.setVisible(true);
      }

      public static void main(String[] args)
      {
      new ScrollPaneBug();
      }
      }

      class ScrolledPane extends Component
      {
      public void paint(Graphics g)
      {
      System.out.println(g.getClipBounds());
      }

      public Dimension getPreferredSize()
      {
      return new Dimension(500, 1000);
      }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      use XAWT

        Attachments

          Activity

            People

            • Assignee:
              dav Andrei Dmitriev (Inactive)
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: