.. | .. |
---|
84 | 84 | |
---|
85 | 85 | void CloneSelection(boolean supports) |
---|
86 | 86 | { |
---|
| 87 | + if (Globals.SAVEONMAKE) |
---|
| 88 | + Save(); |
---|
| 89 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 90 | + Globals.SAVEONMAKE = false; |
---|
87 | 91 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 92 | //Object3D obj; |
---|
89 | 93 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 98 | |
---|
95 | 99 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 100 | } |
---|
| 101 | + Globals.SAVEONMAKE = keep; |
---|
97 | 102 | } |
---|
98 | 103 | |
---|
99 | 104 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 155 | |
---|
151 | 156 | void SetupMenu2(GroupEditor oe) |
---|
152 | 157 | { |
---|
| 158 | + oe.jTree = new cTree(); |
---|
| 159 | + |
---|
153 | 160 | Menu menu; |
---|
154 | 161 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 162 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 163 | //editItem.addActionListener(this); |
---|
157 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 164 | + |
---|
| 165 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 166 | +// undoItem.addActionListener(this); |
---|
| 167 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 168 | +// redoItem.addActionListener(this); |
---|
| 169 | +// menu.add("-"); |
---|
| 170 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
158 | 171 | duplicateItem.addActionListener(this); |
---|
159 | 172 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
160 | 173 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
170 | 183 | copyItem.addActionListener(this); |
---|
171 | 184 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
172 | 185 | pasteItem.addActionListener(this); |
---|
173 | | - menu.add("-"); |
---|
174 | 186 | |
---|
175 | 187 | menu.add("-"); |
---|
176 | 188 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
197 | 209 | //zBufferItem.addActionListener(this); |
---|
198 | 210 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
199 | 211 | //normalLensItem.addActionListener(this); |
---|
200 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
201 | | - revertCameraItem.addActionListener(this); |
---|
| 212 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 213 | + restoreCameraItem.addActionListener(this); |
---|
202 | 214 | |
---|
203 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
204 | | - toggleFullScreenItem.addItemListener(this); |
---|
205 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
206 | | - cameraMenu.add("-"); |
---|
| 215 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 216 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 217 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 218 | +// cameraMenu.add("-"); |
---|
| 219 | +// |
---|
| 220 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 221 | +// toggleTextureItem.addItemListener(this); |
---|
| 222 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 223 | +// |
---|
| 224 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 225 | +// toggleSwitchItem.addItemListener(this); |
---|
| 226 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
207 | 227 | |
---|
208 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
209 | | - toggleTextureItem.addItemListener(this); |
---|
210 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
211 | | - |
---|
212 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
213 | | - toggleSwitchItem.addItemListener(this); |
---|
214 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
215 | | - |
---|
216 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 228 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
217 | 229 | toggleHandleItem.addItemListener(this); |
---|
218 | 230 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
219 | 231 | |
---|
.. | .. |
---|
240 | 252 | |
---|
241 | 253 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
242 | 254 | toggleDebugItem.addItemListener(this); |
---|
243 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 255 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
244 | 256 | |
---|
245 | 257 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
246 | 258 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
261 | 273 | // animationItem.addItemListener(this); |
---|
262 | 274 | // animationItem.setState(CameraPane.ANIMATION); |
---|
263 | 275 | cameraMenu.add("-"); |
---|
264 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
| 276 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
265 | 277 | editCameraItem.addActionListener(this); |
---|
266 | 278 | |
---|
267 | 279 | if (Globals.ADVANCED) |
---|
268 | 280 | { |
---|
269 | 281 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
270 | 282 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
271 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 283 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
272 | 284 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
273 | 285 | oe.cameraMenu.add("-"); |
---|
274 | 286 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
276 | 288 | editLeafItem.addActionListener(this); |
---|
277 | 289 | lookAtItem.addActionListener(this); |
---|
278 | 290 | //lookFromItem.addActinoListener(this); |
---|
279 | | - //switchItem.addActionListener(this); |
---|
| 291 | + //switchViewItem.addActionListener(this); |
---|
280 | 292 | } |
---|
281 | 293 | |
---|
282 | 294 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
321 | 333 | } |
---|
322 | 334 | |
---|
323 | 335 | oe.menuBar.add(menu = new Menu("Group")); |
---|
324 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
325 | | - grabItem.addActionListener(this); |
---|
| 336 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 337 | +// grabItem.addActionListener(this); |
---|
326 | 338 | backItem = menu.add(new MenuItem("Back")); |
---|
327 | 339 | backItem.addActionListener(this); |
---|
328 | 340 | frontItem = menu.add(new MenuItem("Front")); |
---|
329 | 341 | frontItem.addActionListener(this); |
---|
330 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
331 | | - compositeItem.addActionListener(this); |
---|
| 342 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 343 | +// compositeItem.addActionListener(this); |
---|
| 344 | + |
---|
| 345 | + if (Globals.ADVANCED) |
---|
| 346 | + { |
---|
332 | 347 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
333 | 348 | hideItem.addActionListener(this); |
---|
| 349 | + } |
---|
334 | 350 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
335 | 351 | ungroupItem.addActionListener(this); |
---|
336 | | - menu.add("-"); |
---|
337 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
338 | | - randomItem.addActionListener(this); |
---|
| 352 | + |
---|
| 353 | +// menu.add("-"); |
---|
| 354 | +// |
---|
| 355 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 356 | +// switchItem.addActionListener(this); |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
339 | 359 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
340 | 360 | switchGeoItem.addActionListener(this); |
---|
341 | 361 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
343 | 363 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
344 | 364 | morphItem.addActionListener(this); |
---|
345 | 365 | |
---|
346 | | - if (Globals.ADVANCED) |
---|
347 | | - { |
---|
348 | 366 | menu.add("-"); |
---|
349 | 367 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
350 | 368 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
352 | 370 | frameselectorItem.addActionListener(this); |
---|
353 | 371 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
354 | 372 | scriptNodeItem.addActionListener(this); |
---|
355 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
356 | | - cameraItem.addActionListener(this); |
---|
357 | 373 | } |
---|
358 | 374 | |
---|
359 | 375 | oe.menuBar.add(menu = new Menu("Object")); |
---|
360 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
361 | | - textureItem.addActionListener(this); |
---|
| 376 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 377 | +// textureItem.addActionListener(this); |
---|
362 | 378 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
363 | 379 | billboardItem.addActionListener(this); |
---|
364 | 380 | csgItem = menu.add(new MenuItem("CSG")); |
---|
365 | 381 | csgItem.addActionListener(this); |
---|
366 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 382 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
367 | 383 | shadowXItem.addActionListener(this); |
---|
368 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 384 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
369 | 385 | shadowYItem.addActionListener(this); |
---|
370 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 386 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
371 | 387 | shadowZItem.addActionListener(this); |
---|
| 388 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 389 | + attributeItem.addActionListener(this); |
---|
| 390 | + |
---|
372 | 391 | if (Globals.ADVANCED) |
---|
373 | 392 | { |
---|
374 | 393 | menu.add("-"); |
---|
375 | 394 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
376 | 395 | linkerItem.addActionListener(this); |
---|
377 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
378 | | - attributeItem.addActionListener(this); |
---|
379 | 396 | templateItem = menu.add(new MenuItem("Template")); |
---|
380 | 397 | templateItem.addActionListener(this); |
---|
381 | 398 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
464 | 481 | markleavesItem.addActionListener(this); |
---|
465 | 482 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
466 | 483 | unmarkleavesItem.addActionListener(this); |
---|
| 484 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 485 | + rewindleavesItem.addActionListener(this); |
---|
| 486 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 487 | + unrewindleavesItem.addActionListener(this); |
---|
| 488 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 489 | + randomleavesItem.addActionListener(this); |
---|
| 490 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 491 | + unrandomleavesItem.addActionListener(this); |
---|
467 | 492 | menu.add("-"); |
---|
468 | 493 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
469 | 494 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
521 | 546 | |
---|
522 | 547 | void SetupUI2(ObjEditor oe) |
---|
523 | 548 | { |
---|
| 549 | + // June 2019 |
---|
| 550 | + if (oe == null) |
---|
| 551 | + { |
---|
| 552 | + //super.SetupUI2(this); |
---|
| 553 | + //return; |
---|
| 554 | + } |
---|
| 555 | + |
---|
| 556 | + if (copy != group) |
---|
| 557 | + { |
---|
| 558 | + //super.SetupUI2(this); |
---|
| 559 | + } |
---|
| 560 | + |
---|
524 | 561 | //new Exception().printStackTrace(); |
---|
525 | 562 | |
---|
526 | 563 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
549 | 586 | oe.radioPanel.add(dummyButton); |
---|
550 | 587 | oe.buttonGroup.add(dummyButton); |
---|
551 | 588 | */ |
---|
| 589 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 590 | + |
---|
| 591 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 592 | + |
---|
552 | 593 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
553 | 594 | |
---|
554 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 595 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + //minButton.setToolTipText("Minimize window"); |
---|
| 597 | + //minButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + if (Globals.ADVANCED) |
---|
| 600 | + { |
---|
| 601 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 602 | + maxButton.setToolTipText("Maximize window"); |
---|
| 603 | + maxButton.addActionListener(this); |
---|
| 604 | + } |
---|
| 605 | + |
---|
| 606 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 607 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 608 | + fullButton.addActionListener(this); |
---|
| 609 | + |
---|
| 610 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 612 | + screenfitButton.addActionListener(this); |
---|
| 613 | + |
---|
| 614 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 616 | + restoreCameraButton.addActionListener(this); |
---|
| 617 | + |
---|
| 618 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + undoButton.setToolTipText("Undo changes"); |
---|
| 620 | + undoButton.addActionListener(this); |
---|
| 621 | + undoButton.setEnabled(false); |
---|
| 622 | + |
---|
| 623 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + redoButton.setToolTipText("Redo changes"); |
---|
| 625 | + redoButton.addActionListener(this); |
---|
| 626 | + redoButton.setEnabled(false); |
---|
| 627 | + |
---|
| 628 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + saveButton.setToolTipText("Save changes"); |
---|
| 630 | + saveButton.addActionListener(this); |
---|
| 631 | + |
---|
| 632 | + copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
555 | 633 | liveCB.setToolTipText("Enable animation"); |
---|
556 | 634 | liveCB.addItemListener(this); |
---|
557 | 635 | |
---|
558 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
559 | 637 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
560 | 638 | oneStepButton.addActionListener(this); |
---|
561 | 639 | |
---|
562 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 640 | + copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
563 | 641 | fastCB.setToolTipText("Fast mode"); |
---|
564 | 642 | fastCB.addItemListener(this); |
---|
565 | 643 | |
---|
566 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
567 | | - trackCB.setToolTipText("Enable tracking"); |
---|
568 | | - trackCB.addItemListener(this); |
---|
569 | | - |
---|
570 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
571 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
572 | | - screenfitButton.addActionListener(this); |
---|
| 644 | + //oe.toolboxPanel.Return(); |
---|
| 645 | + |
---|
| 646 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 647 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 648 | +// trackCB.addItemListener(this); |
---|
573 | 649 | |
---|
574 | 650 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
575 | 651 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
581 | 657 | snapobjectButton.setToolTipText("Snap Object"); |
---|
582 | 658 | } |
---|
583 | 659 | |
---|
584 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
585 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
586 | | - flashSelectionButton.addActionListener(this); |
---|
| 660 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
587 | 661 | |
---|
588 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
589 | | - |
---|
590 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
591 | 663 | twoButton.setToolTipText("Show center view only"); |
---|
592 | 664 | twoButton.addActionListener(this); |
---|
593 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 665 | + this.fullscreenLayout = twoButton; |
---|
| 666 | + |
---|
| 667 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | 668 | fourButton.addActionListener(this); |
---|
595 | 669 | fourButton.setToolTipText("Show left panel only"); |
---|
596 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
597 | 671 | sixButton.setToolTipText("2-column layout left"); |
---|
598 | 672 | sixButton.addActionListener(this); |
---|
599 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 673 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | 674 | threeButton.setToolTipText("2-column layout right"); |
---|
601 | 675 | threeButton.addActionListener(this); |
---|
602 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 676 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
603 | 677 | sevenButton.setToolTipText("3-column layout"); |
---|
604 | 678 | sevenButton.addActionListener(this); |
---|
605 | 679 | // |
---|
606 | 680 | |
---|
607 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 681 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | 682 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
609 | 683 | rootButton.addActionListener(this); |
---|
610 | 684 | |
---|
611 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 685 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
612 | 686 | closeButton.setToolTipText("Close tab"); |
---|
613 | 687 | closeButton.addActionListener(this); |
---|
614 | 688 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
615 | 689 | //clearButton.addActionListener(this); |
---|
616 | | - |
---|
617 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 690 | + |
---|
| 691 | + // INSERT |
---|
| 692 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + gridButton.setToolTipText("Create grid"); |
---|
| 694 | + gridButton.addActionListener(this); |
---|
| 695 | + |
---|
| 696 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 697 | + boxButton.setToolTipText("Create box"); |
---|
| 698 | + boxButton.addActionListener(this); |
---|
| 699 | + |
---|
| 700 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 701 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 702 | + sphereButton.addActionListener(this); |
---|
| 703 | + |
---|
| 704 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 705 | + coneButton.setToolTipText("Create cone"); |
---|
| 706 | + coneButton.addActionListener(this); |
---|
| 707 | + |
---|
| 708 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 709 | + torusButton.setToolTipText("Create torus"); |
---|
| 710 | + torusButton.addActionListener(this); |
---|
| 711 | + |
---|
| 712 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 714 | + superButton.addActionListener(this); |
---|
| 715 | + |
---|
| 716 | + if (Globals.ADVANCED) |
---|
| 717 | + { |
---|
| 718 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 720 | + kleinButton.addActionListener(this); |
---|
| 721 | + } |
---|
618 | 722 | |
---|
619 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
620 | | - editButton.setToolTipText("Edit selection"); |
---|
| 723 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 724 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 725 | + particlesButton.addActionListener(this); |
---|
| 726 | + |
---|
| 727 | + oe.toolboxPanel.Return(); |
---|
| 728 | + |
---|
| 729 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 730 | + groupButton.setToolTipText("Create group"); |
---|
| 731 | + groupButton.addActionListener(this); |
---|
| 732 | + |
---|
| 733 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 734 | + compositeButton.setToolTipText("Create composite"); |
---|
| 735 | + compositeButton.addActionListener(this); |
---|
| 736 | + |
---|
| 737 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 739 | + switchButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 742 | + loopButton.setToolTipText("Create loop"); |
---|
| 743 | + loopButton.addActionListener(this); |
---|
| 744 | + |
---|
| 745 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 746 | + textureButton.setToolTipText("Create texture"); |
---|
| 747 | + textureButton.addActionListener(this); |
---|
| 748 | + |
---|
| 749 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 750 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 751 | + overlayButton.addActionListener(this); |
---|
| 752 | + |
---|
| 753 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 754 | + lightButton.setToolTipText("Create light"); |
---|
| 755 | + lightButton.addActionListener(this); |
---|
| 756 | + |
---|
| 757 | + for (int i=6; --i>=0;) |
---|
| 758 | + { |
---|
| 759 | + oe.toolboxPanel.Return(); |
---|
| 760 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 761 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 762 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 763 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 764 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 765 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 766 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 767 | + } |
---|
| 768 | + |
---|
| 769 | + // EDIT panel |
---|
| 770 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 771 | + editButton.setToolTipText("Pin selection controls"); |
---|
621 | 772 | editButton.addActionListener(this); |
---|
622 | 773 | |
---|
623 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 774 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 775 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
625 | 776 | uneditButton.addActionListener(this); |
---|
626 | 777 | |
---|
627 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
628 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 778 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 779 | + allParamsButton.setToolTipText("Show all controle"); |
---|
629 | 780 | allParamsButton.addActionListener(this); |
---|
630 | 781 | |
---|
631 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 782 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
632 | 783 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
633 | 784 | clearPanelButton.addActionListener(this); |
---|
634 | 785 | |
---|
635 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 786 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
636 | 787 | unselectButton.setToolTipText("Unselect"); |
---|
637 | 788 | unselectButton.addActionListener(this); |
---|
638 | 789 | |
---|
639 | | - commandsPanel.preferredHeight = 1; |
---|
| 790 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 791 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 792 | + flashSelectionButton.addActionListener(this); |
---|
640 | 793 | |
---|
641 | | - oe.treePanel.add(commandsPanel); |
---|
642 | | - oe.treePanel.Return(); |
---|
| 794 | + editCommandsPanel.preferredHeight = 1; |
---|
| 795 | + |
---|
| 796 | + SetPinStates(false); |
---|
| 797 | +// oe.treePanel.add(commandsPanel); |
---|
| 798 | +// oe.treePanel.Return(); |
---|
643 | 799 | |
---|
644 | 800 | // oe.aConstraints.gridx += 1; |
---|
645 | 801 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
656 | 812 | |
---|
657 | 813 | JScrollPane jSP; |
---|
658 | 814 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
659 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 815 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
660 | 816 | ResetModel(); |
---|
661 | 817 | |
---|
662 | 818 | oe.treePanel.add(jSPPanel); |
---|
663 | 819 | oe.treePanel.Return(); |
---|
664 | 820 | |
---|
665 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
666 | | - |
---|
667 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
668 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
669 | | - colorCB.addItemListener(this); |
---|
670 | | - |
---|
671 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
672 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
673 | | - materialCB.addItemListener(this); |
---|
674 | | - |
---|
675 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
676 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
677 | | - textureCB.addItemListener(this); |
---|
678 | | - |
---|
679 | | - copyOptionsPanel.preferredHeight = 1; |
---|
680 | 821 | oe.treePanel.add(copyOptionsPanel); |
---|
681 | 822 | oe.treePanel.Return(); |
---|
682 | 823 | |
---|
.. | .. |
---|
707 | 848 | |
---|
708 | 849 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
709 | 850 | { |
---|
| 851 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 852 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 853 | + colorCB.addItemListener(this); |
---|
| 854 | + |
---|
| 855 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 856 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 857 | + materialCB.addItemListener(this); |
---|
| 858 | + |
---|
| 859 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 860 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 861 | + textureCB.addItemListener(this); |
---|
| 862 | + |
---|
| 863 | + panel.Return(); |
---|
| 864 | + |
---|
710 | 865 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
711 | 866 | boxCB.setToolTipText("Display bounding boxes"); |
---|
712 | 867 | boxCB.addItemListener(this); |
---|
713 | 868 | |
---|
714 | 869 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
715 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 870 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
716 | 871 | zoomBoxCB.addItemListener(this); |
---|
717 | 872 | |
---|
718 | 873 | if (true) // Globals.ADVANCED) |
---|
719 | 874 | { |
---|
720 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
721 | | - supportCB.setToolTipText("Enable rigging"); |
---|
722 | | - supportCB.addItemListener(this); |
---|
| 875 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 876 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 877 | +// supportCB.addItemListener(this); |
---|
| 878 | + |
---|
| 879 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 880 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 881 | + freezeCB.addItemListener(this); |
---|
723 | 882 | |
---|
724 | 883 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
725 | 884 | // localCB.addItemListener(this); |
---|
726 | 885 | |
---|
| 886 | + panel.Return(); |
---|
| 887 | + |
---|
727 | 888 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
728 | 889 | crowdCB.setToolTipText("Used for crowds"); |
---|
729 | 890 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
740 | 901 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
741 | 902 | // speakerMocapCB.addItemListener(this); |
---|
742 | 903 | |
---|
| 904 | + panel.Return(); |
---|
| 905 | + |
---|
743 | 906 | if (false) |
---|
744 | 907 | { |
---|
745 | 908 | // handled in scripts |
---|
.. | .. |
---|
754 | 917 | //constraints.gridy += 1; |
---|
755 | 918 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
756 | 919 | smoothfocusCB.addItemListener(this); |
---|
| 920 | + panel.Return(); |
---|
757 | 921 | } |
---|
758 | 922 | |
---|
759 | 923 | //constraints.gridx += 1; |
---|
760 | 924 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
761 | 925 | // debugCB.addItemListener(this); |
---|
762 | 926 | |
---|
| 927 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 928 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 929 | + trackCB.addItemListener(this); |
---|
| 930 | + |
---|
763 | 931 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 932 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
764 | 933 | oeilCB.addItemListener(this); |
---|
765 | 934 | |
---|
| 935 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 936 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 937 | + shadowCB.addItemListener(this); |
---|
| 938 | + |
---|
| 939 | + panel.Return(); |
---|
| 940 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 941 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 942 | + toggleTextureCB.addItemListener(this); |
---|
| 943 | + |
---|
| 944 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 945 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 946 | + toggleSwitchCB.addItemListener(this); |
---|
| 947 | + |
---|
| 948 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 949 | + autosaveCB.setToolTipText("On structure change"); |
---|
| 950 | + autosaveCB.addItemListener(this); |
---|
| 951 | + |
---|
| 952 | + panel.Return(); |
---|
| 953 | + if (Globals.ADVANCED) |
---|
| 954 | + { |
---|
766 | 955 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
767 | 956 | lookAtCB.setToolTipText("Look-at target"); |
---|
768 | 957 | lookAtCB.addItemListener(this); |
---|
| 958 | + } |
---|
769 | 959 | |
---|
770 | 960 | } |
---|
771 | 961 | |
---|
772 | 962 | cGridBag fill = new cGridBag(); |
---|
773 | | - |
---|
774 | 963 | fill.preferredHeight = 200; |
---|
| 964 | + cGridBag fill2 = new cGridBag(); |
---|
| 965 | + fill2.preferredHeight = 200; |
---|
| 966 | + cGridBag fill3 = new cGridBag(); |
---|
| 967 | + fill3.preferredHeight = 200; |
---|
775 | 968 | |
---|
776 | 969 | panel.add(fill); |
---|
| 970 | + panel.add(fill2); |
---|
| 971 | + panel.add(fill3); |
---|
777 | 972 | |
---|
778 | 973 | } |
---|
779 | 974 | |
---|
780 | 975 | void EditObject(Object3D obj) |
---|
781 | 976 | { |
---|
782 | 977 | cRadio radioButton = new cRadio(obj.name); |
---|
| 978 | + |
---|
| 979 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 980 | + radioButton.hadMaterial = obj.material != null; |
---|
| 981 | + if (!radioButton.hadMaterial) |
---|
| 982 | + { |
---|
| 983 | + obj.material = new cMaterial(); |
---|
| 984 | + } |
---|
| 985 | + |
---|
783 | 986 | radioButton.SetObject(obj); |
---|
784 | 987 | radioButton.layout = sevenButton; |
---|
785 | 988 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
791 | 994 | |
---|
792 | 995 | void SetupViews(ObjEditor oe) |
---|
793 | 996 | { |
---|
| 997 | + theFrame = this; |
---|
| 998 | + |
---|
794 | 999 | oe.SetupViews(); |
---|
795 | 1000 | |
---|
796 | 1001 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
799 | 1004 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
800 | 1005 | } |
---|
801 | 1006 | |
---|
802 | | - JCheckBox liveCB; |
---|
803 | | - JCheckBox supportCB; |
---|
804 | | - JCheckBox localCB; |
---|
805 | | - JCheckBox crowdCB; |
---|
806 | | - JCheckBox smoothCB; |
---|
807 | | - JCheckBox fastCB; |
---|
808 | | - JCheckBox slowCB; |
---|
809 | | - JCheckBox boxCB; |
---|
810 | | - JCheckBox zoomBoxCB; |
---|
811 | | - JCheckBox trackCB; |
---|
812 | | - JCheckBox smoothfocusCB; |
---|
| 1007 | + cToggleButton liveCB; |
---|
| 1008 | + cCheckBox supportCB; |
---|
| 1009 | + cCheckBox localCB; |
---|
| 1010 | + cCheckBox crowdCB; |
---|
| 1011 | + cCheckBox smoothCB; |
---|
| 1012 | + cToggleButton fastCB; |
---|
| 1013 | + cCheckBox slowCB; |
---|
| 1014 | + cCheckBox boxCB; |
---|
| 1015 | + cCheckBox zoomBoxCB; |
---|
| 1016 | + cCheckBox freezeCB; |
---|
| 1017 | + //cToggleButton trackCB; |
---|
| 1018 | + cCheckBox trackCB; |
---|
| 1019 | + cCheckBox smoothfocusCB; |
---|
813 | 1020 | // JCheckBox speakerMocapCB; |
---|
814 | | - JCheckBox speakerCameraCB; |
---|
815 | | - JCheckBox speakerFocusCB; |
---|
816 | | - JCheckBox debugCB; |
---|
817 | | - JCheckBox oeilCB; |
---|
818 | | - JCheckBox lookAtCB; |
---|
| 1021 | + cCheckBox speakerCameraCB; |
---|
| 1022 | + cCheckBox speakerFocusCB; |
---|
| 1023 | + cCheckBox debugCB; |
---|
| 1024 | + |
---|
| 1025 | + cCheckBox oeilCB; |
---|
| 1026 | + cCheckBox shadowCB; |
---|
| 1027 | + cCheckBox autosaveCB; |
---|
| 1028 | + cCheckBox lookAtCB; |
---|
819 | 1029 | |
---|
820 | 1030 | // static int COLOR = 1; |
---|
821 | 1031 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
823 | 1033 | |
---|
824 | 1034 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
825 | 1035 | |
---|
826 | | - JCheckBox colorCB; |
---|
827 | | - JCheckBox materialCB; |
---|
828 | | - JCheckBox textureCB; |
---|
| 1036 | + cCheckBox colorCB; |
---|
| 1037 | + cCheckBox materialCB; |
---|
| 1038 | + cCheckBox textureCB; |
---|
829 | 1039 | |
---|
830 | 1040 | public void itemStateChanged(ItemEvent e) |
---|
831 | 1041 | { |
---|
.. | .. |
---|
853 | 1063 | } else if(e.getSource() == liveCB) |
---|
854 | 1064 | { |
---|
855 | 1065 | cameraView.ToggleLive(); |
---|
| 1066 | + refreshContents(false); |
---|
856 | 1067 | } |
---|
857 | 1068 | else if(e.getSource() == supportCB) |
---|
858 | 1069 | { |
---|
.. | .. |
---|
917 | 1128 | { |
---|
918 | 1129 | cameraView.ToggleOeil(); |
---|
919 | 1130 | } |
---|
| 1131 | + else if(e.getSource() == shadowCB) |
---|
| 1132 | + { |
---|
| 1133 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1134 | + } |
---|
| 1135 | + else if(e.getSource() == freezeCB) |
---|
| 1136 | + { |
---|
| 1137 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1138 | + } |
---|
| 1139 | + else if(e.getSource() == autosaveCB) |
---|
| 1140 | + { |
---|
| 1141 | + Globals.SAVEONMAKE ^= true; |
---|
| 1142 | + } |
---|
920 | 1143 | else if(e.getSource() == lookAtCB) |
---|
921 | 1144 | { |
---|
922 | 1145 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
933 | 1156 | |
---|
934 | 1157 | /**/ |
---|
935 | 1158 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
936 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1159 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1160 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
937 | 1161 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
938 | 1162 | // We can't move the root node or an empty selection |
---|
939 | 1163 | return; |
---|
.. | .. |
---|
996 | 1220 | } |
---|
997 | 1221 | } |
---|
998 | 1222 | |
---|
999 | | - String string = (String) object; |
---|
1000 | | - |
---|
1001 | 1223 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1002 | 1224 | // if( object instanceof java.io.File[]) |
---|
1003 | 1225 | // { |
---|
.. | .. |
---|
1005 | 1227 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1006 | 1228 | // return; |
---|
1007 | 1229 | // } |
---|
| 1230 | + |
---|
| 1231 | + String string = object.toString(); |
---|
1008 | 1232 | |
---|
1009 | 1233 | // File path for Mac and Windows |
---|
1010 | 1234 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1050 | 1274 | |
---|
1051 | 1275 | assert target == objEditor.jTree; |
---|
1052 | 1276 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1277 | + Object3D destinationLeaf; |
---|
1053 | 1278 | try { |
---|
1054 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1279 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1055 | 1280 | } catch (Exception e) { |
---|
1056 | 1281 | System.out.println("destinationPath : " + destinationPath); |
---|
1057 | 1282 | return; |
---|
1058 | 1283 | } |
---|
1059 | 1284 | |
---|
1060 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1285 | + for (int i=group.selection.size(); --i>=0;) |
---|
1061 | 1286 | { |
---|
| 1287 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1288 | + |
---|
| 1289 | + // Cannot move into itself |
---|
| 1290 | + if (child == destinationLeaf) |
---|
| 1291 | + return; |
---|
| 1292 | + } |
---|
| 1293 | + |
---|
| 1294 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1295 | +// { |
---|
1062 | 1296 | loadClipboard(true); |
---|
1063 | 1297 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1064 | 1298 | pasteInto(false, false); |
---|
1065 | | - } else { |
---|
1066 | | - loadClipboard(false); |
---|
1067 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1068 | | - pasteInto(false, false); // true); // ??? |
---|
1069 | | - } |
---|
| 1299 | +// } else { |
---|
| 1300 | +// loadClipboard(false); |
---|
| 1301 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1302 | +// pasteInto(false, false); // true); // ??? |
---|
| 1303 | +// } |
---|
1070 | 1304 | } |
---|
1071 | 1305 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1072 | 1306 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1171 | 1405 | { |
---|
1172 | 1406 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1173 | 1407 | //heightFieldItem.addActionListener(this); |
---|
1174 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1175 | | - gridItem.addActionListener(this); |
---|
1176 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1177 | | - rectoidItem.addActionListener(this); |
---|
1178 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1179 | | - ellipsoidItem.addActionListener(this); |
---|
1180 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1181 | | - coneItem.addActionListener(this); |
---|
1182 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1183 | | - torusItem.addActionListener(this); |
---|
1184 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1185 | | - superItem.addActionListener(this); |
---|
| 1408 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1409 | +// gridItem.addActionListener(this); |
---|
| 1410 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1411 | +// rectoidItem.addActionListener(this); |
---|
| 1412 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1413 | +// ellipsoidItem.addActionListener(this); |
---|
| 1414 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1415 | +// coneItem.addActionListener(this); |
---|
| 1416 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1417 | +// torusItem.addActionListener(this); |
---|
| 1418 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1419 | +// superItem.addActionListener(this); |
---|
| 1420 | + |
---|
| 1421 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1422 | + cameraItem.addActionListener(this); |
---|
| 1423 | + |
---|
| 1424 | + if (!Globals.ADVANCED) |
---|
| 1425 | + { |
---|
1186 | 1426 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1187 | 1427 | kleinItem.addActionListener(this); |
---|
1188 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1189 | | - particleItem.addActionListener(this); |
---|
| 1428 | + } |
---|
| 1429 | + |
---|
| 1430 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1431 | +// particleItem.addActionListener(this); |
---|
1190 | 1432 | if (Globals.ADVANCED) |
---|
1191 | 1433 | { |
---|
1192 | 1434 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1212 | 1454 | } |
---|
1213 | 1455 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1214 | 1456 | bezierItem.addActionListener(this); |
---|
1215 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1216 | | - overlayItem.addActionListener(this); |
---|
1217 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1218 | | - lightItem.addActionListener(this); |
---|
| 1457 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1458 | +// overlayItem.addActionListener(this); |
---|
| 1459 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1460 | +// lightItem.addActionListener(this); |
---|
1219 | 1461 | menu.add("-"); |
---|
1220 | 1462 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1221 | 1463 | //superLoopItem.addActionListener(this); |
---|
1222 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1223 | | - loopItem.addActionListener(this); |
---|
| 1464 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1465 | +// loopItem.addActionListener(this); |
---|
1224 | 1466 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1225 | 1467 | doubleItem.addActionListener(this); |
---|
1226 | 1468 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1236 | 1478 | animationItem.addItemListener(this); |
---|
1237 | 1479 | animationItem.setState(Globals.ANIMATION); |
---|
1238 | 1480 | |
---|
| 1481 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1482 | + archiveItem.addActionListener(this); |
---|
| 1483 | + |
---|
1239 | 1484 | menu.add("-"); |
---|
1240 | 1485 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1241 | 1486 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1248 | 1493 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1249 | 1494 | reduce34MorphItem.addActionListener(this); |
---|
1250 | 1495 | menu.add("-"); |
---|
| 1496 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1497 | + memoryItem.addActionListener(this); |
---|
1251 | 1498 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1252 | 1499 | computeAOItem.addActionListener(this); |
---|
1253 | 1500 | |
---|
.. | .. |
---|
1256 | 1503 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1257 | 1504 | mirrorItem.addActionListener(this); |
---|
1258 | 1505 | menu.add("-"); |
---|
1259 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1260 | | - memoryItem.addActionListener(this); |
---|
1261 | 1506 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1262 | 1507 | analyzeItem.addActionListener(this); |
---|
1263 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1508 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1264 | 1509 | dumpItem.addActionListener(this); |
---|
1265 | 1510 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1266 | 1511 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1401 | 1646 | shadow.material = new cMaterial(obj.material); |
---|
1402 | 1647 | shadow.material.diffuse = 0.0001f; |
---|
1403 | 1648 | shadow.material.specular = 0.0001f; |
---|
| 1649 | + //shadow.projectedVertices[1].x = 300; |
---|
1404 | 1650 | |
---|
1405 | 1651 | makeSomething(shadow); |
---|
1406 | 1652 | } |
---|
| 1653 | + |
---|
| 1654 | + private void ClearUnpinned() |
---|
| 1655 | + { |
---|
| 1656 | + //for (Object3D obj : listUI) |
---|
| 1657 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1658 | + { |
---|
| 1659 | + Object3D obj = listUI.elementAt(i); |
---|
| 1660 | + if (!obj.pinned) |
---|
| 1661 | + { |
---|
| 1662 | + obj.CloseUI(); |
---|
| 1663 | + listUI.remove(i); |
---|
| 1664 | + } |
---|
| 1665 | + } |
---|
| 1666 | + } |
---|
1407 | 1667 | |
---|
1408 | 1668 | /** |
---|
1409 | 1669 | * applyExample |
---|
.. | .. |
---|
1648 | 1908 | { |
---|
1649 | 1909 | ScreenFit(); |
---|
1650 | 1910 | } else |
---|
1651 | | - if (source == switchItem) |
---|
| 1911 | + if (source == switchViewItem) |
---|
1652 | 1912 | { |
---|
1653 | 1913 | cVector v1 = new cVector(); |
---|
1654 | 1914 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1657 | 1917 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1658 | 1918 | objEditor.cameraView.repaint(); |
---|
1659 | 1919 | } else |
---|
1660 | | - if (source == rectoidItem) |
---|
| 1920 | + if (source == rectoidItem || source == boxButton) |
---|
1661 | 1921 | { |
---|
1662 | 1922 | makeSomething(new Box()); |
---|
1663 | 1923 | } else |
---|
1664 | | - if (source == particleItem) |
---|
| 1924 | + if (source == particleItem || source == particlesButton) |
---|
1665 | 1925 | { |
---|
1666 | 1926 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1667 | 1927 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1740 | 2000 | |
---|
1741 | 2001 | makeSomething(obj); |
---|
1742 | 2002 | } else |
---|
1743 | | - if (source == gridItem) |
---|
| 2003 | + if (source == gridItem || source == gridButton) |
---|
1744 | 2004 | { |
---|
1745 | 2005 | makeSomething(new Grid()); |
---|
1746 | 2006 | } else |
---|
1747 | | - if (source == ellipsoidItem) |
---|
| 2007 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1748 | 2008 | { |
---|
1749 | 2009 | makeSomething(new Sphere()); |
---|
1750 | 2010 | } else |
---|
1751 | | - if (source == coneItem) |
---|
| 2011 | + if (source == coneItem || source == coneButton) |
---|
1752 | 2012 | { |
---|
1753 | 2013 | makeSomething(new Cone()); |
---|
1754 | 2014 | } else |
---|
1755 | | - if (source == torusItem) |
---|
| 2015 | + if (source == torusItem || source == torusButton) |
---|
1756 | 2016 | { |
---|
1757 | 2017 | makeSomething(new Torus()); |
---|
1758 | 2018 | } else |
---|
1759 | | - if (source == superItem) |
---|
| 2019 | + if (source == superItem || source == superButton) |
---|
1760 | 2020 | { |
---|
1761 | 2021 | makeSomething(new Superellipsoid()); |
---|
1762 | 2022 | } else |
---|
1763 | | - if (source == kleinItem) |
---|
| 2023 | + if (source == kleinItem || source == kleinButton) |
---|
1764 | 2024 | { |
---|
1765 | 2025 | makeSomething(new Klein()); |
---|
1766 | 2026 | } else |
---|
.. | .. |
---|
1780 | 2040 | { |
---|
1781 | 2041 | makeSomething(new BezierSurface()); |
---|
1782 | 2042 | } else |
---|
1783 | | - if (source == overlayItem) |
---|
| 2043 | + if (source == overlayItem || source == overlayButton) |
---|
1784 | 2044 | { |
---|
1785 | 2045 | /* |
---|
1786 | 2046 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1828 | 2088 | s.setup(); |
---|
1829 | 2089 | makeSomething(s); |
---|
1830 | 2090 | } else |
---|
1831 | | - if (source == lightItem) |
---|
| 2091 | + if (source == lightItem || source == lightButton) |
---|
1832 | 2092 | { |
---|
1833 | 2093 | makeSomething(new Light()); |
---|
1834 | 2094 | } else |
---|
.. | .. |
---|
1878 | 2138 | |
---|
1879 | 2139 | group(g); |
---|
1880 | 2140 | } else |
---|
1881 | | - if (source == loopItem) |
---|
| 2141 | + if (source == loopItem || source == loopButton) |
---|
1882 | 2142 | { |
---|
1883 | 2143 | Composite csg = new GroupLeaf(); |
---|
1884 | 2144 | csg.count = 5; |
---|
1885 | 2145 | group(csg); |
---|
1886 | | - Composite child = new cGroup(); |
---|
| 2146 | + Composite child = new cGroup("Branch"); |
---|
1887 | 2147 | csg.addChild(child); |
---|
1888 | 2148 | child.addChild(csg); |
---|
1889 | 2149 | } else |
---|
1890 | 2150 | if (source == doubleItem) |
---|
1891 | 2151 | { |
---|
1892 | | - Composite csg = new GroupLeaf(); |
---|
| 2152 | + Composite csg = new GroupLeaf("Fork"); |
---|
1893 | 2153 | csg.count = 5; |
---|
1894 | 2154 | group(csg); |
---|
1895 | | - Composite child = new cGroup(); |
---|
| 2155 | + Composite child = new cGroup("Branch A"); |
---|
1896 | 2156 | csg.addChild(child); |
---|
1897 | 2157 | child.addChild(csg); |
---|
1898 | | - child = new cGroup(); |
---|
| 2158 | + child = new cGroup("Branch B"); |
---|
1899 | 2159 | csg.addChild(child); |
---|
1900 | 2160 | child.addChild(csg); |
---|
1901 | 2161 | } else |
---|
1902 | 2162 | if (source == tripleItem) |
---|
1903 | 2163 | { |
---|
1904 | | - Composite csg = new GroupLeaf(); |
---|
| 2164 | + Composite csg = new GroupLeaf("Trident"); |
---|
1905 | 2165 | csg.count = 4; |
---|
1906 | 2166 | group(csg); |
---|
1907 | 2167 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1951 | 2211 | { |
---|
1952 | 2212 | DumpObject(); |
---|
1953 | 2213 | } else |
---|
| 2214 | + if (source == minButton) |
---|
| 2215 | + { |
---|
| 2216 | + Minimize(); |
---|
| 2217 | + } else |
---|
| 2218 | + if (source == maxButton) |
---|
| 2219 | + { |
---|
| 2220 | + Maximize(); |
---|
| 2221 | + } else |
---|
| 2222 | + if (source == fullButton) |
---|
| 2223 | + { |
---|
| 2224 | + ToggleFullScreen(); |
---|
| 2225 | + } else |
---|
| 2226 | + if (source == undoButton) |
---|
| 2227 | + { |
---|
| 2228 | + if (!Undo()) |
---|
| 2229 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2230 | + } else |
---|
| 2231 | + if (source == redoButton) |
---|
| 2232 | + { |
---|
| 2233 | + Redo(); |
---|
| 2234 | + } else |
---|
| 2235 | + if (source == saveButton) |
---|
| 2236 | + { |
---|
| 2237 | + if (!Save(true)) |
---|
| 2238 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2239 | + } else |
---|
1954 | 2240 | if (source == oneStepButton) |
---|
1955 | 2241 | { |
---|
1956 | 2242 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1958 | 2244 | } else |
---|
1959 | 2245 | if (source == screenfitButton) |
---|
1960 | 2246 | { |
---|
1961 | | - //Reload(lastConverter, lastFilename, true); |
---|
1962 | 2247 | ScreenFit(); |
---|
1963 | 2248 | } else |
---|
1964 | 2249 | if (source == screenfitpointButton) |
---|
1965 | 2250 | { |
---|
1966 | | - //Reload(lastConverter, lastFilename, true); |
---|
1967 | 2251 | ScreenFitPoint(); |
---|
1968 | 2252 | } else |
---|
1969 | 2253 | if (source == snapobjectButton) |
---|
1970 | 2254 | { |
---|
1971 | | - //Reload(lastConverter, lastFilename, true); |
---|
1972 | 2255 | SnapObject(); |
---|
1973 | 2256 | } else |
---|
1974 | 2257 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2004 | 2287 | if (source == cutItem || source == clearButton) |
---|
2005 | 2288 | { |
---|
2006 | 2289 | loadClipboard(true); |
---|
| 2290 | + } else |
---|
| 2291 | + if (source == undoItem) |
---|
| 2292 | + { |
---|
| 2293 | + Undo(); |
---|
| 2294 | + } else |
---|
| 2295 | + if (source == redoItem) |
---|
| 2296 | + { |
---|
| 2297 | + Redo(); |
---|
2007 | 2298 | } else |
---|
2008 | 2299 | if (source == duplicateItem) |
---|
2009 | 2300 | { |
---|
.. | .. |
---|
2336 | 2627 | { |
---|
2337 | 2628 | ClearSelection(true); |
---|
2338 | 2629 | } else |
---|
2339 | | - if (source == grabItem) |
---|
| 2630 | + if (source == grabItem || source == groupButton) |
---|
2340 | 2631 | { |
---|
2341 | | - group(new cGroup(), true); |
---|
| 2632 | + group(new cGroup(), false); // true); |
---|
2342 | 2633 | } else |
---|
2343 | 2634 | if (source == hideItem) |
---|
2344 | 2635 | { |
---|
.. | .. |
---|
2356 | 2647 | { |
---|
2357 | 2648 | makeSomething(new Camera()); |
---|
2358 | 2649 | } else |
---|
2359 | | - if (source == compositeItem) |
---|
| 2650 | + if (source == compositeItem || source == compositeButton) |
---|
2360 | 2651 | { |
---|
2361 | 2652 | group(new Composite()); |
---|
2362 | 2653 | } else |
---|
2363 | | - if (source == randomItem) |
---|
| 2654 | + if (source == switchItem || source == switchButton) |
---|
2364 | 2655 | { |
---|
2365 | 2656 | RandomNode random = new RandomNode(); |
---|
2366 | 2657 | group(random); |
---|
.. | .. |
---|
2462 | 2753 | { |
---|
2463 | 2754 | group(new cLinker()); |
---|
2464 | 2755 | } else |
---|
2465 | | - if (source == textureItem) |
---|
| 2756 | + if (source == textureItem || source == textureButton) |
---|
2466 | 2757 | { |
---|
2467 | 2758 | group(new TextureNode()); |
---|
2468 | 2759 | } else |
---|
.. | .. |
---|
2482 | 2773 | { |
---|
2483 | 2774 | CastShadow(2); |
---|
2484 | 2775 | } else |
---|
2485 | | - if (source == ungroupItem) |
---|
| 2776 | + if (source == ungroupItem || source == ungroupButton) |
---|
2486 | 2777 | { |
---|
2487 | | - //ungroup(); |
---|
| 2778 | + boolean hasRoot = false; |
---|
| 2779 | + |
---|
2488 | 2780 | for (int i=0; i<group.selection.size(); i++) |
---|
2489 | 2781 | { |
---|
2490 | | - Ungroup(group.selection.get(i)); |
---|
| 2782 | + if (group.selection.get(i) == group) |
---|
| 2783 | + { |
---|
| 2784 | + hasRoot = true; |
---|
| 2785 | + break; |
---|
| 2786 | + } |
---|
2491 | 2787 | } |
---|
2492 | 2788 | |
---|
2493 | | - ClearSelection(false); |
---|
2494 | | - |
---|
2495 | | - refreshContents(); |
---|
| 2789 | + if (!hasRoot) |
---|
| 2790 | + { |
---|
| 2791 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2792 | + { |
---|
| 2793 | + Ungroup(group.selection.get(i)); |
---|
| 2794 | + } |
---|
| 2795 | + |
---|
| 2796 | + ClearSelection(false); |
---|
| 2797 | + |
---|
| 2798 | + refreshContents(); |
---|
| 2799 | + } |
---|
2496 | 2800 | } else |
---|
2497 | 2801 | if (source == genUVItem) |
---|
2498 | 2802 | { |
---|
.. | .. |
---|
2504 | 2808 | } else |
---|
2505 | 2809 | if (source == genNormalsMESHItem) |
---|
2506 | 2810 | { |
---|
2507 | | - GenNormals(true); // TODO |
---|
| 2811 | + GenNormalsMESH(); |
---|
2508 | 2812 | } else |
---|
2509 | 2813 | if (source == genNormalsORGANItem) |
---|
2510 | 2814 | { |
---|
.. | .. |
---|
2569 | 2873 | if (source == unmarkleavesItem) |
---|
2570 | 2874 | { |
---|
2571 | 2875 | MarkLeaves(false); |
---|
| 2876 | + } else |
---|
| 2877 | + if (source == rewindleavesItem) |
---|
| 2878 | + { |
---|
| 2879 | + RewindLeaves(true); |
---|
| 2880 | + } else |
---|
| 2881 | + if (source == unrewindleavesItem) |
---|
| 2882 | + { |
---|
| 2883 | + RewindLeaves(false); |
---|
| 2884 | + } else |
---|
| 2885 | + if (source == randomleavesItem) |
---|
| 2886 | + { |
---|
| 2887 | + RandomLeaves(true); |
---|
| 2888 | + } else |
---|
| 2889 | + if (source == unrandomleavesItem) |
---|
| 2890 | + { |
---|
| 2891 | + RandomLeaves(false); |
---|
2572 | 2892 | } else |
---|
2573 | 2893 | if (source == flipVItem) |
---|
2574 | 2894 | { |
---|
.. | .. |
---|
2804 | 3124 | if (source == twoButton) |
---|
2805 | 3125 | { |
---|
2806 | 3126 | radio.layout = twoButton; |
---|
| 3127 | + |
---|
| 3128 | + if (CameraPane.FULLSCREEN) |
---|
| 3129 | + fullscreenLayout = radio.layout; |
---|
| 3130 | + |
---|
2807 | 3131 | // bug |
---|
2808 | 3132 | //gridPanel.setDividerLocation(1.0); |
---|
2809 | 3133 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2836 | 3160 | bigThree.ClearUI(); |
---|
2837 | 3161 | bigThree.add(centralPanel); |
---|
2838 | 3162 | bigThree.FlushUI(); |
---|
| 3163 | + |
---|
| 3164 | + cameraView.requestFocusInWindow(); |
---|
| 3165 | + |
---|
| 3166 | +// refreshContents(true); |
---|
| 3167 | +// |
---|
| 3168 | +// try |
---|
| 3169 | +// { |
---|
| 3170 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3171 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3172 | +// bot.mouseMove(100, 100); |
---|
| 3173 | +// bot.mousePress(mask); |
---|
| 3174 | +// bot.mouseRelease(mask); |
---|
| 3175 | +// } |
---|
| 3176 | +// catch (Exception e) |
---|
| 3177 | +// { |
---|
| 3178 | +// |
---|
| 3179 | +// } |
---|
| 3180 | + |
---|
2839 | 3181 | } else |
---|
2840 | 3182 | if (source == threeButton) |
---|
2841 | 3183 | { |
---|
2842 | 3184 | radio.layout = threeButton; |
---|
| 3185 | + |
---|
| 3186 | + if (CameraPane.FULLSCREEN) |
---|
| 3187 | + fullscreenLayout = radio.layout; |
---|
2843 | 3188 | |
---|
2844 | 3189 | // bigThree.remove(scenePanel); |
---|
2845 | 3190 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2872 | 3217 | bigThree.add(centralPanel); |
---|
2873 | 3218 | bigThree.add(XYZPanel); |
---|
2874 | 3219 | bigThree.FlushUI(); |
---|
| 3220 | + |
---|
| 3221 | + cameraView.requestFocusInWindow(); |
---|
2875 | 3222 | } else |
---|
2876 | 3223 | if (source == fourButton) |
---|
2877 | 3224 | { |
---|
2878 | 3225 | radio.layout = fourButton; |
---|
| 3226 | + |
---|
| 3227 | + if (CameraPane.FULLSCREEN) |
---|
| 3228 | + fullscreenLayout = radio.layout; |
---|
2879 | 3229 | |
---|
2880 | 3230 | // bigThree.remove(scenePanel); |
---|
2881 | 3231 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2907 | 3257 | bigThree.ClearUI(); |
---|
2908 | 3258 | bigThree.add(scenePanel); |
---|
2909 | 3259 | bigThree.FlushUI(); |
---|
| 3260 | + |
---|
| 3261 | + cameraView.requestFocusInWindow(); |
---|
2910 | 3262 | } else |
---|
2911 | 3263 | if (source == sixButton) |
---|
2912 | 3264 | { |
---|
2913 | 3265 | radio.layout = sixButton; |
---|
| 3266 | + |
---|
| 3267 | + if (CameraPane.FULLSCREEN) |
---|
| 3268 | + fullscreenLayout = radio.layout; |
---|
2914 | 3269 | |
---|
2915 | 3270 | // bigThree.remove(scenePanel); |
---|
2916 | 3271 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2943 | 3298 | bigThree.add(scenePanel); |
---|
2944 | 3299 | bigThree.add(centralPanel); |
---|
2945 | 3300 | bigThree.FlushUI(); |
---|
| 3301 | + |
---|
| 3302 | + cameraView.requestFocusInWindow(); |
---|
2946 | 3303 | } else |
---|
2947 | 3304 | if (source == sevenButton) |
---|
2948 | 3305 | { |
---|
2949 | 3306 | radio.layout = sevenButton; |
---|
| 3307 | + |
---|
| 3308 | + if (CameraPane.FULLSCREEN) |
---|
| 3309 | + fullscreenLayout = radio.layout; |
---|
2950 | 3310 | |
---|
2951 | 3311 | // bigThree.remove(scenePanel); |
---|
2952 | 3312 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2980 | 3340 | bigThree.add(centralPanel); |
---|
2981 | 3341 | bigThree.add(XYZPanel); |
---|
2982 | 3342 | bigThree.FlushUI(); |
---|
| 3343 | + |
---|
| 3344 | + cameraView.requestFocusInWindow(); |
---|
2983 | 3345 | } else |
---|
2984 | 3346 | if (source == rootButton) |
---|
2985 | 3347 | { |
---|
.. | .. |
---|
2991 | 3353 | EditObject(obj); |
---|
2992 | 3354 | } |
---|
2993 | 3355 | |
---|
| 3356 | + cameraView.requestFocusInWindow(); |
---|
2994 | 3357 | refreshContents(true); |
---|
2995 | 3358 | } else |
---|
2996 | 3359 | if (source == closeButton) |
---|
.. | .. |
---|
3000 | 3363 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3001 | 3364 | { |
---|
3002 | 3365 | ab = (cRadio)e.nextElement(); |
---|
3003 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3366 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3004 | 3367 | { |
---|
| 3368 | + // Patch to avoid bug with transparency. |
---|
| 3369 | + if (!ab.hadMaterial) |
---|
| 3370 | + { |
---|
| 3371 | + ab.object.material = null; |
---|
| 3372 | + } |
---|
| 3373 | + |
---|
3005 | 3374 | buttonGroup.remove(ab); |
---|
3006 | 3375 | radioPanel.remove(ab); |
---|
3007 | 3376 | |
---|
3008 | | - ab.GetObject().editWindow = null; |
---|
| 3377 | + //ab.GetObject().editWindow = null; |
---|
| 3378 | + ab.GetObject().manipWindow = null; |
---|
3009 | 3379 | // ab.GetObject().objectUI = null; // ????????? |
---|
3010 | 3380 | |
---|
3011 | 3381 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3012 | 3382 | break; |
---|
3013 | 3383 | } |
---|
3014 | 3384 | } |
---|
| 3385 | + |
---|
| 3386 | + cameraView.requestFocusInWindow(); |
---|
3015 | 3387 | refreshContents(true); |
---|
3016 | 3388 | } else |
---|
3017 | 3389 | if (source == editItem || source == editButton) |
---|
3018 | 3390 | { |
---|
| 3391 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3392 | + { |
---|
| 3393 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3394 | + child.pinned = true; |
---|
| 3395 | + } |
---|
| 3396 | + |
---|
3019 | 3397 | EditSelection(false); |
---|
3020 | 3398 | } else |
---|
3021 | 3399 | if (source == uneditButton) |
---|
.. | .. |
---|
3025 | 3403 | Object3D child = (Object3D)e.nextElement(); |
---|
3026 | 3404 | if(child.editWindow != null) |
---|
3027 | 3405 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3406 | + child.pinned = false; |
---|
3028 | 3407 | child.CloseUI(); |
---|
3029 | 3408 | listUI.remove(child); |
---|
3030 | 3409 | |
---|
3031 | | - child.editWindow = null; // ??????????? |
---|
| 3410 | + //child.editWindow = null; // ??????????? |
---|
3032 | 3411 | } |
---|
3033 | 3412 | objEditor.ctrlPanel.FlushUI(); |
---|
3034 | 3413 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3041 | 3420 | //copy.ClearUI(); |
---|
3042 | 3421 | for (Object3D obj : listUI) |
---|
3043 | 3422 | { |
---|
| 3423 | + obj.pinned = false; |
---|
3044 | 3424 | obj.CloseUI(); |
---|
3045 | 3425 | } |
---|
3046 | 3426 | listUI.clear(); |
---|
.. | .. |
---|
3050 | 3430 | { |
---|
3051 | 3431 | assert(copy == group); |
---|
3052 | 3432 | |
---|
3053 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3433 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3054 | 3434 | |
---|
3055 | 3435 | for (Object3D obj : listUI) |
---|
3056 | 3436 | { |
---|
.. | .. |
---|
3115 | 3495 | sideView.object = group; |
---|
3116 | 3496 | } |
---|
3117 | 3497 | |
---|
3118 | | -// fix "+" issue group.editWindow = this; |
---|
| 3498 | +// fix "+" issue |
---|
| 3499 | + //group.editWindow = this; |
---|
| 3500 | + group.manipWindow = this; |
---|
3119 | 3501 | |
---|
3120 | 3502 | /* |
---|
3121 | 3503 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3123 | 3505 | currentLayout = sevenButton; |
---|
3124 | 3506 | */ |
---|
3125 | 3507 | radio.layout.doClick(); |
---|
| 3508 | + |
---|
| 3509 | + ClearUnpinned(); |
---|
| 3510 | + SetPinStates(group.selection.size() > 0); |
---|
| 3511 | + if (group.selection.size() == 1) |
---|
| 3512 | + EditSelection(false); |
---|
3126 | 3513 | keepparent = group.parent; |
---|
3127 | 3514 | // PARENT = NULL or not??? |
---|
3128 | 3515 | //group.parent = null; // ROOT |
---|
3129 | 3516 | //group.attributes = -1; |
---|
3130 | 3517 | ResetModel(); |
---|
| 3518 | + |
---|
| 3519 | + cameraView.requestFocusInWindow(); |
---|
3131 | 3520 | refreshContents(true); |
---|
3132 | 3521 | } else if (event.getSource() == editCameraItem) |
---|
3133 | 3522 | { |
---|
3134 | 3523 | cameraView.ProtectCamera(); |
---|
3135 | 3524 | cameraView.repaint(); |
---|
3136 | 3525 | return; |
---|
3137 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3526 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3138 | 3527 | { |
---|
3139 | 3528 | cameraView.RevertCamera(); |
---|
3140 | 3529 | cameraView.repaint(); |
---|
.. | .. |
---|
3151 | 3540 | } |
---|
3152 | 3541 | |
---|
3153 | 3542 | boolean useclient = false; |
---|
3154 | | - cRadio radio; |
---|
3155 | 3543 | |
---|
3156 | 3544 | void ToggleRoot() |
---|
3157 | 3545 | { |
---|
.. | .. |
---|
3390 | 3778 | |
---|
3391 | 3779 | int size = obj.MemorySize(); |
---|
3392 | 3780 | |
---|
3393 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3781 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3782 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3394 | 3783 | } |
---|
3395 | 3784 | } |
---|
3396 | 3785 | catch (Exception e) |
---|
.. | .. |
---|
3471 | 3860 | void GenNormals(boolean crease) |
---|
3472 | 3861 | { |
---|
3473 | 3862 | group.GenNormalsS(crease); |
---|
| 3863 | + |
---|
| 3864 | + refreshContents(); |
---|
| 3865 | + } |
---|
| 3866 | + |
---|
| 3867 | + void GenNormalsMESH() |
---|
| 3868 | + { |
---|
| 3869 | + group.GenNormalsMeshS(); |
---|
3474 | 3870 | |
---|
3475 | 3871 | refreshContents(); |
---|
3476 | 3872 | } |
---|
.. | .. |
---|
4098 | 4494 | refreshContents(); |
---|
4099 | 4495 | } |
---|
4100 | 4496 | |
---|
| 4497 | + void RewindLeaves(boolean hide) |
---|
| 4498 | + { |
---|
| 4499 | + group.selection.RewindLeaves(hide); |
---|
| 4500 | + refreshContents(); |
---|
| 4501 | + } |
---|
| 4502 | + |
---|
| 4503 | + void RandomLeaves(boolean hide) |
---|
| 4504 | + { |
---|
| 4505 | + group.selection.RandomLeaves(hide); |
---|
| 4506 | + refreshContents(); |
---|
| 4507 | + } |
---|
| 4508 | + |
---|
4101 | 4509 | void SetTexRes(int tr) |
---|
4102 | 4510 | { |
---|
4103 | 4511 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4169 | 4577 | // } |
---|
4170 | 4578 | // } |
---|
4171 | 4579 | |
---|
4172 | | - static boolean allparams = true; |
---|
4173 | | - |
---|
4174 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4175 | | - |
---|
4176 | 4580 | void EditSelection(boolean newWindow) |
---|
4177 | 4581 | { |
---|
4178 | 4582 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4180 | 4584 | { |
---|
4181 | 4585 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4182 | 4586 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4183 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4587 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4184 | 4588 | |
---|
4185 | 4589 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4186 | 4590 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4265 | 4669 | //new Exception().printStackTrace(); |
---|
4266 | 4670 | |
---|
4267 | 4671 | freezemodel = true; |
---|
4268 | | - |
---|
| 4672 | + ClearUnpinned(); |
---|
| 4673 | + |
---|
4269 | 4674 | /**/ |
---|
4270 | 4675 | //switch (event.id) |
---|
4271 | 4676 | { |
---|
.. | .. |
---|
4273 | 4678 | //case 702: // Event.LIST_DESELECT |
---|
4274 | 4679 | group.deselectAll(); |
---|
4275 | 4680 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4276 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4277 | 4681 | if (tps != null) |
---|
4278 | 4682 | { |
---|
4279 | 4683 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4282 | 4686 | |
---|
4283 | 4687 | //if (child.parent != null) |
---|
4284 | 4688 | //child.parent.addSelectee(child); |
---|
| 4689 | + objEditor.SetMaterial(child); |
---|
4285 | 4690 | group.addSelectee(child); |
---|
4286 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4287 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4288 | | - System.err.println("info : " + child.GetPath()); |
---|
4289 | 4691 | } |
---|
4290 | 4692 | } |
---|
4291 | 4693 | // else |
---|
.. | .. |
---|
4295 | 4697 | // System.err.println("info : " + group.GetPath()); |
---|
4296 | 4698 | // } |
---|
4297 | 4699 | |
---|
4298 | | - objEditor.SetText(); // jan 2014 |
---|
4299 | | - |
---|
4300 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4700 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4301 | 4701 | CameraPane.flash = true; |
---|
4302 | 4702 | |
---|
4303 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4703 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4304 | 4704 | // a camera |
---|
4305 | 4705 | { |
---|
4306 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4307 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4706 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4707 | + { |
---|
| 4708 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4709 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4710 | + } |
---|
4308 | 4711 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4309 | 4712 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4310 | 4713 | } |
---|
4311 | 4714 | |
---|
| 4715 | + if (tps != null && tps.length == 1) |
---|
| 4716 | + { |
---|
| 4717 | + EditSelection(false); |
---|
| 4718 | + } |
---|
| 4719 | + |
---|
| 4720 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4721 | + |
---|
4312 | 4722 | refreshContents(); |
---|
4313 | 4723 | //return true; |
---|
4314 | 4724 | } |
---|
.. | .. |
---|
4317 | 4727 | |
---|
4318 | 4728 | freezemodel = false; |
---|
4319 | 4729 | } |
---|
| 4730 | + |
---|
| 4731 | + void SetPinStates(boolean enabled) |
---|
| 4732 | + { |
---|
| 4733 | + editButton.setEnabled(enabled); |
---|
| 4734 | + uneditButton.setEnabled(enabled); |
---|
| 4735 | + unselectButton.setEnabled(enabled); |
---|
| 4736 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4737 | + } |
---|
| 4738 | + |
---|
| 4739 | + void refreshContents(boolean cp) |
---|
| 4740 | + { |
---|
| 4741 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4742 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4743 | + { |
---|
| 4744 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4745 | + |
---|
| 4746 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4747 | + { |
---|
| 4748 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4749 | + |
---|
| 4750 | + objEditor.AddInfo(child, this, true); |
---|
| 4751 | + System.err.println("info : " + child.GetPath()); |
---|
| 4752 | + } |
---|
| 4753 | + |
---|
| 4754 | + objEditor.SetText(); // jan 2014 |
---|
| 4755 | + } |
---|
| 4756 | + |
---|
| 4757 | + super.refreshContents(cp); |
---|
| 4758 | + } |
---|
4320 | 4759 | |
---|
4321 | 4760 | void linkSomething(Object3D thing) |
---|
4322 | 4761 | { |
---|
.. | .. |
---|
4388 | 4827 | { |
---|
4389 | 4828 | if (group.selection.isEmpty()) |
---|
4390 | 4829 | return; |
---|
| 4830 | + |
---|
4391 | 4831 | Grafreed.clipboardIsTempGroup = false; |
---|
4392 | 4832 | Composite tGroup = null; |
---|
4393 | 4833 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4398 | 4838 | |
---|
4399 | 4839 | if (cut) |
---|
4400 | 4840 | { |
---|
| 4841 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4842 | +// Save(); |
---|
4401 | 4843 | //int indices[] = jList.getSelectedIndices(); |
---|
4402 | 4844 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4403 | 4845 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4487 | 4929 | } |
---|
4488 | 4930 | |
---|
4489 | 4931 | } |
---|
| 4932 | + |
---|
4490 | 4933 | if (Grafreed.clipboardIsTempGroup) |
---|
4491 | 4934 | Grafreed.clipboard = tGroup; |
---|
| 4935 | + |
---|
4492 | 4936 | if (cut) |
---|
4493 | 4937 | { |
---|
4494 | 4938 | ResetModel(); |
---|
.. | .. |
---|
4498 | 4942 | |
---|
4499 | 4943 | void paste(boolean expand) |
---|
4500 | 4944 | { |
---|
| 4945 | + if (Globals.SAVEONMAKE) |
---|
| 4946 | + Save(); |
---|
| 4947 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 4948 | + Globals.SAVEONMAKE = false; |
---|
4501 | 4949 | // if (GrafreeD.clipboard == null) |
---|
4502 | 4950 | // return; |
---|
4503 | 4951 | boolean first = true; |
---|
.. | .. |
---|
4557 | 5005 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4558 | 5006 | } |
---|
4559 | 5007 | |
---|
| 5008 | + Globals.SAVEONMAKE = keep; |
---|
4560 | 5009 | ResetModel(); |
---|
4561 | 5010 | refreshContents(); |
---|
4562 | 5011 | } |
---|
.. | .. |
---|
4692 | 5141 | |
---|
4693 | 5142 | void group(Object3D csg, boolean grab) |
---|
4694 | 5143 | { |
---|
| 5144 | + if (Globals.SAVEONMAKE) |
---|
| 5145 | + Save(); |
---|
| 5146 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 5147 | + Globals.SAVEONMAKE = false; |
---|
4695 | 5148 | if (//false) // why?? |
---|
4696 | 5149 | !group.selection.isEmpty()) |
---|
4697 | 5150 | { |
---|
.. | .. |
---|
4805 | 5258 | //node.add(csg); |
---|
4806 | 5259 | //makeSomething(node); |
---|
4807 | 5260 | makeSomething(csg); |
---|
| 5261 | + Globals.SAVEONMAKE = keep; |
---|
4808 | 5262 | } |
---|
4809 | 5263 | |
---|
4810 | 5264 | void Ungroup(Object3D g) |
---|
4811 | 5265 | { |
---|
| 5266 | + if (Globals.SAVEONMAKE) |
---|
| 5267 | + Save(); |
---|
| 5268 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 5269 | + Globals.SAVEONMAKE = false; |
---|
4812 | 5270 | if (g instanceof HiddenObject) |
---|
4813 | 5271 | { |
---|
4814 | 5272 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4825 | 5283 | objEditor.makeSomething(g.get(i), false); |
---|
4826 | 5284 | } |
---|
4827 | 5285 | } |
---|
| 5286 | + Globals.SAVEONMAKE = keep; |
---|
4828 | 5287 | } |
---|
4829 | 5288 | |
---|
4830 | 5289 | void ungroup() |
---|
.. | .. |
---|
5113 | 5572 | cButton clearpanelButton; |
---|
5114 | 5573 | cButton unselectButton; |
---|
5115 | 5574 | |
---|
| 5575 | + cButton restoreCameraButton; |
---|
| 5576 | + |
---|
| 5577 | + cButton saveButton; |
---|
5116 | 5578 | cButton oneStepButton; |
---|
| 5579 | + |
---|
| 5580 | + cButton groupButton; |
---|
| 5581 | + cButton ungroupButton; |
---|
| 5582 | + cButton compositeButton; |
---|
| 5583 | + cButton switchButton; |
---|
| 5584 | + cButton loopButton; |
---|
| 5585 | + cButton textureButton; |
---|
| 5586 | + |
---|
| 5587 | + cButton gridButton; |
---|
| 5588 | + cButton boxButton; |
---|
| 5589 | + cButton sphereButton; |
---|
| 5590 | + cButton coneButton; |
---|
| 5591 | + cButton torusButton; |
---|
| 5592 | + cButton superButton; |
---|
| 5593 | + cButton kleinButton; |
---|
| 5594 | + cButton particlesButton; |
---|
| 5595 | + cButton overlayButton; |
---|
| 5596 | + cButton lightButton; |
---|
5117 | 5597 | |
---|
5118 | 5598 | cButton screenfitButton; |
---|
5119 | 5599 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5126 | 5606 | |
---|
5127 | 5607 | cButton setsupportButton; |
---|
5128 | 5608 | |
---|
5129 | | - cButton twoButton; |
---|
5130 | | - cButton sixButton; |
---|
5131 | | - cButton threeButton; |
---|
5132 | | - cButton sevenButton; |
---|
5133 | | - cButton fourButton; // full panel |
---|
5134 | | - cButton oneButton; // full XYZ |
---|
5135 | | - //cButton currentLayout; |
---|
5136 | | - |
---|
5137 | 5609 | // |
---|
5138 | 5610 | //Composite |
---|
5139 | 5611 | Object3D // to do !! |
---|
.. | .. |
---|
5143 | 5615 | //JTree jTree; |
---|
5144 | 5616 | private MenuItem lookAtItem; |
---|
5145 | 5617 | private MenuItem lookFromItem; |
---|
5146 | | - private MenuItem switchItem; |
---|
| 5618 | + private MenuItem switchViewItem; |
---|
5147 | 5619 | private MenuItem cutItem; |
---|
5148 | | - private MenuItem duplicateItem; |
---|
| 5620 | + private MenuItem undoItem; |
---|
| 5621 | + private MenuItem redoItem; |
---|
| 5622 | + private JMenuItem duplicateItem; |
---|
5149 | 5623 | private MenuItem cloneItem; |
---|
5150 | 5624 | private MenuItem cloneSupportItem; |
---|
5151 | 5625 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5208 | 5682 | private MenuItem showleavesItem; |
---|
5209 | 5683 | private MenuItem markleavesItem; |
---|
5210 | 5684 | private MenuItem unmarkleavesItem; |
---|
| 5685 | + private MenuItem rewindleavesItem; |
---|
| 5686 | + private MenuItem unrewindleavesItem; |
---|
| 5687 | + private MenuItem randomleavesItem; |
---|
| 5688 | + private MenuItem unrandomleavesItem; |
---|
5211 | 5689 | |
---|
5212 | 5690 | private MenuItem flipVItem; |
---|
5213 | 5691 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5229 | 5707 | private MenuItem frontItem; |
---|
5230 | 5708 | private MenuItem cameraItem; |
---|
5231 | 5709 | private MenuItem compositeItem; |
---|
5232 | | - private MenuItem randomItem; |
---|
| 5710 | + private MenuItem switchItem; |
---|
5233 | 5711 | private MenuItem physicsItem; |
---|
5234 | 5712 | private MenuItem frameselectorItem; |
---|
5235 | 5713 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5303 | 5781 | |
---|
5304 | 5782 | Menu cameraMenu; |
---|
5305 | 5783 | MenuItem editCameraItem; |
---|
5306 | | - MenuItem revertCameraItem; |
---|
| 5784 | + MenuItem restoreCameraItem; |
---|
5307 | 5785 | } |
---|