aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/ui/GridLayout.java
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2008-08-28 06:03:32 +0000
committerArtur Signell <artur.signell@itmill.com>2008-08-28 06:03:32 +0000
commitb3a85cbe273719e3f0775f30c47563df9285f5bd (patch)
tree04f68b042a19f5f41c22480e957ad3b62278e9ef /src/com/itmill/toolkit/ui/GridLayout.java
parent452df5fe16c63346db03bfe9edad17241bc7f785 (diff)
downloadvaadin-framework-b3a85cbe273719e3f0775f30c47563df9285f5bd.tar.gz
vaadin-framework-b3a85cbe273719e3f0775f30c47563df9285f5bd.zip
Fixed for #2006 - updated error handling
svn changeset:5281/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui/GridLayout.java')
-rw-r--r--src/com/itmill/toolkit/ui/GridLayout.java105
1 files changed, 54 insertions, 51 deletions
diff --git a/src/com/itmill/toolkit/ui/GridLayout.java b/src/com/itmill/toolkit/ui/GridLayout.java
index 92082fd546..31f7428af1 100644
--- a/src/com/itmill/toolkit/ui/GridLayout.java
+++ b/src/com/itmill/toolkit/ui/GridLayout.java
@@ -93,9 +93,9 @@ public class GridLayout extends AbstractLayout implements
* if you add components outside the grid's area.
*
* @param columns
- * Number of columns in the grid.
+ * Number of columns in the grid.
* @param rows
- * Number of rows in the grid.
+ * Number of rows in the grid.
*/
public GridLayout(int columns, int rows) {
setColumns(columns);
@@ -123,24 +123,24 @@ public class GridLayout extends AbstractLayout implements
* </p>
*
* @param c
- * the component to be added.
+ * the component to be added.
* @param column1
- * the column of the upper left corner of the area
- * <code>c</code> is supposed to occupy.
+ * the column of the upper left corner of the area <code>c</code>
+ * is supposed to occupy.
* @param row1
- * the row of the upper left corner of the area
- * <code>c</code> is supposed to occupy.
+ * the row of the upper left corner of the area <code>c</code> is
+ * supposed to occupy.
* @param column2
- * the column of the lower right corner of the area
- * <code>c</code> is supposed to occupy.
+ * the column of the lower right corner of the area
+ * <code>c</code> is supposed to occupy.
* @param row2
- * the row of the lower right corner of the area
- * <code>c</code> is supposed to occupy.
+ * the row of the lower right corner of the area <code>c</code>
+ * is supposed to occupy.
* @throws OverlapsException
- * if the new component overlaps with any of the components
- * already in the grid.
+ * if the new component overlaps with any of the components
+ * already in the grid.
* @throws OutOfBoundsException
- * if the cells are outside of the grid area.
+ * if the cells are outside of the grid area.
*/
public void addComponent(Component component, int column1, int row1,
int column2, int row2) throws OverlapsException,
@@ -216,9 +216,9 @@ public class GridLayout extends AbstractLayout implements
* grid.
*
* @param area
- * the Area to be checked for overlapping.
+ * the Area to be checked for overlapping.
* @throws OverlapsException
- * if <code>area</code> overlaps with any existing area.
+ * if <code>area</code> overlaps with any existing area.
*/
private void checkExistingOverlaps(Area area) throws OverlapsException {
for (final Iterator i = areas.iterator(); i.hasNext();) {
@@ -236,11 +236,11 @@ public class GridLayout extends AbstractLayout implements
* the same as column1,row1. Component width and height is 1.
*
* @param c
- * the component to be added.
+ * the component to be added.
* @param column
- * the column index.
+ * the column index.
* @param row
- * the row index.
+ * the row index.
*/
public void addComponent(Component c, int column, int row) {
this.addComponent(c, column, row, column, row);
@@ -279,7 +279,7 @@ public class GridLayout extends AbstractLayout implements
* grid is automatically extended.
*
* @param c
- * the component to be added.
+ * the component to be added.
*/
public void addComponent(Component component) {
@@ -291,7 +291,7 @@ public class GridLayout extends AbstractLayout implements
area = new Area(component, cursorX, cursorY, cursorX, cursorY);
checkExistingOverlaps(area);
done = true;
- } catch (final OverlapsException ignored) {
+ } catch (final OverlapsException e) {
space();
}
}
@@ -307,7 +307,7 @@ public class GridLayout extends AbstractLayout implements
* Removes the given component from this container.
*
* @param c
- * the component to be removed.
+ * the component to be removed.
*/
public void removeComponent(Component component) {
@@ -340,9 +340,9 @@ public class GridLayout extends AbstractLayout implements
* Removes the component specified with it's cell index.
*
* @param column
- * the Component's column.
+ * the Component's column.
* @param row
- * the Component's row.
+ * the Component's row.
*/
public void removeComponent(int column, int row) {
@@ -370,9 +370,9 @@ public class GridLayout extends AbstractLayout implements
* Paints the contents of this component.
*
* @param target
- * the Paint Event.
+ * the Paint Event.
* @throws PaintException
- * if the paint operation failed.
+ * if the paint operation failed.
*/
public void paintContent(PaintTarget target) throws PaintException {
@@ -541,7 +541,9 @@ public class GridLayout extends AbstractLayout implements
/*
* (non-Javadoc)
*
- * @see com.itmill.toolkit.ui.Layout.AlignmentHandler#getComponentAlignment(com.itmill.toolkit.ui.Component)
+ * @see
+ * com.itmill.toolkit.ui.Layout.AlignmentHandler#getComponentAlignment(com
+ * .itmill.toolkit.ui.Component)
*/
public int getComponentAlignment(Component childComponent) {
final Integer bitMask = (Integer) componentToAlignment
@@ -606,22 +608,22 @@ public class GridLayout extends AbstractLayout implements
* </p>
*
* @param component
- * the component connected to the area.
+ * the component connected to the area.
* @param column1
- * The column of the upper left corner cell of the area
- * <code>c</code> is supposed to occupy.
+ * The column of the upper left corner cell of the area
+ * <code>c</code> is supposed to occupy.
* @param row1
- * The row of the upper left corner cell of the area
- * <code>c</code> is supposed to occupy.
+ * The row of the upper left corner cell of the area
+ * <code>c</code> is supposed to occupy.
* @param column2
- * The column of the lower right corner cell of the area
- * <code>c</code> is supposed to occupy.
+ * The column of the lower right corner cell of the area
+ * <code>c</code> is supposed to occupy.
* @param row2
- * The row of the lower right corner cell of the area
- * <code>c</code> is supposed to occupy.
+ * The row of the lower right corner cell of the area
+ * <code>c</code> is supposed to occupy.
* @throws OverlapsException
- * if the new component overlaps with any of the
- * components already in the grid
+ * if the new component overlaps with any of the components
+ * already in the grid
*/
public Area(Component component, int column1, int row1, int column2,
int row2) {
@@ -636,10 +638,10 @@ public class GridLayout extends AbstractLayout implements
* Tests if the given Area overlaps with an another Area.
*
* @param other
- * the Another Area that's to be tested for overlap with
- * this area.
- * @return <code>true</code> if <code>other</code> overlaps with
- * this area, <code>false</code> if it doesn't.
+ * the Another Area that's to be tested for overlap with this
+ * area.
+ * @return <code>true</code> if <code>other</code> overlaps with this
+ * area, <code>false</code> if it doesn't.
*/
public boolean overlaps(Area other) {
return column1 <= other.getColumn2() && row1 <= other.getRow2()
@@ -665,7 +667,7 @@ public class GridLayout extends AbstractLayout implements
* </p>
*
* @param newComponent
- * the new connected overriding the existing one.
+ * the new connected overriding the existing one.
*/
protected void setComponent(Component newComponent) {
component = newComponent;
@@ -783,8 +785,8 @@ public class GridLayout extends AbstractLayout implements
}
/**
- * An <code>Exception</code> object which is thrown when an area exceeds
- * the bounds of the grid.
+ * An <code>Exception</code> object which is thrown when an area exceeds the
+ * bounds of the grid.
*
* @author IT Mill Ltd.
* @version
@@ -825,7 +827,7 @@ public class GridLayout extends AbstractLayout implements
* reduced if there are any areas that would be outside of the shrunk grid.
*
* @param columns
- * the new number of columns in the grid.
+ * the new number of columns in the grid.
*/
public void setColumns(int columns) {
@@ -869,7 +871,7 @@ public class GridLayout extends AbstractLayout implements
* reduced if there are any areas that would be outside of the shrunk grid.
*
* @param rows
- * the new number of rows in the grid.
+ * the new number of rows in the grid.
*/
public void setRows(int rows) {
@@ -977,8 +979,9 @@ public class GridLayout extends AbstractLayout implements
/*
* (non-Javadoc)
*
- * @see com.itmill.toolkit.ui.Layout.AlignmentHandler#setComponentAlignment(com.itmill.toolkit.ui.Component,
- * int, int)
+ * @see
+ * com.itmill.toolkit.ui.Layout.AlignmentHandler#setComponentAlignment(com
+ * .itmill.toolkit.ui.Component, int, int)
*/
public void setComponentAlignment(Component childComponent,
int horizontalAlignment, int verticalAlignment) {
@@ -1010,7 +1013,7 @@ public class GridLayout extends AbstractLayout implements
* Inserts an empty row at the chosen position in the grid.
*
* @param row
- * Number of the row the new row will be inserted before
+ * Number of the row the new row will be inserted before
*/
public void insertRow(int row) {
if (row > rows) {
@@ -1047,7 +1050,7 @@ public class GridLayout extends AbstractLayout implements
* row.
*
* @param row
- * The row number to remove
+ * The row number to remove
*/
public void removeRow(int row) {
if (row >= rows) {