Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart2D for Java
 Clipping bug in ChartView.draw
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

PeterJ

26 Posts

Posted - 25 Aug 2010 :  18:02:04  Show Profile  Reply with Quote
We found a problem with the clipping code in ChartView.draw(). Link to the impact below where a QC plot is rendering over a covering panel (in this case a JSplitPane).

The problem was pretty simple. The clip rectangle is getting reset to thew whole plot image when it should remain to the clipping bounds that Swing has provided you. We made the change below and it fixed it.

This problem only shows up on graphics cards the the TYPE_IMAGE_BUFFER succeeds. We found the problem on a range of NVIDIA cards on Linux and Windows. Interestingly, under OS X the problem did not show up.

drawObject(g2, achartobj, drect);
- if (gtype == GraphicsDevice.TYPE_IMAGE_BUFFER)
- g2
- .setClip((int) drect.getX(),
- (int) drect.getY(), (int) drect
- .getWidth(), (int) drect
- .getHeight());
}
}
postDraw(g2);



Edited by - PeterJ on 25 Aug 2010 18:18:50

quinncurtis

1534 Posts

Posted - 25 Aug 2010 :  18:35:09  Show Profile  Reply with Quote
We have Nvida boards in our PC's and we have never seen this problem. Can you modify one of our examples to reproduce it on your systems and send us the program?

That line is there to resolve problems we found with the reset of clipping when printing, and rendering charts to image files. So if you make the change you must check those things too. We didn't see anything bad when we removed it. It could be a bug that was resolved in subsequent releases of the Java runtime.
Go to Top of Page

PeterJ

26 Posts

Posted - 25 Aug 2010 :  19:05:28  Show Profile  Reply with Quote
We can reproduce by putting two instances of SimpleScrollGraph onto a JSplitpane with the minimum sizes of each scroll graph set to zero. As you move the slide across you will see the issue. The best platform to reproduce in Linux and on NVIDIA. We're up to date with our Java (1.6)
Go to Top of Page

quinncurtis

1534 Posts

Posted - 25 Aug 2010 :  19:45:20  Show Profile  Reply with Quote
What did you do to prevent the ScrollApplication1 from resizing to fit the scroll pane?
Go to Top of Page

PeterJ

26 Posts

Posted - 25 Aug 2010 :  22:22:05  Show Profile  Reply with Quote
by setting the minimum size to zero. We'll ship you the simplescroll graph example we built as you're right it is the easiest way to see it.
Go to Top of Page

quinncurtis

1534 Posts

Posted - 26 Aug 2010 :  09:14:24  Show Profile  Reply with Quote
We did set the size to 0. Here is the basic code we used:

scrollapplication1 = new ScrollApplication1();
scrollapplication2 = new ScrollApplication1();

JSplitPane jspane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
     			  scrollapplication1, scrollapplication2);

Dimension minimumSize = new Dimension(0, 0);

jspane.setDividerLocation(200);

scrollapplication1.setMinimumSize(minimumSize) ;  	    
scrollapplication2.setMinimumSize(minimumSize) ;  
   	      	    
contentPane.add(jspane, BorderLayout.CENTER);


Each ScrollApplication1 object resizes to fit the size of the scroll pane, as the divider moves. Send us your own version if you would.
Go to Top of Page

PeterJ

26 Posts

Posted - 30 Aug 2010 :  13:56:54  Show Profile  Reply with Quote
Just back from vacation. Will send you the code today/tomorrow. We just need a little work to totally rip it out of our test program so you don't need any of our code.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07