bibliothek.gui.dock.common.layout
Class RequestDimension

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

@ClientOnly
public class RequestDimension
extends java.lang.Object
implements java.lang.Cloneable

Represents the dimensions a CDockable would like to have.

Author:
Benjamin Sigg

Constructor Summary
RequestDimension()
          Creates a new request dimension where width and height are not set.
RequestDimension(java.awt.Dimension size)
          Creates a new request taking with and height from source.
RequestDimension(int value, boolean valueIsWidth)
          Creates a new request dimension where either width or height is set.
RequestDimension(int width, int height)
          Creates a new request dimension where width and height are set.
RequestDimension(RequestDimension original)
          Creates a new request dimension copying all fields from original.
 
Method Summary
 RequestDimension clone()
           
 void deleteHeight()
          Deletes the height of this dimension.
 void deleteWidth()
          Deletes the width of this dimension.
 boolean equals(java.lang.Object obj)
           
 int getHeight()
          Gets the height of this dimension, clients should first check isHeightSet().
 int getWidth()
          Gets the width of this dimension, clients should first check isWidthSet().
 int hashCode()
           
 boolean isHeightSet()
          Tells whether the height of this dimension was or is invalid.
 boolean isWidthSet()
          Tells whether the width was set or is invalid.
static RequestDimension request(int width, int height)
          Creates a RequestDimension affecting the width and height of a Dockable.
static RequestDimension requestHeight(int height)
          Creates a RequestDimension only affecting the height of a Dockable.
static RequestDimension requestWidth(int width)
          Creates a RequestDimension only affecting the width of a Dockable.
 void setHeight(int height)
          Sets the height of this dimension.
 void setWidth(int width)
          Sets the width of this dimension.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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(java.awt.Dimension size)
Creates a new request taking with and height from source.

Parameters:
size - the size of this dimension
See Also:
RequestDimension(int, int)

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:
setWidth(int), setHeight(int)

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 Detail

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 java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object