tkormann    01/10/15 02:33:44

  Modified:    resources/org/apache/batik/apps/svgbrowser/resources
                        GUI.properties
               samples/tests/resources/svg defs.svg
               sources/org/apache/batik/apps/svgbrowser Main.java
                        PreferenceDialog.java
               sources/org/apache/batik/swing/gvt JGVTComponent.java
                        TextSelectionManager.java
               sources/org/apache/batik/util PreferenceManager.java
  Added:       samples/tests/resources/svg defs2.svg
               samples/tests/spec/structure externalUseCascading.svg
                        useTargets.svg
  Log:
  - add 2 new tests for external use
  - selection XOR mode is now customizable in the browser
  
  Revision  Changes    Path
  1.34      +3 -1      
xml-batik/resources/org/apache/batik/apps/svgbrowser/resources/GUI.properties
  
  Index: GUI.properties
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/resources/org/apache/batik/apps/svgbrowser/resources/GUI.properties,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- GUI.properties    2001/10/10 13:42:37     1.33
  +++ GUI.properties    2001/10/15 09:33:44     1.34
  @@ -9,7 +9,7 @@
   # The viewer's GUI resources.
   #
   # Author: [EMAIL PROTECTED]
  -# $Id: GUI.properties,v 1.33 2001/10/10 13:42:37 tkormann Exp $
  +# $Id: GUI.properties,v 1.34 2001/10/15 09:33:44 tkormann Exp $
   #
   
   ViewSource.width = 750
  @@ -370,6 +370,8 @@
   PreferenceDialog.label.enable.double.buffering = Enable Double Buffering
   PreferenceDialog.label.show.rendering = Show Rendering
   PreferenceDialog.label.show.debug.trace = Show Debug Trace
  +PreferenceDialog.label.selection.xor.mode = Display selection overlay using XOR mode
  +
   PreferenceDialog.label.host = Proxy Host
   PreferenceDialog.label.port = Proxy Port
   PreferenceDialog.label.ok = OK
  
  
  
  1.2       +108 -3    xml-batik/samples/tests/resources/svg/defs.svg
  
  Index: defs.svg
  ===================================================================
  RCS file: /home/cvs/xml-batik/samples/tests/resources/svg/defs.svg,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- defs.svg  2001/10/15 08:07:13     1.1
  +++ defs.svg  2001/10/15 09:33:44     1.2
  @@ -14,11 +14,9 @@
   <!-- Test description here                                                     -->
   <!--                                                                           -->
   <!-- @author [EMAIL PROTECTED]                                                  -->
  -<!-- @version $Id: defs.svg,v 1.1 2001/10/15 08:07:13 vhardy Exp $ -->
  +<!-- @version $Id: defs.svg,v 1.2 2001/10/15 09:33:44 tkormann Exp $ -->
   <!-- ========================================================================= -->
   
  -<?xml-stylesheet type="text/css" href="test.css" ?>
  -
   <svg width="450" height="500" viewBox="0 0 450 500">
   
   <text x="225" y="50" class="title">Not a test - only contains definitions</text>
  @@ -26,6 +24,8 @@
   <defs>
   
   <!-- ###################################################################### -->
  +<!-- used by externalPaints.svg -->
  +<!-- ###################################################################### -->
   <linearGradient id="linearSimpleReference" x1=".5" y1="0" x2=".5" y2="1">
        <stop style="stop-color:blue" offset="0" />
        <stop style="stop-color:white" offset=".5" />
  @@ -72,6 +72,111 @@
            patternContentUnits="userSpaceOnUse" patternUnits="userSpaceOnUse"
            patternTransform="rotate(45)"
            xlink:href="defs2.svg#pattern" />
  +
  +<!-- ###################################################################### -->
  +<!-- useStyling.svg -->
  +<!-- ###################################################################### -->
  +
  +  <radialGradient id="extGrad1">
  +     <stop style="stop-color:gold" offset="0" />
  +     <stop style="stop-color:crimson" offset="1" />
  +  </radialGradient>
  +
  +  <radialGradient id="extGrad2">
  +     <stop style="stop-color:white" offset="0" />
  +     <stop style="stop-color:black" offset="1" />
  +  </radialGradient>
  +
  +  <radialGradient id="extGrad3">
  +     <stop style="stop-color:gold" offset="0" />
  +     <stop style="stop-color:green" offset="1" />
  +  </radialGradient>
  +
  +<g>
  +     <circle id="extE" cx="25" cy="25" r="20" />
  +
  +     <circle id="extE1" cx="25" cy="25" r="20" style="fill:url(#extGrad1)" />
  +
  +     <circle id="extE2" cx="25" cy="25" r="20" 
style="fill:url(useStylingURI.svg#grad1)" />
  +</g>
  +
  +
  +<!-- ###################################################################### -->
  +<!-- externalUseCascading.svg -->
  +<!-- ###################################################################### -->
  +
  +<g id="tree1">
  +     <!-- ### decoration ### -->
  +     <line x1="100" y1="0" x2="0" y2="75" style="stroke:black; fill:none" />
  +     <line x1="100" y1="0" x2="100" y2="75" style="stroke:black; fill:none" />
  +     <line x1="100" y1="0" x2="200" y2="75" style="stroke:black; fill:none" />
  +     <circle cx="100" cy="0" r="25" style="fill:#eee;" />
  +     <text x="100" y="6" style="fill:black; text-anchor:middle; 
font-size:18">&lt;g></text>
  +
  +     <!-- ### color inherited inside this document  ###-->
  +     <g style="fill:orange">
  +             <circle cx="0" cy="75" r="25" />
  +             <text x="0" y="115" style="text-anchor:middle; fill:black; 
stroke:none;">local</text>
  +     </g>
  +
  +     <!-- ### color inherited from the use element  ###-->
  +     <g>
  +             <circle cx="100" cy="75" r="25" />
  +             <text x="100" y="115" style="text-anchor:middle; fill:black; 
stroke:none;">inherited</text>
  +     </g>
  +
  +     <!-- ### color defined on the circle  ###-->
  +     <g>
  +             <circle cx="200" cy="75" r="25" style="fill:gold"/>
  +             <text x="200" y="115" style="text-anchor:middle; fill:black; 
stroke:none;">explicit</text>
  +     </g>
  +</g>
  +
  +<g id="tree2">
  +     <!-- ### decoration ### -->
  +     <line x1="100" y1="0" x2="0" y2="75" style="stroke:black; fill:none" />
  +     <line x1="100" y1="0" x2="100" y2="75" style="stroke:black; fill:none" />
  +     <line x1="100" y1="0" x2="200" y2="75" style="stroke:black; fill:none" />
  +     <circle cx="100" cy="0" r="25" style="fill:#eee;" />
  +     <text x="100" y="6" style="fill:black; text-anchor:middle; 
font-size:18">&lt;g></text>
  +
  +     <!-- ### gradient inherited inside this document ###-->
  +     <g style="fill:url(#extGrad3)">
  +             <circle cx="0" cy="75" r="25" />
  +             <text x="0" y="115" style="text-anchor:middle; fill:black; 
stroke:none;">local</text>
  +     </g>
  +
  +     <!-- ### gradient inherited from the use element ###-->
  +     <g>
  +             <circle cx="100" cy="75" r="25" />
  +             <text x="100" y="115" style="text-anchor:middle; fill:black; 
stroke:none;">inherited</text>
  +     </g>
  +
  +     <!-- ### pattern defined on the circle ###-->
  +     <g>
  +             <circle cx="200" cy="75" r="25" 
style="fill:url(#patternExtReference)"/>
  +             <text x="200" y="115" style="text-anchor:middle; fill:black; 
stroke:none;">explicit</text>
  +     </g>
  +</g>
  +
  +<!-- ###################################################################### -->
  +<!-- useTargets.svg -->
  +<!-- ###################################################################### -->
  +
  +<symbol id="extSymbol" width="50" height="50" viewBox="-50 -50 100 100" 
style="stroke:crimson; stroke-width:4">
  +     <rect x="-50" y="-50" width="100%" height="100%" style="fill:gold; 
stroke:none"/>
  +     <circle cx="0" cy="0" r="25%"/>
  +</symbol>
  +
  +<svg id="extSvg" width="50" height="50" viewBox="-50 -50 100 100" 
style="stroke:crimson; stroke-width:4">
  +     <rect x="-50" y="-50" width="100%" height="100%" style="fill:gold; 
stroke:none"/>
  +     <circle cx="0" cy="0" r="25%"/>
  +</svg>
  +
  +<g id="extOther" style="stroke:crimson; stroke-width:4">
  +     <rect x="-50" y="-50" width="100" height="100" style="fill:gold; stroke:none"/>
  +     <circle cx="0" cy="0" r="25"/>
  +</g>
   
   </defs>
   
  
  
  
  1.1                  xml-batik/samples/tests/resources/svg/defs2.svg
  
  Index: defs2.svg
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>
  
  <!-- ========================================================================= -->
  <!-- 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.                                                         -->
  <!-- ========================================================================= -->
  
  <!-- ========================================================================= -->
  <!-- Test description here                                                     -->
  <!--                                                                           -->
  <!-- @author [EMAIL PROTECTED]                                                  -->
  <!-- @version $Id: defs2.svg,v 1.1 2001/10/15 09:33:44 tkormann Exp $ -->
  <!-- ========================================================================= -->
  
  <svg width="450" height="500" viewBox="0 0 450 500">
  
  <text x="225" y="50" class="title">Not a test - only contains definitions</text>
  
  <defs>
  
  <linearGradient id="linear">
        <stop style="stop-color:blue" offset="0" />
        <stop style="stop-color:white" offset=".5" />
        <stop style="stop-color:gold" offset=".51" />
        <stop style="stop-color:crimson" offset="1" />
  </linearGradient>
  
  <radialGradient id="radial">
        <stop style="stop-color:white" offset="0" />
        <stop style="stop-color:gold" offset=".2" />
        <stop style="stop-color:orange" offset="1" />
  </radialGradient>
  
  <pattern id="pattern">
    <rect x="0" y="0" width="5" height="5" style="fill:crimson" />
    <rect x="5" y="0" width="5" height="5" style="fill:orange" />
    <rect x="0" y="5" width="5" height="5" style="fill:gold" />
    <rect x="5" y="5" width="5" height="5" style="fill:white" />
  </pattern>
  
  </defs>
  
  </svg>
  
  
  
  1.1                  xml-batik/samples/tests/spec/structure/externalUseCascading.svg
  
  Index: externalUseCascading.svg
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>
  
  <!-- ========================================================================= -->
  <!-- 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.                                                         -->
  <!-- ========================================================================= -->
  
  <!-- ========================================================================= -->
  <!-- Alternate stylesheets                                                     -->
  <!--                                                                           -->
  <!-- @author [EMAIL PROTECTED]                                                  -->
  <!-- @version $Id: externalUseCascading.svg,v 1.1 2001/10/15 09:33:44 tkormann Exp $ 
-->
  <!-- ========================================================================= -->
  
  <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>
  
  <svg width="450" height="500" viewBox="0 0 450 500">
  <title>External &lt;use> cascading</title>
  
      <!-- ============================================================= -->
      <!-- Test content                                                  -->
      <!-- ============================================================= -->
      <g id="testContent">
      <text x="225" y="50" class="title">External &lt;use> cascading</text>
      <text x="225" y="70" style="text-anchor:middle; font-size:12; 
font-style:italic">This file is using the defs.svg file to get the external 
resources</text>
  
  <defs>
  
    <radialGradient id="grad">
        <stop style="stop-color:gold" offset="0" />
        <stop style="stop-color:crimson" offset="1" />
    </radialGradient>
  
  </defs>
  
        <use xlink:href="../../resources/svg/defs.svg#tree1" x="120" y="120" 
style="fill:crimson"/>
  
        <use xlink:href="../../resources/svg/defs.svg#tree2" x="120" y="300" 
style="fill:url(#grad)"/>
  
      </g>
  
      <!-- ============================================================= -->
      <!-- Batik sample mark                                             -->
      <!-- ============================================================= -->
      <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" />
      
  </svg>
  
  
  
  1.1                  xml-batik/samples/tests/spec/structure/useTargets.svg
  
  Index: useTargets.svg
  ===================================================================
  <?xml version="1.0" standalone="no"?>
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd";>
  
  <!-- ========================================================================= -->
  <!-- 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.                                                         -->
  <!-- ========================================================================= -->
  
  <!-- ========================================================================= -->
  <!-- Alternate stylesheets                                                     -->
  <!--                                                                           -->
  <!-- @author [EMAIL PROTECTED]                                                  -->
  <!-- @version $Id: useTargets.svg,v 1.1 2001/10/15 09:33:44 tkormann Exp $ -->
  <!-- ========================================================================= -->
  
  <?xml-stylesheet type="text/css" href="../../style/test.css" ?>
  
  <svg width="450" height="500" viewBox="0 0 450 500">
  <title>&lt;use> targets</title>
  
      <!-- ============================================================= -->
      <!-- Test content                                                  -->
      <!-- ============================================================= -->
      <g id="testContent">
      <text x="225" y="50" class="title">&lt;use> targets</text>
      <text x="225" y="70" style="text-anchor:middle; font-size:12; 
font-style:italic">This file is using the defs.svg file to get the external 
resources</text>
  
  <!-- ############################### -->
  <g id="board" style="fill:none; stroke:black;">
  
        <rect x="75" y="100" width="150" height="20" style="fill:#eee"/>
        <rect x="225" y="100" width="150" height="20" style="fill:#eee"/>
  
        <rect x="55" y="120" width="20" height="100" style="fill:#eee"/>
        <rect x="55" y="220" width="20" height="100" style="fill:#eee"/>
        <rect x="55" y="320" width="20" height="100" style="fill:#eee"/>
  
        <rect x="75" y="120" width="150" height="300"/>
        <rect x="225" y="120" width="150" height="300"/>
  
        <line x1="75" y1="220" x2="375" y2="220" />
        <line x1="75" y1="320" x2="375" y2="320" />
  
        <g style="font-size:12; text-anchor:middle; fill:black; stroke:none">
                <text x="150" y="114">&lt;use></text>
                <text x="300" y="114">External &lt;use></text>
  
                <text x="0" y="0" transform="translate(70 170) 
rotate(-90)">Symbol</text>
                <text x="0" y="0" transform="translate(70 270) rotate(-90)">SVG</text>
                <text x="0" y="0" transform="translate(70 370) 
rotate(-90)">Other</text>
        </g>
  </g>
  
  <defs>
  
  <symbol id="symbol" width="50" height="50" viewBox="-50 -50 100 100" 
style="stroke:crimson; stroke-width:4">
        <rect x="-50" y="-50" width="100%" height="100%" style="fill:gold; 
stroke:none"/>
        <circle cx="0" cy="0" r="25%"/>
  </symbol>
  
  <svg id="svg" width="50" height="50" viewBox="-50 -50 100 100" 
style="stroke:crimson; stroke-width:4">
        <rect x="-50" y="-50" width="100%" height="100%" style="fill:gold; 
stroke:none"/>
        <circle cx="0" cy="0" r="25%"/>
  </svg>
  
  <g id="other" style="stroke:crimson; stroke-width:4">
        <rect x="-50" y="-50" width="100" height="100" style="fill:gold; stroke:none"/>
        <circle cx="0" cy="0" r="25"/>
  </g>
  
  </defs>
  
  <!-- ### use ### -->
  <use xlink:href="#symbol" x="115" y="130" width="75" height="75" style="fill:orange" 
/>
  <rect x="115" y="130" width="75" height="75" style="stroke:black; fill:none;" />
  
  <use xlink:href="#svg" x="115" y="230" width="75" height="75" style="fill:orange" />
  <rect x="115" y="230" width="75" height="75" style="stroke:black; fill:none;" />
  
  <use xlink:href="#other" x="115" y="330" width="75" height="75" style="fill:orange" 
       transform="translate(38 38) scale(.75)"/>
  <rect x="115" y="330" width="75" height="75" style="stroke:black; fill:none;" />
  
  
  <!-- ### external use ### -->
  <use xlink:href="../../resources/svg/defs.svg#extSymbol" x="265" y="130" width="75" 
height="75" style="fill:orange" />
  <rect x="265" y="130" width="75" height="75" style="stroke:black; fill:none;" />
  
  <use xlink:href="../../resources/svg/defs.svg#extSvg" x="265" y="230" width="75" 
height="75" style="fill:orange" />
  <rect x="265" y="230" width="75" height="75" style="stroke:black; fill:none;" />
  
  <use xlink:href="../../resources/svg/defs.svg#extOther" x="265" y="330" width="75" 
height="75" style="fill:orange" 
       transform="translate(38 38) scale(.75)"/>
  <rect x="265" y="330" width="75" height="75" style="stroke:black; fill:none;" />
  
      </g>
  
      <!-- ============================================================= -->
      <!-- Batik sample mark                                             -->
      <!-- ============================================================= -->
      <use xlink:href="../../../batikLogo.svg#Batik_Tag_Box" />
      
  </svg>
  
  
  
  1.18      +7 -1      xml-batik/sources/org/apache/batik/apps/svgbrowser/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/apps/svgbrowser/Main.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Main.java 2001/10/11 18:37:33     1.17
  +++ Main.java 2001/10/15 09:33:44     1.18
  @@ -45,7 +45,7 @@
    * This class contains the main method of an SVG viewer.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephane Hillion</a>
  - * @version $Id: Main.java,v 1.17 2001/10/11 18:37:33 hillion Exp $
  + * @version $Id: Main.java,v 1.18 2001/10/15 09:33:44 tkormann Exp $
    */
   public class Main implements Application {
   
  @@ -133,6 +133,8 @@
                        Boolean.FALSE);
           defaults.put(PreferenceDialog.PREFERENCE_KEY_AUTO_ADJUST_WINDOW,
                        Boolean.TRUE);
  +        defaults.put(PreferenceDialog.PREFERENCE_KEY_SELECTION_XOR_MODE,
  +                     Boolean.FALSE);
           defaults.put(PreferenceDialog.PREFERENCE_KEY_ENABLE_DOUBLE_BUFFERING,
                        Boolean.TRUE);
           defaults.put(PreferenceDialog.PREFERENCE_KEY_SHOW_DEBUG_TRACE,
  @@ -405,6 +407,10 @@
           boolean aa = preferenceManager.getBoolean
               (PreferenceDialog.PREFERENCE_KEY_AUTO_ADJUST_WINDOW);
           vf.setAutoAdjust(aa);
  +        boolean dd = preferenceManager.getBoolean
  +            (PreferenceDialog.PREFERENCE_KEY_SELECTION_XOR_MODE);
  +     System.out.println("++++++++++++++++ "+dd);
  +     vf.getJSVGCanvas().setSelectionOverlayXORMode(dd);
       }
   
       /**
  
  
  
  1.8       +24 -6     
xml-batik/sources/org/apache/batik/apps/svgbrowser/PreferenceDialog.java
  
  Index: PreferenceDialog.java
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/apps/svgbrowser/PreferenceDialog.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PreferenceDialog.java     2001/10/10 13:42:37     1.7
  +++ PreferenceDialog.java     2001/10/15 09:33:44     1.8
  @@ -55,7 +55,7 @@
    * Dialog that displays user preferences.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Vincent Hardy</a>
  - * @version $Id: PreferenceDialog.java,v 1.7 2001/10/10 13:42:37 tkormann Exp $
  + * @version $Id: PreferenceDialog.java,v 1.8 2001/10/15 09:33:44 tkormann Exp $
    */
   public class PreferenceDialog extends JDialog 
       implements GridBagConstants {
  @@ -119,6 +119,9 @@
       public static final String LABEL_SHOW_DEBUG_TRACE
           = "PreferenceDialog.label.show.debug.trace";
   
  +    public static final String LABEL_SELECTION_XOR_MODE
  +        = "PreferenceDialog.label.selection.xor.mode";
  +
       public static final String LABEL_HOST
           = "PreferenceDialog.label.host";
   
  @@ -175,10 +178,12 @@
       public static final String PREFERENCE_KEY_SHOW_DEBUG_TRACE
           = "preference.key.show.debug.trace";
   
  +    public static final String PREFERENCE_KEY_SELECTION_XOR_MODE
  +        = "preference.key.selection.xor.mode";
  +
       public static final String PREFERENCE_KEY_PROXY_HOST
           = "preference.key.proxy.host";
   
  -
       public static final String PREFERENCE_KEY_CSS_MEDIA
           = "preference.key.cssmedia";
   
  @@ -214,6 +219,8 @@
   
       protected JCheckBox enableDoubleBuffering;
   
  +    protected JCheckBox selectionXorMode;
  +
       protected JTextField host, port;
   
       protected CSSMediaPanel cssMediaPanel;
  @@ -272,6 +279,7 @@
           
autoAdjustWindow.setSelected(model.getBoolean(PREFERENCE_KEY_AUTO_ADJUST_WINDOW));
           
enableDoubleBuffering.setSelected(model.getBoolean(PREFERENCE_KEY_ENABLE_DOUBLE_BUFFERING));
           
showDebugTrace.setSelected(model.getBoolean(PREFERENCE_KEY_SHOW_DEBUG_TRACE));
  +        
selectionXorMode.setSelected(model.getBoolean(PREFERENCE_KEY_SELECTION_XOR_MODE));
   
           //
           // Initialize the proxy options
  @@ -305,6 +313,12 @@
                            enableDoubleBuffering.isSelected());
           model.setBoolean(PREFERENCE_KEY_SHOW_DEBUG_TRACE,
                            showDebugTrace.isSelected());
  +
  +        model.setBoolean(PREFERENCE_KEY_SELECTION_XOR_MODE,
  +                      selectionXorMode.isSelected());
  +     System.out.println("--------------------- "+selectionXorMode.isSelected());
  +     
System.out.println(">>>>>>>>>>>>>>>>>>>>>>"+model.getBoolean(PREFERENCE_KEY_SELECTION_XOR_MODE));
  +
           model.setString(PREFERENCE_KEY_PROXY_HOST,
                           host.getText());
           model.setString(PREFERENCE_KEY_PROXY_PORT,
  @@ -473,11 +487,14 @@
               = new JCheckBox(Resources.getString(LABEL_ENABLE_DOUBLE_BUFFERING));
           showDebugTrace
               = new JCheckBox(Resources.getString(LABEL_SHOW_DEBUG_TRACE));
  +        selectionXorMode
  +            = new JCheckBox(Resources.getString(LABEL_SELECTION_XOR_MODE));
   
           p.add(showRendering,    0, 0, 1, 1, WEST, HORIZONTAL, 1, 0);
           p.add(autoAdjustWindow, 0, 1, 1, 1, WEST, HORIZONTAL, 1, 0);
           p.add(enableDoubleBuffering, 0, 2, 1, 1, WEST, HORIZONTAL, 1, 0);
           p.add(showDebugTrace,   0, 3, 1, 1, WEST, HORIZONTAL, 1, 0);
  +        p.add(selectionXorMode,   0, 4, 1, 1, WEST, HORIZONTAL, 1, 0);
   
           p.setBorder(BorderFactory.createCompoundBorder
                       (BorderFactory.createTitledBorder
  @@ -526,10 +543,11 @@
       public static void main(String[] args){
           Map defaults = new Hashtable();
           defaults.put(PREFERENCE_KEY_LANGUAGES, "fr");
  -        defaults.put(PREFERENCE_KEY_SHOW_RENDERING, new Boolean(true));
  -        defaults.put(PREFERENCE_KEY_AUTO_ADJUST_WINDOW, new Boolean(true));
  -        defaults.put(PREFERENCE_KEY_ENABLE_DOUBLE_BUFFERING, new Boolean(true));
  -        defaults.put(PREFERENCE_KEY_SHOW_DEBUG_TRACE, new Boolean(true));
  +        defaults.put(PREFERENCE_KEY_SHOW_RENDERING, Boolean.TRUE);
  +        defaults.put(PREFERENCE_KEY_SELECTION_XOR_MODE, Boolean.FALSE);
  +        defaults.put(PREFERENCE_KEY_AUTO_ADJUST_WINDOW, Boolean.TRUE);
  +        defaults.put(PREFERENCE_KEY_ENABLE_DOUBLE_BUFFERING, Boolean.TRUE);
  +        defaults.put(PREFERENCE_KEY_SHOW_DEBUG_TRACE, Boolean.TRUE);
           defaults.put(PREFERENCE_KEY_PROXY_HOST, "webcache.eng.sun.com");
           defaults.put(PREFERENCE_KEY_PROXY_PORT, "8080");
   
  
  
  
  1.21      +25 -7     xml-batik/sources/org/apache/batik/swing/gvt/JGVTComponent.java
  
  Index: JGVTComponent.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/swing/gvt/JGVTComponent.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- JGVTComponent.java        2001/10/05 15:34:26     1.20
  +++ JGVTComponent.java        2001/10/15 09:33:44     1.21
  @@ -53,7 +53,7 @@
    * This class represents a component which can display a GVT tree.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephane Hillion</a>
  - * @version $Id: JGVTComponent.java,v 1.20 2001/10/05 15:34:26 tkormann Exp $
  + * @version $Id: JGVTComponent.java,v 1.21 2001/10/15 09:33:44 tkormann Exp $
    */
   public class JGVTComponent extends JComponent {
   
  @@ -301,14 +301,20 @@
        * @param color the new color of the selection overlay
        */
       public void setSelectionOverlayColor(Color color) {
  -     textSelectionManager.setSelectionOverlayColor(color);
  +     if (textSelectionManager != null) {
  +         textSelectionManager.setSelectionOverlayColor(color);
  +     }
       }
   
       /**
        * Returns the color of the selection overlay.
        */
       public Color getSelectionOverlayColor() {
  -     return textSelectionManager.getSelectionOverlayColor();
  +     if (textSelectionManager != null) {
  +         return textSelectionManager.getSelectionOverlayColor();
  +     } else {
  +         throw new IllegalArgumentException("Selection is disabled");
  +     }
       }
   
       /**
  @@ -318,14 +324,20 @@
        * @param color the new color of the outline of the selection overlay 
        */
       public void setSelectionOverlayStrokeColor(Color color) {
  -     textSelectionManager.setSelectionOverlayStrokeColor(color);
  +     if (textSelectionManager != null) {
  +         textSelectionManager.setSelectionOverlayStrokeColor(color);
  +     }
       }
   
       /**
        * Returns the color of the outline of the selection overlay.
        */
       public Color getSelectionOverlayStrokeColor() {
  -     return textSelectionManager.getSelectionOverlayStrokeColor();
  +     if (textSelectionManager != null) {
  +         return textSelectionManager.getSelectionOverlayStrokeColor();
  +     } else {
  +         throw new IllegalArgumentException("Selection is disabled");
  +     }
       }
   
       /**
  @@ -335,7 +347,9 @@
        * @param state true implies the selection overlay will be in XOR mode 
        */
       public void setSelectionOverlayXORMode(boolean state) {
  -     textSelectionManager.setSelectionOverlayXORMode(state);
  +     if (textSelectionManager != null) {
  +         textSelectionManager.setSelectionOverlayXORMode(state);
  +     }
       }
   
       /**
  @@ -343,7 +357,11 @@
        * otherwise.
        */
       public boolean isSelectionOverlayXORMode() {
  -     return textSelectionManager.isSelectionOverlayXORMode();
  +     if (textSelectionManager != null) {
  +         return textSelectionManager.isSelectionOverlayXORMode();
  +     } else {
  +         throw new IllegalArgumentException("Selection is disabled");
  +     }
       }
   
       /**
  
  
  
  1.14      +2 -1      
xml-batik/sources/org/apache/batik/swing/gvt/TextSelectionManager.java
  
  Index: TextSelectionManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/swing/gvt/TextSelectionManager.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TextSelectionManager.java 2001/10/11 09:35:18     1.13
  +++ TextSelectionManager.java 2001/10/15 09:33:44     1.14
  @@ -36,7 +36,7 @@
    * This class represents an object which manage GVT text nodes selection.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephane Hillion</a>
  - * @version $Id: TextSelectionManager.java,v 1.13 2001/10/11 09:35:18 tkormann Exp $
  + * @version $Id: TextSelectionManager.java,v 1.14 2001/10/15 09:33:44 tkormann Exp $
    */
   public class TextSelectionManager {
   
  @@ -157,6 +157,7 @@
        * @param state true implies the selection overlay will be in XOR mode 
        */
       public void setSelectionOverlayXORMode(boolean state) {
  +     System.out.println("setSelectionOverlayXORMode "+state);
        this.xorMode = state;
       }
   
  
  
  
  1.5       +4 -3      xml-batik/sources/org/apache/batik/util/PreferenceManager.java
  
  Index: PreferenceManager.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/util/PreferenceManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PreferenceManager.java    2001/05/19 05:51:28     1.4
  +++ PreferenceManager.java    2001/10/15 09:33:44     1.5
  @@ -60,7 +60,7 @@
    * </pre></blockquote>
    * <p>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Christophe Jolif</a>
  - * @version $Id: PreferenceManager.java,v 1.4 2001/05/19 05:51:28 vhardy Exp $
  + * @version $Id: PreferenceManager.java,v 1.5 2001/10/15 09:33:44 tkormann Exp $
    */
   public class PreferenceManager
   {
  @@ -831,9 +831,10 @@
       public void setBoolean(String key, boolean value)
       {
           if (getDefault(key) != null &&
  -            ((Boolean)getDefault(key)).booleanValue() != value)
  +            ((Boolean)getDefault(key)).booleanValue() != value) {
               internal.setProperty(key, value?"true":"false");
  -        else
  +     } else {
               internal.remove(key);
  +     }
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to