.. | .. |
---|
60 | 60 | this.copy = this.group = group; |
---|
61 | 61 | //selectees = this.group.selectees; |
---|
62 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
63 | 69 | if(ui) |
---|
64 | 70 | SetupUI(objEditor); |
---|
65 | 71 | } |
---|
.. | .. |
---|
74 | 80 | this.copy = this.group = copy; |
---|
75 | 81 | //selectees = this.group.selectees; |
---|
76 | 82 | |
---|
| 83 | + if (copy.versions == null) |
---|
| 84 | + { |
---|
| 85 | + copy.versions = new byte[100][]; |
---|
| 86 | + copy.versionindex = -1; |
---|
| 87 | + } |
---|
| 88 | + |
---|
77 | 89 | SetupMenu2(this); //objEditor); |
---|
78 | 90 | SetupUI2(objEditor); |
---|
79 | 91 | objEditor.SetupUI(true); |
---|
.. | .. |
---|
84 | 96 | |
---|
85 | 97 | void CloneSelection(boolean supports) |
---|
86 | 98 | { |
---|
| 99 | + if (Globals.REPLACEONMAKE) |
---|
| 100 | + Save(); |
---|
| 101 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 102 | + Globals.REPLACEONMAKE = false; |
---|
87 | 103 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 104 | //Object3D obj; |
---|
89 | 105 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 110 | |
---|
95 | 111 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 112 | } |
---|
| 113 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 114 | } |
---|
98 | 115 | |
---|
99 | 116 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 167 | |
---|
151 | 168 | void SetupMenu2(GroupEditor oe) |
---|
152 | 169 | { |
---|
| 170 | + oe.jTree = new cTree(); |
---|
| 171 | + |
---|
153 | 172 | Menu menu; |
---|
154 | 173 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 174 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
160 | 179 | // redoItem = menu.add(new MenuItem("Redo")); |
---|
161 | 180 | // redoItem.addActionListener(this); |
---|
162 | 181 | // menu.add("-"); |
---|
163 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 182 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
164 | 183 | duplicateItem.addActionListener(this); |
---|
165 | 184 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
166 | 185 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
176 | 195 | copyItem.addActionListener(this); |
---|
177 | 196 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
178 | 197 | pasteItem.addActionListener(this); |
---|
179 | | - menu.add("-"); |
---|
180 | 198 | |
---|
181 | 199 | menu.add("-"); |
---|
182 | 200 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
203 | 221 | //zBufferItem.addActionListener(this); |
---|
204 | 222 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
205 | 223 | //normalLensItem.addActionListener(this); |
---|
206 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
207 | | - revertCameraItem.addActionListener(this); |
---|
| 224 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 225 | + restoreCameraItem.addActionListener(this); |
---|
208 | 226 | |
---|
209 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
210 | | - toggleFullScreenItem.addItemListener(this); |
---|
211 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
212 | | - cameraMenu.add("-"); |
---|
| 227 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 228 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 229 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 230 | +// cameraMenu.add("-"); |
---|
| 231 | +// |
---|
| 232 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 233 | +// toggleTextureItem.addItemListener(this); |
---|
| 234 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 235 | +// |
---|
| 236 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 237 | +// toggleSwitchItem.addItemListener(this); |
---|
| 238 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
213 | 239 | |
---|
214 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
215 | | - toggleTextureItem.addItemListener(this); |
---|
216 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
217 | | - |
---|
218 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
219 | | - toggleSwitchItem.addItemListener(this); |
---|
220 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
221 | | - |
---|
222 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 240 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
223 | 241 | toggleHandleItem.addItemListener(this); |
---|
224 | 242 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
225 | 243 | |
---|
.. | .. |
---|
246 | 264 | |
---|
247 | 265 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
248 | 266 | toggleDebugItem.addItemListener(this); |
---|
249 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 267 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
250 | 268 | |
---|
251 | 269 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
252 | 270 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
274 | 292 | { |
---|
275 | 293 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
276 | 294 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
277 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 295 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
278 | 296 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
279 | 297 | oe.cameraMenu.add("-"); |
---|
280 | 298 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
282 | 300 | editLeafItem.addActionListener(this); |
---|
283 | 301 | lookAtItem.addActionListener(this); |
---|
284 | 302 | //lookFromItem.addActinoListener(this); |
---|
285 | | - //switchItem.addActionListener(this); |
---|
| 303 | + //switchViewItem.addActionListener(this); |
---|
286 | 304 | } |
---|
287 | 305 | |
---|
288 | 306 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
327 | 345 | } |
---|
328 | 346 | |
---|
329 | 347 | oe.menuBar.add(menu = new Menu("Group")); |
---|
330 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
331 | | - grabItem.addActionListener(this); |
---|
| 348 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 349 | +// grabItem.addActionListener(this); |
---|
332 | 350 | backItem = menu.add(new MenuItem("Back")); |
---|
333 | 351 | backItem.addActionListener(this); |
---|
334 | 352 | frontItem = menu.add(new MenuItem("Front")); |
---|
335 | 353 | frontItem.addActionListener(this); |
---|
336 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
337 | | - compositeItem.addActionListener(this); |
---|
| 354 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 355 | +// compositeItem.addActionListener(this); |
---|
| 356 | + |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
338 | 359 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
339 | 360 | hideItem.addActionListener(this); |
---|
| 361 | + } |
---|
340 | 362 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
341 | 363 | ungroupItem.addActionListener(this); |
---|
342 | | - menu.add("-"); |
---|
343 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
344 | | - randomItem.addActionListener(this); |
---|
| 364 | + |
---|
| 365 | +// menu.add("-"); |
---|
| 366 | +// |
---|
| 367 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 368 | +// switchItem.addActionListener(this); |
---|
| 369 | + if (Globals.ADVANCED) |
---|
| 370 | + { |
---|
345 | 371 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
346 | 372 | switchGeoItem.addActionListener(this); |
---|
347 | 373 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
349 | 375 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
350 | 376 | morphItem.addActionListener(this); |
---|
351 | 377 | |
---|
352 | | - if (Globals.ADVANCED) |
---|
353 | | - { |
---|
354 | 378 | menu.add("-"); |
---|
355 | 379 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
356 | 380 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
358 | 382 | frameselectorItem.addActionListener(this); |
---|
359 | 383 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
360 | 384 | scriptNodeItem.addActionListener(this); |
---|
361 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
362 | | - cameraItem.addActionListener(this); |
---|
363 | 385 | } |
---|
364 | 386 | |
---|
365 | 387 | oe.menuBar.add(menu = new Menu("Object")); |
---|
366 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
367 | | - textureItem.addActionListener(this); |
---|
| 388 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 389 | +// textureItem.addActionListener(this); |
---|
368 | 390 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
369 | 391 | billboardItem.addActionListener(this); |
---|
370 | 392 | csgItem = menu.add(new MenuItem("CSG")); |
---|
371 | 393 | csgItem.addActionListener(this); |
---|
372 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 394 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
373 | 395 | shadowXItem.addActionListener(this); |
---|
374 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 396 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
375 | 397 | shadowYItem.addActionListener(this); |
---|
376 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 398 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
377 | 399 | shadowZItem.addActionListener(this); |
---|
| 400 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 401 | + attributeItem.addActionListener(this); |
---|
| 402 | + |
---|
378 | 403 | if (Globals.ADVANCED) |
---|
379 | 404 | { |
---|
380 | 405 | menu.add("-"); |
---|
381 | 406 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
382 | 407 | linkerItem.addActionListener(this); |
---|
383 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
384 | | - attributeItem.addActionListener(this); |
---|
385 | 408 | templateItem = menu.add(new MenuItem("Template")); |
---|
386 | 409 | templateItem.addActionListener(this); |
---|
387 | 410 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
470 | 493 | markleavesItem.addActionListener(this); |
---|
471 | 494 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
472 | 495 | unmarkleavesItem.addActionListener(this); |
---|
| 496 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 497 | + rewindleavesItem.addActionListener(this); |
---|
| 498 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 499 | + unrewindleavesItem.addActionListener(this); |
---|
| 500 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 501 | + randomleavesItem.addActionListener(this); |
---|
| 502 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 503 | + unrandomleavesItem.addActionListener(this); |
---|
473 | 504 | menu.add("-"); |
---|
474 | 505 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
475 | 506 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
525 | 556 | buildToolsMenu(menu); |
---|
526 | 557 | } |
---|
527 | 558 | |
---|
| 559 | + |
---|
528 | 560 | void SetupUI2(ObjEditor oe) |
---|
529 | 561 | { |
---|
| 562 | + // June 2019 |
---|
| 563 | + if (oe == null) |
---|
| 564 | + { |
---|
| 565 | + //super.SetupUI2(this); |
---|
| 566 | + //return; |
---|
| 567 | + } |
---|
| 568 | + |
---|
| 569 | + if (copy != group) |
---|
| 570 | + { |
---|
| 571 | + //super.SetupUI2(this); |
---|
| 572 | + } |
---|
| 573 | + |
---|
530 | 574 | //new Exception().printStackTrace(); |
---|
531 | 575 | |
---|
532 | 576 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
555 | 599 | oe.radioPanel.add(dummyButton); |
---|
556 | 600 | oe.buttonGroup.add(dummyButton); |
---|
557 | 601 | */ |
---|
| 602 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 603 | + |
---|
| 604 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 605 | + |
---|
558 | 606 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
559 | 607 | |
---|
560 | | - oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
561 | | - undoButton.setToolTipText("Undo changes"); |
---|
562 | | - undoButton.addActionListener(this); |
---|
| 608 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 609 | + //minButton.setToolTipText("Minimize window"); |
---|
| 610 | + //minButton.addActionListener(this); |
---|
563 | 611 | |
---|
564 | | - oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | | - redoButton.setToolTipText("Redo changes"); |
---|
566 | | - redoButton.addActionListener(this); |
---|
| 612 | + if (Globals.ADVANCED) |
---|
| 613 | + { |
---|
| 614 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + maxButton.setToolTipText("Maximize window"); |
---|
| 616 | + maxButton.addActionListener(this); |
---|
| 617 | + } |
---|
567 | 618 | |
---|
568 | | - oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
569 | | - saveButton.setToolTipText("Save changes"); |
---|
| 619 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 621 | + fullButton.addActionListener(this); |
---|
| 622 | + |
---|
| 623 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 625 | + screenfitButton.addActionListener(this); |
---|
| 626 | + |
---|
| 627 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 629 | + restoreCameraButton.addActionListener(this); |
---|
| 630 | + |
---|
| 631 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + saveButton.setToolTipText("New version"); |
---|
570 | 633 | saveButton.addActionListener(this); |
---|
| 634 | + |
---|
| 635 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + undoButton.setToolTipText("Previous version"); |
---|
| 637 | + undoButton.addActionListener(this); |
---|
| 638 | + undoButton.setEnabled(false); |
---|
571 | 639 | |
---|
572 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 640 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 641 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + restoreButton.setToolTipText("Restore current"); |
---|
| 643 | + restoreButton.addActionListener(this); |
---|
| 644 | + restoreButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + replaceButton.setToolTipText("Replace current"); |
---|
| 648 | + replaceButton.addActionListener(this); |
---|
| 649 | + replaceButton.setEnabled(false); |
---|
| 650 | + |
---|
| 651 | + copyOptionsPanel.add(updown); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + redoButton.setToolTipText("Next version"); |
---|
| 655 | + redoButton.addActionListener(this); |
---|
| 656 | + redoButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
573 | 659 | liveCB.setToolTipText("Enable animation"); |
---|
574 | 660 | liveCB.addItemListener(this); |
---|
575 | 661 | |
---|
576 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 663 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
578 | 664 | oneStepButton.addActionListener(this); |
---|
579 | 665 | |
---|
580 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 666 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
581 | 667 | fastCB.setToolTipText("Fast mode"); |
---|
582 | 668 | fastCB.addItemListener(this); |
---|
583 | 669 | |
---|
584 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
585 | | - trackCB.setToolTipText("Enable tracking"); |
---|
586 | | - trackCB.addItemListener(this); |
---|
587 | | - |
---|
588 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
589 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
590 | | - screenfitButton.addActionListener(this); |
---|
| 670 | + //oe.toolboxPanel.Return(); |
---|
| 671 | + |
---|
| 672 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 673 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 674 | +// trackCB.addItemListener(this); |
---|
591 | 675 | |
---|
592 | 676 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
593 | 677 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
599 | 683 | snapobjectButton.setToolTipText("Snap Object"); |
---|
600 | 684 | } |
---|
601 | 685 | |
---|
602 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
603 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
604 | | - flashSelectionButton.addActionListener(this); |
---|
| 686 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
605 | 687 | |
---|
606 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
607 | | - |
---|
608 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
609 | 689 | twoButton.setToolTipText("Show center view only"); |
---|
610 | 690 | twoButton.addActionListener(this); |
---|
611 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 691 | + this.fullscreenLayout = twoButton; |
---|
| 692 | + |
---|
| 693 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
612 | 694 | fourButton.addActionListener(this); |
---|
613 | 695 | fourButton.setToolTipText("Show left panel only"); |
---|
614 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 696 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
615 | 697 | sixButton.setToolTipText("2-column layout left"); |
---|
616 | 698 | sixButton.addActionListener(this); |
---|
617 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 699 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
618 | 700 | threeButton.setToolTipText("2-column layout right"); |
---|
619 | 701 | threeButton.addActionListener(this); |
---|
620 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 702 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
621 | 703 | sevenButton.setToolTipText("3-column layout"); |
---|
622 | 704 | sevenButton.addActionListener(this); |
---|
623 | 705 | // |
---|
624 | 706 | |
---|
625 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
626 | 708 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
627 | 709 | rootButton.addActionListener(this); |
---|
628 | 710 | |
---|
629 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
630 | 712 | closeButton.setToolTipText("Close tab"); |
---|
631 | 713 | closeButton.addActionListener(this); |
---|
632 | 714 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
633 | 715 | //clearButton.addActionListener(this); |
---|
634 | | - |
---|
635 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 716 | + |
---|
| 717 | + // INSERT |
---|
| 718 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + gridButton.setToolTipText("Create grid"); |
---|
| 720 | + gridButton.addActionListener(this); |
---|
| 721 | + |
---|
| 722 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 723 | + boxButton.setToolTipText("Create box"); |
---|
| 724 | + boxButton.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 728 | + sphereButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 731 | + coneButton.setToolTipText("Create cone"); |
---|
| 732 | + coneButton.addActionListener(this); |
---|
| 733 | + |
---|
| 734 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 735 | + torusButton.setToolTipText("Create torus"); |
---|
| 736 | + torusButton.addActionListener(this); |
---|
| 737 | + |
---|
| 738 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 739 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 740 | + superButton.addActionListener(this); |
---|
| 741 | + |
---|
| 742 | + if (Globals.ADVANCED) |
---|
| 743 | + { |
---|
| 744 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 745 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 746 | + kleinButton.addActionListener(this); |
---|
| 747 | + } |
---|
636 | 748 | |
---|
637 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
638 | | - editButton.setToolTipText("Edit selection"); |
---|
| 749 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 750 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 751 | + particlesButton.addActionListener(this); |
---|
| 752 | + |
---|
| 753 | + oe.toolboxPanel.Return(); |
---|
| 754 | + |
---|
| 755 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 756 | + groupButton.setToolTipText("Create group"); |
---|
| 757 | + groupButton.addActionListener(this); |
---|
| 758 | + |
---|
| 759 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 760 | + compositeButton.setToolTipText("Create composite"); |
---|
| 761 | + compositeButton.addActionListener(this); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 765 | + switchButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + loopButton.setToolTipText("Create loop"); |
---|
| 769 | + loopButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 772 | + textureButton.setToolTipText("Create texture"); |
---|
| 773 | + textureButton.addActionListener(this); |
---|
| 774 | + |
---|
| 775 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 776 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 777 | + overlayButton.addActionListener(this); |
---|
| 778 | + |
---|
| 779 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + lightButton.setToolTipText("Create light"); |
---|
| 781 | + lightButton.addActionListener(this); |
---|
| 782 | + |
---|
| 783 | + for (int i=6; --i>=0;) |
---|
| 784 | + { |
---|
| 785 | + oe.toolboxPanel.Return(); |
---|
| 786 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 787 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 788 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 789 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 790 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 791 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 792 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 793 | + } |
---|
| 794 | + |
---|
| 795 | + // EDIT panel |
---|
| 796 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 797 | + editButton.setToolTipText("Pin selection controls"); |
---|
639 | 798 | editButton.addActionListener(this); |
---|
640 | 799 | |
---|
641 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
642 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 800 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 801 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
643 | 802 | uneditButton.addActionListener(this); |
---|
644 | 803 | |
---|
645 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
646 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 804 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 805 | + allParamsButton.setToolTipText("Show all controle"); |
---|
647 | 806 | allParamsButton.addActionListener(this); |
---|
648 | 807 | |
---|
649 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 808 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
650 | 809 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
651 | 810 | clearPanelButton.addActionListener(this); |
---|
652 | 811 | |
---|
653 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 812 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
654 | 813 | unselectButton.setToolTipText("Unselect"); |
---|
655 | 814 | unselectButton.addActionListener(this); |
---|
656 | 815 | |
---|
657 | | - commandsPanel.preferredHeight = 1; |
---|
| 816 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 817 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 818 | + flashSelectionButton.addActionListener(this); |
---|
658 | 819 | |
---|
659 | | - oe.treePanel.add(commandsPanel); |
---|
660 | | - oe.treePanel.Return(); |
---|
| 820 | + editCommandsPanel.preferredHeight = 1; |
---|
| 821 | + |
---|
| 822 | + SetPinStates(false); |
---|
| 823 | +// oe.treePanel.add(commandsPanel); |
---|
| 824 | +// oe.treePanel.Return(); |
---|
661 | 825 | |
---|
662 | 826 | // oe.aConstraints.gridx += 1; |
---|
663 | 827 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
674 | 838 | |
---|
675 | 839 | JScrollPane jSP; |
---|
676 | 840 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
677 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 841 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
678 | 842 | ResetModel(); |
---|
679 | 843 | |
---|
680 | 844 | oe.treePanel.add(jSPPanel); |
---|
681 | 845 | oe.treePanel.Return(); |
---|
682 | 846 | |
---|
683 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
684 | | - |
---|
685 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
686 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
687 | | - colorCB.addItemListener(this); |
---|
688 | | - |
---|
689 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
690 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
691 | | - materialCB.addItemListener(this); |
---|
692 | | - |
---|
693 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
694 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
695 | | - textureCB.addItemListener(this); |
---|
696 | | - |
---|
697 | | - copyOptionsPanel.preferredHeight = 1; |
---|
698 | 847 | oe.treePanel.add(copyOptionsPanel); |
---|
699 | 848 | oe.treePanel.Return(); |
---|
| 849 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 850 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 851 | + sliderPane.preferredHeight = 1; |
---|
700 | 852 | |
---|
701 | 853 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
702 | 854 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
725 | 877 | |
---|
726 | 878 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
727 | 879 | { |
---|
| 880 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 881 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 882 | + colorCB.addItemListener(this); |
---|
| 883 | + |
---|
| 884 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 885 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 886 | + materialCB.addItemListener(this); |
---|
| 887 | + |
---|
| 888 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 889 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 890 | + textureCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.Return(); |
---|
| 893 | + |
---|
728 | 894 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
729 | 895 | boxCB.setToolTipText("Display bounding boxes"); |
---|
730 | 896 | boxCB.addItemListener(this); |
---|
731 | 897 | |
---|
732 | 898 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
733 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 899 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
734 | 900 | zoomBoxCB.addItemListener(this); |
---|
735 | 901 | |
---|
736 | 902 | if (true) // Globals.ADVANCED) |
---|
737 | 903 | { |
---|
738 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
739 | | - supportCB.setToolTipText("Enable rigging"); |
---|
740 | | - supportCB.addItemListener(this); |
---|
| 904 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 905 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 906 | +// supportCB.addItemListener(this); |
---|
| 907 | + |
---|
| 908 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 909 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 910 | + freezeCB.addItemListener(this); |
---|
741 | 911 | |
---|
742 | 912 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
743 | 913 | // localCB.addItemListener(this); |
---|
744 | 914 | |
---|
| 915 | + panel.Return(); |
---|
| 916 | + |
---|
745 | 917 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
746 | 918 | crowdCB.setToolTipText("Used for crowds"); |
---|
747 | 919 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
758 | 930 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
759 | 931 | // speakerMocapCB.addItemListener(this); |
---|
760 | 932 | |
---|
| 933 | + panel.Return(); |
---|
| 934 | + |
---|
761 | 935 | if (false) |
---|
762 | 936 | { |
---|
763 | 937 | // handled in scripts |
---|
.. | .. |
---|
772 | 946 | //constraints.gridy += 1; |
---|
773 | 947 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
774 | 948 | smoothfocusCB.addItemListener(this); |
---|
| 949 | + panel.Return(); |
---|
775 | 950 | } |
---|
776 | 951 | |
---|
777 | 952 | //constraints.gridx += 1; |
---|
778 | 953 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
779 | 954 | // debugCB.addItemListener(this); |
---|
780 | 955 | |
---|
| 956 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 957 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 958 | + trackCB.addItemListener(this); |
---|
| 959 | + |
---|
781 | 960 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 961 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
782 | 962 | oeilCB.addItemListener(this); |
---|
783 | 963 | |
---|
| 964 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 965 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 966 | + shadowCB.addItemListener(this); |
---|
| 967 | + |
---|
| 968 | + panel.Return(); |
---|
| 969 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 970 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 971 | + toggleTextureCB.addItemListener(this); |
---|
| 972 | + |
---|
| 973 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 974 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 975 | + toggleSwitchCB.addItemListener(this); |
---|
| 976 | + |
---|
| 977 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 978 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 979 | + autokeepCB.addItemListener(this); |
---|
| 980 | + |
---|
| 981 | + panel.Return(); |
---|
| 982 | + if (Globals.ADVANCED) |
---|
| 983 | + { |
---|
784 | 984 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
785 | 985 | lookAtCB.setToolTipText("Look-at target"); |
---|
786 | 986 | lookAtCB.addItemListener(this); |
---|
| 987 | + } |
---|
787 | 988 | |
---|
788 | 989 | } |
---|
789 | 990 | |
---|
790 | 991 | cGridBag fill = new cGridBag(); |
---|
791 | | - |
---|
792 | 992 | fill.preferredHeight = 200; |
---|
| 993 | + cGridBag fill2 = new cGridBag(); |
---|
| 994 | + fill2.preferredHeight = 200; |
---|
| 995 | + cGridBag fill3 = new cGridBag(); |
---|
| 996 | + fill3.preferredHeight = 200; |
---|
793 | 997 | |
---|
794 | 998 | panel.add(fill); |
---|
| 999 | + panel.add(fill2); |
---|
| 1000 | + panel.add(fill3); |
---|
795 | 1001 | |
---|
796 | 1002 | } |
---|
797 | 1003 | |
---|
798 | 1004 | void EditObject(Object3D obj) |
---|
799 | 1005 | { |
---|
800 | 1006 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1007 | + |
---|
| 1008 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1009 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1010 | + if (!radioButton.hadMaterial) |
---|
| 1011 | + { |
---|
| 1012 | + obj.material = new cMaterial(); |
---|
| 1013 | + } |
---|
| 1014 | + |
---|
801 | 1015 | radioButton.SetObject(obj); |
---|
802 | 1016 | radioButton.layout = sevenButton; |
---|
803 | 1017 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
809 | 1023 | |
---|
810 | 1024 | void SetupViews(ObjEditor oe) |
---|
811 | 1025 | { |
---|
| 1026 | + theFrame = this; |
---|
| 1027 | + |
---|
812 | 1028 | oe.SetupViews(); |
---|
813 | 1029 | |
---|
814 | 1030 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
817 | 1033 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
818 | 1034 | } |
---|
819 | 1035 | |
---|
820 | | - JCheckBox liveCB; |
---|
821 | | - JCheckBox supportCB; |
---|
822 | | - JCheckBox localCB; |
---|
823 | | - JCheckBox crowdCB; |
---|
824 | | - JCheckBox smoothCB; |
---|
825 | | - JCheckBox fastCB; |
---|
826 | | - JCheckBox slowCB; |
---|
827 | | - JCheckBox boxCB; |
---|
828 | | - JCheckBox zoomBoxCB; |
---|
829 | | - JCheckBox trackCB; |
---|
830 | | - JCheckBox smoothfocusCB; |
---|
| 1036 | + cToggleButton liveCB; |
---|
| 1037 | + cCheckBox supportCB; |
---|
| 1038 | + cCheckBox localCB; |
---|
| 1039 | + cCheckBox crowdCB; |
---|
| 1040 | + cCheckBox smoothCB; |
---|
| 1041 | + cToggleButton fastCB; |
---|
| 1042 | + cCheckBox slowCB; |
---|
| 1043 | + cCheckBox boxCB; |
---|
| 1044 | + cCheckBox zoomBoxCB; |
---|
| 1045 | + cCheckBox freezeCB; |
---|
| 1046 | + //cToggleButton trackCB; |
---|
| 1047 | + cCheckBox trackCB; |
---|
| 1048 | + cCheckBox smoothfocusCB; |
---|
831 | 1049 | // JCheckBox speakerMocapCB; |
---|
832 | | - JCheckBox speakerCameraCB; |
---|
833 | | - JCheckBox speakerFocusCB; |
---|
834 | | - JCheckBox debugCB; |
---|
835 | | - JCheckBox oeilCB; |
---|
836 | | - JCheckBox lookAtCB; |
---|
| 1050 | + cCheckBox speakerCameraCB; |
---|
| 1051 | + cCheckBox speakerFocusCB; |
---|
| 1052 | + cCheckBox debugCB; |
---|
| 1053 | + |
---|
| 1054 | + cCheckBox oeilCB; |
---|
| 1055 | + cCheckBox shadowCB; |
---|
| 1056 | + cCheckBox autokeepCB; |
---|
| 1057 | + cCheckBox lookAtCB; |
---|
837 | 1058 | |
---|
838 | 1059 | // static int COLOR = 1; |
---|
839 | 1060 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
841 | 1062 | |
---|
842 | 1063 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
843 | 1064 | |
---|
844 | | - JCheckBox colorCB; |
---|
845 | | - JCheckBox materialCB; |
---|
846 | | - JCheckBox textureCB; |
---|
| 1065 | + cCheckBox colorCB; |
---|
| 1066 | + cCheckBox materialCB; |
---|
| 1067 | + cCheckBox textureCB; |
---|
847 | 1068 | |
---|
848 | 1069 | public void itemStateChanged(ItemEvent e) |
---|
849 | 1070 | { |
---|
.. | .. |
---|
871 | 1092 | } else if(e.getSource() == liveCB) |
---|
872 | 1093 | { |
---|
873 | 1094 | cameraView.ToggleLive(); |
---|
| 1095 | + refreshContents(false); |
---|
874 | 1096 | } |
---|
875 | 1097 | else if(e.getSource() == supportCB) |
---|
876 | 1098 | { |
---|
.. | .. |
---|
935 | 1157 | { |
---|
936 | 1158 | cameraView.ToggleOeil(); |
---|
937 | 1159 | } |
---|
| 1160 | + else if(e.getSource() == shadowCB) |
---|
| 1161 | + { |
---|
| 1162 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1163 | + } |
---|
| 1164 | + else if(e.getSource() == freezeCB) |
---|
| 1165 | + { |
---|
| 1166 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1167 | + } |
---|
| 1168 | + else if(e.getSource() == autokeepCB) |
---|
| 1169 | + { |
---|
| 1170 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1171 | + } |
---|
938 | 1172 | else if(e.getSource() == lookAtCB) |
---|
939 | 1173 | { |
---|
940 | 1174 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
951 | 1185 | |
---|
952 | 1186 | /**/ |
---|
953 | 1187 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
954 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1188 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1189 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
955 | 1190 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
956 | 1191 | // We can't move the root node or an empty selection |
---|
957 | 1192 | return; |
---|
.. | .. |
---|
1014 | 1249 | } |
---|
1015 | 1250 | } |
---|
1016 | 1251 | |
---|
1017 | | - String string = (String) object; |
---|
1018 | | - |
---|
1019 | 1252 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1020 | 1253 | // if( object instanceof java.io.File[]) |
---|
1021 | 1254 | // { |
---|
.. | .. |
---|
1023 | 1256 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1024 | 1257 | // return; |
---|
1025 | 1258 | // } |
---|
| 1259 | + |
---|
| 1260 | + String string = object.toString(); |
---|
1026 | 1261 | |
---|
1027 | 1262 | // File path for Mac and Windows |
---|
1028 | 1263 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1068 | 1303 | |
---|
1069 | 1304 | assert target == objEditor.jTree; |
---|
1070 | 1305 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1306 | + Object3D destinationLeaf; |
---|
1071 | 1307 | try { |
---|
1072 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1308 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1073 | 1309 | } catch (Exception e) { |
---|
1074 | 1310 | System.out.println("destinationPath : " + destinationPath); |
---|
1075 | 1311 | return; |
---|
1076 | 1312 | } |
---|
1077 | 1313 | |
---|
1078 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1314 | + for (int i=group.selection.size(); --i>=0;) |
---|
1079 | 1315 | { |
---|
| 1316 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1317 | + |
---|
| 1318 | + // Cannot move into itself |
---|
| 1319 | + if (child == destinationLeaf) |
---|
| 1320 | + return; |
---|
| 1321 | + } |
---|
| 1322 | + |
---|
| 1323 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1324 | +// { |
---|
1080 | 1325 | loadClipboard(true); |
---|
1081 | 1326 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1082 | 1327 | pasteInto(false, false); |
---|
1083 | | - } else { |
---|
1084 | | - loadClipboard(false); |
---|
1085 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1086 | | - pasteInto(false, false); // true); // ??? |
---|
1087 | | - } |
---|
| 1328 | +// } else { |
---|
| 1329 | +// loadClipboard(false); |
---|
| 1330 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1331 | +// pasteInto(false, false); // true); // ??? |
---|
| 1332 | +// } |
---|
1088 | 1333 | } |
---|
1089 | 1334 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1090 | 1335 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1189 | 1434 | { |
---|
1190 | 1435 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1191 | 1436 | //heightFieldItem.addActionListener(this); |
---|
1192 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1193 | | - gridItem.addActionListener(this); |
---|
1194 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1195 | | - rectoidItem.addActionListener(this); |
---|
1196 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1197 | | - ellipsoidItem.addActionListener(this); |
---|
1198 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1199 | | - coneItem.addActionListener(this); |
---|
1200 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1201 | | - torusItem.addActionListener(this); |
---|
1202 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1203 | | - superItem.addActionListener(this); |
---|
| 1437 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1438 | +// gridItem.addActionListener(this); |
---|
| 1439 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1440 | +// rectoidItem.addActionListener(this); |
---|
| 1441 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1442 | +// ellipsoidItem.addActionListener(this); |
---|
| 1443 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1444 | +// coneItem.addActionListener(this); |
---|
| 1445 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1446 | +// torusItem.addActionListener(this); |
---|
| 1447 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1448 | +// superItem.addActionListener(this); |
---|
| 1449 | + |
---|
| 1450 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1451 | + cameraItem.addActionListener(this); |
---|
| 1452 | + |
---|
| 1453 | + if (!Globals.ADVANCED) |
---|
| 1454 | + { |
---|
1204 | 1455 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1205 | 1456 | kleinItem.addActionListener(this); |
---|
1206 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1207 | | - particleItem.addActionListener(this); |
---|
| 1457 | + } |
---|
| 1458 | + |
---|
| 1459 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1460 | +// particleItem.addActionListener(this); |
---|
1208 | 1461 | if (Globals.ADVANCED) |
---|
1209 | 1462 | { |
---|
1210 | 1463 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1230 | 1483 | } |
---|
1231 | 1484 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1232 | 1485 | bezierItem.addActionListener(this); |
---|
1233 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1234 | | - overlayItem.addActionListener(this); |
---|
1235 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1236 | | - lightItem.addActionListener(this); |
---|
| 1486 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1487 | +// overlayItem.addActionListener(this); |
---|
| 1488 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1489 | +// lightItem.addActionListener(this); |
---|
1237 | 1490 | menu.add("-"); |
---|
1238 | 1491 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1239 | 1492 | //superLoopItem.addActionListener(this); |
---|
1240 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1241 | | - loopItem.addActionListener(this); |
---|
| 1493 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1494 | +// loopItem.addActionListener(this); |
---|
1242 | 1495 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1243 | 1496 | doubleItem.addActionListener(this); |
---|
1244 | 1497 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1254 | 1507 | animationItem.addItemListener(this); |
---|
1255 | 1508 | animationItem.setState(Globals.ANIMATION); |
---|
1256 | 1509 | |
---|
| 1510 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1511 | + archiveItem.addActionListener(this); |
---|
| 1512 | + |
---|
1257 | 1513 | menu.add("-"); |
---|
1258 | 1514 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1259 | 1515 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1266 | 1522 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1267 | 1523 | reduce34MorphItem.addActionListener(this); |
---|
1268 | 1524 | menu.add("-"); |
---|
| 1525 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1526 | + memoryItem.addActionListener(this); |
---|
1269 | 1527 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1270 | 1528 | computeAOItem.addActionListener(this); |
---|
1271 | 1529 | |
---|
.. | .. |
---|
1274 | 1532 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1275 | 1533 | mirrorItem.addActionListener(this); |
---|
1276 | 1534 | menu.add("-"); |
---|
1277 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1278 | | - memoryItem.addActionListener(this); |
---|
1279 | 1535 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1280 | 1536 | analyzeItem.addActionListener(this); |
---|
1281 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1537 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1282 | 1538 | dumpItem.addActionListener(this); |
---|
1283 | 1539 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1284 | 1540 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1419 | 1675 | shadow.material = new cMaterial(obj.material); |
---|
1420 | 1676 | shadow.material.diffuse = 0.0001f; |
---|
1421 | 1677 | shadow.material.specular = 0.0001f; |
---|
| 1678 | + //shadow.projectedVertices[1].x = 300; |
---|
1422 | 1679 | |
---|
1423 | 1680 | makeSomething(shadow); |
---|
1424 | 1681 | } |
---|
| 1682 | + |
---|
| 1683 | + private void ClearUnpinned() |
---|
| 1684 | + { |
---|
| 1685 | + //for (Object3D obj : listUI) |
---|
| 1686 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1687 | + { |
---|
| 1688 | + Object3D obj = listUI.elementAt(i); |
---|
| 1689 | + if (!obj.pinned) |
---|
| 1690 | + { |
---|
| 1691 | + obj.CloseUI(); |
---|
| 1692 | + listUI.remove(i); |
---|
| 1693 | + } |
---|
| 1694 | + } |
---|
| 1695 | + } |
---|
1425 | 1696 | |
---|
1426 | 1697 | /** |
---|
1427 | 1698 | * applyExample |
---|
.. | .. |
---|
1666 | 1937 | { |
---|
1667 | 1938 | ScreenFit(); |
---|
1668 | 1939 | } else |
---|
1669 | | - if (source == switchItem) |
---|
| 1940 | + if (source == switchViewItem) |
---|
1670 | 1941 | { |
---|
1671 | 1942 | cVector v1 = new cVector(); |
---|
1672 | 1943 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1675 | 1946 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1676 | 1947 | objEditor.cameraView.repaint(); |
---|
1677 | 1948 | } else |
---|
1678 | | - if (source == rectoidItem) |
---|
| 1949 | + if (source == rectoidItem || source == boxButton) |
---|
1679 | 1950 | { |
---|
1680 | 1951 | makeSomething(new Box()); |
---|
1681 | 1952 | } else |
---|
1682 | | - if (source == particleItem) |
---|
| 1953 | + if (source == particleItem || source == particlesButton) |
---|
1683 | 1954 | { |
---|
1684 | 1955 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1685 | 1956 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1758 | 2029 | |
---|
1759 | 2030 | makeSomething(obj); |
---|
1760 | 2031 | } else |
---|
1761 | | - if (source == gridItem) |
---|
| 2032 | + if (source == gridItem || source == gridButton) |
---|
1762 | 2033 | { |
---|
1763 | 2034 | makeSomething(new Grid()); |
---|
1764 | 2035 | } else |
---|
1765 | | - if (source == ellipsoidItem) |
---|
| 2036 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1766 | 2037 | { |
---|
1767 | 2038 | makeSomething(new Sphere()); |
---|
1768 | 2039 | } else |
---|
1769 | | - if (source == coneItem) |
---|
| 2040 | + if (source == coneItem || source == coneButton) |
---|
1770 | 2041 | { |
---|
1771 | 2042 | makeSomething(new Cone()); |
---|
1772 | 2043 | } else |
---|
1773 | | - if (source == torusItem) |
---|
| 2044 | + if (source == torusItem || source == torusButton) |
---|
1774 | 2045 | { |
---|
1775 | 2046 | makeSomething(new Torus()); |
---|
1776 | 2047 | } else |
---|
1777 | | - if (source == superItem) |
---|
| 2048 | + if (source == superItem || source == superButton) |
---|
1778 | 2049 | { |
---|
1779 | 2050 | makeSomething(new Superellipsoid()); |
---|
1780 | 2051 | } else |
---|
1781 | | - if (source == kleinItem) |
---|
| 2052 | + if (source == kleinItem || source == kleinButton) |
---|
1782 | 2053 | { |
---|
1783 | 2054 | makeSomething(new Klein()); |
---|
1784 | 2055 | } else |
---|
.. | .. |
---|
1798 | 2069 | { |
---|
1799 | 2070 | makeSomething(new BezierSurface()); |
---|
1800 | 2071 | } else |
---|
1801 | | - if (source == overlayItem) |
---|
| 2072 | + if (source == overlayItem || source == overlayButton) |
---|
1802 | 2073 | { |
---|
1803 | 2074 | /* |
---|
1804 | 2075 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1846 | 2117 | s.setup(); |
---|
1847 | 2118 | makeSomething(s); |
---|
1848 | 2119 | } else |
---|
1849 | | - if (source == lightItem) |
---|
| 2120 | + if (source == lightItem || source == lightButton) |
---|
1850 | 2121 | { |
---|
1851 | 2122 | makeSomething(new Light()); |
---|
1852 | 2123 | } else |
---|
.. | .. |
---|
1896 | 2167 | |
---|
1897 | 2168 | group(g); |
---|
1898 | 2169 | } else |
---|
1899 | | - if (source == loopItem) |
---|
| 2170 | + if (source == loopItem || source == loopButton) |
---|
1900 | 2171 | { |
---|
1901 | 2172 | Composite csg = new GroupLeaf(); |
---|
1902 | 2173 | csg.count = 5; |
---|
1903 | 2174 | group(csg); |
---|
1904 | | - Composite child = new cGroup(); |
---|
| 2175 | + Composite child = new cGroup("Branch"); |
---|
1905 | 2176 | csg.addChild(child); |
---|
1906 | 2177 | child.addChild(csg); |
---|
1907 | 2178 | } else |
---|
1908 | 2179 | if (source == doubleItem) |
---|
1909 | 2180 | { |
---|
1910 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Fork"); |
---|
1911 | 2182 | csg.count = 5; |
---|
1912 | 2183 | group(csg); |
---|
1913 | | - Composite child = new cGroup(); |
---|
| 2184 | + Composite child = new cGroup("Branch A"); |
---|
1914 | 2185 | csg.addChild(child); |
---|
1915 | 2186 | child.addChild(csg); |
---|
1916 | | - child = new cGroup(); |
---|
| 2187 | + child = new cGroup("Branch B"); |
---|
1917 | 2188 | csg.addChild(child); |
---|
1918 | 2189 | child.addChild(csg); |
---|
1919 | 2190 | } else |
---|
1920 | 2191 | if (source == tripleItem) |
---|
1921 | 2192 | { |
---|
1922 | | - Composite csg = new GroupLeaf(); |
---|
| 2193 | + Composite csg = new GroupLeaf("Trident"); |
---|
1923 | 2194 | csg.count = 4; |
---|
1924 | 2195 | group(csg); |
---|
1925 | 2196 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1969 | 2240 | { |
---|
1970 | 2241 | DumpObject(); |
---|
1971 | 2242 | } else |
---|
| 2243 | + if (source == minButton) |
---|
| 2244 | + { |
---|
| 2245 | + Minimize(); |
---|
| 2246 | + } else |
---|
| 2247 | + if (source == maxButton) |
---|
| 2248 | + { |
---|
| 2249 | + Maximize(); |
---|
| 2250 | + } else |
---|
| 2251 | + if (source == fullButton) |
---|
| 2252 | + { |
---|
| 2253 | + ToggleFullScreen(); |
---|
| 2254 | + } else |
---|
1972 | 2255 | if (source == undoButton) |
---|
1973 | 2256 | { |
---|
| 2257 | + // Go to previous version |
---|
| 2258 | + //if (!Undo()) |
---|
| 2259 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
1974 | 2260 | Undo(); |
---|
| 2261 | + } else |
---|
| 2262 | + if (source == restoreButton) |
---|
| 2263 | + { |
---|
| 2264 | + // Restore current version |
---|
| 2265 | + Restore(); |
---|
| 2266 | + } else |
---|
| 2267 | + if (source == replaceButton) |
---|
| 2268 | + { |
---|
| 2269 | + // Overwrite current version |
---|
| 2270 | + Replace(); |
---|
1975 | 2271 | } else |
---|
1976 | 2272 | if (source == redoButton) |
---|
1977 | 2273 | { |
---|
| 2274 | + // Go to next version |
---|
1978 | 2275 | Redo(); |
---|
1979 | 2276 | } else |
---|
1980 | 2277 | if (source == saveButton) |
---|
1981 | 2278 | { |
---|
1982 | | - Save(); |
---|
| 2279 | + // Save a new version |
---|
| 2280 | + if (!Save(true)) |
---|
| 2281 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
1983 | 2282 | } else |
---|
1984 | 2283 | if (source == oneStepButton) |
---|
1985 | 2284 | { |
---|
.. | .. |
---|
1988 | 2287 | } else |
---|
1989 | 2288 | if (source == screenfitButton) |
---|
1990 | 2289 | { |
---|
1991 | | - //Reload(lastConverter, lastFilename, true); |
---|
1992 | 2290 | ScreenFit(); |
---|
1993 | 2291 | } else |
---|
1994 | 2292 | if (source == screenfitpointButton) |
---|
1995 | 2293 | { |
---|
1996 | | - //Reload(lastConverter, lastFilename, true); |
---|
1997 | 2294 | ScreenFitPoint(); |
---|
1998 | 2295 | } else |
---|
1999 | 2296 | if (source == snapobjectButton) |
---|
2000 | 2297 | { |
---|
2001 | | - //Reload(lastConverter, lastFilename, true); |
---|
2002 | 2298 | SnapObject(); |
---|
2003 | 2299 | } else |
---|
2004 | 2300 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2374 | 2670 | { |
---|
2375 | 2671 | ClearSelection(true); |
---|
2376 | 2672 | } else |
---|
2377 | | - if (source == grabItem) |
---|
| 2673 | + if (source == grabItem || source == groupButton) |
---|
2378 | 2674 | { |
---|
2379 | | - group(new cGroup(), true); |
---|
| 2675 | + group(new cGroup(), false); // true); |
---|
2380 | 2676 | } else |
---|
2381 | 2677 | if (source == hideItem) |
---|
2382 | 2678 | { |
---|
.. | .. |
---|
2394 | 2690 | { |
---|
2395 | 2691 | makeSomething(new Camera()); |
---|
2396 | 2692 | } else |
---|
2397 | | - if (source == compositeItem) |
---|
| 2693 | + if (source == compositeItem || source == compositeButton) |
---|
2398 | 2694 | { |
---|
2399 | 2695 | group(new Composite()); |
---|
2400 | 2696 | } else |
---|
2401 | | - if (source == randomItem) |
---|
| 2697 | + if (source == switchItem || source == switchButton) |
---|
2402 | 2698 | { |
---|
2403 | 2699 | RandomNode random = new RandomNode(); |
---|
2404 | 2700 | group(random); |
---|
.. | .. |
---|
2500 | 2796 | { |
---|
2501 | 2797 | group(new cLinker()); |
---|
2502 | 2798 | } else |
---|
2503 | | - if (source == textureItem) |
---|
| 2799 | + if (source == textureItem || source == textureButton) |
---|
2504 | 2800 | { |
---|
2505 | 2801 | group(new TextureNode()); |
---|
2506 | 2802 | } else |
---|
.. | .. |
---|
2520 | 2816 | { |
---|
2521 | 2817 | CastShadow(2); |
---|
2522 | 2818 | } else |
---|
2523 | | - if (source == ungroupItem) |
---|
| 2819 | + if (source == ungroupItem || source == ungroupButton) |
---|
2524 | 2820 | { |
---|
2525 | | - //ungroup(); |
---|
| 2821 | + boolean hasRoot = false; |
---|
| 2822 | + |
---|
2526 | 2823 | for (int i=0; i<group.selection.size(); i++) |
---|
2527 | 2824 | { |
---|
2528 | | - Ungroup(group.selection.get(i)); |
---|
| 2825 | + if (group.selection.get(i) == group) |
---|
| 2826 | + { |
---|
| 2827 | + hasRoot = true; |
---|
| 2828 | + break; |
---|
| 2829 | + } |
---|
2529 | 2830 | } |
---|
2530 | 2831 | |
---|
2531 | | - ClearSelection(false); |
---|
2532 | | - |
---|
2533 | | - refreshContents(); |
---|
| 2832 | + if (!hasRoot) |
---|
| 2833 | + { |
---|
| 2834 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2835 | + { |
---|
| 2836 | + Ungroup(group.selection.get(i)); |
---|
| 2837 | + } |
---|
| 2838 | + |
---|
| 2839 | + ClearSelection(false); |
---|
| 2840 | + |
---|
| 2841 | + refreshContents(); |
---|
| 2842 | + } |
---|
2534 | 2843 | } else |
---|
2535 | 2844 | if (source == genUVItem) |
---|
2536 | 2845 | { |
---|
.. | .. |
---|
2542 | 2851 | } else |
---|
2543 | 2852 | if (source == genNormalsMESHItem) |
---|
2544 | 2853 | { |
---|
2545 | | - GenNormals(true); // TODO |
---|
| 2854 | + GenNormalsMESH(); |
---|
2546 | 2855 | } else |
---|
2547 | 2856 | if (source == genNormalsORGANItem) |
---|
2548 | 2857 | { |
---|
.. | .. |
---|
2607 | 2916 | if (source == unmarkleavesItem) |
---|
2608 | 2917 | { |
---|
2609 | 2918 | MarkLeaves(false); |
---|
| 2919 | + } else |
---|
| 2920 | + if (source == rewindleavesItem) |
---|
| 2921 | + { |
---|
| 2922 | + RewindLeaves(true); |
---|
| 2923 | + } else |
---|
| 2924 | + if (source == unrewindleavesItem) |
---|
| 2925 | + { |
---|
| 2926 | + RewindLeaves(false); |
---|
| 2927 | + } else |
---|
| 2928 | + if (source == randomleavesItem) |
---|
| 2929 | + { |
---|
| 2930 | + RandomLeaves(true); |
---|
| 2931 | + } else |
---|
| 2932 | + if (source == unrandomleavesItem) |
---|
| 2933 | + { |
---|
| 2934 | + RandomLeaves(false); |
---|
2610 | 2935 | } else |
---|
2611 | 2936 | if (source == flipVItem) |
---|
2612 | 2937 | { |
---|
.. | .. |
---|
2842 | 3167 | if (source == twoButton) |
---|
2843 | 3168 | { |
---|
2844 | 3169 | radio.layout = twoButton; |
---|
| 3170 | + |
---|
| 3171 | + if (CameraPane.FULLSCREEN) |
---|
| 3172 | + fullscreenLayout = radio.layout; |
---|
| 3173 | + |
---|
2845 | 3174 | // bug |
---|
2846 | 3175 | //gridPanel.setDividerLocation(1.0); |
---|
2847 | 3176 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2874 | 3203 | bigThree.ClearUI(); |
---|
2875 | 3204 | bigThree.add(centralPanel); |
---|
2876 | 3205 | bigThree.FlushUI(); |
---|
| 3206 | + |
---|
| 3207 | + cameraView.requestFocusInWindow(); |
---|
| 3208 | + |
---|
| 3209 | +// refreshContents(true); |
---|
| 3210 | +// |
---|
| 3211 | +// try |
---|
| 3212 | +// { |
---|
| 3213 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3214 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3215 | +// bot.mouseMove(100, 100); |
---|
| 3216 | +// bot.mousePress(mask); |
---|
| 3217 | +// bot.mouseRelease(mask); |
---|
| 3218 | +// } |
---|
| 3219 | +// catch (Exception e) |
---|
| 3220 | +// { |
---|
| 3221 | +// |
---|
| 3222 | +// } |
---|
| 3223 | + |
---|
2877 | 3224 | } else |
---|
2878 | 3225 | if (source == threeButton) |
---|
2879 | 3226 | { |
---|
2880 | 3227 | radio.layout = threeButton; |
---|
| 3228 | + |
---|
| 3229 | + if (CameraPane.FULLSCREEN) |
---|
| 3230 | + fullscreenLayout = radio.layout; |
---|
2881 | 3231 | |
---|
2882 | 3232 | // bigThree.remove(scenePanel); |
---|
2883 | 3233 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2910 | 3260 | bigThree.add(centralPanel); |
---|
2911 | 3261 | bigThree.add(XYZPanel); |
---|
2912 | 3262 | bigThree.FlushUI(); |
---|
| 3263 | + |
---|
| 3264 | + cameraView.requestFocusInWindow(); |
---|
2913 | 3265 | } else |
---|
2914 | 3266 | if (source == fourButton) |
---|
2915 | 3267 | { |
---|
2916 | 3268 | radio.layout = fourButton; |
---|
| 3269 | + |
---|
| 3270 | + if (CameraPane.FULLSCREEN) |
---|
| 3271 | + fullscreenLayout = radio.layout; |
---|
2917 | 3272 | |
---|
2918 | 3273 | // bigThree.remove(scenePanel); |
---|
2919 | 3274 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2945 | 3300 | bigThree.ClearUI(); |
---|
2946 | 3301 | bigThree.add(scenePanel); |
---|
2947 | 3302 | bigThree.FlushUI(); |
---|
| 3303 | + |
---|
| 3304 | + cameraView.requestFocusInWindow(); |
---|
2948 | 3305 | } else |
---|
2949 | 3306 | if (source == sixButton) |
---|
2950 | 3307 | { |
---|
2951 | 3308 | radio.layout = sixButton; |
---|
| 3309 | + |
---|
| 3310 | + if (CameraPane.FULLSCREEN) |
---|
| 3311 | + fullscreenLayout = radio.layout; |
---|
2952 | 3312 | |
---|
2953 | 3313 | // bigThree.remove(scenePanel); |
---|
2954 | 3314 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2981 | 3341 | bigThree.add(scenePanel); |
---|
2982 | 3342 | bigThree.add(centralPanel); |
---|
2983 | 3343 | bigThree.FlushUI(); |
---|
| 3344 | + |
---|
| 3345 | + cameraView.requestFocusInWindow(); |
---|
2984 | 3346 | } else |
---|
2985 | 3347 | if (source == sevenButton) |
---|
2986 | 3348 | { |
---|
2987 | 3349 | radio.layout = sevenButton; |
---|
| 3350 | + |
---|
| 3351 | + if (CameraPane.FULLSCREEN) |
---|
| 3352 | + fullscreenLayout = radio.layout; |
---|
2988 | 3353 | |
---|
2989 | 3354 | // bigThree.remove(scenePanel); |
---|
2990 | 3355 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3018 | 3383 | bigThree.add(centralPanel); |
---|
3019 | 3384 | bigThree.add(XYZPanel); |
---|
3020 | 3385 | bigThree.FlushUI(); |
---|
| 3386 | + |
---|
| 3387 | + cameraView.requestFocusInWindow(); |
---|
3021 | 3388 | } else |
---|
3022 | 3389 | if (source == rootButton) |
---|
3023 | 3390 | { |
---|
.. | .. |
---|
3029 | 3396 | EditObject(obj); |
---|
3030 | 3397 | } |
---|
3031 | 3398 | |
---|
| 3399 | + cameraView.requestFocusInWindow(); |
---|
3032 | 3400 | refreshContents(true); |
---|
3033 | 3401 | } else |
---|
3034 | 3402 | if (source == closeButton) |
---|
.. | .. |
---|
3038 | 3406 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3039 | 3407 | { |
---|
3040 | 3408 | ab = (cRadio)e.nextElement(); |
---|
3041 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3409 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3042 | 3410 | { |
---|
| 3411 | + // Patch to avoid bug with transparency. |
---|
| 3412 | + if (!ab.hadMaterial) |
---|
| 3413 | + { |
---|
| 3414 | + ab.object.material = null; |
---|
| 3415 | + } |
---|
| 3416 | + |
---|
3043 | 3417 | buttonGroup.remove(ab); |
---|
3044 | 3418 | radioPanel.remove(ab); |
---|
3045 | 3419 | |
---|
3046 | | - ab.GetObject().editWindow = null; |
---|
| 3420 | + //ab.GetObject().editWindow = null; |
---|
| 3421 | + ab.GetObject().manipWindow = null; |
---|
3047 | 3422 | // ab.GetObject().objectUI = null; // ????????? |
---|
3048 | 3423 | |
---|
3049 | 3424 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3050 | 3425 | break; |
---|
3051 | 3426 | } |
---|
3052 | 3427 | } |
---|
| 3428 | + |
---|
| 3429 | + cameraView.requestFocusInWindow(); |
---|
3053 | 3430 | refreshContents(true); |
---|
3054 | 3431 | } else |
---|
3055 | 3432 | if (source == editItem || source == editButton) |
---|
3056 | 3433 | { |
---|
| 3434 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3435 | + { |
---|
| 3436 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3437 | + child.pinned = true; |
---|
| 3438 | + } |
---|
| 3439 | + |
---|
3057 | 3440 | EditSelection(false); |
---|
3058 | 3441 | } else |
---|
3059 | 3442 | if (source == uneditButton) |
---|
.. | .. |
---|
3063 | 3446 | Object3D child = (Object3D)e.nextElement(); |
---|
3064 | 3447 | if(child.editWindow != null) |
---|
3065 | 3448 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3449 | + child.pinned = false; |
---|
3066 | 3450 | child.CloseUI(); |
---|
3067 | 3451 | listUI.remove(child); |
---|
3068 | 3452 | |
---|
.. | .. |
---|
3079 | 3463 | //copy.ClearUI(); |
---|
3080 | 3464 | for (Object3D obj : listUI) |
---|
3081 | 3465 | { |
---|
| 3466 | + obj.pinned = false; |
---|
3082 | 3467 | obj.CloseUI(); |
---|
3083 | 3468 | } |
---|
3084 | 3469 | listUI.clear(); |
---|
.. | .. |
---|
3088 | 3473 | { |
---|
3089 | 3474 | assert(copy == group); |
---|
3090 | 3475 | |
---|
3091 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3476 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3092 | 3477 | |
---|
3093 | 3478 | for (Object3D obj : listUI) |
---|
3094 | 3479 | { |
---|
.. | .. |
---|
3137 | 3522 | } |
---|
3138 | 3523 | |
---|
3139 | 3524 | copy = group; |
---|
| 3525 | + |
---|
| 3526 | + SetUndoStates(); |
---|
| 3527 | + |
---|
3140 | 3528 | //Globals.theRenderer.object = group; |
---|
3141 | 3529 | if(!useclient) |
---|
3142 | 3530 | { |
---|
.. | .. |
---|
3154 | 3542 | } |
---|
3155 | 3543 | |
---|
3156 | 3544 | // fix "+" issue |
---|
3157 | | - group.editWindow = this; |
---|
| 3545 | + //group.editWindow = this; |
---|
| 3546 | + group.manipWindow = this; |
---|
3158 | 3547 | |
---|
3159 | 3548 | /* |
---|
3160 | 3549 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3162 | 3551 | currentLayout = sevenButton; |
---|
3163 | 3552 | */ |
---|
3164 | 3553 | radio.layout.doClick(); |
---|
| 3554 | + |
---|
| 3555 | + ClearUnpinned(); |
---|
| 3556 | + Grafreed.Assert(group != null); |
---|
| 3557 | + Grafreed.Assert(group.selection != null); |
---|
| 3558 | + SetPinStates(group.selection.size() > 0); |
---|
| 3559 | + if (group.selection.size() == 1) |
---|
| 3560 | + EditSelection(false); |
---|
3165 | 3561 | keepparent = group.parent; |
---|
3166 | 3562 | // PARENT = NULL or not??? |
---|
3167 | 3563 | //group.parent = null; // ROOT |
---|
3168 | 3564 | //group.attributes = -1; |
---|
3169 | 3565 | ResetModel(); |
---|
| 3566 | + |
---|
| 3567 | + cameraView.requestFocusInWindow(); |
---|
3170 | 3568 | refreshContents(true); |
---|
3171 | 3569 | } else if (event.getSource() == editCameraItem) |
---|
3172 | 3570 | { |
---|
3173 | 3571 | cameraView.ProtectCamera(); |
---|
3174 | 3572 | cameraView.repaint(); |
---|
3175 | 3573 | return; |
---|
3176 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3574 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3177 | 3575 | { |
---|
3178 | 3576 | cameraView.RevertCamera(); |
---|
3179 | 3577 | cameraView.repaint(); |
---|
.. | .. |
---|
3190 | 3588 | } |
---|
3191 | 3589 | |
---|
3192 | 3590 | boolean useclient = false; |
---|
3193 | | - cRadio radio; |
---|
3194 | 3591 | |
---|
3195 | 3592 | void ToggleRoot() |
---|
3196 | 3593 | { |
---|
.. | .. |
---|
3429 | 3826 | |
---|
3430 | 3827 | int size = obj.MemorySize(); |
---|
3431 | 3828 | |
---|
3432 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3829 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3830 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3433 | 3831 | } |
---|
3434 | 3832 | } |
---|
3435 | 3833 | catch (Exception e) |
---|
.. | .. |
---|
3510 | 3908 | void GenNormals(boolean crease) |
---|
3511 | 3909 | { |
---|
3512 | 3910 | group.GenNormalsS(crease); |
---|
| 3911 | + |
---|
| 3912 | + refreshContents(); |
---|
| 3913 | + } |
---|
| 3914 | + |
---|
| 3915 | + void GenNormalsMESH() |
---|
| 3916 | + { |
---|
| 3917 | + group.GenNormalsMeshS(); |
---|
3513 | 3918 | |
---|
3514 | 3919 | refreshContents(); |
---|
3515 | 3920 | } |
---|
.. | .. |
---|
4137 | 4542 | refreshContents(); |
---|
4138 | 4543 | } |
---|
4139 | 4544 | |
---|
| 4545 | + void RewindLeaves(boolean hide) |
---|
| 4546 | + { |
---|
| 4547 | + group.selection.RewindLeaves(hide); |
---|
| 4548 | + refreshContents(); |
---|
| 4549 | + } |
---|
| 4550 | + |
---|
| 4551 | + void RandomLeaves(boolean hide) |
---|
| 4552 | + { |
---|
| 4553 | + group.selection.RandomLeaves(hide); |
---|
| 4554 | + refreshContents(); |
---|
| 4555 | + } |
---|
| 4556 | + |
---|
4140 | 4557 | void SetTexRes(int tr) |
---|
4141 | 4558 | { |
---|
4142 | 4559 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4208 | 4625 | // } |
---|
4209 | 4626 | // } |
---|
4210 | 4627 | |
---|
4211 | | - static boolean allparams = true; |
---|
4212 | | - |
---|
4213 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4214 | | - |
---|
4215 | 4628 | void EditSelection(boolean newWindow) |
---|
4216 | 4629 | { |
---|
4217 | 4630 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4219 | 4632 | { |
---|
4220 | 4633 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4221 | 4634 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4222 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4635 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4223 | 4636 | |
---|
4224 | 4637 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4225 | 4638 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4304 | 4717 | //new Exception().printStackTrace(); |
---|
4305 | 4718 | |
---|
4306 | 4719 | freezemodel = true; |
---|
4307 | | - |
---|
| 4720 | + ClearUnpinned(); |
---|
| 4721 | + |
---|
4308 | 4722 | /**/ |
---|
4309 | 4723 | //switch (event.id) |
---|
4310 | 4724 | { |
---|
.. | .. |
---|
4312 | 4726 | //case 702: // Event.LIST_DESELECT |
---|
4313 | 4727 | group.deselectAll(); |
---|
4314 | 4728 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4315 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4316 | 4729 | if (tps != null) |
---|
4317 | 4730 | { |
---|
4318 | 4731 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4321 | 4734 | |
---|
4322 | 4735 | //if (child.parent != null) |
---|
4323 | 4736 | //child.parent.addSelectee(child); |
---|
| 4737 | + objEditor.SetMaterial(child); |
---|
4324 | 4738 | group.addSelectee(child); |
---|
4325 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4326 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4327 | | - System.err.println("info : " + child.GetPath()); |
---|
4328 | 4739 | } |
---|
4329 | 4740 | } |
---|
4330 | 4741 | // else |
---|
.. | .. |
---|
4334 | 4745 | // System.err.println("info : " + group.GetPath()); |
---|
4335 | 4746 | // } |
---|
4336 | 4747 | |
---|
4337 | | - objEditor.SetText(); // jan 2014 |
---|
4338 | | - |
---|
4339 | 4748 | if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4340 | 4749 | CameraPane.flash = true; |
---|
4341 | 4750 | |
---|
4342 | 4751 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4343 | 4752 | // a camera |
---|
4344 | 4753 | { |
---|
4345 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4754 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4346 | 4755 | { |
---|
4347 | 4756 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4348 | 4757 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4351 | 4760 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4352 | 4761 | } |
---|
4353 | 4762 | |
---|
| 4763 | + if (tps != null && tps.length == 1) |
---|
| 4764 | + { |
---|
| 4765 | + EditSelection(false); |
---|
| 4766 | + } |
---|
| 4767 | + |
---|
| 4768 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4769 | + |
---|
4354 | 4770 | refreshContents(); |
---|
4355 | 4771 | //return true; |
---|
4356 | 4772 | } |
---|
.. | .. |
---|
4359 | 4775 | |
---|
4360 | 4776 | freezemodel = false; |
---|
4361 | 4777 | } |
---|
| 4778 | + |
---|
| 4779 | + void SetPinStates(boolean enabled) |
---|
| 4780 | + { |
---|
| 4781 | + editButton.setEnabled(enabled); |
---|
| 4782 | + uneditButton.setEnabled(enabled); |
---|
| 4783 | + unselectButton.setEnabled(enabled); |
---|
| 4784 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4785 | + } |
---|
| 4786 | + |
---|
| 4787 | + void refreshContents(boolean cp) |
---|
| 4788 | + { |
---|
| 4789 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4790 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4791 | + { |
---|
| 4792 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4793 | + |
---|
| 4794 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4795 | + { |
---|
| 4796 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4797 | + |
---|
| 4798 | + objEditor.AddInfo(child, this, true); |
---|
| 4799 | + System.err.println("info : " + child.GetPath()); |
---|
| 4800 | + } |
---|
| 4801 | + |
---|
| 4802 | + objEditor.SetText(); // jan 2014 |
---|
| 4803 | + } |
---|
| 4804 | + |
---|
| 4805 | + super.refreshContents(cp); |
---|
| 4806 | + } |
---|
4362 | 4807 | |
---|
4363 | 4808 | void linkSomething(Object3D thing) |
---|
4364 | 4809 | { |
---|
.. | .. |
---|
4441 | 4886 | |
---|
4442 | 4887 | if (cut) |
---|
4443 | 4888 | { |
---|
4444 | | - Save(); |
---|
| 4889 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4890 | +// Save(); |
---|
4445 | 4891 | //int indices[] = jList.getSelectedIndices(); |
---|
4446 | 4892 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4447 | 4893 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4544 | 4990 | |
---|
4545 | 4991 | void paste(boolean expand) |
---|
4546 | 4992 | { |
---|
| 4993 | + if (Globals.REPLACEONMAKE) |
---|
| 4994 | + Save(); |
---|
| 4995 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4996 | + Globals.REPLACEONMAKE = false; |
---|
4547 | 4997 | // if (GrafreeD.clipboard == null) |
---|
4548 | 4998 | // return; |
---|
4549 | 4999 | boolean first = true; |
---|
.. | .. |
---|
4603 | 5053 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4604 | 5054 | } |
---|
4605 | 5055 | |
---|
| 5056 | + Globals.REPLACEONMAKE = keep; |
---|
4606 | 5057 | ResetModel(); |
---|
4607 | 5058 | refreshContents(); |
---|
4608 | 5059 | } |
---|
.. | .. |
---|
4738 | 5189 | |
---|
4739 | 5190 | void group(Object3D csg, boolean grab) |
---|
4740 | 5191 | { |
---|
| 5192 | + if (Globals.REPLACEONMAKE) |
---|
| 5193 | + Save(); |
---|
| 5194 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5195 | + Globals.REPLACEONMAKE = false; |
---|
4741 | 5196 | if (//false) // why?? |
---|
4742 | 5197 | !group.selection.isEmpty()) |
---|
4743 | 5198 | { |
---|
.. | .. |
---|
4851 | 5306 | //node.add(csg); |
---|
4852 | 5307 | //makeSomething(node); |
---|
4853 | 5308 | makeSomething(csg); |
---|
| 5309 | + Globals.REPLACEONMAKE = keep; |
---|
4854 | 5310 | } |
---|
4855 | 5311 | |
---|
4856 | 5312 | void Ungroup(Object3D g) |
---|
4857 | 5313 | { |
---|
| 5314 | + if (Globals.REPLACEONMAKE) |
---|
| 5315 | + Save(); |
---|
| 5316 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5317 | + Globals.REPLACEONMAKE = false; |
---|
4858 | 5318 | if (g instanceof HiddenObject) |
---|
4859 | 5319 | { |
---|
4860 | 5320 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4871 | 5331 | objEditor.makeSomething(g.get(i), false); |
---|
4872 | 5332 | } |
---|
4873 | 5333 | } |
---|
| 5334 | + Globals.REPLACEONMAKE = keep; |
---|
4874 | 5335 | } |
---|
4875 | 5336 | |
---|
4876 | 5337 | void ungroup() |
---|
.. | .. |
---|
5159 | 5620 | cButton clearpanelButton; |
---|
5160 | 5621 | cButton unselectButton; |
---|
5161 | 5622 | |
---|
| 5623 | + cButton restoreCameraButton; |
---|
| 5624 | + |
---|
5162 | 5625 | cButton saveButton; |
---|
5163 | | - cButton undoButton; |
---|
5164 | | - cButton redoButton; |
---|
5165 | 5626 | cButton oneStepButton; |
---|
| 5627 | + |
---|
| 5628 | + cButton groupButton; |
---|
| 5629 | + cButton ungroupButton; |
---|
| 5630 | + cButton compositeButton; |
---|
| 5631 | + cButton switchButton; |
---|
| 5632 | + cButton loopButton; |
---|
| 5633 | + cButton textureButton; |
---|
| 5634 | + |
---|
| 5635 | + cButton gridButton; |
---|
| 5636 | + cButton boxButton; |
---|
| 5637 | + cButton sphereButton; |
---|
| 5638 | + cButton coneButton; |
---|
| 5639 | + cButton torusButton; |
---|
| 5640 | + cButton superButton; |
---|
| 5641 | + cButton kleinButton; |
---|
| 5642 | + cButton particlesButton; |
---|
| 5643 | + cButton overlayButton; |
---|
| 5644 | + cButton lightButton; |
---|
5166 | 5645 | |
---|
5167 | 5646 | cButton screenfitButton; |
---|
5168 | 5647 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5175 | 5654 | |
---|
5176 | 5655 | cButton setsupportButton; |
---|
5177 | 5656 | |
---|
5178 | | - cButton twoButton; |
---|
5179 | | - cButton sixButton; |
---|
5180 | | - cButton threeButton; |
---|
5181 | | - cButton sevenButton; |
---|
5182 | | - cButton fourButton; // full panel |
---|
5183 | | - cButton oneButton; // full XYZ |
---|
5184 | | - //cButton currentLayout; |
---|
5185 | | - |
---|
5186 | 5657 | // |
---|
5187 | 5658 | //Composite |
---|
5188 | 5659 | Object3D // to do !! |
---|
.. | .. |
---|
5192 | 5663 | //JTree jTree; |
---|
5193 | 5664 | private MenuItem lookAtItem; |
---|
5194 | 5665 | private MenuItem lookFromItem; |
---|
5195 | | - private MenuItem switchItem; |
---|
| 5666 | + private MenuItem switchViewItem; |
---|
5196 | 5667 | private MenuItem cutItem; |
---|
5197 | 5668 | private MenuItem undoItem; |
---|
5198 | 5669 | private MenuItem redoItem; |
---|
5199 | | - private MenuItem duplicateItem; |
---|
| 5670 | + private JMenuItem duplicateItem; |
---|
5200 | 5671 | private MenuItem cloneItem; |
---|
5201 | 5672 | private MenuItem cloneSupportItem; |
---|
5202 | 5673 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5259 | 5730 | private MenuItem showleavesItem; |
---|
5260 | 5731 | private MenuItem markleavesItem; |
---|
5261 | 5732 | private MenuItem unmarkleavesItem; |
---|
| 5733 | + private MenuItem rewindleavesItem; |
---|
| 5734 | + private MenuItem unrewindleavesItem; |
---|
| 5735 | + private MenuItem randomleavesItem; |
---|
| 5736 | + private MenuItem unrandomleavesItem; |
---|
5262 | 5737 | |
---|
5263 | 5738 | private MenuItem flipVItem; |
---|
5264 | 5739 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5280 | 5755 | private MenuItem frontItem; |
---|
5281 | 5756 | private MenuItem cameraItem; |
---|
5282 | 5757 | private MenuItem compositeItem; |
---|
5283 | | - private MenuItem randomItem; |
---|
| 5758 | + private MenuItem switchItem; |
---|
5284 | 5759 | private MenuItem physicsItem; |
---|
5285 | 5760 | private MenuItem frameselectorItem; |
---|
5286 | 5761 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5354 | 5829 | |
---|
5355 | 5830 | Menu cameraMenu; |
---|
5356 | 5831 | MenuItem editCameraItem; |
---|
5357 | | - MenuItem revertCameraItem; |
---|
| 5832 | + MenuItem restoreCameraItem; |
---|
5358 | 5833 | } |
---|