You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2007/11/29 00:16:04 UTC

svn commit: r599194 - in /xmlgraphics/batik/trunk: ./ sources-1.3/org/apache/batik/util/ sources-1.4/org/apache/batik/util/ sources/org/apache/batik/apps/svgbrowser/ sources/org/apache/batik/util/gui/

Author: cam
Date: Wed Nov 28 15:16:02 2007
New Revision: 599194

URL: http://svn.apache.org/viewvc?rev=599194&view=rev
Log:
1. Remove jEdit syntax highlighting component.
2. Change the DOM Viewer window to use the new XML Editor component.
3. Make the View Source window use the XML Editor component, too.

Removed:
    xmlgraphics/batik/trunk/sources-1.3/org/apache/batik/util/
    xmlgraphics/batik/trunk/sources-1.4/org/apache/batik/util/
    xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/AbstractJEnhEditTextArea.java
Modified:
    xmlgraphics/batik/trunk/NOTICE
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/NodePickerPanel.java

Modified: xmlgraphics/batik/trunk/NOTICE
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/NOTICE?rev=599194&r1=599193&r2=599194&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/NOTICE (original)
+++ xmlgraphics/batik/trunk/NOTICE Wed Nov 28 15:16:02 2007
@@ -11,10 +11,6 @@
 Standardization for the definition of character entities used in the software's
 documentation.
 
-This software contains code from the jEdit Syntax Package
-(http://syntax.jedit.org/).  Note that this is not the current GPL-licensed
-code from the jEdit project.
-
 This product includes images from the Tango Desktop Project
 (http://tango.freedesktop.org/).
 

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java?rev=599194&r1=599193&r2=599194&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java Wed Nov 28 15:16:02 2007
@@ -80,13 +80,11 @@
 import javax.swing.JPanel;
 import javax.swing.JRadioButtonMenuItem;
 import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
 import javax.swing.JToolBar;
 import javax.swing.JWindow;
 import javax.swing.KeyStroke;
 import javax.swing.filechooser.FileFilter;
 import javax.swing.text.Document;
-import javax.swing.text.PlainDocument;
 
 import org.apache.batik.bridge.DefaultExternalResourceSecurity;
 import org.apache.batik.bridge.DefaultScriptSecurity;
@@ -142,6 +140,8 @@
 import org.apache.batik.util.gui.resource.MenuFactory;
 import org.apache.batik.util.gui.resource.MissingListenerException;
 import org.apache.batik.util.gui.resource.ToolBarFactory;
+import org.apache.batik.util.gui.xmleditor.XMLDocument;
+import org.apache.batik.util.gui.xmleditor.XMLTextEditor;
 import org.apache.batik.util.resources.ResourceManager;
 import org.apache.batik.xml.XMLUtilities;
 
@@ -1887,8 +1887,8 @@
             final JFrame fr = new JFrame(u.toString());
             fr.setSize(resources.getInteger("ViewSource.width"),
                        resources.getInteger("ViewSource.height"));
-            final JTextArea ta  = new JTextArea();
-            ta.setLineWrap(true);
+            final XMLTextEditor ta  = new XMLTextEditor();
+            // ta.setLineWrap(true);
             ta.setFont(new Font("monospaced", Font.PLAIN, 12));
 
             JScrollPane scroll = new JScrollPane();
@@ -1902,7 +1902,7 @@
                     char [] buffer = new char[4096];
 
                     try {
-                        Document  doc = new PlainDocument();
+                        Document  doc = new XMLDocument();
 
                         ParsedURL purl = new ParsedURL(svgDocument.getURL());
                         InputStream is
@@ -1919,7 +1919,7 @@
 
                         ta.setDocument(doc);
                         ta.setEditable(false);
-                        ta.setBackground(Color.white);
+                        // ta.setBackground(Color.white);
                         fr.setVisible(true);
                     } catch (Exception ex) {
                         userAgent.displayError(ex);

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/NodePickerPanel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/NodePickerPanel.java?rev=599194&r1=599193&r2=599194&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/NodePickerPanel.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/NodePickerPanel.java Wed Nov 28 15:16:02 2007
@@ -62,10 +62,10 @@
 import org.apache.batik.dom.AbstractNode;
 import org.apache.batik.dom.util.DOMUtilities;
 import org.apache.batik.util.SVGConstants;
-import org.apache.batik.util.gui.JEnhEditTextArea;
 import org.apache.batik.util.gui.resource.ActionMap;
 import org.apache.batik.util.gui.resource.ButtonFactory;
 import org.apache.batik.util.gui.resource.MissingListenerException;
+import org.apache.batik.util.gui.xmleditor.XMLTextEditor;
 import org.apache.batik.util.XMLConstants;
 import org.apache.batik.util.resources.ResourceManager;
 
@@ -1350,7 +1350,7 @@
         /**
          * The text area.
          */
-        protected JEnhEditTextArea nodeXmlArea;
+        protected XMLTextEditor nodeXmlArea;
 
         /**
          * Constructor.
@@ -1358,8 +1358,6 @@
         public SVGInputPanel() {
             super(new BorderLayout());
             add(getNodeXmlArea());
-            // Workaround ont JEditTextArea's overridden getMinimumSize()
-            setMinimumSize(new Dimension(100, 80));
         }
 
         /**
@@ -1367,38 +1365,13 @@
          *
          * @return    the nodeXmlArea
          */
-        protected JEnhEditTextArea getNodeXmlArea() {
+        protected XMLTextEditor getNodeXmlArea() {
             if (nodeXmlArea == null) {
                 // Create syntax-highlighted text area
-                nodeXmlArea = new JEnhEditTextArea(getTextAreaDefaults());
-                nodeXmlArea.setTokenMarker(new XMLTokenMarker());
-                TextAreaPainter painter = nodeXmlArea.getPainter();
-                painter.setFont(getDefaultTextAreaFont());
+                nodeXmlArea = new XMLTextEditor();
                 nodeXmlArea.setEditable(true);
             }
             return nodeXmlArea;
-        }
-
-        /**
-         * The defaults for the JEditTextArea.
-         *
-         * @return TextAreaDefaults
-         */
-        protected TextAreaDefaults getTextAreaDefaults() {
-            TextAreaDefaults defaults = TextAreaDefaults.getDefaults();
-            defaults.cols = 30;
-            defaults.rows = 10;
-            defaults.electricScroll = 2;
-            return defaults;
-        }
-
-        /**
-         * The default Font for the JEditTextArea.
-         *
-         * @return Font
-         */
-        protected Font getDefaultTextAreaFont() {
-            return new Font("Monospaced", Font.PLAIN, 12);
         }
     }