de.lessvoid.nifty.layout
Class Box

java.lang.Object
  extended by de.lessvoid.nifty.layout.Box

public class Box
extends Object

The Box class represent a rectangular area on the screen. It has a position (x,y) as well as height and weight attributes. The Box represent and already resolved position in pixel.

Author:
void

Constructor Summary
Box()
          Create a new Box with some default coordinates (x,y) set to (0,0) and with width and height set to 0.
Box(Box src)
          copy constructor.
Box(int newX, int newY, int newWidth, int newHeight)
          Create a new Box with the given coordinates.
 
Method Summary
 boolean equals(Object obj)
           
 int getHeight()
          Get the current height for the box.
 int getWidth()
          Get the current width of the box.
 int getX()
          Get the horizontal position of the box.
 int getY()
          Get the vertical position of the box.
 int hashCode()
           
 void setHeight(int newHeight)
          Set a new height for the box.
 void setWidth(int newWidth)
          Set a new width for the box.
 void setX(int newX)
          Get the horizontal position of the box.
 void setY(int newY)
          Set the vertical position of the box.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Box

public Box()
Create a new Box with some default coordinates (x,y) set to (0,0) and with width and height set to 0.


Box

public Box(int newX,
           int newY,
           int newWidth,
           int newHeight)
Create a new Box with the given coordinates.

Parameters:
newX - the x position of the box
newY - the y position of the box
newWidth - the new width of the box
newHeight - the new height of the box

Box

public Box(Box src)
copy constructor.

Parameters:
src - src box to copy from
Method Detail

getX

public final int getX()
Get the horizontal position of the box.

Returns:
the horizontal position of the box

setX

public final void setX(int newX)
Get the horizontal position of the box.

Parameters:
newX - the vertical position of the box

getY

public final int getY()
Get the vertical position of the box.

Returns:
the vertical position of the box

setY

public final void setY(int newY)
Set the vertical position of the box.

Parameters:
newY - the vertical position of the box

getHeight

public final int getHeight()
Get the current height for the box.

Returns:
the current height of the box

setHeight

public final void setHeight(int newHeight)
Set a new height for the box.

Parameters:
newHeight - the new height for the box.

getWidth

public final int getWidth()
Get the current width of the box.

Returns:
the current width of the box

setWidth

public final void setWidth(int newWidth)
Set a new width for the box.

Parameters:
newWidth - the new width

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.