xyitemrenderer.java

来自「JfreeChart 常用图表例子」· Java 代码 · 共 1,418 行 · 第 1/4 页

JAVA
1,418
字号
    public void setBasePositiveItemLabelPosition(ItemLabelPosition position,                                                  boolean notify);    // NEGATIVE ITEM LABEL POSITION...    /**     * Returns the item label position for negative values.  This method can be     * overridden to provide customisation of the item label position for      * individual data items.     *      * @param row  the row index (zero-based).     * @param column  the column (zero-based).     *      * @return The item label position (never <code>null</code>).     */    public ItemLabelPosition getNegativeItemLabelPosition(int row, int column);    /**     * Returns the item label position for negative values in ALL series.     *      * @return The item label position (possibly <code>null</code>).     */    public ItemLabelPosition getNegativeItemLabelPosition();    /**     * Sets the item label position for negative values in ALL series, and      * sends a {@link RendererChangeEvent} to all registered listeners.  You      * need to set this to <code>null</code> to expose the settings for      * individual series.     *      * @param position  the position (<code>null</code> permitted).     */    public void setNegativeItemLabelPosition(ItemLabelPosition position);        /**     * Sets the item label position for negative values in ALL series and (if     * requested) sends a {@link RendererChangeEvent} to all registered      * listeners.       *      * @param position  the position (<code>null</code> permitted).     * @param notify  notify registered listeners?     */    public void setNegativeItemLabelPosition(ItemLabelPosition position,                                              boolean notify);    /**     * Returns the item label position for all negative values in a series.     *      * @param series  the series index (zero-based).     *      * @return The item label position (never <code>null</code>).     */    public ItemLabelPosition getSeriesNegativeItemLabelPosition(int series);    /**     * Sets the item label position for negative values in a series and sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param series  the series index (zero-based).     * @param position  the position (<code>null</code> permitted).     */    public void setSeriesNegativeItemLabelPosition(int series,                                                    ItemLabelPosition position);        /**     * Sets the item label position for negative values in a series and (if      * requested) sends a {@link RendererChangeEvent} to all registered      * listeners.     *      * @param series  the series index (zero-based).     * @param position  the position (<code>null</code> permitted).     * @param notify  notify registered listeners?     */    public void setSeriesNegativeItemLabelPosition(int series,                                                    ItemLabelPosition position,                                                    boolean notify);    /**     * Returns the base item label position for negative values.     *      * @return The position (never <code>null</code>).     */    public ItemLabelPosition getBaseNegativeItemLabelPosition();    /**     * Sets the base item label position for negative values and sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param position  the position (<code>null</code> not permitted).     */    public void setBaseNegativeItemLabelPosition(ItemLabelPosition position);        /**     * Sets the base negative item label position and, if requested, sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param position  the position (<code>null</code> not permitted).     * @param notify  notify registered listeners?     */    public void setBaseNegativeItemLabelPosition(ItemLabelPosition position,                                                  boolean notify);    /**     * Adds an annotation and sends a {@link RendererChangeEvent} to all      * registered listeners.  The annotation is added to the foreground     * layer.     *      * @param annotation  the annotation (<code>null</code> not permitted).     */    public void addAnnotation(XYAnnotation annotation);    /**     * Adds an annotation to the specified layer.     *      * @param annotation  the annotation (<code>null</code> not permitted).     * @param layer  the layer (<code>null</code> not permitted).     */    public void addAnnotation(XYAnnotation annotation, Layer layer);    /**     * Removes the specified annotation and sends a {@link RendererChangeEvent}     * to all registered listeners.     *      * @param annotation  the annotation to remove (<code>null</code> not      *                    permitted).     *      * @return A boolean to indicate whether or not the annotation was      *         successfully removed.     */    public boolean removeAnnotation(XYAnnotation annotation);        /**     * Removes all annotations and sends a {@link RendererChangeEvent}     * to all registered listeners.     */    public void removeAnnotations();        /**     * Draws all the annotations for the specified layer.     *      * @param g2  the graphics device.     * @param dataArea  the data area.     * @param domainAxis  the domain axis.     * @param rangeAxis  the range axis.     * @param layer  the layer.     * @param info  the plot rendering info.     */    public void drawAnnotations(Graphics2D g2,                                 Rectangle2D dataArea,                                 ValueAxis domainAxis,                                 ValueAxis rangeAxis,                                 Layer layer,                                 PlotRenderingInfo info);        /**     * Called for each item to be plotted.     * <p>     * The {@link XYPlot} can make multiple passes through the dataset,      * depending on the value returned by the renderer's initialise() method.     *     * @param g2  the graphics device.     * @param state  the renderer state.     * @param dataArea  the area within which the data is being rendered.     * @param info  collects drawing info.     * @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);    /**     * Returns a legend item for a series from a dataset.     *     * @param datasetIndex  the dataset index.     * @param series  the series (zero-based index).     *     * @return The legend item (possibly <code>null</code>).     */    public LegendItem getLegendItem(int datasetIndex, int series);    /**     * Fills a band between two values on the axis.  This can be used to color      * bands between the grid lines.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param axis  the domain axis.     * @param dataArea  the data area.     * @param start  the start value.     * @param end  the end value.     */    public void fillDomainGridBand(Graphics2D g2,                                   XYPlot plot,                                   ValueAxis axis,                                   Rectangle2D dataArea,                                   double start, double end);    /**     * Fills a band between two values on the range axis.  This can be used to      * color bands between the grid lines.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param axis  the range axis.     * @param dataArea  the data area.     * @param start  the start value.     * @param end  the end value.     */    public void fillRangeGridBand(Graphics2D g2,                                  XYPlot plot,                                  ValueAxis axis,                                  Rectangle2D dataArea,                                  double start, double end);    /**     * Draws a grid line against the domain axis.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param axis  the value axis.     * @param dataArea  the area for plotting data (not yet adjusted for any      *                  3D effect).     * @param value  the value.     */    public void drawDomainGridLine(Graphics2D g2,                                   XYPlot plot,                                   ValueAxis axis,                                   Rectangle2D dataArea,                                   double value);    /**     * Draws a grid line against the range axis.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param axis  the value axis.     * @param dataArea  the area for plotting data (not yet adjusted for any      *                  3D effect).     * @param value  the value.     * @param paint  the paint (<code>null</code> not permitted).     * @param stroke  the stroke (<code>null</code> not permitted).     */    public void drawRangeLine(Graphics2D g2,                              XYPlot plot,                              ValueAxis axis,                              Rectangle2D dataArea,                              double value,                              Paint paint,                              Stroke stroke);    /**     * Draws the specified <code>marker</code> against the domain axis.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param axis  the value axis.     * @param marker  the marker.     * @param dataArea  the axis data area.     */    public void drawDomainMarker(Graphics2D g2,                                 XYPlot plot,                                 ValueAxis axis,                                 Marker marker,                                 Rectangle2D dataArea);    /**     * Draws a horizontal line across the chart to represent a 'range marker'.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param axis  the value axis.     * @param marker  the marker line.     * @param dataArea  the axis data area.     */    public void drawRangeMarker(Graphics2D g2,                                XYPlot plot,                                ValueAxis axis,                                Marker marker,                                Rectangle2D dataArea);    /**     * Returns the plot that this renderer has been assigned to.     *     * @return The plot.     */    public XYPlot getPlot();    /**     * Sets the plot that this renderer is assigned to.  This method will be      * called by the plot class...you do not need to call it yourself.     *     * @param plot  the plot.     */    public void setPlot(XYPlot plot);        /**     * Returns the lower and upper bounds (range) of the x-values in the      * specified dataset.     *      * @param dataset  the dataset (<code>null</code> permitted).     *      * @return The range.     */    public Range findDomainBounds(XYDataset dataset);        /**     * Returns the lower and upper bounds (range) of the y-values in the     * specified dataset.  The implementation of this method will take      * into account the presentation used by the renderers (for example,     * a renderer that "stacks" values will return a bigger range than     * a renderer that doesn't.     *      * @param dataset  the dataset (<code>null</code> permitted).     *      * @return The range (or <code>null</code> if the dataset is      *         <code>null</code> or empty).     */    public Range findRangeBounds(XYDataset dataset);        /**     * Add a renderer change listener.     *      * @param listener  the listener.     */    public void addChangeListener(RendererChangeListener listener);    /**     * Removes a change listener.     *      * @param listener  the listener.     */    public void removeChangeListener(RendererChangeListener listener);    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?