本文整理汇总了Java中org.jfree.chart.StandardChartTheme.getLargeFont方法的典型用法代码示例。如果您正苦于以下问题:Java StandardChartTheme.getLargeFont方法的具体用法?Java StandardChartTheme.getLargeFont怎么用?Java StandardChartTheme.getLargeFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.StandardChartTheme
的用法示例。
在下文中一共展示了StandardChartTheme.getLargeFont方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDefaultChartFonts
import org.jfree.chart.StandardChartTheme; //导入方法依赖的package包/类
/**
* Changes the font of {@link JFreeChart}s to Sans Serif. This method uses a
* {@link StandardChartTheme} to do so, so any changes to the look of the chart must be done
* after calling this method.
*
* @param chart
* the chart to change fonts for
*/
protected static void setDefaultChartFonts(JFreeChart chart) {
final ChartTheme chartTheme = StandardChartTheme.createJFreeTheme();
if (StandardChartTheme.class.isAssignableFrom(chartTheme.getClass())) {
StandardChartTheme standardTheme = (StandardChartTheme) chartTheme;
// The default font used by JFreeChart cannot render japanese etc symbols
final Font oldExtraLargeFont = standardTheme.getExtraLargeFont();
final Font oldLargeFont = standardTheme.getLargeFont();
final Font oldRegularFont = standardTheme.getRegularFont();
final Font oldSmallFont = standardTheme.getSmallFont();
final Font extraLargeFont = new Font(Font.SANS_SERIF, oldExtraLargeFont.getStyle(), oldExtraLargeFont.getSize());
final Font largeFont = new Font(Font.SANS_SERIF, oldLargeFont.getStyle(), oldLargeFont.getSize());
final Font regularFont = new Font(Font.SANS_SERIF, oldRegularFont.getStyle(), oldRegularFont.getSize());
final Font smallFont = new Font(Font.SANS_SERIF, oldSmallFont.getStyle(), oldSmallFont.getSize());
standardTheme.setExtraLargeFont(extraLargeFont);
standardTheme.setLargeFont(largeFont);
standardTheme.setRegularFont(regularFont);
standardTheme.setSmallFont(smallFont);
standardTheme.apply(chart);
}
}
示例2: applyChartTheme
import org.jfree.chart.StandardChartTheme; //导入方法依赖的package包/类
public void applyChartTheme() {
final StandardChartTheme chartTheme = (StandardChartTheme) org.jfree.chart.StandardChartTheme
.createJFreeTheme();
final Font oldExtraLargeFont = chartTheme.getExtraLargeFont();
final Font oldLargeFont = chartTheme.getLargeFont();
final Font oldRegularFont = chartTheme.getRegularFont();
final Font oldSmallFont = chartTheme.getSmallFont();
final Font extraLargeFont = new Font("Sans-serif", oldExtraLargeFont.getStyle(), oldExtraLargeFont.getSize());
final Font largeFont = new Font("Sans-serif", oldLargeFont.getStyle(), oldLargeFont.getSize());
final Font regularFont = new Font("Sans-serif", oldRegularFont.getStyle(), oldRegularFont.getSize());
final Font smallFont = new Font("Sans-serif", oldSmallFont.getStyle(), oldSmallFont.getSize());
chartTheme.setExtraLargeFont(extraLargeFont);
chartTheme.setLargeFont(largeFont);
chartTheme.setRegularFont(regularFont);
chartTheme.setSmallFont(smallFont);
chartTheme.apply(chart);
}
示例3: setDefaultChartFonts
import org.jfree.chart.StandardChartTheme; //导入方法依赖的package包/类
/**
* Changes the font of {@link JFreeChart}s to Sans Serif. This method uses a
* {@link StandardChartTheme} to do so, so any changes to the look of the chart must be done
* after calling this method.
*
* @param chart
* the chart to change fonts for
*/
protected static void setDefaultChartFonts(JFreeChart chart) {
final ChartTheme chartTheme = StandardChartTheme.createJFreeTheme();
if (StandardChartTheme.class.isAssignableFrom(chartTheme.getClass())) {
StandardChartTheme standardTheme = (StandardChartTheme) chartTheme;
// The default font used by JFreeChart cannot render japanese etc symbols
final Font oldExtraLargeFont = standardTheme.getExtraLargeFont();
final Font oldLargeFont = standardTheme.getLargeFont();
final Font oldRegularFont = standardTheme.getRegularFont();
final Font oldSmallFont = standardTheme.getSmallFont();
final Font extraLargeFont = FontTools.getFont(Font.SANS_SERIF, oldExtraLargeFont.getStyle(),
oldExtraLargeFont.getSize());
final Font largeFont = FontTools.getFont(Font.SANS_SERIF, oldLargeFont.getStyle(), oldLargeFont.getSize());
final Font regularFont = FontTools.getFont(Font.SANS_SERIF, oldRegularFont.getStyle(), oldRegularFont.getSize());
final Font smallFont = FontTools.getFont(Font.SANS_SERIF, oldSmallFont.getStyle(), oldSmallFont.getSize());
standardTheme.setExtraLargeFont(extraLargeFont);
standardTheme.setLargeFont(largeFont);
standardTheme.setRegularFont(regularFont);
standardTheme.setSmallFont(smallFont);
standardTheme.apply(chart);
}
}