public void fill(java.awt.Color color)
        {
            if (color == null)
            {
                String message = Logging.getMessage("nullValue.ColorIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            java.awt.Graphics2D g2d = this.getGraphics();

            // Keep track of the previous color.
            java.awt.Color prevColor = g2d.getColor();
            try
            {
                // Fill the raster with the specified color.
                g2d.setColor(color);
                g2d.fillRect(0, 0, this.getWidth(), this.getHeight());
            }
            finally
            {
                // Restore the previous color.
                g2d.setColor(prevColor);
            }
        }
Esempio n. 2
0
 protected internal override Size2D arrangeRN(Graphics2D g2, Range widthRange)
 {
   Size2D size2D = this.arrangeNN(g2);
   if (widthRange.contains(size2D.getWidth()))
     return size2D;
   double w = widthRange.constrain(size2D.getWidth());
   return this.arrangeFN(g2, w);
 }
Esempio n. 3
0
 public virtual void draw(Graphics2D g2, Rectangle2D area)
 {
   area = this.trimMargin(area);
   this.drawBorder(g2, area);
   area = this.trimBorder(area);
   area = this.trimPadding(area);
   g2.setPaint(this.paint);
   g2.fill((Shape) area);
 }
Esempio n. 4
0
 protected internal override Size2D arrangeRR(Graphics2D g2, Range widthRange, Range heightRange)
 {
   ((Graphics) g2).setFont(this.getFont());
   FontMetrics fontMetrics = ((Graphics) g2).getFontMetrics(this.getFont());
   Rectangle2D textBounds = TextUtilities.getTextBounds(this.getText(), g2, fontMetrics);
   if (((RectangularShape) textBounds).getWidth() <= widthRange.getUpperBound() && ((RectangularShape) textBounds).getHeight() <= heightRange.getUpperBound())
     return new Size2D(((RectangularShape) textBounds).getWidth(), ((RectangularShape) textBounds).getHeight());
   else
     return new Size2D(0.0, 0.0);
 }
 public java.awt.Graphics2D getGraphics()
 {
     if (this.g2d == null)
     {
         this.g2d = this.bufferedImage.createGraphics();
         // Enable bilinear interpolation.
         this.g2d.setRenderingHint(java.awt.RenderingHints.KEY_INTERPOLATION,
                                   java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR);
     }
     return(g2d);
 }
Esempio n. 6
0
 internal void Draw(awt.Graphics2D g2d, float x, float y)
 {
     if (_lineIter.Format.IsVertical)
     {
         _layout.draw(g2d, y + NativeY, -(x + NativeX));
     }
     else
     {
         _layout.draw(g2d, x + NativeX, y + NativeY);
     }
 }
        public void dispose()
        {
            if (this.g2d != null)
            {
                this.g2d.dispose();
                this.g2d = null;
            }

            if (this.bufferedImage != null)
            {
                this.bufferedImage.flush();
                this.bufferedImage = null;
            }
        }
Esempio n. 8
0
 protected internal virtual Size2D drawHorizontal(Graphics2D g2, Rectangle2D chartArea)
 {
   double width = this.getWidth();
   double height = this.getHeight();
   RectangleInsets padding = this.getPadding();
   double num1 = padding.calculateTopOutset(height);
   double num2 = padding.calculateBottomOutset(height);
   double num3 = padding.calculateLeftOutset(width);
   double num4 = padding.calculateRightOutset(width);
   double num5 = this.getPosition() != RectangleEdge.__\u003C\u003ETOP ? ((RectangularShape) chartArea).getY() + ((RectangularShape) chartArea).getHeight() - num2 - height : ((RectangularShape) chartArea).getY() + num1;
   HorizontalAlignment horizontalAlignment = this.getHorizontalAlignment();
   double num6 = 0.0;
   if (horizontalAlignment == HorizontalAlignment.__\u003C\u003ECENTER)
     num6 = ((RectangularShape) chartArea).getX() + num3 + ((RectangularShape) chartArea).getWidth() / 2.0 - width / 2.0;
   else if (horizontalAlignment == HorizontalAlignment.__\u003C\u003ELEFT)
     num6 = ((RectangularShape) chartArea).getX() + num3;
   else if (horizontalAlignment == HorizontalAlignment.__\u003C\u003ERIGHT)
     num6 = ((RectangularShape) chartArea).getX() + ((RectangularShape) chartArea).getWidth() - num4 - width;
   ((Graphics) g2).drawImage(this.image, ByteCodeHelper.d2i(num6), ByteCodeHelper.d2i(num5), ByteCodeHelper.d2i(width), ByteCodeHelper.d2i(height), (ImageObserver) null);
   return new Size2D(((RectangularShape) chartArea).getWidth() + num3 + num4, height + num1 + num2);
 }
 protected internal override AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea)
 {
   AxisSpace space1 = new AxisSpace();
   PlotOrientation orientation = this.getOrientation();
   AxisSpace fixedDomainAxisSpace = this.getFixedDomainAxisSpace();
   if (fixedDomainAxisSpace != null)
   {
     if (orientation == PlotOrientation.__\u003C\u003EHORIZONTAL)
     {
       space1.setLeft(fixedDomainAxisSpace.getLeft());
       space1.setRight(fixedDomainAxisSpace.getRight());
     }
     else if (orientation == PlotOrientation.__\u003C\u003EVERTICAL)
     {
       space1.setTop(fixedDomainAxisSpace.getTop());
       space1.setBottom(fixedDomainAxisSpace.getBottom());
     }
   }
   else
   {
     ValueAxis domainAxis = this.getDomainAxis();
     RectangleEdge edge = Plot.resolveDomainAxisLocation(this.getDomainAxisLocation(), orientation);
     if (domainAxis != null)
       space1 = domainAxis.reserveSpace(g2, (Plot) this, plotArea, edge, space1);
   }
   Rectangle2D rectangle2D = space1.shrink(plotArea, (Rectangle2D) null);
   int length = this.subplots.size();
   int num1 = 0;
   for (int index = 0; index < length; ++index)
   {
     XYPlot xyPlot = (XYPlot) this.subplots.get(index);
     num1 += xyPlot.getWeight();
   }
   this.subplotAreas = new Rectangle2D[length];
   double num2 = ((RectangularShape) rectangle2D).getX();
   double num3 = ((RectangularShape) rectangle2D).getY();
   double num4 = 0.0;
   if (orientation == PlotOrientation.__\u003C\u003EHORIZONTAL)
     num4 = ((RectangularShape) rectangle2D).getWidth() - this.gap * (double) (length - 1);
   else if (orientation == PlotOrientation.__\u003C\u003EVERTICAL)
     num4 = ((RectangularShape) rectangle2D).getHeight() - this.gap * (double) (length - 1);
   for (int index = 0; index < length; ++index)
   {
     XYPlot xyPlot = (XYPlot) this.subplots.get(index);
     if (orientation == PlotOrientation.__\u003C\u003EHORIZONTAL)
     {
       double num5 = num4 * (double) xyPlot.getWeight() / (double) num1;
       this.subplotAreas[index] = (Rectangle2D) new Rectangle2D.Double(num2, num3, num5, ((RectangularShape) rectangle2D).getHeight());
       num2 = num2 + num5 + this.gap;
     }
     else if (orientation == PlotOrientation.__\u003C\u003EVERTICAL)
     {
       double num5 = num4 * (double) xyPlot.getWeight() / (double) num1;
       this.subplotAreas[index] = (Rectangle2D) new Rectangle2D.Double(num2, num3, ((RectangularShape) rectangle2D).getWidth(), num5);
       num3 = num3 + num5 + this.gap;
     }
     AxisSpace space2 = xyPlot.calculateRangeAxisSpace(g2, this.subplotAreas[index], (AxisSpace) null);
     space1.ensureAtLeast(space2);
   }
   return space1;
 }
 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);
 }
Esempio n. 11
0
 public virtual object draw(Graphics2D g2, Rectangle2D area, object @params)
 {
   this.draw(g2, area);
   return (object) null;
 }
Esempio n. 12
0
 public override AxisSpace reserveSpace(Graphics2D g2, Plot plot, Rectangle2D plotArea, RectangleEdge edge, AxisSpace space)
 {
   this.internalMarkerCycleBoundTick = (Tick) null;
   AxisSpace axisSpace = base.reserveSpace(g2, plot, plotArea, edge, space);
   if (this.internalMarkerCycleBoundTick == null)
     return axisSpace;
   FontMetrics fontMetrics = ((Graphics) g2).getFontMetrics(this.getTickLabelFont());
   Rectangle2D textBounds = TextUtilities.getTextBounds(this.internalMarkerCycleBoundTick.getText(), g2, fontMetrics);
   if (RectangleEdge.isTopOrBottom(edge))
   {
     if (this.isVerticalTickLabels())
       space.add(((RectangularShape) textBounds).getHeight() / 2.0, RectangleEdge.__\u003C\u003ERIGHT);
     else
       space.add(((RectangularShape) textBounds).getWidth() / 2.0, RectangleEdge.__\u003C\u003ERIGHT);
   }
   else if (RectangleEdge.isLeftOrRight(edge))
   {
     if (this.isVerticalTickLabels())
       space.add(((RectangularShape) textBounds).getWidth() / 2.0, RectangleEdge.__\u003C\u003ETOP);
     else
       space.add(((RectangularShape) textBounds).getHeight() / 2.0, RectangleEdge.__\u003C\u003ETOP);
   }
   return axisSpace;
 }
 public override void drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass)
 {
   Number number1 = dataset.getValue(row, column);
   if (number1 == null)
     return;
   double categoryMiddle1 = domainAxis.getCategoryMiddle(column, this.getColumnCount(), dataArea, plot.getDomainAxisEdge());
   double num1 = rangeAxis.valueToJava2D(number1.doubleValue(), dataArea, plot.getRangeAxisEdge());
   g2.setPaint(this.getItemPaint(row, column));
   g2.setStroke(this.getItemStroke(row, column));
   Rectangle2D.Double double1 = new Rectangle2D.Double(categoryMiddle1 - 4.0, num1 - 4.0, 8.0, 8.0);
   PlotOrientation orientation = plot.getOrientation();
   if (orientation == PlotOrientation.__\u003C\u003EVERTICAL)
     this.objectIcon.paintIcon((Component) null, (Graphics) g2, ByteCodeHelper.d2i(categoryMiddle1), ByteCodeHelper.d2i(num1));
   else
     this.objectIcon.paintIcon((Component) null, (Graphics) g2, ByteCodeHelper.d2i(num1), ByteCodeHelper.d2i(categoryMiddle1));
   if (this.lastCategory == column)
   {
     if (this.min > number1.doubleValue())
       this.min = number1.doubleValue();
     if (this.max < number1.doubleValue())
       this.max = number1.doubleValue();
     if (dataset.getRowCount() - 1 == row)
     {
       g2.setPaint(this.groupPaint);
       g2.setStroke(this.groupStroke);
       double num2 = rangeAxis.valueToJava2D(this.min, dataArea, plot.getRangeAxisEdge());
       double num3 = rangeAxis.valueToJava2D(this.max, dataArea, plot.getRangeAxisEdge());
       if (orientation == PlotOrientation.__\u003C\u003EVERTICAL)
       {
         g2.draw((Shape) new Line2D.Double(categoryMiddle1, num2, categoryMiddle1, num3));
         this.minIcon.paintIcon((Component) null, (Graphics) g2, ByteCodeHelper.d2i(categoryMiddle1), ByteCodeHelper.d2i(num2));
         this.maxIcon.paintIcon((Component) null, (Graphics) g2, ByteCodeHelper.d2i(categoryMiddle1), ByteCodeHelper.d2i(num3));
       }
       else
       {
         g2.draw((Shape) new Line2D.Double(num2, categoryMiddle1, num3, categoryMiddle1));
         this.minIcon.paintIcon((Component) null, (Graphics) g2, ByteCodeHelper.d2i(num2), ByteCodeHelper.d2i(categoryMiddle1));
         this.maxIcon.paintIcon((Component) null, (Graphics) g2, ByteCodeHelper.d2i(num3), ByteCodeHelper.d2i(categoryMiddle1));
       }
     }
   }
   else
   {
     this.lastCategory = column;
     this.min = number1.doubleValue();
     this.max = number1.doubleValue();
   }
   if (this.plotLines && column != 0)
   {
     Number number2 = dataset.getValue(row, column - 1);
     if (number2 != null)
     {
       double d = number2.doubleValue();
       double categoryMiddle2 = domainAxis.getCategoryMiddle(column - 1, this.getColumnCount(), dataArea, plot.getDomainAxisEdge());
       double num2 = rangeAxis.valueToJava2D(d, dataArea, plot.getRangeAxisEdge());
       g2.setPaint(this.getItemPaint(row, column));
       g2.setStroke(this.getItemStroke(row, column));
       Line2D.Double double2 = orientation != PlotOrientation.__\u003C\u003EVERTICAL ? new Line2D.Double(num2, categoryMiddle2, num1, categoryMiddle1) : new Line2D.Double(categoryMiddle2, num2, categoryMiddle1, num1);
       g2.draw((Shape) double2);
     }
   }
   EntityCollection entityCollection = state.getEntityCollection();
   if (entityCollection == null || double1 == null)
     return;
   this.addItemEntity(entityCollection, dataset, row, column, (Shape) double1);
 }
Esempio n. 14
0
 public override object draw(Graphics2D g2, Rectangle2D area, object @params)
 {
   if (((RectangularShape) area).isEmpty())
     return (object) null;
   area = this.trimMargin(area);
   this.drawBorder(g2, area);
   area = this.trimBorder(area);
   area = this.trimPadding(area);
   ((Graphics) g2).setFont(this.getFont());
   g2.setPaint(this.getPaint());
   TextUtilities.drawAlignedString(this.getText(), g2, (float) ((RectangularShape) area).getMinX(), (float) ((RectangularShape) area).getMinY(), TextAnchor.__\u003C\u003ETOP_LEFT);
   return (object) null;
 }
 protected internal virtual void drawInterval(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, IntervalCategoryDataset dataset, int row, int column)
 {
   int visibleSeriesIndex = state.getVisibleSeriesIndex(row);
   if (visibleSeriesIndex < 0)
     return;
   int num1 = state.getVisibleSeriesCount() < 0 ? this.getRowCount() : state.getVisibleSeriesCount();
   int columnCount = this.getColumnCount();
   PlotOrientation orientation = plot.getOrientation();
   double num2 = 0.0;
   double num3 = 0.0;
   RectangleEdge domainAxisEdge = plot.getDomainAxisEdge();
   RectangleEdge rangeAxisEdge = plot.getRangeAxisEdge();
   Number endValue = dataset.getEndValue(row, column);
   if (endValue == null)
     return;
   double num4 = rangeAxis.valueToJava2D(endValue.doubleValue(), dataArea, rangeAxisEdge);
   Number startValue = dataset.getStartValue(row, column);
   if (startValue == null)
     return;
   double num5 = rangeAxis.valueToJava2D(startValue.doubleValue(), dataArea, rangeAxisEdge);
   if (num5 < num4)
   {
     double num6 = num5;
     num5 = num4;
     num4 = num6;
   }
   double num7 = state.getBarWidth();
   double num8 = Math.abs(num5 - num4);
   RectangleEdge re = RectangleEdge.__\u003C\u003ELEFT;
   if (orientation == PlotOrientation.__\u003C\u003EHORIZONTAL)
   {
     double categoryStart = domainAxis.getCategoryStart(column, this.getColumnCount(), dataArea, domainAxisEdge);
     if (num1 > 1)
     {
       double num6 = ((RectangularShape) dataArea).getHeight() * this.getItemMargin() / (double) (columnCount * (num1 - 1));
       num3 = categoryStart + (double) visibleSeriesIndex * (state.getBarWidth() + num6);
     }
     else
       num3 = categoryStart + (double) visibleSeriesIndex * state.getBarWidth();
     num2 = num4;
     num8 = state.getBarWidth();
     num7 = Math.abs(num5 - num4);
     re = RectangleEdge.__\u003C\u003ELEFT;
   }
   else if (orientation == PlotOrientation.__\u003C\u003EVERTICAL)
   {
     double categoryStart = domainAxis.getCategoryStart(column, this.getColumnCount(), dataArea, domainAxisEdge);
     if (num1 > 1)
     {
       double num6 = ((RectangularShape) dataArea).getWidth() * this.getItemMargin() / (double) (columnCount * (num1 - 1));
       num2 = categoryStart + (double) visibleSeriesIndex * (state.getBarWidth() + num6);
     }
     else
       num2 = categoryStart + (double) visibleSeriesIndex * state.getBarWidth();
     num3 = num4;
     re = RectangleEdge.__\u003C\u003EBOTTOM;
   }
   Rectangle2D.Double @double = new Rectangle2D.Double(num2, num3, num7, num8);
   BarPainter barPainter = this.getBarPainter();
   if (this.getShadowsVisible())
     barPainter.paintBarShadow(g2, (BarRenderer) this, row, column, (RectangularShape) @double, re, false);
   this.getBarPainter().paintBar(g2, (BarRenderer) this, row, column, (RectangularShape) @double, re);
   CategoryItemLabelGenerator itemLabelGenerator = this.getItemLabelGenerator(row, column);
   if (itemLabelGenerator != null && this.isItemLabelVisible(row, column))
     this.drawItemLabel(g2, (CategoryDataset) dataset, row, column, plot, itemLabelGenerator, (Rectangle2D) @double, false);
   EntityCollection entityCollection = state.getEntityCollection();
   if (entityCollection == null)
     return;
   this.addItemEntity(entityCollection, (CategoryDataset) dataset, row, column, (Shape) @double);
 }
Esempio n. 16
0
 public override XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
 {
   XYLineAndShapeRenderer.State state = (XYLineAndShapeRenderer.State) base.initialise(g2, dataArea, plot, data, info);
   state.setProcessVisibleItemsOnly(false);
   this.points = new Vector();
   this.setDrawSeriesLineAsPath(true);
   return (XYItemRendererState) state;
 }
 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, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass)
 {
   if (dataset is IntervalCategoryDataset)
   {
     IntervalCategoryDataset dataset1 = (IntervalCategoryDataset) dataset;
     this.drawInterval(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset1, row, column);
   }
   else
     base.drawItem(g2, state, dataArea, plot, domainAxis, rangeAxis, dataset, row, column, pass);
 }
 public override XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset dataset, PlotRenderingInfo info)
 {
   DeviationRenderer.State state = new DeviationRenderer.State(info);
   state.seriesPath = new GeneralPath();
   state.setProcessVisibleItemsOnly(false);
   return (XYItemRendererState) state;
 }
 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 XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
 {
   return (XYItemRendererState) new XYBarRenderer.XYBarRendererState((XYBarRenderer) this, info);
 }
Esempio n. 22
0
 protected internal override List refreshTicksHorizontal(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
 {
   ArrayList arrayList = new ArrayList();
   Range range = this.getRange();
   double val1 = range.getLowerBound();
   if (this.smallLogFlag && val1 < 1E-100)
     val1 = 1E-100;
   double upperBound = range.getUpperBound();
   int num1 = ByteCodeHelper.d2i(Math.rint(this.switchedLog10(val1)));
   int num2 = ByteCodeHelper.d2i(Math.rint(this.switchedLog10(upperBound)));
   if (num1 == num2 && num1 > 0 && Math.pow(10.0, (double) num1) > val1)
     num1 += -1;
   int num3 = 0;
   for (int index1 = num1; index1 <= num2; ++index1)
   {
     for (int index2 = 0; index2 < 10; ++index2)
     {
       double val2;
       string label;
       if (this.smallLogFlag)
       {
         val2 = Math.pow(10.0, (double) index1) + Math.pow(10.0, (double) index1) * (double) index2;
         if (this.expTickLabelsFlag || index1 < 0 && val2 > 0.0 && val2 < 1.0)
         {
           if (index2 == 0 || index1 > -4 && index2 < 2 || val2 >= upperBound)
           {
             this.__\u003C\u003EnumberFormatterObj.setMaximumFractionDigits(-index1);
             label = this.makeTickLabel(val2, true);
           }
           else
             label = "";
         }
         else
           label = index2 < 1 || index1 < 1 && index2 < 5 || (index2 < 4 - index1 || val2 >= upperBound) ? this.makeTickLabel(val2) : "";
       }
       else
       {
         if (num3 != 0)
           index2 += -1;
         val2 = index1 < 0 ? -(Math.pow(10.0, (double) -index1) - Math.pow(10.0, (double) (-index1 - 1)) * (double) index2) : Math.pow(10.0, (double) index1) + Math.pow(10.0, (double) index1) * (double) index2;
         if (num3 == 0)
         {
           if (Math.abs(val2 - 1.0) < 0.0001 && val1 <= 0.0 && upperBound >= 0.0)
           {
             val2 = 0.0;
             num3 = 1;
           }
         }
         else
           num3 = 0;
         label = this.expTickLabelsFlag && index2 < 2 || index2 < 1 || (index1 < 1 && index2 < 5 || (index2 < 4 - index1 || val2 >= upperBound)) ? this.makeTickLabel(val2) : "";
       }
       if (val2 > upperBound)
         return (List) arrayList;
       if (val2 >= val1 - 1E-100)
       {
         double angle = 0.0;
         TextAnchor textAnchor;
         TextAnchor rotationAnchor;
         if (this.isVerticalTickLabels())
         {
           textAnchor = TextAnchor.__\u003C\u003ECENTER_RIGHT;
           rotationAnchor = TextAnchor.__\u003C\u003ECENTER_RIGHT;
           angle = edge != RectangleEdge.__\u003C\u003ETOP ? -1.0 * Math.PI / 2.0 : Math.PI / 2.0;
         }
         else if (edge == RectangleEdge.__\u003C\u003ETOP)
         {
           textAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
           rotationAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
         }
         else
         {
           textAnchor = TextAnchor.__\u003C\u003ETOP_CENTER;
           rotationAnchor = TextAnchor.__\u003C\u003ETOP_CENTER;
         }
         NumberTick numberTick = new NumberTick((Number) new Double(val2), label, textAnchor, rotationAnchor, angle);
         ((List) arrayList).add((object) numberTick);
       }
     }
   }
   return (List) arrayList;
 }
Esempio n. 23
0
 protected internal override Size2D arrangeFN(Graphics2D g2, double w)
 {
   ((Graphics) g2).setFont(this.getFont());
   FontMetrics fontMetrics = ((Graphics) g2).getFontMetrics(this.getFont());
   Rectangle2D textBounds = TextUtilities.getTextBounds(this.getText(), g2, fontMetrics);
   if (((RectangularShape) textBounds).getWidth() <= w)
     return new Size2D(w, ((RectangularShape) textBounds).getHeight());
   else
     return new Size2D(0.0, 0.0);
 }
Esempio n. 24
0
 protected internal override List refreshTicksVertical(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
 {
   ArrayList arrayList = new ArrayList();
   double val = this.getRange().getLowerBound();
   if (this.smallLogFlag && val < 1E-100)
     val = 1E-100;
   double upperBound = this.getRange().getUpperBound();
   int num1 = ByteCodeHelper.d2i(Math.rint(this.switchedLog10(val)));
   int num2 = ByteCodeHelper.d2i(Math.rint(this.switchedLog10(upperBound)));
   if (num1 == num2 && num1 > 0 && Math.pow(10.0, (double) num1) > val)
     num1 += -1;
   int num3 = 0;
   for (int index1 = num1; index1 <= num2; ++index1)
   {
     int num4 = 10;
     if (index1 == num2)
       num4 = 1;
     for (int index2 = 0; index2 < num4; ++index2)
     {
       double num5;
       string label;
       if (this.smallLogFlag)
       {
         num5 = Math.pow(10.0, (double) index1) + Math.pow(10.0, (double) index1) * (double) index2;
         if (index2 == 0)
         {
           if (this.log10TickLabelsFlag)
             label = new StringBuffer().append("10^").append(index1).toString();
           else if (this.expTickLabelsFlag)
             label = new StringBuffer().append("1e").append(index1).toString();
           else if (index1 >= 0)
           {
             NumberFormat numberFormatOverride = this.getNumberFormatOverride();
             label = numberFormatOverride == null ? Long.toString(ByteCodeHelper.d2l(Math.rint(num5))) : numberFormatOverride.format(num5);
           }
           else
           {
             this.__\u003C\u003EnumberFormatterObj.setMaximumFractionDigits(-index1);
             label = this.__\u003C\u003EnumberFormatterObj.format(num5);
           }
         }
         else
           label = "";
       }
       else
       {
         if (num3 != 0)
           index2 += -1;
         num5 = index1 < 0 ? -(Math.pow(10.0, (double) -index1) - Math.pow(10.0, (double) (-index1 - 1)) * (double) index2) : Math.pow(10.0, (double) index1) + Math.pow(10.0, (double) index1) * (double) index2;
         if (index2 == 0)
         {
           if (num3 == 0)
           {
             if (index1 > num1 && index1 < num2 && Math.abs(num5 - 1.0) < 0.0001)
             {
               num5 = 0.0;
               num3 = 1;
               label = "0";
             }
             else if (this.log10TickLabelsFlag)
               label = new StringBuffer().append(index1 >= 0 ? "" : "-").append("10^").append(Math.abs(index1)).toString();
             else if (this.expTickLabelsFlag)
             {
               label = new StringBuffer().append(index1 >= 0 ? "" : "-").append("1e").append(Math.abs(index1)).toString();
             }
             else
             {
               NumberFormat numberFormatOverride = this.getNumberFormatOverride();
               label = numberFormatOverride == null ? Long.toString(ByteCodeHelper.d2l(Math.rint(num5))) : numberFormatOverride.format(num5);
             }
           }
           else
           {
             label = "";
             num3 = 0;
           }
         }
         else
         {
           label = "";
           num3 = 0;
         }
       }
       if (num5 > upperBound)
         return (List) arrayList;
       if (num5 >= val - 1E-100)
       {
         double angle = 0.0;
         TextAnchor textAnchor;
         TextAnchor rotationAnchor;
         if (this.isVerticalTickLabels())
         {
           if (edge == RectangleEdge.__\u003C\u003ELEFT)
           {
             textAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
             rotationAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
             angle = -1.0 * Math.PI / 2.0;
           }
           else
           {
             textAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
             rotationAnchor = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
             angle = Math.PI / 2.0;
           }
         }
         else if (edge == RectangleEdge.__\u003C\u003ELEFT)
         {
           textAnchor = TextAnchor.__\u003C\u003ECENTER_RIGHT;
           rotationAnchor = TextAnchor.__\u003C\u003ECENTER_RIGHT;
         }
         else
         {
           textAnchor = TextAnchor.__\u003C\u003ECENTER_LEFT;
           rotationAnchor = TextAnchor.__\u003C\u003ECENTER_LEFT;
         }
         ((List) arrayList).add((object) new NumberTick((Number) new Double(num5), label, textAnchor, rotationAnchor, angle));
       }
     }
   }
   return (List) arrayList;
 }
//    protected void doDrawOnTo(BufferedImageRaster canvas)
//    {
//        Sector sector = this.getSector();
//        if (null == sector)
//        {
//            String message = Logging.getMessage("nullValue.SectorIsNull");
//            Logging.logger().severe(message);
//            throw new ArgumentException(message);
//        }
//
//        if (!sector.intersects(canvas.getSector()))
//        {
//            return;
//        }
//
//        BufferedImage transformedImage = null;
//        java.awt.Graphics2D g2d = null;
//        java.awt.Shape prevClip = null;
//        java.awt.Composite prevComposite = null;
//
//        try
//        {
//            int canvasWidth = canvas.getWidth();
//            int canvasHeight = canvas.getHeight();
//
//            // Apply the transform that correctly maps the image onto the canvas.
//            java.awt.geom.AffineTransform transform = this.computeSourceToDestTransform(
//                this.getWidth(), this.getHeight(), this.getSector(), canvasWidth, canvasHeight, canvas.getSector());
//
//            AffineTransformOp op = new AffineTransformOp(transform, AffineTransformOp.TYPE_BILINEAR);
//            Rectangle2D rect = op.getBounds2D(this.getBufferedImage());
//
//            int clipWidth = (int) Math.Ceiling((rect.getMaxX() >= canvasWidth) ? canvasWidth : rect.getMaxX());
//            int clipHeight = (int) Math.Ceiling((rect.getMaxY() >= canvasHeight) ? canvasHeight : rect.getMaxY());
//
//            if (clipWidth <= 0 || clipHeight <= 0)
//            {
//                return;
//            }
//
//            int transformedImageType = (BufferedImage.TYPE_CUSTOM != this.getBufferedImage().getType())
//                ? this.getBufferedImage().getType() : BufferedImage.TYPE_INT_ARGB;
//
//            transformedImage = new BufferedImage(clipWidth, clipHeight, transformedImageType);
//            op.filter(this.getBufferedImage(), transformedImage);
//
//            g2d = canvas.getGraphics();
//
//            prevClip = g2d.getClip();
//            prevComposite = g2d.getComposite();
//
//            // Set the alpha composite for appropriate alpha blending.
//            g2d.setComposite(java.awt.AlphaComposite.SrcOver);
//            g2d.drawImage(transformedImage, 0, 0, null);
//        }
//        catch (java.awt.image.ImagingOpException ioe)
//        {
//            // If we catch a ImagingOpException, then the transformed image has a width or height of 0.
//            // This indicates that there is no intersection between the source image and the canvas,
//            // or the intersection is smaller than one pixel.
//        }
//        catch (java.awt.image.RasterFormatException rfe)
//        {
//            // If we catch a RasterFormatException, then the transformed image has a width or height of 0.
//            // This indicates that there is no intersection between the source image and the canvas,
//            // or the intersection is smaller than one pixel.
//        }
//        finally
//        {
//            // Restore the previous clip, composite, and transform.
//            try
//            {
//                if (null != transformedImage)
//                {
//                    transformedImage.flush();
//                }
//
//                if (null != g2d)
//                {
//                    if (null != prevClip)
//                    {
//                        g2d.setClip(prevClip);
//                    }
//
//                    if (null != prevComposite)
//                    {
//                        g2d.setComposite(prevComposite);
//                    }
//                }
//            }
//            catch (Throwable t)
//            {
//                Logging.logger().log(java.util.logging.Level.FINEST, WWUtil.extractExceptionReason(t), t);
//            }
//        }
//    }

        protected void doDrawOnTo(BufferedImageRaster canvas)
        {
            Sector sector = this.getSector();

            if (null == sector)
            {
                String message = Logging.getMessage("nullValue.SectorIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            if (!sector.intersects(canvas.getSector()))
            {
                return;
            }

            java.awt.Graphics2D g2d = null;
            java.awt.Shape      prevClip = null;
            java.awt.Composite  prevComposite = null;
            java.lang.Object    prevInterpolation = null, prevAntialiasing = null;

            try
            {
                int canvasWidth  = canvas.getWidth();
                int canvasHeight = canvas.getHeight();

                // Apply the transform that correctly maps the image onto the canvas.
                java.awt.geom.AffineTransform transform = this.computeSourceToDestTransform(
                    this.getWidth(), this.getHeight(), this.getSector(), canvasWidth, canvasHeight, canvas.getSector());

                AffineTransformOp op   = new AffineTransformOp(transform, AffineTransformOp.TYPE_BILINEAR);
                Rectangle2D       rect = op.getBounds2D(this.getBufferedImage());

                int clipWidth  = (int)Math.Ceiling((rect.getMaxX() >= canvasWidth) ? canvasWidth : rect.getMaxX());
                int clipHeight = (int)Math.Ceiling((rect.getMaxY() >= canvasHeight) ? canvasHeight : rect.getMaxY());

                if (clipWidth <= 0 || clipHeight <= 0)
                {
                    return;
                }

                g2d = canvas.getGraphics();

                prevClip          = g2d.getClip();
                prevComposite     = g2d.getComposite();
                prevInterpolation = g2d.getRenderingHint(RenderingHints.KEY_INTERPOLATION);
                prevAntialiasing  = g2d.getRenderingHint(RenderingHints.KEY_ANTIALIASING);

                // Set the alpha composite for appropriate alpha blending.
                g2d.setComposite(java.awt.AlphaComposite.SrcOver);
                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
                g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

                g2d.drawImage(this.getBufferedImage(), transform, null);
            }
//        catch (java.awt.image.ImagingOpException ioe)
//        {
//            // If we catch a ImagingOpException, then the transformed image has a width or height of 0.
//            // This indicates that there is no intersection between the source image and the canvas,
//            // or the intersection is smaller than one pixel.
//        }
//        catch (java.awt.image.RasterFormatException rfe)
//        {
//            // If we catch a RasterFormatException, then the transformed image has a width or height of 0.
//            // This indicates that there is no intersection between the source image and the canvas,
//            // or the intersection is smaller than one pixel.
//        }
            catch (Throwable t)
            {
                String reason = WWUtil.extractExceptionReason(t);
                Logging.logger().log(java.util.logging.Level.SEVERE, reason, t);
            }
            finally
            {
                // Restore the previous clip, composite, and transform.
                try
                {
                    if (null != g2d)
                    {
                        if (null != prevClip)
                        {
                            g2d.setClip(prevClip);
                        }

                        if (null != prevComposite)
                        {
                            g2d.setComposite(prevComposite);
                        }

                        if (null != prevInterpolation)
                        {
                            g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, prevInterpolation);
                        }

                        if (null != prevAntialiasing)
                        {
                            g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, prevAntialiasing);
                        }
                    }
                }
                catch (Throwable t)
                {
                    Logging.logger().log(java.util.logging.Level.FINEST, WWUtil.extractExceptionReason(t), t);
                }
            }
        }
Esempio n. 26
0
 protected internal override void drawPrimaryLineAsPath(XYItemRendererState state, Graphics2D g2, XYPlot plot, XYDataset dataset, int pass, int series, int item, ValueAxis domainAxis, ValueAxis rangeAxis, Rectangle2D dataArea)
 {
   RectangleEdge domainAxisEdge = plot.getDomainAxisEdge();
   RectangleEdge rangeAxisEdge = plot.getRangeAxisEdge();
   double xvalue = dataset.getXValue(series, item);
   double yvalue = dataset.getYValue(series, item);
   double num1 = domainAxis.valueToJava2D(xvalue, dataArea, domainAxisEdge);
   double num2 = rangeAxis.valueToJava2D(yvalue, dataArea, rangeAxisEdge);
   if (!Double.isNaN(num1) && !Double.isNaN(num2))
   {
     XYSplineRenderer.ControlPoint controlPoint = new XYSplineRenderer.ControlPoint(this, plot.getOrientation() != PlotOrientation.__\u003C\u003EHORIZONTAL ? (float) num1 : (float) num2, plot.getOrientation() != PlotOrientation.__\u003C\u003EHORIZONTAL ? (float) num2 : (float) num1);
     if (!this.points.contains((object) controlPoint))
       this.points.add((object) controlPoint);
   }
   if (item != dataset.getItemCount(series) - 1)
     return;
   XYLineAndShapeRenderer.State state1 = (XYLineAndShapeRenderer.State) state;
   if (this.points.size() > 1)
   {
     XYSplineRenderer.ControlPoint controlPoint1 = (XYSplineRenderer.ControlPoint) this.points.get(0);
     ((Path2D.Float) state1.seriesPath).moveTo(controlPoint1.x, controlPoint1.y);
     if (this.points.size() == 2)
     {
       XYSplineRenderer.ControlPoint controlPoint2 = (XYSplineRenderer.ControlPoint) this.points.get(1);
       ((Path2D.Float) state1.seriesPath).lineTo(controlPoint2.x, controlPoint2.y);
     }
     else
     {
       int length = this.points.size();
       float[] numArray1 = new float[length];
       float[] numArray2 = new float[length];
       float[] numArray3 = new float[length];
       float[] numArray4 = new float[length];
       for (int index = 0; index < length; ++index)
       {
         XYSplineRenderer.ControlPoint controlPoint2 = (XYSplineRenderer.ControlPoint) this.points.get(index);
         numArray2[index] = controlPoint2.x;
         numArray1[index] = controlPoint2.y;
       }
       for (int index = 1; index <= length - 1; ++index)
         numArray4[index] = numArray2[index] - numArray2[index - 1];
       float[] numArray5 = new float[length - 1];
       float[] numArray6 = new float[length - 1];
       float[] numArray7 = new float[length - 1];
       for (int index = 1; index <= length - 2; ++index)
       {
         numArray6[index] = (numArray4[index] + numArray4[index + 1]) / 3f;
         numArray7[index] = numArray4[index + 1] / 6f;
         numArray5[index] = numArray4[index] / 6f;
         numArray3[index] = (numArray1[index + 1] - numArray1[index]) / numArray4[index + 1] - (numArray1[index] - numArray1[index - 1]) / numArray4[index];
       }
       this.solveTridiag(numArray5, numArray6, numArray7, numArray3, length - 2);
       float num3 = numArray2[0];
       float num4 = numArray1[0];
       ((Path2D.Float) state1.seriesPath).moveTo(num3, num4);
       for (int index1 = 1; index1 <= length - 1; ++index1)
       {
         for (int index2 = 1; index2 <= this.precision; ++index2)
         {
           float num5 = numArray4[index1] * (float) index2 / (float) this.precision;
           float num6 = numArray4[index1] - num5;
           float num7 = (((float) (-(double) numArray3[index1 - 1] / 6.0) * (num6 + numArray4[index1]) * num5 + numArray1[index1 - 1]) * num6 + ((float) (-(double) numArray3[index1] / 6.0) * (num5 + numArray4[index1]) * num6 + numArray1[index1]) * num5) / numArray4[index1];
           float num8 = numArray2[index1 - 1] + num5;
           ((Path2D.Float) state1.seriesPath).lineTo(num8, num7);
         }
       }
     }
     this.drawFirstPassShape(g2, pass, series, item, (Shape) state1.seriesPath);
   }
   this.points = new Vector();
 }
 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);
 }
Esempio n. 28
0
 public virtual void releaseGraphics(Graphics2D g)
 {
   ((Graphics) g).dispose();
   this.bufferStrategy.show();
 }
Esempio n. 29
0
 public override AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, PlotRenderingInfo plotState)
 {
   AxisState axisState = base.draw(g2, cursor, plotArea, dataArea, edge, plotState);
   if (this.isAdvanceLineVisible())
   {
     double num = this.valueToJava2D(this.getRange().getUpperBound(), dataArea, edge);
     Line2D.Double @double = (Line2D.Double) null;
     g2.setStroke(this.getAdvanceLineStroke());
     g2.setPaint(this.getAdvanceLinePaint());
     if (edge == RectangleEdge.__\u003C\u003ELEFT)
       @double = new Line2D.Double(cursor, num, cursor + ((RectangularShape) dataArea).getWidth(), num);
     else if (edge == RectangleEdge.__\u003C\u003ERIGHT)
       @double = new Line2D.Double(cursor - ((RectangularShape) dataArea).getWidth(), num, cursor, num);
     else if (edge == RectangleEdge.__\u003C\u003ETOP)
       @double = new Line2D.Double(num, cursor + ((RectangularShape) dataArea).getHeight(), num, cursor);
     else if (edge == RectangleEdge.__\u003C\u003EBOTTOM)
       @double = new Line2D.Double(num, cursor, num, cursor - ((RectangularShape) dataArea).getHeight());
     g2.draw((Shape) @double);
   }
   return axisState;
 }
Esempio n. 30
0
 protected internal override Size2D arrangeNN(Graphics2D g2)
 {
   Range range = new Range(0.0, 3.40282346638529E+38);
   return this.arrangeRR(g2, range, range);
 }
Esempio n. 31
0
 public override Size2D arrange(Graphics2D g2, RectangleConstraint constraint)
 {
   return new Size2D(this.calculateTotalWidth(this.getWidth()), this.calculateTotalHeight(this.getHeight()));
 }
Esempio n. 32
0
 protected internal virtual void selectVerticalAutoTickUnit(Graphics2D g2, Rectangle2D drawArea, Rectangle2D dataArea, RectangleEdge edge)
 {
   this.setTickUnit((NumberTickUnit) this.getStandardTickUnits().getCeilingTickUnit(this.getRange().getLength() * this.estimateMaximumTickLabelWidth(g2, (TickUnit) this.getTickUnit()) / ((RectangularShape) dataArea).getHeight()), false, false);
 }
Esempio n. 33
0
 protected internal override AxisState drawTickMarksAndLabels(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge)
 {
   this.internalMarkerWhenTicksOverlap = false;
   AxisState axisState = base.drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge);
   if (!this.internalMarkerWhenTicksOverlap)
     return axisState;
   double num1 = (double) this.getTickMarkOutsideLength();
   FontMetrics fontMetrics = ((Graphics) g2).getFontMetrics(this.getTickLabelFont());
   double num2 = !this.isVerticalTickLabels() ? (double) fontMetrics.getHeight() : (double) fontMetrics.getMaxAdvance();
   double num3 = 0.0;
   if (this.isTickMarksVisible())
   {
     float num4 = (float) this.valueToJava2D(this.getRange().getUpperBound(), dataArea, edge);
     Line2D.Double @double = (Line2D.Double) null;
     g2.setStroke(this.getTickMarkStroke());
     g2.setPaint(this.getTickMarkPaint());
     if (edge == RectangleEdge.__\u003C\u003ELEFT)
       @double = new Line2D.Double(cursor - num2, (double) num4, cursor + num3, (double) num4);
     else if (edge == RectangleEdge.__\u003C\u003ERIGHT)
       @double = new Line2D.Double(cursor + num2, (double) num4, cursor - num3, (double) num4);
     else if (edge == RectangleEdge.__\u003C\u003ETOP)
       @double = new Line2D.Double((double) num4, cursor - num2, (double) num4, cursor + num3);
     else if (edge == RectangleEdge.__\u003C\u003EBOTTOM)
       @double = new Line2D.Double((double) num4, cursor + num2, (double) num4, cursor - num3);
     g2.draw((Shape) @double);
   }
   return axisState;
 }
Esempio n. 34
0
 public override Size2D arrange(Graphics2D g2, RectangleConstraint constraint)
 {
   RectangleConstraint rectangleConstraint = this.toContentConstraint(constraint);
   LengthConstraintType widthConstraintType = rectangleConstraint.getWidthConstraintType();
   LengthConstraintType heightConstraintType = rectangleConstraint.getHeightConstraintType();
   Size2D size2D = (Size2D) null;
   if (widthConstraintType == LengthConstraintType.__\u003C\u003ENONE)
   {
     if (heightConstraintType == LengthConstraintType.__\u003C\u003ENONE)
       size2D = this.arrangeNN(g2);
     else if (heightConstraintType == LengthConstraintType.__\u003C\u003ERANGE)
     {
       string str = "Not yet implemented.";
       Throwable.__\u003CsuppressFillInStackTrace\u003E();
       throw new RuntimeException(str);
     }
     else if (heightConstraintType == LengthConstraintType.__\u003C\u003EFIXED)
     {
       string str = "Not yet implemented.";
       Throwable.__\u003CsuppressFillInStackTrace\u003E();
       throw new RuntimeException(str);
     }
   }
   else if (widthConstraintType == LengthConstraintType.__\u003C\u003ERANGE)
   {
     if (heightConstraintType == LengthConstraintType.__\u003C\u003ENONE)
       size2D = this.arrangeRN(g2, rectangleConstraint.getWidthRange());
     else if (heightConstraintType == LengthConstraintType.__\u003C\u003ERANGE)
       size2D = this.arrangeRR(g2, rectangleConstraint.getWidthRange(), rectangleConstraint.getHeightRange());
     else if (heightConstraintType == LengthConstraintType.__\u003C\u003EFIXED)
     {
       string str = "Not yet implemented.";
       Throwable.__\u003CsuppressFillInStackTrace\u003E();
       throw new RuntimeException(str);
     }
   }
   else if (widthConstraintType == LengthConstraintType.__\u003C\u003EFIXED)
   {
     if (heightConstraintType == LengthConstraintType.__\u003C\u003ENONE)
       size2D = this.arrangeFN(g2, rectangleConstraint.getWidth());
     else if (heightConstraintType == LengthConstraintType.__\u003C\u003ERANGE)
     {
       string str = "Not yet implemented.";
       Throwable.__\u003CsuppressFillInStackTrace\u003E();
       throw new RuntimeException(str);
     }
     else if (heightConstraintType == LengthConstraintType.__\u003C\u003EFIXED)
     {
       string str = "Not yet implemented.";
       Throwable.__\u003CsuppressFillInStackTrace\u003E();
       throw new RuntimeException(str);
     }
   }
   if (size2D.width <= 0.0 || size2D.height <= 0.0)
     return new Size2D(0.0, 0.0);
   else
     return new Size2D(this.calculateTotalWidth(size2D.getWidth()), this.calculateTotalHeight(size2D.getHeight()));
 }
Esempio n. 35
0
 protected internal virtual List refreshVerticalTicks(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
 {
   ArrayList arrayList = new ArrayList();
   ((List) arrayList).clear();
   Font tickLabelFont = this.getTickLabelFont();
   ((Graphics) g2).setFont(tickLabelFont);
   if (this.isAutoTickUnitSelection())
     this.selectAutoTickUnit(g2, dataArea, edge);
   double size = this.getTickUnit().getSize();
   double cycleBound = this.getCycleBound();
   double num1 = Math.ceil(cycleBound / size) * size;
   double num2 = this.getRange().getUpperBound();
   int num3 = 0;
   int num4 = this.boundMappedToLastCycle ? 1 : 0;
   this.boundMappedToLastCycle = true;
   CyclicNumberAxis.CycleBoundTick cycleBoundTick1 = (CyclicNumberAxis.CycleBoundTick) null;
   float num5 = 0.0f;
   if (num2 == cycleBound)
   {
     num1 = this.calculateLowestVisibleTickValue();
     num3 = 1;
     this.boundMappedToLastCycle = true;
   }
   while (num1 <= num2)
   {
     int num6 = 0;
     if (num1 + size > num2 && num3 == 0)
       num6 = 1;
     double num7 = this.valueToJava2D(num1, dataArea, edge);
     NumberFormat numberFormatOverride = this.getNumberFormatOverride();
     string label = numberFormatOverride == null ? this.getTickUnit().valueToString(num1) : numberFormatOverride.format(num1);
     float num8 = (float) num7;
     double angle = 0.0;
     TextAnchor textAnchor1;
     TextAnchor rotationAnchor;
     if (this.isVerticalTickLabels())
     {
       if (edge == RectangleEdge.__\u003C\u003ELEFT)
       {
         textAnchor1 = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
         if (cycleBoundTick1 != null && (double) num5 == (double) num8 && num1 != cycleBound)
         {
           TextAnchor textAnchor2 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_RIGHT : TextAnchor.__\u003C\u003EBOTTOM_LEFT;
           ((List) arrayList).remove(((List) arrayList).size() - 1);
           ((List) arrayList).add((object) new CyclicNumberAxis.CycleBoundTick(this.boundMappedToLastCycle, cycleBoundTick1.getNumber(), cycleBoundTick1.getText(), textAnchor2, textAnchor2, cycleBoundTick1.getAngle()));
           this.internalMarkerWhenTicksOverlap = true;
           textAnchor1 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_LEFT : TextAnchor.__\u003C\u003EBOTTOM_RIGHT;
         }
         rotationAnchor = textAnchor1;
         angle = -1.0 * Math.PI / 2.0;
       }
       else
       {
         textAnchor1 = TextAnchor.__\u003C\u003EBOTTOM_CENTER;
         if (cycleBoundTick1 != null && (double) num5 == (double) num8 && num1 != cycleBound)
         {
           TextAnchor textAnchor2 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_LEFT : TextAnchor.__\u003C\u003EBOTTOM_RIGHT;
           ((List) arrayList).remove(((List) arrayList).size() - 1);
           ((List) arrayList).add((object) new CyclicNumberAxis.CycleBoundTick(this.boundMappedToLastCycle, cycleBoundTick1.getNumber(), cycleBoundTick1.getText(), textAnchor2, textAnchor2, cycleBoundTick1.getAngle()));
           this.internalMarkerWhenTicksOverlap = true;
           textAnchor1 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_RIGHT : TextAnchor.__\u003C\u003EBOTTOM_LEFT;
         }
         rotationAnchor = textAnchor1;
         angle = Math.PI / 2.0;
       }
     }
     else if (edge == RectangleEdge.__\u003C\u003ELEFT)
     {
       textAnchor1 = TextAnchor.__\u003C\u003ECENTER_RIGHT;
       if (cycleBoundTick1 != null && (double) num5 == (double) num8 && num1 != cycleBound)
       {
         TextAnchor textAnchor2 = !this.isInverted() ? TextAnchor.__\u003C\u003ETOP_RIGHT : TextAnchor.__\u003C\u003EBOTTOM_RIGHT;
         ((List) arrayList).remove(((List) arrayList).size() - 1);
         ((List) arrayList).add((object) new CyclicNumberAxis.CycleBoundTick(this.boundMappedToLastCycle, cycleBoundTick1.getNumber(), cycleBoundTick1.getText(), textAnchor2, textAnchor2, cycleBoundTick1.getAngle()));
         this.internalMarkerWhenTicksOverlap = true;
         textAnchor1 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_RIGHT : TextAnchor.__\u003C\u003ETOP_RIGHT;
       }
       rotationAnchor = textAnchor1;
     }
     else
     {
       textAnchor1 = TextAnchor.__\u003C\u003ECENTER_LEFT;
       if (cycleBoundTick1 != null && (double) num5 == (double) num8 && num1 != cycleBound)
       {
         TextAnchor textAnchor2 = !this.isInverted() ? TextAnchor.__\u003C\u003ETOP_LEFT : TextAnchor.__\u003C\u003EBOTTOM_LEFT;
         ((List) arrayList).remove(((List) arrayList).size() - 1);
         ((List) arrayList).add((object) new CyclicNumberAxis.CycleBoundTick(this.boundMappedToLastCycle, cycleBoundTick1.getNumber(), cycleBoundTick1.getText(), textAnchor2, textAnchor2, cycleBoundTick1.getAngle()));
         this.internalMarkerWhenTicksOverlap = true;
         textAnchor1 = !this.isInverted() ? TextAnchor.__\u003C\u003EBOTTOM_LEFT : TextAnchor.__\u003C\u003ETOP_LEFT;
       }
       rotationAnchor = textAnchor1;
     }
     CyclicNumberAxis.CycleBoundTick cycleBoundTick2 = new CyclicNumberAxis.CycleBoundTick(this.boundMappedToLastCycle, (Number) new Double(num1), label, textAnchor1, rotationAnchor, angle);
     if (num1 == cycleBound)
       this.internalMarkerCycleBoundTick = (Tick) cycleBoundTick2;
     ((List) arrayList).add((object) cycleBoundTick2);
     cycleBoundTick1 = cycleBoundTick2;
     num5 = num8;
     if (num1 == cycleBound)
       this.internalMarkerCycleBoundTick = (Tick) cycleBoundTick2;
     num1 += size;
     if (num6 != 0)
     {
       num1 = this.calculateLowestVisibleTickValue();
       num2 = cycleBound;
       num3 = 1;
       this.boundMappedToLastCycle = false;
     }
   }
   this.boundMappedToLastCycle = num4 != 0;
   return (List) arrayList;
 }