.. | .. |
---|
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 | | - |
---|
| 153 | + oe.jTree = new cTree(); |
---|
| 154 | + |
---|
168 | 155 | Menu menu; |
---|
169 | 156 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 157 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 158 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 159 | + |
---|
| 160 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 161 | +// undoItem.addActionListener(this); |
---|
| 162 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 163 | +// redoItem.addActionListener(this); |
---|
| 164 | +// menu.add("-"); |
---|
| 165 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 166 | duplicateItem.addActionListener(this); |
---|
174 | 167 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
175 | 168 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
185 | 178 | copyItem.addActionListener(this); |
---|
186 | 179 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 180 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 181 | |
---|
190 | 182 | menu.add("-"); |
---|
191 | 183 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
206 | 198 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 199 | clearAllItem.addActionListener(this); |
---|
208 | 200 | } |
---|
| 201 | + |
---|
| 202 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 203 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 204 | + //zBufferItem.addActionListener(this); |
---|
| 205 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 206 | + //normalLensItem.addActionListener(this); |
---|
| 207 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 208 | + restoreCameraItem.addActionListener(this); |
---|
| 209 | + |
---|
| 210 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 211 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 212 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 213 | +// cameraMenu.add("-"); |
---|
| 214 | +// |
---|
| 215 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 216 | +// toggleTextureItem.addItemListener(this); |
---|
| 217 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 218 | +// |
---|
| 219 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 220 | +// toggleSwitchItem.addItemListener(this); |
---|
| 221 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 222 | + |
---|
| 223 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 224 | + toggleHandleItem.addItemListener(this); |
---|
| 225 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 226 | + |
---|
| 227 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 228 | + togglePaintItem.addItemListener(this); |
---|
| 229 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 230 | + |
---|
| 231 | + if (Globals.ADVANCED) |
---|
| 232 | + { |
---|
| 233 | + cameraMenu.add("-"); |
---|
| 234 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 235 | + toggleLiveItem.addItemListener(this); |
---|
| 236 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 237 | |
---|
| 238 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 239 | + stepItem.addActionListener(this); |
---|
| 240 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 241 | + // toggleDLItem.addItemListener(this); |
---|
| 242 | + // toggleDLItem.setState(false); |
---|
| 243 | + |
---|
| 244 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 245 | + toggleRenderItem.addItemListener(this); |
---|
| 246 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 247 | + |
---|
| 248 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 249 | + toggleDebugItem.addItemListener(this); |
---|
| 250 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 251 | + |
---|
| 252 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 253 | + toggleFrustumItem.addItemListener(this); |
---|
| 254 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 255 | + |
---|
| 256 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 257 | + toggleFootContactItem.addItemListener(this); |
---|
| 258 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 259 | + |
---|
| 260 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 261 | + toggleTimelineItem.addItemListener(this); |
---|
| 262 | + } |
---|
| 263 | + |
---|
| 264 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 265 | +// toggleRootItem.addItemListener(this); |
---|
| 266 | +// toggleRootItem.setState(false); |
---|
| 267 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 268 | +// animationItem.addItemListener(this); |
---|
| 269 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 270 | + cameraMenu.add("-"); |
---|
| 271 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 272 | + editCameraItem.addActionListener(this); |
---|
| 273 | + |
---|
| 274 | + if (Globals.ADVANCED) |
---|
| 275 | + { |
---|
| 276 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 277 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 278 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 279 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 280 | + oe.cameraMenu.add("-"); |
---|
| 281 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 282 | + openWindowItem.addActionListener(this); |
---|
| 283 | + editLeafItem.addActionListener(this); |
---|
| 284 | + lookAtItem.addActionListener(this); |
---|
| 285 | + //lookFromItem.addActinoListener(this); |
---|
| 286 | + //switchViewItem.addActionListener(this); |
---|
| 287 | + } |
---|
| 288 | + |
---|
210 | 289 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 290 | if (Globals.ADVANCED) |
---|
212 | 291 | { |
---|
.. | .. |
---|
249 | 328 | } |
---|
250 | 329 | |
---|
251 | 330 | oe.menuBar.add(menu = new Menu("Group")); |
---|
252 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
253 | | - grabItem.addActionListener(this); |
---|
| 331 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 332 | +// grabItem.addActionListener(this); |
---|
254 | 333 | backItem = menu.add(new MenuItem("Back")); |
---|
255 | 334 | backItem.addActionListener(this); |
---|
256 | 335 | frontItem = menu.add(new MenuItem("Front")); |
---|
257 | 336 | frontItem.addActionListener(this); |
---|
258 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
259 | | - compositeItem.addActionListener(this); |
---|
| 337 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 338 | +// compositeItem.addActionListener(this); |
---|
| 339 | + |
---|
| 340 | + if (Globals.ADVANCED) |
---|
| 341 | + { |
---|
260 | 342 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
261 | 343 | hideItem.addActionListener(this); |
---|
| 344 | + } |
---|
262 | 345 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
263 | 346 | ungroupItem.addActionListener(this); |
---|
264 | | - menu.add("-"); |
---|
265 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
266 | | - randomItem.addActionListener(this); |
---|
| 347 | + |
---|
| 348 | +// menu.add("-"); |
---|
| 349 | +// |
---|
| 350 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 351 | +// switchItem.addActionListener(this); |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
267 | 354 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
268 | 355 | switchGeoItem.addActionListener(this); |
---|
269 | 356 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
271 | 358 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
272 | 359 | morphItem.addActionListener(this); |
---|
273 | 360 | |
---|
274 | | - if (Globals.ADVANCED) |
---|
275 | | - { |
---|
276 | 361 | menu.add("-"); |
---|
277 | 362 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
278 | 363 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
280 | 365 | frameselectorItem.addActionListener(this); |
---|
281 | 366 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
282 | 367 | scriptNodeItem.addActionListener(this); |
---|
283 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
284 | | - cameraItem.addActionListener(this); |
---|
285 | 368 | } |
---|
286 | 369 | |
---|
287 | 370 | oe.menuBar.add(menu = new Menu("Object")); |
---|
288 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
289 | | - textureItem.addActionListener(this); |
---|
| 371 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 372 | +// textureItem.addActionListener(this); |
---|
290 | 373 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
291 | 374 | billboardItem.addActionListener(this); |
---|
292 | 375 | csgItem = menu.add(new MenuItem("CSG")); |
---|
293 | 376 | csgItem.addActionListener(this); |
---|
294 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 377 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
295 | 378 | shadowXItem.addActionListener(this); |
---|
296 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 379 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
297 | 380 | shadowYItem.addActionListener(this); |
---|
298 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 381 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
299 | 382 | shadowZItem.addActionListener(this); |
---|
300 | 383 | if (Globals.ADVANCED) |
---|
301 | 384 | { |
---|
.. | .. |
---|
392 | 475 | markleavesItem.addActionListener(this); |
---|
393 | 476 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
394 | 477 | unmarkleavesItem.addActionListener(this); |
---|
| 478 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 479 | + rewindleavesItem.addActionListener(this); |
---|
| 480 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 481 | + unrewindleavesItem.addActionListener(this); |
---|
| 482 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 483 | + randomleavesItem.addActionListener(this); |
---|
| 484 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 485 | + unrandomleavesItem.addActionListener(this); |
---|
395 | 486 | menu.add("-"); |
---|
396 | 487 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
397 | 488 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
443 | 534 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
444 | 535 | buildCreateMenu(menu); |
---|
445 | 536 | |
---|
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 | 537 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
460 | 538 | buildToolsMenu(menu); |
---|
461 | 539 | } |
---|
462 | 540 | |
---|
463 | 541 | void SetupUI2(ObjEditor oe) |
---|
464 | 542 | { |
---|
| 543 | + // June 2019 |
---|
| 544 | + if (oe == null) |
---|
| 545 | + { |
---|
| 546 | + //super.SetupUI2(this); |
---|
| 547 | + //return; |
---|
| 548 | + } |
---|
| 549 | + |
---|
| 550 | + if (copy != group) |
---|
| 551 | + { |
---|
| 552 | + //super.SetupUI2(this); |
---|
| 553 | + } |
---|
| 554 | + |
---|
465 | 555 | //new Exception().printStackTrace(); |
---|
466 | 556 | |
---|
467 | 557 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
490 | 580 | oe.radioPanel.add(dummyButton); |
---|
491 | 581 | oe.buttonGroup.add(dummyButton); |
---|
492 | 582 | */ |
---|
| 583 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 584 | + |
---|
| 585 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 586 | + |
---|
493 | 587 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
494 | 588 | |
---|
495 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 589 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 590 | + //minButton.setToolTipText("Minimize window"); |
---|
| 591 | + //minButton.addActionListener(this); |
---|
| 592 | + |
---|
| 593 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 594 | + maxButton.setToolTipText("Maximize window"); |
---|
| 595 | + maxButton.addActionListener(this); |
---|
| 596 | + |
---|
| 597 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 598 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 599 | + fullButton.addActionListener(this); |
---|
| 600 | + |
---|
| 601 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 602 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 603 | + restoreCameraButton.addActionListener(this); |
---|
| 604 | + |
---|
| 605 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 606 | + undoButton.setToolTipText("Undo changes"); |
---|
| 607 | + undoButton.addActionListener(this); |
---|
| 608 | + |
---|
| 609 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 610 | + redoButton.setToolTipText("Redo changes"); |
---|
| 611 | + redoButton.addActionListener(this); |
---|
| 612 | + |
---|
| 613 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 614 | + saveButton.setToolTipText("Save changes"); |
---|
| 615 | + saveButton.addActionListener(this); |
---|
| 616 | + |
---|
| 617 | + copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
496 | 618 | liveCB.setToolTipText("Enable animation"); |
---|
497 | 619 | liveCB.addItemListener(this); |
---|
498 | 620 | |
---|
499 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 621 | + copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
500 | 622 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
501 | 623 | oneStepButton.addActionListener(this); |
---|
502 | 624 | |
---|
503 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 625 | + copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
504 | 626 | fastCB.setToolTipText("Fast mode"); |
---|
505 | 627 | fastCB.addItemListener(this); |
---|
506 | 628 | |
---|
507 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
508 | | - trackCB.setToolTipText("Enable tracking"); |
---|
509 | | - trackCB.addItemListener(this); |
---|
510 | | - |
---|
511 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + //oe.toolboxPanel.Return(); |
---|
| 630 | + |
---|
| 631 | + copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
512 | 632 | screenfitButton.setToolTipText("Screen fit"); |
---|
513 | 633 | screenfitButton.addActionListener(this); |
---|
| 634 | + |
---|
| 635 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 636 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 637 | +// trackCB.addItemListener(this); |
---|
514 | 638 | |
---|
515 | 639 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
516 | 640 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
522 | 646 | snapobjectButton.setToolTipText("Snap Object"); |
---|
523 | 647 | } |
---|
524 | 648 | |
---|
525 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
526 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
527 | | - flashSelectionButton.addActionListener(this); |
---|
| 649 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
528 | 650 | |
---|
529 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
530 | | - |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
532 | 652 | twoButton.setToolTipText("Show center view only"); |
---|
533 | 653 | twoButton.addActionListener(this); |
---|
534 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + this.fullscreenLayout = twoButton; |
---|
| 655 | + |
---|
| 656 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
535 | 657 | fourButton.addActionListener(this); |
---|
536 | 658 | fourButton.setToolTipText("Show left panel only"); |
---|
537 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 659 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
538 | 660 | sixButton.setToolTipText("2-column layout left"); |
---|
539 | 661 | sixButton.addActionListener(this); |
---|
540 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
541 | 663 | threeButton.setToolTipText("2-column layout right"); |
---|
542 | 664 | threeButton.addActionListener(this); |
---|
543 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 665 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | 666 | sevenButton.setToolTipText("3-column layout"); |
---|
545 | 667 | sevenButton.addActionListener(this); |
---|
546 | 668 | // |
---|
547 | 669 | |
---|
548 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
549 | 671 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
550 | 672 | rootButton.addActionListener(this); |
---|
551 | 673 | |
---|
552 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 674 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
553 | 675 | closeButton.setToolTipText("Close tab"); |
---|
554 | 676 | closeButton.addActionListener(this); |
---|
555 | 677 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
556 | 678 | //clearButton.addActionListener(this); |
---|
557 | | - |
---|
558 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 679 | + |
---|
| 680 | + // INSERT |
---|
| 681 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + gridButton.setToolTipText("Create grid"); |
---|
| 683 | + gridButton.addActionListener(this); |
---|
| 684 | + |
---|
| 685 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 686 | + boxButton.setToolTipText("Create box"); |
---|
| 687 | + boxButton.addActionListener(this); |
---|
| 688 | + |
---|
| 689 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 690 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 691 | + sphereButton.addActionListener(this); |
---|
| 692 | + |
---|
| 693 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 694 | + coneButton.setToolTipText("Create cone"); |
---|
| 695 | + coneButton.addActionListener(this); |
---|
| 696 | + |
---|
| 697 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 698 | + torusButton.setToolTipText("Create torus"); |
---|
| 699 | + torusButton.addActionListener(this); |
---|
| 700 | + |
---|
| 701 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 702 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 703 | + superButton.addActionListener(this); |
---|
| 704 | + |
---|
| 705 | + if (Globals.ADVANCED) |
---|
| 706 | + { |
---|
| 707 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 709 | + kleinButton.addActionListener(this); |
---|
| 710 | + } |
---|
559 | 711 | |
---|
560 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 712 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 714 | + particlesButton.addActionListener(this); |
---|
| 715 | + |
---|
| 716 | + oe.toolboxPanel.Return(); |
---|
| 717 | + |
---|
| 718 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + groupButton.setToolTipText("Create group"); |
---|
| 720 | + groupButton.addActionListener(this); |
---|
| 721 | + |
---|
| 722 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 723 | + compositeButton.setToolTipText("Create composite"); |
---|
| 724 | + compositeButton.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + switchButton.setToolTipText("Create switch"); |
---|
| 728 | + switchButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 731 | + loopButton.setToolTipText("Create loop"); |
---|
| 732 | + loopButton.addActionListener(this); |
---|
| 733 | + |
---|
| 734 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 735 | + textureButton.setToolTipText("Create texture"); |
---|
| 736 | + textureButton.addActionListener(this); |
---|
| 737 | + |
---|
| 738 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 739 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 740 | + overlayButton.addActionListener(this); |
---|
| 741 | + |
---|
| 742 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 743 | + lightButton.setToolTipText("Create light"); |
---|
| 744 | + lightButton.addActionListener(this); |
---|
| 745 | + |
---|
| 746 | + // EDIT panel |
---|
| 747 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
561 | 748 | editButton.setToolTipText("Edit selection"); |
---|
562 | 749 | editButton.addActionListener(this); |
---|
563 | 750 | |
---|
564 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 751 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | 752 | uneditButton.setToolTipText("Unedit selection"); |
---|
566 | 753 | uneditButton.addActionListener(this); |
---|
567 | 754 | |
---|
568 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 755 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
569 | 756 | allParamsButton.setToolTipText("Edit all params"); |
---|
570 | 757 | allParamsButton.addActionListener(this); |
---|
571 | 758 | |
---|
572 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 759 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
573 | 760 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
574 | 761 | clearPanelButton.addActionListener(this); |
---|
575 | 762 | |
---|
576 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 763 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 764 | unselectButton.setToolTipText("Unselect"); |
---|
578 | 765 | unselectButton.addActionListener(this); |
---|
579 | 766 | |
---|
580 | | - commandsPanel.preferredHeight = 1; |
---|
| 767 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 769 | + flashSelectionButton.addActionListener(this); |
---|
581 | 770 | |
---|
582 | | - oe.treePanel.add(commandsPanel); |
---|
583 | | - oe.treePanel.Return(); |
---|
| 771 | + editCommandsPanel.preferredHeight = 1; |
---|
| 772 | + |
---|
| 773 | +// oe.treePanel.add(commandsPanel); |
---|
| 774 | +// oe.treePanel.Return(); |
---|
584 | 775 | |
---|
585 | 776 | // oe.aConstraints.gridx += 1; |
---|
586 | 777 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
597 | 788 | |
---|
598 | 789 | JScrollPane jSP; |
---|
599 | 790 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
600 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 791 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
601 | 792 | ResetModel(); |
---|
602 | 793 | |
---|
603 | 794 | oe.treePanel.add(jSPPanel); |
---|
604 | 795 | oe.treePanel.Return(); |
---|
605 | 796 | |
---|
606 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
607 | | - |
---|
608 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
609 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
610 | | - colorCB.addItemListener(this); |
---|
611 | | - |
---|
612 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
613 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
614 | | - materialCB.addItemListener(this); |
---|
615 | | - |
---|
616 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
617 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
618 | | - textureCB.addItemListener(this); |
---|
619 | | - |
---|
620 | | - copyOptionsPanel.preferredHeight = 1; |
---|
621 | 797 | oe.treePanel.add(copyOptionsPanel); |
---|
622 | 798 | oe.treePanel.Return(); |
---|
623 | 799 | |
---|
.. | .. |
---|
648 | 824 | |
---|
649 | 825 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
650 | 826 | { |
---|
| 827 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 828 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 829 | + colorCB.addItemListener(this); |
---|
| 830 | + |
---|
| 831 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 832 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 833 | + materialCB.addItemListener(this); |
---|
| 834 | + |
---|
| 835 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 836 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 837 | + textureCB.addItemListener(this); |
---|
| 838 | + |
---|
| 839 | + panel.Return(); |
---|
| 840 | + |
---|
651 | 841 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
652 | 842 | boxCB.setToolTipText("Display bounding boxes"); |
---|
653 | 843 | boxCB.addItemListener(this); |
---|
.. | .. |
---|
665 | 855 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
666 | 856 | // localCB.addItemListener(this); |
---|
667 | 857 | |
---|
| 858 | + panel.Return(); |
---|
| 859 | + |
---|
668 | 860 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
669 | 861 | crowdCB.setToolTipText("Used for crowds"); |
---|
670 | 862 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
681 | 873 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
682 | 874 | // speakerMocapCB.addItemListener(this); |
---|
683 | 875 | |
---|
| 876 | + panel.Return(); |
---|
| 877 | + |
---|
684 | 878 | if (false) |
---|
685 | 879 | { |
---|
686 | 880 | // handled in scripts |
---|
.. | .. |
---|
695 | 889 | //constraints.gridy += 1; |
---|
696 | 890 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
697 | 891 | smoothfocusCB.addItemListener(this); |
---|
| 892 | + panel.Return(); |
---|
698 | 893 | } |
---|
699 | 894 | |
---|
700 | 895 | //constraints.gridx += 1; |
---|
701 | 896 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
702 | 897 | // debugCB.addItemListener(this); |
---|
703 | 898 | |
---|
| 899 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 900 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 901 | + trackCB.addItemListener(this); |
---|
| 902 | + |
---|
704 | 903 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 904 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
705 | 905 | oeilCB.addItemListener(this); |
---|
706 | 906 | |
---|
| 907 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 908 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 909 | + shadowCB.addItemListener(this); |
---|
| 910 | + |
---|
| 911 | + panel.Return(); |
---|
| 912 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 913 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 914 | + toggleTextureCB.addItemListener(this); |
---|
| 915 | + |
---|
| 916 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 917 | + toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 918 | + toggleSwitchCB.addItemListener(this); |
---|
| 919 | + |
---|
| 920 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 921 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 922 | + autosaveCB.addItemListener(this); |
---|
| 923 | + |
---|
| 924 | + panel.Return(); |
---|
| 925 | + if (Globals.ADVANCED) |
---|
| 926 | + { |
---|
707 | 927 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
708 | 928 | lookAtCB.setToolTipText("Look-at target"); |
---|
709 | 929 | lookAtCB.addItemListener(this); |
---|
| 930 | + } |
---|
710 | 931 | |
---|
711 | 932 | } |
---|
712 | 933 | |
---|
713 | 934 | cGridBag fill = new cGridBag(); |
---|
714 | | - |
---|
715 | 935 | fill.preferredHeight = 200; |
---|
| 936 | + cGridBag fill2 = new cGridBag(); |
---|
| 937 | + fill2.preferredHeight = 200; |
---|
| 938 | + cGridBag fill3 = new cGridBag(); |
---|
| 939 | + fill3.preferredHeight = 200; |
---|
716 | 940 | |
---|
717 | 941 | panel.add(fill); |
---|
| 942 | + panel.add(fill2); |
---|
| 943 | + panel.add(fill3); |
---|
718 | 944 | |
---|
719 | 945 | } |
---|
720 | 946 | |
---|
721 | 947 | void EditObject(Object3D obj) |
---|
722 | 948 | { |
---|
723 | 949 | cRadio radioButton = new cRadio(obj.name); |
---|
| 950 | + |
---|
| 951 | + // Patch to avoid bug with transparency. |
---|
| 952 | + radioButton.hadMaterial = obj.material != null; |
---|
| 953 | + if (!radioButton.hadMaterial) |
---|
| 954 | + { |
---|
| 955 | + obj.material = new cMaterial(); |
---|
| 956 | + } |
---|
| 957 | + |
---|
724 | 958 | radioButton.SetObject(obj); |
---|
725 | 959 | radioButton.layout = sevenButton; |
---|
726 | 960 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
729 | 963 | buttonGroup.add(radioButton); |
---|
730 | 964 | radioButton.doClick(); |
---|
731 | 965 | } |
---|
| 966 | + |
---|
732 | 967 | void SetupViews(ObjEditor oe) |
---|
733 | 968 | { |
---|
| 969 | + theFrame = this; |
---|
| 970 | + |
---|
734 | 971 | oe.SetupViews(); |
---|
735 | 972 | |
---|
736 | 973 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
739 | 976 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
740 | 977 | } |
---|
741 | 978 | |
---|
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; |
---|
| 979 | + cToggleButton liveCB; |
---|
| 980 | + cCheckBox supportCB; |
---|
| 981 | + cCheckBox localCB; |
---|
| 982 | + cCheckBox crowdCB; |
---|
| 983 | + cCheckBox smoothCB; |
---|
| 984 | + cToggleButton fastCB; |
---|
| 985 | + cCheckBox slowCB; |
---|
| 986 | + cCheckBox boxCB; |
---|
| 987 | + cCheckBox zoomBoxCB; |
---|
| 988 | + //cToggleButton trackCB; |
---|
| 989 | + cCheckBox trackCB; |
---|
| 990 | + cCheckBox smoothfocusCB; |
---|
753 | 991 | // JCheckBox speakerMocapCB; |
---|
754 | | - JCheckBox speakerCameraCB; |
---|
755 | | - JCheckBox speakerFocusCB; |
---|
756 | | - JCheckBox debugCB; |
---|
757 | | - JCheckBox oeilCB; |
---|
758 | | - JCheckBox lookAtCB; |
---|
| 992 | + cCheckBox speakerCameraCB; |
---|
| 993 | + cCheckBox speakerFocusCB; |
---|
| 994 | + cCheckBox debugCB; |
---|
| 995 | + |
---|
| 996 | + cCheckBox oeilCB; |
---|
| 997 | + cCheckBox shadowCB; |
---|
| 998 | + cCheckBox autosaveCB; |
---|
| 999 | + cCheckBox lookAtCB; |
---|
759 | 1000 | |
---|
760 | 1001 | // static int COLOR = 1; |
---|
761 | 1002 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
763 | 1004 | |
---|
764 | 1005 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
765 | 1006 | |
---|
766 | | - JCheckBox colorCB; |
---|
767 | | - JCheckBox materialCB; |
---|
768 | | - JCheckBox textureCB; |
---|
| 1007 | + cCheckBox colorCB; |
---|
| 1008 | + cCheckBox materialCB; |
---|
| 1009 | + cCheckBox textureCB; |
---|
769 | 1010 | |
---|
770 | 1011 | public void itemStateChanged(ItemEvent e) |
---|
771 | 1012 | { |
---|
.. | .. |
---|
793 | 1034 | } else if(e.getSource() == liveCB) |
---|
794 | 1035 | { |
---|
795 | 1036 | cameraView.ToggleLive(); |
---|
| 1037 | + refreshContents(false); |
---|
796 | 1038 | } |
---|
797 | 1039 | else if(e.getSource() == supportCB) |
---|
798 | 1040 | { |
---|
.. | .. |
---|
857 | 1099 | { |
---|
858 | 1100 | cameraView.ToggleOeil(); |
---|
859 | 1101 | } |
---|
| 1102 | + else if(e.getSource() == shadowCB) |
---|
| 1103 | + { |
---|
| 1104 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1105 | + } |
---|
| 1106 | + else if(e.getSource() == autosaveCB) |
---|
| 1107 | + { |
---|
| 1108 | + Globals.SAVEONMAKE ^= true; |
---|
| 1109 | + } |
---|
860 | 1110 | else if(e.getSource() == lookAtCB) |
---|
861 | 1111 | { |
---|
862 | 1112 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
873 | 1123 | |
---|
874 | 1124 | /**/ |
---|
875 | 1125 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
876 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1126 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1127 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
877 | 1128 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
878 | 1129 | // We can't move the root node or an empty selection |
---|
879 | 1130 | return; |
---|
.. | .. |
---|
990 | 1241 | |
---|
991 | 1242 | assert target == objEditor.jTree; |
---|
992 | 1243 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1244 | + Object3D destinationLeaf; |
---|
993 | 1245 | try { |
---|
994 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1246 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
995 | 1247 | } catch (Exception e) { |
---|
996 | 1248 | System.out.println("destinationPath : " + destinationPath); |
---|
997 | 1249 | return; |
---|
998 | 1250 | } |
---|
999 | 1251 | |
---|
1000 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1252 | + for (int i=group.selection.size(); --i>=0;) |
---|
1001 | 1253 | { |
---|
| 1254 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1255 | + |
---|
| 1256 | + // Cannot move into itself |
---|
| 1257 | + if (child == destinationLeaf) |
---|
| 1258 | + return; |
---|
| 1259 | + } |
---|
| 1260 | + |
---|
| 1261 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1262 | +// { |
---|
1002 | 1263 | loadClipboard(true); |
---|
1003 | 1264 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1004 | 1265 | pasteInto(false, false); |
---|
1005 | | - } else { |
---|
1006 | | - loadClipboard(false); |
---|
1007 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1008 | | - pasteInto(false, false); // true); // ??? |
---|
1009 | | - } |
---|
| 1266 | +// } else { |
---|
| 1267 | +// loadClipboard(false); |
---|
| 1268 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1269 | +// pasteInto(false, false); // true); // ??? |
---|
| 1270 | +// } |
---|
1010 | 1271 | } |
---|
1011 | 1272 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1012 | 1273 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1111 | 1372 | { |
---|
1112 | 1373 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1113 | 1374 | //heightFieldItem.addActionListener(this); |
---|
1114 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1115 | | - gridItem.addActionListener(this); |
---|
1116 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1117 | | - rectoidItem.addActionListener(this); |
---|
1118 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1119 | | - ellipsoidItem.addActionListener(this); |
---|
1120 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1121 | | - coneItem.addActionListener(this); |
---|
1122 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1123 | | - torusItem.addActionListener(this); |
---|
1124 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1125 | | - superItem.addActionListener(this); |
---|
| 1375 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1376 | +// gridItem.addActionListener(this); |
---|
| 1377 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1378 | +// rectoidItem.addActionListener(this); |
---|
| 1379 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1380 | +// ellipsoidItem.addActionListener(this); |
---|
| 1381 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1382 | +// coneItem.addActionListener(this); |
---|
| 1383 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1384 | +// torusItem.addActionListener(this); |
---|
| 1385 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1386 | +// superItem.addActionListener(this); |
---|
| 1387 | + |
---|
| 1388 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1389 | + cameraItem.addActionListener(this); |
---|
| 1390 | + |
---|
| 1391 | + if (!Globals.ADVANCED) |
---|
| 1392 | + { |
---|
1126 | 1393 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1127 | 1394 | kleinItem.addActionListener(this); |
---|
1128 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1129 | | - particleItem.addActionListener(this); |
---|
| 1395 | + } |
---|
| 1396 | + |
---|
| 1397 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1398 | +// particleItem.addActionListener(this); |
---|
1130 | 1399 | if (Globals.ADVANCED) |
---|
1131 | 1400 | { |
---|
1132 | 1401 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1152 | 1421 | } |
---|
1153 | 1422 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1154 | 1423 | bezierItem.addActionListener(this); |
---|
1155 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1156 | | - overlayItem.addActionListener(this); |
---|
1157 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1158 | | - lightItem.addActionListener(this); |
---|
| 1424 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1425 | +// overlayItem.addActionListener(this); |
---|
| 1426 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1427 | +// lightItem.addActionListener(this); |
---|
1159 | 1428 | menu.add("-"); |
---|
1160 | 1429 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1161 | 1430 | //superLoopItem.addActionListener(this); |
---|
1162 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1163 | | - loopItem.addActionListener(this); |
---|
| 1431 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1432 | +// loopItem.addActionListener(this); |
---|
1164 | 1433 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1165 | 1434 | doubleItem.addActionListener(this); |
---|
1166 | 1435 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1200 | 1469 | memoryItem.addActionListener(this); |
---|
1201 | 1470 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1202 | 1471 | analyzeItem.addActionListener(this); |
---|
1203 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1472 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1204 | 1473 | dumpItem.addActionListener(this); |
---|
1205 | 1474 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1206 | 1475 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1341 | 1610 | shadow.material = new cMaterial(obj.material); |
---|
1342 | 1611 | shadow.material.diffuse = 0.0001f; |
---|
1343 | 1612 | shadow.material.specular = 0.0001f; |
---|
| 1613 | + //shadow.projectedVertices[1].x = 300; |
---|
1344 | 1614 | |
---|
1345 | 1615 | makeSomething(shadow); |
---|
1346 | 1616 | } |
---|
.. | .. |
---|
1588 | 1858 | { |
---|
1589 | 1859 | ScreenFit(); |
---|
1590 | 1860 | } else |
---|
1591 | | - if (source == switchItem) |
---|
| 1861 | + if (source == switchViewItem) |
---|
1592 | 1862 | { |
---|
1593 | 1863 | cVector v1 = new cVector(); |
---|
1594 | 1864 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1597 | 1867 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1598 | 1868 | objEditor.cameraView.repaint(); |
---|
1599 | 1869 | } else |
---|
1600 | | - if (source == rectoidItem) |
---|
| 1870 | + if (source == rectoidItem || source == boxButton) |
---|
1601 | 1871 | { |
---|
1602 | 1872 | makeSomething(new Box()); |
---|
1603 | 1873 | } else |
---|
1604 | | - if (source == particleItem) |
---|
| 1874 | + if (source == particleItem || source == particlesButton) |
---|
1605 | 1875 | { |
---|
1606 | 1876 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1607 | 1877 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1680 | 1950 | |
---|
1681 | 1951 | makeSomething(obj); |
---|
1682 | 1952 | } else |
---|
1683 | | - if (source == gridItem) |
---|
| 1953 | + if (source == gridItem || source == gridButton) |
---|
1684 | 1954 | { |
---|
1685 | 1955 | makeSomething(new Grid()); |
---|
1686 | 1956 | } else |
---|
1687 | | - if (source == ellipsoidItem) |
---|
| 1957 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1688 | 1958 | { |
---|
1689 | 1959 | makeSomething(new Sphere()); |
---|
1690 | 1960 | } else |
---|
1691 | | - if (source == coneItem) |
---|
| 1961 | + if (source == coneItem || source == coneButton) |
---|
1692 | 1962 | { |
---|
1693 | 1963 | makeSomething(new Cone()); |
---|
1694 | 1964 | } else |
---|
1695 | | - if (source == torusItem) |
---|
| 1965 | + if (source == torusItem || source == torusButton) |
---|
1696 | 1966 | { |
---|
1697 | 1967 | makeSomething(new Torus()); |
---|
1698 | 1968 | } else |
---|
1699 | | - if (source == superItem) |
---|
| 1969 | + if (source == superItem || source == superButton) |
---|
1700 | 1970 | { |
---|
1701 | 1971 | makeSomething(new Superellipsoid()); |
---|
1702 | 1972 | } else |
---|
1703 | | - if (source == kleinItem) |
---|
| 1973 | + if (source == kleinItem || source == kleinButton) |
---|
1704 | 1974 | { |
---|
1705 | 1975 | makeSomething(new Klein()); |
---|
1706 | 1976 | } else |
---|
.. | .. |
---|
1720 | 1990 | { |
---|
1721 | 1991 | makeSomething(new BezierSurface()); |
---|
1722 | 1992 | } else |
---|
1723 | | - if (source == overlayItem) |
---|
| 1993 | + if (source == overlayItem || source == overlayButton) |
---|
1724 | 1994 | { |
---|
1725 | 1995 | /* |
---|
1726 | 1996 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1768 | 2038 | s.setup(); |
---|
1769 | 2039 | makeSomething(s); |
---|
1770 | 2040 | } else |
---|
1771 | | - if (source == lightItem) |
---|
| 2041 | + if (source == lightItem || source == lightButton) |
---|
1772 | 2042 | { |
---|
1773 | 2043 | makeSomething(new Light()); |
---|
1774 | 2044 | } else |
---|
.. | .. |
---|
1818 | 2088 | |
---|
1819 | 2089 | group(g); |
---|
1820 | 2090 | } else |
---|
1821 | | - if (source == loopItem) |
---|
| 2091 | + if (source == loopItem || source == loopButton) |
---|
1822 | 2092 | { |
---|
1823 | 2093 | Composite csg = new GroupLeaf(); |
---|
1824 | 2094 | csg.count = 5; |
---|
.. | .. |
---|
1853 | 2123 | child = new cGroup(); |
---|
1854 | 2124 | csg.addChild(child); |
---|
1855 | 2125 | child.addChild(csg); |
---|
1856 | | - } 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 | 2126 | } else |
---|
1882 | 2127 | if (source == computeAOItem) |
---|
1883 | 2128 | { |
---|
.. | .. |
---|
1915 | 2160 | if (source == dumpItem) |
---|
1916 | 2161 | { |
---|
1917 | 2162 | DumpObject(); |
---|
| 2163 | + } else |
---|
| 2164 | + if (source == minButton) |
---|
| 2165 | + { |
---|
| 2166 | + Minimize(); |
---|
| 2167 | + } else |
---|
| 2168 | + if (source == maxButton) |
---|
| 2169 | + { |
---|
| 2170 | + Maximize(); |
---|
| 2171 | + } else |
---|
| 2172 | + if (source == fullButton) |
---|
| 2173 | + { |
---|
| 2174 | + ToggleFullScreen(); |
---|
| 2175 | + } else |
---|
| 2176 | + if (source == undoButton) |
---|
| 2177 | + { |
---|
| 2178 | + Undo(); |
---|
| 2179 | + } else |
---|
| 2180 | + if (source == redoButton) |
---|
| 2181 | + { |
---|
| 2182 | + Redo(); |
---|
| 2183 | + } else |
---|
| 2184 | + if (source == saveButton) |
---|
| 2185 | + { |
---|
| 2186 | + Save(); |
---|
1918 | 2187 | } else |
---|
1919 | 2188 | if (source == oneStepButton) |
---|
1920 | 2189 | { |
---|
.. | .. |
---|
1969 | 2238 | if (source == cutItem || source == clearButton) |
---|
1970 | 2239 | { |
---|
1971 | 2240 | loadClipboard(true); |
---|
| 2241 | + } else |
---|
| 2242 | + if (source == undoItem) |
---|
| 2243 | + { |
---|
| 2244 | + Undo(); |
---|
| 2245 | + } else |
---|
| 2246 | + if (source == redoItem) |
---|
| 2247 | + { |
---|
| 2248 | + Redo(); |
---|
1972 | 2249 | } else |
---|
1973 | 2250 | if (source == duplicateItem) |
---|
1974 | 2251 | { |
---|
.. | .. |
---|
2301 | 2578 | { |
---|
2302 | 2579 | ClearSelection(true); |
---|
2303 | 2580 | } else |
---|
2304 | | - if (source == grabItem) |
---|
| 2581 | + if (source == grabItem || source == groupButton) |
---|
2305 | 2582 | { |
---|
2306 | | - group(new cGroup(), true); |
---|
| 2583 | + group(new cGroup(), false); // true); |
---|
2307 | 2584 | } else |
---|
2308 | 2585 | if (source == hideItem) |
---|
2309 | 2586 | { |
---|
.. | .. |
---|
2321 | 2598 | { |
---|
2322 | 2599 | makeSomething(new Camera()); |
---|
2323 | 2600 | } else |
---|
2324 | | - if (source == compositeItem) |
---|
| 2601 | + if (source == compositeItem || source == compositeButton) |
---|
2325 | 2602 | { |
---|
2326 | 2603 | group(new Composite()); |
---|
2327 | 2604 | } else |
---|
2328 | | - if (source == randomItem) |
---|
| 2605 | + if (source == switchItem || source == switchButton) |
---|
2329 | 2606 | { |
---|
2330 | 2607 | RandomNode random = new RandomNode(); |
---|
2331 | 2608 | group(random); |
---|
.. | .. |
---|
2427 | 2704 | { |
---|
2428 | 2705 | group(new cLinker()); |
---|
2429 | 2706 | } else |
---|
2430 | | - if (source == textureItem) |
---|
| 2707 | + if (source == textureItem || source == textureButton) |
---|
2431 | 2708 | { |
---|
2432 | 2709 | group(new TextureNode()); |
---|
2433 | 2710 | } else |
---|
.. | .. |
---|
2447 | 2724 | { |
---|
2448 | 2725 | CastShadow(2); |
---|
2449 | 2726 | } else |
---|
2450 | | - if (source == ungroupItem) |
---|
| 2727 | + if (source == ungroupItem || source == ungroupButton) |
---|
2451 | 2728 | { |
---|
2452 | 2729 | //ungroup(); |
---|
2453 | 2730 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2469 | 2746 | } else |
---|
2470 | 2747 | if (source == genNormalsMESHItem) |
---|
2471 | 2748 | { |
---|
2472 | | - GenNormals(true); // TODO |
---|
| 2749 | + GenNormalsMESH(); |
---|
2473 | 2750 | } else |
---|
2474 | 2751 | if (source == genNormalsORGANItem) |
---|
2475 | 2752 | { |
---|
.. | .. |
---|
2534 | 2811 | if (source == unmarkleavesItem) |
---|
2535 | 2812 | { |
---|
2536 | 2813 | MarkLeaves(false); |
---|
| 2814 | + } else |
---|
| 2815 | + if (source == rewindleavesItem) |
---|
| 2816 | + { |
---|
| 2817 | + RewindLeaves(true); |
---|
| 2818 | + } else |
---|
| 2819 | + if (source == unrewindleavesItem) |
---|
| 2820 | + { |
---|
| 2821 | + RewindLeaves(false); |
---|
| 2822 | + } else |
---|
| 2823 | + if (source == randomleavesItem) |
---|
| 2824 | + { |
---|
| 2825 | + RandomLeaves(true); |
---|
| 2826 | + } else |
---|
| 2827 | + if (source == unrandomleavesItem) |
---|
| 2828 | + { |
---|
| 2829 | + RandomLeaves(false); |
---|
2537 | 2830 | } else |
---|
2538 | 2831 | if (source == flipVItem) |
---|
2539 | 2832 | { |
---|
.. | .. |
---|
2769 | 3062 | if (source == twoButton) |
---|
2770 | 3063 | { |
---|
2771 | 3064 | radio.layout = twoButton; |
---|
| 3065 | + |
---|
| 3066 | + if (CameraPane.FULLSCREEN) |
---|
| 3067 | + fullscreenLayout = radio.layout; |
---|
| 3068 | + |
---|
2772 | 3069 | // bug |
---|
2773 | 3070 | //gridPanel.setDividerLocation(1.0); |
---|
2774 | 3071 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2801 | 3098 | bigThree.ClearUI(); |
---|
2802 | 3099 | bigThree.add(centralPanel); |
---|
2803 | 3100 | bigThree.FlushUI(); |
---|
| 3101 | + |
---|
| 3102 | + cameraView.requestFocusInWindow(); |
---|
| 3103 | + |
---|
| 3104 | +// refreshContents(true); |
---|
| 3105 | +// |
---|
| 3106 | +// try |
---|
| 3107 | +// { |
---|
| 3108 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3109 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3110 | +// bot.mouseMove(100, 100); |
---|
| 3111 | +// bot.mousePress(mask); |
---|
| 3112 | +// bot.mouseRelease(mask); |
---|
| 3113 | +// } |
---|
| 3114 | +// catch (Exception e) |
---|
| 3115 | +// { |
---|
| 3116 | +// |
---|
| 3117 | +// } |
---|
| 3118 | + |
---|
2804 | 3119 | } else |
---|
2805 | 3120 | if (source == threeButton) |
---|
2806 | 3121 | { |
---|
2807 | 3122 | radio.layout = threeButton; |
---|
| 3123 | + |
---|
| 3124 | + if (CameraPane.FULLSCREEN) |
---|
| 3125 | + fullscreenLayout = radio.layout; |
---|
2808 | 3126 | |
---|
2809 | 3127 | // bigThree.remove(scenePanel); |
---|
2810 | 3128 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2837 | 3155 | bigThree.add(centralPanel); |
---|
2838 | 3156 | bigThree.add(XYZPanel); |
---|
2839 | 3157 | bigThree.FlushUI(); |
---|
| 3158 | + |
---|
| 3159 | + cameraView.requestFocusInWindow(); |
---|
2840 | 3160 | } else |
---|
2841 | 3161 | if (source == fourButton) |
---|
2842 | 3162 | { |
---|
2843 | 3163 | radio.layout = fourButton; |
---|
| 3164 | + |
---|
| 3165 | + if (CameraPane.FULLSCREEN) |
---|
| 3166 | + fullscreenLayout = radio.layout; |
---|
2844 | 3167 | |
---|
2845 | 3168 | // bigThree.remove(scenePanel); |
---|
2846 | 3169 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2872 | 3195 | bigThree.ClearUI(); |
---|
2873 | 3196 | bigThree.add(scenePanel); |
---|
2874 | 3197 | bigThree.FlushUI(); |
---|
| 3198 | + |
---|
| 3199 | + cameraView.requestFocusInWindow(); |
---|
2875 | 3200 | } else |
---|
2876 | 3201 | if (source == sixButton) |
---|
2877 | 3202 | { |
---|
2878 | 3203 | radio.layout = sixButton; |
---|
| 3204 | + |
---|
| 3205 | + if (CameraPane.FULLSCREEN) |
---|
| 3206 | + fullscreenLayout = radio.layout; |
---|
2879 | 3207 | |
---|
2880 | 3208 | // bigThree.remove(scenePanel); |
---|
2881 | 3209 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2908 | 3236 | bigThree.add(scenePanel); |
---|
2909 | 3237 | bigThree.add(centralPanel); |
---|
2910 | 3238 | bigThree.FlushUI(); |
---|
| 3239 | + |
---|
| 3240 | + cameraView.requestFocusInWindow(); |
---|
2911 | 3241 | } else |
---|
2912 | 3242 | if (source == sevenButton) |
---|
2913 | 3243 | { |
---|
2914 | 3244 | radio.layout = sevenButton; |
---|
| 3245 | + |
---|
| 3246 | + if (CameraPane.FULLSCREEN) |
---|
| 3247 | + fullscreenLayout = radio.layout; |
---|
2915 | 3248 | |
---|
2916 | 3249 | // bigThree.remove(scenePanel); |
---|
2917 | 3250 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2945 | 3278 | bigThree.add(centralPanel); |
---|
2946 | 3279 | bigThree.add(XYZPanel); |
---|
2947 | 3280 | bigThree.FlushUI(); |
---|
| 3281 | + |
---|
| 3282 | + cameraView.requestFocusInWindow(); |
---|
2948 | 3283 | } else |
---|
2949 | 3284 | if (source == rootButton) |
---|
2950 | 3285 | { |
---|
.. | .. |
---|
2956 | 3291 | EditObject(obj); |
---|
2957 | 3292 | } |
---|
2958 | 3293 | |
---|
| 3294 | + cameraView.requestFocusInWindow(); |
---|
2959 | 3295 | refreshContents(true); |
---|
2960 | 3296 | } else |
---|
2961 | 3297 | if (source == closeButton) |
---|
.. | .. |
---|
2965 | 3301 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2966 | 3302 | { |
---|
2967 | 3303 | ab = (cRadio)e.nextElement(); |
---|
2968 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3304 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2969 | 3305 | { |
---|
| 3306 | + // Patch to avoid bug with transparency. |
---|
| 3307 | + if (!ab.hadMaterial) |
---|
| 3308 | + { |
---|
| 3309 | + ab.object.material = null; |
---|
| 3310 | + } |
---|
| 3311 | + |
---|
2970 | 3312 | buttonGroup.remove(ab); |
---|
2971 | 3313 | radioPanel.remove(ab); |
---|
2972 | 3314 | |
---|
2973 | | - ab.GetObject().editWindow = null; |
---|
| 3315 | + //ab.GetObject().editWindow = null; |
---|
| 3316 | + ab.GetObject().manipWindow = null; |
---|
2974 | 3317 | // ab.GetObject().objectUI = null; // ????????? |
---|
2975 | 3318 | |
---|
2976 | 3319 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2977 | 3320 | break; |
---|
2978 | 3321 | } |
---|
2979 | 3322 | } |
---|
| 3323 | + |
---|
| 3324 | + cameraView.requestFocusInWindow(); |
---|
2980 | 3325 | refreshContents(true); |
---|
2981 | 3326 | } else |
---|
2982 | 3327 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
2993 | 3338 | child.CloseUI(); |
---|
2994 | 3339 | listUI.remove(child); |
---|
2995 | 3340 | |
---|
2996 | | - child.editWindow = null; // ??????????? |
---|
| 3341 | + //child.editWindow = null; // ??????????? |
---|
2997 | 3342 | } |
---|
2998 | 3343 | objEditor.ctrlPanel.FlushUI(); |
---|
2999 | 3344 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3079 | 3424 | frontView.object = group; |
---|
3080 | 3425 | sideView.object = group; |
---|
3081 | 3426 | } |
---|
3082 | | - group.editWindow = this; |
---|
| 3427 | + |
---|
| 3428 | +// fix "+" issue |
---|
| 3429 | + //group.editWindow = this; |
---|
| 3430 | + group.manipWindow = this; |
---|
| 3431 | + |
---|
3083 | 3432 | /* |
---|
3084 | 3433 | currentLayout = radio.layout; |
---|
3085 | 3434 | if (currentLayout == null) |
---|
.. | .. |
---|
3091 | 3440 | //group.parent = null; // ROOT |
---|
3092 | 3441 | //group.attributes = -1; |
---|
3093 | 3442 | ResetModel(); |
---|
| 3443 | + |
---|
| 3444 | + cameraView.requestFocusInWindow(); |
---|
3094 | 3445 | refreshContents(true); |
---|
3095 | | - } |
---|
| 3446 | + } else if (event.getSource() == editCameraItem) |
---|
| 3447 | + { |
---|
| 3448 | + cameraView.ProtectCamera(); |
---|
| 3449 | + cameraView.repaint(); |
---|
| 3450 | + return; |
---|
| 3451 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3452 | + { |
---|
| 3453 | + cameraView.RevertCamera(); |
---|
| 3454 | + cameraView.repaint(); |
---|
| 3455 | + return; |
---|
| 3456 | + // } else if (event.getSource() == textureButton) |
---|
| 3457 | + // { |
---|
| 3458 | + // return; // true; |
---|
| 3459 | + } |
---|
3096 | 3460 | else |
---|
3097 | 3461 | { |
---|
3098 | 3462 | //return super.action(event, arg); |
---|
.. | .. |
---|
3101 | 3465 | } |
---|
3102 | 3466 | |
---|
3103 | 3467 | boolean useclient = false; |
---|
3104 | | - cRadio radio; |
---|
3105 | 3468 | |
---|
3106 | 3469 | void ToggleRoot() |
---|
3107 | 3470 | { |
---|
.. | .. |
---|
3340 | 3703 | |
---|
3341 | 3704 | int size = obj.MemorySize(); |
---|
3342 | 3705 | |
---|
3343 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3706 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3707 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3344 | 3708 | } |
---|
3345 | 3709 | } |
---|
3346 | 3710 | catch (Exception e) |
---|
.. | .. |
---|
3421 | 3785 | void GenNormals(boolean crease) |
---|
3422 | 3786 | { |
---|
3423 | 3787 | group.GenNormalsS(crease); |
---|
| 3788 | + |
---|
| 3789 | + refreshContents(); |
---|
| 3790 | + } |
---|
| 3791 | + |
---|
| 3792 | + void GenNormalsMESH() |
---|
| 3793 | + { |
---|
| 3794 | + group.GenNormalsMeshS(); |
---|
3424 | 3795 | |
---|
3425 | 3796 | refreshContents(); |
---|
3426 | 3797 | } |
---|
.. | .. |
---|
4048 | 4419 | refreshContents(); |
---|
4049 | 4420 | } |
---|
4050 | 4421 | |
---|
| 4422 | + void RewindLeaves(boolean hide) |
---|
| 4423 | + { |
---|
| 4424 | + group.selection.RewindLeaves(hide); |
---|
| 4425 | + refreshContents(); |
---|
| 4426 | + } |
---|
| 4427 | + |
---|
| 4428 | + void RandomLeaves(boolean hide) |
---|
| 4429 | + { |
---|
| 4430 | + group.selection.RandomLeaves(hide); |
---|
| 4431 | + refreshContents(); |
---|
| 4432 | + } |
---|
| 4433 | + |
---|
4051 | 4434 | void SetTexRes(int tr) |
---|
4052 | 4435 | { |
---|
4053 | 4436 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4130 | 4513 | { |
---|
4131 | 4514 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4132 | 4515 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4133 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4516 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4134 | 4517 | |
---|
4135 | 4518 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4136 | | - if(elem != group) |
---|
| 4519 | + if(elem != group || !newWindow) |
---|
4137 | 4520 | { |
---|
4138 | 4521 | // if (!(elem instanceof Composite)) |
---|
4139 | 4522 | // newWindow = false; |
---|
.. | .. |
---|
4223 | 4606 | //case 702: // Event.LIST_DESELECT |
---|
4224 | 4607 | group.deselectAll(); |
---|
4225 | 4608 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4226 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4227 | 4609 | if (tps != null) |
---|
4228 | 4610 | { |
---|
4229 | 4611 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4232 | 4614 | |
---|
4233 | 4615 | //if (child.parent != null) |
---|
4234 | 4616 | //child.parent.addSelectee(child); |
---|
| 4617 | + objEditor.SetMaterial(child); |
---|
4235 | 4618 | group.addSelectee(child); |
---|
4236 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4237 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4238 | | - System.err.println("info : " + child.GetPath()); |
---|
4239 | 4619 | } |
---|
4240 | 4620 | } |
---|
4241 | 4621 | // else |
---|
.. | .. |
---|
4245 | 4625 | // System.err.println("info : " + group.GetPath()); |
---|
4246 | 4626 | // } |
---|
4247 | 4627 | |
---|
4248 | | - objEditor.SetText(); // jan 2014 |
---|
4249 | | - |
---|
4250 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4628 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4251 | 4629 | CameraPane.flash = true; |
---|
4252 | 4630 | |
---|
4253 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4631 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4254 | 4632 | // a camera |
---|
4255 | 4633 | { |
---|
4256 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4257 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4634 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4635 | + { |
---|
| 4636 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4637 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4638 | + } |
---|
4258 | 4639 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4259 | 4640 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4260 | 4641 | } |
---|
.. | .. |
---|
4267 | 4648 | |
---|
4268 | 4649 | freezemodel = false; |
---|
4269 | 4650 | } |
---|
| 4651 | + |
---|
| 4652 | + void refreshContents(boolean cp) |
---|
| 4653 | + { |
---|
| 4654 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4655 | + if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 4656 | + { |
---|
| 4657 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4658 | + |
---|
| 4659 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4660 | + { |
---|
| 4661 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4662 | + |
---|
| 4663 | + objEditor.AddInfo(child, this, true); |
---|
| 4664 | + System.err.println("info : " + child.GetPath()); |
---|
| 4665 | + } |
---|
| 4666 | + |
---|
| 4667 | + objEditor.SetText(); // jan 2014 |
---|
| 4668 | + } |
---|
| 4669 | + |
---|
| 4670 | + super.refreshContents(cp); |
---|
| 4671 | + } |
---|
4270 | 4672 | |
---|
4271 | 4673 | void linkSomething(Object3D thing) |
---|
4272 | 4674 | { |
---|
.. | .. |
---|
4338 | 4740 | { |
---|
4339 | 4741 | if (group.selection.isEmpty()) |
---|
4340 | 4742 | return; |
---|
| 4743 | + |
---|
4341 | 4744 | Grafreed.clipboardIsTempGroup = false; |
---|
4342 | 4745 | Composite tGroup = null; |
---|
4343 | 4746 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4348 | 4751 | |
---|
4349 | 4752 | if (cut) |
---|
4350 | 4753 | { |
---|
| 4754 | + if (Globals.SAVEONMAKE) |
---|
| 4755 | + Save(); |
---|
4351 | 4756 | //int indices[] = jList.getSelectedIndices(); |
---|
4352 | 4757 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4353 | 4758 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4437 | 4842 | } |
---|
4438 | 4843 | |
---|
4439 | 4844 | } |
---|
| 4845 | + |
---|
4440 | 4846 | if (Grafreed.clipboardIsTempGroup) |
---|
4441 | 4847 | Grafreed.clipboard = tGroup; |
---|
| 4848 | + |
---|
4442 | 4849 | if (cut) |
---|
4443 | 4850 | { |
---|
4444 | 4851 | ResetModel(); |
---|
.. | .. |
---|
4970 | 5377 | } |
---|
4971 | 5378 | */ |
---|
4972 | 5379 | |
---|
4973 | | - void ImportGFD() |
---|
4974 | | - { |
---|
4975 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4976 | | - browser.show(); |
---|
4977 | | - String filename = browser.getFile(); |
---|
4978 | | - if (filename != null && filename.length() > 0) |
---|
4979 | | - { |
---|
4980 | | - String fullname = browser.getDirectory() + filename; |
---|
4981 | | - |
---|
4982 | | - //Object3D readobj = |
---|
4983 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4984 | | - //makeSomething(readobj); |
---|
4985 | | - } |
---|
4986 | | - } |
---|
4987 | | - |
---|
4988 | 5380 | /* |
---|
4989 | 5381 | public void Callback(Object obj) |
---|
4990 | 5382 | { |
---|
.. | .. |
---|
5008 | 5400 | } |
---|
5009 | 5401 | */ |
---|
5010 | 5402 | |
---|
5011 | | - void ImportVRMLX3D() |
---|
5012 | | - { |
---|
5013 | | - if (Grafreed.standAlone) |
---|
5014 | | - { |
---|
5015 | | - /**/ |
---|
5016 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
5017 | | - browser.show(); |
---|
5018 | | - String filename = browser.getFile(); |
---|
5019 | | - if (filename != null && filename.length() > 0) |
---|
5020 | | - { |
---|
5021 | | - String fullname = browser.getDirectory() + filename; |
---|
5022 | | - LoadVRMLX3D(fullname); |
---|
5023 | | - } |
---|
5024 | | - /**/ |
---|
5025 | | - } |
---|
5026 | | - } |
---|
5027 | | - |
---|
5028 | 5403 | String GetFile(String dialogName) |
---|
5029 | 5404 | { |
---|
5030 | 5405 | if (Grafreed.standAlone) |
---|
.. | .. |
---|
5095 | 5470 | cButton clearpanelButton; |
---|
5096 | 5471 | cButton unselectButton; |
---|
5097 | 5472 | |
---|
| 5473 | + cButton restoreCameraButton; |
---|
| 5474 | + |
---|
| 5475 | + cButton minButton; |
---|
| 5476 | + cButton maxButton; |
---|
| 5477 | + cButton fullButton; |
---|
| 5478 | + cButton undoButton; |
---|
| 5479 | + cButton redoButton; |
---|
| 5480 | + cButton saveButton; |
---|
5098 | 5481 | cButton oneStepButton; |
---|
| 5482 | + |
---|
| 5483 | + cButton groupButton; |
---|
| 5484 | + cButton ungroupButton; |
---|
| 5485 | + cButton compositeButton; |
---|
| 5486 | + cButton switchButton; |
---|
| 5487 | + cButton loopButton; |
---|
| 5488 | + cButton textureButton; |
---|
| 5489 | + |
---|
| 5490 | + cButton gridButton; |
---|
| 5491 | + cButton boxButton; |
---|
| 5492 | + cButton sphereButton; |
---|
| 5493 | + cButton coneButton; |
---|
| 5494 | + cButton torusButton; |
---|
| 5495 | + cButton superButton; |
---|
| 5496 | + cButton kleinButton; |
---|
| 5497 | + cButton particlesButton; |
---|
| 5498 | + cButton overlayButton; |
---|
| 5499 | + cButton lightButton; |
---|
5099 | 5500 | |
---|
5100 | 5501 | cButton screenfitButton; |
---|
5101 | 5502 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5108 | 5509 | |
---|
5109 | 5510 | cButton setsupportButton; |
---|
5110 | 5511 | |
---|
5111 | | - cButton twoButton; |
---|
5112 | | - cButton sixButton; |
---|
5113 | | - cButton threeButton; |
---|
5114 | | - cButton sevenButton; |
---|
5115 | | - cButton fourButton; // full panel |
---|
5116 | | - cButton oneButton; // full XYZ |
---|
5117 | | - //cButton currentLayout; |
---|
5118 | | - |
---|
5119 | 5512 | // |
---|
5120 | 5513 | //Composite |
---|
5121 | 5514 | Object3D // to do !! |
---|
.. | .. |
---|
5125 | 5518 | //JTree jTree; |
---|
5126 | 5519 | private MenuItem lookAtItem; |
---|
5127 | 5520 | private MenuItem lookFromItem; |
---|
5128 | | - private MenuItem switchItem; |
---|
| 5521 | + private MenuItem switchViewItem; |
---|
5129 | 5522 | private MenuItem cutItem; |
---|
5130 | | - private MenuItem duplicateItem; |
---|
| 5523 | + private MenuItem undoItem; |
---|
| 5524 | + private MenuItem redoItem; |
---|
| 5525 | + private JMenuItem duplicateItem; |
---|
5131 | 5526 | private MenuItem cloneItem; |
---|
5132 | 5527 | private MenuItem cloneSupportItem; |
---|
5133 | 5528 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5190 | 5585 | private MenuItem showleavesItem; |
---|
5191 | 5586 | private MenuItem markleavesItem; |
---|
5192 | 5587 | private MenuItem unmarkleavesItem; |
---|
| 5588 | + private MenuItem rewindleavesItem; |
---|
| 5589 | + private MenuItem unrewindleavesItem; |
---|
| 5590 | + private MenuItem randomleavesItem; |
---|
| 5591 | + private MenuItem unrandomleavesItem; |
---|
5193 | 5592 | |
---|
5194 | 5593 | private MenuItem flipVItem; |
---|
5195 | 5594 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5211 | 5610 | private MenuItem frontItem; |
---|
5212 | 5611 | private MenuItem cameraItem; |
---|
5213 | 5612 | private MenuItem compositeItem; |
---|
5214 | | - private MenuItem randomItem; |
---|
| 5613 | + private MenuItem switchItem; |
---|
5215 | 5614 | private MenuItem physicsItem; |
---|
5216 | 5615 | private MenuItem frameselectorItem; |
---|
5217 | 5616 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5273 | 5672 | private MenuItem doubleItem; |
---|
5274 | 5673 | private MenuItem tripleItem; |
---|
5275 | 5674 | |
---|
5276 | | - private MenuItem importGFDItem; |
---|
5277 | | - private MenuItem importVRMLX3DItem; |
---|
5278 | | - private MenuItem import3DSItem; |
---|
5279 | | - private MenuItem importOBJItem; |
---|
5280 | | - |
---|
5281 | 5675 | private MenuItem computeAOItem; |
---|
5282 | 5676 | private MenuItem recompileItem; |
---|
5283 | 5677 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5287 | 5681 | private MenuItem analyzeItem; |
---|
5288 | 5682 | private MenuItem dumpItem; |
---|
5289 | 5683 | //boolean freezemodel = false; |
---|
| 5684 | + |
---|
| 5685 | + Menu cameraMenu; |
---|
| 5686 | + MenuItem editCameraItem; |
---|
| 5687 | + MenuItem restoreCameraItem; |
---|
5290 | 5688 | } |
---|