JDK-4314043 : Need a way to quickly determine if a Font object has a transform
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.2.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2000-02-18
  • Updated: 2000-03-21
  • Resolved: 2000-03-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 betaFixed
Description
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.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta FIXED IN: merlin-beta INTEGRATED IN: merlin-beta
14-06-2004

SUGGESTED FIX Add the following methods to the indicated classes: // true iff Font.getTransform().isIdentity() == false // Note: the return value is unaffected by the Size attribute java.awt.Font.isTransformed() // true iff TransformAttribute.getTransform().isIdentity() == true java.awt.font.TransformAttribute.isIdentity()
11-06-2004

EVALUATION Implement new methods as indicated in Suggested Fix for Merlin. jim.graham@Eng 2000-02-18
18-02-2000