📄 xyarearenderer.html
字号:
<FONT color="green">523</FONT> areaState.area.addPoint((int) transZero, (int) transX1);<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> g2.fill(areaState.area);<a name="line.526"></a><FONT color="green">527</FONT> <a name="line.527"></a><FONT color="green">528</FONT> // draw an outline around the Area.<a name="line.528"></a><FONT color="green">529</FONT> if (isOutline()) {<a name="line.529"></a><FONT color="green">530</FONT> g2.setStroke(getItemOutlineStroke(series, item));<a name="line.530"></a><FONT color="green">531</FONT> g2.setPaint(getItemOutlinePaint(series, item));<a name="line.531"></a><FONT color="green">532</FONT> g2.draw(areaState.area);<a name="line.532"></a><FONT color="green">533</FONT> }<a name="line.533"></a><FONT color="green">534</FONT> }<a name="line.534"></a><FONT color="green">535</FONT> <a name="line.535"></a><FONT color="green">536</FONT> updateCrosshairValues(<a name="line.536"></a><FONT color="green">537</FONT> crosshairState, x1, y1, transX1, transY1, orientation<a name="line.537"></a><FONT color="green">538</FONT> );<a name="line.538"></a><FONT color="green">539</FONT> <a name="line.539"></a><FONT color="green">540</FONT> // collect entity and tool tip information...<a name="line.540"></a><FONT color="green">541</FONT> if (state.getInfo() != null) {<a name="line.541"></a><FONT color="green">542</FONT> EntityCollection entities = state.getEntityCollection();<a name="line.542"></a><FONT color="green">543</FONT> if (entities != null && hotspot != null) {<a name="line.543"></a><FONT color="green">544</FONT> String tip = null;<a name="line.544"></a><FONT color="green">545</FONT> XYToolTipGenerator generator <a name="line.545"></a><FONT color="green">546</FONT> = getToolTipGenerator(series, item);<a name="line.546"></a><FONT color="green">547</FONT> if (generator != null) {<a name="line.547"></a><FONT color="green">548</FONT> tip = generator.generateToolTip(dataset, series, item);<a name="line.548"></a><FONT color="green">549</FONT> }<a name="line.549"></a><FONT color="green">550</FONT> String url = null;<a name="line.550"></a><FONT color="green">551</FONT> if (getURLGenerator() != null) {<a name="line.551"></a><FONT color="green">552</FONT> url = getURLGenerator().generateURL(dataset, series, item);<a name="line.552"></a><FONT color="green">553</FONT> }<a name="line.553"></a><FONT color="green">554</FONT> XYItemEntity entity = new XYItemEntity(hotspot, dataset, <a name="line.554"></a><FONT color="green">555</FONT> series, item, tip, url);<a name="line.555"></a><FONT color="green">556</FONT> entities.add(entity);<a name="line.556"></a><FONT color="green">557</FONT> }<a name="line.557"></a><FONT color="green">558</FONT> }<a name="line.558"></a><FONT color="green">559</FONT> <a name="line.559"></a><FONT color="green">560</FONT> }<a name="line.560"></a><FONT color="green">561</FONT> <a name="line.561"></a><FONT color="green">562</FONT> /**<a name="line.562"></a><FONT color="green">563</FONT> * Returns a clone of the renderer.<a name="line.563"></a><FONT color="green">564</FONT> * <a name="line.564"></a><FONT color="green">565</FONT> * @return A clone.<a name="line.565"></a><FONT color="green">566</FONT> * <a name="line.566"></a><FONT color="green">567</FONT> * @throws CloneNotSupportedException if the renderer cannot be cloned.<a name="line.567"></a><FONT color="green">568</FONT> */<a name="line.568"></a><FONT color="green">569</FONT> public Object clone() throws CloneNotSupportedException {<a name="line.569"></a><FONT color="green">570</FONT> return super.clone();<a name="line.570"></a><FONT color="green">571</FONT> }<a name="line.571"></a><FONT color="green">572</FONT> <a name="line.572"></a><FONT color="green">573</FONT> /**<a name="line.573"></a><FONT color="green">574</FONT> * Tests this renderer for equality with an arbitrary object.<a name="line.574"></a><FONT color="green">575</FONT> * <a name="line.575"></a><FONT color="green">576</FONT> * @param obj the object (<code>null</code> permitted).<a name="line.576"></a><FONT color="green">577</FONT> * <a name="line.577"></a><FONT color="green">578</FONT> * @return A boolean.<a name="line.578"></a><FONT color="green">579</FONT> */<a name="line.579"></a><FONT color="green">580</FONT> public boolean equals(Object obj) {<a name="line.580"></a><FONT color="green">581</FONT> if (obj == this) {<a name="line.581"></a><FONT color="green">582</FONT> return true; <a name="line.582"></a><FONT color="green">583</FONT> }<a name="line.583"></a><FONT color="green">584</FONT> if (!(obj instanceof XYAreaRenderer)) {<a name="line.584"></a><FONT color="green">585</FONT> return false; <a name="line.585"></a><FONT color="green">586</FONT> }<a name="line.586"></a><FONT color="green">587</FONT> XYAreaRenderer that = (XYAreaRenderer) obj;<a name="line.587"></a><FONT color="green">588</FONT> if (this.plotArea != that.plotArea) {<a name="line.588"></a><FONT color="green">589</FONT> return false; <a name="line.589"></a><FONT color="green">590</FONT> }<a name="line.590"></a><FONT color="green">591</FONT> if (this.plotLines != that.plotLines) {<a name="line.591"></a><FONT color="green">592</FONT> return false; <a name="line.592"></a><FONT color="green">593</FONT> }<a name="line.593"></a><FONT color="green">594</FONT> if (this.plotShapes != that.plotShapes) {<a name="line.594"></a><FONT color="green">595</FONT> return false; <a name="line.595"></a><FONT color="green">596</FONT> }<a name="line.596"></a><FONT color="green">597</FONT> if (this.showOutline != that.showOutline) {<a name="line.597"></a><FONT color="green">598</FONT> return false; <a name="line.598"></a><FONT color="green">599</FONT> }<a name="line.599"></a><FONT color="green">600</FONT> if (!ShapeUtilities.equal(this.legendArea, that.legendArea)) {<a name="line.600"></a><FONT color="green">601</FONT> return false; <a name="line.601"></a><FONT color="green">602</FONT> }<a name="line.602"></a><FONT color="green">603</FONT> return true;<a name="line.603"></a><FONT color="green">604</FONT> }<a name="line.604"></a><FONT color="green">605</FONT> <a name="line.605"></a><FONT color="green">606</FONT> /**<a name="line.606"></a><FONT color="green">607</FONT> * Provides serialization support.<a name="line.607"></a><FONT color="green">608</FONT> *<a name="line.608"></a><FONT color="green">609</FONT> * @param stream the input stream.<a name="line.609"></a><FONT color="green">610</FONT> *<a name="line.610"></a><FONT color="green">611</FONT> * @throws IOException if there is an I/O error.<a name="line.611"></a><FONT color="green">612</FONT> * @throws ClassNotFoundException if there is a classpath problem.<a name="line.612"></a><FONT color="green">613</FONT> */<a name="line.613"></a><FONT color="green">614</FONT> private void readObject(ObjectInputStream stream) <a name="line.614"></a><FONT color="green">615</FONT> throws IOException, ClassNotFoundException {<a name="line.615"></a><FONT color="green">616</FONT> stream.defaultReadObject();<a name="line.616"></a><FONT color="green">617</FONT> this.legendArea = SerialUtilities.readShape(stream);<a name="line.617"></a><FONT color="green">618</FONT> }<a name="line.618"></a><FONT color="green">619</FONT> <a name="line.619"></a><FONT color="green">620</FONT> /**<a name="line.620"></a><FONT color="green">621</FONT> * Provides serialization support.<a name="line.621"></a><FONT color="green">622</FONT> *<a name="line.622"></a><FONT color="green">623</FONT> * @param stream the output stream.<a name="line.623"></a><FONT color="green">624</FONT> *<a name="line.624"></a><FONT color="green">625</FONT> * @throws IOException if there is an I/O error.<a name="line.625"></a><FONT color="green">626</FONT> */<a name="line.626"></a><FONT color="green">627</FONT> private void writeObject(ObjectOutputStream stream) throws IOException {<a name="line.627"></a><FONT color="green">628</FONT> stream.defaultWriteObject();<a name="line.628"></a><FONT color="green">629</FONT> SerialUtilities.writeShape(this.legendArea, stream);<a name="line.629"></a><FONT color="green">630</FONT> }<a name="line.630"></a><FONT color="green">631</FONT> }<a name="line.631"></a></PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -