[vtkusers] problems trying to use the Render() method of vtkPanel
Romain Ollivier
Romain.Ollivier at sophia.inria.fr
Thu Jun 19 11:32:39 EDT 2003
Hi,
I'm trying to create a java viewer to display images slices of raw
data. I've put on a JFrame container two component : a vtkPanel and a
JSlider. the vtkPanel is working fine and I can zoom/rotate/move my
image, but :
- if another application overlap my windows, the vtkPanel is not
refresh automaticaly (until I make an action on it)
- my JSlider has an event listener to change the slice when moved :
public void stateChanged(final ChangeEvent e)
{
JSlider source = (JSlider)e.getSource();
slice = (int)source.getValue();
System.out.println(slice + "\n");
actor.SetZSlice(slice);
view.repaint();
}
when I use the slider, this error is sent in the console at each move
:
java.lang.NullPointerException
at MIPSViewer.stateChanged(MIPSViewer.java:133)
at javax.swing.JSlider.fireStateChanged(JSlider.java:343)
at
javax.swing.JSlider$ModelListener.stateChanged(JSlider.java:271)
at
javax.swing.DefaultBoundedRangeModel.fireStateChanged(DefaultBoundedRangeModel.java:346)
at
javax.swing.DefaultBoundedRangeModel.setRangeProperties(DefaultBoundedRangeModel.java:283)
at
javax.swing.DefaultBoundedRangeModel.setValue(DefaultBoundedRangeModel.java:149)
at javax.swing.JSlider.setValue(JSlider.java:421)
at
javax.swing.plaf.basic.BasicSliderUI$TrackListener.mouseDragged(BasicSliderUI.java:1496)
at
java.awt.Component.processMouseMotionEvent(Component.java:5069)
at
javax.swing.JComponent.processMouseMotionEvent(JComponent.java:2763)
at java.awt.Component.processEvent(Component.java:4822)
at java.awt.Container.processEvent(Container.java:1380)
at java.awt.Component.dispatchEventImpl(Component.java:3526)
at java.awt.Container.dispatchEventImpl(Container.java:1437)
at java.awt.Component.dispatchEvent(Component.java:3367)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:2946)
at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
at java.awt.Container.dispatchEventImpl(Container.java:1423)
at java.awt.Window.dispatchEventImpl(Window.java:1566)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
After this, if I try to interact with my vtkPanel, the program crashes
sending :
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x4E208188
Function=__nvsym17103+0x0
Library=/usr/X11R6/lib/libGL.so.1
Current Java thread:
at vtk.vtkRenderer.ResetCameraClippingRange_45(Native Method)
at
vtk.vtkRenderer.ResetCameraClippingRange(vtkRenderer.java:192)
at vtk.vtkPanel.resetCameraClippingRange(vtkPanel.java:195)
at vtk.vtkPanel.mouseDragged(vtkPanel.java:261)
at
java.awt.Component.processMouseMotionEvent(Component.java:5069)
at java.awt.Component.processEvent(Component.java:4822)
at java.awt.Component.dispatchEventImpl(Component.java:3526)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
Dynamic libraries:
......
If I do not call the Render() fonction in my StateChanged function,
there is no crash problem, but of course no refreh until I interact with
the vtkPanel.
I've seen a quite similar message on the list
(http://www.vtk.org/pipermail/vtkusers/2003-June/018389.html) but no one
responded yet... Could anyone help me ?
PS: I use jdk1.4.0 and a CVS vtk version (17 jun 2003)
More information about the vtkusers
mailing list