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


Java PaintScaleLegend.setMargin方法代码示例

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


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

示例1: RTMZPlot

import org.jfree.chart.title.PaintScaleLegend; //导入方法依赖的package包/类
public RTMZPlot(RTMZAnalyzerWindow masterFrame, AbstractXYZDataset dataset,
    InterpolatingLookupPaintScale paintScale) {
super(null);

this.paintScale = paintScale;

chart = ChartFactory.createXYAreaChart("", "Retention time", "m/z",
	dataset, PlotOrientation.VERTICAL, false, false, false);
chart.setBackgroundPaint(Color.white);
setChart(chart);

// title

TextTitle chartTitle = chart.getTitle();
chartTitle.setMargin(5, 0, 0, 0);
chartTitle.setFont(titleFont);
chart.removeSubtitle(chartTitle);

// disable maximum size (we don't want scaling)
setMaximumDrawWidth(Integer.MAX_VALUE);
setMaximumDrawHeight(Integer.MAX_VALUE);

// set the plot properties
plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.white);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));

// set grid properties
plot.setDomainGridlinePaint(gridColor);
plot.setRangeGridlinePaint(gridColor);

// set crosshair (selection) properties
plot.setDomainCrosshairVisible(true);
plot.setRangeCrosshairVisible(true);
plot.setDomainCrosshairPaint(crossHairColor);
plot.setRangeCrosshairPaint(crossHairColor);
plot.setDomainCrosshairStroke(crossHairStroke);
plot.setRangeCrosshairStroke(crossHairStroke);

NumberFormat rtFormat = MZmineCore.getConfiguration().getRTFormat();
NumberFormat mzFormat = MZmineCore.getConfiguration().getMZFormat();

// set the X axis (retention time) properties
NumberAxis xAxis = (NumberAxis) plot.getDomainAxis();
xAxis.setNumberFormatOverride(rtFormat);
xAxis.setUpperMargin(0.001);
xAxis.setLowerMargin(0.001);

// set the Y axis (intensity) properties
NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
yAxis.setAutoRangeIncludesZero(false);
yAxis.setNumberFormatOverride(mzFormat);

plot.setDataset(dataset);
spotRenderer = new RTMZRenderer(dataset, paintScale);
plot.setRenderer(spotRenderer);
spotRenderer.setDefaultToolTipGenerator(new RTMZToolTipGenerator());

// Add a paintScaleLegend to chart

paintScaleAxis = new NumberAxis("Logratio");
paintScaleAxis.setRange(paintScale.getLowerBound(),
	paintScale.getUpperBound());

paintScaleLegend = new PaintScaleLegend(paintScale, paintScaleAxis);
paintScaleLegend.setPosition(plot.getDomainAxisEdge());
paintScaleLegend.setMargin(5, 25, 5, 25);

chart.addSubtitle(paintScaleLegend);

   }
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:72,代码来源:RTMZPlot.java


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