@class
A TMX Map loaded from a .tmx file

@memberOf cocos.nodes
@extends cocos.nodes.Node

@opt {String} file The file path of the TMX map to load
191995
function TMXTiledMap (opts) {
    TMXTiledMap.superclass.constructor.call(this, opts)

    this.anchorPoint = ccp(0, 0)

    var mapInfo

    var initialize = function () {
        this.mapSize        = mapInfo.mapSize
        this.tileSize       = mapInfo.tileSize
        this.mapOrientation = mapInfo.orientation
        this.objectGroups   = mapInfo.objectGroups
        this.properties     = mapInfo.properties
        this.tileProperties = mapInfo.tileProperties

        // Add layers to map
        var idx = 0
        mapInfo.layers.forEach(function (layerInfo) {
            if (layerInfo.visible) {
                var child = this.parseLayer({layerInfo: layerInfo, mapInfo: mapInfo})
                this.addChild({child: child, z: idx, tag: idx})

                var childSize   = child.contentSize
                var currentSize = this.contentSize
                currentSize.width  = Math.max(currentSize.width,  childSize.width)
                currentSize.height = Math.max(currentSize.height, childSize.height)
                this.contentSize = currentSize

                idx++
            }
        }.bind(this))
    }.bind(this)


    if (opts.file) {
        mapInfo = new TMXMapInfo({file: opts.file})
        initialize()
    } else if (opts.url) {
        var xhr = new XMLHttpRequest
        xhr.onreadystatechange = function () {
            if (xhr.readyState == 4) {
                var url = opts.url

                // Create absolute URL
                if (/^\/\//.test(url)) {
                    // URL prefixed with double slash
                    url = window.location.protocol + url
                } else if (/^\//.test(url)) {
                    // URL with single slash prefix
                    url = window.location.protocol + "//" + window.location.hostname + url
                } else {
                    url = window.location.href.replace(/\/[^\/]*$/, '/') + url
                }

                mapInfo = new TMXMapInfo({filename: url, xml: xhr.responseText})
                initialize()
            }
        }
        xhr.open('GET', opts.url, true)
        xhr.send(null)
    } else if (opts.xml) {
        mapInfo = new TMXMapInfo({xml: opts.xml})
        initialize()
    }
}
915698
function JSXElement(node, parent, scope, file) {
    // filter
    var open = node.openingElement;
    if (hasRefOrSpread(open.attributes)) return;

    // init
    var isComponent = true;
    var props = t.objectExpression([]);
    var obj = t.objectExpression([]);
    var key = t.literal(null);
    var type = open.name;

    if (t.isJSXIdentifier(type) && react.isCompatTag(type.name)) {
      type = t.literal(type.name);
      isComponent = false;
    }

    function pushElemProp(key, value) {
      pushProp(obj.properties, t.identifier(key), value);
    }

    function pushProp(objProps, key, value) {
      objProps.push(t.property("init", key, value));
    }

    if (node.children.length) {
      var children = react.buildChildren(node);
      children = children.length === 1 ? children[0] : t.arrayExpression(children);
      pushProp(props.properties, t.identifier("children"), children);
    }

    // props
    for (var i = 0; i < open.attributes.length; i++) {
      var attr = open.attributes[i];
      if (isJSXAttributeOfName(attr, "key")) {
        key = attr.value;
      } else {
        pushProp(props.properties, attr.name, attr.value || t.identifier("true"));
      }
    }

    if (isComponent) {
      props = t.callExpression(file.addHelper("default-props"), [t.memberExpression(type, t.identifier("defaultProps")), props]);
    }

    // metadata
    pushElemProp("$$typeof", file.addHelper("typeof-react-element"));
    pushElemProp("type", type);
    pushElemProp("key", key);
    pushElemProp("ref", t.literal(null));

    pushElemProp("props", props);
    pushElemProp("_owner", t.literal(null));

    return obj;
  }
516316
function (node, parent, scope, file) {
      var callee = this.get('callee');
      if (node._hotDecorated || !callee.matchesPattern('React.createClass')) {
        return;
      }
      
      var makeHot = file.addImport(makeHotPath, makeHotName);
      var React   = file.addImport(reactPath,   reactName);
      var mount   = file.addImport(mountPath,   mountName);
      
      node._hotDecorated = true;

      return t.callExpression(
        t.callExpression(
          makeHot,
          [
            React,
            mount,
            t.literal(file.opts._address || file.opts.filename),
            t.literal(parent && parent.id && parent.id.name || null)
          ]
        ),
        [node]
      );
    }
414008
def from_file(cls, file_path, validate=True):
        
        return xmlmap.load_xmlobject_from_file(file_path, xmlclass=cls, validate=validate)
1106962
function asJSX({attributes, children}, {file: {opts: fileOpts}}, babel) {
  // It's a shame you cannot use evaluate() with JSX
  const string = children[0].node.value
  children[0].replaceWith(
    getReplacement({
      string,
      fileOpts,
      babel,
    }),
  )
  const {
    parentPath: {
      node: {openingElement, closingElement},
    },
  } = children[0]
  openingElement.name.name = 'div'
  closingElement.name.name = 'div'
}
967448
private void visitMap(final ObjectGraphNode node) {
		Map map = (Map) node.getValue();

		for (Iterator i = map.entrySet().iterator(); i.hasNext();) {
			Map.Entry entry = (Map.Entry) i.next();
			Object key = entry.getKey();

			if (key != null) {
				ObjectGraphNode keyNode = new ObjectGraphNode(++nodeCount, "key", key.getClass().
						getName(), key);
				node.add(keyNode);
				visit(keyNode);
			} else {
				ObjectGraphNode keyNode = new ObjectGraphNode(++nodeCount, "key", Object.class.
						getName(), null);
				node.add(keyNode);
			}

			Object value = entry.getValue();

			if (value != null) {
				ObjectGraphNode valueNode = new ObjectGraphNode(++nodeCount, "value", value.
						getClass().getName(), value);
				node.add(valueNode);
				visit(valueNode);
			} else {
				ObjectGraphNode valueNode = new ObjectGraphNode(++nodeCount, "value", Object.class.
						getName(), null);
				node.add(valueNode);
			}
		}

		adjustOverhead(node);
	}
1296969
function __lazyload(key, node, dfd){
			callback.call(self, node, "loading");
			node.load().done(function(){
				self.loadKeyPath.call(self, loadMap[key], callback, node).always(_makeResolveFunc(dfd, self));
			}).fail(function(errMsg){
				self.warn("loadKeyPath: error loading: " + key + " (parent: " + root + ")");
				callback.call(self, node, "error");
				dfd.reject();
			});
		}
76331
def load(opts)
      doc = nil

      if(opts.has_key?(:file)) then
        doc = LibXML::XML::Document.file(opts[:file],:options => LibXML::XML::Parser::Options::NOBLANKS|LibXML::XML::Parser::Options::NOENT)
      else
        doc = LibXML::XML::Document.string(opts[:data],:options => LibXML::XML::Parser::Options::NOBLANKS|LibXML::XML::Parser::Options::NOENT)
      end

      if doc
        root = doc.root.first
        return import_xml(root)
      end
    rescue LibXML::XML::Error => e
      raise CFFormatError.new('invalid XML: ' + e.message)
    end
954974
function FilesNode(src, raw, config) {
  utils.define(this, 'isFilesNode', true);
  this.options = utils.omit(raw.options, ['mapDest', 'flatten', 'rename', 'filter']);
  this.src = utils.arrayify(src);

  if (this.options.resolve) {
    var cwd = path.resolve(this.options.cwd || process.cwd());
    this.src = this.src.map(function(fp) {
      return path.resolve(cwd, fp);
    });
  }

  if (raw.options.mapDest) {
    this.dest = mapDest(raw.dest, src, raw);
  } else {
    this.dest = rewriteDest(raw.dest, src, raw.options);
  }

  // copy properties to the new node
  for (var key in raw) {
    if (key !== 'src' && key !== 'dest' && key !== 'options') {
      this[key] = raw[key];
    }
  }
  util.run(config, 'filesNode', this);
}
1334659
function(helpers, options) {
      if (typeof helpers === 'object') {
        this.visit('helper', helpers);
        return this;
      }

      if (lazy.isGlob(helpers)) {
        this.loader('helpers-glob', ['base-glob'], function (files) {
          return files.map(function (fp) {
            return require(path.resolve(fp));
          });
        });

        var res = this.compose('helpers-glob')(helpers, options);
        this.visit('helper', res);
        return this;
      }

      if (typeof helpers === 'string') {
        console.log('loading helpers from a string is not implemented yet.');
      }
      return this;
    }
566895
function plugin(opts) {
  opts = objectAssign({
    modulesDirectory: 'dist/node_modules',
    modulesManifestPath: 'dist/require-modules.json',
    dist: true,
    fromDirectory: 'src',
    distDirectory: 'dist'
  }, opts);

  return through.obj(function (file, enc, cb) {
    if (file.isStream()) {
      this.emit('error', new PluginError(PLUGIN_NAME, 'Streams are not supported!'));
      return cb();
    }
    if (file.isBuffer()) {
      var modulesDirectory = path.join(process.cwd(), opts.modulesDirectory);
      var modulesManifestPath = path.join(process.cwd(), opts.modulesManifestPath);
      var distDirectory = opts.distDirectory;

      // get old modulesManifest
      if (fs.existsSync(modulesManifestPath)) {
        var data = fs.readFileSync(modulesManifestPath, 'utf8');
        modulesManifest = JSON.parse(data);
      } else {
        dirname = path.dirname(modulesManifestPath);
        fs.mkdirsSync(dirname);
      }

      var filePath = file.path;
      var contents = file.contents.toString();

      // the path where this file will be disted to
      var distFilePath = filePath;
      if (distDirectory) {
        var cwd = path.join(process.cwd());
        var relativePath = path.relative(path.join(cwd, opts.fromDirectory || ''), filePath);
        var distFilePath = path.join(process.cwd(), distDirectory, relativePath);
      }
      var distFileDirname = path.dirname(distFilePath);

      // modules
      var modules = getModules(contents);
      for (var index in modules) {
        var module = modules[index];

        var modulePath = path_util.modulePath(module, node_modules);
        if (modulePath === null) {
          continue;
        }
        var targetPath = path_util.targetPath(modulePath, node_modules, modulesDirectory);

        if (!modulesManifest.hasOwnProperty(module)) {
          var relativePath = path.relative(process.cwd(), targetPath);
          modulesManifest[module] = relativePath;

          if (!fs.existsSync(targetPath)) {
            transformFile(modulePath, targetPath, modulesDirectory);
          }
        }

        if (opts.dist) { // replace modules with path
          var relativePath = path_util.relativePath(distFileDirname, targetPath);
          var re = eval('\/require\\\(\[\'\"\]' + module + '\[\'\"\]\\\)\/ig');
          contents = contents.replace(re, 'require(\'' + relativePath + '\')');
        }
      }

      // subModules
      var subModules = getSubModules(contents);
      for (var index in subModules) {
        var subModule = subModules[index];
        var subModulePath = path_util.subModulePath(subModule, node_modules);
        if (subModulePath === null) {
          continue;
        }
        var targetPath = path_util.targetPath(subModulePath, node_modules, modulesDirectory);

        if (!modulesManifest.hasOwnProperty(subModule)) {
          var relativePath = path.relative(process.cwd(), targetPath);
          modulesManifest[subModule] = relativePath;

          if (!fs.existsSync(targetPath)) {
            transformFile(subModulePath, targetPath, modulesDirectory);
          }
        }

        if (opts.dist) { // replace modules with path
          var relativePath = path_util.relativePath(distFileDirname, targetPath);
          var subModuleRegex = subModule.replace('/', '\\\/');
          var subModuleRegex = subModuleRegex.replace('.', '\\\.');
          var re = 'require\\\(\[\'\"\]' + subModuleRegex + '\[\'\"\]\\\)';
          var regex = new RegExp(re, 'ig');
          contents = contents.replace(regex, 'require(\'' + relativePath + '\')');
        }
      }
      file.contents = Buffer.from(contents);
      fs.writeFileSync(modulesManifestPath, JSON.stringify(modulesManifest, null, 2), 'utf8');
    }

    // go to next gulp plugin
    this.push(file);
    cb();
  });
}
354184
def load(opts)
      doc = nil
      if(opts.has_key?(:file)) then
        File.open(opts[:file], "rb") { |fd| doc = Nokogiri::XML::Document.parse(fd, nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS|Nokogiri::XML::ParseOptions::NOENT) }
      else
        doc = Nokogiri::XML::Document.parse(opts[:data], nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS|Nokogiri::XML::ParseOptions::NOENT)
      end

      if doc
        root = doc.root.children.first
        return import_xml(root)
      end
    rescue Nokogiri::XML::SyntaxError => e
      raise CFFormatError.new('invalid XML: ' + e.message)
    end
1034079
private void init() {
		Collection<String> paths = StringSupport.split(classpath, ";:", false);

		for (String location : paths) {

			location = FileSupport.convertToUnixStylePath(location);
			if (location.endsWith(".zip") || location.endsWith(".jar")) {
				mapFilesInZip(location);
			} else {
				File dir = new File(location);
				if (dir.isDirectory()) {
					if (!location.endsWith("/")) {
						location += '/';
					}
					Collection<File> classFiles = FileSupport.getFilesInDirectoryTree(dir);
					for (File file : classFiles) {
						String fileName = file.getPath();
						if ((fileName.endsWith(".jar") || fileName.endsWith(".zip")) && !file.isHidden()) {
							mapFilesInZip(fileName);
						} else { // .class .properties etc.
							mapClassResourceEntry(file.getPath().substring(location.length()), file);
							fileCreationTimes.put(file, new Long(file.lastModified()));
						}
					}
				} else {
					//path can not be mapped
				}
			}
		}
	}
966118
function (data) {
      var parse = function() {
        var parsed = lazy.extend({}, lazy.parseFilepath(this.path), data);
        if (typeof parsed.ext === 'undefined') {
          parsed.ext = parsed.extname;
        }
        return parsed;
      }.bind(this);
      return this.fragmentCache('path', parse);
    }
611757
function (opts) {
        var layerName = opts.name,
            layer = null

        this.children.forEach(function (item) {
            if (item instanceof TMXLayer && item.layerName == layerName) {
                layer = item
            }
        })
        if (layer !== null) {
            return layer
        }
    }
781106
function RenderTexture (opts) {
    RenderTexture.superclass.constructor.call(this, opts)

    var width = opts.width,
        height = opts.height

    evt.addPropertyListener(this, 'contentSize', 'change', this._resizeCanvas.bind(this))

    this.canvas = document.createElement('canvas')
    this.context = this.canvas.getContext('2d')

    var atlas = new TextureAtlas({canvas: this.canvas})
    this.sprite = new Sprite({textureAtlas: atlas, rect: {origin: ccp(0, 0), size: {width: width, height: height}}})

    this.contentSize = geo.sizeMake(width, height)
    this.addChild(this.sprite)
    this.anchorPoint = ccp(0, 0)
    this.sprite.anchorPoint = ccp(0, 0)

}
86257
function childNodesFromPaths (files, parent, renderLabelFn, originalFiles, baseDir) {
  // Group by first path element
  var groups = _.groupBy(files, file => file.match(/^[^/]*\/?/))
  return Object.keys(groups).map(function (groupKey) {
    const group = groups[groupKey]
    // Is this group explicitly part of the result, or
    // just implicit through its children
    const explicit = group.indexOf(groupKey) >= 0
    let index = -1
    if (explicit) {
      index = originalFiles.indexOf(parent.replace(baseDir, '') + groupKey)
    }

    return {
      label: renderLabelFn(parent, groupKey, explicit, explicit ? index : -1),
      nodes: childNodesFromPaths(
        // Remove parent directory from file paths
        group
          .map(node => node.substr(groupKey.length))
          // Skip the empty path
          .filter(node => node),
        // New parent..., normalize to one trailing slash
        parent + groupKey,
        renderLabelFn,
        originalFiles,
        baseDir
      )
    }
  })
}