.. | .. |
---|
23 | 23 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 24 | ItemListener // ListSelectionListener |
---|
25 | 25 | { |
---|
| 26 | + |
---|
| 27 | + public void AddSkyboxButton(String f, String s, cGridBag row) |
---|
| 28 | + { |
---|
| 29 | + cButton skyboxButton; |
---|
| 30 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 31 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 33 | + skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 35 | + { |
---|
| 36 | + @Override |
---|
| 37 | + public void actionPerformed(ActionEvent e) |
---|
| 38 | + { |
---|
| 39 | + ChangeSkybox(path); |
---|
| 40 | + } |
---|
| 41 | + }); |
---|
| 42 | + } |
---|
| 43 | + |
---|
| 44 | + public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
| 45 | + { |
---|
| 46 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 47 | + |
---|
| 48 | + tab0.setName("Urban"); |
---|
| 49 | + skyboxpanel.add(tab0); |
---|
| 50 | + |
---|
| 51 | + cGridBag row0 = new cGridBag(); |
---|
| 52 | + cGridBag row1 = new cGridBag(); |
---|
| 53 | + cGridBag row2 = new cGridBag(); |
---|
| 54 | + cGridBag row3 = new cGridBag(); |
---|
| 55 | + cGridBag row4 = new cGridBag(); |
---|
| 56 | + cGridBag row5 = new cGridBag(); |
---|
| 57 | + cGridBag row6 = new cGridBag(); |
---|
| 58 | + |
---|
| 59 | + AddSkyboxButton("default", "rgb", row0); |
---|
| 60 | + //AddSkyboxButton("default", "cornell", row0); |
---|
| 61 | + AddSkyboxButton("penguins", "dust", row0); |
---|
| 62 | + AddSkyboxButton("penguins", "tropic", row0); |
---|
| 63 | + AddSkyboxButton("default", "skycube", row0); |
---|
| 64 | + |
---|
| 65 | + AddSkyboxButton("default", "uffizi", row1); |
---|
| 66 | + AddSkyboxButton("bridge", "Bridge", row1); |
---|
| 67 | + AddSkyboxButton("bridge", "Bridge2", row1); |
---|
| 68 | + AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
| 69 | + |
---|
| 70 | + AddSkyboxButton("urban", "Parliament", row2); |
---|
| 71 | + AddSkyboxButton("urban", "Roundabout", row2); |
---|
| 72 | + AddSkyboxButton("urban", "SaintLazarusChurch", row2); |
---|
| 73 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row2); |
---|
| 74 | + |
---|
| 75 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
| 76 | + AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 77 | + AddSkyboxButton("urban", "Medborgarplatsen", row3); |
---|
| 78 | + AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
| 79 | + |
---|
| 80 | + AddSkyboxButton("park", "Buddha", row4); |
---|
| 81 | + AddSkyboxButton("park", "CNTower2", row4); |
---|
| 82 | + AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
| 83 | + AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
| 84 | + |
---|
| 85 | + AddSkyboxButton("park", "Park", row5); |
---|
| 86 | + AddSkyboxButton("park", "Pond", row5); |
---|
| 87 | + AddSkyboxButton("park", "Skansen", row5); |
---|
| 88 | + AddSkyboxButton("park", "Skansen2", row5); |
---|
| 89 | + |
---|
| 90 | + AddSkyboxButton("park", "Skansen3", row6); |
---|
| 91 | + AddSkyboxButton("park", "Skansen4", row6); |
---|
| 92 | + AddSkyboxButton("park", "Skansen5", row6); |
---|
| 93 | + AddSkyboxButton("park", "Stairs", row6); |
---|
| 94 | + |
---|
| 95 | + tab0.add(row0); |
---|
| 96 | + tab0.add(row1); |
---|
| 97 | + tab0.add(row2); |
---|
| 98 | + tab0.add(row3); |
---|
| 99 | + tab0.add(row4); |
---|
| 100 | + tab0.add(row5); |
---|
| 101 | + tab0.add(row6); |
---|
| 102 | + |
---|
| 103 | + for (int i=5; --i>=0;) |
---|
| 104 | + { |
---|
| 105 | + //oe.toolboxPanel.Return(); |
---|
| 106 | + //tab0.add(new cGridBag()); |
---|
| 107 | + } |
---|
| 108 | + } |
---|
| 109 | + |
---|
| 110 | + public void AddSkyboxTab1(JTabbedPane skyboxpanel) |
---|
| 111 | + { |
---|
| 112 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 113 | + |
---|
| 114 | + tab0.setName("Nature"); |
---|
| 115 | + skyboxpanel.add(tab0); |
---|
| 116 | + |
---|
| 117 | + cGridBag row0 = new cGridBag(); |
---|
| 118 | + cGridBag row1 = new cGridBag(); |
---|
| 119 | + cGridBag row2 = new cGridBag(); |
---|
| 120 | + cGridBag row3 = new cGridBag(); |
---|
| 121 | + cGridBag row4 = new cGridBag(); |
---|
| 122 | + cGridBag row5 = new cGridBag(); |
---|
| 123 | + cGridBag row6 = new cGridBag(); |
---|
| 124 | + |
---|
| 125 | + AddSkyboxButton("beach", "HeartInTheSand", row0); |
---|
| 126 | + AddSkyboxButton("beach", "LarnacaBeach", row0); |
---|
| 127 | + AddSkyboxButton("beach", "PalmTrees", row0); |
---|
| 128 | + AddSkyboxButton("beach", "Tenerife", row0); |
---|
| 129 | + |
---|
| 130 | + AddSkyboxButton("beach", "Tenerife2", row1); |
---|
| 131 | + AddSkyboxButton("beach", "Tenerife3", row1); |
---|
| 132 | + AddSkyboxButton("field", "FishPond", row1); |
---|
| 133 | + AddSkyboxButton("field", "Footballfield", row1); |
---|
| 134 | + |
---|
| 135 | + AddSkyboxButton("field", "Meadow", row2); |
---|
| 136 | + AddSkyboxButton("field", "Sorsele", row2); |
---|
| 137 | + AddSkyboxButton("field", "Sorsele2", row2); |
---|
| 138 | + AddSkyboxButton("field", "Sorsele3", row2); |
---|
| 139 | + |
---|
| 140 | + AddSkyboxButton("forest", "Brudslojan", row3); |
---|
| 141 | + AddSkyboxButton("forest", "Langholmen2", row3); |
---|
| 142 | + AddSkyboxButton("forest", "Plants", row3); |
---|
| 143 | + AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 144 | + |
---|
| 145 | + AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
| 146 | + AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
| 147 | + AddSkyboxButton("mountain", "Ryfjallet", row4); |
---|
| 148 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 149 | + AddSkyboxButton("park", "Tantolunden4", row4); |
---|
| 150 | + |
---|
| 151 | + AddSkyboxButton("penguins", "wrath", row5); |
---|
| 152 | + AddSkyboxButton("penguins", "yonder", row5); |
---|
| 153 | + AddSkyboxButton("rocky", "Langholmen", row5); |
---|
| 154 | + AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 155 | + AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 156 | + |
---|
| 157 | + AddSkyboxButton("default", "CloudyHills", row6); |
---|
| 158 | + AddSkyboxButton("daz", "Autumn", row6); |
---|
| 159 | + AddSkyboxButton("daz", "Greenlands", row6); |
---|
| 160 | + AddSkyboxButton("daz", "MountainTrail", row6); |
---|
| 161 | + AddSkyboxButton("daz", "Oasis", row6); |
---|
| 162 | + /* |
---|
| 163 | +Autumn |
---|
| 164 | +Greenlands |
---|
| 165 | +MountainTrail |
---|
| 166 | +Oasis |
---|
| 167 | +TheRock |
---|
| 168 | +TopOfTheWorld |
---|
| 169 | +Winter |
---|
| 170 | + */ |
---|
| 171 | + |
---|
| 172 | + tab0.add(row0); |
---|
| 173 | + tab0.add(row1); |
---|
| 174 | + tab0.add(row2); |
---|
| 175 | + tab0.add(row3); |
---|
| 176 | + tab0.add(row4); |
---|
| 177 | + tab0.add(row5); |
---|
| 178 | + tab0.add(row6); |
---|
| 179 | + |
---|
| 180 | + for (int i=5; --i>=0;) |
---|
| 181 | + { |
---|
| 182 | + //oe.toolboxPanel.Return(); |
---|
| 183 | + //tab0.add(new cGridBag()); |
---|
| 184 | + } |
---|
| 185 | + } |
---|
| 186 | + |
---|
| 187 | + public void AddSkyboxTab2(JTabbedPane skyboxpanel) |
---|
| 188 | + { |
---|
| 189 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 190 | + |
---|
| 191 | + tab0.setName("Night"); |
---|
| 192 | + skyboxpanel.add(tab0); |
---|
| 193 | + |
---|
| 194 | + cGridBag row0 = new cGridBag(); |
---|
| 195 | + cGridBag row1 = new cGridBag(); |
---|
| 196 | + cGridBag row2 = new cGridBag(); |
---|
| 197 | + cGridBag row3 = new cGridBag(); |
---|
| 198 | + cGridBag row4 = new cGridBag(); |
---|
| 199 | + cGridBag row5 = new cGridBag(); |
---|
| 200 | + cGridBag row6 = new cGridBag(); |
---|
| 201 | + |
---|
| 202 | + AddSkyboxButton("night", "NightPath", row0); |
---|
| 203 | + AddSkyboxButton("night", "PondNight", row0); |
---|
| 204 | + AddSkyboxButton("night", "Powerlines", row0); |
---|
| 205 | + AddSkyboxButton("night", "SwedishRoyalCastle", row0); |
---|
| 206 | + |
---|
| 207 | + AddSkyboxButton("urban", "CNTower", row1); |
---|
| 208 | + AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
| 209 | + AddSkyboxButton("rocky", "Riddarfjarden", row1); |
---|
| 210 | + AddSkyboxButton("penguins", "sleepyhollow", row1); |
---|
| 211 | + |
---|
| 212 | + AddSkyboxButton("penguins", "kenon_star", row2); |
---|
| 213 | + AddSkyboxButton("indoors", "DallasW", row2); |
---|
| 214 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row2); |
---|
| 215 | + AddSkyboxButton("indoors", "Vasa", row2); |
---|
| 216 | + |
---|
| 217 | + AddSkyboxButton("winter", "Backyard", row3); |
---|
| 218 | + AddSkyboxButton("winter", "Creek", row3); |
---|
| 219 | + AddSkyboxButton("winter", "FootballField3", row3); |
---|
| 220 | + AddSkyboxButton("winter", "Forest", row3); |
---|
| 221 | + |
---|
| 222 | + AddSkyboxButton("winter", "HornstullsStrand2", row4); |
---|
| 223 | + AddSkyboxButton("winter", "House", row4); |
---|
| 224 | + AddSkyboxButton("winter", "IceLake", row4); |
---|
| 225 | + AddSkyboxButton("winter", "IceRiver", row4); |
---|
| 226 | + |
---|
| 227 | + AddSkyboxButton("winter", "Park3", row5); |
---|
| 228 | + AddSkyboxButton("winter", "PondWinter", row5); |
---|
| 229 | + AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
| 230 | + AddSkyboxButton("winter", "Vindelalven", row5); |
---|
| 231 | + |
---|
| 232 | + AddSkyboxButton("daz", "TheRock", row6); |
---|
| 233 | + AddSkyboxButton("daz", "TopOfTheWorld", row6); |
---|
| 234 | + AddSkyboxButton("daz", "Winter", row6); |
---|
| 235 | + AddSkyboxButton("penguins", "desertdawn", row6); |
---|
| 236 | + |
---|
| 237 | + tab0.add(row0); |
---|
| 238 | + tab0.add(row1); |
---|
| 239 | + tab0.add(row2); |
---|
| 240 | + tab0.add(row3); |
---|
| 241 | + tab0.add(row4); |
---|
| 242 | + tab0.add(row5); |
---|
| 243 | + tab0.add(row6); |
---|
| 244 | + |
---|
| 245 | + for (int i=5; --i>=0;) |
---|
| 246 | + { |
---|
| 247 | + //oe.toolboxPanel.Return(); |
---|
| 248 | + //tab0.add(new cGridBag()); |
---|
| 249 | + } |
---|
| 250 | + } |
---|
| 251 | + |
---|
| 252 | + public void ChangeSkybox(String name) |
---|
| 253 | + { |
---|
| 254 | + //cameraView.envyoff = false; |
---|
| 255 | + group.skyboxname = name; |
---|
| 256 | + group.skyboxext = "jpg"; |
---|
| 257 | + cameraView.repaint(); |
---|
| 258 | + } |
---|
| 259 | + |
---|
26 | 260 | //ObjEditor objEditor; |
---|
27 | 261 | public void closeUI2() |
---|
28 | 262 | { |
---|
.. | .. |
---|
80 | 314 | this.copy = this.group = copy; |
---|
81 | 315 | //selectees = this.group.selectees; |
---|
82 | 316 | |
---|
83 | | - if (copy.versions == null) |
---|
84 | | - { |
---|
85 | | - copy.versions = new byte[100][]; |
---|
86 | | - copy.versionindex = -1; |
---|
87 | | - } |
---|
88 | | - |
---|
89 | 317 | SetupMenu2(this); //objEditor); |
---|
90 | 318 | SetupUI2(objEditor); |
---|
91 | 319 | objEditor.SetupUI(true); |
---|
92 | 320 | SetupViews(objEditor); |
---|
93 | 321 | |
---|
94 | 322 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 323 | + |
---|
| 324 | + if (copy.versions == null) |
---|
| 325 | + { |
---|
| 326 | + copy.versions = new byte[100][]; |
---|
| 327 | + copy.versionindex = -1; |
---|
| 328 | + |
---|
| 329 | + Save(true); |
---|
| 330 | + } |
---|
95 | 331 | } |
---|
96 | 332 | |
---|
97 | 333 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
206 | 442 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
207 | 443 | // pasteExpandItem.addActionListener(this); |
---|
208 | 444 | menu.add("-"); |
---|
209 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
210 | | - clearItem.addActionListener(this); |
---|
| 445 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 446 | + deleteItem.addActionListener(this); |
---|
211 | 447 | |
---|
212 | 448 | if (Globals.ADVANCED) |
---|
213 | 449 | { |
---|
.. | .. |
---|
433 | 669 | genNormalsMESHItem.addActionListener(this); |
---|
434 | 670 | if (Globals.ADVANCED) |
---|
435 | 671 | { |
---|
436 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 672 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
437 | 673 | genNormalsMINEItem.addActionListener(this); |
---|
438 | 674 | } |
---|
439 | 675 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
526 | 762 | attachBumpItem.addActionListener(this); |
---|
527 | 763 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
528 | 764 | pigmentBumpItem.addActionListener(this); |
---|
| 765 | + //embedTexturesItem |
---|
529 | 766 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
530 | 767 | detachPigmentItem.addActionListener(this); |
---|
531 | 768 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
532 | 769 | detachBumpItem.addActionListener(this); |
---|
| 770 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 771 | + embedTexturesItem.addActionListener(this); |
---|
| 772 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 773 | + deEmbedTexturesItem.addActionListener(this); |
---|
533 | 774 | menu.add("-"); |
---|
534 | 775 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
535 | 776 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
601 | 842 | */ |
---|
602 | 843 | cGridBag copyOptionsPanel = new cGridBag(); |
---|
603 | 844 | |
---|
604 | | - copyOptionsPanel.preferredHeight = 1; |
---|
| 845 | + copyOptionsPanel.preferredHeight = 2; |
---|
605 | 846 | |
---|
606 | 847 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
607 | 848 | |
---|
.. | .. |
---|
681 | 922 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
682 | 923 | snapobjectButton.addActionListener(this); |
---|
683 | 924 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 925 | + |
---|
| 926 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 927 | + fourButton.addActionListener(this); |
---|
| 928 | + fourButton.setToolTipText("Show control panel only"); |
---|
684 | 929 | } |
---|
685 | 930 | |
---|
686 | 931 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
687 | 932 | |
---|
688 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
689 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 933 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 934 | + twoButton.setToolTipText("Show 3D view only"); |
---|
690 | 935 | twoButton.addActionListener(this); |
---|
691 | 936 | this.fullscreenLayout = twoButton; |
---|
692 | 937 | |
---|
693 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
694 | | - fourButton.addActionListener(this); |
---|
695 | | - fourButton.setToolTipText("Show left panel only"); |
---|
696 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
697 | | - sixButton.setToolTipText("2-column layout left"); |
---|
698 | | - sixButton.addActionListener(this); |
---|
699 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
700 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 938 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 939 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
701 | 940 | threeButton.addActionListener(this); |
---|
702 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
703 | | - sevenButton.setToolTipText("3-column layout"); |
---|
704 | | - sevenButton.addActionListener(this); |
---|
| 941 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 942 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 943 | + sixButton.addActionListener(this); |
---|
| 944 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 945 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 946 | +// sevenButton.addActionListener(this); |
---|
705 | 947 | // |
---|
706 | 948 | |
---|
707 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
708 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 949 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 950 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
709 | 951 | rootButton.addActionListener(this); |
---|
710 | 952 | |
---|
711 | 953 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
714 | 956 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
715 | 957 | //clearButton.addActionListener(this); |
---|
716 | 958 | |
---|
| 959 | + cGridBag row1 = new cGridBag(); |
---|
| 960 | + |
---|
717 | 961 | // INSERT |
---|
718 | | - oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 962 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
719 | 963 | gridButton.setToolTipText("Create grid"); |
---|
720 | 964 | gridButton.addActionListener(this); |
---|
721 | 965 | |
---|
722 | | - oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 966 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
723 | 967 | boxButton.setToolTipText("Create box"); |
---|
724 | 968 | boxButton.addActionListener(this); |
---|
725 | 969 | |
---|
726 | | - oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 970 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
727 | 971 | sphereButton.setToolTipText("Create sphere"); |
---|
728 | 972 | sphereButton.addActionListener(this); |
---|
729 | 973 | |
---|
730 | | - oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 974 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
731 | 975 | coneButton.setToolTipText("Create cone"); |
---|
732 | 976 | coneButton.addActionListener(this); |
---|
733 | 977 | |
---|
734 | | - oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 978 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
735 | 979 | torusButton.setToolTipText("Create torus"); |
---|
736 | 980 | torusButton.addActionListener(this); |
---|
737 | 981 | |
---|
738 | | - oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 982 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
739 | 983 | superButton.setToolTipText("Create superellipsoid"); |
---|
740 | 984 | superButton.addActionListener(this); |
---|
741 | 985 | |
---|
.. | .. |
---|
746 | 990 | kleinButton.addActionListener(this); |
---|
747 | 991 | } |
---|
748 | 992 | |
---|
749 | | - oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 993 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
750 | 994 | particlesButton.setToolTipText("Create particle system"); |
---|
751 | 995 | particlesButton.addActionListener(this); |
---|
752 | 996 | |
---|
753 | | - oe.toolboxPanel.Return(); |
---|
| 997 | + oe.toolboxPanel.add(row1); |
---|
754 | 998 | |
---|
755 | | - oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 999 | + cGridBag row2 = new cGridBag(); |
---|
| 1000 | + |
---|
| 1001 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
756 | 1002 | groupButton.setToolTipText("Create group"); |
---|
757 | 1003 | groupButton.addActionListener(this); |
---|
758 | 1004 | |
---|
759 | | - oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1005 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
760 | 1006 | compositeButton.setToolTipText("Create composite"); |
---|
761 | 1007 | compositeButton.addActionListener(this); |
---|
762 | 1008 | |
---|
763 | | - oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1009 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
764 | 1010 | switchButton.setToolTipText("Create item switcher"); |
---|
765 | 1011 | switchButton.addActionListener(this); |
---|
766 | 1012 | |
---|
767 | | - oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1013 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
768 | 1014 | loopButton.setToolTipText("Create loop"); |
---|
769 | 1015 | loopButton.addActionListener(this); |
---|
770 | 1016 | |
---|
771 | | - oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1017 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
772 | 1018 | textureButton.setToolTipText("Create texture"); |
---|
773 | 1019 | textureButton.addActionListener(this); |
---|
774 | 1020 | |
---|
775 | | - oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1021 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
776 | 1022 | overlayButton.setToolTipText("Create overlay"); |
---|
777 | 1023 | overlayButton.addActionListener(this); |
---|
778 | 1024 | |
---|
779 | | - oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1025 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
780 | 1026 | lightButton.setToolTipText("Create light"); |
---|
781 | 1027 | lightButton.addActionListener(this); |
---|
782 | 1028 | |
---|
783 | | - for (int i=6; --i>=0;) |
---|
784 | | - { |
---|
785 | | - oe.toolboxPanel.Return(); |
---|
786 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
787 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
788 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
789 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
790 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
791 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
792 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
793 | | - } |
---|
| 1029 | + oe.toolboxPanel.add(row2); |
---|
| 1030 | + |
---|
| 1031 | + // ENVYMAPS |
---|
| 1032 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1033 | + skyboxpane.preferredHeight = 100; |
---|
| 1034 | + |
---|
| 1035 | + oe.toolboxPanel.add(skyboxpane); |
---|
| 1036 | + |
---|
| 1037 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1038 | + skyboxpane.add(skyboxpanel); |
---|
| 1039 | + |
---|
| 1040 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1041 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1042 | + AddSkyboxTab2(skyboxpanel); |
---|
794 | 1043 | |
---|
795 | 1044 | // EDIT panel |
---|
796 | 1045 | editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
850 | 1099 | versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
851 | 1100 | sliderPane.preferredHeight = 1; |
---|
852 | 1101 | |
---|
853 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
854 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1102 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1103 | + mainPanel.setResizeWeight(0.4); |
---|
855 | 1104 | |
---|
856 | 1105 | //jList.addListSelectionListener(this); |
---|
857 | 1106 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
859 | 1108 | //jTree.setEditable(true); |
---|
860 | 1109 | oe.jTree.setDragEnabled(true); |
---|
861 | 1110 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
862 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1111 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
863 | 1112 | |
---|
864 | 1113 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
865 | 1114 | |
---|
.. | .. |
---|
871 | 1120 | dgr.addDragGestureListener(this); |
---|
872 | 1121 | }catch(Exception e) {} |
---|
873 | 1122 | */ |
---|
874 | | - radio.layout = sevenButton; |
---|
| 1123 | + radio.layout = sixButton; // sevenButton; |
---|
875 | 1124 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
876 | 1125 | } |
---|
877 | 1126 | |
---|
.. | .. |
---|
1013 | 1262 | } |
---|
1014 | 1263 | |
---|
1015 | 1264 | radioButton.SetObject(obj); |
---|
1016 | | - radioButton.layout = sevenButton; |
---|
| 1265 | + radioButton.layout = sixButton; // sevenButton; |
---|
1017 | 1266 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
1018 | 1267 | radioButton.addActionListener(this); |
---|
1019 | 1268 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1693 | 1942 | } |
---|
1694 | 1943 | } |
---|
1695 | 1944 | } |
---|
| 1945 | + |
---|
| 1946 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1947 | + { |
---|
| 1948 | + // if (!(elem instanceof Composite)) |
---|
| 1949 | + // newWindow = false; |
---|
| 1950 | + listUI.add(elem); |
---|
| 1951 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1952 | + System.out.println("edit : " + elem); |
---|
| 1953 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1954 | + } |
---|
1696 | 1955 | |
---|
1697 | 1956 | /** |
---|
1698 | 1957 | * applyExample |
---|
.. | .. |
---|
2121 | 2380 | { |
---|
2122 | 2381 | makeSomething(new Light()); |
---|
2123 | 2382 | } else |
---|
| 2383 | +// if (source == skybox1Button || |
---|
| 2384 | +// source == skybox2Button || |
---|
| 2385 | +// source == skybox3Button || |
---|
| 2386 | +// source == skybox4Button || |
---|
| 2387 | +// source == skybox5Button || |
---|
| 2388 | +// source == skybox6Button || |
---|
| 2389 | +// source == skybox7Button || |
---|
| 2390 | +// source == skybox11Button || |
---|
| 2391 | +// source == skybox12Button || |
---|
| 2392 | +// source == skybox13Button || |
---|
| 2393 | +// source == skybox14Button || |
---|
| 2394 | +// source == skybox15Button || |
---|
| 2395 | +// source == skybox16Button || |
---|
| 2396 | +// source == skybox17Button) |
---|
| 2397 | +// { |
---|
| 2398 | +// ChangeSkybox(source); |
---|
| 2399 | +// } else |
---|
2124 | 2400 | if (source == csgItem) |
---|
2125 | 2401 | { |
---|
2126 | 2402 | group(new CSG()); |
---|
.. | .. |
---|
2206 | 2482 | if (source == computeAOItem) |
---|
2207 | 2483 | { |
---|
2208 | 2484 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
2209 | | - Globals.theRenderer.repaint(); |
---|
| 2485 | + cameraView.repaint(); |
---|
2210 | 2486 | } else |
---|
2211 | 2487 | if (source == recompileItem) |
---|
2212 | 2488 | { |
---|
.. | .. |
---|
2658 | 2934 | { |
---|
2659 | 2935 | StepAll(); |
---|
2660 | 2936 | } else |
---|
2661 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2937 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2662 | 2938 | { |
---|
2663 | 2939 | //int indices[] = jList.getSelectedIndices(); |
---|
2664 | 2940 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
3140 | 3416 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3141 | 3417 | { |
---|
3142 | 3418 | obj = (Object3D)e.nextElement(); |
---|
3143 | | - obj.SetBumpTexture(null); |
---|
| 3419 | + obj.ResetBumpTexture(); |
---|
3144 | 3420 | } |
---|
3145 | 3421 | |
---|
3146 | 3422 | refreshContents(); |
---|
.. | .. |
---|
3154 | 3430 | obj.SetBumpTexture(obj.GetPigmentTexture()); |
---|
3155 | 3431 | } |
---|
3156 | 3432 | |
---|
| 3433 | + refreshContents(); |
---|
| 3434 | + } else |
---|
| 3435 | + if (source == embedTexturesItem) |
---|
| 3436 | + { |
---|
| 3437 | + Object3D obj; |
---|
| 3438 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3439 | + { |
---|
| 3440 | + obj = (Object3D)e.nextElement(); |
---|
| 3441 | + obj.EmbedTextures(true); |
---|
| 3442 | + } |
---|
| 3443 | + |
---|
| 3444 | + refreshContents(); |
---|
| 3445 | + } else |
---|
| 3446 | + if (source == deEmbedTexturesItem) |
---|
| 3447 | + { |
---|
| 3448 | + Object3D obj; |
---|
| 3449 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3450 | + { |
---|
| 3451 | + obj = (Object3D)e.nextElement(); |
---|
| 3452 | + obj.EmbedTextures(false); |
---|
| 3453 | + } |
---|
| 3454 | + |
---|
| 3455 | + CameraPane.texturepigment.clear(); |
---|
| 3456 | + CameraPane.texturebump.clear(); |
---|
| 3457 | + |
---|
3157 | 3458 | refreshContents(); |
---|
3158 | 3459 | } else |
---|
3159 | 3460 | if (source == flashSelectionButton) |
---|
.. | .. |
---|
3257 | 3558 | // centralPanel.setVisible(true); |
---|
3258 | 3559 | // XYZPanel.setVisible(true); |
---|
3259 | 3560 | bigThree.ClearUI(); |
---|
| 3561 | + bigThree.add(scenePanel); |
---|
3260 | 3562 | bigThree.add(centralPanel); |
---|
3261 | | - bigThree.add(XYZPanel); |
---|
3262 | 3563 | bigThree.FlushUI(); |
---|
3263 | 3564 | |
---|
3264 | 3565 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3338 | 3639 | // centralPanel.setVisible(true); |
---|
3339 | 3640 | // XYZPanel.setVisible(false); |
---|
3340 | 3641 | bigThree.ClearUI(); |
---|
3341 | | - bigThree.add(scenePanel); |
---|
3342 | 3642 | bigThree.add(centralPanel); |
---|
| 3643 | + bigThree.add(scenePanel); |
---|
3343 | 3644 | bigThree.FlushUI(); |
---|
3344 | 3645 | |
---|
3345 | 3646 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3553 | 3854 | radio.layout.doClick(); |
---|
3554 | 3855 | |
---|
3555 | 3856 | ClearUnpinned(); |
---|
3556 | | - Grafreed.Assert(group != null); |
---|
3557 | | - Grafreed.Assert(group.selection != null); |
---|
3558 | | - SetPinStates(group.selection.size() > 0); |
---|
3559 | | - if (group.selection.size() == 1) |
---|
| 3857 | + //Grafreed.Assert(group != null); |
---|
| 3858 | + //Grafreed.Assert(group.selection != null); |
---|
| 3859 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3860 | + if (group.selection == null || group.selection.size() == 1) |
---|
3560 | 3861 | EditSelection(false); |
---|
3561 | 3862 | keepparent = group.parent; |
---|
3562 | 3863 | // PARENT = NULL or not??? |
---|
.. | .. |
---|
4150 | 4451 | |
---|
4151 | 4452 | try |
---|
4152 | 4453 | { |
---|
4153 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4454 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
4154 | 4455 | } |
---|
4155 | 4456 | catch (Exception e) |
---|
4156 | 4457 | { |
---|
.. | .. |
---|
4627 | 4928 | |
---|
4628 | 4929 | void EditSelection(boolean newWindow) |
---|
4629 | 4930 | { |
---|
| 4931 | + if (group.selection == null) |
---|
| 4932 | + { |
---|
| 4933 | + EditElement(group, newWindow); // ? new |
---|
| 4934 | + return; |
---|
| 4935 | + } |
---|
| 4936 | + |
---|
4630 | 4937 | // aConstraints.gridy = 0; |
---|
4631 | 4938 | for (int i=0; i<group.selection.size(); i++) |
---|
4632 | 4939 | { |
---|
.. | .. |
---|
4637 | 4944 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4638 | 4945 | if(elem != group || !newWindow) |
---|
4639 | 4946 | { |
---|
4640 | | - // if (!(elem instanceof Composite)) |
---|
4641 | | - // newWindow = false; |
---|
4642 | | - listUI.add(elem); |
---|
4643 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4644 | | - System.out.println("edit : " + elem); |
---|
4645 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4947 | + EditElement(elem, newWindow); // ? new |
---|
4646 | 4948 | } |
---|
4647 | 4949 | } |
---|
4648 | 4950 | } |
---|
.. | .. |
---|
4786 | 5088 | |
---|
4787 | 5089 | void refreshContents(boolean cp) |
---|
4788 | 5090 | { |
---|
4789 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 5091 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
4790 | 5092 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4791 | 5093 | { |
---|
4792 | 5094 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
5632 | 5934 | cButton loopButton; |
---|
5633 | 5935 | cButton textureButton; |
---|
5634 | 5936 | |
---|
| 5937 | + cButton skybox1Button; |
---|
| 5938 | + cButton skybox2Button; |
---|
| 5939 | + cButton skybox3Button; |
---|
| 5940 | + cButton skybox4Button; |
---|
| 5941 | + cButton skybox5Button; |
---|
| 5942 | + cButton skybox6Button; |
---|
| 5943 | + cButton skybox7Button; |
---|
| 5944 | + |
---|
| 5945 | + cButton skybox11Button; |
---|
| 5946 | + cButton skybox12Button; |
---|
| 5947 | + cButton skybox13Button; |
---|
| 5948 | + cButton skybox14Button; |
---|
| 5949 | + cButton skybox15Button; |
---|
| 5950 | + cButton skybox16Button; |
---|
| 5951 | + cButton skybox17Button; |
---|
| 5952 | + |
---|
5635 | 5953 | cButton gridButton; |
---|
5636 | 5954 | cButton boxButton; |
---|
5637 | 5955 | cButton sphereButton; |
---|
.. | .. |
---|
5695 | 6013 | private MenuItem pasteLinkItem; |
---|
5696 | 6014 | private MenuItem pasteCloneItem; |
---|
5697 | 6015 | private MenuItem pasteExpandItem; |
---|
5698 | | - private MenuItem clearItem; |
---|
| 6016 | + private MenuItem deleteItem; |
---|
5699 | 6017 | private MenuItem clearAllItem; |
---|
5700 | 6018 | private MenuItem genUVItem; |
---|
5701 | 6019 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5779 | 6097 | private MenuItem attachBumpItem; |
---|
5780 | 6098 | private MenuItem detachBumpItem; |
---|
5781 | 6099 | private MenuItem pigmentBumpItem; |
---|
| 6100 | + private MenuItem embedTexturesItem; |
---|
| 6101 | + private MenuItem deEmbedTexturesItem; |
---|
5782 | 6102 | |
---|
5783 | 6103 | private MenuItem particleItem; |
---|
5784 | 6104 | private MenuItem ragdollItem; |
---|