Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4238731

View.modelToView #2 method description unclear about parameters and function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.1
    • docs
    • beta
    • generic
    • generic



      Name: vi73552 Date: 05/17/99


      In the JavaDoc web page for method
      javax.swing.text.View.modelToView(int, Position.Bias, int,
      Position.Bias, Shape), the method description is not clear.

      Before the Parameters, Returns, etc., sections, it says only:
         Provides a mapping from the document model coordinate space to
         the coordinate space of the view mapped to it.

      Although that statement is true, it:
      - says nothing to differentiate the second modelToView method
        from the first, and
      - doesn't mention the main thing: that this second modelToView
        method maps a _range_ of character positions (specified by the
        endpoint offsets) to...well...I don't know for sure, because
        that's unclear too.
       
        The return description says "the bounding box of the position,"
        but that reference to "the position" doesn't make sense--there
        are two positions passed as parameters.

      Note also that the parameter descriptions are useless for
      understanding exactly what the two positions are for:
         p0 - the position to convert >= 0
         p1 - the position to convert >= 0

      Finally, I wonder if the return value description _might_ be
      overspecified:
         the bounding box of the given position is returned

      (If the Shape returned is really always something (e.g., Rectangle?)
      that represents the bounding box, that's fine. I just wonder
      if it might return a more-complicated region. (I don't know
      if this is used to highlight non-rectangular regions or if this
      is just for damaging and repaining screen regions.))
      (Review ID: 63220)
      ======================================================================

            sharonz Sharon Zakhour (Inactive)
            vasya Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: