.. | .. |
---|
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, |
---|
.. | .. |
---|
28 | 29 | { |
---|
29 | 30 | cButton skyboxButton; |
---|
30 | 31 | final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
31 | | - //row.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF)); |
---|
32 | | - row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
33 | | - skyboxButton.setToolTipText(s); |
---|
| 32 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF)); |
---|
| 33 | + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 34 | + skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
34 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
35 | 36 | { |
---|
36 | 37 | @Override |
---|
.. | .. |
---|
41 | 42 | }); |
---|
42 | 43 | } |
---|
43 | 44 | |
---|
| 45 | + public void AddTextureButton(String f, String c, final String t, int count, cGridBag row) |
---|
| 46 | + { |
---|
| 47 | + cButton textureButton; |
---|
| 48 | + final String path = "textures/" + f + "/" + c + "/"; // + t; |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF)); |
---|
| 50 | + textureButton.setToolTipText(c + count); |
---|
| 51 | + textureButton.addActionListener(new ActionListener() |
---|
| 52 | + { |
---|
| 53 | + @Override |
---|
| 54 | + public void actionPerformed(ActionEvent e) |
---|
| 55 | + { |
---|
| 56 | + ChangeTexture(path + t); |
---|
| 57 | + } |
---|
| 58 | + }); |
---|
| 59 | + } |
---|
| 60 | + |
---|
44 | 61 | public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
45 | 62 | { |
---|
46 | 63 | cGridBag tab0 = new cGridBag().setVertical(true); |
---|
.. | .. |
---|
56 | 73 | cGridBag row5 = new cGridBag(); |
---|
57 | 74 | cGridBag row6 = new cGridBag(); |
---|
58 | 75 | |
---|
59 | | - AddSkyboxButton("default", "rgb", row0); |
---|
60 | | - AddSkyboxButton("default", "cornell", row0); |
---|
61 | | - AddSkyboxButton("default", "uffizi", row0); |
---|
62 | | - AddSkyboxButton("default", "CloudyHills", row0); |
---|
63 | | - |
---|
64 | | - AddSkyboxButton("default", "skycube", row1); |
---|
| 76 | + AddSkyboxButton("default", "", row0); |
---|
| 77 | + //AddSkyboxButton("default", "cornell", row0); |
---|
| 78 | + AddSkyboxButton("penguins", "dust", row0); |
---|
| 79 | + AddSkyboxButton("penguins", "tropic", row0); |
---|
| 80 | + AddSkyboxButton("penguins", "yonder", row0); |
---|
| 81 | + |
---|
| 82 | + AddSkyboxButton("default", "uffizi", row1); |
---|
65 | 83 | AddSkyboxButton("bridge", "Bridge", row1); |
---|
66 | 84 | AddSkyboxButton("bridge", "Bridge2", row1); |
---|
67 | 85 | AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
.. | .. |
---|
73 | 91 | |
---|
74 | 92 | AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
75 | 93 | AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 94 | + AddSkyboxButton("urban", "Medborgarplatsen", row3); |
---|
76 | 95 | AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
77 | | - AddSkyboxButton("park", "Buddha", row3); |
---|
78 | 96 | |
---|
| 97 | + AddSkyboxButton("park", "Buddha", row4); |
---|
79 | 98 | AddSkyboxButton("park", "CNTower2", row4); |
---|
80 | 99 | AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
81 | 100 | AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
82 | | - AddSkyboxButton("park", "Park", row4); |
---|
83 | 101 | |
---|
| 102 | + AddSkyboxButton("park", "Park", row5); |
---|
84 | 103 | AddSkyboxButton("park", "Pond", row5); |
---|
85 | 104 | AddSkyboxButton("park", "Skansen", row5); |
---|
86 | 105 | AddSkyboxButton("park", "Skansen2", row5); |
---|
87 | | - AddSkyboxButton("park", "Skansen3", row5); |
---|
88 | 106 | |
---|
| 107 | + AddSkyboxButton("park", "Skansen3", row6); |
---|
89 | 108 | AddSkyboxButton("park", "Skansen4", row6); |
---|
90 | 109 | AddSkyboxButton("park", "Skansen5", row6); |
---|
91 | | - AddSkyboxButton("park", "Stairs", row6); |
---|
92 | | - AddSkyboxButton("park", "Tantolunden4", row6); |
---|
| 110 | + AddSkyboxButton("persson", "VancouverConventionCentre", row6); |
---|
93 | 111 | |
---|
94 | 112 | tab0.add(row0); |
---|
95 | 113 | tab0.add(row1); |
---|
.. | .. |
---|
140 | 158 | AddSkyboxButton("forest", "Langholmen2", row3); |
---|
141 | 159 | AddSkyboxButton("forest", "Plants", row3); |
---|
142 | 160 | AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 161 | + |
---|
143 | 162 | AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
144 | | - |
---|
145 | 163 | AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
146 | | - AddSkyboxButton("mountain", "Ryfjallet", row4); |
---|
147 | | - AddSkyboxButton("mountain", "Teide", row4); |
---|
| 164 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 165 | + AddSkyboxButton("park", "Tantolunden4", row4); |
---|
148 | 166 | |
---|
| 167 | + AddSkyboxButton("park", "Stairs", row5); |
---|
| 168 | + AddSkyboxButton("default", "skycube", row6); |
---|
149 | 169 | AddSkyboxButton("rocky", "Langholmen", row5); |
---|
150 | | - AddSkyboxButton("rocky", "Riddarfjarden", row5); |
---|
151 | 170 | AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 171 | + |
---|
152 | 172 | AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 173 | + AddSkyboxButton("default", "CloudyHills", row6); |
---|
| 174 | + AddSkyboxButton("daz", "Autumn", row6); |
---|
| 175 | + AddSkyboxButton("daz", "MountainTrail", row6); |
---|
153 | 176 | /* |
---|
154 | | -Kastellholmen |
---|
155 | | -Langholmen |
---|
156 | | -Riddarfjarden |
---|
157 | | -Skinnarviksberget |
---|
158 | | -Tanto |
---|
159 | | -Tantolunden2 |
---|
160 | | -Tantolunden6 |
---|
| 177 | +Autumn |
---|
| 178 | +Greenlands |
---|
| 179 | +MountainTrail |
---|
| 180 | +Oasis |
---|
| 181 | +TheRock |
---|
| 182 | +TopOfTheWorld |
---|
| 183 | +Winter |
---|
161 | 184 | */ |
---|
162 | 185 | |
---|
163 | 186 | tab0.add(row0); |
---|
.. | .. |
---|
197 | 220 | |
---|
198 | 221 | AddSkyboxButton("urban", "CNTower", row1); |
---|
199 | 222 | AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
200 | | - AddSkyboxButton("indoors", "DallasW", row1); |
---|
201 | | - AddSkyboxButton("indoors", "MarriottMadisonWest", row1); |
---|
| 223 | + AddSkyboxButton("rocky", "Riddarfjarden", row1); |
---|
| 224 | + AddSkyboxButton("penguins", "sleepyhollow", row1); |
---|
202 | 225 | |
---|
| 226 | + AddSkyboxButton("penguins", "kenon_star", row2); |
---|
| 227 | + AddSkyboxButton("persson", "corona", row2); |
---|
| 228 | + AddSkyboxButton("persson", "spaceskybox", row2); |
---|
203 | 229 | AddSkyboxButton("indoors", "Vasa", row2); |
---|
204 | | - AddSkyboxButton("winter", "Backyard", row2); |
---|
205 | | - AddSkyboxButton("winter", "Creek", row2); |
---|
206 | | - AddSkyboxButton("winter", "FootballField3", row2); |
---|
207 | 230 | |
---|
| 231 | + AddSkyboxButton("winter", "Backyard", row3); |
---|
| 232 | + AddSkyboxButton("winter", "Creek", row3); |
---|
| 233 | + AddSkyboxButton("winter", "FootballField3", row3); |
---|
208 | 234 | AddSkyboxButton("winter", "Forest", row3); |
---|
209 | | - AddSkyboxButton("winter", "HornstullsStrand2", row3); |
---|
210 | | - AddSkyboxButton("winter", "House", row3); |
---|
211 | | - AddSkyboxButton("winter", "IceLake", row3); |
---|
212 | 235 | |
---|
| 236 | + AddSkyboxButton("winter", "HornstullsStrand2", row4); |
---|
| 237 | + AddSkyboxButton("winter", "House", row4); |
---|
| 238 | + AddSkyboxButton("winter", "IceLake", row4); |
---|
213 | 239 | AddSkyboxButton("winter", "IceRiver", row4); |
---|
214 | | - AddSkyboxButton("winter", "Park3", row4); |
---|
215 | | - AddSkyboxButton("winter", "PondWinter", row4); |
---|
216 | 240 | |
---|
| 241 | + AddSkyboxButton("winter", "Park3", row5); |
---|
| 242 | + AddSkyboxButton("winter", "PondWinter", row5); |
---|
217 | 243 | AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
218 | 244 | AddSkyboxButton("winter", "Vindelalven", row5); |
---|
219 | | - /* |
---|
220 | | -Backyard |
---|
221 | | -Creek |
---|
222 | | -FootballField3 |
---|
223 | | -Forest |
---|
224 | | -HornstullsStrand2 |
---|
225 | | -House |
---|
226 | | -IceLake |
---|
227 | | -IceRiver |
---|
228 | | -Park3 |
---|
229 | | -PondWinter |
---|
230 | | -Tantolunden5 |
---|
231 | | -Vindelalven * |
---|
232 | | - */ |
---|
| 245 | + |
---|
| 246 | + AddSkyboxButton("daz", "TheRock", row6); |
---|
| 247 | + AddSkyboxButton("daz", "TopOfTheWorld", row6); |
---|
| 248 | + AddSkyboxButton("daz", "Winter", row6); |
---|
| 249 | + AddSkyboxButton("mountain", "Ryfjallet", row6); |
---|
233 | 250 | |
---|
234 | 251 | tab0.add(row0); |
---|
235 | 252 | tab0.add(row1); |
---|
.. | .. |
---|
245 | 262 | //tab0.add(new cGridBag()); |
---|
246 | 263 | } |
---|
247 | 264 | } |
---|
248 | | - |
---|
249 | | - public void ChangeSkybox(String name) |
---|
| 265 | + |
---|
| 266 | + public void AddSkyboxTab3(JTabbedPane skyboxpanel) |
---|
250 | 267 | { |
---|
251 | | - cameraView.envyoff = false; |
---|
252 | | - cameraView.skyboxname = name; |
---|
253 | | - cameraView.skyboxext = "jpg"; |
---|
254 | | - cameraView.repaint(); |
---|
| 268 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 269 | + |
---|
| 270 | + tab0.setName("Others"); |
---|
| 271 | + skyboxpanel.add(tab0); |
---|
| 272 | + |
---|
| 273 | + cGridBag row0 = new cGridBag(); |
---|
| 274 | + cGridBag row1 = new cGridBag(); |
---|
| 275 | + cGridBag row2 = new cGridBag(); |
---|
| 276 | + cGridBag row3 = new cGridBag(); |
---|
| 277 | + cGridBag row4 = new cGridBag(); |
---|
| 278 | + cGridBag row5 = new cGridBag(); |
---|
| 279 | + cGridBag row6 = new cGridBag(); |
---|
| 280 | + |
---|
| 281 | + AddSkyboxButton("mayhem", "afterrain", row0); |
---|
| 282 | + AddSkyboxButton("mayhem", "aqua4", row0); |
---|
| 283 | + AddSkyboxButton("mayhem", "aqua9", row0); |
---|
| 284 | + AddSkyboxButton("mayhem", "flame", row0); |
---|
| 285 | + |
---|
| 286 | + AddSkyboxButton("mayhem", "h2s", row1); |
---|
| 287 | + AddSkyboxButton("mayhem", "prehistoric", row1); |
---|
| 288 | + AddSkyboxButton("mayhem", "scorched", row1); |
---|
| 289 | + AddSkyboxButton("penguins", "desertdawn", row1); |
---|
| 290 | + |
---|
| 291 | + AddSkyboxButton("persson", "Citadella", row2); |
---|
| 292 | + AddSkyboxButton("persson", "Citadella2", row2); |
---|
| 293 | + AddSkyboxButton("persson", "clouds1", row2); |
---|
| 294 | + AddSkyboxButton("penguins", "wrath", row2); |
---|
| 295 | + |
---|
| 296 | + AddSkyboxButton("persson", "FishermansBastion", row3); |
---|
| 297 | + AddSkyboxButton("persson", "HeroesSquare", row3); |
---|
| 298 | + AddSkyboxButton("indoors", "DallasW", row3); |
---|
| 299 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row3); |
---|
| 300 | + |
---|
| 301 | + AddSkyboxButton("persson", "LancellottiChapel", row4); |
---|
| 302 | + AddSkyboxButton("persson", "PereaBeach1", row4); |
---|
| 303 | + AddSkyboxButton("persson", "PereaBeach2", row4); |
---|
| 304 | + AddSkyboxButton("persson", "redeclipse", row4); |
---|
| 305 | + |
---|
| 306 | + AddSkyboxButton("daz", "Greenlands", row5); |
---|
| 307 | + AddSkyboxButton("daz", "Oasis", row5); |
---|
| 308 | + AddSkyboxButton("elyvisions", "arch3", row5); |
---|
| 309 | + AddSkyboxButton("elyvisions", "calm_sea", row5); |
---|
| 310 | + |
---|
| 311 | + AddSkyboxButton("elyvisions", "rainbow", row6); |
---|
| 312 | + AddSkyboxButton("elyvisions", "distant_sunset", row6); |
---|
| 313 | + AddSkyboxButton("elyvisions", "heaven", row6); |
---|
| 314 | + AddSkyboxButton("elyvisions", "hot", row6); |
---|
| 315 | + |
---|
| 316 | + tab0.add(row0); |
---|
| 317 | + tab0.add(row1); |
---|
| 318 | + tab0.add(row2); |
---|
| 319 | + tab0.add(row3); |
---|
| 320 | + tab0.add(row4); |
---|
| 321 | + tab0.add(row5); |
---|
| 322 | + tab0.add(row6); |
---|
| 323 | + |
---|
| 324 | + for (int i=5; --i>=0;) |
---|
| 325 | + { |
---|
| 326 | + //oe.toolboxPanel.Return(); |
---|
| 327 | + //tab0.add(new cGridBag()); |
---|
| 328 | + } |
---|
| 329 | + } |
---|
| 330 | + |
---|
| 331 | + public void ChangeSkybox(String skybox) |
---|
| 332 | + { |
---|
| 333 | + if (skybox.endsWith("/")) |
---|
| 334 | + { |
---|
| 335 | + group.skyboxname = null; |
---|
| 336 | + group.skyboxext = null; |
---|
| 337 | + cameraView.repaint(); |
---|
| 338 | + } |
---|
| 339 | + else |
---|
| 340 | + { |
---|
| 341 | + //cameraView.envyoff = false; |
---|
| 342 | + group.skyboxname = skybox; |
---|
| 343 | + group.skyboxext = "jpg"; |
---|
| 344 | + cameraView.repaint(); |
---|
| 345 | + } |
---|
| 346 | + } |
---|
| 347 | + |
---|
| 348 | + public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
| 349 | + { |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 351 | + |
---|
| 352 | + AddSkyboxTab0(skyboxpane); |
---|
| 353 | + AddSkyboxTab1(skyboxpane); |
---|
| 354 | + AddSkyboxTab2(skyboxpane); |
---|
| 355 | + AddSkyboxTab3(skyboxpane); |
---|
| 356 | + |
---|
| 357 | + skyboxPanel.add(skyboxpane); |
---|
255 | 358 | } |
---|
256 | 359 | |
---|
| 360 | + public void ChangeTexture(String texture) |
---|
| 361 | + { |
---|
| 362 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 363 | + { |
---|
| 364 | + Object3D obj = group.selection.get(i); |
---|
| 365 | + obj.SetPigmentTexture("@" + texture); |
---|
| 366 | + } |
---|
| 367 | + |
---|
| 368 | + refreshContents(); |
---|
| 369 | + } |
---|
| 370 | + |
---|
257 | 371 | //ObjEditor objEditor; |
---|
258 | 372 | public void closeUI2() |
---|
259 | 373 | { |
---|
.. | .. |
---|
291 | 405 | this.copy = this.group = group; |
---|
292 | 406 | //selectees = this.group.selectees; |
---|
293 | 407 | |
---|
294 | | - if (copy.versions == null) |
---|
295 | | - { |
---|
296 | | - copy.versions = new byte[100][]; |
---|
297 | | - copy.versionindex = -1; |
---|
298 | | - } |
---|
| 408 | + assert(false); |
---|
| 409 | + |
---|
| 410 | +// if (copy.versionlist == null) |
---|
| 411 | +// { |
---|
| 412 | +// copy.versionlist = new Object3D[100]; |
---|
| 413 | +// copy.versionindex = -1; |
---|
| 414 | +// |
---|
| 415 | +// //Save(true); |
---|
| 416 | +// } |
---|
299 | 417 | |
---|
300 | 418 | if(ui) |
---|
301 | 419 | SetupUI(objEditor); |
---|
.. | .. |
---|
318 | 436 | |
---|
319 | 437 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
320 | 438 | |
---|
321 | | - if (copy.versions == null) |
---|
322 | | - { |
---|
323 | | - copy.versions = new byte[100][]; |
---|
324 | | - copy.versionindex = -1; |
---|
325 | | - |
---|
326 | | - Save(true); |
---|
327 | | - } |
---|
| 439 | +// if (copy.versionlist == null) |
---|
| 440 | +// { |
---|
| 441 | +// copy.versionlist = new Object3D[100]; |
---|
| 442 | +// copy.versionindex = -1; |
---|
| 443 | +// |
---|
| 444 | +// //Save(true); |
---|
| 445 | +// } |
---|
328 | 446 | } |
---|
329 | 447 | |
---|
330 | 448 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
365 | 483 | |
---|
366 | 484 | Object3D parent = obj.parent; |
---|
367 | 485 | obj.parent = null; |
---|
| 486 | + |
---|
368 | 487 | // Object3D support = obj.support; |
---|
369 | 488 | // obj.support = null; |
---|
370 | 489 | if (!supports) |
---|
371 | 490 | obj.SaveSupports(); |
---|
| 491 | + |
---|
372 | 492 | Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
| 493 | + |
---|
| 494 | + clone.ResetUUIDs(); |
---|
| 495 | + |
---|
373 | 496 | obj.parent = parent; |
---|
374 | 497 | // obj.support = support; |
---|
375 | 498 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
414 | 537 | // menu.add("-"); |
---|
415 | 538 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
416 | 539 | duplicateItem.addActionListener(this); |
---|
417 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 540 | + |
---|
| 541 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
418 | 542 | cloneItem.addActionListener(this); |
---|
419 | | - if (Globals.ADVANCED) |
---|
| 543 | + //if (Globals.ADVANCED) |
---|
420 | 544 | { |
---|
421 | 545 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
422 | 546 | cloneSupportItem.addActionListener(this); |
---|
423 | 547 | } |
---|
| 548 | + oe.jTree.popup.addSeparator(); |
---|
424 | 549 | menu.add("-"); |
---|
425 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 550 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
426 | 551 | cutItem.addActionListener(this); |
---|
427 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 552 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
428 | 553 | copyItem.addActionListener(this); |
---|
429 | 554 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
430 | 555 | pasteItem.addActionListener(this); |
---|
431 | 556 | |
---|
432 | | - menu.add("-"); |
---|
433 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 557 | + oe.jTree.popup.addSeparator(); |
---|
| 558 | + //menu.add("-"); |
---|
| 559 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
434 | 560 | pasteIntoItem.addActionListener(this); |
---|
435 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 561 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
436 | 562 | pasteLinkItem.addActionListener(this); |
---|
437 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 563 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
438 | 564 | pasteCloneItem.addActionListener(this); |
---|
439 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
440 | | -// pasteExpandItem.addActionListener(this); |
---|
441 | | - menu.add("-"); |
---|
442 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
443 | | - deleteItem.addActionListener(this); |
---|
| 565 | +// CRASH |
---|
| 566 | + pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
| 567 | +// |
---|
| 568 | + pasteExpandItem.addActionListener(this); |
---|
| 569 | + //menu.add("-"); |
---|
| 570 | + oe.jTree.popup.addSeparator(); |
---|
444 | 571 | |
---|
445 | 572 | if (Globals.ADVANCED) |
---|
446 | 573 | { |
---|
.. | .. |
---|
526 | 653 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
527 | 654 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
528 | 655 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
529 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
530 | 656 | oe.cameraMenu.add("-"); |
---|
531 | 657 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
532 | 658 | openWindowItem.addActionListener(this); |
---|
533 | | - editLeafItem.addActionListener(this); |
---|
534 | 659 | lookAtItem.addActionListener(this); |
---|
535 | 660 | //lookFromItem.addActinoListener(this); |
---|
536 | 661 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
577 | 702 | setMasterItem.addActionListener(this); |
---|
578 | 703 | } |
---|
579 | 704 | |
---|
580 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
581 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
582 | | -// grabItem.addActionListener(this); |
---|
| 705 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 706 | + |
---|
583 | 707 | backItem = menu.add(new MenuItem("Back")); |
---|
584 | 708 | backItem.addActionListener(this); |
---|
585 | 709 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
587 | 711 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
588 | 712 | // compositeItem.addActionListener(this); |
---|
589 | 713 | |
---|
| 714 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 715 | + grabItem.addActionListener(this); |
---|
| 716 | + |
---|
590 | 717 | if (Globals.ADVANCED) |
---|
591 | 718 | { |
---|
592 | 719 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
593 | 720 | hideItem.addActionListener(this); |
---|
594 | 721 | } |
---|
595 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 722 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
596 | 723 | ungroupItem.addActionListener(this); |
---|
| 724 | + |
---|
| 725 | + oe.jTree.popup.addSeparator(); |
---|
| 726 | + |
---|
| 727 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 728 | + deleteItem.addActionListener(this); |
---|
597 | 729 | |
---|
598 | 730 | // menu.add("-"); |
---|
599 | 731 | // |
---|
.. | .. |
---|
630 | 762 | shadowYItem.addActionListener(this); |
---|
631 | 763 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
632 | 764 | shadowZItem.addActionListener(this); |
---|
| 765 | + |
---|
633 | 766 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
634 | 767 | attributeItem.addActionListener(this); |
---|
635 | | - |
---|
636 | 768 | if (Globals.ADVANCED) |
---|
637 | 769 | { |
---|
638 | 770 | menu.add("-"); |
---|
.. | .. |
---|
644 | 776 | pointflowItem.addActionListener(this); |
---|
645 | 777 | } |
---|
646 | 778 | menu.add("-"); |
---|
| 779 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 780 | + textureRatioRItem.addActionListener(this); |
---|
| 781 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 782 | + textureRatioGItem.addActionListener(this); |
---|
| 783 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 784 | + textureRatioBItem.addActionListener(this); |
---|
| 785 | + menu.add("-"); |
---|
647 | 786 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
648 | 787 | resetTransformItem.addActionListener(this); |
---|
649 | 788 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
650 | 789 | resetCentroidItem.addActionListener(this); |
---|
651 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 790 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
652 | 791 | resetCentroidXZItem.addActionListener(this); |
---|
653 | 792 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
654 | 793 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
664 | 803 | genNormalsCADItem.addActionListener(this); |
---|
665 | 804 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
666 | 805 | genNormalsMESHItem.addActionListener(this); |
---|
667 | | - if (Globals.ADVANCED) |
---|
| 806 | + //if (Globals.ADVANCED) |
---|
668 | 807 | { |
---|
669 | 808 | genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
670 | 809 | genNormalsMINEItem.addActionListener(this); |
---|
.. | .. |
---|
700 | 839 | } |
---|
701 | 840 | |
---|
702 | 841 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 842 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 843 | + clearVersionsItem.addActionListener(this); |
---|
703 | 844 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
704 | 845 | clearMaterialsItem.addActionListener(this); |
---|
705 | 846 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
722 | 863 | hideleavesItem.addActionListener(this); |
---|
723 | 864 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
724 | 865 | showleavesItem.addActionListener(this); |
---|
725 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 866 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
726 | 867 | markleavesItem.addActionListener(this); |
---|
727 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 868 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
728 | 869 | unmarkleavesItem.addActionListener(this); |
---|
729 | 870 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
730 | 871 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
778 | 919 | shareGeometriesItem.addActionListener(this); |
---|
779 | 920 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
780 | 921 | mergeGeometriesItem.addActionListener(this); |
---|
| 922 | + menu.add("-"); |
---|
| 923 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 924 | + editLeafItem.addActionListener(this); |
---|
781 | 925 | if (Globals.ADVANCED) |
---|
782 | 926 | { |
---|
783 | 927 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
794 | 938 | buildToolsMenu(menu); |
---|
795 | 939 | } |
---|
796 | 940 | |
---|
| 941 | + JTabbedPane resourcecontainer; |
---|
| 942 | + cGridBag currenttab; |
---|
| 943 | + //boolean added; // patch for jar |
---|
| 944 | + |
---|
| 945 | + int totalcount = 0; |
---|
| 946 | + |
---|
| 947 | + int tabcount = 0; |
---|
| 948 | + int colcount = 0; |
---|
| 949 | + int rowcount = 0; |
---|
| 950 | + int texturecount = 0; |
---|
| 951 | + |
---|
| 952 | + int columns = 5; |
---|
| 953 | + int rows = 7; |
---|
| 954 | + |
---|
| 955 | + public void ResourceCallBack(String[] path) |
---|
| 956 | + { |
---|
| 957 | +// for (int i = 0; i < path.length; i++) |
---|
| 958 | +// System.out.print(path[i] + "/"); |
---|
| 959 | +// System.out.println(); |
---|
| 960 | + |
---|
| 961 | + if (//rowcount == 0 || |
---|
| 962 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
| 963 | + { |
---|
| 964 | + currenttab = new cGridBag(); |
---|
| 965 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 966 | + currenttab.setName(tabname); |
---|
| 967 | + //added = false; |
---|
| 968 | + resourcecontainer.add(currenttab); |
---|
| 969 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture " + tabname); |
---|
| 970 | + rowcount = 1; |
---|
| 971 | + colcount = 0; |
---|
| 972 | + texturecount = 0; |
---|
| 973 | + } |
---|
| 974 | + |
---|
| 975 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
| 976 | + { |
---|
| 977 | + //if (!added) |
---|
| 978 | + { |
---|
| 979 | + //added = true; |
---|
| 980 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 981 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
| 982 | + } |
---|
| 983 | + |
---|
| 984 | + columns = 5; |
---|
| 985 | + |
---|
| 986 | + if (path[0].contains("D&R") || path[0].contains("Paint")) |
---|
| 987 | + columns = 4; |
---|
| 988 | + |
---|
| 989 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 990 | + totalcount++; |
---|
| 991 | + |
---|
| 992 | + if (++colcount >= columns) |
---|
| 993 | + { |
---|
| 994 | + colcount = 0; |
---|
| 995 | + currenttab.Return(); |
---|
| 996 | + |
---|
| 997 | + if (rowcount++ >= rows) |
---|
| 998 | + { |
---|
| 999 | + rowcount = 0; |
---|
| 1000 | + } |
---|
| 1001 | + } |
---|
| 1002 | + } |
---|
| 1003 | + else |
---|
| 1004 | + { |
---|
| 1005 | +// if (!path[path.length-1].equals("icons")) |
---|
| 1006 | +// resourcecontainer.Return(); |
---|
| 1007 | + } |
---|
| 1008 | + } |
---|
| 1009 | + |
---|
| 1010 | + void CreateTexturePanel(cGridBag container) |
---|
| 1011 | + { |
---|
| 1012 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 1013 | + container.add(resourcecontainer); |
---|
| 1014 | + |
---|
| 1015 | + Grafreed.ParseResources("textures", this); |
---|
| 1016 | + |
---|
| 1017 | + // 935. System.out.println("Total = " + totalcount); |
---|
| 1018 | + } |
---|
797 | 1019 | |
---|
798 | 1020 | void SetupUI2(ObjEditor oe) |
---|
799 | 1021 | { |
---|
.. | .. |
---|
812 | 1034 | //new Exception().printStackTrace(); |
---|
813 | 1035 | |
---|
814 | 1036 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
815 | | - oe.aConstraints.weightx = 1; |
---|
816 | | - oe.aConstraints.weighty = 0; |
---|
817 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
818 | | - oe.aConstraints.gridwidth = 100; |
---|
819 | | - oe.aConstraints.gridheight = 1; |
---|
820 | 1037 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
821 | 1038 | |
---|
822 | 1039 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
837 | 1054 | oe.radioPanel.add(dummyButton); |
---|
838 | 1055 | oe.buttonGroup.add(dummyButton); |
---|
839 | 1056 | */ |
---|
840 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1057 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
841 | 1058 | |
---|
842 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1059 | + versionManagerPanel.preferredHeight = 4; |
---|
843 | 1060 | |
---|
844 | 1061 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
845 | 1062 | |
---|
.. | .. |
---|
849 | 1066 | |
---|
850 | 1067 | if (Globals.ADVANCED) |
---|
851 | 1068 | { |
---|
852 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
853 | | - maxButton.setToolTipText("Maximize window"); |
---|
854 | | - maxButton.addActionListener(this); |
---|
| 1069 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1070 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1071 | +// maxButton.addActionListener(this); |
---|
855 | 1072 | } |
---|
856 | 1073 | |
---|
857 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
858 | | - fullButton.setToolTipText("Full-screen window"); |
---|
859 | | - fullButton.addActionListener(this); |
---|
| 1074 | + cButton gcButton; |
---|
860 | 1075 | |
---|
861 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1076 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1077 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1078 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1079 | +// { |
---|
| 1080 | +// public void actionPerformed(ActionEvent e) |
---|
| 1081 | +// { |
---|
| 1082 | +// System.gc(); |
---|
| 1083 | +// } |
---|
| 1084 | +// }); |
---|
| 1085 | + |
---|
| 1086 | + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | + fullScreenButton.setToolTipText("Full-screen window"); |
---|
| 1088 | + fullScreenButton.addActionListener(this); |
---|
| 1089 | + |
---|
| 1090 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1091 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1092 | + collapseButton.addActionListener(this); |
---|
| 1093 | + |
---|
| 1094 | +// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1095 | +// maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1096 | +// maximize3DButton.addActionListener(this); |
---|
| 1097 | + |
---|
| 1098 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1099 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1100 | + twoButton.addActionListener(this); |
---|
| 1101 | + this.fullscreenLayout = twoButton; |
---|
| 1102 | + |
---|
| 1103 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1104 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1105 | + threeButton.addActionListener(this); |
---|
| 1106 | + if (Globals.ADVANCED) |
---|
| 1107 | + { |
---|
| 1108 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1110 | + sixButton.addActionListener(this); |
---|
| 1111 | + } |
---|
| 1112 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1114 | +// sevenButton.addActionListener(this); |
---|
| 1115 | + // |
---|
| 1116 | + |
---|
| 1117 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
862 | 1118 | screenfitButton.setToolTipText("Screen fit"); |
---|
863 | 1119 | screenfitButton.addActionListener(this); |
---|
864 | 1120 | |
---|
865 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1121 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
866 | 1122 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
867 | 1123 | restoreCameraButton.addActionListener(this); |
---|
868 | 1124 | |
---|
869 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
870 | | - saveButton.setToolTipText("New version"); |
---|
871 | | - saveButton.addActionListener(this); |
---|
| 1125 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1126 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 1127 | + saveVersionButton.addActionListener(this); |
---|
872 | 1128 | |
---|
873 | | - copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
874 | | - undoButton.setToolTipText("Previous version"); |
---|
875 | | - undoButton.addActionListener(this); |
---|
876 | | - undoButton.setEnabled(false); |
---|
| 1129 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1130 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 1131 | + deleteVersionButton.addActionListener(this); |
---|
| 1132 | + deleteVersionButton.setEnabled(false); |
---|
| 1133 | + |
---|
| 1134 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1135 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 1136 | + previousVersionButton.addActionListener(this); |
---|
| 1137 | + previousVersionButton.setEnabled(false); |
---|
877 | 1138 | |
---|
878 | 1139 | cGridBag updown = new cGridBag().setVertical(true); |
---|
879 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
880 | | - restoreButton.setToolTipText("Restore current"); |
---|
| 1140 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1141 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
881 | 1142 | restoreButton.addActionListener(this); |
---|
882 | 1143 | restoreButton.setEnabled(false); |
---|
883 | 1144 | |
---|
884 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
885 | | - replaceButton.setToolTipText("Replace current"); |
---|
| 1145 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1146 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
886 | 1147 | replaceButton.addActionListener(this); |
---|
887 | 1148 | replaceButton.setEnabled(false); |
---|
888 | 1149 | |
---|
889 | | - copyOptionsPanel.add(updown); |
---|
| 1150 | + versionManagerPanel.add(updown); |
---|
890 | 1151 | |
---|
891 | | - copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
892 | | - redoButton.setToolTipText("Next version"); |
---|
893 | | - redoButton.addActionListener(this); |
---|
894 | | - redoButton.setEnabled(false); |
---|
| 1152 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1153 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 1154 | + nextVersionButton.addActionListener(this); |
---|
| 1155 | + nextVersionButton.setEnabled(false); |
---|
| 1156 | + |
---|
| 1157 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1158 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1159 | + oneStepButton.addActionListener(this); |
---|
895 | 1160 | |
---|
896 | 1161 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
897 | 1162 | liveCB.setToolTipText("Enable animation"); |
---|
898 | 1163 | liveCB.addItemListener(this); |
---|
899 | 1164 | |
---|
900 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
901 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
902 | | - oneStepButton.addActionListener(this); |
---|
903 | | - |
---|
904 | 1165 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
905 | 1166 | fastCB.setToolTipText("Fast mode"); |
---|
906 | 1167 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
916 | 1177 | |
---|
917 | 1178 | if (Globals.ADVANCED) |
---|
918 | 1179 | { |
---|
919 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
920 | 1181 | snapobjectButton.addActionListener(this); |
---|
921 | 1182 | snapobjectButton.setToolTipText("Snap Object"); |
---|
922 | 1183 | |
---|
923 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1184 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
924 | 1185 | fourButton.addActionListener(this); |
---|
925 | 1186 | fourButton.setToolTipText("Show control panel only"); |
---|
926 | 1187 | } |
---|
927 | 1188 | |
---|
928 | 1189 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
929 | 1190 | |
---|
930 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
931 | | - twoButton.setToolTipText("Show 3D view only"); |
---|
932 | | - twoButton.addActionListener(this); |
---|
933 | | - this.fullscreenLayout = twoButton; |
---|
934 | | - |
---|
935 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
936 | | - threeButton.setToolTipText("Show controls and 3D view"); |
---|
937 | | - threeButton.addActionListener(this); |
---|
938 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
939 | | - sixButton.setToolTipText("Show 3D view and controls"); |
---|
940 | | - sixButton.addActionListener(this); |
---|
941 | | -// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
942 | | -// sevenButton.setToolTipText("3-column layout"); |
---|
943 | | -// sevenButton.addActionListener(this); |
---|
944 | | - // |
---|
945 | 1191 | |
---|
946 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1192 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
947 | 1193 | rootButton.setToolTipText("Open selection in new tab"); |
---|
948 | 1194 | rootButton.addActionListener(this); |
---|
949 | 1195 | |
---|
950 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1196 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
951 | 1197 | closeButton.setToolTipText("Close tab"); |
---|
952 | 1198 | closeButton.addActionListener(this); |
---|
953 | 1199 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
954 | 1200 | //clearButton.addActionListener(this); |
---|
955 | 1201 | |
---|
956 | 1202 | cGridBag row1 = new cGridBag(); |
---|
| 1203 | + row1.preferredHeight = 8; |
---|
957 | 1204 | |
---|
958 | 1205 | // INSERT |
---|
959 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
960 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1206 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1207 | + gridButton.setToolTipText("Create ground"); |
---|
961 | 1208 | gridButton.addActionListener(this); |
---|
962 | 1209 | |
---|
963 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
964 | 1211 | boxButton.setToolTipText("Create box"); |
---|
965 | 1212 | boxButton.addActionListener(this); |
---|
966 | 1213 | |
---|
967 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
968 | | - sphereButton.setToolTipText("Create sphere"); |
---|
969 | | - sphereButton.addActionListener(this); |
---|
970 | | - |
---|
971 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
972 | | - coneButton.setToolTipText("Create cone"); |
---|
973 | | - coneButton.addActionListener(this); |
---|
974 | | - |
---|
975 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
976 | | - torusButton.setToolTipText("Create torus"); |
---|
977 | | - torusButton.addActionListener(this); |
---|
978 | | - |
---|
979 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1214 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
980 | 1215 | superButton.setToolTipText("Create superellipsoid"); |
---|
981 | 1216 | superButton.addActionListener(this); |
---|
982 | 1217 | |
---|
983 | | - if (Globals.ADVANCED) |
---|
| 1218 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1219 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1220 | + sphereButton.addActionListener(this); |
---|
| 1221 | + |
---|
| 1222 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1223 | + coneButton.setToolTipText("Create cone"); |
---|
| 1224 | + coneButton.addActionListener(this); |
---|
| 1225 | + |
---|
| 1226 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1227 | + torusButton.setToolTipText("Create torus"); |
---|
| 1228 | + torusButton.addActionListener(this); |
---|
| 1229 | + |
---|
| 1230 | + if (false) //Globals.ADVANCED) |
---|
984 | 1231 | { |
---|
985 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
986 | 1233 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
987 | 1234 | kleinButton.addActionListener(this); |
---|
988 | 1235 | } |
---|
989 | 1236 | |
---|
990 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1237 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
991 | 1238 | particlesButton.setToolTipText("Create particle system"); |
---|
992 | 1239 | particlesButton.addActionListener(this); |
---|
993 | 1240 | |
---|
994 | 1241 | oe.toolboxPanel.add(row1); |
---|
995 | 1242 | |
---|
996 | 1243 | cGridBag row2 = new cGridBag(); |
---|
| 1244 | + row2.preferredHeight = 8; |
---|
997 | 1245 | |
---|
998 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1246 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
999 | 1247 | groupButton.setToolTipText("Create group"); |
---|
1000 | 1248 | groupButton.addActionListener(this); |
---|
1001 | 1249 | |
---|
1002 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1250 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1003 | 1251 | compositeButton.setToolTipText("Create composite"); |
---|
1004 | 1252 | compositeButton.addActionListener(this); |
---|
1005 | 1253 | |
---|
1006 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1254 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1007 | 1255 | switchButton.setToolTipText("Create item switcher"); |
---|
1008 | 1256 | switchButton.addActionListener(this); |
---|
1009 | 1257 | |
---|
1010 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1258 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1011 | 1259 | loopButton.setToolTipText("Create loop"); |
---|
1012 | 1260 | loopButton.addActionListener(this); |
---|
1013 | 1261 | |
---|
1014 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1262 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1015 | 1263 | textureButton.setToolTipText("Create texture"); |
---|
1016 | 1264 | textureButton.addActionListener(this); |
---|
1017 | 1265 | |
---|
1018 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1266 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1019 | 1267 | overlayButton.setToolTipText("Create overlay"); |
---|
1020 | 1268 | overlayButton.addActionListener(this); |
---|
1021 | 1269 | |
---|
1022 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1270 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1023 | 1271 | lightButton.setToolTipText("Create light"); |
---|
1024 | 1272 | lightButton.addActionListener(this); |
---|
1025 | 1273 | |
---|
1026 | 1274 | oe.toolboxPanel.add(row2); |
---|
1027 | 1275 | |
---|
1028 | | - // ENVYMAPS |
---|
1029 | | - cGridBag skyboxpane = new cGridBag(); |
---|
1030 | | - skyboxpane.preferredHeight = 100; |
---|
| 1276 | + cGridBag textures = new cGridBag(); |
---|
1031 | 1277 | |
---|
1032 | | - oe.toolboxPanel.add(skyboxpane); |
---|
| 1278 | + CreateTexturePanel(textures); |
---|
1033 | 1279 | |
---|
1034 | | - JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
1035 | | - skyboxpane.add(skyboxpanel); |
---|
| 1280 | + int tabCount = resourcecontainer.getTabCount(); |
---|
1036 | 1281 | |
---|
1037 | | - AddSkyboxTab0(skyboxpanel); |
---|
1038 | | - AddSkyboxTab1(skyboxpanel); |
---|
1039 | | - AddSkyboxTab2(skyboxpanel); |
---|
| 1282 | + if (tabCount > 0) |
---|
| 1283 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1284 | + |
---|
| 1285 | + oe.toolboxPanel.add(textures); |
---|
| 1286 | + |
---|
| 1287 | + textures.preferredHeight = 100; |
---|
| 1288 | + |
---|
| 1289 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
1040 | 1290 | |
---|
1041 | 1291 | // EDIT panel |
---|
1042 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1292 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1043 | 1293 | editButton.setToolTipText("Pin selection controls"); |
---|
1044 | 1294 | editButton.addActionListener(this); |
---|
1045 | 1295 | |
---|
1046 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1047 | | - uneditButton.setToolTipText("Remove selection controls"); |
---|
| 1296 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1297 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
1048 | 1298 | uneditButton.addActionListener(this); |
---|
1049 | 1299 | |
---|
1050 | 1300 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
1051 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1301 | + allParamsButton.setToolTipText("Show all controls"); |
---|
1052 | 1302 | allParamsButton.addActionListener(this); |
---|
1053 | 1303 | |
---|
1054 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1055 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1304 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1305 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
1056 | 1306 | clearPanelButton.addActionListener(this); |
---|
1057 | 1307 | |
---|
1058 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1059 | | - unselectButton.setToolTipText("Unselect"); |
---|
1060 | | - unselectButton.addActionListener(this); |
---|
| 1308 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1309 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1310 | + //unselectButton.addActionListener(this); |
---|
1061 | 1311 | |
---|
1062 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1312 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
1063 | 1313 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
1064 | 1314 | flashSelectionButton.addActionListener(this); |
---|
1065 | 1315 | |
---|
.. | .. |
---|
1082 | 1332 | |
---|
1083 | 1333 | cGridBag jSPPanel = new cGridBag(); |
---|
1084 | 1334 | |
---|
| 1335 | + jSPPanel.preferredHeight = 20; |
---|
| 1336 | + |
---|
1085 | 1337 | JScrollPane jSP; |
---|
1086 | 1338 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
1087 | 1339 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
1090 | 1342 | oe.treePanel.add(jSPPanel); |
---|
1091 | 1343 | oe.treePanel.Return(); |
---|
1092 | 1344 | |
---|
1093 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1345 | + oe.treePanel.add(versionManagerPanel); |
---|
1094 | 1346 | oe.treePanel.Return(); |
---|
1095 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
1096 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
1097 | | - sliderPane.preferredHeight = 1; |
---|
| 1347 | + |
---|
| 1348 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1349 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1350 | + versionSliderPane.preferredHeight = 3; |
---|
1098 | 1351 | |
---|
1099 | 1352 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
1100 | 1353 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1117 | 1370 | dgr.addDragGestureListener(this); |
---|
1118 | 1371 | }catch(Exception e) {} |
---|
1119 | 1372 | */ |
---|
1120 | | - radio.layout = sixButton; // sevenButton; |
---|
| 1373 | + radio.layout = threeButton; // sixButton; |
---|
1121 | 1374 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
1122 | 1375 | } |
---|
1123 | 1376 | |
---|
.. | .. |
---|
1151 | 1404 | // supportCB.setToolTipText("Enable rigging"); |
---|
1152 | 1405 | // supportCB.addItemListener(this); |
---|
1153 | 1406 | |
---|
1154 | | - panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1407 | + panel.add(freezeCB = new cCheckBox("Fast cam", Globals.FREEZEONMOVE)); //, constraints); |
---|
1155 | 1408 | freezeCB.setToolTipText("Fast moving camera"); |
---|
1156 | 1409 | freezeCB.addItemListener(this); |
---|
1157 | 1410 | |
---|
.. | .. |
---|
1160 | 1413 | |
---|
1161 | 1414 | panel.Return(); |
---|
1162 | 1415 | |
---|
| 1416 | + if (Globals.ADVANCED) |
---|
| 1417 | + { |
---|
1163 | 1418 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
1164 | 1419 | crowdCB.setToolTipText("Used for crowds"); |
---|
1165 | 1420 | crowdCB.addItemListener(this); |
---|
| 1421 | + } |
---|
1166 | 1422 | |
---|
1167 | 1423 | panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
1168 | 1424 | smoothCB.setToolTipText("Snapping delay"); |
---|
1169 | 1425 | smoothCB.addItemListener(this); |
---|
1170 | 1426 | |
---|
1171 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
1172 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
1173 | | - slowCB.addItemListener(this); |
---|
| 1427 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1428 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1429 | +// slowCB.addItemListener(this); |
---|
| 1430 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1431 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1432 | + minshaderCB.addItemListener(this); |
---|
1174 | 1433 | |
---|
1175 | | -// constraints.gridy += 1; |
---|
1176 | 1434 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
1177 | 1435 | // speakerMocapCB.addItemListener(this); |
---|
1178 | 1436 | |
---|
1179 | | - panel.Return(); |
---|
1180 | | - |
---|
1181 | 1437 | if (false) |
---|
1182 | 1438 | { |
---|
1183 | 1439 | // handled in scripts |
---|
1184 | | - //constraints.gridy += 1; |
---|
1185 | 1440 | panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
1186 | 1441 | speakerCameraCB.addItemListener(this); |
---|
1187 | 1442 | |
---|
1188 | | - //constraints.gridy += 1; |
---|
1189 | 1443 | panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
1190 | 1444 | speakerFocusCB.addItemListener(this); |
---|
1191 | 1445 | |
---|
1192 | | - //constraints.gridy += 1; |
---|
1193 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
1194 | | - smoothfocusCB.addItemListener(this); |
---|
1195 | 1446 | panel.Return(); |
---|
1196 | 1447 | } |
---|
1197 | 1448 | |
---|
1198 | | -//constraints.gridx += 1; |
---|
| 1449 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 1450 | + smoothfocusCB.addItemListener(this); |
---|
| 1451 | + |
---|
| 1452 | + panel.Return(); |
---|
| 1453 | + |
---|
1199 | 1454 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
1200 | 1455 | // debugCB.addItemListener(this); |
---|
1201 | 1456 | |
---|
.. | .. |
---|
1249 | 1504 | |
---|
1250 | 1505 | void EditObject(Object3D obj) |
---|
1251 | 1506 | { |
---|
| 1507 | + //assert(obj instanceof Composite); |
---|
| 1508 | + |
---|
| 1509 | +// if (obj.versionlist == null) |
---|
| 1510 | +// { |
---|
| 1511 | +// obj.versionlist = new Object3D[100]; |
---|
| 1512 | +// obj.versionindex = -1; |
---|
| 1513 | +// } |
---|
| 1514 | + |
---|
1252 | 1515 | cRadio radioButton = new cRadio(obj.name); |
---|
1253 | 1516 | |
---|
1254 | 1517 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1259 | 1522 | } |
---|
1260 | 1523 | |
---|
1261 | 1524 | radioButton.SetObject(obj); |
---|
1262 | | - radioButton.layout = sixButton; // sevenButton; |
---|
| 1525 | + radioButton.layout = threeButton; // sixButton; |
---|
1263 | 1526 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
1264 | 1527 | radioButton.addActionListener(this); |
---|
1265 | 1528 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1273 | 1536 | |
---|
1274 | 1537 | oe.SetupViews(); |
---|
1275 | 1538 | |
---|
| 1539 | + if (Globals.DEBUG) |
---|
1276 | 1540 | System.out.println("SetupViews"); |
---|
1277 | 1541 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1278 | 1542 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
1284 | 1548 | cCheckBox localCB; |
---|
1285 | 1549 | cCheckBox crowdCB; |
---|
1286 | 1550 | cCheckBox smoothCB; |
---|
| 1551 | + cCheckBox minshaderCB; |
---|
| 1552 | + |
---|
1287 | 1553 | cToggleButton fastCB; |
---|
1288 | 1554 | cCheckBox slowCB; |
---|
1289 | 1555 | cCheckBox boxCB; |
---|
.. | .. |
---|
1354 | 1620 | { |
---|
1355 | 1621 | cameraView.ToggleInertia(); |
---|
1356 | 1622 | cameraView.repaint(); |
---|
| 1623 | + } |
---|
| 1624 | + else if(e.getSource() == minshaderCB) |
---|
| 1625 | + { |
---|
| 1626 | + Globals.MINSHADER ^= true; |
---|
| 1627 | + cameraView.programInitialized = false; |
---|
| 1628 | + cameraView.repaint(); |
---|
1357 | 1629 | } |
---|
1358 | 1630 | else if(e.getSource() == localCB) |
---|
1359 | 1631 | { |
---|
.. | .. |
---|
1631 | 1903 | TreePath path; |
---|
1632 | 1904 | |
---|
1633 | 1905 | public TransferableTreePath(TreePath tp) { |
---|
1634 | | - path = tp; |
---|
| 1906 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1907 | + for (int i=0; i<objs.length; i++) |
---|
| 1908 | + { |
---|
| 1909 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1910 | + } |
---|
| 1911 | + path = new TreePath(objs); |
---|
1635 | 1912 | } |
---|
1636 | 1913 | |
---|
1637 | 1914 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
1812 | 2089 | Object3D obj = (Object3D)group.selection.elementAt(0); |
---|
1813 | 2090 | objEditor.ScreenFit(obj, false); |
---|
1814 | 2091 | |
---|
1815 | | - cameraView.pingthread.StepToTarget(true); |
---|
| 2092 | + cameraView.pingthread.StepToTarget(); //true); |
---|
1816 | 2093 | refreshContents(); |
---|
1817 | 2094 | } |
---|
1818 | 2095 | |
---|
.. | .. |
---|
1849 | 2126 | obj.parent.TransformToWorld(maxima); //, maxima); |
---|
1850 | 2127 | } |
---|
1851 | 2128 | |
---|
1852 | | - Object3D shadow = new Object3D("Shadow " + obj.name); |
---|
| 2129 | + Object3D shadow = new Object3D("Shadow" + obj.name); |
---|
1853 | 2130 | |
---|
1854 | 2131 | shadow.toParent = LA.newMatrix(); |
---|
1855 | 2132 | shadow.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1863 | 2140 | switch(axis) |
---|
1864 | 2141 | { |
---|
1865 | 2142 | case 0 : |
---|
1866 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1867 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
1868 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
1869 | | - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
| 2143 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2144 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2145 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2146 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
1870 | 2147 | norm = cVector.X; |
---|
1871 | 2148 | break; |
---|
1872 | 2149 | case 1 : |
---|
1873 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1874 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
1875 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
1876 | | - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; |
---|
| 2150 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2151 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2152 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2153 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
1877 | 2154 | norm = cVector.Y; |
---|
1878 | 2155 | break; |
---|
1879 | 2156 | case 2 : |
---|
1880 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1881 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
1882 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
1883 | | - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; |
---|
| 2157 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2158 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2159 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2160 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
1884 | 2161 | norm = cVector.Z; |
---|
1885 | 2162 | break; |
---|
1886 | 2163 | } |
---|
.. | .. |
---|
1921 | 2198 | shadow.material = new cMaterial(obj.material); |
---|
1922 | 2199 | shadow.material.diffuse = 0.0001f; |
---|
1923 | 2200 | shadow.material.specular = 0.0001f; |
---|
1924 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2201 | + shadow.material.opacity = 0.75f; |
---|
| 2202 | + |
---|
| 2203 | + AllocProjectedVertices(shadow); |
---|
| 2204 | + |
---|
| 2205 | + shadow.projectedVertices[1].x = 300; |
---|
1925 | 2206 | |
---|
1926 | 2207 | makeSomething(shadow); |
---|
1927 | 2208 | } |
---|
.. | .. |
---|
2442 | 2723 | } else |
---|
2443 | 2724 | if (source == loopItem || source == loopButton) |
---|
2444 | 2725 | { |
---|
| 2726 | + if (!group.selection.isEmpty()) |
---|
| 2727 | + { |
---|
2445 | 2728 | Composite csg = new GroupLeaf(); |
---|
2446 | | - csg.count = 5; |
---|
2447 | 2729 | group(csg); |
---|
| 2730 | + csg.count = 5; |
---|
2448 | 2731 | Composite child = new cGroup("Branch"); |
---|
2449 | 2732 | csg.addChild(child); |
---|
2450 | 2733 | child.addChild(csg); |
---|
| 2734 | + } |
---|
2451 | 2735 | } else |
---|
2452 | 2736 | if (source == doubleItem) |
---|
2453 | 2737 | { |
---|
| 2738 | + if (!group.selection.isEmpty()) |
---|
| 2739 | + { |
---|
2454 | 2740 | Composite csg = new GroupLeaf("Fork"); |
---|
2455 | | - csg.count = 5; |
---|
2456 | 2741 | group(csg); |
---|
| 2742 | + csg.count = 5; |
---|
2457 | 2743 | Composite child = new cGroup("Branch A"); |
---|
2458 | 2744 | csg.addChild(child); |
---|
2459 | 2745 | child.addChild(csg); |
---|
2460 | 2746 | child = new cGroup("Branch B"); |
---|
2461 | 2747 | csg.addChild(child); |
---|
2462 | 2748 | child.addChild(csg); |
---|
| 2749 | + } |
---|
2463 | 2750 | } else |
---|
2464 | 2751 | if (source == tripleItem) |
---|
2465 | 2752 | { |
---|
| 2753 | + if (!group.selection.isEmpty()) |
---|
| 2754 | + { |
---|
2466 | 2755 | Composite csg = new GroupLeaf("Trident"); |
---|
2467 | 2756 | csg.count = 4; |
---|
2468 | 2757 | group(csg); |
---|
.. | .. |
---|
2475 | 2764 | child = new cGroup(); |
---|
2476 | 2765 | csg.addChild(child); |
---|
2477 | 2766 | child.addChild(csg); |
---|
| 2767 | + } |
---|
2478 | 2768 | } else |
---|
2479 | 2769 | if (source == computeAOItem) |
---|
2480 | 2770 | { |
---|
.. | .. |
---|
2494 | 2784 | if (source == invariantsItem) |
---|
2495 | 2785 | { |
---|
2496 | 2786 | System.out.println("Invariants:"); |
---|
2497 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2787 | + Grafreed.grafreed.universe.invariants(); |
---|
2498 | 2788 | } else |
---|
2499 | 2789 | if (source == memoryItem) |
---|
2500 | 2790 | { |
---|
.. | .. |
---|
2521 | 2811 | { |
---|
2522 | 2812 | Maximize(); |
---|
2523 | 2813 | } else |
---|
2524 | | - if (source == fullButton) |
---|
| 2814 | + if (source == fullScreenButton) |
---|
2525 | 2815 | { |
---|
2526 | 2816 | ToggleFullScreen(); |
---|
2527 | 2817 | } else |
---|
2528 | | - if (source == undoButton) |
---|
| 2818 | + if (source == collapseButton) |
---|
| 2819 | + { |
---|
| 2820 | + this.expandedLayout = radio.layout; |
---|
| 2821 | + CollapseToolbar(); |
---|
| 2822 | + } else |
---|
| 2823 | +// if (source == maximize3DButton) |
---|
| 2824 | +// { |
---|
| 2825 | +// this.expandedLayout = radio.layout; |
---|
| 2826 | +// radio.layout = twoButton; |
---|
| 2827 | +// CollapseToolbar(); |
---|
| 2828 | +// Show3DView(); |
---|
| 2829 | +// } else |
---|
| 2830 | + if (source == previousVersionButton) |
---|
2529 | 2831 | { |
---|
2530 | 2832 | // Go to previous version |
---|
2531 | 2833 | //if (!Undo()) |
---|
2532 | 2834 | //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2533 | | - Undo(); |
---|
| 2835 | + PreviousVersion(); |
---|
2534 | 2836 | } else |
---|
2535 | 2837 | if (source == restoreButton) |
---|
2536 | 2838 | { |
---|
2537 | 2839 | // Restore current version |
---|
2538 | 2840 | Restore(); |
---|
| 2841 | + //restoreButton.setEnabled(false); |
---|
2539 | 2842 | } else |
---|
2540 | 2843 | if (source == replaceButton) |
---|
2541 | 2844 | { |
---|
2542 | 2845 | // Overwrite current version |
---|
2543 | 2846 | Replace(); |
---|
| 2847 | + //replaceButton.setEnabled(false); |
---|
2544 | 2848 | } else |
---|
2545 | | - if (source == redoButton) |
---|
| 2849 | + if (source == nextVersionButton) |
---|
2546 | 2850 | { |
---|
2547 | 2851 | // Go to next version |
---|
2548 | | - Redo(); |
---|
| 2852 | + NextVersion(); |
---|
2549 | 2853 | } else |
---|
2550 | | - if (source == saveButton) |
---|
| 2854 | + if (source == saveVersionButton) |
---|
2551 | 2855 | { |
---|
2552 | 2856 | // Save a new version |
---|
2553 | | - if (!Save(true)) |
---|
| 2857 | + if (!DuplicateVersion()) //true)) |
---|
2554 | 2858 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2859 | + } else |
---|
| 2860 | + if (source == deleteVersionButton) |
---|
| 2861 | + { |
---|
| 2862 | + // Delete a new version |
---|
| 2863 | + DeleteVersion(); |
---|
2555 | 2864 | } else |
---|
2556 | 2865 | if (source == oneStepButton) |
---|
2557 | 2866 | { |
---|
.. | .. |
---|
2606 | 2915 | } else |
---|
2607 | 2916 | if (source == undoItem) |
---|
2608 | 2917 | { |
---|
2609 | | - Undo(); |
---|
| 2918 | + PreviousVersion(); |
---|
2610 | 2919 | } else |
---|
2611 | 2920 | if (source == redoItem) |
---|
2612 | 2921 | { |
---|
2613 | | - Redo(); |
---|
| 2922 | + NextVersion(); |
---|
2614 | 2923 | } else |
---|
2615 | 2924 | if (source == duplicateItem) |
---|
2616 | 2925 | { |
---|
.. | .. |
---|
3091 | 3400 | } else |
---|
3092 | 3401 | if (source == ungroupItem || source == ungroupButton) |
---|
3093 | 3402 | { |
---|
3094 | | - boolean hasRoot = false; |
---|
| 3403 | + boolean canUngroup = true; |
---|
3095 | 3404 | |
---|
3096 | 3405 | for (int i=0; i<group.selection.size(); i++) |
---|
3097 | 3406 | { |
---|
3098 | | - if (group.selection.get(i) == group) |
---|
| 3407 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3408 | + |
---|
| 3409 | + if (selectedItem.Size() == 0) |
---|
3099 | 3410 | { |
---|
3100 | | - hasRoot = true; |
---|
| 3411 | + // Cannot ungroup leaves |
---|
| 3412 | + canUngroup = false; |
---|
| 3413 | + break; |
---|
| 3414 | + } |
---|
| 3415 | + |
---|
| 3416 | + if (selectedItem == group) |
---|
| 3417 | + { |
---|
| 3418 | + // Cannot ungroup root |
---|
| 3419 | + canUngroup = false; |
---|
3101 | 3420 | break; |
---|
3102 | 3421 | } |
---|
3103 | 3422 | } |
---|
3104 | 3423 | |
---|
3105 | | - if (!hasRoot) |
---|
| 3424 | + if (canUngroup) |
---|
3106 | 3425 | { |
---|
3107 | 3426 | for (int i=0; i<group.selection.size(); i++) |
---|
3108 | 3427 | { |
---|
3109 | | - Ungroup(group.selection.get(i)); |
---|
| 3428 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3429 | + |
---|
| 3430 | + Ungroup(selectedItem); |
---|
3110 | 3431 | } |
---|
3111 | 3432 | |
---|
3112 | 3433 | ClearSelection(false); |
---|
.. | .. |
---|
3157 | 3478 | if (source == clearMaterialsItem) |
---|
3158 | 3479 | { |
---|
3159 | 3480 | ClearMaterials(); |
---|
| 3481 | + } else |
---|
| 3482 | + if (source == clearVersionsItem) |
---|
| 3483 | + { |
---|
| 3484 | + ClearVersions(); |
---|
3160 | 3485 | } else |
---|
3161 | 3486 | if (source == liveleavesItem) |
---|
3162 | 3487 | { |
---|
.. | .. |
---|
3297 | 3622 | if (source == transformChildrenItem) |
---|
3298 | 3623 | { |
---|
3299 | 3624 | TransformChildren(); |
---|
| 3625 | + } else |
---|
| 3626 | + if (source == textureRatioRItem) |
---|
| 3627 | + { |
---|
| 3628 | + TextureRatio(0); |
---|
| 3629 | + } else |
---|
| 3630 | + if (source == textureRatioGItem) |
---|
| 3631 | + { |
---|
| 3632 | + TextureRatio(1); |
---|
| 3633 | + } else |
---|
| 3634 | + if (source == textureRatioBItem) |
---|
| 3635 | + { |
---|
| 3636 | + TextureRatio(2); |
---|
3300 | 3637 | } else |
---|
3301 | 3638 | if (source == resetTransformItem) |
---|
3302 | 3639 | { |
---|
.. | .. |
---|
3469 | 3806 | if (CameraPane.FULLSCREEN) |
---|
3470 | 3807 | fullscreenLayout = radio.layout; |
---|
3471 | 3808 | |
---|
3472 | | - // bug |
---|
3473 | | - //gridPanel.setDividerLocation(1.0); |
---|
3474 | | - //bigPanel.setDividerLocation(0.0); |
---|
3475 | | -// bigThree.remove(scenePanel); |
---|
3476 | | -// bigThree.remove(centralPanel); |
---|
3477 | | -// bigThree.remove(XYZPanel); |
---|
3478 | | -// aWindowConstraints.gridx = 0; |
---|
3479 | | -// aWindowConstraints.gridy = 0; |
---|
3480 | | -// aWindowConstraints.gridwidth = 1; |
---|
3481 | | -// // aConstraints.gridheight = 3; |
---|
3482 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3483 | | -// aWindowConstraints.weightx = 0; |
---|
3484 | | -// aWindowConstraints.weighty = 1; |
---|
3485 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3486 | | -// aWindowConstraints.weightx = 1; |
---|
3487 | | -// aWindowConstraints.gridwidth = 3; |
---|
3488 | | -// // aConstraints.gridheight = 3; |
---|
3489 | | -// aWindowConstraints.gridx = 1; |
---|
3490 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3491 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3492 | | -// aWindowConstraints.weightx = 0; |
---|
3493 | | -// aWindowConstraints.gridx = 4; |
---|
3494 | | -// aWindowConstraints.gridwidth = 1; |
---|
3495 | | -// // aConstraints.gridheight = 3; |
---|
3496 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3497 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3498 | | -// scenePanel.setVisible(false); |
---|
3499 | | -// centralPanel.setVisible(true); |
---|
3500 | | -// XYZPanel.setVisible(false); |
---|
3501 | | - bigThree.ClearUI(); |
---|
3502 | | - bigThree.add(centralPanel); |
---|
3503 | | - bigThree.FlushUI(); |
---|
| 3809 | + Show3DView(); |
---|
3504 | 3810 | |
---|
3505 | 3811 | cameraView.requestFocusInWindow(); |
---|
3506 | 3812 | |
---|
.. | .. |
---|
3686 | 3992 | } else |
---|
3687 | 3993 | if (source == rootButton) |
---|
3688 | 3994 | { |
---|
| 3995 | + Replace(); |
---|
3689 | 3996 | Object3D obj; |
---|
3690 | 3997 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3691 | 3998 | { |
---|
.. | .. |
---|
3700 | 4007 | if (source == closeButton) |
---|
3701 | 4008 | { |
---|
3702 | 4009 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 4010 | + if (copy.versionlist != null) |
---|
| 4011 | + Replace(); |
---|
| 4012 | + |
---|
3703 | 4013 | cRadio ab; |
---|
3704 | 4014 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3705 | 4015 | { |
---|
.. | .. |
---|
3743 | 4053 | { |
---|
3744 | 4054 | Object3D child = (Object3D)e.nextElement(); |
---|
3745 | 4055 | if(child.editWindow != null) |
---|
3746 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3747 | 4056 | child.pinned = false; |
---|
3748 | 4057 | child.CloseUI(); |
---|
3749 | 4058 | listUI.remove(child); |
---|
| 4059 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3750 | 4060 | |
---|
3751 | 4061 | //child.editWindow = null; // ??????????? |
---|
3752 | 4062 | } |
---|
.. | .. |
---|
3765 | 4075 | obj.CloseUI(); |
---|
3766 | 4076 | } |
---|
3767 | 4077 | listUI.clear(); |
---|
| 4078 | + SetPinStates(group.selection.size() > 0); |
---|
3768 | 4079 | refreshContents(true); |
---|
3769 | 4080 | } else |
---|
3770 | 4081 | if (source == allParamsButton) |
---|
.. | .. |
---|
3797 | 4108 | } else |
---|
3798 | 4109 | if(source instanceof cRadio) |
---|
3799 | 4110 | { |
---|
| 4111 | + if (copy.versionlist != null) |
---|
| 4112 | + Replace(); |
---|
| 4113 | + |
---|
3800 | 4114 | group.parent = keepparent; |
---|
3801 | 4115 | group.attributes = 0; |
---|
3802 | 4116 | //group.editWindow = null; |
---|
.. | .. |
---|
3821 | 4135 | |
---|
3822 | 4136 | copy = group; |
---|
3823 | 4137 | |
---|
3824 | | - SetUndoStates(); |
---|
3825 | | - |
---|
3826 | 4138 | //Globals.theRenderer.object = group; |
---|
3827 | 4139 | if(!useclient) |
---|
3828 | 4140 | { |
---|
.. | .. |
---|
3850 | 4162 | */ |
---|
3851 | 4163 | radio.layout.doClick(); |
---|
3852 | 4164 | |
---|
| 4165 | + //assert(copy instanceof Composite); |
---|
| 4166 | + |
---|
| 4167 | + if (copy.versionlist == null) |
---|
| 4168 | + { |
---|
| 4169 | + copy.versionindex = -1; |
---|
| 4170 | + |
---|
| 4171 | + // Cannot work with loops |
---|
| 4172 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4173 | + // and check if any of these nodes are reachable below the root. |
---|
| 4174 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4175 | + |
---|
| 4176 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
| 4177 | + { |
---|
| 4178 | + if (copy.versionlist == null) |
---|
| 4179 | + copy.versionlist = new Object3D[100]; |
---|
| 4180 | + |
---|
| 4181 | + //Save(true); |
---|
| 4182 | + } |
---|
| 4183 | + else |
---|
| 4184 | + copy.versionindex = -2; |
---|
| 4185 | + |
---|
| 4186 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4187 | + } |
---|
| 4188 | + |
---|
| 4189 | + SetVersionStates(); |
---|
| 4190 | + |
---|
3853 | 4191 | ClearUnpinned(); |
---|
| 4192 | + |
---|
3854 | 4193 | //Grafreed.Assert(group != null); |
---|
3855 | 4194 | //Grafreed.Assert(group.selection != null); |
---|
3856 | 4195 | SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
.. | .. |
---|
3867 | 4206 | } else if (event.getSource() == editCameraItem) |
---|
3868 | 4207 | { |
---|
3869 | 4208 | cameraView.ProtectCamera(); |
---|
| 4209 | + cameraView.requestFocusInWindow(); |
---|
3870 | 4210 | cameraView.repaint(); |
---|
3871 | 4211 | return; |
---|
3872 | 4212 | } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3873 | 4213 | { |
---|
3874 | 4214 | cameraView.RevertCamera(); |
---|
| 4215 | + cameraView.requestFocusInWindow(); |
---|
3875 | 4216 | cameraView.repaint(); |
---|
3876 | 4217 | return; |
---|
3877 | 4218 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
3960 | 4301 | refreshContents(); |
---|
3961 | 4302 | } |
---|
3962 | 4303 | |
---|
| 4304 | + void TextureRatio(int axis) |
---|
| 4305 | + { |
---|
| 4306 | + Object3D obj; |
---|
| 4307 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4308 | + { |
---|
| 4309 | + obj = (Object3D)e.nextElement(); |
---|
| 4310 | + obj.TextureRatio(axis); |
---|
| 4311 | + } |
---|
| 4312 | + |
---|
| 4313 | + refreshContents(); |
---|
| 4314 | + } |
---|
| 4315 | + |
---|
3963 | 4316 | void ResetTransform() |
---|
3964 | 4317 | { |
---|
3965 | 4318 | ResetTransform(-1); |
---|
| 4319 | + } |
---|
| 4320 | + |
---|
| 4321 | + void ScaleSelection(int scale) |
---|
| 4322 | + { |
---|
| 4323 | + Object3D obj; |
---|
| 4324 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4325 | + { |
---|
| 4326 | + obj = (Object3D)e.nextElement(); |
---|
| 4327 | + |
---|
| 4328 | + if (obj.toParent == null) |
---|
| 4329 | + continue; |
---|
| 4330 | + |
---|
| 4331 | + obj.Scale(scale); |
---|
| 4332 | + |
---|
| 4333 | + if (obj.parent == null) |
---|
| 4334 | + { |
---|
| 4335 | + System.out.println("NULL PARENT!"); |
---|
| 4336 | + // new Exception().printStackTrace(); |
---|
| 4337 | + } |
---|
| 4338 | + else |
---|
| 4339 | + TouchTransform(obj); |
---|
| 4340 | + //obj.parent.Touch(); |
---|
| 4341 | + } |
---|
| 4342 | + |
---|
| 4343 | + refreshContents(); |
---|
3966 | 4344 | } |
---|
3967 | 4345 | |
---|
3968 | 4346 | void ResetTransform(int mask) |
---|
.. | .. |
---|
3975 | 4353 | if (obj.toParent == null) |
---|
3976 | 4354 | continue; |
---|
3977 | 4355 | |
---|
3978 | | - if (mask == -1) |
---|
3979 | | - { |
---|
3980 | | - if (obj instanceof Camera) // jan 2014 |
---|
3981 | | - { |
---|
3982 | | - LA.matIdentity(obj.toParent); |
---|
3983 | | - LA.matIdentity(obj.fromParent); |
---|
3984 | | - } |
---|
3985 | | - else |
---|
3986 | | - { |
---|
3987 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
3988 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
3989 | | - } |
---|
3990 | | - TouchTransform(obj); |
---|
3991 | | - continue; |
---|
3992 | | - } |
---|
3993 | | - if ((mask&2) != 0) // Scale |
---|
3994 | | - { |
---|
3995 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
3996 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
3997 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
3998 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
3999 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
4000 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
4001 | | - } |
---|
4002 | | - if ((mask&4) != 0) // Rotation |
---|
4003 | | - { |
---|
4004 | | - // ? |
---|
4005 | | - } |
---|
4006 | | - if ((mask&1) != 0) // Translation |
---|
4007 | | - { |
---|
4008 | | - if (obj.toParent != null) |
---|
4009 | | - { |
---|
4010 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
4011 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
4012 | | - } |
---|
4013 | | - } |
---|
| 4356 | + obj.ResetTransform(mask); |
---|
| 4357 | + |
---|
4014 | 4358 | if (obj.parent == null) |
---|
4015 | 4359 | { |
---|
4016 | 4360 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4519 | 4863 | { |
---|
4520 | 4864 | Object3D obj = group.selection.get(i); |
---|
4521 | 4865 | |
---|
| 4866 | + if (obj.toParent == null) |
---|
| 4867 | + { |
---|
| 4868 | + obj.toParent = LA.newMatrix(); |
---|
| 4869 | + obj.fromParent = LA.newMatrix(); |
---|
| 4870 | + } |
---|
| 4871 | + |
---|
4522 | 4872 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4523 | 4873 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4524 | 4874 | } |
---|
4525 | 4875 | |
---|
| 4876 | + Globals.lighttouched = true; |
---|
4526 | 4877 | refreshContents(); |
---|
4527 | 4878 | } |
---|
4528 | 4879 | |
---|
.. | .. |
---|
4810 | 5161 | refreshContents(); |
---|
4811 | 5162 | } |
---|
4812 | 5163 | |
---|
| 5164 | + void ClearVersions() |
---|
| 5165 | + { |
---|
| 5166 | + group.selection.ClearVersions(); |
---|
| 5167 | + refreshContents(); |
---|
| 5168 | + } |
---|
| 5169 | + |
---|
4813 | 5170 | void FlipV(boolean flip) |
---|
4814 | 5171 | { |
---|
4815 | 5172 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
5004 | 5361 | |
---|
5005 | 5362 | freezemodel = false; |
---|
5006 | 5363 | } |
---|
5007 | | - |
---|
5008 | | - boolean flashIt = true; |
---|
5009 | | - |
---|
| 5364 | + |
---|
5010 | 5365 | public void valueChanged(TreeSelectionEvent e) |
---|
5011 | 5366 | //public boolean handleEvent(Event event) |
---|
5012 | 5367 | { |
---|
.. | .. |
---|
5050 | 5405 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
5051 | 5406 | // a camera |
---|
5052 | 5407 | { |
---|
5053 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5408 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace |
---|
5054 | 5409 | { |
---|
5055 | 5410 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
5056 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5411 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent(), true); |
---|
5057 | 5412 | } |
---|
5058 | 5413 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
5059 | 5414 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
.. | .. |
---|
5079 | 5434 | { |
---|
5080 | 5435 | editButton.setEnabled(enabled); |
---|
5081 | 5436 | uneditButton.setEnabled(enabled); |
---|
5082 | | - unselectButton.setEnabled(enabled); |
---|
| 5437 | + //unselectButton.setEnabled(enabled); |
---|
5083 | 5438 | flashSelectionButton.setEnabled(enabled); |
---|
| 5439 | + |
---|
| 5440 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5441 | + |
---|
| 5442 | + boolean allComposites = true; |
---|
| 5443 | + |
---|
| 5444 | + if (group.selection != null) |
---|
| 5445 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5446 | + { |
---|
| 5447 | + Object next = e.nextElement(); |
---|
| 5448 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
| 5449 | + { |
---|
| 5450 | + allComposites = false; |
---|
| 5451 | + break; |
---|
| 5452 | + } |
---|
| 5453 | + } |
---|
| 5454 | + |
---|
| 5455 | + rootButton.setEnabled(true); // allComposites); |
---|
5084 | 5456 | } |
---|
5085 | 5457 | |
---|
5086 | 5458 | void refreshContents(boolean cp) |
---|
5087 | 5459 | { |
---|
5088 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5460 | + if (Globals.SHOWINFO) |
---|
| 5461 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
5089 | 5462 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
5090 | 5463 | { |
---|
5091 | 5464 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
5095 | 5468 | Object3D child = (Object3D) group.selection.get(i); |
---|
5096 | 5469 | |
---|
5097 | 5470 | objEditor.AddInfo(child, this, true); |
---|
5098 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5471 | +// System.err.println("info : " + child.GetPath()); |
---|
5099 | 5472 | } |
---|
5100 | 5473 | |
---|
5101 | 5474 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
5921 | 6294 | |
---|
5922 | 6295 | cButton restoreCameraButton; |
---|
5923 | 6296 | |
---|
5924 | | - cButton saveButton; |
---|
5925 | 6297 | cButton oneStepButton; |
---|
5926 | 6298 | |
---|
5927 | 6299 | cButton groupButton; |
---|
.. | .. |
---|
5979 | 6351 | private MenuItem lookAtItem; |
---|
5980 | 6352 | private MenuItem lookFromItem; |
---|
5981 | 6353 | private MenuItem switchViewItem; |
---|
5982 | | - private MenuItem cutItem; |
---|
| 6354 | + private JMenuItem cutItem; |
---|
5983 | 6355 | private MenuItem undoItem; |
---|
5984 | 6356 | private MenuItem redoItem; |
---|
5985 | 6357 | private JMenuItem duplicateItem; |
---|
5986 | | - private MenuItem cloneItem; |
---|
| 6358 | + private JMenuItem cloneItem; |
---|
5987 | 6359 | private MenuItem cloneSupportItem; |
---|
5988 | 6360 | private MenuItem overwriteGeoItem; |
---|
5989 | 6361 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
6004 | 6376 | private MenuItem cloneGeometriesItem; |
---|
6005 | 6377 | private MenuItem shareGeometriesItem; |
---|
6006 | 6378 | private MenuItem mergeGeometriesItem; |
---|
6007 | | - private MenuItem copyItem; |
---|
| 6379 | + private JMenuItem copyItem; |
---|
6008 | 6380 | private MenuItem pasteItem; |
---|
6009 | | - private MenuItem pasteIntoItem; |
---|
6010 | | - private MenuItem pasteLinkItem; |
---|
6011 | | - private MenuItem pasteCloneItem; |
---|
6012 | | - private MenuItem pasteExpandItem; |
---|
6013 | | - private MenuItem deleteItem; |
---|
| 6381 | + private JMenuItem pasteIntoItem; |
---|
| 6382 | + private JMenuItem pasteLinkItem; |
---|
| 6383 | + private JMenuItem pasteCloneItem; |
---|
| 6384 | + private JMenuItem pasteExpandItem; |
---|
| 6385 | + private JMenuItem deleteItem; |
---|
6014 | 6386 | private MenuItem clearAllItem; |
---|
6015 | 6387 | private MenuItem genUVItem; |
---|
6016 | 6388 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
6036 | 6408 | private MenuItem clipMeshItem; |
---|
6037 | 6409 | private MenuItem smoothMeshItem; |
---|
6038 | 6410 | private MenuItem clearMaterialsItem; |
---|
| 6411 | + private MenuItem clearVersionsItem; |
---|
6039 | 6412 | |
---|
6040 | 6413 | private MenuItem liveleavesItem; |
---|
6041 | 6414 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
6059 | 6432 | private MenuItem maxTexturesItem; |
---|
6060 | 6433 | private MenuItem panoTexturesItem; |
---|
6061 | 6434 | |
---|
| 6435 | + private MenuItem textureRatioRItem; |
---|
| 6436 | + private MenuItem textureRatioGItem; |
---|
| 6437 | + private MenuItem textureRatioBItem; |
---|
6062 | 6438 | private MenuItem resetCentroidItem; |
---|
6063 | 6439 | private MenuItem resetCentroidXZItem; |
---|
6064 | 6440 | private MenuItem resetTransformItem; |
---|
6065 | 6441 | private MenuItem transformGeometryItem; |
---|
6066 | 6442 | private MenuItem transformChildrenItem; |
---|
6067 | 6443 | private MenuItem hideItem; |
---|
6068 | | - private MenuItem grabItem; |
---|
| 6444 | + private JMenuItem grabItem; |
---|
6069 | 6445 | private MenuItem backItem; |
---|
6070 | 6446 | private MenuItem frontItem; |
---|
6071 | 6447 | private MenuItem cameraItem; |
---|
.. | .. |
---|
6078 | 6454 | private MenuItem switchTransfoItem; |
---|
6079 | 6455 | private MenuItem morphItem; |
---|
6080 | 6456 | private MenuItem linkerItem; |
---|
6081 | | - private MenuItem ungroupItem; |
---|
| 6457 | + private JMenuItem ungroupItem; |
---|
6082 | 6458 | private MenuItem editItem; |
---|
6083 | 6459 | private MenuItem openWindowItem; |
---|
6084 | 6460 | private MenuItem editLeafItem; |
---|