+ DALI_LOG_WARNING( "RecordStyle() Node \"%s\" is not a JSON object\n", key.c_str() );
+ continue;
+ }
+
+ for( TreeNode::ConstIterator iter = states.CBegin(); iter != states.CEnd(); ++iter )
+ {
+ const TreeNode& stateNode = (*iter).second;
+ const char* stateName = stateNode.GetName();
+ if( stateNode.GetType() != TreeNode::OBJECT )
+ {
+ DALI_LOG_WARNING( "RecordStyle() Node \"%s\" is not a JSON object\n", stateName );
+ continue;
+ }
+
+ StylePtr* stylePtr = style->subStates.Find( stateName );
+ if( stylePtr )
+ {
+ StylePtr style(*stylePtr);
+ RecordStyle( style, stateNode, handle, replacements );
+ }
+ else
+ {
+ StylePtr subState = Style::New();
+ RecordStyle( subState, stateNode, handle, replacements );
+ style->subStates.Add( stateName, subState );
+ }
+ }
+ }
+ else if( key == KEYNAME_VISUALS )
+ {
+ for( TreeNode::ConstIterator iter = keyValue.second.CBegin(); iter != keyValue.second.CEnd(); ++iter )
+ {
+ // Each key in this table should be a property name matching a visual.
+ const TreeNode::KeyNodePair& visual = *iter;
+ Dali::Property::Value property(Property::MAP);
+ if( DeterminePropertyFromNode( visual.second, Property::MAP, property, replacements ) )
+ {
+ Property::Map* mapPtr = style->visuals.Find( visual.first );
+ if( mapPtr )
+ {
+ // Override existing visuals
+ mapPtr->Clear();
+ mapPtr->Merge( *property.GetMap() );
+ }
+ else
+ {
+ Property::Map* map = property.GetMap();
+ if( map )
+ {
+ style->visuals.Add( visual.first, *map );
+ }
+ }
+ }
+ }
+ }
+ else if( key == KEYNAME_ENTRY_TRANSITION )
+ {
+ RecordTransitionData( keyValue, style->entryTransition, replacements );
+ }
+ else if( key == KEYNAME_EXIT_TRANSITION )
+ {
+ RecordTransitionData( keyValue, style->exitTransition, replacements );
+ }
+ else if( key == KEYNAME_TRANSITIONS )
+ {
+ RecordTransitions( keyValue, style->transitions, replacements );
+ }
+ else if( key == KEYNAME_TYPE ||
+ key == KEYNAME_ACTORS ||
+ key == KEYNAME_SIGNALS ||
+ key == KEYNAME_STYLES ||
+ key == KEYNAME_MAPPINGS ||
+ key == KEYNAME_INHERIT )
+ {
+ continue;
+ }
+ else // It's a property
+ {
+ Property::Index index;
+ Property::Value value;
+ if( MapToTargetProperty( handle, key, keyValue.second, replacements, index, value ) )
+ {
+ Property::Value* existingValuePtr = style->properties.Find( index );
+ if( existingValuePtr != NULL )
+ {
+ *existingValuePtr = value; // Overwrite existing property.
+ }
+ else
+ {
+ style->properties.Add( index, value );
+ }