Revision: 4011 http://vexi.svn.sourceforge.net/vexi/?rev=4011&view=rev Author: clrg Date: 2011-01-31 14:40:02 +0000 (Mon, 31 Jan 2011)
Log Message: ----------- Fix textcolor Modified Paths: -------------- trunk/org.vexi-core.main/src/main/java/org/vexi/core/BoxRenderProperties.java trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Box.jpp Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/core/BoxRenderProperties.java =================================================================== --- trunk/org.vexi-core.main/src/main/java/org/vexi/core/BoxRenderProperties.java 2011-01-31 14:31:31 UTC (rev 4010) +++ trunk/org.vexi-core.main/src/main/java/org/vexi/core/BoxRenderProperties.java 2011-01-31 14:40:02 UTC (rev 4011) @@ -272,8 +272,9 @@ boolean isDefaultColor() { return !test(FONTCOLOR_SET); } boolean isDefaultStream() { return !test(FONTSTREAM_SET); } - /** set color to default color */ - boolean resetColor() { + /** set textcolor to default color + * @return boolean stating if textcolor has changed */ + boolean resetTextcolor() { if (this != DEFAULT_RENDER_PROPS && test(FONTCOLOR_SET)) { textcolor = DEFAULT_COLOR; clear(FONTCOLOR_SET); @@ -282,24 +283,32 @@ return false; } - /** set color to arbitary value - * @return boolean stating if color has changed */ - boolean setColor(JS jscolor, Box owner) throws JSExn { - int c = Color.stringToColor(JSU.toString(jscolor)); - return setColor(c, owner); + /** set textcolor using arbitrary string, converting as necessary + * @return boolean stating if textcolor has changed */ + boolean setTextcolor(JS jstextcolor, Box owner) throws JSExn { + int c = Color.stringToColor(JSU.toString(jstextcolor)); + return setTextcolor(c, owner); } - boolean setColor(int color, Box owner) { - if (test(FONTCOLOR_SET) && color == this.textcolor) { + + /** set textcolor to integer value + * @return boolean stating if textcolor has changed */ + boolean setTextcolor(int textcolor, Box owner) { + if (test(FONTCOLOR_SET) && textcolor == this.textcolor) { return false; } - - set(FONTCOLOR_SET); - BoxRenderProperties t = (this == DEFAULT_RENDER_PROPS) ? new BoxRenderProperties() : this; - t.textcolor = color; + if (this == DEFAULT_RENDER_PROPS) { + BoxRenderProperties t = new BoxRenderProperties(); + t.set(FONTCOLOR_SET); + t.textcolor = textcolor; + owner.renderprops = t; + } else { + set(FONTCOLOR_SET); + this.textcolor = textcolor; + } return true; } - /** set the fill of a box according to 'value' */ + /** set the fill of a box according to 'value', converting as necessary */ boolean setFill(JS value, Box owner) throws JSExn { if (value == null) { return resetFill(); Modified: trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Box.jpp =================================================================== --- trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Box.jpp 2011-01-31 14:31:31 UTC (rev 4010) +++ trunk/org.vexi-core.main/src/main/jpp/org/vexi/core/Box.jpp 2011-01-31 14:40:02 UTC (rev 4011) @@ -2406,11 +2406,11 @@ case "textcolor": try { if (value==null) { - if (!renderprops.resetColor()) { + if (!renderprops.resetTextcolor()) { return; } } else { - if (!renderprops.setColor(value, this)) { + if (!renderprops.setTextcolor(value, this)) { return; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn