Package muntjac :: Package ui :: Module grid_layout :: Class Area
[hide private]
[frames] | no frames]

Class Area

source code

object --+
         |
        Area

This class defines an area on a grid. An Area is defined by the cells of its upper left corner (column1,row1) and lower right corner (column2, row2).


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, component, column1, row1, column2, row2)
Construct a new area on a grid.
source code
 
overlaps(self, other)
Tests if the given Area overlaps with an another Area.
source code
 
getComponent(self)
Gets the component connected to the area.
source code
 
setComponent(self, newComponent)
Sets the component connected to the area.
source code
 
getX1(self) source code
 
getColumn1(self)
Gets the column of the top-left corner cell.
source code
 
getX2(self) source code
 
getColumn2(self)
Gets the column of the bottom-right corner cell.
source code
 
getY1(self) source code
 
getRow1(self)
Gets the row of the top-left corner cell.
source code
 
getY2(self) source code
 
getRow2(self)
Gets the row of the bottom-right corner cell.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, component, column1, row1, column2, row2)
(Constructor)

source code 

Construct a new area on a grid.

Parameters:
  • component - the component connected to the area.
  • column1 - The column of the upper left corner cell of the area c is supposed to occupy.
  • row1 - The row of the upper left corner cell of the area c is supposed to occupy.
  • column2 - The column of the lower right corner cell of the area c is supposed to occupy.
  • row2 - The row of the lower right corner cell of the area c is supposed to occupy.
Raises:
  • OverlapsException - if the new component overlaps with any of the components already in the grid
Overrides: object.__init__

overlaps(self, other)

source code 

Tests if the given Area overlaps with an another Area.

Parameters:
  • other - the 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(self)

source code 

Gets the component connected to the area.

Returns:
the Component.

setComponent(self, newComponent)

source code 

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(self)

source code 

Deprecated: Use getColumn1() instead.

See Also: GridLayout.getColumn1

getColumn1(self)

source code 

Gets the column of the top-left corner cell.

Returns:
the column of the top-left corner cell.

getX2(self)

source code 

Deprecated: Use getColumn2() instead.

See Also: GridLayout.getColumn2

getColumn2(self)

source code 

Gets the column of the bottom-right corner cell.

Returns:
the column of the bottom-right corner cell.

getY1(self)

source code 

Deprecated: Use getRow1() instead.

See Also: GridLayout.getRow1

getRow1(self)

source code 

Gets the row of the top-left corner cell.

Returns:
the row of the top-left corner cell.

getY2(self)

source code 

Deprecated: Use getRow2() instead.

See Also: GridLayout.getRow2

getRow2(self)

source code 

Gets the row of the bottom-right corner cell.

Returns:
the row of the bottom-right corner cell.