StyleCodeGenerator

An encapsulation of code generation for the style of a graphical stroke.

Summary
StyleCodeGeneratorAn encapsulation of code generation for the style of a graphical stroke.
Code generation
generateStyleCodeGenerates AS3 code for a line style.
generateFillCodeGenerates AS3 code for a solid or gradient fill style.
generateBoxCodeGenerates AS3 code for a gradient box method call.
defaultsAfterArgFind and return the index after the last line style argument that is not a default lineStyle value.

Code generation

generateStyleCode

public static function generateStyleCode(style: StrokeStyle):String

Generates AS3 code for a line style.  Script size is reduced by using default parameters.

Parameters

stylegraphics style object

Returns

AS3 code snippet string

generateFillCode

public static function generateFillCode(style: StrokeStyle,
boxName: String):String

Generates AS3 code for a solid or gradient fill style.  Script size is reduced by using default parameters.

Parameters

stylegraphics style object
boxNamename of gradient box for a gradient fill

Returns

AS3 code snippet string

generateBoxCode

public static function generateBoxCode(style: StrokeStyle):String

Generates AS3 code for a gradient box method call.  Only generated if the style is a gradient fill.  Default parameters are used to reduce the script size.

Parameters

stylegraphics style object

Returns

AS3 code snippet string

defaultsAfterArg

private static function defaultsAfterArg(style: StrokeStyle):int

Find and return the index after the last line style argument that is not a default lineStyle value.

Parameters

stylegraphics style object

Returns

number of arguments that are not default

public static function generateStyleCode(style: StrokeStyle):String
Generates AS3 code for a line style.
public static function generateFillCode(style: StrokeStyle,
boxName: String):String
Generates AS3 code for a solid or gradient fill style.
public static function generateBoxCode(style: StrokeStyle):String
Generates AS3 code for a gradient box method call.
private static function defaultsAfterArg(style: StrokeStyle):int
Find and return the index after the last line style argument that is not a default lineStyle value.
Close