diff --git a/frontend-js/src/main/js/gui/export/GraphicsExportPanel.js b/frontend-js/src/main/js/gui/export/GraphicsExportPanel.js index 38d38419447956b808f8cfd8f4dc7108ab2c7672..4b3c3d2a124e6b5914054439155c7d1d54084b6b 100644 --- a/frontend-js/src/main/js/gui/export/GraphicsExportPanel.js +++ b/frontend-js/src/main/js/gui/export/GraphicsExportPanel.js @@ -136,9 +136,9 @@ GraphicsExportPanel.prototype._createDownloadButton = function () { var identifier = null; var defaultOverlayName = "Network"; for (var i = 0; i < self.getProject().getDataOverlays().length; i++) { - var layout = self.getProject().getDataOverlays()[i]; - if (identifier === null || layout.getName() === defaultOverlayName) { - identifier = layout.getId(); + var overlay = self.getProject().getDataOverlays()[i]; + if (identifier === null || overlay.getName() === defaultOverlayName) { + identifier = overlay.getId(); } } diff --git a/frontend-js/src/main/js/map/AbstractCustomMap.js b/frontend-js/src/main/js/map/AbstractCustomMap.js index ff7a66e80fd7a01599e106ce57a04ff8fdc4c121..2150be2c13c952084102f242a4d3b859e699d1dc 100644 --- a/frontend-js/src/main/js/map/AbstractCustomMap.js +++ b/frontend-js/src/main/js/map/AbstractCustomMap.js @@ -37,9 +37,9 @@ function AbstractCustomMap(model, options) { this.setModel(model); - // this array contains elements that are presented on a specific layout (set + // this array contains elements that are presented on a specific overlay (set // of google map object representing lines/areas that are associated with - // layout) + // overlay) this.selectedLayoutOverlays = []; // following fields are used in conversion between x,y coordinates and lat,lng @@ -90,8 +90,8 @@ AbstractCustomMap.prototype.getMarkerSurfaceCollection = function () { return this._markerSurfaceCollection; }; /** - * Assigns layouts with images to the google map (which set of images should be - * used by google maps api for which layout). + * Assigns overlays with images to the google map (which set of images should be + * used by google maps api for which overlay). * */ AbstractCustomMap.prototype.setupLayouts = function () { @@ -157,10 +157,10 @@ AbstractCustomMap.prototype.createMapOptions = function () { }; /** - * Create google maps configuration options object for a specific layout. + * Create google maps configuration options object for a specific overlay. * * @param param - * object with information about layout + * object with information about overlay */ AbstractCustomMap.prototype.createTypeOptions = function (param) { var self = this; @@ -556,22 +556,22 @@ AbstractCustomMap.prototype.getTopMap = function () { }; /** - * Method that should be called when number of layouts to visualize changed to - * modify boundaries of the elements to visualize. When few layouts are + * Method that should be called when number of overlays to visualize changed to + * modify boundaries of the elements to visualize. When few overlays are * visualized at the same time then index contains information where this new - * layout is placed in the list (starting from 0) and length contains - * information how many layouts we visualize in total. + * overlay is placed in the list (starting from 0) and length contains + * information how many overlays we visualize in total. * - * @param layoutId - * identifier of a layout + * @param overlayId + * identifier of a overlay * @param index - * when visualizing more than one layout at the same time index - * contains information at which position in the list this layout is + * when visualizing more than one overlay at the same time index + * contains information at which position in the list this overlay is * placed * @param length - * number of layouts that are currently visualized + * number of overlays that are currently visualized */ -AbstractCustomMap.prototype._resizeSelectedDataOverlay = function (layoutId, index, length) { +AbstractCustomMap.prototype._resizeSelectedDataOverlay = function (overlayId, index, length) { var self = this; return new Promise(function (resolve) { // if map is not initialized then don't perform this operation @@ -579,35 +579,35 @@ AbstractCustomMap.prototype._resizeSelectedDataOverlay = function (layoutId, ind logger.debug("Model " + self.getId() + " not initialized"); resolve(); } - logger.debug("Resize layout: " + layoutId); + logger.debug("Resize overlay: " + overlayId); // start ratio var startX = index * (1.0 / length); // end ratio var endX = (index + 1) * (1.0 / length); - for (var i = 0; i < self.selectedLayoutOverlays[layoutId].length; i++) { - self.selectedLayoutOverlays[layoutId][i].setBoundsForAlias(startX, endX); + for (var i = 0; i < self.selectedLayoutOverlays[overlayId].length; i++) { + self.selectedLayoutOverlays[overlayId][i].setBoundsForAlias(startX, endX); } resolve(); }); }; /** - * Shows all elements from a given layout. When few layouts are visualized at - * the same time then index contains information where this new layout is placed + * Shows all elements from a given overlay. When few overlays are visualized at + * the same time then index contains information where this new overlay is placed * in the list (starting from 0) and length contains information how many - * layouts we visualize in total. + * overlays we visualize in total. * - * @param layoutId - * identifier of a layout + * @param overlayId + * identifier of a overlay * @param index - * when visualizing more than one layout at the same time index - * contains information at which position in the list this layout is + * when visualizing more than one overlay at the same time index + * contains information at which position in the list this overlay is * placed * @param length - * number of layouts that are currently visualized + * number of overlays that are currently visualized */ -AbstractCustomMap.prototype._showSelectedDataOverlay = function (layoutId, index, length) { +AbstractCustomMap.prototype._showSelectedDataOverlay = function (overlayId, index, length) { var self = this; // if map is not initialized then don't perform this operation return new Promise(function (resolve, reject) { @@ -619,43 +619,43 @@ AbstractCustomMap.prototype._showSelectedDataOverlay = function (layoutId, index logger.debug("Showing model " + self.getId()); } - self.selectedLayoutOverlays[layoutId] = []; + self.selectedLayoutOverlays[overlayId] = []; // start ratio var startX = index * (1.0 / length); // end ratio var endX = (index + 1) * (1.0 / length); - var layoutAliases; - var layoutReactions; + var overlayAliases; + var overlayReactions; - return self.getProject().getDataOverlayById(layoutId).then(function (layout) { - layoutAliases = layout.getAliases(); - layoutReactions = layout.getReactions(); + return self.getProject().getDataOverlayById(overlayId).then(function (overlay) { + overlayAliases = overlay.getAliases(); + overlayReactions = overlay.getReactions(); var identifiedElements = []; var i; - for (i = 0; i < layoutAliases.length; i++) { - if (layoutAliases[i].getModelId() === self.getId()) { - identifiedElements.push(new IdentifiedElement(layoutAliases[i])); + for (i = 0; i < overlayAliases.length; i++) { + if (overlayAliases[i].getModelId() === self.getId()) { + identifiedElements.push(new IdentifiedElement(overlayAliases[i])); } } var reactionIds = []; - for (i = 0; i < layoutReactions.length; i++) { - if (layoutReactions[i].getModelId() === self.getId()) { - identifiedElements.push(new IdentifiedElement(layoutReactions[i])); + for (i = 0; i < overlayReactions.length; i++) { + if (overlayReactions[i].getModelId() === self.getId()) { + identifiedElements.push(new IdentifiedElement(overlayReactions[i])); } } return self.getModel().getByIdentifiedElements(identifiedElements, false); }).then(function () { - return Promise.each(layoutAliases, function (layoutAlias) { - if (layoutAlias.getModelId() === self.getId()) { + return Promise.each(overlayAliases, function (overlayAlias) { + if (overlayAlias.getModelId() === self.getId()) { var surface; var element; - return self.getModel().getAliasById(layoutAlias.getId()).then(function (aliasData) { + return self.getModel().getAliasById(overlayAlias.getId()).then(function (aliasData) { element = new IdentifiedElement(aliasData); return AliasSurface.create({ - overlayAlias: layoutAlias, + overlayAlias: overlayAlias, alias: aliasData, map: self, startX: startX, @@ -668,18 +668,18 @@ AbstractCustomMap.prototype._showSelectedDataOverlay = function (layoutId, index }); }).then(function (result) { surface = result; - self.selectedLayoutOverlays[layoutId].push(surface); + self.selectedLayoutOverlays[overlayId].push(surface); }); } }); }).then(function () { - return Promise.each(layoutReactions, function (layoutReaction) { - if (layoutReaction.getModelId() === self.getId()) { - return self.getModel().getReactionById(layoutReaction.getId()).then(function (reactionData) { + return Promise.each(overlayReactions, function (overlayReaction) { + if (overlayReaction.getModelId() === self.getId()) { + return self.getModel().getReactionById(overlayReaction.getId()).then(function (reactionData) { var surface; var element = new IdentifiedElement(reactionData); return ReactionSurface.create({ - layoutReaction: layoutReaction, + layoutReaction: overlayReaction, reaction: reactionData, map: self, onClick: [function () { @@ -690,7 +690,7 @@ AbstractCustomMap.prototype._showSelectedDataOverlay = function (layoutId, index customized: (length === 1) }).then(function (result) { surface = result; - self.selectedLayoutOverlays[layoutId].push(surface); + self.selectedLayoutOverlays[overlayId].push(surface); surface.show(); }); }); @@ -703,21 +703,21 @@ AbstractCustomMap.prototype._showSelectedDataOverlay = function (layoutId, index }; /** - * Hides all elements from layout. + * Hides all elements from overlay. * - * @param layoutId - * identifier of a layout + * @param overlayId + * identifier of a overlay */ -AbstractCustomMap.prototype._hideSelectedLayout = function (layoutId) { +AbstractCustomMap.prototype._hideSelectedLayout = function (overlayId) { // if map is not initialized then don't perform this operation if (!this.initialized) { logger.debug("Model " + this.getId() + " not initialized"); return; } - for (var i = 0; i < this.selectedLayoutOverlays[layoutId].length; i++) { - this.selectedLayoutOverlays[layoutId][i].setMap(null); + for (var i = 0; i < this.selectedLayoutOverlays[overlayId].length; i++) { + this.selectedLayoutOverlays[overlayId][i].setMap(null); } - this.selectedLayoutOverlays[layoutId] = []; + this.selectedLayoutOverlays[overlayId] = []; }; /** @@ -749,20 +749,20 @@ AbstractCustomMap.prototype._openInfoWindowForAlias = function (alias, googleMar /** * Returns promise of a list of {@link LayoutAlias} information for a given - * {@link Alias} in all currently visualized layouts. + * {@link Alias} in all currently visualized overlays. * * @param aliasId * identifier of the {@link Alias} * @returns promise of an {Array} with list of {@link LayoutAlias} information - * for a given {@link Alias} in all currently visualized layouts + * for a given {@link Alias} in all currently visualized overlays */ AbstractCustomMap.prototype.getAliasVisibleLayoutsData = function (aliasId) { var self = this; return self.getTopMap().getVisibleDataOverlays().then(function (visibleDataOverlays) { var result = []; for (var i = 0; i < visibleDataOverlays.length; i++) { - var layout = visibleDataOverlays[i]; - result.push(layout.getFullAliasById(aliasId)); + var overlay = visibleDataOverlays[i]; + result.push(overlay.getFullAliasById(aliasId)); } return Promise.all(result); }); @@ -987,13 +987,13 @@ AbstractCustomMap.prototype.getPictureSize = function () { }; /** - * Returns array containing elements that are presented on a specific layout + * Returns array containing elements that are presented on a specific overlay * (set of google map objects representing lines/areas that are associated with - * layout). + * overlay). * * @returns {Array} containing elements that are presented on a specific - * layout (set of google map objects representing lines/areas that are - * associated with layout). + * overlay (set of google map objects representing lines/areas that are + * associated with overlay). */ AbstractCustomMap.prototype.getSelectedLayoutOverlays = function () { return this.selectedLayoutOverlays; diff --git a/frontend-js/src/main/js/map/CustomMap.js b/frontend-js/src/main/js/map/CustomMap.js index 66a7fa93f2bddba5982dd6b141959fb29bfdb4dc..86759aabadc7a88a0b3830a13c8bf36c4bbd41b2 100644 --- a/frontend-js/src/main/js/map/CustomMap.js +++ b/frontend-js/src/main/js/map/CustomMap.js @@ -415,20 +415,20 @@ CustomMap.prototype.openSubmap = function (id) { // we have to perform it on top map, because on submaps id is different return this.openDataOverlay(self.getGoogleMap().getMapTypeId()).then(function () { if (!wasInitialized) { - // now we have to visualize layouts - var layouts = []; + // now we have to visualize overlays + var overlayIds = []; - // get list of layouts + // get list of overlays for (var key in self._selectedOverlays) { if (self._selectedOverlays.hasOwnProperty(key) && self._selectedOverlays[key] === true) { - layouts.push(key); + overlayIds.push(key); } } - // show layouts that should be visualized (resize or show them) - for (var i = 0; i < layouts.length; i++) { - var layoutId = layouts[i]; - submap._showSelectedDataOverlay(layoutId, i, layouts.length); + // show overlays that should be visualized (resize or show them) + for (var i = 0; i < overlayIds.length; i++) { + var overlayId = overlayIds[i]; + submap._showSelectedDataOverlay(overlayId, i, overlayIds.length); } return self.refreshMarkers(true); } @@ -482,7 +482,7 @@ CustomMap.prototype.createMapChangedCallbacks = function () { var self = this; var sessionData = ServerConnector.getSessionData(self.getProject()); - // listener for changing type of layout + // listener for changing type of background overlay google.maps.event.addListener(self.getGoogleMap(), 'maptypeid_changed', function () { sessionData.setSelectedBackgroundOverlay(self.getGoogleMap().getMapTypeId()); }); @@ -520,15 +520,15 @@ CustomMap.prototype.removeSelection = function () { }; /** - * Removes layout from visualization. + * Removes overlay from visualization. * * @param identifier - * identifier of layout to remove + * identifier of overlay to remove * */ CustomMap.prototype.hideDataOverlay = function (identifier) { var self = this; - logger.debug("Removing layout: " + identifier); + logger.debug("Hiding overlay: " + identifier); if (this._selectedOverlays[identifier] !== true) { logger.warn("Overlay " + identifier + " is not selected"); @@ -553,7 +553,7 @@ CustomMap.prototype.hideDataOverlay = function (identifier) { }; /** - * Refresh visualization of selected layouts. + * Redrawing selected overlays. */ CustomMap.prototype.redrawSelectedDataOverlays = function () { logger.debug("Redrawing overlays"); @@ -585,81 +585,81 @@ CustomMap.prototype.redrawSelectedDataOverlays = function () { }; /** - * Hides layout from the map and all submaps + * Hides overlay on the map and all submaps * - * @param layoutId - * identifier of a layout to hide + * @param overlayId + * identifier of a overlay to hide */ -CustomMap.prototype.hideSelectedLayout = function (layoutId) { - this._hideSelectedLayout(layoutId); +CustomMap.prototype.hideSelectedLayout = function (overlayId) { + this._hideSelectedLayout(overlayId); for (var i = 0; i < this.submaps.length; i++) { - this.submaps[i]._hideSelectedLayout(layoutId); + this.submaps[i]._hideSelectedLayout(overlayId); } }; /** - * Resize(refresh) layout on the map and all submaps. Resizing should be called - * when number of layouts to visualize change. + * Resize(refresh) overlay on the map and all submaps. Resizing should be called + * when number of overlays to visualize change. * - * @param layoutId - * identifier of layout to refresh + * @param overlayId + * identifier of overlay to refresh * @param index - * position of the layout in list of layouts that we visualize + * position of the overlay in list of overlays that we visualize * @param length - * number of layouts that we currently visualize + * number of overlays that we currently visualize */ -CustomMap.prototype.resizeSelectedDataOverlay = function (layoutId, index, length) { - logger.debug("Resize layout: " + layoutId); +CustomMap.prototype.resizeSelectedDataOverlay = function (overlayId, index, length) { + logger.debug("Resize overlay: " + overlayId); var promises = []; - promises.push(this._resizeSelectedDataOverlay(layoutId, index, length)); + promises.push(this._resizeSelectedDataOverlay(overlayId, index, length)); for (var i = 0; i < this.submaps.length; i++) { - promises.push(this.submaps[i]._resizeSelectedDataOverlay(layoutId, index, length)); + promises.push(this.submaps[i]._resizeSelectedDataOverlay(overlayId, index, length)); } return Promise.all(promises); }; /** - * Show layout on the map and all submaps. + * Show overlay on the map and all submaps. * - * @param layoutId - * identifier of layout to show + * @param overlayId + * identifier of overlay to show * @param index - * position of the layout in list of layouts that we visualize + * position of the overlay in list of overlays that we visualize * @param length - * number of layouts that we currently visualize + * number of overlays that we currently visualize */ -CustomMap.prototype.showSelectedDataOverlay = function (layoutId, index, length) { - logger.debug("Resize layout: " + layoutId); +CustomMap.prototype.showSelectedDataOverlay = function (overlayId, index, length) { + logger.debug("Show overlay: " + overlayId); var promises = []; - promises.push(this._showSelectedDataOverlay(layoutId, index, length)); + promises.push(this._showSelectedDataOverlay(overlayId, index, length)); for (var i = 0; i < this.submaps.length; i++) { - promises.push(this.submaps[i]._showSelectedDataOverlay(layoutId, index, length)); + promises.push(this.submaps[i]._showSelectedDataOverlay(overlayId, index, length)); } return Promise.all(promises); }; /** - * This method checks if the layout contains any overlays (like AliasSurface or + * This method checks if the overlay contains any overlays (like AliasSurface or * ReactionSurface) that is currently visible on the map. * - * @param layoutId - * identifier of the layout - * @returns {Boolean}: <code>true</code> if the layout contains overlays to + * @param overlayId + * identifier of the overlay + * @returns {Boolean}: <code>true</code> if the overlay contains overlays to * visualize, <code>false</code> otherwise */ -CustomMap.prototype.layoutContainsOverlays = function (layoutId) { +CustomMap.prototype.layoutContainsOverlays = function (overlayId) { // first, check top map - if (this.selectedLayoutOverlays.hasOwnProperty(layoutId) && this.selectedLayoutOverlays[layoutId].length > 0) { + if (this.selectedLayoutOverlays.hasOwnProperty(overlayId) && this.selectedLayoutOverlays[overlayId].length > 0) { return true; } // now check all submaps for (var i = 0; i < this.submaps.length; i++) { if (this.submaps[i].initialized) { - if (this.submaps[i].selectedLayoutOverlays.hasOwnProperty(layoutId) - && this.submaps[i].selectedLayoutOverlays[layoutId].length > 0) { + if (this.submaps[i].selectedLayoutOverlays.hasOwnProperty(overlayId) + && this.submaps[i].selectedLayoutOverlays[overlayId].length > 0) { return true; } } diff --git a/frontend-js/src/main/js/map/data/DataOverlay.js b/frontend-js/src/main/js/map/data/DataOverlay.js index 3231fc430dbb0c520ef019ff3108a5a0c4d2c7fb..a859fe054c2e50dd300201a31b05280bcecc4803 100644 --- a/frontend-js/src/main/js/map/data/DataOverlay.js +++ b/frontend-js/src/main/js/map/data/DataOverlay.js @@ -8,14 +8,14 @@ var LayoutReaction = require('./LayoutReaction'); var logger = require('../../logger'); /** - * Class representing data in a specific layout. + * Class representing data in a specific overlay. */ -function DataOverlay(layoutId, name) { +function DataOverlay(overlayId, name) { this.setInitialized(false); if (name === undefined) { // from json structure - var object = layoutId; + var object = overlayId; this.setId(object.idObject); this.setOrder(object.order); this.setName(object.name); @@ -33,7 +33,7 @@ function DataOverlay(layoutId, name) { } } else { // default two param call - this.setId(layoutId); + this.setId(overlayId); this.setName(name); } this.aliases = []; @@ -44,22 +44,22 @@ function DataOverlay(layoutId, name) { /** * Adds alias to the {@link DataOverlay} * - * @param layoutAlias - * information about alias in a layout + * @param overlayAlias + * information about alias in the overlay */ -DataOverlay.prototype.addAlias = function (layoutAlias) { - this.aliases.push(layoutAlias); - this.aliasById[layoutAlias.getId()] = layoutAlias; +DataOverlay.prototype.addAlias = function (overlayAlias) { + this.aliases.push(overlayAlias); + this.aliasById[overlayAlias.getId()] = overlayAlias; }; /** * Adds reaction to the {@link DataOverlay} * - * @param layoutReaction - * information about reaction in a layout + * @param overlayReaction + * information about reaction in the overlay */ -DataOverlay.prototype.addReaction = function (layoutReaction) { - this.reactions.push(layoutReaction); +DataOverlay.prototype.addReaction = function (overlayReaction) { + this.reactions.push(overlayReaction); }; DataOverlay.prototype.getId = function () { @@ -126,11 +126,11 @@ DataOverlay.prototype.setImagesDirectory = function (imagesDirectory) { this._imagesDirectory = imagesDirectory; }; -DataOverlay.prototype.updateAlias = function (layoutAlias) { - if (this.aliasById[layoutAlias.getId()] === undefined) { - logger.warn("Cannot update alias, it doesn't exist. Alias: ", layoutAlias.getId()); +DataOverlay.prototype.updateAlias = function (overlayAlias) { + if (this.aliasById[overlayAlias.getId()] === undefined) { + logger.warn("Cannot update alias, it doesn't exist. Alias: ", overlayAlias.getId()); } else { - this.aliasById[layoutAlias.getId()].update(layoutAlias); + this.aliasById[overlayAlias.getId()].update(overlayAlias); } }; diff --git a/frontend-js/src/main/js/map/data/LayoutAlias.js b/frontend-js/src/main/js/map/data/LayoutAlias.js index 7527d6ec9543f81478cd64890e107fedf260c307..d41d52b7bc5f173f05a86fd859876b6fafb04646 100644 --- a/frontend-js/src/main/js/map/data/LayoutAlias.js +++ b/frontend-js/src/main/js/map/data/LayoutAlias.js @@ -3,8 +3,8 @@ var GeneVariant = require('./GeneVariant'); /** - * Class representing alias visualized in a layout. - * + * Class representing alias visualized in a overlay. + * * @param javaObject * object de-serialized ajax query to the server side */ @@ -21,7 +21,7 @@ function LayoutAlias(javaObject) { } else if (javaObject.type === LayoutAlias.GENERIC) { this.setType(LayoutAlias.GENERIC); } else { - throw new Error("Unknown type: ", javaObject.type); + throw new Error("Unknown type: " + javaObject.type); } this.setGeneVariants([]); @@ -36,55 +36,55 @@ LayoutAlias.LIGHT = "LIGHT"; LayoutAlias.GENETIC_VARIANT = "GENETIC_VARIANT"; LayoutAlias.GENERIC = "GENERIC"; -LayoutAlias.prototype.getId = function() { +LayoutAlias.prototype.getId = function () { return this.id; }; -LayoutAlias.prototype.setId = function(id) { +LayoutAlias.prototype.setId = function (id) { this.id = parseInt(id); }; -LayoutAlias.prototype.getModelId = function() { +LayoutAlias.prototype.getModelId = function () { return this._modelId; }; -LayoutAlias.prototype.setModelId = function(modelId) { +LayoutAlias.prototype.setModelId = function (modelId) { this._modelId = parseInt(modelId); }; -LayoutAlias.prototype.getValue = function() { +LayoutAlias.prototype.getValue = function () { return this.value; }; -LayoutAlias.prototype.getColor = function() { +LayoutAlias.prototype.getColor = function () { return this.color; }; -LayoutAlias.prototype.getType = function() { +LayoutAlias.prototype.getType = function () { return this._type; }; -LayoutAlias.prototype.getGeneVariants = function() { +LayoutAlias.prototype.getGeneVariants = function () { return this._geneVariants; }; -LayoutAlias.prototype.setValue = function(newValue) { +LayoutAlias.prototype.setValue = function (newValue) { this.value = newValue; }; -LayoutAlias.prototype.setColor = function(newColor) { +LayoutAlias.prototype.setColor = function (newColor) { this.color = newColor; }; -LayoutAlias.prototype.setType = function(newType) { +LayoutAlias.prototype.setType = function (newType) { this._type = newType; }; -LayoutAlias.prototype.setGeneVariants = function(newGeneVariants) { +LayoutAlias.prototype.setGeneVariants = function (newGeneVariants) { this._geneVariants = newGeneVariants; }; -LayoutAlias.prototype.update = function(alias) { +LayoutAlias.prototype.update = function (alias) { if (!(alias instanceof LayoutAlias)) { throw new Error("Unknown parameter type: " + alias); } @@ -96,15 +96,15 @@ LayoutAlias.prototype.update = function(alias) { this.setDescription(alias.getDescription()); }; -LayoutAlias.prototype.addGeneVariant = function(geneVariant) { +LayoutAlias.prototype.addGeneVariant = function (geneVariant) { this._geneVariants.push(geneVariant); }; -LayoutAlias.prototype.getDescription = function() { +LayoutAlias.prototype.getDescription = function () { return this._description; }; -LayoutAlias.prototype.setDescription = function(description) { +LayoutAlias.prototype.setDescription = function (description) { this._description = description; }; diff --git a/frontend-js/src/main/js/map/data/LayoutReaction.js b/frontend-js/src/main/js/map/data/LayoutReaction.js index 58d3dfd3b64e616f84b4b6cc23adee03510c3624..4026262f1371b037036a02890a46d9f2e4d55802 100644 --- a/frontend-js/src/main/js/map/data/LayoutReaction.js +++ b/frontend-js/src/main/js/map/data/LayoutReaction.js @@ -1,7 +1,7 @@ "use strict"; /** - * Class representing reaction visualized in a layout. + * Class representing reaction visualized in a overlay. * * @param javaObject * object de-serialized from ajax query to the server side diff --git a/frontend-js/src/main/js/map/surface/AbstractSurfaceElement.js b/frontend-js/src/main/js/map/surface/AbstractSurfaceElement.js index a161dca5d6494cb96bfaa3a38014e807f9d32a2f..fd58a218b009deaeca57dddefcd4e934880baa29 100644 --- a/frontend-js/src/main/js/map/surface/AbstractSurfaceElement.js +++ b/frontend-js/src/main/js/map/surface/AbstractSurfaceElement.js @@ -6,7 +6,7 @@ var ObjectWithListeners = require('../../ObjectWithListeners'); /** * Class representing abstract overlay element on the map relevant for a - * specific layout. + * specific overlay. */ function AbstractSurfaceElement(params) { var self = this; diff --git a/frontend-js/src/main/js/map/surface/AliasSurface.js b/frontend-js/src/main/js/map/surface/AliasSurface.js index 888a7980f139b6afadc2d54b9b07dea8a19c78bf..2aba79b1b4b7c05eb39b9ea80ed4a016b224e08d 100644 --- a/frontend-js/src/main/js/map/surface/AliasSurface.js +++ b/frontend-js/src/main/js/map/surface/AliasSurface.js @@ -72,7 +72,7 @@ AliasSurface.prototype.setBoundsForAlias = function (startX, endX) { * <li>map - {@link AbstractCustomMap} where overlay should be placed * <li> startX - this is the ratio on OX axis that should be use as a * starting point of the overlay. For instance when there are three - * layouts to visualize then + * overlays to visualize then * <ul> * <li>the first layout have startX=0.0; endX=0.33333</li> * <li>second layout have startX=0.33333; endX=0.66666</li> diff --git a/frontend-js/src/main/js/map/surface/ReactionSurface.js b/frontend-js/src/main/js/map/surface/ReactionSurface.js index 58748537d193ee03bb53accf1092483d5653f6a2..1d93d2ec71ea843d916f55e4abb01fd950a84329 100644 --- a/frontend-js/src/main/js/map/surface/ReactionSurface.js +++ b/frontend-js/src/main/js/map/surface/ReactionSurface.js @@ -10,22 +10,6 @@ var logger = require('../../logger'); var AbstractSurfaceElement = require('./AbstractSurfaceElement'); var IdentifiedElement = require('../data/IdentifiedElement'); -/** - * Class representing overlay of the reaction on the map relevant for a specific - * layout. - * - * @param layoutReaction - * {@link LayoutReaction} for which overlay is created - * @param reactionData - * {@link Reaction data} of the reaction - * @param map - * {@link AbstractCustomMap} where overlay should be placed - * @param customized - * if true then coloring from layoutReaction is taken, if false then - * default is used. Second option is used when more than one layout is - * visualized (there is no simple way to visualize few layouts at the - * same time) - */ function ReactionSurface(params) { // call super constructor AbstractSurfaceElement.call(this, params); @@ -132,9 +116,9 @@ ReactionSurface.prototype.getWidth = function () { }; /** - * This function is used when some layouts are added/removed from visualization. + * This function is used when some overlays are added/removed from visualization. * The syntax is compatible with AliasSurface class so they can be handled in - * the same way. When visualizing more than one layout startX or endX will be + * the same way. When visualizing more than one overlay startX or endX will be * set to a value between 0..1 (not inclusive). In such case the visualization * of reaction should turn to some default mode where we know that reaction is * highlighted, but we have no more information. In this way user will know that @@ -143,12 +127,12 @@ ReactionSurface.prototype.getWidth = function () { * @param startX * see {AliasSurface} class for details, in this implementation the * only important information is that when there are more than one - * layout visualized at least one of the two parameters (startX,endX) + * overlay visualized at least one of the two parameters (startX,endX) * will differ from {0.0, 1.0} values * @param endX * see {AliasSurface} class for details, in this implementation the * only important information is that when there are more than one - * layout visualized at least one of the two parameters (startX,endX) + * overlay visualized at least one of the two parameters (startX,endX) * will differ from {0.0, 1.0} values */ ReactionSurface.prototype.setBoundsForAlias = function (startX, endX) { @@ -161,7 +145,7 @@ ReactionSurface.prototype.setBoundsForAlias = function (startX, endX) { /** * Changes visualization of the ReactionSurface to default mode where we mark - * reaction as highlighted, but we skip customized reaction layout data. + * reaction as highlighted, but we skip customized reaction overlay data. */ ReactionSurface.prototype.changedToDefault = function () { for (var i = 0; i < this.getGoogleMapObjects().length; i++) { @@ -175,7 +159,7 @@ ReactionSurface.prototype.changedToDefault = function () { /** * Changes visualization of the ReactionSurface to customized mode where we mark - * reaction as highlighted with customized reaction layout data. + * reaction as highlighted with customized reaction overlay data. */ ReactionSurface.prototype.changedToCustomized = function () { for (var i = 0; i < this.getGoogleMapObjects().length; i++) { diff --git a/frontend-js/src/main/js/map/window/AliasInfoWindow.js b/frontend-js/src/main/js/map/window/AliasInfoWindow.js index 7edbbd32bd8b25d20a6865be01c67e4a975a03e3..bae098392d7fc16b15a8c3b579c855ad86f84dac 100644 --- a/frontend-js/src/main/js/map/window/AliasInfoWindow.js +++ b/frontend-js/src/main/js/map/window/AliasInfoWindow.js @@ -68,10 +68,10 @@ AliasInfoWindow.prototype.init = function () { /** * Creates and returns chart representing data related to alias on different - * layouts. + * overlays. * * @returns {String} html string representing chart with data related to alias - * on different layouts + * on different overlays */ AliasInfoWindow.prototype.createChartDiv = function () { var result = document.createElement("div"); @@ -184,9 +184,9 @@ AliasInfoWindow.prototype.createContentDiv = function () { title.innerHTML = alias.getType() + ": " + alias.getName(); result.appendChild(title); - var layoutsDiv = document.createElement("div"); + var overlayDiv = document.createElement("div"); - result.appendChild(layoutsDiv); + result.appendChild(overlayDiv); return self.getCustomMap().getAliasVisibleLayoutsData(alias.getId()).then(function (layoutAliases) { self.layoutAliases = layoutAliases; @@ -198,10 +198,10 @@ AliasInfoWindow.prototype.createContentDiv = function () { } return self.createChartDiv(); }).then(function (chartDiv) { - layoutsDiv.appendChild(chartDiv); + overlayDiv.appendChild(chartDiv); return self.createGenomicDiv(); }).then(function (genomicDiv) { - layoutsDiv.appendChild(genomicDiv); + overlayDiv.appendChild(genomicDiv); return result; }); } else { @@ -331,7 +331,7 @@ AliasInfoWindow.prototype.createGenomicDiv = function () { name: self.layoutNames[iter] + ' - Variants', options: { variantHeightByFrequency: true - }, + } }); } } diff --git a/frontend-js/src/test/js/minerva-test.js b/frontend-js/src/test/js/minerva-test.js index 038a8b0a54fd7bd49e74dd0763c18a722d3ac2d2..1a149f451c1750d1d9f43924c1d8f33993f926b7 100644 --- a/frontend-js/src/test/js/minerva-test.js +++ b/frontend-js/src/test/js/minerva-test.js @@ -125,8 +125,8 @@ describe('minerva global', function () { }); }); - it('create with layout', function () { - var layout, project, plugin, map; + it('create with overlay', function () { + var overlay, project, plugin, map; return ServerConnectorMock.getProject().then(function (result) { project = result; var options = helper.createCustomMapOptions(project); @@ -134,9 +134,9 @@ describe('minerva global', function () { plugin = new ProxyAccessPlugin({}); options.getPlugins().push(plugin); - layout = project.getDataOverlays()[1]; + overlay = project.getDataOverlays()[1]; - helper.setUrl("http://test/?layout=" + layout.getName()); + helper.setUrl("http://test/?layout=" + overlay.getName()); return minerva.create(options); }).then(function (result) { @@ -147,7 +147,7 @@ describe('minerva global', function () { }).then(function (visibleDataOverlays) { // input file is available so it's not the background file but overlay assert.equal(visibleDataOverlays.length, 0); - assert.equal(ServerConnectorMock.getSessionData(project).getSelectedBackgroundOverlay(), layout.getId()); + assert.equal(ServerConnectorMock.getSessionData(project).getSelectedBackgroundOverlay(), overlay.getId()); assert.equal(logger.getWarnings().length, 0); return map.destroy(); }); diff --git a/model/src/main/java/lcsb/mapviewer/model/user/PrivilegeType.java b/model/src/main/java/lcsb/mapviewer/model/user/PrivilegeType.java index be5c1fe1220fc167f988761be1372ee0f4a965f9..b214a50ab832d9ca984fe23612d4a8fd5b2034d6 100644 --- a/model/src/main/java/lcsb/mapviewer/model/user/PrivilegeType.java +++ b/model/src/main/java/lcsb/mapviewer/model/user/PrivilegeType.java @@ -39,12 +39,12 @@ public enum PrivilegeType { /** * User can have custom layouts (access level defines how many). */ - CUSTOM_LAYOUTS(BasicPrivilege.class, null, "Custom layouts", true), + CUSTOM_LAYOUTS(BasicPrivilege.class, null, "Custom overlays", true), /** * User can view non-public layout. */ - LAYOUT_VIEW(ObjectPrivilege.class, Layout.class, "View layout"), + LAYOUT_VIEW(ObjectPrivilege.class, Layout.class, "View overlay"), /** * User can manage configuration. @@ -54,7 +54,7 @@ public enum PrivilegeType { /** * User can manage layouts of all users in the project. */ - LAYOUT_MANAGEMENT(ObjectPrivilege.class, Project.class, "Manage layouts"), // + LAYOUT_MANAGEMENT(ObjectPrivilege.class, Project.class, "Manage overlays"), // /** * User can manage reference genomes.