    All Packages    This Package    Previous    Next

# Class awt.Dimension

    java.lang.Object
       |
       +----awt.Dimension

public class Dimension
extends Object

A class to encapsulate objects that have a width and a height.

Version:
  1.6 31 Jan 1995
Author:
  Arthur van Hoff, Sami Shaio

##

height
width

##

Dimension()
  Constructors
Dimension(Dimension)
Dimension(int, int)

##

add(Dimension)
  Add the width and height of "other" to this dimension.
addDim(boolean, int)
  If h is true then add value to the height otherwise add it to the width
addDim(boolean, Dimension)
  The same as addDim with an integer value but takes a Dimension.
clone()
  Clone this dimension.
max(Dimension)
  Set "other" to be the max of this dimension with itself.
set(int, int)
  Change it
toString()

##

width

      public int width

height

      public int height

##

Dimension

      public Dimension()

  Constructors

Dimension

      public Dimension(Dimension d)

Dimension

      public Dimension(int w,
                       int h)

##

set

      public void set(int w,
                      int h)

  Change it

max

      public Dimension max(Dimension other)

  Set "other" to be the max of this dimension with itself.

add

      public void add(Dimension other)

  Add the width and height of "other" to this dimension.

toString

      public String toString()

addDim

      public void addDim(boolean h,
                         int value)

  If h is true then add value to the height otherwise add it to the width

addDim

      public void addDim(boolean h,
                         Dimension s)

  The same as addDim with an integer value but takes a Dimension.

clone

      public Object clone()

  Clone this dimension.
  Overrides:
    clone in class Object

    All Packages    This Package    Previous    Next