reader.onloadend = function () {
     dataUrl = reader.result;
     figure = Figure.initializeFigureWithType(FigureType["Image"], [0, 0], {
         dataURL: dataUrl
     });
     self.application.map._oldMode = Mode["ImageTool"];
     self.application.map.figures.add(figure);
     self._imageFileInput.value = "";
 };
        value: function (legacyFigure) {
            var contourFigure,
                coordinates,
                properties,
                type;
            type = this._parseLegacyFigureType(legacyFigure);
            if (typeof type !== "undefined") {
                properties = this._parseLegacyFigureProperties(legacyFigure);
                coordinates = this._parseLegacyFigureCoordinates(legacyFigure);

                contourFigure = Figure.initializeFigureWithType(type, coordinates, properties);
                if (contourFigure.type === FigureType["Annotation"]) {
                    contourFigure.fillOpacity = legacyFigure.fillOpacity;
                    contourFigure.mapTip = legacyFigure.maptip;
                    contourFigure.strokeColor = legacyFigure.borderColor;
                    properties.strokeOpacity = legacyFigure.borderOpacity;
                }
            }
            return contourFigure;
        }
 value: function (event) {
     event.stopPropagation();
     var dataUrl, file = this.__imageFileInput.files[0], figure, reader, self = this;
     if (file && Figure.isSupportedImageMimeType(file.type)) {
         this.selectionEditor._optionsController.select(this._imageTool);
         reader = new FileReader();
         reader.onloadend = function () {
             dataUrl = reader.result;
             figure = Figure.initializeFigureWithType(FigureType["Image"], [0, 0], {
                 dataURL: dataUrl
             });
             self.application.map._oldMode = Mode["ImageTool"];
             self.application.map.figures.add(figure);
             self._imageFileInput.value = "";
         };
         reader.readAsDataURL(file);
     } else if (file) {
         this._error = new Error("Unsupported mimetype");
         this.needsDraw = true;
         this._imageFileInput.value = "";
         this.errorBar.addEventListener("closeAction", this, false);
     }
 }