Class PageShape.InsetShape

  • Enclosing class:
    PageShape

    public static class PageShape.InsetShape
    extends PageShape
    A PageShape that returns constant inset values regardless of the Y-position. This is sometimes useful when creating a CompoundShape.
    • Constructor Detail

      • InsetShape

        public InsetShape​(double leftInset,
                          double rightInset)
    • Method Detail

      • getLeftInset

        public double getLeftInset​(double y1,
                                   double y2)
        Description copied from class: PageShape
        Return the narrowest (maximum) left edge inset between y1 and y2. y1 must be <= y2.
        Overrides:
        getLeftInset in class PageShape
      • getRightInset

        public double getRightInset​(double y1,
                                    double y2)
        Description copied from class: PageShape
        Return the narrowest (maximum) right edge inset between y1 and y2. y1 must be <= y2.
        Overrides:
        getRightInset in class PageShape
      • debugDraw

        public void debugDraw​(java.awt.Graphics2D g,
                              java.awt.geom.Rectangle2D rect)
        Description copied from class: PageShape
        This function is called when the markup renderer is painting its text box for debugging purposes. It should draw lines or a shape to indicate how the margins are modified by this shape. The default implementation samples the left and right insets at regular intervals to construct an approximate shape. Subclasses are encouraged to override this to provide more efficient and/or more accurate implementations.
        Overrides:
        debugDraw in class PageShape
        Parameters:
        g - the graphics context to draw into
        rect - the rectangle within which text is being laid out