.. | .. |
---|
84 | 84 | |
---|
85 | 85 | void CloneSelection(boolean supports) |
---|
86 | 86 | { |
---|
| 87 | + if (Globals.REPLACEONMAKE) |
---|
| 88 | + Save(); |
---|
| 89 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 90 | + Globals.REPLACEONMAKE = false; |
---|
87 | 91 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 92 | //Object3D obj; |
---|
89 | 93 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 98 | |
---|
95 | 99 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 100 | } |
---|
| 101 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 102 | } |
---|
98 | 103 | |
---|
99 | 104 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 155 | |
---|
151 | 156 | void SetupMenu2(GroupEditor oe) |
---|
152 | 157 | { |
---|
| 158 | + oe.jTree = new cTree(); |
---|
| 159 | + |
---|
153 | 160 | Menu menu; |
---|
154 | 161 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 162 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
160 | 167 | // redoItem = menu.add(new MenuItem("Redo")); |
---|
161 | 168 | // redoItem.addActionListener(this); |
---|
162 | 169 | // menu.add("-"); |
---|
163 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 170 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
164 | 171 | duplicateItem.addActionListener(this); |
---|
165 | 172 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
166 | 173 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
176 | 183 | copyItem.addActionListener(this); |
---|
177 | 184 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
178 | 185 | pasteItem.addActionListener(this); |
---|
179 | | - menu.add("-"); |
---|
180 | 186 | |
---|
181 | 187 | menu.add("-"); |
---|
182 | 188 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
203 | 209 | //zBufferItem.addActionListener(this); |
---|
204 | 210 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
205 | 211 | //normalLensItem.addActionListener(this); |
---|
206 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
207 | | - revertCameraItem.addActionListener(this); |
---|
| 212 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 213 | + restoreCameraItem.addActionListener(this); |
---|
208 | 214 | |
---|
209 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
210 | | - toggleFullScreenItem.addItemListener(this); |
---|
211 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
212 | | - cameraMenu.add("-"); |
---|
| 215 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 216 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 217 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 218 | +// cameraMenu.add("-"); |
---|
| 219 | +// |
---|
| 220 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 221 | +// toggleTextureItem.addItemListener(this); |
---|
| 222 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 223 | +// |
---|
| 224 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 225 | +// toggleSwitchItem.addItemListener(this); |
---|
| 226 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
213 | 227 | |
---|
214 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
215 | | - toggleTextureItem.addItemListener(this); |
---|
216 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
217 | | - |
---|
218 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
219 | | - toggleSwitchItem.addItemListener(this); |
---|
220 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
221 | | - |
---|
222 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 228 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
223 | 229 | toggleHandleItem.addItemListener(this); |
---|
224 | 230 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
225 | 231 | |
---|
.. | .. |
---|
274 | 280 | { |
---|
275 | 281 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
276 | 282 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
277 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 283 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
278 | 284 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
279 | 285 | oe.cameraMenu.add("-"); |
---|
280 | 286 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
282 | 288 | editLeafItem.addActionListener(this); |
---|
283 | 289 | lookAtItem.addActionListener(this); |
---|
284 | 290 | //lookFromItem.addActinoListener(this); |
---|
285 | | - //switchItem.addActionListener(this); |
---|
| 291 | + //switchViewItem.addActionListener(this); |
---|
286 | 292 | } |
---|
287 | 293 | |
---|
288 | 294 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
327 | 333 | } |
---|
328 | 334 | |
---|
329 | 335 | oe.menuBar.add(menu = new Menu("Group")); |
---|
330 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
331 | | - grabItem.addActionListener(this); |
---|
| 336 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 337 | +// grabItem.addActionListener(this); |
---|
332 | 338 | backItem = menu.add(new MenuItem("Back")); |
---|
333 | 339 | backItem.addActionListener(this); |
---|
334 | 340 | frontItem = menu.add(new MenuItem("Front")); |
---|
335 | 341 | frontItem.addActionListener(this); |
---|
336 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
337 | | - compositeItem.addActionListener(this); |
---|
| 342 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 343 | +// compositeItem.addActionListener(this); |
---|
| 344 | + |
---|
| 345 | + if (Globals.ADVANCED) |
---|
| 346 | + { |
---|
338 | 347 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
339 | 348 | hideItem.addActionListener(this); |
---|
| 349 | + } |
---|
340 | 350 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
341 | 351 | ungroupItem.addActionListener(this); |
---|
342 | | - menu.add("-"); |
---|
343 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
344 | | - randomItem.addActionListener(this); |
---|
| 352 | + |
---|
| 353 | +// menu.add("-"); |
---|
| 354 | +// |
---|
| 355 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 356 | +// switchItem.addActionListener(this); |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
345 | 359 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
346 | 360 | switchGeoItem.addActionListener(this); |
---|
347 | 361 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
349 | 363 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
350 | 364 | morphItem.addActionListener(this); |
---|
351 | 365 | |
---|
352 | | - if (Globals.ADVANCED) |
---|
353 | | - { |
---|
354 | 366 | menu.add("-"); |
---|
355 | 367 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
356 | 368 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
358 | 370 | frameselectorItem.addActionListener(this); |
---|
359 | 371 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
360 | 372 | scriptNodeItem.addActionListener(this); |
---|
361 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
362 | | - cameraItem.addActionListener(this); |
---|
363 | 373 | } |
---|
364 | 374 | |
---|
365 | 375 | oe.menuBar.add(menu = new Menu("Object")); |
---|
366 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
367 | | - textureItem.addActionListener(this); |
---|
| 376 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 377 | +// textureItem.addActionListener(this); |
---|
368 | 378 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
369 | 379 | billboardItem.addActionListener(this); |
---|
370 | 380 | csgItem = menu.add(new MenuItem("CSG")); |
---|
371 | 381 | csgItem.addActionListener(this); |
---|
372 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 382 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
373 | 383 | shadowXItem.addActionListener(this); |
---|
374 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 384 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
375 | 385 | shadowYItem.addActionListener(this); |
---|
376 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 386 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
377 | 387 | shadowZItem.addActionListener(this); |
---|
| 388 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 389 | + attributeItem.addActionListener(this); |
---|
| 390 | + |
---|
378 | 391 | if (Globals.ADVANCED) |
---|
379 | 392 | { |
---|
380 | 393 | menu.add("-"); |
---|
381 | 394 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
382 | 395 | linkerItem.addActionListener(this); |
---|
383 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
384 | | - attributeItem.addActionListener(this); |
---|
385 | 396 | templateItem = menu.add(new MenuItem("Template")); |
---|
386 | 397 | templateItem.addActionListener(this); |
---|
387 | 398 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
533 | 544 | buildToolsMenu(menu); |
---|
534 | 545 | } |
---|
535 | 546 | |
---|
| 547 | + |
---|
536 | 548 | void SetupUI2(ObjEditor oe) |
---|
537 | 549 | { |
---|
538 | 550 | // June 2019 |
---|
.. | .. |
---|
575 | 587 | oe.radioPanel.add(dummyButton); |
---|
576 | 588 | oe.buttonGroup.add(dummyButton); |
---|
577 | 589 | */ |
---|
| 590 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 591 | + |
---|
| 592 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 593 | + |
---|
578 | 594 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
579 | 595 | |
---|
580 | 596 | //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
581 | 597 | //minButton.setToolTipText("Minimize window"); |
---|
582 | 598 | //minButton.addActionListener(this); |
---|
583 | 599 | |
---|
584 | | - oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
585 | | - maxButton.setToolTipText("Maximize window"); |
---|
586 | | - maxButton.addActionListener(this); |
---|
| 600 | + if (Globals.ADVANCED) |
---|
| 601 | + { |
---|
| 602 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 603 | + maxButton.setToolTipText("Maximize window"); |
---|
| 604 | + maxButton.addActionListener(this); |
---|
| 605 | + } |
---|
587 | 606 | |
---|
588 | | - oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
589 | 608 | fullButton.setToolTipText("Full-screen window"); |
---|
590 | 609 | fullButton.addActionListener(this); |
---|
591 | 610 | |
---|
592 | | - oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
593 | | - undoButton.setToolTipText("Undo changes"); |
---|
594 | | - undoButton.addActionListener(this); |
---|
| 611 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 613 | + screenfitButton.addActionListener(this); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 617 | + restoreCameraButton.addActionListener(this); |
---|
595 | 618 | |
---|
596 | | - oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
597 | | - redoButton.setToolTipText("Redo changes"); |
---|
598 | | - redoButton.addActionListener(this); |
---|
599 | | - |
---|
600 | | - oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
601 | | - saveButton.setToolTipText("Save changes"); |
---|
| 619 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + saveButton.setToolTipText("New version"); |
---|
602 | 621 | saveButton.addActionListener(this); |
---|
| 622 | + |
---|
| 623 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + undoButton.setToolTipText("Previous version"); |
---|
| 625 | + undoButton.addActionListener(this); |
---|
| 626 | + undoButton.setEnabled(false); |
---|
603 | 627 | |
---|
604 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 628 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 629 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + restoreButton.setToolTipText("Restore current"); |
---|
| 631 | + restoreButton.addActionListener(this); |
---|
| 632 | + restoreButton.setEnabled(false); |
---|
| 633 | + |
---|
| 634 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 635 | + replaceButton.setToolTipText("Replace current"); |
---|
| 636 | + replaceButton.addActionListener(this); |
---|
| 637 | + replaceButton.setEnabled(false); |
---|
| 638 | + |
---|
| 639 | + copyOptionsPanel.add(updown); |
---|
| 640 | + |
---|
| 641 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + redoButton.setToolTipText("Next version"); |
---|
| 643 | + redoButton.addActionListener(this); |
---|
| 644 | + redoButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
605 | 647 | liveCB.setToolTipText("Enable animation"); |
---|
606 | 648 | liveCB.addItemListener(this); |
---|
607 | 649 | |
---|
608 | | - oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 650 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
609 | 651 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
610 | 652 | oneStepButton.addActionListener(this); |
---|
611 | 653 | |
---|
612 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 654 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
613 | 655 | fastCB.setToolTipText("Fast mode"); |
---|
614 | 656 | fastCB.addItemListener(this); |
---|
615 | 657 | |
---|
616 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
617 | | - trackCB.setToolTipText("Enable tracking"); |
---|
618 | | - trackCB.addItemListener(this); |
---|
619 | | - |
---|
620 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
621 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
622 | | - screenfitButton.addActionListener(this); |
---|
| 658 | + //oe.toolboxPanel.Return(); |
---|
| 659 | + |
---|
| 660 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 661 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 662 | +// trackCB.addItemListener(this); |
---|
623 | 663 | |
---|
624 | 664 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
625 | 665 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
631 | 671 | snapobjectButton.setToolTipText("Snap Object"); |
---|
632 | 672 | } |
---|
633 | 673 | |
---|
634 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
635 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
636 | | - flashSelectionButton.addActionListener(this); |
---|
| 674 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
637 | 675 | |
---|
638 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
639 | | - |
---|
640 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 676 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
641 | 677 | twoButton.setToolTipText("Show center view only"); |
---|
642 | 678 | twoButton.addActionListener(this); |
---|
643 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 679 | + this.fullscreenLayout = twoButton; |
---|
| 680 | + |
---|
| 681 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
644 | 682 | fourButton.addActionListener(this); |
---|
645 | 683 | fourButton.setToolTipText("Show left panel only"); |
---|
646 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 684 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
647 | 685 | sixButton.setToolTipText("2-column layout left"); |
---|
648 | 686 | sixButton.addActionListener(this); |
---|
649 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 687 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
650 | 688 | threeButton.setToolTipText("2-column layout right"); |
---|
651 | 689 | threeButton.addActionListener(this); |
---|
652 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 690 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
653 | 691 | sevenButton.setToolTipText("3-column layout"); |
---|
654 | 692 | sevenButton.addActionListener(this); |
---|
655 | 693 | // |
---|
656 | 694 | |
---|
657 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
658 | 696 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
659 | 697 | rootButton.addActionListener(this); |
---|
660 | 698 | |
---|
661 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 699 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
662 | 700 | closeButton.setToolTipText("Close tab"); |
---|
663 | 701 | closeButton.addActionListener(this); |
---|
664 | 702 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
665 | 703 | //clearButton.addActionListener(this); |
---|
666 | | - |
---|
667 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 704 | + |
---|
| 705 | + // INSERT |
---|
| 706 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + gridButton.setToolTipText("Create grid"); |
---|
| 708 | + gridButton.addActionListener(this); |
---|
| 709 | + |
---|
| 710 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + boxButton.setToolTipText("Create box"); |
---|
| 712 | + boxButton.addActionListener(this); |
---|
| 713 | + |
---|
| 714 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 715 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 716 | + sphereButton.addActionListener(this); |
---|
| 717 | + |
---|
| 718 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + coneButton.setToolTipText("Create cone"); |
---|
| 720 | + coneButton.addActionListener(this); |
---|
| 721 | + |
---|
| 722 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 723 | + torusButton.setToolTipText("Create torus"); |
---|
| 724 | + torusButton.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 728 | + superButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + if (Globals.ADVANCED) |
---|
| 731 | + { |
---|
| 732 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 733 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 734 | + kleinButton.addActionListener(this); |
---|
| 735 | + } |
---|
668 | 736 | |
---|
669 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
670 | | - editButton.setToolTipText("Edit selection"); |
---|
| 737 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 739 | + particlesButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + oe.toolboxPanel.Return(); |
---|
| 742 | + |
---|
| 743 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 744 | + groupButton.setToolTipText("Create group"); |
---|
| 745 | + groupButton.addActionListener(this); |
---|
| 746 | + |
---|
| 747 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 748 | + compositeButton.setToolTipText("Create composite"); |
---|
| 749 | + compositeButton.addActionListener(this); |
---|
| 750 | + |
---|
| 751 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 752 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 753 | + switchButton.addActionListener(this); |
---|
| 754 | + |
---|
| 755 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 756 | + loopButton.setToolTipText("Create loop"); |
---|
| 757 | + loopButton.addActionListener(this); |
---|
| 758 | + |
---|
| 759 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 760 | + textureButton.setToolTipText("Create texture"); |
---|
| 761 | + textureButton.addActionListener(this); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 765 | + overlayButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + lightButton.setToolTipText("Create light"); |
---|
| 769 | + lightButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + for (int i=6; --i>=0;) |
---|
| 772 | + { |
---|
| 773 | + oe.toolboxPanel.Return(); |
---|
| 774 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 775 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 776 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 777 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 778 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 779 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 780 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 781 | + } |
---|
| 782 | + |
---|
| 783 | + // EDIT panel |
---|
| 784 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 785 | + editButton.setToolTipText("Pin selection controls"); |
---|
671 | 786 | editButton.addActionListener(this); |
---|
672 | 787 | |
---|
673 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
674 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 788 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 789 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
675 | 790 | uneditButton.addActionListener(this); |
---|
676 | 791 | |
---|
677 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
678 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 792 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 793 | + allParamsButton.setToolTipText("Show all controle"); |
---|
679 | 794 | allParamsButton.addActionListener(this); |
---|
680 | 795 | |
---|
681 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 796 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
682 | 797 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
683 | 798 | clearPanelButton.addActionListener(this); |
---|
684 | 799 | |
---|
685 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 800 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
686 | 801 | unselectButton.setToolTipText("Unselect"); |
---|
687 | 802 | unselectButton.addActionListener(this); |
---|
688 | 803 | |
---|
689 | | - commandsPanel.preferredHeight = 1; |
---|
| 804 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 806 | + flashSelectionButton.addActionListener(this); |
---|
690 | 807 | |
---|
691 | | - oe.treePanel.add(commandsPanel); |
---|
692 | | - oe.treePanel.Return(); |
---|
| 808 | + editCommandsPanel.preferredHeight = 1; |
---|
| 809 | + |
---|
| 810 | + SetPinStates(false); |
---|
| 811 | +// oe.treePanel.add(commandsPanel); |
---|
| 812 | +// oe.treePanel.Return(); |
---|
693 | 813 | |
---|
694 | 814 | // oe.aConstraints.gridx += 1; |
---|
695 | 815 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
706 | 826 | |
---|
707 | 827 | JScrollPane jSP; |
---|
708 | 828 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
709 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 829 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
710 | 830 | ResetModel(); |
---|
711 | 831 | |
---|
712 | 832 | oe.treePanel.add(jSPPanel); |
---|
713 | 833 | oe.treePanel.Return(); |
---|
714 | 834 | |
---|
715 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
716 | | - |
---|
717 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
718 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
719 | | - colorCB.addItemListener(this); |
---|
720 | | - |
---|
721 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
722 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
723 | | - materialCB.addItemListener(this); |
---|
724 | | - |
---|
725 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
726 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
727 | | - textureCB.addItemListener(this); |
---|
728 | | - |
---|
729 | | - copyOptionsPanel.preferredHeight = 1; |
---|
730 | 835 | oe.treePanel.add(copyOptionsPanel); |
---|
731 | 836 | oe.treePanel.Return(); |
---|
| 837 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0); |
---|
| 838 | + versionField = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 839 | + sliderPane.preferredHeight = 1; |
---|
732 | 840 | |
---|
733 | 841 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
734 | 842 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
757 | 865 | |
---|
758 | 866 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
759 | 867 | { |
---|
| 868 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 869 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 870 | + colorCB.addItemListener(this); |
---|
| 871 | + |
---|
| 872 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 873 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 874 | + materialCB.addItemListener(this); |
---|
| 875 | + |
---|
| 876 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 877 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 878 | + textureCB.addItemListener(this); |
---|
| 879 | + |
---|
| 880 | + panel.Return(); |
---|
| 881 | + |
---|
760 | 882 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
761 | 883 | boxCB.setToolTipText("Display bounding boxes"); |
---|
762 | 884 | boxCB.addItemListener(this); |
---|
763 | 885 | |
---|
764 | 886 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
765 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 887 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
766 | 888 | zoomBoxCB.addItemListener(this); |
---|
767 | 889 | |
---|
768 | 890 | if (true) // Globals.ADVANCED) |
---|
769 | 891 | { |
---|
770 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
771 | | - supportCB.setToolTipText("Enable rigging"); |
---|
772 | | - supportCB.addItemListener(this); |
---|
| 892 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 893 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 894 | +// supportCB.addItemListener(this); |
---|
| 895 | + |
---|
| 896 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 897 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 898 | + freezeCB.addItemListener(this); |
---|
773 | 899 | |
---|
774 | 900 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
775 | 901 | // localCB.addItemListener(this); |
---|
776 | 902 | |
---|
| 903 | + panel.Return(); |
---|
| 904 | + |
---|
777 | 905 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
778 | 906 | crowdCB.setToolTipText("Used for crowds"); |
---|
779 | 907 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
790 | 918 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
791 | 919 | // speakerMocapCB.addItemListener(this); |
---|
792 | 920 | |
---|
| 921 | + panel.Return(); |
---|
| 922 | + |
---|
793 | 923 | if (false) |
---|
794 | 924 | { |
---|
795 | 925 | // handled in scripts |
---|
.. | .. |
---|
804 | 934 | //constraints.gridy += 1; |
---|
805 | 935 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
806 | 936 | smoothfocusCB.addItemListener(this); |
---|
| 937 | + panel.Return(); |
---|
807 | 938 | } |
---|
808 | 939 | |
---|
809 | 940 | //constraints.gridx += 1; |
---|
810 | 941 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
811 | 942 | // debugCB.addItemListener(this); |
---|
812 | 943 | |
---|
| 944 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 945 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 946 | + trackCB.addItemListener(this); |
---|
| 947 | + |
---|
813 | 948 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 949 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
814 | 950 | oeilCB.addItemListener(this); |
---|
815 | 951 | |
---|
| 952 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 953 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 954 | + shadowCB.addItemListener(this); |
---|
| 955 | + |
---|
| 956 | + panel.Return(); |
---|
| 957 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 958 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 959 | + toggleTextureCB.addItemListener(this); |
---|
| 960 | + |
---|
| 961 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 962 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 963 | + toggleSwitchCB.addItemListener(this); |
---|
| 964 | + |
---|
| 965 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 966 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 967 | + autokeepCB.addItemListener(this); |
---|
| 968 | + |
---|
| 969 | + panel.Return(); |
---|
| 970 | + if (Globals.ADVANCED) |
---|
| 971 | + { |
---|
816 | 972 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
817 | 973 | lookAtCB.setToolTipText("Look-at target"); |
---|
818 | 974 | lookAtCB.addItemListener(this); |
---|
| 975 | + } |
---|
819 | 976 | |
---|
820 | 977 | } |
---|
821 | 978 | |
---|
822 | 979 | cGridBag fill = new cGridBag(); |
---|
823 | | - |
---|
824 | 980 | fill.preferredHeight = 200; |
---|
| 981 | + cGridBag fill2 = new cGridBag(); |
---|
| 982 | + fill2.preferredHeight = 200; |
---|
| 983 | + cGridBag fill3 = new cGridBag(); |
---|
| 984 | + fill3.preferredHeight = 200; |
---|
825 | 985 | |
---|
826 | 986 | panel.add(fill); |
---|
| 987 | + panel.add(fill2); |
---|
| 988 | + panel.add(fill3); |
---|
827 | 989 | |
---|
828 | 990 | } |
---|
829 | 991 | |
---|
830 | 992 | void EditObject(Object3D obj) |
---|
831 | 993 | { |
---|
832 | 994 | cRadio radioButton = new cRadio(obj.name); |
---|
| 995 | + |
---|
| 996 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 997 | + radioButton.hadMaterial = obj.material != null; |
---|
| 998 | + if (!radioButton.hadMaterial) |
---|
| 999 | + { |
---|
| 1000 | + obj.material = new cMaterial(); |
---|
| 1001 | + } |
---|
| 1002 | + |
---|
833 | 1003 | radioButton.SetObject(obj); |
---|
834 | 1004 | radioButton.layout = sevenButton; |
---|
835 | 1005 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
851 | 1021 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
852 | 1022 | } |
---|
853 | 1023 | |
---|
854 | | - JCheckBox liveCB; |
---|
855 | | - JCheckBox supportCB; |
---|
856 | | - JCheckBox localCB; |
---|
857 | | - JCheckBox crowdCB; |
---|
858 | | - JCheckBox smoothCB; |
---|
859 | | - JCheckBox fastCB; |
---|
860 | | - JCheckBox slowCB; |
---|
861 | | - JCheckBox boxCB; |
---|
862 | | - JCheckBox zoomBoxCB; |
---|
863 | | - JCheckBox trackCB; |
---|
864 | | - JCheckBox smoothfocusCB; |
---|
| 1024 | + cToggleButton liveCB; |
---|
| 1025 | + cCheckBox supportCB; |
---|
| 1026 | + cCheckBox localCB; |
---|
| 1027 | + cCheckBox crowdCB; |
---|
| 1028 | + cCheckBox smoothCB; |
---|
| 1029 | + cToggleButton fastCB; |
---|
| 1030 | + cCheckBox slowCB; |
---|
| 1031 | + cCheckBox boxCB; |
---|
| 1032 | + cCheckBox zoomBoxCB; |
---|
| 1033 | + cCheckBox freezeCB; |
---|
| 1034 | + //cToggleButton trackCB; |
---|
| 1035 | + cCheckBox trackCB; |
---|
| 1036 | + cCheckBox smoothfocusCB; |
---|
865 | 1037 | // JCheckBox speakerMocapCB; |
---|
866 | | - JCheckBox speakerCameraCB; |
---|
867 | | - JCheckBox speakerFocusCB; |
---|
868 | | - JCheckBox debugCB; |
---|
869 | | - JCheckBox oeilCB; |
---|
870 | | - JCheckBox lookAtCB; |
---|
| 1038 | + cCheckBox speakerCameraCB; |
---|
| 1039 | + cCheckBox speakerFocusCB; |
---|
| 1040 | + cCheckBox debugCB; |
---|
| 1041 | + |
---|
| 1042 | + cCheckBox oeilCB; |
---|
| 1043 | + cCheckBox shadowCB; |
---|
| 1044 | + cCheckBox autokeepCB; |
---|
| 1045 | + cCheckBox lookAtCB; |
---|
871 | 1046 | |
---|
872 | 1047 | // static int COLOR = 1; |
---|
873 | 1048 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
875 | 1050 | |
---|
876 | 1051 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
877 | 1052 | |
---|
878 | | - JCheckBox colorCB; |
---|
879 | | - JCheckBox materialCB; |
---|
880 | | - JCheckBox textureCB; |
---|
| 1053 | + cCheckBox colorCB; |
---|
| 1054 | + cCheckBox materialCB; |
---|
| 1055 | + cCheckBox textureCB; |
---|
881 | 1056 | |
---|
882 | 1057 | public void itemStateChanged(ItemEvent e) |
---|
883 | 1058 | { |
---|
.. | .. |
---|
970 | 1145 | { |
---|
971 | 1146 | cameraView.ToggleOeil(); |
---|
972 | 1147 | } |
---|
| 1148 | + else if(e.getSource() == shadowCB) |
---|
| 1149 | + { |
---|
| 1150 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1151 | + } |
---|
| 1152 | + else if(e.getSource() == freezeCB) |
---|
| 1153 | + { |
---|
| 1154 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1155 | + } |
---|
| 1156 | + else if(e.getSource() == autokeepCB) |
---|
| 1157 | + { |
---|
| 1158 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1159 | + } |
---|
973 | 1160 | else if(e.getSource() == lookAtCB) |
---|
974 | 1161 | { |
---|
975 | 1162 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
986 | 1173 | |
---|
987 | 1174 | /**/ |
---|
988 | 1175 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
989 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1176 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1177 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
990 | 1178 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
991 | 1179 | // We can't move the root node or an empty selection |
---|
992 | 1180 | return; |
---|
.. | .. |
---|
1049 | 1237 | } |
---|
1050 | 1238 | } |
---|
1051 | 1239 | |
---|
1052 | | - String string = (String) object; |
---|
1053 | | - |
---|
1054 | 1240 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1055 | 1241 | // if( object instanceof java.io.File[]) |
---|
1056 | 1242 | // { |
---|
.. | .. |
---|
1058 | 1244 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1059 | 1245 | // return; |
---|
1060 | 1246 | // } |
---|
| 1247 | + |
---|
| 1248 | + String string = object.toString(); |
---|
1061 | 1249 | |
---|
1062 | 1250 | // File path for Mac and Windows |
---|
1063 | 1251 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1103 | 1291 | |
---|
1104 | 1292 | assert target == objEditor.jTree; |
---|
1105 | 1293 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1294 | + Object3D destinationLeaf; |
---|
1106 | 1295 | try { |
---|
1107 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1296 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1108 | 1297 | } catch (Exception e) { |
---|
1109 | 1298 | System.out.println("destinationPath : " + destinationPath); |
---|
1110 | 1299 | return; |
---|
1111 | 1300 | } |
---|
1112 | 1301 | |
---|
1113 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1302 | + for (int i=group.selection.size(); --i>=0;) |
---|
1114 | 1303 | { |
---|
| 1304 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1305 | + |
---|
| 1306 | + // Cannot move into itself |
---|
| 1307 | + if (child == destinationLeaf) |
---|
| 1308 | + return; |
---|
| 1309 | + } |
---|
| 1310 | + |
---|
| 1311 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1312 | +// { |
---|
1115 | 1313 | loadClipboard(true); |
---|
1116 | 1314 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1117 | 1315 | pasteInto(false, false); |
---|
1118 | | - } else { |
---|
1119 | | - loadClipboard(false); |
---|
1120 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1121 | | - pasteInto(false, false); // true); // ??? |
---|
1122 | | - } |
---|
| 1316 | +// } else { |
---|
| 1317 | +// loadClipboard(false); |
---|
| 1318 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1319 | +// pasteInto(false, false); // true); // ??? |
---|
| 1320 | +// } |
---|
1123 | 1321 | } |
---|
1124 | 1322 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1125 | 1323 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1224 | 1422 | { |
---|
1225 | 1423 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1226 | 1424 | //heightFieldItem.addActionListener(this); |
---|
1227 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1228 | | - gridItem.addActionListener(this); |
---|
1229 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1230 | | - rectoidItem.addActionListener(this); |
---|
1231 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1232 | | - ellipsoidItem.addActionListener(this); |
---|
1233 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1234 | | - coneItem.addActionListener(this); |
---|
1235 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1236 | | - torusItem.addActionListener(this); |
---|
1237 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1238 | | - superItem.addActionListener(this); |
---|
| 1425 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1426 | +// gridItem.addActionListener(this); |
---|
| 1427 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1428 | +// rectoidItem.addActionListener(this); |
---|
| 1429 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1430 | +// ellipsoidItem.addActionListener(this); |
---|
| 1431 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1432 | +// coneItem.addActionListener(this); |
---|
| 1433 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1434 | +// torusItem.addActionListener(this); |
---|
| 1435 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1436 | +// superItem.addActionListener(this); |
---|
| 1437 | + |
---|
| 1438 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1439 | + cameraItem.addActionListener(this); |
---|
| 1440 | + |
---|
| 1441 | + if (!Globals.ADVANCED) |
---|
| 1442 | + { |
---|
1239 | 1443 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1240 | 1444 | kleinItem.addActionListener(this); |
---|
1241 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1242 | | - particleItem.addActionListener(this); |
---|
| 1445 | + } |
---|
| 1446 | + |
---|
| 1447 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1448 | +// particleItem.addActionListener(this); |
---|
1243 | 1449 | if (Globals.ADVANCED) |
---|
1244 | 1450 | { |
---|
1245 | 1451 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1265 | 1471 | } |
---|
1266 | 1472 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1267 | 1473 | bezierItem.addActionListener(this); |
---|
1268 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1269 | | - overlayItem.addActionListener(this); |
---|
1270 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1271 | | - lightItem.addActionListener(this); |
---|
| 1474 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1475 | +// overlayItem.addActionListener(this); |
---|
| 1476 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1477 | +// lightItem.addActionListener(this); |
---|
1272 | 1478 | menu.add("-"); |
---|
1273 | 1479 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1274 | 1480 | //superLoopItem.addActionListener(this); |
---|
1275 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1276 | | - loopItem.addActionListener(this); |
---|
| 1481 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1482 | +// loopItem.addActionListener(this); |
---|
1277 | 1483 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1278 | 1484 | doubleItem.addActionListener(this); |
---|
1279 | 1485 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1289 | 1495 | animationItem.addItemListener(this); |
---|
1290 | 1496 | animationItem.setState(Globals.ANIMATION); |
---|
1291 | 1497 | |
---|
| 1498 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1499 | + archiveItem.addActionListener(this); |
---|
| 1500 | + |
---|
1292 | 1501 | menu.add("-"); |
---|
1293 | 1502 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1294 | 1503 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1301 | 1510 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1302 | 1511 | reduce34MorphItem.addActionListener(this); |
---|
1303 | 1512 | menu.add("-"); |
---|
| 1513 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1514 | + memoryItem.addActionListener(this); |
---|
1304 | 1515 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1305 | 1516 | computeAOItem.addActionListener(this); |
---|
1306 | 1517 | |
---|
.. | .. |
---|
1309 | 1520 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1310 | 1521 | mirrorItem.addActionListener(this); |
---|
1311 | 1522 | menu.add("-"); |
---|
1312 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1313 | | - memoryItem.addActionListener(this); |
---|
1314 | 1523 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1315 | 1524 | analyzeItem.addActionListener(this); |
---|
1316 | 1525 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1454 | 1663 | shadow.material = new cMaterial(obj.material); |
---|
1455 | 1664 | shadow.material.diffuse = 0.0001f; |
---|
1456 | 1665 | shadow.material.specular = 0.0001f; |
---|
| 1666 | + //shadow.projectedVertices[1].x = 300; |
---|
1457 | 1667 | |
---|
1458 | 1668 | makeSomething(shadow); |
---|
1459 | 1669 | } |
---|
| 1670 | + |
---|
| 1671 | + private void ClearUnpinned() |
---|
| 1672 | + { |
---|
| 1673 | + //for (Object3D obj : listUI) |
---|
| 1674 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1675 | + { |
---|
| 1676 | + Object3D obj = listUI.elementAt(i); |
---|
| 1677 | + if (!obj.pinned) |
---|
| 1678 | + { |
---|
| 1679 | + obj.CloseUI(); |
---|
| 1680 | + listUI.remove(i); |
---|
| 1681 | + } |
---|
| 1682 | + } |
---|
| 1683 | + } |
---|
1460 | 1684 | |
---|
1461 | 1685 | /** |
---|
1462 | 1686 | * applyExample |
---|
.. | .. |
---|
1701 | 1925 | { |
---|
1702 | 1926 | ScreenFit(); |
---|
1703 | 1927 | } else |
---|
1704 | | - if (source == switchItem) |
---|
| 1928 | + if (source == switchViewItem) |
---|
1705 | 1929 | { |
---|
1706 | 1930 | cVector v1 = new cVector(); |
---|
1707 | 1931 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1710 | 1934 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1711 | 1935 | objEditor.cameraView.repaint(); |
---|
1712 | 1936 | } else |
---|
1713 | | - if (source == rectoidItem) |
---|
| 1937 | + if (source == rectoidItem || source == boxButton) |
---|
1714 | 1938 | { |
---|
1715 | 1939 | makeSomething(new Box()); |
---|
1716 | 1940 | } else |
---|
1717 | | - if (source == particleItem) |
---|
| 1941 | + if (source == particleItem || source == particlesButton) |
---|
1718 | 1942 | { |
---|
1719 | 1943 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1720 | 1944 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1793 | 2017 | |
---|
1794 | 2018 | makeSomething(obj); |
---|
1795 | 2019 | } else |
---|
1796 | | - if (source == gridItem) |
---|
| 2020 | + if (source == gridItem || source == gridButton) |
---|
1797 | 2021 | { |
---|
1798 | 2022 | makeSomething(new Grid()); |
---|
1799 | 2023 | } else |
---|
1800 | | - if (source == ellipsoidItem) |
---|
| 2024 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1801 | 2025 | { |
---|
1802 | 2026 | makeSomething(new Sphere()); |
---|
1803 | 2027 | } else |
---|
1804 | | - if (source == coneItem) |
---|
| 2028 | + if (source == coneItem || source == coneButton) |
---|
1805 | 2029 | { |
---|
1806 | 2030 | makeSomething(new Cone()); |
---|
1807 | 2031 | } else |
---|
1808 | | - if (source == torusItem) |
---|
| 2032 | + if (source == torusItem || source == torusButton) |
---|
1809 | 2033 | { |
---|
1810 | 2034 | makeSomething(new Torus()); |
---|
1811 | 2035 | } else |
---|
1812 | | - if (source == superItem) |
---|
| 2036 | + if (source == superItem || source == superButton) |
---|
1813 | 2037 | { |
---|
1814 | 2038 | makeSomething(new Superellipsoid()); |
---|
1815 | 2039 | } else |
---|
1816 | | - if (source == kleinItem) |
---|
| 2040 | + if (source == kleinItem || source == kleinButton) |
---|
1817 | 2041 | { |
---|
1818 | 2042 | makeSomething(new Klein()); |
---|
1819 | 2043 | } else |
---|
.. | .. |
---|
1833 | 2057 | { |
---|
1834 | 2058 | makeSomething(new BezierSurface()); |
---|
1835 | 2059 | } else |
---|
1836 | | - if (source == overlayItem) |
---|
| 2060 | + if (source == overlayItem || source == overlayButton) |
---|
1837 | 2061 | { |
---|
1838 | 2062 | /* |
---|
1839 | 2063 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1881 | 2105 | s.setup(); |
---|
1882 | 2106 | makeSomething(s); |
---|
1883 | 2107 | } else |
---|
1884 | | - if (source == lightItem) |
---|
| 2108 | + if (source == lightItem || source == lightButton) |
---|
1885 | 2109 | { |
---|
1886 | 2110 | makeSomething(new Light()); |
---|
1887 | 2111 | } else |
---|
.. | .. |
---|
1931 | 2155 | |
---|
1932 | 2156 | group(g); |
---|
1933 | 2157 | } else |
---|
1934 | | - if (source == loopItem) |
---|
| 2158 | + if (source == loopItem || source == loopButton) |
---|
1935 | 2159 | { |
---|
1936 | 2160 | Composite csg = new GroupLeaf(); |
---|
1937 | 2161 | csg.count = 5; |
---|
1938 | 2162 | group(csg); |
---|
1939 | | - Composite child = new cGroup(); |
---|
| 2163 | + Composite child = new cGroup("Branch"); |
---|
1940 | 2164 | csg.addChild(child); |
---|
1941 | 2165 | child.addChild(csg); |
---|
1942 | 2166 | } else |
---|
1943 | 2167 | if (source == doubleItem) |
---|
1944 | 2168 | { |
---|
1945 | | - Composite csg = new GroupLeaf(); |
---|
| 2169 | + Composite csg = new GroupLeaf("Fork"); |
---|
1946 | 2170 | csg.count = 5; |
---|
1947 | 2171 | group(csg); |
---|
1948 | | - Composite child = new cGroup(); |
---|
| 2172 | + Composite child = new cGroup("Branch A"); |
---|
1949 | 2173 | csg.addChild(child); |
---|
1950 | 2174 | child.addChild(csg); |
---|
1951 | | - child = new cGroup(); |
---|
| 2175 | + child = new cGroup("Branch B"); |
---|
1952 | 2176 | csg.addChild(child); |
---|
1953 | 2177 | child.addChild(csg); |
---|
1954 | 2178 | } else |
---|
1955 | 2179 | if (source == tripleItem) |
---|
1956 | 2180 | { |
---|
1957 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Trident"); |
---|
1958 | 2182 | csg.count = 4; |
---|
1959 | 2183 | group(csg); |
---|
1960 | 2184 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2018 | 2242 | } else |
---|
2019 | 2243 | if (source == undoButton) |
---|
2020 | 2244 | { |
---|
| 2245 | + // Go to previous version |
---|
| 2246 | + //if (!Undo()) |
---|
| 2247 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2021 | 2248 | Undo(); |
---|
| 2249 | + } else |
---|
| 2250 | + if (source == restoreButton) |
---|
| 2251 | + { |
---|
| 2252 | + // Restore current version |
---|
| 2253 | + Restore(); |
---|
| 2254 | + } else |
---|
| 2255 | + if (source == replaceButton) |
---|
| 2256 | + { |
---|
| 2257 | + // Overwrite current version |
---|
| 2258 | + Replace(); |
---|
2022 | 2259 | } else |
---|
2023 | 2260 | if (source == redoButton) |
---|
2024 | 2261 | { |
---|
| 2262 | + // Go to next version |
---|
2025 | 2263 | Redo(); |
---|
2026 | 2264 | } else |
---|
2027 | 2265 | if (source == saveButton) |
---|
2028 | 2266 | { |
---|
2029 | | - Save(); |
---|
| 2267 | + // Save a new version |
---|
| 2268 | + if (!Save(true)) |
---|
| 2269 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2030 | 2270 | } else |
---|
2031 | 2271 | if (source == oneStepButton) |
---|
2032 | 2272 | { |
---|
.. | .. |
---|
2035 | 2275 | } else |
---|
2036 | 2276 | if (source == screenfitButton) |
---|
2037 | 2277 | { |
---|
2038 | | - //Reload(lastConverter, lastFilename, true); |
---|
2039 | 2278 | ScreenFit(); |
---|
2040 | 2279 | } else |
---|
2041 | 2280 | if (source == screenfitpointButton) |
---|
2042 | 2281 | { |
---|
2043 | | - //Reload(lastConverter, lastFilename, true); |
---|
2044 | 2282 | ScreenFitPoint(); |
---|
2045 | 2283 | } else |
---|
2046 | 2284 | if (source == snapobjectButton) |
---|
2047 | 2285 | { |
---|
2048 | | - //Reload(lastConverter, lastFilename, true); |
---|
2049 | 2286 | SnapObject(); |
---|
2050 | 2287 | } else |
---|
2051 | 2288 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2421 | 2658 | { |
---|
2422 | 2659 | ClearSelection(true); |
---|
2423 | 2660 | } else |
---|
2424 | | - if (source == grabItem) |
---|
| 2661 | + if (source == grabItem || source == groupButton) |
---|
2425 | 2662 | { |
---|
2426 | | - group(new cGroup(), true); |
---|
| 2663 | + group(new cGroup(), false); // true); |
---|
2427 | 2664 | } else |
---|
2428 | 2665 | if (source == hideItem) |
---|
2429 | 2666 | { |
---|
.. | .. |
---|
2441 | 2678 | { |
---|
2442 | 2679 | makeSomething(new Camera()); |
---|
2443 | 2680 | } else |
---|
2444 | | - if (source == compositeItem) |
---|
| 2681 | + if (source == compositeItem || source == compositeButton) |
---|
2445 | 2682 | { |
---|
2446 | 2683 | group(new Composite()); |
---|
2447 | 2684 | } else |
---|
2448 | | - if (source == randomItem) |
---|
| 2685 | + if (source == switchItem || source == switchButton) |
---|
2449 | 2686 | { |
---|
2450 | 2687 | RandomNode random = new RandomNode(); |
---|
2451 | 2688 | group(random); |
---|
.. | .. |
---|
2547 | 2784 | { |
---|
2548 | 2785 | group(new cLinker()); |
---|
2549 | 2786 | } else |
---|
2550 | | - if (source == textureItem) |
---|
| 2787 | + if (source == textureItem || source == textureButton) |
---|
2551 | 2788 | { |
---|
2552 | 2789 | group(new TextureNode()); |
---|
2553 | 2790 | } else |
---|
.. | .. |
---|
2567 | 2804 | { |
---|
2568 | 2805 | CastShadow(2); |
---|
2569 | 2806 | } else |
---|
2570 | | - if (source == ungroupItem) |
---|
| 2807 | + if (source == ungroupItem || source == ungroupButton) |
---|
2571 | 2808 | { |
---|
2572 | | - //ungroup(); |
---|
| 2809 | + boolean hasRoot = false; |
---|
| 2810 | + |
---|
2573 | 2811 | for (int i=0; i<group.selection.size(); i++) |
---|
2574 | 2812 | { |
---|
2575 | | - Ungroup(group.selection.get(i)); |
---|
| 2813 | + if (group.selection.get(i) == group) |
---|
| 2814 | + { |
---|
| 2815 | + hasRoot = true; |
---|
| 2816 | + break; |
---|
| 2817 | + } |
---|
2576 | 2818 | } |
---|
2577 | 2819 | |
---|
2578 | | - ClearSelection(false); |
---|
2579 | | - |
---|
2580 | | - refreshContents(); |
---|
| 2820 | + if (!hasRoot) |
---|
| 2821 | + { |
---|
| 2822 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2823 | + { |
---|
| 2824 | + Ungroup(group.selection.get(i)); |
---|
| 2825 | + } |
---|
| 2826 | + |
---|
| 2827 | + ClearSelection(false); |
---|
| 2828 | + |
---|
| 2829 | + refreshContents(); |
---|
| 2830 | + } |
---|
2581 | 2831 | } else |
---|
2582 | 2832 | if (source == genUVItem) |
---|
2583 | 2833 | { |
---|
.. | .. |
---|
2905 | 3155 | if (source == twoButton) |
---|
2906 | 3156 | { |
---|
2907 | 3157 | radio.layout = twoButton; |
---|
| 3158 | + |
---|
| 3159 | + if (CameraPane.FULLSCREEN) |
---|
| 3160 | + fullscreenLayout = radio.layout; |
---|
| 3161 | + |
---|
2908 | 3162 | // bug |
---|
2909 | 3163 | //gridPanel.setDividerLocation(1.0); |
---|
2910 | 3164 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2960 | 3214 | { |
---|
2961 | 3215 | radio.layout = threeButton; |
---|
2962 | 3216 | |
---|
| 3217 | + if (CameraPane.FULLSCREEN) |
---|
| 3218 | + fullscreenLayout = radio.layout; |
---|
| 3219 | + |
---|
2963 | 3220 | // bigThree.remove(scenePanel); |
---|
2964 | 3221 | // bigThree.remove(centralPanel); |
---|
2965 | 3222 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
2998 | 3255 | { |
---|
2999 | 3256 | radio.layout = fourButton; |
---|
3000 | 3257 | |
---|
| 3258 | + if (CameraPane.FULLSCREEN) |
---|
| 3259 | + fullscreenLayout = radio.layout; |
---|
| 3260 | + |
---|
3001 | 3261 | // bigThree.remove(scenePanel); |
---|
3002 | 3262 | // bigThree.remove(centralPanel); |
---|
3003 | 3263 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3034 | 3294 | if (source == sixButton) |
---|
3035 | 3295 | { |
---|
3036 | 3296 | radio.layout = sixButton; |
---|
| 3297 | + |
---|
| 3298 | + if (CameraPane.FULLSCREEN) |
---|
| 3299 | + fullscreenLayout = radio.layout; |
---|
3037 | 3300 | |
---|
3038 | 3301 | // bigThree.remove(scenePanel); |
---|
3039 | 3302 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3072 | 3335 | if (source == sevenButton) |
---|
3073 | 3336 | { |
---|
3074 | 3337 | radio.layout = sevenButton; |
---|
| 3338 | + |
---|
| 3339 | + if (CameraPane.FULLSCREEN) |
---|
| 3340 | + fullscreenLayout = radio.layout; |
---|
3075 | 3341 | |
---|
3076 | 3342 | // bigThree.remove(scenePanel); |
---|
3077 | 3343 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3128 | 3394 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3129 | 3395 | { |
---|
3130 | 3396 | ab = (cRadio)e.nextElement(); |
---|
3131 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3397 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3132 | 3398 | { |
---|
| 3399 | + // Patch to avoid bug with transparency. |
---|
| 3400 | + if (!ab.hadMaterial) |
---|
| 3401 | + { |
---|
| 3402 | + ab.object.material = null; |
---|
| 3403 | + } |
---|
| 3404 | + |
---|
3133 | 3405 | buttonGroup.remove(ab); |
---|
3134 | 3406 | radioPanel.remove(ab); |
---|
3135 | 3407 | |
---|
3136 | | - ab.GetObject().editWindow = null; |
---|
| 3408 | + //ab.GetObject().editWindow = null; |
---|
| 3409 | + ab.GetObject().manipWindow = null; |
---|
3137 | 3410 | // ab.GetObject().objectUI = null; // ????????? |
---|
3138 | 3411 | |
---|
3139 | 3412 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
.. | .. |
---|
3146 | 3419 | } else |
---|
3147 | 3420 | if (source == editItem || source == editButton) |
---|
3148 | 3421 | { |
---|
| 3422 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3423 | + { |
---|
| 3424 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3425 | + child.pinned = true; |
---|
| 3426 | + } |
---|
| 3427 | + |
---|
3149 | 3428 | EditSelection(false); |
---|
3150 | 3429 | } else |
---|
3151 | 3430 | if (source == uneditButton) |
---|
.. | .. |
---|
3155 | 3434 | Object3D child = (Object3D)e.nextElement(); |
---|
3156 | 3435 | if(child.editWindow != null) |
---|
3157 | 3436 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3437 | + child.pinned = false; |
---|
3158 | 3438 | child.CloseUI(); |
---|
3159 | 3439 | listUI.remove(child); |
---|
3160 | 3440 | |
---|
.. | .. |
---|
3171 | 3451 | //copy.ClearUI(); |
---|
3172 | 3452 | for (Object3D obj : listUI) |
---|
3173 | 3453 | { |
---|
| 3454 | + obj.pinned = false; |
---|
3174 | 3455 | obj.CloseUI(); |
---|
3175 | 3456 | } |
---|
3176 | 3457 | listUI.clear(); |
---|
.. | .. |
---|
3180 | 3461 | { |
---|
3181 | 3462 | assert(copy == group); |
---|
3182 | 3463 | |
---|
3183 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3464 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3184 | 3465 | |
---|
3185 | 3466 | for (Object3D obj : listUI) |
---|
3186 | 3467 | { |
---|
.. | .. |
---|
3229 | 3510 | } |
---|
3230 | 3511 | |
---|
3231 | 3512 | copy = group; |
---|
| 3513 | + |
---|
| 3514 | + SetUndoStates(); |
---|
| 3515 | + |
---|
3232 | 3516 | //Globals.theRenderer.object = group; |
---|
3233 | 3517 | if(!useclient) |
---|
3234 | 3518 | { |
---|
.. | .. |
---|
3247 | 3531 | |
---|
3248 | 3532 | // fix "+" issue |
---|
3249 | 3533 | //group.editWindow = this; |
---|
| 3534 | + group.manipWindow = this; |
---|
3250 | 3535 | |
---|
3251 | 3536 | /* |
---|
3252 | 3537 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3254 | 3539 | currentLayout = sevenButton; |
---|
3255 | 3540 | */ |
---|
3256 | 3541 | radio.layout.doClick(); |
---|
| 3542 | + |
---|
| 3543 | + ClearUnpinned(); |
---|
| 3544 | + SetPinStates(group.selection.size() > 0); |
---|
| 3545 | + if (group.selection.size() == 1) |
---|
| 3546 | + EditSelection(false); |
---|
3257 | 3547 | keepparent = group.parent; |
---|
3258 | 3548 | // PARENT = NULL or not??? |
---|
3259 | 3549 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3267 | 3557 | cameraView.ProtectCamera(); |
---|
3268 | 3558 | cameraView.repaint(); |
---|
3269 | 3559 | return; |
---|
3270 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3560 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3271 | 3561 | { |
---|
3272 | 3562 | cameraView.RevertCamera(); |
---|
3273 | 3563 | cameraView.repaint(); |
---|
.. | .. |
---|
4321 | 4611 | // } |
---|
4322 | 4612 | // } |
---|
4323 | 4613 | |
---|
4324 | | - static boolean allparams = true; |
---|
4325 | | - |
---|
4326 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4327 | | - |
---|
4328 | 4614 | void EditSelection(boolean newWindow) |
---|
4329 | 4615 | { |
---|
4330 | 4616 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4332 | 4618 | { |
---|
4333 | 4619 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4334 | 4620 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4335 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4621 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4336 | 4622 | |
---|
4337 | 4623 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4338 | 4624 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4417 | 4703 | //new Exception().printStackTrace(); |
---|
4418 | 4704 | |
---|
4419 | 4705 | freezemodel = true; |
---|
4420 | | - |
---|
| 4706 | + ClearUnpinned(); |
---|
| 4707 | + |
---|
4421 | 4708 | /**/ |
---|
4422 | 4709 | //switch (event.id) |
---|
4423 | 4710 | { |
---|
.. | .. |
---|
4450 | 4737 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4451 | 4738 | // a camera |
---|
4452 | 4739 | { |
---|
4453 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4740 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4454 | 4741 | { |
---|
4455 | 4742 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4456 | 4743 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4459 | 4746 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4460 | 4747 | } |
---|
4461 | 4748 | |
---|
| 4749 | + if (tps != null && tps.length == 1) |
---|
| 4750 | + { |
---|
| 4751 | + EditSelection(false); |
---|
| 4752 | + } |
---|
| 4753 | + |
---|
| 4754 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4755 | + |
---|
4462 | 4756 | refreshContents(); |
---|
4463 | 4757 | //return true; |
---|
4464 | 4758 | } |
---|
.. | .. |
---|
4468 | 4762 | freezemodel = false; |
---|
4469 | 4763 | } |
---|
4470 | 4764 | |
---|
| 4765 | + void SetPinStates(boolean enabled) |
---|
| 4766 | + { |
---|
| 4767 | + editButton.setEnabled(enabled); |
---|
| 4768 | + uneditButton.setEnabled(enabled); |
---|
| 4769 | + unselectButton.setEnabled(enabled); |
---|
| 4770 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4771 | + } |
---|
| 4772 | + |
---|
4471 | 4773 | void refreshContents(boolean cp) |
---|
4472 | 4774 | { |
---|
4473 | | - if (!Globals.MOUSEDRAGGED) |
---|
| 4775 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4776 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4474 | 4777 | { |
---|
4475 | 4778 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4476 | 4779 | |
---|
.. | .. |
---|
4569 | 4872 | |
---|
4570 | 4873 | if (cut) |
---|
4571 | 4874 | { |
---|
4572 | | - Save(); |
---|
| 4875 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4876 | +// Save(); |
---|
4573 | 4877 | //int indices[] = jList.getSelectedIndices(); |
---|
4574 | 4878 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4575 | 4879 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4672 | 4976 | |
---|
4673 | 4977 | void paste(boolean expand) |
---|
4674 | 4978 | { |
---|
| 4979 | + if (Globals.REPLACEONMAKE) |
---|
| 4980 | + Save(); |
---|
| 4981 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4982 | + Globals.REPLACEONMAKE = false; |
---|
4675 | 4983 | // if (GrafreeD.clipboard == null) |
---|
4676 | 4984 | // return; |
---|
4677 | 4985 | boolean first = true; |
---|
.. | .. |
---|
4731 | 5039 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4732 | 5040 | } |
---|
4733 | 5041 | |
---|
| 5042 | + Globals.REPLACEONMAKE = keep; |
---|
4734 | 5043 | ResetModel(); |
---|
4735 | 5044 | refreshContents(); |
---|
4736 | 5045 | } |
---|
.. | .. |
---|
4866 | 5175 | |
---|
4867 | 5176 | void group(Object3D csg, boolean grab) |
---|
4868 | 5177 | { |
---|
| 5178 | + if (Globals.REPLACEONMAKE) |
---|
| 5179 | + Save(); |
---|
| 5180 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5181 | + Globals.REPLACEONMAKE = false; |
---|
4869 | 5182 | if (//false) // why?? |
---|
4870 | 5183 | !group.selection.isEmpty()) |
---|
4871 | 5184 | { |
---|
.. | .. |
---|
4979 | 5292 | //node.add(csg); |
---|
4980 | 5293 | //makeSomething(node); |
---|
4981 | 5294 | makeSomething(csg); |
---|
| 5295 | + Globals.REPLACEONMAKE = keep; |
---|
4982 | 5296 | } |
---|
4983 | 5297 | |
---|
4984 | 5298 | void Ungroup(Object3D g) |
---|
4985 | 5299 | { |
---|
| 5300 | + if (Globals.REPLACEONMAKE) |
---|
| 5301 | + Save(); |
---|
| 5302 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5303 | + Globals.REPLACEONMAKE = false; |
---|
4986 | 5304 | if (g instanceof HiddenObject) |
---|
4987 | 5305 | { |
---|
4988 | 5306 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4999 | 5317 | objEditor.makeSomething(g.get(i), false); |
---|
5000 | 5318 | } |
---|
5001 | 5319 | } |
---|
| 5320 | + Globals.REPLACEONMAKE = keep; |
---|
5002 | 5321 | } |
---|
5003 | 5322 | |
---|
5004 | 5323 | void ungroup() |
---|
.. | .. |
---|
5287 | 5606 | cButton clearpanelButton; |
---|
5288 | 5607 | cButton unselectButton; |
---|
5289 | 5608 | |
---|
5290 | | - cButton minButton; |
---|
5291 | | - cButton maxButton; |
---|
5292 | | - cButton fullButton; |
---|
5293 | | - cButton undoButton; |
---|
5294 | | - cButton redoButton; |
---|
| 5609 | + cButton restoreCameraButton; |
---|
| 5610 | + |
---|
5295 | 5611 | cButton saveButton; |
---|
5296 | 5612 | cButton oneStepButton; |
---|
| 5613 | + |
---|
| 5614 | + cButton groupButton; |
---|
| 5615 | + cButton ungroupButton; |
---|
| 5616 | + cButton compositeButton; |
---|
| 5617 | + cButton switchButton; |
---|
| 5618 | + cButton loopButton; |
---|
| 5619 | + cButton textureButton; |
---|
| 5620 | + |
---|
| 5621 | + cButton gridButton; |
---|
| 5622 | + cButton boxButton; |
---|
| 5623 | + cButton sphereButton; |
---|
| 5624 | + cButton coneButton; |
---|
| 5625 | + cButton torusButton; |
---|
| 5626 | + cButton superButton; |
---|
| 5627 | + cButton kleinButton; |
---|
| 5628 | + cButton particlesButton; |
---|
| 5629 | + cButton overlayButton; |
---|
| 5630 | + cButton lightButton; |
---|
5297 | 5631 | |
---|
5298 | 5632 | cButton screenfitButton; |
---|
5299 | 5633 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5315 | 5649 | //JTree jTree; |
---|
5316 | 5650 | private MenuItem lookAtItem; |
---|
5317 | 5651 | private MenuItem lookFromItem; |
---|
5318 | | - private MenuItem switchItem; |
---|
| 5652 | + private MenuItem switchViewItem; |
---|
5319 | 5653 | private MenuItem cutItem; |
---|
5320 | 5654 | private MenuItem undoItem; |
---|
5321 | 5655 | private MenuItem redoItem; |
---|
5322 | | - private MenuItem duplicateItem; |
---|
| 5656 | + private JMenuItem duplicateItem; |
---|
5323 | 5657 | private MenuItem cloneItem; |
---|
5324 | 5658 | private MenuItem cloneSupportItem; |
---|
5325 | 5659 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5407 | 5741 | private MenuItem frontItem; |
---|
5408 | 5742 | private MenuItem cameraItem; |
---|
5409 | 5743 | private MenuItem compositeItem; |
---|
5410 | | - private MenuItem randomItem; |
---|
| 5744 | + private MenuItem switchItem; |
---|
5411 | 5745 | private MenuItem physicsItem; |
---|
5412 | 5746 | private MenuItem frameselectorItem; |
---|
5413 | 5747 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5481 | 5815 | |
---|
5482 | 5816 | Menu cameraMenu; |
---|
5483 | 5817 | MenuItem editCameraItem; |
---|
5484 | | - MenuItem revertCameraItem; |
---|
| 5818 | + MenuItem restoreCameraItem; |
---|
5485 | 5819 | } |
---|