legenditem.java

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

JAVA
555
字号
                      Paint fillPaint,                       boolean shapeOutlineVisible,                      Paint outlinePaint,                      Stroke outlineStroke,                      boolean lineVisible,                      Shape line,                      Stroke lineStroke,                      Paint linePaint) {                if (label == null) {            throw new IllegalArgumentException("Null 'label' argument.");           }        if (fillPaint == null) {            throw new IllegalArgumentException("Null 'fillPaint' argument.");           }        if (lineStroke == null) {            throw new IllegalArgumentException("Null 'lineStroke' argument.");        }        if (outlinePaint == null) {            throw new IllegalArgumentException("Null 'outlinePaint' argument.");        }        if (outlineStroke == null) {            throw new IllegalArgumentException(                "Null 'outlineStroke' argument."            );           }        this.label = label;        this.description = description;        this.shapeVisible = shapeVisible;        this.shape = shape;        this.shapeFilled = shapeFilled;        this.fillPaint = fillPaint;        this.shapeOutlineVisible = shapeOutlineVisible;        this.outlinePaint = outlinePaint;        this.outlineStroke = outlineStroke;        this.lineVisible = lineVisible;        this.line = line;        this.lineStroke = lineStroke;        this.linePaint = linePaint;        this.toolTipText = toolTipText;        this.urlText = urlText;    }    /**     * Returns the label.     *     * @return The label (never <code>null</code>).     */    public String getLabel() {        return this.label;    }    /**     * Returns the description for the legend item.     *      * @return The description.     */    public String getDescription() {        return this.description;       }        /**     * Returns the tool tip text.     *      * @return The tool tip text (possibly <code>null</code>).     */    public String getToolTipText() {        return this.toolTipText;       }        /**     * Returns the URL text.     *      * @return The URL text (possibly <code>null</code>).     */    public String getURLText() {        return this.urlText;     }        /**     * Returns a flag that indicates whether or not the shape is visible.     *      * @return A boolean.     */    public boolean isShapeVisible() {        return this.shapeVisible;    }        /**     * Returns the shape used to label the series represented by this legend      * item.     *     * @return The shape (never <code>null</code>).     */    public Shape getShape() {        return this.shape;    }        /**     * Returns a flag that controls whether or not the shape is filled.     *      * @return A boolean.     */    public boolean isShapeFilled() {        return this.shapeFilled;    }    /**     * Returns the fill paint.     *     * @return The fill paint (never <code>null</code>).     */    public Paint getFillPaint() {        return this.fillPaint;    }    /**     * Returns the flag that controls whether or not the shape outline     * is visible.     *      * @return A boolean.     */    public boolean isShapeOutlineVisible() {        return this.shapeOutlineVisible;    }        /**     * Returns the line stroke for the series.     *     * @return The stroke (never <code>null</code>).     */    public Stroke getLineStroke() {        return this.lineStroke;    }        /**     * Returns the paint used for lines.     *      * @return The paint.     */    public Paint getLinePaint() {        return this.linePaint;    }        /**     * Returns the outline paint.     *     * @return The outline paint (never <code>null</code>).     */    public Paint getOutlinePaint() {        return this.outlinePaint;    }    /**     * Returns the outline stroke.     *     * @return The outline stroke (never <code>null</code>).     */    public Stroke getOutlineStroke() {        return this.outlineStroke;    }        /**     * Returns a flag that indicates whether or not the line is visible.     *      * @return A boolean.     */    public boolean isLineVisible() {        return this.lineVisible;    }        /**     * Returns the line.     *      * @return The line.     */    public Shape getLine() {        return this.line;    }        /**     * Tests this item for equality with an arbitrary object.     *      * @param obj  the object (<code>null</code> permitted).     *      * @return A boolean.     */    public boolean equals(Object obj) {        if (obj == this) {            return true;           }        if (!(obj instanceof LegendItem)) {                return false;        }        LegendItem that = (LegendItem) obj;        if (!this.label.equals(that.label)) {            return false;        }        if (!ObjectUtilities.equal(this.description, that.description)) {            return false;        }        if (this.shapeVisible != that.shapeVisible) {            return false;        }        if (!ShapeUtilities.equal(this.shape, that.shape)) {            return false;        }        if (this.shapeFilled != that.shapeFilled) {            return false;        }        if (!this.fillPaint.equals(that.fillPaint)) {            return false;           }        if (this.shapeOutlineVisible != that.shapeOutlineVisible) {            return false;        }        if (!this.outlineStroke.equals(that.outlineStroke)) {            return false;           }        if (!this.outlinePaint.equals(that.outlinePaint)) {            return false;           }        if (!this.lineVisible == that.lineVisible) {            return false;        }        if (!ShapeUtilities.equal(this.line, that.line)) {            return false;        }        if (!this.lineStroke.equals(that.lineStroke)) {            return false;           }        if (!this.linePaint.equals(that.linePaint)) {            return false;        }        return true;    }        /**     * Provides serialization support.     *     * @param stream  the output stream (<code>null</code> not permitted).     *     * @throws IOException  if there is an I/O error.     */    private void writeObject(ObjectOutputStream stream) throws IOException {        stream.defaultWriteObject();        SerialUtilities.writeShape(this.shape, stream);        SerialUtilities.writePaint(this.fillPaint, stream);        SerialUtilities.writeStroke(this.outlineStroke, stream);        SerialUtilities.writePaint(this.outlinePaint, stream);        SerialUtilities.writeShape(this.line, stream);        SerialUtilities.writeStroke(this.lineStroke, stream);        SerialUtilities.writePaint(this.linePaint, stream);    }    /**     * Provides serialization support.     *     * @param stream  the input stream (<code>null</code> not permitted).     *     * @throws IOException  if there is an I/O error.     * @throws ClassNotFoundException  if there is a classpath problem.     */    private void readObject(ObjectInputStream stream)         throws IOException, ClassNotFoundException {        stream.defaultReadObject();        this.shape = SerialUtilities.readShape(stream);        this.fillPaint = SerialUtilities.readPaint(stream);        this.outlineStroke = SerialUtilities.readStroke(stream);        this.outlinePaint = SerialUtilities.readPaint(stream);        this.line = SerialUtilities.readShape(stream);        this.lineStroke = SerialUtilities.readStroke(stream);        this.linePaint = SerialUtilities.readPaint(stream);    }    }

⌨️ 快捷键说明

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