.. | .. |
---|
16 | 16 | //import buoy.widget.BFileChooser; |
---|
17 | 17 | |
---|
18 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
| 19 | + Grafreed.iResourceCallBack, |
---|
19 | 20 | ObjectUI, |
---|
20 | 21 | Runnable, |
---|
21 | 22 | ActionListener, |
---|
.. | .. |
---|
23 | 24 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 25 | ItemListener // ListSelectionListener |
---|
25 | 26 | { |
---|
| 27 | + |
---|
| 28 | + public void AddSkyboxButton(String f, String s, cGridBag row) |
---|
| 29 | + { |
---|
| 30 | + cButton skyboxButton; |
---|
| 31 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 32 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 33 | + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 34 | + skyboxButton.setToolTipText(s); |
---|
| 35 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 36 | + { |
---|
| 37 | + @Override |
---|
| 38 | + public void actionPerformed(ActionEvent e) |
---|
| 39 | + { |
---|
| 40 | + ChangeSkybox(path); |
---|
| 41 | + } |
---|
| 42 | + }); |
---|
| 43 | + } |
---|
| 44 | + |
---|
| 45 | + public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
| 46 | + { |
---|
| 47 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 48 | + |
---|
| 49 | + tab0.setName("Urban"); |
---|
| 50 | + skyboxpanel.add(tab0); |
---|
| 51 | + |
---|
| 52 | + cGridBag row0 = new cGridBag(); |
---|
| 53 | + cGridBag row1 = new cGridBag(); |
---|
| 54 | + cGridBag row2 = new cGridBag(); |
---|
| 55 | + cGridBag row3 = new cGridBag(); |
---|
| 56 | + cGridBag row4 = new cGridBag(); |
---|
| 57 | + cGridBag row5 = new cGridBag(); |
---|
| 58 | + cGridBag row6 = new cGridBag(); |
---|
| 59 | + |
---|
| 60 | + AddSkyboxButton("default", "rgb", row0); |
---|
| 61 | + //AddSkyboxButton("default", "cornell", row0); |
---|
| 62 | + AddSkyboxButton("penguins", "dust", row0); |
---|
| 63 | + AddSkyboxButton("penguins", "tropic", row0); |
---|
| 64 | + AddSkyboxButton("penguins", "yonder", row0); |
---|
| 65 | + |
---|
| 66 | + AddSkyboxButton("default", "uffizi", row1); |
---|
| 67 | + AddSkyboxButton("bridge", "Bridge", row1); |
---|
| 68 | + AddSkyboxButton("bridge", "Bridge2", row1); |
---|
| 69 | + AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
| 70 | + |
---|
| 71 | + AddSkyboxButton("urban", "Parliament", row2); |
---|
| 72 | + AddSkyboxButton("urban", "Roundabout", row2); |
---|
| 73 | + AddSkyboxButton("urban", "SaintLazarusChurch", row2); |
---|
| 74 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row2); |
---|
| 75 | + |
---|
| 76 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
| 77 | + AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 78 | + AddSkyboxButton("urban", "Medborgarplatsen", row3); |
---|
| 79 | + AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
| 80 | + |
---|
| 81 | + AddSkyboxButton("park", "Buddha", row4); |
---|
| 82 | + AddSkyboxButton("park", "CNTower2", row4); |
---|
| 83 | + AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
| 84 | + AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
| 85 | + |
---|
| 86 | + AddSkyboxButton("park", "Park", row5); |
---|
| 87 | + AddSkyboxButton("park", "Pond", row5); |
---|
| 88 | + AddSkyboxButton("park", "Skansen", row5); |
---|
| 89 | + AddSkyboxButton("park", "Skansen2", row5); |
---|
| 90 | + |
---|
| 91 | + AddSkyboxButton("park", "Skansen3", row6); |
---|
| 92 | + AddSkyboxButton("park", "Skansen4", row6); |
---|
| 93 | + AddSkyboxButton("park", "Skansen5", row6); |
---|
| 94 | + AddSkyboxButton("persson", "VancouverConventionCentre", row6); |
---|
| 95 | + |
---|
| 96 | + tab0.add(row0); |
---|
| 97 | + tab0.add(row1); |
---|
| 98 | + tab0.add(row2); |
---|
| 99 | + tab0.add(row3); |
---|
| 100 | + tab0.add(row4); |
---|
| 101 | + tab0.add(row5); |
---|
| 102 | + tab0.add(row6); |
---|
| 103 | + |
---|
| 104 | + for (int i=5; --i>=0;) |
---|
| 105 | + { |
---|
| 106 | + //oe.toolboxPanel.Return(); |
---|
| 107 | + //tab0.add(new cGridBag()); |
---|
| 108 | + } |
---|
| 109 | + } |
---|
| 110 | + |
---|
| 111 | + public void AddSkyboxTab1(JTabbedPane skyboxpanel) |
---|
| 112 | + { |
---|
| 113 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 114 | + |
---|
| 115 | + tab0.setName("Nature"); |
---|
| 116 | + skyboxpanel.add(tab0); |
---|
| 117 | + |
---|
| 118 | + cGridBag row0 = new cGridBag(); |
---|
| 119 | + cGridBag row1 = new cGridBag(); |
---|
| 120 | + cGridBag row2 = new cGridBag(); |
---|
| 121 | + cGridBag row3 = new cGridBag(); |
---|
| 122 | + cGridBag row4 = new cGridBag(); |
---|
| 123 | + cGridBag row5 = new cGridBag(); |
---|
| 124 | + cGridBag row6 = new cGridBag(); |
---|
| 125 | + |
---|
| 126 | + AddSkyboxButton("beach", "HeartInTheSand", row0); |
---|
| 127 | + AddSkyboxButton("beach", "LarnacaBeach", row0); |
---|
| 128 | + AddSkyboxButton("beach", "PalmTrees", row0); |
---|
| 129 | + AddSkyboxButton("beach", "Tenerife", row0); |
---|
| 130 | + |
---|
| 131 | + AddSkyboxButton("beach", "Tenerife2", row1); |
---|
| 132 | + AddSkyboxButton("beach", "Tenerife3", row1); |
---|
| 133 | + AddSkyboxButton("field", "FishPond", row1); |
---|
| 134 | + AddSkyboxButton("field", "Footballfield", row1); |
---|
| 135 | + |
---|
| 136 | + AddSkyboxButton("field", "Meadow", row2); |
---|
| 137 | + AddSkyboxButton("field", "Sorsele", row2); |
---|
| 138 | + AddSkyboxButton("field", "Sorsele2", row2); |
---|
| 139 | + AddSkyboxButton("field", "Sorsele3", row2); |
---|
| 140 | + |
---|
| 141 | + AddSkyboxButton("forest", "Brudslojan", row3); |
---|
| 142 | + AddSkyboxButton("forest", "Langholmen2", row3); |
---|
| 143 | + AddSkyboxButton("forest", "Plants", row3); |
---|
| 144 | + AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 145 | + |
---|
| 146 | + AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
| 147 | + AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
| 148 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 149 | + AddSkyboxButton("park", "Tantolunden4", row4); |
---|
| 150 | + |
---|
| 151 | + AddSkyboxButton("park", "Stairs", row5); |
---|
| 152 | + AddSkyboxButton("default", "skycube", row6); |
---|
| 153 | + AddSkyboxButton("rocky", "Langholmen", row5); |
---|
| 154 | + AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 155 | + |
---|
| 156 | + AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 157 | + AddSkyboxButton("default", "CloudyHills", row6); |
---|
| 158 | + AddSkyboxButton("daz", "Autumn", row6); |
---|
| 159 | + AddSkyboxButton("daz", "MountainTrail", row6); |
---|
| 160 | + /* |
---|
| 161 | +Autumn |
---|
| 162 | +Greenlands |
---|
| 163 | +MountainTrail |
---|
| 164 | +Oasis |
---|
| 165 | +TheRock |
---|
| 166 | +TopOfTheWorld |
---|
| 167 | +Winter |
---|
| 168 | + */ |
---|
| 169 | + |
---|
| 170 | + tab0.add(row0); |
---|
| 171 | + tab0.add(row1); |
---|
| 172 | + tab0.add(row2); |
---|
| 173 | + tab0.add(row3); |
---|
| 174 | + tab0.add(row4); |
---|
| 175 | + tab0.add(row5); |
---|
| 176 | + tab0.add(row6); |
---|
| 177 | + |
---|
| 178 | + for (int i=5; --i>=0;) |
---|
| 179 | + { |
---|
| 180 | + //oe.toolboxPanel.Return(); |
---|
| 181 | + //tab0.add(new cGridBag()); |
---|
| 182 | + } |
---|
| 183 | + } |
---|
| 184 | + |
---|
| 185 | + public void AddSkyboxTab2(JTabbedPane skyboxpanel) |
---|
| 186 | + { |
---|
| 187 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 188 | + |
---|
| 189 | + tab0.setName("Night"); |
---|
| 190 | + skyboxpanel.add(tab0); |
---|
| 191 | + |
---|
| 192 | + cGridBag row0 = new cGridBag(); |
---|
| 193 | + cGridBag row1 = new cGridBag(); |
---|
| 194 | + cGridBag row2 = new cGridBag(); |
---|
| 195 | + cGridBag row3 = new cGridBag(); |
---|
| 196 | + cGridBag row4 = new cGridBag(); |
---|
| 197 | + cGridBag row5 = new cGridBag(); |
---|
| 198 | + cGridBag row6 = new cGridBag(); |
---|
| 199 | + |
---|
| 200 | + AddSkyboxButton("night", "NightPath", row0); |
---|
| 201 | + AddSkyboxButton("night", "PondNight", row0); |
---|
| 202 | + AddSkyboxButton("night", "Powerlines", row0); |
---|
| 203 | + AddSkyboxButton("night", "SwedishRoyalCastle", row0); |
---|
| 204 | + |
---|
| 205 | + AddSkyboxButton("urban", "CNTower", row1); |
---|
| 206 | + AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
| 207 | + AddSkyboxButton("rocky", "Riddarfjarden", row1); |
---|
| 208 | + AddSkyboxButton("penguins", "sleepyhollow", row1); |
---|
| 209 | + |
---|
| 210 | + AddSkyboxButton("penguins", "kenon_star", row2); |
---|
| 211 | + AddSkyboxButton("persson", "corona", row2); |
---|
| 212 | + AddSkyboxButton("persson", "spaceskybox", row2); |
---|
| 213 | + AddSkyboxButton("indoors", "Vasa", row2); |
---|
| 214 | + |
---|
| 215 | + AddSkyboxButton("winter", "Backyard", row3); |
---|
| 216 | + AddSkyboxButton("winter", "Creek", row3); |
---|
| 217 | + AddSkyboxButton("winter", "FootballField3", row3); |
---|
| 218 | + AddSkyboxButton("winter", "Forest", row3); |
---|
| 219 | + |
---|
| 220 | + AddSkyboxButton("winter", "HornstullsStrand2", row4); |
---|
| 221 | + AddSkyboxButton("winter", "House", row4); |
---|
| 222 | + AddSkyboxButton("winter", "IceLake", row4); |
---|
| 223 | + AddSkyboxButton("winter", "IceRiver", row4); |
---|
| 224 | + |
---|
| 225 | + AddSkyboxButton("winter", "Park3", row5); |
---|
| 226 | + AddSkyboxButton("winter", "PondWinter", row5); |
---|
| 227 | + AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
| 228 | + AddSkyboxButton("winter", "Vindelalven", row5); |
---|
| 229 | + |
---|
| 230 | + AddSkyboxButton("daz", "TheRock", row6); |
---|
| 231 | + AddSkyboxButton("daz", "TopOfTheWorld", row6); |
---|
| 232 | + AddSkyboxButton("daz", "Winter", row6); |
---|
| 233 | + AddSkyboxButton("mountain", "Ryfjallet", row6); |
---|
| 234 | + |
---|
| 235 | + tab0.add(row0); |
---|
| 236 | + tab0.add(row1); |
---|
| 237 | + tab0.add(row2); |
---|
| 238 | + tab0.add(row3); |
---|
| 239 | + tab0.add(row4); |
---|
| 240 | + tab0.add(row5); |
---|
| 241 | + tab0.add(row6); |
---|
| 242 | + |
---|
| 243 | + for (int i=5; --i>=0;) |
---|
| 244 | + { |
---|
| 245 | + //oe.toolboxPanel.Return(); |
---|
| 246 | + //tab0.add(new cGridBag()); |
---|
| 247 | + } |
---|
| 248 | + } |
---|
| 249 | + |
---|
| 250 | + public void AddSkyboxTab3(JTabbedPane skyboxpanel) |
---|
| 251 | + { |
---|
| 252 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 253 | + |
---|
| 254 | + tab0.setName("Others"); |
---|
| 255 | + skyboxpanel.add(tab0); |
---|
| 256 | + |
---|
| 257 | + cGridBag row0 = new cGridBag(); |
---|
| 258 | + cGridBag row1 = new cGridBag(); |
---|
| 259 | + cGridBag row2 = new cGridBag(); |
---|
| 260 | + cGridBag row3 = new cGridBag(); |
---|
| 261 | + cGridBag row4 = new cGridBag(); |
---|
| 262 | + cGridBag row5 = new cGridBag(); |
---|
| 263 | + cGridBag row6 = new cGridBag(); |
---|
| 264 | + |
---|
| 265 | + AddSkyboxButton("mayhem", "afterrain", row0); |
---|
| 266 | + AddSkyboxButton("mayhem", "aqua4", row0); |
---|
| 267 | + AddSkyboxButton("mayhem", "aqua9", row0); |
---|
| 268 | + AddSkyboxButton("mayhem", "flame", row0); |
---|
| 269 | + |
---|
| 270 | + AddSkyboxButton("mayhem", "h2s", row1); |
---|
| 271 | + AddSkyboxButton("mayhem", "prehistoric", row1); |
---|
| 272 | + AddSkyboxButton("mayhem", "scorched", row1); |
---|
| 273 | + AddSkyboxButton("penguins", "desertdawn", row1); |
---|
| 274 | + |
---|
| 275 | + AddSkyboxButton("persson", "Citadella", row2); |
---|
| 276 | + AddSkyboxButton("persson", "Citadella2", row2); |
---|
| 277 | + AddSkyboxButton("persson", "clouds1", row2); |
---|
| 278 | + AddSkyboxButton("penguins", "wrath", row2); |
---|
| 279 | + |
---|
| 280 | + AddSkyboxButton("persson", "FishermansBastion", row3); |
---|
| 281 | + AddSkyboxButton("persson", "HeroesSquare", row3); |
---|
| 282 | + AddSkyboxButton("indoors", "DallasW", row3); |
---|
| 283 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row3); |
---|
| 284 | + |
---|
| 285 | + AddSkyboxButton("persson", "LancellottiChapel", row4); |
---|
| 286 | + AddSkyboxButton("persson", "PereaBeach1", row4); |
---|
| 287 | + AddSkyboxButton("persson", "PereaBeach2", row4); |
---|
| 288 | + AddSkyboxButton("persson", "redeclipse", row4); |
---|
| 289 | + |
---|
| 290 | + AddSkyboxButton("daz", "Greenlands", row5); |
---|
| 291 | + AddSkyboxButton("daz", "Oasis", row5); |
---|
| 292 | + AddSkyboxButton("elyvisions", "arch3", row5); |
---|
| 293 | + AddSkyboxButton("elyvisions", "calm_sea", row5); |
---|
| 294 | + |
---|
| 295 | + AddSkyboxButton("elyvisions", "rainbow", row6); |
---|
| 296 | + AddSkyboxButton("elyvisions", "distant_sunset", row6); |
---|
| 297 | + AddSkyboxButton("elyvisions", "heaven", row6); |
---|
| 298 | + AddSkyboxButton("elyvisions", "hot", row6); |
---|
| 299 | + |
---|
| 300 | + tab0.add(row0); |
---|
| 301 | + tab0.add(row1); |
---|
| 302 | + tab0.add(row2); |
---|
| 303 | + tab0.add(row3); |
---|
| 304 | + tab0.add(row4); |
---|
| 305 | + tab0.add(row5); |
---|
| 306 | + tab0.add(row6); |
---|
| 307 | + |
---|
| 308 | + for (int i=5; --i>=0;) |
---|
| 309 | + { |
---|
| 310 | + //oe.toolboxPanel.Return(); |
---|
| 311 | + //tab0.add(new cGridBag()); |
---|
| 312 | + } |
---|
| 313 | + } |
---|
| 314 | + |
---|
| 315 | + public void CallBack(String[] path) |
---|
| 316 | + { |
---|
| 317 | + for (int i = 0; i < path.length; i++) |
---|
| 318 | + { |
---|
| 319 | + System.out.print(path[i] + "/"); |
---|
| 320 | + } |
---|
| 321 | + |
---|
| 322 | + System.out.println(); |
---|
| 323 | + } |
---|
| 324 | + |
---|
| 325 | + public void ChangeSkybox(String skybox) |
---|
| 326 | + { |
---|
| 327 | + //cameraView.envyoff = false; |
---|
| 328 | + group.skyboxname = skybox; |
---|
| 329 | + group.skyboxext = "jpg"; |
---|
| 330 | + cameraView.repaint(); |
---|
| 331 | + |
---|
| 332 | + Grafreed.ParseResources("textures", this); |
---|
| 333 | + } |
---|
| 334 | + |
---|
26 | 335 | //ObjEditor objEditor; |
---|
27 | 336 | public void closeUI2() |
---|
28 | 337 | { |
---|
.. | .. |
---|
60 | 369 | this.copy = this.group = group; |
---|
61 | 370 | //selectees = this.group.selectees; |
---|
62 | 371 | |
---|
| 372 | + if (copy.versionlist == null) |
---|
| 373 | + { |
---|
| 374 | + copy.versionlist = new Object3D[100]; |
---|
| 375 | + copy.versionindex = -1; |
---|
| 376 | + } |
---|
| 377 | + |
---|
63 | 378 | if(ui) |
---|
64 | 379 | SetupUI(objEditor); |
---|
65 | 380 | } |
---|
.. | .. |
---|
80 | 395 | SetupViews(objEditor); |
---|
81 | 396 | |
---|
82 | 397 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 398 | + |
---|
| 399 | + if (copy.versionlist == null) |
---|
| 400 | + { |
---|
| 401 | + copy.versionlist = new Object3D[100]; |
---|
| 402 | + copy.versionindex = -1; |
---|
| 403 | + |
---|
| 404 | + Save(true); |
---|
| 405 | + } |
---|
83 | 406 | } |
---|
84 | 407 | |
---|
85 | 408 | void CloneSelection(boolean supports) |
---|
86 | 409 | { |
---|
| 410 | + if (Globals.REPLACEONMAKE) |
---|
| 411 | + Save(); |
---|
| 412 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 413 | + Globals.REPLACEONMAKE = false; |
---|
87 | 414 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 415 | //Object3D obj; |
---|
89 | 416 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 421 | |
---|
95 | 422 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 423 | } |
---|
| 424 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 425 | } |
---|
98 | 426 | |
---|
99 | 427 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
189 | 517 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
190 | 518 | // pasteExpandItem.addActionListener(this); |
---|
191 | 519 | menu.add("-"); |
---|
192 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
193 | | - clearItem.addActionListener(this); |
---|
| 520 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 521 | + deleteItem.addActionListener(this); |
---|
194 | 522 | |
---|
195 | 523 | if (Globals.ADVANCED) |
---|
196 | 524 | { |
---|
.. | .. |
---|
380 | 708 | shadowYItem.addActionListener(this); |
---|
381 | 709 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
382 | 710 | shadowZItem.addActionListener(this); |
---|
| 711 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 712 | + attributeItem.addActionListener(this); |
---|
| 713 | + |
---|
383 | 714 | if (Globals.ADVANCED) |
---|
384 | 715 | { |
---|
385 | 716 | menu.add("-"); |
---|
386 | 717 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
387 | 718 | linkerItem.addActionListener(this); |
---|
388 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
389 | | - attributeItem.addActionListener(this); |
---|
390 | 719 | templateItem = menu.add(new MenuItem("Template")); |
---|
391 | 720 | templateItem.addActionListener(this); |
---|
392 | 721 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
415 | 744 | genNormalsMESHItem.addActionListener(this); |
---|
416 | 745 | if (Globals.ADVANCED) |
---|
417 | 746 | { |
---|
418 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 747 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
419 | 748 | genNormalsMINEItem.addActionListener(this); |
---|
420 | 749 | } |
---|
421 | 750 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
508 | 837 | attachBumpItem.addActionListener(this); |
---|
509 | 838 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
510 | 839 | pigmentBumpItem.addActionListener(this); |
---|
| 840 | + //embedTexturesItem |
---|
511 | 841 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
512 | 842 | detachPigmentItem.addActionListener(this); |
---|
513 | 843 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
514 | 844 | detachBumpItem.addActionListener(this); |
---|
| 845 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 846 | + embedTexturesItem.addActionListener(this); |
---|
| 847 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 848 | + deEmbedTexturesItem.addActionListener(this); |
---|
515 | 849 | menu.add("-"); |
---|
516 | 850 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
517 | 851 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
538 | 872 | buildToolsMenu(menu); |
---|
539 | 873 | } |
---|
540 | 874 | |
---|
| 875 | + |
---|
541 | 876 | void SetupUI2(ObjEditor oe) |
---|
542 | 877 | { |
---|
543 | 878 | // June 2019 |
---|
.. | .. |
---|
582 | 917 | */ |
---|
583 | 918 | cGridBag copyOptionsPanel = new cGridBag(); |
---|
584 | 919 | |
---|
585 | | - copyOptionsPanel.preferredHeight = 1; |
---|
| 920 | + copyOptionsPanel.preferredHeight = 2; |
---|
586 | 921 | |
---|
587 | 922 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
588 | 923 | |
---|
.. | .. |
---|
590 | 925 | //minButton.setToolTipText("Minimize window"); |
---|
591 | 926 | //minButton.addActionListener(this); |
---|
592 | 927 | |
---|
593 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | | - maxButton.setToolTipText("Maximize window"); |
---|
595 | | - maxButton.addActionListener(this); |
---|
| 928 | + if (Globals.ADVANCED) |
---|
| 929 | + { |
---|
| 930 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 931 | + maxButton.setToolTipText("Maximize window"); |
---|
| 932 | + maxButton.addActionListener(this); |
---|
| 933 | + } |
---|
596 | 934 | |
---|
597 | 935 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 936 | fullButton.setToolTipText("Full-screen window"); |
---|
599 | 937 | fullButton.addActionListener(this); |
---|
600 | 938 | |
---|
| 939 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 940 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 941 | + screenfitButton.addActionListener(this); |
---|
| 942 | + |
---|
601 | 943 | oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 944 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
603 | 945 | restoreCameraButton.addActionListener(this); |
---|
604 | 946 | |
---|
605 | | - copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
606 | | - undoButton.setToolTipText("Undo changes"); |
---|
607 | | - undoButton.addActionListener(this); |
---|
608 | | - undoButton.setEnabled(false); |
---|
| 947 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 948 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 949 | + saveVersionButton.addActionListener(this); |
---|
| 950 | + |
---|
| 951 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 952 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 953 | + deleteVersionButton.addActionListener(this); |
---|
| 954 | + |
---|
| 955 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 956 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 957 | + previousVersionButton.addActionListener(this); |
---|
| 958 | + previousVersionButton.setEnabled(false); |
---|
609 | 959 | |
---|
610 | | - copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
611 | | - redoButton.setToolTipText("Redo changes"); |
---|
612 | | - redoButton.addActionListener(this); |
---|
613 | | - redoButton.setEnabled(false); |
---|
| 960 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 961 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 962 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
| 963 | + restoreButton.addActionListener(this); |
---|
| 964 | + //restoreButton.setEnabled(false); |
---|
614 | 965 | |
---|
615 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
616 | | - saveButton.setToolTipText("Save changes"); |
---|
617 | | - saveButton.addActionListener(this); |
---|
| 966 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 967 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
| 968 | + replaceButton.addActionListener(this); |
---|
| 969 | + //replaceButton.setEnabled(false); |
---|
618 | 970 | |
---|
619 | | - copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 971 | + copyOptionsPanel.add(updown); |
---|
| 972 | + |
---|
| 973 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 974 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 975 | + nextVersionButton.addActionListener(this); |
---|
| 976 | + nextVersionButton.setEnabled(false); |
---|
| 977 | + |
---|
| 978 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
620 | 979 | liveCB.setToolTipText("Enable animation"); |
---|
621 | 980 | liveCB.addItemListener(this); |
---|
622 | 981 | |
---|
623 | | - copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 982 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | 983 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
625 | 984 | oneStepButton.addActionListener(this); |
---|
626 | 985 | |
---|
627 | | - copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 986 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
628 | 987 | fastCB.setToolTipText("Fast mode"); |
---|
629 | 988 | fastCB.addItemListener(this); |
---|
630 | 989 | |
---|
631 | 990 | //oe.toolboxPanel.Return(); |
---|
632 | 991 | |
---|
633 | | - copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
635 | | - screenfitButton.addActionListener(this); |
---|
636 | | - |
---|
637 | 992 | // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
638 | 993 | // trackCB.setToolTipText("Enable tracking"); |
---|
639 | 994 | // trackCB.addItemListener(this); |
---|
.. | .. |
---|
646 | 1001 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
647 | 1002 | snapobjectButton.addActionListener(this); |
---|
648 | 1003 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 1004 | + |
---|
| 1005 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1006 | + fourButton.addActionListener(this); |
---|
| 1007 | + fourButton.setToolTipText("Show control panel only"); |
---|
649 | 1008 | } |
---|
650 | 1009 | |
---|
651 | 1010 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
652 | 1011 | |
---|
653 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
654 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 1012 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1013 | + twoButton.setToolTipText("Show 3D view only"); |
---|
655 | 1014 | twoButton.addActionListener(this); |
---|
656 | 1015 | this.fullscreenLayout = twoButton; |
---|
657 | 1016 | |
---|
658 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
659 | | - fourButton.addActionListener(this); |
---|
660 | | - fourButton.setToolTipText("Show left panel only"); |
---|
661 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
662 | | - sixButton.setToolTipText("2-column layout left"); |
---|
663 | | - sixButton.addActionListener(this); |
---|
664 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
665 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 1017 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1018 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
666 | 1019 | threeButton.addActionListener(this); |
---|
667 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
668 | | - sevenButton.setToolTipText("3-column layout"); |
---|
669 | | - sevenButton.addActionListener(this); |
---|
| 1020 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1021 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1022 | + sixButton.addActionListener(this); |
---|
| 1023 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1024 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1025 | +// sevenButton.addActionListener(this); |
---|
670 | 1026 | // |
---|
671 | 1027 | |
---|
672 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
673 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 1028 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1029 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
674 | 1030 | rootButton.addActionListener(this); |
---|
675 | 1031 | |
---|
676 | 1032 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
679 | 1035 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
680 | 1036 | //clearButton.addActionListener(this); |
---|
681 | 1037 | |
---|
| 1038 | + cGridBag row1 = new cGridBag(); |
---|
| 1039 | + |
---|
682 | 1040 | // INSERT |
---|
683 | | - oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1041 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
684 | 1042 | gridButton.setToolTipText("Create grid"); |
---|
685 | 1043 | gridButton.addActionListener(this); |
---|
686 | 1044 | |
---|
687 | | - oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1045 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
688 | 1046 | boxButton.setToolTipText("Create box"); |
---|
689 | 1047 | boxButton.addActionListener(this); |
---|
690 | 1048 | |
---|
691 | | - oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1049 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
692 | 1050 | sphereButton.setToolTipText("Create sphere"); |
---|
693 | 1051 | sphereButton.addActionListener(this); |
---|
694 | 1052 | |
---|
695 | | - oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1053 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
696 | 1054 | coneButton.setToolTipText("Create cone"); |
---|
697 | 1055 | coneButton.addActionListener(this); |
---|
698 | 1056 | |
---|
699 | | - oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1057 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
700 | 1058 | torusButton.setToolTipText("Create torus"); |
---|
701 | 1059 | torusButton.addActionListener(this); |
---|
702 | 1060 | |
---|
703 | | - oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1061 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
704 | 1062 | superButton.setToolTipText("Create superellipsoid"); |
---|
705 | 1063 | superButton.addActionListener(this); |
---|
706 | 1064 | |
---|
.. | .. |
---|
711 | 1069 | kleinButton.addActionListener(this); |
---|
712 | 1070 | } |
---|
713 | 1071 | |
---|
714 | | - oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
715 | 1073 | particlesButton.setToolTipText("Create particle system"); |
---|
716 | 1074 | particlesButton.addActionListener(this); |
---|
717 | 1075 | |
---|
718 | | - oe.toolboxPanel.Return(); |
---|
| 1076 | + oe.toolboxPanel.add(row1); |
---|
719 | 1077 | |
---|
720 | | - oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1078 | + cGridBag row2 = new cGridBag(); |
---|
| 1079 | + |
---|
| 1080 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
721 | 1081 | groupButton.setToolTipText("Create group"); |
---|
722 | 1082 | groupButton.addActionListener(this); |
---|
723 | 1083 | |
---|
724 | | - oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1084 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
725 | 1085 | compositeButton.setToolTipText("Create composite"); |
---|
726 | 1086 | compositeButton.addActionListener(this); |
---|
727 | 1087 | |
---|
728 | | - oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1088 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
729 | 1089 | switchButton.setToolTipText("Create item switcher"); |
---|
730 | 1090 | switchButton.addActionListener(this); |
---|
731 | 1091 | |
---|
732 | | - oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1092 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
733 | 1093 | loopButton.setToolTipText("Create loop"); |
---|
734 | 1094 | loopButton.addActionListener(this); |
---|
735 | 1095 | |
---|
736 | | - oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1096 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
737 | 1097 | textureButton.setToolTipText("Create texture"); |
---|
738 | 1098 | textureButton.addActionListener(this); |
---|
739 | 1099 | |
---|
740 | | - oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1100 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
741 | 1101 | overlayButton.setToolTipText("Create overlay"); |
---|
742 | 1102 | overlayButton.addActionListener(this); |
---|
743 | 1103 | |
---|
744 | | - oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1104 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
745 | 1105 | lightButton.setToolTipText("Create light"); |
---|
746 | 1106 | lightButton.addActionListener(this); |
---|
747 | 1107 | |
---|
748 | | - for (int i=6; --i>=0;) |
---|
749 | | - { |
---|
750 | | - oe.toolboxPanel.Return(); |
---|
751 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
752 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
753 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
754 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
755 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
756 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
757 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
758 | | - } |
---|
| 1108 | + oe.toolboxPanel.add(row2); |
---|
| 1109 | + |
---|
| 1110 | + // ENVYMAPS |
---|
| 1111 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1112 | + skyboxpane.preferredHeight = 100; |
---|
| 1113 | + |
---|
| 1114 | + oe.skyboxPanel.add(skyboxpane); |
---|
| 1115 | + |
---|
| 1116 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1117 | + skyboxpane.add(skyboxpanel); |
---|
| 1118 | + |
---|
| 1119 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1120 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1121 | + AddSkyboxTab2(skyboxpanel); |
---|
| 1122 | + AddSkyboxTab3(skyboxpanel); |
---|
759 | 1123 | |
---|
760 | 1124 | // EDIT panel |
---|
761 | 1125 | editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
763 | 1127 | editButton.addActionListener(this); |
---|
764 | 1128 | |
---|
765 | 1129 | editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
766 | | - uneditButton.setToolTipText("Remove selection controls"); |
---|
| 1130 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
767 | 1131 | uneditButton.addActionListener(this); |
---|
768 | 1132 | |
---|
769 | 1133 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
770 | 1134 | allParamsButton.setToolTipText("Show all controle"); |
---|
771 | 1135 | allParamsButton.addActionListener(this); |
---|
772 | 1136 | |
---|
773 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1137 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
774 | 1138 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
775 | 1139 | clearPanelButton.addActionListener(this); |
---|
776 | 1140 | |
---|
777 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
778 | | - unselectButton.setToolTipText("Unselect"); |
---|
779 | | - unselectButton.addActionListener(this); |
---|
| 1141 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1142 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1143 | + //unselectButton.addActionListener(this); |
---|
780 | 1144 | |
---|
781 | 1145 | editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
782 | 1146 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
.. | .. |
---|
811 | 1175 | |
---|
812 | 1176 | oe.treePanel.add(copyOptionsPanel); |
---|
813 | 1177 | oe.treePanel.Return(); |
---|
| 1178 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1179 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1180 | + sliderPane.preferredHeight = 1; |
---|
814 | 1181 | |
---|
815 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
816 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1182 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1183 | + mainPanel.setResizeWeight(0.4); |
---|
817 | 1184 | |
---|
818 | 1185 | //jList.addListSelectionListener(this); |
---|
819 | 1186 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
821 | 1188 | //jTree.setEditable(true); |
---|
822 | 1189 | oe.jTree.setDragEnabled(true); |
---|
823 | 1190 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
824 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1191 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
825 | 1192 | |
---|
826 | 1193 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
827 | 1194 | |
---|
.. | .. |
---|
833 | 1200 | dgr.addDragGestureListener(this); |
---|
834 | 1201 | }catch(Exception e) {} |
---|
835 | 1202 | */ |
---|
836 | | - radio.layout = sevenButton; |
---|
| 1203 | + radio.layout = threeButton; // sixButton; |
---|
837 | 1204 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
838 | 1205 | } |
---|
839 | 1206 | |
---|
.. | .. |
---|
884 | 1251 | smoothCB.setToolTipText("Snapping delay"); |
---|
885 | 1252 | smoothCB.addItemListener(this); |
---|
886 | 1253 | |
---|
887 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
888 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
889 | | - slowCB.addItemListener(this); |
---|
| 1254 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1255 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1256 | +// slowCB.addItemListener(this); |
---|
| 1257 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1258 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1259 | + minshaderCB.addItemListener(this); |
---|
890 | 1260 | |
---|
891 | 1261 | // constraints.gridy += 1; |
---|
892 | 1262 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
.. | .. |
---|
936 | 1306 | toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
937 | 1307 | toggleSwitchCB.addItemListener(this); |
---|
938 | 1308 | |
---|
939 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
940 | | - autosaveCB.setToolTipText("On structure change"); |
---|
941 | | - autosaveCB.addItemListener(this); |
---|
| 1309 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1310 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1311 | + autokeepCB.addItemListener(this); |
---|
942 | 1312 | |
---|
943 | 1313 | panel.Return(); |
---|
944 | 1314 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
967 | 1337 | { |
---|
968 | 1338 | cRadio radioButton = new cRadio(obj.name); |
---|
969 | 1339 | |
---|
970 | | - // Patch to avoid bug with transparency. |
---|
| 1340 | + // June 2019. Patch to avoid bug with transparency. |
---|
971 | 1341 | radioButton.hadMaterial = obj.material != null; |
---|
972 | 1342 | if (!radioButton.hadMaterial) |
---|
973 | 1343 | { |
---|
.. | .. |
---|
975 | 1345 | } |
---|
976 | 1346 | |
---|
977 | 1347 | radioButton.SetObject(obj); |
---|
978 | | - radioButton.layout = sevenButton; |
---|
| 1348 | + radioButton.layout = threeButton; // sixButton; |
---|
979 | 1349 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
980 | 1350 | radioButton.addActionListener(this); |
---|
981 | 1351 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1000 | 1370 | cCheckBox localCB; |
---|
1001 | 1371 | cCheckBox crowdCB; |
---|
1002 | 1372 | cCheckBox smoothCB; |
---|
| 1373 | + cCheckBox minshaderCB; |
---|
| 1374 | + |
---|
1003 | 1375 | cToggleButton fastCB; |
---|
1004 | 1376 | cCheckBox slowCB; |
---|
1005 | 1377 | cCheckBox boxCB; |
---|
.. | .. |
---|
1015 | 1387 | |
---|
1016 | 1388 | cCheckBox oeilCB; |
---|
1017 | 1389 | cCheckBox shadowCB; |
---|
1018 | | - cCheckBox autosaveCB; |
---|
| 1390 | + cCheckBox autokeepCB; |
---|
1019 | 1391 | cCheckBox lookAtCB; |
---|
1020 | 1392 | |
---|
1021 | 1393 | // static int COLOR = 1; |
---|
.. | .. |
---|
1070 | 1442 | { |
---|
1071 | 1443 | cameraView.ToggleInertia(); |
---|
1072 | 1444 | cameraView.repaint(); |
---|
| 1445 | + } |
---|
| 1446 | + else if(e.getSource() == minshaderCB) |
---|
| 1447 | + { |
---|
| 1448 | + Globals.MINSHADER ^= true; |
---|
| 1449 | + cameraView.programInitialized = false; |
---|
| 1450 | + cameraView.repaint(); |
---|
1073 | 1451 | } |
---|
1074 | 1452 | else if(e.getSource() == localCB) |
---|
1075 | 1453 | { |
---|
.. | .. |
---|
1127 | 1505 | { |
---|
1128 | 1506 | Globals.FREEZEONMOVE ^= true; |
---|
1129 | 1507 | } |
---|
1130 | | - else if(e.getSource() == autosaveCB) |
---|
| 1508 | + else if(e.getSource() == autokeepCB) |
---|
1131 | 1509 | { |
---|
1132 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1510 | + Globals.REPLACEONMAKE ^= true; |
---|
1133 | 1511 | } |
---|
1134 | 1512 | else if(e.getSource() == lookAtCB) |
---|
1135 | 1513 | { |
---|
.. | .. |
---|
1211 | 1589 | } |
---|
1212 | 1590 | } |
---|
1213 | 1591 | |
---|
1214 | | - String string = (String) object; |
---|
1215 | | - |
---|
1216 | 1592 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1217 | 1593 | // if( object instanceof java.io.File[]) |
---|
1218 | 1594 | // { |
---|
.. | .. |
---|
1220 | 1596 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1221 | 1597 | // return; |
---|
1222 | 1598 | // } |
---|
| 1599 | + |
---|
| 1600 | + String string = object.toString(); |
---|
1223 | 1601 | |
---|
1224 | 1602 | // File path for Mac and Windows |
---|
1225 | 1603 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1469 | 1847 | animationItem.addItemListener(this); |
---|
1470 | 1848 | animationItem.setState(Globals.ANIMATION); |
---|
1471 | 1849 | |
---|
| 1850 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1851 | + archiveItem.addActionListener(this); |
---|
| 1852 | + |
---|
1472 | 1853 | menu.add("-"); |
---|
1473 | 1854 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1474 | 1855 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1481 | 1862 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1482 | 1863 | reduce34MorphItem.addActionListener(this); |
---|
1483 | 1864 | menu.add("-"); |
---|
| 1865 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1866 | + memoryItem.addActionListener(this); |
---|
1484 | 1867 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1485 | 1868 | computeAOItem.addActionListener(this); |
---|
1486 | 1869 | |
---|
.. | .. |
---|
1489 | 1872 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1490 | 1873 | mirrorItem.addActionListener(this); |
---|
1491 | 1874 | menu.add("-"); |
---|
1492 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1493 | | - memoryItem.addActionListener(this); |
---|
1494 | 1875 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1495 | 1876 | analyzeItem.addActionListener(this); |
---|
1496 | 1877 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1651 | 2032 | listUI.remove(i); |
---|
1652 | 2033 | } |
---|
1653 | 2034 | } |
---|
| 2035 | + } |
---|
| 2036 | + |
---|
| 2037 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2038 | + { |
---|
| 2039 | + // if (!(elem instanceof Composite)) |
---|
| 2040 | + // newWindow = false; |
---|
| 2041 | + listUI.add(elem); |
---|
| 2042 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2043 | + System.out.println("edit : " + elem); |
---|
| 2044 | + elem.editWindow.refreshContents(true); // ? new |
---|
1654 | 2045 | } |
---|
1655 | 2046 | |
---|
1656 | 2047 | /** |
---|
.. | .. |
---|
2080 | 2471 | { |
---|
2081 | 2472 | makeSomething(new Light()); |
---|
2082 | 2473 | } else |
---|
| 2474 | +// if (source == skybox1Button || |
---|
| 2475 | +// source == skybox2Button || |
---|
| 2476 | +// source == skybox3Button || |
---|
| 2477 | +// source == skybox4Button || |
---|
| 2478 | +// source == skybox5Button || |
---|
| 2479 | +// source == skybox6Button || |
---|
| 2480 | +// source == skybox7Button || |
---|
| 2481 | +// source == skybox11Button || |
---|
| 2482 | +// source == skybox12Button || |
---|
| 2483 | +// source == skybox13Button || |
---|
| 2484 | +// source == skybox14Button || |
---|
| 2485 | +// source == skybox15Button || |
---|
| 2486 | +// source == skybox16Button || |
---|
| 2487 | +// source == skybox17Button) |
---|
| 2488 | +// { |
---|
| 2489 | +// ChangeSkybox(source); |
---|
| 2490 | +// } else |
---|
2083 | 2491 | if (source == csgItem) |
---|
2084 | 2492 | { |
---|
2085 | 2493 | group(new CSG()); |
---|
.. | .. |
---|
2165 | 2573 | if (source == computeAOItem) |
---|
2166 | 2574 | { |
---|
2167 | 2575 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
2168 | | - Globals.theRenderer.repaint(); |
---|
| 2576 | + cameraView.repaint(); |
---|
2169 | 2577 | } else |
---|
2170 | 2578 | if (source == recompileItem) |
---|
2171 | 2579 | { |
---|
.. | .. |
---|
2180 | 2588 | if (source == invariantsItem) |
---|
2181 | 2589 | { |
---|
2182 | 2590 | System.out.println("Invariants:"); |
---|
2183 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2591 | + Grafreed.grafreed.universe.invariants(); |
---|
2184 | 2592 | } else |
---|
2185 | 2593 | if (source == memoryItem) |
---|
2186 | 2594 | { |
---|
.. | .. |
---|
2211 | 2619 | { |
---|
2212 | 2620 | ToggleFullScreen(); |
---|
2213 | 2621 | } else |
---|
2214 | | - if (source == undoButton) |
---|
| 2622 | + if (source == previousVersionButton) |
---|
2215 | 2623 | { |
---|
2216 | | - Undo(); |
---|
| 2624 | + // Go to previous version |
---|
| 2625 | + //if (!Undo()) |
---|
| 2626 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2627 | + PreviousVersion(); |
---|
2217 | 2628 | } else |
---|
2218 | | - if (source == redoButton) |
---|
| 2629 | + if (source == restoreButton) |
---|
2219 | 2630 | { |
---|
2220 | | - Redo(); |
---|
| 2631 | + // Restore current version |
---|
| 2632 | + Restore(); |
---|
| 2633 | + //restoreButton.setEnabled(false); |
---|
2221 | 2634 | } else |
---|
2222 | | - if (source == saveButton) |
---|
| 2635 | + if (source == replaceButton) |
---|
2223 | 2636 | { |
---|
2224 | | - Save(); |
---|
| 2637 | + // Overwrite current version |
---|
| 2638 | + Replace(); |
---|
| 2639 | + //replaceButton.setEnabled(false); |
---|
| 2640 | + } else |
---|
| 2641 | + if (source == nextVersionButton) |
---|
| 2642 | + { |
---|
| 2643 | + // Go to next version |
---|
| 2644 | + NextVersion(); |
---|
| 2645 | + } else |
---|
| 2646 | + if (source == saveVersionButton) |
---|
| 2647 | + { |
---|
| 2648 | + // Save a new version |
---|
| 2649 | + if (!Save(true)) |
---|
| 2650 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2651 | + } else |
---|
| 2652 | + if (source == deleteVersionButton) |
---|
| 2653 | + { |
---|
| 2654 | + // Delete a new version |
---|
| 2655 | + DeleteVersion(); |
---|
2225 | 2656 | } else |
---|
2226 | 2657 | if (source == oneStepButton) |
---|
2227 | 2658 | { |
---|
.. | .. |
---|
2230 | 2661 | } else |
---|
2231 | 2662 | if (source == screenfitButton) |
---|
2232 | 2663 | { |
---|
2233 | | - //Reload(lastConverter, lastFilename, true); |
---|
2234 | 2664 | ScreenFit(); |
---|
2235 | 2665 | } else |
---|
2236 | 2666 | if (source == screenfitpointButton) |
---|
2237 | 2667 | { |
---|
2238 | | - //Reload(lastConverter, lastFilename, true); |
---|
2239 | 2668 | ScreenFitPoint(); |
---|
2240 | 2669 | } else |
---|
2241 | 2670 | if (source == snapobjectButton) |
---|
2242 | 2671 | { |
---|
2243 | | - //Reload(lastConverter, lastFilename, true); |
---|
2244 | 2672 | SnapObject(); |
---|
2245 | 2673 | } else |
---|
2246 | 2674 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2279 | 2707 | } else |
---|
2280 | 2708 | if (source == undoItem) |
---|
2281 | 2709 | { |
---|
2282 | | - Undo(); |
---|
| 2710 | + PreviousVersion(); |
---|
2283 | 2711 | } else |
---|
2284 | 2712 | if (source == redoItem) |
---|
2285 | 2713 | { |
---|
2286 | | - Redo(); |
---|
| 2714 | + NextVersion(); |
---|
2287 | 2715 | } else |
---|
2288 | 2716 | if (source == duplicateItem) |
---|
2289 | 2717 | { |
---|
.. | .. |
---|
2604 | 3032 | { |
---|
2605 | 3033 | StepAll(); |
---|
2606 | 3034 | } else |
---|
2607 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 3035 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2608 | 3036 | { |
---|
2609 | 3037 | //int indices[] = jList.getSelectedIndices(); |
---|
2610 | 3038 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
3086 | 3514 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3087 | 3515 | { |
---|
3088 | 3516 | obj = (Object3D)e.nextElement(); |
---|
3089 | | - obj.SetBumpTexture(null); |
---|
| 3517 | + obj.ResetBumpTexture(); |
---|
3090 | 3518 | } |
---|
3091 | 3519 | |
---|
3092 | 3520 | refreshContents(); |
---|
.. | .. |
---|
3100 | 3528 | obj.SetBumpTexture(obj.GetPigmentTexture()); |
---|
3101 | 3529 | } |
---|
3102 | 3530 | |
---|
| 3531 | + refreshContents(); |
---|
| 3532 | + } else |
---|
| 3533 | + if (source == embedTexturesItem) |
---|
| 3534 | + { |
---|
| 3535 | + Object3D obj; |
---|
| 3536 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3537 | + { |
---|
| 3538 | + obj = (Object3D)e.nextElement(); |
---|
| 3539 | + obj.EmbedTextures(true); |
---|
| 3540 | + } |
---|
| 3541 | + |
---|
| 3542 | + refreshContents(); |
---|
| 3543 | + } else |
---|
| 3544 | + if (source == deEmbedTexturesItem) |
---|
| 3545 | + { |
---|
| 3546 | + Object3D obj; |
---|
| 3547 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3548 | + { |
---|
| 3549 | + obj = (Object3D)e.nextElement(); |
---|
| 3550 | + obj.EmbedTextures(false); |
---|
| 3551 | + } |
---|
| 3552 | + |
---|
| 3553 | + CameraPane.texturepigment.clear(); |
---|
| 3554 | + CameraPane.texturebump.clear(); |
---|
| 3555 | + |
---|
3103 | 3556 | refreshContents(); |
---|
3104 | 3557 | } else |
---|
3105 | 3558 | if (source == flashSelectionButton) |
---|
.. | .. |
---|
3203 | 3656 | // centralPanel.setVisible(true); |
---|
3204 | 3657 | // XYZPanel.setVisible(true); |
---|
3205 | 3658 | bigThree.ClearUI(); |
---|
| 3659 | + bigThree.add(scenePanel); |
---|
3206 | 3660 | bigThree.add(centralPanel); |
---|
3207 | | - bigThree.add(XYZPanel); |
---|
3208 | 3661 | bigThree.FlushUI(); |
---|
3209 | 3662 | |
---|
3210 | 3663 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3284 | 3737 | // centralPanel.setVisible(true); |
---|
3285 | 3738 | // XYZPanel.setVisible(false); |
---|
3286 | 3739 | bigThree.ClearUI(); |
---|
3287 | | - bigThree.add(scenePanel); |
---|
3288 | 3740 | bigThree.add(centralPanel); |
---|
| 3741 | + bigThree.add(scenePanel); |
---|
3289 | 3742 | bigThree.FlushUI(); |
---|
3290 | 3743 | |
---|
3291 | 3744 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3391 | 3844 | { |
---|
3392 | 3845 | Object3D child = (Object3D)e.nextElement(); |
---|
3393 | 3846 | if(child.editWindow != null) |
---|
3394 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3395 | 3847 | child.pinned = false; |
---|
3396 | 3848 | child.CloseUI(); |
---|
3397 | 3849 | listUI.remove(child); |
---|
| 3850 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3398 | 3851 | |
---|
3399 | 3852 | //child.editWindow = null; // ??????????? |
---|
3400 | 3853 | } |
---|
.. | .. |
---|
3413 | 3866 | obj.CloseUI(); |
---|
3414 | 3867 | } |
---|
3415 | 3868 | listUI.clear(); |
---|
| 3869 | + SetPinStates(group.selection.size() > 0); |
---|
3416 | 3870 | refreshContents(true); |
---|
3417 | 3871 | } else |
---|
3418 | 3872 | if (source == allParamsButton) |
---|
.. | .. |
---|
3468 | 3922 | } |
---|
3469 | 3923 | |
---|
3470 | 3924 | copy = group; |
---|
| 3925 | + |
---|
| 3926 | + SetUndoStates(); |
---|
| 3927 | + |
---|
3471 | 3928 | //Globals.theRenderer.object = group; |
---|
3472 | 3929 | if(!useclient) |
---|
3473 | 3930 | { |
---|
.. | .. |
---|
3496 | 3953 | radio.layout.doClick(); |
---|
3497 | 3954 | |
---|
3498 | 3955 | ClearUnpinned(); |
---|
3499 | | - SetPinStates(group.selection.size() > 0); |
---|
3500 | | - if (group.selection.size() == 1) |
---|
| 3956 | + |
---|
| 3957 | + //Grafreed.Assert(group != null); |
---|
| 3958 | + //Grafreed.Assert(group.selection != null); |
---|
| 3959 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3960 | + if (group.selection == null || group.selection.size() == 1) |
---|
3501 | 3961 | EditSelection(false); |
---|
3502 | 3962 | keepparent = group.parent; |
---|
3503 | 3963 | // PARENT = NULL or not??? |
---|
.. | .. |
---|
3510 | 3970 | } else if (event.getSource() == editCameraItem) |
---|
3511 | 3971 | { |
---|
3512 | 3972 | cameraView.ProtectCamera(); |
---|
| 3973 | + cameraView.requestFocusInWindow(); |
---|
3513 | 3974 | cameraView.repaint(); |
---|
3514 | 3975 | return; |
---|
3515 | 3976 | } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3516 | 3977 | { |
---|
3517 | 3978 | cameraView.RevertCamera(); |
---|
| 3979 | + cameraView.requestFocusInWindow(); |
---|
3518 | 3980 | cameraView.repaint(); |
---|
3519 | 3981 | return; |
---|
3520 | 3982 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
4091 | 4553 | |
---|
4092 | 4554 | try |
---|
4093 | 4555 | { |
---|
4094 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4556 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
4095 | 4557 | } |
---|
4096 | 4558 | catch (Exception e) |
---|
4097 | 4559 | { |
---|
.. | .. |
---|
4568 | 5030 | |
---|
4569 | 5031 | void EditSelection(boolean newWindow) |
---|
4570 | 5032 | { |
---|
| 5033 | + if (group.selection == null) |
---|
| 5034 | + { |
---|
| 5035 | + EditElement(group, newWindow); // ? new |
---|
| 5036 | + return; |
---|
| 5037 | + } |
---|
| 5038 | + |
---|
4571 | 5039 | // aConstraints.gridy = 0; |
---|
4572 | 5040 | for (int i=0; i<group.selection.size(); i++) |
---|
4573 | 5041 | { |
---|
.. | .. |
---|
4578 | 5046 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4579 | 5047 | if(elem != group || !newWindow) |
---|
4580 | 5048 | { |
---|
4581 | | - // if (!(elem instanceof Composite)) |
---|
4582 | | - // newWindow = false; |
---|
4583 | | - listUI.add(elem); |
---|
4584 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4585 | | - System.out.println("edit : " + elem); |
---|
4586 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5049 | + EditElement(elem, newWindow); // ? new |
---|
4587 | 5050 | } |
---|
4588 | 5051 | } |
---|
4589 | 5052 | } |
---|
.. | .. |
---|
4646 | 5109 | |
---|
4647 | 5110 | freezemodel = false; |
---|
4648 | 5111 | } |
---|
4649 | | - |
---|
4650 | | - boolean flashIt = true; |
---|
4651 | | - |
---|
| 5112 | + |
---|
4652 | 5113 | public void valueChanged(TreeSelectionEvent e) |
---|
4653 | 5114 | //public boolean handleEvent(Event event) |
---|
4654 | 5115 | { |
---|
.. | .. |
---|
4721 | 5182 | { |
---|
4722 | 5183 | editButton.setEnabled(enabled); |
---|
4723 | 5184 | uneditButton.setEnabled(enabled); |
---|
4724 | | - unselectButton.setEnabled(enabled); |
---|
| 5185 | + //unselectButton.setEnabled(enabled); |
---|
4725 | 5186 | flashSelectionButton.setEnabled(enabled); |
---|
| 5187 | + |
---|
| 5188 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
4726 | 5189 | } |
---|
4727 | 5190 | |
---|
4728 | 5191 | void refreshContents(boolean cp) |
---|
4729 | 5192 | { |
---|
4730 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4731 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 5193 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5194 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4732 | 5195 | { |
---|
4733 | 5196 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4734 | 5197 | |
---|
.. | .. |
---|
4827 | 5290 | |
---|
4828 | 5291 | if (cut) |
---|
4829 | 5292 | { |
---|
4830 | | - if (Globals.SAVEONMAKE) |
---|
4831 | | - Save(); |
---|
| 5293 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5294 | +// Save(); |
---|
4832 | 5295 | //int indices[] = jList.getSelectedIndices(); |
---|
4833 | 5296 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4834 | 5297 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4931 | 5394 | |
---|
4932 | 5395 | void paste(boolean expand) |
---|
4933 | 5396 | { |
---|
| 5397 | + if (Globals.REPLACEONMAKE) |
---|
| 5398 | + Save(); |
---|
| 5399 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5400 | + Globals.REPLACEONMAKE = false; |
---|
4934 | 5401 | // if (GrafreeD.clipboard == null) |
---|
4935 | 5402 | // return; |
---|
4936 | 5403 | boolean first = true; |
---|
.. | .. |
---|
4990 | 5457 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4991 | 5458 | } |
---|
4992 | 5459 | |
---|
| 5460 | + Globals.REPLACEONMAKE = keep; |
---|
4993 | 5461 | ResetModel(); |
---|
4994 | 5462 | refreshContents(); |
---|
4995 | 5463 | } |
---|
.. | .. |
---|
5125 | 5593 | |
---|
5126 | 5594 | void group(Object3D csg, boolean grab) |
---|
5127 | 5595 | { |
---|
| 5596 | + if (Globals.REPLACEONMAKE) |
---|
| 5597 | + Save(); |
---|
| 5598 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5599 | + Globals.REPLACEONMAKE = false; |
---|
5128 | 5600 | if (//false) // why?? |
---|
5129 | 5601 | !group.selection.isEmpty()) |
---|
5130 | 5602 | { |
---|
.. | .. |
---|
5238 | 5710 | //node.add(csg); |
---|
5239 | 5711 | //makeSomething(node); |
---|
5240 | 5712 | makeSomething(csg); |
---|
| 5713 | + Globals.REPLACEONMAKE = keep; |
---|
5241 | 5714 | } |
---|
5242 | 5715 | |
---|
5243 | 5716 | void Ungroup(Object3D g) |
---|
5244 | 5717 | { |
---|
| 5718 | + if (Globals.REPLACEONMAKE) |
---|
| 5719 | + Save(); |
---|
| 5720 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5721 | + Globals.REPLACEONMAKE = false; |
---|
5245 | 5722 | if (g instanceof HiddenObject) |
---|
5246 | 5723 | { |
---|
5247 | 5724 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5258 | 5735 | objEditor.makeSomething(g.get(i), false); |
---|
5259 | 5736 | } |
---|
5260 | 5737 | } |
---|
| 5738 | + Globals.REPLACEONMAKE = keep; |
---|
5261 | 5739 | } |
---|
5262 | 5740 | |
---|
5263 | 5741 | void ungroup() |
---|
.. | .. |
---|
5548 | 6026 | |
---|
5549 | 6027 | cButton restoreCameraButton; |
---|
5550 | 6028 | |
---|
5551 | | - cButton saveButton; |
---|
5552 | 6029 | cButton oneStepButton; |
---|
5553 | 6030 | |
---|
5554 | 6031 | cButton groupButton; |
---|
.. | .. |
---|
5557 | 6034 | cButton switchButton; |
---|
5558 | 6035 | cButton loopButton; |
---|
5559 | 6036 | cButton textureButton; |
---|
| 6037 | + |
---|
| 6038 | + cButton skybox1Button; |
---|
| 6039 | + cButton skybox2Button; |
---|
| 6040 | + cButton skybox3Button; |
---|
| 6041 | + cButton skybox4Button; |
---|
| 6042 | + cButton skybox5Button; |
---|
| 6043 | + cButton skybox6Button; |
---|
| 6044 | + cButton skybox7Button; |
---|
| 6045 | + |
---|
| 6046 | + cButton skybox11Button; |
---|
| 6047 | + cButton skybox12Button; |
---|
| 6048 | + cButton skybox13Button; |
---|
| 6049 | + cButton skybox14Button; |
---|
| 6050 | + cButton skybox15Button; |
---|
| 6051 | + cButton skybox16Button; |
---|
| 6052 | + cButton skybox17Button; |
---|
5560 | 6053 | |
---|
5561 | 6054 | cButton gridButton; |
---|
5562 | 6055 | cButton boxButton; |
---|
.. | .. |
---|
5621 | 6114 | private MenuItem pasteLinkItem; |
---|
5622 | 6115 | private MenuItem pasteCloneItem; |
---|
5623 | 6116 | private MenuItem pasteExpandItem; |
---|
5624 | | - private MenuItem clearItem; |
---|
| 6117 | + private MenuItem deleteItem; |
---|
5625 | 6118 | private MenuItem clearAllItem; |
---|
5626 | 6119 | private MenuItem genUVItem; |
---|
5627 | 6120 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5705 | 6198 | private MenuItem attachBumpItem; |
---|
5706 | 6199 | private MenuItem detachBumpItem; |
---|
5707 | 6200 | private MenuItem pigmentBumpItem; |
---|
| 6201 | + private MenuItem embedTexturesItem; |
---|
| 6202 | + private MenuItem deEmbedTexturesItem; |
---|
5708 | 6203 | |
---|
5709 | 6204 | private MenuItem particleItem; |
---|
5710 | 6205 | private MenuItem ragdollItem; |
---|