Frames | No Frames |
1: /* =========================================================== 2: * JFreeChart : a free chart library for the Java(tm) platform 3: * =========================================================== 4: * 5: * (C) Copyright 2000-2007, 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: * XYItemRendererState.java 29: * ------------------------ 30: * (C) Copyright 2003-2007, by Object Refinery Limited. 31: * 32: * Original Author: David Gilbert (for Object Refinery Limited); 33: * Contributor(s): -; 34: * 35: * Changes: 36: * -------- 37: * 07-Oct-2003 : Version 1 (DG); 38: * 27-Jan-2004 : Added workingLine attribute (DG); 39: * ------------- JFREECHART 1.0.x --------------------------------------------- 40: * 04-May-2007 : Added processVisibleItemsOnly flag (DG); 41: * 42: */ 43: 44: package org.jfree.chart.renderer.xy; 45: 46: import java.awt.geom.Line2D; 47: 48: import org.jfree.chart.plot.PlotRenderingInfo; 49: import org.jfree.chart.renderer.RendererState; 50: 51: /** 52: * The state for an {@link XYItemRenderer}. 53: */ 54: public class XYItemRendererState extends RendererState { 55: 56: /** 57: * A line object that the renderer can reuse to save instantiating a lot 58: * of objects. 59: */ 60: public Line2D workingLine; 61: 62: /** 63: * A flag that controls whether the plot should pass ALL data items to the 64: * renderer, or just the items that will be visible. 65: * 66: * @since 1.0.6 67: */ 68: private boolean processVisibleItemsOnly; 69: 70: /** 71: * Creates a new state. 72: * 73: * @param info the plot rendering info. 74: */ 75: public XYItemRendererState(PlotRenderingInfo info) { 76: super(info); 77: this.workingLine = new Line2D.Double(); 78: this.processVisibleItemsOnly = true; 79: } 80: 81: /** 82: * Returns the flag that controls whether the plot passes all data 83: * items in each series to the renderer, or just the visible items. The 84: * default value is <code>true</code>. 85: * 86: * @return A boolean. 87: * 88: * @since 1.0.6 89: * 90: * @see #setProcessVisibleItemsOnly(boolean) 91: */ 92: public boolean getProcessVisibleItemsOnly() { 93: return this.processVisibleItemsOnly; 94: } 95: 96: /** 97: * Sets the flag that controls whether the plot passes all data 98: * items in each series to the renderer, or just the visible items. 99: * 100: * @param flag the new flag value. 101: * 102: * @since 1.0.6 103: */ 104: public void setProcessVisibleItemsOnly(boolean flag) { 105: this.processVisibleItemsOnly = flag; 106: } 107: 108: }