jdk/src/share/classes/javax/swing/plaf/metal/MetalTreeUI.java
author malenkov
Tue, 29 Oct 2013 17:01:06 +0400
changeset 21278 ef8a3a2a72f2
parent 20451 4cedf4e1560a
child 23010 6dadb192ad81
permissions -rw-r--r--
8022746: List of spelling errors in API doc Reviewed-by: alexsch, smarks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.swing.plaf.metal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import javax.swing.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.swing.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.awt.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.beans.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.swing.plaf.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.swing.tree.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import javax.swing.plaf.basic.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * The metal look and feel implementation of <code>TreeUI</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * <code>MetalTreeUI</code> allows for configuring how to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * visually render the spacing and delineation between nodes. The following
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * hints are supported:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <table summary="Descriptions of supported hints: Angled, Horizontal, and None">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 *  <tr>
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 5506
diff changeset
    49
 *    <th><p style="text-align:left">Angled</p></th>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 *    <td>A line is drawn connecting the child to the parent. For handling
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *          of the root node refer to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *          {@link javax.swing.JTree#setRootVisible} and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *          {@link javax.swing.JTree#setShowsRootHandles}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *    </td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 *  </tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *  <tr>
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 5506
diff changeset
    57
 *     <th><p style="text-align:left">Horizontal</p></th>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *     <td>A horizontal line is drawn dividing the children of the root node.</td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *  </tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 *  <tr>
20451
4cedf4e1560a 8025409: Fix javadoc comments errors and warning reported by doclint report
cl
parents: 5506
diff changeset
    61
 *      <th><p style="text-align:left">None</p></th>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 *      <td>Do not draw any visual indication between nodes.</td>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 *  </tr>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * </table>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * <p>
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 20451
diff changeset
    67
 * As it is typically impractical to obtain the <code>TreeUI</code> from
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * the <code>JTree</code> and cast to an instance of <code>MetalTreeUI</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * you enable this property via the client property
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * <code>JTree.lineStyle</code>. For example, to switch to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * <code>Horizontal</code> style you would do:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * <code>tree.putClientProperty("JTree.lineStyle", "Horizontal");</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * The default is <code>Angled</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * @author Tom Santos
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * @author Steve Wilson (value add stuff)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
public class MetalTreeUI extends BasicTreeUI {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    private static Color lineColor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    private static final String LINE_STYLE = "JTree.lineStyle";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    private static final String LEG_LINE_STYLE_STRING = "Angled";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    private static final String HORIZ_STYLE_STRING = "Horizontal";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    private static final String NO_STYLE_STRING = "None";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    private static final int LEG_LINE_STYLE = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    private static final int HORIZ_LINE_STYLE = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    private static final int NO_LINE_STYLE = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    private int lineStyle = LEG_LINE_STYLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    private PropertyChangeListener lineStyleListener = new LineListener();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    // Boilerplate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    public static ComponentUI createUI(JComponent x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        return new MetalTreeUI();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    public MetalTreeUI()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    protected int getHorizontalLegBuffer()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
      {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
          return 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    public void installUI( JComponent c ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        super.installUI( c );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        lineColor = UIManager.getColor( "Tree.line" );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        Object lineStyleFlag = c.getClientProperty( LINE_STYLE );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        decodeLineStyle(lineStyleFlag);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        c.addPropertyChangeListener(lineStyleListener);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    public void uninstallUI( JComponent c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
         c.removePropertyChangeListener(lineStyleListener);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
         super.uninstallUI(c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    /** this function converts between the string passed into the client property
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
      * and the internal representation (currently and int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    protected void decodeLineStyle(Object lineStyleFlag) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
      if ( lineStyleFlag == null ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                    lineStyleFlag.equals(LEG_LINE_STYLE_STRING)){
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        lineStyle = LEG_LINE_STYLE; // default case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
      } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
          if ( lineStyleFlag.equals(NO_STYLE_STRING) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
              lineStyle = NO_LINE_STYLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
          } else if ( lineStyleFlag.equals(HORIZ_STYLE_STRING) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
              lineStyle = HORIZ_LINE_STYLE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
          }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
      }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    protected boolean isLocationInExpandControl(int row, int rowLevel,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                                                int mouseX, int mouseY) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        if(tree != null && !isLeaf(row)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            int                     boxWidth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
            if(getExpandedIcon() != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                boxWidth = getExpandedIcon().getIconWidth() + 6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
            else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                boxWidth = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            Insets i = tree.getInsets();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            int    boxLeftX = (i != null) ? i.left : 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            boxLeftX += (((rowLevel + depthOffset - 1) * totalChildIndent) +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
                        getLeftChildIndent()) - boxWidth/2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            int boxRightX = boxLeftX + boxWidth;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            return mouseX >= boxLeftX && mouseX <= boxRightX;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    public void paint(Graphics g, JComponent c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        super.paint( g, c );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        // Paint the lines
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        if (lineStyle == HORIZ_LINE_STYLE && !largeModel) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            paintHorizontalSeparators(g,c);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    protected void paintHorizontalSeparators(Graphics g, JComponent c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        g.setColor( lineColor );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        Rectangle clipBounds = g.getClipBounds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        int beginRow = getRowForPath(tree, getClosestPathForLocation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                                     (tree, 0, clipBounds.y));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        int endRow = getRowForPath(tree, getClosestPathForLocation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                             (tree, 0, clipBounds.y + clipBounds.height - 1));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        if ( beginRow <= -1 || endRow <= -1 ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        for ( int i = beginRow; i <= endRow; ++i ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
            TreePath        path = getPathForRow(tree, i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            if(path != null && path.getPathCount() == 2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                Rectangle       rowBounds = getPathBounds(tree,getPathForRow
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
                                                          (tree, i));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                // Draw a line at the top
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                if(rowBounds != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                    g.drawLine(clipBounds.x, rowBounds.y,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                               clipBounds.x + clipBounds.width, rowBounds.y);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                                          Insets insets, TreePath path) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        if (lineStyle == LEG_LINE_STYLE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            super.paintVerticalPartOfLeg(g, clipBounds, insets, path);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                                            Insets insets, Rectangle bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                                            TreePath path, int row,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                                            boolean isExpanded,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                                            boolean hasBeenExpanded, boolean
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                                            isLeaf) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        if (lineStyle == LEG_LINE_STYLE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            super.paintHorizontalPartOfLeg(g, clipBounds, insets, bounds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                                           path, row, isExpanded,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                                           hasBeenExpanded, isLeaf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    /** This class listens for changes in line style */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    class LineListener implements PropertyChangeListener {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        public void propertyChange(PropertyChangeEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
            String name = e.getPropertyName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
            if ( name.equals( LINE_STYLE ) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                decodeLineStyle(e.getNewValue());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    } // end class PaletteListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
}