abstractrenderer.java

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

JAVA
1,979
字号
    public void setBaseItemLabelsVisible(Boolean visible) {        setBaseItemLabelsVisible(visible, true);    }    /**     * Sets the base visibility for item labels and, if requested, sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param visible  the visibility flag.     * @param notify  a flag that controls whether or not listeners are      *                notified.     */    public void setBaseItemLabelsVisible(Boolean visible, boolean notify) {        this.baseItemLabelsVisible = visible;        if (notify) {            notifyListeners(new RendererChangeEvent(this));        }    }    //// ITEM LABEL FONT //////////////////////////////////////////////////////    /**     * Returns the font for an item label.     *      * @param row  the row index (zero-based).     * @param column  the column index (zero-based).     *      * @return The font (never <code>null</code>).     */    public Font getItemLabelFont(int row, int column) {        Font result = this.itemLabelFont;        if (result == null) {            result = getSeriesItemLabelFont(row);            if (result == null) {                result = this.baseItemLabelFont;               }        }        return result;    }    /**     * Returns the font used for all item labels.  This may be      * <code>null</code>, in which case the per series font settings will apply.     *      * @return The font (possibly <code>null</code>).     */    public Font getItemLabelFont() {        return this.itemLabelFont;       }        /**     * Sets the item label font for ALL series and sends a      * {@link RendererChangeEvent} to all registered listeners.  You can set      * this to <code>null</code> if you prefer to set the font on a per series      * basis.     *      * @param font  the font (<code>null</code> permitted).     */    public void setItemLabelFont(Font font) {        setItemLabelFont(font, true);    }        /**     * Sets the item label font for ALL series and, if requested, sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param font  the font (<code>null</code> permitted).     * @param notify  a flag that controls whether or not listeners are      *                notified.     */     public void setItemLabelFont(Font font, boolean notify) {        this.itemLabelFont = font;        if (notify) {            notifyListeners(new RendererChangeEvent(this));        }    }    /**     * Returns the font for all the item labels in a series.     *      * @param series  the series index (zero-based).     *      * @return The font (possibly <code>null</code>).     */    public Font getSeriesItemLabelFont(int series) {        return (Font) this.itemLabelFontList.get(series);    }    /**     * Sets the item label font for a series and sends a      * {@link RendererChangeEvent} to all registered listeners.       *      * @param series  the series index (zero-based).     * @param font  the font (<code>null</code> permitted).     */    public void setSeriesItemLabelFont(int series, Font font) {        setSeriesItemLabelFont(series, font, true);    }    /**     * Sets the item label font for a series and, if requested, sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param series  the series index (zero based).     * @param font  the font (<code>null</code> permitted).     * @param notify  a flag that controls whether or not listeners are      *                notified.     */    public void setSeriesItemLabelFont(int series, Font font, boolean notify) {        this.itemLabelFontList.set(series, font);        if (notify) {            notifyListeners(new RendererChangeEvent(this));        }    }        /**     * Returns the base item label font (this is used when no other font      * setting is available).     *      * @return The font (<code>never</code> null).     */    public Font getBaseItemLabelFont() {        return this.baseItemLabelFont;    }    /**     * Sets the base item label font and sends a {@link RendererChangeEvent} to      * all registered listeners.       *      * @param font  the font (<code>null</code> not permitted).     */    public void setBaseItemLabelFont(Font font) {        if (font == null) {            throw new IllegalArgumentException("Null 'font' argument.");        }        setBaseItemLabelFont(font, true);    }    /**     * Sets the base item label font and, if requested, sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param font  the font (<code>null</code> not permitted).     * @param notify  a flag that controls whether or not listeners are      *                notified.     */    public void setBaseItemLabelFont(Font font, boolean notify) {        this.baseItemLabelFont = font;        if (notify) {            notifyListeners(new RendererChangeEvent(this));        }    }    //// ITEM LABEL PAINT  ////////////////////////////////////////////////////    /**     * Returns the paint used to draw an item label.     *      * @param row  the row index (zero based).     * @param column  the column index (zero based).     *      * @return The paint (never <code>null</code>).     */    public Paint getItemLabelPaint(int row, int column) {        Paint result = this.itemLabelPaint;        if (result == null) {            result = getSeriesItemLabelPaint(row);            if (result == null) {                result = this.baseItemLabelPaint;               }        }        return result;    }        /**     * Returns the paint used for all item labels.  This may be      * <code>null</code>, in which case the per series paint settings will      * apply.     *      * @return The paint (possibly <code>null</code>).     */    public Paint getItemLabelPaint() {        return this.itemLabelPaint;       }    /**     * Sets the item label paint for ALL series and sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param paint  the paint (<code>null</code> permitted).     */    public void setItemLabelPaint(Paint paint) {        setItemLabelPaint(paint, true);    }    /**     * Sets the item label paint for ALL series and, if requested, sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param paint  the paint.     * @param notify  a flag that controls whether or not listeners are      *                notified.     */    public void setItemLabelPaint(Paint paint, boolean notify) {        this.itemLabelPaint = paint;        if (notify) {            notifyListeners(new RendererChangeEvent(this));        }    }        /**     * Returns the paint used to draw the item labels for a series.     *      * @param series  the series index (zero based).     *      * @return The paint (possibly <code>null<code>).     */    public Paint getSeriesItemLabelPaint(int series) {        return this.itemLabelPaintList.getPaint(series);    }    /**     * Sets the item label paint for a series and sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param series  the series (zero based index).     * @param paint  the paint (<code>null</code> permitted).     */    public void setSeriesItemLabelPaint(int series, Paint paint) {        setSeriesItemLabelPaint(series, paint, true);    }        /**     * Sets the item label paint for a series and, if requested, sends a      * {@link RendererChangeEvent} to all registered listeners.     *      * @param series  the series index (zero based).     * @param paint  the paint (<code>null</code> permitted).     * @param notify  a flag that controls whether or not listeners are      *                notified.     */    public void setSeriesItemLabelPaint(int series, Paint paint,                                         boolean notify) {        this.itemLabelPaintList.setPaint(series, paint);        if (notify) {            notifyListeners(new RendererChangeEvent(this));        }    }        /**     * Returns the base item label paint.     *      * @return The paint (never <code>null<code>).     */    public Paint getBaseItemLabelPaint() {        return this.baseItemLabelPaint;    }    /**     * Sets the base item label paint and sends a {@link RendererChangeEvent}      * to all registered listeners.     *      * @param paint  the paint (<code>null</code> not permitted).     */    public void setBaseItemLabelPaint(Paint paint) {        // defer argument checking...        setBaseItemLabelPaint(paint, true);    }    /**     * Sets the base item label paint and, if requested, sends a      * {@link RendererChangeEvent} to all registered listeners..     *      * @param paint  the paint (<code>null</code> not permitted).     * @param notify  a flag that controls whether or not listeners are      *                notified.     */    public void setBaseItemLabelPaint(Paint paint, boolean notify) {        if (paint == null) {            throw new IllegalArgumentException("Null 'paint' argument.");           }        this.baseItemLabelPaint = paint;        if (notify) {            notifyListeners(new RendererChangeEvent(this));        }    }        // POSITIVE ITEM LABEL POSITION...    /**     * Returns the item label position for positive values.     *      * @param row  the row index (zero-based).     * @param column  the column index (zero-based).     *      * @return The item label position (never <code>null</code>).     */    public ItemLabelPosition getPositiveItemLabelPosition(int row, int column) {        return getSeriesPositiveItemLabelPosition(row);    }    /**     * Returns the item label position for positive values in ALL series.     *      * @return The item label position (possibly <code>null</code>).     */    public ItemLabelPosition getPositiveItemLabelPosition() {        return this.positiveItemLabelPosition;    }    /**     * Sets the item label position for positive 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 setPositiveItemLabelPosition(ItemLabelPosition position) {        setPositiveItemLabelPosition(position, true);    }        /**     * Sets the positive item label position for 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 setPositiveItemLabelPosition(ItemLabelPosition position,                                              boolean notify) {        this.positiveItemLabelPosition = position;        if (notify) {            notifyListeners(new RendererChangeEvent(this));        }    }    /**     * Returns the item label position for all positive values in a series.     *      * @param series  the series index (zero-based).     *      * @return The item label position (never <code>null</code>).     */    public ItemLabelPosition getSeriesPositiveItemLabelPosition(int series) {        // return the override, if there is one...        if (this.positiveItemLabelPosition != null) {            return this.positiveItemLabelPosition;        }        // otherwise look up the position table        ItemLabelPosition position = (ItemLabelPosition)             this.positiveItemLabelPositionList.get(series);        if (position == null) {            position = this.basePositiveItemLabelPosition;        }        return position;    }        /**     * Sets the item label position for all positive 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 setSeriesPositiveItemLabelPosition(int series,                                                    ItemLabelPosition position) {        setSeriesPositiveItemLabelPosition(series, position, true);    }    /**     * Sets the item label position for all positive 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 setSeriesPositiveItemLabelPosition(int series,                                                    ItemLabelPosition position,                                                    boolean notify) {        this.positiveItemLabelPositionList.set(series, position);        if (notify) {            notifyListeners(new RendererChangeEvent(this));        }    }    /**     * Returns the base positive item label position.     *      * @return The 

⌨️ 快捷键说明

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