Class RequestDimension

java.lang.Object
bibliothek.gui.dock.common.layout.RequestDimension
All Implemented Interfaces:
Cloneable

@ClientOnly public class RequestDimension extends Object implements Cloneable
Represents the dimensions a CDockable would like to have.
Author:
Benjamin Sigg
  • Constructor Details

    • RequestDimension

      public RequestDimension()
      Creates a new request dimension where width and height are not set.
    • RequestDimension

      public RequestDimension(RequestDimension original)
      Creates a new request dimension copying all fields from original.
      Parameters:
      original - the original from which to copy all settings
    • RequestDimension

      public RequestDimension(Dimension size)
      Creates a new request taking with and height from source.
      Parameters:
      size - the size of this dimension
      See Also:
    • RequestDimension

      public RequestDimension(int width, int height)
      Creates a new request dimension where width and height are set.
      Parameters:
      width - the initial value of width
      height - the initial value of height
      See Also:
    • RequestDimension

      public RequestDimension(int value, boolean valueIsWidth)
      Creates a new request dimension where either width or height is set.
      Parameters:
      value - the value for the width or the height
      valueIsWidth - if true then value is considered to be the width, else value is considered to be the height
  • Method Details

    • requestWidth

      public static RequestDimension requestWidth(int width)
      Creates a RequestDimension only affecting the width of a Dockable. This method is equivalent of calling new RequestDimension( width, true ).
      Parameters:
      width - the requested width
      Returns:
      the new request
    • requestHeight

      public static RequestDimension requestHeight(int height)
      Creates a RequestDimension only affecting the height of a Dockable. This method is equivalent of calling new RequestDimension( height, false ).
      Parameters:
      height - the requested height
      Returns:
      the new request
    • request

      public static RequestDimension request(int width, int height)
      Creates a RequestDimension affecting the width and height of a Dockable. This method is equivalent of calling new RequestDimension( width, height ).
      Parameters:
      width - the requested width
      height - the requested height
      Returns:
      the new request
    • setWidth

      public void setWidth(int width)
      Sets the width of this dimension. This also changes the result of isWidthSet() to true.
      Parameters:
      width - the new width
    • getWidth

      public int getWidth()
      Gets the width of this dimension, clients should first check isWidthSet().
      Returns:
      the width of this dimension
    • isWidthSet

      public boolean isWidthSet()
      Tells whether the width was set or is invalid.
      Returns:
      true if the width is valid
    • deleteWidth

      public void deleteWidth()
      Deletes the width of this dimension. The result of isWidthSet() will be false.
    • setHeight

      public void setHeight(int height)
      Sets the height of this dimension. This also changes the result of isHeightSet() to true.
      Parameters:
      height - the new height
    • getHeight

      public int getHeight()
      Gets the height of this dimension, clients should first check isHeightSet().
      Returns:
      the height of this dimension
    • isHeightSet

      public boolean isHeightSet()
      Tells whether the height of this dimension was or is invalid.
      Returns:
      true if the height is valid
    • deleteHeight

      public void deleteHeight()
      Deletes the height of this dimension. The result of isHeightSet() will change to false.
    • clone

      public RequestDimension clone()
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object