.. | .. |
---|
23 | 23 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 24 | ItemListener // ListSelectionListener |
---|
25 | 25 | { |
---|
| 26 | + |
---|
| 27 | + public void AddSkyboxButton(String f, String s, cGridBag row3) |
---|
| 28 | + { |
---|
| 29 | + cButton skyboxButton; |
---|
| 30 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 31 | + row3.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + skyboxButton.setToolTipText(s); |
---|
| 33 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 34 | + { |
---|
| 35 | + @Override |
---|
| 36 | + public void actionPerformed(ActionEvent e) |
---|
| 37 | + { |
---|
| 38 | + ChangeSkybox(path); |
---|
| 39 | + } |
---|
| 40 | + }); |
---|
| 41 | + } |
---|
| 42 | + |
---|
| 43 | + public void ChangeSkybox(String name) |
---|
| 44 | + { |
---|
| 45 | + cameraView.envyoff = false; |
---|
| 46 | + cameraView.skyboxname = name; |
---|
| 47 | + cameraView.skyboxext = "jpg"; |
---|
| 48 | + cameraView.repaint(); |
---|
| 49 | + } |
---|
| 50 | + |
---|
26 | 51 | //ObjEditor objEditor; |
---|
27 | 52 | public void closeUI2() |
---|
28 | 53 | { |
---|
.. | .. |
---|
60 | 85 | this.copy = this.group = group; |
---|
61 | 86 | //selectees = this.group.selectees; |
---|
62 | 87 | |
---|
| 88 | + if (copy.versions == null) |
---|
| 89 | + { |
---|
| 90 | + copy.versions = new byte[100][]; |
---|
| 91 | + copy.versionindex = -1; |
---|
| 92 | + } |
---|
| 93 | + |
---|
63 | 94 | if(ui) |
---|
64 | 95 | SetupUI(objEditor); |
---|
65 | 96 | } |
---|
.. | .. |
---|
80 | 111 | SetupViews(objEditor); |
---|
81 | 112 | |
---|
82 | 113 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 114 | + |
---|
| 115 | + if (copy.versions == null) |
---|
| 116 | + { |
---|
| 117 | + copy.versions = new byte[100][]; |
---|
| 118 | + copy.versionindex = -1; |
---|
| 119 | + |
---|
| 120 | + Save(true); |
---|
| 121 | + } |
---|
83 | 122 | } |
---|
84 | 123 | |
---|
85 | 124 | void CloneSelection(boolean supports) |
---|
86 | 125 | { |
---|
| 126 | + if (Globals.REPLACEONMAKE) |
---|
| 127 | + Save(); |
---|
| 128 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 129 | + Globals.REPLACEONMAKE = false; |
---|
87 | 130 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 131 | //Object3D obj; |
---|
89 | 132 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 137 | |
---|
95 | 138 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 139 | } |
---|
| 140 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 141 | } |
---|
98 | 142 | |
---|
99 | 143 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
189 | 233 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
190 | 234 | // pasteExpandItem.addActionListener(this); |
---|
191 | 235 | menu.add("-"); |
---|
192 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
193 | | - clearItem.addActionListener(this); |
---|
| 236 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 237 | + deleteItem.addActionListener(this); |
---|
194 | 238 | |
---|
195 | 239 | if (Globals.ADVANCED) |
---|
196 | 240 | { |
---|
.. | .. |
---|
204 | 248 | //zBufferItem.addActionListener(this); |
---|
205 | 249 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
206 | 250 | //normalLensItem.addActionListener(this); |
---|
207 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
208 | | - revertCameraItem.addActionListener(this); |
---|
| 251 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 252 | + restoreCameraItem.addActionListener(this); |
---|
209 | 253 | |
---|
210 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
211 | | - toggleFullScreenItem.addItemListener(this); |
---|
212 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
213 | | - cameraMenu.add("-"); |
---|
| 254 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 255 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 256 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 257 | +// cameraMenu.add("-"); |
---|
| 258 | +// |
---|
| 259 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 260 | +// toggleTextureItem.addItemListener(this); |
---|
| 261 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 262 | +// |
---|
| 263 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 264 | +// toggleSwitchItem.addItemListener(this); |
---|
| 265 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
214 | 266 | |
---|
215 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
216 | | - toggleTextureItem.addItemListener(this); |
---|
217 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
218 | | - |
---|
219 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
220 | | - toggleSwitchItem.addItemListener(this); |
---|
221 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
222 | | - |
---|
223 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 267 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
224 | 268 | toggleHandleItem.addItemListener(this); |
---|
225 | 269 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
226 | 270 | |
---|
.. | .. |
---|
275 | 319 | { |
---|
276 | 320 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
277 | 321 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
278 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 322 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
279 | 323 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
280 | 324 | oe.cameraMenu.add("-"); |
---|
281 | 325 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
283 | 327 | editLeafItem.addActionListener(this); |
---|
284 | 328 | lookAtItem.addActionListener(this); |
---|
285 | 329 | //lookFromItem.addActinoListener(this); |
---|
286 | | - //switchItem.addActionListener(this); |
---|
| 330 | + //switchViewItem.addActionListener(this); |
---|
287 | 331 | } |
---|
288 | 332 | |
---|
289 | 333 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
328 | 372 | } |
---|
329 | 373 | |
---|
330 | 374 | oe.menuBar.add(menu = new Menu("Group")); |
---|
331 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
332 | | - grabItem.addActionListener(this); |
---|
| 375 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 376 | +// grabItem.addActionListener(this); |
---|
333 | 377 | backItem = menu.add(new MenuItem("Back")); |
---|
334 | 378 | backItem.addActionListener(this); |
---|
335 | 379 | frontItem = menu.add(new MenuItem("Front")); |
---|
336 | 380 | frontItem.addActionListener(this); |
---|
337 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
338 | | - compositeItem.addActionListener(this); |
---|
| 381 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 382 | +// compositeItem.addActionListener(this); |
---|
339 | 383 | |
---|
340 | 384 | if (Globals.ADVANCED) |
---|
341 | 385 | { |
---|
.. | .. |
---|
345 | 389 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
346 | 390 | ungroupItem.addActionListener(this); |
---|
347 | 391 | |
---|
348 | | - menu.add("-"); |
---|
349 | | - |
---|
350 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
351 | | - randomItem.addActionListener(this); |
---|
| 392 | +// menu.add("-"); |
---|
| 393 | +// |
---|
| 394 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 395 | +// switchItem.addActionListener(this); |
---|
352 | 396 | if (Globals.ADVANCED) |
---|
353 | 397 | { |
---|
354 | 398 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
.. | .. |
---|
365 | 409 | frameselectorItem.addActionListener(this); |
---|
366 | 410 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
367 | 411 | scriptNodeItem.addActionListener(this); |
---|
368 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
369 | | - cameraItem.addActionListener(this); |
---|
370 | 412 | } |
---|
371 | 413 | |
---|
372 | 414 | oe.menuBar.add(menu = new Menu("Object")); |
---|
373 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
374 | | - textureItem.addActionListener(this); |
---|
| 415 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 416 | +// textureItem.addActionListener(this); |
---|
375 | 417 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
376 | 418 | billboardItem.addActionListener(this); |
---|
377 | 419 | csgItem = menu.add(new MenuItem("CSG")); |
---|
.. | .. |
---|
382 | 424 | shadowYItem.addActionListener(this); |
---|
383 | 425 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
384 | 426 | shadowZItem.addActionListener(this); |
---|
| 427 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 428 | + attributeItem.addActionListener(this); |
---|
| 429 | + |
---|
385 | 430 | if (Globals.ADVANCED) |
---|
386 | 431 | { |
---|
387 | 432 | menu.add("-"); |
---|
388 | 433 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
389 | 434 | linkerItem.addActionListener(this); |
---|
390 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
391 | | - attributeItem.addActionListener(this); |
---|
392 | 435 | templateItem = menu.add(new MenuItem("Template")); |
---|
393 | 436 | templateItem.addActionListener(this); |
---|
394 | 437 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
417 | 460 | genNormalsMESHItem.addActionListener(this); |
---|
418 | 461 | if (Globals.ADVANCED) |
---|
419 | 462 | { |
---|
420 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 463 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
421 | 464 | genNormalsMINEItem.addActionListener(this); |
---|
422 | 465 | } |
---|
423 | 466 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
510 | 553 | attachBumpItem.addActionListener(this); |
---|
511 | 554 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
512 | 555 | pigmentBumpItem.addActionListener(this); |
---|
| 556 | + //embedTexturesItem |
---|
513 | 557 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
514 | 558 | detachPigmentItem.addActionListener(this); |
---|
515 | 559 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
516 | 560 | detachBumpItem.addActionListener(this); |
---|
| 561 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 562 | + embedTexturesItem.addActionListener(this); |
---|
| 563 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 564 | + deEmbedTexturesItem.addActionListener(this); |
---|
517 | 565 | menu.add("-"); |
---|
518 | 566 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
519 | 567 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
540 | 588 | buildToolsMenu(menu); |
---|
541 | 589 | } |
---|
542 | 590 | |
---|
| 591 | + |
---|
543 | 592 | void SetupUI2(ObjEditor oe) |
---|
544 | 593 | { |
---|
545 | 594 | // June 2019 |
---|
.. | .. |
---|
582 | 631 | oe.radioPanel.add(dummyButton); |
---|
583 | 632 | oe.buttonGroup.add(dummyButton); |
---|
584 | 633 | */ |
---|
| 634 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 635 | + |
---|
| 636 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 637 | + |
---|
585 | 638 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
586 | 639 | |
---|
587 | 640 | //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
588 | 641 | //minButton.setToolTipText("Minimize window"); |
---|
589 | 642 | //minButton.addActionListener(this); |
---|
590 | 643 | |
---|
591 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
592 | | - maxButton.setToolTipText("Maximize window"); |
---|
593 | | - maxButton.addActionListener(this); |
---|
| 644 | + if (Globals.ADVANCED) |
---|
| 645 | + { |
---|
| 646 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + maxButton.setToolTipText("Maximize window"); |
---|
| 648 | + maxButton.addActionListener(this); |
---|
| 649 | + } |
---|
594 | 650 | |
---|
595 | 651 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | 652 | fullButton.setToolTipText("Full-screen window"); |
---|
597 | 653 | fullButton.addActionListener(this); |
---|
598 | 654 | |
---|
599 | | - oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | | - undoButton.setToolTipText("Undo changes"); |
---|
601 | | - undoButton.addActionListener(this); |
---|
| 655 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 657 | + screenfitButton.addActionListener(this); |
---|
| 658 | + |
---|
| 659 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 660 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 661 | + restoreCameraButton.addActionListener(this); |
---|
602 | 662 | |
---|
603 | | - oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
604 | | - redoButton.setToolTipText("Redo changes"); |
---|
605 | | - redoButton.addActionListener(this); |
---|
606 | | - |
---|
607 | | - oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | | - saveButton.setToolTipText("Save changes"); |
---|
| 663 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + saveButton.setToolTipText("New version"); |
---|
609 | 665 | saveButton.addActionListener(this); |
---|
| 666 | + |
---|
| 667 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 668 | + undoButton.setToolTipText("Previous version"); |
---|
| 669 | + undoButton.addActionListener(this); |
---|
| 670 | + undoButton.setEnabled(false); |
---|
610 | 671 | |
---|
611 | | - oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 672 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 673 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 674 | + restoreButton.setToolTipText("Restore current"); |
---|
| 675 | + restoreButton.addActionListener(this); |
---|
| 676 | + restoreButton.setEnabled(false); |
---|
| 677 | + |
---|
| 678 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 679 | + replaceButton.setToolTipText("Replace current"); |
---|
| 680 | + replaceButton.addActionListener(this); |
---|
| 681 | + replaceButton.setEnabled(false); |
---|
| 682 | + |
---|
| 683 | + copyOptionsPanel.add(updown); |
---|
| 684 | + |
---|
| 685 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 686 | + redoButton.setToolTipText("Next version"); |
---|
| 687 | + redoButton.addActionListener(this); |
---|
| 688 | + redoButton.setEnabled(false); |
---|
| 689 | + |
---|
| 690 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
612 | 691 | liveCB.setToolTipText("Enable animation"); |
---|
613 | 692 | liveCB.addItemListener(this); |
---|
614 | 693 | |
---|
615 | | - oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 694 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
616 | 695 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
617 | 696 | oneStepButton.addActionListener(this); |
---|
618 | 697 | |
---|
619 | | - oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 698 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
620 | 699 | fastCB.setToolTipText("Fast mode"); |
---|
621 | 700 | fastCB.addItemListener(this); |
---|
622 | 701 | |
---|
623 | | - oe.toolboxPanel.Return(); |
---|
| 702 | + //oe.toolboxPanel.Return(); |
---|
624 | 703 | |
---|
625 | | - oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
626 | | - trackCB.setToolTipText("Enable tracking"); |
---|
627 | | - trackCB.addItemListener(this); |
---|
628 | | - |
---|
629 | | - oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
630 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
631 | | - screenfitButton.addActionListener(this); |
---|
| 704 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 705 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 706 | +// trackCB.addItemListener(this); |
---|
632 | 707 | |
---|
633 | 708 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
634 | 709 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
638 | 713 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
639 | 714 | snapobjectButton.addActionListener(this); |
---|
640 | 715 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 716 | + |
---|
| 717 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 718 | + fourButton.addActionListener(this); |
---|
| 719 | + fourButton.setToolTipText("Show control panel only"); |
---|
641 | 720 | } |
---|
642 | 721 | |
---|
643 | | - oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
644 | | - flashSelectionButton.setToolTipText("Highlight selection"); |
---|
645 | | - flashSelectionButton.addActionListener(this); |
---|
646 | | - |
---|
647 | 722 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
648 | 723 | |
---|
649 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
650 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 724 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 725 | + twoButton.setToolTipText("Show 3D view only"); |
---|
651 | 726 | twoButton.addActionListener(this); |
---|
652 | 727 | this.fullscreenLayout = twoButton; |
---|
653 | 728 | |
---|
654 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
655 | | - fourButton.addActionListener(this); |
---|
656 | | - fourButton.setToolTipText("Show left panel only"); |
---|
657 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
658 | | - sixButton.setToolTipText("2-column layout left"); |
---|
659 | | - sixButton.addActionListener(this); |
---|
660 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
661 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 729 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 730 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
662 | 731 | threeButton.addActionListener(this); |
---|
663 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
664 | | - sevenButton.setToolTipText("3-column layout"); |
---|
665 | | - sevenButton.addActionListener(this); |
---|
| 732 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 733 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 734 | + sixButton.addActionListener(this); |
---|
| 735 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 736 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 737 | +// sevenButton.addActionListener(this); |
---|
666 | 738 | // |
---|
667 | 739 | |
---|
668 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
669 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 740 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 741 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
670 | 742 | rootButton.addActionListener(this); |
---|
671 | 743 | |
---|
672 | 744 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
675 | 747 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
676 | 748 | //clearButton.addActionListener(this); |
---|
677 | 749 | |
---|
| 750 | + cGridBag row1 = new cGridBag(); |
---|
| 751 | + |
---|
678 | 752 | // INSERT |
---|
679 | | - oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 753 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
680 | 754 | gridButton.setToolTipText("Create grid"); |
---|
681 | 755 | gridButton.addActionListener(this); |
---|
682 | 756 | |
---|
683 | | - oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 757 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
684 | 758 | boxButton.setToolTipText("Create box"); |
---|
685 | 759 | boxButton.addActionListener(this); |
---|
686 | 760 | |
---|
687 | | - oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 761 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
688 | 762 | sphereButton.setToolTipText("Create sphere"); |
---|
689 | 763 | sphereButton.addActionListener(this); |
---|
690 | 764 | |
---|
691 | | - oe.toolboxPanel.Return(); |
---|
692 | | - |
---|
693 | | - oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 765 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
694 | 766 | coneButton.setToolTipText("Create cone"); |
---|
695 | 767 | coneButton.addActionListener(this); |
---|
696 | 768 | |
---|
697 | | - oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 769 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
698 | 770 | torusButton.setToolTipText("Create torus"); |
---|
699 | 771 | torusButton.addActionListener(this); |
---|
700 | 772 | |
---|
701 | | - oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 773 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
702 | 774 | superButton.setToolTipText("Create superellipsoid"); |
---|
703 | 775 | superButton.addActionListener(this); |
---|
704 | 776 | |
---|
.. | .. |
---|
709 | 781 | kleinButton.addActionListener(this); |
---|
710 | 782 | } |
---|
711 | 783 | |
---|
712 | | - oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 784 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
713 | 785 | particlesButton.setToolTipText("Create particle system"); |
---|
714 | 786 | particlesButton.addActionListener(this); |
---|
715 | 787 | |
---|
716 | | - oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 788 | + oe.toolboxPanel.add(row1); |
---|
| 789 | + |
---|
| 790 | + cGridBag row2 = new cGridBag(); |
---|
| 791 | + |
---|
| 792 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 793 | + groupButton.setToolTipText("Create group"); |
---|
| 794 | + groupButton.addActionListener(this); |
---|
| 795 | + |
---|
| 796 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 797 | + compositeButton.setToolTipText("Create composite"); |
---|
| 798 | + compositeButton.addActionListener(this); |
---|
| 799 | + |
---|
| 800 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 801 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 802 | + switchButton.addActionListener(this); |
---|
| 803 | + |
---|
| 804 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + loopButton.setToolTipText("Create loop"); |
---|
| 806 | + loopButton.addActionListener(this); |
---|
| 807 | + |
---|
| 808 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 809 | + textureButton.setToolTipText("Create texture"); |
---|
| 810 | + textureButton.addActionListener(this); |
---|
| 811 | + |
---|
| 812 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
717 | 813 | overlayButton.setToolTipText("Create overlay"); |
---|
718 | 814 | overlayButton.addActionListener(this); |
---|
719 | 815 | |
---|
720 | | - oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 816 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
721 | 817 | lightButton.setToolTipText("Create light"); |
---|
722 | 818 | lightButton.addActionListener(this); |
---|
723 | 819 | |
---|
| 820 | + oe.toolboxPanel.add(row2); |
---|
| 821 | + |
---|
| 822 | + // ENVYMAPS |
---|
| 823 | + cGridBag row3 = new cGridBag(); |
---|
| 824 | + row3.preferredHeight = 20; |
---|
| 825 | + |
---|
| 826 | + AddSkyboxButton("default", "rgb", row3); |
---|
| 827 | + AddSkyboxButton("default", "cornell", row3); |
---|
| 828 | + AddSkyboxButton("default", "uffizi", row3); |
---|
| 829 | + AddSkyboxButton("default", "CloudyHills", row3); |
---|
| 830 | + AddSkyboxButton("default", "skycube", row3); |
---|
| 831 | + |
---|
| 832 | + oe.toolboxPanel.add(row3); |
---|
| 833 | + |
---|
| 834 | + cGridBag row4 = new cGridBag(); |
---|
| 835 | + row4.preferredHeight = 20; |
---|
| 836 | + |
---|
| 837 | + AddSkyboxButton("bridge", "Bridge2", row4); |
---|
| 838 | + AddSkyboxButton("urban", "GamlaStan2", row4); |
---|
| 839 | + AddSkyboxButton("urban", "Parliament", row4); |
---|
| 840 | + AddSkyboxButton("urban", "Roundabout", row4); |
---|
| 841 | + |
---|
| 842 | + oe.toolboxPanel.add(row4); |
---|
| 843 | + |
---|
| 844 | + cGridBag row5 = new cGridBag(); |
---|
| 845 | + row5.preferredHeight = 20; |
---|
| 846 | + |
---|
| 847 | + AddSkyboxButton("urban", "SaintLazarusChurch", row5); |
---|
| 848 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row5); |
---|
| 849 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row5); |
---|
| 850 | + AddSkyboxButton("urban", "UnionSquare", row5); |
---|
| 851 | + |
---|
| 852 | + oe.toolboxPanel.add(row5); |
---|
| 853 | + |
---|
| 854 | + cGridBag row6 = new cGridBag(); |
---|
| 855 | + row6.preferredHeight = 20; |
---|
| 856 | + |
---|
| 857 | + AddSkyboxButton("park", "BerzeliiPark", row6); |
---|
| 858 | + AddSkyboxButton("park", "Buddha", row6); |
---|
| 859 | + AddSkyboxButton("park", "CNTower2", row6); |
---|
| 860 | + //AddSkyboxButton("park", "Fatbursparken", row6); |
---|
| 861 | + AddSkyboxButton("park", "NiagaraFalls1", row6); |
---|
| 862 | + |
---|
| 863 | + oe.toolboxPanel.add(row6); |
---|
| 864 | + |
---|
| 865 | + cGridBag row7 = new cGridBag(); |
---|
| 866 | + row7.preferredHeight = 20; |
---|
| 867 | + |
---|
| 868 | + AddSkyboxButton("park", "NiagaraFalls3", row7); |
---|
| 869 | + AddSkyboxButton("park", "Park", row7); |
---|
| 870 | + //AddSkyboxButton("park", "Park2", row6); |
---|
| 871 | + //AddSkyboxButton("park", "Path", row6); |
---|
| 872 | + AddSkyboxButton("park", "Pond", row7); |
---|
| 873 | + AddSkyboxButton("park", "Skansen", row7); |
---|
| 874 | + |
---|
| 875 | + oe.toolboxPanel.add(row7); |
---|
| 876 | + |
---|
| 877 | + cGridBag row8 = new cGridBag(); |
---|
| 878 | + row8.preferredHeight = 20; |
---|
| 879 | + |
---|
| 880 | + AddSkyboxButton("park", "Skansen2", row8); |
---|
| 881 | + AddSkyboxButton("park", "Skansen3", row8); |
---|
| 882 | + AddSkyboxButton("park", "Skansen4", row8); |
---|
| 883 | + AddSkyboxButton("park", "Skansen5", row8); |
---|
| 884 | + |
---|
| 885 | + oe.toolboxPanel.add(row8); |
---|
| 886 | + |
---|
| 887 | + cGridBag row9 = new cGridBag(); |
---|
| 888 | + row9.preferredHeight = 20; |
---|
| 889 | + |
---|
| 890 | + AddSkyboxButton("park", "Stairs", row9); |
---|
| 891 | + //AddSkyboxButton("park", "Tantolunden", row6); |
---|
| 892 | + //AddSkyboxButton("park", "Tantolunden3", row6); |
---|
| 893 | + AddSkyboxButton("park", "Tantolunden4", row9); |
---|
| 894 | + |
---|
| 895 | + oe.toolboxPanel.add(row9); |
---|
| 896 | +/* |
---|
| 897 | +BerzeliiPark |
---|
| 898 | +Buddha |
---|
| 899 | +CNTower2 |
---|
| 900 | +Fatbursparken |
---|
| 901 | +NiagaraFalls1 |
---|
| 902 | +NiagaraFalls3 |
---|
| 903 | +Park |
---|
| 904 | +Park2 |
---|
| 905 | +Path |
---|
| 906 | +Pond |
---|
| 907 | +Skansen |
---|
| 908 | +Skansen2 |
---|
| 909 | +Skansen3 |
---|
| 910 | +Skansen4 |
---|
| 911 | +Skansen5 |
---|
| 912 | +Stairs |
---|
| 913 | +Tantolunden |
---|
| 914 | +Tantolunden3 |
---|
| 915 | +Tantolunden4 |
---|
| 916 | + */ |
---|
| 917 | + |
---|
| 918 | + for (int i=1; --i>=0;) |
---|
| 919 | + { |
---|
| 920 | + //oe.toolboxPanel.Return(); |
---|
| 921 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 922 | + } |
---|
| 923 | + |
---|
724 | 924 | // EDIT panel |
---|
725 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
726 | | - editButton.setToolTipText("Edit selection"); |
---|
| 925 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 926 | + editButton.setToolTipText("Pin selection controls"); |
---|
727 | 927 | editButton.addActionListener(this); |
---|
728 | 928 | |
---|
729 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
730 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 929 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 930 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
731 | 931 | uneditButton.addActionListener(this); |
---|
732 | 932 | |
---|
733 | 933 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
734 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 934 | + allParamsButton.setToolTipText("Show all controle"); |
---|
735 | 935 | allParamsButton.addActionListener(this); |
---|
736 | 936 | |
---|
737 | 937 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
742 | 942 | unselectButton.setToolTipText("Unselect"); |
---|
743 | 943 | unselectButton.addActionListener(this); |
---|
744 | 944 | |
---|
| 945 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 946 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 947 | + flashSelectionButton.addActionListener(this); |
---|
| 948 | + |
---|
745 | 949 | editCommandsPanel.preferredHeight = 1; |
---|
746 | 950 | |
---|
| 951 | + SetPinStates(false); |
---|
747 | 952 | // oe.treePanel.add(commandsPanel); |
---|
748 | 953 | // oe.treePanel.Return(); |
---|
749 | 954 | |
---|
.. | .. |
---|
768 | 973 | oe.treePanel.add(jSPPanel); |
---|
769 | 974 | oe.treePanel.Return(); |
---|
770 | 975 | |
---|
771 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
772 | | - |
---|
773 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
774 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
775 | | - colorCB.addItemListener(this); |
---|
776 | | - |
---|
777 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
778 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
779 | | - materialCB.addItemListener(this); |
---|
780 | | - |
---|
781 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
782 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
783 | | - textureCB.addItemListener(this); |
---|
784 | | - |
---|
785 | | - copyOptionsPanel.preferredHeight = 1; |
---|
786 | 976 | oe.treePanel.add(copyOptionsPanel); |
---|
787 | 977 | oe.treePanel.Return(); |
---|
| 978 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 979 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 980 | + sliderPane.preferredHeight = 1; |
---|
788 | 981 | |
---|
789 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
790 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 982 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 983 | + mainPanel.setResizeWeight(0.4); |
---|
791 | 984 | |
---|
792 | 985 | //jList.addListSelectionListener(this); |
---|
793 | 986 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
795 | 988 | //jTree.setEditable(true); |
---|
796 | 989 | oe.jTree.setDragEnabled(true); |
---|
797 | 990 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
798 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 991 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
799 | 992 | |
---|
800 | 993 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
801 | 994 | |
---|
.. | .. |
---|
807 | 1000 | dgr.addDragGestureListener(this); |
---|
808 | 1001 | }catch(Exception e) {} |
---|
809 | 1002 | */ |
---|
810 | | - radio.layout = sevenButton; |
---|
| 1003 | + radio.layout = sixButton; // sevenButton; |
---|
811 | 1004 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
812 | 1005 | } |
---|
813 | 1006 | |
---|
814 | 1007 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
815 | 1008 | { |
---|
| 1009 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1010 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1011 | + colorCB.addItemListener(this); |
---|
| 1012 | + |
---|
| 1013 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1014 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1015 | + materialCB.addItemListener(this); |
---|
| 1016 | + |
---|
| 1017 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1018 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1019 | + textureCB.addItemListener(this); |
---|
| 1020 | + |
---|
| 1021 | + panel.Return(); |
---|
| 1022 | + |
---|
816 | 1023 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
817 | 1024 | boxCB.setToolTipText("Display bounding boxes"); |
---|
818 | 1025 | boxCB.addItemListener(this); |
---|
819 | 1026 | |
---|
820 | 1027 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
821 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1028 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
822 | 1029 | zoomBoxCB.addItemListener(this); |
---|
823 | 1030 | |
---|
824 | 1031 | if (true) // Globals.ADVANCED) |
---|
825 | 1032 | { |
---|
826 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
827 | | - supportCB.setToolTipText("Enable rigging"); |
---|
828 | | - supportCB.addItemListener(this); |
---|
| 1033 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1034 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1035 | +// supportCB.addItemListener(this); |
---|
| 1036 | + |
---|
| 1037 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1038 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1039 | + freezeCB.addItemListener(this); |
---|
829 | 1040 | |
---|
830 | 1041 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
831 | 1042 | // localCB.addItemListener(this); |
---|
832 | 1043 | |
---|
| 1044 | + panel.Return(); |
---|
| 1045 | + |
---|
833 | 1046 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
834 | 1047 | crowdCB.setToolTipText("Used for crowds"); |
---|
835 | 1048 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
846 | 1059 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
847 | 1060 | // speakerMocapCB.addItemListener(this); |
---|
848 | 1061 | |
---|
| 1062 | + panel.Return(); |
---|
| 1063 | + |
---|
849 | 1064 | if (false) |
---|
850 | 1065 | { |
---|
851 | 1066 | // handled in scripts |
---|
.. | .. |
---|
860 | 1075 | //constraints.gridy += 1; |
---|
861 | 1076 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
862 | 1077 | smoothfocusCB.addItemListener(this); |
---|
| 1078 | + panel.Return(); |
---|
863 | 1079 | } |
---|
864 | 1080 | |
---|
865 | 1081 | //constraints.gridx += 1; |
---|
866 | 1082 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
867 | 1083 | // debugCB.addItemListener(this); |
---|
868 | 1084 | |
---|
| 1085 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1086 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1087 | + trackCB.addItemListener(this); |
---|
| 1088 | + |
---|
869 | 1089 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
870 | | - oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 1090 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
871 | 1091 | oeilCB.addItemListener(this); |
---|
872 | 1092 | |
---|
873 | 1093 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
874 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 1094 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
875 | 1095 | shadowCB.addItemListener(this); |
---|
876 | 1096 | |
---|
877 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
878 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
879 | | - autosaveCB.addItemListener(this); |
---|
| 1097 | + panel.Return(); |
---|
| 1098 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1099 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1100 | + toggleTextureCB.addItemListener(this); |
---|
| 1101 | + |
---|
| 1102 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1103 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1104 | + toggleSwitchCB.addItemListener(this); |
---|
| 1105 | + |
---|
| 1106 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1107 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1108 | + autokeepCB.addItemListener(this); |
---|
880 | 1109 | |
---|
| 1110 | + panel.Return(); |
---|
881 | 1111 | if (Globals.ADVANCED) |
---|
882 | 1112 | { |
---|
883 | 1113 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
.. | .. |
---|
888 | 1118 | } |
---|
889 | 1119 | |
---|
890 | 1120 | cGridBag fill = new cGridBag(); |
---|
891 | | - |
---|
892 | 1121 | fill.preferredHeight = 200; |
---|
| 1122 | + cGridBag fill2 = new cGridBag(); |
---|
| 1123 | + fill2.preferredHeight = 200; |
---|
| 1124 | + cGridBag fill3 = new cGridBag(); |
---|
| 1125 | + fill3.preferredHeight = 200; |
---|
893 | 1126 | |
---|
894 | 1127 | panel.add(fill); |
---|
| 1128 | + panel.add(fill2); |
---|
| 1129 | + panel.add(fill3); |
---|
895 | 1130 | |
---|
896 | 1131 | } |
---|
897 | 1132 | |
---|
.. | .. |
---|
899 | 1134 | { |
---|
900 | 1135 | cRadio radioButton = new cRadio(obj.name); |
---|
901 | 1136 | |
---|
902 | | - // Patch to avoid bug with transparency. |
---|
| 1137 | + // June 2019. Patch to avoid bug with transparency. |
---|
903 | 1138 | radioButton.hadMaterial = obj.material != null; |
---|
904 | 1139 | if (!radioButton.hadMaterial) |
---|
905 | 1140 | { |
---|
.. | .. |
---|
907 | 1142 | } |
---|
908 | 1143 | |
---|
909 | 1144 | radioButton.SetObject(obj); |
---|
910 | | - radioButton.layout = sevenButton; |
---|
| 1145 | + radioButton.layout = sixButton; // sevenButton; |
---|
911 | 1146 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
912 | 1147 | radioButton.addActionListener(this); |
---|
913 | 1148 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
936 | 1171 | cCheckBox slowCB; |
---|
937 | 1172 | cCheckBox boxCB; |
---|
938 | 1173 | cCheckBox zoomBoxCB; |
---|
939 | | - cToggleButton trackCB; |
---|
| 1174 | + cCheckBox freezeCB; |
---|
| 1175 | + //cToggleButton trackCB; |
---|
| 1176 | + cCheckBox trackCB; |
---|
940 | 1177 | cCheckBox smoothfocusCB; |
---|
941 | 1178 | // JCheckBox speakerMocapCB; |
---|
942 | 1179 | cCheckBox speakerCameraCB; |
---|
.. | .. |
---|
945 | 1182 | |
---|
946 | 1183 | cCheckBox oeilCB; |
---|
947 | 1184 | cCheckBox shadowCB; |
---|
948 | | - cCheckBox autosaveCB; |
---|
| 1185 | + cCheckBox autokeepCB; |
---|
949 | 1186 | cCheckBox lookAtCB; |
---|
950 | 1187 | |
---|
951 | 1188 | // static int COLOR = 1; |
---|
.. | .. |
---|
1053 | 1290 | { |
---|
1054 | 1291 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
1055 | 1292 | } |
---|
1056 | | - else if(e.getSource() == autosaveCB) |
---|
| 1293 | + else if(e.getSource() == freezeCB) |
---|
1057 | 1294 | { |
---|
1058 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1295 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1296 | + } |
---|
| 1297 | + else if(e.getSource() == autokeepCB) |
---|
| 1298 | + { |
---|
| 1299 | + Globals.REPLACEONMAKE ^= true; |
---|
1059 | 1300 | } |
---|
1060 | 1301 | else if(e.getSource() == lookAtCB) |
---|
1061 | 1302 | { |
---|
.. | .. |
---|
1137 | 1378 | } |
---|
1138 | 1379 | } |
---|
1139 | 1380 | |
---|
1140 | | - String string = (String) object; |
---|
1141 | | - |
---|
1142 | 1381 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1143 | 1382 | // if( object instanceof java.io.File[]) |
---|
1144 | 1383 | // { |
---|
.. | .. |
---|
1146 | 1385 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1147 | 1386 | // return; |
---|
1148 | 1387 | // } |
---|
| 1388 | + |
---|
| 1389 | + String string = object.toString(); |
---|
1149 | 1390 | |
---|
1150 | 1391 | // File path for Mac and Windows |
---|
1151 | 1392 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1191 | 1432 | |
---|
1192 | 1433 | assert target == objEditor.jTree; |
---|
1193 | 1434 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1435 | + Object3D destinationLeaf; |
---|
1194 | 1436 | try { |
---|
1195 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1437 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1196 | 1438 | } catch (Exception e) { |
---|
1197 | 1439 | System.out.println("destinationPath : " + destinationPath); |
---|
1198 | 1440 | return; |
---|
1199 | 1441 | } |
---|
1200 | 1442 | |
---|
| 1443 | + for (int i=group.selection.size(); --i>=0;) |
---|
| 1444 | + { |
---|
| 1445 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1446 | + |
---|
| 1447 | + // Cannot move into itself |
---|
| 1448 | + if (child == destinationLeaf) |
---|
| 1449 | + return; |
---|
| 1450 | + } |
---|
| 1451 | + |
---|
1201 | 1452 | // june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
1202 | 1453 | // { |
---|
1203 | 1454 | loadClipboard(true); |
---|
.. | .. |
---|
1312 | 1563 | { |
---|
1313 | 1564 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1314 | 1565 | //heightFieldItem.addActionListener(this); |
---|
1315 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1316 | | - gridItem.addActionListener(this); |
---|
1317 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1318 | | - rectoidItem.addActionListener(this); |
---|
1319 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1320 | | - ellipsoidItem.addActionListener(this); |
---|
1321 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1322 | | - coneItem.addActionListener(this); |
---|
1323 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1324 | | - torusItem.addActionListener(this); |
---|
1325 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1326 | | - superItem.addActionListener(this); |
---|
| 1566 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1567 | +// gridItem.addActionListener(this); |
---|
| 1568 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1569 | +// rectoidItem.addActionListener(this); |
---|
| 1570 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1571 | +// ellipsoidItem.addActionListener(this); |
---|
| 1572 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1573 | +// coneItem.addActionListener(this); |
---|
| 1574 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1575 | +// torusItem.addActionListener(this); |
---|
| 1576 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1577 | +// superItem.addActionListener(this); |
---|
| 1578 | + |
---|
| 1579 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1580 | + cameraItem.addActionListener(this); |
---|
| 1581 | + |
---|
| 1582 | + if (!Globals.ADVANCED) |
---|
| 1583 | + { |
---|
1327 | 1584 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1328 | 1585 | kleinItem.addActionListener(this); |
---|
1329 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1330 | | - particleItem.addActionListener(this); |
---|
| 1586 | + } |
---|
| 1587 | + |
---|
| 1588 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1589 | +// particleItem.addActionListener(this); |
---|
1331 | 1590 | if (Globals.ADVANCED) |
---|
1332 | 1591 | { |
---|
1333 | 1592 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1353 | 1612 | } |
---|
1354 | 1613 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1355 | 1614 | bezierItem.addActionListener(this); |
---|
1356 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1357 | | - overlayItem.addActionListener(this); |
---|
1358 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1359 | | - lightItem.addActionListener(this); |
---|
| 1615 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1616 | +// overlayItem.addActionListener(this); |
---|
| 1617 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1618 | +// lightItem.addActionListener(this); |
---|
1360 | 1619 | menu.add("-"); |
---|
1361 | 1620 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1362 | 1621 | //superLoopItem.addActionListener(this); |
---|
1363 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1364 | | - loopItem.addActionListener(this); |
---|
| 1622 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1623 | +// loopItem.addActionListener(this); |
---|
1365 | 1624 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1366 | 1625 | doubleItem.addActionListener(this); |
---|
1367 | 1626 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1377 | 1636 | animationItem.addItemListener(this); |
---|
1378 | 1637 | animationItem.setState(Globals.ANIMATION); |
---|
1379 | 1638 | |
---|
| 1639 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1640 | + archiveItem.addActionListener(this); |
---|
| 1641 | + |
---|
1380 | 1642 | menu.add("-"); |
---|
1381 | 1643 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1382 | 1644 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1389 | 1651 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1390 | 1652 | reduce34MorphItem.addActionListener(this); |
---|
1391 | 1653 | menu.add("-"); |
---|
| 1654 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1655 | + memoryItem.addActionListener(this); |
---|
1392 | 1656 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1393 | 1657 | computeAOItem.addActionListener(this); |
---|
1394 | 1658 | |
---|
.. | .. |
---|
1397 | 1661 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1398 | 1662 | mirrorItem.addActionListener(this); |
---|
1399 | 1663 | menu.add("-"); |
---|
1400 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1401 | | - memoryItem.addActionListener(this); |
---|
1402 | 1664 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1403 | 1665 | analyzeItem.addActionListener(this); |
---|
1404 | 1666 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1546 | 1808 | |
---|
1547 | 1809 | makeSomething(shadow); |
---|
1548 | 1810 | } |
---|
| 1811 | + |
---|
| 1812 | + private void ClearUnpinned() |
---|
| 1813 | + { |
---|
| 1814 | + //for (Object3D obj : listUI) |
---|
| 1815 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1816 | + { |
---|
| 1817 | + Object3D obj = listUI.elementAt(i); |
---|
| 1818 | + if (!obj.pinned) |
---|
| 1819 | + { |
---|
| 1820 | + obj.CloseUI(); |
---|
| 1821 | + listUI.remove(i); |
---|
| 1822 | + } |
---|
| 1823 | + } |
---|
| 1824 | + } |
---|
| 1825 | + |
---|
| 1826 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1827 | + { |
---|
| 1828 | + // if (!(elem instanceof Composite)) |
---|
| 1829 | + // newWindow = false; |
---|
| 1830 | + listUI.add(elem); |
---|
| 1831 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1832 | + System.out.println("edit : " + elem); |
---|
| 1833 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1834 | + } |
---|
1549 | 1835 | |
---|
1550 | 1836 | /** |
---|
1551 | 1837 | * applyExample |
---|
.. | .. |
---|
1790 | 2076 | { |
---|
1791 | 2077 | ScreenFit(); |
---|
1792 | 2078 | } else |
---|
1793 | | - if (source == switchItem) |
---|
| 2079 | + if (source == switchViewItem) |
---|
1794 | 2080 | { |
---|
1795 | 2081 | cVector v1 = new cVector(); |
---|
1796 | 2082 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1974 | 2260 | { |
---|
1975 | 2261 | makeSomething(new Light()); |
---|
1976 | 2262 | } else |
---|
| 2263 | +// if (source == skybox1Button || |
---|
| 2264 | +// source == skybox2Button || |
---|
| 2265 | +// source == skybox3Button || |
---|
| 2266 | +// source == skybox4Button || |
---|
| 2267 | +// source == skybox5Button || |
---|
| 2268 | +// source == skybox6Button || |
---|
| 2269 | +// source == skybox7Button || |
---|
| 2270 | +// source == skybox11Button || |
---|
| 2271 | +// source == skybox12Button || |
---|
| 2272 | +// source == skybox13Button || |
---|
| 2273 | +// source == skybox14Button || |
---|
| 2274 | +// source == skybox15Button || |
---|
| 2275 | +// source == skybox16Button || |
---|
| 2276 | +// source == skybox17Button) |
---|
| 2277 | +// { |
---|
| 2278 | +// ChangeSkybox(source); |
---|
| 2279 | +// } else |
---|
1977 | 2280 | if (source == csgItem) |
---|
1978 | 2281 | { |
---|
1979 | 2282 | group(new CSG()); |
---|
.. | .. |
---|
2020 | 2323 | |
---|
2021 | 2324 | group(g); |
---|
2022 | 2325 | } else |
---|
2023 | | - if (source == loopItem) |
---|
| 2326 | + if (source == loopItem || source == loopButton) |
---|
2024 | 2327 | { |
---|
2025 | 2328 | Composite csg = new GroupLeaf(); |
---|
2026 | 2329 | csg.count = 5; |
---|
2027 | 2330 | group(csg); |
---|
2028 | | - Composite child = new cGroup(); |
---|
| 2331 | + Composite child = new cGroup("Branch"); |
---|
2029 | 2332 | csg.addChild(child); |
---|
2030 | 2333 | child.addChild(csg); |
---|
2031 | 2334 | } else |
---|
2032 | 2335 | if (source == doubleItem) |
---|
2033 | 2336 | { |
---|
2034 | | - Composite csg = new GroupLeaf(); |
---|
| 2337 | + Composite csg = new GroupLeaf("Fork"); |
---|
2035 | 2338 | csg.count = 5; |
---|
2036 | 2339 | group(csg); |
---|
2037 | | - Composite child = new cGroup(); |
---|
| 2340 | + Composite child = new cGroup("Branch A"); |
---|
2038 | 2341 | csg.addChild(child); |
---|
2039 | 2342 | child.addChild(csg); |
---|
2040 | | - child = new cGroup(); |
---|
| 2343 | + child = new cGroup("Branch B"); |
---|
2041 | 2344 | csg.addChild(child); |
---|
2042 | 2345 | child.addChild(csg); |
---|
2043 | 2346 | } else |
---|
2044 | 2347 | if (source == tripleItem) |
---|
2045 | 2348 | { |
---|
2046 | | - Composite csg = new GroupLeaf(); |
---|
| 2349 | + Composite csg = new GroupLeaf("Trident"); |
---|
2047 | 2350 | csg.count = 4; |
---|
2048 | 2351 | group(csg); |
---|
2049 | 2352 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2059 | 2362 | if (source == computeAOItem) |
---|
2060 | 2363 | { |
---|
2061 | 2364 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
2062 | | - Globals.theRenderer.repaint(); |
---|
| 2365 | + cameraView.repaint(); |
---|
2063 | 2366 | } else |
---|
2064 | 2367 | if (source == recompileItem) |
---|
2065 | 2368 | { |
---|
.. | .. |
---|
2107 | 2410 | } else |
---|
2108 | 2411 | if (source == undoButton) |
---|
2109 | 2412 | { |
---|
| 2413 | + // Go to previous version |
---|
| 2414 | + //if (!Undo()) |
---|
| 2415 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2110 | 2416 | Undo(); |
---|
| 2417 | + } else |
---|
| 2418 | + if (source == restoreButton) |
---|
| 2419 | + { |
---|
| 2420 | + // Restore current version |
---|
| 2421 | + Restore(); |
---|
| 2422 | + } else |
---|
| 2423 | + if (source == replaceButton) |
---|
| 2424 | + { |
---|
| 2425 | + // Overwrite current version |
---|
| 2426 | + Replace(); |
---|
2111 | 2427 | } else |
---|
2112 | 2428 | if (source == redoButton) |
---|
2113 | 2429 | { |
---|
| 2430 | + // Go to next version |
---|
2114 | 2431 | Redo(); |
---|
2115 | 2432 | } else |
---|
2116 | 2433 | if (source == saveButton) |
---|
2117 | 2434 | { |
---|
2118 | | - Save(); |
---|
| 2435 | + // Save a new version |
---|
| 2436 | + if (!Save(true)) |
---|
| 2437 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2119 | 2438 | } else |
---|
2120 | 2439 | if (source == oneStepButton) |
---|
2121 | 2440 | { |
---|
.. | .. |
---|
2124 | 2443 | } else |
---|
2125 | 2444 | if (source == screenfitButton) |
---|
2126 | 2445 | { |
---|
2127 | | - //Reload(lastConverter, lastFilename, true); |
---|
2128 | 2446 | ScreenFit(); |
---|
2129 | 2447 | } else |
---|
2130 | 2448 | if (source == screenfitpointButton) |
---|
2131 | 2449 | { |
---|
2132 | | - //Reload(lastConverter, lastFilename, true); |
---|
2133 | 2450 | ScreenFitPoint(); |
---|
2134 | 2451 | } else |
---|
2135 | 2452 | if (source == snapobjectButton) |
---|
2136 | 2453 | { |
---|
2137 | | - //Reload(lastConverter, lastFilename, true); |
---|
2138 | 2454 | SnapObject(); |
---|
2139 | 2455 | } else |
---|
2140 | 2456 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2498 | 2814 | { |
---|
2499 | 2815 | StepAll(); |
---|
2500 | 2816 | } else |
---|
2501 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2817 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2502 | 2818 | { |
---|
2503 | 2819 | //int indices[] = jList.getSelectedIndices(); |
---|
2504 | 2820 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2510 | 2826 | { |
---|
2511 | 2827 | ClearSelection(true); |
---|
2512 | 2828 | } else |
---|
2513 | | - if (source == grabItem) |
---|
| 2829 | + if (source == grabItem || source == groupButton) |
---|
2514 | 2830 | { |
---|
2515 | | - group(new cGroup(), true); |
---|
| 2831 | + group(new cGroup(), false); // true); |
---|
2516 | 2832 | } else |
---|
2517 | 2833 | if (source == hideItem) |
---|
2518 | 2834 | { |
---|
.. | .. |
---|
2530 | 2846 | { |
---|
2531 | 2847 | makeSomething(new Camera()); |
---|
2532 | 2848 | } else |
---|
2533 | | - if (source == compositeItem) |
---|
| 2849 | + if (source == compositeItem || source == compositeButton) |
---|
2534 | 2850 | { |
---|
2535 | 2851 | group(new Composite()); |
---|
2536 | 2852 | } else |
---|
2537 | | - if (source == randomItem) |
---|
| 2853 | + if (source == switchItem || source == switchButton) |
---|
2538 | 2854 | { |
---|
2539 | 2855 | RandomNode random = new RandomNode(); |
---|
2540 | 2856 | group(random); |
---|
.. | .. |
---|
2636 | 2952 | { |
---|
2637 | 2953 | group(new cLinker()); |
---|
2638 | 2954 | } else |
---|
2639 | | - if (source == textureItem) |
---|
| 2955 | + if (source == textureItem || source == textureButton) |
---|
2640 | 2956 | { |
---|
2641 | 2957 | group(new TextureNode()); |
---|
2642 | 2958 | } else |
---|
.. | .. |
---|
2658 | 2974 | } else |
---|
2659 | 2975 | if (source == ungroupItem || source == ungroupButton) |
---|
2660 | 2976 | { |
---|
2661 | | - //ungroup(); |
---|
| 2977 | + boolean hasRoot = false; |
---|
| 2978 | + |
---|
2662 | 2979 | for (int i=0; i<group.selection.size(); i++) |
---|
2663 | 2980 | { |
---|
2664 | | - Ungroup(group.selection.get(i)); |
---|
| 2981 | + if (group.selection.get(i) == group) |
---|
| 2982 | + { |
---|
| 2983 | + hasRoot = true; |
---|
| 2984 | + break; |
---|
| 2985 | + } |
---|
2665 | 2986 | } |
---|
2666 | 2987 | |
---|
2667 | | - ClearSelection(false); |
---|
2668 | | - |
---|
2669 | | - refreshContents(); |
---|
| 2988 | + if (!hasRoot) |
---|
| 2989 | + { |
---|
| 2990 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2991 | + { |
---|
| 2992 | + Ungroup(group.selection.get(i)); |
---|
| 2993 | + } |
---|
| 2994 | + |
---|
| 2995 | + ClearSelection(false); |
---|
| 2996 | + |
---|
| 2997 | + refreshContents(); |
---|
| 2998 | + } |
---|
2670 | 2999 | } else |
---|
2671 | 3000 | if (source == genUVItem) |
---|
2672 | 3001 | { |
---|
.. | .. |
---|
2967 | 3296 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2968 | 3297 | { |
---|
2969 | 3298 | obj = (Object3D)e.nextElement(); |
---|
2970 | | - obj.SetBumpTexture(null); |
---|
| 3299 | + obj.ResetBumpTexture(); |
---|
2971 | 3300 | } |
---|
2972 | 3301 | |
---|
2973 | 3302 | refreshContents(); |
---|
.. | .. |
---|
2981 | 3310 | obj.SetBumpTexture(obj.GetPigmentTexture()); |
---|
2982 | 3311 | } |
---|
2983 | 3312 | |
---|
| 3313 | + refreshContents(); |
---|
| 3314 | + } else |
---|
| 3315 | + if (source == embedTexturesItem) |
---|
| 3316 | + { |
---|
| 3317 | + Object3D obj; |
---|
| 3318 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3319 | + { |
---|
| 3320 | + obj = (Object3D)e.nextElement(); |
---|
| 3321 | + obj.EmbedTextures(true); |
---|
| 3322 | + } |
---|
| 3323 | + |
---|
| 3324 | + refreshContents(); |
---|
| 3325 | + } else |
---|
| 3326 | + if (source == deEmbedTexturesItem) |
---|
| 3327 | + { |
---|
| 3328 | + Object3D obj; |
---|
| 3329 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3330 | + { |
---|
| 3331 | + obj = (Object3D)e.nextElement(); |
---|
| 3332 | + obj.EmbedTextures(false); |
---|
| 3333 | + } |
---|
| 3334 | + |
---|
| 3335 | + CameraPane.texturepigment.clear(); |
---|
| 3336 | + CameraPane.texturebump.clear(); |
---|
| 3337 | + |
---|
2984 | 3338 | refreshContents(); |
---|
2985 | 3339 | } else |
---|
2986 | 3340 | if (source == flashSelectionButton) |
---|
.. | .. |
---|
3084 | 3438 | // centralPanel.setVisible(true); |
---|
3085 | 3439 | // XYZPanel.setVisible(true); |
---|
3086 | 3440 | bigThree.ClearUI(); |
---|
| 3441 | + bigThree.add(scenePanel); |
---|
3087 | 3442 | bigThree.add(centralPanel); |
---|
3088 | | - bigThree.add(XYZPanel); |
---|
3089 | 3443 | bigThree.FlushUI(); |
---|
3090 | 3444 | |
---|
3091 | 3445 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3165 | 3519 | // centralPanel.setVisible(true); |
---|
3166 | 3520 | // XYZPanel.setVisible(false); |
---|
3167 | 3521 | bigThree.ClearUI(); |
---|
3168 | | - bigThree.add(scenePanel); |
---|
3169 | 3522 | bigThree.add(centralPanel); |
---|
| 3523 | + bigThree.add(scenePanel); |
---|
3170 | 3524 | bigThree.FlushUI(); |
---|
3171 | 3525 | |
---|
3172 | 3526 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3258 | 3612 | } else |
---|
3259 | 3613 | if (source == editItem || source == editButton) |
---|
3260 | 3614 | { |
---|
| 3615 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3616 | + { |
---|
| 3617 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3618 | + child.pinned = true; |
---|
| 3619 | + } |
---|
| 3620 | + |
---|
3261 | 3621 | EditSelection(false); |
---|
3262 | 3622 | } else |
---|
3263 | 3623 | if (source == uneditButton) |
---|
.. | .. |
---|
3267 | 3627 | Object3D child = (Object3D)e.nextElement(); |
---|
3268 | 3628 | if(child.editWindow != null) |
---|
3269 | 3629 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3630 | + child.pinned = false; |
---|
3270 | 3631 | child.CloseUI(); |
---|
3271 | 3632 | listUI.remove(child); |
---|
3272 | 3633 | |
---|
.. | .. |
---|
3283 | 3644 | //copy.ClearUI(); |
---|
3284 | 3645 | for (Object3D obj : listUI) |
---|
3285 | 3646 | { |
---|
| 3647 | + obj.pinned = false; |
---|
3286 | 3648 | obj.CloseUI(); |
---|
3287 | 3649 | } |
---|
3288 | 3650 | listUI.clear(); |
---|
.. | .. |
---|
3292 | 3654 | { |
---|
3293 | 3655 | assert(copy == group); |
---|
3294 | 3656 | |
---|
3295 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3657 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3296 | 3658 | |
---|
3297 | 3659 | for (Object3D obj : listUI) |
---|
3298 | 3660 | { |
---|
.. | .. |
---|
3341 | 3703 | } |
---|
3342 | 3704 | |
---|
3343 | 3705 | copy = group; |
---|
| 3706 | + |
---|
| 3707 | + SetUndoStates(); |
---|
| 3708 | + |
---|
3344 | 3709 | //Globals.theRenderer.object = group; |
---|
3345 | 3710 | if(!useclient) |
---|
3346 | 3711 | { |
---|
.. | .. |
---|
3367 | 3732 | currentLayout = sevenButton; |
---|
3368 | 3733 | */ |
---|
3369 | 3734 | radio.layout.doClick(); |
---|
| 3735 | + |
---|
| 3736 | + ClearUnpinned(); |
---|
| 3737 | + //Grafreed.Assert(group != null); |
---|
| 3738 | + //Grafreed.Assert(group.selection != null); |
---|
| 3739 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3740 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3741 | + EditSelection(false); |
---|
3370 | 3742 | keepparent = group.parent; |
---|
3371 | 3743 | // PARENT = NULL or not??? |
---|
3372 | 3744 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3380 | 3752 | cameraView.ProtectCamera(); |
---|
3381 | 3753 | cameraView.repaint(); |
---|
3382 | 3754 | return; |
---|
3383 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3755 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3384 | 3756 | { |
---|
3385 | 3757 | cameraView.RevertCamera(); |
---|
3386 | 3758 | cameraView.repaint(); |
---|
.. | .. |
---|
3959 | 4331 | |
---|
3960 | 4332 | try |
---|
3961 | 4333 | { |
---|
3962 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4334 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
3963 | 4335 | } |
---|
3964 | 4336 | catch (Exception e) |
---|
3965 | 4337 | { |
---|
.. | .. |
---|
4434 | 4806 | // } |
---|
4435 | 4807 | // } |
---|
4436 | 4808 | |
---|
4437 | | - static boolean allparams = true; |
---|
4438 | | - |
---|
4439 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4440 | | - |
---|
4441 | 4809 | void EditSelection(boolean newWindow) |
---|
4442 | 4810 | { |
---|
| 4811 | + if (group.selection == null) |
---|
| 4812 | + { |
---|
| 4813 | + EditElement(group, newWindow); // ? new |
---|
| 4814 | + return; |
---|
| 4815 | + } |
---|
| 4816 | + |
---|
4443 | 4817 | // aConstraints.gridy = 0; |
---|
4444 | 4818 | for (int i=0; i<group.selection.size(); i++) |
---|
4445 | 4819 | { |
---|
.. | .. |
---|
4450 | 4824 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4451 | 4825 | if(elem != group || !newWindow) |
---|
4452 | 4826 | { |
---|
4453 | | - // if (!(elem instanceof Composite)) |
---|
4454 | | - // newWindow = false; |
---|
4455 | | - listUI.add(elem); |
---|
4456 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4457 | | - System.out.println("edit : " + elem); |
---|
4458 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4827 | + EditElement(elem, newWindow); // ? new |
---|
4459 | 4828 | } |
---|
4460 | 4829 | } |
---|
4461 | 4830 | } |
---|
.. | .. |
---|
4530 | 4899 | //new Exception().printStackTrace(); |
---|
4531 | 4900 | |
---|
4532 | 4901 | freezemodel = true; |
---|
4533 | | - |
---|
| 4902 | + ClearUnpinned(); |
---|
| 4903 | + |
---|
4534 | 4904 | /**/ |
---|
4535 | 4905 | //switch (event.id) |
---|
4536 | 4906 | { |
---|
.. | .. |
---|
4563 | 4933 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4564 | 4934 | // a camera |
---|
4565 | 4935 | { |
---|
4566 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4936 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4567 | 4937 | { |
---|
4568 | 4938 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4569 | 4939 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4572 | 4942 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4573 | 4943 | } |
---|
4574 | 4944 | |
---|
| 4945 | + if (tps != null && tps.length == 1) |
---|
| 4946 | + { |
---|
| 4947 | + EditSelection(false); |
---|
| 4948 | + } |
---|
| 4949 | + |
---|
| 4950 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4951 | + |
---|
4575 | 4952 | refreshContents(); |
---|
4576 | 4953 | //return true; |
---|
4577 | 4954 | } |
---|
.. | .. |
---|
4581 | 4958 | freezemodel = false; |
---|
4582 | 4959 | } |
---|
4583 | 4960 | |
---|
| 4961 | + void SetPinStates(boolean enabled) |
---|
| 4962 | + { |
---|
| 4963 | + editButton.setEnabled(enabled); |
---|
| 4964 | + uneditButton.setEnabled(enabled); |
---|
| 4965 | + unselectButton.setEnabled(enabled); |
---|
| 4966 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4967 | + } |
---|
| 4968 | + |
---|
4584 | 4969 | void refreshContents(boolean cp) |
---|
4585 | 4970 | { |
---|
4586 | | - if (!Globals.MOUSEDRAGGED) |
---|
| 4971 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4972 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4587 | 4973 | { |
---|
4588 | 4974 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4589 | 4975 | |
---|
.. | .. |
---|
4682 | 5068 | |
---|
4683 | 5069 | if (cut) |
---|
4684 | 5070 | { |
---|
4685 | | - if (Globals.SAVEONMAKE) |
---|
4686 | | - Save(); |
---|
| 5071 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5072 | +// Save(); |
---|
4687 | 5073 | //int indices[] = jList.getSelectedIndices(); |
---|
4688 | 5074 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4689 | 5075 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4786 | 5172 | |
---|
4787 | 5173 | void paste(boolean expand) |
---|
4788 | 5174 | { |
---|
| 5175 | + if (Globals.REPLACEONMAKE) |
---|
| 5176 | + Save(); |
---|
| 5177 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5178 | + Globals.REPLACEONMAKE = false; |
---|
4789 | 5179 | // if (GrafreeD.clipboard == null) |
---|
4790 | 5180 | // return; |
---|
4791 | 5181 | boolean first = true; |
---|
.. | .. |
---|
4845 | 5235 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4846 | 5236 | } |
---|
4847 | 5237 | |
---|
| 5238 | + Globals.REPLACEONMAKE = keep; |
---|
4848 | 5239 | ResetModel(); |
---|
4849 | 5240 | refreshContents(); |
---|
4850 | 5241 | } |
---|
.. | .. |
---|
4980 | 5371 | |
---|
4981 | 5372 | void group(Object3D csg, boolean grab) |
---|
4982 | 5373 | { |
---|
| 5374 | + if (Globals.REPLACEONMAKE) |
---|
| 5375 | + Save(); |
---|
| 5376 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5377 | + Globals.REPLACEONMAKE = false; |
---|
4983 | 5378 | if (//false) // why?? |
---|
4984 | 5379 | !group.selection.isEmpty()) |
---|
4985 | 5380 | { |
---|
.. | .. |
---|
5093 | 5488 | //node.add(csg); |
---|
5094 | 5489 | //makeSomething(node); |
---|
5095 | 5490 | makeSomething(csg); |
---|
| 5491 | + Globals.REPLACEONMAKE = keep; |
---|
5096 | 5492 | } |
---|
5097 | 5493 | |
---|
5098 | 5494 | void Ungroup(Object3D g) |
---|
5099 | 5495 | { |
---|
| 5496 | + if (Globals.REPLACEONMAKE) |
---|
| 5497 | + Save(); |
---|
| 5498 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5499 | + Globals.REPLACEONMAKE = false; |
---|
5100 | 5500 | if (g instanceof HiddenObject) |
---|
5101 | 5501 | { |
---|
5102 | 5502 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5113 | 5513 | objEditor.makeSomething(g.get(i), false); |
---|
5114 | 5514 | } |
---|
5115 | 5515 | } |
---|
| 5516 | + Globals.REPLACEONMAKE = keep; |
---|
5116 | 5517 | } |
---|
5117 | 5518 | |
---|
5118 | 5519 | void ungroup() |
---|
.. | .. |
---|
5401 | 5802 | cButton clearpanelButton; |
---|
5402 | 5803 | cButton unselectButton; |
---|
5403 | 5804 | |
---|
5404 | | - cButton minButton; |
---|
5405 | | - cButton maxButton; |
---|
5406 | | - cButton fullButton; |
---|
5407 | | - cButton undoButton; |
---|
5408 | | - cButton redoButton; |
---|
| 5805 | + cButton restoreCameraButton; |
---|
| 5806 | + |
---|
5409 | 5807 | cButton saveButton; |
---|
5410 | 5808 | cButton oneStepButton; |
---|
5411 | 5809 | |
---|
5412 | 5810 | cButton groupButton; |
---|
5413 | 5811 | cButton ungroupButton; |
---|
5414 | 5812 | cButton compositeButton; |
---|
| 5813 | + cButton switchButton; |
---|
| 5814 | + cButton loopButton; |
---|
| 5815 | + cButton textureButton; |
---|
| 5816 | + |
---|
| 5817 | + cButton skybox1Button; |
---|
| 5818 | + cButton skybox2Button; |
---|
| 5819 | + cButton skybox3Button; |
---|
| 5820 | + cButton skybox4Button; |
---|
| 5821 | + cButton skybox5Button; |
---|
| 5822 | + cButton skybox6Button; |
---|
| 5823 | + cButton skybox7Button; |
---|
| 5824 | + |
---|
| 5825 | + cButton skybox11Button; |
---|
| 5826 | + cButton skybox12Button; |
---|
| 5827 | + cButton skybox13Button; |
---|
| 5828 | + cButton skybox14Button; |
---|
| 5829 | + cButton skybox15Button; |
---|
| 5830 | + cButton skybox16Button; |
---|
| 5831 | + cButton skybox17Button; |
---|
5415 | 5832 | |
---|
5416 | 5833 | cButton gridButton; |
---|
5417 | 5834 | cButton boxButton; |
---|
.. | .. |
---|
5444 | 5861 | //JTree jTree; |
---|
5445 | 5862 | private MenuItem lookAtItem; |
---|
5446 | 5863 | private MenuItem lookFromItem; |
---|
5447 | | - private MenuItem switchItem; |
---|
| 5864 | + private MenuItem switchViewItem; |
---|
5448 | 5865 | private MenuItem cutItem; |
---|
5449 | 5866 | private MenuItem undoItem; |
---|
5450 | 5867 | private MenuItem redoItem; |
---|
.. | .. |
---|
5476 | 5893 | private MenuItem pasteLinkItem; |
---|
5477 | 5894 | private MenuItem pasteCloneItem; |
---|
5478 | 5895 | private MenuItem pasteExpandItem; |
---|
5479 | | - private MenuItem clearItem; |
---|
| 5896 | + private MenuItem deleteItem; |
---|
5480 | 5897 | private MenuItem clearAllItem; |
---|
5481 | 5898 | private MenuItem genUVItem; |
---|
5482 | 5899 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5536 | 5953 | private MenuItem frontItem; |
---|
5537 | 5954 | private MenuItem cameraItem; |
---|
5538 | 5955 | private MenuItem compositeItem; |
---|
5539 | | - private MenuItem randomItem; |
---|
| 5956 | + private MenuItem switchItem; |
---|
5540 | 5957 | private MenuItem physicsItem; |
---|
5541 | 5958 | private MenuItem frameselectorItem; |
---|
5542 | 5959 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5560 | 5977 | private MenuItem attachBumpItem; |
---|
5561 | 5978 | private MenuItem detachBumpItem; |
---|
5562 | 5979 | private MenuItem pigmentBumpItem; |
---|
| 5980 | + private MenuItem embedTexturesItem; |
---|
| 5981 | + private MenuItem deEmbedTexturesItem; |
---|
5563 | 5982 | |
---|
5564 | 5983 | private MenuItem particleItem; |
---|
5565 | 5984 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5610 | 6029 | |
---|
5611 | 6030 | Menu cameraMenu; |
---|
5612 | 6031 | MenuItem editCameraItem; |
---|
5613 | | - MenuItem revertCameraItem; |
---|
| 6032 | + MenuItem restoreCameraItem; |
---|
5614 | 6033 | } |
---|