Statistics
| Revision:

root / trunk / extensions / extGraph_predes / src / com / iver / cit / gvsig / gvsig / gui / styling / SymbolSelector.java @ 8458

History | View | Annotate | Download (18.8 KB)

1
/*
2
 * Created on 26-abr-2005
3
 *
4
 * gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
5
 *
6
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
7
 *
8
 * This program is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU General Public License
10
 * as published by the Free Software Foundation; either version 2
11
 * of the License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21
 *
22
 * For more information, contact:
23
 *
24
 *  Generalitat Valenciana
25
 *   Conselleria d'Infraestructures i Transport
26
 *   Av. Blasco Ib??ez, 50
27
 *   46010 VALENCIA
28
 *   SPAIN
29
 *
30
 *      +34 963862235
31
 *   gvsig@gva.es
32
 *      www.gvsig.gva.es
33
 *
34
 *    or
35
 *
36
 *   IVER T.I. S.A
37
 *   Salamanca 50
38
 *   46005 Valencia
39
 *   Spain
40
 *
41
 *   +34 963163400
42
 *   dac@iver.es
43
 */
44
package com.iver.cit.gvsig.gvsig.gui.styling;
45

    
46
import java.awt.BorderLayout;
47
import java.awt.Color;
48
import java.awt.Component;
49
import java.awt.Dimension;
50
import java.awt.FlowLayout;
51
import java.awt.Font;
52
import java.awt.GridLayout;
53
import java.awt.event.ActionEvent;
54
import java.awt.event.ActionListener;
55
import java.io.File;
56
import java.io.FileFilter;
57
import java.io.FileWriter;
58

    
59
import javax.swing.BorderFactory;
60
import javax.swing.BoxLayout;
61
import javax.swing.JComponent;
62
import javax.swing.JFileChooser;
63
import javax.swing.JLabel;
64
import javax.swing.JList;
65
import javax.swing.JOptionPane;
66
import javax.swing.JPanel;
67
import javax.swing.JScrollPane;
68
import javax.swing.JSplitPane;
69
import javax.swing.JTree;
70
import javax.swing.ListCellRenderer;
71
import javax.swing.event.ListSelectionEvent;
72
import javax.swing.event.ListSelectionListener;
73
import javax.swing.event.TreeModelListener;
74
import javax.swing.tree.TreeModel;
75
import javax.swing.tree.TreePath;
76

    
77
import org.exolab.castor.xml.Marshaller;
78
import org.gvsig.gui.beans.AcceptCancelPanel;
79
import org.gvsig.gui.beans.swing.GridBagLayoutPanel;
80
import org.gvsig.gui.beans.swing.JButton;
81

    
82
import com.iver.andami.PluginServices;
83
import com.iver.andami.messages.NotificationManager;
84
import com.iver.andami.ui.mdiManager.IWindow;
85
import com.iver.andami.ui.mdiManager.WindowInfo;
86
import com.iver.cit.gvsig.fmap.core.FShape;
87
import com.iver.cit.gvsig.fmap.core.ISymbol;
88
import com.iver.cit.gvsig.gui.panels.ColorChooserPanel;
89
import com.iver.utiles.StringUtilities;
90
import com.iver.utiles.XMLEntity;
91

    
92
import de.ios.framework.swing.JDecimalField;
93
import de.ios.framework.swing.JNumberField;
94

    
95
/**
96
 * @author jaume dominguez faus - jaume.dominguez@iver.es
97
 */
98
public class SymbolSelector extends JPanel implements IWindow{
99

    
100
    private JTree treeFamilies = null;
101
    private JList jListSymbols = null;
102
    private JPanel jPanel = null;
103
    private JScrollPane jScrollPane = null;
104
    private JScrollPane jScrollPane1 = null;
105
    private SymbolPreview jPanelPreview = null;
106
    private GridBagLayoutPanel jPanelOptions = null;
107
        private WindowInfo wi;
108
        private JSplitPane jSplitPane = null;
109
        private File symbolDir;
110
        private AcceptCancelPanel okCancelPanel;
111
        private ISymbol selectedSymbol = null;
112
        private JPanel northPanel;
113
        private ColorChooserPanel jcc1;
114
        private ColorChooserPanel jcc2;
115
        private JNumberField txtSize;
116
        private JDecimalField txtAngle;
117
        private JPanel jPanelButtons;
118
        private JButton btnProperties;
119
        private int shapeType;
120
        private JButton btnSaveSymbol;
121
        private JButton btnResetSymbol;
122
        private ActionListener buttonListener = new MyButtonListener();
123
    /**
124
     * This method initializes
125
     *
126
     */
127
    public SymbolSelector(ISymbol symbol, int shapeType) {
128
            super();
129
            this.selectedSymbol = symbol;
130
            this.shapeType = shapeType;
131
            symbolDir = new File(getClass().
132
                                  getClassLoader().
133
                                  getResource("symbols").
134
                                  getFile());
135
            initialize();
136
    }
137

    
138
    /**
139
     * This method initializes this
140
     *
141
     */
142
    private void initialize() {
143

    
144
        this.setLayout(new BorderLayout());
145
        this.setSize(400, 221);
146

    
147
        this.add(getJNorthPanel(), BorderLayout.NORTH);
148
        this.add(getJSplitPane(), BorderLayout.CENTER);
149
        this.add(getJEastPanel(), BorderLayout.EAST);
150
        ActionListener okAction = new ActionListener() {
151
                    public void actionPerformed(ActionEvent e) {
152
                            PluginServices.getMDIManager().closeWindow(SymbolSelector.this);
153
                    }
154
            }, cancelAction = new ActionListener() {
155
                    public void actionPerformed(ActionEvent e) {
156
                            setSymbol(null);
157
                            PluginServices.getMDIManager().closeWindow(SymbolSelector.this);
158
                    }
159
            };
160

    
161
        okCancelPanel = new AcceptCancelPanel(okAction, cancelAction);
162

    
163

    
164
        this.add(okCancelPanel, BorderLayout.SOUTH);
165
    }
166

    
167
    private JPanel getJNorthPanel() throws IllegalArgumentException {
168
                if (northPanel == null) {
169
                        String text = "";
170
                        switch (shapeType) {
171
                        case FShape.POINT:
172
                                text = PluginServices.getText(this, "point_symbols");
173
                                break;
174
                        case FShape.LINE:
175
                                text = PluginServices.getText(this, "line_symbols");
176
                                break;
177
                        case FShape.POLYGON:
178
                                text = PluginServices.getText(this, "polygon_symbols");
179
                                break;
180
                        default:
181
                                throw new IllegalArgumentException(PluginServices.getText(this, "shape_type_not_yet_supported"));
182
                        }
183
                        northPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
184
                        JLabel lbl = new JLabel(text);
185
                        lbl.setFont(lbl.getFont().deriveFont(Font.BOLD));
186
                        northPanel.add(lbl);
187
                }
188
                return northPanel;
189
        }
190

    
191
        /**
192
     * This method initializes jList
193
     *
194
     * @return javax.swing.JList
195
     */
196
    private JTree getJListFav() {
197
            if (treeFamilies == null) {
198
                    treeFamilies = new JTree();
199
                    treeFamilies.setPreferredSize(new java.awt.Dimension(70,100));
200
                    try {
201
                            treeFamilies.setModel(new TreeModel() {
202
                                    final class MyFile extends File {
203
                                            public MyFile(String pathname) {
204
                                                    super(pathname);
205
                                            }
206

    
207
                                            public String toString() {
208
                                                    if (this.equals(root))
209
                                                            return PluginServices.getText(this, "symbol_library");
210
                                                    String path = getAbsolutePath();
211
                                                    String prefixToRemove = symbolDir.getAbsolutePath();
212
                                                    path = path.substring(prefixToRemove.length()+1, path.length());
213
                                                    return path;
214
                                            }
215
                                    };
216
                                    MyFile root = new MyFile(symbolDir.getAbsolutePath());
217

    
218
                                    private FileFilter ff = new FileFilter() {
219
                                            public boolean accept(File pathname) {
220
                                                    return pathname.isDirectory();
221
                                            }
222
                                    };
223

    
224
                                    public Object getRoot() {
225
                                            return root;
226
                                    }
227

    
228
                                    public int getChildCount(Object parent) {
229
                                            return ((File) parent).listFiles(ff).length;
230
                                    }
231

    
232
                                    public boolean isLeaf(Object node) {
233
                                            return getChildCount(node)==0;
234
                                    }
235

    
236
                                    public void addTreeModelListener(TreeModelListener l) {
237
                                            // TODO Auto-generated method stub
238

    
239
                                    }
240

    
241
                                    public void removeTreeModelListener(TreeModelListener l) {
242
                                            // TODO Auto-generated method stub
243

    
244
                                    }
245

    
246
                                    public Object getChild(Object parent, int index) {
247
                                            return new MyFile(((File) parent).listFiles(ff)[index].getAbsolutePath());
248
                                    }
249

    
250
                                    public int getIndexOfChild(Object parent, Object child) {
251
                                            if (parent == null)
252
                                                    return -1;
253
                                            File[] files = ((File) parent).listFiles(ff);
254
                                            for (int i = 0; i < files.length; i++) {
255
                                                    if (files[i].equals((File) child))
256
                                                            return i;
257
                                            }
258
                                            return -1;
259
                                    }
260

    
261
                                    public void valueForPathChanged(TreePath path, Object newValue) {
262
                                            // TODO Auto-generated method stub
263
                                    }
264

    
265
                            });
266
                            treeFamilies.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
267
                                        public void valueChanged(javax.swing.event.TreeSelectionEvent e) {
268
                                                 File node = (File)
269
                               treeFamilies.getLastSelectedPathComponent();
270

    
271
                                                         if (node == null) return;
272
                                                         jListSymbols.setModel(
273
                                                                  new SymbolSelectorListModel(node));
274
                                        }
275
                                });
276
                    } catch ( ExceptionInInitializerError ex ) {
277
                            JOptionPane.showMessageDialog(this, PluginServices.getText(this, "could_not_find_symbol_directory"));
278
                    }
279
            }
280
            return treeFamilies;
281
    }
282

    
283
    /**
284
     * This method initializes jList
285
     *
286
     * @return javax.swing.JList
287
     */
288
    private JList getJListSymbols() {
289
            if (jListSymbols == null) {
290
                    jListSymbols = new JList();
291
                    jListSymbols.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
292
            jListSymbols.setLayoutOrientation(JList.HORIZONTAL_WRAP);
293
            jListSymbols.setVisibleRowCount(-1);
294
            jListSymbols.addListSelectionListener(new ListSelectionListener() {
295
                    public void valueChanged(ListSelectionEvent e) {
296
                            setSymbol((ISymbol) jListSymbols.getSelectedValue());
297
                            updateOptionsPanel();
298
                    }
299
            });
300
            ListCellRenderer renderer = new ListCellRenderer() {
301
                        private Color mySelectedBGColor = new Color(255,145,100,255);
302
                            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
303
                                    ISymbol sym = (ISymbol) value;
304
                                    JPanel pnl = new JPanel();
305
                                    BoxLayout layout = new BoxLayout(pnl, BoxLayout.Y_AXIS);
306
                                    pnl.setLayout(layout);
307
                                    Color bgColor = (isSelected) ? mySelectedBGColor
308
                                                             : getJListSymbols().getBackground();
309

    
310
                                    pnl.setBackground(bgColor);
311
                                    SymbolPreview sp = new SymbolPreview();
312
                                    sp.setAlignmentX(Component.CENTER_ALIGNMENT);
313
                                    sp.setPreferredSize(new Dimension(50, 50));
314
                                    sp.setSymbol(sym);
315
                                    sp.setBackground(bgColor);
316
                                    pnl.add(sp);
317
                                    JLabel lbl = new JLabel(sym.getDescription());
318
                                    lbl.setBackground(bgColor);
319
                                    lbl.setAlignmentX(Component.CENTER_ALIGNMENT);
320
                                    pnl.add(lbl);
321

    
322
                                    return pnl;
323
                            }
324

    
325
                };
326
                jListSymbols.setCellRenderer(renderer);
327
            }
328
            return jListSymbols;
329
    }
330

    
331
    protected void updateOptionsPanel() {
332
            ISymbol sym = ((ISymbol) jListSymbols.getSelectedValue());
333
            if (sym == null)
334
                    return;
335

    
336
                XMLEntity xml = sym.getXMLEntity();
337

    
338
                Color c = null;
339
            if (xml.contains("color")) {
340
                    c = StringUtilities.string2Color(xml.getStringProperty("color"));
341
            }
342
                jcc1.setColor(c);
343

    
344
                if (jcc2 == null)
345
                        return;
346
                if (xml.contains("outline")) {
347
                    c = StringUtilities.string2Color(xml.getStringProperty("outline"));
348
                    jcc2.setEnabled(true);
349
                    jcc2.setColor(c);
350
            } else {
351
                    jcc2.setEnabled(false);
352
            }
353

    
354

    
355
        }
356

    
357
        /**
358
     * This method initializes jPanel
359
     *
360
     * @return javax.swing.JPanel
361
     */
362
    private JPanel getJEastPanel() {
363
            if (jPanel == null) {
364
                    jPanel = new JPanel();
365
                    jPanel.setLayout(new BorderLayout());
366
                    jPanel.add(getJPanelOptions(), BorderLayout.CENTER);
367
                    JPanel aux = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 5));
368
                    aux.setBorder(BorderFactory.createTitledBorder(null, PluginServices.getText(this, "preview")));
369
                    aux.add(getJPanelPreview());
370
                    jPanel.add(aux, BorderLayout.NORTH);
371

    
372
                    aux = new JPanel(new FlowLayout(FlowLayout.LEADING, 5, 5));
373
                    aux.setBorder(BorderFactory.createTitledBorder(null, PluginServices.getText(this, "options")));
374
                    aux.add(getJPanelOptions());
375
                    jPanel.add(aux, BorderLayout.CENTER);
376
                    aux = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 5));
377
                    aux.add(getJPanelButtons());
378
                    jPanel.add(aux, BorderLayout.SOUTH);
379
            }
380
            return jPanel;
381
    }
382

    
383
    private JPanel getJPanelButtons() {
384
                if (jPanelButtons == null) {
385
                        jPanelButtons = new JPanel();
386
                        GridLayout layout = new GridLayout();
387
                        layout.setColumns(1);
388
                        layout.setVgap(5);
389
                        jPanelButtons.add(getBtnSaveSymbol());
390
                        jPanelButtons.add(getBtnResetSymbol());
391
                        jPanelButtons.add(getBtnProperties());
392

    
393
                        // do not add components bellow this line!
394
                        layout.setRows(jPanelButtons.getComponentCount());
395
                        jPanelButtons.setLayout(layout);
396
                }
397
                return jPanelButtons;
398
        }
399

    
400
        private JButton getBtnResetSymbol() {
401
                if (btnResetSymbol == null) {
402
                        btnResetSymbol = new JButton();
403
                        btnResetSymbol.setName("btnResetSymbol");
404
                        btnResetSymbol.setText(PluginServices.getText(this, "reset"));
405
                        btnResetSymbol.addActionListener(buttonListener);
406
                }
407
                return btnResetSymbol;
408
        }
409

    
410
        private JButton getBtnSaveSymbol() {
411
                if (btnSaveSymbol == null) {
412
                        btnSaveSymbol = new JButton();
413
                        btnSaveSymbol.setName("btnSaveSymbol");
414
                        btnSaveSymbol.setText(PluginServices.getText(this, "save"));
415
                        btnSaveSymbol.addActionListener(buttonListener);
416
                }
417
                return btnSaveSymbol;
418
        }
419

    
420
        private JButton getBtnProperties() {
421
                if (btnProperties == null) {
422
                        btnProperties = new JButton();
423
                        btnProperties.setName("btnProperties");
424
                        btnProperties.setText(PluginServices.getText(this, "properties"));
425
                        btnProperties.addActionListener(buttonListener);
426
                }
427
                return btnProperties;
428
        }
429

    
430
        /**
431
     * This method initializes jScrollPane
432
     *
433
     * @return javax.swing.JScrollPane
434
     */
435
    private JScrollPane getJScrollPane() {
436
            if (jScrollPane == null) {
437
                    jScrollPane = new JScrollPane();
438
                    jScrollPane.setPreferredSize(new java.awt.Dimension(80,130));
439
                    jScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
440
                    jScrollPane.setViewportView(getJListFav());
441
            }
442
            return jScrollPane;
443
    }
444

    
445
    /**
446
     * This method initializes jScrollPane1
447
     *
448
     * @return javax.swing.JScrollPane
449
     */
450
    private JScrollPane getJScrollPane1() {
451
            if (jScrollPane1 == null) {
452
                    jScrollPane1 = new JScrollPane();
453
                    jScrollPane1.setViewportView(getJListSymbols());
454
            }
455
            return jScrollPane1;
456
    }
457

    
458
    /**
459
     * This method initializes jPanel1
460
     *
461
     * @return javax.swing.JPanel
462
     */
463
    private SymbolPreview getJPanelPreview() {
464
            if (jPanelPreview == null) {
465
                    jPanelPreview = new SymbolPreview();
466
                    jPanelPreview.setPreferredSize(new java.awt.Dimension(100,100));
467
                    jPanelPreview.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
468
            }
469
            return jPanelPreview;
470
    }
471

    
472
    /**
473
     * This method initializes jPanel1
474
     *
475
     * @return javax.swing.JPanel
476
     */
477
    private JPanel getJPanelOptions() {
478
            if (jPanelOptions == null) {
479
                    jPanelOptions = new GridBagLayoutPanel();
480

    
481
                    jcc1 = new ColorChooserPanel();
482
                    jcc2 = new ColorChooserPanel();
483
                    jcc1.setAlpha(255);
484
                    jcc2.setAlpha(255);
485
                    jcc1.addActionListener(buttonListener);
486
                    jcc2.addActionListener(buttonListener);
487
                    if (shapeType == FShape.POINT) {
488
                            jPanelOptions.addComponent(
489
                                            PluginServices.getText(this, "color")+":", jcc1);
490
                            jPanelOptions.addComponent(
491
                                            PluginServices.getText(this, "size")+":",
492
                                            txtSize = new JNumberField());
493
                            jPanelOptions.addComponent(
494
                                            PluginServices.getText(this, "angle")+":",
495
                                            txtAngle = new JDecimalField());
496
                    } else if (shapeType == FShape.LINE) {
497
                            jPanelOptions.addComponent(
498
                                            PluginServices.getText(this, "color")+":", jcc1);
499
                            jPanelOptions.addComponent(
500
                                            PluginServices.getText(this, "width")+":",
501
                                            txtSize = new JNumberField());
502
                            jPanelOptions.addComponent(new JLabel("AQUI VA EL COMBO DE PATTERN DE LINEA"));
503
                    } else if (shapeType == FShape.POLYGON) {
504
                            jPanelOptions.addComponent(
505
                                            PluginServices.getText(this, "fill_color")+":", jcc1);
506
                            jPanelOptions.addComponent(
507
                                            PluginServices.getText(this, "outline_color")+":", jcc2);
508
                            jPanelOptions.addComponent(
509
                                            new JLabel("AQUI VA EL ANCHO DEL CONTORNO"));
510
                    }
511
            }
512
            return jPanelOptions;
513
    }
514

    
515
        public WindowInfo getWindowInfo() {
516
                if (wi == null) {
517
                        wi = new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
518
                        wi.setWidth(706);
519
                        wi.setHeight(500);
520
                        wi.setTitle(PluginServices.getText(this, "symbol_selector"));
521
                }
522
                return wi;
523
        }
524

    
525
        /**
526
         * This method initializes jSplitPane
527
         *
528
         * @return javax.swing.JSplitPane
529
         */
530
        private JSplitPane getJSplitPane() {
531
                if (jSplitPane == null) {
532
                        jSplitPane = new JSplitPane();
533
                        jSplitPane.setDividerLocation(200);
534
                        jSplitPane.setResizeWeight(0.4);
535
                jSplitPane.setLeftComponent(getJScrollPane());
536
                jSplitPane.setRightComponent(getJScrollPane1());
537
                }
538
                return jSplitPane;
539
        }
540

    
541
        /**
542
         * Returns the symbol selected by the user or null if none
543
         * @return
544
         */
545
        public ISymbol getSymbol() {
546
                return selectedSymbol;
547
        }
548

    
549
        private void setSymbol(ISymbol symbol) {
550
                selectedSymbol = symbol;
551
                jPanelPreview.setSymbol(symbol);
552
        }
553

    
554

    
555
        private class MyButtonListener implements ActionListener {
556
                public void actionPerformed(ActionEvent e) {
557
                        if (selectedSymbol ==null)
558
                                return;
559

    
560
                        JComponent comp = (JComponent) e.getSource();
561
                        XMLEntity xml = null;
562
                        if (selectedSymbol != null)
563
                                xml = selectedSymbol.getXMLEntity();
564

    
565

    
566
                        if ( comp.equals(getBtnProperties()) ) {
567
                                // properties pressed
568
                                SymbolEditor se = new SymbolEditor(selectedSymbol, shapeType);
569
                                PluginServices.getMDIManager().addWindow(se);
570
                                setSymbol(se.getSymbol());
571
                        } else if ( comp.equals(getBtnResetSymbol()) ) {
572
                                // reset pressed
573
                                setSymbol(null);
574
                        } else if ( comp.equals(getBtnSaveSymbol()) ) {
575
                                // save pressed
576
                                JFileChooser jfc = new JFileChooser(SymbolSelectorListModel.SYMBOL_DIRECTORY);
577
                                javax.swing.filechooser.FileFilter ff = new javax.swing.filechooser.FileFilter() {
578
                                        public boolean accept(File f) {
579
                                                return f.getAbsolutePath().
580
                                                toLowerCase().
581
                                                endsWith(SymbolSelectorListModel.
582
                                                                SYMBOL_FILE_EXTENSION);
583
                                        }
584

    
585
                                        public String getDescription() {
586
                                                return PluginServices.getText(
587
                                                                this, "gvSIG_symbol_definition_file")+ " (*.sym)";
588
                                        }
589
                                };
590
                                jfc.setFileFilter(ff);
591
                                if (jfc.showSaveDialog(SymbolSelector.this) == JFileChooser.APPROVE_OPTION) {
592
                                        File targetFile = jfc.getSelectedFile();
593
                                        String fExtension = SymbolSelectorListModel.SYMBOL_FILE_EXTENSION;
594
                                        if (!targetFile.
595
                                                        getAbsolutePath().
596
                                                        toLowerCase().
597
                                                        endsWith(fExtension))
598
                                                targetFile = new File(targetFile.getAbsolutePath() + fExtension);
599
                                        FileWriter writer;
600
                                        try {
601
                                                writer = new FileWriter(targetFile.getAbsolutePath());
602
                                                Marshaller m = new Marshaller(writer);
603
                                                m.setEncoding("ISO-8859-1");
604
                                                m.marshal(xml.getXmlTag());
605

    
606
                                        } catch (Exception ex) {
607
                                                NotificationManager.addError(
608
                                                                PluginServices.getText(this, "save_error"), ex);
609
                                        }
610
                                }
611
                        } else if (comp.equals(jcc1) && xml != null) {
612
                                xml.putProperty("color", StringUtilities.color2String(jcc1.getColor()));
613
                        } else if (comp.equals(jcc2) && xml != null) {
614
                                xml.putProperty("outline", StringUtilities.color2String(jcc2.getColor()));
615
                        }
616

    
617
                        SymbolSelector.this.repaint();
618
                }
619
        }
620
}  //  @jve:decl-index=0:visual-constraint="10,10"