.. | .. |
---|
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 | } |
---|
.. | .. |
---|
74 | 80 | this.copy = this.group = copy; |
---|
75 | 81 | //selectees = this.group.selectees; |
---|
76 | 82 | |
---|
| 83 | + if (copy.versions == null) |
---|
| 84 | + { |
---|
| 85 | + copy.versions = new byte[100][]; |
---|
| 86 | + copy.versionindex = -1; |
---|
| 87 | + } |
---|
| 88 | + |
---|
77 | 89 | SetupMenu2(this); //objEditor); |
---|
78 | 90 | SetupUI2(objEditor); |
---|
79 | 91 | objEditor.SetupUI(true); |
---|
.. | .. |
---|
84 | 96 | |
---|
85 | 97 | void CloneSelection(boolean supports) |
---|
86 | 98 | { |
---|
| 99 | + if (Globals.REPLACEONMAKE) |
---|
| 100 | + Save(); |
---|
| 101 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 102 | + Globals.REPLACEONMAKE = false; |
---|
87 | 103 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 104 | //Object3D obj; |
---|
89 | 105 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 110 | |
---|
95 | 111 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 112 | } |
---|
| 113 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 114 | } |
---|
98 | 115 | |
---|
99 | 116 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 167 | |
---|
151 | 168 | void SetupMenu2(GroupEditor oe) |
---|
152 | 169 | { |
---|
| 170 | + oe.jTree = new cTree(); |
---|
| 171 | + |
---|
153 | 172 | Menu menu; |
---|
154 | 173 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 174 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
160 | 179 | // redoItem = menu.add(new MenuItem("Redo")); |
---|
161 | 180 | // redoItem.addActionListener(this); |
---|
162 | 181 | // menu.add("-"); |
---|
163 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 182 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
164 | 183 | duplicateItem.addActionListener(this); |
---|
165 | 184 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
166 | 185 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
187 | 206 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
188 | 207 | // pasteExpandItem.addActionListener(this); |
---|
189 | 208 | menu.add("-"); |
---|
190 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
191 | | - clearItem.addActionListener(this); |
---|
| 209 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 210 | + deleteItem.addActionListener(this); |
---|
192 | 211 | |
---|
193 | 212 | if (Globals.ADVANCED) |
---|
194 | 213 | { |
---|
.. | .. |
---|
202 | 221 | //zBufferItem.addActionListener(this); |
---|
203 | 222 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 223 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
206 | | - revertCameraItem.addActionListener(this); |
---|
| 224 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 225 | + restoreCameraItem.addActionListener(this); |
---|
207 | 226 | |
---|
208 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
209 | | - toggleFullScreenItem.addItemListener(this); |
---|
210 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
211 | | - cameraMenu.add("-"); |
---|
| 227 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 228 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 229 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 230 | +// cameraMenu.add("-"); |
---|
| 231 | +// |
---|
| 232 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 233 | +// toggleTextureItem.addItemListener(this); |
---|
| 234 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 235 | +// |
---|
| 236 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 237 | +// toggleSwitchItem.addItemListener(this); |
---|
| 238 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
212 | 239 | |
---|
213 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
214 | | - toggleTextureItem.addItemListener(this); |
---|
215 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
216 | | - |
---|
217 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
218 | | - toggleSwitchItem.addItemListener(this); |
---|
219 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
220 | | - |
---|
221 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 240 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
222 | 241 | toggleHandleItem.addItemListener(this); |
---|
223 | 242 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
224 | 243 | |
---|
.. | .. |
---|
273 | 292 | { |
---|
274 | 293 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
275 | 294 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
276 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 295 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
277 | 296 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
278 | 297 | oe.cameraMenu.add("-"); |
---|
279 | 298 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
281 | 300 | editLeafItem.addActionListener(this); |
---|
282 | 301 | lookAtItem.addActionListener(this); |
---|
283 | 302 | //lookFromItem.addActinoListener(this); |
---|
284 | | - //switchItem.addActionListener(this); |
---|
| 303 | + //switchViewItem.addActionListener(this); |
---|
285 | 304 | } |
---|
286 | 305 | |
---|
287 | 306 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
326 | 345 | } |
---|
327 | 346 | |
---|
328 | 347 | oe.menuBar.add(menu = new Menu("Group")); |
---|
329 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
330 | | - grabItem.addActionListener(this); |
---|
| 348 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 349 | +// grabItem.addActionListener(this); |
---|
331 | 350 | backItem = menu.add(new MenuItem("Back")); |
---|
332 | 351 | backItem.addActionListener(this); |
---|
333 | 352 | frontItem = menu.add(new MenuItem("Front")); |
---|
334 | 353 | frontItem.addActionListener(this); |
---|
335 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | | - compositeItem.addActionListener(this); |
---|
| 354 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 355 | +// compositeItem.addActionListener(this); |
---|
| 356 | + |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
337 | 359 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 360 | hideItem.addActionListener(this); |
---|
| 361 | + } |
---|
339 | 362 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 363 | ungroupItem.addActionListener(this); |
---|
341 | | - menu.add("-"); |
---|
342 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | | - randomItem.addActionListener(this); |
---|
| 364 | + |
---|
| 365 | +// menu.add("-"); |
---|
| 366 | +// |
---|
| 367 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 368 | +// switchItem.addActionListener(this); |
---|
| 369 | + if (Globals.ADVANCED) |
---|
| 370 | + { |
---|
344 | 371 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 372 | switchGeoItem.addActionListener(this); |
---|
346 | 373 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 375 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 376 | morphItem.addActionListener(this); |
---|
350 | 377 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 378 | menu.add("-"); |
---|
354 | 379 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 380 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
357 | 382 | frameselectorItem.addActionListener(this); |
---|
358 | 383 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
359 | 384 | scriptNodeItem.addActionListener(this); |
---|
360 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
361 | | - cameraItem.addActionListener(this); |
---|
362 | 385 | } |
---|
363 | 386 | |
---|
364 | 387 | oe.menuBar.add(menu = new Menu("Object")); |
---|
365 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
366 | | - textureItem.addActionListener(this); |
---|
| 388 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 389 | +// textureItem.addActionListener(this); |
---|
367 | 390 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
368 | 391 | billboardItem.addActionListener(this); |
---|
369 | 392 | csgItem = menu.add(new MenuItem("CSG")); |
---|
.. | .. |
---|
374 | 397 | shadowYItem.addActionListener(this); |
---|
375 | 398 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 399 | shadowZItem.addActionListener(this); |
---|
| 400 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 401 | + attributeItem.addActionListener(this); |
---|
| 402 | + |
---|
377 | 403 | if (Globals.ADVANCED) |
---|
378 | 404 | { |
---|
379 | 405 | menu.add("-"); |
---|
380 | 406 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
381 | 407 | linkerItem.addActionListener(this); |
---|
382 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
383 | | - attributeItem.addActionListener(this); |
---|
384 | 408 | templateItem = menu.add(new MenuItem("Template")); |
---|
385 | 409 | templateItem.addActionListener(this); |
---|
386 | 410 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
409 | 433 | genNormalsMESHItem.addActionListener(this); |
---|
410 | 434 | if (Globals.ADVANCED) |
---|
411 | 435 | { |
---|
412 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 436 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
413 | 437 | genNormalsMINEItem.addActionListener(this); |
---|
414 | 438 | } |
---|
415 | 439 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
532 | 556 | buildToolsMenu(menu); |
---|
533 | 557 | } |
---|
534 | 558 | |
---|
| 559 | + |
---|
535 | 560 | void SetupUI2(ObjEditor oe) |
---|
536 | 561 | { |
---|
537 | 562 | // June 2019 |
---|
.. | .. |
---|
574 | 599 | oe.radioPanel.add(dummyButton); |
---|
575 | 600 | oe.buttonGroup.add(dummyButton); |
---|
576 | 601 | */ |
---|
| 602 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 603 | + |
---|
| 604 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 605 | + |
---|
577 | 606 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
578 | 607 | |
---|
579 | 608 | //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
580 | 609 | //minButton.setToolTipText("Minimize window"); |
---|
581 | 610 | //minButton.addActionListener(this); |
---|
582 | 611 | |
---|
583 | | - oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
584 | | - maxButton.setToolTipText("Maximize window"); |
---|
585 | | - maxButton.addActionListener(this); |
---|
| 612 | + if (Globals.ADVANCED) |
---|
| 613 | + { |
---|
| 614 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + maxButton.setToolTipText("Maximize window"); |
---|
| 616 | + maxButton.addActionListener(this); |
---|
| 617 | + } |
---|
586 | 618 | |
---|
587 | | - oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
588 | 620 | fullButton.setToolTipText("Full-screen window"); |
---|
589 | 621 | fullButton.addActionListener(this); |
---|
590 | 622 | |
---|
591 | | - oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
592 | | - undoButton.setToolTipText("Undo changes"); |
---|
593 | | - undoButton.addActionListener(this); |
---|
| 623 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 625 | + screenfitButton.addActionListener(this); |
---|
| 626 | + |
---|
| 627 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 629 | + restoreCameraButton.addActionListener(this); |
---|
594 | 630 | |
---|
595 | | - oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | | - redoButton.setToolTipText("Redo changes"); |
---|
597 | | - redoButton.addActionListener(this); |
---|
598 | | - |
---|
599 | | - oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | | - saveButton.setToolTipText("Save changes"); |
---|
| 631 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + saveButton.setToolTipText("New version"); |
---|
601 | 633 | saveButton.addActionListener(this); |
---|
| 634 | + |
---|
| 635 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + undoButton.setToolTipText("Previous version"); |
---|
| 637 | + undoButton.addActionListener(this); |
---|
| 638 | + undoButton.setEnabled(false); |
---|
602 | 639 | |
---|
603 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 640 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 641 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + restoreButton.setToolTipText("Restore current"); |
---|
| 643 | + restoreButton.addActionListener(this); |
---|
| 644 | + restoreButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + replaceButton.setToolTipText("Replace current"); |
---|
| 648 | + replaceButton.addActionListener(this); |
---|
| 649 | + replaceButton.setEnabled(false); |
---|
| 650 | + |
---|
| 651 | + copyOptionsPanel.add(updown); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + redoButton.setToolTipText("Next version"); |
---|
| 655 | + redoButton.addActionListener(this); |
---|
| 656 | + redoButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
604 | 659 | liveCB.setToolTipText("Enable animation"); |
---|
605 | 660 | liveCB.addItemListener(this); |
---|
606 | 661 | |
---|
607 | | - oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | 663 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
609 | 664 | oneStepButton.addActionListener(this); |
---|
610 | 665 | |
---|
611 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 666 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
612 | 667 | fastCB.setToolTipText("Fast mode"); |
---|
613 | 668 | fastCB.addItemListener(this); |
---|
614 | 669 | |
---|
615 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
616 | | - trackCB.setToolTipText("Enable tracking"); |
---|
617 | | - trackCB.addItemListener(this); |
---|
618 | | - |
---|
619 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
620 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
621 | | - screenfitButton.addActionListener(this); |
---|
| 670 | + //oe.toolboxPanel.Return(); |
---|
| 671 | + |
---|
| 672 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 673 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 674 | +// trackCB.addItemListener(this); |
---|
622 | 675 | |
---|
623 | 676 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
624 | 677 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
630 | 683 | snapobjectButton.setToolTipText("Snap Object"); |
---|
631 | 684 | } |
---|
632 | 685 | |
---|
633 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
635 | | - flashSelectionButton.addActionListener(this); |
---|
| 686 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
636 | 687 | |
---|
637 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
638 | | - |
---|
639 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
640 | | - twoButton.setToolTipText("Show center view only"); |
---|
641 | | - twoButton.addActionListener(this); |
---|
642 | 688 | oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
643 | 689 | fourButton.addActionListener(this); |
---|
644 | 690 | fourButton.setToolTipText("Show left panel only"); |
---|
| 691 | + |
---|
| 692 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + twoButton.setToolTipText("Show right view only"); |
---|
| 694 | + twoButton.addActionListener(this); |
---|
| 695 | + this.fullscreenLayout = twoButton; |
---|
| 696 | + |
---|
645 | 697 | oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
646 | | - sixButton.setToolTipText("2-column layout left"); |
---|
| 698 | + sixButton.setToolTipText("Show left and right"); |
---|
647 | 699 | sixButton.addActionListener(this); |
---|
648 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
649 | | - threeButton.setToolTipText("2-column layout right"); |
---|
650 | | - threeButton.addActionListener(this); |
---|
651 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
652 | | - sevenButton.setToolTipText("3-column layout"); |
---|
653 | | - sevenButton.addActionListener(this); |
---|
| 700 | +// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 701 | +// threeButton.setToolTipText("2-column layout right"); |
---|
| 702 | +// threeButton.addActionListener(this); |
---|
| 703 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 704 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 705 | +// sevenButton.addActionListener(this); |
---|
654 | 706 | // |
---|
655 | 707 | |
---|
656 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
657 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 708 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 709 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
658 | 710 | rootButton.addActionListener(this); |
---|
659 | 711 | |
---|
660 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 712 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
661 | 713 | closeButton.setToolTipText("Close tab"); |
---|
662 | 714 | closeButton.addActionListener(this); |
---|
663 | 715 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
664 | 716 | //clearButton.addActionListener(this); |
---|
665 | | - |
---|
666 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
667 | | - editButton.setToolTipText("Edit selection"); |
---|
| 717 | + |
---|
| 718 | + // INSERT |
---|
| 719 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 720 | + gridButton.setToolTipText("Create grid"); |
---|
| 721 | + gridButton.addActionListener(this); |
---|
| 722 | + |
---|
| 723 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 724 | + boxButton.setToolTipText("Create box"); |
---|
| 725 | + boxButton.addActionListener(this); |
---|
| 726 | + |
---|
| 727 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 728 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 729 | + sphereButton.addActionListener(this); |
---|
| 730 | + |
---|
| 731 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 732 | + coneButton.setToolTipText("Create cone"); |
---|
| 733 | + coneButton.addActionListener(this); |
---|
| 734 | + |
---|
| 735 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 736 | + torusButton.setToolTipText("Create torus"); |
---|
| 737 | + torusButton.addActionListener(this); |
---|
| 738 | + |
---|
| 739 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 740 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 741 | + superButton.addActionListener(this); |
---|
| 742 | + |
---|
| 743 | + if (Globals.ADVANCED) |
---|
| 744 | + { |
---|
| 745 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 746 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 747 | + kleinButton.addActionListener(this); |
---|
| 748 | + } |
---|
| 749 | + |
---|
| 750 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 751 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 752 | + particlesButton.addActionListener(this); |
---|
| 753 | + |
---|
| 754 | + oe.toolboxPanel.Return(); |
---|
| 755 | + |
---|
| 756 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 757 | + groupButton.setToolTipText("Create group"); |
---|
| 758 | + groupButton.addActionListener(this); |
---|
| 759 | + |
---|
| 760 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 761 | + compositeButton.setToolTipText("Create composite"); |
---|
| 762 | + compositeButton.addActionListener(this); |
---|
| 763 | + |
---|
| 764 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 765 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 766 | + switchButton.addActionListener(this); |
---|
| 767 | + |
---|
| 768 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 769 | + loopButton.setToolTipText("Create loop"); |
---|
| 770 | + loopButton.addActionListener(this); |
---|
| 771 | + |
---|
| 772 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 773 | + textureButton.setToolTipText("Create texture"); |
---|
| 774 | + textureButton.addActionListener(this); |
---|
| 775 | + |
---|
| 776 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 777 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 778 | + overlayButton.addActionListener(this); |
---|
| 779 | + |
---|
| 780 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 781 | + lightButton.setToolTipText("Create light"); |
---|
| 782 | + lightButton.addActionListener(this); |
---|
| 783 | + |
---|
| 784 | + for (int i=6; --i>=0;) |
---|
| 785 | + { |
---|
| 786 | + oe.toolboxPanel.Return(); |
---|
| 787 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 788 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 789 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 790 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 791 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 792 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 793 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 794 | + } |
---|
| 795 | + |
---|
| 796 | + // EDIT panel |
---|
| 797 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 798 | + editButton.setToolTipText("Pin selection controls"); |
---|
668 | 799 | editButton.addActionListener(this); |
---|
669 | 800 | |
---|
670 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
671 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 801 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 802 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
672 | 803 | uneditButton.addActionListener(this); |
---|
673 | 804 | |
---|
674 | 805 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
675 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 806 | + allParamsButton.setToolTipText("Show all controle"); |
---|
676 | 807 | allParamsButton.addActionListener(this); |
---|
677 | 808 | |
---|
678 | 809 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
683 | 814 | unselectButton.setToolTipText("Unselect"); |
---|
684 | 815 | unselectButton.addActionListener(this); |
---|
685 | 816 | |
---|
| 817 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 818 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 819 | + flashSelectionButton.addActionListener(this); |
---|
| 820 | + |
---|
686 | 821 | editCommandsPanel.preferredHeight = 1; |
---|
687 | 822 | |
---|
| 823 | + SetPinStates(false); |
---|
688 | 824 | // oe.treePanel.add(commandsPanel); |
---|
689 | 825 | // oe.treePanel.Return(); |
---|
690 | 826 | |
---|
.. | .. |
---|
703 | 839 | |
---|
704 | 840 | JScrollPane jSP; |
---|
705 | 841 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
706 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 842 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
707 | 843 | ResetModel(); |
---|
708 | 844 | |
---|
709 | 845 | oe.treePanel.add(jSPPanel); |
---|
710 | 846 | oe.treePanel.Return(); |
---|
711 | 847 | |
---|
712 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
713 | | - |
---|
714 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
715 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
716 | | - colorCB.addItemListener(this); |
---|
717 | | - |
---|
718 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
719 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
720 | | - materialCB.addItemListener(this); |
---|
721 | | - |
---|
722 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
723 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
724 | | - textureCB.addItemListener(this); |
---|
725 | | - |
---|
726 | | - copyOptionsPanel.preferredHeight = 1; |
---|
727 | 848 | oe.treePanel.add(copyOptionsPanel); |
---|
728 | 849 | oe.treePanel.Return(); |
---|
| 850 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 851 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 852 | + sliderPane.preferredHeight = 1; |
---|
729 | 853 | |
---|
730 | 854 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
731 | 855 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
748 | 872 | dgr.addDragGestureListener(this); |
---|
749 | 873 | }catch(Exception e) {} |
---|
750 | 874 | */ |
---|
751 | | - radio.layout = sevenButton; |
---|
| 875 | + radio.layout = sixButton; // sevenButton; |
---|
752 | 876 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
753 | 877 | } |
---|
754 | 878 | |
---|
755 | 879 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
756 | 880 | { |
---|
| 881 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 882 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 883 | + colorCB.addItemListener(this); |
---|
| 884 | + |
---|
| 885 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 886 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 887 | + materialCB.addItemListener(this); |
---|
| 888 | + |
---|
| 889 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 890 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 891 | + textureCB.addItemListener(this); |
---|
| 892 | + |
---|
| 893 | + panel.Return(); |
---|
| 894 | + |
---|
757 | 895 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
758 | 896 | boxCB.setToolTipText("Display bounding boxes"); |
---|
759 | 897 | boxCB.addItemListener(this); |
---|
760 | 898 | |
---|
761 | 899 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
762 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 900 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
763 | 901 | zoomBoxCB.addItemListener(this); |
---|
764 | 902 | |
---|
765 | 903 | if (true) // Globals.ADVANCED) |
---|
766 | 904 | { |
---|
767 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
768 | | - supportCB.setToolTipText("Enable rigging"); |
---|
769 | | - supportCB.addItemListener(this); |
---|
| 905 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 906 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 907 | +// supportCB.addItemListener(this); |
---|
| 908 | + |
---|
| 909 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 910 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 911 | + freezeCB.addItemListener(this); |
---|
770 | 912 | |
---|
771 | 913 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
772 | 914 | // localCB.addItemListener(this); |
---|
773 | 915 | |
---|
| 916 | + panel.Return(); |
---|
| 917 | + |
---|
774 | 918 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
775 | 919 | crowdCB.setToolTipText("Used for crowds"); |
---|
776 | 920 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
787 | 931 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
788 | 932 | // speakerMocapCB.addItemListener(this); |
---|
789 | 933 | |
---|
| 934 | + panel.Return(); |
---|
| 935 | + |
---|
790 | 936 | if (false) |
---|
791 | 937 | { |
---|
792 | 938 | // handled in scripts |
---|
.. | .. |
---|
801 | 947 | //constraints.gridy += 1; |
---|
802 | 948 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
803 | 949 | smoothfocusCB.addItemListener(this); |
---|
| 950 | + panel.Return(); |
---|
804 | 951 | } |
---|
805 | 952 | |
---|
806 | 953 | //constraints.gridx += 1; |
---|
807 | 954 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
808 | 955 | // debugCB.addItemListener(this); |
---|
809 | 956 | |
---|
| 957 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 958 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 959 | + trackCB.addItemListener(this); |
---|
| 960 | + |
---|
810 | 961 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
811 | | - oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 962 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
812 | 963 | oeilCB.addItemListener(this); |
---|
813 | 964 | |
---|
814 | 965 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
815 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 966 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
816 | 967 | shadowCB.addItemListener(this); |
---|
817 | 968 | |
---|
| 969 | + panel.Return(); |
---|
| 970 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 971 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 972 | + toggleTextureCB.addItemListener(this); |
---|
| 973 | + |
---|
| 974 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 975 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 976 | + toggleSwitchCB.addItemListener(this); |
---|
| 977 | + |
---|
| 978 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 979 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 980 | + autokeepCB.addItemListener(this); |
---|
| 981 | + |
---|
| 982 | + panel.Return(); |
---|
818 | 983 | if (Globals.ADVANCED) |
---|
819 | 984 | { |
---|
820 | 985 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
.. | .. |
---|
825 | 990 | } |
---|
826 | 991 | |
---|
827 | 992 | cGridBag fill = new cGridBag(); |
---|
828 | | - |
---|
829 | 993 | fill.preferredHeight = 200; |
---|
| 994 | + cGridBag fill2 = new cGridBag(); |
---|
| 995 | + fill2.preferredHeight = 200; |
---|
| 996 | + cGridBag fill3 = new cGridBag(); |
---|
| 997 | + fill3.preferredHeight = 200; |
---|
830 | 998 | |
---|
831 | 999 | panel.add(fill); |
---|
| 1000 | + panel.add(fill2); |
---|
| 1001 | + panel.add(fill3); |
---|
832 | 1002 | |
---|
833 | 1003 | } |
---|
834 | 1004 | |
---|
.. | .. |
---|
836 | 1006 | { |
---|
837 | 1007 | cRadio radioButton = new cRadio(obj.name); |
---|
838 | 1008 | |
---|
839 | | - // Patch to avoid bug with transparency. |
---|
| 1009 | + // June 2019. Patch to avoid bug with transparency. |
---|
840 | 1010 | radioButton.hadMaterial = obj.material != null; |
---|
841 | 1011 | if (!radioButton.hadMaterial) |
---|
842 | 1012 | { |
---|
.. | .. |
---|
844 | 1014 | } |
---|
845 | 1015 | |
---|
846 | 1016 | radioButton.SetObject(obj); |
---|
847 | | - radioButton.layout = sevenButton; |
---|
| 1017 | + radioButton.layout = sixButton; // sevenButton; |
---|
848 | 1018 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
849 | 1019 | radioButton.addActionListener(this); |
---|
850 | 1020 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
864 | 1034 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
865 | 1035 | } |
---|
866 | 1036 | |
---|
867 | | - JCheckBox liveCB; |
---|
868 | | - JCheckBox supportCB; |
---|
869 | | - JCheckBox localCB; |
---|
870 | | - JCheckBox crowdCB; |
---|
871 | | - JCheckBox smoothCB; |
---|
872 | | - JCheckBox fastCB; |
---|
873 | | - JCheckBox slowCB; |
---|
874 | | - JCheckBox boxCB; |
---|
875 | | - JCheckBox zoomBoxCB; |
---|
876 | | - JCheckBox trackCB; |
---|
877 | | - JCheckBox smoothfocusCB; |
---|
| 1037 | + cToggleButton liveCB; |
---|
| 1038 | + cCheckBox supportCB; |
---|
| 1039 | + cCheckBox localCB; |
---|
| 1040 | + cCheckBox crowdCB; |
---|
| 1041 | + cCheckBox smoothCB; |
---|
| 1042 | + cToggleButton fastCB; |
---|
| 1043 | + cCheckBox slowCB; |
---|
| 1044 | + cCheckBox boxCB; |
---|
| 1045 | + cCheckBox zoomBoxCB; |
---|
| 1046 | + cCheckBox freezeCB; |
---|
| 1047 | + //cToggleButton trackCB; |
---|
| 1048 | + cCheckBox trackCB; |
---|
| 1049 | + cCheckBox smoothfocusCB; |
---|
878 | 1050 | // JCheckBox speakerMocapCB; |
---|
879 | | - JCheckBox speakerCameraCB; |
---|
880 | | - JCheckBox speakerFocusCB; |
---|
881 | | - JCheckBox debugCB; |
---|
| 1051 | + cCheckBox speakerCameraCB; |
---|
| 1052 | + cCheckBox speakerFocusCB; |
---|
| 1053 | + cCheckBox debugCB; |
---|
882 | 1054 | |
---|
883 | | - JCheckBox oeilCB; |
---|
884 | | - JCheckBox shadowCB; |
---|
885 | | - JCheckBox lookAtCB; |
---|
| 1055 | + cCheckBox oeilCB; |
---|
| 1056 | + cCheckBox shadowCB; |
---|
| 1057 | + cCheckBox autokeepCB; |
---|
| 1058 | + cCheckBox lookAtCB; |
---|
886 | 1059 | |
---|
887 | 1060 | // static int COLOR = 1; |
---|
888 | 1061 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
890 | 1063 | |
---|
891 | 1064 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
892 | 1065 | |
---|
893 | | - JCheckBox colorCB; |
---|
894 | | - JCheckBox materialCB; |
---|
895 | | - JCheckBox textureCB; |
---|
| 1066 | + cCheckBox colorCB; |
---|
| 1067 | + cCheckBox materialCB; |
---|
| 1068 | + cCheckBox textureCB; |
---|
896 | 1069 | |
---|
897 | 1070 | public void itemStateChanged(ItemEvent e) |
---|
898 | 1071 | { |
---|
.. | .. |
---|
989 | 1162 | { |
---|
990 | 1163 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
991 | 1164 | } |
---|
| 1165 | + else if(e.getSource() == freezeCB) |
---|
| 1166 | + { |
---|
| 1167 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1168 | + } |
---|
| 1169 | + else if(e.getSource() == autokeepCB) |
---|
| 1170 | + { |
---|
| 1171 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1172 | + } |
---|
992 | 1173 | else if(e.getSource() == lookAtCB) |
---|
993 | 1174 | { |
---|
994 | 1175 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
1005 | 1186 | |
---|
1006 | 1187 | /**/ |
---|
1007 | 1188 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
1008 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1189 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1190 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
1009 | 1191 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
1010 | 1192 | // We can't move the root node or an empty selection |
---|
1011 | 1193 | return; |
---|
.. | .. |
---|
1068 | 1250 | } |
---|
1069 | 1251 | } |
---|
1070 | 1252 | |
---|
1071 | | - String string = (String) object; |
---|
1072 | | - |
---|
1073 | 1253 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1074 | 1254 | // if( object instanceof java.io.File[]) |
---|
1075 | 1255 | // { |
---|
.. | .. |
---|
1077 | 1257 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1078 | 1258 | // return; |
---|
1079 | 1259 | // } |
---|
| 1260 | + |
---|
| 1261 | + String string = object.toString(); |
---|
1080 | 1262 | |
---|
1081 | 1263 | // File path for Mac and Windows |
---|
1082 | 1264 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1122 | 1304 | |
---|
1123 | 1305 | assert target == objEditor.jTree; |
---|
1124 | 1306 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1307 | + Object3D destinationLeaf; |
---|
1125 | 1308 | try { |
---|
1126 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1309 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1127 | 1310 | } catch (Exception e) { |
---|
1128 | 1311 | System.out.println("destinationPath : " + destinationPath); |
---|
1129 | 1312 | return; |
---|
1130 | 1313 | } |
---|
1131 | 1314 | |
---|
1132 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1315 | + for (int i=group.selection.size(); --i>=0;) |
---|
1133 | 1316 | { |
---|
| 1317 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1318 | + |
---|
| 1319 | + // Cannot move into itself |
---|
| 1320 | + if (child == destinationLeaf) |
---|
| 1321 | + return; |
---|
| 1322 | + } |
---|
| 1323 | + |
---|
| 1324 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1325 | +// { |
---|
1134 | 1326 | loadClipboard(true); |
---|
1135 | 1327 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1136 | 1328 | pasteInto(false, false); |
---|
1137 | | - } else { |
---|
1138 | | - loadClipboard(false); |
---|
1139 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1140 | | - pasteInto(false, false); // true); // ??? |
---|
1141 | | - } |
---|
| 1329 | +// } else { |
---|
| 1330 | +// loadClipboard(false); |
---|
| 1331 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1332 | +// pasteInto(false, false); // true); // ??? |
---|
| 1333 | +// } |
---|
1142 | 1334 | } |
---|
1143 | 1335 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1144 | 1336 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1243 | 1435 | { |
---|
1244 | 1436 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1245 | 1437 | //heightFieldItem.addActionListener(this); |
---|
1246 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1247 | | - gridItem.addActionListener(this); |
---|
1248 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1249 | | - rectoidItem.addActionListener(this); |
---|
1250 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1251 | | - ellipsoidItem.addActionListener(this); |
---|
1252 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1253 | | - coneItem.addActionListener(this); |
---|
1254 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1255 | | - torusItem.addActionListener(this); |
---|
1256 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1257 | | - superItem.addActionListener(this); |
---|
| 1438 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1439 | +// gridItem.addActionListener(this); |
---|
| 1440 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1441 | +// rectoidItem.addActionListener(this); |
---|
| 1442 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1443 | +// ellipsoidItem.addActionListener(this); |
---|
| 1444 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1445 | +// coneItem.addActionListener(this); |
---|
| 1446 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1447 | +// torusItem.addActionListener(this); |
---|
| 1448 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1449 | +// superItem.addActionListener(this); |
---|
| 1450 | + |
---|
| 1451 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1452 | + cameraItem.addActionListener(this); |
---|
| 1453 | + |
---|
| 1454 | + if (!Globals.ADVANCED) |
---|
| 1455 | + { |
---|
1258 | 1456 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1259 | 1457 | kleinItem.addActionListener(this); |
---|
1260 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1261 | | - particleItem.addActionListener(this); |
---|
| 1458 | + } |
---|
| 1459 | + |
---|
| 1460 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1461 | +// particleItem.addActionListener(this); |
---|
1262 | 1462 | if (Globals.ADVANCED) |
---|
1263 | 1463 | { |
---|
1264 | 1464 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1284 | 1484 | } |
---|
1285 | 1485 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1286 | 1486 | bezierItem.addActionListener(this); |
---|
1287 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1288 | | - overlayItem.addActionListener(this); |
---|
1289 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1290 | | - lightItem.addActionListener(this); |
---|
| 1487 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1488 | +// overlayItem.addActionListener(this); |
---|
| 1489 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1490 | +// lightItem.addActionListener(this); |
---|
1291 | 1491 | menu.add("-"); |
---|
1292 | 1492 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1293 | 1493 | //superLoopItem.addActionListener(this); |
---|
1294 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1295 | | - loopItem.addActionListener(this); |
---|
| 1494 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1495 | +// loopItem.addActionListener(this); |
---|
1296 | 1496 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1297 | 1497 | doubleItem.addActionListener(this); |
---|
1298 | 1498 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1308 | 1508 | animationItem.addItemListener(this); |
---|
1309 | 1509 | animationItem.setState(Globals.ANIMATION); |
---|
1310 | 1510 | |
---|
| 1511 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1512 | + archiveItem.addActionListener(this); |
---|
| 1513 | + |
---|
1311 | 1514 | menu.add("-"); |
---|
1312 | 1515 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1313 | 1516 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1320 | 1523 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1321 | 1524 | reduce34MorphItem.addActionListener(this); |
---|
1322 | 1525 | menu.add("-"); |
---|
| 1526 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1527 | + memoryItem.addActionListener(this); |
---|
1323 | 1528 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1324 | 1529 | computeAOItem.addActionListener(this); |
---|
1325 | 1530 | |
---|
.. | .. |
---|
1328 | 1533 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1329 | 1534 | mirrorItem.addActionListener(this); |
---|
1330 | 1535 | menu.add("-"); |
---|
1331 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1332 | | - memoryItem.addActionListener(this); |
---|
1333 | 1536 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1334 | 1537 | analyzeItem.addActionListener(this); |
---|
1335 | 1538 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1477 | 1680 | |
---|
1478 | 1681 | makeSomething(shadow); |
---|
1479 | 1682 | } |
---|
| 1683 | + |
---|
| 1684 | + private void ClearUnpinned() |
---|
| 1685 | + { |
---|
| 1686 | + //for (Object3D obj : listUI) |
---|
| 1687 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1688 | + { |
---|
| 1689 | + Object3D obj = listUI.elementAt(i); |
---|
| 1690 | + if (!obj.pinned) |
---|
| 1691 | + { |
---|
| 1692 | + obj.CloseUI(); |
---|
| 1693 | + listUI.remove(i); |
---|
| 1694 | + } |
---|
| 1695 | + } |
---|
| 1696 | + } |
---|
| 1697 | + |
---|
| 1698 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1699 | + { |
---|
| 1700 | + // if (!(elem instanceof Composite)) |
---|
| 1701 | + // newWindow = false; |
---|
| 1702 | + listUI.add(elem); |
---|
| 1703 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1704 | + System.out.println("edit : " + elem); |
---|
| 1705 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1706 | + } |
---|
1480 | 1707 | |
---|
1481 | 1708 | /** |
---|
1482 | 1709 | * applyExample |
---|
.. | .. |
---|
1721 | 1948 | { |
---|
1722 | 1949 | ScreenFit(); |
---|
1723 | 1950 | } else |
---|
1724 | | - if (source == switchItem) |
---|
| 1951 | + if (source == switchViewItem) |
---|
1725 | 1952 | { |
---|
1726 | 1953 | cVector v1 = new cVector(); |
---|
1727 | 1954 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1730 | 1957 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1731 | 1958 | objEditor.cameraView.repaint(); |
---|
1732 | 1959 | } else |
---|
1733 | | - if (source == rectoidItem) |
---|
| 1960 | + if (source == rectoidItem || source == boxButton) |
---|
1734 | 1961 | { |
---|
1735 | 1962 | makeSomething(new Box()); |
---|
1736 | 1963 | } else |
---|
1737 | | - if (source == particleItem) |
---|
| 1964 | + if (source == particleItem || source == particlesButton) |
---|
1738 | 1965 | { |
---|
1739 | 1966 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1740 | 1967 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1813 | 2040 | |
---|
1814 | 2041 | makeSomething(obj); |
---|
1815 | 2042 | } else |
---|
1816 | | - if (source == gridItem) |
---|
| 2043 | + if (source == gridItem || source == gridButton) |
---|
1817 | 2044 | { |
---|
1818 | 2045 | makeSomething(new Grid()); |
---|
1819 | 2046 | } else |
---|
1820 | | - if (source == ellipsoidItem) |
---|
| 2047 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1821 | 2048 | { |
---|
1822 | 2049 | makeSomething(new Sphere()); |
---|
1823 | 2050 | } else |
---|
1824 | | - if (source == coneItem) |
---|
| 2051 | + if (source == coneItem || source == coneButton) |
---|
1825 | 2052 | { |
---|
1826 | 2053 | makeSomething(new Cone()); |
---|
1827 | 2054 | } else |
---|
1828 | | - if (source == torusItem) |
---|
| 2055 | + if (source == torusItem || source == torusButton) |
---|
1829 | 2056 | { |
---|
1830 | 2057 | makeSomething(new Torus()); |
---|
1831 | 2058 | } else |
---|
1832 | | - if (source == superItem) |
---|
| 2059 | + if (source == superItem || source == superButton) |
---|
1833 | 2060 | { |
---|
1834 | 2061 | makeSomething(new Superellipsoid()); |
---|
1835 | 2062 | } else |
---|
1836 | | - if (source == kleinItem) |
---|
| 2063 | + if (source == kleinItem || source == kleinButton) |
---|
1837 | 2064 | { |
---|
1838 | 2065 | makeSomething(new Klein()); |
---|
1839 | 2066 | } else |
---|
.. | .. |
---|
1853 | 2080 | { |
---|
1854 | 2081 | makeSomething(new BezierSurface()); |
---|
1855 | 2082 | } else |
---|
1856 | | - if (source == overlayItem) |
---|
| 2083 | + if (source == overlayItem || source == overlayButton) |
---|
1857 | 2084 | { |
---|
1858 | 2085 | /* |
---|
1859 | 2086 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1901 | 2128 | s.setup(); |
---|
1902 | 2129 | makeSomething(s); |
---|
1903 | 2130 | } else |
---|
1904 | | - if (source == lightItem) |
---|
| 2131 | + if (source == lightItem || source == lightButton) |
---|
1905 | 2132 | { |
---|
1906 | 2133 | makeSomething(new Light()); |
---|
1907 | 2134 | } else |
---|
.. | .. |
---|
1951 | 2178 | |
---|
1952 | 2179 | group(g); |
---|
1953 | 2180 | } else |
---|
1954 | | - if (source == loopItem) |
---|
| 2181 | + if (source == loopItem || source == loopButton) |
---|
1955 | 2182 | { |
---|
1956 | 2183 | Composite csg = new GroupLeaf(); |
---|
1957 | 2184 | csg.count = 5; |
---|
1958 | 2185 | group(csg); |
---|
1959 | | - Composite child = new cGroup(); |
---|
| 2186 | + Composite child = new cGroup("Branch"); |
---|
1960 | 2187 | csg.addChild(child); |
---|
1961 | 2188 | child.addChild(csg); |
---|
1962 | 2189 | } else |
---|
1963 | 2190 | if (source == doubleItem) |
---|
1964 | 2191 | { |
---|
1965 | | - Composite csg = new GroupLeaf(); |
---|
| 2192 | + Composite csg = new GroupLeaf("Fork"); |
---|
1966 | 2193 | csg.count = 5; |
---|
1967 | 2194 | group(csg); |
---|
1968 | | - Composite child = new cGroup(); |
---|
| 2195 | + Composite child = new cGroup("Branch A"); |
---|
1969 | 2196 | csg.addChild(child); |
---|
1970 | 2197 | child.addChild(csg); |
---|
1971 | | - child = new cGroup(); |
---|
| 2198 | + child = new cGroup("Branch B"); |
---|
1972 | 2199 | csg.addChild(child); |
---|
1973 | 2200 | child.addChild(csg); |
---|
1974 | 2201 | } else |
---|
1975 | 2202 | if (source == tripleItem) |
---|
1976 | 2203 | { |
---|
1977 | | - Composite csg = new GroupLeaf(); |
---|
| 2204 | + Composite csg = new GroupLeaf("Trident"); |
---|
1978 | 2205 | csg.count = 4; |
---|
1979 | 2206 | group(csg); |
---|
1980 | 2207 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2038 | 2265 | } else |
---|
2039 | 2266 | if (source == undoButton) |
---|
2040 | 2267 | { |
---|
| 2268 | + // Go to previous version |
---|
| 2269 | + //if (!Undo()) |
---|
| 2270 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2041 | 2271 | Undo(); |
---|
| 2272 | + } else |
---|
| 2273 | + if (source == restoreButton) |
---|
| 2274 | + { |
---|
| 2275 | + // Restore current version |
---|
| 2276 | + Restore(); |
---|
| 2277 | + } else |
---|
| 2278 | + if (source == replaceButton) |
---|
| 2279 | + { |
---|
| 2280 | + // Overwrite current version |
---|
| 2281 | + Replace(); |
---|
2042 | 2282 | } else |
---|
2043 | 2283 | if (source == redoButton) |
---|
2044 | 2284 | { |
---|
| 2285 | + // Go to next version |
---|
2045 | 2286 | Redo(); |
---|
2046 | 2287 | } else |
---|
2047 | 2288 | if (source == saveButton) |
---|
2048 | 2289 | { |
---|
2049 | | - Save(); |
---|
| 2290 | + // Save a new version |
---|
| 2291 | + if (!Save(true)) |
---|
| 2292 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2050 | 2293 | } else |
---|
2051 | 2294 | if (source == oneStepButton) |
---|
2052 | 2295 | { |
---|
.. | .. |
---|
2055 | 2298 | } else |
---|
2056 | 2299 | if (source == screenfitButton) |
---|
2057 | 2300 | { |
---|
2058 | | - //Reload(lastConverter, lastFilename, true); |
---|
2059 | 2301 | ScreenFit(); |
---|
2060 | 2302 | } else |
---|
2061 | 2303 | if (source == screenfitpointButton) |
---|
2062 | 2304 | { |
---|
2063 | | - //Reload(lastConverter, lastFilename, true); |
---|
2064 | 2305 | ScreenFitPoint(); |
---|
2065 | 2306 | } else |
---|
2066 | 2307 | if (source == snapobjectButton) |
---|
2067 | 2308 | { |
---|
2068 | | - //Reload(lastConverter, lastFilename, true); |
---|
2069 | 2309 | SnapObject(); |
---|
2070 | 2310 | } else |
---|
2071 | 2311 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2429 | 2669 | { |
---|
2430 | 2670 | StepAll(); |
---|
2431 | 2671 | } else |
---|
2432 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2672 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2433 | 2673 | { |
---|
2434 | 2674 | //int indices[] = jList.getSelectedIndices(); |
---|
2435 | 2675 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2441 | 2681 | { |
---|
2442 | 2682 | ClearSelection(true); |
---|
2443 | 2683 | } else |
---|
2444 | | - if (source == grabItem) |
---|
| 2684 | + if (source == grabItem || source == groupButton) |
---|
2445 | 2685 | { |
---|
2446 | | - group(new cGroup(), true); |
---|
| 2686 | + group(new cGroup(), false); // true); |
---|
2447 | 2687 | } else |
---|
2448 | 2688 | if (source == hideItem) |
---|
2449 | 2689 | { |
---|
.. | .. |
---|
2461 | 2701 | { |
---|
2462 | 2702 | makeSomething(new Camera()); |
---|
2463 | 2703 | } else |
---|
2464 | | - if (source == compositeItem) |
---|
| 2704 | + if (source == compositeItem || source == compositeButton) |
---|
2465 | 2705 | { |
---|
2466 | 2706 | group(new Composite()); |
---|
2467 | 2707 | } else |
---|
2468 | | - if (source == randomItem) |
---|
| 2708 | + if (source == switchItem || source == switchButton) |
---|
2469 | 2709 | { |
---|
2470 | 2710 | RandomNode random = new RandomNode(); |
---|
2471 | 2711 | group(random); |
---|
.. | .. |
---|
2567 | 2807 | { |
---|
2568 | 2808 | group(new cLinker()); |
---|
2569 | 2809 | } else |
---|
2570 | | - if (source == textureItem) |
---|
| 2810 | + if (source == textureItem || source == textureButton) |
---|
2571 | 2811 | { |
---|
2572 | 2812 | group(new TextureNode()); |
---|
2573 | 2813 | } else |
---|
.. | .. |
---|
2587 | 2827 | { |
---|
2588 | 2828 | CastShadow(2); |
---|
2589 | 2829 | } else |
---|
2590 | | - if (source == ungroupItem) |
---|
| 2830 | + if (source == ungroupItem || source == ungroupButton) |
---|
2591 | 2831 | { |
---|
2592 | | - //ungroup(); |
---|
| 2832 | + boolean hasRoot = false; |
---|
| 2833 | + |
---|
2593 | 2834 | for (int i=0; i<group.selection.size(); i++) |
---|
2594 | 2835 | { |
---|
2595 | | - Ungroup(group.selection.get(i)); |
---|
| 2836 | + if (group.selection.get(i) == group) |
---|
| 2837 | + { |
---|
| 2838 | + hasRoot = true; |
---|
| 2839 | + break; |
---|
| 2840 | + } |
---|
2596 | 2841 | } |
---|
2597 | 2842 | |
---|
2598 | | - ClearSelection(false); |
---|
2599 | | - |
---|
2600 | | - refreshContents(); |
---|
| 2843 | + if (!hasRoot) |
---|
| 2844 | + { |
---|
| 2845 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2846 | + { |
---|
| 2847 | + Ungroup(group.selection.get(i)); |
---|
| 2848 | + } |
---|
| 2849 | + |
---|
| 2850 | + ClearSelection(false); |
---|
| 2851 | + |
---|
| 2852 | + refreshContents(); |
---|
| 2853 | + } |
---|
2601 | 2854 | } else |
---|
2602 | 2855 | if (source == genUVItem) |
---|
2603 | 2856 | { |
---|
.. | .. |
---|
2925 | 3178 | if (source == twoButton) |
---|
2926 | 3179 | { |
---|
2927 | 3180 | radio.layout = twoButton; |
---|
| 3181 | + |
---|
| 3182 | + if (CameraPane.FULLSCREEN) |
---|
| 3183 | + fullscreenLayout = radio.layout; |
---|
| 3184 | + |
---|
2928 | 3185 | // bug |
---|
2929 | 3186 | //gridPanel.setDividerLocation(1.0); |
---|
2930 | 3187 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2980 | 3237 | { |
---|
2981 | 3238 | radio.layout = threeButton; |
---|
2982 | 3239 | |
---|
| 3240 | + if (CameraPane.FULLSCREEN) |
---|
| 3241 | + fullscreenLayout = radio.layout; |
---|
| 3242 | + |
---|
2983 | 3243 | // bigThree.remove(scenePanel); |
---|
2984 | 3244 | // bigThree.remove(centralPanel); |
---|
2985 | 3245 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3018 | 3278 | { |
---|
3019 | 3279 | radio.layout = fourButton; |
---|
3020 | 3280 | |
---|
| 3281 | + if (CameraPane.FULLSCREEN) |
---|
| 3282 | + fullscreenLayout = radio.layout; |
---|
| 3283 | + |
---|
3021 | 3284 | // bigThree.remove(scenePanel); |
---|
3022 | 3285 | // bigThree.remove(centralPanel); |
---|
3023 | 3286 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3054 | 3317 | if (source == sixButton) |
---|
3055 | 3318 | { |
---|
3056 | 3319 | radio.layout = sixButton; |
---|
| 3320 | + |
---|
| 3321 | + if (CameraPane.FULLSCREEN) |
---|
| 3322 | + fullscreenLayout = radio.layout; |
---|
3057 | 3323 | |
---|
3058 | 3324 | // bigThree.remove(scenePanel); |
---|
3059 | 3325 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3092 | 3358 | if (source == sevenButton) |
---|
3093 | 3359 | { |
---|
3094 | 3360 | radio.layout = sevenButton; |
---|
| 3361 | + |
---|
| 3362 | + if (CameraPane.FULLSCREEN) |
---|
| 3363 | + fullscreenLayout = radio.layout; |
---|
3095 | 3364 | |
---|
3096 | 3365 | // bigThree.remove(scenePanel); |
---|
3097 | 3366 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3159 | 3428 | buttonGroup.remove(ab); |
---|
3160 | 3429 | radioPanel.remove(ab); |
---|
3161 | 3430 | |
---|
3162 | | - ab.GetObject().editWindow = null; |
---|
| 3431 | + //ab.GetObject().editWindow = null; |
---|
| 3432 | + ab.GetObject().manipWindow = null; |
---|
3163 | 3433 | // ab.GetObject().objectUI = null; // ????????? |
---|
3164 | 3434 | |
---|
3165 | 3435 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
.. | .. |
---|
3172 | 3442 | } else |
---|
3173 | 3443 | if (source == editItem || source == editButton) |
---|
3174 | 3444 | { |
---|
| 3445 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3446 | + { |
---|
| 3447 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3448 | + child.pinned = true; |
---|
| 3449 | + } |
---|
| 3450 | + |
---|
3175 | 3451 | EditSelection(false); |
---|
3176 | 3452 | } else |
---|
3177 | 3453 | if (source == uneditButton) |
---|
.. | .. |
---|
3181 | 3457 | Object3D child = (Object3D)e.nextElement(); |
---|
3182 | 3458 | if(child.editWindow != null) |
---|
3183 | 3459 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3460 | + child.pinned = false; |
---|
3184 | 3461 | child.CloseUI(); |
---|
3185 | 3462 | listUI.remove(child); |
---|
3186 | 3463 | |
---|
.. | .. |
---|
3197 | 3474 | //copy.ClearUI(); |
---|
3198 | 3475 | for (Object3D obj : listUI) |
---|
3199 | 3476 | { |
---|
| 3477 | + obj.pinned = false; |
---|
3200 | 3478 | obj.CloseUI(); |
---|
3201 | 3479 | } |
---|
3202 | 3480 | listUI.clear(); |
---|
.. | .. |
---|
3206 | 3484 | { |
---|
3207 | 3485 | assert(copy == group); |
---|
3208 | 3486 | |
---|
3209 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3487 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3210 | 3488 | |
---|
3211 | 3489 | for (Object3D obj : listUI) |
---|
3212 | 3490 | { |
---|
.. | .. |
---|
3255 | 3533 | } |
---|
3256 | 3534 | |
---|
3257 | 3535 | copy = group; |
---|
| 3536 | + |
---|
| 3537 | + SetUndoStates(); |
---|
| 3538 | + |
---|
3258 | 3539 | //Globals.theRenderer.object = group; |
---|
3259 | 3540 | if(!useclient) |
---|
3260 | 3541 | { |
---|
.. | .. |
---|
3273 | 3554 | |
---|
3274 | 3555 | // fix "+" issue |
---|
3275 | 3556 | //group.editWindow = this; |
---|
| 3557 | + group.manipWindow = this; |
---|
3276 | 3558 | |
---|
3277 | 3559 | /* |
---|
3278 | 3560 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3280 | 3562 | currentLayout = sevenButton; |
---|
3281 | 3563 | */ |
---|
3282 | 3564 | radio.layout.doClick(); |
---|
| 3565 | + |
---|
| 3566 | + ClearUnpinned(); |
---|
| 3567 | + //Grafreed.Assert(group != null); |
---|
| 3568 | + //Grafreed.Assert(group.selection != null); |
---|
| 3569 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3570 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3571 | + EditSelection(false); |
---|
3283 | 3572 | keepparent = group.parent; |
---|
3284 | 3573 | // PARENT = NULL or not??? |
---|
3285 | 3574 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3293 | 3582 | cameraView.ProtectCamera(); |
---|
3294 | 3583 | cameraView.repaint(); |
---|
3295 | 3584 | return; |
---|
3296 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3585 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3297 | 3586 | { |
---|
3298 | 3587 | cameraView.RevertCamera(); |
---|
3299 | 3588 | cameraView.repaint(); |
---|
.. | .. |
---|
4347 | 4636 | // } |
---|
4348 | 4637 | // } |
---|
4349 | 4638 | |
---|
4350 | | - static boolean allparams = true; |
---|
4351 | | - |
---|
4352 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4353 | | - |
---|
4354 | 4639 | void EditSelection(boolean newWindow) |
---|
4355 | 4640 | { |
---|
| 4641 | + if (group.selection == null) |
---|
| 4642 | + { |
---|
| 4643 | + EditElement(group, newWindow); // ? new |
---|
| 4644 | + return; |
---|
| 4645 | + } |
---|
| 4646 | + |
---|
4356 | 4647 | // aConstraints.gridy = 0; |
---|
4357 | 4648 | for (int i=0; i<group.selection.size(); i++) |
---|
4358 | 4649 | { |
---|
4359 | 4650 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4360 | 4651 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4361 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4652 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4362 | 4653 | |
---|
4363 | 4654 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4364 | 4655 | if(elem != group || !newWindow) |
---|
4365 | 4656 | { |
---|
4366 | | - // if (!(elem instanceof Composite)) |
---|
4367 | | - // newWindow = false; |
---|
4368 | | - listUI.add(elem); |
---|
4369 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4370 | | - System.out.println("edit : " + elem); |
---|
4371 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4657 | + EditElement(elem, newWindow); // ? new |
---|
4372 | 4658 | } |
---|
4373 | 4659 | } |
---|
4374 | 4660 | } |
---|
.. | .. |
---|
4443 | 4729 | //new Exception().printStackTrace(); |
---|
4444 | 4730 | |
---|
4445 | 4731 | freezemodel = true; |
---|
4446 | | - |
---|
| 4732 | + ClearUnpinned(); |
---|
| 4733 | + |
---|
4447 | 4734 | /**/ |
---|
4448 | 4735 | //switch (event.id) |
---|
4449 | 4736 | { |
---|
.. | .. |
---|
4476 | 4763 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4477 | 4764 | // a camera |
---|
4478 | 4765 | { |
---|
4479 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4766 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4480 | 4767 | { |
---|
4481 | 4768 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4482 | 4769 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4485 | 4772 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4486 | 4773 | } |
---|
4487 | 4774 | |
---|
| 4775 | + if (tps != null && tps.length == 1) |
---|
| 4776 | + { |
---|
| 4777 | + EditSelection(false); |
---|
| 4778 | + } |
---|
| 4779 | + |
---|
| 4780 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4781 | + |
---|
4488 | 4782 | refreshContents(); |
---|
4489 | 4783 | //return true; |
---|
4490 | 4784 | } |
---|
.. | .. |
---|
4494 | 4788 | freezemodel = false; |
---|
4495 | 4789 | } |
---|
4496 | 4790 | |
---|
| 4791 | + void SetPinStates(boolean enabled) |
---|
| 4792 | + { |
---|
| 4793 | + editButton.setEnabled(enabled); |
---|
| 4794 | + uneditButton.setEnabled(enabled); |
---|
| 4795 | + unselectButton.setEnabled(enabled); |
---|
| 4796 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4797 | + } |
---|
| 4798 | + |
---|
4497 | 4799 | void refreshContents(boolean cp) |
---|
4498 | 4800 | { |
---|
4499 | | - if (!Globals.MOUSEDRAGGED) |
---|
| 4801 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4802 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4500 | 4803 | { |
---|
4501 | 4804 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4502 | 4805 | |
---|
.. | .. |
---|
4595 | 4898 | |
---|
4596 | 4899 | if (cut) |
---|
4597 | 4900 | { |
---|
4598 | | - Save(); |
---|
| 4901 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4902 | +// Save(); |
---|
4599 | 4903 | //int indices[] = jList.getSelectedIndices(); |
---|
4600 | 4904 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4601 | 4905 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4698 | 5002 | |
---|
4699 | 5003 | void paste(boolean expand) |
---|
4700 | 5004 | { |
---|
| 5005 | + if (Globals.REPLACEONMAKE) |
---|
| 5006 | + Save(); |
---|
| 5007 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5008 | + Globals.REPLACEONMAKE = false; |
---|
4701 | 5009 | // if (GrafreeD.clipboard == null) |
---|
4702 | 5010 | // return; |
---|
4703 | 5011 | boolean first = true; |
---|
.. | .. |
---|
4757 | 5065 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4758 | 5066 | } |
---|
4759 | 5067 | |
---|
| 5068 | + Globals.REPLACEONMAKE = keep; |
---|
4760 | 5069 | ResetModel(); |
---|
4761 | 5070 | refreshContents(); |
---|
4762 | 5071 | } |
---|
.. | .. |
---|
4892 | 5201 | |
---|
4893 | 5202 | void group(Object3D csg, boolean grab) |
---|
4894 | 5203 | { |
---|
| 5204 | + if (Globals.REPLACEONMAKE) |
---|
| 5205 | + Save(); |
---|
| 5206 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5207 | + Globals.REPLACEONMAKE = false; |
---|
4895 | 5208 | if (//false) // why?? |
---|
4896 | 5209 | !group.selection.isEmpty()) |
---|
4897 | 5210 | { |
---|
.. | .. |
---|
5005 | 5318 | //node.add(csg); |
---|
5006 | 5319 | //makeSomething(node); |
---|
5007 | 5320 | makeSomething(csg); |
---|
| 5321 | + Globals.REPLACEONMAKE = keep; |
---|
5008 | 5322 | } |
---|
5009 | 5323 | |
---|
5010 | 5324 | void Ungroup(Object3D g) |
---|
5011 | 5325 | { |
---|
| 5326 | + if (Globals.REPLACEONMAKE) |
---|
| 5327 | + Save(); |
---|
| 5328 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5329 | + Globals.REPLACEONMAKE = false; |
---|
5012 | 5330 | if (g instanceof HiddenObject) |
---|
5013 | 5331 | { |
---|
5014 | 5332 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5025 | 5343 | objEditor.makeSomething(g.get(i), false); |
---|
5026 | 5344 | } |
---|
5027 | 5345 | } |
---|
| 5346 | + Globals.REPLACEONMAKE = keep; |
---|
5028 | 5347 | } |
---|
5029 | 5348 | |
---|
5030 | 5349 | void ungroup() |
---|
.. | .. |
---|
5313 | 5632 | cButton clearpanelButton; |
---|
5314 | 5633 | cButton unselectButton; |
---|
5315 | 5634 | |
---|
5316 | | - cButton minButton; |
---|
5317 | | - cButton maxButton; |
---|
5318 | | - cButton fullButton; |
---|
5319 | | - cButton undoButton; |
---|
5320 | | - cButton redoButton; |
---|
| 5635 | + cButton restoreCameraButton; |
---|
| 5636 | + |
---|
5321 | 5637 | cButton saveButton; |
---|
5322 | 5638 | cButton oneStepButton; |
---|
| 5639 | + |
---|
| 5640 | + cButton groupButton; |
---|
| 5641 | + cButton ungroupButton; |
---|
| 5642 | + cButton compositeButton; |
---|
| 5643 | + cButton switchButton; |
---|
| 5644 | + cButton loopButton; |
---|
| 5645 | + cButton textureButton; |
---|
| 5646 | + |
---|
| 5647 | + cButton gridButton; |
---|
| 5648 | + cButton boxButton; |
---|
| 5649 | + cButton sphereButton; |
---|
| 5650 | + cButton coneButton; |
---|
| 5651 | + cButton torusButton; |
---|
| 5652 | + cButton superButton; |
---|
| 5653 | + cButton kleinButton; |
---|
| 5654 | + cButton particlesButton; |
---|
| 5655 | + cButton overlayButton; |
---|
| 5656 | + cButton lightButton; |
---|
5323 | 5657 | |
---|
5324 | 5658 | cButton screenfitButton; |
---|
5325 | 5659 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5341 | 5675 | //JTree jTree; |
---|
5342 | 5676 | private MenuItem lookAtItem; |
---|
5343 | 5677 | private MenuItem lookFromItem; |
---|
5344 | | - private MenuItem switchItem; |
---|
| 5678 | + private MenuItem switchViewItem; |
---|
5345 | 5679 | private MenuItem cutItem; |
---|
5346 | 5680 | private MenuItem undoItem; |
---|
5347 | 5681 | private MenuItem redoItem; |
---|
5348 | | - private MenuItem duplicateItem; |
---|
| 5682 | + private JMenuItem duplicateItem; |
---|
5349 | 5683 | private MenuItem cloneItem; |
---|
5350 | 5684 | private MenuItem cloneSupportItem; |
---|
5351 | 5685 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5373 | 5707 | private MenuItem pasteLinkItem; |
---|
5374 | 5708 | private MenuItem pasteCloneItem; |
---|
5375 | 5709 | private MenuItem pasteExpandItem; |
---|
5376 | | - private MenuItem clearItem; |
---|
| 5710 | + private MenuItem deleteItem; |
---|
5377 | 5711 | private MenuItem clearAllItem; |
---|
5378 | 5712 | private MenuItem genUVItem; |
---|
5379 | 5713 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5433 | 5767 | private MenuItem frontItem; |
---|
5434 | 5768 | private MenuItem cameraItem; |
---|
5435 | 5769 | private MenuItem compositeItem; |
---|
5436 | | - private MenuItem randomItem; |
---|
| 5770 | + private MenuItem switchItem; |
---|
5437 | 5771 | private MenuItem physicsItem; |
---|
5438 | 5772 | private MenuItem frameselectorItem; |
---|
5439 | 5773 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5507 | 5841 | |
---|
5508 | 5842 | Menu cameraMenu; |
---|
5509 | 5843 | MenuItem editCameraItem; |
---|
5510 | | - MenuItem revertCameraItem; |
---|
| 5844 | + MenuItem restoreCameraItem; |
---|
5511 | 5845 | } |
---|