.. | .. |
---|
60 | 60 | this.copy = this.group = group; |
---|
61 | 61 | //selectees = this.group.selectees; |
---|
62 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
63 | 69 | if(ui) |
---|
64 | 70 | SetupUI(objEditor); |
---|
65 | 71 | } |
---|
.. | .. |
---|
80 | 86 | SetupViews(objEditor); |
---|
81 | 87 | |
---|
82 | 88 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 89 | + |
---|
| 90 | + if (copy.versions == null) |
---|
| 91 | + { |
---|
| 92 | + copy.versions = new byte[100][]; |
---|
| 93 | + copy.versionindex = -1; |
---|
| 94 | + |
---|
| 95 | + Save(true); |
---|
| 96 | + } |
---|
83 | 97 | } |
---|
84 | 98 | |
---|
85 | 99 | void CloneSelection(boolean supports) |
---|
86 | 100 | { |
---|
| 101 | + if (Globals.REPLACEONMAKE) |
---|
| 102 | + Save(); |
---|
| 103 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 104 | + Globals.REPLACEONMAKE = false; |
---|
87 | 105 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 106 | //Object3D obj; |
---|
89 | 107 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 112 | |
---|
95 | 113 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 114 | } |
---|
| 115 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 116 | } |
---|
98 | 117 | |
---|
99 | 118 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 169 | |
---|
151 | 170 | void SetupMenu2(GroupEditor oe) |
---|
152 | 171 | { |
---|
| 172 | + oe.jTree = new cTree(); |
---|
| 173 | + |
---|
153 | 174 | Menu menu; |
---|
154 | 175 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 176 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
160 | 181 | // redoItem = menu.add(new MenuItem("Redo")); |
---|
161 | 182 | // redoItem.addActionListener(this); |
---|
162 | 183 | // menu.add("-"); |
---|
163 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 184 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
164 | 185 | duplicateItem.addActionListener(this); |
---|
165 | 186 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
166 | 187 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
176 | 197 | copyItem.addActionListener(this); |
---|
177 | 198 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
178 | 199 | pasteItem.addActionListener(this); |
---|
179 | | - menu.add("-"); |
---|
180 | 200 | |
---|
181 | 201 | menu.add("-"); |
---|
182 | 202 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
188 | 208 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
189 | 209 | // pasteExpandItem.addActionListener(this); |
---|
190 | 210 | menu.add("-"); |
---|
191 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
192 | | - clearItem.addActionListener(this); |
---|
| 211 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 212 | + deleteItem.addActionListener(this); |
---|
193 | 213 | |
---|
194 | 214 | if (Globals.ADVANCED) |
---|
195 | 215 | { |
---|
.. | .. |
---|
203 | 223 | //zBufferItem.addActionListener(this); |
---|
204 | 224 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
205 | 225 | //normalLensItem.addActionListener(this); |
---|
206 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
207 | | - revertCameraItem.addActionListener(this); |
---|
| 226 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 227 | + restoreCameraItem.addActionListener(this); |
---|
208 | 228 | |
---|
209 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
210 | | - toggleFullScreenItem.addItemListener(this); |
---|
211 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
212 | | - cameraMenu.add("-"); |
---|
| 229 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 230 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 231 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 232 | +// cameraMenu.add("-"); |
---|
| 233 | +// |
---|
| 234 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 235 | +// toggleTextureItem.addItemListener(this); |
---|
| 236 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 237 | +// |
---|
| 238 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 239 | +// toggleSwitchItem.addItemListener(this); |
---|
| 240 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
213 | 241 | |
---|
214 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
215 | | - toggleTextureItem.addItemListener(this); |
---|
216 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
217 | | - |
---|
218 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
219 | | - toggleSwitchItem.addItemListener(this); |
---|
220 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
221 | | - |
---|
222 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 242 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
223 | 243 | toggleHandleItem.addItemListener(this); |
---|
224 | 244 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
225 | 245 | |
---|
.. | .. |
---|
246 | 266 | |
---|
247 | 267 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
248 | 268 | toggleDebugItem.addItemListener(this); |
---|
249 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 269 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
250 | 270 | |
---|
251 | 271 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
252 | 272 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
274 | 294 | { |
---|
275 | 295 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
276 | 296 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
277 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 297 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
278 | 298 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
279 | 299 | oe.cameraMenu.add("-"); |
---|
280 | 300 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
282 | 302 | editLeafItem.addActionListener(this); |
---|
283 | 303 | lookAtItem.addActionListener(this); |
---|
284 | 304 | //lookFromItem.addActinoListener(this); |
---|
285 | | - //switchItem.addActionListener(this); |
---|
| 305 | + //switchViewItem.addActionListener(this); |
---|
286 | 306 | } |
---|
287 | 307 | |
---|
288 | 308 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
327 | 347 | } |
---|
328 | 348 | |
---|
329 | 349 | oe.menuBar.add(menu = new Menu("Group")); |
---|
330 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
331 | | - grabItem.addActionListener(this); |
---|
| 350 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 351 | +// grabItem.addActionListener(this); |
---|
332 | 352 | backItem = menu.add(new MenuItem("Back")); |
---|
333 | 353 | backItem.addActionListener(this); |
---|
334 | 354 | frontItem = menu.add(new MenuItem("Front")); |
---|
335 | 355 | frontItem.addActionListener(this); |
---|
336 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
337 | | - compositeItem.addActionListener(this); |
---|
| 356 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 357 | +// compositeItem.addActionListener(this); |
---|
| 358 | + |
---|
| 359 | + if (Globals.ADVANCED) |
---|
| 360 | + { |
---|
338 | 361 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
339 | 362 | hideItem.addActionListener(this); |
---|
| 363 | + } |
---|
340 | 364 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
341 | 365 | ungroupItem.addActionListener(this); |
---|
342 | | - menu.add("-"); |
---|
343 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
344 | | - randomItem.addActionListener(this); |
---|
| 366 | + |
---|
| 367 | +// menu.add("-"); |
---|
| 368 | +// |
---|
| 369 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 370 | +// switchItem.addActionListener(this); |
---|
| 371 | + if (Globals.ADVANCED) |
---|
| 372 | + { |
---|
345 | 373 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
346 | 374 | switchGeoItem.addActionListener(this); |
---|
347 | 375 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
349 | 377 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
350 | 378 | morphItem.addActionListener(this); |
---|
351 | 379 | |
---|
352 | | - if (Globals.ADVANCED) |
---|
353 | | - { |
---|
354 | 380 | menu.add("-"); |
---|
355 | 381 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
356 | 382 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
358 | 384 | frameselectorItem.addActionListener(this); |
---|
359 | 385 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
360 | 386 | scriptNodeItem.addActionListener(this); |
---|
361 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
362 | | - cameraItem.addActionListener(this); |
---|
363 | 387 | } |
---|
364 | 388 | |
---|
365 | 389 | oe.menuBar.add(menu = new Menu("Object")); |
---|
366 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
367 | | - textureItem.addActionListener(this); |
---|
| 390 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 391 | +// textureItem.addActionListener(this); |
---|
368 | 392 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
369 | 393 | billboardItem.addActionListener(this); |
---|
370 | 394 | csgItem = menu.add(new MenuItem("CSG")); |
---|
371 | 395 | csgItem.addActionListener(this); |
---|
372 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 396 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
373 | 397 | shadowXItem.addActionListener(this); |
---|
374 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 398 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
375 | 399 | shadowYItem.addActionListener(this); |
---|
376 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 400 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
377 | 401 | shadowZItem.addActionListener(this); |
---|
| 402 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 403 | + attributeItem.addActionListener(this); |
---|
| 404 | + |
---|
378 | 405 | if (Globals.ADVANCED) |
---|
379 | 406 | { |
---|
380 | 407 | menu.add("-"); |
---|
381 | 408 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
382 | 409 | linkerItem.addActionListener(this); |
---|
383 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
384 | | - attributeItem.addActionListener(this); |
---|
385 | 410 | templateItem = menu.add(new MenuItem("Template")); |
---|
386 | 411 | templateItem.addActionListener(this); |
---|
387 | 412 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
410 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
411 | 436 | if (Globals.ADVANCED) |
---|
412 | 437 | { |
---|
413 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
414 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
415 | 440 | } |
---|
416 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
470 | 495 | markleavesItem.addActionListener(this); |
---|
471 | 496 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
472 | 497 | unmarkleavesItem.addActionListener(this); |
---|
| 498 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 499 | + rewindleavesItem.addActionListener(this); |
---|
| 500 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 501 | + unrewindleavesItem.addActionListener(this); |
---|
| 502 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 503 | + randomleavesItem.addActionListener(this); |
---|
| 504 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 505 | + unrandomleavesItem.addActionListener(this); |
---|
473 | 506 | menu.add("-"); |
---|
474 | 507 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
475 | 508 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
525 | 558 | buildToolsMenu(menu); |
---|
526 | 559 | } |
---|
527 | 560 | |
---|
| 561 | + |
---|
528 | 562 | void SetupUI2(ObjEditor oe) |
---|
529 | 563 | { |
---|
| 564 | + // June 2019 |
---|
| 565 | + if (oe == null) |
---|
| 566 | + { |
---|
| 567 | + //super.SetupUI2(this); |
---|
| 568 | + //return; |
---|
| 569 | + } |
---|
| 570 | + |
---|
| 571 | + if (copy != group) |
---|
| 572 | + { |
---|
| 573 | + //super.SetupUI2(this); |
---|
| 574 | + } |
---|
| 575 | + |
---|
530 | 576 | //new Exception().printStackTrace(); |
---|
531 | 577 | |
---|
532 | 578 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
555 | 601 | oe.radioPanel.add(dummyButton); |
---|
556 | 602 | oe.buttonGroup.add(dummyButton); |
---|
557 | 603 | */ |
---|
| 604 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 605 | + |
---|
| 606 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 607 | + |
---|
558 | 608 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
559 | 609 | |
---|
560 | | - oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
561 | | - undoButton.setToolTipText("Undo changes"); |
---|
562 | | - undoButton.addActionListener(this); |
---|
| 610 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + //minButton.setToolTipText("Minimize window"); |
---|
| 612 | + //minButton.addActionListener(this); |
---|
563 | 613 | |
---|
564 | | - oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | | - redoButton.setToolTipText("Redo changes"); |
---|
566 | | - redoButton.addActionListener(this); |
---|
| 614 | + if (Globals.ADVANCED) |
---|
| 615 | + { |
---|
| 616 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 617 | + maxButton.setToolTipText("Maximize window"); |
---|
| 618 | + maxButton.addActionListener(this); |
---|
| 619 | + } |
---|
567 | 620 | |
---|
568 | | - oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
569 | | - saveButton.setToolTipText("Save changes"); |
---|
| 621 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 622 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 623 | + fullButton.addActionListener(this); |
---|
| 624 | + |
---|
| 625 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 626 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 627 | + screenfitButton.addActionListener(this); |
---|
| 628 | + |
---|
| 629 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 631 | + restoreCameraButton.addActionListener(this); |
---|
| 632 | + |
---|
| 633 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + saveButton.setToolTipText("New version"); |
---|
570 | 635 | saveButton.addActionListener(this); |
---|
| 636 | + |
---|
| 637 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 638 | + undoButton.setToolTipText("Previous version"); |
---|
| 639 | + undoButton.addActionListener(this); |
---|
| 640 | + undoButton.setEnabled(false); |
---|
571 | 641 | |
---|
572 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 642 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 643 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 644 | + restoreButton.setToolTipText("Restore current"); |
---|
| 645 | + restoreButton.addActionListener(this); |
---|
| 646 | + restoreButton.setEnabled(false); |
---|
| 647 | + |
---|
| 648 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + replaceButton.setToolTipText("Replace current"); |
---|
| 650 | + replaceButton.addActionListener(this); |
---|
| 651 | + replaceButton.setEnabled(false); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(updown); |
---|
| 654 | + |
---|
| 655 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + redoButton.setToolTipText("Next version"); |
---|
| 657 | + redoButton.addActionListener(this); |
---|
| 658 | + redoButton.setEnabled(false); |
---|
| 659 | + |
---|
| 660 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
573 | 661 | liveCB.setToolTipText("Enable animation"); |
---|
574 | 662 | liveCB.addItemListener(this); |
---|
575 | 663 | |
---|
576 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 665 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
578 | 666 | oneStepButton.addActionListener(this); |
---|
579 | 667 | |
---|
580 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 668 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
581 | 669 | fastCB.setToolTipText("Fast mode"); |
---|
582 | 670 | fastCB.addItemListener(this); |
---|
583 | 671 | |
---|
584 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
585 | | - trackCB.setToolTipText("Enable tracking"); |
---|
586 | | - trackCB.addItemListener(this); |
---|
587 | | - |
---|
588 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
589 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
590 | | - screenfitButton.addActionListener(this); |
---|
| 672 | + //oe.toolboxPanel.Return(); |
---|
| 673 | + |
---|
| 674 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 675 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 676 | +// trackCB.addItemListener(this); |
---|
591 | 677 | |
---|
592 | 678 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
593 | 679 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
599 | 685 | snapobjectButton.setToolTipText("Snap Object"); |
---|
600 | 686 | } |
---|
601 | 687 | |
---|
602 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
603 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
604 | | - flashSelectionButton.addActionListener(this); |
---|
| 688 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
605 | 689 | |
---|
606 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
607 | | - |
---|
608 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
609 | | - twoButton.setToolTipText("Show center view only"); |
---|
610 | | - twoButton.addActionListener(this); |
---|
611 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 690 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
612 | 691 | fourButton.addActionListener(this); |
---|
613 | 692 | fourButton.setToolTipText("Show left panel only"); |
---|
614 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
615 | | - sixButton.setToolTipText("2-column layout left"); |
---|
| 693 | + |
---|
| 694 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + twoButton.setToolTipText("Show right view only"); |
---|
| 696 | + twoButton.addActionListener(this); |
---|
| 697 | + this.fullscreenLayout = twoButton; |
---|
| 698 | + |
---|
| 699 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 700 | + sixButton.setToolTipText("Show left and right"); |
---|
616 | 701 | sixButton.addActionListener(this); |
---|
617 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
618 | | - threeButton.setToolTipText("2-column layout right"); |
---|
619 | | - threeButton.addActionListener(this); |
---|
620 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
621 | | - sevenButton.setToolTipText("3-column layout"); |
---|
622 | | - sevenButton.addActionListener(this); |
---|
| 702 | +// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 703 | +// threeButton.setToolTipText("2-column layout right"); |
---|
| 704 | +// threeButton.addActionListener(this); |
---|
| 705 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 706 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 707 | +// sevenButton.addActionListener(this); |
---|
623 | 708 | // |
---|
624 | 709 | |
---|
625 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
626 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 710 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
627 | 712 | rootButton.addActionListener(this); |
---|
628 | 713 | |
---|
629 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 714 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
630 | 715 | closeButton.setToolTipText("Close tab"); |
---|
631 | 716 | closeButton.addActionListener(this); |
---|
632 | 717 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
633 | 718 | //clearButton.addActionListener(this); |
---|
634 | | - |
---|
635 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 719 | + |
---|
| 720 | + // INSERT |
---|
| 721 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 722 | + gridButton.setToolTipText("Create grid"); |
---|
| 723 | + gridButton.addActionListener(this); |
---|
| 724 | + |
---|
| 725 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 726 | + boxButton.setToolTipText("Create box"); |
---|
| 727 | + boxButton.addActionListener(this); |
---|
| 728 | + |
---|
| 729 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 730 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 731 | + sphereButton.addActionListener(this); |
---|
| 732 | + |
---|
| 733 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 734 | + coneButton.setToolTipText("Create cone"); |
---|
| 735 | + coneButton.addActionListener(this); |
---|
| 736 | + |
---|
| 737 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + torusButton.setToolTipText("Create torus"); |
---|
| 739 | + torusButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 742 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 743 | + superButton.addActionListener(this); |
---|
| 744 | + |
---|
| 745 | + if (Globals.ADVANCED) |
---|
| 746 | + { |
---|
| 747 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 748 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 749 | + kleinButton.addActionListener(this); |
---|
| 750 | + } |
---|
636 | 751 | |
---|
637 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
638 | | - editButton.setToolTipText("Edit selection"); |
---|
| 752 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 753 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 754 | + particlesButton.addActionListener(this); |
---|
| 755 | + |
---|
| 756 | + oe.toolboxPanel.Return(); |
---|
| 757 | + |
---|
| 758 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 759 | + groupButton.setToolTipText("Create group"); |
---|
| 760 | + groupButton.addActionListener(this); |
---|
| 761 | + |
---|
| 762 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 763 | + compositeButton.setToolTipText("Create composite"); |
---|
| 764 | + compositeButton.addActionListener(this); |
---|
| 765 | + |
---|
| 766 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 767 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 768 | + switchButton.addActionListener(this); |
---|
| 769 | + |
---|
| 770 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 771 | + loopButton.setToolTipText("Create loop"); |
---|
| 772 | + loopButton.addActionListener(this); |
---|
| 773 | + |
---|
| 774 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 775 | + textureButton.setToolTipText("Create texture"); |
---|
| 776 | + textureButton.addActionListener(this); |
---|
| 777 | + |
---|
| 778 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 779 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 780 | + overlayButton.addActionListener(this); |
---|
| 781 | + |
---|
| 782 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 783 | + lightButton.setToolTipText("Create light"); |
---|
| 784 | + lightButton.addActionListener(this); |
---|
| 785 | + |
---|
| 786 | + for (int i=6; --i>=0;) |
---|
| 787 | + { |
---|
| 788 | + oe.toolboxPanel.Return(); |
---|
| 789 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 790 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 791 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 792 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 793 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 794 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 795 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 796 | + } |
---|
| 797 | + |
---|
| 798 | + // EDIT panel |
---|
| 799 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 800 | + editButton.setToolTipText("Pin selection controls"); |
---|
639 | 801 | editButton.addActionListener(this); |
---|
640 | 802 | |
---|
641 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
642 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 803 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 804 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
643 | 805 | uneditButton.addActionListener(this); |
---|
644 | 806 | |
---|
645 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
646 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 807 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 808 | + allParamsButton.setToolTipText("Show all controle"); |
---|
647 | 809 | allParamsButton.addActionListener(this); |
---|
648 | 810 | |
---|
649 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 811 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
650 | 812 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
651 | 813 | clearPanelButton.addActionListener(this); |
---|
652 | 814 | |
---|
653 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 815 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
654 | 816 | unselectButton.setToolTipText("Unselect"); |
---|
655 | 817 | unselectButton.addActionListener(this); |
---|
656 | 818 | |
---|
657 | | - commandsPanel.preferredHeight = 1; |
---|
| 819 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 820 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 821 | + flashSelectionButton.addActionListener(this); |
---|
658 | 822 | |
---|
659 | | - oe.treePanel.add(commandsPanel); |
---|
660 | | - oe.treePanel.Return(); |
---|
| 823 | + editCommandsPanel.preferredHeight = 1; |
---|
| 824 | + |
---|
| 825 | + SetPinStates(false); |
---|
| 826 | +// oe.treePanel.add(commandsPanel); |
---|
| 827 | +// oe.treePanel.Return(); |
---|
661 | 828 | |
---|
662 | 829 | // oe.aConstraints.gridx += 1; |
---|
663 | 830 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
674 | 841 | |
---|
675 | 842 | JScrollPane jSP; |
---|
676 | 843 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
677 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 844 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
678 | 845 | ResetModel(); |
---|
679 | 846 | |
---|
680 | 847 | oe.treePanel.add(jSPPanel); |
---|
681 | 848 | oe.treePanel.Return(); |
---|
682 | 849 | |
---|
683 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
684 | | - |
---|
685 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
686 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
687 | | - colorCB.addItemListener(this); |
---|
688 | | - |
---|
689 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
690 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
691 | | - materialCB.addItemListener(this); |
---|
692 | | - |
---|
693 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
694 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
695 | | - textureCB.addItemListener(this); |
---|
696 | | - |
---|
697 | | - copyOptionsPanel.preferredHeight = 1; |
---|
698 | 850 | oe.treePanel.add(copyOptionsPanel); |
---|
699 | 851 | oe.treePanel.Return(); |
---|
| 852 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 853 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 854 | + sliderPane.preferredHeight = 1; |
---|
700 | 855 | |
---|
701 | 856 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
702 | 857 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
719 | 874 | dgr.addDragGestureListener(this); |
---|
720 | 875 | }catch(Exception e) {} |
---|
721 | 876 | */ |
---|
722 | | - radio.layout = sevenButton; |
---|
| 877 | + radio.layout = sixButton; // sevenButton; |
---|
723 | 878 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
724 | 879 | } |
---|
725 | 880 | |
---|
726 | 881 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
727 | 882 | { |
---|
| 883 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 884 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 885 | + colorCB.addItemListener(this); |
---|
| 886 | + |
---|
| 887 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 888 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 889 | + materialCB.addItemListener(this); |
---|
| 890 | + |
---|
| 891 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 892 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 893 | + textureCB.addItemListener(this); |
---|
| 894 | + |
---|
| 895 | + panel.Return(); |
---|
| 896 | + |
---|
728 | 897 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
729 | 898 | boxCB.setToolTipText("Display bounding boxes"); |
---|
730 | 899 | boxCB.addItemListener(this); |
---|
731 | 900 | |
---|
732 | 901 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
733 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 902 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
734 | 903 | zoomBoxCB.addItemListener(this); |
---|
735 | 904 | |
---|
736 | 905 | if (true) // Globals.ADVANCED) |
---|
737 | 906 | { |
---|
738 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
739 | | - supportCB.setToolTipText("Enable rigging"); |
---|
740 | | - supportCB.addItemListener(this); |
---|
| 907 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 908 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 909 | +// supportCB.addItemListener(this); |
---|
| 910 | + |
---|
| 911 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 912 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 913 | + freezeCB.addItemListener(this); |
---|
741 | 914 | |
---|
742 | 915 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
743 | 916 | // localCB.addItemListener(this); |
---|
744 | 917 | |
---|
| 918 | + panel.Return(); |
---|
| 919 | + |
---|
745 | 920 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
746 | 921 | crowdCB.setToolTipText("Used for crowds"); |
---|
747 | 922 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
758 | 933 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
759 | 934 | // speakerMocapCB.addItemListener(this); |
---|
760 | 935 | |
---|
| 936 | + panel.Return(); |
---|
| 937 | + |
---|
761 | 938 | if (false) |
---|
762 | 939 | { |
---|
763 | 940 | // handled in scripts |
---|
.. | .. |
---|
772 | 949 | //constraints.gridy += 1; |
---|
773 | 950 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
774 | 951 | smoothfocusCB.addItemListener(this); |
---|
| 952 | + panel.Return(); |
---|
775 | 953 | } |
---|
776 | 954 | |
---|
777 | 955 | //constraints.gridx += 1; |
---|
778 | 956 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
779 | 957 | // debugCB.addItemListener(this); |
---|
780 | 958 | |
---|
| 959 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 960 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 961 | + trackCB.addItemListener(this); |
---|
| 962 | + |
---|
781 | 963 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 964 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
782 | 965 | oeilCB.addItemListener(this); |
---|
783 | 966 | |
---|
| 967 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 968 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 969 | + shadowCB.addItemListener(this); |
---|
| 970 | + |
---|
| 971 | + panel.Return(); |
---|
| 972 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 973 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 974 | + toggleTextureCB.addItemListener(this); |
---|
| 975 | + |
---|
| 976 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 977 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 978 | + toggleSwitchCB.addItemListener(this); |
---|
| 979 | + |
---|
| 980 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 981 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 982 | + autokeepCB.addItemListener(this); |
---|
| 983 | + |
---|
| 984 | + panel.Return(); |
---|
| 985 | + if (Globals.ADVANCED) |
---|
| 986 | + { |
---|
784 | 987 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
785 | 988 | lookAtCB.setToolTipText("Look-at target"); |
---|
786 | 989 | lookAtCB.addItemListener(this); |
---|
| 990 | + } |
---|
787 | 991 | |
---|
788 | 992 | } |
---|
789 | 993 | |
---|
790 | 994 | cGridBag fill = new cGridBag(); |
---|
791 | | - |
---|
792 | 995 | fill.preferredHeight = 200; |
---|
| 996 | + cGridBag fill2 = new cGridBag(); |
---|
| 997 | + fill2.preferredHeight = 200; |
---|
| 998 | + cGridBag fill3 = new cGridBag(); |
---|
| 999 | + fill3.preferredHeight = 200; |
---|
793 | 1000 | |
---|
794 | 1001 | panel.add(fill); |
---|
| 1002 | + panel.add(fill2); |
---|
| 1003 | + panel.add(fill3); |
---|
795 | 1004 | |
---|
796 | 1005 | } |
---|
797 | 1006 | |
---|
798 | 1007 | void EditObject(Object3D obj) |
---|
799 | 1008 | { |
---|
800 | 1009 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1010 | + |
---|
| 1011 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1012 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1013 | + if (!radioButton.hadMaterial) |
---|
| 1014 | + { |
---|
| 1015 | + obj.material = new cMaterial(); |
---|
| 1016 | + } |
---|
| 1017 | + |
---|
801 | 1018 | radioButton.SetObject(obj); |
---|
802 | | - radioButton.layout = sevenButton; |
---|
| 1019 | + radioButton.layout = sixButton; // sevenButton; |
---|
803 | 1020 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
804 | 1021 | radioButton.addActionListener(this); |
---|
805 | 1022 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
809 | 1026 | |
---|
810 | 1027 | void SetupViews(ObjEditor oe) |
---|
811 | 1028 | { |
---|
| 1029 | + theFrame = this; |
---|
| 1030 | + |
---|
812 | 1031 | oe.SetupViews(); |
---|
813 | 1032 | |
---|
814 | 1033 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
817 | 1036 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
818 | 1037 | } |
---|
819 | 1038 | |
---|
820 | | - JCheckBox liveCB; |
---|
821 | | - JCheckBox supportCB; |
---|
822 | | - JCheckBox localCB; |
---|
823 | | - JCheckBox crowdCB; |
---|
824 | | - JCheckBox smoothCB; |
---|
825 | | - JCheckBox fastCB; |
---|
826 | | - JCheckBox slowCB; |
---|
827 | | - JCheckBox boxCB; |
---|
828 | | - JCheckBox zoomBoxCB; |
---|
829 | | - JCheckBox trackCB; |
---|
830 | | - JCheckBox smoothfocusCB; |
---|
| 1039 | + cToggleButton liveCB; |
---|
| 1040 | + cCheckBox supportCB; |
---|
| 1041 | + cCheckBox localCB; |
---|
| 1042 | + cCheckBox crowdCB; |
---|
| 1043 | + cCheckBox smoothCB; |
---|
| 1044 | + cToggleButton fastCB; |
---|
| 1045 | + cCheckBox slowCB; |
---|
| 1046 | + cCheckBox boxCB; |
---|
| 1047 | + cCheckBox zoomBoxCB; |
---|
| 1048 | + cCheckBox freezeCB; |
---|
| 1049 | + //cToggleButton trackCB; |
---|
| 1050 | + cCheckBox trackCB; |
---|
| 1051 | + cCheckBox smoothfocusCB; |
---|
831 | 1052 | // JCheckBox speakerMocapCB; |
---|
832 | | - JCheckBox speakerCameraCB; |
---|
833 | | - JCheckBox speakerFocusCB; |
---|
834 | | - JCheckBox debugCB; |
---|
835 | | - JCheckBox oeilCB; |
---|
836 | | - JCheckBox lookAtCB; |
---|
| 1053 | + cCheckBox speakerCameraCB; |
---|
| 1054 | + cCheckBox speakerFocusCB; |
---|
| 1055 | + cCheckBox debugCB; |
---|
| 1056 | + |
---|
| 1057 | + cCheckBox oeilCB; |
---|
| 1058 | + cCheckBox shadowCB; |
---|
| 1059 | + cCheckBox autokeepCB; |
---|
| 1060 | + cCheckBox lookAtCB; |
---|
837 | 1061 | |
---|
838 | 1062 | // static int COLOR = 1; |
---|
839 | 1063 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
841 | 1065 | |
---|
842 | 1066 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
843 | 1067 | |
---|
844 | | - JCheckBox colorCB; |
---|
845 | | - JCheckBox materialCB; |
---|
846 | | - JCheckBox textureCB; |
---|
| 1068 | + cCheckBox colorCB; |
---|
| 1069 | + cCheckBox materialCB; |
---|
| 1070 | + cCheckBox textureCB; |
---|
847 | 1071 | |
---|
848 | 1072 | public void itemStateChanged(ItemEvent e) |
---|
849 | 1073 | { |
---|
.. | .. |
---|
871 | 1095 | } else if(e.getSource() == liveCB) |
---|
872 | 1096 | { |
---|
873 | 1097 | cameraView.ToggleLive(); |
---|
| 1098 | + refreshContents(false); |
---|
874 | 1099 | } |
---|
875 | 1100 | else if(e.getSource() == supportCB) |
---|
876 | 1101 | { |
---|
.. | .. |
---|
935 | 1160 | { |
---|
936 | 1161 | cameraView.ToggleOeil(); |
---|
937 | 1162 | } |
---|
| 1163 | + else if(e.getSource() == shadowCB) |
---|
| 1164 | + { |
---|
| 1165 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1166 | + } |
---|
| 1167 | + else if(e.getSource() == freezeCB) |
---|
| 1168 | + { |
---|
| 1169 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1170 | + } |
---|
| 1171 | + else if(e.getSource() == autokeepCB) |
---|
| 1172 | + { |
---|
| 1173 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1174 | + } |
---|
938 | 1175 | else if(e.getSource() == lookAtCB) |
---|
939 | 1176 | { |
---|
940 | 1177 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
951 | 1188 | |
---|
952 | 1189 | /**/ |
---|
953 | 1190 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
954 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1191 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1192 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
955 | 1193 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
956 | 1194 | // We can't move the root node or an empty selection |
---|
957 | 1195 | return; |
---|
.. | .. |
---|
1014 | 1252 | } |
---|
1015 | 1253 | } |
---|
1016 | 1254 | |
---|
1017 | | - String string = (String) object; |
---|
1018 | | - |
---|
1019 | 1255 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1020 | 1256 | // if( object instanceof java.io.File[]) |
---|
1021 | 1257 | // { |
---|
.. | .. |
---|
1023 | 1259 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1024 | 1260 | // return; |
---|
1025 | 1261 | // } |
---|
| 1262 | + |
---|
| 1263 | + String string = object.toString(); |
---|
1026 | 1264 | |
---|
1027 | 1265 | // File path for Mac and Windows |
---|
1028 | 1266 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1068 | 1306 | |
---|
1069 | 1307 | assert target == objEditor.jTree; |
---|
1070 | 1308 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1309 | + Object3D destinationLeaf; |
---|
1071 | 1310 | try { |
---|
1072 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1311 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1073 | 1312 | } catch (Exception e) { |
---|
1074 | 1313 | System.out.println("destinationPath : " + destinationPath); |
---|
1075 | 1314 | return; |
---|
1076 | 1315 | } |
---|
1077 | 1316 | |
---|
1078 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1317 | + for (int i=group.selection.size(); --i>=0;) |
---|
1079 | 1318 | { |
---|
| 1319 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1320 | + |
---|
| 1321 | + // Cannot move into itself |
---|
| 1322 | + if (child == destinationLeaf) |
---|
| 1323 | + return; |
---|
| 1324 | + } |
---|
| 1325 | + |
---|
| 1326 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1327 | +// { |
---|
1080 | 1328 | loadClipboard(true); |
---|
1081 | 1329 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1082 | 1330 | pasteInto(false, false); |
---|
1083 | | - } else { |
---|
1084 | | - loadClipboard(false); |
---|
1085 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1086 | | - pasteInto(false, false); // true); // ??? |
---|
1087 | | - } |
---|
| 1331 | +// } else { |
---|
| 1332 | +// loadClipboard(false); |
---|
| 1333 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1334 | +// pasteInto(false, false); // true); // ??? |
---|
| 1335 | +// } |
---|
1088 | 1336 | } |
---|
1089 | 1337 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1090 | 1338 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1189 | 1437 | { |
---|
1190 | 1438 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1191 | 1439 | //heightFieldItem.addActionListener(this); |
---|
1192 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1193 | | - gridItem.addActionListener(this); |
---|
1194 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1195 | | - rectoidItem.addActionListener(this); |
---|
1196 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1197 | | - ellipsoidItem.addActionListener(this); |
---|
1198 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1199 | | - coneItem.addActionListener(this); |
---|
1200 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1201 | | - torusItem.addActionListener(this); |
---|
1202 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1203 | | - superItem.addActionListener(this); |
---|
| 1440 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1441 | +// gridItem.addActionListener(this); |
---|
| 1442 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1443 | +// rectoidItem.addActionListener(this); |
---|
| 1444 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1445 | +// ellipsoidItem.addActionListener(this); |
---|
| 1446 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1447 | +// coneItem.addActionListener(this); |
---|
| 1448 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1449 | +// torusItem.addActionListener(this); |
---|
| 1450 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1451 | +// superItem.addActionListener(this); |
---|
| 1452 | + |
---|
| 1453 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1454 | + cameraItem.addActionListener(this); |
---|
| 1455 | + |
---|
| 1456 | + if (!Globals.ADVANCED) |
---|
| 1457 | + { |
---|
1204 | 1458 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1205 | 1459 | kleinItem.addActionListener(this); |
---|
1206 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1207 | | - particleItem.addActionListener(this); |
---|
| 1460 | + } |
---|
| 1461 | + |
---|
| 1462 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1463 | +// particleItem.addActionListener(this); |
---|
1208 | 1464 | if (Globals.ADVANCED) |
---|
1209 | 1465 | { |
---|
1210 | 1466 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1230 | 1486 | } |
---|
1231 | 1487 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1232 | 1488 | bezierItem.addActionListener(this); |
---|
1233 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1234 | | - overlayItem.addActionListener(this); |
---|
1235 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1236 | | - lightItem.addActionListener(this); |
---|
| 1489 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1490 | +// overlayItem.addActionListener(this); |
---|
| 1491 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1492 | +// lightItem.addActionListener(this); |
---|
1237 | 1493 | menu.add("-"); |
---|
1238 | 1494 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1239 | 1495 | //superLoopItem.addActionListener(this); |
---|
1240 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1241 | | - loopItem.addActionListener(this); |
---|
| 1496 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1497 | +// loopItem.addActionListener(this); |
---|
1242 | 1498 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1243 | 1499 | doubleItem.addActionListener(this); |
---|
1244 | 1500 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1254 | 1510 | animationItem.addItemListener(this); |
---|
1255 | 1511 | animationItem.setState(Globals.ANIMATION); |
---|
1256 | 1512 | |
---|
| 1513 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1514 | + archiveItem.addActionListener(this); |
---|
| 1515 | + |
---|
1257 | 1516 | menu.add("-"); |
---|
1258 | 1517 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1259 | 1518 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1266 | 1525 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1267 | 1526 | reduce34MorphItem.addActionListener(this); |
---|
1268 | 1527 | menu.add("-"); |
---|
| 1528 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1529 | + memoryItem.addActionListener(this); |
---|
1269 | 1530 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1270 | 1531 | computeAOItem.addActionListener(this); |
---|
1271 | 1532 | |
---|
.. | .. |
---|
1274 | 1535 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1275 | 1536 | mirrorItem.addActionListener(this); |
---|
1276 | 1537 | menu.add("-"); |
---|
1277 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1278 | | - memoryItem.addActionListener(this); |
---|
1279 | 1538 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1280 | 1539 | analyzeItem.addActionListener(this); |
---|
1281 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1540 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1282 | 1541 | dumpItem.addActionListener(this); |
---|
1283 | 1542 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1284 | 1543 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1419 | 1678 | shadow.material = new cMaterial(obj.material); |
---|
1420 | 1679 | shadow.material.diffuse = 0.0001f; |
---|
1421 | 1680 | shadow.material.specular = 0.0001f; |
---|
| 1681 | + //shadow.projectedVertices[1].x = 300; |
---|
1422 | 1682 | |
---|
1423 | 1683 | makeSomething(shadow); |
---|
1424 | 1684 | } |
---|
| 1685 | + |
---|
| 1686 | + private void ClearUnpinned() |
---|
| 1687 | + { |
---|
| 1688 | + //for (Object3D obj : listUI) |
---|
| 1689 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1690 | + { |
---|
| 1691 | + Object3D obj = listUI.elementAt(i); |
---|
| 1692 | + if (!obj.pinned) |
---|
| 1693 | + { |
---|
| 1694 | + obj.CloseUI(); |
---|
| 1695 | + listUI.remove(i); |
---|
| 1696 | + } |
---|
| 1697 | + } |
---|
| 1698 | + } |
---|
| 1699 | + |
---|
| 1700 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1701 | + { |
---|
| 1702 | + // if (!(elem instanceof Composite)) |
---|
| 1703 | + // newWindow = false; |
---|
| 1704 | + listUI.add(elem); |
---|
| 1705 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1706 | + System.out.println("edit : " + elem); |
---|
| 1707 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1708 | + } |
---|
1425 | 1709 | |
---|
1426 | 1710 | /** |
---|
1427 | 1711 | * applyExample |
---|
.. | .. |
---|
1666 | 1950 | { |
---|
1667 | 1951 | ScreenFit(); |
---|
1668 | 1952 | } else |
---|
1669 | | - if (source == switchItem) |
---|
| 1953 | + if (source == switchViewItem) |
---|
1670 | 1954 | { |
---|
1671 | 1955 | cVector v1 = new cVector(); |
---|
1672 | 1956 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1675 | 1959 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1676 | 1960 | objEditor.cameraView.repaint(); |
---|
1677 | 1961 | } else |
---|
1678 | | - if (source == rectoidItem) |
---|
| 1962 | + if (source == rectoidItem || source == boxButton) |
---|
1679 | 1963 | { |
---|
1680 | 1964 | makeSomething(new Box()); |
---|
1681 | 1965 | } else |
---|
1682 | | - if (source == particleItem) |
---|
| 1966 | + if (source == particleItem || source == particlesButton) |
---|
1683 | 1967 | { |
---|
1684 | 1968 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1685 | 1969 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1758 | 2042 | |
---|
1759 | 2043 | makeSomething(obj); |
---|
1760 | 2044 | } else |
---|
1761 | | - if (source == gridItem) |
---|
| 2045 | + if (source == gridItem || source == gridButton) |
---|
1762 | 2046 | { |
---|
1763 | 2047 | makeSomething(new Grid()); |
---|
1764 | 2048 | } else |
---|
1765 | | - if (source == ellipsoidItem) |
---|
| 2049 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1766 | 2050 | { |
---|
1767 | 2051 | makeSomething(new Sphere()); |
---|
1768 | 2052 | } else |
---|
1769 | | - if (source == coneItem) |
---|
| 2053 | + if (source == coneItem || source == coneButton) |
---|
1770 | 2054 | { |
---|
1771 | 2055 | makeSomething(new Cone()); |
---|
1772 | 2056 | } else |
---|
1773 | | - if (source == torusItem) |
---|
| 2057 | + if (source == torusItem || source == torusButton) |
---|
1774 | 2058 | { |
---|
1775 | 2059 | makeSomething(new Torus()); |
---|
1776 | 2060 | } else |
---|
1777 | | - if (source == superItem) |
---|
| 2061 | + if (source == superItem || source == superButton) |
---|
1778 | 2062 | { |
---|
1779 | 2063 | makeSomething(new Superellipsoid()); |
---|
1780 | 2064 | } else |
---|
1781 | | - if (source == kleinItem) |
---|
| 2065 | + if (source == kleinItem || source == kleinButton) |
---|
1782 | 2066 | { |
---|
1783 | 2067 | makeSomething(new Klein()); |
---|
1784 | 2068 | } else |
---|
.. | .. |
---|
1798 | 2082 | { |
---|
1799 | 2083 | makeSomething(new BezierSurface()); |
---|
1800 | 2084 | } else |
---|
1801 | | - if (source == overlayItem) |
---|
| 2085 | + if (source == overlayItem || source == overlayButton) |
---|
1802 | 2086 | { |
---|
1803 | 2087 | /* |
---|
1804 | 2088 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1846 | 2130 | s.setup(); |
---|
1847 | 2131 | makeSomething(s); |
---|
1848 | 2132 | } else |
---|
1849 | | - if (source == lightItem) |
---|
| 2133 | + if (source == lightItem || source == lightButton) |
---|
1850 | 2134 | { |
---|
1851 | 2135 | makeSomething(new Light()); |
---|
1852 | 2136 | } else |
---|
.. | .. |
---|
1896 | 2180 | |
---|
1897 | 2181 | group(g); |
---|
1898 | 2182 | } else |
---|
1899 | | - if (source == loopItem) |
---|
| 2183 | + if (source == loopItem || source == loopButton) |
---|
1900 | 2184 | { |
---|
1901 | 2185 | Composite csg = new GroupLeaf(); |
---|
1902 | 2186 | csg.count = 5; |
---|
1903 | 2187 | group(csg); |
---|
1904 | | - Composite child = new cGroup(); |
---|
| 2188 | + Composite child = new cGroup("Branch"); |
---|
1905 | 2189 | csg.addChild(child); |
---|
1906 | 2190 | child.addChild(csg); |
---|
1907 | 2191 | } else |
---|
1908 | 2192 | if (source == doubleItem) |
---|
1909 | 2193 | { |
---|
1910 | | - Composite csg = new GroupLeaf(); |
---|
| 2194 | + Composite csg = new GroupLeaf("Fork"); |
---|
1911 | 2195 | csg.count = 5; |
---|
1912 | 2196 | group(csg); |
---|
1913 | | - Composite child = new cGroup(); |
---|
| 2197 | + Composite child = new cGroup("Branch A"); |
---|
1914 | 2198 | csg.addChild(child); |
---|
1915 | 2199 | child.addChild(csg); |
---|
1916 | | - child = new cGroup(); |
---|
| 2200 | + child = new cGroup("Branch B"); |
---|
1917 | 2201 | csg.addChild(child); |
---|
1918 | 2202 | child.addChild(csg); |
---|
1919 | 2203 | } else |
---|
1920 | 2204 | if (source == tripleItem) |
---|
1921 | 2205 | { |
---|
1922 | | - Composite csg = new GroupLeaf(); |
---|
| 2206 | + Composite csg = new GroupLeaf("Trident"); |
---|
1923 | 2207 | csg.count = 4; |
---|
1924 | 2208 | group(csg); |
---|
1925 | 2209 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1969 | 2253 | { |
---|
1970 | 2254 | DumpObject(); |
---|
1971 | 2255 | } else |
---|
| 2256 | + if (source == minButton) |
---|
| 2257 | + { |
---|
| 2258 | + Minimize(); |
---|
| 2259 | + } else |
---|
| 2260 | + if (source == maxButton) |
---|
| 2261 | + { |
---|
| 2262 | + Maximize(); |
---|
| 2263 | + } else |
---|
| 2264 | + if (source == fullButton) |
---|
| 2265 | + { |
---|
| 2266 | + ToggleFullScreen(); |
---|
| 2267 | + } else |
---|
1972 | 2268 | if (source == undoButton) |
---|
1973 | 2269 | { |
---|
| 2270 | + // Go to previous version |
---|
| 2271 | + //if (!Undo()) |
---|
| 2272 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
1974 | 2273 | Undo(); |
---|
| 2274 | + } else |
---|
| 2275 | + if (source == restoreButton) |
---|
| 2276 | + { |
---|
| 2277 | + // Restore current version |
---|
| 2278 | + Restore(); |
---|
| 2279 | + } else |
---|
| 2280 | + if (source == replaceButton) |
---|
| 2281 | + { |
---|
| 2282 | + // Overwrite current version |
---|
| 2283 | + Replace(); |
---|
1975 | 2284 | } else |
---|
1976 | 2285 | if (source == redoButton) |
---|
1977 | 2286 | { |
---|
| 2287 | + // Go to next version |
---|
1978 | 2288 | Redo(); |
---|
1979 | 2289 | } else |
---|
1980 | 2290 | if (source == saveButton) |
---|
1981 | 2291 | { |
---|
1982 | | - Save(); |
---|
| 2292 | + // Save a new version |
---|
| 2293 | + if (!Save(true)) |
---|
| 2294 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
1983 | 2295 | } else |
---|
1984 | 2296 | if (source == oneStepButton) |
---|
1985 | 2297 | { |
---|
.. | .. |
---|
1988 | 2300 | } else |
---|
1989 | 2301 | if (source == screenfitButton) |
---|
1990 | 2302 | { |
---|
1991 | | - //Reload(lastConverter, lastFilename, true); |
---|
1992 | 2303 | ScreenFit(); |
---|
1993 | 2304 | } else |
---|
1994 | 2305 | if (source == screenfitpointButton) |
---|
1995 | 2306 | { |
---|
1996 | | - //Reload(lastConverter, lastFilename, true); |
---|
1997 | 2307 | ScreenFitPoint(); |
---|
1998 | 2308 | } else |
---|
1999 | 2309 | if (source == snapobjectButton) |
---|
2000 | 2310 | { |
---|
2001 | | - //Reload(lastConverter, lastFilename, true); |
---|
2002 | 2311 | SnapObject(); |
---|
2003 | 2312 | } else |
---|
2004 | 2313 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2362 | 2671 | { |
---|
2363 | 2672 | StepAll(); |
---|
2364 | 2673 | } else |
---|
2365 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2674 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2366 | 2675 | { |
---|
2367 | 2676 | //int indices[] = jList.getSelectedIndices(); |
---|
2368 | 2677 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2374 | 2683 | { |
---|
2375 | 2684 | ClearSelection(true); |
---|
2376 | 2685 | } else |
---|
2377 | | - if (source == grabItem) |
---|
| 2686 | + if (source == grabItem || source == groupButton) |
---|
2378 | 2687 | { |
---|
2379 | | - group(new cGroup(), true); |
---|
| 2688 | + group(new cGroup(), false); // true); |
---|
2380 | 2689 | } else |
---|
2381 | 2690 | if (source == hideItem) |
---|
2382 | 2691 | { |
---|
.. | .. |
---|
2394 | 2703 | { |
---|
2395 | 2704 | makeSomething(new Camera()); |
---|
2396 | 2705 | } else |
---|
2397 | | - if (source == compositeItem) |
---|
| 2706 | + if (source == compositeItem || source == compositeButton) |
---|
2398 | 2707 | { |
---|
2399 | 2708 | group(new Composite()); |
---|
2400 | 2709 | } else |
---|
2401 | | - if (source == randomItem) |
---|
| 2710 | + if (source == switchItem || source == switchButton) |
---|
2402 | 2711 | { |
---|
2403 | 2712 | RandomNode random = new RandomNode(); |
---|
2404 | 2713 | group(random); |
---|
.. | .. |
---|
2500 | 2809 | { |
---|
2501 | 2810 | group(new cLinker()); |
---|
2502 | 2811 | } else |
---|
2503 | | - if (source == textureItem) |
---|
| 2812 | + if (source == textureItem || source == textureButton) |
---|
2504 | 2813 | { |
---|
2505 | 2814 | group(new TextureNode()); |
---|
2506 | 2815 | } else |
---|
.. | .. |
---|
2520 | 2829 | { |
---|
2521 | 2830 | CastShadow(2); |
---|
2522 | 2831 | } else |
---|
2523 | | - if (source == ungroupItem) |
---|
| 2832 | + if (source == ungroupItem || source == ungroupButton) |
---|
2524 | 2833 | { |
---|
2525 | | - //ungroup(); |
---|
| 2834 | + boolean hasRoot = false; |
---|
| 2835 | + |
---|
2526 | 2836 | for (int i=0; i<group.selection.size(); i++) |
---|
2527 | 2837 | { |
---|
2528 | | - Ungroup(group.selection.get(i)); |
---|
| 2838 | + if (group.selection.get(i) == group) |
---|
| 2839 | + { |
---|
| 2840 | + hasRoot = true; |
---|
| 2841 | + break; |
---|
| 2842 | + } |
---|
2529 | 2843 | } |
---|
2530 | 2844 | |
---|
2531 | | - ClearSelection(false); |
---|
2532 | | - |
---|
2533 | | - refreshContents(); |
---|
| 2845 | + if (!hasRoot) |
---|
| 2846 | + { |
---|
| 2847 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2848 | + { |
---|
| 2849 | + Ungroup(group.selection.get(i)); |
---|
| 2850 | + } |
---|
| 2851 | + |
---|
| 2852 | + ClearSelection(false); |
---|
| 2853 | + |
---|
| 2854 | + refreshContents(); |
---|
| 2855 | + } |
---|
2534 | 2856 | } else |
---|
2535 | 2857 | if (source == genUVItem) |
---|
2536 | 2858 | { |
---|
.. | .. |
---|
2542 | 2864 | } else |
---|
2543 | 2865 | if (source == genNormalsMESHItem) |
---|
2544 | 2866 | { |
---|
2545 | | - GenNormals(true); // TODO |
---|
| 2867 | + GenNormalsMESH(); |
---|
2546 | 2868 | } else |
---|
2547 | 2869 | if (source == genNormalsORGANItem) |
---|
2548 | 2870 | { |
---|
.. | .. |
---|
2607 | 2929 | if (source == unmarkleavesItem) |
---|
2608 | 2930 | { |
---|
2609 | 2931 | MarkLeaves(false); |
---|
| 2932 | + } else |
---|
| 2933 | + if (source == rewindleavesItem) |
---|
| 2934 | + { |
---|
| 2935 | + RewindLeaves(true); |
---|
| 2936 | + } else |
---|
| 2937 | + if (source == unrewindleavesItem) |
---|
| 2938 | + { |
---|
| 2939 | + RewindLeaves(false); |
---|
| 2940 | + } else |
---|
| 2941 | + if (source == randomleavesItem) |
---|
| 2942 | + { |
---|
| 2943 | + RandomLeaves(true); |
---|
| 2944 | + } else |
---|
| 2945 | + if (source == unrandomleavesItem) |
---|
| 2946 | + { |
---|
| 2947 | + RandomLeaves(false); |
---|
2610 | 2948 | } else |
---|
2611 | 2949 | if (source == flipVItem) |
---|
2612 | 2950 | { |
---|
.. | .. |
---|
2842 | 3180 | if (source == twoButton) |
---|
2843 | 3181 | { |
---|
2844 | 3182 | radio.layout = twoButton; |
---|
| 3183 | + |
---|
| 3184 | + if (CameraPane.FULLSCREEN) |
---|
| 3185 | + fullscreenLayout = radio.layout; |
---|
| 3186 | + |
---|
2845 | 3187 | // bug |
---|
2846 | 3188 | //gridPanel.setDividerLocation(1.0); |
---|
2847 | 3189 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2874 | 3216 | bigThree.ClearUI(); |
---|
2875 | 3217 | bigThree.add(centralPanel); |
---|
2876 | 3218 | bigThree.FlushUI(); |
---|
| 3219 | + |
---|
| 3220 | + cameraView.requestFocusInWindow(); |
---|
| 3221 | + |
---|
| 3222 | +// refreshContents(true); |
---|
| 3223 | +// |
---|
| 3224 | +// try |
---|
| 3225 | +// { |
---|
| 3226 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3227 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3228 | +// bot.mouseMove(100, 100); |
---|
| 3229 | +// bot.mousePress(mask); |
---|
| 3230 | +// bot.mouseRelease(mask); |
---|
| 3231 | +// } |
---|
| 3232 | +// catch (Exception e) |
---|
| 3233 | +// { |
---|
| 3234 | +// |
---|
| 3235 | +// } |
---|
| 3236 | + |
---|
2877 | 3237 | } else |
---|
2878 | 3238 | if (source == threeButton) |
---|
2879 | 3239 | { |
---|
2880 | 3240 | radio.layout = threeButton; |
---|
| 3241 | + |
---|
| 3242 | + if (CameraPane.FULLSCREEN) |
---|
| 3243 | + fullscreenLayout = radio.layout; |
---|
2881 | 3244 | |
---|
2882 | 3245 | // bigThree.remove(scenePanel); |
---|
2883 | 3246 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2910 | 3273 | bigThree.add(centralPanel); |
---|
2911 | 3274 | bigThree.add(XYZPanel); |
---|
2912 | 3275 | bigThree.FlushUI(); |
---|
| 3276 | + |
---|
| 3277 | + cameraView.requestFocusInWindow(); |
---|
2913 | 3278 | } else |
---|
2914 | 3279 | if (source == fourButton) |
---|
2915 | 3280 | { |
---|
2916 | 3281 | radio.layout = fourButton; |
---|
| 3282 | + |
---|
| 3283 | + if (CameraPane.FULLSCREEN) |
---|
| 3284 | + fullscreenLayout = radio.layout; |
---|
2917 | 3285 | |
---|
2918 | 3286 | // bigThree.remove(scenePanel); |
---|
2919 | 3287 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2945 | 3313 | bigThree.ClearUI(); |
---|
2946 | 3314 | bigThree.add(scenePanel); |
---|
2947 | 3315 | bigThree.FlushUI(); |
---|
| 3316 | + |
---|
| 3317 | + cameraView.requestFocusInWindow(); |
---|
2948 | 3318 | } else |
---|
2949 | 3319 | if (source == sixButton) |
---|
2950 | 3320 | { |
---|
2951 | 3321 | radio.layout = sixButton; |
---|
| 3322 | + |
---|
| 3323 | + if (CameraPane.FULLSCREEN) |
---|
| 3324 | + fullscreenLayout = radio.layout; |
---|
2952 | 3325 | |
---|
2953 | 3326 | // bigThree.remove(scenePanel); |
---|
2954 | 3327 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2981 | 3354 | bigThree.add(scenePanel); |
---|
2982 | 3355 | bigThree.add(centralPanel); |
---|
2983 | 3356 | bigThree.FlushUI(); |
---|
| 3357 | + |
---|
| 3358 | + cameraView.requestFocusInWindow(); |
---|
2984 | 3359 | } else |
---|
2985 | 3360 | if (source == sevenButton) |
---|
2986 | 3361 | { |
---|
2987 | 3362 | radio.layout = sevenButton; |
---|
| 3363 | + |
---|
| 3364 | + if (CameraPane.FULLSCREEN) |
---|
| 3365 | + fullscreenLayout = radio.layout; |
---|
2988 | 3366 | |
---|
2989 | 3367 | // bigThree.remove(scenePanel); |
---|
2990 | 3368 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3018 | 3396 | bigThree.add(centralPanel); |
---|
3019 | 3397 | bigThree.add(XYZPanel); |
---|
3020 | 3398 | bigThree.FlushUI(); |
---|
| 3399 | + |
---|
| 3400 | + cameraView.requestFocusInWindow(); |
---|
3021 | 3401 | } else |
---|
3022 | 3402 | if (source == rootButton) |
---|
3023 | 3403 | { |
---|
.. | .. |
---|
3029 | 3409 | EditObject(obj); |
---|
3030 | 3410 | } |
---|
3031 | 3411 | |
---|
| 3412 | + cameraView.requestFocusInWindow(); |
---|
3032 | 3413 | refreshContents(true); |
---|
3033 | 3414 | } else |
---|
3034 | 3415 | if (source == closeButton) |
---|
.. | .. |
---|
3038 | 3419 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3039 | 3420 | { |
---|
3040 | 3421 | ab = (cRadio)e.nextElement(); |
---|
3041 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3422 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3042 | 3423 | { |
---|
| 3424 | + // Patch to avoid bug with transparency. |
---|
| 3425 | + if (!ab.hadMaterial) |
---|
| 3426 | + { |
---|
| 3427 | + ab.object.material = null; |
---|
| 3428 | + } |
---|
| 3429 | + |
---|
3043 | 3430 | buttonGroup.remove(ab); |
---|
3044 | 3431 | radioPanel.remove(ab); |
---|
3045 | 3432 | |
---|
3046 | | - ab.GetObject().editWindow = null; |
---|
| 3433 | + //ab.GetObject().editWindow = null; |
---|
| 3434 | + ab.GetObject().manipWindow = null; |
---|
3047 | 3435 | // ab.GetObject().objectUI = null; // ????????? |
---|
3048 | 3436 | |
---|
3049 | 3437 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3050 | 3438 | break; |
---|
3051 | 3439 | } |
---|
3052 | 3440 | } |
---|
| 3441 | + |
---|
| 3442 | + cameraView.requestFocusInWindow(); |
---|
3053 | 3443 | refreshContents(true); |
---|
3054 | 3444 | } else |
---|
3055 | 3445 | if (source == editItem || source == editButton) |
---|
3056 | 3446 | { |
---|
| 3447 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3448 | + { |
---|
| 3449 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3450 | + child.pinned = true; |
---|
| 3451 | + } |
---|
| 3452 | + |
---|
3057 | 3453 | EditSelection(false); |
---|
3058 | 3454 | } else |
---|
3059 | 3455 | if (source == uneditButton) |
---|
.. | .. |
---|
3063 | 3459 | Object3D child = (Object3D)e.nextElement(); |
---|
3064 | 3460 | if(child.editWindow != null) |
---|
3065 | 3461 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3462 | + child.pinned = false; |
---|
3066 | 3463 | child.CloseUI(); |
---|
3067 | 3464 | listUI.remove(child); |
---|
3068 | 3465 | |
---|
.. | .. |
---|
3079 | 3476 | //copy.ClearUI(); |
---|
3080 | 3477 | for (Object3D obj : listUI) |
---|
3081 | 3478 | { |
---|
| 3479 | + obj.pinned = false; |
---|
3082 | 3480 | obj.CloseUI(); |
---|
3083 | 3481 | } |
---|
3084 | 3482 | listUI.clear(); |
---|
.. | .. |
---|
3088 | 3486 | { |
---|
3089 | 3487 | assert(copy == group); |
---|
3090 | 3488 | |
---|
3091 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3489 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3092 | 3490 | |
---|
3093 | 3491 | for (Object3D obj : listUI) |
---|
3094 | 3492 | { |
---|
.. | .. |
---|
3137 | 3535 | } |
---|
3138 | 3536 | |
---|
3139 | 3537 | copy = group; |
---|
| 3538 | + |
---|
| 3539 | + SetUndoStates(); |
---|
| 3540 | + |
---|
3140 | 3541 | //Globals.theRenderer.object = group; |
---|
3141 | 3542 | if(!useclient) |
---|
3142 | 3543 | { |
---|
.. | .. |
---|
3154 | 3555 | } |
---|
3155 | 3556 | |
---|
3156 | 3557 | // fix "+" issue |
---|
3157 | | - group.editWindow = this; |
---|
| 3558 | + //group.editWindow = this; |
---|
| 3559 | + group.manipWindow = this; |
---|
3158 | 3560 | |
---|
3159 | 3561 | /* |
---|
3160 | 3562 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3162 | 3564 | currentLayout = sevenButton; |
---|
3163 | 3565 | */ |
---|
3164 | 3566 | radio.layout.doClick(); |
---|
| 3567 | + |
---|
| 3568 | + ClearUnpinned(); |
---|
| 3569 | + //Grafreed.Assert(group != null); |
---|
| 3570 | + //Grafreed.Assert(group.selection != null); |
---|
| 3571 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3572 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3573 | + EditSelection(false); |
---|
3165 | 3574 | keepparent = group.parent; |
---|
3166 | 3575 | // PARENT = NULL or not??? |
---|
3167 | 3576 | //group.parent = null; // ROOT |
---|
3168 | 3577 | //group.attributes = -1; |
---|
3169 | 3578 | ResetModel(); |
---|
| 3579 | + |
---|
| 3580 | + cameraView.requestFocusInWindow(); |
---|
3170 | 3581 | refreshContents(true); |
---|
3171 | 3582 | } else if (event.getSource() == editCameraItem) |
---|
3172 | 3583 | { |
---|
3173 | 3584 | cameraView.ProtectCamera(); |
---|
3174 | 3585 | cameraView.repaint(); |
---|
3175 | 3586 | return; |
---|
3176 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3587 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3177 | 3588 | { |
---|
3178 | 3589 | cameraView.RevertCamera(); |
---|
3179 | 3590 | cameraView.repaint(); |
---|
.. | .. |
---|
3190 | 3601 | } |
---|
3191 | 3602 | |
---|
3192 | 3603 | boolean useclient = false; |
---|
3193 | | - cRadio radio; |
---|
3194 | 3604 | |
---|
3195 | 3605 | void ToggleRoot() |
---|
3196 | 3606 | { |
---|
.. | .. |
---|
3511 | 3921 | void GenNormals(boolean crease) |
---|
3512 | 3922 | { |
---|
3513 | 3923 | group.GenNormalsS(crease); |
---|
| 3924 | + |
---|
| 3925 | + refreshContents(); |
---|
| 3926 | + } |
---|
| 3927 | + |
---|
| 3928 | + void GenNormalsMESH() |
---|
| 3929 | + { |
---|
| 3930 | + group.GenNormalsMeshS(); |
---|
3514 | 3931 | |
---|
3515 | 3932 | refreshContents(); |
---|
3516 | 3933 | } |
---|
.. | .. |
---|
4138 | 4555 | refreshContents(); |
---|
4139 | 4556 | } |
---|
4140 | 4557 | |
---|
| 4558 | + void RewindLeaves(boolean hide) |
---|
| 4559 | + { |
---|
| 4560 | + group.selection.RewindLeaves(hide); |
---|
| 4561 | + refreshContents(); |
---|
| 4562 | + } |
---|
| 4563 | + |
---|
| 4564 | + void RandomLeaves(boolean hide) |
---|
| 4565 | + { |
---|
| 4566 | + group.selection.RandomLeaves(hide); |
---|
| 4567 | + refreshContents(); |
---|
| 4568 | + } |
---|
| 4569 | + |
---|
4141 | 4570 | void SetTexRes(int tr) |
---|
4142 | 4571 | { |
---|
4143 | 4572 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4209 | 4638 | // } |
---|
4210 | 4639 | // } |
---|
4211 | 4640 | |
---|
4212 | | - static boolean allparams = true; |
---|
4213 | | - |
---|
4214 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4215 | | - |
---|
4216 | 4641 | void EditSelection(boolean newWindow) |
---|
4217 | 4642 | { |
---|
| 4643 | + if (group.selection == null) |
---|
| 4644 | + { |
---|
| 4645 | + EditElement(group, newWindow); // ? new |
---|
| 4646 | + return; |
---|
| 4647 | + } |
---|
| 4648 | + |
---|
4218 | 4649 | // aConstraints.gridy = 0; |
---|
4219 | 4650 | for (int i=0; i<group.selection.size(); i++) |
---|
4220 | 4651 | { |
---|
4221 | 4652 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4222 | 4653 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4223 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4654 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4224 | 4655 | |
---|
4225 | 4656 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4226 | 4657 | if(elem != group || !newWindow) |
---|
4227 | 4658 | { |
---|
4228 | | - // if (!(elem instanceof Composite)) |
---|
4229 | | - // newWindow = false; |
---|
4230 | | - listUI.add(elem); |
---|
4231 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4232 | | - System.out.println("edit : " + elem); |
---|
4233 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4659 | + EditElement(elem, newWindow); // ? new |
---|
4234 | 4660 | } |
---|
4235 | 4661 | } |
---|
4236 | 4662 | } |
---|
.. | .. |
---|
4305 | 4731 | //new Exception().printStackTrace(); |
---|
4306 | 4732 | |
---|
4307 | 4733 | freezemodel = true; |
---|
4308 | | - |
---|
| 4734 | + ClearUnpinned(); |
---|
| 4735 | + |
---|
4309 | 4736 | /**/ |
---|
4310 | 4737 | //switch (event.id) |
---|
4311 | 4738 | { |
---|
.. | .. |
---|
4313 | 4740 | //case 702: // Event.LIST_DESELECT |
---|
4314 | 4741 | group.deselectAll(); |
---|
4315 | 4742 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4316 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4317 | 4743 | if (tps != null) |
---|
4318 | 4744 | { |
---|
4319 | 4745 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4322 | 4748 | |
---|
4323 | 4749 | //if (child.parent != null) |
---|
4324 | 4750 | //child.parent.addSelectee(child); |
---|
| 4751 | + objEditor.SetMaterial(child); |
---|
4325 | 4752 | group.addSelectee(child); |
---|
4326 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4327 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4328 | | - System.err.println("info : " + child.GetPath()); |
---|
4329 | 4753 | } |
---|
4330 | 4754 | } |
---|
4331 | 4755 | // else |
---|
.. | .. |
---|
4335 | 4759 | // System.err.println("info : " + group.GetPath()); |
---|
4336 | 4760 | // } |
---|
4337 | 4761 | |
---|
4338 | | - objEditor.SetText(); // jan 2014 |
---|
4339 | | - |
---|
4340 | 4762 | if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4341 | 4763 | CameraPane.flash = true; |
---|
4342 | 4764 | |
---|
4343 | 4765 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4344 | 4766 | // a camera |
---|
4345 | 4767 | { |
---|
4346 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4768 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4347 | 4769 | { |
---|
4348 | 4770 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4349 | 4771 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4352 | 4774 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4353 | 4775 | } |
---|
4354 | 4776 | |
---|
| 4777 | + if (tps != null && tps.length == 1) |
---|
| 4778 | + { |
---|
| 4779 | + EditSelection(false); |
---|
| 4780 | + } |
---|
| 4781 | + |
---|
| 4782 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4783 | + |
---|
4355 | 4784 | refreshContents(); |
---|
4356 | 4785 | //return true; |
---|
4357 | 4786 | } |
---|
.. | .. |
---|
4360 | 4789 | |
---|
4361 | 4790 | freezemodel = false; |
---|
4362 | 4791 | } |
---|
| 4792 | + |
---|
| 4793 | + void SetPinStates(boolean enabled) |
---|
| 4794 | + { |
---|
| 4795 | + editButton.setEnabled(enabled); |
---|
| 4796 | + uneditButton.setEnabled(enabled); |
---|
| 4797 | + unselectButton.setEnabled(enabled); |
---|
| 4798 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4799 | + } |
---|
| 4800 | + |
---|
| 4801 | + void refreshContents(boolean cp) |
---|
| 4802 | + { |
---|
| 4803 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4804 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4805 | + { |
---|
| 4806 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4807 | + |
---|
| 4808 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4809 | + { |
---|
| 4810 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4811 | + |
---|
| 4812 | + objEditor.AddInfo(child, this, true); |
---|
| 4813 | + System.err.println("info : " + child.GetPath()); |
---|
| 4814 | + } |
---|
| 4815 | + |
---|
| 4816 | + objEditor.SetText(); // jan 2014 |
---|
| 4817 | + } |
---|
| 4818 | + |
---|
| 4819 | + super.refreshContents(cp); |
---|
| 4820 | + } |
---|
4363 | 4821 | |
---|
4364 | 4822 | void linkSomething(Object3D thing) |
---|
4365 | 4823 | { |
---|
.. | .. |
---|
4442 | 4900 | |
---|
4443 | 4901 | if (cut) |
---|
4444 | 4902 | { |
---|
4445 | | - Save(); |
---|
| 4903 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4904 | +// Save(); |
---|
4446 | 4905 | //int indices[] = jList.getSelectedIndices(); |
---|
4447 | 4906 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4448 | 4907 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4545 | 5004 | |
---|
4546 | 5005 | void paste(boolean expand) |
---|
4547 | 5006 | { |
---|
| 5007 | + if (Globals.REPLACEONMAKE) |
---|
| 5008 | + Save(); |
---|
| 5009 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5010 | + Globals.REPLACEONMAKE = false; |
---|
4548 | 5011 | // if (GrafreeD.clipboard == null) |
---|
4549 | 5012 | // return; |
---|
4550 | 5013 | boolean first = true; |
---|
.. | .. |
---|
4604 | 5067 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4605 | 5068 | } |
---|
4606 | 5069 | |
---|
| 5070 | + Globals.REPLACEONMAKE = keep; |
---|
4607 | 5071 | ResetModel(); |
---|
4608 | 5072 | refreshContents(); |
---|
4609 | 5073 | } |
---|
.. | .. |
---|
4739 | 5203 | |
---|
4740 | 5204 | void group(Object3D csg, boolean grab) |
---|
4741 | 5205 | { |
---|
| 5206 | + if (Globals.REPLACEONMAKE) |
---|
| 5207 | + Save(); |
---|
| 5208 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5209 | + Globals.REPLACEONMAKE = false; |
---|
4742 | 5210 | if (//false) // why?? |
---|
4743 | 5211 | !group.selection.isEmpty()) |
---|
4744 | 5212 | { |
---|
.. | .. |
---|
4852 | 5320 | //node.add(csg); |
---|
4853 | 5321 | //makeSomething(node); |
---|
4854 | 5322 | makeSomething(csg); |
---|
| 5323 | + Globals.REPLACEONMAKE = keep; |
---|
4855 | 5324 | } |
---|
4856 | 5325 | |
---|
4857 | 5326 | void Ungroup(Object3D g) |
---|
4858 | 5327 | { |
---|
| 5328 | + if (Globals.REPLACEONMAKE) |
---|
| 5329 | + Save(); |
---|
| 5330 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5331 | + Globals.REPLACEONMAKE = false; |
---|
4859 | 5332 | if (g instanceof HiddenObject) |
---|
4860 | 5333 | { |
---|
4861 | 5334 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4872 | 5345 | objEditor.makeSomething(g.get(i), false); |
---|
4873 | 5346 | } |
---|
4874 | 5347 | } |
---|
| 5348 | + Globals.REPLACEONMAKE = keep; |
---|
4875 | 5349 | } |
---|
4876 | 5350 | |
---|
4877 | 5351 | void ungroup() |
---|
.. | .. |
---|
5160 | 5634 | cButton clearpanelButton; |
---|
5161 | 5635 | cButton unselectButton; |
---|
5162 | 5636 | |
---|
| 5637 | + cButton restoreCameraButton; |
---|
| 5638 | + |
---|
5163 | 5639 | cButton saveButton; |
---|
5164 | | - cButton undoButton; |
---|
5165 | | - cButton redoButton; |
---|
5166 | 5640 | cButton oneStepButton; |
---|
| 5641 | + |
---|
| 5642 | + cButton groupButton; |
---|
| 5643 | + cButton ungroupButton; |
---|
| 5644 | + cButton compositeButton; |
---|
| 5645 | + cButton switchButton; |
---|
| 5646 | + cButton loopButton; |
---|
| 5647 | + cButton textureButton; |
---|
| 5648 | + |
---|
| 5649 | + cButton gridButton; |
---|
| 5650 | + cButton boxButton; |
---|
| 5651 | + cButton sphereButton; |
---|
| 5652 | + cButton coneButton; |
---|
| 5653 | + cButton torusButton; |
---|
| 5654 | + cButton superButton; |
---|
| 5655 | + cButton kleinButton; |
---|
| 5656 | + cButton particlesButton; |
---|
| 5657 | + cButton overlayButton; |
---|
| 5658 | + cButton lightButton; |
---|
5167 | 5659 | |
---|
5168 | 5660 | cButton screenfitButton; |
---|
5169 | 5661 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5176 | 5668 | |
---|
5177 | 5669 | cButton setsupportButton; |
---|
5178 | 5670 | |
---|
5179 | | - cButton twoButton; |
---|
5180 | | - cButton sixButton; |
---|
5181 | | - cButton threeButton; |
---|
5182 | | - cButton sevenButton; |
---|
5183 | | - cButton fourButton; // full panel |
---|
5184 | | - cButton oneButton; // full XYZ |
---|
5185 | | - //cButton currentLayout; |
---|
5186 | | - |
---|
5187 | 5671 | // |
---|
5188 | 5672 | //Composite |
---|
5189 | 5673 | Object3D // to do !! |
---|
.. | .. |
---|
5193 | 5677 | //JTree jTree; |
---|
5194 | 5678 | private MenuItem lookAtItem; |
---|
5195 | 5679 | private MenuItem lookFromItem; |
---|
5196 | | - private MenuItem switchItem; |
---|
| 5680 | + private MenuItem switchViewItem; |
---|
5197 | 5681 | private MenuItem cutItem; |
---|
5198 | 5682 | private MenuItem undoItem; |
---|
5199 | 5683 | private MenuItem redoItem; |
---|
5200 | | - private MenuItem duplicateItem; |
---|
| 5684 | + private JMenuItem duplicateItem; |
---|
5201 | 5685 | private MenuItem cloneItem; |
---|
5202 | 5686 | private MenuItem cloneSupportItem; |
---|
5203 | 5687 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5225 | 5709 | private MenuItem pasteLinkItem; |
---|
5226 | 5710 | private MenuItem pasteCloneItem; |
---|
5227 | 5711 | private MenuItem pasteExpandItem; |
---|
5228 | | - private MenuItem clearItem; |
---|
| 5712 | + private MenuItem deleteItem; |
---|
5229 | 5713 | private MenuItem clearAllItem; |
---|
5230 | 5714 | private MenuItem genUVItem; |
---|
5231 | 5715 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5260 | 5744 | private MenuItem showleavesItem; |
---|
5261 | 5745 | private MenuItem markleavesItem; |
---|
5262 | 5746 | private MenuItem unmarkleavesItem; |
---|
| 5747 | + private MenuItem rewindleavesItem; |
---|
| 5748 | + private MenuItem unrewindleavesItem; |
---|
| 5749 | + private MenuItem randomleavesItem; |
---|
| 5750 | + private MenuItem unrandomleavesItem; |
---|
5263 | 5751 | |
---|
5264 | 5752 | private MenuItem flipVItem; |
---|
5265 | 5753 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5281 | 5769 | private MenuItem frontItem; |
---|
5282 | 5770 | private MenuItem cameraItem; |
---|
5283 | 5771 | private MenuItem compositeItem; |
---|
5284 | | - private MenuItem randomItem; |
---|
| 5772 | + private MenuItem switchItem; |
---|
5285 | 5773 | private MenuItem physicsItem; |
---|
5286 | 5774 | private MenuItem frameselectorItem; |
---|
5287 | 5775 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5355 | 5843 | |
---|
5356 | 5844 | Menu cameraMenu; |
---|
5357 | 5845 | MenuItem editCameraItem; |
---|
5358 | | - MenuItem revertCameraItem; |
---|
| 5846 | + MenuItem restoreCameraItem; |
---|
5359 | 5847 | } |
---|