KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > chart > editor > DefaultPlotEditor


1 /* ===========================================================
2  * JFreeChart : a free chart library for the Java(tm) platform
3  * ===========================================================
4  *
5  * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
6  *
7  * Project Info: http://www.jfree.org/jfreechart/index.html
8  *
9  * This library is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  * License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22  * USA.
23  *
24  * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
25  * in the United States and other countries.]
26  *
27  * ----------------------
28  * DefaultPlotEditor.java
29  * ----------------------
30  * (C) Copyright 2005, by Object Refinery Limited and Contributors.
31  *
32  * Original Author: David Gilbert (for Object Refinery Limited);
33  * Contributor(s): Andrzej Porebski;
34  * Arnaud Lelievre;
35  * Daniel Gredler;
36  *
37  * $Id: DefaultPlotEditor.java,v 1.1.2.1 2005/11/24 16:11:48 mungady Exp $
38  *
39  * Changes:
40  * --------
41  * 24-Nov-2005 : Version 1, based on PlotPropertyEditPanel.java (DG);
42  *
43  */

44
45 package org.jfree.chart.editor;
46
47 import java.awt.BasicStroke JavaDoc;
48 import java.awt.BorderLayout JavaDoc;
49 import java.awt.Color JavaDoc;
50 import java.awt.Paint JavaDoc;
51 import java.awt.Stroke JavaDoc;
52 import java.awt.event.ActionEvent JavaDoc;
53 import java.awt.event.ActionListener JavaDoc;
54 import java.util.ResourceBundle JavaDoc;
55
56 import javax.swing.BorderFactory JavaDoc;
57 import javax.swing.JButton JavaDoc;
58 import javax.swing.JCheckBox JavaDoc;
59 import javax.swing.JColorChooser JavaDoc;
60 import javax.swing.JComboBox JavaDoc;
61 import javax.swing.JLabel JavaDoc;
62 import javax.swing.JOptionPane JavaDoc;
63 import javax.swing.JPanel JavaDoc;
64 import javax.swing.JTabbedPane JavaDoc;
65
66 import org.jfree.chart.axis.Axis;
67 import org.jfree.chart.axis.ColorBar;
68 import org.jfree.chart.plot.CategoryPlot;
69 import org.jfree.chart.plot.ContourPlot;
70 import org.jfree.chart.plot.Plot;
71 import org.jfree.chart.plot.PlotOrientation;
72 import org.jfree.chart.plot.XYPlot;
73 import org.jfree.chart.renderer.category.CategoryItemRenderer;
74 import org.jfree.chart.renderer.category.LineAndShapeRenderer;
75 import org.jfree.chart.renderer.xy.StandardXYItemRenderer;
76 import org.jfree.chart.renderer.xy.XYItemRenderer;
77 import org.jfree.layout.LCBLayout;
78 import org.jfree.ui.PaintSample;
79 import org.jfree.ui.RectangleInsets;
80 import org.jfree.ui.StrokeChooserPanel;
81 import org.jfree.ui.StrokeSample;
82 import org.jfree.util.BooleanUtilities;
83
84 /**
85  * A panel for editing the properties of a {@link Plot}.
86  */

87 class DefaultPlotEditor extends JPanel JavaDoc implements ActionListener JavaDoc {
88
89     /** Orientation constants. */
90     private final static String JavaDoc[] orientationNames = {"Vertical", "Horizontal"};
91     private final static int ORIENTATION_VERTICAL = 0;
92     private final static int ORIENTATION_HORIZONTAL = 1;
93
94     /** The paint (color) used to fill the background of the plot. */
95     private PaintSample backgroundPaintSample;
96
97     /** The stroke (pen) used to draw the outline of the plot. */
98     private StrokeSample outlineStrokeSample;
99
100     /** The paint (color) used to draw the outline of the plot. */
101     private PaintSample outlinePaintSample;
102
103     /**
104      * A panel used to display/edit the properties of the domain axis (if any).
105      */

106     private DefaultAxisEditor domainAxisPropertyPanel;
107
108     /**
109      * A panel used to display/edit the properties of the range axis (if any).
110      */

111     private DefaultAxisEditor rangeAxisPropertyPanel;
112
113     /**
114      * A panel used to display/edit the properties of the colorbar axis (if
115      * any).
116      */

117     private DefaultColorBarEditor colorBarAxisPropertyPanel;
118
119     /** An array of stroke samples to choose from. */
120     private StrokeSample[] availableStrokeSamples;
121
122     /** The insets for the plot. */
123     private RectangleInsets plotInsets;
124
125     /**
126      * The orientation for the plot (for <tt>CategoryPlot</tt>s and
127      * <tt>XYPlot</tt>s).
128      */

129     private PlotOrientation plotOrientation;
130
131     /**
132      * The orientation combo box (for <tt>CategoryPlot</tt>s and
133      * <tt>XYPlot</tt>s).
134      */

135     private JComboBox JavaDoc orientationCombo;
136
137     /** Whether or not to draw lines between each data point (for
138      * <tt>LineAndShapeRenderer</tt>s and <tt>StandardXYItemRenderer</tt>s).
139      */

140     private Boolean JavaDoc drawLines;
141
142     /**
143      * The checkbox for whether or not to draw lines between each data point.
144      */

145     private JCheckBox JavaDoc drawLinesCheckBox;
146
147     /** Whether or not to draw shapes at each data point (for
148      * <tt>LineAndShapeRenderer</tt>s and <tt>StandardXYItemRenderer</tt>s).
149      */

150     private Boolean JavaDoc drawShapes;
151
152     /**
153      * The checkbox for whether or not to draw shapes at each data point.
154      */

155     private JCheckBox JavaDoc drawShapesCheckBox;
156
157     /** The resourceBundle for the localization. */
158     protected static ResourceBundle JavaDoc localizationResources
159         = ResourceBundle.getBundle("org.jfree.chart.editor.LocalizationBundle");
160
161     /**
162      * Standard constructor - constructs a panel for editing the properties of
163      * the specified plot.
164      * <P>
165      * In designing the panel, we need to be aware that subclasses of Plot will
166      * need to implement subclasses of PlotPropertyEditPanel - so we need to
167      * leave one or two 'slots' where the subclasses can extend the user
168      * interface.
169      *
170      * @param plot the plot, which should be changed.
171      */

172     public DefaultPlotEditor(Plot plot) {
173
174         this.plotInsets = plot.getInsets();
175         this.backgroundPaintSample = new PaintSample(plot.getBackgroundPaint());
176         this.outlineStrokeSample = new StrokeSample(plot.getOutlineStroke());
177         this.outlinePaintSample = new PaintSample(plot.getOutlinePaint());
178         if (plot instanceof CategoryPlot) {
179             this.plotOrientation = ((CategoryPlot) plot).getOrientation();
180         }
181         else if (plot instanceof XYPlot) {
182             this.plotOrientation = ((XYPlot) plot).getOrientation();
183         }
184         if (plot instanceof CategoryPlot) {
185             CategoryItemRenderer renderer = ((CategoryPlot) plot).getRenderer();
186             if (renderer instanceof LineAndShapeRenderer) {
187                 LineAndShapeRenderer r = (LineAndShapeRenderer) renderer;
188                 this.drawLines
189                     = BooleanUtilities.valueOf(r.getBaseLinesVisible());
190                 this.drawShapes
191                     = BooleanUtilities.valueOf(r.getBaseShapesVisible());
192             }
193         }
194         else if (plot instanceof XYPlot) {
195             XYItemRenderer renderer = ((XYPlot) plot).getRenderer();
196             if (renderer instanceof StandardXYItemRenderer) {
197                 StandardXYItemRenderer r = (StandardXYItemRenderer) renderer;
198                 this.drawLines = BooleanUtilities.valueOf(r.getPlotLines());
199                 this.drawShapes = BooleanUtilities.valueOf(r.getBaseShapesVisible());
200             }
201         }
202
203         setLayout(new BorderLayout JavaDoc());
204
205         this.availableStrokeSamples = new StrokeSample[3];
206         this.availableStrokeSamples[0]
207             = new StrokeSample(new BasicStroke JavaDoc(1.0f));
208         this.availableStrokeSamples[1]
209             = new StrokeSample(new BasicStroke JavaDoc(2.0f));
210         this.availableStrokeSamples[2]
211             = new StrokeSample(new BasicStroke JavaDoc(3.0f));
212
213         // create a panel for the settings...
214
JPanel JavaDoc panel = new JPanel JavaDoc(new BorderLayout JavaDoc());
215         panel.setBorder(
216             BorderFactory.createTitledBorder(
217                 BorderFactory.createEtchedBorder(),
218                 plot.getPlotType() + localizationResources.getString(":")
219             )
220         );
221
222         JPanel JavaDoc general = new JPanel JavaDoc(new BorderLayout JavaDoc());
223         general.setBorder(
224             BorderFactory.createTitledBorder(
225                 localizationResources.getString("General")
226             )
227         );
228
229         JPanel JavaDoc interior = new JPanel JavaDoc(new LCBLayout(7));
230         interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
231
232 // interior.add(new JLabel(localizationResources.getString("Insets")));
233
// JButton button = new JButton(
234
// localizationResources.getString("Edit...")
235
// );
236
// button.setActionCommand("Insets");
237
// button.addActionListener(this);
238
//
239
// this.insetsTextField = new InsetsTextField(this.plotInsets);
240
// this.insetsTextField.setEnabled(false);
241
// interior.add(this.insetsTextField);
242
// interior.add(button);
243

244         interior.add(
245             new JLabel JavaDoc(localizationResources.getString("Outline_stroke"))
246         );
247         JButton JavaDoc button = new JButton JavaDoc(localizationResources.getString("Select..."));
248         button.setActionCommand("OutlineStroke");
249         button.addActionListener(this);
250         interior.add(this.outlineStrokeSample);
251         interior.add(button);
252
253         interior.add(
254             new JLabel JavaDoc(localizationResources.getString("Outline_Paint"))
255         );
256         button = new JButton JavaDoc(localizationResources.getString("Select..."));
257         button.setActionCommand("OutlinePaint");
258         button.addActionListener(this);
259         interior.add(this.outlinePaintSample);
260         interior.add(button);
261
262         interior.add(
263             new JLabel JavaDoc(localizationResources.getString("Background_paint"))
264         );
265         button = new JButton JavaDoc(localizationResources.getString("Select..."));
266         button.setActionCommand("BackgroundPaint");
267         button.addActionListener(this);
268         interior.add(this.backgroundPaintSample);
269         interior.add(button);
270
271         if (this.plotOrientation != null) {
272             boolean isVertical
273                 = this.plotOrientation.equals(PlotOrientation.VERTICAL);
274             int index
275                 = isVertical ? ORIENTATION_VERTICAL : ORIENTATION_HORIZONTAL;
276             interior.add(
277                 new JLabel JavaDoc(localizationResources.getString("Orientation"))
278             );
279             this.orientationCombo = new JComboBox JavaDoc(orientationNames);
280             this.orientationCombo.setSelectedIndex(index);
281             this.orientationCombo.setActionCommand("Orientation");
282             this.orientationCombo.addActionListener(this);
283             interior.add(new JPanel JavaDoc());
284             interior.add(this.orientationCombo);
285         }
286
287         if (this.drawLines != null) {
288             interior.add(
289                 new JLabel JavaDoc(localizationResources.getString("Draw_lines"))
290             );
291             this.drawLinesCheckBox = new JCheckBox JavaDoc();
292             this.drawLinesCheckBox.setSelected(this.drawLines.booleanValue());
293             this.drawLinesCheckBox.setActionCommand("DrawLines");
294             this.drawLinesCheckBox.addActionListener(this);
295             interior.add(new JPanel JavaDoc());
296             interior.add(this.drawLinesCheckBox);
297         }
298
299         if (this.drawShapes != null) {
300             interior.add(
301                 new JLabel JavaDoc(localizationResources.getString("Draw_shapes"))
302             );
303             this.drawShapesCheckBox = new JCheckBox JavaDoc();
304             this.drawShapesCheckBox.setSelected(this.drawShapes.booleanValue());
305             this.drawShapesCheckBox.setActionCommand("DrawShapes");
306             this.drawShapesCheckBox.addActionListener(this);
307             interior.add(new JPanel JavaDoc());
308             interior.add(this.drawShapesCheckBox);
309         }
310
311         general.add(interior, BorderLayout.NORTH);
312
313         JPanel JavaDoc appearance = new JPanel JavaDoc(new BorderLayout JavaDoc());
314         appearance.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
315         appearance.add(general, BorderLayout.NORTH);
316
317         JTabbedPane JavaDoc tabs = new JTabbedPane JavaDoc();
318         tabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
319
320         Axis domainAxis = null;
321         if (plot instanceof CategoryPlot) {
322             domainAxis = ((CategoryPlot) plot).getDomainAxis();
323         }
324         else if (plot instanceof XYPlot) {
325             domainAxis = ((XYPlot) plot).getDomainAxis();
326         }
327         this.domainAxisPropertyPanel
328             = DefaultAxisEditor.getInstance(domainAxis);
329         if (this.domainAxisPropertyPanel != null) {
330             this.domainAxisPropertyPanel.setBorder(
331                 BorderFactory.createEmptyBorder(2, 2, 2, 2)
332             );
333             tabs.add(
334                 localizationResources.getString("Domain_Axis"),
335                 this.domainAxisPropertyPanel
336             );
337         }
338
339         Axis rangeAxis = null;
340         if (plot instanceof CategoryPlot) {
341             rangeAxis = ((CategoryPlot) plot).getRangeAxis();
342         }
343         else if (plot instanceof XYPlot) {
344             rangeAxis = ((XYPlot) plot).getRangeAxis();
345         }
346
347         this.rangeAxisPropertyPanel
348             = DefaultAxisEditor.getInstance(rangeAxis);
349         if (this.rangeAxisPropertyPanel != null) {
350             this.rangeAxisPropertyPanel.setBorder(
351                 BorderFactory.createEmptyBorder(2, 2, 2, 2)
352             );
353             tabs.add(
354                 localizationResources.getString("Range_Axis"),
355                 this.rangeAxisPropertyPanel
356             );
357         }
358
359 //dmo: added this panel for colorbar control. (start dmo additions)
360
ColorBar colorBar = null;
361         if (plot instanceof ContourPlot) {
362             colorBar = ((ContourPlot) plot).getColorBar();
363         }
364
365         this.colorBarAxisPropertyPanel
366             = DefaultColorBarEditor.getInstance(colorBar);
367         if (this.colorBarAxisPropertyPanel != null) {
368             this.colorBarAxisPropertyPanel.setBorder(
369                 BorderFactory.createEmptyBorder(2, 2, 2, 2)
370             );
371             tabs.add(
372                 localizationResources.getString("Color_Bar"),
373                 this.colorBarAxisPropertyPanel
374             );
375         }
376 //dmo: (end dmo additions)
377

378         tabs.add(localizationResources.getString("Appearance"), appearance);
379         panel.add(tabs);
380
381         add(panel);
382     }
383
384     /**
385      * Returns the current plot insets.
386      *
387      * @return The current plot insets.
388      */

389     public RectangleInsets getPlotInsets() {
390         if (this.plotInsets == null) {
391             this.plotInsets = new RectangleInsets(0.0, 0.0, 0.0, 0.0);
392         }
393         return this.plotInsets;
394     }
395
396     /**
397      * Returns the current background paint.
398      *
399      * @return The current background paint.
400      */

401     public Paint JavaDoc getBackgroundPaint() {
402         return this.backgroundPaintSample.getPaint();
403     }
404
405     /**
406      * Returns the current outline stroke.
407      *
408      * @return The current outline stroke.
409      */

410     public Stroke JavaDoc getOutlineStroke() {
411         return this.outlineStrokeSample.getStroke();
412     }
413
414     /**
415      * Returns the current outline paint.
416      *
417      * @return The current outline paint.
418      */

419     public Paint JavaDoc getOutlinePaint() {
420         return this.outlinePaintSample.getPaint();
421     }
422
423     /**
424      * Returns a reference to the panel for editing the properties of the
425      * domain axis.
426      *
427      * @return A reference to a panel.
428      */

429     public DefaultAxisEditor getDomainAxisPropertyEditPanel() {
430         return this.domainAxisPropertyPanel;
431     }
432
433     /**
434      * Returns a reference to the panel for editing the properties of the
435      * range axis.
436      *
437      * @return A reference to a panel.
438      */

439     public DefaultAxisEditor getRangeAxisPropertyEditPanel() {
440         return this.rangeAxisPropertyPanel;
441     }
442
443     /**
444      * Handles user actions generated within the panel.
445      * @param event the event
446      */

447     public void actionPerformed(ActionEvent JavaDoc event) {
448         String JavaDoc command = event.getActionCommand();
449         if (command.equals("BackgroundPaint")) {
450             attemptBackgroundPaintSelection();
451         }
452         else if (command.equals("OutlineStroke")) {
453             attemptOutlineStrokeSelection();
454         }
455         else if (command.equals("OutlinePaint")) {
456             attemptOutlinePaintSelection();
457         }
458 // else if (command.equals("Insets")) {
459
// editInsets();
460
// }
461
else if (command.equals("Orientation")) {
462             attemptOrientationSelection();
463         }
464         else if (command.equals("DrawLines")) {
465             attemptDrawLinesSelection();
466         }
467         else if (command.equals("DrawShapes")) {
468             attemptDrawShapesSelection();
469         }
470     }
471
472     /**
473      * Allow the user to change the background paint.
474      */

475     private void attemptBackgroundPaintSelection() {
476         Color JavaDoc c;
477         c = JColorChooser.showDialog(
478             this, localizationResources.getString("Background_Color"),
479             Color.blue
480         );
481         if (c != null) {
482             this.backgroundPaintSample.setPaint(c);
483         }
484     }
485
486     /**
487      * Allow the user to change the outline stroke.
488      */

489     private void attemptOutlineStrokeSelection() {
490         StrokeChooserPanel panel
491             = new StrokeChooserPanel(null, this.availableStrokeSamples);
492         int result = JOptionPane.showConfirmDialog(this, panel,
493             localizationResources.getString("Stroke_Selection"),
494             JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
495
496         if (result == JOptionPane.OK_OPTION) {
497             this.outlineStrokeSample.setStroke(panel.getSelectedStroke());
498         }
499     }
500
501     /**
502      * Allow the user to change the outline paint. We use JColorChooser, so
503      * the user can only choose colors (a subset of all possible paints).
504      */

505     private void attemptOutlinePaintSelection() {
506         Color JavaDoc c;
507         c = JColorChooser.showDialog(
508             this, localizationResources.getString("Outline_Color"), Color.blue
509         );
510         if (c != null) {
511             this.outlinePaintSample.setPaint(c);
512         }
513     }
514
515 // /**
516
// * Allow the user to edit the individual insets' values.
517
// */
518
// private void editInsets() {
519
// InsetsChooserPanel panel = new InsetsChooserPanel(this.plotInsets);
520
// int result = JOptionPane.showConfirmDialog(
521
// this, panel, localizationResources.getString("Edit_Insets"),
522
// JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE
523
// );
524
//
525
// if (result == JOptionPane.OK_OPTION) {
526
// this.plotInsets = panel.getInsets();
527
// this.insetsTextField.setInsets(this.plotInsets);
528
// }
529
//
530
// }
531
//
532
/**
533      * Allow the user to modify the plot orientation if this is an editor for a
534      * <tt>CategoryPlot</tt> or a <tt>XYPlot</tt>.
535      */

536     private void attemptOrientationSelection() {
537
538         int index = this.orientationCombo.getSelectedIndex();
539
540         if (index == ORIENTATION_VERTICAL) {
541             this.plotOrientation = PlotOrientation.VERTICAL;
542         }
543         else {
544             this.plotOrientation = PlotOrientation.HORIZONTAL;
545         }
546     }
547
548     /**
549      * Allow the user to modify whether or not lines are drawn between data
550      * points by <tt>LineAndShapeRenderer</tt>s and
551      * <tt>StandardXYItemRenderer</tt>s.
552      */

553     private void attemptDrawLinesSelection() {
554         this.drawLines = BooleanUtilities.valueOf(
555             this.drawLinesCheckBox.isSelected()
556         );
557     }
558
559     /**
560      * Allow the user to modify whether or not shapes are drawn at data points
561      * by <tt>LineAndShapeRenderer</tt>s and <tt>StandardXYItemRenderer</tt>s.
562      */

563     private void attemptDrawShapesSelection() {
564         this.drawShapes = BooleanUtilities.valueOf(
565             this.drawShapesCheckBox.isSelected()
566         );
567     }
568
569     /**
570      * Updates the plot properties to match the properties defined on the panel.
571      *
572      * @param plot The plot.
573      */

574     public void updatePlotProperties(Plot plot) {
575
576         // set the plot properties...
577
plot.setOutlinePaint(getOutlinePaint());
578         plot.setOutlineStroke(getOutlineStroke());
579         plot.setBackgroundPaint(getBackgroundPaint());
580         plot.setInsets(getPlotInsets());
581
582         // then the axis properties...
583
if (this.domainAxisPropertyPanel != null) {
584             Axis domainAxis = null;
585             if (plot instanceof CategoryPlot) {
586                 CategoryPlot p = (CategoryPlot) plot;
587                 domainAxis = p.getDomainAxis();
588             }
589             else if (plot instanceof XYPlot) {
590                 XYPlot p = (XYPlot) plot;
591                 domainAxis = p.getDomainAxis();
592             }
593             if (domainAxis != null) {
594                 this.domainAxisPropertyPanel.setAxisProperties(domainAxis);
595             }
596         }
597
598         if (this.rangeAxisPropertyPanel != null) {
599             Axis rangeAxis = null;
600             if (plot instanceof CategoryPlot) {
601                 CategoryPlot p = (CategoryPlot) plot;
602                 rangeAxis = p.getRangeAxis();
603             }
604             else if (plot instanceof XYPlot) {
605                 XYPlot p = (XYPlot) plot;
606                 rangeAxis = p.getRangeAxis();
607             }
608             if (rangeAxis != null) {
609                 this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
610             }
611         }
612
613         if (this.plotOrientation != null) {
614             if (plot instanceof CategoryPlot) {
615                 CategoryPlot p = (CategoryPlot) plot;
616                 p.setOrientation(this.plotOrientation);
617             }
618             else if (plot instanceof XYPlot) {
619                 XYPlot p = (XYPlot) plot;
620                 p.setOrientation(this.plotOrientation);
621             }
622         }
623
624         if (this.drawLines != null) {
625             if (plot instanceof CategoryPlot) {
626                 CategoryPlot p = (CategoryPlot) plot;
627                 CategoryItemRenderer r = p.getRenderer();
628                 if (r instanceof LineAndShapeRenderer) {
629                     ((LineAndShapeRenderer) r).setLinesVisible(
630                         this.drawLines.booleanValue()
631                     );
632                 }
633             }
634             else if (plot instanceof XYPlot) {
635                 XYPlot p = (XYPlot) plot;
636                 XYItemRenderer r = p.getRenderer();
637                 if (r instanceof StandardXYItemRenderer) {
638                     ((StandardXYItemRenderer) r).setPlotLines(
639                         this.drawLines.booleanValue()
640                     );
641                 }
642             }
643         }
644
645         if (this.drawShapes != null) {
646             if (plot instanceof CategoryPlot) {
647                 CategoryPlot p = (CategoryPlot) plot;
648                 CategoryItemRenderer r = p.getRenderer();
649                 if (r instanceof LineAndShapeRenderer) {
650                     ((LineAndShapeRenderer) r).setShapesVisible(
651                         this.drawShapes.booleanValue()
652                     );
653                 }
654             }
655             else if (plot instanceof XYPlot) {
656                 XYPlot p = (XYPlot) plot;
657                 XYItemRenderer r = p.getRenderer();
658                 if (r instanceof StandardXYItemRenderer) {
659                     ((StandardXYItemRenderer) r).setBaseShapesVisible(
660                         this.drawShapes.booleanValue());
661                 }
662             }
663         }
664
665 //dmo: added this panel for colorbar control. (start dmo additions)
666
if (this.colorBarAxisPropertyPanel != null) {
667             ColorBar colorBar = null;
668             if (plot instanceof ContourPlot) {
669                 ContourPlot p = (ContourPlot) plot;
670                 colorBar = p.getColorBar();
671             }
672             if (colorBar != null) {
673                 this.colorBarAxisPropertyPanel.setAxisProperties(colorBar);
674             }
675         }
676 //dmo: (end dmo additions)
677

678     }
679
680 }
681
Popular Tags