📄 stackedxyarearenderer.html
字号:
<FONT color="green">586</FONT> * @param series the series.<a name="line.586"></a><FONT color="green">587</FONT> * @param index the index.<a name="line.587"></a><FONT color="green">588</FONT> *<a name="line.588"></a><FONT color="green">589</FONT> * @return The cumulative value for all series' values up to but excluding <a name="line.589"></a><FONT color="green">590</FONT> * <code>series</code> for <code>index</code>.<a name="line.590"></a><FONT color="green">591</FONT> */<a name="line.591"></a><FONT color="green">592</FONT> protected double getPreviousHeight(TableXYDataset dataset, <a name="line.592"></a><FONT color="green">593</FONT> int series, int index) {<a name="line.593"></a><FONT color="green">594</FONT> double result = 0.0;<a name="line.594"></a><FONT color="green">595</FONT> for (int i = 0; i < series; i++) {<a name="line.595"></a><FONT color="green">596</FONT> double value = dataset.getYValue(i, index);<a name="line.596"></a><FONT color="green">597</FONT> if (!Double.isNaN(value)) {<a name="line.597"></a><FONT color="green">598</FONT> result += value;<a name="line.598"></a><FONT color="green">599</FONT> }<a name="line.599"></a><FONT color="green">600</FONT> }<a name="line.600"></a><FONT color="green">601</FONT> return result;<a name="line.601"></a><FONT color="green">602</FONT> }<a name="line.602"></a><FONT color="green">603</FONT> <a name="line.603"></a><FONT color="green">604</FONT> /**<a name="line.604"></a><FONT color="green">605</FONT> * Tests the renderer for equality with an arbitrary object.<a name="line.605"></a><FONT color="green">606</FONT> * <a name="line.606"></a><FONT color="green">607</FONT> * @param obj the object (<code>null</code> permitted).<a name="line.607"></a><FONT color="green">608</FONT> * <a name="line.608"></a><FONT color="green">609</FONT> * @return A boolean.<a name="line.609"></a><FONT color="green">610</FONT> */<a name="line.610"></a><FONT color="green">611</FONT> public boolean equals(Object obj) {<a name="line.611"></a><FONT color="green">612</FONT> if (obj == this) {<a name="line.612"></a><FONT color="green">613</FONT> return true;<a name="line.613"></a><FONT color="green">614</FONT> }<a name="line.614"></a><FONT color="green">615</FONT> if (!(obj instanceof StackedXYAreaRenderer) || !super.equals(obj)) {<a name="line.615"></a><FONT color="green">616</FONT> return false;<a name="line.616"></a><FONT color="green">617</FONT> }<a name="line.617"></a><FONT color="green">618</FONT> StackedXYAreaRenderer that = (StackedXYAreaRenderer) obj;<a name="line.618"></a><FONT color="green">619</FONT> if (!PaintUtilities.equal(this.shapePaint, that.shapePaint)) {<a name="line.619"></a><FONT color="green">620</FONT> return false;<a name="line.620"></a><FONT color="green">621</FONT> }<a name="line.621"></a><FONT color="green">622</FONT> if (!ObjectUtilities.equal(this.shapeStroke, that.shapeStroke)) {<a name="line.622"></a><FONT color="green">623</FONT> return false;<a name="line.623"></a><FONT color="green">624</FONT> }<a name="line.624"></a><FONT color="green">625</FONT> return true;<a name="line.625"></a><FONT color="green">626</FONT> }<a name="line.626"></a><FONT color="green">627</FONT> <a name="line.627"></a><FONT color="green">628</FONT> /**<a name="line.628"></a><FONT color="green">629</FONT> * Returns a clone of the renderer.<a name="line.629"></a><FONT color="green">630</FONT> *<a name="line.630"></a><FONT color="green">631</FONT> * @return A clone.<a name="line.631"></a><FONT color="green">632</FONT> *<a name="line.632"></a><FONT color="green">633</FONT> * @throws CloneNotSupportedException if the renderer cannot be cloned.<a name="line.633"></a><FONT color="green">634</FONT> */<a name="line.634"></a><FONT color="green">635</FONT> public Object clone() throws CloneNotSupportedException {<a name="line.635"></a><FONT color="green">636</FONT> return super.clone();<a name="line.636"></a><FONT color="green">637</FONT> }<a name="line.637"></a><FONT color="green">638</FONT> <a name="line.638"></a><FONT color="green">639</FONT> /**<a name="line.639"></a><FONT color="green">640</FONT> * Provides serialization support.<a name="line.640"></a><FONT color="green">641</FONT> *<a name="line.641"></a><FONT color="green">642</FONT> * @param stream the input stream.<a name="line.642"></a><FONT color="green">643</FONT> *<a name="line.643"></a><FONT color="green">644</FONT> * @throws IOException if there is an I/O error.<a name="line.644"></a><FONT color="green">645</FONT> * @throws ClassNotFoundException if there is a classpath problem.<a name="line.645"></a><FONT color="green">646</FONT> */<a name="line.646"></a><FONT color="green">647</FONT> private void readObject(ObjectInputStream stream) <a name="line.647"></a><FONT color="green">648</FONT> throws IOException, ClassNotFoundException {<a name="line.648"></a><FONT color="green">649</FONT> stream.defaultReadObject();<a name="line.649"></a><FONT color="green">650</FONT> this.shapePaint = SerialUtilities.readPaint(stream);<a name="line.650"></a><FONT color="green">651</FONT> this.shapeStroke = SerialUtilities.readStroke(stream);<a name="line.651"></a><FONT color="green">652</FONT> }<a name="line.652"></a><FONT color="green">653</FONT> <a name="line.653"></a><FONT color="green">654</FONT> /**<a name="line.654"></a><FONT color="green">655</FONT> * Provides serialization support.<a name="line.655"></a><FONT color="green">656</FONT> *<a name="line.656"></a><FONT color="green">657</FONT> * @param stream the output stream.<a name="line.657"></a><FONT color="green">658</FONT> *<a name="line.658"></a><FONT color="green">659</FONT> * @throws IOException if there is an I/O error.<a name="line.659"></a><FONT color="green">660</FONT> */<a name="line.660"></a><FONT color="green">661</FONT> private void writeObject(ObjectOutputStream stream) throws IOException {<a name="line.661"></a><FONT color="green">662</FONT> stream.defaultWriteObject();<a name="line.662"></a><FONT color="green">663</FONT> SerialUtilities.writePaint(this.shapePaint, stream);<a name="line.663"></a><FONT color="green">664</FONT> SerialUtilities.writeStroke(this.shapeStroke, stream);<a name="line.664"></a><FONT color="green">665</FONT> }<a name="line.665"></a><FONT color="green">666</FONT> <a name="line.666"></a><FONT color="green">667</FONT> }<a name="line.667"></a></PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -