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

Need a way to quickly determine if a Font object has a transform

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.2.0
    • client-libs
    • None
    • 2d
    • beta
    • generic
    • generic

      The Font object has a transform attribute that can be accessed via
      Font.getTransform(). Most of the time, this attribute will be a
      simple identity transform. The only way to figure out if the
      transform is an identity transform is to call getTransform and then
      inspect the returned AffineTransform object. Unfortunately, calling
      getTransform() requires the Font object to clone the AffineTransform
      since the transform is mutable.

      Alternatively, Font could have a method that would return a boolean
      indicating whether the transform attribute was an identity transform.
      In that case, the caller could simplify their processing of the Font
      and avoid having to clone a transform by avoiding a call to getTransform().

      Similarly, the TransformAttribute object that is used to hold the
      transform attribute for a Font object has no easy way to determine if
      it is holding an identity transform. An isIdentity() method on that
      class would enable the same optimizations when dealing with a
      TransformAttribute object.

            flar Jim Graham
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: