/** * Returns a shape used to represent the items in a series. * * @param series the series (zero-based index). * * @return The shape (possibly <code>null</code>). * * @see #setSeriesShape(int, Shape) */ public Shape getSeriesShape(int series) { return this.shapeList.getShape(series); }
/** * Returns a {@link Shape} object from the list. * * @param index the index (zero-based). * * @return The object. */ public Shape getShape(final int index) { return (Shape) get(index); }
/** * Sets the {@link Shape} for an item in the list. The list is expanded * if necessary. * * @param index the index (zero-based). * @param shape the {@link Shape}. */ public void setShape(final int index, final Shape shape) { set(index, shape); }
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(final ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); final int count = size(); stream.writeInt(count); for (int i = 0; i < count; i++) { final Shape shape = getShape(i); if (shape != null) { stream.writeInt(i); SerialUtilities.writeShape(shape, stream); } else { stream.writeInt(-1); } } }
/** * Sets the shape used for the legend item for the specified series, and * sends a {@link RendererChangeEvent} to all registered listeners. * * @param series the series index. * @param shape the shape (<code>null</code> permitted). * * @since 1.0.11 */ public void setLegendShape(int series, Shape shape) { this.legendShapeList.setShape(series, shape); fireChangeEvent(); }
/** * Tests the list for equality with another object (typically also a list). * * @param obj the other object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ShapeList)) { return false; } ShapeList that = (ShapeList) obj; int listSize = size(); for (int i = 0; i < listSize; i++) { if (!ShapeUtilities.equal((Shape) get(i), (Shape) that.get(i))) { return false; } } return true; }
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(final ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); final int count = size(); stream.writeInt(count); for (int i = 0; i < count; i++) { final Shape shape = getShape(i); if (shape != null) { stream.writeInt(i); SerialUtilities.writeShape(shape, stream); } else { stream.writeInt(-1); } } }
/** * Sets the shape for a series and, if requested, sends a * {@link RendererChangeEvent} to all registered listeners. * * @param series the series index (zero based). * @param shape the shape (<code>null</code> permitted). * @param notify notify listeners? * * @see #getSeriesShape(int) */ public void setSeriesShape(int series, Shape shape, boolean notify) { this.shapeList.setShape(series, shape); if (notify) { fireChangeEvent(); } }
/** * Tests the list for equality with another object (typically also a list). * * @param obj the other object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ShapeList)) { return false; } ShapeList that = (ShapeList) obj; int listSize = size(); for (int i = 0; i < listSize; i++) { if (!ShapeUtilities.equal((Shape) get(i), (Shape) that.get(i))) { return false; } } return true; }
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(final ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); final int count = size(); stream.writeInt(count); for (int i = 0; i < count; i++) { final Shape shape = getShape(i); if (shape != null) { stream.writeInt(i); SerialUtilities.writeShape(shape, stream); } else { stream.writeInt(-1); } } }
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); final int count = stream.readInt(); for (int i = 0; i < count; i++) { final int index = stream.readInt(); if (index != -1) { setShape(index, SerialUtilities.readShape(stream)); } } }
/** * Returns the legend shape defined for the specified series (possibly * <code>null</code>). * * @param series the series index. * * @return The shape (possibly <code>null</code>). * * @see #lookupLegendShape(int) * * @since 1.0.11 */ public Shape getLegendShape(int series) { return this.legendShapeList.getShape(series); }
/** * Sets the {@link Shape} for an item in the list. The list is expanded if necessary. * * @param index the index (zero-based). * @param shape the {@link Shape}. */ public void setShape(final int index, final Shape shape) { set(index, shape); }
/** * Returns a {@link Shape} object from the list. * * @param index the index (zero-based). * * @return The object. */ public Shape getShape(final int index) { return (Shape) get(index); }
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); final int count = stream.readInt(); for (int i = 0; i < count; i++) { final int index = stream.readInt(); if (index != -1) { setShape(index, SerialUtilities.readShape(stream)); } } }
/** * Sets the {@link Shape} for an item in the list. The list is expanded * if necessary. * * @param index the index (zero-based). * @param shape the {@link Shape}. */ public void setShape(final int index, final Shape shape) { set(index, shape); }
/** * Returns a {@link Shape} object from the list. * * @param index the index (zero-based). * * @return The object. */ public Shape getShape(final int index) { return (Shape) get(index); }
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); final int count = stream.readInt(); for (int i = 0; i < count; i++) { final int index = stream.readInt(); if (index != -1) { setShape(index, SerialUtilities.readShape(stream)); } } }