Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Having problem while using SwingLightweightGlimpseCanvas

36 views
Skip to first unread message

Caglar K

unread,
Jun 13, 2016, 11:09:24 AM6/13/16
to Glimpse
I've been using Glimpse library for a while. I was having scroll pane problem and some additional panel refreshing issues as it is mentioned here;


I've followed the thread and then decided to use SwingLightweightGlimpseCanvas instead of NewtSwingGlimpseCanvas. 

Now I am able to display the content easier and lighter. But now the problem is, canvas is not being repaint after mouse action;
For example; content being displayed is not being dragged with mouse action. It only repaints after I make a very little main frame resizing with mouse.

The version of glimpse I use is 2.2.0. SwingLightweightGlimpseCanvas defined as deprecated but since it is a performance issue; I've continue with that.

Regards..

Geoffrey Ulman

unread,
Jun 13, 2016, 11:22:45 AM6/13/16
to Glimpse

The simplest explanation would be that you haven't started an animator to periodically redraw the GlimpseCanvas.

After creating your canvas, call:

        GLAnimatorControl animator = new FPSAnimator( 120 );
        animator.add( canvas.getGLDrawable( ) );
        animator.start( );

You can see a complete example of setting up a GlimpseCanvas in Example.java.

If that doesn't help, do you see any Exceptions being printed to the console when you run your application?

Also, regarding SwingLightweightGlimpseCanvas: it is deprecated, but should work fine and is still necessary if you want to do things like place a GlimpseCanvas inside a JScrollPane. It's just not as efficient performance-wise as some of the other GlimpseCanvas implementations. But if you're getting fine performance, I wouldn't worry about it.

Geoff

Caglar K

unread,
Jun 13, 2016, 11:39:21 AM6/13/16
to Glimpse
Hi Geoffrey,

What I basically do is;

        FPSAnimator fpsAnimator = new FPSAnimator( canvas.getGLDrawable( ), 60); 
        fpsAnimator.start();

I also tried your code segment which is through GLAnimatorControl, but result is the same. It is strange that there is no exception on the console during runtime.


13 Haziran 2016 Pazartesi 18:09:24 UTC+3 tarihinde Caglar K yazdı:

Geoffrey Ulman

unread,
Jun 13, 2016, 11:54:12 AM6/13/16
to Glimpse
That is odd.

The next debugging step would be for you to create and post a simple, self-contained, single-class example which demonstrates the problem occurring in as simple a situation as possible. I'd suggest patterning it off of the examples in the Glimpse core-examples module.

To get you started, here's my example code from the previous thread you mentioned demonstrating using a SwingLightweightGlimpseCanvas with a JScrollPane: https://gist.github.com/ulmangt/11264961

A class like that which demonstrates the issue you're encountering would be ideal. That will let me reproduce the issue and look into it further.

Caglar K

unread,
Jun 14, 2016, 10:40:35 AM6/14/16
to Glimpse
Actually, I've been using Glimpse library for about 3-4 months. I've developed nice looking and working timeplot examples, for sure patterning them of core examples. 

I will try to create a sample for this situation when I find a suitable time period to do so.

I have also other questions, will open new threads for them.

Thanks.


13 Haziran 2016 Pazartesi 18:09:24 UTC+3 tarihinde Caglar K yazdı:
I've been using Glimpse library for a while. I was having scroll pane problem and some additional panel refreshing issues as it is mentioned here;

Ryan Jones

unread,
Jun 14, 2016, 7:58:18 PM6/14/16
to Glimpse
I would suggest looking at the VerticallyScrollableLayoutExample. This worked for me. Using ScrollPanes never worked for me.
Reply all
Reply to author
Forward
0 new messages