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


Java Rotation类代码示例

本文整理汇总了Java中org.jfree.chart.util.Rotation的典型用法代码示例。如果您正苦于以下问题:Java Rotation类的具体用法?Java Rotation怎么用?Java Rotation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SpiderWebPlot

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Creates a new spider web plot with the given dataset.
 *
 * @param dataset  the dataset.
 * @param extract  controls how data is extracted ({@link TableOrder#BY_ROW}
 *                 or {@link TableOrder#BY_COLUMN}).
 */
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
    super();
    Args.nullNotPermitted(extract, "extract");
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.dataExtractOrder = extract;
    this.headPercent = DEFAULT_HEAD;
    this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
    this.axisLinePaint = Color.BLACK;
    this.axisLineStroke = new BasicStroke(1.0f);

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.maxValue = DEFAULT_MAX_VALUE;

    this.seriesPaint = null;
    this.seriesPaintList = new PaintList();
    this.baseSeriesPaint = null;

    this.seriesOutlinePaint = null;
    this.seriesOutlinePaintList = new PaintList();
    this.baseSeriesOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.seriesOutlineStroke = null;
    this.seriesOutlineStrokeList = new StrokeList();
    this.baseSeriesOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelGenerator = new StandardCategoryItemLabelGenerator();

    this.legendItemShape = DEFAULT_LEGEND_ITEM_CIRCLE;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:45,代码来源:SpiderWebPlot.java

示例2: SpiderWebPlot

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Creates a new spider web plot with the given dataset.
 *
 * @param dataset  the dataset.
 * @param extract  controls how data is extracted ({@link TableOrder#BY_ROW}
 *                 or {@link TableOrder#BY_COLUMN}).
 */
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract) {
    super();
    if (extract == null) {
        throw new IllegalArgumentException("Null 'extract' argument.");
    }
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.dataExtractOrder = extract;
    this.headPercent = DEFAULT_HEAD;
    this.axisLabelGap = DEFAULT_AXIS_LABEL_GAP;
    this.axisLinePaint = Color.black;
    this.axisLineStroke = new BasicStroke(1.0f);

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.maxValue = DEFAULT_MAX_VALUE;

    this.seriesPaint = null;
    this.seriesPaintList = new PaintList();
    this.baseSeriesPaint = null;

    this.seriesOutlinePaint = null;
    this.seriesOutlinePaintList = new PaintList();
    this.baseSeriesOutlinePaint = DEFAULT_OUTLINE_PAINT;

    this.seriesOutlineStroke = null;
    this.seriesOutlineStrokeList = new StrokeList();
    this.baseSeriesOutlineStroke = DEFAULT_OUTLINE_STROKE;

    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelGenerator = new StandardCategoryItemLabelGenerator();

    this.legendItemShape = DEFAULT_LEGEND_ITEM_CIRCLE;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:47,代码来源:SpiderWebPlot.java

示例3: setDirection

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Sets the direction in which the pie sections are drawn and sends a
 * {@link PlotChangeEvent} to all registered listeners.
 *
 * @param direction  the direction (<code>null</code> not permitted).
 *
 * @see #getDirection()
 */
public void setDirection(Rotation direction) {
    if (direction == null) {
        throw new IllegalArgumentException("Null 'direction' argument.");
    }
    this.direction = direction;
    fireChangeEvent();

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:17,代码来源:PiePlot.java

示例4: calculateAngleForValue

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
private double calculateAngleForValue(double value, double total) {
    if (this.direction == Rotation.CLOCKWISE) {
        return this.startAngle - (value / total * 360.0);
    }
    else if (this.direction == Rotation.ANTICLOCKWISE) {
        return this.startAngle + (value / total * 360.0);
    }
    throw new RuntimeException("Unrecognised Rotation type.");
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:10,代码来源:PiePlot.java

示例5: PiePlot

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Creates a plot that will draw a pie chart for the specified dataset.
 *
 * @param dataset  the dataset ({@code null} permitted).
 */
public PiePlot(PieDataset dataset) {
    super();
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }
    this.pieIndex = 0;

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.circular = true;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.minimumArcAngleToDraw = DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW;

    this.sectionPaintMap = new PaintMap();
    this.defaultSectionPaint = Color.GRAY;
    this.autoPopulateSectionPaint = true;

    this.sectionOutlinesVisible = true;
    this.sectionOutlinePaintMap = new PaintMap();
    this.defaultSectionOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSectionOutlinePaint = false;

    this.sectionOutlineStrokeMap = new StrokeMap();
    this.defaultSectionOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSectionOutlineStroke = false;

    this.explodePercentages = new TreeMap();

    this.labelGenerator = new StandardPieSectionLabelGenerator();
    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelBackgroundPaint = DEFAULT_LABEL_BACKGROUND_PAINT;
    this.labelOutlinePaint = DEFAULT_LABEL_OUTLINE_PAINT;
    this.labelOutlineStroke = DEFAULT_LABEL_OUTLINE_STROKE;
    this.labelShadowPaint = DEFAULT_LABEL_SHADOW_PAINT;
    this.labelLinksVisible = true;
    this.labelDistributor = new PieLabelDistributor(0);

    this.simpleLabels = false;
    this.simpleLabelOffset = new RectangleInsets(UnitType.RELATIVE, 0.18,
            0.18, 0.18, 0.18);
    this.labelPadding = new RectangleInsets(2, 2, 2, 2);

    this.toolTipGenerator = null;
    this.urlGenerator = null;
    this.legendLabelGenerator = new StandardPieSectionLabelGenerator();
    this.legendLabelToolTipGenerator = null;
    this.legendLabelURLGenerator = null;
    this.legendItemShape = Plot.DEFAULT_LEGEND_ITEM_CIRCLE;

    this.ignoreNullValues = false;
    this.ignoreZeroValues = false;

    this.shadowGenerator = null;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:62,代码来源:PiePlot.java

示例6: getArcCenter

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Returns the center for the specified section.
 * Checks to see if the section is exploded and recalculates the
 * new center if so.
 *
 * @param state  PiePlotState
 * @param key  section key.
 *
 * @return The center for the specified section.
 *
 * @since 1.0.14
 */
protected Point2D getArcCenter(PiePlotState state, Comparable key) {
    Point2D center = new Point2D.Double(state.getPieCenterX(), state
        .getPieCenterY());

    double ep = getExplodePercent(key);
    double mep = getMaximumExplodePercent();
    if (mep > 0.0) {
        ep = ep / mep;
    }
    if (ep != 0) {
        Rectangle2D pieArea = state.getPieArea();
        Rectangle2D expPieArea = state.getExplodedPieArea();
        double angle1, angle2;
        Number n = this.dataset.getValue(key);
        double value = n.doubleValue();

        if (this.direction == Rotation.CLOCKWISE) {
            angle1 = state.getLatestAngle();
            angle2 = angle1 - value / state.getTotal() * 360.0;
        } else if (this.direction == Rotation.ANTICLOCKWISE) {
            angle1 = state.getLatestAngle();
            angle2 = angle1 + value / state.getTotal() * 360.0;
        } else {
            throw new IllegalStateException("Rotation type not recognised.");
        }
        double angle = (angle2 - angle1);

        Arc2D arc1 = new Arc2D.Double(pieArea, angle1, angle / 2,
                Arc2D.OPEN);
        Point2D point1 = arc1.getEndPoint();
        Arc2D.Double arc2 = new Arc2D.Double(expPieArea, angle1, angle / 2,
                Arc2D.OPEN);
        Point2D point2 = arc2.getEndPoint();
        double deltaX = (point1.getX() - point2.getX()) * ep;
        double deltaY = (point1.getY() - point2.getY()) * ep;

        center = new Point2D.Double(state.getPieCenterX() - deltaX,
                 state.getPieCenterY() - deltaY);

    }
    return center;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:55,代码来源:PiePlot.java

示例7: PiePlot

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Creates a plot that will draw a pie chart for the specified dataset.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 */
public PiePlot(PieDataset dataset) {
    super();
    this.dataset = dataset;
    if (dataset != null) {
        dataset.addChangeListener(this);
    }
    this.pieIndex = 0;

    this.interiorGap = DEFAULT_INTERIOR_GAP;
    this.circular = true;
    this.startAngle = DEFAULT_START_ANGLE;
    this.direction = Rotation.CLOCKWISE;
    this.minimumArcAngleToDraw = DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW;

    this.sectionPaintMap = new PaintMap();
    this.baseSectionPaint = Color.gray;
    this.autoPopulateSectionPaint = true;

    this.sectionOutlinesVisible = true;
    this.sectionOutlinePaintMap = new PaintMap();
    this.baseSectionOutlinePaint = DEFAULT_OUTLINE_PAINT;
    this.autoPopulateSectionOutlinePaint = false;

    this.sectionOutlineStrokeMap = new StrokeMap();
    this.baseSectionOutlineStroke = DEFAULT_OUTLINE_STROKE;
    this.autoPopulateSectionOutlineStroke = false;

    this.explodePercentages = new TreeMap();

    this.labelGenerator = new StandardPieSectionLabelGenerator();
    this.labelFont = DEFAULT_LABEL_FONT;
    this.labelPaint = DEFAULT_LABEL_PAINT;
    this.labelBackgroundPaint = DEFAULT_LABEL_BACKGROUND_PAINT;
    this.labelOutlinePaint = DEFAULT_LABEL_OUTLINE_PAINT;
    this.labelOutlineStroke = DEFAULT_LABEL_OUTLINE_STROKE;
    this.labelShadowPaint = DEFAULT_LABEL_SHADOW_PAINT;
    this.labelLinksVisible = true;
    this.labelDistributor = new PieLabelDistributor(0);

    this.simpleLabels = false;
    this.simpleLabelOffset = new RectangleInsets(UnitType.RELATIVE, 0.18,
            0.18, 0.18, 0.18);
    this.labelPadding = new RectangleInsets(2, 2, 2, 2);

    this.toolTipGenerator = null;
    this.urlGenerator = null;
    this.legendLabelGenerator = new StandardPieSectionLabelGenerator();
    this.legendLabelToolTipGenerator = null;
    this.legendLabelURLGenerator = null;
    this.legendItemShape = Plot.DEFAULT_LEGEND_ITEM_CIRCLE;

    this.ignoreNullValues = false;
    this.ignoreZeroValues = false;

    this.selectedItemAttributes = new PieSelectionAttributes();
    this.shadowGenerator = new DefaultShadowGenerator();
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:63,代码来源:PiePlot.java

示例8: createHotSpotShape

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Returns a shape representing the hotspot for a pie section.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area within which the data is being rendered.
 * @param selected  is the item selected?
 *
 * @return A shape equal to the hot spot for a data item.
 */
public Shape createHotSpotShape(Graphics2D g2, Rectangle2D dataArea,
        int section, boolean selected) {

    Number n = this.dataset.getValue(section);
    if (n == null) {
        return null;
    }
    double value = n.doubleValue();
    double angle1 = 0.0;
    double angle2 = 0.0;

    double total = DatasetUtilities.calculatePieDatasetTotal(this.dataset);
    double lead = 0.0;
    if (this.direction == Rotation.CLOCKWISE) {
        for (int i = 0; i < section; i++) {
            n = this.dataset.getValue(i);
            if (n != null) {
                value = n.doubleValue();
                if (value >= 0.0) {
                    lead = lead + value;
                }
            }
        }
        angle1 = getStartAngle() - lead / total * 360.0;
        angle2 = angle1 - value / total * 360.0;
    }
    else if (this.direction == Rotation.ANTICLOCKWISE) {
        angle1 = getStartAngle() + lead / total * 360.0;
        angle2 = angle1 + value / total * 360.0;
    }
    else {
        throw new IllegalStateException("Rotation type not recognised.");
    }

    double angle = (angle2 - angle1);
    if (Math.abs(angle) > getMinimumArcAngleToDraw()) {
        double ep = 0.0;
        double mep = getMaximumExplodePercent();
        if (mep > 0.0) {
            ep = getExplodePercent(getSectionKey(section)) / mep;
        }
        Rectangle2D arcBounds = getArcBounds(dataArea,
                dataArea, angle1, angle, ep);
        Arc2D.Double arc = new Arc2D.Double(arcBounds, angle1, angle,
                Arc2D.PIE);
        return arc;
    }
    return null;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:59,代码来源:PiePlot.java

示例9: setDirection

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Sets the direction in which the pie sections are drawn and sends a
 * {@link PlotChangeEvent} to all registered listeners.
 *
 * @param direction  the direction ({@code null} not permitted).
 *
 * @see #getDirection()
 */
public void setDirection(Rotation direction) {
    Args.nullNotPermitted(direction, "direction");
    this.direction = direction;
    fireChangeEvent();

}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:15,代码来源:PiePlot.java

示例10: setDirection

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Sets the direction in which the radar axes are drawn and sends a
 * {@link PlotChangeEvent} to all registered listeners.
 *
 * @param direction  the direction (<code>null</code> not permitted).
 *
 * @see #getDirection()
 */
public void setDirection(Rotation direction) {
    if (direction == null) {
        throw new IllegalArgumentException("Null 'direction' argument.");
    }
    this.direction = direction;
    fireChangeEvent();
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:16,代码来源:SpiderWebPlot.java

示例11: getDirection

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Returns the direction in which the radar axes are drawn
 * (clockwise or anti-clockwise).
 *
 * @return The direction (never {@code null}).
 *
 * @see #setDirection(Rotation)
 */
public Rotation getDirection() {
    return this.direction;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:12,代码来源:SpiderWebPlot.java

示例12: setDirection

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Sets the direction in which the radar axes are drawn and sends a
 * {@link PlotChangeEvent} to all registered listeners.
 *
 * @param direction  the direction ({@code null} not permitted).
 *
 * @see #getDirection()
 */
public void setDirection(Rotation direction) {
    Args.nullNotPermitted(direction, "direction");
    this.direction = direction;
    fireChangeEvent();
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:14,代码来源:SpiderWebPlot.java

示例13: getDirection

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Returns the direction in which the pie sections are drawn (clockwise or
 * anti-clockwise).
 *
 * @return The direction (never {@code null}).
 *
 * @see #setDirection(Rotation)
 */
public Rotation getDirection() {
    return this.direction;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:12,代码来源:PiePlot.java

示例14: getDirection

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Returns the direction in which the radar axes are drawn
 * (clockwise or anti-clockwise).
 *
 * @return The direction (never <code>null</code>).
 *
 * @see #setDirection(Rotation)
 */
public Rotation getDirection() {
    return this.direction;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:SpiderWebPlot.java

示例15: getDirection

import org.jfree.chart.util.Rotation; //导入依赖的package包/类
/**
 * Returns the direction in which the pie sections are drawn (clockwise or
 * anti-clockwise).
 *
 * @return The direction (never <code>null</code>).
 *
 * @see #setDirection(Rotation)
 */
public Rotation getDirection() {
    return this.direction;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:PiePlot.java


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