当前位置: 首页>>代码示例>>Java>>正文


Java Axis.setFixedDimension方法代码示例

本文整理汇总了Java中org.jfree.chart.axis.Axis.setFixedDimension方法的典型用法代码示例。如果您正苦于以下问题:Java Axis.setFixedDimension方法的具体用法?Java Axis.setFixedDimension怎么用?Java Axis.setFixedDimension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.axis.Axis的用法示例。


在下文中一共展示了Axis.setFixedDimension方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureAxis

import org.jfree.chart.axis.Axis; //导入方法依赖的package包/类
/**
 * Sets all the axis formatting options.  This includes the colors and fonts to use on
 * the axis as well as the color to use when drawing the axis line.
 *
 * @param axis the axis to format
 * @param labelFont the font to use for the axis label
 * @param labelColor the color of the axis label
 * @param tickLabelFont the font to use for each tick mark value label
 * @param tickLabelColor the color of each tick mark value label
 * @param tickLabelMask formatting mask for the label.  If the axis is a NumberAxis then
 * 						the mask should be <code>java.text.DecimalFormat</code> mask, and
 * 						if it is a DateAxis then the mask should be a
 * 						<code>java.text.SimpleDateFormat</code> mask.
 * @param verticalTickLabels flag to draw tick labels at 90 degrees
 * @param lineColor color to use when drawing the axis line and any tick marks
 * @param isRangeAxis used to distinguish between range and domain axis type
 * @param timeUnit time unit used to create a DateAxis
 */
protected void configureAxis(
		Axis axis,
		JRFont labelFont,
		Color labelColor,
		JRFont tickLabelFont,
		Color tickLabelColor,
		String tickLabelMask,
		Boolean verticalTickLabels,
		Paint lineColor,
		boolean isRangeAxis,
		Comparable<?> axisMinValue,
		Comparable<?> axisMaxValue
		) throws JRException
{
	Boolean axisVisible = (Boolean)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_VISIBLE);
	
	if (axisVisible != null && axisVisible.booleanValue())
	{
		setAxisLine(axis, lineColor);

		Double defaultFixedDimension = (Double)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.AXIS_FIXED_DIMENSION);
		if (defaultFixedDimension != null)
		{
			axis.setFixedDimension(defaultFixedDimension.doubleValue());
		}
		
		Integer baseFontSize = (Integer)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BASEFONT_SIZE);
		setAxisLabel(axis, labelFont, labelColor, baseFontSize);
		setAxisTickLabels(axis, tickLabelFont, tickLabelColor, tickLabelMask, baseFontSize);
		setAxisTickMarks(axis, lineColor);
		String timePeriodUnit = isRangeAxis 
			? (String)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.RANGE_AXIS_TIME_PERIOD_UNIT)
			: (String)getDefaultValue(defaultAxisPropertiesMap, ChartThemesConstants.DOMAIN_AXIS_TIME_PERIOD_UNIT);
		setAxisBounds(axis, isRangeAxis, timePeriodUnit, axisMinValue, axisMaxValue);
		
		if (verticalTickLabels != null && axis instanceof ValueAxis)
		{
			((ValueAxis)axis).setVerticalTickLabels(verticalTickLabels.booleanValue());
		}
	}
	else
	{
		axis.setVisible(false);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:64,代码来源:GenericChartTheme.java


注:本文中的org.jfree.chart.axis.Axis.setFixedDimension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。