protected internal virtual void addEntity(PlotRenderingInfo info, Shape hotspot, int rendererIndex, string toolTipText, string urlText) { if (info == null) return; EntityCollection entityCollection = info.getOwner().getEntityCollection(); if (entityCollection == null) return; XYAnnotationEntity annotationEntity = new XYAnnotationEntity(hotspot, rendererIndex, toolTipText, urlText); entityCollection.add((ChartEntity) annotationEntity); }
public override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info) { if (info != null) info.setPlotArea(area); this.getInsets().trim(area); this.setFixedRangeAxisSpaceForSubplots((AxisSpace) null); AxisSpace space = this.calculateAxisSpace(g2, area); Rectangle2D rectangle2D = space.shrink(area, (Rectangle2D) null); this.setFixedRangeAxisSpaceForSubplots(space); ValueAxis domainAxis = this.getDomainAxis(); RectangleEdge domainAxisEdge = this.getDomainAxisEdge(); double d = RectangleEdge.coordinate(rectangle2D, domainAxisEdge); AxisState axisState = domainAxis.draw(g2, d, area, rectangle2D, domainAxisEdge, info); if (parentState == null) parentState = new PlotState(); parentState.getSharedAxisStates().put((object) domainAxis, (object) axisState); for (int index = 0; index < this.subplots.size(); ++index) { XYPlot xyPlot = (XYPlot) this.subplots.get(index); PlotRenderingInfo info1 = (PlotRenderingInfo) null; if (info != null) { info1 = new PlotRenderingInfo(info.getOwner()); info.addSubplotInfo(info1); } xyPlot.draw(g2, this.subplotAreas[index], anchor, parentState, info1); } if (info == null) return; info.setDataArea(rectangle2D); }
public override void drawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass) { if (!this.getItemVisible(series, item)) return; if (pass == 0) { IntervalXYDataset ntervalXyDataset = (IntervalXYDataset) dataset; DeviationRenderer.State state1 = (DeviationRenderer.State) state; double xvalue = ntervalXyDataset.getXValue(series, item); double startYvalue = ntervalXyDataset.getStartYValue(series, item); double endYvalue = ntervalXyDataset.getEndYValue(series, item); RectangleEdge domainAxisEdge = plot.getDomainAxisEdge(); RectangleEdge rangeAxisEdge = plot.getRangeAxisEdge(); double num1 = domainAxis.valueToJava2D(xvalue, dataArea, domainAxisEdge); double num2 = rangeAxis.valueToJava2D(startYvalue, dataArea, rangeAxisEdge); double num3 = rangeAxis.valueToJava2D(endYvalue, dataArea, rangeAxisEdge); PlotOrientation orientation = plot.getOrientation(); if (orientation == PlotOrientation.__\u003C\u003EHORIZONTAL) { List list1 = state1.lowerCoordinates; double[] numArray1 = new double[2]; int index1 = 0; double num4 = num2; numArray1[index1] = num4; int index2 = 1; double num5 = num1; numArray1[index2] = num5; list1.add((object) numArray1); List list2 = state1.upperCoordinates; double[] numArray2 = new double[2]; int index3 = 0; double num6 = num3; numArray2[index3] = num6; int index4 = 1; double num7 = num1; numArray2[index4] = num7; list2.add((object) numArray2); } else if (orientation == PlotOrientation.__\u003C\u003EVERTICAL) { List list1 = state1.lowerCoordinates; double[] numArray1 = new double[2]; int index1 = 0; double num4 = num1; numArray1[index1] = num4; int index2 = 1; double num5 = num2; numArray1[index2] = num5; list1.add((object) numArray1); List list2 = state1.upperCoordinates; double[] numArray2 = new double[2]; int index3 = 0; double num6 = num1; numArray2[index3] = num6; int index4 = 1; double num7 = num3; numArray2[index4] = num7; list2.add((object) numArray2); } if (item == dataset.getItemCount(series) - 1) { Composite composite = g2.getComposite(); g2.setComposite((Composite) AlphaComposite.getInstance(3, this.alpha)); g2.setPaint(this.getItemFillPaint(series, item)); GeneralPath generalPath = new GeneralPath(); double[] numArray1 = (double[]) state1.lowerCoordinates.get(0); ((Path2D.Float) generalPath).moveTo((float) numArray1[0], (float) numArray1[1]); for (int index = 1; index < state1.lowerCoordinates.size(); ++index) { double[] numArray2 = (double[]) state1.lowerCoordinates.get(index); ((Path2D.Float) generalPath).lineTo((float) numArray2[0], (float) numArray2[1]); } int num4 = state1.upperCoordinates.size(); double[] numArray3 = (double[]) state1.upperCoordinates.get(num4 - 1); ((Path2D.Float) generalPath).lineTo((float) numArray3[0], (float) numArray3[1]); int num5 = num4 - 2; while (num5 >= 0) { double[] numArray2 = (double[]) state1.upperCoordinates.get(num5); ((Path2D.Float) generalPath).lineTo((float) numArray2[0], (float) numArray2[1]); num5 += -1; } ((Path2D) generalPath).closePath(); g2.fill((Shape) generalPath); g2.setComposite(composite); state1.lowerCoordinates.clear(); state1.upperCoordinates.clear(); } } if (this.isLinePass(pass)) { if (item == 0) { DeviationRenderer.State state1 = (DeviationRenderer.State) state; ((Path2D) state1.seriesPath).reset(); state1.setLastPointGood(false); } if (!this.getItemLineVisible(series, item)) return; this.drawPrimaryLineAsPath(state, g2, plot, dataset, pass, series, item, domainAxis, rangeAxis, dataArea); } else { if (!this.isItemPass(pass)) return; EntityCollection entities = (EntityCollection) null; if (info != null) entities = info.getOwner().getEntityCollection(); this.drawSecondaryPass(g2, plot, dataset, pass, series, item, domainAxis, dataArea, rangeAxis, crosshairState, entities); } }
public override void drawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass) { if (!(dataset is IntervalXYDataset) || !(dataset is TableXYDataset)) { string str1 = new StringBuffer().append("dataset (type ").append(Object.instancehelper_getClass((object) dataset).getName()).append(") has wrong type:").toString(); int num = 0; if (!(StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024IntervalXYDataset != null ? StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024IntervalXYDataset : (StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024IntervalXYDataset = StackedXYBarRenderer.class\u0024("org.jfree.data.xy.IntervalXYDataset"))).isAssignableFrom(Object.instancehelper_getClass((object) dataset))) { str1 = new StringBuffer().append(str1).append(" it is no IntervalXYDataset").toString(); num = 1; } if (!(StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024TableXYDataset != null ? StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024TableXYDataset : (StackedXYBarRenderer.class\u0024org\u0024jfree\u0024data\u0024xy\u0024TableXYDataset = StackedXYBarRenderer.class\u0024("org.jfree.data.xy.TableXYDataset"))).isAssignableFrom(Object.instancehelper_getClass((object) dataset))) { if (num != 0) str1 = new StringBuffer().append(str1).append(" and").toString(); str1 = new StringBuffer().append(str1).append(" it is no TableXYDataset").toString(); } string str2 = str1; Throwable.__\u003CsuppressFillInStackTrace\u003E(); throw new IllegalArgumentException(str2); } else { IntervalXYDataset ntervalXyDataset = (IntervalXYDataset) dataset; double yvalue1 = ntervalXyDataset.getYValue(series, item); if (Double.isNaN(yvalue1)) return; double num1 = 0.0; if (this.renderAsPercentages) { num1 = DatasetUtilities.calculateStackTotal((TableXYDataset) dataset, item); yvalue1 /= num1; } double d1 = 0.0; double d2 = 0.0; for (int i1 = 0; i1 < series; ++i1) { double yvalue2 = dataset.getYValue(i1, item); if (!Double.isNaN(yvalue2)) { if (this.renderAsPercentages) yvalue2 /= num1; if (yvalue2 > 0.0) d1 += yvalue2; else d2 += yvalue2; } } RectangleEdge rangeAxisEdge = plot.getRangeAxisEdge(); double num2; double num3; if (yvalue1 > 0.0) { num2 = rangeAxis.valueToJava2D(d1, dataArea, rangeAxisEdge); num3 = rangeAxis.valueToJava2D(d1 + yvalue1, dataArea, rangeAxisEdge); } else { num2 = rangeAxis.valueToJava2D(d2, dataArea, rangeAxisEdge); num3 = rangeAxis.valueToJava2D(d2 + yvalue1, dataArea, rangeAxisEdge); } RectangleEdge domainAxisEdge = plot.getDomainAxisEdge(); double startXvalue = ntervalXyDataset.getStartXValue(series, item); if (Double.isNaN(startXvalue)) return; double num4 = domainAxis.valueToJava2D(startXvalue, dataArea, domainAxisEdge); double endXvalue = ntervalXyDataset.getEndXValue(series, item); if (Double.isNaN(endXvalue)) return; double num5 = domainAxis.valueToJava2D(endXvalue, dataArea, domainAxisEdge); double num6 = Math.max(1.0, Math.abs(num5 - num4)); double num7 = Math.abs(num3 - num2); if (this.getMargin() > 0.0) { double num8 = num6 * this.getMargin(); num6 -= num8; num4 += num8 / 2.0; } Rectangle2D.Double @double = (Rectangle2D.Double) null; PlotOrientation orientation = plot.getOrientation(); if (orientation == PlotOrientation.__\u003C\u003EHORIZONTAL) @double = new Rectangle2D.Double(Math.min(num2, num3), num5, num7, num6); else if (orientation == PlotOrientation.__\u003C\u003EVERTICAL) @double = new Rectangle2D.Double(num4, Math.min(num2, num3), num6, num7); int num9 = yvalue1 > 0.0 ? 1 : 0; int num10 = rangeAxis.isInverted() ? 1 : 0; RectangleEdge re = orientation != PlotOrientation.__\u003C\u003EHORIZONTAL ? (num9 != 0 && num10 == 0 || num9 == 0 && num10 != 0 ? RectangleEdge.__\u003C\u003EBOTTOM : RectangleEdge.__\u003C\u003ETOP) : (num9 != 0 && num10 != 0 || num9 == 0 && num10 == 0 ? RectangleEdge.__\u003C\u003ERIGHT : RectangleEdge.__\u003C\u003ELEFT); if (pass == 0) { if (!this.getShadowsVisible()) return; this.getBarPainter().paintBarShadow(g2, (XYBarRenderer) this, series, item, (RectangularShape) @double, re, false); } else if (pass == 1) { this.getBarPainter().paintBar(g2, (XYBarRenderer) this, series, item, (RectangularShape) @double, re); if (info == null) return; EntityCollection entityCollection = info.getOwner().getEntityCollection(); if (entityCollection == null) return; this.addEntity(entityCollection, (Shape) @double, dataset, series, item, ((RectangularShape) @double).getCenterX(), ((RectangularShape) @double).getCenterY()); } else { if (pass != 2 || !this.isItemLabelVisible(series, item)) return; XYItemLabelGenerator itemLabelGenerator = this.getItemLabelGenerator(series, item); this.drawItemLabel(g2, dataset, series, item, plot, itemLabelGenerator, (Rectangle2D) @double, yvalue1 < 0.0); } } }
public override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info) { if (info != null) info.setPlotArea(area); RectangleInsets insets = this.getInsets(); area.setRect(((RectangularShape) area).getX() + insets.getLeft(), ((RectangularShape) area).getY() + insets.getTop(), ((RectangularShape) area).getWidth() - insets.getLeft() - insets.getRight(), ((RectangularShape) area).getHeight() - insets.getTop() - insets.getBottom()); this.setFixedRangeAxisSpaceForSubplots((AxisSpace) null); AxisSpace space = this.calculateAxisSpace(g2, area); Rectangle2D rectangle2D = space.shrink(area, (Rectangle2D) null); this.setFixedRangeAxisSpaceForSubplots(space); CategoryAxis domainAxis = this.getDomainAxis(); RectangleEdge domainAxisEdge = this.getDomainAxisEdge(); double cursor = RectangleEdge.coordinate(rectangle2D, domainAxisEdge); AxisState axisState = domainAxis.draw(g2, cursor, area, rectangle2D, domainAxisEdge, info); if (parentState == null) parentState = new PlotState(); parentState.getSharedAxisStates().put((object) domainAxis, (object) axisState); for (int index = 0; index < this.subplots.size(); ++index) { CategoryPlot categoryPlot = (CategoryPlot) this.subplots.get(index); PlotRenderingInfo plotRenderingInfo = (PlotRenderingInfo) null; if (info != null) { plotRenderingInfo = new PlotRenderingInfo(info.getOwner()); info.addSubplotInfo(plotRenderingInfo); } Point2D anchor1 = (Point2D) null; if (anchor != null && ((RectangularShape) this.subplotAreas[index]).contains(anchor)) anchor1 = anchor; categoryPlot.draw(g2, this.subplotAreas[index], anchor1, parentState, plotRenderingInfo); } if (info == null) return; info.setDataArea(rectangle2D); }