public override void setFixedRangeAxisSpace(AxisSpace space)
 {
   base.setFixedRangeAxisSpace(space);
   this.setFixedRangeAxisSpaceForSubplots(space);
   this.fireChangeEvent();
 }
 protected internal virtual void setFixedRangeAxisSpaceForSubplots(AxisSpace space)
 {
   Iterator iterator = this.subplots.iterator();
   while (iterator.hasNext())
     ((XYPlot) iterator.next()).setFixedRangeAxisSpace(space, false);
 }
 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;
 }
예제 #4
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;
 }