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

TransformableShape interface to allow Shapes to return typed transformations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 1.2.1, 1.3.1
    • client-libs
    • None
    • 2d
    • Fix Understood
    • generic
    • generic

      It would be nice if there was a mechanism to transform one Shape and
      return another Shape of the same or a related class so that the
      transformed Shape could maintain certain type-specific capabilities.

      The Shape interface currently provides no such method and should not
      be extended at this time to include one for two reasons. First, it
      would break backwards compatibility with any objects that implement
      the current version of the Shape interface. Second, it would be too
      restrictive to expect all implementers of Shape objects to be able to
      perform this operation. The built-in Ellipse2D is an example of an
      object that cannot return a useful value from such a method because
      it cannot represent a rotated version of itself.

      The AffineTransform object can only return a generic Shape object if it
      transforms a Shape since it cannot know the implementation details of
      all possible objects that implement the Shape interface.

      The easiest way to add this capability would be to create a new interface
      that extends the current Shape interface and provides this capability as
      an option for Shape objects which can easily perform this operation.

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

              Created:
              Updated:
              Imported:
              Indexed: