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

javax.swing.text.Utilities methods could be more correct and efficient

XMLWordPrintable

    • b28
    • x86
    • linux, windows_nt



      Name: anR10225 Date: 07/11/2003


          The following three methods of javax.swing.text.Utilities class
      which are intensively used during text components layout and
      painting could be optimized and made more correct :
          . getTabbedTextWidth
          . drawTabbedText
          . getTabbedTextOffset
      Their current implementations calculate the width of a substring
      by summing length of its composing characters. This is
          . inefficient: calculating the width by a single invocation of
            FontMetrics.getCharsWidth(char[], int, int) is 20% - 50%
            faster than invocation of FontMetrics.getCharWidth(char)
            'length' times.
          . incorrect: theoretically a metrics may exist (see bug #4841188)
            in which width(char1) + width(char2) != width("" + char1 + char2)

      ======================================================================

            naasunw Naa Naa (Inactive)
            naasunw Naa Naa (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: