.. | .. |
---|
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")); |
---|
.. | .. |
---|
502 | 528 | attachBumpItem.addActionListener(this); |
---|
503 | 529 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
504 | 530 | pigmentBumpItem.addActionListener(this); |
---|
| 531 | + //embedTexturesItem |
---|
505 | 532 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
506 | 533 | detachPigmentItem.addActionListener(this); |
---|
507 | 534 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
508 | 535 | detachBumpItem.addActionListener(this); |
---|
| 536 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 537 | + embedTexturesItem.addActionListener(this); |
---|
| 538 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 539 | + deEmbedTexturesItem.addActionListener(this); |
---|
509 | 540 | menu.add("-"); |
---|
510 | 541 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
511 | 542 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
532 | 563 | buildToolsMenu(menu); |
---|
533 | 564 | } |
---|
534 | 565 | |
---|
| 566 | + |
---|
535 | 567 | void SetupUI2(ObjEditor oe) |
---|
536 | 568 | { |
---|
537 | 569 | // June 2019 |
---|
.. | .. |
---|
574 | 606 | oe.radioPanel.add(dummyButton); |
---|
575 | 607 | oe.buttonGroup.add(dummyButton); |
---|
576 | 608 | */ |
---|
| 609 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 610 | + |
---|
| 611 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 612 | + |
---|
577 | 613 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
578 | 614 | |
---|
579 | 615 | //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
580 | 616 | //minButton.setToolTipText("Minimize window"); |
---|
581 | 617 | //minButton.addActionListener(this); |
---|
582 | 618 | |
---|
583 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
584 | | - maxButton.setToolTipText("Maximize window"); |
---|
585 | | - maxButton.addActionListener(this); |
---|
| 619 | + if (Globals.ADVANCED) |
---|
| 620 | + { |
---|
| 621 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 622 | + maxButton.setToolTipText("Maximize window"); |
---|
| 623 | + maxButton.addActionListener(this); |
---|
| 624 | + } |
---|
586 | 625 | |
---|
587 | 626 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
588 | 627 | fullButton.setToolTipText("Full-screen window"); |
---|
589 | 628 | fullButton.addActionListener(this); |
---|
590 | 629 | |
---|
591 | | - oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
592 | | - undoButton.setToolTipText("Undo changes"); |
---|
593 | | - undoButton.addActionListener(this); |
---|
| 630 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 631 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 632 | + screenfitButton.addActionListener(this); |
---|
| 633 | + |
---|
| 634 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 635 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 636 | + restoreCameraButton.addActionListener(this); |
---|
594 | 637 | |
---|
595 | | - oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | | - redoButton.setToolTipText("Redo changes"); |
---|
597 | | - redoButton.addActionListener(this); |
---|
598 | | - |
---|
599 | | - oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | | - saveButton.setToolTipText("Save changes"); |
---|
| 638 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + saveButton.setToolTipText("New version"); |
---|
601 | 640 | saveButton.addActionListener(this); |
---|
| 641 | + |
---|
| 642 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 643 | + undoButton.setToolTipText("Previous version"); |
---|
| 644 | + undoButton.addActionListener(this); |
---|
| 645 | + undoButton.setEnabled(false); |
---|
602 | 646 | |
---|
603 | | - oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 647 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 648 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + restoreButton.setToolTipText("Restore current"); |
---|
| 650 | + restoreButton.addActionListener(this); |
---|
| 651 | + restoreButton.setEnabled(false); |
---|
| 652 | + |
---|
| 653 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + replaceButton.setToolTipText("Replace current"); |
---|
| 655 | + replaceButton.addActionListener(this); |
---|
| 656 | + replaceButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + copyOptionsPanel.add(updown); |
---|
| 659 | + |
---|
| 660 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + redoButton.setToolTipText("Next version"); |
---|
| 662 | + redoButton.addActionListener(this); |
---|
| 663 | + redoButton.setEnabled(false); |
---|
| 664 | + |
---|
| 665 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
604 | 666 | liveCB.setToolTipText("Enable animation"); |
---|
605 | 667 | liveCB.addItemListener(this); |
---|
606 | 668 | |
---|
607 | | - oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
608 | | - fastCB.setToolTipText("Fast mode"); |
---|
609 | | - fastCB.addItemListener(this); |
---|
610 | | - |
---|
611 | 669 | oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
612 | 670 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
613 | 671 | oneStepButton.addActionListener(this); |
---|
614 | 672 | |
---|
615 | | - oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
616 | | - trackCB.setToolTipText("Enable tracking"); |
---|
617 | | - trackCB.addItemListener(this); |
---|
618 | | - |
---|
619 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
620 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
621 | | - screenfitButton.addActionListener(this); |
---|
| 673 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 674 | + fastCB.setToolTipText("Fast mode"); |
---|
| 675 | + fastCB.addItemListener(this); |
---|
| 676 | + |
---|
| 677 | + //oe.toolboxPanel.Return(); |
---|
| 678 | + |
---|
| 679 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 680 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 681 | +// trackCB.addItemListener(this); |
---|
622 | 682 | |
---|
623 | 683 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
624 | 684 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
628 | 688 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
629 | 689 | snapobjectButton.addActionListener(this); |
---|
630 | 690 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 691 | + |
---|
| 692 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + fourButton.addActionListener(this); |
---|
| 694 | + fourButton.setToolTipText("Show control panel only"); |
---|
631 | 695 | } |
---|
632 | 696 | |
---|
633 | | - oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - flashSelectionButton.setToolTipText("Highlight selection"); |
---|
635 | | - flashSelectionButton.addActionListener(this); |
---|
| 697 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
636 | 698 | |
---|
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"); |
---|
| 699 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 700 | + twoButton.setToolTipText("Show 3D view only"); |
---|
641 | 701 | twoButton.addActionListener(this); |
---|
642 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
643 | | - fourButton.addActionListener(this); |
---|
644 | | - fourButton.setToolTipText("Show left panel only"); |
---|
645 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
646 | | - sixButton.setToolTipText("2-column layout left"); |
---|
647 | | - sixButton.addActionListener(this); |
---|
648 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
649 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 702 | + this.fullscreenLayout = twoButton; |
---|
| 703 | + |
---|
| 704 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 705 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
650 | 706 | threeButton.addActionListener(this); |
---|
651 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
652 | | - sevenButton.setToolTipText("3-column layout"); |
---|
653 | | - sevenButton.addActionListener(this); |
---|
| 707 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 709 | + sixButton.addActionListener(this); |
---|
| 710 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 712 | +// sevenButton.addActionListener(this); |
---|
654 | 713 | // |
---|
655 | 714 | |
---|
656 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
657 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 715 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 716 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
658 | 717 | rootButton.addActionListener(this); |
---|
659 | 718 | |
---|
660 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
661 | 720 | closeButton.setToolTipText("Close tab"); |
---|
662 | 721 | closeButton.addActionListener(this); |
---|
663 | 722 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
664 | 723 | //clearButton.addActionListener(this); |
---|
665 | | - |
---|
666 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
667 | | - editButton.setToolTipText("Edit selection"); |
---|
| 724 | + |
---|
| 725 | + // INSERT |
---|
| 726 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + gridButton.setToolTipText("Create grid"); |
---|
| 728 | + gridButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 731 | + boxButton.setToolTipText("Create box"); |
---|
| 732 | + boxButton.addActionListener(this); |
---|
| 733 | + |
---|
| 734 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 735 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 736 | + sphereButton.addActionListener(this); |
---|
| 737 | + |
---|
| 738 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 739 | + coneButton.setToolTipText("Create cone"); |
---|
| 740 | + coneButton.addActionListener(this); |
---|
| 741 | + |
---|
| 742 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 743 | + torusButton.setToolTipText("Create torus"); |
---|
| 744 | + torusButton.addActionListener(this); |
---|
| 745 | + |
---|
| 746 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 747 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 748 | + superButton.addActionListener(this); |
---|
| 749 | + |
---|
| 750 | + if (Globals.ADVANCED) |
---|
| 751 | + { |
---|
| 752 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 753 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 754 | + kleinButton.addActionListener(this); |
---|
| 755 | + } |
---|
| 756 | + |
---|
| 757 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 758 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 759 | + particlesButton.addActionListener(this); |
---|
| 760 | + |
---|
| 761 | + oe.toolboxPanel.Return(); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + groupButton.setToolTipText("Create group"); |
---|
| 765 | + groupButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + compositeButton.setToolTipText("Create composite"); |
---|
| 769 | + compositeButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 772 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 773 | + switchButton.addActionListener(this); |
---|
| 774 | + |
---|
| 775 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 776 | + loopButton.setToolTipText("Create loop"); |
---|
| 777 | + loopButton.addActionListener(this); |
---|
| 778 | + |
---|
| 779 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + textureButton.setToolTipText("Create texture"); |
---|
| 781 | + textureButton.addActionListener(this); |
---|
| 782 | + |
---|
| 783 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 784 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 785 | + overlayButton.addActionListener(this); |
---|
| 786 | + |
---|
| 787 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 788 | + lightButton.setToolTipText("Create light"); |
---|
| 789 | + lightButton.addActionListener(this); |
---|
| 790 | + |
---|
| 791 | + for (int i=6; --i>=0;) |
---|
| 792 | + { |
---|
| 793 | + oe.toolboxPanel.Return(); |
---|
| 794 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 795 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 796 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 797 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 798 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 799 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 800 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 801 | + } |
---|
| 802 | + |
---|
| 803 | + // EDIT panel |
---|
| 804 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + editButton.setToolTipText("Pin selection controls"); |
---|
668 | 806 | editButton.addActionListener(this); |
---|
669 | 807 | |
---|
670 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
671 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 808 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 809 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
672 | 810 | uneditButton.addActionListener(this); |
---|
673 | 811 | |
---|
674 | 812 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
675 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 813 | + allParamsButton.setToolTipText("Show all controle"); |
---|
676 | 814 | allParamsButton.addActionListener(this); |
---|
677 | 815 | |
---|
678 | 816 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
683 | 821 | unselectButton.setToolTipText("Unselect"); |
---|
684 | 822 | unselectButton.addActionListener(this); |
---|
685 | 823 | |
---|
| 824 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 825 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 826 | + flashSelectionButton.addActionListener(this); |
---|
| 827 | + |
---|
686 | 828 | editCommandsPanel.preferredHeight = 1; |
---|
687 | 829 | |
---|
| 830 | + SetPinStates(false); |
---|
688 | 831 | // oe.treePanel.add(commandsPanel); |
---|
689 | 832 | // oe.treePanel.Return(); |
---|
690 | 833 | |
---|
.. | .. |
---|
703 | 846 | |
---|
704 | 847 | JScrollPane jSP; |
---|
705 | 848 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
706 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 849 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
707 | 850 | ResetModel(); |
---|
708 | 851 | |
---|
709 | 852 | oe.treePanel.add(jSPPanel); |
---|
710 | 853 | oe.treePanel.Return(); |
---|
711 | 854 | |
---|
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 | 855 | oe.treePanel.add(copyOptionsPanel); |
---|
728 | 856 | oe.treePanel.Return(); |
---|
| 857 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 858 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 859 | + sliderPane.preferredHeight = 1; |
---|
729 | 860 | |
---|
730 | 861 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
731 | 862 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
748 | 879 | dgr.addDragGestureListener(this); |
---|
749 | 880 | }catch(Exception e) {} |
---|
750 | 881 | */ |
---|
751 | | - radio.layout = sevenButton; |
---|
| 882 | + radio.layout = sixButton; // sevenButton; |
---|
752 | 883 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
753 | 884 | } |
---|
754 | 885 | |
---|
755 | 886 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
756 | 887 | { |
---|
| 888 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 889 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 890 | + colorCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 893 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 894 | + materialCB.addItemListener(this); |
---|
| 895 | + |
---|
| 896 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 897 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 898 | + textureCB.addItemListener(this); |
---|
| 899 | + |
---|
| 900 | + panel.Return(); |
---|
| 901 | + |
---|
757 | 902 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
758 | 903 | boxCB.setToolTipText("Display bounding boxes"); |
---|
759 | 904 | boxCB.addItemListener(this); |
---|
760 | 905 | |
---|
761 | 906 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
762 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 907 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
763 | 908 | zoomBoxCB.addItemListener(this); |
---|
764 | 909 | |
---|
765 | 910 | if (true) // Globals.ADVANCED) |
---|
766 | 911 | { |
---|
767 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
768 | | - supportCB.setToolTipText("Enable rigging"); |
---|
769 | | - supportCB.addItemListener(this); |
---|
| 912 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 913 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 914 | +// supportCB.addItemListener(this); |
---|
| 915 | + |
---|
| 916 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 917 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 918 | + freezeCB.addItemListener(this); |
---|
770 | 919 | |
---|
771 | 920 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
772 | 921 | // localCB.addItemListener(this); |
---|
773 | 922 | |
---|
| 923 | + panel.Return(); |
---|
| 924 | + |
---|
774 | 925 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
775 | 926 | crowdCB.setToolTipText("Used for crowds"); |
---|
776 | 927 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
787 | 938 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
788 | 939 | // speakerMocapCB.addItemListener(this); |
---|
789 | 940 | |
---|
| 941 | + panel.Return(); |
---|
| 942 | + |
---|
790 | 943 | if (false) |
---|
791 | 944 | { |
---|
792 | 945 | // handled in scripts |
---|
.. | .. |
---|
801 | 954 | //constraints.gridy += 1; |
---|
802 | 955 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
803 | 956 | smoothfocusCB.addItemListener(this); |
---|
| 957 | + panel.Return(); |
---|
804 | 958 | } |
---|
805 | 959 | |
---|
806 | 960 | //constraints.gridx += 1; |
---|
807 | 961 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
808 | 962 | // debugCB.addItemListener(this); |
---|
809 | 963 | |
---|
| 964 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 965 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 966 | + trackCB.addItemListener(this); |
---|
| 967 | + |
---|
810 | 968 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
811 | | - oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 969 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
812 | 970 | oeilCB.addItemListener(this); |
---|
813 | 971 | |
---|
814 | 972 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
815 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 973 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
816 | 974 | shadowCB.addItemListener(this); |
---|
817 | 975 | |
---|
818 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
819 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
820 | | - autosaveCB.addItemListener(this); |
---|
| 976 | + panel.Return(); |
---|
| 977 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 978 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 979 | + toggleTextureCB.addItemListener(this); |
---|
| 980 | + |
---|
| 981 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 982 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 983 | + toggleSwitchCB.addItemListener(this); |
---|
| 984 | + |
---|
| 985 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 986 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 987 | + autokeepCB.addItemListener(this); |
---|
821 | 988 | |
---|
| 989 | + panel.Return(); |
---|
822 | 990 | if (Globals.ADVANCED) |
---|
823 | 991 | { |
---|
824 | 992 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
.. | .. |
---|
829 | 997 | } |
---|
830 | 998 | |
---|
831 | 999 | cGridBag fill = new cGridBag(); |
---|
832 | | - |
---|
833 | 1000 | fill.preferredHeight = 200; |
---|
| 1001 | + cGridBag fill2 = new cGridBag(); |
---|
| 1002 | + fill2.preferredHeight = 200; |
---|
| 1003 | + cGridBag fill3 = new cGridBag(); |
---|
| 1004 | + fill3.preferredHeight = 200; |
---|
834 | 1005 | |
---|
835 | 1006 | panel.add(fill); |
---|
| 1007 | + panel.add(fill2); |
---|
| 1008 | + panel.add(fill3); |
---|
836 | 1009 | |
---|
837 | 1010 | } |
---|
838 | 1011 | |
---|
.. | .. |
---|
840 | 1013 | { |
---|
841 | 1014 | cRadio radioButton = new cRadio(obj.name); |
---|
842 | 1015 | |
---|
843 | | - // Patch to avoid bug with transparency. |
---|
| 1016 | + // June 2019. Patch to avoid bug with transparency. |
---|
844 | 1017 | radioButton.hadMaterial = obj.material != null; |
---|
845 | 1018 | if (!radioButton.hadMaterial) |
---|
846 | 1019 | { |
---|
.. | .. |
---|
848 | 1021 | } |
---|
849 | 1022 | |
---|
850 | 1023 | radioButton.SetObject(obj); |
---|
851 | | - radioButton.layout = sevenButton; |
---|
| 1024 | + radioButton.layout = sixButton; // sevenButton; |
---|
852 | 1025 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
853 | 1026 | radioButton.addActionListener(this); |
---|
854 | 1027 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
868 | 1041 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
869 | 1042 | } |
---|
870 | 1043 | |
---|
871 | | - cCheckBox liveCB; |
---|
| 1044 | + cToggleButton liveCB; |
---|
872 | 1045 | cCheckBox supportCB; |
---|
873 | 1046 | cCheckBox localCB; |
---|
874 | 1047 | cCheckBox crowdCB; |
---|
875 | 1048 | cCheckBox smoothCB; |
---|
876 | | - cCheckBox fastCB; |
---|
| 1049 | + cToggleButton fastCB; |
---|
877 | 1050 | cCheckBox slowCB; |
---|
878 | 1051 | cCheckBox boxCB; |
---|
879 | 1052 | cCheckBox zoomBoxCB; |
---|
| 1053 | + cCheckBox freezeCB; |
---|
| 1054 | + //cToggleButton trackCB; |
---|
880 | 1055 | cCheckBox trackCB; |
---|
881 | 1056 | cCheckBox smoothfocusCB; |
---|
882 | 1057 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
886 | 1061 | |
---|
887 | 1062 | cCheckBox oeilCB; |
---|
888 | 1063 | cCheckBox shadowCB; |
---|
889 | | - cCheckBox autosaveCB; |
---|
| 1064 | + cCheckBox autokeepCB; |
---|
890 | 1065 | cCheckBox lookAtCB; |
---|
891 | 1066 | |
---|
892 | 1067 | // static int COLOR = 1; |
---|
.. | .. |
---|
994 | 1169 | { |
---|
995 | 1170 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
996 | 1171 | } |
---|
997 | | - else if(e.getSource() == autosaveCB) |
---|
| 1172 | + else if(e.getSource() == freezeCB) |
---|
998 | 1173 | { |
---|
999 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1174 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1175 | + } |
---|
| 1176 | + else if(e.getSource() == autokeepCB) |
---|
| 1177 | + { |
---|
| 1178 | + Globals.REPLACEONMAKE ^= true; |
---|
1000 | 1179 | } |
---|
1001 | 1180 | else if(e.getSource() == lookAtCB) |
---|
1002 | 1181 | { |
---|
.. | .. |
---|
1014 | 1193 | |
---|
1015 | 1194 | /**/ |
---|
1016 | 1195 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
1017 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1196 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1197 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
1018 | 1198 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
1019 | 1199 | // We can't move the root node or an empty selection |
---|
1020 | 1200 | return; |
---|
.. | .. |
---|
1077 | 1257 | } |
---|
1078 | 1258 | } |
---|
1079 | 1259 | |
---|
1080 | | - String string = (String) object; |
---|
1081 | | - |
---|
1082 | 1260 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1083 | 1261 | // if( object instanceof java.io.File[]) |
---|
1084 | 1262 | // { |
---|
.. | .. |
---|
1086 | 1264 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1087 | 1265 | // return; |
---|
1088 | 1266 | // } |
---|
| 1267 | + |
---|
| 1268 | + String string = object.toString(); |
---|
1089 | 1269 | |
---|
1090 | 1270 | // File path for Mac and Windows |
---|
1091 | 1271 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1131 | 1311 | |
---|
1132 | 1312 | assert target == objEditor.jTree; |
---|
1133 | 1313 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1314 | + Object3D destinationLeaf; |
---|
1134 | 1315 | try { |
---|
1135 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1316 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1136 | 1317 | } catch (Exception e) { |
---|
1137 | 1318 | System.out.println("destinationPath : " + destinationPath); |
---|
1138 | 1319 | return; |
---|
1139 | 1320 | } |
---|
1140 | 1321 | |
---|
1141 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1322 | + for (int i=group.selection.size(); --i>=0;) |
---|
1142 | 1323 | { |
---|
| 1324 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1325 | + |
---|
| 1326 | + // Cannot move into itself |
---|
| 1327 | + if (child == destinationLeaf) |
---|
| 1328 | + return; |
---|
| 1329 | + } |
---|
| 1330 | + |
---|
| 1331 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1332 | +// { |
---|
1143 | 1333 | loadClipboard(true); |
---|
1144 | 1334 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1145 | 1335 | pasteInto(false, false); |
---|
1146 | | - } else { |
---|
1147 | | - loadClipboard(false); |
---|
1148 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1149 | | - pasteInto(false, false); // true); // ??? |
---|
1150 | | - } |
---|
| 1336 | +// } else { |
---|
| 1337 | +// loadClipboard(false); |
---|
| 1338 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1339 | +// pasteInto(false, false); // true); // ??? |
---|
| 1340 | +// } |
---|
1151 | 1341 | } |
---|
1152 | 1342 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1153 | 1343 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1252 | 1442 | { |
---|
1253 | 1443 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1254 | 1444 | //heightFieldItem.addActionListener(this); |
---|
1255 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1256 | | - gridItem.addActionListener(this); |
---|
1257 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1258 | | - rectoidItem.addActionListener(this); |
---|
1259 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1260 | | - ellipsoidItem.addActionListener(this); |
---|
1261 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1262 | | - coneItem.addActionListener(this); |
---|
1263 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1264 | | - torusItem.addActionListener(this); |
---|
1265 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1266 | | - superItem.addActionListener(this); |
---|
| 1445 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1446 | +// gridItem.addActionListener(this); |
---|
| 1447 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1448 | +// rectoidItem.addActionListener(this); |
---|
| 1449 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1450 | +// ellipsoidItem.addActionListener(this); |
---|
| 1451 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1452 | +// coneItem.addActionListener(this); |
---|
| 1453 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1454 | +// torusItem.addActionListener(this); |
---|
| 1455 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1456 | +// superItem.addActionListener(this); |
---|
| 1457 | + |
---|
| 1458 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1459 | + cameraItem.addActionListener(this); |
---|
| 1460 | + |
---|
| 1461 | + if (!Globals.ADVANCED) |
---|
| 1462 | + { |
---|
1267 | 1463 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1268 | 1464 | kleinItem.addActionListener(this); |
---|
1269 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1270 | | - particleItem.addActionListener(this); |
---|
| 1465 | + } |
---|
| 1466 | + |
---|
| 1467 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1468 | +// particleItem.addActionListener(this); |
---|
1271 | 1469 | if (Globals.ADVANCED) |
---|
1272 | 1470 | { |
---|
1273 | 1471 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1293 | 1491 | } |
---|
1294 | 1492 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1295 | 1493 | bezierItem.addActionListener(this); |
---|
1296 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1297 | | - overlayItem.addActionListener(this); |
---|
1298 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1299 | | - lightItem.addActionListener(this); |
---|
| 1494 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1495 | +// overlayItem.addActionListener(this); |
---|
| 1496 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1497 | +// lightItem.addActionListener(this); |
---|
1300 | 1498 | menu.add("-"); |
---|
1301 | 1499 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1302 | 1500 | //superLoopItem.addActionListener(this); |
---|
1303 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1304 | | - loopItem.addActionListener(this); |
---|
| 1501 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1502 | +// loopItem.addActionListener(this); |
---|
1305 | 1503 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1306 | 1504 | doubleItem.addActionListener(this); |
---|
1307 | 1505 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1317 | 1515 | animationItem.addItemListener(this); |
---|
1318 | 1516 | animationItem.setState(Globals.ANIMATION); |
---|
1319 | 1517 | |
---|
| 1518 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1519 | + archiveItem.addActionListener(this); |
---|
| 1520 | + |
---|
1320 | 1521 | menu.add("-"); |
---|
1321 | 1522 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1322 | 1523 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1329 | 1530 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1330 | 1531 | reduce34MorphItem.addActionListener(this); |
---|
1331 | 1532 | menu.add("-"); |
---|
| 1533 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1534 | + memoryItem.addActionListener(this); |
---|
1332 | 1535 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1333 | 1536 | computeAOItem.addActionListener(this); |
---|
1334 | 1537 | |
---|
.. | .. |
---|
1337 | 1540 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1338 | 1541 | mirrorItem.addActionListener(this); |
---|
1339 | 1542 | menu.add("-"); |
---|
1340 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1341 | | - memoryItem.addActionListener(this); |
---|
1342 | 1543 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1343 | 1544 | analyzeItem.addActionListener(this); |
---|
1344 | 1545 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1486 | 1687 | |
---|
1487 | 1688 | makeSomething(shadow); |
---|
1488 | 1689 | } |
---|
| 1690 | + |
---|
| 1691 | + private void ClearUnpinned() |
---|
| 1692 | + { |
---|
| 1693 | + //for (Object3D obj : listUI) |
---|
| 1694 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1695 | + { |
---|
| 1696 | + Object3D obj = listUI.elementAt(i); |
---|
| 1697 | + if (!obj.pinned) |
---|
| 1698 | + { |
---|
| 1699 | + obj.CloseUI(); |
---|
| 1700 | + listUI.remove(i); |
---|
| 1701 | + } |
---|
| 1702 | + } |
---|
| 1703 | + } |
---|
| 1704 | + |
---|
| 1705 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1706 | + { |
---|
| 1707 | + // if (!(elem instanceof Composite)) |
---|
| 1708 | + // newWindow = false; |
---|
| 1709 | + listUI.add(elem); |
---|
| 1710 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1711 | + System.out.println("edit : " + elem); |
---|
| 1712 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1713 | + } |
---|
1489 | 1714 | |
---|
1490 | 1715 | /** |
---|
1491 | 1716 | * applyExample |
---|
.. | .. |
---|
1730 | 1955 | { |
---|
1731 | 1956 | ScreenFit(); |
---|
1732 | 1957 | } else |
---|
1733 | | - if (source == switchItem) |
---|
| 1958 | + if (source == switchViewItem) |
---|
1734 | 1959 | { |
---|
1735 | 1960 | cVector v1 = new cVector(); |
---|
1736 | 1961 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1739 | 1964 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1740 | 1965 | objEditor.cameraView.repaint(); |
---|
1741 | 1966 | } else |
---|
1742 | | - if (source == rectoidItem) |
---|
| 1967 | + if (source == rectoidItem || source == boxButton) |
---|
1743 | 1968 | { |
---|
1744 | 1969 | makeSomething(new Box()); |
---|
1745 | 1970 | } else |
---|
1746 | | - if (source == particleItem) |
---|
| 1971 | + if (source == particleItem || source == particlesButton) |
---|
1747 | 1972 | { |
---|
1748 | 1973 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1749 | 1974 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1822 | 2047 | |
---|
1823 | 2048 | makeSomething(obj); |
---|
1824 | 2049 | } else |
---|
1825 | | - if (source == gridItem) |
---|
| 2050 | + if (source == gridItem || source == gridButton) |
---|
1826 | 2051 | { |
---|
1827 | 2052 | makeSomething(new Grid()); |
---|
1828 | 2053 | } else |
---|
1829 | | - if (source == ellipsoidItem) |
---|
| 2054 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1830 | 2055 | { |
---|
1831 | 2056 | makeSomething(new Sphere()); |
---|
1832 | 2057 | } else |
---|
1833 | | - if (source == coneItem) |
---|
| 2058 | + if (source == coneItem || source == coneButton) |
---|
1834 | 2059 | { |
---|
1835 | 2060 | makeSomething(new Cone()); |
---|
1836 | 2061 | } else |
---|
1837 | | - if (source == torusItem) |
---|
| 2062 | + if (source == torusItem || source == torusButton) |
---|
1838 | 2063 | { |
---|
1839 | 2064 | makeSomething(new Torus()); |
---|
1840 | 2065 | } else |
---|
1841 | | - if (source == superItem) |
---|
| 2066 | + if (source == superItem || source == superButton) |
---|
1842 | 2067 | { |
---|
1843 | 2068 | makeSomething(new Superellipsoid()); |
---|
1844 | 2069 | } else |
---|
1845 | | - if (source == kleinItem) |
---|
| 2070 | + if (source == kleinItem || source == kleinButton) |
---|
1846 | 2071 | { |
---|
1847 | 2072 | makeSomething(new Klein()); |
---|
1848 | 2073 | } else |
---|
.. | .. |
---|
1862 | 2087 | { |
---|
1863 | 2088 | makeSomething(new BezierSurface()); |
---|
1864 | 2089 | } else |
---|
1865 | | - if (source == overlayItem) |
---|
| 2090 | + if (source == overlayItem || source == overlayButton) |
---|
1866 | 2091 | { |
---|
1867 | 2092 | /* |
---|
1868 | 2093 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1910 | 2135 | s.setup(); |
---|
1911 | 2136 | makeSomething(s); |
---|
1912 | 2137 | } else |
---|
1913 | | - if (source == lightItem) |
---|
| 2138 | + if (source == lightItem || source == lightButton) |
---|
1914 | 2139 | { |
---|
1915 | 2140 | makeSomething(new Light()); |
---|
1916 | 2141 | } else |
---|
.. | .. |
---|
1960 | 2185 | |
---|
1961 | 2186 | group(g); |
---|
1962 | 2187 | } else |
---|
1963 | | - if (source == loopItem) |
---|
| 2188 | + if (source == loopItem || source == loopButton) |
---|
1964 | 2189 | { |
---|
1965 | 2190 | Composite csg = new GroupLeaf(); |
---|
1966 | 2191 | csg.count = 5; |
---|
1967 | 2192 | group(csg); |
---|
1968 | | - Composite child = new cGroup(); |
---|
| 2193 | + Composite child = new cGroup("Branch"); |
---|
1969 | 2194 | csg.addChild(child); |
---|
1970 | 2195 | child.addChild(csg); |
---|
1971 | 2196 | } else |
---|
1972 | 2197 | if (source == doubleItem) |
---|
1973 | 2198 | { |
---|
1974 | | - Composite csg = new GroupLeaf(); |
---|
| 2199 | + Composite csg = new GroupLeaf("Fork"); |
---|
1975 | 2200 | csg.count = 5; |
---|
1976 | 2201 | group(csg); |
---|
1977 | | - Composite child = new cGroup(); |
---|
| 2202 | + Composite child = new cGroup("Branch A"); |
---|
1978 | 2203 | csg.addChild(child); |
---|
1979 | 2204 | child.addChild(csg); |
---|
1980 | | - child = new cGroup(); |
---|
| 2205 | + child = new cGroup("Branch B"); |
---|
1981 | 2206 | csg.addChild(child); |
---|
1982 | 2207 | child.addChild(csg); |
---|
1983 | 2208 | } else |
---|
1984 | 2209 | if (source == tripleItem) |
---|
1985 | 2210 | { |
---|
1986 | | - Composite csg = new GroupLeaf(); |
---|
| 2211 | + Composite csg = new GroupLeaf("Trident"); |
---|
1987 | 2212 | csg.count = 4; |
---|
1988 | 2213 | group(csg); |
---|
1989 | 2214 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2047 | 2272 | } else |
---|
2048 | 2273 | if (source == undoButton) |
---|
2049 | 2274 | { |
---|
| 2275 | + // Go to previous version |
---|
| 2276 | + //if (!Undo()) |
---|
| 2277 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2050 | 2278 | Undo(); |
---|
| 2279 | + } else |
---|
| 2280 | + if (source == restoreButton) |
---|
| 2281 | + { |
---|
| 2282 | + // Restore current version |
---|
| 2283 | + Restore(); |
---|
| 2284 | + } else |
---|
| 2285 | + if (source == replaceButton) |
---|
| 2286 | + { |
---|
| 2287 | + // Overwrite current version |
---|
| 2288 | + Replace(); |
---|
2051 | 2289 | } else |
---|
2052 | 2290 | if (source == redoButton) |
---|
2053 | 2291 | { |
---|
| 2292 | + // Go to next version |
---|
2054 | 2293 | Redo(); |
---|
2055 | 2294 | } else |
---|
2056 | 2295 | if (source == saveButton) |
---|
2057 | 2296 | { |
---|
2058 | | - Save(); |
---|
| 2297 | + // Save a new version |
---|
| 2298 | + if (!Save(true)) |
---|
| 2299 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2059 | 2300 | } else |
---|
2060 | 2301 | if (source == oneStepButton) |
---|
2061 | 2302 | { |
---|
.. | .. |
---|
2064 | 2305 | } else |
---|
2065 | 2306 | if (source == screenfitButton) |
---|
2066 | 2307 | { |
---|
2067 | | - //Reload(lastConverter, lastFilename, true); |
---|
2068 | 2308 | ScreenFit(); |
---|
2069 | 2309 | } else |
---|
2070 | 2310 | if (source == screenfitpointButton) |
---|
2071 | 2311 | { |
---|
2072 | | - //Reload(lastConverter, lastFilename, true); |
---|
2073 | 2312 | ScreenFitPoint(); |
---|
2074 | 2313 | } else |
---|
2075 | 2314 | if (source == snapobjectButton) |
---|
2076 | 2315 | { |
---|
2077 | | - //Reload(lastConverter, lastFilename, true); |
---|
2078 | 2316 | SnapObject(); |
---|
2079 | 2317 | } else |
---|
2080 | 2318 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2438 | 2676 | { |
---|
2439 | 2677 | StepAll(); |
---|
2440 | 2678 | } else |
---|
2441 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2679 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2442 | 2680 | { |
---|
2443 | 2681 | //int indices[] = jList.getSelectedIndices(); |
---|
2444 | 2682 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2450 | 2688 | { |
---|
2451 | 2689 | ClearSelection(true); |
---|
2452 | 2690 | } else |
---|
2453 | | - if (source == grabItem) |
---|
| 2691 | + if (source == grabItem || source == groupButton) |
---|
2454 | 2692 | { |
---|
2455 | | - group(new cGroup(), true); |
---|
| 2693 | + group(new cGroup(), false); // true); |
---|
2456 | 2694 | } else |
---|
2457 | 2695 | if (source == hideItem) |
---|
2458 | 2696 | { |
---|
.. | .. |
---|
2470 | 2708 | { |
---|
2471 | 2709 | makeSomething(new Camera()); |
---|
2472 | 2710 | } else |
---|
2473 | | - if (source == compositeItem) |
---|
| 2711 | + if (source == compositeItem || source == compositeButton) |
---|
2474 | 2712 | { |
---|
2475 | 2713 | group(new Composite()); |
---|
2476 | 2714 | } else |
---|
2477 | | - if (source == randomItem) |
---|
| 2715 | + if (source == switchItem || source == switchButton) |
---|
2478 | 2716 | { |
---|
2479 | 2717 | RandomNode random = new RandomNode(); |
---|
2480 | 2718 | group(random); |
---|
.. | .. |
---|
2576 | 2814 | { |
---|
2577 | 2815 | group(new cLinker()); |
---|
2578 | 2816 | } else |
---|
2579 | | - if (source == textureItem) |
---|
| 2817 | + if (source == textureItem || source == textureButton) |
---|
2580 | 2818 | { |
---|
2581 | 2819 | group(new TextureNode()); |
---|
2582 | 2820 | } else |
---|
.. | .. |
---|
2596 | 2834 | { |
---|
2597 | 2835 | CastShadow(2); |
---|
2598 | 2836 | } else |
---|
2599 | | - if (source == ungroupItem) |
---|
| 2837 | + if (source == ungroupItem || source == ungroupButton) |
---|
2600 | 2838 | { |
---|
2601 | | - //ungroup(); |
---|
| 2839 | + boolean hasRoot = false; |
---|
| 2840 | + |
---|
2602 | 2841 | for (int i=0; i<group.selection.size(); i++) |
---|
2603 | 2842 | { |
---|
2604 | | - Ungroup(group.selection.get(i)); |
---|
| 2843 | + if (group.selection.get(i) == group) |
---|
| 2844 | + { |
---|
| 2845 | + hasRoot = true; |
---|
| 2846 | + break; |
---|
| 2847 | + } |
---|
2605 | 2848 | } |
---|
2606 | 2849 | |
---|
2607 | | - ClearSelection(false); |
---|
2608 | | - |
---|
2609 | | - refreshContents(); |
---|
| 2850 | + if (!hasRoot) |
---|
| 2851 | + { |
---|
| 2852 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2853 | + { |
---|
| 2854 | + Ungroup(group.selection.get(i)); |
---|
| 2855 | + } |
---|
| 2856 | + |
---|
| 2857 | + ClearSelection(false); |
---|
| 2858 | + |
---|
| 2859 | + refreshContents(); |
---|
| 2860 | + } |
---|
2610 | 2861 | } else |
---|
2611 | 2862 | if (source == genUVItem) |
---|
2612 | 2863 | { |
---|
.. | .. |
---|
2907 | 3158 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2908 | 3159 | { |
---|
2909 | 3160 | obj = (Object3D)e.nextElement(); |
---|
2910 | | - obj.SetBumpTexture(null); |
---|
| 3161 | + obj.ResetBumpTexture(); |
---|
2911 | 3162 | } |
---|
2912 | 3163 | |
---|
2913 | 3164 | refreshContents(); |
---|
.. | .. |
---|
2923 | 3174 | |
---|
2924 | 3175 | refreshContents(); |
---|
2925 | 3176 | } else |
---|
| 3177 | + if (source == embedTexturesItem) |
---|
| 3178 | + { |
---|
| 3179 | + Object3D obj; |
---|
| 3180 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3181 | + { |
---|
| 3182 | + obj = (Object3D)e.nextElement(); |
---|
| 3183 | + obj.EmbedTextures(true); |
---|
| 3184 | + } |
---|
| 3185 | + |
---|
| 3186 | + refreshContents(); |
---|
| 3187 | + } else |
---|
| 3188 | + if (source == deEmbedTexturesItem) |
---|
| 3189 | + { |
---|
| 3190 | + Object3D obj; |
---|
| 3191 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3192 | + { |
---|
| 3193 | + obj = (Object3D)e.nextElement(); |
---|
| 3194 | + obj.EmbedTextures(false); |
---|
| 3195 | + } |
---|
| 3196 | + |
---|
| 3197 | + CameraPane.texturepigment.clear(); |
---|
| 3198 | + CameraPane.texturebump.clear(); |
---|
| 3199 | + |
---|
| 3200 | + refreshContents(); |
---|
| 3201 | + } else |
---|
2926 | 3202 | if (source == flashSelectionButton) |
---|
2927 | 3203 | { |
---|
2928 | 3204 | CameraPane.flash = true; |
---|
.. | .. |
---|
2934 | 3210 | if (source == twoButton) |
---|
2935 | 3211 | { |
---|
2936 | 3212 | radio.layout = twoButton; |
---|
| 3213 | + |
---|
| 3214 | + if (CameraPane.FULLSCREEN) |
---|
| 3215 | + fullscreenLayout = radio.layout; |
---|
| 3216 | + |
---|
2937 | 3217 | // bug |
---|
2938 | 3218 | //gridPanel.setDividerLocation(1.0); |
---|
2939 | 3219 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2989 | 3269 | { |
---|
2990 | 3270 | radio.layout = threeButton; |
---|
2991 | 3271 | |
---|
| 3272 | + if (CameraPane.FULLSCREEN) |
---|
| 3273 | + fullscreenLayout = radio.layout; |
---|
| 3274 | + |
---|
2992 | 3275 | // bigThree.remove(scenePanel); |
---|
2993 | 3276 | // bigThree.remove(centralPanel); |
---|
2994 | 3277 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3017 | 3300 | // centralPanel.setVisible(true); |
---|
3018 | 3301 | // XYZPanel.setVisible(true); |
---|
3019 | 3302 | bigThree.ClearUI(); |
---|
| 3303 | + bigThree.add(scenePanel); |
---|
3020 | 3304 | bigThree.add(centralPanel); |
---|
3021 | | - bigThree.add(XYZPanel); |
---|
3022 | 3305 | bigThree.FlushUI(); |
---|
3023 | 3306 | |
---|
3024 | 3307 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3026 | 3309 | if (source == fourButton) |
---|
3027 | 3310 | { |
---|
3028 | 3311 | radio.layout = fourButton; |
---|
| 3312 | + |
---|
| 3313 | + if (CameraPane.FULLSCREEN) |
---|
| 3314 | + fullscreenLayout = radio.layout; |
---|
3029 | 3315 | |
---|
3030 | 3316 | // bigThree.remove(scenePanel); |
---|
3031 | 3317 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3064 | 3350 | { |
---|
3065 | 3351 | radio.layout = sixButton; |
---|
3066 | 3352 | |
---|
| 3353 | + if (CameraPane.FULLSCREEN) |
---|
| 3354 | + fullscreenLayout = radio.layout; |
---|
| 3355 | + |
---|
3067 | 3356 | // bigThree.remove(scenePanel); |
---|
3068 | 3357 | // bigThree.remove(centralPanel); |
---|
3069 | 3358 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3092 | 3381 | // centralPanel.setVisible(true); |
---|
3093 | 3382 | // XYZPanel.setVisible(false); |
---|
3094 | 3383 | bigThree.ClearUI(); |
---|
3095 | | - bigThree.add(scenePanel); |
---|
3096 | 3384 | bigThree.add(centralPanel); |
---|
| 3385 | + bigThree.add(scenePanel); |
---|
3097 | 3386 | bigThree.FlushUI(); |
---|
3098 | 3387 | |
---|
3099 | 3388 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3101 | 3390 | if (source == sevenButton) |
---|
3102 | 3391 | { |
---|
3103 | 3392 | radio.layout = sevenButton; |
---|
| 3393 | + |
---|
| 3394 | + if (CameraPane.FULLSCREEN) |
---|
| 3395 | + fullscreenLayout = radio.layout; |
---|
3104 | 3396 | |
---|
3105 | 3397 | // bigThree.remove(scenePanel); |
---|
3106 | 3398 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3182 | 3474 | } else |
---|
3183 | 3475 | if (source == editItem || source == editButton) |
---|
3184 | 3476 | { |
---|
| 3477 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3478 | + { |
---|
| 3479 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3480 | + child.pinned = true; |
---|
| 3481 | + } |
---|
| 3482 | + |
---|
3185 | 3483 | EditSelection(false); |
---|
3186 | 3484 | } else |
---|
3187 | 3485 | if (source == uneditButton) |
---|
.. | .. |
---|
3191 | 3489 | Object3D child = (Object3D)e.nextElement(); |
---|
3192 | 3490 | if(child.editWindow != null) |
---|
3193 | 3491 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3492 | + child.pinned = false; |
---|
3194 | 3493 | child.CloseUI(); |
---|
3195 | 3494 | listUI.remove(child); |
---|
3196 | 3495 | |
---|
.. | .. |
---|
3207 | 3506 | //copy.ClearUI(); |
---|
3208 | 3507 | for (Object3D obj : listUI) |
---|
3209 | 3508 | { |
---|
| 3509 | + obj.pinned = false; |
---|
3210 | 3510 | obj.CloseUI(); |
---|
3211 | 3511 | } |
---|
3212 | 3512 | listUI.clear(); |
---|
.. | .. |
---|
3216 | 3516 | { |
---|
3217 | 3517 | assert(copy == group); |
---|
3218 | 3518 | |
---|
3219 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3519 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3220 | 3520 | |
---|
3221 | 3521 | for (Object3D obj : listUI) |
---|
3222 | 3522 | { |
---|
.. | .. |
---|
3265 | 3565 | } |
---|
3266 | 3566 | |
---|
3267 | 3567 | copy = group; |
---|
| 3568 | + |
---|
| 3569 | + SetUndoStates(); |
---|
| 3570 | + |
---|
3268 | 3571 | //Globals.theRenderer.object = group; |
---|
3269 | 3572 | if(!useclient) |
---|
3270 | 3573 | { |
---|
.. | .. |
---|
3291 | 3594 | currentLayout = sevenButton; |
---|
3292 | 3595 | */ |
---|
3293 | 3596 | radio.layout.doClick(); |
---|
| 3597 | + |
---|
| 3598 | + ClearUnpinned(); |
---|
| 3599 | + //Grafreed.Assert(group != null); |
---|
| 3600 | + //Grafreed.Assert(group.selection != null); |
---|
| 3601 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3602 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3603 | + EditSelection(false); |
---|
3294 | 3604 | keepparent = group.parent; |
---|
3295 | 3605 | // PARENT = NULL or not??? |
---|
3296 | 3606 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3304 | 3614 | cameraView.ProtectCamera(); |
---|
3305 | 3615 | cameraView.repaint(); |
---|
3306 | 3616 | return; |
---|
3307 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3617 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3308 | 3618 | { |
---|
3309 | 3619 | cameraView.RevertCamera(); |
---|
3310 | 3620 | cameraView.repaint(); |
---|
.. | .. |
---|
3883 | 4193 | |
---|
3884 | 4194 | try |
---|
3885 | 4195 | { |
---|
3886 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4196 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
3887 | 4197 | } |
---|
3888 | 4198 | catch (Exception e) |
---|
3889 | 4199 | { |
---|
.. | .. |
---|
4358 | 4668 | // } |
---|
4359 | 4669 | // } |
---|
4360 | 4670 | |
---|
4361 | | - static boolean allparams = true; |
---|
4362 | | - |
---|
4363 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4364 | | - |
---|
4365 | 4671 | void EditSelection(boolean newWindow) |
---|
4366 | 4672 | { |
---|
| 4673 | + if (group.selection == null) |
---|
| 4674 | + { |
---|
| 4675 | + EditElement(group, newWindow); // ? new |
---|
| 4676 | + return; |
---|
| 4677 | + } |
---|
| 4678 | + |
---|
4367 | 4679 | // aConstraints.gridy = 0; |
---|
4368 | 4680 | for (int i=0; i<group.selection.size(); i++) |
---|
4369 | 4681 | { |
---|
4370 | 4682 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4371 | 4683 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4372 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4684 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4373 | 4685 | |
---|
4374 | 4686 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4375 | 4687 | if(elem != group || !newWindow) |
---|
4376 | 4688 | { |
---|
4377 | | - // if (!(elem instanceof Composite)) |
---|
4378 | | - // newWindow = false; |
---|
4379 | | - listUI.add(elem); |
---|
4380 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4381 | | - System.out.println("edit : " + elem); |
---|
4382 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4689 | + EditElement(elem, newWindow); // ? new |
---|
4383 | 4690 | } |
---|
4384 | 4691 | } |
---|
4385 | 4692 | } |
---|
.. | .. |
---|
4454 | 4761 | //new Exception().printStackTrace(); |
---|
4455 | 4762 | |
---|
4456 | 4763 | freezemodel = true; |
---|
4457 | | - |
---|
| 4764 | + ClearUnpinned(); |
---|
| 4765 | + |
---|
4458 | 4766 | /**/ |
---|
4459 | 4767 | //switch (event.id) |
---|
4460 | 4768 | { |
---|
.. | .. |
---|
4487 | 4795 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4488 | 4796 | // a camera |
---|
4489 | 4797 | { |
---|
4490 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4798 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4491 | 4799 | { |
---|
4492 | 4800 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4493 | 4801 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4496 | 4804 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4497 | 4805 | } |
---|
4498 | 4806 | |
---|
| 4807 | + if (tps != null && tps.length == 1) |
---|
| 4808 | + { |
---|
| 4809 | + EditSelection(false); |
---|
| 4810 | + } |
---|
| 4811 | + |
---|
| 4812 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4813 | + |
---|
4499 | 4814 | refreshContents(); |
---|
4500 | 4815 | //return true; |
---|
4501 | 4816 | } |
---|
.. | .. |
---|
4505 | 4820 | freezemodel = false; |
---|
4506 | 4821 | } |
---|
4507 | 4822 | |
---|
| 4823 | + void SetPinStates(boolean enabled) |
---|
| 4824 | + { |
---|
| 4825 | + editButton.setEnabled(enabled); |
---|
| 4826 | + uneditButton.setEnabled(enabled); |
---|
| 4827 | + unselectButton.setEnabled(enabled); |
---|
| 4828 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4829 | + } |
---|
| 4830 | + |
---|
4508 | 4831 | void refreshContents(boolean cp) |
---|
4509 | 4832 | { |
---|
4510 | | - if (!Globals.MOUSEDRAGGED) |
---|
| 4833 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4834 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4511 | 4835 | { |
---|
4512 | 4836 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4513 | 4837 | |
---|
.. | .. |
---|
4606 | 4930 | |
---|
4607 | 4931 | if (cut) |
---|
4608 | 4932 | { |
---|
4609 | | - if (Globals.SAVEONMAKE) |
---|
4610 | | - Save(); |
---|
| 4933 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4934 | +// Save(); |
---|
4611 | 4935 | //int indices[] = jList.getSelectedIndices(); |
---|
4612 | 4936 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4613 | 4937 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4710 | 5034 | |
---|
4711 | 5035 | void paste(boolean expand) |
---|
4712 | 5036 | { |
---|
| 5037 | + if (Globals.REPLACEONMAKE) |
---|
| 5038 | + Save(); |
---|
| 5039 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5040 | + Globals.REPLACEONMAKE = false; |
---|
4713 | 5041 | // if (GrafreeD.clipboard == null) |
---|
4714 | 5042 | // return; |
---|
4715 | 5043 | boolean first = true; |
---|
.. | .. |
---|
4769 | 5097 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4770 | 5098 | } |
---|
4771 | 5099 | |
---|
| 5100 | + Globals.REPLACEONMAKE = keep; |
---|
4772 | 5101 | ResetModel(); |
---|
4773 | 5102 | refreshContents(); |
---|
4774 | 5103 | } |
---|
.. | .. |
---|
4904 | 5233 | |
---|
4905 | 5234 | void group(Object3D csg, boolean grab) |
---|
4906 | 5235 | { |
---|
| 5236 | + if (Globals.REPLACEONMAKE) |
---|
| 5237 | + Save(); |
---|
| 5238 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5239 | + Globals.REPLACEONMAKE = false; |
---|
4907 | 5240 | if (//false) // why?? |
---|
4908 | 5241 | !group.selection.isEmpty()) |
---|
4909 | 5242 | { |
---|
.. | .. |
---|
5017 | 5350 | //node.add(csg); |
---|
5018 | 5351 | //makeSomething(node); |
---|
5019 | 5352 | makeSomething(csg); |
---|
| 5353 | + Globals.REPLACEONMAKE = keep; |
---|
5020 | 5354 | } |
---|
5021 | 5355 | |
---|
5022 | 5356 | void Ungroup(Object3D g) |
---|
5023 | 5357 | { |
---|
| 5358 | + if (Globals.REPLACEONMAKE) |
---|
| 5359 | + Save(); |
---|
| 5360 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5361 | + Globals.REPLACEONMAKE = false; |
---|
5024 | 5362 | if (g instanceof HiddenObject) |
---|
5025 | 5363 | { |
---|
5026 | 5364 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5037 | 5375 | objEditor.makeSomething(g.get(i), false); |
---|
5038 | 5376 | } |
---|
5039 | 5377 | } |
---|
| 5378 | + Globals.REPLACEONMAKE = keep; |
---|
5040 | 5379 | } |
---|
5041 | 5380 | |
---|
5042 | 5381 | void ungroup() |
---|
.. | .. |
---|
5325 | 5664 | cButton clearpanelButton; |
---|
5326 | 5665 | cButton unselectButton; |
---|
5327 | 5666 | |
---|
5328 | | - cButton minButton; |
---|
5329 | | - cButton maxButton; |
---|
5330 | | - cButton fullButton; |
---|
5331 | | - cButton undoButton; |
---|
5332 | | - cButton redoButton; |
---|
| 5667 | + cButton restoreCameraButton; |
---|
| 5668 | + |
---|
5333 | 5669 | cButton saveButton; |
---|
5334 | 5670 | cButton oneStepButton; |
---|
| 5671 | + |
---|
| 5672 | + cButton groupButton; |
---|
| 5673 | + cButton ungroupButton; |
---|
| 5674 | + cButton compositeButton; |
---|
| 5675 | + cButton switchButton; |
---|
| 5676 | + cButton loopButton; |
---|
| 5677 | + cButton textureButton; |
---|
| 5678 | + |
---|
| 5679 | + cButton gridButton; |
---|
| 5680 | + cButton boxButton; |
---|
| 5681 | + cButton sphereButton; |
---|
| 5682 | + cButton coneButton; |
---|
| 5683 | + cButton torusButton; |
---|
| 5684 | + cButton superButton; |
---|
| 5685 | + cButton kleinButton; |
---|
| 5686 | + cButton particlesButton; |
---|
| 5687 | + cButton overlayButton; |
---|
| 5688 | + cButton lightButton; |
---|
5335 | 5689 | |
---|
5336 | 5690 | cButton screenfitButton; |
---|
5337 | 5691 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5353 | 5707 | //JTree jTree; |
---|
5354 | 5708 | private MenuItem lookAtItem; |
---|
5355 | 5709 | private MenuItem lookFromItem; |
---|
5356 | | - private MenuItem switchItem; |
---|
| 5710 | + private MenuItem switchViewItem; |
---|
5357 | 5711 | private MenuItem cutItem; |
---|
5358 | 5712 | private MenuItem undoItem; |
---|
5359 | 5713 | private MenuItem redoItem; |
---|
5360 | | - private MenuItem duplicateItem; |
---|
| 5714 | + private JMenuItem duplicateItem; |
---|
5361 | 5715 | private MenuItem cloneItem; |
---|
5362 | 5716 | private MenuItem cloneSupportItem; |
---|
5363 | 5717 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5385 | 5739 | private MenuItem pasteLinkItem; |
---|
5386 | 5740 | private MenuItem pasteCloneItem; |
---|
5387 | 5741 | private MenuItem pasteExpandItem; |
---|
5388 | | - private MenuItem clearItem; |
---|
| 5742 | + private MenuItem deleteItem; |
---|
5389 | 5743 | private MenuItem clearAllItem; |
---|
5390 | 5744 | private MenuItem genUVItem; |
---|
5391 | 5745 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5445 | 5799 | private MenuItem frontItem; |
---|
5446 | 5800 | private MenuItem cameraItem; |
---|
5447 | 5801 | private MenuItem compositeItem; |
---|
5448 | | - private MenuItem randomItem; |
---|
| 5802 | + private MenuItem switchItem; |
---|
5449 | 5803 | private MenuItem physicsItem; |
---|
5450 | 5804 | private MenuItem frameselectorItem; |
---|
5451 | 5805 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5469 | 5823 | private MenuItem attachBumpItem; |
---|
5470 | 5824 | private MenuItem detachBumpItem; |
---|
5471 | 5825 | private MenuItem pigmentBumpItem; |
---|
| 5826 | + private MenuItem embedTexturesItem; |
---|
| 5827 | + private MenuItem deEmbedTexturesItem; |
---|
5472 | 5828 | |
---|
5473 | 5829 | private MenuItem particleItem; |
---|
5474 | 5830 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5519 | 5875 | |
---|
5520 | 5876 | Menu cameraMenu; |
---|
5521 | 5877 | MenuItem editCameraItem; |
---|
5522 | | - MenuItem revertCameraItem; |
---|
| 5878 | + MenuItem restoreCameraItem; |
---|
5523 | 5879 | } |
---|