Class PageShape.CupShape

  • Enclosing class:
    PageShape

    public static class PageShape.CupShape
    extends PageShape
    A PageShape that is optimized for the most common case: a rectangle that becomes wider or narrower after a certain y-point is reached, e.g.:
     x1        x2
      +--------+
      |        |
      |        |
      +--+  +--+  y
         |  |
         +--+
       xp1  xp2
     
    • Constructor Detail

      • CupShape

        public CupShape​(double leftInset1,
                        double rightInset1,
                        double y,
                        double leftInset2,
                        double rightInset2)
    • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object