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/13 01:40:58 UTC

svn commit: r594367 [1/9] - in /xmlgraphics/batik/trunk: ./ resources/org/apache/batik/apps/svgbrowser/resources/ resources/org/apache/batik/util/gui/resources/ sources-1.3/org/apache/batik/util/ sources-1.3/org/apache/batik/util/gui/ sources-1.4/org/a...

Author: cam
Date: Mon Nov 12 16:40:53 2007
New Revision: 594367

URL: http://svn.apache.org/viewvc?rev=594367&view=rev
Log:
Enhanced DOM Viewer window.  This commit is Ivan's patch from
http://issues.apache.org/bugzilla/show_bug.cgi?id=42697 with some
changes (reformatting, moving some classes to different packages).

The features of the DOM Viewer enhancements are, in Ivan's words:

  * Added better document inspection using the DOMViewer:
    - Added support for viewing elements of the document as xml
      and their attributes in the attributes table,
    - Allowed live tracking the changes in the document by refreshing
      the DOMViewer's document tree and the xml text area.
  * Added support for editing the documents through the DOMViewer:
    - Allowed changing elements directly by editing their xml,
      or using the attributes table,
    - Allowed switching nodes position in the document by
      adding the dnd support for the DOMViewer's document tree,
    - Allowed adding the most commonly used elements (element templates)
      with their attributes set to default values,
    - Allowed adding new elements by editing their xml directly,
    - Allowed removing the nodes from the document using DOMViewer's
      document tree.
  * Added support for history browsing. The DOMViewer is able
      to undo and redo the changes made from the DOMViewer,
      as well as the changes made on the document from outside
      of the DOMViewer. Added the scrollable drop down menu to
      support undo / redo of a custom number of last actions.
  * Allowed searching the element on the canvas from the DOMViewer
      and vice versa, by selecting the tree node in the document tree
      or on the canvas and painting the found element(s).
  * Added syntax highlighting to elements xml representation
      using JEditTextArea component. Created the enhanced JEditTextArea,
      the JEnhEditTextArea with the cut / copy / paste, select all,
      undo / redo shortcuts added and mouse wheel scroll as well.

Congratulations to Ivan, for successfully completing his Google Summer of
Code project.  I hope that he can continue to contribute to Batik!

Submitted by: Ivan Andjelkovic <an...@gmail.com>

Added:
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/DOMViewerMessages.properties
      - copied, changed from r594022, xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/DOMViewerMessages.properties
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/DropDownHistoryModelMessages.properties
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/NameEditorDialogMessages.properties
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/NodePickerPanelMessages.properties
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/captureClick.png   (with props)
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/comment.gif
      - copied unchanged from r594022, xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/comment.gif
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/disabledRedo.png   (with props)
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/disabledUndo.png   (with props)
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/element.gif
      - copied unchanged from r594022, xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/element.gif
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/enableOverlay.png   (with props)
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/pi.gif
      - copied unchanged from r594022, xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/pi.gif
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/redo.png   (with props)
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/text.gif
      - copied unchanged from r594022, xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/text.gif
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/undo.png   (with props)
    xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/ScrollablePopupMenuMessages.properties
    xmlgraphics/batik/trunk/sources-1.3/org/apache/batik/util/
    xmlgraphics/batik/trunk/sources-1.3/org/apache/batik/util/gui/
    xmlgraphics/batik/trunk/sources-1.3/org/apache/batik/util/gui/JEnhEditTextArea.java
    xmlgraphics/batik/trunk/sources-1.4/org/apache/batik/util/
    xmlgraphics/batik/trunk/sources-1.4/org/apache/batik/util/gui/
    xmlgraphics/batik/trunk/sources-1.4/org/apache/batik/util/gui/JEnhEditTextArea.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/AbstractCompoundCommand.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/AbstractUndoableCommand.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMDocumentTree.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMDocumentTreeController.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMViewer.java
      - copied, changed from r594022, xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/DOMViewer.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMViewerController.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DropDownHistoryModel.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/ElementOverlayController.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/ElementOverlayManager.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/HistoryBrowser.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/HistoryBrowserInterface.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/NodePickerController.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/NodePickerPanel.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/NodeTemplates.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/UndoableCommand.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/AbstractJEnhEditTextArea.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/DropDownComponent.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/resource/JToolbarToggleButton.java
    xmlgraphics/batik/trunk/sources/org/gjt/
    xmlgraphics/batik/trunk/sources/org/gjt/sp/
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/DefaultInputHandler.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/InputHandler.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/JEditTextArea.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/KeywordMap.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/SyntaxDocument.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/SyntaxStyle.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/SyntaxUtilities.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/TextAreaDefaults.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/TextAreaPainter.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/TextUtilities.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/Token.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/TokenMarker.java
    xmlgraphics/batik/trunk/sources/org/gjt/sp/jedit/textarea/XMLTokenMarker.java
Removed:
    xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/DOMViewerMessages.properties
    xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/LICENSE.icons.txt
    xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/README.icons.txt
    xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/comment.gif
    xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/element.gif
    xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/pi.gif
    xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/text.gif
    xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/web.gif
    xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/DOMViewer.java
Modified:
    xmlgraphics/batik/trunk/build.xml
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/LICENSE.icons.txt
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/README.icons.txt
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/squiggle.png
    xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/squiggle.svg
    xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/CursorManager.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/ScriptingEnvironment.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/dom/AbstractParentNode.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/dom/util/DOMUtilities.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/swing/JSVGCanvas.java
    xmlgraphics/batik/trunk/sources/org/apache/batik/util/gui/resource/ButtonFactory.java

Modified: xmlgraphics/batik/trunk/build.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/build.xml?rev=594367&r1=594366&r2=594367&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/build.xml (original)
+++ xmlgraphics/batik/trunk/build.xml Mon Nov 12 16:40:53 2007
@@ -1309,6 +1309,7 @@
       <metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
       <fileset dir="${dest}">
         <include name="${package-prefix}/apps/svgbrowser/**/*.class"/>
+        <include name="org/gjt/sp/jedit/textarea/**/*.class"/>
       </fileset>
       <fileset dir="${resources}" excludes="**/.svn/">
         <include name="${package-prefix}/apps/svgbrowser/**/resources/**"/>

Copied: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/DOMViewerMessages.properties (from r594022, xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/DOMViewerMessages.properties)
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/DOMViewerMessages.properties?p2=xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/DOMViewerMessages.properties&p1=xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/DOMViewerMessages.properties&r1=594022&r2=594367&rev=594367&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/DOMViewerMessages.properties (original)
+++ xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/DOMViewerMessages.properties Mon Nov 12 16:40:53 2007
@@ -53,3 +53,35 @@
 CloseButton.mnemonic = C
 CloseButton.tooltip  = Close the tree view frame
 CloseButton.action   = CloseButtonAction
+
+UndoButton.text         = 
+UndoButton.tooltip      = Undo 
+UndoButton.action       = UndoButtonAction
+UndoButton.icon         = resources/undo.png
+UndoButton.disabledIcon = resources/disabledUndo.png
+
+RedoButton.text         = 
+RedoButton.tooltip      = Redo 
+RedoButton.action       = RedoButtonAction
+RedoButton.icon         = resources/redo.png
+RedoButton.disabledIcon = resources/disabledRedo.png
+
+CapturingClickButton.text        = 
+CapturingClickButton.tooltip     = Click to enable canvas click node finder
+CapturingClickButton.disableText = Click to disable canvas click node finder
+CapturingClickButton.action      = CapturingClickButtonAction
+CapturingClickButton.icon        = resources/captureClick.png
+
+OverlayButton.text        = 
+OverlayButton.tooltip     = Click to enable highlight of selected node
+OverlayButton.disableText = Click to disable highlight of selected node
+OverlayButton.action      = OverlayButtonAction
+OverlayButton.icon        = resources/enableOverlay.png
+
+ContextMenuItem.removeSelection  = Remove selection
+ContextMenuItem.createNewElement = Create new element...
+ContextMenuItem.insertNewNode    = Insert new node
+
+DOMViewerToolbar.name       = DOMViewer toolbar
+
+ShowWhitespaceCheckbox.text = Show Whitespace Text Nodes

Added: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/DropDownHistoryModelMessages.properties
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/DropDownHistoryModelMessages.properties?rev=594367&view=auto
==============================================================================
--- xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/DropDownHistoryModelMessages.properties (added)
+++ xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/DropDownHistoryModelMessages.properties Mon Nov 12 16:40:53 2007
@@ -0,0 +1,25 @@
+# -----------------------------------------------------------------------------
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+# $Id$
+# -----------------------------------------------------------------------------
+
+UndoModel.footerText = Undo last actions: 
+UndoModel.tooltipPrefix = Undo 
+
+RedoModel.footerText = Redo last actions: 
+RedoModel.tooltipPrefix = Redo 

Modified: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/LICENSE.icons.txt
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/LICENSE.icons.txt?rev=594367&r1=594366&r2=594367&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/LICENSE.icons.txt (original)
+++ xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/LICENSE.icons.txt Mon Nov 12 16:40:53 2007
@@ -15,7 +15,10 @@
 	media-playback-pause.png
 	media-playback-start.png
 	process-stop.png
+	redo.png		(modified version of edit-redo.png)
 	system-search.png
+	text-html.png
+	undo.png		(modified version of edit-undo.png)
 	utilities-system-monitor.png
 	view-refresh.png
 	window-new.png

Added: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/NameEditorDialogMessages.properties
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/NameEditorDialogMessages.properties?rev=594367&view=auto
==============================================================================
--- xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/NameEditorDialogMessages.properties (added)
+++ xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/NameEditorDialogMessages.properties Mon Nov 12 16:40:53 2007
@@ -0,0 +1,32 @@
+# -----------------------------------------------------------------------------
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+# $Id$
+# -----------------------------------------------------------------------------
+
+Dialog.width = 200
+Dialog.height = 125
+Dialog.title  = Enter element name
+Dialog.label  = Node name:
+
+OKButton.text = OK
+OKButton.mnemonic = O
+OKButton.action = OKButtonAction
+
+CancelButton.text = Cancel
+CancelButton.mnemonic = C
+CancelButton.action = CancelButtonAction

Added: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/NodePickerPanelMessages.properties
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/NodePickerPanelMessages.properties?rev=594367&view=auto
==============================================================================
--- xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/NodePickerPanelMessages.properties (added)
+++ xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/NodePickerPanelMessages.properties Mon Nov 12 16:40:53 2007
@@ -0,0 +1,44 @@
+# -----------------------------------------------------------------------------
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+# $Id$
+# -----------------------------------------------------------------------------
+
+AttributesTable.column1 = Name
+AttributesTable.column2 = Value
+AttributesTable.name = Attributes:
+
+InputPanelLabel.name = XML representation:
+IsWellFormedLabel.wellFormed = XML well formed.
+IsWellFormedLabel.notWellFormed = XML not well formed. 
+ConfirmDialog.message = Save changes?
+
+ApplyButton.text = Apply
+ApplyButton.mnemonic = A
+ApplyButton.action = ApplyButtonAction
+
+ResetButton.text = Reset
+ResetButton.mnemonic = R
+ResetButton.action = ResetButtonAction
+
+AddButton.text = Add
+AddButton.mnemonic = d
+AddButton.action = AddButtonAction
+
+RemoveButton.text = Remove
+RemoveButton.mnemonic = m
+RemoveButton.action = RemoveButtonAction

Modified: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/README.icons.txt
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/README.icons.txt?rev=594367&r1=594366&r2=594367&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/README.icons.txt (original)
+++ xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/README.icons.txt Mon Nov 12 16:40:53 2007
@@ -15,7 +15,10 @@
 	media-playback-pause.png
 	media-playback-start.png
 	process-stop.png
+	redo.png		(modified version of edit-redo.png)
 	system-search.png
+	text-html.png
+	undo.png		(modified version of edit-undo.png)
 	utilities-system-monitor.png
 	view-refresh.png
 	window-new.png

Added: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/captureClick.png
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/captureClick.png?rev=594367&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/captureClick.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/disabledRedo.png
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/disabledRedo.png?rev=594367&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/disabledRedo.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/disabledUndo.png
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/disabledUndo.png?rev=594367&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/disabledUndo.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/enableOverlay.png
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/enableOverlay.png?rev=594367&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/enableOverlay.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/redo.png
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/redo.png?rev=594367&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/redo.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/squiggle.png
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/squiggle.png?rev=594367&r1=594366&r2=594367&view=diff
==============================================================================
Binary files - no diff available.

Modified: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/squiggle.svg
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/squiggle.svg?rev=594367&r1=594366&r2=594367&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/squiggle.svg (original)
+++ xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/squiggle.svg Mon Nov 12 16:40:53 2007
@@ -498,7 +498,7 @@
         <rect x="50" y="210" width="520" height="55" visibility="hidden"/>
       </flowRegion>
       <flowDiv>
-        <flowPara font-size="13" line-height="125%">
+        <flowPara font-size="13.5" line-height="125%">
           Thomas&#xa0;DeWeese, Bill&#xa0;Haneman, Vincent&#xa0;Hardy, Stephane&#xa0;Hillion,
           Dieter&#xa0;von&#xa0;Holten, Dean&#xa0;Jackson,
           Christophe&#xa0;Jolif, Thierry&#xa0;Kormann, Cameron&#xa0;McCormack, Bella&#xa0;Robinson,
@@ -516,13 +516,13 @@
         <rect x="50" y="285" width="520" height="100" visibility="hidden"/>
       </flowRegion>
       <flowDiv>
-        <flowPara font-size="13" line-height="125%">
-          Curt&#xa0;Arnold, Bert&#xa0;Bos, James&#xa0;Davidson, Robert&#xa0;DiBlasi,
-          Archie&#xa0;Cobbs, Paul&#xa0;Evenblij, Pier&#xa0;Fumagalli, Hervé&#xa0;Girod,
-          Christophe&#xa0;Held, Clay&#xa0;Leeds, Keiron&#xa0;Liddle, Jeremias&#xa0;Märki,
-          Stefano&#xa0;Mazzochi, John&#xa0;Morisson, Andreas&#xa0;Neumann, Luan&#xa0;O’Carroll,
-          Sheng&#xa0;Pei, Neeme&#xa0;Praks, Henri&#xa0;Ruini, David&#xa0;Schweinsberg,
-          Eric&#xa0;Suen, Nicholas&#xa0;Talian, Andres&#xa0;Toussaint
+        <flowPara font-size="13.5" line-height="125%">
+          Ivan&#xa0;Andjelkovic, Curt&#xa0;Arnold, Bert&#xa0;Bos, James&#xa0;Davidson,
+          Robert&#xa0;DiBlasi, Archie&#xa0;Cobbs, Paul&#xa0;Evenblij, Pier&#xa0;Fumagalli,
+          Hervé&#xa0;Girod, Christophe&#xa0;Held, Clay&#xa0;Leeds, Keiron&#xa0;Liddle,
+          Jeremias&#xa0;Märki, Stefano&#xa0;Mazzochi, John&#xa0;Morisson, Andreas&#xa0;Neumann,
+          Luan&#xa0;O’Carroll, Sheng&#xa0;Pei, Neeme&#xa0;Praks, Henri&#xa0;Ruini,
+          David&#xa0;Schweinsberg, Eric&#xa0;Suen, Nicholas&#xa0;Talian, Andres&#xa0;Toussaint
         </flowPara>
       </flowDiv>
     </flowRoot>

Added: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/undo.png
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/undo.png?rev=594367&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/batik/trunk/resources/org/apache/batik/apps/svgbrowser/resources/undo.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/ScrollablePopupMenuMessages.properties
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/ScrollablePopupMenuMessages.properties?rev=594367&view=auto
==============================================================================
--- xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/ScrollablePopupMenuMessages.properties (added)
+++ xmlgraphics/batik/trunk/resources/org/apache/batik/util/gui/resources/ScrollablePopupMenuMessages.properties Mon Nov 12 16:40:53 2007
@@ -0,0 +1,27 @@
+# -----------------------------------------------------------------------------
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements.  See the NOTICE file distributed with
+#   this work for additional information regarding copyright ownership.
+#   The ASF licenses this file to You under the Apache License, Version 2.0
+#   (the "License"); you may not use this file except in compliance with
+#   the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+# $Id$
+# -----------------------------------------------------------------------------
+
+PreferredHeight = 218
+
+ScrollPane.minWidth = 240
+ScrollPane.minHeight = 40
+ScrollPane.maxWidth = 1200
+ScrollPane.maxHeight = 400
+

Added: xmlgraphics/batik/trunk/sources-1.3/org/apache/batik/util/gui/JEnhEditTextArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources-1.3/org/apache/batik/util/gui/JEnhEditTextArea.java?rev=594367&view=auto
==============================================================================
--- xmlgraphics/batik/trunk/sources-1.3/org/apache/batik/util/gui/JEnhEditTextArea.java (added)
+++ xmlgraphics/batik/trunk/sources-1.3/org/apache/batik/util/gui/JEnhEditTextArea.java Mon Nov 12 16:40:53 2007
@@ -0,0 +1,40 @@
+/*
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+package org.apache.batik.util.gui;
+
+import org.gjt.sp.jedit.textarea.TextAreaDefaults;
+
+/**
+ * The enhanced JEditTextArea without the mouse wheel scroll support (only for
+ * JDKs lower then 1.4).
+ *
+ * @version $Id$
+ */
+public class JEnhEditTextArea extends AbstractJEnhEditTextArea {
+
+    /**
+     * Creates a new JEnhEditTextArea with the specified settings.
+     * 
+     * @param defaults
+     *            The default settings
+     */
+    public JEnhEditTextArea(TextAreaDefaults defaults) {
+        super(defaults);
+    }
+}

Added: xmlgraphics/batik/trunk/sources-1.4/org/apache/batik/util/gui/JEnhEditTextArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources-1.4/org/apache/batik/util/gui/JEnhEditTextArea.java?rev=594367&view=auto
==============================================================================
--- xmlgraphics/batik/trunk/sources-1.4/org/apache/batik/util/gui/JEnhEditTextArea.java (added)
+++ xmlgraphics/batik/trunk/sources-1.4/org/apache/batik/util/gui/JEnhEditTextArea.java Mon Nov 12 16:40:53 2007
@@ -0,0 +1,67 @@
+/*
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+package org.apache.batik.util.gui;
+
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+
+import org.gjt.sp.jedit.textarea.TextAreaDefaults;
+
+/**
+ * The enhanced JEditTextArea. Has cut / copy / paste, select all and undo /
+ * redo shortcuts added, as well as the mouse wheel scroll support (only for
+ * JDKs greater then 1.3).
+ *
+ * @version $Id$
+ */
+public class JEnhEditTextArea extends AbstractJEnhEditTextArea {
+
+    /**
+     * Creates a new JEnhEditTextArea with the specified settings.
+     * 
+     * @param defaults
+     *            The default settings
+     */
+    public JEnhEditTextArea(TextAreaDefaults defaults) {
+        super(defaults);
+        // Mouse wheel support
+        addMouseWheelListener(new MouseWhellSupport());
+    }
+    
+    //     Mouse wheel support
+    /**
+     * The mouse wheel listener.
+     */
+    protected class MouseWhellSupport implements MouseWheelListener {
+        public void mouseWheelMoved(MouseWheelEvent e) {
+            int wheelRotationCount = e.getWheelRotation();
+            int lineToShow = getFirstLine() + wheelRotationCount;
+            if (wheelRotationCount > 0) {
+                lineToShow += getVisibleLines();
+            }
+            if (lineToShow < 0) {
+                lineToShow = 0;
+            }
+            if (lineToShow >= getLineCount()) {
+                lineToShow = getLineCount() - 1;
+            }
+            scrollTo(lineToShow, getLineStartOffset(lineToShow));
+        }
+    }
+}

Added: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/AbstractCompoundCommand.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/AbstractCompoundCommand.java?rev=594367&view=auto
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/AbstractCompoundCommand.java (added)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/AbstractCompoundCommand.java Mon Nov 12 16:40:53 2007
@@ -0,0 +1,100 @@
+/*
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+package org.apache.batik.apps.svgbrowser;
+
+import java.util.ArrayList;
+
+/**
+ * Abstract compound command. Supports the execute / undo / redo of more than
+ * one command
+ *
+ * @version $Id$
+ */
+public abstract class AbstractCompoundCommand extends AbstractUndoableCommand {
+
+    /**
+     * The atom UndoableCommand command list.
+     */
+    protected ArrayList atomCommands;
+
+    /**
+     * Constructor.
+     */
+    public AbstractCompoundCommand() {
+        this.atomCommands = new ArrayList();
+    }
+
+    /**
+     * Adds the given command to the atomCommand list.
+     *
+     * @param command
+     *            The given command
+     */
+    public void addCommand(UndoableCommand command) {
+        if (command.shouldExecute()) {
+            atomCommands.add(command);
+        }
+    }
+
+    public void execute() {
+        int n = atomCommands.size();
+        for (int i = 0; i < n; i++) {
+            UndoableCommand cmd = (UndoableCommand) atomCommands.get(i);
+            cmd.execute();
+        }
+    }
+
+    public void undo() {
+        int size = atomCommands.size();
+        for (int i = size - 1; i >= 0; i--) {
+            UndoableCommand command = (UndoableCommand) atomCommands.get(i);
+            command.undo();
+        }
+    }
+
+    public void redo() {
+        int n = atomCommands.size();
+        for (int i = 0; i < n; i++) {
+            UndoableCommand cmd = (UndoableCommand) atomCommands.get(i);
+            cmd.redo();
+        }
+    }
+
+    public boolean shouldExecute() {
+        boolean shouldExecute = true;
+        if (atomCommands.size() == 0) {
+            shouldExecute = false;
+        }
+        int n = atomCommands.size();
+        for (int i = 0; i < n && shouldExecute; i++) {
+            UndoableCommand command = (UndoableCommand) atomCommands.get(i);
+            shouldExecute = command.shouldExecute() && shouldExecute;
+        }
+        return shouldExecute;
+    }
+
+    /**
+     * Returns the command number that this compound command contains.
+     *
+     * @return The atom command number
+     */
+    public int getCommandNumber() {
+        return atomCommands.size();
+    }
+}

Added: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/AbstractUndoableCommand.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/AbstractUndoableCommand.java?rev=594367&view=auto
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/AbstractUndoableCommand.java (added)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/AbstractUndoableCommand.java Mon Nov 12 16:40:53 2007
@@ -0,0 +1,60 @@
+/*
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+package org.apache.batik.apps.svgbrowser;
+
+/**
+ * Represents abstract undoable/redoable command. Concrete commands should
+ * extend this class
+ *
+ * @version $Id$
+ */
+public abstract class AbstractUndoableCommand implements UndoableCommand {
+
+    /**
+     * The command name.
+     */
+    protected String name;
+
+    public void execute() {
+    }
+
+    public void undo() {
+    }
+
+    public void redo() {
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Sets the command name.
+     *
+     * @param newName
+     *            Name to set
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public boolean shouldExecute() {
+        return true;
+    }
+}

Added: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMDocumentTree.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMDocumentTree.java?rev=594367&view=auto
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMDocumentTree.java (added)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMDocumentTree.java Mon Nov 12 16:40:53 2007
@@ -0,0 +1,1007 @@
+/*
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+package org.apache.batik.apps.svgbrowser;
+
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.dnd.Autoscroll;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragGestureRecognizer;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DragSourceDragEvent;
+import java.awt.dnd.DragSourceDropEvent;
+import java.awt.dnd.DragSourceEvent;
+import java.awt.dnd.DragSourceListener;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetContext;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.EventListener;
+import java.util.EventObject;
+import java.util.Iterator;
+
+import javax.swing.JPanel;
+import javax.swing.JRootPane;
+import javax.swing.JTree;
+import javax.swing.JViewport;
+import javax.swing.SwingUtilities;
+import javax.swing.Timer;
+import javax.swing.UIManager;
+import javax.swing.event.EventListenerList;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
+
+import org.apache.batik.dom.util.DOMUtilities;
+import org.apache.batik.apps.svgbrowser.DOMViewer.NodeInfo;
+
+import org.w3c.dom.Node;
+
+/**
+ * A swing tree to represent DOM Document.
+ */
+public class DOMDocumentTree extends JTree implements Autoscroll {
+
+    /**
+     * Listeners list.
+     */
+    protected EventListenerList eventListeners = new EventListenerList();
+
+    /**
+     * The insets where autoscrolling is active.
+     */
+    protected Insets autoscrollInsets = new Insets(20, 20, 20, 20);
+
+    /**
+     * How much to scroll.
+     */
+    protected Insets scrollUnits = new Insets(25, 25, 25, 25);
+
+    /**
+     * The controller for this tree.
+     */
+    protected DOMDocumentTreeController controller;
+
+    /**
+     * Creates the DOMDocumentTree.
+     *
+     * @param root
+     *            Root node
+     * @param controller
+     *            The tree controller
+     */
+    public DOMDocumentTree(TreeNode root, DOMDocumentTreeController controller) {
+        super(root);
+        this.controller = controller;
+        new TreeDragSource(this, DnDConstants.ACTION_COPY_OR_MOVE);
+        new DropTarget(this, new TreeDropTargetListener(this));
+    }
+
+    // DND Support
+
+    /**
+     * The JTree drag source wrapper.
+     */
+    public class TreeDragSource implements DragSourceListener,
+                                           DragGestureListener {
+
+        /**
+         * The drag source.
+         */
+        protected DragSource source;
+
+        /**
+         * The drag gesture recognizer.
+         */
+        protected DragGestureRecognizer recognizer;
+
+        /**
+         * The transferable tree node(s).
+         */
+        protected TransferableTreeNode transferable;
+
+        /**
+         * The sourceTree.
+         */
+        protected DOMDocumentTree sourceTree;
+
+        /**
+         * Constructor.
+         *
+         * @param tree
+         *            The source tree
+         * @param actions
+         *            The permitted action
+         */
+        public TreeDragSource(DOMDocumentTree tree, int actions) {
+            sourceTree = tree;
+            source = new DragSource();
+            recognizer =
+                source.createDefaultDragGestureRecognizer(sourceTree, actions,
+                                                          this);
+        }
+
+        public void dragGestureRecognized(DragGestureEvent dge) {
+            if (!controller.isDNDSupported()) {
+                return;
+            }
+            TreePath[] paths = sourceTree.getSelectionPaths();
+            // If an empty selection is 'being dragged'
+            if (paths == null) {
+                return;
+            }
+            ArrayList nodeList = new ArrayList();
+            for (int i = 0; i < paths.length; i++) {
+                TreePath path = paths[i];
+                // If the root node 'being dragged'
+                if (path.getPathCount() > 1) {
+                    DefaultMutableTreeNode node =
+                        (DefaultMutableTreeNode) path.getLastPathComponent();
+                    Node associatedNode = getDomNodeFromTreeNode(node);
+                    if (associatedNode != null) {
+                        nodeList.add(associatedNode);
+                    }
+                }
+            }
+            if (nodeList.isEmpty()) {
+                return;
+            }
+            transferable = new TransferableTreeNode(new TransferData(nodeList));
+
+            // Sets the default cursor behavior
+            source.startDrag(dge, null, transferable, this);
+        }
+
+        public void dragEnter(DragSourceDragEvent dsde) {
+        }
+
+        public void dragExit(DragSourceEvent dse) {
+        }
+
+        public void dragOver(DragSourceDragEvent dsde) {
+        }
+
+        public void dropActionChanged(DragSourceDragEvent dsde) {
+        }
+
+        public void dragDropEnd(DragSourceDropEvent dsde) {
+        }
+    }
+
+    /**
+     * Tree as a drop target listener.
+     */
+    public class TreeDropTargetListener implements DropTargetListener {
+
+        /**
+         * Insert node before the current node.
+         */
+        private static final int BEFORE = 1;
+
+        /**
+         * Insert node after the current node.
+         */
+        private static final int AFTER = 2;
+
+        /**
+         * Insert node as a child of the current node.
+         */
+        private static final int CURRENT = 3;
+
+        /**
+         * The associated transfer data.
+         */
+        private TransferData transferData;
+
+        /**
+         * The original glass pane of the tree is stored here.
+         */
+        private Component originalGlassPane;
+
+        /**
+         * The vertical offset where to catch the 'visual tips' of the tree node
+         * items rectangle.
+         */
+        private int visualTipOffset = 5;
+
+        /**
+         * The thickness of the visual tip.
+         */
+        private int visualTipThickness = 2;
+
+        /**
+         * Indicates the potential drop position relative to the current node
+         * where the dragged nodes are to be inserted.
+         */
+        private int positionIndicator;
+
+        /**
+         * The start point of the 'visual tip' line.
+         */
+        private Point startPoint;
+
+        /**
+         * The end point of the 'visual tip' line.
+         */
+        private Point endPoint;
+
+        /**
+         * Glasspane where 'visual tip' line is drawn
+         */
+        protected JPanel visualTipGlassPane = new JPanel() {
+            public void paint(Graphics g) {
+                g.setColor(UIManager.getColor("Tree.selectionBackground"));
+                if (startPoint == null || endPoint == null) {
+                    return;
+                }
+                int x1 = startPoint.x;
+                int x2 = endPoint.x;
+                int y1 = startPoint.y;
+
+                // Draws the visualTipThickness number of lines
+                int start = -visualTipThickness / 2;
+                start += visualTipThickness % 2 == 0 ? 1 : 0;
+                for (int i = start; i <= visualTipThickness / 2; i++) {
+                    g.drawLine(x1 + 2, y1 + i, x2 - 2, y1 + i);
+                }
+            }
+        };
+
+        /**
+         * The timer that controls the delay of expanding the tree path that is
+         * being dragged over.
+         */
+        private Timer expandControlTimer;
+
+        /**
+         * The delay for expanding.
+         */
+        private int expandTimeout = 1500;
+
+        /**
+         * The tree path that is being dragged over.
+         */
+        private TreePath dragOverTreePath;
+
+        /**
+         * The tree path that is scheduled for expand.
+         */
+        private TreePath treePathToExpand;
+
+        /**
+         * Constructor.
+         */
+        public TreeDropTargetListener(DOMDocumentTree tree) {
+            addOnAutoscrollListener(tree);
+        }
+
+        public void dragEnter(DropTargetDragEvent dtde) {
+            JTree tree = (JTree) dtde.getDropTargetContext().getComponent();
+            JRootPane rootPane = tree.getRootPane();
+            // Set glass pane
+            originalGlassPane = rootPane.getGlassPane();
+            rootPane.setGlassPane(visualTipGlassPane);
+            visualTipGlassPane.setOpaque(false);
+            visualTipGlassPane.setVisible(true);
+            updateVisualTipLine(tree, null);
+            // Set transferable
+            try {
+                Transferable transferable = dtde.getTransferable();
+                DataFlavor[] flavors = transferable.getTransferDataFlavors();
+                for (int i = 0; i < flavors.length; i++) {
+                    if (transferable.isDataFlavorSupported(flavors[i])) {
+                        transferData = (TransferData) transferable
+                                .getTransferData(flavors[i]);
+                        return;
+                    }
+                }
+            } catch (UnsupportedFlavorException e) {
+                e.printStackTrace();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+
+        public void dragOver(DropTargetDragEvent dtde) {
+            JTree tree = (JTree) dtde.getDropTargetContext().getComponent();
+            TreeNode targetTreeNode = getNode(dtde);
+            if (targetTreeNode != null) {
+                // Get the parent and sibling paths and nodes
+                updatePositionIndicator(dtde);
+                Point p = dtde.getLocation();
+                TreePath currentPath = tree.getPathForLocation(p.x, p.y);
+                TreePath parentPath = getParentPathForPosition(currentPath);
+                TreeNode parentNode = getNodeForPath(parentPath);
+                TreePath nextSiblingPath =
+                    getSiblingPathForPosition(currentPath);
+                TreeNode nextSiblingNode = getNodeForPath(nextSiblingPath);
+                Node potentialParent =
+                    getDomNodeFromTreeNode((DefaultMutableTreeNode) parentNode);
+                Node potentialSibling =
+                    getDomNodeFromTreeNode
+                        ((DefaultMutableTreeNode) nextSiblingNode);
+                // Check the drop target:
+                // - Checks if any node from the dragged nodes can be appended
+                // to the parent node
+                // - Checks whether the sibling node is among the nodes being
+                // dragged
+                if (DOMUtilities.canAppendAny(transferData.getNodeList(),
+                                              potentialParent)
+                        && !transferData.getNodeList()
+                            .contains(potentialSibling)) {
+                    dtde.acceptDrag(dtde.getDropAction());
+                    // Draw the 'visual tip' line
+                    updateVisualTipLine(tree, currentPath);
+                    // Expand the path
+                    dragOverTreePath = currentPath;
+                    if (!tree.isExpanded(currentPath)) {
+                        scheduleExpand(currentPath, tree);
+                    }
+                } else {
+                    dtde.rejectDrag();
+                }
+            } else {
+                dtde.rejectDrag();
+            }
+        }
+
+        public void dropActionChanged(DropTargetDragEvent dtde) {
+        }
+
+        public void drop(DropTargetDropEvent dtde) {
+            Point p = dtde.getLocation();
+            DropTargetContext dtc = dtde.getDropTargetContext();
+            JTree tree = (JTree) dtc.getComponent();
+            // Sets the original glass pane
+            setOriginalGlassPane(tree);
+            // Cancel tree item expanding
+            dragOverTreePath = null;
+            // Get the parent and sibling paths and nodes
+            TreePath currentPath = tree.getPathForLocation(p.x, p.y);
+            DefaultMutableTreeNode parent =
+                (DefaultMutableTreeNode) getNodeForPath
+                    (getParentPathForPosition(currentPath));
+            Node dropTargetNode = getDomNodeFromTreeNode(parent);
+            DefaultMutableTreeNode sibling =
+                (DefaultMutableTreeNode)
+                    getNodeForPath(getSiblingPathForPosition(currentPath));
+            Node siblingNode = getDomNodeFromTreeNode(sibling);
+            if (this.transferData != null) {
+                ArrayList nodelist =
+                    getNodeListForParent(this.transferData.getNodeList(),
+                                         dropTargetNode);
+                fireDropCompleted
+                    (new DOMDocumentTreeEvent
+                        (new DropCompletedInfo
+                            (dropTargetNode, siblingNode, nodelist)));
+                dtde.dropComplete(true);
+                return;
+            }
+            dtde.rejectDrop();
+        }
+
+        public void dragExit(DropTargetEvent dte) {
+            setOriginalGlassPane
+                ((JTree) dte.getDropTargetContext().getComponent());
+            // Set the current dragover path
+            dragOverTreePath = null;
+        }
+
+        /**
+         * Sets the position indicator according to the current cursor location.
+         *
+         * @param dtde
+         *            DropTargetDragEvent
+         */
+        private void updatePositionIndicator(DropTargetDragEvent dtde) {
+            Point p = dtde.getLocation();
+            DropTargetContext dtc = dtde.getDropTargetContext();
+            JTree tree = (JTree) dtc.getComponent();
+            // Current path
+            TreePath currentPath = tree.getPathForLocation(p.x, p.y);
+            Rectangle bounds = tree.getPathBounds(currentPath);
+            // Upper area of the tree node
+            if (p.y <= bounds.y + visualTipOffset) {
+                positionIndicator = BEFORE;
+            }
+            // Lower area of the tree node
+            else if (p.y >= bounds.y + bounds.height - visualTipOffset) {
+                positionIndicator = AFTER;
+            }
+            // Somewhere between the upper and the lower area of the tree node
+            else {
+                positionIndicator = CURRENT;
+            }
+        }
+
+        /**
+         * Finds the parent TreePath of the given current path, according to the
+         * position indicator, where the dragged nodes should be appended.
+         *
+         * @param currentPath
+         *            The current path (the items are dragged over this path)
+         * @param positionIndicator
+         *            AFTER or BEFORE - nodes should be appended to the parent
+         *            path of the given path, as siblings of the current path
+         *            CURRENT - nodes should be appended to the current path, as
+         *            its children
+         * @return TreePath where dragged nodes are to be inserted
+         */
+        private TreePath getParentPathForPosition(TreePath currentPath) {
+            if (currentPath == null) {
+                return null;
+            }
+            TreePath parentPath = null;
+            if (positionIndicator == AFTER) {
+                parentPath = currentPath.getParentPath();
+            } else if (positionIndicator == BEFORE) {
+                parentPath = currentPath.getParentPath();
+            } else if (positionIndicator == CURRENT) {
+                parentPath = currentPath;
+            }
+            return parentPath;
+        }
+
+        /**
+         * Finds the TreePath that is going to be next sibling to the nodes that
+         * are being dragged.
+         *
+         * @param currentPath
+         *            The current path (the items are dragged over this path)
+         * @return sibling TreePath
+         */
+        private TreePath getSiblingPathForPosition(TreePath currentPath) {
+            TreePath parentPath = getParentPathForPosition(currentPath);
+            TreePath nextSiblingPath = null;
+            if (positionIndicator == AFTER) {
+                TreeNode parentNode = getNodeForPath(parentPath);
+                TreeNode currentNode = getNodeForPath(currentPath);
+                if (parentPath != null && parentNode != null
+                        && currentNode != null) {
+                    int siblingIndex = parentNode.getIndex(currentNode) + 1;
+                    if (parentNode.getChildCount() > siblingIndex) {
+                        nextSiblingPath =
+                            parentPath.pathByAddingChild
+                                (parentNode.getChildAt(siblingIndex));
+                    }
+                }
+            } else if (positionIndicator == BEFORE) {
+                nextSiblingPath = currentPath;
+            } else if (positionIndicator == CURRENT) {
+                nextSiblingPath = null;
+            }
+            return nextSiblingPath;
+        }
+
+        /**
+         * Gets the TreeNode from the given TreePath.
+         *
+         * @param path
+         *            The given TreePath
+         * @return The TreeNode
+         */
+        private TreeNode getNodeForPath(TreePath path) {
+            if (path == null || path.getLastPathComponent() == null) {
+                return null;
+            }
+            return (TreeNode) path.getLastPathComponent();
+        }
+
+        /**
+         * Gets the TreeNode from the DropTargetDragEvent
+         *
+         * @param dtde
+         *            The DropTargetDragEvent
+         * @return Associated TreeNode or null
+         */
+        private TreeNode getNode(DropTargetDragEvent dtde) {
+            Point p = dtde.getLocation();
+            DropTargetContext dtc = dtde.getDropTargetContext();
+            JTree tree = (JTree) dtc.getComponent();
+            TreePath path = tree.getPathForLocation(p.x, p.y);
+            if (path == null || path.getLastPathComponent() == null) {
+                return null;
+            }
+            return (TreeNode) path.getLastPathComponent();
+        }
+
+        // Visual tips
+        /**
+         * Draws the 'visual tip' line on the glass pane.
+         *
+         * @param tree
+         *            The tree
+         * @param path
+         *            The path to get the bounds
+         */
+        private void updateVisualTipLine(JTree tree, TreePath path) {
+            if (path == null) {
+                startPoint = null;
+                endPoint = null;
+            } else {
+                Rectangle bounds = tree.getPathBounds(path);
+                if (positionIndicator == BEFORE) {
+                    startPoint = bounds.getLocation();
+                    endPoint = new Point(startPoint.x + bounds.width,
+                            startPoint.y);
+                } else if (positionIndicator == AFTER) {
+                    startPoint = new Point(bounds.x, bounds.y + bounds.height);
+                    endPoint = new Point(startPoint.x + bounds.width,
+                            startPoint.y);
+                    positionIndicator = AFTER;
+                } else if (positionIndicator == CURRENT) {
+                    startPoint = null;
+                    endPoint = null;
+                }
+                if (startPoint != null && endPoint != null) {
+                    startPoint = SwingUtilities.convertPoint(tree, startPoint,
+                            visualTipGlassPane);
+                    endPoint = SwingUtilities.convertPoint(tree, endPoint,
+                            visualTipGlassPane);
+                }
+            }
+            visualTipGlassPane.getRootPane().repaint();
+        }
+
+        /**
+         * Adds the onAutoscroll listener.
+         *
+         * @param tree
+         *            The DOMDocumentTree
+         */
+        private void addOnAutoscrollListener(DOMDocumentTree tree) {
+            tree.addListener(new DOMDocumentTreeAdapter() {
+                public void onAutoscroll(DOMDocumentTreeEvent event) {
+                    // Whenever autoscroll is triggered,
+                    // the 'visual tip' line should be hidden
+                    startPoint = null;
+                    endPoint = null;
+                }
+            });
+        }
+
+        /**
+         * Sets the original glass pane.
+         *
+         * @param dte
+         *            DropTargetEvent to get the tree
+         */
+        private void setOriginalGlassPane(JTree tree) {
+            JRootPane rootPane = tree.getRootPane();
+            rootPane.setGlassPane(originalGlassPane);
+            originalGlassPane.setVisible(false);
+            rootPane.repaint();
+        }
+
+        // Expand scheduling
+        /**
+         * Schedules the expand of the given treePath on a tree.
+         *
+         * @param treePath
+         *            The treePath to expand
+         * @param tree
+         *            The JTree
+         */
+        private void scheduleExpand(TreePath treePath, JTree tree) {
+            // If the treepath to schedule for expand isn't already scheduled
+            if (treePath != treePathToExpand) {
+                getExpandTreeTimer(tree).stop();
+                treePathToExpand = treePath;
+                getExpandTreeTimer(tree).start();
+            }
+        }
+
+        /**
+         * Gets the timer for treepath expand.
+         *
+         * @param tree
+         *            The JTree
+         * @return Timer
+         */
+        private Timer getExpandTreeTimer(final JTree tree) {
+            if (expandControlTimer == null) {
+                expandControlTimer = new Timer(expandTimeout,
+                        new ActionListener() {
+                            public void actionPerformed(ActionEvent arg0) {
+                                // If the treepath scheduled for expand is the
+                                // same one that is being dragged over
+                                if (treePathToExpand != null
+                                        && treePathToExpand == dragOverTreePath) {
+                                    tree.expandPath(treePathToExpand);
+                                }
+                                getExpandTreeTimer(tree).stop();
+                            }
+                        });
+            }
+            return expandControlTimer;
+        }
+    }
+
+    /**
+     * Transferable tree node.
+     */
+    public static class TransferableTreeNode implements Transferable {
+
+        /**
+         * A flavor that supports the node transfer.
+         */
+        protected static final DataFlavor NODE_FLAVOR =
+            new DataFlavor(TransferData.class, "TransferData");
+
+        /**
+         * The supported flavors.
+         */
+        protected static final DataFlavor[] FLAVORS =
+            new DataFlavor[] { NODE_FLAVOR, DataFlavor.stringFlavor };
+
+        /**
+         * The data being transfered.
+         */
+        protected TransferData data;
+
+        public TransferableTreeNode(TransferData data) {
+            this.data = data;
+        }
+
+        public synchronized DataFlavor[] getTransferDataFlavors() {
+            return FLAVORS;
+        }
+
+        /**
+         * Checks if the given date flavor is supported.
+         *
+         * @param flavor
+         *            DataFlavor
+         * @return boolean
+         */
+        public boolean isDataFlavorSupported(DataFlavor flavor) {
+            for (int i = 0; i < FLAVORS.length; i++) {
+                if (flavor.equals(FLAVORS[i])) {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        /**
+         * Data that is being transfered.
+         *
+         * @param flavor
+         *            DataFlavor
+         * @return (TransferData data, String xmlString)
+         */
+        public synchronized Object getTransferData(DataFlavor flavor) {
+            if (!isDataFlavorSupported(flavor)) {
+                return null;
+            }
+            if (flavor.equals(NODE_FLAVOR)) {
+                return (Object) data;
+            } else if (flavor.equals(DataFlavor.stringFlavor)) {
+                return data.getNodesAsXML();
+            } else {
+                return null;
+            }
+        }
+    }
+
+    /**
+     * The data being transfered on dnd.
+     */
+    public static class TransferData {
+
+        /**
+         * The nodes to transfer.
+         */
+        protected ArrayList nodeList;
+
+        /**
+         * Creates the TransferData.
+         *
+         * @param nodes
+         *            the nodeList
+         */
+        public TransferData(ArrayList nodeList) {
+            this.nodeList = nodeList;
+        }
+
+        /**
+         * Gets the nodeList.
+         *
+         * @return the nodeList
+         */
+        public ArrayList getNodeList() {
+            return nodeList;
+        }
+
+        /**
+         * Gets the concatenated string representation of the nodes in the node
+         * list. (To support string data flavor)
+         */
+        public String getNodesAsXML() {
+            String toReturn = "";
+            Iterator iterator = nodeList.iterator();
+            while (iterator.hasNext()) {
+                Node node = (Node) iterator.next();
+                toReturn += DOMUtilities.getXML(node);
+            }
+            return toReturn;
+        }
+    }
+
+    // Autoscroll support
+
+    public void autoscroll(Point point) {
+        JViewport viewport =
+            (JViewport) SwingUtilities.getAncestorOfClass(JViewport.class,
+                                                          this);
+        if (viewport == null) {
+            return;
+        }
+
+        Point viewportPos = viewport.getViewPosition();
+        int viewHeight = viewport.getExtentSize().height;
+        int viewWidth = viewport.getExtentSize().width;
+
+        // Scroll
+        if ((point.y - viewportPos.y) < autoscrollInsets.top) {
+            // Up
+            viewport.setViewPosition
+                (new Point(viewportPos.x,
+                           Math.max(viewportPos.y - scrollUnits.top, 0)));
+            fireOnAutoscroll(new DOMDocumentTreeEvent(this));
+        } else if ((viewportPos.y + viewHeight - point.y)
+                    < autoscrollInsets.bottom) {
+            // Down
+            viewport.setViewPosition
+                (new Point(viewportPos.x,
+                           Math.min(viewportPos.y + scrollUnits.bottom,
+                                    getHeight() - viewHeight)));
+            fireOnAutoscroll(new DOMDocumentTreeEvent(this));
+        } else if ((point.x - viewportPos.x) < autoscrollInsets.left) {
+            // Left
+            viewport.setViewPosition
+                (new Point(Math.max(viewportPos.x - scrollUnits.left, 0),
+                           viewportPos.y));
+            fireOnAutoscroll(new DOMDocumentTreeEvent(this));
+        } else if ((viewportPos.x + viewWidth - point.x)
+                    < autoscrollInsets.right) {
+            // Right
+            viewport.setViewPosition
+                (new Point(Math.min(viewportPos.x + scrollUnits.right,
+                                    getWidth() - viewWidth),
+                           viewportPos.y));
+            fireOnAutoscroll(new DOMDocumentTreeEvent(this));
+        }
+    }
+
+    public Insets getAutoscrollInsets() {
+        int topAndBottom = getHeight();
+        int leftAndRight = getWidth();
+        return new Insets
+            (topAndBottom, leftAndRight, topAndBottom, leftAndRight);
+    }
+
+    // Custom event support
+
+    /**
+     * Event to pass to listener.
+     */
+    public static class DOMDocumentTreeEvent extends EventObject {
+
+        public DOMDocumentTreeEvent(Object source) {
+            super(source);
+        }
+    }
+
+    /**
+     * The DOMDocumentTreeListener.
+     */
+    public static interface DOMDocumentTreeListener extends EventListener {
+
+        /**
+         * Fired after successfully completed drop.
+         *
+         * @param event
+         *            the DOMDocumentTreeEvent
+         */
+        void dropCompleted(DOMDocumentTreeEvent event);
+
+        /**
+         * Fired when autoscroll is invoked
+         *
+         * @param event
+         *            the DOMDocumentTreeEvent
+         */
+        void onAutoscroll(DOMDocumentTreeEvent event);
+    }
+
+    /**
+     * The adapter for the DOMDocumentTreeListener.
+     */
+    public static class DOMDocumentTreeAdapter
+            implements DOMDocumentTreeListener {
+
+        public void dropCompleted(DOMDocumentTreeEvent event) {
+        }
+
+        public void onAutoscroll(DOMDocumentTreeEvent event) {
+        }
+    }
+
+    /**
+     * Adds the listener to the listener list.
+     *
+     * @param l
+     *            The listener to add
+     */
+    public void addListener(DOMDocumentTreeListener listener) {
+        eventListeners.add(DOMDocumentTreeListener.class, listener);
+    }
+
+    /**
+     * Fires the dropCompleted event.
+     *
+     * @param event
+     *            The associated DndTreeSupportEvent event
+     */
+    public void fireDropCompleted(DOMDocumentTreeEvent event) {
+        Object[] listeners = eventListeners.getListenerList();
+        int length = listeners.length;
+        for (int i = 0; i < length; i += 2) {
+            if (listeners[i] == DOMDocumentTreeListener.class) {
+                ((DOMDocumentTreeListener) listeners[i + 1])
+                        .dropCompleted(event);
+            }
+        }
+    }
+
+    /**
+     * Fires the dropCompleted event.
+     *
+     * @param event
+     *            The associated DndTreeSupportEvent event
+     */
+    public void fireOnAutoscroll(DOMDocumentTreeEvent event) {
+        Object[] listeners = eventListeners.getListenerList();
+        int length = listeners.length;
+        for (int i = 0; i < length; i += 2) {
+            if (listeners[i] == DOMDocumentTreeListener.class) {
+                ((DOMDocumentTreeListener) listeners[i + 1])
+                        .onAutoscroll(event);
+            }
+        }
+    }
+
+    /**
+     * Contains the info for the 'dropCompleted' Event.
+     */
+    public static class DropCompletedInfo {
+
+        /**
+         * Parent node.
+         */
+        protected Node parent;
+
+        /**
+         * Nodes to be appended.
+         */
+        protected ArrayList children;
+
+        /**
+         * Next sibling node.
+         */
+        protected Node sibling;
+
+        /**
+         * @param parent
+         *            Parent node
+         * @param children
+         *            Nodes to be appended
+         */
+        public DropCompletedInfo(Node parent, Node sibling,
+                                 ArrayList children) {
+            this.parent = parent;
+            this.sibling = sibling;
+            this.children = children;
+        }
+
+        /**
+         * Gets the children.
+         *
+         * @return the children
+         */
+        public ArrayList getChildren() {
+            return children;
+        }
+
+        /**
+         * Getter for the parent.
+         *
+         * @return the parent
+         */
+        public Node getParent() {
+            return parent;
+        }
+
+        /**
+         * Getter for the sibling.
+         *
+         * @return the sibling
+         */
+        public Node getSibling() {
+            return sibling;
+        }
+    }
+
+    // Utility methods
+
+    /**
+     * Gets the associated org.w3c.dom.Node from the DefaultMutableTreeNode
+     *
+     * @param treeNode
+     *            The given DefaultMutableTreeNode
+     * @return the associated Node
+     */
+    protected Node getDomNodeFromTreeNode(DefaultMutableTreeNode treeNode) {
+        if (treeNode == null) {
+            return null;
+        }
+        if (treeNode.getUserObject() instanceof NodeInfo) {
+            return ((NodeInfo) treeNode.getUserObject()).getNode();
+        }
+        return null;
+    }
+
+    /**
+     * Finds and returns a group of nodes that can be appended to the given
+     * parent node.
+     *
+     * @param potentialChildren
+     *            The given potential children
+     * @param parentNode
+     *            The given parent node
+     * @return list of nodes that can be appended to the given parent
+     */
+    protected ArrayList getNodeListForParent(ArrayList potentialChildren,
+                                             Node parentNode) {
+        ArrayList children = new ArrayList();
+        int n = potentialChildren.size();
+        for (int i = 0; i < n; i++) {
+            Node node = (Node) potentialChildren.get(i);
+            if (DOMUtilities.canAppend(node, parentNode)) {
+                children.add(node);
+            }
+        }
+        return children;
+    }
+}

Added: xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMDocumentTreeController.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMDocumentTreeController.java?rev=594367&view=auto
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMDocumentTreeController.java (added)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/apps/svgbrowser/DOMDocumentTreeController.java Mon Nov 12 16:40:53 2007
@@ -0,0 +1,30 @@
+/*
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+package org.apache.batik.apps.svgbrowser;
+
+/**
+ * Provides the information to control the DOMDocumentTree behaviour.
+ */
+public interface DOMDocumentTreeController {
+
+    /**
+     * Returns whether the DOMDocumentTree supports drag-and-drop.
+     */
+    boolean isDNDSupported();
+}



Re: svn commit: r594367 [1/9] - in /xmlgraphics/batik/trunk: ./ resources/org/apache/batik/apps/svgbrowser/resources/ resources/org/apache/batik/util/gui/resources/ sources-1.3/org/apache/batik/util/ sources-1.3/org/apache/batik/util/gui/ sources-1.4/org/a...

Posted by Cameron McCormack <ca...@mcc.id.au>.
cam@apache.org:
> Author: cam
> Date: Mon Nov 12 16:40:53 2007
> New Revision: 594367
> 
> URL: http://svn.apache.org/viewvc?rev=594367&view=rev
> Log:
> Enhanced DOM Viewer window.  This commit is Ivan's patch from
> http://issues.apache.org/bugzilla/show_bug.cgi?id=42697 with some
> changes (reformatting, moving some classes to different packages).

I should point out that with this commit, I have moved the DOM Viewer
classes from org.apache.batik.util.gui to
org.apache.batik.apps.svgbrowser, since the gui-util jar was getting a
bit heavy (especially since it is a dependency of the swing jar).

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org