.. | .. |
---|
150 | 150 | |
---|
151 | 151 | void SetupMenu2(GroupEditor oe) |
---|
152 | 152 | { |
---|
| 153 | + oe.jTree = new cTree(); |
---|
| 154 | + |
---|
153 | 155 | Menu menu; |
---|
154 | 156 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 157 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 158 | //editItem.addActionListener(this); |
---|
157 | | - undoItem = menu.add(new MenuItem("Undo")); |
---|
158 | | - undoItem.addActionListener(this); |
---|
159 | | - redoItem = menu.add(new MenuItem("Redo")); |
---|
160 | | - redoItem.addActionListener(this); |
---|
161 | | - menu.add("-"); |
---|
162 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 159 | + |
---|
| 160 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 161 | +// undoItem.addActionListener(this); |
---|
| 162 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 163 | +// redoItem.addActionListener(this); |
---|
| 164 | +// menu.add("-"); |
---|
| 165 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
163 | 166 | duplicateItem.addActionListener(this); |
---|
164 | 167 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
165 | 168 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
175 | 178 | copyItem.addActionListener(this); |
---|
176 | 179 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
177 | 180 | pasteItem.addActionListener(this); |
---|
178 | | - menu.add("-"); |
---|
179 | 181 | |
---|
180 | 182 | menu.add("-"); |
---|
181 | 183 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
202 | 204 | //zBufferItem.addActionListener(this); |
---|
203 | 205 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 206 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); |
---|
206 | | - revertCameraItem.addActionListener(this); |
---|
| 207 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 208 | + restoreCameraItem.addActionListener(this); |
---|
207 | 209 | |
---|
208 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
209 | | - toggleFullScreenItem.addItemListener(this); |
---|
210 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
211 | | - cameraMenu.add("-"); |
---|
212 | | - |
---|
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); |
---|
| 210 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 211 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 212 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 213 | +// cameraMenu.add("-"); |
---|
| 214 | +// |
---|
| 215 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 216 | +// toggleTextureItem.addItemListener(this); |
---|
| 217 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 218 | +// |
---|
| 219 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 220 | +// toggleSwitchItem.addItemListener(this); |
---|
| 221 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
220 | 222 | |
---|
221 | 223 | cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
222 | 224 | toggleHandleItem.addItemListener(this); |
---|
.. | .. |
---|
245 | 247 | |
---|
246 | 248 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
247 | 249 | toggleDebugItem.addItemListener(this); |
---|
248 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 250 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
249 | 251 | |
---|
250 | 252 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
251 | 253 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
266 | 268 | // animationItem.addItemListener(this); |
---|
267 | 269 | // animationItem.setState(CameraPane.ANIMATION); |
---|
268 | 270 | cameraMenu.add("-"); |
---|
269 | | - cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); |
---|
| 271 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
270 | 272 | editCameraItem.addActionListener(this); |
---|
271 | 273 | |
---|
272 | 274 | if (Globals.ADVANCED) |
---|
273 | 275 | { |
---|
274 | 276 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
275 | 277 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
276 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 278 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
277 | 279 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
278 | 280 | oe.cameraMenu.add("-"); |
---|
279 | 281 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
281 | 283 | editLeafItem.addActionListener(this); |
---|
282 | 284 | lookAtItem.addActionListener(this); |
---|
283 | 285 | //lookFromItem.addActinoListener(this); |
---|
284 | | - //switchItem.addActionListener(this); |
---|
| 286 | + //switchViewItem.addActionListener(this); |
---|
285 | 287 | } |
---|
286 | 288 | |
---|
287 | 289 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
326 | 328 | } |
---|
327 | 329 | |
---|
328 | 330 | oe.menuBar.add(menu = new Menu("Group")); |
---|
329 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
330 | | - grabItem.addActionListener(this); |
---|
| 331 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 332 | +// grabItem.addActionListener(this); |
---|
331 | 333 | backItem = menu.add(new MenuItem("Back")); |
---|
332 | 334 | backItem.addActionListener(this); |
---|
333 | 335 | frontItem = menu.add(new MenuItem("Front")); |
---|
334 | 336 | frontItem.addActionListener(this); |
---|
335 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | | - compositeItem.addActionListener(this); |
---|
| 337 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 338 | +// compositeItem.addActionListener(this); |
---|
| 339 | + |
---|
| 340 | + if (Globals.ADVANCED) |
---|
| 341 | + { |
---|
337 | 342 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 343 | hideItem.addActionListener(this); |
---|
| 344 | + } |
---|
339 | 345 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 346 | ungroupItem.addActionListener(this); |
---|
341 | | - menu.add("-"); |
---|
342 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | | - randomItem.addActionListener(this); |
---|
| 347 | + |
---|
| 348 | +// menu.add("-"); |
---|
| 349 | +// |
---|
| 350 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 351 | +// switchItem.addActionListener(this); |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
344 | 354 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 355 | switchGeoItem.addActionListener(this); |
---|
346 | 356 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 358 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 359 | morphItem.addActionListener(this); |
---|
350 | 360 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 361 | menu.add("-"); |
---|
354 | 362 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 363 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
357 | 365 | frameselectorItem.addActionListener(this); |
---|
358 | 366 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
359 | 367 | scriptNodeItem.addActionListener(this); |
---|
360 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
361 | | - cameraItem.addActionListener(this); |
---|
362 | 368 | } |
---|
363 | 369 | |
---|
364 | 370 | oe.menuBar.add(menu = new Menu("Object")); |
---|
365 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
366 | | - textureItem.addActionListener(this); |
---|
| 371 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 372 | +// textureItem.addActionListener(this); |
---|
367 | 373 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
368 | 374 | billboardItem.addActionListener(this); |
---|
369 | 375 | csgItem = menu.add(new MenuItem("CSG")); |
---|
370 | 376 | csgItem.addActionListener(this); |
---|
371 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 377 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
372 | 378 | shadowXItem.addActionListener(this); |
---|
373 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 379 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
374 | 380 | shadowYItem.addActionListener(this); |
---|
375 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 381 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 382 | shadowZItem.addActionListener(this); |
---|
377 | 383 | if (Globals.ADVANCED) |
---|
378 | 384 | { |
---|
.. | .. |
---|
469 | 475 | markleavesItem.addActionListener(this); |
---|
470 | 476 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
471 | 477 | unmarkleavesItem.addActionListener(this); |
---|
| 478 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 479 | + rewindleavesItem.addActionListener(this); |
---|
| 480 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 481 | + unrewindleavesItem.addActionListener(this); |
---|
| 482 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 483 | + randomleavesItem.addActionListener(this); |
---|
| 484 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 485 | + unrandomleavesItem.addActionListener(this); |
---|
472 | 486 | menu.add("-"); |
---|
473 | 487 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
474 | 488 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
526 | 540 | |
---|
527 | 541 | void SetupUI2(ObjEditor oe) |
---|
528 | 542 | { |
---|
| 543 | + // June 2019 |
---|
| 544 | + if (oe == null) |
---|
| 545 | + { |
---|
| 546 | + //super.SetupUI2(this); |
---|
| 547 | + //return; |
---|
| 548 | + } |
---|
| 549 | + |
---|
| 550 | + if (copy != group) |
---|
| 551 | + { |
---|
| 552 | + //super.SetupUI2(this); |
---|
| 553 | + } |
---|
| 554 | + |
---|
529 | 555 | //new Exception().printStackTrace(); |
---|
530 | 556 | |
---|
531 | 557 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
554 | 580 | oe.radioPanel.add(dummyButton); |
---|
555 | 581 | oe.buttonGroup.add(dummyButton); |
---|
556 | 582 | */ |
---|
| 583 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 584 | + |
---|
| 585 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 586 | + |
---|
557 | 587 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
558 | 588 | |
---|
559 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 589 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 590 | + //minButton.setToolTipText("Minimize window"); |
---|
| 591 | + //minButton.addActionListener(this); |
---|
| 592 | + |
---|
| 593 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 594 | + maxButton.setToolTipText("Maximize window"); |
---|
| 595 | + maxButton.addActionListener(this); |
---|
| 596 | + |
---|
| 597 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 598 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 599 | + fullButton.addActionListener(this); |
---|
| 600 | + |
---|
| 601 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 602 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 603 | + restoreCameraButton.addActionListener(this); |
---|
| 604 | + |
---|
| 605 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 606 | + undoButton.setToolTipText("Undo changes"); |
---|
| 607 | + undoButton.addActionListener(this); |
---|
| 608 | + undoButton.setEnabled(false); |
---|
| 609 | + |
---|
| 610 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + redoButton.setToolTipText("Redo changes"); |
---|
| 612 | + redoButton.addActionListener(this); |
---|
| 613 | + redoButton.setEnabled(false); |
---|
| 614 | + |
---|
| 615 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + saveButton.setToolTipText("Save changes"); |
---|
| 617 | + saveButton.addActionListener(this); |
---|
| 618 | + |
---|
| 619 | + copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
560 | 620 | liveCB.setToolTipText("Enable animation"); |
---|
561 | 621 | liveCB.addItemListener(this); |
---|
562 | 622 | |
---|
563 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 623 | + copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
564 | 624 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
565 | 625 | oneStepButton.addActionListener(this); |
---|
566 | 626 | |
---|
567 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 627 | + copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
568 | 628 | fastCB.setToolTipText("Fast mode"); |
---|
569 | 629 | fastCB.addItemListener(this); |
---|
570 | 630 | |
---|
571 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
572 | | - trackCB.setToolTipText("Enable tracking"); |
---|
573 | | - trackCB.addItemListener(this); |
---|
574 | | - |
---|
575 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 631 | + //oe.toolboxPanel.Return(); |
---|
| 632 | + |
---|
| 633 | + copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
576 | 634 | screenfitButton.setToolTipText("Screen fit"); |
---|
577 | 635 | screenfitButton.addActionListener(this); |
---|
| 636 | + |
---|
| 637 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 638 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 639 | +// trackCB.addItemListener(this); |
---|
578 | 640 | |
---|
579 | 641 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
580 | 642 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
586 | 648 | snapobjectButton.setToolTipText("Snap Object"); |
---|
587 | 649 | } |
---|
588 | 650 | |
---|
589 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
590 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
591 | | - flashSelectionButton.addActionListener(this); |
---|
| 651 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
592 | 652 | |
---|
593 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
594 | | - |
---|
595 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 653 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | 654 | twoButton.setToolTipText("Show center view only"); |
---|
597 | 655 | twoButton.addActionListener(this); |
---|
598 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + this.fullscreenLayout = twoButton; |
---|
| 657 | + |
---|
| 658 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
599 | 659 | fourButton.addActionListener(this); |
---|
600 | 660 | fourButton.setToolTipText("Show left panel only"); |
---|
601 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 662 | sixButton.setToolTipText("2-column layout left"); |
---|
603 | 663 | sixButton.addActionListener(this); |
---|
604 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
605 | 665 | threeButton.setToolTipText("2-column layout right"); |
---|
606 | 666 | threeButton.addActionListener(this); |
---|
607 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 667 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | 668 | sevenButton.setToolTipText("3-column layout"); |
---|
609 | 669 | sevenButton.addActionListener(this); |
---|
610 | 670 | // |
---|
611 | 671 | |
---|
612 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 672 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
613 | 673 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
614 | 674 | rootButton.addActionListener(this); |
---|
615 | 675 | |
---|
616 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 676 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
617 | 677 | closeButton.setToolTipText("Close tab"); |
---|
618 | 678 | closeButton.addActionListener(this); |
---|
619 | 679 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
620 | 680 | //clearButton.addActionListener(this); |
---|
621 | | - |
---|
622 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 681 | + |
---|
| 682 | + // INSERT |
---|
| 683 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 684 | + gridButton.setToolTipText("Create grid"); |
---|
| 685 | + gridButton.addActionListener(this); |
---|
| 686 | + |
---|
| 687 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + boxButton.setToolTipText("Create box"); |
---|
| 689 | + boxButton.addActionListener(this); |
---|
| 690 | + |
---|
| 691 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 692 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 693 | + sphereButton.addActionListener(this); |
---|
| 694 | + |
---|
| 695 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 696 | + coneButton.setToolTipText("Create cone"); |
---|
| 697 | + coneButton.addActionListener(this); |
---|
| 698 | + |
---|
| 699 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 700 | + torusButton.setToolTipText("Create torus"); |
---|
| 701 | + torusButton.addActionListener(this); |
---|
| 702 | + |
---|
| 703 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 704 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 705 | + superButton.addActionListener(this); |
---|
| 706 | + |
---|
| 707 | + if (Globals.ADVANCED) |
---|
| 708 | + { |
---|
| 709 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 710 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 711 | + kleinButton.addActionListener(this); |
---|
| 712 | + } |
---|
623 | 713 | |
---|
624 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 714 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 715 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 716 | + particlesButton.addActionListener(this); |
---|
| 717 | + |
---|
| 718 | + oe.toolboxPanel.Return(); |
---|
| 719 | + |
---|
| 720 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 721 | + groupButton.setToolTipText("Create group"); |
---|
| 722 | + groupButton.addActionListener(this); |
---|
| 723 | + |
---|
| 724 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 725 | + compositeButton.setToolTipText("Create composite"); |
---|
| 726 | + compositeButton.addActionListener(this); |
---|
| 727 | + |
---|
| 728 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 729 | + switchButton.setToolTipText("Create switch"); |
---|
| 730 | + switchButton.addActionListener(this); |
---|
| 731 | + |
---|
| 732 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 733 | + loopButton.setToolTipText("Create loop"); |
---|
| 734 | + loopButton.addActionListener(this); |
---|
| 735 | + |
---|
| 736 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 737 | + textureButton.setToolTipText("Create texture"); |
---|
| 738 | + textureButton.addActionListener(this); |
---|
| 739 | + |
---|
| 740 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 741 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 742 | + overlayButton.addActionListener(this); |
---|
| 743 | + |
---|
| 744 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 745 | + lightButton.setToolTipText("Create light"); |
---|
| 746 | + lightButton.addActionListener(this); |
---|
| 747 | + |
---|
| 748 | + for (int i=6; --i>=0;) |
---|
| 749 | + { |
---|
| 750 | + oe.toolboxPanel.Return(); |
---|
| 751 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 752 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 753 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 754 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 755 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 756 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 757 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 758 | + } |
---|
| 759 | + |
---|
| 760 | + // EDIT panel |
---|
| 761 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
625 | 762 | editButton.setToolTipText("Edit selection"); |
---|
626 | 763 | editButton.addActionListener(this); |
---|
627 | 764 | |
---|
628 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 765 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
629 | 766 | uneditButton.setToolTipText("Unedit selection"); |
---|
630 | 767 | uneditButton.addActionListener(this); |
---|
631 | 768 | |
---|
632 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 769 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
633 | 770 | allParamsButton.setToolTipText("Edit all params"); |
---|
634 | 771 | allParamsButton.addActionListener(this); |
---|
635 | 772 | |
---|
636 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 773 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
637 | 774 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
638 | 775 | clearPanelButton.addActionListener(this); |
---|
639 | 776 | |
---|
640 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 777 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
641 | 778 | unselectButton.setToolTipText("Unselect"); |
---|
642 | 779 | unselectButton.addActionListener(this); |
---|
643 | 780 | |
---|
644 | | - commandsPanel.preferredHeight = 1; |
---|
| 781 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 782 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 783 | + flashSelectionButton.addActionListener(this); |
---|
645 | 784 | |
---|
646 | | - oe.treePanel.add(commandsPanel); |
---|
647 | | - oe.treePanel.Return(); |
---|
| 785 | + editCommandsPanel.preferredHeight = 1; |
---|
| 786 | + |
---|
| 787 | +// oe.treePanel.add(commandsPanel); |
---|
| 788 | +// oe.treePanel.Return(); |
---|
648 | 789 | |
---|
649 | 790 | // oe.aConstraints.gridx += 1; |
---|
650 | 791 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
661 | 802 | |
---|
662 | 803 | JScrollPane jSP; |
---|
663 | 804 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
664 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 805 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
665 | 806 | ResetModel(); |
---|
666 | 807 | |
---|
667 | 808 | oe.treePanel.add(jSPPanel); |
---|
668 | 809 | oe.treePanel.Return(); |
---|
669 | 810 | |
---|
670 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
671 | | - |
---|
672 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
673 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
674 | | - colorCB.addItemListener(this); |
---|
675 | | - |
---|
676 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
677 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
678 | | - materialCB.addItemListener(this); |
---|
679 | | - |
---|
680 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
681 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
682 | | - textureCB.addItemListener(this); |
---|
683 | | - |
---|
684 | | - copyOptionsPanel.preferredHeight = 1; |
---|
685 | 811 | oe.treePanel.add(copyOptionsPanel); |
---|
686 | 812 | oe.treePanel.Return(); |
---|
687 | 813 | |
---|
.. | .. |
---|
712 | 838 | |
---|
713 | 839 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
714 | 840 | { |
---|
| 841 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 842 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 843 | + colorCB.addItemListener(this); |
---|
| 844 | + |
---|
| 845 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 846 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 847 | + materialCB.addItemListener(this); |
---|
| 848 | + |
---|
| 849 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 850 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 851 | + textureCB.addItemListener(this); |
---|
| 852 | + |
---|
| 853 | + panel.Return(); |
---|
| 854 | + |
---|
715 | 855 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
716 | 856 | boxCB.setToolTipText("Display bounding boxes"); |
---|
717 | 857 | boxCB.addItemListener(this); |
---|
.. | .. |
---|
729 | 869 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
730 | 870 | // localCB.addItemListener(this); |
---|
731 | 871 | |
---|
| 872 | + panel.Return(); |
---|
| 873 | + |
---|
732 | 874 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
733 | 875 | crowdCB.setToolTipText("Used for crowds"); |
---|
734 | 876 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
745 | 887 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
746 | 888 | // speakerMocapCB.addItemListener(this); |
---|
747 | 889 | |
---|
| 890 | + panel.Return(); |
---|
| 891 | + |
---|
748 | 892 | if (false) |
---|
749 | 893 | { |
---|
750 | 894 | // handled in scripts |
---|
.. | .. |
---|
759 | 903 | //constraints.gridy += 1; |
---|
760 | 904 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
761 | 905 | smoothfocusCB.addItemListener(this); |
---|
| 906 | + panel.Return(); |
---|
762 | 907 | } |
---|
763 | 908 | |
---|
764 | 909 | //constraints.gridx += 1; |
---|
765 | 910 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
766 | 911 | // debugCB.addItemListener(this); |
---|
767 | 912 | |
---|
| 913 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 914 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 915 | + trackCB.addItemListener(this); |
---|
| 916 | + |
---|
768 | 917 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 918 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
769 | 919 | oeilCB.addItemListener(this); |
---|
770 | 920 | |
---|
| 921 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 922 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 923 | + shadowCB.addItemListener(this); |
---|
| 924 | + |
---|
| 925 | + panel.Return(); |
---|
| 926 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 927 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 928 | + toggleTextureCB.addItemListener(this); |
---|
| 929 | + |
---|
| 930 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 931 | + toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 932 | + toggleSwitchCB.addItemListener(this); |
---|
| 933 | + |
---|
| 934 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 935 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 936 | + autosaveCB.addItemListener(this); |
---|
| 937 | + |
---|
| 938 | + panel.Return(); |
---|
| 939 | + if (Globals.ADVANCED) |
---|
| 940 | + { |
---|
771 | 941 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
772 | 942 | lookAtCB.setToolTipText("Look-at target"); |
---|
773 | 943 | lookAtCB.addItemListener(this); |
---|
| 944 | + } |
---|
774 | 945 | |
---|
775 | 946 | } |
---|
776 | 947 | |
---|
777 | 948 | cGridBag fill = new cGridBag(); |
---|
778 | | - |
---|
779 | 949 | fill.preferredHeight = 200; |
---|
| 950 | + cGridBag fill2 = new cGridBag(); |
---|
| 951 | + fill2.preferredHeight = 200; |
---|
| 952 | + cGridBag fill3 = new cGridBag(); |
---|
| 953 | + fill3.preferredHeight = 200; |
---|
780 | 954 | |
---|
781 | 955 | panel.add(fill); |
---|
| 956 | + panel.add(fill2); |
---|
| 957 | + panel.add(fill3); |
---|
782 | 958 | |
---|
783 | 959 | } |
---|
784 | 960 | |
---|
785 | 961 | void EditObject(Object3D obj) |
---|
786 | 962 | { |
---|
787 | 963 | cRadio radioButton = new cRadio(obj.name); |
---|
| 964 | + |
---|
| 965 | + // Patch to avoid bug with transparency. |
---|
| 966 | + radioButton.hadMaterial = obj.material != null; |
---|
| 967 | + if (!radioButton.hadMaterial) |
---|
| 968 | + { |
---|
| 969 | + obj.material = new cMaterial(); |
---|
| 970 | + } |
---|
| 971 | + |
---|
788 | 972 | radioButton.SetObject(obj); |
---|
789 | 973 | radioButton.layout = sevenButton; |
---|
790 | 974 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
796 | 980 | |
---|
797 | 981 | void SetupViews(ObjEditor oe) |
---|
798 | 982 | { |
---|
| 983 | + theFrame = this; |
---|
| 984 | + |
---|
799 | 985 | oe.SetupViews(); |
---|
800 | 986 | |
---|
801 | 987 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
804 | 990 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
805 | 991 | } |
---|
806 | 992 | |
---|
807 | | - JCheckBox liveCB; |
---|
808 | | - JCheckBox supportCB; |
---|
809 | | - JCheckBox localCB; |
---|
810 | | - JCheckBox crowdCB; |
---|
811 | | - JCheckBox smoothCB; |
---|
812 | | - JCheckBox fastCB; |
---|
813 | | - JCheckBox slowCB; |
---|
814 | | - JCheckBox boxCB; |
---|
815 | | - JCheckBox zoomBoxCB; |
---|
816 | | - JCheckBox trackCB; |
---|
817 | | - JCheckBox smoothfocusCB; |
---|
| 993 | + cToggleButton liveCB; |
---|
| 994 | + cCheckBox supportCB; |
---|
| 995 | + cCheckBox localCB; |
---|
| 996 | + cCheckBox crowdCB; |
---|
| 997 | + cCheckBox smoothCB; |
---|
| 998 | + cToggleButton fastCB; |
---|
| 999 | + cCheckBox slowCB; |
---|
| 1000 | + cCheckBox boxCB; |
---|
| 1001 | + cCheckBox zoomBoxCB; |
---|
| 1002 | + //cToggleButton trackCB; |
---|
| 1003 | + cCheckBox trackCB; |
---|
| 1004 | + cCheckBox smoothfocusCB; |
---|
818 | 1005 | // JCheckBox speakerMocapCB; |
---|
819 | | - JCheckBox speakerCameraCB; |
---|
820 | | - JCheckBox speakerFocusCB; |
---|
821 | | - JCheckBox debugCB; |
---|
822 | | - JCheckBox oeilCB; |
---|
823 | | - JCheckBox lookAtCB; |
---|
| 1006 | + cCheckBox speakerCameraCB; |
---|
| 1007 | + cCheckBox speakerFocusCB; |
---|
| 1008 | + cCheckBox debugCB; |
---|
| 1009 | + |
---|
| 1010 | + cCheckBox oeilCB; |
---|
| 1011 | + cCheckBox shadowCB; |
---|
| 1012 | + cCheckBox autosaveCB; |
---|
| 1013 | + cCheckBox lookAtCB; |
---|
824 | 1014 | |
---|
825 | 1015 | // static int COLOR = 1; |
---|
826 | 1016 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
828 | 1018 | |
---|
829 | 1019 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
830 | 1020 | |
---|
831 | | - JCheckBox colorCB; |
---|
832 | | - JCheckBox materialCB; |
---|
833 | | - JCheckBox textureCB; |
---|
| 1021 | + cCheckBox colorCB; |
---|
| 1022 | + cCheckBox materialCB; |
---|
| 1023 | + cCheckBox textureCB; |
---|
834 | 1024 | |
---|
835 | 1025 | public void itemStateChanged(ItemEvent e) |
---|
836 | 1026 | { |
---|
.. | .. |
---|
858 | 1048 | } else if(e.getSource() == liveCB) |
---|
859 | 1049 | { |
---|
860 | 1050 | cameraView.ToggleLive(); |
---|
| 1051 | + refreshContents(false); |
---|
861 | 1052 | } |
---|
862 | 1053 | else if(e.getSource() == supportCB) |
---|
863 | 1054 | { |
---|
.. | .. |
---|
922 | 1113 | { |
---|
923 | 1114 | cameraView.ToggleOeil(); |
---|
924 | 1115 | } |
---|
| 1116 | + else if(e.getSource() == shadowCB) |
---|
| 1117 | + { |
---|
| 1118 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1119 | + } |
---|
| 1120 | + else if(e.getSource() == autosaveCB) |
---|
| 1121 | + { |
---|
| 1122 | + Globals.SAVEONMAKE ^= true; |
---|
| 1123 | + } |
---|
925 | 1124 | else if(e.getSource() == lookAtCB) |
---|
926 | 1125 | { |
---|
927 | 1126 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
938 | 1137 | |
---|
939 | 1138 | /**/ |
---|
940 | 1139 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
941 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1140 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1141 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
942 | 1142 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
943 | 1143 | // We can't move the root node or an empty selection |
---|
944 | 1144 | return; |
---|
.. | .. |
---|
1055 | 1255 | |
---|
1056 | 1256 | assert target == objEditor.jTree; |
---|
1057 | 1257 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1258 | + Object3D destinationLeaf; |
---|
1058 | 1259 | try { |
---|
1059 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1260 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1060 | 1261 | } catch (Exception e) { |
---|
1061 | 1262 | System.out.println("destinationPath : " + destinationPath); |
---|
1062 | 1263 | return; |
---|
1063 | 1264 | } |
---|
1064 | 1265 | |
---|
1065 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1266 | + for (int i=group.selection.size(); --i>=0;) |
---|
1066 | 1267 | { |
---|
| 1268 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1269 | + |
---|
| 1270 | + // Cannot move into itself |
---|
| 1271 | + if (child == destinationLeaf) |
---|
| 1272 | + return; |
---|
| 1273 | + } |
---|
| 1274 | + |
---|
| 1275 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1276 | +// { |
---|
1067 | 1277 | loadClipboard(true); |
---|
1068 | 1278 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1069 | 1279 | pasteInto(false, false); |
---|
1070 | | - } else { |
---|
1071 | | - loadClipboard(false); |
---|
1072 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1073 | | - pasteInto(false, false); // true); // ??? |
---|
1074 | | - } |
---|
| 1280 | +// } else { |
---|
| 1281 | +// loadClipboard(false); |
---|
| 1282 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1283 | +// pasteInto(false, false); // true); // ??? |
---|
| 1284 | +// } |
---|
1075 | 1285 | } |
---|
1076 | 1286 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1077 | 1287 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1176 | 1386 | { |
---|
1177 | 1387 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1178 | 1388 | //heightFieldItem.addActionListener(this); |
---|
1179 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1180 | | - gridItem.addActionListener(this); |
---|
1181 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1182 | | - rectoidItem.addActionListener(this); |
---|
1183 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1184 | | - ellipsoidItem.addActionListener(this); |
---|
1185 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1186 | | - coneItem.addActionListener(this); |
---|
1187 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1188 | | - torusItem.addActionListener(this); |
---|
1189 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1190 | | - superItem.addActionListener(this); |
---|
| 1389 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1390 | +// gridItem.addActionListener(this); |
---|
| 1391 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1392 | +// rectoidItem.addActionListener(this); |
---|
| 1393 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1394 | +// ellipsoidItem.addActionListener(this); |
---|
| 1395 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1396 | +// coneItem.addActionListener(this); |
---|
| 1397 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1398 | +// torusItem.addActionListener(this); |
---|
| 1399 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1400 | +// superItem.addActionListener(this); |
---|
| 1401 | + |
---|
| 1402 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1403 | + cameraItem.addActionListener(this); |
---|
| 1404 | + |
---|
| 1405 | + if (!Globals.ADVANCED) |
---|
| 1406 | + { |
---|
1191 | 1407 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1192 | 1408 | kleinItem.addActionListener(this); |
---|
1193 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1194 | | - particleItem.addActionListener(this); |
---|
| 1409 | + } |
---|
| 1410 | + |
---|
| 1411 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1412 | +// particleItem.addActionListener(this); |
---|
1195 | 1413 | if (Globals.ADVANCED) |
---|
1196 | 1414 | { |
---|
1197 | 1415 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1217 | 1435 | } |
---|
1218 | 1436 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1219 | 1437 | bezierItem.addActionListener(this); |
---|
1220 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1221 | | - overlayItem.addActionListener(this); |
---|
1222 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1223 | | - lightItem.addActionListener(this); |
---|
| 1438 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1439 | +// overlayItem.addActionListener(this); |
---|
| 1440 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1441 | +// lightItem.addActionListener(this); |
---|
1224 | 1442 | menu.add("-"); |
---|
1225 | 1443 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1226 | 1444 | //superLoopItem.addActionListener(this); |
---|
1227 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1228 | | - loopItem.addActionListener(this); |
---|
| 1445 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1446 | +// loopItem.addActionListener(this); |
---|
1229 | 1447 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1230 | 1448 | doubleItem.addActionListener(this); |
---|
1231 | 1449 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1265 | 1483 | memoryItem.addActionListener(this); |
---|
1266 | 1484 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1267 | 1485 | analyzeItem.addActionListener(this); |
---|
1268 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1486 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1269 | 1487 | dumpItem.addActionListener(this); |
---|
1270 | 1488 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1271 | 1489 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1406 | 1624 | shadow.material = new cMaterial(obj.material); |
---|
1407 | 1625 | shadow.material.diffuse = 0.0001f; |
---|
1408 | 1626 | shadow.material.specular = 0.0001f; |
---|
| 1627 | + //shadow.projectedVertices[1].x = 300; |
---|
1409 | 1628 | |
---|
1410 | 1629 | makeSomething(shadow); |
---|
1411 | 1630 | } |
---|
.. | .. |
---|
1653 | 1872 | { |
---|
1654 | 1873 | ScreenFit(); |
---|
1655 | 1874 | } else |
---|
1656 | | - if (source == switchItem) |
---|
| 1875 | + if (source == switchViewItem) |
---|
1657 | 1876 | { |
---|
1658 | 1877 | cVector v1 = new cVector(); |
---|
1659 | 1878 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1662 | 1881 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1663 | 1882 | objEditor.cameraView.repaint(); |
---|
1664 | 1883 | } else |
---|
1665 | | - if (source == rectoidItem) |
---|
| 1884 | + if (source == rectoidItem || source == boxButton) |
---|
1666 | 1885 | { |
---|
1667 | 1886 | makeSomething(new Box()); |
---|
1668 | 1887 | } else |
---|
1669 | | - if (source == particleItem) |
---|
| 1888 | + if (source == particleItem || source == particlesButton) |
---|
1670 | 1889 | { |
---|
1671 | 1890 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1672 | 1891 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1745 | 1964 | |
---|
1746 | 1965 | makeSomething(obj); |
---|
1747 | 1966 | } else |
---|
1748 | | - if (source == gridItem) |
---|
| 1967 | + if (source == gridItem || source == gridButton) |
---|
1749 | 1968 | { |
---|
1750 | 1969 | makeSomething(new Grid()); |
---|
1751 | 1970 | } else |
---|
1752 | | - if (source == ellipsoidItem) |
---|
| 1971 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1753 | 1972 | { |
---|
1754 | 1973 | makeSomething(new Sphere()); |
---|
1755 | 1974 | } else |
---|
1756 | | - if (source == coneItem) |
---|
| 1975 | + if (source == coneItem || source == coneButton) |
---|
1757 | 1976 | { |
---|
1758 | 1977 | makeSomething(new Cone()); |
---|
1759 | 1978 | } else |
---|
1760 | | - if (source == torusItem) |
---|
| 1979 | + if (source == torusItem || source == torusButton) |
---|
1761 | 1980 | { |
---|
1762 | 1981 | makeSomething(new Torus()); |
---|
1763 | 1982 | } else |
---|
1764 | | - if (source == superItem) |
---|
| 1983 | + if (source == superItem || source == superButton) |
---|
1765 | 1984 | { |
---|
1766 | 1985 | makeSomething(new Superellipsoid()); |
---|
1767 | 1986 | } else |
---|
1768 | | - if (source == kleinItem) |
---|
| 1987 | + if (source == kleinItem || source == kleinButton) |
---|
1769 | 1988 | { |
---|
1770 | 1989 | makeSomething(new Klein()); |
---|
1771 | 1990 | } else |
---|
.. | .. |
---|
1785 | 2004 | { |
---|
1786 | 2005 | makeSomething(new BezierSurface()); |
---|
1787 | 2006 | } else |
---|
1788 | | - if (source == overlayItem) |
---|
| 2007 | + if (source == overlayItem || source == overlayButton) |
---|
1789 | 2008 | { |
---|
1790 | 2009 | /* |
---|
1791 | 2010 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1833 | 2052 | s.setup(); |
---|
1834 | 2053 | makeSomething(s); |
---|
1835 | 2054 | } else |
---|
1836 | | - if (source == lightItem) |
---|
| 2055 | + if (source == lightItem || source == lightButton) |
---|
1837 | 2056 | { |
---|
1838 | 2057 | makeSomething(new Light()); |
---|
1839 | 2058 | } else |
---|
.. | .. |
---|
1883 | 2102 | |
---|
1884 | 2103 | group(g); |
---|
1885 | 2104 | } else |
---|
1886 | | - if (source == loopItem) |
---|
| 2105 | + if (source == loopItem || source == loopButton) |
---|
1887 | 2106 | { |
---|
1888 | 2107 | Composite csg = new GroupLeaf(); |
---|
1889 | 2108 | csg.count = 5; |
---|
.. | .. |
---|
1955 | 2174 | if (source == dumpItem) |
---|
1956 | 2175 | { |
---|
1957 | 2176 | DumpObject(); |
---|
| 2177 | + } else |
---|
| 2178 | + if (source == minButton) |
---|
| 2179 | + { |
---|
| 2180 | + Minimize(); |
---|
| 2181 | + } else |
---|
| 2182 | + if (source == maxButton) |
---|
| 2183 | + { |
---|
| 2184 | + Maximize(); |
---|
| 2185 | + } else |
---|
| 2186 | + if (source == fullButton) |
---|
| 2187 | + { |
---|
| 2188 | + ToggleFullScreen(); |
---|
| 2189 | + } else |
---|
| 2190 | + if (source == undoButton) |
---|
| 2191 | + { |
---|
| 2192 | + Undo(); |
---|
| 2193 | + } else |
---|
| 2194 | + if (source == redoButton) |
---|
| 2195 | + { |
---|
| 2196 | + Redo(); |
---|
| 2197 | + } else |
---|
| 2198 | + if (source == saveButton) |
---|
| 2199 | + { |
---|
| 2200 | + Save(); |
---|
1958 | 2201 | } else |
---|
1959 | 2202 | if (source == oneStepButton) |
---|
1960 | 2203 | { |
---|
.. | .. |
---|
2349 | 2592 | { |
---|
2350 | 2593 | ClearSelection(true); |
---|
2351 | 2594 | } else |
---|
2352 | | - if (source == grabItem) |
---|
| 2595 | + if (source == grabItem || source == groupButton) |
---|
2353 | 2596 | { |
---|
2354 | | - group(new cGroup(), true); |
---|
| 2597 | + group(new cGroup(), false); // true); |
---|
2355 | 2598 | } else |
---|
2356 | 2599 | if (source == hideItem) |
---|
2357 | 2600 | { |
---|
.. | .. |
---|
2369 | 2612 | { |
---|
2370 | 2613 | makeSomething(new Camera()); |
---|
2371 | 2614 | } else |
---|
2372 | | - if (source == compositeItem) |
---|
| 2615 | + if (source == compositeItem || source == compositeButton) |
---|
2373 | 2616 | { |
---|
2374 | 2617 | group(new Composite()); |
---|
2375 | 2618 | } else |
---|
2376 | | - if (source == randomItem) |
---|
| 2619 | + if (source == switchItem || source == switchButton) |
---|
2377 | 2620 | { |
---|
2378 | 2621 | RandomNode random = new RandomNode(); |
---|
2379 | 2622 | group(random); |
---|
.. | .. |
---|
2475 | 2718 | { |
---|
2476 | 2719 | group(new cLinker()); |
---|
2477 | 2720 | } else |
---|
2478 | | - if (source == textureItem) |
---|
| 2721 | + if (source == textureItem || source == textureButton) |
---|
2479 | 2722 | { |
---|
2480 | 2723 | group(new TextureNode()); |
---|
2481 | 2724 | } else |
---|
.. | .. |
---|
2495 | 2738 | { |
---|
2496 | 2739 | CastShadow(2); |
---|
2497 | 2740 | } else |
---|
2498 | | - if (source == ungroupItem) |
---|
| 2741 | + if (source == ungroupItem || source == ungroupButton) |
---|
2499 | 2742 | { |
---|
2500 | 2743 | //ungroup(); |
---|
2501 | 2744 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2517 | 2760 | } else |
---|
2518 | 2761 | if (source == genNormalsMESHItem) |
---|
2519 | 2762 | { |
---|
2520 | | - GenNormals(true); // TODO |
---|
| 2763 | + GenNormalsMESH(); |
---|
2521 | 2764 | } else |
---|
2522 | 2765 | if (source == genNormalsORGANItem) |
---|
2523 | 2766 | { |
---|
.. | .. |
---|
2582 | 2825 | if (source == unmarkleavesItem) |
---|
2583 | 2826 | { |
---|
2584 | 2827 | MarkLeaves(false); |
---|
| 2828 | + } else |
---|
| 2829 | + if (source == rewindleavesItem) |
---|
| 2830 | + { |
---|
| 2831 | + RewindLeaves(true); |
---|
| 2832 | + } else |
---|
| 2833 | + if (source == unrewindleavesItem) |
---|
| 2834 | + { |
---|
| 2835 | + RewindLeaves(false); |
---|
| 2836 | + } else |
---|
| 2837 | + if (source == randomleavesItem) |
---|
| 2838 | + { |
---|
| 2839 | + RandomLeaves(true); |
---|
| 2840 | + } else |
---|
| 2841 | + if (source == unrandomleavesItem) |
---|
| 2842 | + { |
---|
| 2843 | + RandomLeaves(false); |
---|
2585 | 2844 | } else |
---|
2586 | 2845 | if (source == flipVItem) |
---|
2587 | 2846 | { |
---|
.. | .. |
---|
2817 | 3076 | if (source == twoButton) |
---|
2818 | 3077 | { |
---|
2819 | 3078 | radio.layout = twoButton; |
---|
| 3079 | + |
---|
| 3080 | + if (CameraPane.FULLSCREEN) |
---|
| 3081 | + fullscreenLayout = radio.layout; |
---|
| 3082 | + |
---|
2820 | 3083 | // bug |
---|
2821 | 3084 | //gridPanel.setDividerLocation(1.0); |
---|
2822 | 3085 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2849 | 3112 | bigThree.ClearUI(); |
---|
2850 | 3113 | bigThree.add(centralPanel); |
---|
2851 | 3114 | bigThree.FlushUI(); |
---|
| 3115 | + |
---|
| 3116 | + cameraView.requestFocusInWindow(); |
---|
| 3117 | + |
---|
| 3118 | +// refreshContents(true); |
---|
| 3119 | +// |
---|
| 3120 | +// try |
---|
| 3121 | +// { |
---|
| 3122 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3123 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3124 | +// bot.mouseMove(100, 100); |
---|
| 3125 | +// bot.mousePress(mask); |
---|
| 3126 | +// bot.mouseRelease(mask); |
---|
| 3127 | +// } |
---|
| 3128 | +// catch (Exception e) |
---|
| 3129 | +// { |
---|
| 3130 | +// |
---|
| 3131 | +// } |
---|
| 3132 | + |
---|
2852 | 3133 | } else |
---|
2853 | 3134 | if (source == threeButton) |
---|
2854 | 3135 | { |
---|
2855 | 3136 | radio.layout = threeButton; |
---|
| 3137 | + |
---|
| 3138 | + if (CameraPane.FULLSCREEN) |
---|
| 3139 | + fullscreenLayout = radio.layout; |
---|
2856 | 3140 | |
---|
2857 | 3141 | // bigThree.remove(scenePanel); |
---|
2858 | 3142 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2885 | 3169 | bigThree.add(centralPanel); |
---|
2886 | 3170 | bigThree.add(XYZPanel); |
---|
2887 | 3171 | bigThree.FlushUI(); |
---|
| 3172 | + |
---|
| 3173 | + cameraView.requestFocusInWindow(); |
---|
2888 | 3174 | } else |
---|
2889 | 3175 | if (source == fourButton) |
---|
2890 | 3176 | { |
---|
2891 | 3177 | radio.layout = fourButton; |
---|
| 3178 | + |
---|
| 3179 | + if (CameraPane.FULLSCREEN) |
---|
| 3180 | + fullscreenLayout = radio.layout; |
---|
2892 | 3181 | |
---|
2893 | 3182 | // bigThree.remove(scenePanel); |
---|
2894 | 3183 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2920 | 3209 | bigThree.ClearUI(); |
---|
2921 | 3210 | bigThree.add(scenePanel); |
---|
2922 | 3211 | bigThree.FlushUI(); |
---|
| 3212 | + |
---|
| 3213 | + cameraView.requestFocusInWindow(); |
---|
2923 | 3214 | } else |
---|
2924 | 3215 | if (source == sixButton) |
---|
2925 | 3216 | { |
---|
2926 | 3217 | radio.layout = sixButton; |
---|
| 3218 | + |
---|
| 3219 | + if (CameraPane.FULLSCREEN) |
---|
| 3220 | + fullscreenLayout = radio.layout; |
---|
2927 | 3221 | |
---|
2928 | 3222 | // bigThree.remove(scenePanel); |
---|
2929 | 3223 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2956 | 3250 | bigThree.add(scenePanel); |
---|
2957 | 3251 | bigThree.add(centralPanel); |
---|
2958 | 3252 | bigThree.FlushUI(); |
---|
| 3253 | + |
---|
| 3254 | + cameraView.requestFocusInWindow(); |
---|
2959 | 3255 | } else |
---|
2960 | 3256 | if (source == sevenButton) |
---|
2961 | 3257 | { |
---|
2962 | 3258 | radio.layout = sevenButton; |
---|
| 3259 | + |
---|
| 3260 | + if (CameraPane.FULLSCREEN) |
---|
| 3261 | + fullscreenLayout = radio.layout; |
---|
2963 | 3262 | |
---|
2964 | 3263 | // bigThree.remove(scenePanel); |
---|
2965 | 3264 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2993 | 3292 | bigThree.add(centralPanel); |
---|
2994 | 3293 | bigThree.add(XYZPanel); |
---|
2995 | 3294 | bigThree.FlushUI(); |
---|
| 3295 | + |
---|
| 3296 | + cameraView.requestFocusInWindow(); |
---|
2996 | 3297 | } else |
---|
2997 | 3298 | if (source == rootButton) |
---|
2998 | 3299 | { |
---|
.. | .. |
---|
3004 | 3305 | EditObject(obj); |
---|
3005 | 3306 | } |
---|
3006 | 3307 | |
---|
| 3308 | + cameraView.requestFocusInWindow(); |
---|
3007 | 3309 | refreshContents(true); |
---|
3008 | 3310 | } else |
---|
3009 | 3311 | if (source == closeButton) |
---|
.. | .. |
---|
3013 | 3315 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3014 | 3316 | { |
---|
3015 | 3317 | ab = (cRadio)e.nextElement(); |
---|
3016 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3318 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3017 | 3319 | { |
---|
| 3320 | + // Patch to avoid bug with transparency. |
---|
| 3321 | + if (!ab.hadMaterial) |
---|
| 3322 | + { |
---|
| 3323 | + ab.object.material = null; |
---|
| 3324 | + } |
---|
| 3325 | + |
---|
3018 | 3326 | buttonGroup.remove(ab); |
---|
3019 | 3327 | radioPanel.remove(ab); |
---|
3020 | 3328 | |
---|
3021 | | - ab.GetObject().editWindow = null; |
---|
| 3329 | + //ab.GetObject().editWindow = null; |
---|
| 3330 | + ab.GetObject().manipWindow = null; |
---|
3022 | 3331 | // ab.GetObject().objectUI = null; // ????????? |
---|
3023 | 3332 | |
---|
3024 | 3333 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3025 | 3334 | break; |
---|
3026 | 3335 | } |
---|
3027 | 3336 | } |
---|
| 3337 | + |
---|
| 3338 | + cameraView.requestFocusInWindow(); |
---|
3028 | 3339 | refreshContents(true); |
---|
3029 | 3340 | } else |
---|
3030 | 3341 | if (source == editItem || source == editButton) |
---|
3031 | 3342 | { |
---|
| 3343 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3344 | + { |
---|
| 3345 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3346 | + child.pinned = true; |
---|
| 3347 | + } |
---|
| 3348 | + |
---|
3032 | 3349 | EditSelection(false); |
---|
3033 | 3350 | } else |
---|
3034 | 3351 | if (source == uneditButton) |
---|
.. | .. |
---|
3038 | 3355 | Object3D child = (Object3D)e.nextElement(); |
---|
3039 | 3356 | if(child.editWindow != null) |
---|
3040 | 3357 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3358 | + child.pinned = false; |
---|
3041 | 3359 | child.CloseUI(); |
---|
3042 | 3360 | listUI.remove(child); |
---|
3043 | 3361 | |
---|
.. | .. |
---|
3054 | 3372 | //copy.ClearUI(); |
---|
3055 | 3373 | for (Object3D obj : listUI) |
---|
3056 | 3374 | { |
---|
| 3375 | + obj.pinned = true; |
---|
3057 | 3376 | obj.CloseUI(); |
---|
3058 | 3377 | } |
---|
3059 | 3378 | listUI.clear(); |
---|
.. | .. |
---|
3063 | 3382 | { |
---|
3064 | 3383 | assert(copy == group); |
---|
3065 | 3384 | |
---|
3066 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3385 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3067 | 3386 | |
---|
3068 | 3387 | for (Object3D obj : listUI) |
---|
3069 | 3388 | { |
---|
.. | .. |
---|
3128 | 3447 | sideView.object = group; |
---|
3129 | 3448 | } |
---|
3130 | 3449 | |
---|
3131 | | -// fix "+" issue group.editWindow = this; |
---|
| 3450 | +// fix "+" issue |
---|
| 3451 | + //group.editWindow = this; |
---|
| 3452 | + group.manipWindow = this; |
---|
3132 | 3453 | |
---|
3133 | 3454 | /* |
---|
3134 | 3455 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3141 | 3462 | //group.parent = null; // ROOT |
---|
3142 | 3463 | //group.attributes = -1; |
---|
3143 | 3464 | ResetModel(); |
---|
| 3465 | + |
---|
| 3466 | + cameraView.requestFocusInWindow(); |
---|
3144 | 3467 | refreshContents(true); |
---|
3145 | 3468 | } else if (event.getSource() == editCameraItem) |
---|
3146 | 3469 | { |
---|
3147 | 3470 | cameraView.ProtectCamera(); |
---|
3148 | 3471 | cameraView.repaint(); |
---|
3149 | 3472 | return; |
---|
3150 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3473 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3151 | 3474 | { |
---|
3152 | 3475 | cameraView.RevertCamera(); |
---|
3153 | 3476 | cameraView.repaint(); |
---|
.. | .. |
---|
3164 | 3487 | } |
---|
3165 | 3488 | |
---|
3166 | 3489 | boolean useclient = false; |
---|
3167 | | - cRadio radio; |
---|
3168 | 3490 | |
---|
3169 | 3491 | void ToggleRoot() |
---|
3170 | 3492 | { |
---|
.. | .. |
---|
3403 | 3725 | |
---|
3404 | 3726 | int size = obj.MemorySize(); |
---|
3405 | 3727 | |
---|
3406 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3728 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3729 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3407 | 3730 | } |
---|
3408 | 3731 | } |
---|
3409 | 3732 | catch (Exception e) |
---|
.. | .. |
---|
3484 | 3807 | void GenNormals(boolean crease) |
---|
3485 | 3808 | { |
---|
3486 | 3809 | group.GenNormalsS(crease); |
---|
| 3810 | + |
---|
| 3811 | + refreshContents(); |
---|
| 3812 | + } |
---|
| 3813 | + |
---|
| 3814 | + void GenNormalsMESH() |
---|
| 3815 | + { |
---|
| 3816 | + group.GenNormalsMeshS(); |
---|
3487 | 3817 | |
---|
3488 | 3818 | refreshContents(); |
---|
3489 | 3819 | } |
---|
.. | .. |
---|
4111 | 4441 | refreshContents(); |
---|
4112 | 4442 | } |
---|
4113 | 4443 | |
---|
| 4444 | + void RewindLeaves(boolean hide) |
---|
| 4445 | + { |
---|
| 4446 | + group.selection.RewindLeaves(hide); |
---|
| 4447 | + refreshContents(); |
---|
| 4448 | + } |
---|
| 4449 | + |
---|
| 4450 | + void RandomLeaves(boolean hide) |
---|
| 4451 | + { |
---|
| 4452 | + group.selection.RandomLeaves(hide); |
---|
| 4453 | + refreshContents(); |
---|
| 4454 | + } |
---|
| 4455 | + |
---|
4114 | 4456 | void SetTexRes(int tr) |
---|
4115 | 4457 | { |
---|
4116 | 4458 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4182 | 4524 | // } |
---|
4183 | 4525 | // } |
---|
4184 | 4526 | |
---|
4185 | | - static boolean allparams = true; |
---|
4186 | | - |
---|
4187 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4188 | | - |
---|
4189 | 4527 | void EditSelection(boolean newWindow) |
---|
4190 | 4528 | { |
---|
4191 | 4529 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4193 | 4531 | { |
---|
4194 | 4532 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4195 | 4533 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4196 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4534 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4197 | 4535 | |
---|
4198 | 4536 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4199 | 4537 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4279 | 4617 | |
---|
4280 | 4618 | freezemodel = true; |
---|
4281 | 4619 | |
---|
| 4620 | + //for (Object3D obj : listUI) |
---|
| 4621 | + for (int i=listUI.size(); --i>=0;) |
---|
| 4622 | + { |
---|
| 4623 | + Object3D obj = listUI.elementAt(i); |
---|
| 4624 | + if (!obj.pinned) |
---|
| 4625 | + { |
---|
| 4626 | + obj.CloseUI(); |
---|
| 4627 | + listUI.remove(i); |
---|
| 4628 | + } |
---|
| 4629 | + } |
---|
| 4630 | + |
---|
4282 | 4631 | /**/ |
---|
4283 | 4632 | //switch (event.id) |
---|
4284 | 4633 | { |
---|
.. | .. |
---|
4286 | 4635 | //case 702: // Event.LIST_DESELECT |
---|
4287 | 4636 | group.deselectAll(); |
---|
4288 | 4637 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4289 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4290 | 4638 | if (tps != null) |
---|
4291 | 4639 | { |
---|
4292 | 4640 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4295 | 4643 | |
---|
4296 | 4644 | //if (child.parent != null) |
---|
4297 | 4645 | //child.parent.addSelectee(child); |
---|
| 4646 | + objEditor.SetMaterial(child); |
---|
4298 | 4647 | group.addSelectee(child); |
---|
4299 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4300 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4301 | | - System.err.println("info : " + child.GetPath()); |
---|
4302 | 4648 | } |
---|
4303 | 4649 | } |
---|
4304 | 4650 | // else |
---|
.. | .. |
---|
4308 | 4654 | // System.err.println("info : " + group.GetPath()); |
---|
4309 | 4655 | // } |
---|
4310 | 4656 | |
---|
4311 | | - objEditor.SetText(); // jan 2014 |
---|
4312 | | - |
---|
4313 | 4657 | if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4314 | 4658 | CameraPane.flash = true; |
---|
4315 | 4659 | |
---|
4316 | 4660 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4317 | 4661 | // a camera |
---|
4318 | 4662 | { |
---|
4319 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4663 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4320 | 4664 | { |
---|
4321 | 4665 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4322 | 4666 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4325 | 4669 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4326 | 4670 | } |
---|
4327 | 4671 | |
---|
| 4672 | + if (tps != null && tps.length == 1) |
---|
| 4673 | + { |
---|
| 4674 | + EditSelection(false); |
---|
| 4675 | + } |
---|
| 4676 | + |
---|
| 4677 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4678 | + |
---|
4328 | 4679 | refreshContents(); |
---|
4329 | 4680 | //return true; |
---|
4330 | 4681 | } |
---|
.. | .. |
---|
4333 | 4684 | |
---|
4334 | 4685 | freezemodel = false; |
---|
4335 | 4686 | } |
---|
| 4687 | + |
---|
| 4688 | + void SetPinStates(boolean enabled) |
---|
| 4689 | + { |
---|
| 4690 | + editButton.setEnabled(enabled); |
---|
| 4691 | + uneditButton.setEnabled(enabled); |
---|
| 4692 | + } |
---|
| 4693 | + |
---|
| 4694 | + void refreshContents(boolean cp) |
---|
| 4695 | + { |
---|
| 4696 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4697 | + if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4698 | + { |
---|
| 4699 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4700 | + |
---|
| 4701 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4702 | + { |
---|
| 4703 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4704 | + |
---|
| 4705 | + objEditor.AddInfo(child, this, true); |
---|
| 4706 | + System.err.println("info : " + child.GetPath()); |
---|
| 4707 | + } |
---|
| 4708 | + |
---|
| 4709 | + objEditor.SetText(); // jan 2014 |
---|
| 4710 | + } |
---|
| 4711 | + |
---|
| 4712 | + super.refreshContents(cp); |
---|
| 4713 | + } |
---|
4336 | 4714 | |
---|
4337 | 4715 | void linkSomething(Object3D thing) |
---|
4338 | 4716 | { |
---|
.. | .. |
---|
4404 | 4782 | { |
---|
4405 | 4783 | if (group.selection.isEmpty()) |
---|
4406 | 4784 | return; |
---|
| 4785 | + |
---|
4407 | 4786 | Grafreed.clipboardIsTempGroup = false; |
---|
4408 | 4787 | Composite tGroup = null; |
---|
4409 | 4788 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4414 | 4793 | |
---|
4415 | 4794 | if (cut) |
---|
4416 | 4795 | { |
---|
| 4796 | + if (Globals.SAVEONMAKE) |
---|
| 4797 | + Save(); |
---|
4417 | 4798 | //int indices[] = jList.getSelectedIndices(); |
---|
4418 | 4799 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4419 | 4800 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4503 | 4884 | } |
---|
4504 | 4885 | |
---|
4505 | 4886 | } |
---|
| 4887 | + |
---|
4506 | 4888 | if (Grafreed.clipboardIsTempGroup) |
---|
4507 | 4889 | Grafreed.clipboard = tGroup; |
---|
| 4890 | + |
---|
4508 | 4891 | if (cut) |
---|
4509 | 4892 | { |
---|
4510 | 4893 | ResetModel(); |
---|
.. | .. |
---|
5129 | 5512 | cButton clearpanelButton; |
---|
5130 | 5513 | cButton unselectButton; |
---|
5131 | 5514 | |
---|
| 5515 | + cButton restoreCameraButton; |
---|
| 5516 | + |
---|
| 5517 | + cButton minButton; |
---|
| 5518 | + cButton maxButton; |
---|
| 5519 | + cButton fullButton; |
---|
| 5520 | + cButton saveButton; |
---|
5132 | 5521 | cButton oneStepButton; |
---|
| 5522 | + |
---|
| 5523 | + cButton groupButton; |
---|
| 5524 | + cButton ungroupButton; |
---|
| 5525 | + cButton compositeButton; |
---|
| 5526 | + cButton switchButton; |
---|
| 5527 | + cButton loopButton; |
---|
| 5528 | + cButton textureButton; |
---|
| 5529 | + |
---|
| 5530 | + cButton gridButton; |
---|
| 5531 | + cButton boxButton; |
---|
| 5532 | + cButton sphereButton; |
---|
| 5533 | + cButton coneButton; |
---|
| 5534 | + cButton torusButton; |
---|
| 5535 | + cButton superButton; |
---|
| 5536 | + cButton kleinButton; |
---|
| 5537 | + cButton particlesButton; |
---|
| 5538 | + cButton overlayButton; |
---|
| 5539 | + cButton lightButton; |
---|
5133 | 5540 | |
---|
5134 | 5541 | cButton screenfitButton; |
---|
5135 | 5542 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5142 | 5549 | |
---|
5143 | 5550 | cButton setsupportButton; |
---|
5144 | 5551 | |
---|
5145 | | - cButton twoButton; |
---|
5146 | | - cButton sixButton; |
---|
5147 | | - cButton threeButton; |
---|
5148 | | - cButton sevenButton; |
---|
5149 | | - cButton fourButton; // full panel |
---|
5150 | | - cButton oneButton; // full XYZ |
---|
5151 | | - //cButton currentLayout; |
---|
5152 | | - |
---|
5153 | 5552 | // |
---|
5154 | 5553 | //Composite |
---|
5155 | 5554 | Object3D // to do !! |
---|
.. | .. |
---|
5159 | 5558 | //JTree jTree; |
---|
5160 | 5559 | private MenuItem lookAtItem; |
---|
5161 | 5560 | private MenuItem lookFromItem; |
---|
5162 | | - private MenuItem switchItem; |
---|
| 5561 | + private MenuItem switchViewItem; |
---|
5163 | 5562 | private MenuItem cutItem; |
---|
5164 | 5563 | private MenuItem undoItem; |
---|
5165 | 5564 | private MenuItem redoItem; |
---|
5166 | | - private MenuItem duplicateItem; |
---|
| 5565 | + private JMenuItem duplicateItem; |
---|
5167 | 5566 | private MenuItem cloneItem; |
---|
5168 | 5567 | private MenuItem cloneSupportItem; |
---|
5169 | 5568 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5226 | 5625 | private MenuItem showleavesItem; |
---|
5227 | 5626 | private MenuItem markleavesItem; |
---|
5228 | 5627 | private MenuItem unmarkleavesItem; |
---|
| 5628 | + private MenuItem rewindleavesItem; |
---|
| 5629 | + private MenuItem unrewindleavesItem; |
---|
| 5630 | + private MenuItem randomleavesItem; |
---|
| 5631 | + private MenuItem unrandomleavesItem; |
---|
5229 | 5632 | |
---|
5230 | 5633 | private MenuItem flipVItem; |
---|
5231 | 5634 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5247 | 5650 | private MenuItem frontItem; |
---|
5248 | 5651 | private MenuItem cameraItem; |
---|
5249 | 5652 | private MenuItem compositeItem; |
---|
5250 | | - private MenuItem randomItem; |
---|
| 5653 | + private MenuItem switchItem; |
---|
5251 | 5654 | private MenuItem physicsItem; |
---|
5252 | 5655 | private MenuItem frameselectorItem; |
---|
5253 | 5656 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5321 | 5724 | |
---|
5322 | 5725 | Menu cameraMenu; |
---|
5323 | 5726 | MenuItem editCameraItem; |
---|
5324 | | - MenuItem revertCameraItem; |
---|
| 5727 | + MenuItem restoreCameraItem; |
---|
5325 | 5728 | } |
---|