Package ej.mwt.util

Class Size

  • All Implemented Interfaces:
    Outlineable

    public class Size
    extends 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 and 32767.

    • 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 interface Outlineable
        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 interface Outlineable
        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.