com.vaadin.ui.
Class GridLayout.Area
java.lang.Object
com.vaadin.ui.GridLayout.Area
All Implemented Interfaces:
Enclosing class:
- extends Object
- implements Serializable
public class GridLayout.Area
Defines a rectangular area of cells in a GridLayout.
Also maintains a reference to the component contained in the area.
The area is specified by the cell coordinates of its upper left corner (column1,row1) and lower right corner (column2,row2). As otherwise with GridLayout, the column and row coordinates start from zero.
Since:
3.0
Version:
6.8.18
Author:
Vaadin Ltd.
See Also:
Constructor Summary | |
---|---|
GridLayout.Area(Component component,
int column1,
int row1,
int column2,
int row2)
Construct a new area on a grid. |
Method Summary | |
---|---|
int |
getColumn1()
Gets the column of the top-left corner cell. |
int |
getColumn2()
Gets the column of the bottom-right corner cell. |
Component |
getComponent()
Gets the component connected to the area. |
int |
getRow1()
Gets the row of the top-left corner cell. |
int |
getRow2()
Gets the row of the bottom-right corner cell. |
int |
getX1()
Deprecated. Use getColumn1() instead. |
int |
getX2()
Deprecated. Use getColumn2() instead. |
int |
getY1()
Deprecated. Use getRow1() instead. |
int |
getY2()
Deprecated. Use getRow2() instead. |
boolean |
overlaps(GridLayout.Area other)
Tests if this Area overlaps with 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 column1,
int row1,
int column2,
int row2)
- Parameters:
component
- the component connected to the area.column1
- The column of the upper left corner cell of the area. The leftmost column has index 0.row1
- The row of the upper left corner cell of the area. The topmost row has index 0.column2
- The column of the lower right corner cell of the area. The leftmost column has index 0.row2
- The row of the lower right corner cell of the area. The topmost row has index 0.
Construct a new area on a grid.
Method Detail |
---|
overlaps
public boolean overlaps(GridLayout.Area other)
- Parameters:
other
- the other Area that is to be tested for overlap with this area- Returns:
true
ifother
area overlaps with this on,false
if it does not.
Tests if this Area overlaps with another Area.
getComponent
public Component getComponent()
- Returns:
- the Component.
Gets the component connected to the area.
setComponent
protected void setComponent(Component newComponent)
- Parameters:
newComponent
- the new connected overriding the existing one.
Sets the component connected to the area.
This function only sets the value in the data structure and does not send any events or set parents.
getX1
@Deprecated
public int getX1()
Deprecated. Use getColumn1()
instead.
getColumn1
public int getColumn1()
- Returns:
- the column of the top-left corner cell.
Gets the column of the top-left corner cell.
getX2
@Deprecated
public int getX2()
Deprecated. Use getColumn2()
instead.
getColumn2
public int getColumn2()
- Returns:
- the column of the bottom-right corner cell.
Gets the column of the bottom-right corner cell.
getY1
@Deprecated
public int getY1()
Deprecated. Use getRow1()
instead.
getRow1
public int getRow1()
- Returns:
- the row of the top-left corner cell.
Gets the row of the top-left corner cell.
getY2
@Deprecated
public int getY2()
Deprecated. Use getRow2()
instead.
getRow2
public int getRow2()
- Returns:
- the row of the bottom-right corner cell.
Gets the row of the bottom-right corner cell.