Implement a convenience method for Rectangle.setWidth and .setHeight

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: javafx

      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);

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

              Created:
              Updated:
              Imported: