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


Java PolarPlot.translateValueThetaRadiusToJava2D方法代码示例

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


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

示例1: drawSeries

import org.jfree.chart.plot.PolarPlot; //导入方法依赖的package包/类
/**
 * Plots the data for a given series.
 * 
 * @param g2  the drawing surface.
 * @param dataArea  the data area.
 * @param info  collects plot rendering info.
 * @param plot  the plot.
 * @param dataset  the dataset.
 * @param seriesIndex  the series index.
 */
public void drawSeries(Graphics2D g2, 
                       Rectangle2D dataArea, 
                       PlotRenderingInfo info,
                       PolarPlot plot,
                       XYDataset dataset,
                       int seriesIndex) {
    
    Polygon poly = new Polygon();
    int numPoints = dataset.getItemCount(seriesIndex);
    for (int i = 0; i < numPoints; i++) {
        double theta = dataset.getXValue(seriesIndex, i);
        double radius = dataset.getYValue(seriesIndex, i);
        Point p = plot.translateValueThetaRadiusToJava2D(theta, radius, dataArea);
        poly.addPoint(p.x, p.y);
    }
    g2.setPaint(getSeriesPaint(seriesIndex));
    g2.setStroke(getSeriesStroke(seriesIndex));
    if (isSeriesFilled(seriesIndex)) {
        Composite savedComposite = g2.getComposite();
        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
        g2.fill(poly);
        g2.setComposite(savedComposite);
    }
    else {
        g2.draw(poly);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:38,代码来源:DefaultPolarItemRenderer.java

示例2: drawRadialGridLines

import org.jfree.chart.plot.PolarPlot; //导入方法依赖的package包/类
/**
 * Draw the radial gridlines - the rings.
 * 
 * @param g2  the drawing surface.
 * @param plot  the plot.
 * @param radialAxis  the radial axis.
 * @param ticks  the ticks.
 * @param dataArea  the data area.
 */
public void drawRadialGridLines(Graphics2D g2, 
                                PolarPlot plot,
                                ValueAxis radialAxis,
                                List ticks,
                                Rectangle2D dataArea) {
    
    g2.setFont(radialAxis.getTickLabelFont());
    g2.setPaint(plot.getRadiusGridlinePaint());
    g2.setStroke(plot.getRadiusGridlineStroke());

    Point center = plot.translateValueThetaRadiusToJava2D(0.0, 0.0, dataArea);
    
    Iterator iterator = ticks.iterator();
    while (iterator.hasNext()) {
        NumberTick tick = (NumberTick) iterator.next();
        Point p = plot.translateValueThetaRadiusToJava2D(
            90.0, tick.getNumber().doubleValue(), dataArea
        );
        int r = p.x - center.x;
        int upperLeftX = center.x - r;
        int upperLeftY = center.y - r;
        int d = 2 * r;
        Ellipse2D ring = new Ellipse2D.Double(upperLeftX, upperLeftY, d, d);
        g2.setPaint(plot.getRadiusGridlinePaint());
        g2.draw(ring);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:37,代码来源:DefaultPolarItemRenderer.java

示例3: drawSeries

import org.jfree.chart.plot.PolarPlot; //导入方法依赖的package包/类
/**
 * Plots the data for a given series.
 * 
 * @param g2  the drawing surface.
 * @param dataArea  the data area.
 * @param info  collects plot rendering info.
 * @param plot  the plot.
 * @param dataset  the dataset.
 * @param seriesIndex  the series index.
 */
public void drawSeries(Graphics2D g2, 
                       Rectangle2D dataArea, 
                       PlotRenderingInfo info,
                       PolarPlot plot,
                       XYDataset dataset,
                       int seriesIndex) {
    
    Polygon poly = new Polygon();
    int numPoints = dataset.getItemCount(seriesIndex);
    for (int i = 0; i < numPoints; i++) {
        double theta = dataset.getXValue(seriesIndex, i);
        double radius = dataset.getYValue(seriesIndex, i);
        Point p = plot.translateValueThetaRadiusToJava2D(theta, radius, 
                dataArea);
        poly.addPoint(p.x, p.y);
    }
    g2.setPaint(getSeriesPaint(seriesIndex));
    g2.setStroke(getSeriesStroke(seriesIndex));
    if (isSeriesFilled(seriesIndex)) {
        Composite savedComposite = g2.getComposite();
        g2.setComposite(AlphaComposite.getInstance(
                AlphaComposite.SRC_OVER, 0.5f));
        g2.fill(poly);
        g2.setComposite(savedComposite);
    }
    else {
        g2.draw(poly);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:40,代码来源:DefaultPolarItemRenderer.java

示例4: drawRadialGridLines

import org.jfree.chart.plot.PolarPlot; //导入方法依赖的package包/类
/**
 * Draw the radial gridlines - the rings.
 * 
 * @param g2  the drawing surface.
 * @param plot  the plot.
 * @param radialAxis  the radial axis.
 * @param ticks  the ticks.
 * @param dataArea  the data area.
 */
public void drawRadialGridLines(Graphics2D g2, 
                                PolarPlot plot,
                                ValueAxis radialAxis,
                                List ticks,
                                Rectangle2D dataArea) {
    
    g2.setFont(radialAxis.getTickLabelFont());
    g2.setPaint(plot.getRadiusGridlinePaint());
    g2.setStroke(plot.getRadiusGridlineStroke());

    double axisMin = radialAxis.getLowerBound();
    Point center = plot.translateValueThetaRadiusToJava2D(axisMin, axisMin,
            dataArea);
    
    Iterator iterator = ticks.iterator();
    while (iterator.hasNext()) {
        NumberTick tick = (NumberTick) iterator.next();
        Point p = plot.translateValueThetaRadiusToJava2D(90.0, 
                tick.getNumber().doubleValue(), dataArea);
        int r = p.x - center.x;
        int upperLeftX = center.x - r;
        int upperLeftY = center.y - r;
        int d = 2 * r;
        Ellipse2D ring = new Ellipse2D.Double(upperLeftX, upperLeftY, d, d);
        g2.setPaint(plot.getRadiusGridlinePaint());
        g2.draw(ring);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:38,代码来源:DefaultPolarItemRenderer.java

示例5: drawSeries

import org.jfree.chart.plot.PolarPlot; //导入方法依赖的package包/类
/**
 * Plots the data for a given series.
 *
 * @param g2  the drawing surface.
 * @param dataArea  the data area.
 * @param info  collects plot rendering info.
 * @param plot  the plot.
 * @param dataset  the dataset.
 * @param seriesIndex  the series index.
 */
public void drawSeries(Graphics2D g2,
                       Rectangle2D dataArea,
                       PlotRenderingInfo info,
                       PolarPlot plot,
                       XYDataset dataset,
                       int seriesIndex) {

    Polygon poly = new Polygon();
    int numPoints = dataset.getItemCount(seriesIndex);
    for (int i = 0; i < numPoints; i++) {
        double theta = dataset.getXValue(seriesIndex, i);
        double radius = dataset.getYValue(seriesIndex, i);
        Point p = plot.translateValueThetaRadiusToJava2D(theta, radius,
                dataArea);
        poly.addPoint(p.x, p.y);
    }
    g2.setPaint(lookupSeriesPaint(seriesIndex));
    g2.setStroke(lookupSeriesStroke(seriesIndex));
    if (isSeriesFilled(seriesIndex)) {
        Composite savedComposite = g2.getComposite();
        g2.setComposite(AlphaComposite.getInstance(
                AlphaComposite.SRC_OVER, 0.5f));
        g2.fill(poly);
        g2.setComposite(savedComposite);
    }
    else {
        g2.draw(poly);
    }
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:40,代码来源:DefaultPolarItemRenderer.java

示例6: drawRadialGridLines

import org.jfree.chart.plot.PolarPlot; //导入方法依赖的package包/类
/**
 * Draw the radial gridlines - the rings.
 *
 * @param g2  the drawing surface.
 * @param plot  the plot.
 * @param radialAxis  the radial axis.
 * @param ticks  the ticks.
 * @param dataArea  the data area.
 */
public void drawRadialGridLines(Graphics2D g2,
                                PolarPlot plot,
                                ValueAxis radialAxis,
                                List ticks,
                                Rectangle2D dataArea) {

    g2.setFont(radialAxis.getTickLabelFont());
    g2.setPaint(plot.getRadiusGridlinePaint());
    g2.setStroke(plot.getRadiusGridlineStroke());

    double axisMin = radialAxis.getLowerBound();
    Point center = plot.translateValueThetaRadiusToJava2D(axisMin, axisMin,
            dataArea);

    Iterator iterator = ticks.iterator();
    while (iterator.hasNext()) {
        NumberTick tick = (NumberTick) iterator.next();
        Point p = plot.translateValueThetaRadiusToJava2D(90.0,
                tick.getNumber().doubleValue(), dataArea);
        int r = p.x - center.x;
        int upperLeftX = center.x - r;
        int upperLeftY = center.y - r;
        int d = 2 * r;
        Ellipse2D ring = new Ellipse2D.Double(upperLeftX, upperLeftY, d, d);
        g2.setPaint(plot.getRadiusGridlinePaint());
        g2.draw(ring);
    }
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:38,代码来源:DefaultPolarItemRenderer.java

示例7: drawSeries

import org.jfree.chart.plot.PolarPlot; //导入方法依赖的package包/类
/**
 * Plots the data for a given series. - modified to draw points only not connected, add label
 *
 * @param g2  the drawing surface.
 * @param dataArea  the data area.
 * @param info  collects plot rendering info.
 * @param plot  the plot.
 * @param dataset  the dataset.
 * @param seriesIndex  the series index.
 */
public void drawSeries(Graphics2D g2,
                       Rectangle2D dataArea,
                       PlotRenderingInfo info,
                       PolarPlot plot,
                       XYDataset dataset,
                       int seriesIndex)
{

    Polygon poly = new Polygon();
    int numPoints = dataset.getItemCount(seriesIndex);

    g2.setPaint(lookupSeriesPaint(seriesIndex));
    g2.setStroke(lookupSeriesStroke(seriesIndex));

    for (int i = 0; i < numPoints; i++)
    {
        double theta = dataset.getXValue(seriesIndex, i);
        double radius = dataset.getYValue(seriesIndex, i);
        Point p = plot.translateValueThetaRadiusToJava2D(theta, radius, dataArea);
        //poly.addPoint(p.x, p.y);
         XYGPSDataItem gpsItem = (XYGPSDataItem)((XYSeriesCollection) dataset).getSeries(seriesIndex).getDataItem(i);
        drawScatterPoint(p, gpsItem, seriesIndex,g2); // draw the point

    }


}
 
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:38,代码来源:SctterPlotItemGPSRenderer.java

示例8: drawSeries

import org.jfree.chart.plot.PolarPlot; //导入方法依赖的package包/类
/**
     * Plots the data for a given series. - modified to draw points only not connected
     *
     * @param g2  the drawing surface.
     * @param dataArea  the data area.
     * @param info  collects plot rendering info.
     * @param plot  the plot.
     * @param dataset  the dataset.
     * @param seriesIndex  the series index.
     */
    public void drawSeries(Graphics2D g2,
                           Rectangle2D dataArea,
                           PlotRenderingInfo info,
                           PolarPlot plot,
                           XYDataset dataset,
                           int seriesIndex)
    {

        Polygon poly = new Polygon();
        int numPoints = dataset.getItemCount(seriesIndex);

        g2.setPaint(lookupSeriesPaint(seriesIndex));
        g2.setStroke(lookupSeriesStroke(seriesIndex));
        
        for (int i = 0; i < numPoints; i++)
        {
            double theta = dataset.getXValue(seriesIndex, i);
            double radius = dataset.getYValue(seriesIndex, i);
            Point p = plot.translateValueThetaRadiusToJava2D(theta, radius, dataArea);
            //poly.addPoint(p.x, p.y);
            drawScatterPoint(p,seriesIndex,g2); // draw the point
        }
        
//        if (isSeriesFilled(seriesIndex))
//        {
//            Composite savedComposite = g2.getComposite();
//            g2.setComposite(AlphaComposite.getInstance(
//                    AlphaComposite.SRC_OVER, 0.5f));
//            g2.fill(poly);
//            g2.setComposite(savedComposite);
//        }
//        else {
//            g2.draw(poly);
//        }
    }
 
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:46,代码来源:ScatterPolarItemRenderer.java


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