Java 类org.jfree.chart.labels.CategoryItemLabelGenerator 实例源码

项目:parabuild-ci    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = (CategoryItemLabelGenerator)
        this.itemLabelGeneratorList.get(series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;

}
项目:ccu-historian    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
@Override
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = this.itemLabelGeneratorMap.get(
            series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;
}
项目:aya-lang    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
@Override
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = this.itemLabelGeneratorMap.get(
            series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;
}
项目:HTML5_WebSite    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = (CategoryItemLabelGenerator)
        this.itemLabelGeneratorList.get(series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;

}
项目:populus    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
@Override
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = this.itemLabelGeneratorMap.get(
            series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;
}
项目:PI    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = (CategoryItemLabelGenerator)
        this.itemLabelGeneratorList.get(series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;

}
项目:nabs    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = (CategoryItemLabelGenerator)
        this.itemLabelGeneratorList.get(series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;

}
项目:ECG-Viewer    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
@Override
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = this.itemLabelGeneratorMap.get(
            series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;
}
项目:opensim-gui    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 */
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = (CategoryItemLabelGenerator) 
        this.itemLabelGeneratorList.get(series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;

}
项目:group-five    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
@Override
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = this.itemLabelGeneratorMap.get(
            series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;
}
项目:manydesigns.cn    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly <code>null</code>).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
@Override
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // return the generator for ALL series, if there is one...
    if (this.itemLabelGenerator != null) {
        return this.itemLabelGenerator;
    }

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = (CategoryItemLabelGenerator)
        this.itemLabelGeneratorList.get(series);
    if (generator == null) {
        generator = this.baseItemLabelGenerator;
    }
    return generator;

}
项目:parabuild-ci    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2,
                             PlotOrientation orientation,
                             CategoryDataset dataset,
                             int row, int column,
                             double x, double y,
                             boolean negative) {

    CategoryItemLabelGenerator generator
        = getItemLabelGenerator(row, column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position = null;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:ccu-historian    文件:AbstractCategoryItemRenderer.java   
/**
 * Creates a new renderer with no tool tip generator and no URL generator.
 * The defaults (no tool tip or URL generators) have been chosen to
 * minimise the processing required to generate a default chart.  If you
 * require tool tips or URLs, then you can easily add the required
 * generators.
 */
protected AbstractCategoryItemRenderer() {
    this.itemLabelGenerator = null;
    this.itemLabelGeneratorMap 
            = new HashMap<Integer, CategoryItemLabelGenerator>();
    this.toolTipGenerator = null;
    this.toolTipGeneratorMap 
            = new HashMap<Integer, CategoryToolTipGenerator>();
    this.itemURLGenerator = null;
    this.itemURLGeneratorMap = new HashMap<Integer, CategoryURLGenerator>();
    this.legendItemLabelGenerator
            = new StandardCategorySeriesLabelGenerator();
}
项目:ccu-historian    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation,
        CategoryDataset dataset, int row, int column,
        double x, double y, boolean negative) {

    CategoryItemLabelGenerator generator = getItemLabelGenerator(row,
            column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:jfreechart    文件:AbstractCategoryItemRenderer.java   
/**
 * Creates a new renderer with no tool tip generator and no URL generator.
 * The defaults (no tool tip or URL generators) have been chosen to
 * minimise the processing required to generate a default chart.  If you
 * require tool tips or URLs, then you can easily add the required
 * generators.
 */
protected AbstractCategoryItemRenderer() {
    this.itemLabelGeneratorMap 
            = new HashMap<Integer, CategoryItemLabelGenerator>();
    this.toolTipGeneratorMap 
            = new HashMap<Integer, CategoryToolTipGenerator>();
    this.itemURLGeneratorMap = new HashMap<Integer, CategoryURLGenerator>();
    this.legendItemLabelGenerator
            = new StandardCategorySeriesLabelGenerator();
}
项目:jfreechart    文件:AbstractCategoryItemRenderer.java   
/**
 * Returns the item label generator for a series.
 *
 * @param series  the series index (zero based).
 *
 * @return The generator (possibly {@code null}).
 *
 * @see #setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
 */
@Override
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {

    // otherwise look up the generator table
    CategoryItemLabelGenerator generator = this.itemLabelGeneratorMap.get(
            series);
    if (generator == null) {
        generator = this.defaultItemLabelGenerator;
    }
    return generator;
}
项目:jfreechart    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation,
        CategoryDataset dataset, int row, int column,
        double x, double y, boolean negative) {

    CategoryItemLabelGenerator generator = getItemLabelGenerator(row,
            column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtils.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:jasperreports    文件:SimpleChartTheme.java   
/**
 *
 */
protected JFreeChart createStackedBarChart() throws JRException
{
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
        ChartFactory.createStackedBarChart(
            evaluateTextExpression(getChart().getTitleExpression()),
            evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
            evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
            (CategoryDataset)getDataset(),
            getPlot().getOrientationValue().getOrientation(),
            isShowLegend(),
            true,
            false
            );

    configureChart(jfreeChart, getPlot());

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    JRBarPlot barPlot = (JRBarPlot)getPlot();
    //plot.setNoDataMessage("No data to display");
    boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
    boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
    boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();

    categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
    categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
    ((NumberAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
    ((NumberAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);

    BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
    categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
    categoryRenderer.setShadowVisible(false);

    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
            barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
            barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
            barPlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(),
            (Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()), 
            (Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression())
            );

    // Handle the axis formating for the value axis
    configureAxis(categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
            barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
            barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
            barPlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
            (Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()), 
            (Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression())
            );

    return jfreeChart;
}
项目:aya-lang    文件:AbstractCategoryItemRenderer.java   
/**
 * Creates a new renderer with no tool tip generator and no URL generator.
 * The defaults (no tool tip or URL generators) have been chosen to
 * minimise the processing required to generate a default chart.  If you
 * require tool tips or URLs, then you can easily add the required
 * generators.
 */
protected AbstractCategoryItemRenderer() {
    this.itemLabelGenerator = null;
    this.itemLabelGeneratorMap 
            = new HashMap<Integer, CategoryItemLabelGenerator>();
    this.toolTipGenerator = null;
    this.toolTipGeneratorMap 
            = new HashMap<Integer, CategoryToolTipGenerator>();
    this.itemURLGenerator = null;
    this.itemURLGeneratorMap = new HashMap<Integer, CategoryURLGenerator>();
    this.legendItemLabelGenerator
            = new StandardCategorySeriesLabelGenerator();
}
项目:aya-lang    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation,
        CategoryDataset dataset, int row, int column,
        double x, double y, boolean negative) {

    CategoryItemLabelGenerator generator = getItemLabelGenerator(row,
            column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:HTML5_WebSite    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2,
                             PlotOrientation orientation,
                             CategoryDataset dataset,
                             int row, int column,
                             double x, double y,
                             boolean negative) {

    CategoryItemLabelGenerator generator
        = getItemLabelGenerator(row, column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position = null;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:populus    文件:AbstractCategoryItemRenderer.java   
/**
 * Creates a new renderer with no tool tip generator and no URL generator.
 * The defaults (no tool tip or URL generators) have been chosen to
 * minimise the processing required to generate a default chart.  If you
 * require tool tips or URLs, then you can easily add the required
 * generators.
 */
protected AbstractCategoryItemRenderer() {
    this.itemLabelGenerator = null;
    this.itemLabelGeneratorMap 
            = new HashMap<Integer, CategoryItemLabelGenerator>();
    this.toolTipGenerator = null;
    this.toolTipGeneratorMap 
            = new HashMap<Integer, CategoryToolTipGenerator>();
    this.itemURLGenerator = null;
    this.itemURLGeneratorMap = new HashMap<Integer, CategoryURLGenerator>();
    this.legendItemLabelGenerator
            = new StandardCategorySeriesLabelGenerator();
}
项目:populus    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation,
        CategoryDataset dataset, int row, int column,
        double x, double y, boolean negative) {

    CategoryItemLabelGenerator generator = getItemLabelGenerator(row,
            column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:PI    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation,
        CategoryDataset dataset, int row, int column,
        double x, double y, boolean negative) {

    CategoryItemLabelGenerator generator = getItemLabelGenerator(row,
            column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position = null;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:nabs    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2,
                             PlotOrientation orientation,
                             CategoryDataset dataset,
                             int row, int column,
                             double x, double y,
                             boolean negative) {

    CategoryItemLabelGenerator generator
        = getItemLabelGenerator(row, column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position = null;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:ECG-Viewer    文件:AbstractCategoryItemRenderer.java   
/**
 * Creates a new renderer with no tool tip generator and no URL generator.
 * The defaults (no tool tip or URL generators) have been chosen to
 * minimise the processing required to generate a default chart.  If you
 * require tool tips or URLs, then you can easily add the required
 * generators.
 */
protected AbstractCategoryItemRenderer() {
    this.itemLabelGenerator = null;
    this.itemLabelGeneratorMap 
            = new HashMap<Integer, CategoryItemLabelGenerator>();
    this.toolTipGenerator = null;
    this.toolTipGeneratorMap 
            = new HashMap<Integer, CategoryToolTipGenerator>();
    this.itemURLGenerator = null;
    this.itemURLGeneratorMap = new HashMap<Integer, CategoryURLGenerator>();
    this.legendItemLabelGenerator
            = new StandardCategorySeriesLabelGenerator();
}
项目:ECG-Viewer    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation,
        CategoryDataset dataset, int row, int column,
        double x, double y, boolean negative) {

    CategoryItemLabelGenerator generator = getItemLabelGenerator(row,
            column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:astor    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param selected  is the item selected?
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 *
 * @since 1.2.0
 */
protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation,
        CategoryDataset dataset, int row, int column, boolean selected,
        double x, double y, boolean negative) {

    CategoryItemLabelGenerator generator = getItemLabelGenerator(row,
            column, selected);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column, selected);
        Paint paint = getItemLabelPaint(row, column, selected);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position = null;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column, selected);
        }
        else {
            position = getNegativeItemLabelPosition(row, column, selected);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:opensim-gui    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item 
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2, 
                             PlotOrientation orientation,
                             CategoryDataset dataset, 
                             int row, int column,
                             double x, double y, 
                             boolean negative) {

    CategoryItemLabelGenerator generator 
        = getItemLabelGenerator(row, column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position = null;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2, 
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(), 
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:group-five    文件:AbstractCategoryItemRenderer.java   
/**
 * Creates a new renderer with no tool tip generator and no URL generator.
 * The defaults (no tool tip or URL generators) have been chosen to
 * minimise the processing required to generate a default chart.  If you
 * require tool tips or URLs, then you can easily add the required
 * generators.
 */
protected AbstractCategoryItemRenderer() {
    this.itemLabelGenerator = null;
    this.itemLabelGeneratorMap 
            = new HashMap<Integer, CategoryItemLabelGenerator>();
    this.toolTipGenerator = null;
    this.toolTipGeneratorMap 
            = new HashMap<Integer, CategoryToolTipGenerator>();
    this.itemURLGenerator = null;
    this.itemURLGeneratorMap = new HashMap<Integer, CategoryURLGenerator>();
    this.legendItemLabelGenerator
            = new StandardCategorySeriesLabelGenerator();
}
项目:group-five    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation,
        CategoryDataset dataset, int row, int column,
        double x, double y, boolean negative) {

    CategoryItemLabelGenerator generator = getItemLabelGenerator(row,
            column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:manydesigns.cn    文件:AbstractCategoryItemRenderer.java   
/**
 * Draws an item label.
 *
 * @param g2  the graphics device.
 * @param orientation  the orientation.
 * @param dataset  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param x  the x coordinate (in Java2D space).
 * @param y  the y coordinate (in Java2D space).
 * @param negative  indicates a negative value (which affects the item
 *                  label position).
 */
protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation,
        CategoryDataset dataset, int row, int column,
        double x, double y, boolean negative) {

    CategoryItemLabelGenerator generator = getItemLabelGenerator(row,
            column);
    if (generator != null) {
        Font labelFont = getItemLabelFont(row, column);
        Paint paint = getItemLabelPaint(row, column);
        g2.setFont(labelFont);
        g2.setPaint(paint);
        String label = generator.generateLabel(dataset, row, column);
        ItemLabelPosition position;
        if (!negative) {
            position = getPositiveItemLabelPosition(row, column);
        }
        else {
            position = getNegativeItemLabelPosition(row, column);
        }
        Point2D anchorPoint = calculateLabelAnchorPoint(
                position.getItemLabelAnchor(), x, y, orientation);
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(),
                position.getAngle(), position.getRotationAnchor());
    }

}
项目:parabuild-ci    文件:BarRenderer.java   
/**
 * Draws an item label.  This method is overridden so that the bar can be 
 * used to calculate the label anchor point.
 * 
 * @param g2  the graphics device.
 * @param data  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param plot  the plot.
 * @param generator  the label generator.
 * @param bar  the bar.
 * @param negative  a flag indicating a negative value.
 */
protected void drawItemLabel(Graphics2D g2,
                             CategoryDataset data,
                             int row,
                             int column,
                             CategoryPlot plot,
                             CategoryItemLabelGenerator generator,
                             Rectangle2D bar,
                             boolean negative) {

    String label = generator.generateLabel(data, row, column);
    if (label == null) {
        return;  // nothing to do   
    }

    Font labelFont = getItemLabelFont(row, column);
    g2.setFont(labelFont);
    Paint paint = getItemLabelPaint(row, column);
    g2.setPaint(paint);

    // find out where to place the label...
    ItemLabelPosition position = null;
    if (!negative) {
        position = getPositiveItemLabelPosition(row, column);
    }
    else {
        position = getNegativeItemLabelPosition(row, column);
    }

    // work out the label anchor point...
    Point2D anchorPoint = calculateLabelAnchorPoint(
            position.getItemLabelAnchor(), bar, plot.getOrientation());

    if (isInternalAnchor(position.getItemLabelAnchor())) {
        Shape bounds = TextUtilities.calculateRotatedStringBounds(label, 
                g2, (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(), position.getAngle(),
                position.getRotationAnchor());

        if (bounds != null) {
            if (!bar.contains(bounds.getBounds2D())) {
                if (!negative) {
                    position = getPositiveItemLabelPositionFallback();
                }
                else {
                    position = getNegativeItemLabelPositionFallback();
                }
                if (position != null) {
                    anchorPoint = calculateLabelAnchorPoint(
                            position.getItemLabelAnchor(), bar, 
                            plot.getOrientation());
                }
            }
        }

    }

    if (position != null) {
        TextUtilities.drawRotatedString(label, g2, 
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(), position.getAngle(), 
                position.getRotationAnchor());
    }        
}
项目:ccu-historian    文件:BarRenderer.java   
/**
 * Draws an item label.  This method is overridden so that the bar can be
 * used to calculate the label anchor point.
 *
 * @param g2  the graphics device.
 * @param data  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param plot  the plot.
 * @param generator  the label generator.
 * @param bar  the bar.
 * @param negative  a flag indicating a negative value.
 */
protected void drawItemLabel(Graphics2D g2,
                             CategoryDataset data,
                             int row,
                             int column,
                             CategoryPlot plot,
                             CategoryItemLabelGenerator generator,
                             Rectangle2D bar,
                             boolean negative) {

    String label = generator.generateLabel(data, row, column);
    if (label == null) {
        return;  // nothing to do
    }

    Font labelFont = getItemLabelFont(row, column);
    g2.setFont(labelFont);
    Paint paint = getItemLabelPaint(row, column);
    g2.setPaint(paint);

    // find out where to place the label...
    ItemLabelPosition position;
    if (!negative) {
        position = getPositiveItemLabelPosition(row, column);
    }
    else {
        position = getNegativeItemLabelPosition(row, column);
    }

    // work out the label anchor point...
    Point2D anchorPoint = calculateLabelAnchorPoint(
            position.getItemLabelAnchor(), bar, plot.getOrientation());

    if (isInternalAnchor(position.getItemLabelAnchor())) {
        Shape bounds = TextUtilities.calculateRotatedStringBounds(label,
                g2, (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(), position.getAngle(),
                position.getRotationAnchor());

        if (bounds != null) {
            if (!bar.contains(bounds.getBounds2D())) {
                if (!negative) {
                    position = getPositiveItemLabelPositionFallback();
                }
                else {
                    position = getNegativeItemLabelPositionFallback();
                }
                if (position != null) {
                    anchorPoint = calculateLabelAnchorPoint(
                            position.getItemLabelAnchor(), bar,
                            plot.getOrientation());
                }
            }
        }

    }

    if (position != null) {
        TextUtilities.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(), position.getAngle(),
                position.getRotationAnchor());
    }
}
项目:jfreechart    文件:CategoryItemRenderer.java   
public void setSeriesItemLabelGenerator(int series, 
CategoryItemLabelGenerator generator, boolean notify);
项目:jfreechart    文件:CategoryItemRenderer.java   
public void setDefaultItemLabelGenerator(CategoryItemLabelGenerator generator,
boolean notify);
项目:jfreechart    文件:BarRenderer.java   
/**
 * Draws an item label.  This method is overridden so that the bar can be
 * used to calculate the label anchor point.
 *
 * @param g2  the graphics device.
 * @param data  the dataset.
 * @param row  the row.
 * @param column  the column.
 * @param plot  the plot.
 * @param generator  the label generator.
 * @param bar  the bar.
 * @param negative  a flag indicating a negative value.
 */
protected void drawItemLabel(Graphics2D g2,
                             CategoryDataset data,
                             int row,
                             int column,
                             CategoryPlot plot,
                             CategoryItemLabelGenerator generator,
                             Rectangle2D bar,
                             boolean negative) {

    String label = generator.generateLabel(data, row, column);
    if (label == null) {
        return;  // nothing to do
    }

    Font labelFont = getItemLabelFont(row, column);
    g2.setFont(labelFont);
    Paint paint = getItemLabelPaint(row, column);
    g2.setPaint(paint);

    // find out where to place the label...
    ItemLabelPosition position;
    if (!negative) {
        position = getPositiveItemLabelPosition(row, column);
    }
    else {
        position = getNegativeItemLabelPosition(row, column);
    }

    // work out the label anchor point...
    Point2D anchorPoint = calculateLabelAnchorPoint(
            position.getItemLabelAnchor(), bar, plot.getOrientation());

    if (isInternalAnchor(position.getItemLabelAnchor())) {
        Shape bounds = TextUtils.calculateRotatedStringBounds(label,
                g2, (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(), position.getAngle(),
                position.getRotationAnchor());

        if (bounds != null) {
            if (!bar.contains(bounds.getBounds2D())) {
                if (!negative) {
                    position = getPositiveItemLabelPositionFallback();
                }
                else {
                    position = getNegativeItemLabelPositionFallback();
                }
                if (position != null) {
                    anchorPoint = calculateLabelAnchorPoint(
                            position.getItemLabelAnchor(), bar,
                            plot.getOrientation());
                }
            }
        }

    }

    if (position != null) {
        TextUtils.drawRotatedString(label, g2,
                (float) anchorPoint.getX(), (float) anchorPoint.getY(),
                position.getTextAnchor(), position.getAngle(),
                position.getRotationAnchor());
    }
}
项目:jasperreports    文件:GenericChartTheme.java   
/**
 *
 */
protected JFreeChart createStackedBar3DChart() throws JRException
{
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
        ChartFactory.createStackedBarChart3D(
            evaluateTextExpression(getChart().getTitleExpression()),
            evaluateTextExpression(((JRBar3DPlot)getPlot()).getCategoryAxisLabelExpression()),
            evaluateTextExpression(((JRBar3DPlot)getPlot()).getValueAxisLabelExpression()),
            (CategoryDataset)getDataset(),
            getPlot().getOrientationValue().getOrientation(),
            isShowLegend(),
            true,
            false
            );

    configureChart(jfreeChart, getPlot());

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    JRBar3DPlot bar3DPlot = (JRBar3DPlot)getPlot();

    StackedBarRenderer3D stackedBarRenderer3D =
        new StackedBarRenderer3D(
            bar3DPlot.getXOffsetDouble() == null ? StackedBarRenderer3D.DEFAULT_X_OFFSET : bar3DPlot.getXOffsetDouble().doubleValue(),
            bar3DPlot.getYOffsetDouble() == null ? StackedBarRenderer3D.DEFAULT_Y_OFFSET : bar3DPlot.getYOffsetDouble().doubleValue()
            );

    stackedBarRenderer3D.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    stackedBarRenderer3D.setBaseItemLabelsVisible( bar3DPlot.getShowLabels() );

    categoryPlot.setRenderer(stackedBarRenderer3D);

    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), bar3DPlot.getCategoryAxisLabelFont(),
            bar3DPlot.getCategoryAxisLabelColor(), bar3DPlot.getCategoryAxisTickLabelFont(),
            bar3DPlot.getCategoryAxisTickLabelColor(), bar3DPlot.getCategoryAxisTickLabelMask(), bar3DPlot.getCategoryAxisVerticalTickLabels(),
            bar3DPlot.getOwnCategoryAxisLineColor(), false,
            (Comparable<?>)evaluateExpression(bar3DPlot.getDomainAxisMinValueExpression()),
            (Comparable<?>)evaluateExpression(bar3DPlot.getDomainAxisMaxValueExpression()));

    // Handle the axis formating for the value axis
    configureAxis(categoryPlot.getRangeAxis(), bar3DPlot.getValueAxisLabelFont(),
            bar3DPlot.getValueAxisLabelColor(), bar3DPlot.getValueAxisTickLabelFont(),
            bar3DPlot.getValueAxisTickLabelColor(), bar3DPlot.getValueAxisTickLabelMask(), bar3DPlot.getValueAxisVerticalTickLabels(),
            bar3DPlot.getOwnValueAxisLineColor(), true,
            (Comparable<?>)evaluateExpression(bar3DPlot.getRangeAxisMinValueExpression()),
            (Comparable<?>)evaluateExpression(bar3DPlot.getRangeAxisMaxValueExpression()));

    return jfreeChart;
}
项目:jasperreports    文件:GenericChartTheme.java   
/**
 *
 */
protected JFreeChart createStackedBarChart() throws JRException
{
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
        ChartFactory.createStackedBarChart(
            evaluateTextExpression(getChart().getTitleExpression()),
            evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
            evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
            (CategoryDataset)getDataset(),
            getPlot().getOrientationValue().getOrientation(),
            isShowLegend(),
            true,
            false
            );

    configureChart(jfreeChart, getPlot());

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    JRBarPlot barPlot = (JRBarPlot)getPlot();
    //plot.setNoDataMessage("No data to display");
    boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
    boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
    boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();

    categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
    categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
    ((NumberAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
    ((NumberAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);

    BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
    categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
    categoryRenderer.setShadowVisible(false);

    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
            barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
            barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
            barPlot.getOwnCategoryAxisLineColor(), false,
            (Comparable<?>)evaluateExpression(barPlot.getDomainAxisMinValueExpression()),
            (Comparable<?>)evaluateExpression(barPlot.getDomainAxisMaxValueExpression()));

    // Handle the axis formating for the value axis
    configureAxis(categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
            barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
            barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
            barPlot.getOwnValueAxisLineColor(), true,
            (Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
            (Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));

    return jfreeChart;
}
项目:jasperreports    文件:GenericChartTheme.java   
/**
 *
 */
protected JFreeChart createGanttChart() throws JRException
{
    //FIXMECHART legend/tooltip/url should come from plot?

    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart =
        ChartFactory.createGanttChart(
            evaluateTextExpression(getChart().getTitleExpression()),
            evaluateTextExpression(((JRBarPlot)getPlot()).getCategoryAxisLabelExpression()),
            evaluateTextExpression(((JRBarPlot)getPlot()).getValueAxisLabelExpression()),
            (GanttCategoryDataset)getDataset(),
            isShowLegend(),
            true,  //FIXMECHART tooltip: I guess BarPlot is not the best for gantt
            false
            );

    configureChart(jfreeChart, getPlot());

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    //plot.setNoDataMessage("No data to display");

    JRBarPlot barPlot = (JRBarPlot)getPlot();
    boolean isShowTickMarks = barPlot.getShowTickMarks() == null ? true : barPlot.getShowTickMarks().booleanValue();
    boolean isShowTickLabels = barPlot.getShowTickLabels() == null ? true : barPlot.getShowTickLabels().booleanValue();
    boolean isShowLabels = barPlot.getShowLabels() == null ? false : barPlot.getShowLabels().booleanValue();

    categoryPlot.getDomainAxis().setTickMarksVisible(isShowTickMarks);
    categoryPlot.getDomainAxis().setTickLabelsVisible(isShowTickLabels);
    // Handle the axis formating for the category axis
    configureAxis(
        categoryPlot.getDomainAxis(), barPlot.getCategoryAxisLabelFont(),
        barPlot.getCategoryAxisLabelColor(), barPlot.getCategoryAxisTickLabelFont(),
        barPlot.getCategoryAxisTickLabelColor(), barPlot.getCategoryAxisTickLabelMask(), barPlot.getCategoryAxisVerticalTickLabels(),
        barPlot.getOwnCategoryAxisLineColor(), false, null, null
        );
    ((DateAxis)categoryPlot.getRangeAxis()).setTickMarksVisible(isShowTickMarks);
    ((DateAxis)categoryPlot.getRangeAxis()).setTickLabelsVisible(isShowTickLabels);
    // Handle the axis formating for the value axis
    configureAxis(
        categoryPlot.getRangeAxis(), barPlot.getValueAxisLabelFont(),
        barPlot.getValueAxisLabelColor(), barPlot.getValueAxisTickLabelFont(),
        barPlot.getValueAxisTickLabelColor(), barPlot.getValueAxisTickLabelMask(), barPlot.getValueAxisVerticalTickLabels(),
        barPlot.getOwnValueAxisLineColor(), true,
        (Comparable<?>)evaluateExpression(barPlot.getRangeAxisMinValueExpression()),
        (Comparable<?>)evaluateExpression(barPlot.getRangeAxisMaxValueExpression()));

    BarRenderer categoryRenderer = (BarRenderer)categoryPlot.getRenderer();
    categoryRenderer.setBaseItemLabelGenerator((CategoryItemLabelGenerator)getLabelGenerator());
    categoryRenderer.setBaseItemLabelsVisible(isShowLabels);
    categoryRenderer.setShadowVisible(false);

    return jfreeChart;
}