Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/OldClient/src/org/litesoft/GWT/forms/client/nonpublic/TwoDimensionalHorizontalPeerDeterminer.java

Diff revisions: vs.
  @@ -1,37 +1,37 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.GWT.forms.client.nonpublic;
3 -
4 - import org.litesoft.ui.def.nonpublic.support.*;
5 -
6 - public class TwoDimensionalHorizontalPeerDeterminer extends HorizontalPeerDeterminer {
7 - private int mCurRow = 0;
8 - private int mCurCol = 0;
9 - private int mColumns;
10 - private int[] mPeersPerRow;
11 -
12 - public TwoDimensionalHorizontalPeerDeterminer( UiLayoutTwoDimensionalDef pUiDef ) {
13 - super( pUiDef, false );
14 - ComponentGrid grid = pUiDef.getComponentGrid();
15 - mColumns = grid.getColumns();
16 - int zRows = grid.getRows();
17 - mPeersPerRow = new int[zRows]; // all ZERO
18 - for ( int row = 0; row < zRows; row++ ) {
19 - for ( int col = 0; col < mColumns; col++ ) {
20 - if ( !grid.getCell( row, col ).isEffectivelyEmpty() ) {
21 - mPeersPerRow[row]++;
22 - }
23 - }
24 - }
25 - }
26 -
27 - public Object next() {
28 - if ( hasNext() ) {
29 - mHorizontalPeers = (mPeersPerRow[mCurRow] > 1);
30 - if ( ++mCurCol >= mColumns ) {
31 - mCurRow++;
32 - mCurCol = 0;
33 - }
34 - }
35 - return super.next();
36 - }
37 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.GWT.forms.client.nonpublic;
3 +
4 + import org.litesoft.ui.def.nonpublic.support.*;
5 +
6 + public class TwoDimensionalHorizontalPeerDeterminer extends HorizontalPeerDeterminer {
7 + private int mCurRow = 0;
8 + private int mCurCol = 0;
9 + private int mColumns;
10 + private int[] mPeersPerRow;
11 +
12 + public TwoDimensionalHorizontalPeerDeterminer( UiLayoutTwoDimensionalDef pUiDef ) {
13 + super( pUiDef, false );
14 + ComponentGrid grid = pUiDef.getComponentGrid();
15 + mColumns = grid.getColumns();
16 + int zRows = grid.getRows();
17 + mPeersPerRow = new int[zRows]; // all ZERO
18 + for ( int row = 0; row < zRows; row++ ) {
19 + for ( int col = 0; col < mColumns; col++ ) {
20 + if ( !grid.getCell( row, col ).isEffectivelyEmpty() ) {
21 + mPeersPerRow[row]++;
22 + }
23 + }
24 + }
25 + }
26 +
27 + public Object next() {
28 + if ( hasNext() ) {
29 + mHorizontalPeers = (mPeersPerRow[mCurRow] > 1);
30 + if ( ++mCurCol >= mColumns ) {
31 + mCurRow++;
32 + mCurCol = 0;
33 + }
34 + }
35 + return super.next();
36 + }
37 + }