MantisBT - VTK
View Issue Details
0006287VTK(No Category)public2008-01-30 05:222016-08-12 09:54
Jerome Robert 
Kitware Robot 
normalminoralways
closedmoved 
 
 
0006287: vtkCanvas in JSplitter should be resizable
vtkCanvas minimum size and prefered size are not initialised so Swing set them to the last value specified with setSized. So even when a vtkCanvas is used in context where it should be resizable, it's size is frozen. The minimum and prefered size of vtkCanvas should be set to (0,0) in the constructor.
A simple example to show the bug:

import javax.swing.JFrame;
import javax.swing.JSplitPane;
import vtk.vtkCanvas;

public class BugCanvasSize
{
    public static void main(String[] args)
    {
        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JSplitPane split = new JSplitPane();
        vtkCanvas canvas = new vtkCanvas()
        {
            public void setSize(int x, int y)
            {
                super.setSize(x, y);
                System.out.println("Someone has changed my size to "+x+" "+y);
                System.out.println("prefered and min size are now: "+
                    getPreferredSize()+" "+getMinimumSize());
            }
        };
        //Uncomment: Workaround for not resizable vtkCanvas bug.
        //canvas.setMinimumSize(new Dimension(0, 0));
        //canvas.setPreferredSize(new Dimension(0, 0));

        split.add(canvas, JSplitPane.BOTTOM);
        canvas.GetRenderer().AddActor(Utils.createDummyActor());
        frame.add(split);
        frame.setSize(800, 600);
        frame.setVisible(true);
    }
}
No tags attached.
Issue History
2008-01-30 05:22Jerome RobertNew Issue
2008-01-30 05:23Jerome RobertNote Added: 0010338
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:54Kitware RobotNote Added: 0036948
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved
2016-08-12 09:54Kitware RobotAssigned To => Kitware Robot

Notes
(0010338)
Jerome Robert   
2008-01-30 05:23   
Not sure of that be the bug should probably fixed in vtkPanel, and not in vtkCanvas.
I get this error with vtkCanvas.java revision 1.9 and vtkPanel.java revision 1.17.
(0036948)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.