hillion 02/03/11 01:04:38 Modified: sources/org/apache/batik/apps/svgbrowser JSVGViewerFrame.java sources/org/apache/batik/bridge ScriptingEnvironment.java UserAgent.java UserAgentAdapter.java sources/org/apache/batik/dom AbstractElement.java AbstractParentNode.java sources/org/apache/batik/dom/events EventListenerList.java EventSupport.java sources/org/apache/batik/script/rhino WindowWrapper.java sources/org/apache/batik/swing/svg JSVGComponent.java SVGUserAgent.java sources/org/apache/batik/transcoder/image ImageTranscoder.java sources/org/apache/batik/transcoder/print PrintTranscoder.java xdocs faq.xml index.xml javaScripting.xml jsvgcanvas.xml mail-lists.xml scriptFeatures.xml whoAreWe.xml Added: resources/org/apache/batik/swing/svg/resources Messages.properties Log: - Moved alert, confirm and prompt dialog boxes creation code from the bridge to the JSVGComponent, - documentation updates. Revision Changes Path 1.1 xml-batik/resources/org/apache/batik/swing/svg/resources/Messages.properties Index: Messages.properties =================================================================== ############################################################################# # Copyright (C) The Apache Software Foundation. All rights reserved. # ############################################################################# # This software is published under the terms of the Apache Software License # # version 1.1, a copy of which has been included with this distribution in # # the LICENSE file. # ############################################################################# script.alert = \ Script alert:\n{0} script.confirm = \ Script confirm:\n{0} script.prompt = \ Script prompt:\n{0} 1.72 +31 -3 xml-batik/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java Index: JSVGViewerFrame.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- JSVGViewerFrame.java 22 Feb 2002 11:30:53 -0000 1.71 +++ JSVGViewerFrame.java 11 Mar 2002 09:04:37 -0000 1.72 @@ -161,7 +161,7 @@ * This class represents a SVG viewer swing frame. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: JSVGViewerFrame.java,v 1.71 2002/02/22 11:30:53 hillion Exp $ + * @version $Id: JSVGViewerFrame.java,v 1.72 2002/03/11 09:04:37 hillion Exp $ */ public class JSVGViewerFrame extends JFrame @@ -1909,7 +1909,7 @@ new JOptionPane(message, JOptionPane.ERROR_MESSAGE); JDialog dialog = pane.createDialog(JSVGViewerFrame.this, "ERROR"); dialog.setModal(false); - dialog.show(); // Safe to be called from any thread + dialog.show(); } /** @@ -1923,7 +1923,7 @@ new JErrorPane(ex, JOptionPane.ERROR_MESSAGE); JDialog dialog = pane.createDialog(JSVGViewerFrame.this, "ERROR"); dialog.setModal(false); - dialog.show(); // Safe to be called from any thread + dialog.show(); } /** @@ -1932,6 +1932,34 @@ */ public void displayMessage(String message) { statusBar.setMessage(message); + } + + /** + * Shows an alert dialog box. + */ + public void showAlert(String message) { + svgCanvas.showAlert(message); + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message) { + return svgCanvas.showPrompt(message); + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message, String defaultValue) { + return svgCanvas.showPrompt(message, defaultValue); + } + + /** + * Shows a confirm dialog box. + */ + public boolean showConfirm(String message) { + return svgCanvas.showConfirm(message); } /** 1.12 +16 -15 xml-batik/sources/org/apache/batik/bridge/ScriptingEnvironment.java Index: ScriptingEnvironment.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/ScriptingEnvironment.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- ScriptingEnvironment.java 6 Mar 2002 17:14:44 -0000 1.11 +++ ScriptingEnvironment.java 11 Mar 2002 09:04:37 -0000 1.12 @@ -25,7 +25,7 @@ * This class contains the informations needed by the SVG scripting. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: ScriptingEnvironment.java,v 1.11 2002/03/06 17:14:44 tkormann Exp $ + * @version $Id: ScriptingEnvironment.java,v 1.12 2002/03/11 09:04:37 hillion Exp $ */ public class ScriptingEnvironment extends BaseScriptingEnvironment { @@ -311,38 +311,39 @@ * Displays an alert dialog box. */ public void alert(String message) { - javax.swing.JOptionPane.showMessageDialog - (null, "Script alert:\n" + message); + if (userAgent != null) { + userAgent.showAlert(message); + } } /** * Displays a confirm dialog box. */ public boolean confirm(String message) { - return javax.swing.JOptionPane.showConfirmDialog - (null, "Script confirm:\n" + message, - "Confirm",javax.swing.JOptionPane.YES_NO_OPTION) == - javax.swing.JOptionPane.YES_OPTION; + if (userAgent != null) { + return userAgent.showConfirm(message); + } + return false; } /** * Displays an input dialog box. */ public String prompt(String message) { - return javax.swing.JOptionPane.showInputDialog - ("Script prompt:\n" + message); + if (userAgent != null) { + return userAgent.showPrompt(message); + } + return null; } /** * Displays an input dialog box, given the default value. */ public String prompt(String message, String defVal) { - return (String)javax.swing.JOptionPane.showInputDialog - (null, - "Script prompt:\n" + message, - "Prompt", - javax.swing.JOptionPane.PLAIN_MESSAGE, - null, null, defVal); + if (userAgent != null) { + return userAgent.showPrompt(message, defVal); + } + return null; } /** 1.19 +21 -1 xml-batik/sources/org/apache/batik/bridge/UserAgent.java Index: UserAgent.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/UserAgent.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- UserAgent.java 24 Oct 2001 14:52:36 -0000 1.18 +++ UserAgent.java 11 Mar 2002 09:04:37 -0000 1.19 @@ -24,7 +24,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Christophe Jolif</a> * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: UserAgent.java,v 1.18 2001/10/24 14:52:36 tkormann Exp $ + * @version $Id: UserAgent.java,v 1.19 2002/03/11 09:04:37 hillion Exp $ */ public interface UserAgent { @@ -48,6 +48,26 @@ * Displays a message in the User Agent interface. */ void displayMessage(String message); + + /** + * Shows an alert dialog box. + */ + void showAlert(String message); + + /** + * Shows a prompt dialog box. + */ + String showPrompt(String message); + + /** + * Shows a prompt dialog box. + */ + String showPrompt(String message, String defaultValue); + + /** + * Shows a confirm dialog box. + */ + boolean showConfirm(String message); /** * Returns the pixel to mm factor. 1.6 +28 -1 xml-batik/sources/org/apache/batik/bridge/UserAgentAdapter.java Index: UserAgentAdapter.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/UserAgentAdapter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- UserAgentAdapter.java 24 Oct 2001 14:52:36 -0000 1.5 +++ UserAgentAdapter.java 11 Mar 2002 09:04:37 -0000 1.6 @@ -31,7 +31,7 @@ * the creation of UserAgent instances. * * @author <a href="mailto:[EMAIL PROTECTED]">Thomas DeWeese</a> - * @version $Id: UserAgentAdapter.java,v 1.5 2001/10/24 14:52:36 tkormann Exp $ + * @version $Id: UserAgentAdapter.java,v 1.6 2002/03/11 09:04:37 hillion Exp $ */ public class UserAgentAdapter implements UserAgent { protected Set FEATURES = new HashSet(); @@ -71,6 +71,33 @@ */ public void displayError(Exception e) { displayError(e.getMessage()); + } + + /** + * Shows an alert dialog box. + */ + public void showAlert(String message) { + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message) { + return null; + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message, String defaultValue) { + return null; + } + + /** + * Shows a confirm dialog box. + */ + public boolean showConfirm(String message) { + return false; } /** 1.14 +3 -2 xml-batik/sources/org/apache/batik/dom/AbstractElement.java Index: AbstractElement.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/AbstractElement.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- AbstractElement.java 8 Mar 2002 08:45:27 -0000 1.13 +++ AbstractElement.java 11 Mar 2002 09:04:37 -0000 1.14 @@ -29,7 +29,7 @@ * This class implements the {@link org.w3c.dom.Element} interface. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: AbstractElement.java,v 1.13 2002/03/08 08:45:27 hillion Exp $ + * @version $Id: AbstractElement.java,v 1.14 2002/03/11 09:04:37 hillion Exp $ */ public abstract class AbstractElement extends AbstractParentChildNode @@ -656,7 +656,8 @@ /** * Adds a node to the map. */ - public Node setNamedItem(String ns, String name, Node arg) throws DOMException { + public Node setNamedItem(String ns, String name, Node arg) + throws DOMException { ((AbstractAttr)arg).setOwnerElement(AbstractElement.this); AbstractAttr result = (AbstractAttr)put(ns, name, arg); 1.12 +4 -2 xml-batik/sources/org/apache/batik/dom/AbstractParentNode.java Index: AbstractParentNode.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/AbstractParentNode.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- AbstractParentNode.java 19 Nov 2001 13:39:56 -0000 1.11 +++ AbstractParentNode.java 11 Mar 2002 09:04:37 -0000 1.12 @@ -24,7 +24,7 @@ * This class implements the Node interface with support for children. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: AbstractParentNode.java,v 1.11 2001/11/19 13:39:56 hillion Exp $ + * @version $Id: AbstractParentNode.java,v 1.12 2002/03/11 09:04:37 hillion Exp $ */ public abstract class AbstractParentNode extends AbstractNode { @@ -540,7 +540,9 @@ private void initialize(Node node) { if (node.getNodeType() == ELEMENT_NODE) { String ns = node.getNamespaceURI(); - String nm = (ns == null) ? node.getNodeName() : node.getLocalName(); + String nm = (ns == null) + ? node.getNodeName() + : node.getLocalName(); if (nsMatch(namespaceURI, node.getNamespaceURI()) && (localName.equals("*") || localName.equals(nm))) { append(node); 1.3 +7 -0 xml-batik/sources/org/apache/batik/dom/events/EventListenerList.java Index: EventListenerList.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/events/EventListenerList.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- EventListenerList.java 11 Feb 2001 20:36:42 -0000 1.2 +++ EventListenerList.java 11 Mar 2002 09:04:37 -0000 1.3 @@ -83,6 +83,13 @@ return false; } + /** + * Returns the number of listeners in the list. + */ + public int size() { + return n; + } + // simple entry for the list private static class Entry { EventListener listener; 1.7 +5 -2 xml-batik/sources/org/apache/batik/dom/events/EventSupport.java Index: EventSupport.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/events/EventSupport.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- EventSupport.java 13 Feb 2002 13:00:31 -0000 1.6 +++ EventSupport.java 11 Mar 2002 09:04:37 -0000 1.7 @@ -19,7 +19,7 @@ * @see NodeEventTarget * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: EventSupport.java,v 1.6 2002/02/13 13:00:31 tkormann Exp $ + * @version $Id: EventSupport.java,v 1.7 2002/03/11 09:04:37 hillion Exp $ */ public class EventSupport { @@ -122,9 +122,12 @@ if (listeners == null) { return; } - EventListenerList list = (EventListenerList) listeners.get(type); + EventListenerList list = (EventListenerList)listeners.get(type); if (list != null) { list.remove(listener); + if (list.size() == 0) { + listeners.remove(type); + } } } 1.4 +3 -5 xml-batik/sources/org/apache/batik/script/rhino/WindowWrapper.java Index: WindowWrapper.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/script/rhino/WindowWrapper.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- WindowWrapper.java 7 Mar 2002 15:23:11 -0000 1.3 +++ WindowWrapper.java 11 Mar 2002 09:04:37 -0000 1.4 @@ -27,7 +27,7 @@ * This class wraps a Window object to expose it to the interpreter. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: WindowWrapper.java,v 1.3 2002/03/07 15:23:11 hillion Exp $ + * @version $Id: WindowWrapper.java,v 1.4 2002/03/11 09:04:37 hillion Exp $ */ public class WindowWrapper extends ScriptableObject { @@ -214,16 +214,14 @@ case 1: String message = (String)NativeJavaObject.coerceType(String.class, args[0]); - String result = window.prompt(message); - return (result == null) ? "" : result; + return window.prompt(message); default: message = (String)NativeJavaObject.coerceType(String.class, args[0]); String defVal = (String)NativeJavaObject.coerceType(String.class, args[1]); - result = window.prompt(message, defVal); - return (result == null) ? "" : result; + return window.prompt(message, defVal); } } 1.47 +157 -1 xml-batik/sources/org/apache/batik/swing/svg/JSVGComponent.java Index: JSVGComponent.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/swing/svg/JSVGComponent.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- JSVGComponent.java 8 Mar 2002 15:17:18 -0000 1.46 +++ JSVGComponent.java 11 Mar 2002 09:04:37 -0000 1.47 @@ -35,6 +35,7 @@ import java.util.Set; import javax.swing.JComponent; +import javax.swing.JOptionPane; import org.apache.batik.bridge.BridgeContext; import org.apache.batik.bridge.BridgeException; @@ -180,7 +181,7 @@ * building/rendering a document (invalid XML file, missing attributes...).</p> * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: JSVGComponent.java,v 1.46 2002/03/08 15:17:18 tkormann Exp $ + * @version $Id: JSVGComponent.java,v 1.47 2002/03/11 09:04:37 hillion Exp $ */ public class JSVGComponent extends JGVTComponent { @@ -724,6 +725,47 @@ } /** + * Shows an alert dialog box. + */ + public void showAlert(String message) { + JOptionPane.showMessageDialog + (this, Messages.formatMessage("script.alert", + new Object[] { message })); + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message) { + return JOptionPane.showInputDialog + (this, Messages.formatMessage("script.prompt", + new Object[] { message })); + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message, String defaultValue) { + return (String)JOptionPane.showInputDialog + (this, + Messages.formatMessage("script.prompt", + new Object[] { message }), + null, + JOptionPane.PLAIN_MESSAGE, + null, null, defaultValue); + } + + /** + * Shows a confirm dialog box. + */ + public boolean showConfirm(String message) { + return JOptionPane.showConfirmDialog + (this, Messages.formatMessage("script.confirm", + new Object[] { message }), + "Confirm", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION; + } + + /** * Creates an instance of Listener. */ protected Listener createListener() { @@ -1522,6 +1564,79 @@ } /** + * Shows an alert dialog box. + */ + public void showAlert(final String message) { + if (EventQueue.isDispatchThread()) { + userAgent.showAlert(message); + } else { + invokeAndWait(new Runnable() { + public void run() { + userAgent.showAlert(message); + } + }); + } + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(final String message) { + if (EventQueue.isDispatchThread()) { + return userAgent.showPrompt(message); + } else { + class Query implements Runnable { + String result; + public void run() { + result = userAgent.showPrompt(message); + } + } + Query q = new Query(); + invokeAndWait(q); + return q.result; + } + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(final String message, + final String defaultValue) { + if (EventQueue.isDispatchThread()) { + return userAgent.showPrompt(message, defaultValue); + } else { + class Query implements Runnable { + String result; + public void run() { + result = userAgent.showPrompt(message, defaultValue); + } + } + Query q = new Query(); + invokeAndWait(q); + return q.result; + } + } + + /** + * Shows a confirm dialog box. + */ + public boolean showConfirm(final String message) { + if (EventQueue.isDispatchThread()) { + return userAgent.showConfirm(message); + } else { + class Query implements Runnable { + boolean result; + public void run() { + result = userAgent.showConfirm(message); + } + } + Query q = new Query(); + invokeAndWait(q); + return q.result; + } + } + + /** * Returns the pixel to mm factor. */ public float getPixelToMM() { @@ -1847,6 +1962,47 @@ if (svgUserAgent != null) { svgUserAgent.displayMessage(message); } + } + + /** + * Shows an alert dialog box. + */ + public void showAlert(String message) { + if (svgUserAgent != null) { + svgUserAgent.showAlert(message); + return; + } + JSVGComponent.this.showAlert(message); + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message) { + if (svgUserAgent != null) { + return svgUserAgent.showPrompt(message); + } + return JSVGComponent.this.showPrompt(message); + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message, String defaultValue) { + if (svgUserAgent != null) { + return svgUserAgent.showPrompt(message, defaultValue); + } + return JSVGComponent.this.showPrompt(message, defaultValue); + } + + /** + * Shows a confirm dialog box. + */ + public boolean showConfirm(String message) { + if (svgUserAgent != null) { + return svgUserAgent.showConfirm(message); + } + return JSVGComponent.this.showConfirm(message); } /** 1.7 +21 -1 xml-batik/sources/org/apache/batik/swing/svg/SVGUserAgent.java Index: SVGUserAgent.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/swing/svg/SVGUserAgent.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- SVGUserAgent.java 24 Oct 2001 14:52:36 -0000 1.6 +++ SVGUserAgent.java 11 Mar 2002 09:04:37 -0000 1.7 @@ -15,7 +15,7 @@ * a JSVGComponent. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: SVGUserAgent.java,v 1.6 2001/10/24 14:52:36 tkormann Exp $ + * @version $Id: SVGUserAgent.java,v 1.7 2002/03/11 09:04:37 hillion Exp $ */ public interface SVGUserAgent { @@ -34,6 +34,26 @@ * The given message is typically displayed in a status bar. */ void displayMessage(String message); + + /** + * Shows an alert dialog box. + */ + void showAlert(String message); + + /** + * Shows a prompt dialog box. + */ + String showPrompt(String message); + + /** + * Shows a prompt dialog box. + */ + String showPrompt(String message, String defaultValue); + + /** + * Shows a confirm dialog box. + */ + boolean showConfirm(String message); /** * Returns a customized the pixel to mm factor. 1.38 +28 -1 xml-batik/sources/org/apache/batik/transcoder/image/ImageTranscoder.java Index: ImageTranscoder.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/transcoder/image/ImageTranscoder.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- ImageTranscoder.java 7 Mar 2002 22:07:44 -0000 1.37 +++ ImageTranscoder.java 11 Mar 2002 09:04:38 -0000 1.38 @@ -101,7 +101,7 @@ * millimeter conversion factor. * * @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a> - * @version $Id: ImageTranscoder.java,v 1.37 2002/03/07 22:07:44 deweese Exp $ + * @version $Id: ImageTranscoder.java,v 1.38 2002/03/11 09:04:38 hillion Exp $ */ public abstract class ImageTranscoder extends XMLAbstractTranscoder { @@ -365,6 +365,33 @@ } catch (TranscoderException ex) { throw new RuntimeException(); } + } + + /** + * Shows an alert dialog box. + */ + public void showAlert(String message) { + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message) { + return null; + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message, String defaultValue) { + return null; + } + + /** + * Shows a confirm dialog box. + */ + public boolean showConfirm(String message) { + return false; } /** 1.19 +28 -1 xml-batik/sources/org/apache/batik/transcoder/print/PrintTranscoder.java Index: PrintTranscoder.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/transcoder/print/PrintTranscoder.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- PrintTranscoder.java 29 Nov 2001 15:05:26 -0000 1.18 +++ PrintTranscoder.java 11 Mar 2002 09:04:38 -0000 1.19 @@ -110,7 +110,7 @@ * </ul> * * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Hardy</a> - * @version $Id: PrintTranscoder.java,v 1.18 2001/11/29 15:05:26 deweese Exp $ + * @version $Id: PrintTranscoder.java,v 1.19 2002/03/11 09:04:38 hillion Exp $ */ public class PrintTranscoder extends XMLAbstractTranscoder implements Printable { @@ -796,6 +796,33 @@ } catch (TranscoderException ex) { throw new RuntimeException(); } + } + + /** + * Shows an alert dialog box. + */ + public void showAlert(String message) { + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message) { + return null; + } + + /** + * Shows a prompt dialog box. + */ + public String showPrompt(String message, String defaultValue) { + return null; + } + + /** + * Shows a confirm dialog box. + */ + public boolean showConfirm(String message) { + return false; } /** 1.29 +2 -2 xml-batik/xdocs/faq.xml Index: faq.xml =================================================================== RCS file: /home/cvs/xml-batik/xdocs/faq.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- faq.xml 18 Dec 2001 13:08:06 -0000 1.28 +++ faq.xml 11 Mar 2002 09:04:38 -0000 1.29 @@ -10,7 +10,7 @@ <!-- ========================================================================= --> <!-- author [EMAIL PROTECTED] --> <!-- author [EMAIL PROTECTED] --> -<!-- version $Id: faq.xml,v 1.28 2001/12/18 13:08:06 vhardy Exp $ --> +<!-- version $Id: faq.xml,v 1.29 2002/03/11 09:04:38 hillion Exp $ --> <!-- ========================================================================= --> <!DOCTYPE faqs SYSTEM "./dtd/faq-v10.dtd"> @@ -233,7 +233,7 @@ <ul> <li><link href="http://www.csiro.au/">CSIRO</link></li> <li><link href="http://www.ilog.com/">ILOG</link></li> - <li><link href="http://www.inria.fr/koala/">Koala Team</link></li> + <li><link href="http://koala.ilog.fr/">Koala Team</link></li> <li><link href="http://www.kodak.com/">Eastman Kodak Company</link></li> <li><link href="http://www.sun.com">Sun Microsystems, Inc.</link></li> </ul> 1.38 +2 -4 xml-batik/xdocs/index.xml Index: index.xml =================================================================== RCS file: /home/cvs/xml-batik/xdocs/index.xml,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- index.xml 4 Mar 2002 12:16:42 -0000 1.37 +++ index.xml 11 Mar 2002 09:04:38 -0000 1.38 @@ -11,7 +11,7 @@ <!-- ========================================================================= --> <!-- author [EMAIL PROTECTED] --> -<!-- version $Id: index.xml,v 1.37 2002/03/04 12:16:42 vhardy Exp $ --> +<!-- version $Id: index.xml,v 1.38 2002/03/11 09:04:38 hillion Exp $ --> <!-- ========================================================================= --> <document> <header> @@ -90,9 +90,7 @@ <s1 title="Batik's Implementation Status"> <p> At this time, Batik provides a good implementation for all the SVG static - features, supports linking, and has some scripting support, even though dynamic - modification of SVG documents is not yet available and animation is - not supported. + features, supports linking, and has some scripting support, even though SMIL animation is not supported. </p> <p> You will find a detailed description of the set of SVG features 1.4 +25 -14 xml-batik/xdocs/javaScripting.xml Index: javaScripting.xml =================================================================== RCS file: /home/cvs/xml-batik/xdocs/javaScripting.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- javaScripting.xml 8 Mar 2002 09:55:53 -0000 1.3 +++ javaScripting.xml 11 Mar 2002 09:04:38 -0000 1.4 @@ -11,7 +11,7 @@ <!-- ========================================================================= --> <!-- author [EMAIL PROTECTED] --> -<!-- version $Id: javaScripting.xml,v 1.3 2002/03/08 09:55:53 hillion Exp $ --> +<!-- version $Id: javaScripting.xml,v 1.4 2002/03/11 09:04:38 hillion Exp $ --> <!-- ========================================================================= --> <document> <header> @@ -27,11 +27,11 @@ The follow code template demonstrates how to manipulate an SVG document displayed in a JSVGCanvas directly from a Java program. </p> - <p> - Notice that you don't have to worry about the graphics updates: - each event dispatch updates the canvas if needed. - </p> + <note>You don't have to worry about graphics updates: + after each event listener invocation the canvas is updated + if needed.</note> <source> +import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JFrame; import org.apache.batik.swing.JSVGCanvas; @@ -80,7 +80,8 @@ frame.addWindowListener(new WindowAdapter() { public void windowOpened(WindowEvent e) { - // Loads the base document now. + // The canvas is ready to load the base document + // now, from the AWT thread. canvas.setURI("doc.svg"); } }); @@ -93,22 +94,20 @@ public void registerListeners() { // Gets an element from the loaded document. Element elt = document.getElementById("elt-id"); + EventTarget t = (EventTarget)elt; // Adds a 'onload' listener - ((EventTarget)elt).addEventListener("SVGLoad", - new OnLoadAction(), - false); + t.addEventListener("SVGLoad", new OnLoadAction(), false); + // Adds a 'onclick' listener - ((EventTarget)elt).addEventListener("click", - new OnClickAction(), - false); + t.addEventListener("click", new OnClickAction(), false); } public class OnLoadAction implements EventListener { public void handleEvent(Event evt) { - // Make some action here... + // Make some actions here... - // For example start an animation loop: + // ...for example start an animation loop: window.setInterval(new Animation(), 50); } } @@ -116,12 +115,24 @@ public class OnClickAction implements EventListener { public void handleEvent(Event evt) { // Make some actions here... + + // ...for example schedule an action for later: + window.setTimeout(new DelayedTask(), 500); } } public class Animation implements Runnable { public void run() { // Insert animation code here... + } + } + + public class DelayedTask implements Runnable { + public void run() { + // Make some actions here... + + // ...for example displays an alert dialog: + window.alert("Delayed Action invoked!"); } } } 1.5 +36 -10 xml-batik/xdocs/jsvgcanvas.xml Index: jsvgcanvas.xml =================================================================== RCS file: /home/cvs/xml-batik/xdocs/jsvgcanvas.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- jsvgcanvas.xml 31 Oct 2001 16:50:37 -0000 1.4 +++ jsvgcanvas.xml 11 Mar 2002 09:04:38 -0000 1.5 @@ -11,7 +11,7 @@ <!-- ========================================================================= --> <!-- author [EMAIL PROTECTED] --> -<!-- version $Id: jsvgcanvas.xml,v 1.4 2001/10/31 16:50:37 hillion Exp $ --> +<!-- version $Id: jsvgcanvas.xml,v 1.5 2002/03/11 09:04:38 hillion Exp $ --> <!-- ========================================================================= --> <document> @@ -174,9 +174,10 @@ Each time you set a URI or a SVG DOM tree to the JSVGCanvas (using the <code>setURI</code> or <code>setSVGDocument</code> method), the specified -document is first parsed (in case of a URI), built, and finally rendered. The -proper way to be notified of those different phases is to implement a listener -and attach it to the component. There are three types of listener: +document is first parsed (in case of a URI), built, rendered and optionally +updated. The proper way to be notified of those different phases is to +implement a listener and attach it to the component. There are five types +of listener: </p> @@ -202,32 +203,57 @@ <br /><br /> </dd> +<dt>SVGLoadEventDispatcherListener</dt> +<dd> + +This listener provides a set of methods that can be used to track +<code>SVGLoadEventDispatcherEvent</code> events. It describes the +DOM 'SVGLoad' event dispatch phase.<br/> +This event is triggered only in dynamic documents. +<br /><br /> +</dd> + <dt>GVTTreeRendererListener</dt> <dd> This listener provides a set of methods that can be used to track <code>GVTTreeRendererEvent</code> events. It describes the rendering phase: -constructing an image using a GVT tree. +constructing an image using a GVT tree.<br/> +In dynamic documents this event is fired only once for the initial rendering. <br /><br /> </dd> +<dt>UpdateManagerListener</dt> +<dd> + +This listener provides a set of methods that can be used to track +<code>UpdateManagerEvent</code> events. It describes the running phase: +the update manager is started and then it can be suspended, resumed or +stopped, and graphics updates can be tracked. +<br/> +Only dynamic documents trigger this event. + +<br /><br /> +</dd> + + </dl> <p> Those listeners give a complete description of the different steps of those -three phases (including error states). Adapter classes are available to ease the +five phases (including error states). Adapter classes are available to ease the creation of new listener implementation. </p> <p> -You can assume that the JSVGCanvas has completed its job (parsing, building and -rendering) when the <code>gvtRenderingCompleted</code> method call is called and -following a setURI or a setSVGDocument method call. - +For static documents, you can assume that the JSVGCanvas has completed its job (parsing, building and rendering) when the <code>gvtRenderingCompleted</code> method call is called, following a setURI or a setSVGDocument method call.<br/> +In case of dynamic documents, the end of the computations (parsing, building, +SVGLoad dispatch, initial rendering and updates) is marked by a call to the +<code>updateManagerStopped</code> method. </p> </s1> 1.4 +2 -2 xml-batik/xdocs/mail-lists.xml Index: mail-lists.xml =================================================================== RCS file: /home/cvs/xml-batik/xdocs/mail-lists.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mail-lists.xml 18 May 2001 22:44:49 -0000 1.3 +++ mail-lists.xml 11 Mar 2002 09:04:38 -0000 1.4 @@ -12,7 +12,7 @@ <!-- ========================================================================= --> <!-- author [EMAIL PROTECTED] --> -<!-- version $Id: mail-lists.xml,v 1.3 2001/05/18 22:44:49 vhardy Exp $ --> +<!-- version $Id: mail-lists.xml,v 1.4 2002/03/11 09:04:38 hillion Exp $ --> <!-- ========================================================================= --> <document> @@ -30,7 +30,7 @@ mailing list, please first look at the following resources in this order:</p> <ol> <li><link href="faqs.html">Batik FAQs</link></li> - <li><link href="http://www-sop.inria.fr/koala/batik/">Batik temporary mailing lists archives hosted by Koala</link></li> + <li><link href="http://koala.ilog.fr/batik/">Batik mailing lists archives hosted by Koala</link></li> </ol> </s1> 1.4 +4 -4 xml-batik/xdocs/scriptFeatures.xml Index: scriptFeatures.xml =================================================================== RCS file: /home/cvs/xml-batik/xdocs/scriptFeatures.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- scriptFeatures.xml 8 Mar 2002 08:45:28 -0000 1.3 +++ scriptFeatures.xml 11 Mar 2002 09:04:38 -0000 1.4 @@ -11,7 +11,7 @@ <!-- ========================================================================= --> <!-- author [EMAIL PROTECTED] --> -<!-- version $Id: scriptFeatures.xml,v 1.3 2002/03/08 08:45:28 hillion Exp $ --> +<!-- version $Id: scriptFeatures.xml,v 1.4 2002/03/11 09:04:38 hillion Exp $ --> <!-- ========================================================================= --> <document> <header> @@ -39,8 +39,8 @@ </p> <note>In the ECMAScript programs executed in an SVG document, the <code>window</code> object is the global object, so - its properties and methods can be accessed without qualifying - them.</note> + its properties and methods can be accessed as global + variables and functions.</note> <p> It provides the following features: </p> @@ -106,7 +106,7 @@ <li><em>question</em>: The string to display</li> </ul> <p> - This method returns <code>true</code> if the user clicked on the + This method returns <code>true</code> if the user clicks on the 'OK' button, <code>false</code> otherwise. </p> 1.34 +68 -87 xml-batik/xdocs/whoAreWe.xml Index: whoAreWe.xml =================================================================== RCS file: /home/cvs/xml-batik/xdocs/whoAreWe.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- whoAreWe.xml 3 Dec 2001 15:44:07 -0000 1.33 +++ whoAreWe.xml 11 Mar 2002 09:04:38 -0000 1.34 @@ -11,7 +11,7 @@ <!-- ========================================================================= --> <!-- author [EMAIL PROTECTED] --> -<!-- version $Id: whoAreWe.xml,v 1.33 2001/12/03 15:44:07 vhardy Exp $ --> +<!-- version $Id: whoAreWe.xml,v 1.34 2002/03/11 09:04:38 hillion Exp $ --> <!-- ========================================================================= --> <document> <header> @@ -30,9 +30,12 @@ </p> </s1> - <s1 title="Batik Commiters"> + <s1 title="Batik Committers"> <p> - The following people are active Batik developers and are the project's committers: + This section lists all the Batik committers. + </p> + <p> + The following people are active Batik developers: </p> <dl> <dt>Thomas DeWeese (TD)</dt><dd><br /> @@ -50,22 +53,6 @@ <br /><br /> </dd> - <dt>Bill Haneman (BH)</dt><dd><br /> - <link href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</link><br /> - <em> - Bill Haneman works for Sun Microsystems' Desktop Enabling Middleware - group in Dublin, Ireland, and implemented much of the Batik's text - support (though not SVG Fonts, thanks Bella, Dean, and David!). He is - also technical lead for the Gnome Accessibility Project - (http://developer.gnome.org/projects/gap), an open project to provide - an accessibility framework for linux and Solaris(TM) desktops. A - twenty-year veteran of scientific programming and application - development, he is a US expatriate who plays traditional Irish music - on the uilleann pipes. - </em> - <br /><br /> - </dd> - <dt>Vincent Hardy (VH)</dt><dd><br /> <link href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</link><br /> <em>Vincent is one of the founders of the SVG Batik project at Apache and the Batik @@ -80,21 +67,10 @@ <dt>Stephane Hillion (SH)</dt><dd><br /> <link href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</link><br /> <em> - Stephane is a research engineer at ILOG. His main interests are in - programming languages and web standards. He wrote DynamicJava, a Java - source interpreter, and the Apache Batik's DOM and CSS modules. - </em> - <br /><br /> - </dd> - - <dt>Dean Jackson (DJ)</dt><dd><br /> - <link href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</link><br /> - <em> - Dean is employed by CSIRO Australia and is currently working at - the World Wide Web Consortium (W3C) full time on SVG. He is a member - of the W3C's SVG working group, and was a developer - of the CSIRO SVG Toolkit, one of the first and most complete open source - SVG libraries. + Stephane is a software engineer at the Koala project, part of + the ILOG's visualisation R&D team, located in Sophia-Antipolis, + France. His main interests are in programming languages and web + standards. He wrote the Apache Batik's DOM, CSS and Swing modules. </em> <br /><br /> </dd> @@ -103,7 +79,7 @@ <link href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</link><br /> <em> Christophe Jolif is a Staff Software Engineer mainly working on the ILOG - JViews Component Suite, the ILOG Java vizualisation framework. He has + JViews Component Suite, the ILOG Java visualisation framework. He has been working for ILOG since 1997, and is representing the company at the Scalable Vector Graphics (SVG) W3C Working Group since 1999. He has implemented the SVG import and export features in ILOG JViews and is now @@ -116,8 +92,8 @@ <link href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</link> <br /> <em> -Thierry is a software engineer, at the Koala project of ILOG located at INRIA -Sophia Antipolis, France and a member of the SVG working group. Thierry has +Thierry is a software engineer, at the Koala project of ILOG located at +Sophia-Antipolis, France and a member of the SVG working group. Thierry has contributed to most of the Koala's projects involving Java and XML. Since then, he co-founded the Apache Batik project. His daytime job is focused on Graphics and XML related technologies. Prior to joining ILOG, Thierry worked @@ -125,19 +101,22 @@ <br /><br /> </dd> - <dt>Bella Robinson (BR)</dt><dd><br /> - <link href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</link> <br /> - <em> - Bella is a Software Engineer working for CSIRO Australia. She was one - of the main developers of the CSIRO SVG Toolkit and has also been working - on a Pocket SVG Viewer for handheld devices. Her interests include - graphics and XML programming.</em> - <br /><br /> - </dd> - </dl> <p> + <link href="mailto:[EMAIL PROTECTED]">Dean Jackson</link>, + <link href="mailto:[EMAIL PROTECTED]">Bill Haneman</link>, + <link href="mailto:[EMAIL PROTECTED]">Emmanuel Tissandier</link> + are some of the Batik project founders and helped define and + implement the initial Batik architecture. + </p> + + <p> + <link href="mailto:[EMAIL PROTECTED]">Bella Robinson</link> + implemented the SVG fonts support in Batik. + </p> + + <p> In addition, <link href="mailto:[EMAIL PROTECTED]">James Davidson</link> and <link href="mailto:[EMAIL PROTECTED]">Stefano Mazzochi</link> , two Apache veterans who helped the Batik team start the project at Apache, also have commit access to the CVS repository. @@ -151,13 +130,13 @@ <ul> <li><link href="mailto:[EMAIL PROTECTED]">Curt Arnold</link> - Contributed many bug reports and fixes</li> <li><link href="mailto:[EMAIL PROTECTED]">Robert DiBlasi</link> - Contributed a lot of feedback on the - Batik documentation and suggestions on how to improve the it</li> + Batik documentation and suggestions on how to improve it</li> <li><link href="mailto:[EMAIL PROTECTED]">Paul Evenblij</link> - Contributed an improvement to the way images are handled by the SVGGraphics2D component. Also contributed bug fixes on the SVGGraphics2D component. </li> <li><link href="mailto:[EMAIL PROTECTED]">Pier Fumagalli</link>- is helping us with the Batik web site and mailing lists.</li> - <li><link href="mailto:[EMAIL PROTECTED]">Christophe Held</link>- Contributed a math formula in SVG + <li><link href="mailto:[EMAIL PROTECTED]">Christophe Held</link> - Contributed a math formula in SVG generated from MathML. </li> <li><link href="mailto:[EMAIL PROTECTED]">Keiron Liddle</link> - A <link href="http://xml.apache.org/fop">FOP</link> member who is working on an SVG to PDF transcoder that will be part of FOP but that will work in @@ -175,85 +154,87 @@ <li><link href="mailto:[EMAIL PROTECTED]">David Schweinsberg</link> - Contributed the True Type Font to SVG Font converter</li> <li><link href="mailto:[EMAIL PROTECTED]">Nicholas Talian</link> - Contributed on gradients.</li> - <li><link href="mailto:[EMAIL PROTECTED]">Emmanuel Tissandier</link> was one of the Batik project - founders and helped define and implement the initial Batik architecture</li> </ul> </s1> <s1 title="Areas of Expertise"> <p> - The following table summarizes the areas of expertise of each committer. It allows better - coordination of both internal and external development efforts. + The following table summarizes the areas of expertise of each active + committer. It allows better coordination of both internal and + external development efforts. </p> <table> <tr> - <th/><th>TD</th><th>BH</th><th>VH</th><th>SH</th> - <th>DJ</th><th>CJ</th><th>TK</th><th>ET</th> + <th/><th>TD</th><th>VH</th><th>SH</th><th>CJ</th><th>TK</th> + </tr> + <tr> + <td>Team Contact</td> + <td/><td>X</td><td/><td/><td/> </tr> <tr> - <td>Team Contact</td><td/><td/><td>X</td><td/> - <td/><td/><td/><td/> + <td>SMIL Animation</td> + <td/><td/><td/><td/><td/> </tr> <tr> - <td>Animation</td><td/><td/><td/><td/> - <td/><td/><td/><td/> + <td>Bridge</td> + <td/><td>X</td><td>X</td><td>X</td><td>X</td> </tr> <tr> - <td>Bridge</td><td/><td/><td>X</td><td/> - <td/><td>X</td><td>X</td><td>X</td> + <td>CSS</td> + <td/><td/><td>X</td><td/><td/> </tr> <tr> - <td>CSS</td><td/><td/><td/><td>X</td> - <td/><td/><td/><td/> + <td>Documentation</td> + <td>X</td><td>X</td><td>X</td><td>X</td><td>X</td> </tr> <tr> - <td>Documentation</td><td/><td/><td>X</td><td/> - <td/><td/><td>X</td><td/> + <td>SVG DOM</td> + <td/><td/><td>X</td><td/><td/> </tr> <tr> - <td>SVG DOM</td><td/><td/><td/><td>X</td> - <td/><td/><td/><td/> + <td>GVT Core</td> + <td>X</td><td>X</td><td/><td/><td>X</td> </tr> <tr> - <td>GVT Core</td><td/><td/><td>X</td><td/> - <td/><td/><td>X</td><td>X</td> + <td>GVT Filters</td> + <td>X</td><td>X</td><td/><td/><td/> </tr> <tr> - <td>GVT Filters</td><td>X</td><td/><td>X</td><td/> - <td></td><td/><td/><td/> + <td>GVT Renderer</td> + <td>X</td><td>X</td><td/><td/><td/> </tr> <tr> - <td>GVT Renderer</td><td>X</td><td/><td>X</td><td/> - <td/><td/><td>X</td><td/> + <td>GVT Text</td> + <td>X</td><td/><td/><td/><td/> </tr> <tr> - <td>GVT Text</td><td/><td>X</td><td/><td/> - <td>X</td><td/><td/><td/> + <td>SVGGraphics2D</td> + <td/><td>X</td><td/><td>X</td><td/> </tr> <tr> - <td>SVGGraphics2D</td><td/><td/><td>X</td><td/> - <td/><td>X</td><td/><td/> + <td>Micro Parsers</td> + <td/><td/><td>X</td><td/><td/> </tr> <tr> - <td>Micro Parsers</td><td/><td/><td/><td>X</td> - <td/><td/><td/><td/> + <td>Scripting</td> + <td/><td/><td>X</td><td>X</td><td/> </tr> <tr> - <td>Scripting</td><td/><td/><td/><td/> - <td/><td>X</td><td/><td/> + <td>Swing Components</td> + <td/><td/><td>X</td><td/><td>X</td> </tr> <tr> - <td>Swing Components</td><td/><td/><td/><td>X</td> - <td/><td/><td>X</td><td/> + <td>Rasterizer</td> + <td/><td/><td/><td/><td>X</td> </tr> <tr> - <td>Rasterizer</td><td/><td/><td/><td/> - <td/><td/><td>X</td><td/> + <td>Browser</td> + <td/><td/><td>X</td><td/><td>X</td> </tr> <tr> - <td>Browser</td><td/><td/><td/><td>X</td> - <td/><td/><td>X</td><td/> + <td>Test</td> + <td/><td>X</td><td/><td/><td/> </tr> </table> </s1>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]