1. /* ===========================================================
  2. * JFreeChart : a free chart library for the Java(tm) platform
  3. * ===========================================================
  4. *
  5. * (C) Copyright 2000-2004, 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. * RendererChangeDetector.java
  26. * ---------------------------
  27. * (C) Copyright 2003, 2004, by Object Refinery Limited and Contributors.
  28. *
  29. * Original Author: David Gilbert (for Object Refinery Limited);
  30. * Contributor(s): -;
  31. *
  32. * $Id: RendererChangeDetector.java,v 1.1 2004/08/31 14:45:33 mungady Exp $
  33. *
  34. * Changes
  35. * -------
  36. * 29-Oct-2003 : Version 1 (DG);
  37. *
  38. */
  39. package org.jfree.chart.renderer.junit;
  40. import org.jfree.chart.event.RendererChangeEvent;
  41. import org.jfree.chart.event.RendererChangeListener;
  42. /**
  43. * A simple class for detecting whether or not a renderer has generated
  44. * a {@link RendererChangeEvent}.
  45. */
  46. public class RendererChangeDetector implements RendererChangeListener {
  47. /** A flag that records whether or not a change event has been received. */
  48. private boolean notified;
  49. /**
  50. * Creates a new detector.
  51. */
  52. public RendererChangeDetector() {
  53. this.notified = false;
  54. }
  55. /**
  56. * Returns the flag that indicates whether or not a change event has been received.
  57. *
  58. * @return The flag.
  59. */
  60. public boolean getNotified() {
  61. return this.notified;
  62. }
  63. /**
  64. * Sets the flag that indicates whether or not a change event has been received.
  65. *
  66. * @param notified the new value of the flag.
  67. */
  68. public void setNotified(boolean notified) {
  69. this.notified = notified;
  70. }
  71. /**
  72. * Receives a {@link RendererChangeEvent} from a renderer.
  73. *
  74. * @param event the event.
  75. */
  76. public void rendererChanged(RendererChangeEvent event) {
  77. this.notified = true;
  78. }
  79. }