本文整理汇总了Java中org.jfree.chart.title.PaintScaleLegend.setPosition方法的典型用法代码示例。如果您正苦于以下问题:Java PaintScaleLegend.setPosition方法的具体用法?Java PaintScaleLegend.setPosition怎么用?Java PaintScaleLegend.setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.title.PaintScaleLegend
的用法示例。
在下文中一共展示了PaintScaleLegend.setPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: resetRenderer
import org.jfree.chart.title.PaintScaleLegend; //导入方法依赖的package包/类
protected void resetRenderer(final IScope scope, final String serieid) {
final XYBlockRenderer newr = (XYBlockRenderer) this.getOrCreateRenderer(scope, serieid);
// newr.setSeriesStroke(0, new BasicStroke(0));
final ChartDataSeries myserie = this.getChartdataset().getDataSeries(scope, serieid);
if (myserie.getMycolor() != null) {
newr.setSeriesPaint(0, myserie.getMycolor());
}
if (myserie.getSValues(scope).size() > 0) {
final double maxval = Collections.max(myserie.getSValues(scope));
final double minval = Collections.min(myserie.getSValues(scope));
Color cdeb = new Color(0, 0, 0, 0);
if (myserie.getMyMincolor() != null)
cdeb = myserie.getMyMincolor();
Color cend = new Color(0.9f, 0.9f, 0.9f, 1.0f);
if (myserie.getMycolor() != null)
cend = myserie.getMycolor();
LookupPaintScale paintscale = createLUT(100, (float) minval, (float) maxval, cdeb, cend);
if (myserie.getMyMedcolor() != null)
paintscale = createLUT(100, (float) minval, (float) maxval, cdeb, myserie.getMyMedcolor(), cend);
newr.setPaintScale(paintscale);
final NumberAxis scaleAxis = new NumberAxis(myserie.getName());
scaleAxis.setAxisLinePaint(this.axesColor);
scaleAxis.setTickMarkPaint(this.axesColor);
scaleAxis.setTickLabelFont(this.getTickFont());
scaleAxis.setRange(minval, maxval);
scaleAxis.setAxisLinePaint(axesColor);
scaleAxis.setLabelFont(getLabelFont());
if (textColor != null) {
scaleAxis.setLabelPaint(textColor);
scaleAxis.setTickLabelPaint(textColor);
}
if (!this.getXTickValueVisible(scope))
{
scaleAxis.setTickMarksVisible(false);
scaleAxis.setTickLabelsVisible(false);
}
final PaintScaleLegend legend = new PaintScaleLegend(paintscale, scaleAxis);
legend.setAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
legend.setAxisOffset(5.0);
// legend.setMargin(new RectangleInsets(5, 5, 5, 5));
// legend.setFrame(new BlockBorder(Color.red));
// legend.setPadding(new RectangleInsets(10, 10, 10, 10));
// legend.setStripWidth(10);
legend.setPosition(RectangleEdge.RIGHT);
legend.setBackgroundPaint(this.backgroundColor);
// ArrayList<PaintScaleLegend> caxe=new
// ArrayList<PaintScaleLegend>();
// caxe.add(legend);
// chart.setSubtitles(caxe);
if (!this.series_label_position.equals("none"))
chart.addSubtitle(legend);
}
}