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

Implement a convenience method for Rectangle.setWidth and .setHeight

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • tbd
    • None
    • javafx

    Description

      I use a lot of Rectangles in my custom components, and often I have to set their width and height as the component is being laid out. This means I get a lot of code like this

      clip.setWidth(width);
      clip.setHeight(height);
      aRectangle.setWidth(width);
      aRectangle.setHeight(height);
      anotherRectangle.setWidth(width - 2);
      anotherRectangle.setHeight(height - 2);

      I suggest adding a convenience method which would allow me to set both the width and the height of rectangles using a single method call. I suggest reusing the method resize() for this purpose, allowing me to substitue the code above with

      clip.resize(width, height);
      aRectangle.resize(width, height);
      anotherRectangle.resize(width - 2, height - 2);

      Attachments

        Activity

          People

            Unassigned Unassigned
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Imported: