Java Code Examples for org.jfree.chart.axis.ValueAxis#resizeRange()

The following examples show how to use org.jfree.chart.axis.ValueAxis#resizeRange() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XYPlot.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Multiplies the range on the domain axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomDomainAxes(double factor, PlotRenderingInfo info,
                           Point2D source, boolean useAnchor) {

    // perform the zoom on each domain axis
    for (ValueAxis xAxis : this.domainAxes.values()) {
        if (xAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceX = source.getX();
            if (this.orientation == PlotOrientation.HORIZONTAL) {
                sourceX = source.getY();
            }
            double anchorX = xAxis.java2DToValue(sourceX,
                    info.getDataArea(), getDomainAxisEdge());
            xAxis.resizeRange2(factor, anchorX);
        } else {
            xAxis.resizeRange(factor);
        }
    }
}
 
Example 2
Source File: PolarPlot.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
    // get the source coordinate - this plot has always a VERTICAL
    // orientation
    final double sourceX = source.getX();

    for (int axisIdx = 0; axisIdx < getAxisCount(); axisIdx++) {
        final ValueAxis axis = getAxis(axisIdx);
        if (axis != null) {
            if (useAnchor) {
                double anchorX = axis.java2DToValue(sourceX,
                        info.getDataArea(), RectangleEdge.BOTTOM);
                axis.resizeRange(factor, anchorX);
            }
            else {
                axis.resizeRange(factor);
            }
        }
    }
}
 
Example 3
Source File: XYPlot.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (ValueAxis yAxis : this.rangeAxes.values()) {
        if (yAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceY = source.getY();
            if (this.orientation == PlotOrientation.HORIZONTAL) {
                sourceY = source.getX();
            }
            double anchorY = yAxis.java2DToValue(sourceY,
                    info.getDataArea(), getRangeAxisEdge());
            yAxis.resizeRange2(factor, anchorY);
        } else {
            yAxis.resizeRange(factor);
        }
    }
}
 
Example 4
Source File: XYPlot.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (ValueAxis yAxis : this.rangeAxes.values()) {
        if (yAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceY = source.getY();
            if (this.orientation == PlotOrientation.HORIZONTAL) {
                sourceY = source.getX();
            }
            double anchorY = yAxis.java2DToValue(sourceY,
                    info.getDataArea(), getRangeAxisEdge());
            yAxis.resizeRange2(factor, anchorY);
        } else {
            yAxis.resizeRange(factor);
        }
    }
}
 
Example 5
Source File: PolarPlot.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
    // get the source coordinate - this plot has always a VERTICAL
    // orientation
    final double sourceX = source.getX();

    for (int axisIdx = 0; axisIdx < getAxisCount(); axisIdx++) {
        final ValueAxis axis = getAxis(axisIdx);
        if (axis != null) {
            if (useAnchor) {
                double anchorX = axis.java2DToValue(sourceX,
                        info.getDataArea(), RectangleEdge.BOTTOM);
                axis.resizeRange(factor, anchorX);
            }
            else {
                axis.resizeRange(factor);
            }
        }
    }
}
 
Example 6
Source File: Cardumen_0082_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            if (useAnchor) {
                // get the relevant source coordinate given the plot
                // orientation
                double sourceY = source.getY();
                if (this.orientation == PlotOrientation.HORIZONTAL) {
                    sourceY = source.getX();
                }
                double anchorY = rangeAxis.java2DToValue(sourceY,
                        info.getDataArea(), getRangeAxisEdge());
                rangeAxis.resizeRange2(factor, anchorY);
            }
            else {
                rangeAxis.resizeRange(factor);
            }
        }
    }
}
 
Example 7
Source File: CategoryPlot.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            if (useAnchor) {
                // get the relevant source coordinate given the plot
                // orientation
                double sourceY = source.getY();
                if (this.orientation == PlotOrientation.HORIZONTAL) {
                    sourceY = source.getX();
                }
                double anchorY = rangeAxis.java2DToValue(sourceY,
                        info.getDataArea(), getRangeAxisEdge());
                rangeAxis.resizeRange2(factor, anchorY);
            }
            else {
                rangeAxis.resizeRange(factor);
            }
        }
    }
}
 
Example 8
Source File: XYPlot.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Multiplies the range on the domain axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point (in Java2D space).
 * @param useAnchor  use source point as zoom anchor?
 *
 * @see #zoomRangeAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomDomainAxes(double factor, PlotRenderingInfo info,
                           Point2D source, boolean useAnchor) {

    // perform the zoom on each domain axis
    for (ValueAxis xAxis : this.domainAxes.values()) {
        if (xAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceX = source.getX();
            if (this.orientation == PlotOrientation.HORIZONTAL) {
                sourceX = source.getY();
            }
            double anchorX = xAxis.java2DToValue(sourceX,
                    info.getDataArea(), getDomainAxisEdge());
            xAxis.resizeRange2(factor, anchorX);
        } else {
            xAxis.resizeRange(factor);
        }
    }
}
 
Example 9
Source File: XYPlot.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (ValueAxis yAxis : this.rangeAxes.values()) {
        if (yAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceY = source.getY();
            if (this.orientation == PlotOrientation.HORIZONTAL) {
                sourceY = source.getX();
            }
            double anchorY = yAxis.java2DToValue(sourceY,
                    info.getDataArea(), getRangeAxisEdge());
            yAxis.resizeRange2(factor, anchorY);
        } else {
            yAxis.resizeRange(factor);
        }
    }
}
 
Example 10
Source File: Chart_14_CategoryPlot_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 * 
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 * 
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
            
    // perform the zoom on each range axis
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            if (useAnchor) {
                // get the relevant source coordinate given the plot 
                // orientation
                double sourceY = source.getY();
                if (this.orientation == PlotOrientation.HORIZONTAL) {
                    sourceY = source.getX();
                }
                double anchorY = rangeAxis.java2DToValue(sourceY, 
                        info.getDataArea(), getRangeAxisEdge());
                rangeAxis.resizeRange(factor, anchorY);
            }
            else {
                rangeAxis.resizeRange(factor);
            }
        }
    }
}
 
Example 11
Source File: Chart_14_CategoryPlot_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 * 
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 * 
 * @since 1.0.7
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {
            
    // perform the zoom on each range axis
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            if (useAnchor) {
                // get the relevant source coordinate given the plot 
                // orientation
                double sourceY = source.getY();
                if (this.orientation == PlotOrientation.HORIZONTAL) {
                    sourceY = source.getX();
                }
                double anchorY = rangeAxis.java2DToValue(sourceY, 
                        info.getDataArea(), getRangeAxisEdge());
                rangeAxis.resizeRange(factor, anchorY);
            }
            else {
                rangeAxis.resizeRange(factor);
            }
        }
    }
}
 
Example 12
Source File: CategoryPlot.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param info  the plot rendering info.
 * @param source  the source point.
 * @param useAnchor  a flag that controls whether or not the source point
 *         is used for the zoom anchor.
 *
 * @see #zoomDomainAxes(double, PlotRenderingInfo, Point2D, boolean)
 *
 * @since 1.0.7
 */
@Override
public void zoomRangeAxes(double factor, PlotRenderingInfo info,
                          Point2D source, boolean useAnchor) {

    // perform the zoom on each range axis
    for (ValueAxis rangeAxis : this.rangeAxes.values()) {
        if (rangeAxis == null) {
            continue;
        }
        if (useAnchor) {
            // get the relevant source coordinate given the plot orientation
            double sourceY = source.getY();
            if (this.orientation.isHorizontal()) {
                sourceY = source.getX();
            }
            double anchorY = rangeAxis.java2DToValue(sourceY,
                    info.getDataArea(), getRangeAxisEdge());
            rangeAxis.resizeRange2(factor, anchorY);
        } else {
            rangeAxis.resizeRange(factor);
        }
    }
}
 
Example 13
Source File: Cardumen_006_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param state  the plot state.
 * @param source  the source point (in Java2D space) for the zoom.
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo state, 
                          Point2D source) {
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            rangeAxis.resizeRange(factor);
        }
    }
}
 
Example 14
Source File: jMutRepair_0021_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param state  the plot state.
 * @param source  the source point (in Java2D space) for the zoom.
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo state, 
                          Point2D source) {
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            rangeAxis.resizeRange(factor);
        }
    }
}
 
Example 15
Source File: jMutRepair_0021_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param state  the plot state.
 * @param source  the source point (in Java2D space) for the zoom.
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo state, 
                          Point2D source) {
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            rangeAxis.resizeRange(factor);
        }
    }
}
 
Example 16
Source File: JGenProg2017_005_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param state  the plot state.
 * @param source  the source point (in Java2D space) for the zoom.
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo state, 
                          Point2D source) {
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            rangeAxis.resizeRange(factor);
        }
    }
}
 
Example 17
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param state  the plot state.
 * @param source  the source point (in Java2D space) for the zoom.
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo state, 
                          Point2D source) {
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            rangeAxis.resizeRange(factor);
        }
    }
}
 
Example 18
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Multiplies the range on the range axis/axes by the specified factor.
 *
 * @param factor  the zoom factor.
 * @param state  the plot state.
 * @param source  the source point (in Java2D space) for the zoom.
 */
public void zoomRangeAxes(double factor, PlotRenderingInfo state, 
                          Point2D source) {
    for (int i = 0; i < this.rangeAxes.size(); i++) {
        ValueAxis rangeAxis = (ValueAxis) this.rangeAxes.get(i);
        if (rangeAxis != null) {
            rangeAxis.resizeRange(factor);
        }
    }
}
 
Example 19
Source File: ChartLogics.java    From mzmine3 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Auto range the axis
 * 
 * @param axis
 */
public static void autoAxis(ValueAxis axis) {
  axis.resizeRange(0);
}
 
Example 20
Source File: ChartLogics.java    From old-mzmine3 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Auto range the axis
 * 
 * @param axis
 */
public static void autoAxis(ValueAxis axis) {
  axis.resizeRange(0);
}