Class UIUtils

java.lang.Object
org.troy.capstone.utils.UIUtils

public class UIUtils extends Object
Utility class for UI-related functions.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Only exists to prevent Jacoco from complaining about the default constructor not being tested.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    setLineBorder(Region region, int cornerRadii, int borderWidth)
    Sets a solid black line border on a Region object with a specified corner radius and border width.
    static void
    setSize(Region region, Integer width, Integer height)
    Sets the size of a JavaFX Region (such as a Pane, Button, etc.) to the specified width and height.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UIUtils

      @Generated private UIUtils()
      Only exists to prevent Jacoco from complaining about the default constructor not being tested. As the only function of this class is to provide static methods, there is no reason for it to be instantiated, so the constructor is private.
  • Method Details

    • setSize

      public static void setSize(Region region, Integer width, Integer height)
      Sets the size of a JavaFX Region (such as a Pane, Button, etc.) to the specified width and height. If either width or height is null, that dimension will not be modified.
      Parameters:
      region - The JavaFX Region to set the size of.
      width - The desired width to set for the region, or null to leave the width unchanged.
      height - The desired height to set for the region, or null to leave the height unchanged.
      Preconditions:
      The region parameter should be a valid JavaFX Region object.
    • setLineBorder

      public static void setLineBorder(Region region, int cornerRadii, int borderWidth)
      Sets a solid black line border on a Region object with a specified corner radius and border width.
      Parameters:
      region - The JavaFX Region to set the border on.
      cornerRadii - The radius of the corners of the border, in pixels.
      borderWidth - The width of the border, in pixels.
      Preconditions:
      The region parameter should be a valid JavaFX Region object, and cornerRadii and borderWidth should be non-negative integers.
      Postconditions:
      The specified Region will have a solid black line border applied to it with the given corner radius and border width.