/** * Sets the main title for the chart and sends a {@link ChartChangeEvent} * to all registered listeners. If you do not want a title for the * chart, set it to {@code null}. If you want more than one title on * a chart, use the {@link #addSubtitle(Title)} method. * * @param title the title ({@code null} permitted). * * @see #getTitle() */ public void setTitle(TextTitle title) { if (this.title != null) { this.title.removeChangeListener(this); } this.title = title; if (title != null) { title.addChangeListener(this); } fireChartChanged(); }
/** * Sets the main title for the chart and sends a {@link ChartChangeEvent} * to all registered listeners. If you do not want a title for the * chart, set it to <code>null</code>. If you want more than one title on * a chart, use the {@link #addSubtitle(Title)} method. * * @param title the title (<code>null</code> permitted). * * @see #getTitle() */ public void setTitle(TextTitle title) { if (this.title != null) { this.title.removeChangeListener(this); } this.title = title; if (title != null) { title.addChangeListener(this); } fireChartChanged(); }
chart.title.addChangeListener(chart);
chart.title.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); }
this.title.addChangeListener(this);
this.title.addChangeListener(this);
this.title.addChangeListener(this);