/** * Applies this theme to the supplied chart. * * @param chart the chart (<code>null</code> not permitted). */ public void apply(JFreeChart chart) { if (chart == null) { throw new IllegalArgumentException("Null 'chart' argument."); } TextTitle title = chart.getTitle(); if (title != null) { title.setFont(this.extraLargeFont); title.setPaint(this.titlePaint); } int subtitleCount = chart.getSubtitleCount(); for (int i = 0; i < subtitleCount; i++) { applyToTitle(chart.getSubtitle(i)); } chart.setBackgroundPaint(this.chartBackgroundPaint); // now process the plot if there is one Plot plot = chart.getPlot(); if (plot != null) { applyToPlot(plot); } }
LegendTitle legend = (LegendTitle) chart.getSubtitle(0); legend.setPosition(RectangleEdge.RIGHT); legend.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0, 4, 0, 4));
/** * 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); }
LegendTitle legend = (LegendTitle) chart.getSubtitle(0); legend.setPosition(RectangleEdge.RIGHT); legend.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0, 4, 0, 4));
Title subtitle = (Title) getSubtitle(i).clone(); chart.subtitles.add(subtitle); subtitle.addChangeListener(chart);
getSubtitle(i).addChangeListener(this);
Title subtitle = (Title) getSubtitle(i).clone(); chart.subtitles.add(subtitle); subtitle.addChangeListener(chart);
/** * Applies this theme to the supplied chart. * * @param chart the chart ({@code null} not permitted). */ @Override public void apply(JFreeChart chart) { Args.nullNotPermitted(chart, "chart"); TextTitle title = chart.getTitle(); if (title != null) { title.setFont(this.extraLargeFont); title.setPaint(this.titlePaint); } int subtitleCount = chart.getSubtitleCount(); for (int i = 0; i < subtitleCount; i++) { applyToTitle(chart.getSubtitle(i)); } chart.setBackgroundPaint(this.chartBackgroundPaint); // now process the plot if there is one Plot plot = chart.getPlot(); if (plot != null) { applyToPlot(plot); } }
Title t = chart.getSubtitle(i); if (t instanceof TextTitle) { TextTitle tt = (TextTitle) t;
final Title subtitle = chart.getSubtitle(i); if (subtitle instanceof TextTitle) { ((TextTitle) subtitle).setFont(WidgetUtils.FONT_NORMAL);