本文整理汇总了Java中org.jfree.chart.plot.XYPlot.getRangeAxisCount方法的典型用法代码示例。如果您正苦于以下问题:Java XYPlot.getRangeAxisCount方法的具体用法?Java XYPlot.getRangeAxisCount怎么用?Java XYPlot.getRangeAxisCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.plot.XYPlot
的用法示例。
在下文中一共展示了XYPlot.getRangeAxisCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateYFieldValue
import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
* Updates the preselected y-value.
*/
private void updateYFieldValue() {
// update preselected y value because range axis has been changed
if (mousePosition != null) {
Rectangle2D plotArea = engine.getChartPanel().getScreenDataArea();
if (engine.getChartPanel().getChart().getPlot() instanceof XYPlot) {
XYPlot plot = (XYPlot) engine.getChartPanel().getChart().getPlot();
// calculate y value
for (int i = 0; i < plot.getRangeAxisCount(); i++) {
ValueAxis config = plot.getRangeAxis(i);
if (config != null && config.getLabel() != null) {
if (config.getLabel().equals(String.valueOf(rangeAxisSelectionCombobox.getSelectedItem()))) {
double chartY = config.java2DToValue(mousePosition.getY(), plotArea, plot.getRangeAxisEdge());
yField.setText(String.valueOf(chartY));
}
}
}
}
}
}
示例2: resolveYAxis
import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
@Override
public Collection<String> resolveYAxis(int axisIndex) {
Plot p = chart.getPlot();
Collection<String> names = new LinkedList<>();
if (p instanceof XYPlot) {
XYPlot plot = (XYPlot) p;
for (int i = 0; i < plot.getRangeAxisCount(); i++) {
ValueAxis domain = plot.getRangeAxis(i);
names.add(domain.getLabel());
}
}
return names;
}
示例3: shrinkSelectionOnRange
import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
* Decreases the length of the range axis, centered about the given coordinate on the screen.
* The length of the range axis is reduced by the value of {@link #getZoomInFactor()}.
*
* @param x
* the x-coordinate (in screen coordinates).
* @param y
* the y coordinate (in screen coordinates).
*/
public void shrinkSelectionOnRange(double x, double y, MouseEvent selectionEvent) {
Plot p = this.chart.getPlot();
if (p instanceof XYPlot) {
XYPlot plot = (XYPlot) p;
Selection selectionObject = new Selection();
for (int i = 0; i < plot.getRangeAxisCount(); i++) {
ValueAxis domain = plot.getRangeAxis(i);
double zoomFactor = getZoomInFactor();
shrinkSelectionYAxis(x, y, selectionObject, domain, i, zoomFactor);
}
informSelectionListener(selectionObject, selectionEvent);
}
}
示例4: enlargeSelectionOnRange
import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
* Increases the length the range axis, centered about the given coordinate on the screen. The
* length of the range axis is increased by the value of {@link #getZoomOutFactor()}.
*
* @param x
* the x coordinate (in screen coordinates).
* @param y
* the y-coordinate (in screen coordinates).
*/
public void enlargeSelectionOnRange(double x, double y, MouseEvent selectionEvent) {
Plot p = this.chart.getPlot();
if (p instanceof XYPlot) {
XYPlot plot = (XYPlot) p;
Selection selectionObject = new Selection();
for (int i = 0; i < plot.getRangeAxisCount(); i++) {
ValueAxis domain = plot.getRangeAxis(i);
double zoomFactor = getZoomOutFactor();
shrinkSelectionYAxis(x, y, selectionObject, domain, i, zoomFactor);
}
informSelectionListener(selectionObject, selectionEvent);
}
}
示例5: selectCompleteRangeBounds
import org.jfree.chart.plot.XYPlot; //导入方法依赖的package包/类
/**
* Restores the auto-range calculation on the range axis.
*/
public void selectCompleteRangeBounds() {
Plot plot = this.chart.getPlot();
if (plot instanceof Zoomable) {
Zoomable z = (Zoomable) plot;
// here we tweak the notify flag on the plot so that only
// one notification happens even though we update multiple
// axes...
boolean savedNotify = plot.isNotify();
plot.setNotify(false);
// we need to guard against this.zoomPoint being null
Point2D zp = this.zoomPoint != null ? this.zoomPoint : new Point();
z.zoomRangeAxes(0.0, this.info.getPlotInfo(), zp);
plot.setNotify(savedNotify);
if (plot instanceof XYPlot) {
XYPlot xyPlot = (XYPlot) plot;
Selection selectionObject = new Selection();
for (int i = 0; i < xyPlot.getRangeAxisCount(); i++) {
ValueAxis range = xyPlot.getRangeAxis(i);
Range axisRange = new Range(range.getLowerBound(), range.getUpperBound());
for (String axisName : axisNameResolver.resolveYAxis(i)) {
selectionObject.addDelimiter(axisName, axisRange);
}
}
informSelectionListener(selectionObject, null);
}
}
}