Package ej.mwt.util
Class Size
- java.lang.Object
-
- ej.mwt.util.Size
-
- All Implemented Interfaces:
Outlineable
public class Size extends java.lang.Object implements Outlineable
Represents a size (width and height).For heap optimization the size is stored as a
short
and therefore is limited between-32768
and32767
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOutline(int left, int top, int right, int bottom)
Adds the given outline.int
getHeight()
Gets the height.int
getWidth()
Gets the width.void
removeOutline(int left, int top, int right, int bottom)
Removes the given outline.void
setHeight(int height)
Sets the height.void
setSize(int width, int height)
Sets the size.void
setWidth(int width)
Sets the width.
-
-
-
Constructor Detail
-
Size
public Size(int width, int height)
Creates a size specifying its values.- Parameters:
width
- the width.height
- the height.
-
Size
public Size(Size size)
Creates a size from another size.- Parameters:
size
- the other size.
-
-
Method Detail
-
getWidth
public int getWidth()
Gets the width.- Returns:
- the width.
-
setWidth
public void setWidth(int width)
Sets the width.- Parameters:
width
- the width.
-
getHeight
public int getHeight()
Gets the height.- Returns:
- the height.
-
setHeight
public void setHeight(int height)
Sets the height.- Parameters:
height
- the height.
-
setSize
public void setSize(int width, int height)
Sets the size.- Parameters:
width
- the width.height
- the height.
-
addOutline
public void addOutline(int left, int top, int right, int bottom)
Description copied from interface:Outlineable
Adds the given outline.- Specified by:
addOutline
in interfaceOutlineable
- Parameters:
left
- the left side thickness of the outline.top
- the top side thickness of the outline.right
- the right side thickness of the outline.bottom
- the bottom side thickness of the outline.
-
removeOutline
public void removeOutline(int left, int top, int right, int bottom)
Description copied from interface:Outlineable
Removes the given outline.- Specified by:
removeOutline
in interfaceOutlineable
- Parameters:
left
- the left side thickness of the outline.top
- the top side thickness of the outline.right
- the right side thickness of the outline.bottom
- the bottom side thickness of the outline.
-
-