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
shortand therefore is limited between-32768and32767.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOutline(int left, int top, int right, int bottom)Adds the given outline.intgetHeight()Gets the height.intgetWidth()Gets the width.voidremoveOutline(int left, int top, int right, int bottom)Removes the given outline.voidsetHeight(int height)Sets the height.voidsetSize(int width, int height)Sets the size.voidsetWidth(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:OutlineableAdds the given outline.- Specified by:
addOutlinein 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:OutlineableRemoves the given outline.- Specified by:
removeOutlinein 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.
-
-