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


Java Zoomable.zoomRangeAxes方法代码示例

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


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

示例1: handleZoomable

import org.jfree.chart.plot.Zoomable; //导入方法依赖的package包/类
/**
 * Handle the case where a plot implements the {@link Zoomable} interface.
 *
 * @param zoomable  the zoomable plot.
 * @param e  the mouse wheel event.
 */
private void handleZoomable(ChartCanvas canvas, Zoomable zoomable, 
        ScrollEvent e) {
    // don't zoom unless the mouse pointer is in the plot's data area
    ChartRenderingInfo info = canvas.getRenderingInfo();
    PlotRenderingInfo pinfo = info.getPlotInfo();
    Point2D p = new Point2D.Double(e.getX(), e.getY());
    if (pinfo.getDataArea().contains(p)) {
        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
        boolean notifyState = plot.isNotify();
        plot.setNotify(false);
        int clicks = (int) e.getDeltaY();
        double zf = 1.0 + this.zoomFactor;
        if (clicks < 0) {
            zf = 1.0 / zf;
        }
        if (canvas.isDomainZoomable()) {
            zoomable.zoomDomainAxes(zf, pinfo, p, true);
        }
        if (canvas.isRangeZoomable()) {
            zoomable.zoomRangeAxes(zf, pinfo, p, true);
        }
        plot.setNotify(notifyState);  // this generates the change event too
    } 
}
 
开发者ID:jfree,项目名称:jfreechart-fx,代码行数:32,代码来源:ScrollHandlerFX.java

示例2: handleZoomable

import org.jfree.chart.plot.Zoomable; //导入方法依赖的package包/类
/**
 * Handle the case where a plot implements the {@link Zoomable} interface.
 *
 * @param zoomable  the zoomable plot.
 * @param e  the mouse wheel event.
 */
private void handleZoomable(ChartCanvas canvas, Zoomable zoomable, 
        ScrollEvent e) {
    // don't zoom unless the mouse pointer is in the plot's data area
    ChartRenderingInfo info = canvas.getRenderingInfo();
    PlotRenderingInfo pinfo = info.getPlotInfo();
    Point2D p = new Point2D.Double(e.getX(), e.getY());
    if (pinfo.getDataArea().contains(p)) {
        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
        boolean notifyState = plot.isNotify();
        plot.setNotify(false);
        int clicks = (int) e.getDeltaY();
        double zf = 1.0 + this.zoomFactor;
        if (clicks < 0) {
            zf = 1.0 / zf;
        }
        if (true) { //this.chartPanel.isDomainZoomable()) {
            zoomable.zoomDomainAxes(zf, pinfo, p, true);
        }
        if (true) { //this.chartPanel.isRangeZoomable()) {
            zoomable.zoomRangeAxes(zf, pinfo, p, true);
        }
        plot.setNotify(notifyState);  // this generates the change event too
    } 
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:32,代码来源:ScrollHandlerFX.java

示例3: zoomInRange

import org.jfree.chart.plot.Zoomable; //导入方法依赖的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 zoomInRange(double x, double y) {
    Plot plot = this.chart.getPlot();
    if (plot instanceof Zoomable) {
        // 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);
        Zoomable z = (Zoomable) plot;
        z.zoomRangeAxes(this.zoomInFactor, this.info.getPlotInfo(),
                translateScreenToJava2D(new Point((int) x, (int) y)),
                this.zoomAroundAnchor);
        plot.setNotify(savedNotify);
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:24,代码来源:ChartPanel.java

示例4: zoomOutRange

import org.jfree.chart.plot.Zoomable; //导入方法依赖的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 zoomOutRange(double x, double y) {
    Plot plot = this.chart.getPlot();
    if (plot instanceof Zoomable) {
        // 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);
        Zoomable z = (Zoomable) plot;
        z.zoomRangeAxes(this.zoomOutFactor, this.info.getPlotInfo(),
                translateScreenToJava2D(new Point((int) x, (int) y)),
                this.zoomAroundAnchor);
        plot.setNotify(savedNotify);
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:24,代码来源:ChartPanel.java

示例5: restoreAutoRangeBounds

import org.jfree.chart.plot.Zoomable; //导入方法依赖的package包/类
/**
 * Restores the auto-range calculation on the range axis.
 */
public void restoreAutoRangeBounds() {
    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);
    }
}
 
开发者ID:nick-paul,项目名称:aya-lang,代码行数:20,代码来源:ChartPanel.java

示例6: selectCompleteRangeBounds

import org.jfree.chart.plot.Zoomable; //导入方法依赖的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);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:33,代码来源:AbstractChartPanel.java

示例7: zoomInRange

import org.jfree.chart.plot.Zoomable; //导入方法依赖的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 zoomInRange(double x, double y) {
    Plot p = this.chart.getPlot();
    if (p instanceof Zoomable) {
        Zoomable z = (Zoomable) p;
        z.zoomRangeAxes(this.zoomInFactor, this.info.getPlotInfo(), 
                translateScreenToJava2D(new Point((int) x, (int) y)));
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:ChartComposite.java

示例8: zoomOutRange

import org.jfree.chart.plot.Zoomable; //导入方法依赖的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 zoomOutRange(double x, double y) {
    Plot p = this.chart.getPlot();
    if (p instanceof Zoomable) {
        Zoomable z = (Zoomable) p;
        z.zoomRangeAxes(this.zoomOutFactor, this.info.getPlotInfo(), 
                translateScreenToJava2D(new Point((int) x, (int) y)));
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:ChartComposite.java

示例9: zoom

import org.jfree.chart.plot.Zoomable; //导入方法依赖的package包/类
/**
 * Zooms in on a selected region.
 *
 * @param selection  the selected region.
 */
public void zoom(Rectangle selection) {

    // get the origin of the zoom selection in the Java2D space used for
    // drawing the chart (that is, before any scaling to fit the panel)
    Point2D selectOrigin = translateScreenToJava2D(
            new Point(selection.x, selection.y));
    PlotRenderingInfo plotInfo = this.info.getPlotInfo();
    Rectangle scaledDataArea = getScreenDataArea(
            (int) (selection.x + selection.width)/2, 
            (int) (selection.y + selection.height)/2);
    if ((selection.height > 0) && (selection.width > 0)) {

        double hLower = (selection.x - scaledDataArea.x) 
            / (double) scaledDataArea.width;
        double hUpper = (selection.x + selection.width - scaledDataArea.x) 
            / (double) scaledDataArea.width;
        double vLower = (scaledDataArea.y + scaledDataArea.height - selection.y - selection.height) 
            / (double) scaledDataArea.height;
        double vUpper = (scaledDataArea.y + scaledDataArea.height - selection.y) 
            / (double) scaledDataArea.height;
        Plot p = this.chart.getPlot();
        if (p instanceof Zoomable) {
            Zoomable z = (Zoomable) p;
            if (z.getOrientation() == PlotOrientation.HORIZONTAL) {
                z.zoomDomainAxes(vLower, vUpper, plotInfo, selectOrigin);
                z.zoomRangeAxes(hLower, hUpper, plotInfo, selectOrigin);
            }
            else {
                z.zoomDomainAxes(hLower, hUpper, plotInfo, selectOrigin);
                z.zoomRangeAxes(vLower, vUpper, plotInfo, selectOrigin);
            }
        }

    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:42,代码来源:ChartComposite.java

示例10: restoreAutoRangeBounds

import org.jfree.chart.plot.Zoomable; //导入方法依赖的package包/类
/**
 * Restores the auto-range calculation on the range axis.
 */
public void restoreAutoRangeBounds() {
    Plot p = this.chart.getPlot();
    if (p instanceof ValueAxisPlot)
    {
        Zoomable z = (Zoomable) p;
        z.zoomRangeAxes(0.0, this.info.getPlotInfo(), SWTUtils.toAwtPoint(this.zoomPoint)); 
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:ChartComposite.java

示例11: zoom

import org.jfree.chart.plot.Zoomable; //导入方法依赖的package包/类
/**
 * Zooms in on a selected region.
 *
 * @param selection  the selected region.
 */
public void zoom(Rectangle2D selection) {

    // get the origin of the zoom selection in the Java2D space used for
    // drawing the chart (that is, before any scaling to fit the panel)
    Point2D selectOrigin = translateScreenToJava2D(new Point(
            (int) Math.ceil(selection.getX()), 
            (int) Math.ceil(selection.getY())));
    PlotRenderingInfo plotInfo = this.info.getPlotInfo();
    Rectangle2D scaledDataArea = getScreenDataArea(
            (int) selection.getCenterX(), (int) selection.getCenterY());
    if ((selection.getHeight() > 0) && (selection.getWidth() > 0)) {

        double hLower = (selection.getMinX() - scaledDataArea.getMinX()) 
            / scaledDataArea.getWidth();
        double hUpper = (selection.getMaxX() - scaledDataArea.getMinX()) 
            / scaledDataArea.getWidth();
        double vLower = (scaledDataArea.getMaxY() - selection.getMaxY()) 
            / scaledDataArea.getHeight();
        double vUpper = (scaledDataArea.getMaxY() - selection.getMinY()) 
            / scaledDataArea.getHeight();

        Plot p = this.chart.getPlot();
        if (p instanceof Zoomable) {
            Zoomable z = (Zoomable) p;
            if (z.getOrientation() == PlotOrientation.HORIZONTAL) {
                z.zoomDomainAxes(vLower, vUpper, plotInfo, selectOrigin);
                z.zoomRangeAxes(hLower, hUpper, plotInfo, selectOrigin);
            }
            else {
                z.zoomDomainAxes(hLower, hUpper, plotInfo, selectOrigin);
                z.zoomRangeAxes(vLower, vUpper, plotInfo, selectOrigin);
            }
        }

    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:43,代码来源:ChartPanel.java

示例12: restoreAutoRangeBounds

import org.jfree.chart.plot.Zoomable; //导入方法依赖的package包/类
/**
 * Restores the auto-range calculation on the range axis.
 */
public void restoreAutoRangeBounds() {
    Plot p = this.chart.getPlot();
    if (p instanceof Zoomable) {
        Zoomable z = (Zoomable) p;
        z.zoomRangeAxes(0.0, this.info.getPlotInfo(), this.zoomPoint);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:11,代码来源:ChartPanel.java

示例13: zoomInRange

import org.jfree.chart.plot.Zoomable; //导入方法依赖的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 zoomInRange(double x, double y) {
    Plot p = this.chart.getPlot();
    if (p instanceof Zoomable) {
        Zoomable z = (Zoomable) p;
        z.zoomRangeAxes(this.zoomInFactor, this.info.getPlotInfo(),
                translateScreenToJava2D(new Point((int) x, (int) y)));
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:17,代码来源:ChartComposite.java

示例14: zoomOutRange

import org.jfree.chart.plot.Zoomable; //导入方法依赖的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 zoomOutRange(double x, double y) {
    Plot p = this.chart.getPlot();
    if (p instanceof Zoomable) {
        Zoomable z = (Zoomable) p;
        z.zoomRangeAxes(this.zoomOutFactor, this.info.getPlotInfo(),
                translateScreenToJava2D(new Point((int) x, (int) y)));
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:17,代码来源:ChartComposite.java

示例15: zoom

import org.jfree.chart.plot.Zoomable; //导入方法依赖的package包/类
/**
 * Zooms in on a selected region.
 *
 * @param selection  the selected region.
 */
public void zoom(Rectangle selection) {

    // get the origin of the zoom selection in the Java2D space used for
    // drawing the chart (that is, before any scaling to fit the panel)
    Point2D selectOrigin = translateScreenToJava2D(
            new Point(selection.x, selection.y));
    PlotRenderingInfo plotInfo = this.info.getPlotInfo();
    Rectangle scaledDataArea = getScreenDataArea(
            (selection.x + selection.width / 2),
            (selection.y + selection.height / 2));
    if ((selection.height > 0) && (selection.width > 0)) {

        double hLower = (selection.x - scaledDataArea.x)
            / (double) scaledDataArea.width;
        double hUpper = (selection.x + selection.width - scaledDataArea.x)
            / (double) scaledDataArea.width;
        double vLower = (scaledDataArea.y + scaledDataArea.height
                - selection.y - selection.height)
                / (double) scaledDataArea.height;
        double vUpper = (scaledDataArea.y + scaledDataArea.height
                - selection.y) / (double) scaledDataArea.height;
        Plot p = this.chart.getPlot();
        if (p instanceof Zoomable) {
            Zoomable z = (Zoomable) p;
            if (z.getOrientation() == PlotOrientation.HORIZONTAL) {
                z.zoomDomainAxes(vLower, vUpper, plotInfo, selectOrigin);
                z.zoomRangeAxes(hLower, hUpper, plotInfo, selectOrigin);
            }
            else {
                z.zoomDomainAxes(hLower, hUpper, plotInfo, selectOrigin);
                z.zoomRangeAxes(vLower, vUpper, plotInfo, selectOrigin);
            }
        }

    }

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:43,代码来源:ChartComposite.java


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