Revision: 3827 http://vexi.svn.sourceforge.net/vexi/?rev=3827&view=rev Author: clrg Date: 2010-03-26 16:58:18 +0000 (Fri, 26 Mar 2010)
Log Message: ----------- Code cleanup only Modified Paths: -------------- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp Modified: trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp =================================================================== --- trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp 2010-03-26 16:06:30 UTC (rev 3826) +++ trunk/core/org.vexi.core/src/org/vexi/core/Box.jpp 2010-03-26 16:58:18 UTC (rev 3827) @@ -726,10 +726,10 @@ boolean right = test(ALIGN_RIGHT); boolean bottom = test(ALIGN_BOTTOM); - // horizontal stacking if (test(ORIENT) == HORIZONTAL) { - // simple case - no slack, place children next to eachother - if (!test(HAS_WIDTH_SLACK) && 0 >= width - contentwidth) { + // horizontal stacking + if (!test(HAS_WIDTH_SLACK) && 0 >= width-contentwidth) { + // simple case - no slack, place children next to eachother for (Box child = getChild(i=0); child != null; child = getChild(++i)) { if (!child.test(DISPLAY)) { continue; @@ -742,8 +742,8 @@ child_x += child.contentwidth; } - // take into account slack - slightly more processing } else { + // take into account slack - slightly more processing: // our layout lies somewhere between the min and max size, // loop over the children attempting to set their width to // targetsize and adjust until it meets the parent width @@ -778,8 +778,8 @@ total += targetsize; } } - // no active children - nothing to do if (numactive==0) { + // no active children - nothing to do return; } // test to see if targetsize produces a solution that rounds @@ -861,10 +861,10 @@ } } - // vertical stacking - mirrors horizontal stacking code [see for comments] } else { - // simple case - no slack + // vertical stacking - mirrors horizontal stacking code [see for comments] if (!test(HAS_HEIGHT_SLACK) && 0 >= height - contentheight) { + // simple case - no slack for (Box child = getChild(i=0); child != null; child = getChild(++i)) { if (!child.test(DISPLAY)) { continue; @@ -877,8 +877,8 @@ child_y += child.contentheight; } - // take into account slack - slightly more processing } else { + // take into account slack - slightly more processing: // our layout lies somewhere between the min and max size, // loop over the children attempting to set their width to // targetsize and adjust until it meets the parent width @@ -913,8 +913,8 @@ total += targetsize; } } - // no active children - nothing to do if (numactive==0) { + // no active children - nothing to do return; } // test to see if targetsize produces a solution that rounds @@ -924,8 +924,8 @@ if (numflexible>0) { targetsize -= (total-(float)height)/(float)numflexible; } else { - // no solution required - avaiable min-sizes over-consume height if (num_minsize+num_passive==numactive) { + // no solution required - avaiable min-sizes over-consume height targetsize = height; break; } @@ -935,8 +935,8 @@ if (numflexible>0) { targetsize += ((float)height-total)/(float)numflexible; } else { - // no solution required - avaiable max-sizes do not consume height if (num_maxsize+num_passive==numactive) { + // no solution required - avaiable max-sizes do not consume height targetsize = height; break; } @@ -1055,8 +1055,8 @@ //if (path != null) path.realize(Affine.translate(globalx, globaly)).stroke(buf, 1, strokecolor); - // absolute layout means we must attempt to render all visible children if (!test(PACK)) { + // absolute layout means we must attempt to render all visible children int i = 0; for (Box b = getChild(0); b != null; b = getChild(++i)) { if (!b.test(DISPLAY)) { @@ -1065,8 +1065,8 @@ b.render(globalx, globaly, cx1, cy1, cx2, cy2, buf); } - // packed layout allows us to know early when to stop processing } else { + // packed layout allows us to know early when to stop processing if (test(ORIENT) == HORIZONTAL) { int i = 0; for (Box b = getChild(0); b != null; b = getChild(++i)) { @@ -1492,8 +1492,8 @@ return true; int i; - // absolute layout - check all children if (!test(PACK)) { + // absolute layout - check all children for (Box b = getChild(i=treeSize()-1); b != null; b = getChild(--i)) { int b_mx = mousex-getXInParent(b); int b_my = mousey-getYInParent(b); @@ -1504,8 +1504,8 @@ } } - // packing allows for early exit } else { + // packing allows for early exit for (Box b = getChild(i=0); b != null; b = getChild(++i)) { int b_mx = mousex-b.x; int b_my = mousey-b.y; @@ -3110,17 +3110,16 @@ if (rangeTrap != null) { value = Main.SCHEDULER.runBeforePut(rangeTrap, value, JSU.N(i)); JS jsi = Main.SCHEDULER.cascadedTo; - // returned from trap without cascading (cleaned up in finally clause) if (jsi==null) { + // returned from trap without cascading (cleaned up in finally clause) return; } i = JSU.toInt(jsi); } // handle assignment - // REMARK - when !fireTrapsOnRemove we are moving from an oldparent. In this - // case it is possible that the redirect is not the same as the parent, and - // we don't want to act on the redirect (as we would for + // REMARK - when !fireTrapsOnRemove we are removing from an oldparent. In this + // case it is not possible that oldparent.redirect is not the same as oldparent if (viaRedirect && redirect != this) { // can't add children to a null redirect if (redirect == null) { @@ -3129,13 +3128,13 @@ redirect.put(i, value); } else { // CHECKS - // ignore puts outside of valid index range (0+) if (i < 0) { + // ignore puts outside of valid index range (0+) return; } - // can't put non-box as a child of a box if (value != null && !(value instanceof Box)) { + // can't put non-box as a child of a box throw new JSExn("Attempt to set a numerical property on a box to a non-box"); } @@ -3154,7 +3153,8 @@ b.removeFromParent(); } - } else {// attempt to add a child, b, to this box + } else { + // attempt to add a child, b, to this box Box b = (Box)value; // check if box being moved is currently target of a redirect This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn