/** * Sets the chart title and sends a {@link ChartChangeEvent} to all * registered listeners. This is a convenience method that ends up calling * the {@link #setTitle(TextTitle)} method. If there is an existing title, * its text is updated, otherwise a new title using the default font is * added to the chart. If {@code text} is {@code null} the chart * title is set to {@code null}. * * @param text the title text ({@code null} permitted). * * @see #getTitle() */ public void setTitle(String text) { if (text != null) { if (this.title == null) { setTitle(new TextTitle(text, JFreeChart.DEFAULT_TITLE_FONT)); } else { this.title.setText(text); } } else { setTitle((TextTitle) null); } }
/** * Sets the chart title and sends a {@link ChartChangeEvent} to all * registered listeners. This is a convenience method that ends up calling * the {@link #setTitle(TextTitle)} method. If there is an existing title, * its text is updated, otherwise a new title using the default font is * added to the chart. If <code>text</code> is <code>null</code> the chart * title is set to <code>null</code>. * * @param text the title text (<code>null</code> permitted). * * @see #getTitle() */ public void setTitle(String text) { if (text != null) { if (this.title == null) { setTitle(new TextTitle(text, JFreeChart.DEFAULT_TITLE_FONT)); } else { this.title.setText(text); } } else { setTitle((TextTitle) null); } }
private TextTitle getSubTitle( BaseChart chart ) { TextTitle textTitle = new TextTitle(); String title = chart.hasTitle() ? chart.getTitle() : chart.generateTitle(); textTitle.setFont( SUB_TITLE_FONT ); textTitle.setText( title ); return textTitle; }
private void addNotice(JFreeChart chart) { TextTitle notice = new TextTitle(); String msg = i18n.get("notice"); if (msg != null && !msg.isEmpty()) { notice.setText(msg); notice.setPaint(BLACK); notice.setFont(FONT_LABEL_SMALL); notice.setPosition(RectangleEdge.BOTTOM); notice.setHorizontalAlignment(HorizontalAlignment.RIGHT); notice.setVerticalAlignment(VerticalAlignment.BOTTOM); notice.setPadding(new RectangleInsets(0, 0, 20, 20)); chart.addSubtitle(notice); } }
private void addNotice(JFreeChart chart) { TextTitle notice = new TextTitle(); String msg = i18n.get("msg.io.chart.notice"); if (msg != null && !msg.isEmpty()) { notice.setText(msg); notice.setPaint(Color.BLACK); notice.setFont(LabelConstants.FONT_LABEL_SMALL); notice.setPosition(RectangleEdge.BOTTOM); notice.setHorizontalAlignment(HorizontalAlignment.RIGHT); notice.setVerticalAlignment(VerticalAlignment.BOTTOM); notice.setPadding(new RectangleInsets(0, 0, 20, 20)); chart.addSubtitle(notice); } }
/** * Sets the properties of the specified title to match the properties * defined on this panel. * * @param chart the chart whose title is to be modified. */ public void setTitleProperties(JFreeChart chart) { if (this.showTitle) { TextTitle title = chart.getTitle(); if (title == null) { title = new TextTitle(); chart.setTitle(title); } title.setText(getTitleText()); title.setFont(getTitleFont()); title.setPaint(getTitlePaint()); } else { chart.setTitle((TextTitle) null); } }
/** * Sets the properties of the specified title to match the properties * defined on this panel. * * @param chart the chart whose title is to be modified. */ public void setTitleProperties(JFreeChart chart) { if (this.showTitle) { TextTitle title = chart.getTitle(); if (title == null) { title = new TextTitle(); chart.setTitle(title); } title.setText(getTitleText()); title.setFont(getTitleFont()); title.setPaint(getTitlePaint()); } else { chart.setTitle((TextTitle) null); } }
protected synchronized void updateResults() { JFreeChart chart; if (numberOfAllPaths <= 0) { makePromptInteractive(false); if (graphFrame != null) { chart = graphFrame.chartPanel.getChart(); if (chart != null) { chart.setNotify(false); final TextTitle currentitle = chart.getTitle(); if (currentitle != null) currentitle.setText(""); final XYPlot plot = chart.getXYPlot(); if (plot != null) plot.setDataset(null); chart.setNotify(true); } } } else { // valid paths to be analyzed makePromptInteractive(true); final ShollResults results = getCurrentResults(); resultsPanel.updateFromResults(results); chart = results.createGraph(); if (chart == null) return; if (graphFrame == null) graphFrame = new GraphFrame(chart, results.getSuggestedSuffix()); else graphFrame.updateWithNewChart(chart, results.getSuggestedSuffix()); } }