I've noticed that every once in a while, when the application starts up, the view is translated along the x or y axis such that the layout/graph is half out of view. The GraphZoomScrollPane horizontal or vertical scrollbar must then be used to slide the image back into the center of the view.
This is a very random occurence. I've checked to make sure the graph center is aligned with the layout center, and that is always the case (d.width/2f, d.height/2f). The dimensions are always correct, as well.
I have posted a link to these images to give you a better idea:
If you have any suggestions as to what might be causing this, it would be a big help.
-----------
Issue #2:
Also, since I have linked to those images, I also noticed that on rare occasions, the VisualizationViewer needs to be restarted on such graphs to allow the nodes to "shake" and sort themselves out (as if the graph was prematurely stopped). This is using the FRLayout. My educated guess is that this is related to these graphs cooling off too rapidly (larger graphs never have this happen) and somehow the visualization cannot keep up? My attempt to get around this is to call vv.restart() if the temperature cools below a certain threshold too rapidly... which applies to smaller, less populated graphs. This patchwork solution works "most" of the time, which means I am not fully understanding the issue. Any feedback would be appreciated. Both issues are equally perplexing.
Thanks,
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have seen this from time to time.
Can you tell me if your layout is initialized to
a different size than the view? If so, I think that
it might be because when the application attempts
to auto-scale the view to the layout size, it gets the
wrong value for the view size, perhaps because
in the process of sizing all the various panels,
there is some strange intermediate size that gets
used.
I'll look into a way to fix it. It would be a lot easier if
it happened all the time!
For #2:
Usually I see FRLayout running too long, long after
the graph has settled down. What version of jung are
you using?
Tom Nelson
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Re: #1... yes, the layout is initialized to a size that is different from the view. At least you are aware of this issue. What if I went in and changed the hard-coded default? I'll see if that makes a difference.
Re: #2... I am using 1.7.4. I think I have corrected the problem, though, so this issue appears to be closed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
#1 If my theory is correct, then using getPreferredSize instead of
getSize in the method that autoscales, should correct the problem
of getting a completely wrong scaling. You would lose the ability to
auto scale to a view that is not the preferredSize, however.
I may look at ways to ensure that the view is actually showing
before calling getSize.
Tom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can add a 'reset' button to your app that resets the layout
affine transform to identity, and recover from cases where the
graph is in the wrong place. One of the sample apps shows
this feature. I think its in the GraphZoomScollPaneDemo.
I don't think there are any plans to fix bugs or release any
new versions of jung-1.7.x
Tom Nelson
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Issue #1:
I've noticed that every once in a while, when the application starts up, the view is translated along the x or y axis such that the layout/graph is half out of view. The GraphZoomScrollPane horizontal or vertical scrollbar must then be used to slide the image back into the center of the view.
This is a very random occurence. I've checked to make sure the graph center is aligned with the layout center, and that is always the case (d.width/2f, d.height/2f). The dimensions are always correct, as well.
I have posted a link to these images to give you a better idea:
http://home.twcny.rr.com/cmamorel/graphImages.zip
If you have any suggestions as to what might be causing this, it would be a big help.
-----------
Issue #2:
Also, since I have linked to those images, I also noticed that on rare occasions, the VisualizationViewer needs to be restarted on such graphs to allow the nodes to "shake" and sort themselves out (as if the graph was prematurely stopped). This is using the FRLayout. My educated guess is that this is related to these graphs cooling off too rapidly (larger graphs never have this happen) and somehow the visualization cannot keep up? My attempt to get around this is to call vv.restart() if the temperature cools below a certain threshold too rapidly... which applies to smaller, less populated graphs. This patchwork solution works "most" of the time, which means I am not fully understanding the issue. Any feedback would be appreciated. Both issues are equally perplexing.
Thanks,
Chris
Chris,
For #1:
I have seen this from time to time.
Can you tell me if your layout is initialized to
a different size than the view? If so, I think that
it might be because when the application attempts
to auto-scale the view to the layout size, it gets the
wrong value for the view size, perhaps because
in the process of sizing all the various panels,
there is some strange intermediate size that gets
used.
I'll look into a way to fix it. It would be a lot easier if
it happened all the time!
For #2:
Usually I see FRLayout running too long, long after
the graph has settled down. What version of jung are
you using?
Tom Nelson
Re: #1... yes, the layout is initialized to a size that is different from the view. At least you are aware of this issue. What if I went in and changed the hard-coded default? I'll see if that makes a difference.
Re: #2... I am using 1.7.4. I think I have corrected the problem, though, so this issue appears to be closed.
#1 If my theory is correct, then using getPreferredSize instead of
getSize in the method that autoscales, should correct the problem
of getting a completely wrong scaling. You would lose the ability to
auto scale to a view that is not the preferredSize, however.
I may look at ways to ensure that the view is actually showing
before calling getSize.
Tom
Tom,
It seems like this bug is back again... several months ago I stated that the I figured out... but that was probably a fluke.
Has this off-center visualization problem with FRLayout been diagnosed and/or solved yet for 1.7.6?
Thanks,
Chris M.
You can add a 'reset' button to your app that resets the layout
affine transform to identity, and recover from cases where the
graph is in the wrong place. One of the sample apps shows
this feature. I think its in the GraphZoomScollPaneDemo.
I don't think there are any plans to fix bugs or release any
new versions of jung-1.7.x
Tom Nelson