public static void align(Rectangle2D rect, Rectangle2D frame, int align) { double num1 = ((RectangularShape) frame).getCenterX() - ((RectangularShape) rect).getWidth() / 2.0; double num2 = ((RectangularShape) frame).getCenterY() - ((RectangularShape) rect).getHeight() / 2.0; double width = ((RectangularShape) rect).getWidth(); double height = ((RectangularShape) rect).getHeight(); if ((align & 3) == 3) height = ((RectangularShape) frame).getHeight(); if ((align & 12) == 12) width = ((RectangularShape) frame).getWidth(); if ((align & 1) == 1) num2 = ((RectangularShape) frame).getMinY(); if ((align & 2) == 2) num2 = ((RectangularShape) frame).getMaxY() - height; if ((align & 4) == 4) num1 = ((RectangularShape) frame).getX(); if ((align & 8) == 8) num1 = ((RectangularShape) frame).getMaxX() - width; rect.setRect(num1, num2, width, height); }
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); }