Changeset 21:3cc449a6b75e for source/class
- Timestamp:
- Dec 26, 2007, 5:44:01 PM (17 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/class/pf/Application.js
r20 r21 947 947 }, 948 948 949 /** 950 * TODOC 951 * 952 * @type member 953 * @param e {Event} TODOC 954 * @return {void} 955 */ 956 main : function(e) 957 { 958 this.base(arguments); 959 960 // Define alias for custom resource path 961 qx.io.Alias.getInstance().add("pf", 962 qx.core.Setting.get("pf.resourceUri")); 963 964 // Defaults 965 966 this.r = new pf.base.Species("r", 1.0, 0, 0, 1.0, null); 967 this.e = new pf.base.Species("e", (1.0/1836.2), -1, 1e16, 1.0, this.r); 968 this.i = new pf.base.Species("i", 1.0, +1, 1e16, 1.0, this.r); 969 970 this.P_r = 0; 971 972 this.B = 0; 973 974 this.n_u = 2; 975 this.n_l = 1; 976 977 if (this.updatePlasmaParameters() != true) { 978 alert("Error!"); 979 } 980 981 // Favorites 982 this.favorites = new Array; 983 984 // Top-level container 985 this.bl_top = new qx.ui.layout.VerticalBoxLayout("vertical"); 986 this.bl_top.setWidth("100%"); 987 this.bl_top.setHeight("auto"); 988 989 this.bl_top.addToDocument(); 990 991 992 // The toolbar 993 var tb = new qx.ui.toolbar.ToolBar; 994 this.bl_top.add(tb); 995 996 // ... and the buttons themselves 997 998 var sep = new qx.ui.toolbar.Separator; 999 tb.add(sep); 1000 1001 var btn = new qx.ui.toolbar.Button("About..."); 1002 tb.add(btn); 1003 // btn.addEventListener("execute", this.aboutCB, this); 1004 1005 var tf1 = new qx.ui.pageview.tabview.TabView; 1006 this.bl_top.add(tf1); 1007 1008 this.tabbar = tf1.getBar(); 1009 this.tabpane = tf1.getPane(); 1010 this.tabpane.setPadding(0, 0, 0, 0); 1011 949 renderTabPage : function(label, icon, checked) 950 { 1012 951 var tab_id, page_id; 1013 var fr, gl; 1014 var l, e; 1015 1016 var tab_id = new qx.ui.pageview.tabview.Button("Parameters", 1017 "pf/image/tab-parameters.png"); 952 953 tab_id = new qx.ui.pageview.tabview.Button(label, icon); 1018 954 this.tabbar.add(tab_id); 1019 955 page_id = new qx.ui.pageview.tabview.Page(tab_id); … … 1023 959 this.tabpane.add(page_id); 1024 960 961 if (checked) { 962 tab_id.setChecked(true); 963 } 964 965 return page_id; 966 }, 967 968 renderParametersTab : function() 969 { 970 var page_id = this.renderTabPage("Parameters", 971 "pf/image/tab-parameters.png", true); 972 973 var fr, gl; 974 1025 975 fr = new qx.ui.groupbox.GroupBox("Electrons", 1026 976 "pf/image/e_small.png"); … … 1041 991 1042 992 fr.add(gl); 993 994 var l, e; 1043 995 1044 996 // N_e … … 1243 1195 gl.add(e, 1, 2); 1244 1196 e.addEventListener("change", changeN_l, this); 1245 1246 tab_id.setChecked(true); 1247 1248 1249 tab_id = new qx.ui.pageview.tabview.Button("Explorer",1197 }, 1198 1199 renderExplorerTab : function() 1200 { 1201 var page_id = this.renderTabPage("Explorer", 1250 1202 "pf/image/tab-explorer.png"); 1251 this.tabbar.add(tab_id);1252 page_id = new qx.ui.pageview.tabview.Page(tab_id);1253 page_id.setHeight("auto");1254 page_id.setPadding(10, 10, 10, 10);1255 page_id.setBackgroundColor("white");1256 this.tabpane.add(page_id);1257 1258 var pageLayout = new qx.ui.layout.CanvasLayout;1259 pageLayout.set(1260 {1261 width: "100%",1262 height: 600,1263 backgroundColor: "grey"1264 });1265 page_id.add(pageLayout);1266 1203 1267 1204 var sp = new qx.ui.splitpane.HorizontalSplitPane(300, "1*"); … … 1276 1213 showKnob : true 1277 1214 }); 1278 page Layout.add(sp);1215 page_id.add(sp); 1279 1216 1280 1217 var left_pane = sp.getLeftArea(); … … 1287 1224 border : "inset-thin", 1288 1225 overflow : "scroll", 1289 height : "100%",1226 height : 530, 1290 1227 width : "100%", 1291 1228 paddingLeft : 4, … … 1382 1319 1383 1320 1384 gl = new qx.ui.layout.GridLayout;1321 var gl = new qx.ui.layout.GridLayout; 1385 1322 gl.set( 1386 1323 { … … 1401 1338 gl.setRowHeight(2, 30); 1402 1339 1340 var l, e; 1341 1403 1342 l = new qx.ui.basic.Label("Name:"); 1404 1343 gl.add(l, 0, 0); … … 1428 1367 1429 1368 right_pane.add(gl); 1369 }, 1370 1371 renderCompareTab : function() 1372 { 1373 var page_id = this.renderTabPage("Compare", 1374 "pf/image/tab-compare.png"); 1375 }, 1376 1377 renderPlotTab : function() 1378 { 1379 var page_id = this.renderTabPage("Plot", 1380 "pf/image/tab-plot.png"); 1381 }, 1382 1383 /** 1384 * TODOC 1385 * 1386 * @type member 1387 * @param e {Event} TODOC 1388 * @return {void} 1389 */ 1390 main : function(e) 1391 { 1392 this.base(arguments); 1393 1394 // Define alias for custom resource path 1395 qx.io.Alias.getInstance().add("pf", 1396 qx.core.Setting.get("pf.resourceUri")); 1397 1398 // Defaults 1399 1400 this.r = new pf.base.Species("r", 1.0, 0, 0, 1.0, null); 1401 this.e = new pf.base.Species("e", (1.0/1836.2), -1, 1e16, 1.0, this.r); 1402 this.i = new pf.base.Species("i", 1.0, +1, 1e16, 1.0, this.r); 1403 1404 this.P_r = 0; 1405 1406 this.B = 0; 1407 1408 this.n_u = 2; 1409 this.n_l = 1; 1410 1411 if (this.updatePlasmaParameters() != true) { 1412 alert("Error!"); 1413 } 1414 1415 // Favorites 1416 this.favorites = new Array; 1417 1418 // Top-level container 1419 this.bl_top = new qx.ui.layout.VerticalBoxLayout("vertical"); 1420 this.bl_top.setWidth("100%"); 1421 this.bl_top.setHeight("100%"); 1422 1423 this.bl_top.addToDocument(); 1424 1425 1426 // The toolbar 1427 var tb = new qx.ui.toolbar.ToolBar; 1428 this.bl_top.add(tb); 1429 1430 // ... and the buttons themselves 1431 1432 var sep = new qx.ui.toolbar.Separator; 1433 tb.add(sep); 1434 1435 var btn = new qx.ui.toolbar.Button("About..."); 1436 tb.add(btn); 1437 // btn.addEventListener("execute", this.aboutCB, this); 1438 1439 var tf1 = new qx.ui.pageview.tabview.TabView; 1440 tf1.set({ width : '100%', height : 'auto' }); 1441 1442 this.bl_top.add(tf1); 1443 1444 this.tabbar = tf1.getBar(); 1445 this.tabpane = tf1.getPane(); 1446 this.tabpane.setHeight('auto'); 1447 this.tabpane.setPadding(0, 0, 0, 0); 1448 1449 // The "Parameters" tab 1450 this.renderParametersTab(); 1451 1452 // The "Explorer" tab 1453 this.renderExplorerTab(); 1454 1455 // The "Compare" tab 1456 this.renderCompareTab(); 1457 1458 // The "Plot" tab 1459 this.renderPlotTab(); 1430 1460 }, 1431 1461
Note: See TracChangeset
for help on using the changeset viewer.