Changeset 15:c7ca2b5abb5f for source/class
- Timestamp:
- Dec 24, 2007, 2:03:27 PM (17 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/class/pf/Application.js
r14 r15 380 380 this.B = v; 381 381 } 382 } 383 384 function treeMenuCB(ev) 385 { 386 if (ev.getButton() == "right") { 387 var menu = this.treeMenu; 388 389 if (menu.isSeeable()) { 390 menu.hide(); 391 } else { 392 var leaf = ev.getTarget(); 393 var favorite = leaf.getUserData("favorite"); 394 var el = leaf.getElement(); 395 396 if (favorite) { 397 this.treeMenuButtonAddToFav.setEnabled(false); 398 this.treeMenuButtonRemoveFromFav.setEnabled(true); 399 } else { 400 this.treeMenuButtonAddToFav.setEnabled(true); 401 this.treeMenuButtonRemoveFromFav.setEnabled(false); 402 } 403 404 menu.setUserData("leaf", leaf); 405 406 // position the menu 407 menu.setLeft(qx.html.Location.getPageBoxLeft(el)); 408 menu.setTop(qx.html.Location.getPageBoxBottom(el)); 409 410 menu.show(); 411 }; 412 413 ev.setPropagationStopped(true); 414 } 415 } 416 417 function showFundamentalCB(ev) 418 { 419 this.showFundamental = !this.showFundamental; 420 this.rePopulateTree(); 421 } 422 423 function showSpectroscopyCB(ev) 424 { 425 this.showSpectroscopy = !this.showSpectroscopy; 426 this.rePopulateTree(); 427 } 428 429 function showElectronsCB(ev) 430 { 431 this.showElectrons = !this.showElectrons; 432 this.rePopulateTree(); 433 } 434 435 function showIonsCB(ev) 436 { 437 this.showIons = !this.showIons; 438 this.rePopulateTree(); 439 } 440 441 function showRadiatorsCB(ev) 442 { 443 this.showRadiators = !this.showRadiators; 444 this.rePopulateTree(); 445 } 446 447 function addToFavCB(ev) 448 { 449 var leaf = this.treeMenu.getUserData("leaf"); 450 leaf.setUserData("favorite", true); 451 leaf.setTextColor("red"); 452 } 453 454 function removeFromFavCB(ev) 455 { 456 var leaf = this.treeMenu.getUserData("leaf"); 457 leaf.setUserData("favorite", false); 458 leaf.setTextColor("black"); 382 459 } 383 460 … … 464 541 members : 465 542 { 466 R0 : 0.5, // 0.3/0.7/1 ?; 543 R0 : 0.5, // 0.3/0.7/1 ? 544 545 showFundamental : true, 546 showSpectroscopy : true, 547 548 showElectrons : true, 549 showIons : true, 550 showRadiators : true, 467 551 468 552 checkPlasmaParameters : function() … … 708 792 }, 709 793 710 /** 711 * TODOC 712 * 713 * @type member 714 * @param e {Event} TODOC 715 * @return {void} 716 */ 717 main : function(e) 718 { 719 this.base(arguments); 720 721 // Define alias for custom resource path 722 qx.io.Alias.getInstance().add("pf", 723 qx.core.Setting.get("pf.resourceUri")); 724 725 // Defaults 726 727 this.r = new pf.base.Species("r", 1.0, 0, 0, 1.0, null); 728 this.e = new pf.base.Species("e", (1.0/1836.2), -1, 1e16, 1.0, this.r); 729 this.i = new pf.base.Species("i", 1.0, +1, 1e16, 1.0, this.r); 730 731 this.P_r = 0; 732 733 this.B = 0; 734 735 this.n_u = 2; 736 this.n_l = 1; 737 738 if (this.updatePlasmaParameters() != true) { 739 alert("Error!"); 740 } 741 742 743 // Top-level container 744 this.bl_top = new qx.ui.layout.VerticalBoxLayout("vertical"); 745 746 this.bl_top.addToDocument(); 747 748 749 // The toolbar 750 var tb = new qx.ui.toolbar.ToolBar; 751 this.bl_top.add(tb); 752 753 // ... and the buttons themselves 754 755 var sep = new qx.ui.toolbar.Separator; 756 tb.add(sep); 757 758 var btn = new qx.ui.toolbar.Button("About..."); 759 tb.add(btn); 760 // btn.addEventListener("execute", this.aboutCB, this); 761 762 var tf1 = new qx.ui.pageview.tabview.TabView; 763 // tf1.setSpacing(0); 764 this.bl_top.add(tf1); 765 766 this.tabbar = tf1.getBar(); 767 this.tabpane = tf1.getPane(); 768 this.tabpane.setPadding(0, 0, 0, 0); 769 this.tabpane.setBackgroundColor("white"); 770 771 772 var tab_id = new qx.ui.pageview.tabview.Button("Parameters"); 773 this.tabbar.add(tab_id); 774 var page_id = new qx.ui.pageview.tabview.Page(tab_id); 775 this.tabpane.add(page_id); 776 777 778 var fr, gl; 779 var l, e; 780 781 fr = new qx.ui.groupbox.GroupBox("Electrons", 782 "pf/image/e_small.png"); 783 fr.setDimension("auto", "auto"); 784 fr.setBackgroundColor("#eeeeff"); 785 786 page_id.add(fr); 787 788 gl = new qx.ui.layout.GridLayout; 789 gl.setVerticalSpacing(4); 790 gl.setHorizontalSpacing(6); 791 gl.setColumnCount(2); 792 gl.setColumnWidth(0, 100); 793 gl.setColumnWidth(1, 200); 794 gl.setRowCount(2); 795 gl.setRowHeight(0, 30); 796 gl.setRowHeight(1, 30); 797 798 fr.add(gl); 799 800 // N_e 801 l = new qx.ui.basic.Label("N<sub>e</sub> (cm<sup>-3</sup>):"); 802 gl.add(l, 0, 0); 803 e = new pf.ui.TextField(this.e.getN()); 804 gl.add(e, 1, 0); 805 // e.setLiveUpdate(true); 806 e.addEventListener("changeValue", changeN_e, this); 807 808 // T_e 809 l = new qx.ui.basic.Label("T<sub>e</sub> (eV):"); 810 gl.add(l, 0, 1); 811 e = new pf.ui.TextField(this.e.getT()); 812 gl.add(e, 1, 1); 813 e.addEventListener("changeValue", changeT_e, this); 814 e.setLiveUpdate(true); 815 816 817 fr = new qx.ui.groupbox.GroupBox("Ions", 818 "pf/image/i_small.png"); 819 fr.setDimension("auto", "auto"); 820 fr.setBackgroundColor("#ffeeee"); 821 822 page_id.add(fr); 823 fr.setTop(100); 824 825 gl = new qx.ui.layout.GridLayout; 826 gl.setVerticalSpacing(4); 827 gl.setHorizontalSpacing(6); 828 gl.setColumnCount(2); 829 gl.setColumnWidth(0, 100); 830 gl.setColumnWidth(1, 200); 831 gl.setRowCount(4); 832 gl.setRowHeight(0, 30); 833 gl.setRowHeight(1, 30); 834 gl.setRowHeight(2, 30); 835 gl.setRowHeight(3, 30); 836 837 fr.add(gl); 838 839 // Z_i 840 l = new qx.ui.basic.Label("Z<sub>i</sub>:"); 841 gl.add(l, 0, 0); 842 e = new pf.ui.Spinner(1, this.i.getQ(), 100); 843 gl.add(e, 1, 0); 844 845 e.addEventListener("change", changeZ_i, this); 846 847 // M_i 848 l = new qx.ui.basic.Label("M<sub>i</sub>:"); 849 gl.add(l, 0, 1); 850 e = new pf.ui.Spinner(1, this.i.getM(), 200); 851 gl.add(e, 1, 1); 852 e.addEventListener("change", changeM_i, this); 853 854 // T_i 855 l = new qx.ui.basic.Label("T<sub>i</sub> (eV):"); 856 gl.add(l, 0, 2); 857 e = new pf.ui.TextField(this.i.getT()); 858 gl.add(e, 1, 2); 859 e.addEventListener("changeValue", changeT_i, this); 860 e.setLiveUpdate(true); 861 this.gui_T_i = e; 862 863 // N_i 864 l = new qx.ui.basic.Label("N<sub>i</sub> (cm<sup>-3</sup>):"); 865 gl.add(l, 0, 3); 866 e = new pf.ui.TextField(this.i.getN()); 867 gl.add(e, 1, 3); 868 e.setReadOnly(true); 869 this.gui_N_i = e; 870 871 872 fr = new qx.ui.groupbox.GroupBox("Radiators", 873 "pf/image/r_small.png"); 874 fr.setDimension("auto", "auto"); 875 fr.setBackgroundColor("#eeffee"); 876 877 page_id.add(fr); 878 fr.setLeft(330); 879 880 gl = new qx.ui.layout.GridLayout; 881 gl.setVerticalSpacing(4); 882 gl.setHorizontalSpacing(6); 883 gl.setColumnCount(2); 884 gl.setColumnWidth(0, 100); 885 gl.setColumnWidth(1, 200); 886 gl.setRowCount(5); 887 gl.setRowHeight(0, 30); 888 gl.setRowHeight(1, 30); 889 gl.setRowHeight(2, 30); 890 gl.setRowHeight(3, 30); 891 gl.setRowHeight(4, 30); 892 893 fr.add(gl); 894 895 896 // Z_r 897 l = new qx.ui.basic.Label("Z<sub>r</sub>:"); 898 gl.add(l, 0, 0); 899 e = new pf.ui.Spinner(0, this.Z_r, 100); 900 gl.add(e, 1, 0); 901 e.addEventListener("change", changeZ_r, this); 902 903 // M_r 904 l = new qx.ui.basic.Label("M<sub>r</sub>:"); 905 gl.add(l, 0, 1); 906 e = new pf.ui.Spinner(1, this.r.getM(), 200); 907 gl.add(e, 1, 1); 908 e.addEventListener("change", changeM_r, this); 909 910 // T_r 911 l = new qx.ui.basic.Label("T<sub>r</sub> (eV):"); 912 gl.add(l, 0, 2); 913 e = new pf.ui.TextField(this.r.getT()); 914 gl.add(e, 1, 2); 915 e.addEventListener("changeValue", changeT_r, this); 916 this.gui_T_r = e; 917 918 // P_r 919 l = new qx.ui.basic.Label("P<sub>r</sub> (%):"); 920 gl.add(l, 0, 3); 921 e = new pf.ui.Spinner(0, this.P_r, 100); 922 gl.add(e, 1, 3); 923 e.addEventListener("change", changeP_r, this); 924 925 // N_r 926 l = new qx.ui.basic.Label("N<sub>r</sub> (cm<sup>-3</sup>):"); 927 gl.add(l, 0, 4); 928 e = new pf.ui.TextField(this.r.getN()); 929 e.setReadOnly(true); 930 gl.add(e, 1, 4); 931 this.gui_N_r = e; 932 933 934 fr = new qx.ui.groupbox.GroupBox("Fields"); 935 fr.setDimension("auto", "auto"); 936 fr.setBackgroundColor("#ffffdd"); 937 938 page_id.add(fr); 939 940 gl = new qx.ui.layout.GridLayout; 941 gl.setVerticalSpacing(4); 942 gl.setHorizontalSpacing(6); 943 gl.setColumnCount(2); 944 gl.setColumnWidth(0, 100); 945 gl.setColumnWidth(1, 200); 946 gl.setRowCount(1); 947 gl.setRowHeight(0, 30); 948 949 fr.add(gl); 950 fr.setTop(268); 951 952 953 l = new qx.ui.basic.Label("B (T):"); 954 gl.add(l, 0, 0); 955 e = new pf.ui.TextField(this.B); 956 gl.add(e, 1, 0); 957 // e.setLiveUpdate(true); 958 e.addEventListener("changeValue", changeB, this); 959 960 // Atomic system frame 961 fr = new qx.ui.groupbox.GroupBox("Atomic system", 962 "pf/image/all_small.png"); 963 fr.setDimension("auto", "auto"); 964 fr.setBackgroundColor("#ffffdd"); 965 966 page_id.add(fr); 967 968 gl = new qx.ui.layout.GridLayout; 969 gl.setVerticalSpacing(4); 970 gl.setHorizontalSpacing(6); 971 gl.setColumnCount(2); 972 gl.setColumnWidth(0, 100); 973 gl.setColumnWidth(1, 200); 974 gl.setRowCount(3); 975 gl.setRowHeight(0, 30); 976 gl.setRowHeight(1, 30); 977 gl.setRowHeight(2, 30); 978 979 fr.add(gl); 980 fr.setLeft(330); 981 fr.setTop(202); 982 983 l = new qx.ui.basic.Label("Z<sub>core</sub>:"); 984 gl.add(l, 0, 0); 985 e = new qx.ui.form.TextField(this.r.getQ() + 1); 986 e.setReadOnly(true); 987 gl.add(e, 1, 0); 988 this.gui_Zcore = e; 989 990 l = new qx.ui.basic.Label("n<sub>u</sub>:"); 991 gl.add(l, 0, 1); 992 e = new pf.ui.Spinner(2, this.n_u, 1000); 993 gl.add(e, 1, 1); 994 e.addEventListener("change", changeN_u, this); 995 996 l = new qx.ui.basic.Label("n<sub>l</sub>:"); 997 gl.add(l, 0, 2); 998 e = new pf.ui.Spinner(1, this.n_l, 1000); 999 gl.add(e, 1, 2); 1000 e.addEventListener("change", changeN_l, this); 1001 1002 tab_id.setChecked(true); 1003 1004 1005 var tab_id = new qx.ui.pageview.tabview.Button("Explorer"); 1006 this.tabbar.add(tab_id); 1007 var page_id = new qx.ui.pageview.tabview.Page(tab_id); 1008 this.tabpane.add(page_id); 1009 page_id.setDimension(800, 600); 1010 page_id.setBackgroundColor("black"); 1011 1012 var sp = new qx.ui.splitpane.HorizontalSplitPane(300, "1*"); 1013 sp.set( 1014 { 1015 left : 5, 1016 right : 5, 1017 top : 5, 1018 bottom : 5, 1019 border : "inset-thin", 1020 backgroundColor : "white", 1021 showKnob : true 1022 }); 1023 1024 var fff = new qx.ui.layout.CanvasLayout(); 1025 fff.set( 1026 { 1027 width: 800, 1028 height: 600 1029 }); 1030 1031 page_id.add(fff); 1032 fff.add(sp); 1033 1034 var left_pane = sp.getLeftArea(); 1035 left_pane.setPaddingRight(4); 1036 var right_pane = sp.getRightArea(); 1037 right_pane.setPaddingLeft(4); 1038 var tree = new qx.ui.tree.Tree("Browser"); 1039 tree.set( 1040 { 1041 top : 4, 1042 left : 4, 1043 bottom : 4, 1044 backgroundColor : "white", 1045 border : "inset-thin", 1046 overflow : "scroll", 1047 height : "100%", 1048 width : "100%", 1049 paddingLeft : 4, 1050 paddingTop : 4 1051 }); 1052 left_pane.add(tree); 1053 1054 folder = new qx.ui.tree.TreeFolder("Frequencies"); 1055 tree.add(folder); 1056 this.gui_folder_freq = folder; 1057 1058 var folder = new qx.ui.tree.TreeFolder("Lengths"); 1059 tree.add(folder); 1060 this.gui_folder_length = folder; 1061 1062 var folder = new qx.ui.tree.TreeFolder("Velocities"); 1063 tree.add(folder); 1064 this.gui_folder_vel = folder; 1065 1066 folder = new qx.ui.tree.TreeFolder("Dimensionless"); 1067 tree.add(folder); 1068 this.gui_folder_none = folder; 1069 1070 folder = new qx.ui.tree.TreeFolder("Energies"); 1071 tree.add(folder); 1072 this.gui_folder_energy = folder; 1073 1074 folder = new qx.ui.tree.TreeFolder("Miscellaneous"); 1075 tree.add(folder); 1076 this.gui_folder_misc = folder; 1077 794 populateTree : function() 795 { 1078 796 var i, n = plasma_entities.length; 1079 var sa = new Array(this.e, this.i, this.r); 797 var sa = new Array; 798 if (this.showElectrons) { 799 sa.push(this.e) 800 } 801 if (this.showIons) { 802 sa.push(this.i) 803 } 804 if (this.showRadiators) { 805 sa.push(this.r) 806 } 807 1080 808 for (var i = 0; i < n; i++) { 1081 809 var entity = plasma_entities[i]; 810 811 if (entity.section == "fundamental" && 812 this.showFundamental != true) { 813 continue; 814 } 815 if (entity.section == "spectroscopy" && 816 this.showSpectroscopy != true) { 817 continue; 818 } 819 1082 820 var folder; 1083 821 switch (entity.dimension) { … … 1106 844 switch (entity.nspecies) { 1107 845 case 1: 1108 for (var j = 0; j < 3; j++) {846 for (var j = 0; j < sa.length; j++) { 1109 847 var s = sa[j]; 1110 848 var icon = "pf/image/" + s.id + "_small.png"; … … 1112 850 leaf = new qx.ui.tree.TreeFile(entity.name, icon); 1113 851 leaf.addEventListener("click", clickEntityCB, this); 852 leaf.addEventListener("mouseup", treeMenuCB, this); 1114 853 leaf.setUserData("entity", entity); 1115 854 leaf.setUserData("species", s); … … 1122 861 "pf/image/all_small.png"); 1123 862 leaf.addEventListener("click", clickEntityCB, this); 863 leaf.addEventListener("mouseup", treeMenuCB, this); 1124 864 leaf.setUserData("entity", entity); 1125 865 folder.add(leaf); … … 1127 867 } 1128 868 } 869 }, 870 871 cleanTree : function() 872 { 873 this.gui_folder_freq.destroyContent(); 874 875 this.gui_folder_length.destroyContent(); 876 877 this.gui_folder_vel.destroyContent(); 878 879 this.gui_folder_none.destroyContent(); 880 881 this.gui_folder_energy.destroyContent(); 882 883 this.gui_folder_misc.destroyContent(); 884 }, 885 886 rePopulateTree : function() 887 { 888 // this.entity_tree.hide(); 889 890 this.cleanTree(); 891 this.populateTree(); 892 893 this.gui_folder_freq.close(); 894 this.gui_folder_length.close(); 895 this.gui_folder_vel.close(); 896 this.gui_folder_none.close(); 897 this.gui_folder_energy.close(); 898 this.gui_folder_misc.close(); 899 900 // this.entity_tree.show(); 901 }, 902 903 /** 904 * TODOC 905 * 906 * @type member 907 * @param e {Event} TODOC 908 * @return {void} 909 */ 910 main : function(e) 911 { 912 this.base(arguments); 913 914 // Define alias for custom resource path 915 qx.io.Alias.getInstance().add("pf", 916 qx.core.Setting.get("pf.resourceUri")); 917 918 // Defaults 919 920 this.r = new pf.base.Species("r", 1.0, 0, 0, 1.0, null); 921 this.e = new pf.base.Species("e", (1.0/1836.2), -1, 1e16, 1.0, this.r); 922 this.i = new pf.base.Species("i", 1.0, +1, 1e16, 1.0, this.r); 923 924 this.P_r = 0; 925 926 this.B = 0; 927 928 this.n_u = 2; 929 this.n_l = 1; 930 931 if (this.updatePlasmaParameters() != true) { 932 alert("Error!"); 933 } 934 935 936 // Top-level container 937 this.bl_top = new qx.ui.layout.VerticalBoxLayout("vertical"); 938 939 this.bl_top.addToDocument(); 940 941 942 // The toolbar 943 var tb = new qx.ui.toolbar.ToolBar; 944 this.bl_top.add(tb); 945 946 // ... and the buttons themselves 947 948 var sep = new qx.ui.toolbar.Separator; 949 tb.add(sep); 950 951 var btn = new qx.ui.toolbar.Button("About..."); 952 tb.add(btn); 953 // btn.addEventListener("execute", this.aboutCB, this); 954 955 var tf1 = new qx.ui.pageview.tabview.TabView; 956 // tf1.setSpacing(0); 957 this.bl_top.add(tf1); 958 959 this.tabbar = tf1.getBar(); 960 this.tabpane = tf1.getPane(); 961 this.tabpane.setPadding(0, 0, 0, 0); 962 this.tabpane.setBackgroundColor("white"); 963 964 965 var tab_id = new qx.ui.pageview.tabview.Button("Parameters"); 966 this.tabbar.add(tab_id); 967 var page_id = new qx.ui.pageview.tabview.Page(tab_id); 968 this.tabpane.add(page_id); 969 970 971 var fr, gl; 972 var l, e; 973 974 fr = new qx.ui.groupbox.GroupBox("Electrons", 975 "pf/image/e_small.png"); 976 fr.setDimension("auto", "auto"); 977 fr.setBackgroundColor("#eeeeff"); 978 979 page_id.add(fr); 980 981 gl = new qx.ui.layout.GridLayout; 982 gl.setVerticalSpacing(4); 983 gl.setHorizontalSpacing(6); 984 gl.setColumnCount(2); 985 gl.setColumnWidth(0, 100); 986 gl.setColumnWidth(1, 200); 987 gl.setRowCount(2); 988 gl.setRowHeight(0, 30); 989 gl.setRowHeight(1, 30); 990 991 fr.add(gl); 992 993 // N_e 994 l = new qx.ui.basic.Label("N<sub>e</sub> (cm<sup>-3</sup>):"); 995 gl.add(l, 0, 0); 996 e = new pf.ui.TextField(this.e.getN()); 997 gl.add(e, 1, 0); 998 // e.setLiveUpdate(true); 999 e.addEventListener("changeValue", changeN_e, this); 1000 1001 // T_e 1002 l = new qx.ui.basic.Label("T<sub>e</sub> (eV):"); 1003 gl.add(l, 0, 1); 1004 e = new pf.ui.TextField(this.e.getT()); 1005 gl.add(e, 1, 1); 1006 e.addEventListener("changeValue", changeT_e, this); 1007 e.setLiveUpdate(true); 1008 1009 1010 fr = new qx.ui.groupbox.GroupBox("Ions", 1011 "pf/image/i_small.png"); 1012 fr.setDimension("auto", "auto"); 1013 fr.setBackgroundColor("#ffeeee"); 1014 1015 page_id.add(fr); 1016 fr.setTop(100); 1017 1018 gl = new qx.ui.layout.GridLayout; 1019 gl.setVerticalSpacing(4); 1020 gl.setHorizontalSpacing(6); 1021 gl.setColumnCount(2); 1022 gl.setColumnWidth(0, 100); 1023 gl.setColumnWidth(1, 200); 1024 gl.setRowCount(4); 1025 gl.setRowHeight(0, 30); 1026 gl.setRowHeight(1, 30); 1027 gl.setRowHeight(2, 30); 1028 gl.setRowHeight(3, 30); 1029 1030 fr.add(gl); 1031 1032 // Z_i 1033 l = new qx.ui.basic.Label("Z<sub>i</sub>:"); 1034 gl.add(l, 0, 0); 1035 e = new pf.ui.Spinner(1, this.i.getQ(), 100); 1036 gl.add(e, 1, 0); 1037 1038 e.addEventListener("change", changeZ_i, this); 1039 1040 // M_i 1041 l = new qx.ui.basic.Label("M<sub>i</sub>:"); 1042 gl.add(l, 0, 1); 1043 e = new pf.ui.Spinner(1, this.i.getM(), 200); 1044 gl.add(e, 1, 1); 1045 e.addEventListener("change", changeM_i, this); 1046 1047 // T_i 1048 l = new qx.ui.basic.Label("T<sub>i</sub> (eV):"); 1049 gl.add(l, 0, 2); 1050 e = new pf.ui.TextField(this.i.getT()); 1051 gl.add(e, 1, 2); 1052 e.addEventListener("changeValue", changeT_i, this); 1053 e.setLiveUpdate(true); 1054 this.gui_T_i = e; 1055 1056 // N_i 1057 l = new qx.ui.basic.Label("N<sub>i</sub> (cm<sup>-3</sup>):"); 1058 gl.add(l, 0, 3); 1059 e = new pf.ui.TextField(this.i.getN()); 1060 gl.add(e, 1, 3); 1061 e.setReadOnly(true); 1062 this.gui_N_i = e; 1063 1064 1065 fr = new qx.ui.groupbox.GroupBox("Radiators", 1066 "pf/image/r_small.png"); 1067 fr.setDimension("auto", "auto"); 1068 fr.setBackgroundColor("#eeffee"); 1069 1070 page_id.add(fr); 1071 fr.setLeft(330); 1072 1073 gl = new qx.ui.layout.GridLayout; 1074 gl.setVerticalSpacing(4); 1075 gl.setHorizontalSpacing(6); 1076 gl.setColumnCount(2); 1077 gl.setColumnWidth(0, 100); 1078 gl.setColumnWidth(1, 200); 1079 gl.setRowCount(5); 1080 gl.setRowHeight(0, 30); 1081 gl.setRowHeight(1, 30); 1082 gl.setRowHeight(2, 30); 1083 gl.setRowHeight(3, 30); 1084 gl.setRowHeight(4, 30); 1085 1086 fr.add(gl); 1087 1088 1089 // Z_r 1090 l = new qx.ui.basic.Label("Z<sub>r</sub>:"); 1091 gl.add(l, 0, 0); 1092 e = new pf.ui.Spinner(0, this.Z_r, 100); 1093 gl.add(e, 1, 0); 1094 e.addEventListener("change", changeZ_r, this); 1095 1096 // M_r 1097 l = new qx.ui.basic.Label("M<sub>r</sub>:"); 1098 gl.add(l, 0, 1); 1099 e = new pf.ui.Spinner(1, this.r.getM(), 200); 1100 gl.add(e, 1, 1); 1101 e.addEventListener("change", changeM_r, this); 1102 1103 // T_r 1104 l = new qx.ui.basic.Label("T<sub>r</sub> (eV):"); 1105 gl.add(l, 0, 2); 1106 e = new pf.ui.TextField(this.r.getT()); 1107 gl.add(e, 1, 2); 1108 e.addEventListener("changeValue", changeT_r, this); 1109 this.gui_T_r = e; 1110 1111 // P_r 1112 l = new qx.ui.basic.Label("P<sub>r</sub> (%):"); 1113 gl.add(l, 0, 3); 1114 e = new pf.ui.Spinner(0, this.P_r, 100); 1115 gl.add(e, 1, 3); 1116 e.addEventListener("change", changeP_r, this); 1117 1118 // N_r 1119 l = new qx.ui.basic.Label("N<sub>r</sub> (cm<sup>-3</sup>):"); 1120 gl.add(l, 0, 4); 1121 e = new pf.ui.TextField(this.r.getN()); 1122 e.setReadOnly(true); 1123 gl.add(e, 1, 4); 1124 this.gui_N_r = e; 1125 1126 1127 fr = new qx.ui.groupbox.GroupBox("Fields"); 1128 fr.setDimension("auto", "auto"); 1129 fr.setBackgroundColor("#ffffdd"); 1130 1131 page_id.add(fr); 1132 1133 gl = new qx.ui.layout.GridLayout; 1134 gl.setVerticalSpacing(4); 1135 gl.setHorizontalSpacing(6); 1136 gl.setColumnCount(2); 1137 gl.setColumnWidth(0, 100); 1138 gl.setColumnWidth(1, 200); 1139 gl.setRowCount(1); 1140 gl.setRowHeight(0, 30); 1141 1142 fr.add(gl); 1143 fr.setTop(268); 1144 1145 1146 l = new qx.ui.basic.Label("B (T):"); 1147 gl.add(l, 0, 0); 1148 e = new pf.ui.TextField(this.B); 1149 gl.add(e, 1, 0); 1150 // e.setLiveUpdate(true); 1151 e.addEventListener("changeValue", changeB, this); 1152 1153 // Atomic system frame 1154 fr = new qx.ui.groupbox.GroupBox("Atomic system", 1155 "pf/image/all_small.png"); 1156 fr.setDimension("auto", "auto"); 1157 fr.setBackgroundColor("#ffffdd"); 1158 1159 page_id.add(fr); 1160 1161 gl = new qx.ui.layout.GridLayout; 1162 gl.setVerticalSpacing(4); 1163 gl.setHorizontalSpacing(6); 1164 gl.setColumnCount(2); 1165 gl.setColumnWidth(0, 100); 1166 gl.setColumnWidth(1, 200); 1167 gl.setRowCount(3); 1168 gl.setRowHeight(0, 30); 1169 gl.setRowHeight(1, 30); 1170 gl.setRowHeight(2, 30); 1171 1172 fr.add(gl); 1173 fr.setLeft(330); 1174 fr.setTop(202); 1175 1176 l = new qx.ui.basic.Label("Z<sub>core</sub>:"); 1177 gl.add(l, 0, 0); 1178 e = new qx.ui.form.TextField(this.r.getQ() + 1); 1179 e.setReadOnly(true); 1180 gl.add(e, 1, 0); 1181 this.gui_Zcore = e; 1182 1183 l = new qx.ui.basic.Label("n<sub>u</sub>:"); 1184 gl.add(l, 0, 1); 1185 e = new pf.ui.Spinner(2, this.n_u, 1000); 1186 gl.add(e, 1, 1); 1187 e.addEventListener("change", changeN_u, this); 1188 1189 l = new qx.ui.basic.Label("n<sub>l</sub>:"); 1190 gl.add(l, 0, 2); 1191 e = new pf.ui.Spinner(1, this.n_l, 1000); 1192 gl.add(e, 1, 2); 1193 e.addEventListener("change", changeN_l, this); 1194 1195 tab_id.setChecked(true); 1196 1197 1198 var tab_id = new qx.ui.pageview.tabview.Button("Explorer"); 1199 this.tabbar.add(tab_id); 1200 var page_id = new qx.ui.pageview.tabview.Page(tab_id); 1201 this.tabpane.add(page_id); 1202 page_id.setDimension(800, 600); 1203 page_id.setBackgroundColor("black"); 1204 1205 var sp = new qx.ui.splitpane.HorizontalSplitPane(300, "1*"); 1206 sp.set( 1207 { 1208 left : 5, 1209 right : 5, 1210 top : 5, 1211 bottom : 5, 1212 border : "inset-thin", 1213 backgroundColor : "white", 1214 showKnob : true 1215 }); 1216 1217 var fff = new qx.ui.layout.CanvasLayout(); 1218 fff.set( 1219 { 1220 width: 800, 1221 height: 600 1222 }); 1223 1224 page_id.add(fff); 1225 fff.add(sp); 1226 1227 var left_pane = sp.getLeftArea(); 1228 left_pane.setPaddingRight(4); 1229 var right_pane = sp.getRightArea(); 1230 right_pane.setPaddingLeft(4); 1231 var tree = new qx.ui.tree.Tree("Browser"); 1232 tree.set( 1233 { 1234 top : 4, 1235 left : 4, 1236 bottom : 4, 1237 backgroundColor : "white", 1238 border : "inset-thin", 1239 overflow : "scroll", 1240 height : "100%", 1241 width : "100%", 1242 paddingLeft : 4, 1243 paddingTop : 4 1244 }); 1245 left_pane.add(tree); 1246 1247 this.entity_tree = tree; 1248 1249 var folder; 1250 1251 folder = new qx.ui.tree.TreeFolder("Frequencies"); 1252 folder.setAlwaysShowPlusMinusSymbol(true); 1253 tree.add(folder); 1254 this.gui_folder_freq = folder; 1255 1256 folder = new qx.ui.tree.TreeFolder("Lengths"); 1257 folder.setAlwaysShowPlusMinusSymbol(true); 1258 tree.add(folder); 1259 this.gui_folder_length = folder; 1260 1261 folder = new qx.ui.tree.TreeFolder("Velocities"); 1262 folder.setAlwaysShowPlusMinusSymbol(true); 1263 tree.add(folder); 1264 this.gui_folder_vel = folder; 1265 1266 folder = new qx.ui.tree.TreeFolder("Dimensionless"); 1267 tree.add(folder); 1268 this.gui_folder_none = folder; 1269 1270 folder = new qx.ui.tree.TreeFolder("Energies"); 1271 folder.setAlwaysShowPlusMinusSymbol(true); 1272 tree.add(folder); 1273 this.gui_folder_energy = folder; 1274 1275 folder = new qx.ui.tree.TreeFolder("Miscellaneous"); 1276 folder.setAlwaysShowPlusMinusSymbol(true); 1277 tree.add(folder); 1278 this.gui_folder_misc = folder; 1279 1280 this.populateTree(); 1281 1129 1282 tree.setHideNode(true); 1130 1283 tree.setRootOpenClose(true); 1131 1284 1132 this.entity_tree = tree; 1285 // Build context-sensitive popup menu 1286 this.treeMenu = new qx.ui.menu.Menu; 1287 var button; 1288 1289 var subMenu1 = new qx.ui.menu.Menu; 1290 button = new qx.ui.menu.CheckBox("Fundamental", 1291 null, this.showFundamental); 1292 button.addEventListener("execute", showFundamentalCB, this); 1293 subMenu1.add(button); 1294 button = new qx.ui.menu.CheckBox("Spectroscopy", 1295 null, this.showSpectroscopy); 1296 button.addEventListener("execute", showSpectroscopyCB, this); 1297 subMenu1.add(button); 1298 this.treeMenu.add(new qx.ui.menu.Button("Show sections", 1299 null, null, subMenu1)); 1300 1301 this.treeMenu.add(new qx.ui.menu.Separator); 1302 1303 var subMenu2 = new qx.ui.menu.Menu; 1304 button = new qx.ui.menu.CheckBox("Electrons", 1305 null, this.showElectrons) 1306 button.addEventListener("execute", showElectronsCB, this); 1307 subMenu2.add(button); 1308 button = new qx.ui.menu.CheckBox("Ions", 1309 null, this.showIons) 1310 button.addEventListener("execute", showIonsCB, this); 1311 subMenu2.add(button); 1312 button = new qx.ui.menu.CheckBox("Radiators", 1313 null, this.showRadiators) 1314 button.addEventListener("execute", showRadiatorsCB, this); 1315 subMenu2.add(button); 1316 this.treeMenu.add(new qx.ui.menu.Button("Show species", 1317 null, null, subMenu2)); 1318 1319 this.treeMenu.add(new qx.ui.menu.Separator); 1320 1321 button = new qx.ui.menu.Button("Add to favorites"); 1322 button.addEventListener("execute", addToFavCB, this); 1323 this.treeMenu.add(button); 1324 this.treeMenuButtonAddToFav = button; 1325 button = new qx.ui.menu.Button("Remove from favorites"); 1326 button.addEventListener("execute", removeFromFavCB, this); 1327 this.treeMenu.add(button); 1328 this.treeMenuButtonRemoveFromFav = button; 1329 1330 var doc = qx.ui.core.ClientDocument.getInstance(); 1331 doc.add(this.treeMenu, subMenu1, subMenu2); 1133 1332 1134 1333
Note: See TracChangeset
for help on using the changeset viewer.