Skip to content

Commit

Permalink
added support for RadialGradient
Browse files Browse the repository at this point in the history
  • Loading branch information
EliEladElrom committed Apr 19, 2010
1 parent 463be71 commit 68f3348
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions EladLibFlex/.actionScriptProperties
Expand Up @@ -14,3 +14,4 @@
<modules/> <modules/>
<buildCSSFiles/> <buildCSSFiles/>
</actionScriptProperties> </actionScriptProperties>

1 change: 1 addition & 0 deletions EladLibFlex/.flexProperties
@@ -1,2 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/> <flexProperties enableServiceManager="false" flexServerFeatures="0" flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="2"/>

Binary file modified EladLibFlex/bin-debug/FXGConverter.swf
Binary file not shown.
Expand Up @@ -4,6 +4,7 @@ package com.elad.framework.utils.fxgconverter


import mx.graphics.GradientEntry; import mx.graphics.GradientEntry;
import mx.graphics.LinearGradient; import mx.graphics.LinearGradient;
import mx.graphics.RadialGradient;
import mx.graphics.SolidColor; import mx.graphics.SolidColor;
import mx.graphics.SolidColorStroke; import mx.graphics.SolidColorStroke;
import mx.utils.StringUtil; import mx.utils.StringUtil;
Expand Down Expand Up @@ -83,8 +84,8 @@ package com.elad.framework.utils.fxgconverter
component = retrieveComponentFromXML( subSubComList[ii], debug ); component = retrieveComponentFromXML( subSubComList[ii], debug );


// Use case for gradients // Use case for gradients
if ( component is LinearGradient ) if ( component is LinearGradient || component is RadialGradient )
(component as LinearGradient).entries = getGradients( subComList[i].children().children().children(), debug );; component.entries = getGradients( subComList[i].children().children().children(), debug );;


addChildToComponent( component, previousComponent, debug ); addChildToComponent( component, previousComponent, debug );
} }
Expand Down Expand Up @@ -171,7 +172,8 @@ package com.elad.framework.utils.fxgconverter
return false; return false;
} }


if ( child is SolidColor || ( child is LinearGradient && previousComponent is Path ) ) if ( child is SolidColor ||
( (child is LinearGradient || child is RadialGradient) && previousComponent is Path ) )
{ {
previousComponent.fill = child; previousComponent.fill = child;
isUIComponent = false; isUIComponent = false;
Expand Down
Expand Up @@ -3,6 +3,7 @@ package com.elad.framework.utils.fxgconverter
import mx.controls.Label; import mx.controls.Label;
import mx.graphics.GradientEntry; import mx.graphics.GradientEntry;
import mx.graphics.LinearGradient; import mx.graphics.LinearGradient;
import mx.graphics.RadialGradient;
import mx.graphics.SolidColor; import mx.graphics.SolidColor;
import mx.graphics.SolidColorStroke; import mx.graphics.SolidColorStroke;


Expand Down Expand Up @@ -45,7 +46,7 @@ package com.elad.framework.utils.fxgconverter
{ {
case "GradientEntry": case "GradientEntry":
retComponent = new GradientEntry(); retComponent = new GradientEntry();
break; break;
case "Group": case "Group":
retComponent = new Group(); retComponent = new Group();
break; break;
Expand Down Expand Up @@ -91,6 +92,9 @@ package com.elad.framework.utils.fxgconverter
case "LinearGradient": case "LinearGradient":
retComponent = new LinearGradient(); retComponent = new LinearGradient();
break; break;
case "RadialGradient":
retComponent = new RadialGradient();
break;
default: default:
if ( debug ) if ( debug )
trace( "FAIL: missing component, couldn't parse component: " + componentType ); trace( "FAIL: missing component, couldn't parse component: " + componentType );
Expand Down

0 comments on commit 68f3348

Please sign in to comment.