📄 legendtitle.html
字号:
<FONT color="green">499</FONT> */<a name="line.499"></a><FONT color="green">500</FONT> public Object draw(Graphics2D g2, Rectangle2D area, Object params) {<a name="line.500"></a><FONT color="green">501</FONT> Rectangle2D target = (Rectangle2D) area.clone();<a name="line.501"></a><FONT color="green">502</FONT> target = trimMargin(target);<a name="line.502"></a><FONT color="green">503</FONT> if (this.backgroundPaint != null) {<a name="line.503"></a><FONT color="green">504</FONT> g2.setPaint(this.backgroundPaint);<a name="line.504"></a><FONT color="green">505</FONT> g2.fill(target);<a name="line.505"></a><FONT color="green">506</FONT> }<a name="line.506"></a><FONT color="green">507</FONT> getBorder().draw(g2, target);<a name="line.507"></a><FONT color="green">508</FONT> getBorder().getInsets().trim(target);<a name="line.508"></a><FONT color="green">509</FONT> BlockContainer container = this.wrapper;<a name="line.509"></a><FONT color="green">510</FONT> if (container == null) {<a name="line.510"></a><FONT color="green">511</FONT> container = this.items; <a name="line.511"></a><FONT color="green">512</FONT> }<a name="line.512"></a><FONT color="green">513</FONT> target = trimPadding(target);<a name="line.513"></a><FONT color="green">514</FONT> return container.draw(g2, target, params); <a name="line.514"></a><FONT color="green">515</FONT> }<a name="line.515"></a><FONT color="green">516</FONT> <a name="line.516"></a><FONT color="green">517</FONT> /**<a name="line.517"></a><FONT color="green">518</FONT> * Sets the wrapper container for the legend.<a name="line.518"></a><FONT color="green">519</FONT> * <a name="line.519"></a><FONT color="green">520</FONT> * @param wrapper the wrapper container.<a name="line.520"></a><FONT color="green">521</FONT> */<a name="line.521"></a><FONT color="green">522</FONT> public void setWrapper(BlockContainer wrapper) {<a name="line.522"></a><FONT color="green">523</FONT> this.wrapper = wrapper;<a name="line.523"></a><FONT color="green">524</FONT> }<a name="line.524"></a><FONT color="green">525</FONT> <a name="line.525"></a><FONT color="green">526</FONT> /**<a name="line.526"></a><FONT color="green">527</FONT> * Tests this title for equality with an arbitrary object.<a name="line.527"></a><FONT color="green">528</FONT> * <a name="line.528"></a><FONT color="green">529</FONT> * @param obj the object (<code>null</code> permitted).<a name="line.529"></a><FONT color="green">530</FONT> * <a name="line.530"></a><FONT color="green">531</FONT> * @return A boolean.<a name="line.531"></a><FONT color="green">532</FONT> */<a name="line.532"></a><FONT color="green">533</FONT> public boolean equals(Object obj) {<a name="line.533"></a><FONT color="green">534</FONT> if (obj == this) {<a name="line.534"></a><FONT color="green">535</FONT> return true; <a name="line.535"></a><FONT color="green">536</FONT> }<a name="line.536"></a><FONT color="green">537</FONT> if (!(obj instanceof LegendTitle)) {<a name="line.537"></a><FONT color="green">538</FONT> return false; <a name="line.538"></a><FONT color="green">539</FONT> }<a name="line.539"></a><FONT color="green">540</FONT> if (!super.equals(obj)) {<a name="line.540"></a><FONT color="green">541</FONT> return false; <a name="line.541"></a><FONT color="green">542</FONT> }<a name="line.542"></a><FONT color="green">543</FONT> LegendTitle that = (LegendTitle) obj;<a name="line.543"></a><FONT color="green">544</FONT> if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {<a name="line.544"></a><FONT color="green">545</FONT> return false; <a name="line.545"></a><FONT color="green">546</FONT> }<a name="line.546"></a><FONT color="green">547</FONT> if (this.legendItemGraphicEdge != that.legendItemGraphicEdge) {<a name="line.547"></a><FONT color="green">548</FONT> return false; <a name="line.548"></a><FONT color="green">549</FONT> }<a name="line.549"></a><FONT color="green">550</FONT> if (this.legendItemGraphicAnchor != that.legendItemGraphicAnchor) {<a name="line.550"></a><FONT color="green">551</FONT> return false; <a name="line.551"></a><FONT color="green">552</FONT> }<a name="line.552"></a><FONT color="green">553</FONT> if (this.legendItemGraphicLocation != that.legendItemGraphicLocation) {<a name="line.553"></a><FONT color="green">554</FONT> return false; <a name="line.554"></a><FONT color="green">555</FONT> }<a name="line.555"></a><FONT color="green">556</FONT> if (!this.itemFont.equals(that.itemFont)) {<a name="line.556"></a><FONT color="green">557</FONT> return false; <a name="line.557"></a><FONT color="green">558</FONT> }<a name="line.558"></a><FONT color="green">559</FONT> if (!this.itemPaint.equals(that.itemPaint)) {<a name="line.559"></a><FONT color="green">560</FONT> return false; <a name="line.560"></a><FONT color="green">561</FONT> }<a name="line.561"></a><FONT color="green">562</FONT> if (!this.hLayout.equals(that.hLayout)) {<a name="line.562"></a><FONT color="green">563</FONT> return false; <a name="line.563"></a><FONT color="green">564</FONT> }<a name="line.564"></a><FONT color="green">565</FONT> if (!this.vLayout.equals(that.vLayout)) {<a name="line.565"></a><FONT color="green">566</FONT> return false; <a name="line.566"></a><FONT color="green">567</FONT> }<a name="line.567"></a><FONT color="green">568</FONT> return true;<a name="line.568"></a><FONT color="green">569</FONT> }<a name="line.569"></a><FONT color="green">570</FONT> <a name="line.570"></a><FONT color="green">571</FONT> /**<a name="line.571"></a><FONT color="green">572</FONT> * Provides serialization support.<a name="line.572"></a><FONT color="green">573</FONT> *<a name="line.573"></a><FONT color="green">574</FONT> * @param stream the output stream.<a name="line.574"></a><FONT color="green">575</FONT> *<a name="line.575"></a><FONT color="green">576</FONT> * @throws IOException if there is an I/O error.<a name="line.576"></a><FONT color="green">577</FONT> */<a name="line.577"></a><FONT color="green">578</FONT> private void writeObject(ObjectOutputStream stream) throws IOException {<a name="line.578"></a><FONT color="green">579</FONT> stream.defaultWriteObject();<a name="line.579"></a><FONT color="green">580</FONT> SerialUtilities.writePaint(this.backgroundPaint, stream);<a name="line.580"></a><FONT color="green">581</FONT> SerialUtilities.writePaint(this.itemPaint, stream);<a name="line.581"></a><FONT color="green">582</FONT> }<a name="line.582"></a><FONT color="green">583</FONT> <a name="line.583"></a><FONT color="green">584</FONT> /**<a name="line.584"></a><FONT color="green">585</FONT> * Provides serialization support.<a name="line.585"></a><FONT color="green">586</FONT> *<a name="line.586"></a><FONT color="green">587</FONT> * @param stream the input stream.<a name="line.587"></a><FONT color="green">588</FONT> *<a name="line.588"></a><FONT color="green">589</FONT> * @throws IOException if there is an I/O error.<a name="line.589"></a><FONT color="green">590</FONT> * @throws ClassNotFoundException if there is a classpath problem.<a name="line.590"></a><FONT color="green">591</FONT> */<a name="line.591"></a><FONT color="green">592</FONT> private void readObject(ObjectInputStream stream) <a name="line.592"></a><FONT color="green">593</FONT> throws IOException, ClassNotFoundException {<a name="line.593"></a><FONT color="green">594</FONT> stream.defaultReadObject();<a name="line.594"></a><FONT color="green">595</FONT> this.backgroundPaint = SerialUtilities.readPaint(stream);<a name="line.595"></a><FONT color="green">596</FONT> this.itemPaint = SerialUtilities.readPaint(stream);<a name="line.596"></a><FONT color="green">597</FONT> }<a name="line.597"></a><FONT color="green">598</FONT> <a name="line.598"></a><FONT color="green">599</FONT> }<a name="line.599"></a></PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -