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