.. | .. |
---|
74 | 74 | this.copy = this.group = copy; |
---|
75 | 75 | //selectees = this.group.selectees; |
---|
76 | 76 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 77 | + SetupMenu2(this); //objEditor); |
---|
78 | 78 | SetupUI2(objEditor); |
---|
79 | 79 | objEditor.SetupUI(true); |
---|
80 | 80 | SetupViews(objEditor); |
---|
.. | .. |
---|
148 | 148 | |
---|
149 | 149 | //JTextField nameField; |
---|
150 | 150 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 151 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 152 | { |
---|
153 | | - if (Globals.ADVANCED) |
---|
154 | | - { |
---|
155 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
156 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
157 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
158 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
159 | | - oe.cameraMenu.add("-"); |
---|
160 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
161 | | - openWindowItem.addActionListener(this); |
---|
162 | | - editLeafItem.addActionListener(this); |
---|
163 | | - lookAtItem.addActionListener(this); |
---|
164 | | - //lookFromItem.addActinoListener(this); |
---|
165 | | - //switchItem.addActionListener(this); |
---|
166 | | - } |
---|
167 | | - |
---|
168 | 153 | Menu menu; |
---|
169 | 154 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 155 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 156 | //editItem.addActionListener(this); |
---|
| 157 | + |
---|
| 158 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 159 | +// undoItem.addActionListener(this); |
---|
| 160 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 161 | +// redoItem.addActionListener(this); |
---|
| 162 | +// menu.add("-"); |
---|
172 | 163 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
173 | 164 | duplicateItem.addActionListener(this); |
---|
174 | 165 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
.. | .. |
---|
185 | 176 | copyItem.addActionListener(this); |
---|
186 | 177 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 178 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 179 | |
---|
190 | 180 | menu.add("-"); |
---|
191 | 181 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
206 | 196 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 197 | clearAllItem.addActionListener(this); |
---|
208 | 198 | } |
---|
| 199 | + |
---|
| 200 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 201 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 202 | + //zBufferItem.addActionListener(this); |
---|
| 203 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 204 | + //normalLensItem.addActionListener(this); |
---|
| 205 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 206 | + revertCameraItem.addActionListener(this); |
---|
| 207 | + |
---|
| 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); |
---|
| 220 | + |
---|
| 221 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 222 | + toggleHandleItem.addItemListener(this); |
---|
| 223 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 224 | + |
---|
| 225 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 226 | + togglePaintItem.addItemListener(this); |
---|
| 227 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 228 | + |
---|
| 229 | + if (Globals.ADVANCED) |
---|
| 230 | + { |
---|
| 231 | + cameraMenu.add("-"); |
---|
| 232 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 233 | + toggleLiveItem.addItemListener(this); |
---|
| 234 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 235 | |
---|
| 236 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 237 | + stepItem.addActionListener(this); |
---|
| 238 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 239 | + // toggleDLItem.addItemListener(this); |
---|
| 240 | + // toggleDLItem.setState(false); |
---|
| 241 | + |
---|
| 242 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 243 | + toggleRenderItem.addItemListener(this); |
---|
| 244 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 245 | + |
---|
| 246 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 247 | + toggleDebugItem.addItemListener(this); |
---|
| 248 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 249 | + |
---|
| 250 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 251 | + toggleFrustumItem.addItemListener(this); |
---|
| 252 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 253 | + |
---|
| 254 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 255 | + toggleFootContactItem.addItemListener(this); |
---|
| 256 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 257 | + |
---|
| 258 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 259 | + toggleTimelineItem.addItemListener(this); |
---|
| 260 | + } |
---|
| 261 | + |
---|
| 262 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 263 | +// toggleRootItem.addItemListener(this); |
---|
| 264 | +// toggleRootItem.setState(false); |
---|
| 265 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 266 | +// animationItem.addItemListener(this); |
---|
| 267 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 268 | + cameraMenu.add("-"); |
---|
| 269 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 270 | + editCameraItem.addActionListener(this); |
---|
| 271 | + |
---|
| 272 | + if (Globals.ADVANCED) |
---|
| 273 | + { |
---|
| 274 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 275 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 276 | + //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 277 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 278 | + oe.cameraMenu.add("-"); |
---|
| 279 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 280 | + openWindowItem.addActionListener(this); |
---|
| 281 | + editLeafItem.addActionListener(this); |
---|
| 282 | + lookAtItem.addActionListener(this); |
---|
| 283 | + //lookFromItem.addActinoListener(this); |
---|
| 284 | + //switchItem.addActionListener(this); |
---|
| 285 | + } |
---|
| 286 | + |
---|
210 | 287 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 288 | if (Globals.ADVANCED) |
---|
212 | 289 | { |
---|
213 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
214 | | - resetMeshItem.addActionListener(this); |
---|
215 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
216 | | - stepAllItem.addActionListener(this); |
---|
217 | 290 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 291 | revertMeshItem.addActionListener(this); |
---|
219 | 292 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
295 | 368 | billboardItem.addActionListener(this); |
---|
296 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
297 | 370 | csgItem.addActionListener(this); |
---|
298 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 371 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
299 | 372 | shadowXItem.addActionListener(this); |
---|
300 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 373 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
301 | 374 | shadowYItem.addActionListener(this); |
---|
302 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 375 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
303 | 376 | shadowZItem.addActionListener(this); |
---|
304 | 377 | if (Globals.ADVANCED) |
---|
305 | 378 | { |
---|
.. | .. |
---|
372 | 445 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
373 | 446 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
374 | 447 | clearMaterialsItem.addActionListener(this); |
---|
| 448 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 449 | + resetAllItem.addActionListener(this); |
---|
| 450 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 451 | + stepAllItem.addActionListener(this); |
---|
375 | 452 | menu.add("-"); |
---|
376 | 453 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
377 | 454 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
392 | 469 | markleavesItem.addActionListener(this); |
---|
393 | 470 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
394 | 471 | unmarkleavesItem.addActionListener(this); |
---|
| 472 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 473 | + rewindleavesItem.addActionListener(this); |
---|
| 474 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 475 | + unrewindleavesItem.addActionListener(this); |
---|
| 476 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 477 | + randomleavesItem.addActionListener(this); |
---|
| 478 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 479 | + unrandomleavesItem.addActionListener(this); |
---|
395 | 480 | menu.add("-"); |
---|
396 | 481 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
397 | 482 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
443 | 528 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
444 | 529 | buildCreateMenu(menu); |
---|
445 | 530 | |
---|
446 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
447 | | - importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
448 | | - importOBJItem.addActionListener(this); |
---|
449 | | - menu.add("-"); |
---|
450 | | - import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
451 | | - import3DSItem.addActionListener(this); |
---|
452 | | - menu.add("-"); |
---|
453 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
454 | | - importVRMLX3DItem.addActionListener(this); |
---|
455 | | - menu.add("-"); |
---|
456 | | - importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
457 | | - importGFDItem.addActionListener(this); |
---|
458 | | - |
---|
459 | 531 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
460 | 532 | buildToolsMenu(menu); |
---|
461 | 533 | } |
---|
462 | 534 | |
---|
463 | 535 | void SetupUI2(ObjEditor oe) |
---|
464 | 536 | { |
---|
| 537 | + // June 2019 |
---|
| 538 | + if (oe == null) |
---|
| 539 | + { |
---|
| 540 | + //super.SetupUI2(this); |
---|
| 541 | + //return; |
---|
| 542 | + } |
---|
| 543 | + |
---|
| 544 | + if (copy != group) |
---|
| 545 | + { |
---|
| 546 | + //super.SetupUI2(this); |
---|
| 547 | + } |
---|
| 548 | + |
---|
465 | 549 | //new Exception().printStackTrace(); |
---|
466 | 550 | |
---|
467 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
492 | 576 | */ |
---|
493 | 577 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
494 | 578 | |
---|
495 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
496 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 579 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 580 | + //minButton.setToolTipText("Minimize window"); |
---|
| 581 | + //minButton.addActionListener(this); |
---|
| 582 | + |
---|
| 583 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + maxButton.setToolTipText("Maximize window"); |
---|
| 585 | + maxButton.addActionListener(this); |
---|
| 586 | + |
---|
| 587 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 589 | + fullButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + undoButton.setToolTipText("Undo changes"); |
---|
| 593 | + undoButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + redoButton.setToolTipText("Redo changes"); |
---|
| 597 | + redoButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + saveButton.setToolTipText("Save changes"); |
---|
| 601 | + saveButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 604 | + liveCB.setToolTipText("Enable animation"); |
---|
497 | 605 | liveCB.addItemListener(this); |
---|
498 | 606 | |
---|
499 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
500 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
501 | | - oneStepButton.addActionListener(this); |
---|
502 | | - |
---|
503 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 607 | + oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
504 | 608 | fastCB.setToolTipText("Fast mode"); |
---|
505 | 609 | fastCB.addItemListener(this); |
---|
506 | 610 | |
---|
507 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 611 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 613 | + oneStepButton.addActionListener(this); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
508 | 616 | trackCB.setToolTipText("Enable tracking"); |
---|
509 | 617 | trackCB.addItemListener(this); |
---|
510 | 618 | |
---|
511 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
512 | 620 | screenfitButton.setToolTipText("Screen fit"); |
---|
513 | 621 | screenfitButton.addActionListener(this); |
---|
514 | 622 | |
---|
.. | .. |
---|
522 | 630 | snapobjectButton.setToolTipText("Snap Object"); |
---|
523 | 631 | } |
---|
524 | 632 | |
---|
525 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
526 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
| 633 | + oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
527 | 635 | flashSelectionButton.addActionListener(this); |
---|
528 | 636 | |
---|
529 | 637 | oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
530 | 638 | |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
532 | 640 | twoButton.setToolTipText("Show center view only"); |
---|
533 | 641 | twoButton.addActionListener(this); |
---|
534 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
535 | 643 | fourButton.addActionListener(this); |
---|
536 | 644 | fourButton.setToolTipText("Show left panel only"); |
---|
537 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 645 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
538 | 646 | sixButton.setToolTipText("2-column layout left"); |
---|
539 | 647 | sixButton.addActionListener(this); |
---|
540 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 648 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
541 | 649 | threeButton.setToolTipText("2-column layout right"); |
---|
542 | 650 | threeButton.addActionListener(this); |
---|
543 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | 652 | sevenButton.setToolTipText("3-column layout"); |
---|
545 | 653 | sevenButton.addActionListener(this); |
---|
546 | 654 | // |
---|
.. | .. |
---|
555 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
556 | 664 | //clearButton.addActionListener(this); |
---|
557 | 665 | |
---|
558 | | - cGridBag commandsPanel = new cGridBag(); |
---|
559 | | - |
---|
560 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 666 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
561 | 667 | editButton.setToolTipText("Edit selection"); |
---|
562 | 668 | editButton.addActionListener(this); |
---|
563 | 669 | |
---|
564 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | 671 | uneditButton.setToolTipText("Unedit selection"); |
---|
566 | 672 | uneditButton.addActionListener(this); |
---|
567 | 673 | |
---|
568 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
569 | 675 | allParamsButton.setToolTipText("Edit all params"); |
---|
570 | 676 | allParamsButton.addActionListener(this); |
---|
571 | 677 | |
---|
572 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 678 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
573 | 679 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
574 | 680 | clearPanelButton.addActionListener(this); |
---|
575 | 681 | |
---|
576 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 683 | unselectButton.setToolTipText("Unselect"); |
---|
578 | 684 | unselectButton.addActionListener(this); |
---|
579 | 685 | |
---|
580 | | - commandsPanel.preferredHeight = 1; |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
581 | 687 | |
---|
582 | | - oe.treePanel.add(commandsPanel); |
---|
583 | | - oe.treePanel.Return(); |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
584 | 690 | |
---|
585 | 691 | // oe.aConstraints.gridx += 1; |
---|
586 | 692 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
702 | 808 | // debugCB.addItemListener(this); |
---|
703 | 809 | |
---|
704 | 810 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 811 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
705 | 812 | oeilCB.addItemListener(this); |
---|
706 | 813 | |
---|
| 814 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 815 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 816 | + shadowCB.addItemListener(this); |
---|
| 817 | + |
---|
| 818 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 819 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 820 | + autosaveCB.addItemListener(this); |
---|
| 821 | + |
---|
| 822 | + if (Globals.ADVANCED) |
---|
| 823 | + { |
---|
707 | 824 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
708 | 825 | lookAtCB.setToolTipText("Look-at target"); |
---|
709 | 826 | lookAtCB.addItemListener(this); |
---|
| 827 | + } |
---|
710 | 828 | |
---|
711 | 829 | } |
---|
712 | 830 | |
---|
.. | .. |
---|
721 | 839 | void EditObject(Object3D obj) |
---|
722 | 840 | { |
---|
723 | 841 | cRadio radioButton = new cRadio(obj.name); |
---|
| 842 | + |
---|
| 843 | + // Patch to avoid bug with transparency. |
---|
| 844 | + radioButton.hadMaterial = obj.material != null; |
---|
| 845 | + if (!radioButton.hadMaterial) |
---|
| 846 | + { |
---|
| 847 | + obj.material = new cMaterial(); |
---|
| 848 | + } |
---|
| 849 | + |
---|
724 | 850 | radioButton.SetObject(obj); |
---|
725 | 851 | radioButton.layout = sevenButton; |
---|
726 | 852 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
729 | 855 | buttonGroup.add(radioButton); |
---|
730 | 856 | radioButton.doClick(); |
---|
731 | 857 | } |
---|
| 858 | + |
---|
732 | 859 | void SetupViews(ObjEditor oe) |
---|
733 | 860 | { |
---|
| 861 | + theFrame = this; |
---|
| 862 | + |
---|
734 | 863 | oe.SetupViews(); |
---|
735 | 864 | |
---|
736 | 865 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
739 | 868 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
740 | 869 | } |
---|
741 | 870 | |
---|
742 | | - JCheckBox liveCB; |
---|
743 | | - JCheckBox supportCB; |
---|
744 | | - JCheckBox localCB; |
---|
745 | | - JCheckBox crowdCB; |
---|
746 | | - JCheckBox smoothCB; |
---|
747 | | - JCheckBox fastCB; |
---|
748 | | - JCheckBox slowCB; |
---|
749 | | - JCheckBox boxCB; |
---|
750 | | - JCheckBox zoomBoxCB; |
---|
751 | | - JCheckBox trackCB; |
---|
752 | | - JCheckBox smoothfocusCB; |
---|
| 871 | + cCheckBox liveCB; |
---|
| 872 | + cCheckBox supportCB; |
---|
| 873 | + cCheckBox localCB; |
---|
| 874 | + cCheckBox crowdCB; |
---|
| 875 | + cCheckBox smoothCB; |
---|
| 876 | + cCheckBox fastCB; |
---|
| 877 | + cCheckBox slowCB; |
---|
| 878 | + cCheckBox boxCB; |
---|
| 879 | + cCheckBox zoomBoxCB; |
---|
| 880 | + cCheckBox trackCB; |
---|
| 881 | + cCheckBox smoothfocusCB; |
---|
753 | 882 | // JCheckBox speakerMocapCB; |
---|
754 | | - JCheckBox speakerCameraCB; |
---|
755 | | - JCheckBox speakerFocusCB; |
---|
756 | | - JCheckBox debugCB; |
---|
757 | | - JCheckBox oeilCB; |
---|
758 | | - JCheckBox lookAtCB; |
---|
| 883 | + cCheckBox speakerCameraCB; |
---|
| 884 | + cCheckBox speakerFocusCB; |
---|
| 885 | + cCheckBox debugCB; |
---|
| 886 | + |
---|
| 887 | + cCheckBox oeilCB; |
---|
| 888 | + cCheckBox shadowCB; |
---|
| 889 | + cCheckBox autosaveCB; |
---|
| 890 | + cCheckBox lookAtCB; |
---|
759 | 891 | |
---|
760 | 892 | // static int COLOR = 1; |
---|
761 | 893 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
763 | 895 | |
---|
764 | 896 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
765 | 897 | |
---|
766 | | - JCheckBox colorCB; |
---|
767 | | - JCheckBox materialCB; |
---|
768 | | - JCheckBox textureCB; |
---|
| 898 | + cCheckBox colorCB; |
---|
| 899 | + cCheckBox materialCB; |
---|
| 900 | + cCheckBox textureCB; |
---|
769 | 901 | |
---|
770 | 902 | public void itemStateChanged(ItemEvent e) |
---|
771 | 903 | { |
---|
.. | .. |
---|
793 | 925 | } else if(e.getSource() == liveCB) |
---|
794 | 926 | { |
---|
795 | 927 | cameraView.ToggleLive(); |
---|
| 928 | + refreshContents(false); |
---|
796 | 929 | } |
---|
797 | 930 | else if(e.getSource() == supportCB) |
---|
798 | 931 | { |
---|
.. | .. |
---|
856 | 989 | else if(e.getSource() == oeilCB) |
---|
857 | 990 | { |
---|
858 | 991 | cameraView.ToggleOeil(); |
---|
| 992 | + } |
---|
| 993 | + else if(e.getSource() == shadowCB) |
---|
| 994 | + { |
---|
| 995 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 996 | + } |
---|
| 997 | + else if(e.getSource() == autosaveCB) |
---|
| 998 | + { |
---|
| 999 | + Globals.SAVEONMAKE ^= true; |
---|
859 | 1000 | } |
---|
860 | 1001 | else if(e.getSource() == lookAtCB) |
---|
861 | 1002 | { |
---|
.. | .. |
---|
1200 | 1341 | memoryItem.addActionListener(this); |
---|
1201 | 1342 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1202 | 1343 | analyzeItem.addActionListener(this); |
---|
1203 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1344 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1204 | 1345 | dumpItem.addActionListener(this); |
---|
1205 | 1346 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1206 | 1347 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1341 | 1482 | shadow.material = new cMaterial(obj.material); |
---|
1342 | 1483 | shadow.material.diffuse = 0.0001f; |
---|
1343 | 1484 | shadow.material.specular = 0.0001f; |
---|
| 1485 | + //shadow.projectedVertices[1].x = 300; |
---|
1344 | 1486 | |
---|
1345 | 1487 | makeSomething(shadow); |
---|
1346 | 1488 | } |
---|
.. | .. |
---|
1854 | 1996 | csg.addChild(child); |
---|
1855 | 1997 | child.addChild(csg); |
---|
1856 | 1998 | } else |
---|
1857 | | - |
---|
1858 | | - if (source == importGFDItem) |
---|
1859 | | - { |
---|
1860 | | - ImportGFD(); |
---|
1861 | | - } else |
---|
1862 | | - if (source == importVRMLX3DItem) |
---|
1863 | | - { |
---|
1864 | | - ImportVRMLX3D(); |
---|
1865 | | - } else |
---|
1866 | | - if (source == import3DSItem) |
---|
1867 | | - { |
---|
1868 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1869 | | - } else |
---|
1870 | | - if (source == importOBJItem) |
---|
1871 | | - { |
---|
1872 | | - //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1873 | | - FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
1874 | | - browser.setVisible(true); |
---|
1875 | | - String filename = browser.getFile(); |
---|
1876 | | - if (filename != null && filename.length() > 0) |
---|
1877 | | - { |
---|
1878 | | - String fullname = browser.getDirectory() + filename; |
---|
1879 | | - makeSomething(ReadOBJ(fullname), true); |
---|
1880 | | - } |
---|
1881 | | - } else |
---|
1882 | 1999 | if (source == computeAOItem) |
---|
1883 | 2000 | { |
---|
1884 | 2001 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1915 | 2032 | if (source == dumpItem) |
---|
1916 | 2033 | { |
---|
1917 | 2034 | DumpObject(); |
---|
| 2035 | + } else |
---|
| 2036 | + if (source == minButton) |
---|
| 2037 | + { |
---|
| 2038 | + Minimize(); |
---|
| 2039 | + } else |
---|
| 2040 | + if (source == maxButton) |
---|
| 2041 | + { |
---|
| 2042 | + Maximize(); |
---|
| 2043 | + } else |
---|
| 2044 | + if (source == fullButton) |
---|
| 2045 | + { |
---|
| 2046 | + ToggleFullScreen(); |
---|
| 2047 | + } else |
---|
| 2048 | + if (source == undoButton) |
---|
| 2049 | + { |
---|
| 2050 | + Undo(); |
---|
| 2051 | + } else |
---|
| 2052 | + if (source == redoButton) |
---|
| 2053 | + { |
---|
| 2054 | + Redo(); |
---|
| 2055 | + } else |
---|
| 2056 | + if (source == saveButton) |
---|
| 2057 | + { |
---|
| 2058 | + Save(); |
---|
1918 | 2059 | } else |
---|
1919 | 2060 | if (source == oneStepButton) |
---|
1920 | 2061 | { |
---|
.. | .. |
---|
1969 | 2110 | if (source == cutItem || source == clearButton) |
---|
1970 | 2111 | { |
---|
1971 | 2112 | loadClipboard(true); |
---|
| 2113 | + } else |
---|
| 2114 | + if (source == undoItem) |
---|
| 2115 | + { |
---|
| 2116 | + Undo(); |
---|
| 2117 | + } else |
---|
| 2118 | + if (source == redoItem) |
---|
| 2119 | + { |
---|
| 2120 | + Redo(); |
---|
1972 | 2121 | } else |
---|
1973 | 2122 | if (source == duplicateItem) |
---|
1974 | 2123 | { |
---|
.. | .. |
---|
2281 | 2430 | { |
---|
2282 | 2431 | RevertMeshes(); |
---|
2283 | 2432 | } else |
---|
2284 | | - if (source == resetMeshItem) |
---|
| 2433 | + if (source == resetAllItem) |
---|
2285 | 2434 | { |
---|
2286 | 2435 | ResetAll(); |
---|
2287 | 2436 | } else |
---|
.. | .. |
---|
2469 | 2618 | } else |
---|
2470 | 2619 | if (source == genNormalsMESHItem) |
---|
2471 | 2620 | { |
---|
2472 | | - GenNormals(true); // TODO |
---|
| 2621 | + GenNormalsMESH(); |
---|
2473 | 2622 | } else |
---|
2474 | 2623 | if (source == genNormalsORGANItem) |
---|
2475 | 2624 | { |
---|
.. | .. |
---|
2534 | 2683 | if (source == unmarkleavesItem) |
---|
2535 | 2684 | { |
---|
2536 | 2685 | MarkLeaves(false); |
---|
| 2686 | + } else |
---|
| 2687 | + if (source == rewindleavesItem) |
---|
| 2688 | + { |
---|
| 2689 | + RewindLeaves(true); |
---|
| 2690 | + } else |
---|
| 2691 | + if (source == unrewindleavesItem) |
---|
| 2692 | + { |
---|
| 2693 | + RewindLeaves(false); |
---|
| 2694 | + } else |
---|
| 2695 | + if (source == randomleavesItem) |
---|
| 2696 | + { |
---|
| 2697 | + RandomLeaves(true); |
---|
| 2698 | + } else |
---|
| 2699 | + if (source == unrandomleavesItem) |
---|
| 2700 | + { |
---|
| 2701 | + RandomLeaves(false); |
---|
2537 | 2702 | } else |
---|
2538 | 2703 | if (source == flipVItem) |
---|
2539 | 2704 | { |
---|
.. | .. |
---|
2801 | 2966 | bigThree.ClearUI(); |
---|
2802 | 2967 | bigThree.add(centralPanel); |
---|
2803 | 2968 | bigThree.FlushUI(); |
---|
| 2969 | + |
---|
| 2970 | + cameraView.requestFocusInWindow(); |
---|
| 2971 | + |
---|
| 2972 | +// refreshContents(true); |
---|
| 2973 | +// |
---|
| 2974 | +// try |
---|
| 2975 | +// { |
---|
| 2976 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2977 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2978 | +// bot.mouseMove(100, 100); |
---|
| 2979 | +// bot.mousePress(mask); |
---|
| 2980 | +// bot.mouseRelease(mask); |
---|
| 2981 | +// } |
---|
| 2982 | +// catch (Exception e) |
---|
| 2983 | +// { |
---|
| 2984 | +// |
---|
| 2985 | +// } |
---|
| 2986 | + |
---|
2804 | 2987 | } else |
---|
2805 | 2988 | if (source == threeButton) |
---|
2806 | 2989 | { |
---|
.. | .. |
---|
2837 | 3020 | bigThree.add(centralPanel); |
---|
2838 | 3021 | bigThree.add(XYZPanel); |
---|
2839 | 3022 | bigThree.FlushUI(); |
---|
| 3023 | + |
---|
| 3024 | + cameraView.requestFocusInWindow(); |
---|
2840 | 3025 | } else |
---|
2841 | 3026 | if (source == fourButton) |
---|
2842 | 3027 | { |
---|
.. | .. |
---|
2872 | 3057 | bigThree.ClearUI(); |
---|
2873 | 3058 | bigThree.add(scenePanel); |
---|
2874 | 3059 | bigThree.FlushUI(); |
---|
| 3060 | + |
---|
| 3061 | + cameraView.requestFocusInWindow(); |
---|
2875 | 3062 | } else |
---|
2876 | 3063 | if (source == sixButton) |
---|
2877 | 3064 | { |
---|
.. | .. |
---|
2908 | 3095 | bigThree.add(scenePanel); |
---|
2909 | 3096 | bigThree.add(centralPanel); |
---|
2910 | 3097 | bigThree.FlushUI(); |
---|
| 3098 | + |
---|
| 3099 | + cameraView.requestFocusInWindow(); |
---|
2911 | 3100 | } else |
---|
2912 | 3101 | if (source == sevenButton) |
---|
2913 | 3102 | { |
---|
.. | .. |
---|
2945 | 3134 | bigThree.add(centralPanel); |
---|
2946 | 3135 | bigThree.add(XYZPanel); |
---|
2947 | 3136 | bigThree.FlushUI(); |
---|
| 3137 | + |
---|
| 3138 | + cameraView.requestFocusInWindow(); |
---|
2948 | 3139 | } else |
---|
2949 | 3140 | if (source == rootButton) |
---|
2950 | 3141 | { |
---|
.. | .. |
---|
2956 | 3147 | EditObject(obj); |
---|
2957 | 3148 | } |
---|
2958 | 3149 | |
---|
| 3150 | + cameraView.requestFocusInWindow(); |
---|
2959 | 3151 | refreshContents(true); |
---|
2960 | 3152 | } else |
---|
2961 | 3153 | if (source == closeButton) |
---|
.. | .. |
---|
2965 | 3157 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2966 | 3158 | { |
---|
2967 | 3159 | ab = (cRadio)e.nextElement(); |
---|
2968 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3160 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2969 | 3161 | { |
---|
| 3162 | + // Patch to avoid bug with transparency. |
---|
| 3163 | + if (!ab.hadMaterial) |
---|
| 3164 | + { |
---|
| 3165 | + ab.object.material = null; |
---|
| 3166 | + } |
---|
| 3167 | + |
---|
2970 | 3168 | buttonGroup.remove(ab); |
---|
2971 | 3169 | radioPanel.remove(ab); |
---|
2972 | 3170 | |
---|
2973 | | - ab.GetObject().editWindow = null; |
---|
| 3171 | + //ab.GetObject().editWindow = null; |
---|
| 3172 | + ab.GetObject().manipWindow = null; |
---|
2974 | 3173 | // ab.GetObject().objectUI = null; // ????????? |
---|
2975 | 3174 | |
---|
2976 | 3175 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2977 | 3176 | break; |
---|
2978 | 3177 | } |
---|
2979 | 3178 | } |
---|
| 3179 | + |
---|
| 3180 | + cameraView.requestFocusInWindow(); |
---|
2980 | 3181 | refreshContents(true); |
---|
2981 | 3182 | } else |
---|
2982 | 3183 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
2993 | 3194 | child.CloseUI(); |
---|
2994 | 3195 | listUI.remove(child); |
---|
2995 | 3196 | |
---|
2996 | | - child.editWindow = null; // ??????????? |
---|
| 3197 | + //child.editWindow = null; // ??????????? |
---|
2997 | 3198 | } |
---|
2998 | 3199 | objEditor.ctrlPanel.FlushUI(); |
---|
2999 | 3200 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3079 | 3280 | frontView.object = group; |
---|
3080 | 3281 | sideView.object = group; |
---|
3081 | 3282 | } |
---|
3082 | | - group.editWindow = this; |
---|
| 3283 | + |
---|
| 3284 | +// fix "+" issue |
---|
| 3285 | + //group.editWindow = this; |
---|
| 3286 | + group.manipWindow = this; |
---|
| 3287 | + |
---|
3083 | 3288 | /* |
---|
3084 | 3289 | currentLayout = radio.layout; |
---|
3085 | 3290 | if (currentLayout == null) |
---|
.. | .. |
---|
3091 | 3296 | //group.parent = null; // ROOT |
---|
3092 | 3297 | //group.attributes = -1; |
---|
3093 | 3298 | ResetModel(); |
---|
| 3299 | + |
---|
| 3300 | + cameraView.requestFocusInWindow(); |
---|
3094 | 3301 | refreshContents(true); |
---|
3095 | | - } |
---|
| 3302 | + } else if (event.getSource() == editCameraItem) |
---|
| 3303 | + { |
---|
| 3304 | + cameraView.ProtectCamera(); |
---|
| 3305 | + cameraView.repaint(); |
---|
| 3306 | + return; |
---|
| 3307 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3308 | + { |
---|
| 3309 | + cameraView.RevertCamera(); |
---|
| 3310 | + cameraView.repaint(); |
---|
| 3311 | + return; |
---|
| 3312 | + // } else if (event.getSource() == textureButton) |
---|
| 3313 | + // { |
---|
| 3314 | + // return; // true; |
---|
| 3315 | + } |
---|
3096 | 3316 | else |
---|
3097 | 3317 | { |
---|
3098 | 3318 | //return super.action(event, arg); |
---|
.. | .. |
---|
3101 | 3321 | } |
---|
3102 | 3322 | |
---|
3103 | 3323 | boolean useclient = false; |
---|
3104 | | - cRadio radio; |
---|
3105 | 3324 | |
---|
3106 | 3325 | void ToggleRoot() |
---|
3107 | 3326 | { |
---|
.. | .. |
---|
3340 | 3559 | |
---|
3341 | 3560 | int size = obj.MemorySize(); |
---|
3342 | 3561 | |
---|
3343 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3562 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3563 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3344 | 3564 | } |
---|
3345 | 3565 | } |
---|
3346 | 3566 | catch (Exception e) |
---|
.. | .. |
---|
3421 | 3641 | void GenNormals(boolean crease) |
---|
3422 | 3642 | { |
---|
3423 | 3643 | group.GenNormalsS(crease); |
---|
| 3644 | + |
---|
| 3645 | + refreshContents(); |
---|
| 3646 | + } |
---|
| 3647 | + |
---|
| 3648 | + void GenNormalsMESH() |
---|
| 3649 | + { |
---|
| 3650 | + group.GenNormalsMeshS(); |
---|
3424 | 3651 | |
---|
3425 | 3652 | refreshContents(); |
---|
3426 | 3653 | } |
---|
.. | .. |
---|
3652 | 3879 | String pigment = Object3D.GetPigment(tex); |
---|
3653 | 3880 | //String bump = Object3D.GetBump(tex); |
---|
3654 | 3881 | |
---|
3655 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3882 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3883 | + |
---|
| 3884 | + try |
---|
| 3885 | + { |
---|
| 3886 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3887 | + } |
---|
| 3888 | + catch (Exception e) |
---|
| 3889 | + { |
---|
| 3890 | + System.err.println("FAIL: " + node); |
---|
| 3891 | + } |
---|
3656 | 3892 | |
---|
3657 | 3893 | double s = v.s; |
---|
3658 | 3894 | |
---|
.. | .. |
---|
4039 | 4275 | refreshContents(); |
---|
4040 | 4276 | } |
---|
4041 | 4277 | |
---|
| 4278 | + void RewindLeaves(boolean hide) |
---|
| 4279 | + { |
---|
| 4280 | + group.selection.RewindLeaves(hide); |
---|
| 4281 | + refreshContents(); |
---|
| 4282 | + } |
---|
| 4283 | + |
---|
| 4284 | + void RandomLeaves(boolean hide) |
---|
| 4285 | + { |
---|
| 4286 | + group.selection.RandomLeaves(hide); |
---|
| 4287 | + refreshContents(); |
---|
| 4288 | + } |
---|
| 4289 | + |
---|
4042 | 4290 | void SetTexRes(int tr) |
---|
4043 | 4291 | { |
---|
4044 | 4292 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4124 | 4372 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4125 | 4373 | |
---|
4126 | 4374 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4127 | | - if(elem != group) |
---|
| 4375 | + if(elem != group || !newWindow) |
---|
4128 | 4376 | { |
---|
4129 | 4377 | // if (!(elem instanceof Composite)) |
---|
4130 | 4378 | // newWindow = false; |
---|
.. | .. |
---|
4214 | 4462 | //case 702: // Event.LIST_DESELECT |
---|
4215 | 4463 | group.deselectAll(); |
---|
4216 | 4464 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4217 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4218 | 4465 | if (tps != null) |
---|
4219 | 4466 | { |
---|
4220 | 4467 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4223 | 4470 | |
---|
4224 | 4471 | //if (child.parent != null) |
---|
4225 | 4472 | //child.parent.addSelectee(child); |
---|
| 4473 | + objEditor.SetMaterial(child); |
---|
4226 | 4474 | group.addSelectee(child); |
---|
4227 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4228 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4229 | | - System.err.println("info : " + child.GetPath()); |
---|
4230 | 4475 | } |
---|
4231 | 4476 | } |
---|
4232 | 4477 | // else |
---|
.. | .. |
---|
4236 | 4481 | // System.err.println("info : " + group.GetPath()); |
---|
4237 | 4482 | // } |
---|
4238 | 4483 | |
---|
4239 | | - objEditor.SetText(); // jan 2014 |
---|
4240 | | - |
---|
4241 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4484 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4242 | 4485 | CameraPane.flash = true; |
---|
4243 | 4486 | |
---|
4244 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4487 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4245 | 4488 | // a camera |
---|
4246 | 4489 | { |
---|
4247 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4248 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4490 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4491 | + { |
---|
| 4492 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4493 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4494 | + } |
---|
4249 | 4495 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4250 | 4496 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4251 | 4497 | } |
---|
.. | .. |
---|
4258 | 4504 | |
---|
4259 | 4505 | freezemodel = false; |
---|
4260 | 4506 | } |
---|
| 4507 | + |
---|
| 4508 | + void refreshContents(boolean cp) |
---|
| 4509 | + { |
---|
| 4510 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4511 | + { |
---|
| 4512 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4513 | + |
---|
| 4514 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4515 | + { |
---|
| 4516 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4517 | + |
---|
| 4518 | + objEditor.AddInfo(child, this, true); |
---|
| 4519 | + System.err.println("info : " + child.GetPath()); |
---|
| 4520 | + } |
---|
| 4521 | + |
---|
| 4522 | + objEditor.SetText(); // jan 2014 |
---|
| 4523 | + } |
---|
| 4524 | + |
---|
| 4525 | + super.refreshContents(cp); |
---|
| 4526 | + } |
---|
4261 | 4527 | |
---|
4262 | 4528 | void linkSomething(Object3D thing) |
---|
4263 | 4529 | { |
---|
.. | .. |
---|
4329 | 4595 | { |
---|
4330 | 4596 | if (group.selection.isEmpty()) |
---|
4331 | 4597 | return; |
---|
| 4598 | + |
---|
4332 | 4599 | Grafreed.clipboardIsTempGroup = false; |
---|
4333 | 4600 | Composite tGroup = null; |
---|
4334 | 4601 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4339 | 4606 | |
---|
4340 | 4607 | if (cut) |
---|
4341 | 4608 | { |
---|
| 4609 | + if (Globals.SAVEONMAKE) |
---|
| 4610 | + Save(); |
---|
4342 | 4611 | //int indices[] = jList.getSelectedIndices(); |
---|
4343 | 4612 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4344 | 4613 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4428 | 4697 | } |
---|
4429 | 4698 | |
---|
4430 | 4699 | } |
---|
| 4700 | + |
---|
4431 | 4701 | if (Grafreed.clipboardIsTempGroup) |
---|
4432 | 4702 | Grafreed.clipboard = tGroup; |
---|
| 4703 | + |
---|
4433 | 4704 | if (cut) |
---|
4434 | 4705 | { |
---|
4435 | 4706 | ResetModel(); |
---|
.. | .. |
---|
4961 | 5232 | } |
---|
4962 | 5233 | */ |
---|
4963 | 5234 | |
---|
4964 | | - void ImportGFD() |
---|
4965 | | - { |
---|
4966 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4967 | | - browser.show(); |
---|
4968 | | - String filename = browser.getFile(); |
---|
4969 | | - if (filename != null && filename.length() > 0) |
---|
4970 | | - { |
---|
4971 | | - String fullname = browser.getDirectory() + filename; |
---|
4972 | | - |
---|
4973 | | - //Object3D readobj = |
---|
4974 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4975 | | - //makeSomething(readobj); |
---|
4976 | | - } |
---|
4977 | | - } |
---|
4978 | | - |
---|
4979 | 5235 | /* |
---|
4980 | 5236 | public void Callback(Object obj) |
---|
4981 | 5237 | { |
---|
.. | .. |
---|
4999 | 5255 | } |
---|
5000 | 5256 | */ |
---|
5001 | 5257 | |
---|
5002 | | - void ImportVRMLX3D() |
---|
5003 | | - { |
---|
5004 | | - if (Grafreed.standAlone) |
---|
5005 | | - { |
---|
5006 | | - /**/ |
---|
5007 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
5008 | | - browser.show(); |
---|
5009 | | - String filename = browser.getFile(); |
---|
5010 | | - if (filename != null && filename.length() > 0) |
---|
5011 | | - { |
---|
5012 | | - String fullname = browser.getDirectory() + filename; |
---|
5013 | | - LoadVRMLX3D(fullname); |
---|
5014 | | - } |
---|
5015 | | - /**/ |
---|
5016 | | - } |
---|
5017 | | - } |
---|
5018 | | - |
---|
5019 | 5258 | String GetFile(String dialogName) |
---|
5020 | 5259 | { |
---|
5021 | 5260 | if (Grafreed.standAlone) |
---|
.. | .. |
---|
5086 | 5325 | cButton clearpanelButton; |
---|
5087 | 5326 | cButton unselectButton; |
---|
5088 | 5327 | |
---|
| 5328 | + cButton minButton; |
---|
| 5329 | + cButton maxButton; |
---|
| 5330 | + cButton fullButton; |
---|
| 5331 | + cButton undoButton; |
---|
| 5332 | + cButton redoButton; |
---|
| 5333 | + cButton saveButton; |
---|
5089 | 5334 | cButton oneStepButton; |
---|
5090 | 5335 | |
---|
5091 | 5336 | cButton screenfitButton; |
---|
.. | .. |
---|
5099 | 5344 | |
---|
5100 | 5345 | cButton setsupportButton; |
---|
5101 | 5346 | |
---|
5102 | | - cButton twoButton; |
---|
5103 | | - cButton sixButton; |
---|
5104 | | - cButton threeButton; |
---|
5105 | | - cButton sevenButton; |
---|
5106 | | - cButton fourButton; // full panel |
---|
5107 | | - cButton oneButton; // full XYZ |
---|
5108 | | - //cButton currentLayout; |
---|
5109 | | - |
---|
5110 | 5347 | // |
---|
5111 | 5348 | //Composite |
---|
5112 | 5349 | Object3D // to do !! |
---|
.. | .. |
---|
5118 | 5355 | private MenuItem lookFromItem; |
---|
5119 | 5356 | private MenuItem switchItem; |
---|
5120 | 5357 | private MenuItem cutItem; |
---|
| 5358 | + private MenuItem undoItem; |
---|
| 5359 | + private MenuItem redoItem; |
---|
5121 | 5360 | private MenuItem duplicateItem; |
---|
5122 | 5361 | private MenuItem cloneItem; |
---|
5123 | 5362 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5131 | 5370 | private MenuItem linkverticesItem; |
---|
5132 | 5371 | private MenuItem relinkverticesItem; |
---|
5133 | 5372 | private MenuItem setMasterItem; |
---|
5134 | | - private MenuItem resetMeshItem; |
---|
| 5373 | + private MenuItem resetAllItem; |
---|
5135 | 5374 | private MenuItem stepAllItem; |
---|
5136 | 5375 | private MenuItem revertMeshItem; |
---|
5137 | 5376 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5181 | 5420 | private MenuItem showleavesItem; |
---|
5182 | 5421 | private MenuItem markleavesItem; |
---|
5183 | 5422 | private MenuItem unmarkleavesItem; |
---|
| 5423 | + private MenuItem rewindleavesItem; |
---|
| 5424 | + private MenuItem unrewindleavesItem; |
---|
| 5425 | + private MenuItem randomleavesItem; |
---|
| 5426 | + private MenuItem unrandomleavesItem; |
---|
5184 | 5427 | |
---|
5185 | 5428 | private MenuItem flipVItem; |
---|
5186 | 5429 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5264 | 5507 | private MenuItem doubleItem; |
---|
5265 | 5508 | private MenuItem tripleItem; |
---|
5266 | 5509 | |
---|
5267 | | - private MenuItem importGFDItem; |
---|
5268 | | - private MenuItem importVRMLX3DItem; |
---|
5269 | | - private MenuItem import3DSItem; |
---|
5270 | | - private MenuItem importOBJItem; |
---|
5271 | | - |
---|
5272 | 5510 | private MenuItem computeAOItem; |
---|
5273 | 5511 | private MenuItem recompileItem; |
---|
5274 | 5512 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5278 | 5516 | private MenuItem analyzeItem; |
---|
5279 | 5517 | private MenuItem dumpItem; |
---|
5280 | 5518 | //boolean freezemodel = false; |
---|
| 5519 | + |
---|
| 5520 | + Menu cameraMenu; |
---|
| 5521 | + MenuItem editCameraItem; |
---|
| 5522 | + MenuItem revertCameraItem; |
---|
5281 | 5523 | } |
---|