yu.ac.bg.etf.javaqx.qswing.graphics
Class Dimension

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.qswing.graphics.Dimension

public class Dimension
extends java.lang.Object

Dimension Class.

NOTE: This class is immutable.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Field Summary
static Dimension INFINITE_DIMESNION
          Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE) object.
static Dimension ZERO_DIMESNION
          Dimension(0, 0) object.
 
Constructor Summary
Dimension()
          Constructs new Dimension object.
Dimension(int width, int height)
          Constructs new Dimension object.
 
Method Summary
 Dimension enlarge(int dw, int dh)
          Returns enlarged dimension.
 boolean equals(java.lang.Object obj)
          
 int getHeight()
          Returns the height of this dimension.
 int getWidth()
          Returns the width of this dimension.
 int hashCode()
          
 boolean isNull()
          Returns true if both the width and height is 0.
 boolean isValid()
          Returns true if both the width and height is equal to or greater than 0.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO_DIMESNION

public static final Dimension ZERO_DIMESNION
Dimension(0, 0) object.


INFINITE_DIMESNION

public static final Dimension INFINITE_DIMESNION
Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE) object.

Constructor Detail

Dimension

public Dimension()
Constructs new Dimension object.


Dimension

public Dimension(int width,
                 int height)
Constructs new Dimension object.

Parameters:
width - the width
height - the height
Method Detail

getWidth

public int getWidth()
Returns the width of this dimension.

Returns:
the width of this dimension

getHeight

public int getHeight()
Returns the height of this dimension.

Returns:
the height of this dimension

isNull

public boolean isNull()
Returns true if both the width and height is 0.

Returns:
true if both the width and height is 0

isValid

public boolean isValid()
Returns true if both the width and height is equal to or greater than 0.

Returns:
true if both the width and height is equal to or greater than 0

enlarge

public Dimension enlarge(int dw,
                         int dh)
Returns enlarged dimension.

Parameters:
dw - the width enlargement
dh - the height enlargement
Returns:
enlarged dimension

equals

public boolean equals(java.lang.Object obj)


hashCode

public int hashCode()


toString

public java.lang.String toString()



Copyright © 2007 ETF and contributors. All Rights Reserved.