コード例 #1
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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: DialPlot.cs プロジェクト: NALSS/SmartDashboard.NET
 public override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)
 {
   Shape clip1 = ((Graphics) g2).getClip();
   ((Graphics) g2).setClip((Shape) area);
   Rectangle2D rectangle2D = this.viewToFrame(area);
   if (this.background != null && this.background.isVisible())
   {
     if (this.background.isClippedToWindow())
     {
       Shape clip2 = ((Graphics) g2).getClip();
       g2.clip(this.dialFrame.getWindow(rectangle2D));
       this.background.draw(g2, this, rectangle2D, area);
       ((Graphics) g2).setClip(clip2);
     }
     else
       this.background.draw(g2, this, rectangle2D, area);
   }
   Iterator iterator1 = this.layers.iterator();
   while (iterator1.hasNext())
   {
     DialLayer dialLayer = (DialLayer) iterator1.next();
     if (dialLayer.isVisible())
     {
       if (dialLayer.isClippedToWindow())
       {
         Shape clip2 = ((Graphics) g2).getClip();
         g2.clip(this.dialFrame.getWindow(rectangle2D));
         dialLayer.draw(g2, this, rectangle2D, area);
         ((Graphics) g2).setClip(clip2);
       }
       else
         dialLayer.draw(g2, this, rectangle2D, area);
     }
   }
   Iterator iterator2 = this.pointers.iterator();
   while (iterator2.hasNext())
   {
     DialPointer dialPointer = (DialPointer) iterator2.next();
     if (dialPointer.isVisible())
     {
       if (dialPointer.isClippedToWindow())
       {
         Shape clip2 = ((Graphics) g2).getClip();
         g2.clip(this.dialFrame.getWindow(rectangle2D));
         dialPointer.draw(g2, this, rectangle2D, area);
         ((Graphics) g2).setClip(clip2);
       }
       else
         dialPointer.draw(g2, this, rectangle2D, area);
     }
   }
   if (this.cap != null && this.cap.isVisible())
   {
     if (this.cap.isClippedToWindow())
     {
       Shape clip2 = ((Graphics) g2).getClip();
       g2.clip(this.dialFrame.getWindow(rectangle2D));
       this.cap.draw(g2, this, rectangle2D, area);
       ((Graphics) g2).setClip(clip2);
     }
     else
       this.cap.draw(g2, this, rectangle2D, area);
   }
   if (this.dialFrame.isVisible())
     this.dialFrame.draw(g2, this, rectangle2D, area);
   ((Graphics) g2).setClip(clip1);
 }