/** * Adds a chart subtitle, and notifies registered listeners that the chart * has been modified. * * @param subtitle the subtitle (<code>null</code> not permitted). * * @see #getSubtitle(int) */ public void addSubtitle(Title subtitle) { if (subtitle == null) { throw new IllegalArgumentException("Null 'subtitle' argument."); } this.subtitles.add(subtitle); subtitle.addChangeListener(this); fireChartChanged(); }
/** * Adds a chart subtitle, and notifies registered listeners that the chart * has been modified. * * @param subtitle the subtitle ({@code null} not permitted). * * @see #getSubtitle(int) */ public void addSubtitle(Title subtitle) { Args.nullNotPermitted(subtitle, "subtitle"); this.subtitles.add(subtitle); subtitle.addChangeListener(this); fireChartChanged(); }
/** * Adds a subtitle at a particular position in the subtitle list, and sends * a {@link ChartChangeEvent} to all registered listeners. * * @param index the index (in the range 0 to {@link #getSubtitleCount()}). * @param subtitle the subtitle to add (<code>null</code> not permitted). * * @since 1.0.6 */ public void addSubtitle(int index, Title subtitle) { if (index < 0 || index > getSubtitleCount()) { throw new IllegalArgumentException( "The 'index' argument is out of range."); } if (subtitle == null) { throw new IllegalArgumentException("Null 'subtitle' argument."); } this.subtitles.add(index, subtitle); subtitle.addChangeListener(this); fireChartChanged(); }
/** * Adds a subtitle at a particular position in the subtitle list, and sends * a {@link ChartChangeEvent} to all registered listeners. * * @param index the index (in the range 0 to {@link #getSubtitleCount()}). * @param subtitle the subtitle to add ({@code null} not permitted). * * @since 1.0.6 */ public void addSubtitle(int index, Title subtitle) { if (index < 0 || index > getSubtitleCount()) { throw new IllegalArgumentException( "The 'index' argument is out of range."); } Args.nullNotPermitted(subtitle, "subtitle"); this.subtitles.add(index, subtitle); subtitle.addChangeListener(this); fireChartChanged(); }
Title subtitle = (Title) getSubtitle(i).clone(); chart.subtitles.add(subtitle); subtitle.addChangeListener(chart);
Title subtitle = (Title) getSubtitle(i).clone(); chart.subtitles.add(subtitle); subtitle.addChangeListener(chart);
/** * 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(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.borderStroke = SerialUtilities.readStroke(stream); this.borderPaint = SerialUtilities.readPaint(stream); this.backgroundPaint = SerialUtilities.readPaint(stream); this.progressListeners = new EventListenerList(); this.changeListeners = new EventListenerList(); this.renderingHints = new RenderingHints( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // register as a listener with sub-components... if (this.title != null) { this.title.addChangeListener(this); } for (int i = 0; i < getSubtitleCount(); i++) { getSubtitle(i).addChangeListener(this); } this.plot.addChangeListener(this); }
getSubtitle(i).addChangeListener(this);