* CompilationUnit. Additional symbols will be generated for child
* sprites corresponding to <TextGraphic> nodes.
*/
private Source generateSource(CompilationUnit unit, SymbolTable symbolTable) throws IOException
{
Source originalSource = unit.getSource();
// package/class is derived from source name and location
String className = originalSource.getShortName();
String packageName = originalSource.getRelativePath().replace('/','.');
// TypeTable will be used to determine if an text related FXG
// attribute apply to a property or style of the associated
// ActionScript API.
TypeTable typeTable = new TypeTable(symbolTable, nameMappings, unit.getStandardDefs(),
themeNames);
// Transcode the FXG DOM to SWF graphics primitives
FXGSymbolClass asset = transcodeFXG(unit, packageName, className, typeTable);
// Generate the main source and associate the top level DefineSprite
Source generatedSource = generateMainSource(unit, packageName, className, asset);
// Handle any additional generated child sprite classes
List<FXGSymbolClass> additionalAssets = asset.getAdditionalSymbolClasses();
if (additionalAssets != null && additionalAssets.size() > 0)
{
Map<QName, Source> additionalSources = new HashMap<QName, Source>(additionalAssets.size());
for (FXGSymbolClass additionalAsset : additionalAssets)
{
if (additionalAsset.getSymbol() != null)
{
Source additionalSource = generateAdditionalSource(unit, additionalAsset);
if (additionalSource != null)
{
QName additionalQName = new QName(additionalAsset.getPackageName(), additionalAsset.getClassName());
additionalSources.put(additionalQName, additionalSource);
}