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 under the terms
  10. * of the GNU Lesser General Public License as published by the Free Software Foundation;
  11. * either version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  14. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. * See the GNU Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public License along with this
  18. * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. *
  21. * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
  22. * in the United States and other countries.]
  23. *
  24. * --------------------------
  25. * PlotPropertyEditPanel.java
  26. * --------------------------
  27. * (C) Copyright 2000-2005, by Object Refinery Limited.
  28. *
  29. * Original Author: David Gilbert (for Object Refinery Limited);
  30. * Contributor(s): Andrzej Porebski;
  31. * Arnaud Lelievre;
  32. * Daniel Gredler;
  33. *
  34. * $Id: PlotPropertyEditPanel.java,v 1.3 2005/01/27 17:49:23 mungady Exp $
  35. *
  36. * Changes (from 24-Aug-2001)
  37. * --------------------------
  38. * 24-Aug-2001 : Added standard source header. Fixed DOS encoding problem (DG);
  39. * 07-Nov-2001 : Separated the JCommon Class Library classes, JFreeChart now requires
  40. * jcommon.jar (DG);
  41. * 21-Nov-2001 : Allowed for null axes (DG);
  42. * 27-Aug-2002 : Small update to get existing axis properties working again (DG);
  43. * 26-Nov-2002 : Changes by David M. O'Donnell for ContourPlot (DG);
  44. * 17-Jan-2003 : Plot classes have been moved into a separate package (DG);
  45. * 08-Sep-2003 : Added internationalization via use of properties resourceBundle (RFE 690236) (AL);
  46. * 24-Aug-2004 : Applied patch 1014378 (DG);
  47. *
  48. */
  49. package org.jfree.chart.ui;
  50. import java.awt.BasicStroke;
  51. import java.awt.BorderLayout;
  52. import java.awt.Color;
  53. import java.awt.Insets;
  54. import java.awt.Paint;
  55. import java.awt.Stroke;
  56. import java.awt.event.ActionEvent;
  57. import java.awt.event.ActionListener;
  58. import java.util.ResourceBundle;
  59. import javax.swing.BorderFactory;
  60. import javax.swing.JButton;
  61. import javax.swing.JCheckBox;
  62. import javax.swing.JColorChooser;
  63. import javax.swing.JComboBox;
  64. import javax.swing.JLabel;
  65. import javax.swing.JOptionPane;
  66. import javax.swing.JPanel;
  67. import javax.swing.JTabbedPane;
  68. import org.jfree.chart.axis.Axis;
  69. import org.jfree.chart.axis.ColorBar;
  70. import org.jfree.chart.plot.CategoryPlot;
  71. import org.jfree.chart.plot.ContourPlot;
  72. import org.jfree.chart.plot.Plot;
  73. import org.jfree.chart.plot.PlotOrientation;
  74. import org.jfree.chart.plot.XYPlot;
  75. import org.jfree.chart.renderer.category.CategoryItemRenderer;
  76. import org.jfree.chart.renderer.category.LineAndShapeRenderer;
  77. import org.jfree.chart.renderer.xy.StandardXYItemRenderer;
  78. import org.jfree.chart.renderer.xy.XYItemRenderer;
  79. import org.jfree.layout.LCBLayout;
  80. import org.jfree.ui.InsetsChooserPanel;
  81. import org.jfree.ui.InsetsTextField;
  82. import org.jfree.ui.PaintSample;
  83. import org.jfree.ui.StrokeChooserPanel;
  84. import org.jfree.ui.StrokeSample;
  85. /**
  86. * A panel for editing the properties of a {@link Plot}.
  87. *
  88. */
  89. public class PlotPropertyEditPanel extends JPanel implements ActionListener {
  90. /** Orientation constants. */
  91. private final static String[] orientationNames = {"Vertical", "Horizontal"};
  92. private final static int ORIENTATION_VERTICAL = 0;
  93. private final static int ORIENTATION_HORIZONTAL = 1;
  94. /** The paint (color) used to fill the background of the plot. */
  95. private PaintSample backgroundPaintSample;
  96. /** The stroke (pen) used to draw the outline of the plot. */
  97. private StrokeSample outlineStrokeSample;
  98. /** The paint (color) used to draw the outline of the plot. */
  99. private PaintSample outlinePaintSample;
  100. /** A panel used to display/edit the properties of the domain axis (if any). */
  101. private AxisPropertyEditPanel domainAxisPropertyPanel;
  102. /** A panel used to display/edit the properties of the range axis (if any).*/
  103. private AxisPropertyEditPanel rangeAxisPropertyPanel;
  104. /** A panel used to display/edit the properties of the colorbar axis (if any).*/
  105. private ColorBarPropertyEditPanel colorBarAxisPropertyPanel;
  106. /** An array of stroke samples to choose from. */
  107. private StrokeSample[] availableStrokeSamples;
  108. /** The insets for the plot. */
  109. private Insets plotInsets;
  110. /** The insets text field. */
  111. private InsetsTextField insetsTextField;
  112. /** The orientation for the plot (for <tt>CategoryPlot</tt>s and <tt>XYPlot</tt>s). */
  113. private PlotOrientation plotOrientation;
  114. /** The orientation combo box (for <tt>CategoryPlot</tt>s and <tt>XYPlot</tt>s). */
  115. private JComboBox orientationCombo;
  116. /** Whether or not to draw lines between each data point (for
  117. * <tt>LineAndShapeRenderer</tt>s and <tt>StandardXYItemRenderer</tt>s).
  118. */
  119. private Boolean drawLines;
  120. /**
  121. * The checkbox for whether or not to draw lines between each data point.
  122. */
  123. private JCheckBox drawLinesCheckBox;
  124. /** Whether or not to draw shapes at each data point (for
  125. * <tt>LineAndShapeRenderer</tt>s and <tt>StandardXYItemRenderer</tt>s).
  126. */
  127. private Boolean drawShapes;
  128. /**
  129. * The checkbox for whether or not to draw shapes at each data point.
  130. */
  131. private JCheckBox drawShapesCheckBox;
  132. /** The resourceBundle for the localization. */
  133. protected static ResourceBundle localizationResources =
  134. ResourceBundle.getBundle("org.jfree.chart.ui.LocalizationBundle");
  135. /**
  136. * Standard constructor - constructs a panel for editing the properties of
  137. * the specified plot.
  138. * <P>
  139. * In designing the panel, we need to be aware that subclasses of Plot will
  140. * need to implement subclasses of PlotPropertyEditPanel - so we need to
  141. * leave one or two 'slots' where the subclasses can extend the user
  142. * interface.
  143. *
  144. * @param plot the plot, which should be changed.
  145. */
  146. public PlotPropertyEditPanel(Plot plot) {
  147. this.plotInsets = plot.getInsets();
  148. this.backgroundPaintSample = new PaintSample(plot.getBackgroundPaint());
  149. this.outlineStrokeSample = new StrokeSample(plot.getOutlineStroke());
  150. this.outlinePaintSample = new PaintSample(plot.getOutlinePaint());
  151. if (plot instanceof CategoryPlot) {
  152. this.plotOrientation = ((CategoryPlot) plot).getOrientation();
  153. }
  154. else if (plot instanceof XYPlot) {
  155. this.plotOrientation = ((XYPlot) plot).getOrientation();
  156. }
  157. if (plot instanceof CategoryPlot) {
  158. CategoryItemRenderer renderer = ((CategoryPlot) plot).getRenderer();
  159. if (renderer instanceof LineAndShapeRenderer) {
  160. LineAndShapeRenderer r = (LineAndShapeRenderer) renderer;
  161. this.drawLines = new Boolean(r.isLinesVisible());
  162. this.drawShapes = new Boolean(r.isShapesVisible());
  163. }
  164. }
  165. else if (plot instanceof XYPlot) {
  166. XYItemRenderer renderer = ((XYPlot) plot).getRenderer();
  167. if (renderer instanceof StandardXYItemRenderer) {
  168. StandardXYItemRenderer r = (StandardXYItemRenderer) renderer;
  169. this.drawLines = new Boolean(r.getPlotLines());
  170. this.drawShapes = new Boolean(r.getPlotShapes());
  171. }
  172. }
  173. setLayout(new BorderLayout());
  174. this.availableStrokeSamples = new StrokeSample[3];
  175. this.availableStrokeSamples[0] = new StrokeSample(new BasicStroke(1.0f));
  176. this.availableStrokeSamples[1] = new StrokeSample(new BasicStroke(2.0f));
  177. this.availableStrokeSamples[2] = new StrokeSample(new BasicStroke(3.0f));
  178. // create a panel for the settings...
  179. JPanel panel = new JPanel(new BorderLayout());
  180. panel.setBorder(
  181. BorderFactory.createTitledBorder(
  182. BorderFactory.createEtchedBorder(),
  183. plot.getPlotType() + localizationResources.getString(":")
  184. )
  185. );
  186. JPanel general = new JPanel(new BorderLayout());
  187. general.setBorder(
  188. BorderFactory.createTitledBorder(localizationResources.getString("General"))
  189. );
  190. JPanel interior = new JPanel(new LCBLayout(7));
  191. interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
  192. interior.add(new JLabel(localizationResources.getString("Insets")));
  193. JButton button = new JButton(localizationResources.getString("Edit..."));
  194. button.setActionCommand("Insets");
  195. button.addActionListener(this);
  196. this.insetsTextField = new InsetsTextField(this.plotInsets);
  197. this.insetsTextField.setEnabled(false);
  198. interior.add(this.insetsTextField);
  199. interior.add(button);
  200. interior.add(new JLabel(localizationResources.getString("Outline_stroke")));
  201. button = new JButton(localizationResources.getString("Select..."));
  202. button.setActionCommand("OutlineStroke");
  203. button.addActionListener(this);
  204. interior.add(this.outlineStrokeSample);
  205. interior.add(button);
  206. interior.add(new JLabel(localizationResources.getString("Outline_Paint")));
  207. button = new JButton(localizationResources.getString("Select..."));
  208. button.setActionCommand("OutlinePaint");
  209. button.addActionListener(this);
  210. interior.add(this.outlinePaintSample);
  211. interior.add(button);
  212. interior.add(new JLabel(localizationResources.getString("Background_paint")));
  213. button = new JButton(localizationResources.getString("Select..."));
  214. button.setActionCommand("BackgroundPaint");
  215. button.addActionListener(this);
  216. interior.add(this.backgroundPaintSample);
  217. interior.add(button);
  218. if (this.plotOrientation != null) {
  219. boolean isVertical = this.plotOrientation.equals(PlotOrientation.VERTICAL);
  220. int index = isVertical ? ORIENTATION_VERTICAL : ORIENTATION_HORIZONTAL;
  221. interior.add(new JLabel(localizationResources.getString("Orientation")));
  222. this.orientationCombo = new JComboBox(orientationNames);
  223. this.orientationCombo.setSelectedIndex(index);
  224. this.orientationCombo.setActionCommand("Orientation");
  225. this.orientationCombo.addActionListener(this);
  226. interior.add(new JPanel());
  227. interior.add(this.orientationCombo);
  228. }
  229. if (this.drawLines != null) {
  230. interior.add(new JLabel(localizationResources.getString("Draw_lines")));
  231. this.drawLinesCheckBox = new JCheckBox();
  232. this.drawLinesCheckBox.setSelected(this.drawLines.booleanValue());
  233. this.drawLinesCheckBox.setActionCommand("DrawLines");
  234. this.drawLinesCheckBox.addActionListener(this);
  235. interior.add(new JPanel());
  236. interior.add(this.drawLinesCheckBox);
  237. }
  238. if (this.drawShapes != null) {
  239. interior.add(new JLabel(localizationResources.getString("Draw_shapes")));
  240. this.drawShapesCheckBox = new JCheckBox();
  241. this.drawShapesCheckBox.setSelected(this.drawShapes.booleanValue());
  242. this.drawShapesCheckBox.setActionCommand("DrawShapes");
  243. this.drawShapesCheckBox.addActionListener(this);
  244. interior.add(new JPanel());
  245. interior.add(this.drawShapesCheckBox);
  246. }
  247. general.add(interior, BorderLayout.NORTH);
  248. JPanel appearance = new JPanel(new BorderLayout());
  249. appearance.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
  250. appearance.add(general, BorderLayout.NORTH);
  251. JTabbedPane tabs = new JTabbedPane();
  252. tabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
  253. Axis domainAxis = null;
  254. if (plot instanceof CategoryPlot) {
  255. domainAxis = ((CategoryPlot) plot).getDomainAxis();
  256. }
  257. else if (plot instanceof XYPlot) {
  258. domainAxis = ((XYPlot) plot).getDomainAxis();
  259. }
  260. this.domainAxisPropertyPanel = AxisPropertyEditPanel.getInstance(domainAxis);
  261. if (this.domainAxisPropertyPanel != null) {
  262. this.domainAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
  263. tabs.add(localizationResources.getString("Domain_Axis"), this.domainAxisPropertyPanel);
  264. }
  265. Axis rangeAxis = null;
  266. if (plot instanceof CategoryPlot) {
  267. rangeAxis = ((CategoryPlot) plot).getRangeAxis();
  268. }
  269. else if (plot instanceof XYPlot) {
  270. rangeAxis = ((XYPlot) plot).getRangeAxis();
  271. }
  272. this.rangeAxisPropertyPanel = AxisPropertyEditPanel.getInstance(rangeAxis);
  273. if (this.rangeAxisPropertyPanel != null) {
  274. this.rangeAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
  275. tabs.add(localizationResources.getString("Range_Axis"), this.rangeAxisPropertyPanel);
  276. }
  277. //dmo: added this panel for colorbar control. (start dmo additions)
  278. ColorBar colorBar = null;
  279. if (plot instanceof ContourPlot) {
  280. colorBar = ((ContourPlot) plot).getColorBar();
  281. }
  282. this.colorBarAxisPropertyPanel = ColorBarPropertyEditPanel.getInstance(colorBar);
  283. if (this.colorBarAxisPropertyPanel != null) {
  284. this.colorBarAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
  285. tabs.add(localizationResources.getString("Color_Bar"), this.colorBarAxisPropertyPanel);
  286. }
  287. //dmo: (end dmo additions)
  288. tabs.add(localizationResources.getString("Appearance"), appearance);
  289. panel.add(tabs);
  290. add(panel);
  291. }
  292. /**
  293. * Returns the current plot insets.
  294. * @return the current plot insets.
  295. */
  296. public Insets getPlotInsets() {
  297. if (this.plotInsets == null) {
  298. this.plotInsets = new Insets(0, 0, 0, 0);
  299. }
  300. return this.plotInsets;
  301. }
  302. /**
  303. * Returns the current background paint.
  304. * @return the current background paint.
  305. */
  306. public Paint getBackgroundPaint() {
  307. return this.backgroundPaintSample.getPaint();
  308. }
  309. /**
  310. * Returns the current outline stroke.
  311. * @return the current outline stroke.
  312. */
  313. public Stroke getOutlineStroke() {
  314. return this.outlineStrokeSample.getStroke();
  315. }
  316. /**
  317. * Returns the current outline paint.
  318. * @return the current outline paint.
  319. */
  320. public Paint getOutlinePaint() {
  321. return this.outlinePaintSample.getPaint();
  322. }
  323. /**
  324. * Returns a reference to the panel for editing the properties of the
  325. * domain axis.
  326. *
  327. * @return a reference to a panel.
  328. */
  329. public AxisPropertyEditPanel getDomainAxisPropertyEditPanel() {
  330. return this.domainAxisPropertyPanel;
  331. }
  332. /**
  333. * Returns a reference to the panel for editing the properties of the
  334. * range axis.
  335. *
  336. * @return a reference to a panel.
  337. */
  338. public AxisPropertyEditPanel getRangeAxisPropertyEditPanel() {
  339. return this.rangeAxisPropertyPanel;
  340. }
  341. /**
  342. * Handles user actions generated within the panel.
  343. * @param event the event
  344. */
  345. public void actionPerformed(ActionEvent event) {
  346. String command = event.getActionCommand();
  347. if (command.equals("BackgroundPaint")) {
  348. attemptBackgroundPaintSelection();
  349. }
  350. else if (command.equals("OutlineStroke")) {
  351. attemptOutlineStrokeSelection();
  352. }
  353. else if (command.equals("OutlinePaint")) {
  354. attemptOutlinePaintSelection();
  355. }
  356. else if (command.equals("Insets")) {
  357. editInsets();
  358. }
  359. else if (command.equals("Orientation")) {
  360. attemptOrientationSelection();
  361. }
  362. else if (command.equals("DrawLines")) {
  363. attemptDrawLinesSelection();
  364. }
  365. else if (command.equals("DrawShapes")) {
  366. attemptDrawShapesSelection();
  367. }
  368. }
  369. /**
  370. * Allow the user to change the background paint.
  371. */
  372. private void attemptBackgroundPaintSelection() {
  373. Color c;
  374. c = JColorChooser.showDialog(this, localizationResources.getString("Background_Color"),
  375. Color.blue);
  376. if (c != null) {
  377. this.backgroundPaintSample.setPaint(c);
  378. }
  379. }
  380. /**
  381. * Allow the user to change the outline stroke.
  382. */
  383. private void attemptOutlineStrokeSelection() {
  384. StrokeChooserPanel panel = new StrokeChooserPanel(null, this.availableStrokeSamples);
  385. int result = JOptionPane.showConfirmDialog(this, panel,
  386. localizationResources.getString("Stroke_Selection"),
  387. JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
  388. if (result == JOptionPane.OK_OPTION) {
  389. this.outlineStrokeSample.setStroke(panel.getSelectedStroke());
  390. }
  391. }
  392. /**
  393. * Allow the user to change the outline paint. We use JColorChooser, so
  394. * the user can only choose colors (a subset of all possible paints).
  395. */
  396. private void attemptOutlinePaintSelection() {
  397. Color c;
  398. c = JColorChooser.showDialog(this, localizationResources.getString("Outline_Color"),
  399. Color.blue);
  400. if (c != null) {
  401. this.outlinePaintSample.setPaint(c);
  402. }
  403. }
  404. /**
  405. * Allow the user to edit the individual insets' values.
  406. */
  407. private void editInsets() {
  408. InsetsChooserPanel panel = new InsetsChooserPanel(this.plotInsets);
  409. int result = JOptionPane.showConfirmDialog(this, panel,
  410. localizationResources.getString("Edit_Insets"),
  411. JOptionPane.OK_CANCEL_OPTION,
  412. JOptionPane.PLAIN_MESSAGE);
  413. if (result == JOptionPane.OK_OPTION) {
  414. this.plotInsets = panel.getInsets();
  415. this.insetsTextField.setInsets(this.plotInsets);
  416. }
  417. }
  418. /**
  419. * Allow the user to modify the plot orientation if this is an editor for a
  420. * <tt>CategoryPlot</tt> or a <tt>XYPlot</tt>.
  421. */
  422. private void attemptOrientationSelection() {
  423. int index = this.orientationCombo.getSelectedIndex();
  424. if (index == ORIENTATION_VERTICAL) {
  425. this.plotOrientation = PlotOrientation.VERTICAL;
  426. }
  427. else {
  428. this.plotOrientation = PlotOrientation.HORIZONTAL;
  429. }
  430. }
  431. /**
  432. * Allow the user to modify whether or not lines are drawn between data points
  433. * by <tt>LineAndShapeRenderer</tt>s and <tt>StandardXYItemRenderer</tt>s.
  434. */
  435. private void attemptDrawLinesSelection() {
  436. this.drawLines = new Boolean(this.drawLinesCheckBox.isSelected());
  437. }
  438. /**
  439. * Allow the user to modify whether or not shapes are drawn at data points
  440. * by <tt>LineAndShapeRenderer</tt>s and <tt>StandardXYItemRenderer</tt>s.
  441. */
  442. private void attemptDrawShapesSelection() {
  443. this.drawShapes = new Boolean(this.drawShapesCheckBox.isSelected());
  444. }
  445. /**
  446. * Updates the plot properties to match the properties defined on the panel.
  447. *
  448. * @param plot The plot.
  449. */
  450. public void updatePlotProperties(Plot plot) {
  451. // set the plot properties...
  452. plot.setOutlinePaint(getOutlinePaint());
  453. plot.setOutlineStroke(getOutlineStroke());
  454. plot.setBackgroundPaint(getBackgroundPaint());
  455. plot.setInsets(getPlotInsets());
  456. // then the axis properties...
  457. if (this.domainAxisPropertyPanel != null) {
  458. Axis domainAxis = null;
  459. if (plot instanceof CategoryPlot) {
  460. CategoryPlot p = (CategoryPlot) plot;
  461. domainAxis = p.getDomainAxis();
  462. }
  463. else if (plot instanceof XYPlot) {
  464. XYPlot p = (XYPlot) plot;
  465. domainAxis = p.getDomainAxis();
  466. }
  467. if (domainAxis != null) {
  468. this.domainAxisPropertyPanel.setAxisProperties(domainAxis);
  469. }
  470. }
  471. if (this.rangeAxisPropertyPanel != null) {
  472. Axis rangeAxis = null;
  473. if (plot instanceof CategoryPlot) {
  474. CategoryPlot p = (CategoryPlot) plot;
  475. rangeAxis = p.getRangeAxis();
  476. }
  477. else if (plot instanceof XYPlot) {
  478. XYPlot p = (XYPlot) plot;
  479. rangeAxis = p.getRangeAxis();
  480. }
  481. if (rangeAxis != null) {
  482. this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
  483. }
  484. }
  485. if (this.plotOrientation != null) {
  486. if (plot instanceof CategoryPlot) {
  487. CategoryPlot p = (CategoryPlot) plot;
  488. p.setOrientation(this.plotOrientation);
  489. }
  490. else if (plot instanceof XYPlot) {
  491. XYPlot p = (XYPlot) plot;
  492. p.setOrientation(this.plotOrientation);
  493. }
  494. }
  495. if (this.drawLines != null) {
  496. if (plot instanceof CategoryPlot) {
  497. CategoryPlot p = (CategoryPlot) plot;
  498. CategoryItemRenderer r = p.getRenderer();
  499. if (r instanceof LineAndShapeRenderer) {
  500. ((LineAndShapeRenderer) r).setLinesVisible(this.drawLines.booleanValue());
  501. }
  502. }
  503. else if (plot instanceof XYPlot) {
  504. XYPlot p = (XYPlot) plot;
  505. XYItemRenderer r = p.getRenderer();
  506. if (r instanceof StandardXYItemRenderer) {
  507. ((StandardXYItemRenderer) r).setPlotLines(this.drawLines.booleanValue());
  508. }
  509. }
  510. }
  511. if (this.drawShapes != null) {
  512. if (plot instanceof CategoryPlot) {
  513. CategoryPlot p = (CategoryPlot) plot;
  514. CategoryItemRenderer r = p.getRenderer();
  515. if (r instanceof LineAndShapeRenderer) {
  516. ((LineAndShapeRenderer) r).setShapesVisible(this.drawShapes.booleanValue());
  517. }
  518. }
  519. else if (plot instanceof XYPlot) {
  520. XYPlot p = (XYPlot) plot;
  521. XYItemRenderer r = p.getRenderer();
  522. if (r instanceof StandardXYItemRenderer) {
  523. ((StandardXYItemRenderer) r).setPlotShapes(this.drawShapes.booleanValue());
  524. }
  525. }
  526. }
  527. //dmo: added this panel for colorbar control. (start dmo additions)
  528. if (this.colorBarAxisPropertyPanel != null) {
  529. ColorBar colorBar = null;
  530. if (plot instanceof ContourPlot) {
  531. ContourPlot p = (ContourPlot) plot;
  532. colorBar = p.getColorBar();
  533. }
  534. if (colorBar != null) {
  535. this.colorBarAxisPropertyPanel.setAxisProperties(colorBar);
  536. }
  537. }
  538. //dmo: (end dmo additions)
  539. }
  540. }