org.millstone.base.ui
Class GridLayout.Area

java.lang.Object
  |
  +--org.millstone.base.ui.GridLayout.Area
Enclosing class:
GridLayout

public class GridLayout.Area
extends java.lang.Object

This class defines an area on a grid. An Area is defined by the coordinates of its upper left corner (x1,y1) and lower right corner (x2,y2)

Since:
3.0
Version:
3.0.3
Author:
IT Mill Ltd.

Constructor Summary
GridLayout.Area(Component component, int x1, int y1, int x2, int y2)
          Construct a new area on a grid.
 
Method Summary
 Component getComponent()
          Returns the component connected to the area.
 int getX1()
          Returns the top-left corner x-coordinate.
 int getX2()
          Returns the bottom-right corner x-coordinate.
 int getY1()
          Returns the top-left corner y-coordinate.
 int getY2()
          Returns the bottom-right corner y-coordinate.
 boolean overlaps(GridLayout.Area other)
          Tests if the given Area overlaps with an another Area.
protected  void setComponent(Component newComponent)
          Sets the component connected to the area.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridLayout.Area

public GridLayout.Area(Component component,
                       int x1,
                       int y1,
                       int x2,
                       int y2)

Construct a new area on a grid.

Parameters:
x1 - The X-coordinate of the upper left corner of the area c is supposed to occupy
y1 - The Y-coordinate of the upper left corner of the area c is supposed to occupy
x2 - The X-coordinate of the lower right corner of the area c is supposed to occupy
y2 - The Y-coordinate of the lower right corner of the area c is supposed to occupy
Throws:
OverlapsException - if the new component overlaps with any of the components already in the grid
Method Detail

overlaps

public boolean overlaps(GridLayout.Area other)
Tests if the given Area overlaps with an another Area.

Parameters:
other - Another Area that's to be tested for overlap with this area
Returns:
true if other overlaps with this area, false if it doesn't

getComponent

public Component getComponent()
Returns the component connected to the area.

Returns:
Component

setComponent

protected void setComponent(Component newComponent)
Sets the component connected to the area.

This function only sets the value in the datastructure and does not send any events or set parents

Parameters:
newComponent - The new connected overriding the existing one

getX1

public int getX1()
Returns the top-left corner x-coordinate.

Returns:
int

getX2

public int getX2()
Returns the bottom-right corner x-coordinate.

Returns:
int

getY1

public int getY1()
Returns the top-left corner y-coordinate.

Returns:
int

getY2

public int getY2()
Returns the bottom-right corner y-coordinate.

Returns:
int


Copyright © 2000,2001,2002 IT Mill Ltd. All Rights Reserved.