diff --git a/js/API/LatticeAPI.js b/js/API/LatticeAPI.js index 7bed5afdefd6e573167f9c384982c0ca87b2a753..fe6248ec5b669e2e590e92b43cccf246323a0c72 100644 --- a/js/API/LatticeAPI.js +++ b/js/API/LatticeAPI.js @@ -31,7 +31,7 @@ define(['lattice', 'plist'], function(lattice, plist){ }, getApplicationType: function(){ - return lattice.get("latticeType"); + return lattice.get("applicationType"); }, getPartType: function(){ @@ -76,7 +76,7 @@ define(['lattice', 'plist'], function(lattice, plist){ console.warn("no application type " + applicationType + " for cell type " + plistCellData.name + " and connection type " + plistConnectionData.name); return; } - return lattice.set("latticeType", applicationType); + return lattice.set("applicationType", applicationType); }, setPartType: function(partType){ @@ -84,7 +84,7 @@ define(['lattice', 'plist'], function(lattice, plist){ var plistCellData = plist.allLattices[cellType]; var connectionType = lattice.get("connectionType"); var plistConnectionData = plistCellData[connectionType]; - var applicationType = lattice.get("latticeType"); + var applicationType = lattice.get("applicationType"); var plistAppData = plistConnectionData[applicationType]; if (plistConnectionData[applicationType] === undefined){ console.warn("no part type " + partType + " for cell type " + plistCellData.name + " and connection type " + plistConnectionData.name + " and application type " + plistAppData.name); diff --git a/js/cells/supercells/GIKSuperCell.js b/js/cells/supercells/GIKSuperCell.js index dfda8f2845c5bf40a0c5ae3f2b9888fdfda6c3b6..45705e9f64d4a803cc377cd1a227ad5d512e3206 100644 --- a/js/cells/supercells/GIKSuperCell.js +++ b/js/cells/supercells/GIKSuperCell.js @@ -30,7 +30,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell', GIKSuperCell.prototype._makeSubCellForIndex = function(json, callback){ json.materialID = this.material.getID(); - if (lattice.get("latticeType") == "dnaBricks"){ + if (lattice.get("applicationType") == "dnaBricks"){ callback(new DNABrickCell(json, this)); return; } diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index 02c91353ee18929811db1eeb62e3abbe3c85e20a..ccca998de4d16aa83a798005f45bf2e13bd1db69 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -15,7 +15,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'materialsPlis cellType: "cube", connectionType: "gik", - latticeType: "willGik", + applicationType: "willGik", partType: null, aspectRatio: null, @@ -39,8 +39,8 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'materialsPlis this._connectionTypeChanged(); this.reloadCells(); }); - this.listenTo(this, "change:latticeType", function(){ - this._latticeTypeChanged(); + this.listenTo(this, "change:applicationType", function(){ + this._applicationTypeChanged(); this.reloadCells(); }); this.listenTo(this, "change:aspectRatio", function(){ @@ -52,7 +52,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'materialsPlis this.updateThreeViewTarget(); }); - this._latticeTypeChanged(); + this._applicationTypeChanged(); this.reloadCells(); }, @@ -77,12 +77,12 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'materialsPlis _connectionTypeChanged: function(){ var cellType = this.get("cellType"); var connectionType = this.get("connectionType"); - var latticeType = _.keys(plist.allLattices[cellType].connection[connectionType].type)[0]; - this.set("latticeType", latticeType, {silent:true}); - this._latticeTypeChanged(); + var appType = _.keys(plist.allLattices[cellType].connection[connectionType].type)[0]; + this.set("applicationType", appType, {silent:true}); + this._applicationTypeChanged(); }, - _latticeTypeChanged: function(){ + _applicationTypeChanged: function(){ var latticeData = this._getLatticePlistData(); this.set("aspectRatio", latticeData.aspectRatio.clone(), {silent:true}); diff --git a/js/lattice/LatticeBase.js b/js/lattice/LatticeBase.js index 91048b29f2bf03519083e6c0a7c40635baa22ba3..b3e6938b9af8400be3ddc5c3ec4765d5acb8de3d 100644 --- a/js/lattice/LatticeBase.js +++ b/js/lattice/LatticeBase.js @@ -40,7 +40,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre //lattice type _getLatticePlistData: function(){ - return plist.allLattices[this.get("cellType")].connection[this.get("connectionType")].type[this.get("latticeType")]; + return plist.allLattices[this.get("cellType")].connection[this.get("connectionType")].type[this.get("applicationType")]; }, reloadCells: function(cells, subclass){ diff --git a/js/menus/MenuWrapperView.js b/js/menus/MenuWrapperView.js index 193b720d42c694422fcf65182937b467bc22f103..2136e9314a0f0ef1e226723043b9bf3a8c5643b4 100644 --- a/js/menus/MenuWrapperView.js +++ b/js/menus/MenuWrapperView.js @@ -36,7 +36,7 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice', 'appState', 'tex if (this.currentNav == this.model.get("currentNav")) return; this.render(); }); - this.listenTo(lattice, "change:cellType change:connectionType change:latticeType", this._populateAndShow); + this.listenTo(lattice, "change:cellType change:connectionType change:applicationType", this._populateAndShow); this.listenTo(this.model, "change:currentTab", function(){ if (this.currentTab == this.model.get("currentTab")) return; if (!this.model.changedAttributes() || this.model.changedAttributes()["currentNav"]) return; diff --git a/js/menus/Ribbon.js b/js/menus/Ribbon.js index ec73dab52ac137f553ae0fc381e740580de895e7..a9223d000298b6220f2c769ee6a2e2379dbcdeb6 100644 --- a/js/menus/Ribbon.js +++ b/js/menus/Ribbon.js @@ -25,7 +25,7 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice', 'appState', 'tex this.listenTo(this.model, "change:deleteMode", this.render); this.listenTo(this.model, "change:highlightMode", this.render); this.listenTo(this.model, "change:axesAreVisible", this.render); - this.listenTo(lattice, "change:cellType change:connectionType change:latticeType", this.render); + this.listenTo(lattice, "change:cellType change:connectionType change:applicationType", this.render); this.render(); }, diff --git a/js/menus/templates/ESetupMenuView.html b/js/menus/templates/ESetupMenuView.html index 62abd20c319218851ae28c4df4310757326a2580..76f87236a9813ee2174f758ea3e8f41146e4c3a3 100644 --- a/js/menus/templates/ESetupMenuView.html +++ b/js/menus/templates/ESetupMenuView.html @@ -5,7 +5,7 @@ Simulation Type: <div class="btn-group"> <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allMaterialClasses[materialClass] %><span class="caret"></span></button> <ul role="menu" class="dropdown-menu"> - <% _.each(allLattices[cellType].connection[connectionType].type[latticeType].materialClasses || _.keys(allMaterialClasses), function(key){ %> + <% _.each(allLattices[cellType].connection[connectionType].type[applicationType].materialClasses || _.keys(allMaterialClasses), function(key){ %> <li><a class="appState dropdownSelector" data-property="materialClass" data-value="<%= key %>" href="#"><%= allMaterialClasses[key] %></a></li> <% }); %> </ul> diff --git a/js/menus/templates/LatticeMenuView.html b/js/menus/templates/LatticeMenuView.html index c57e9d86e18dc8394d650e085cd3373af1aea0df..c568f1599e842195d2362f5f9e74596ea8f9bf03 100644 --- a/js/menus/templates/LatticeMenuView.html +++ b/js/menus/templates/LatticeMenuView.html @@ -18,19 +18,19 @@ Cell Connection: </div><br/><br/> Type: <div class="btn-group"> - <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allLattices[cellType].connection[connectionType].type[latticeType].name %><span class="caret"></span></button> + <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allLattices[cellType].connection[connectionType].type[applicationType].name %><span class="caret"></span></button> <ul role="menu" class="dropdown-menu"> - <% _.each(allLattices[cellType].connection[connectionType].type, function(latticeTypeData, key){ %> - <li><a class="lattice dropdownSelector" data-property="latticeType" data-value="<%= key %>" href="#"><%= latticeTypeData.name %></a></li> + <% _.each(allLattices[cellType].connection[connectionType].type, function(appTypeData, key){ %> + <li><a class="lattice dropdownSelector" data-property="applicationType" data-value="<%= key %>" href="#"><%= appTypeData.name %></a></li> <% }); %> </ul> </div><br/><br/> -<% if(allLattices[cellType].connection[connectionType].type[latticeType].parts){ %> +<% if(allLattices[cellType].connection[connectionType].type[applicationType].parts){ %> Part Type: <div class="btn-group"> - <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allLattices[cellType].connection[connectionType].type[latticeType].parts[partType].name %><span class="caret"></span></button> + <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allLattices[cellType].connection[connectionType].type[applicationType].parts[partType].name %><span class="caret"></span></button> <ul role="menu" class="dropdown-menu"> - <% _.each(allLattices[cellType].connection[connectionType].type[latticeType].parts, function(val, key){ %> + <% _.each(allLattices[cellType].connection[connectionType].type[applicationType].parts, function(val, key){ %> <li><a class="lattice dropdownSelector" data-property="partType" data-value="<%= key %>" href="#"><%= val.name %></a></li> <% }); %> </ul> diff --git a/js/menus/templates/MSetupMenuView.html b/js/menus/templates/MSetupMenuView.html index 8375962cae072756a1e342dbdc48d4bca7ec3831..3d7e19b4e176f131ef075ad6e91c52fe3c4af7f3 100644 --- a/js/menus/templates/MSetupMenuView.html +++ b/js/menus/templates/MSetupMenuView.html @@ -2,7 +2,7 @@ Simulation Type: <div class="btn-group"> <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allMaterialClasses[materialClass] %><span class="caret"></span></button> <ul role="menu" class="dropdown-menu"> - <% _.each(allLattices[cellType].connection[connectionType].type[latticeType].materialClasses || _.keys(allMaterialClasses), function(key){ %> + <% _.each(allLattices[cellType].connection[connectionType].type[applicationType].materialClasses || _.keys(allMaterialClasses), function(key){ %> <li><a class="appState dropdownSelector" data-property="materialClass" data-value="<%= key %>" href="#"><%= allMaterialClasses[key] %></a></li> <% }); %> </ul> diff --git a/js/menus/templates/MaterialMenuView.html b/js/menus/templates/MaterialMenuView.html index 2306310cd1093ca496704878b7aa4e4bef6348fa..04565702c5533dbbe0317a77e49eac04acc4bcbd 100644 --- a/js/menus/templates/MaterialMenuView.html +++ b/js/menus/templates/MaterialMenuView.html @@ -3,7 +3,7 @@ <div class="btn-group"> <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allMaterialClasses[materialClass] %><span class="caret"></span></button> <ul role="menu" class="dropdown-menu"> - <% _.each(allLattices[cellType].connection[connectionType].type[latticeType].materialClasses || _.keys(allMaterialClasses), function(key){ %> + <% _.each(allLattices[cellType].connection[connectionType].type[applicationType].materialClasses || _.keys(allMaterialClasses), function(key){ %> <li><a class="appState dropdownSelector" data-property="materialClass" data-value="<%= key %>" href="#"><%= allMaterialClasses[key] %></a></li> <% }); %> </ul> diff --git a/js/menus/templates/MenuWrapperView.html b/js/menus/templates/MenuWrapperView.html index 2ce0aa289e4cedfcc33720560e0f12c558207307..f7d0b40e7371b49f7f64bb1132dd93cc0dae28a9 100644 --- a/js/menus/templates/MenuWrapperView.html +++ b/js/menus/templates/MenuWrapperView.html @@ -1,6 +1,6 @@ <ul class="nav nav-tabs nav-justified"> <% _.each(allMenus[currentNav].tabs, function(tabName, key){ - if (key == "part" && allLattices[cellType].connection[connectionType].type[latticeType].parts === null) return; %> + if (key == "part" && allLattices[cellType].connection[connectionType].type[applicationType].parts === null) return; %> <li role="presentation" class="menuWrapperTab" data-name="<%= key %>"><a href="#"><%= tabName %></a></li> <% }); %> </ul> \ No newline at end of file diff --git a/js/menus/templates/NavViewMenu.html b/js/menus/templates/NavViewMenu.html index c1f0f9dba4147b64fefa6218a1a2f2a02eb444a2..af4595ddcceec10d9d4316d8ae60c9e3e922a994 100644 --- a/js/menus/templates/NavViewMenu.html +++ b/js/menus/templates/NavViewMenu.html @@ -29,7 +29,7 @@ <a tabindex="-1">Cells<span class="pull-right fui-arrow-right"></span></a> <ul class="dropdown-menu"> <% _.each(allCellModes, function(mode, key){ - if (key == "part" && allLattices[cellType].connection[connectionType].type[latticeType].parts === null) return; %> + if (key == "part" && allLattices[cellType].connection[connectionType].type[applicationType].parts === null) return; %> <li><a class="appState" data-property="cellMode" data-value="<%= key %>" href="#"><% if (cellMode == key) { %><span class="fui-check"></span><% } %><%= mode %></a></li> <% }); %> </ul> diff --git a/js/menus/templates/PartMenuView.html b/js/menus/templates/PartMenuView.html index 329494f3d8819f2a18261b2b8d2c5a4f38efbbf4..b8c6030b50e9f4da7a04c5bded6555a174105a65 100644 --- a/js/menus/templates/PartMenuView.html +++ b/js/menus/templates/PartMenuView.html @@ -1,4 +1,4 @@ -<% var latticeData = allLattices[cellType].connection[connectionType].type[latticeType]; %> +<% var latticeData = allLattices[cellType].connection[connectionType].type[applicationType]; %> Part Type: <div class="btn-group"> <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= latticeData.parts[partType].name %><span class="caret"></span></button> diff --git a/js/menus/templates/Ribbon.html b/js/menus/templates/Ribbon.html index 0fee241406ab026a63a22c94b6a7434af13d8052..6ce50d483f94664b0e575071f8dae4379b2a7b24 100644 --- a/js/menus/templates/Ribbon.html +++ b/js/menus/templates/Ribbon.html @@ -3,7 +3,7 @@ <div class="btn-group"> <a data-type="supercell" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "supercell"){ %> ribbon-selected<% } %>" href="#"><img data-type="supercell" src="assets/imgs/super-sm.png"></a> <a data-type="cell" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "cell"){ %> ribbon-selected<% } %>" href="#"><img data-type="cell" src="assets/imgs/cell-sm.png"></a> - <% if (allLattices[cellType].connection[connectionType].type[latticeType].parts){ %> + <% if (allLattices[cellType].connection[connectionType].type[applicationType].parts){ %> <a data-type="part" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "part"){ %> ribbon-selected<% } %>" href="#"><img data-type="part" src="assets/imgs/part-sm.png"></a> <% } %> <!--<a data-type="beam" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "beam"){ %> ribbon-selected<% } %>" href="#">Beam</a>--> diff --git a/js/models/AppState.js b/js/models/AppState.js index 5ff1d306d98c97e07919781ca14f39c101bd48b6..e07abab9844b6d64e1004a6de19547a5f9a19da8 100644 --- a/js/models/AppState.js +++ b/js/models/AppState.js @@ -290,7 +290,7 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], if (this.lattice.get("connectionType") != "gik") break; if (state) { var val = e.keyCode-48; - var range = plist.allLattices[this.lattice.get("cellType")].connection[this.lattice.get("connectionType")].type[this.lattice.get("latticeType")].options.gikRange; + var range = plist.allLattices[this.lattice.get("cellType")].connection[this.lattice.get("connectionType")].type[this.lattice.get("applicationType")].options.gikRange; if (range){ if ((range[0] > 0 && val < range[0]) || (range[1] > 1 && val > range[1])){ console.warn("gik length out of range"); diff --git a/js/plists/PList.js b/js/plists/PList.js index ab9994e83821dca54b6b638de4419881139a785a..cfc71501eba9bef19d7776ca30f6c8199837a8ce 100644 --- a/js/plists/PList.js +++ b/js/plists/PList.js @@ -106,13 +106,13 @@ define(['three'], function(THREE){ dnabricks: { cellType: "cube", connectionType: "gik", - latticeType: "willGik", + applicationType: "willGik", partType: null }, electronics: { cellType: "cube", connectionType: "gik", - latticeType: "dnaBricks", + applicationType: "dnaBricks", partType: null } },