Class RequestDimension
java.lang.Object
bibliothek.gui.dock.common.layout.RequestDimension
- All Implemented Interfaces:
Cloneable
Represents the dimensions a
CDockable would like to have.- Author:
- Benjamin Sigg
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new request dimension where width and height are not set.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 fromoriginal.RequestDimension(Dimension size) Creates a new request taking with and height fromsource. -
Method Summary
Modifier and TypeMethodDescriptionclone()voidDeletes the height of this dimension.voidDeletes the width of this dimension.booleanintGets the height of this dimension, clients should first checkisHeightSet().intgetWidth()Gets the width of this dimension, clients should first checkisWidthSet().inthashCode()booleanTells whether theheightof this dimension was or is invalid.booleanTells whether thewidthwas set or is invalid.static RequestDimensionrequest(int width, int height) Creates aRequestDimensionaffecting the width and height of aDockable.static RequestDimensionrequestHeight(int height) Creates aRequestDimensiononly affecting the height of aDockable.static RequestDimensionrequestWidth(int width) Creates aRequestDimensiononly affecting the width of aDockable.voidsetHeight(int height) Sets the height of this dimension.voidsetWidth(int width) Sets the width of this dimension.toString()
-
Constructor Details
-
RequestDimension
public RequestDimension()Creates a new request dimension where width and height are not set. -
RequestDimension
Creates a new request dimension copying all fields fromoriginal.- Parameters:
original- the original from which to copy all settings
-
RequestDimension
Creates a new request taking with and height fromsource.- 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 widthheight- 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 heightvalueIsWidth- iftruethenvalueis considered to be the width, elsevalueis considered to be the height
-
-
Method Details
-
requestWidth
Creates aRequestDimensiononly affecting the width of aDockable. This method is equivalent of callingnew RequestDimension( width, true ).- Parameters:
width- the requested width- Returns:
- the new request
-
requestHeight
Creates aRequestDimensiononly affecting the height of aDockable. This method is equivalent of callingnew RequestDimension( height, false ).- Parameters:
height- the requested height- Returns:
- the new request
-
request
Creates aRequestDimensionaffecting the width and height of aDockable. This method is equivalent of callingnew RequestDimension( width, height ).- Parameters:
width- the requested widthheight- the requested height- Returns:
- the new request
-
setWidth
public void setWidth(int width) Sets the width of this dimension. This also changes the result ofisWidthSet()totrue.- Parameters:
width- the new width
-
getWidth
public int getWidth()Gets the width of this dimension, clients should first checkisWidthSet().- Returns:
- the width of this dimension
-
isWidthSet
public boolean isWidthSet()Tells whether thewidthwas set or is invalid.- Returns:
trueif the width is valid
-
deleteWidth
public void deleteWidth()Deletes the width of this dimension. The result ofisWidthSet()will befalse. -
setHeight
public void setHeight(int height) Sets the height of this dimension. This also changes the result ofisHeightSet()totrue.- Parameters:
height- the new height
-
getHeight
public int getHeight()Gets the height of this dimension, clients should first checkisHeightSet().- Returns:
- the height of this dimension
-
isHeightSet
public boolean isHeightSet()Tells whether theheightof this dimension was or is invalid.- Returns:
trueif the height is valid
-
deleteHeight
public void deleteHeight()Deletes the height of this dimension. The result ofisHeightSet()will change tofalse. -
clone
-
toString
-
hashCode
public int hashCode() -
equals
-