Hello.
There's a bug that was introduced sometime between beta3 and beta4. I'm
attaching sample code that will reproduce it reliably.
The code includes a single JFrame which contains a JDesktop. The desktop
contains JInternalFrames which hold a JSVGCanvas. Under beta4 and beta5 when
you load an SVG file into the canvas contained in the internal frame, the
ENTIRE root JFrame resizes (packs really) into it's smallest possible size.
Resizing or packing the internal frame should not cause the entire parent frame
to resize. This does not occur under beta3.
I haven't had time yet to dig through the batik code and find the bug itself,
however, as it stands I'm stuck using beta3 until this is fixed.
Any help would be appriciated.
jaaron
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
package batik.test;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import org.apache.batik.swing.*;
import javax.swing.border.EmptyBorder;
import java.beans.*;
public class BatikFrames {
private JFrame m_root;
private JDesktopPane m_desktop;
public BatikFrames() {
}
public void initialize(){
m_root = new JFrame();
m_desktop = new JDesktopPane();
final int inset = 50;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
m_root.setBounds(inset, inset, screenSize.width - inset*2, screenSize.height - inset * 2);
m_root.setJMenuBar(buildMenuBar());
m_root.getContentPane().add(m_desktop);
m_root.setVisible(true);
}
protected JMenuBar buildMenuBar(){
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu("File");
JMenuItem item = new JMenuItem("New");
item.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
String url = JOptionPane.showInputDialog(m_root,
"Enter a URL to an SVG file",
"Enter URL",
JOptionPane.QUESTION_MESSAGE);
addCanvas(url);
}
}
);
menu.add(item);
menuBar.add(menu);
return menuBar;
}
protected void addCanvas(String url){
JInternalFrame internal = new JInternalFrame(url,true,true,true,true);
internal.setBounds(10,10,300,400);
JPanel panel = new JPanel();
panel.setBorder( new EmptyBorder(5,5,5,5));
panel.setLayout(new BorderLayout());
JSVGCanvas canvas = new JSVGCanvas();
canvas.setURI(url);
panel.add(canvas, BorderLayout.CENTER);
internal.getContentPane().add(panel);
m_desktop.add(internal);
internal.setVisible(true);
}
public static void main(String[] args) {
BatikFrames batik = new BatikFrames();
batik.initialize();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]