Java 类org.jfree.chart.plot.CrosshairState 实例源码

项目:parabuild-ci    文件:XYDifferenceRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color 
 *              information etc).
 * @param domainAxis  the domain (horizontal) axis.
 * @param rangeAxis  the range (vertical) axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot 
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    if (pass == 0) {
        drawItemPass0(g2, dataArea, info, plot, domainAxis, rangeAxis, 
                dataset, series, item, crosshairState);
    }
    else if (pass == 1) {
        drawItemPass1(g2, dataArea, info, plot, domainAxis, rangeAxis, 
                dataset, series, item, crosshairState);
    }

}
项目:parabuild-ci    文件:XYBoxAndWhiskerRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the plot is being drawn.
 * @param info  collects info about the drawing.
 * @param plot  the plot (can be used to obtain standard color 
 *              information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot 
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2, 
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot, 
                     ValueAxis domainAxis, 
                     ValueAxis rangeAxis,
                     XYDataset dataset, 
                     int series, 
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    PlotOrientation orientation = plot.getOrientation();

    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }

}
项目:PhET    文件:PositionHistogramPlot.java   
public void drawItem(Graphics2D g2,
        XYItemRendererState state,
        Rectangle2D dataArea,
        PlotRenderingInfo info,
        XYPlot plot,
        ValueAxis domainAxis,
        ValueAxis rangeAxis,
        XYDataset dataset,
        int seriesIndex,
        int itemIndex,
        CrosshairState crosshairState,
        int pass) {
    PhetHistogramSeries series = ((PhetHistogramDataset)dataset).getSeries( seriesIndex );
    if ( series.getNumberOfObservations() == 0 ) {
        return;
    }
    super.drawItem( g2, state, dataArea, info, plot, domainAxis, rangeAxis, dataset, seriesIndex, itemIndex, crosshairState, pass );
}
项目:HTML5_WebSite    文件:XYDifferenceRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color
 *              information etc).
 * @param domainAxis  the domain (horizontal) axis.
 * @param rangeAxis  the range (vertical) axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    if (pass == 0) {
        drawItemPass0(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState);
    }
    else if (pass == 1) {
        drawItemPass1(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState);
    }

}
项目:HTML5_WebSite    文件:XYBoxAndWhiskerRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the plot is being drawn.
 * @param info  collects info about the drawing.
 * @param plot  the plot (can be used to obtain standard color
 *              information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset (must be an instance of
 *                 {@link BoxAndWhiskerXYDataset}).
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    PlotOrientation orientation = plot.getOrientation();

    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }

}
项目:OAT    文件:IndicatorRenderer.java   
@Override
public void drawItem(Graphics2D g2,
        XYItemRendererState state,
        Rectangle2D dataArea,
        PlotRenderingInfo info,
        XYPlot plot,
        ValueAxis domainAxis,
        ValueAxis rangeAxis,
        XYDataset dataset,
        int series,
        int item,
        CrosshairState crosshairState,
        int pass) {

    setSeriesShape(series, shape, false);
    setSeriesStroke(series, stroke, false);

    if (seriesPaint != null && series < seriesPaint.length) {
        setSeriesPaint(series, seriesPaint[series], false);
    }

    super.drawItem(g2, state, dataArea, info, plot,
            domainAxis, rangeAxis, dataset, series, item,
            crosshairState, pass);
}
项目:PI    文件:XYDifferenceRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color
 *              information etc).
 * @param domainAxis  the domain (horizontal) axis.
 * @param rangeAxis  the range (vertical) axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    if (pass == 0) {
        drawItemPass0(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState);
    }
    else if (pass == 1) {
        drawItemPass1(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState);
    }

}
项目:PI    文件:XYBoxAndWhiskerRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the plot is being drawn.
 * @param info  collects info about the drawing.
 * @param plot  the plot (can be used to obtain standard color
 *              information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset (must be an instance of
 *                 {@link BoxAndWhiskerXYDataset}).
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    PlotOrientation orientation = plot.getOrientation();

    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }

}
项目:nabs    文件:XYDifferenceRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color 
 *              information etc).
 * @param domainAxis  the domain (horizontal) axis.
 * @param rangeAxis  the range (vertical) axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot 
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    if (pass == 0) {
        drawItemPass0(g2, dataArea, info, plot, domainAxis, rangeAxis, 
                dataset, series, item, crosshairState);
    }
    else if (pass == 1) {
        drawItemPass1(g2, dataArea, info, plot, domainAxis, rangeAxis, 
                dataset, series, item, crosshairState);
    }

}
项目:nabs    文件:XYBoxAndWhiskerRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the plot is being drawn.
 * @param info  collects info about the drawing.
 * @param plot  the plot (can be used to obtain standard color 
 *              information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot 
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2, 
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot, 
                     ValueAxis domainAxis, 
                     ValueAxis rangeAxis,
                     XYDataset dataset, 
                     int series, 
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    PlotOrientation orientation = plot.getOrientation();

    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }

}
项目:opensim-gui    文件:ExcitationRenderer.java   
public void drawFunctions(Graphics2D g2,
        XYItemRendererState state,
        Rectangle2D dataArea,
        XYPlot plot,
        ValueAxis domainAxis,
        ValueAxis rangeAxis,
        XYDataset dataset,
        CrosshairState crosshairState) {

   if (fillMode == ExcitationFillMode.MIN_MAX) {
      fillMinMax(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset);
   } else if (fillMode == ExcitationFillMode.MIN_MAX_EXC) {
      fillMinMaxExc(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset);
   }
   super.drawFunctions(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset, crosshairState);
}
项目:opensim-gui    文件:XYDifferenceRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color 
 *              information etc).
 * @param domainAxis  the domain (horizontal) axis.
 * @param rangeAxis  the range (vertical) axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot 
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    if (pass == 0) {
        drawItemPass0(g2, dataArea, info, plot, domainAxis, rangeAxis, 
                dataset, series, item, crosshairState);
    }
    else if (pass == 1) {
        drawItemPass1(g2, dataArea, info, plot, domainAxis, rangeAxis, 
                dataset, series, item, crosshairState);
    }

}
项目:opensim-gui    文件:XYBoxAndWhiskerRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the plot is being drawn.
 * @param info  collects info about the drawing.
 * @param plot  the plot (can be used to obtain standard color 
 *              information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot 
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2, 
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot, 
                     ValueAxis domainAxis, 
                     ValueAxis rangeAxis,
                     XYDataset dataset, 
                     int series, 
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    PlotOrientation orientation = plot.getOrientation();

    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState, pass);
    }

}
项目:snap-desktop    文件:XYImagePlot.java   
@Override
public boolean render(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info, CrosshairState crosshairState) {
    final boolean foundData = super.render(g2, dataArea, index, info, crosshairState);
    if (image != null) {
        final int dx1 = (int) dataArea.getMinX();
        final int dy1 = (int) dataArea.getMinY();
        final int dx2 = (int) dataArea.getMaxX();
        final int dy2 = (int) dataArea.getMaxY();

        synchronized (imageLock) {
            final Rectangle rectangle = getImageSourceArea();
            final int sx1 = rectangle.x;
            final int sy1 = rectangle.y;
            final int sx2 = sx1 + rectangle.width - 1;
            final int sy2 = sy1 + rectangle.height - 1;
            g2.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);
        }
    }
    return foundData;
}
项目:proyecto-teoria-control-utn-frro    文件:XYDifferenceRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color
 *              information etc).
 * @param domainAxis  the domain (horizontal) axis.
 * @param rangeAxis  the range (vertical) axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    if (pass == 0) {
        drawItemPass0(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState);
    }
    else if (pass == 1) {
        drawItemPass1(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState);
    }

}
项目:Memetic-Algorithm-for-TSP    文件:XYDifferenceRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color
 *              information etc).
 * @param domainAxis  the domain (horizontal) axis.
 * @param rangeAxis  the range (vertical) axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    if (pass == 0) {
        drawItemPass0(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState);
    }
    else if (pass == 1) {
        drawItemPass1(g2, dataArea, info, plot, domainAxis, rangeAxis,
                dataset, series, item, crosshairState);
    }

}
项目:parabuild-ci    文件:XYDifferenceRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color information etc).
 * @param domainAxis  the domain (horizontal) axis.
 * @param rangeAxis  the range (vertical) axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    if (pass == 0) {
        drawItemPass0(
            g2, dataArea, info, plot, domainAxis, rangeAxis, dataset,
            series, item, crosshairState
        );
    }
    else if (pass == 1) {
        drawItemPass1(
            g2, dataArea, info, plot, domainAxis, rangeAxis, dataset,
            series, item, crosshairState
        );
    }

}
项目:parabuild-ci    文件:XYDotRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color information etc).
 * @param domainAxis  the domain (horizontal) axis.
 * @param rangeAxis  the range (vertical) axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset dataset,
                     int series,
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    // get the data point...
    Number xn = dataset.getX(series, item);
    Number yn = dataset.getY(series, item);
    if (yn != null) {
        double x = xn.doubleValue();
        double y = yn.doubleValue();
        RectangleEdge xAxisLocation = plot.getDomainAxisEdge();
        RectangleEdge yAxisLocation = plot.getRangeAxisEdge();
        double transX = domainAxis.valueToJava2D(x, dataArea, xAxisLocation);
        double transY = rangeAxis.valueToJava2D(y, dataArea, yAxisLocation);

        g2.setPaint(this.getItemPaint(series, item));
        PlotOrientation orientation = plot.getOrientation();
        if (orientation == PlotOrientation.HORIZONTAL) {
            g2.drawRect((int) transY, (int) transX, 1, 1);
        }
        else if (orientation == PlotOrientation.VERTICAL) {
            g2.drawRect((int) transX, (int) transY, 1, 1);
        }

        updateCrosshairValues(crosshairState, x, y, transX, transY, orientation);
    }

}
项目:parabuild-ci    文件:AbstractXYItemRenderer.java   
/**
 * Considers the current (x, y) coordinate and updates the crosshair point if it meets the
 * criteria (usually means the (x, y) coordinate is the closest to the anchor point so far).
 *
 * @param crosshairState  the crosshair state (<code>null</code> permitted, but the method does 
 *                        nothing in that case).
 * @param x  the x-value (in data space).
 * @param y  the y-value (in data space).
 * @param transX  the x-value translated to Java2D space.
 * @param transY  the y-value translated to Java2D space.
 * @param orientation  the plot orientation (<code>null</code> not permitted).
 */
protected void updateCrosshairValues(CrosshairState crosshairState,
                                     double x, double y, double transX, double transY,
                                     PlotOrientation orientation) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }

    if (crosshairState != null) {
        // do we need to update the crosshair values?
        if (this.plot.isDomainCrosshairLockedOnData()) {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // both axes
                crosshairState.updateCrosshairPoint(x, y, transX, transY, orientation);
            }
            else {
                // just the domain axis...
                crosshairState.updateCrosshairX(x);
            }
        }
        else {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // just the range axis...
                crosshairState.updateCrosshairY(y);
            }
        }
    }

}
项目:parabuild-ci    文件:XYBoxAndWhiskerRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the plot is being drawn.
 * @param info  collects info about the drawing.
 * @param plot  the plot (can be used to obtain standard color information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot (<code>null</code> permitted).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2, 
                     XYItemRendererState state,
                     Rectangle2D dataArea,
                     PlotRenderingInfo info,
                     XYPlot plot, 
                     ValueAxis domainAxis, 
                     ValueAxis rangeAxis,
                     XYDataset dataset, 
                     int series, 
                     int item,
                     CrosshairState crosshairState,
                     int pass) {

    PlotOrientation orientation = plot.getOrientation();
    setPaint(getItemPaint(series, item));

    if (orientation == PlotOrientation.HORIZONTAL) {
        drawHorizontalItem(
            g2, dataArea, info, plot, domainAxis, rangeAxis,
            dataset, series, item, crosshairState, pass
        );
    }
    else if (orientation == PlotOrientation.VERTICAL) {
        drawVerticalItem(
            g2, dataArea, info, plot, domainAxis, rangeAxis,
            dataset, series, item, crosshairState, pass
        );
    }

}
项目:parabuild-ci    文件:AbstractXYItemRenderer.java   
/**
 * Considers the current (x, y) coordinate and updates the crosshair point
 * if it meets the criteria (usually means the (x, y) coordinate is the
 * closest to the anchor point so far).
 *
 * @param crosshairState  the crosshair state (<code>null</code> permitted,
 *                        but the method does nothing in that case).
 * @param x  the x-value (in data space).
 * @param y  the y-value (in data space).
 * @param domainAxisIndex  the index of the domain axis for the point.
 * @param rangeAxisIndex  the index of the range axis for the point.
 * @param transX  the x-value translated to Java2D space.
 * @param transY  the y-value translated to Java2D space.
 * @param orientation  the plot orientation (<code>null</code> not
 *                     permitted).
 *
 * @since 1.0.4
 */
protected void updateCrosshairValues(CrosshairState crosshairState,
        double x, double y, int domainAxisIndex, int rangeAxisIndex,
        double transX, double transY, PlotOrientation orientation) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }

    if (crosshairState != null) {
        // do we need to update the crosshair values?
        if (this.plot.isDomainCrosshairLockedOnData()) {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // both axes
                crosshairState.updateCrosshairPoint(x, y, domainAxisIndex,
                        rangeAxisIndex, transX, transY, orientation);
            }
            else {
                // just the domain axis...
                crosshairState.updateCrosshairX(x, domainAxisIndex);
            }
        }
        else {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // just the range axis...
                crosshairState.updateCrosshairY(y, rangeAxisIndex);
            }
        }
    }

}
项目:parabuild-ci    文件:XYBlockRenderer.java   
/**
 * Draws the block representing the specified item.
 * 
 * @param g2  the graphics device.
 * @param state  the state.
 * @param dataArea  the data area.
 * @param info  the plot rendering info.
 * @param plot  the plot.
 * @param domainAxis  the x-axis.
 * @param rangeAxis  the y-axis.
 * @param dataset  the dataset.
 * @param series  the series index.
 * @param item  the item index.
 * @param crosshairState  the crosshair state.
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2, XYItemRendererState state, 
        Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, 
        ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, 
        int series, int item, CrosshairState crosshairState, int pass) {

    double x = dataset.getXValue(series, item);
    double y = dataset.getYValue(series, item);
    double z = 0.0;
    if (dataset instanceof XYZDataset) {
        z = ((XYZDataset) dataset).getZValue(series, item);
    }
    Paint p = this.paintScale.getPaint(z);
    double xx0 = domainAxis.valueToJava2D(x + this.xOffset, dataArea, 
            plot.getDomainAxisEdge());
    double yy0 = rangeAxis.valueToJava2D(y + this.yOffset, dataArea, 
            plot.getRangeAxisEdge());
    double xx1 = domainAxis.valueToJava2D(x + this.blockWidth 
            + this.xOffset, dataArea, plot.getDomainAxisEdge());
    double yy1 = rangeAxis.valueToJava2D(y + this.blockHeight 
            + this.yOffset, dataArea, plot.getRangeAxisEdge());
    Rectangle2D block;
    PlotOrientation orientation = plot.getOrientation();
    if (orientation.equals(PlotOrientation.HORIZONTAL)) {
        block = new Rectangle2D.Double(Math.min(yy0, yy1), 
                Math.min(xx0, xx1), Math.abs(yy1 - yy0), 
                Math.abs(xx0 - xx1));
    }
    else {
        block = new Rectangle2D.Double(Math.min(xx0, xx1), 
                Math.min(yy0, yy1), Math.abs(xx1 - xx0), 
                Math.abs(yy1 - yy0));            
    }
    g2.setPaint(p);
    g2.fill(block);
    g2.setStroke(new BasicStroke(1.0f));
    g2.draw(block);
}
项目:ccu-historian    文件:XYLineAndShapeRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color
 *              information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, XYItemRendererState state,
        Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot,
        ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset,
        int series, int item, CrosshairState crosshairState, int pass) {

    // do nothing if item is not visible
    if (!getItemVisible(series, item)) {
        return;
    }

    // first pass draws the background (lines, for instance)
    if (isLinePass(pass)) {
        if (getItemLineVisible(series, item)) {
            if (this.drawSeriesLineAsPath) {
                drawPrimaryLineAsPath(state, g2, plot, dataset, pass,
                        series, item, domainAxis, rangeAxis, dataArea);
            }
            else {
                drawPrimaryLine(state, g2, plot, dataset, pass, series,
                        item, domainAxis, rangeAxis, dataArea);
            }
        }
    }
    // second pass adds shapes where the items are ..
    else if (isItemPass(pass)) {

        // setup for collecting optional entity info...
        EntityCollection entities = null;
        if (info != null && info.getOwner() != null) {
            entities = info.getOwner().getEntityCollection();
        }

        drawSecondaryPass(g2, plot, dataset, pass, series, item,
                domainAxis, dataArea, rangeAxis, crosshairState, entities);
    }
}
项目:ccu-historian    文件:AbstractXYItemRenderer.java   
/**
 * Considers the current (x, y) coordinate and updates the crosshair point
 * if it meets the criteria (usually means the (x, y) coordinate is the
 * closest to the anchor point so far).
 *
 * @param crosshairState  the crosshair state (<code>null</code> permitted,
 *                        but the method does nothing in that case).
 * @param x  the x-value (in data space).
 * @param y  the y-value (in data space).
 * @param domainAxisIndex  the index of the domain axis for the point.
 * @param rangeAxisIndex  the index of the range axis for the point.
 * @param transX  the x-value translated to Java2D space.
 * @param transY  the y-value translated to Java2D space.
 * @param orientation  the plot orientation (<code>null</code> not
 *                     permitted).
 *
 * @since 1.0.4
 */
protected void updateCrosshairValues(CrosshairState crosshairState,
        double x, double y, int domainAxisIndex, int rangeAxisIndex,
        double transX, double transY, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(orientation, "orientation");
    if (crosshairState != null) {
        // do we need to update the crosshair values?
        if (this.plot.isDomainCrosshairLockedOnData()) {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // both axes
                crosshairState.updateCrosshairPoint(x, y, domainAxisIndex,
                        rangeAxisIndex, transX, transY, orientation);
            }
            else {
                // just the domain axis...
                crosshairState.updateCrosshairX(x, domainAxisIndex);
            }
        }
        else {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // just the range axis...
                crosshairState.updateCrosshairY(y, rangeAxisIndex);
            }
        }
    }

}
项目:jfreechart    文件:XYLineAndShapeRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color
 *              information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot
 *                        ({@code null} permitted).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, XYItemRendererState state,
        Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot,
        ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset,
        int series, int item, CrosshairState crosshairState, int pass) {

    // do nothing if item is not visible
    if (!getItemVisible(series, item)) {
        return;
    }

    // first pass draws the background (lines, for instance)
    if (isLinePass(pass)) {
        if (getItemLineVisible(series, item)) {
            if (this.drawSeriesLineAsPath) {
                drawPrimaryLineAsPath(state, g2, plot, dataset, pass,
                        series, item, domainAxis, rangeAxis, dataArea);
            }
            else {
                drawPrimaryLine(state, g2, plot, dataset, pass, series,
                        item, domainAxis, rangeAxis, dataArea);
            }
        }
    }
    // second pass adds shapes where the items are ..
    else if (isItemPass(pass)) {

        // setup for collecting optional entity info...
        EntityCollection entities = null;
        if (info != null && info.getOwner() != null) {
            entities = info.getOwner().getEntityCollection();
        }

        drawSecondaryPass(g2, plot, dataset, pass, series, item,
                domainAxis, dataArea, rangeAxis, crosshairState, entities);
    }
}
项目:jfreechart    文件:AbstractXYItemRenderer.java   
/**
 * Considers the current (x, y) coordinate and updates the crosshair point
 * if it meets the criteria (usually means the (x, y) coordinate is the
 * closest to the anchor point so far).
 *
 * @param crosshairState  the crosshair state ({@code null} permitted,
 *                        but the method does nothing in that case).
 * @param x  the x-value (in data space).
 * @param y  the y-value (in data space).
 * @param datasetIndex  the index of the dataset for the point.
 * @param transX  the x-value translated to Java2D space.
 * @param transY  the y-value translated to Java2D space.
 * @param orientation  the plot orientation ({@code null} not
 *                     permitted).
 *
 * @since 1.0.20
 */
protected void updateCrosshairValues(CrosshairState crosshairState,
        double x, double y, int datasetIndex,
        double transX, double transY, PlotOrientation orientation) {

    Args.nullNotPermitted(orientation, "orientation");
    if (crosshairState != null) {
        // do we need to update the crosshair values?
        if (this.plot.isDomainCrosshairLockedOnData()) {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // both axes
                crosshairState.updateCrosshairPoint(x, y, datasetIndex,
                        transX, transY, orientation);
            }
            else {
                // just the domain axis...
                crosshairState.updateCrosshairX(x, transX, datasetIndex);
            }
        }
        else {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // just the range axis...
                crosshairState.updateCrosshairY(y, transY, datasetIndex);
            }
        }
    }

}
项目:PhET    文件:EigenstatesRenderer.java   
/**
 * Draws a horizontal line at each energy value.
 */
public void drawItem( Graphics2D g2, 
        XYItemRendererState state, 
        Rectangle2D dataArea, 
        PlotRenderingInfo info, 
        XYPlot plot, 
        ValueAxis domainAxis, 
        ValueAxis rangeAxis, 
        XYDataset dataset, 
        int series, 
        int item, 
        CrosshairState crosshairState, 
        int pass ) {

    if ( !getItemVisible( series, item ) ) {
        return;
    }

    // Model coordinates to draw a horizontal line at the specified energy...
    final double minPosition = domainAxis.getLowerBound();
    final double maxPosition = domainAxis.getUpperBound();
    final double energy = dataset.getYValue( series, item );

    // Translate the points to screen coordinates...
    RectangleEdge xAxisLocation = plot.getDomainAxisEdge();
    RectangleEdge yAxisLocation = plot.getRangeAxisEdge();
    final double minX = domainAxis.valueToJava2D( minPosition, dataArea, xAxisLocation );
    final double maxX = domainAxis.valueToJava2D( maxPosition, dataArea, xAxisLocation );
    final double y = rangeAxis.valueToJava2D( energy, dataArea, yAxisLocation );

    // Draw the line...
    g2.setPaint( getSeriesPaint( series ) );
    g2.setStroke( getSeriesStroke( series ) );
    _path.reset();
    _path.moveTo( (float)minX, (float)y );
    _path.lineTo( (float)maxX, (float)y );
    g2.draw( _path );
}
项目:PhET    文件:TestSplitXYPlot.java   
public boolean render( Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info, CrosshairState crosshairState ) {
    if ( renderData ) {
        return super.render( g2, dataArea, index, info, crosshairState );
    }
    else {
        return false;
    }
}
项目:aya-lang    文件:XYLineAndShapeRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color
 *              information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, XYItemRendererState state,
        Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot,
        ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset,
        int series, int item, CrosshairState crosshairState, int pass) {

    // do nothing if item is not visible
    if (!getItemVisible(series, item)) {
        return;
    }

    // first pass draws the background (lines, for instance)
    if (isLinePass(pass)) {
        if (getItemLineVisible(series, item)) {
            if (this.drawSeriesLineAsPath) {
                drawPrimaryLineAsPath(state, g2, plot, dataset, pass,
                        series, item, domainAxis, rangeAxis, dataArea);
            }
            else {
                drawPrimaryLine(state, g2, plot, dataset, pass, series,
                        item, domainAxis, rangeAxis, dataArea);
            }
        }
    }
    // second pass adds shapes where the items are ..
    else if (isItemPass(pass)) {

        // setup for collecting optional entity info...
        EntityCollection entities = null;
        if (info != null && info.getOwner() != null) {
            entities = info.getOwner().getEntityCollection();
        }

        drawSecondaryPass(g2, plot, dataset, pass, series, item,
                domainAxis, dataArea, rangeAxis, crosshairState, entities);
    }
}
项目:aya-lang    文件:AbstractXYItemRenderer.java   
/**
 * Considers the current (x, y) coordinate and updates the crosshair point
 * if it meets the criteria (usually means the (x, y) coordinate is the
 * closest to the anchor point so far).
 *
 * @param crosshairState  the crosshair state (<code>null</code> permitted,
 *                        but the method does nothing in that case).
 * @param x  the x-value (in data space).
 * @param y  the y-value (in data space).
 * @param domainAxisIndex  the index of the domain axis for the point.
 * @param rangeAxisIndex  the index of the range axis for the point.
 * @param transX  the x-value translated to Java2D space.
 * @param transY  the y-value translated to Java2D space.
 * @param orientation  the plot orientation (<code>null</code> not
 *                     permitted).
 *
 * @since 1.0.4
 */
protected void updateCrosshairValues(CrosshairState crosshairState,
        double x, double y, int domainAxisIndex, int rangeAxisIndex,
        double transX, double transY, PlotOrientation orientation) {

    ParamChecks.nullNotPermitted(orientation, "orientation");
    if (crosshairState != null) {
        // do we need to update the crosshair values?
        if (this.plot.isDomainCrosshairLockedOnData()) {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // both axes
                crosshairState.updateCrosshairPoint(x, y, domainAxisIndex,
                        rangeAxisIndex, transX, transY, orientation);
            }
            else {
                // just the domain axis...
                crosshairState.updateCrosshairX(x, domainAxisIndex);
            }
        }
        else {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // just the range axis...
                crosshairState.updateCrosshairY(y, rangeAxisIndex);
            }
        }
    }

}
项目:dotalys-cli    文件:MapCanvasComponent.java   
@Override
public void drawItem( Graphics2D arg0, XYItemRendererState arg1, Rectangle2D arg2, PlotRenderingInfo arg3, XYPlot arg4, ValueAxis arg5, ValueAxis arg6,
                XYDataset arg7, int arg8, int arg9, CrosshairState arg10, int arg11 ) {
    if (itemIndex == null || itemIndex == arg9) {
        super.drawItem( arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11 );
    }
}
项目:mzmine2    文件:ContinuousRenderer.java   
public void drawItem(Graphics2D g2, XYItemRendererState state,
    Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot,
    ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset,
    int series, int item, CrosshairState crosshairState, int pass) {

if (isTransparent)
    g2.setComposite(alphaComp);

super.drawItem(g2, state, dataArea, info, plot, domainAxis, rangeAxis,
    dataset, series, item, crosshairState, pass);

   }
项目:mzmine2    文件:PeakRenderer.java   
public void drawItem(Graphics2D g2, XYItemRendererState state,
    Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot,
    ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset,
    int series, int item, CrosshairState crosshairState, int pass) {

if (isTransparent)
    g2.setComposite(alphaComp);

super.drawItem(g2, state, dataArea, info, plot, domainAxis, rangeAxis,
    dataset, series, item, crosshairState, pass);

   }
项目:mzmine2    文件:TICPlotRenderer.java   
public void drawItem(Graphics2D g2, XYItemRendererState state,
    Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot,
    ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset,
    int series, int item, CrosshairState crosshairState, int pass) {

g2.setComposite(makeComposite(transparency));

super.drawItem(g2, state, dataArea, info, plot, domainAxis, rangeAxis,
    dataset, series, item, crosshairState, pass);

   }
项目:mzmine2    文件:TICPlotRenderer.java   
protected void drawSecondaryPass(Graphics2D g2, XYPlot plot,
    XYDataset dataset, int pass, int series, int item,
    ValueAxis domainAxis, Rectangle2D dataArea, ValueAxis rangeAxis,
    CrosshairState crosshairState, EntityCollection entities) {

g2.setComposite(makeComposite(transparency));

super.drawSecondaryPass(g2, plot, dataset, pass, series, item,
    domainAxis, dataArea, rangeAxis, crosshairState, entities);

   }
项目:mzmine2    文件:PeakTICPlotRenderer.java   
@Override
   public void drawItem(final Graphics2D g2, final XYItemRendererState state,
    final Rectangle2D dataArea, final PlotRenderingInfo info,
    final XYPlot plot, final ValueAxis domainAxis,
    final ValueAxis rangeAxis, final XYDataset dataSet,
    final int series, final int item,
    final CrosshairState crosshairState, final int pass) {

g2.setComposite(makeComposite(OPACITY));
super.drawItem(g2, state, dataArea, info, plot, domainAxis, rangeAxis,
    dataSet, series, item, crosshairState, pass);
   }
项目:mzmine2    文件:NeutralLossDataPointRenderer.java   
public void drawItem(Graphics2D g2, XYItemRendererState state,
    Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot,
    ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset,
    int series, int item, CrosshairState crosshairState, int pass) {

if (series > 0) {
    g2.setComposite(alphaComp);
} else if (series == 0) {
    g2.setComposite(alphaCompOriginal);
}

super.drawItem(g2, state, dataArea, info, plot, domainAxis, rangeAxis,
    dataset, series, item, crosshairState, pass);

   }
项目:mzmine2    文件:ScatterPlotRenderer.java   
public void drawItem(java.awt.Graphics2D g2, XYItemRendererState state,
    java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info,
    XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis,
    XYDataset dataset, int series, int item,
    CrosshairState crosshairState, int pass) {

if (series == 0)
    g2.setComposite(pointAlpha);
else
    g2.setComposite(selectionAlpha);

super.drawItem(g2, state, dataArea, info, plot, domainAxis, rangeAxis,
    dataset, series, item, crosshairState, pass);
   }
项目:HTML5_WebSite    文件:AbstractXYItemRenderer.java   
/**
 * Considers the current (x, y) coordinate and updates the crosshair point
 * if it meets the criteria (usually means the (x, y) coordinate is the
 * closest to the anchor point so far).
 *
 * @param crosshairState  the crosshair state (<code>null</code> permitted,
 *                        but the method does nothing in that case).
 * @param x  the x-value (in data space).
 * @param y  the y-value (in data space).
 * @param domainAxisIndex  the index of the domain axis for the point.
 * @param rangeAxisIndex  the index of the range axis for the point.
 * @param transX  the x-value translated to Java2D space.
 * @param transY  the y-value translated to Java2D space.
 * @param orientation  the plot orientation (<code>null</code> not
 *                     permitted).
 *
 * @since 1.0.4
 */
protected void updateCrosshairValues(CrosshairState crosshairState,
        double x, double y, int domainAxisIndex, int rangeAxisIndex,
        double transX, double transY, PlotOrientation orientation) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }

    if (crosshairState != null) {
        // do we need to update the crosshair values?
        if (this.plot.isDomainCrosshairLockedOnData()) {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // both axes
                crosshairState.updateCrosshairPoint(x, y, domainAxisIndex,
                        rangeAxisIndex, transX, transY, orientation);
            }
            else {
                // just the domain axis...
                crosshairState.updateCrosshairX(x, domainAxisIndex);
            }
        }
        else {
            if (this.plot.isRangeCrosshairLockedOnData()) {
                // just the range axis...
                crosshairState.updateCrosshairY(y, rangeAxisIndex);
            }
        }
    }

}
项目:populus    文件:XYLineAndShapeRenderer.java   
/**
 * Draws the visual representation of a single data item.
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the area within which the data is being drawn.
 * @param info  collects information about the drawing.
 * @param plot  the plot (can be used to obtain standard color
 *              information etc).
 * @param domainAxis  the domain axis.
 * @param rangeAxis  the range axis.
 * @param dataset  the dataset.
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 * @param crosshairState  crosshair information for the plot
 *                        (<code>null</code> permitted).
 * @param pass  the pass index.
 */
@Override
public void drawItem(Graphics2D g2, XYItemRendererState state,
        Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot,
        ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset,
        int series, int item, CrosshairState crosshairState, int pass) {

    // do nothing if item is not visible
    if (!getItemVisible(series, item)) {
        return;
    }

    // first pass draws the background (lines, for instance)
    if (isLinePass(pass)) {
        if (getItemLineVisible(series, item)) {
            if (this.drawSeriesLineAsPath) {
                drawPrimaryLineAsPath(state, g2, plot, dataset, pass,
                        series, item, domainAxis, rangeAxis, dataArea);
            }
            else {
                drawPrimaryLine(state, g2, plot, dataset, pass, series,
                        item, domainAxis, rangeAxis, dataArea);
            }
        }
    }
    // second pass adds shapes where the items are ..
    else if (isItemPass(pass)) {

        // setup for collecting optional entity info...
        EntityCollection entities = null;
        if (info != null && info.getOwner() != null) {
            entities = info.getOwner().getEntityCollection();
        }

        drawSecondaryPass(g2, plot, dataset, pass, series, item,
                domainAxis, dataArea, rangeAxis, crosshairState, entities);
    }
}