Hi, here is it. I have done this job for few days....
/** * Diese Methode wird im Constructor von JGVTComponent aufgerufen und soll * einen Listener fur Maus und GVTTreeRenderer erzeugen. * Damit der eigene Listener verwendet wird muss diese Methode * uberschrieben werden. */ protected Listener createListener() { return new ScrollableCanvasSVGListener(); } /** * To hide the listener methods. This class just reset the tooltip. * Diese Klasse ist nur uberschrieben im Zusammenhang mit der Methode * createListener * Das Problem des nicht erwunschten Vergrossern des Frames lag hier in der * Anwendung der pack()-Methode. * Dieser Aufruf fuhrt zu einer Neuberechnung der erforderlichen * fenstergrosse. Durch den Aufruf von validate werden die * preferredSize-Werte angepasst und das Fenster nicht vergrossert. */ protected class ScrollableCanvasSVGListener extends CanvasSVGListener { public void setMySize(Dimension d) { setPreferredSize(d); invalidate(); Container p = getParent(); while (p != null) { if (p instanceof Window) { Window w = (Window) p; w.validate(); // im Orignial wurde hier pack() aufgerufen break; } p = p.getParent(); } } } Sorry for the german comment, but it works. Insert this in your own subclass from JSVGCanvas. Jan -----Ursprungliche Nachricht----- Von: Thomas E Deweese [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 25. Marz 2003 16:59 An: Batik Users Cc: [EMAIL PROTECTED] Betreff: RE: Batik 1.5beta5 available >>>>> "BR" == Baron, Randy {PRG~Basel} <[EMAIL PROTECTED]> writes: BR> Hi, I just switched to the new version of Batik 1.5b5. The fix of BR> the tooltips hanging around is fantastic since I was just starting BR> to look into solving that problem myself and it looked very BR> difficult. That problem is gone in 1.5b5 but is replaced by BR> another: I have a JDesktopPane with a toolbar, a menubar and two BR> JInternalFrames, one with a JSVGCanvas and one with a JTree. With BR> Batik1.5b4 the user would select some data from the tree, then the BR> data would be converted to svg and rendered. Now, after the user BR> selects the data from the tree, the entire outermost frame (the BR> one holding the JDesktop), snaps to a very small size, just large BR> enough to display the toolbar and menubar it contains. The user BR> then has to drag the window corner back down to make the frame BR> large enough again to see the canvas where the data is displayed. BR> Does anyone have an idea what might be responsible for this new BR> behaviour? Yup, the JSVGComponent (base class of JSVGCanvas) when it loads a document set's it's preferred size, and tries to find it's parent Window and call's 'pack'. Probably this needs to be controlled by a 'user' option (you being the user). This is currently done in 'setMySize()' in JSVGComponent. You should be able to create a small subclass that does not do this. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]