.. | .. |
---|
60 | 60 | this.copy = this.group = group; |
---|
61 | 61 | //selectees = this.group.selectees; |
---|
62 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
63 | 69 | if(ui) |
---|
64 | 70 | SetupUI(objEditor); |
---|
65 | 71 | } |
---|
.. | .. |
---|
80 | 86 | SetupViews(objEditor); |
---|
81 | 87 | |
---|
82 | 88 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 89 | + |
---|
| 90 | + if (copy.versions == null) |
---|
| 91 | + { |
---|
| 92 | + copy.versions = new byte[100][]; |
---|
| 93 | + copy.versionindex = -1; |
---|
| 94 | + |
---|
| 95 | + Save(true); |
---|
| 96 | + } |
---|
83 | 97 | } |
---|
84 | 98 | |
---|
85 | 99 | void CloneSelection(boolean supports) |
---|
86 | 100 | { |
---|
| 101 | + if (Globals.REPLACEONMAKE) |
---|
| 102 | + Save(); |
---|
| 103 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 104 | + Globals.REPLACEONMAKE = false; |
---|
87 | 105 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 106 | //Object3D obj; |
---|
89 | 107 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 112 | |
---|
95 | 113 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 114 | } |
---|
| 115 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 116 | } |
---|
98 | 117 | |
---|
99 | 118 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 169 | |
---|
151 | 170 | void SetupMenu2(GroupEditor oe) |
---|
152 | 171 | { |
---|
| 172 | + oe.jTree = new cTree(); |
---|
| 173 | + |
---|
153 | 174 | Menu menu; |
---|
154 | 175 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 176 | //editItem = menu.add(new MenuItem("Edit")); |
---|
156 | 177 | //editItem.addActionListener(this); |
---|
157 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 178 | + |
---|
| 179 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 180 | +// undoItem.addActionListener(this); |
---|
| 181 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 182 | +// redoItem.addActionListener(this); |
---|
| 183 | +// menu.add("-"); |
---|
| 184 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
158 | 185 | duplicateItem.addActionListener(this); |
---|
159 | 186 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
160 | 187 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
170 | 197 | copyItem.addActionListener(this); |
---|
171 | 198 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
172 | 199 | pasteItem.addActionListener(this); |
---|
173 | | - menu.add("-"); |
---|
174 | 200 | |
---|
175 | 201 | menu.add("-"); |
---|
176 | 202 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
182 | 208 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
183 | 209 | // pasteExpandItem.addActionListener(this); |
---|
184 | 210 | menu.add("-"); |
---|
185 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
186 | | - clearItem.addActionListener(this); |
---|
| 211 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 212 | + deleteItem.addActionListener(this); |
---|
187 | 213 | |
---|
188 | 214 | if (Globals.ADVANCED) |
---|
189 | 215 | { |
---|
.. | .. |
---|
197 | 223 | //zBufferItem.addActionListener(this); |
---|
198 | 224 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
199 | 225 | //normalLensItem.addActionListener(this); |
---|
200 | | - cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
201 | | - revertCameraItem.addActionListener(this); |
---|
| 226 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 227 | + restoreCameraItem.addActionListener(this); |
---|
202 | 228 | |
---|
203 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
204 | | - toggleFullScreenItem.addItemListener(this); |
---|
205 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
206 | | - cameraMenu.add("-"); |
---|
| 229 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 230 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 231 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 232 | +// cameraMenu.add("-"); |
---|
| 233 | +// |
---|
| 234 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 235 | +// toggleTextureItem.addItemListener(this); |
---|
| 236 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 237 | +// |
---|
| 238 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 239 | +// toggleSwitchItem.addItemListener(this); |
---|
| 240 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
207 | 241 | |
---|
208 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
209 | | - toggleTextureItem.addItemListener(this); |
---|
210 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
211 | | - |
---|
212 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
213 | | - toggleSwitchItem.addItemListener(this); |
---|
214 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
215 | | - |
---|
216 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 242 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
217 | 243 | toggleHandleItem.addItemListener(this); |
---|
218 | 244 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
219 | 245 | |
---|
.. | .. |
---|
240 | 266 | |
---|
241 | 267 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
242 | 268 | toggleDebugItem.addItemListener(this); |
---|
243 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 269 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
244 | 270 | |
---|
245 | 271 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
246 | 272 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
261 | 287 | // animationItem.addItemListener(this); |
---|
262 | 288 | // animationItem.setState(CameraPane.ANIMATION); |
---|
263 | 289 | cameraMenu.add("-"); |
---|
264 | | - cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
| 290 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
265 | 291 | editCameraItem.addActionListener(this); |
---|
266 | 292 | |
---|
267 | 293 | if (Globals.ADVANCED) |
---|
268 | 294 | { |
---|
269 | 295 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
270 | 296 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
271 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 297 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
272 | 298 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
273 | 299 | oe.cameraMenu.add("-"); |
---|
274 | 300 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
276 | 302 | editLeafItem.addActionListener(this); |
---|
277 | 303 | lookAtItem.addActionListener(this); |
---|
278 | 304 | //lookFromItem.addActinoListener(this); |
---|
279 | | - //switchItem.addActionListener(this); |
---|
| 305 | + //switchViewItem.addActionListener(this); |
---|
280 | 306 | } |
---|
281 | 307 | |
---|
282 | 308 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
321 | 347 | } |
---|
322 | 348 | |
---|
323 | 349 | oe.menuBar.add(menu = new Menu("Group")); |
---|
324 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
325 | | - grabItem.addActionListener(this); |
---|
| 350 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 351 | +// grabItem.addActionListener(this); |
---|
326 | 352 | backItem = menu.add(new MenuItem("Back")); |
---|
327 | 353 | backItem.addActionListener(this); |
---|
328 | 354 | frontItem = menu.add(new MenuItem("Front")); |
---|
329 | 355 | frontItem.addActionListener(this); |
---|
330 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
331 | | - compositeItem.addActionListener(this); |
---|
| 356 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 357 | +// compositeItem.addActionListener(this); |
---|
| 358 | + |
---|
| 359 | + if (Globals.ADVANCED) |
---|
| 360 | + { |
---|
332 | 361 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
333 | 362 | hideItem.addActionListener(this); |
---|
| 363 | + } |
---|
334 | 364 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
335 | 365 | ungroupItem.addActionListener(this); |
---|
336 | | - menu.add("-"); |
---|
337 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
338 | | - randomItem.addActionListener(this); |
---|
| 366 | + |
---|
| 367 | +// menu.add("-"); |
---|
| 368 | +// |
---|
| 369 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 370 | +// switchItem.addActionListener(this); |
---|
| 371 | + if (Globals.ADVANCED) |
---|
| 372 | + { |
---|
339 | 373 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
340 | 374 | switchGeoItem.addActionListener(this); |
---|
341 | 375 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
343 | 377 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
344 | 378 | morphItem.addActionListener(this); |
---|
345 | 379 | |
---|
346 | | - if (Globals.ADVANCED) |
---|
347 | | - { |
---|
348 | 380 | menu.add("-"); |
---|
349 | 381 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
350 | 382 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
352 | 384 | frameselectorItem.addActionListener(this); |
---|
353 | 385 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
354 | 386 | scriptNodeItem.addActionListener(this); |
---|
355 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
356 | | - cameraItem.addActionListener(this); |
---|
357 | 387 | } |
---|
358 | 388 | |
---|
359 | 389 | oe.menuBar.add(menu = new Menu("Object")); |
---|
360 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
361 | | - textureItem.addActionListener(this); |
---|
| 390 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 391 | +// textureItem.addActionListener(this); |
---|
362 | 392 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
363 | 393 | billboardItem.addActionListener(this); |
---|
364 | 394 | csgItem = menu.add(new MenuItem("CSG")); |
---|
365 | 395 | csgItem.addActionListener(this); |
---|
366 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 396 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
367 | 397 | shadowXItem.addActionListener(this); |
---|
368 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 398 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
369 | 399 | shadowYItem.addActionListener(this); |
---|
370 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 400 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
371 | 401 | shadowZItem.addActionListener(this); |
---|
| 402 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 403 | + attributeItem.addActionListener(this); |
---|
| 404 | + |
---|
372 | 405 | if (Globals.ADVANCED) |
---|
373 | 406 | { |
---|
374 | 407 | menu.add("-"); |
---|
375 | 408 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
376 | 409 | linkerItem.addActionListener(this); |
---|
377 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
378 | | - attributeItem.addActionListener(this); |
---|
379 | 410 | templateItem = menu.add(new MenuItem("Template")); |
---|
380 | 411 | templateItem.addActionListener(this); |
---|
381 | 412 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
404 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
405 | 436 | if (Globals.ADVANCED) |
---|
406 | 437 | { |
---|
407 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
408 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
409 | 440 | } |
---|
410 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
464 | 495 | markleavesItem.addActionListener(this); |
---|
465 | 496 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
466 | 497 | unmarkleavesItem.addActionListener(this); |
---|
| 498 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 499 | + rewindleavesItem.addActionListener(this); |
---|
| 500 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 501 | + unrewindleavesItem.addActionListener(this); |
---|
| 502 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 503 | + randomleavesItem.addActionListener(this); |
---|
| 504 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 505 | + unrandomleavesItem.addActionListener(this); |
---|
467 | 506 | menu.add("-"); |
---|
468 | 507 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
469 | 508 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
519 | 558 | buildToolsMenu(menu); |
---|
520 | 559 | } |
---|
521 | 560 | |
---|
| 561 | + |
---|
522 | 562 | void SetupUI2(ObjEditor oe) |
---|
523 | 563 | { |
---|
| 564 | + // June 2019 |
---|
| 565 | + if (oe == null) |
---|
| 566 | + { |
---|
| 567 | + //super.SetupUI2(this); |
---|
| 568 | + //return; |
---|
| 569 | + } |
---|
| 570 | + |
---|
| 571 | + if (copy != group) |
---|
| 572 | + { |
---|
| 573 | + //super.SetupUI2(this); |
---|
| 574 | + } |
---|
| 575 | + |
---|
524 | 576 | //new Exception().printStackTrace(); |
---|
525 | 577 | |
---|
526 | 578 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
549 | 601 | oe.radioPanel.add(dummyButton); |
---|
550 | 602 | oe.buttonGroup.add(dummyButton); |
---|
551 | 603 | */ |
---|
| 604 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 605 | + |
---|
| 606 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 607 | + |
---|
552 | 608 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
553 | 609 | |
---|
554 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 610 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + //minButton.setToolTipText("Minimize window"); |
---|
| 612 | + //minButton.addActionListener(this); |
---|
| 613 | + |
---|
| 614 | + if (Globals.ADVANCED) |
---|
| 615 | + { |
---|
| 616 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 617 | + maxButton.setToolTipText("Maximize window"); |
---|
| 618 | + maxButton.addActionListener(this); |
---|
| 619 | + } |
---|
| 620 | + |
---|
| 621 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 622 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 623 | + fullButton.addActionListener(this); |
---|
| 624 | + |
---|
| 625 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 626 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 627 | + screenfitButton.addActionListener(this); |
---|
| 628 | + |
---|
| 629 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 631 | + restoreCameraButton.addActionListener(this); |
---|
| 632 | + |
---|
| 633 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + saveButton.setToolTipText("New version"); |
---|
| 635 | + saveButton.addActionListener(this); |
---|
| 636 | + |
---|
| 637 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 638 | + undoButton.setToolTipText("Previous version"); |
---|
| 639 | + undoButton.addActionListener(this); |
---|
| 640 | + undoButton.setEnabled(false); |
---|
| 641 | + |
---|
| 642 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 643 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 644 | + restoreButton.setToolTipText("Restore current"); |
---|
| 645 | + restoreButton.addActionListener(this); |
---|
| 646 | + restoreButton.setEnabled(false); |
---|
| 647 | + |
---|
| 648 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + replaceButton.setToolTipText("Replace current"); |
---|
| 650 | + replaceButton.addActionListener(this); |
---|
| 651 | + replaceButton.setEnabled(false); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(updown); |
---|
| 654 | + |
---|
| 655 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + redoButton.setToolTipText("Next version"); |
---|
| 657 | + redoButton.addActionListener(this); |
---|
| 658 | + redoButton.setEnabled(false); |
---|
| 659 | + |
---|
| 660 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
555 | 661 | liveCB.setToolTipText("Enable animation"); |
---|
556 | 662 | liveCB.addItemListener(this); |
---|
557 | 663 | |
---|
558 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
559 | 665 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
560 | 666 | oneStepButton.addActionListener(this); |
---|
561 | 667 | |
---|
562 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 668 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
563 | 669 | fastCB.setToolTipText("Fast mode"); |
---|
564 | 670 | fastCB.addItemListener(this); |
---|
565 | 671 | |
---|
566 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
567 | | - trackCB.setToolTipText("Enable tracking"); |
---|
568 | | - trackCB.addItemListener(this); |
---|
569 | | - |
---|
570 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
571 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
572 | | - screenfitButton.addActionListener(this); |
---|
| 672 | + //oe.toolboxPanel.Return(); |
---|
| 673 | + |
---|
| 674 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 675 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 676 | +// trackCB.addItemListener(this); |
---|
573 | 677 | |
---|
574 | 678 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
575 | 679 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
581 | 685 | snapobjectButton.setToolTipText("Snap Object"); |
---|
582 | 686 | } |
---|
583 | 687 | |
---|
584 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
585 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
586 | | - flashSelectionButton.addActionListener(this); |
---|
| 688 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
587 | 689 | |
---|
588 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
589 | | - |
---|
590 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
591 | | - twoButton.setToolTipText("Show center view only"); |
---|
592 | | - twoButton.addActionListener(this); |
---|
593 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 690 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | 691 | fourButton.addActionListener(this); |
---|
595 | 692 | fourButton.setToolTipText("Show left panel only"); |
---|
596 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
597 | | - sixButton.setToolTipText("2-column layout left"); |
---|
| 693 | + |
---|
| 694 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + twoButton.setToolTipText("Show right view only"); |
---|
| 696 | + twoButton.addActionListener(this); |
---|
| 697 | + this.fullscreenLayout = twoButton; |
---|
| 698 | + |
---|
| 699 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 700 | + sixButton.setToolTipText("Show left and right"); |
---|
598 | 701 | sixButton.addActionListener(this); |
---|
599 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | | - threeButton.setToolTipText("2-column layout right"); |
---|
601 | | - threeButton.addActionListener(this); |
---|
602 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
603 | | - sevenButton.setToolTipText("3-column layout"); |
---|
604 | | - sevenButton.addActionListener(this); |
---|
| 702 | +// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 703 | +// threeButton.setToolTipText("2-column layout right"); |
---|
| 704 | +// threeButton.addActionListener(this); |
---|
| 705 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 706 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 707 | +// sevenButton.addActionListener(this); |
---|
605 | 708 | // |
---|
606 | 709 | |
---|
607 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 710 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
609 | 712 | rootButton.addActionListener(this); |
---|
610 | 713 | |
---|
611 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 714 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
612 | 715 | closeButton.setToolTipText("Close tab"); |
---|
613 | 716 | closeButton.addActionListener(this); |
---|
614 | 717 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
615 | 718 | //clearButton.addActionListener(this); |
---|
616 | | - |
---|
617 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 719 | + |
---|
| 720 | + // INSERT |
---|
| 721 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 722 | + gridButton.setToolTipText("Create grid"); |
---|
| 723 | + gridButton.addActionListener(this); |
---|
| 724 | + |
---|
| 725 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 726 | + boxButton.setToolTipText("Create box"); |
---|
| 727 | + boxButton.addActionListener(this); |
---|
| 728 | + |
---|
| 729 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 730 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 731 | + sphereButton.addActionListener(this); |
---|
| 732 | + |
---|
| 733 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 734 | + coneButton.setToolTipText("Create cone"); |
---|
| 735 | + coneButton.addActionListener(this); |
---|
| 736 | + |
---|
| 737 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + torusButton.setToolTipText("Create torus"); |
---|
| 739 | + torusButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 742 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 743 | + superButton.addActionListener(this); |
---|
| 744 | + |
---|
| 745 | + if (Globals.ADVANCED) |
---|
| 746 | + { |
---|
| 747 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 748 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 749 | + kleinButton.addActionListener(this); |
---|
| 750 | + } |
---|
618 | 751 | |
---|
619 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
620 | | - editButton.setToolTipText("Edit selection"); |
---|
| 752 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 753 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 754 | + particlesButton.addActionListener(this); |
---|
| 755 | + |
---|
| 756 | + oe.toolboxPanel.Return(); |
---|
| 757 | + |
---|
| 758 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 759 | + groupButton.setToolTipText("Create group"); |
---|
| 760 | + groupButton.addActionListener(this); |
---|
| 761 | + |
---|
| 762 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 763 | + compositeButton.setToolTipText("Create composite"); |
---|
| 764 | + compositeButton.addActionListener(this); |
---|
| 765 | + |
---|
| 766 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 767 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 768 | + switchButton.addActionListener(this); |
---|
| 769 | + |
---|
| 770 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 771 | + loopButton.setToolTipText("Create loop"); |
---|
| 772 | + loopButton.addActionListener(this); |
---|
| 773 | + |
---|
| 774 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 775 | + textureButton.setToolTipText("Create texture"); |
---|
| 776 | + textureButton.addActionListener(this); |
---|
| 777 | + |
---|
| 778 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 779 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 780 | + overlayButton.addActionListener(this); |
---|
| 781 | + |
---|
| 782 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 783 | + lightButton.setToolTipText("Create light"); |
---|
| 784 | + lightButton.addActionListener(this); |
---|
| 785 | + |
---|
| 786 | + for (int i=6; --i>=0;) |
---|
| 787 | + { |
---|
| 788 | + oe.toolboxPanel.Return(); |
---|
| 789 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 790 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 791 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 792 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 793 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 794 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 795 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 796 | + } |
---|
| 797 | + |
---|
| 798 | + // EDIT panel |
---|
| 799 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 800 | + editButton.setToolTipText("Pin selection controls"); |
---|
621 | 801 | editButton.addActionListener(this); |
---|
622 | 802 | |
---|
623 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 803 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 804 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
625 | 805 | uneditButton.addActionListener(this); |
---|
626 | 806 | |
---|
627 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
628 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 807 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 808 | + allParamsButton.setToolTipText("Show all controle"); |
---|
629 | 809 | allParamsButton.addActionListener(this); |
---|
630 | 810 | |
---|
631 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 811 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
632 | 812 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
633 | 813 | clearPanelButton.addActionListener(this); |
---|
634 | 814 | |
---|
635 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 815 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
636 | 816 | unselectButton.setToolTipText("Unselect"); |
---|
637 | 817 | unselectButton.addActionListener(this); |
---|
638 | 818 | |
---|
639 | | - commandsPanel.preferredHeight = 1; |
---|
| 819 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 820 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 821 | + flashSelectionButton.addActionListener(this); |
---|
640 | 822 | |
---|
641 | | - oe.treePanel.add(commandsPanel); |
---|
642 | | - oe.treePanel.Return(); |
---|
| 823 | + editCommandsPanel.preferredHeight = 1; |
---|
| 824 | + |
---|
| 825 | + SetPinStates(false); |
---|
| 826 | +// oe.treePanel.add(commandsPanel); |
---|
| 827 | +// oe.treePanel.Return(); |
---|
643 | 828 | |
---|
644 | 829 | // oe.aConstraints.gridx += 1; |
---|
645 | 830 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
656 | 841 | |
---|
657 | 842 | JScrollPane jSP; |
---|
658 | 843 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
659 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 844 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
660 | 845 | ResetModel(); |
---|
661 | 846 | |
---|
662 | 847 | oe.treePanel.add(jSPPanel); |
---|
663 | 848 | oe.treePanel.Return(); |
---|
664 | 849 | |
---|
665 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
666 | | - |
---|
667 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
668 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
669 | | - colorCB.addItemListener(this); |
---|
670 | | - |
---|
671 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
672 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
673 | | - materialCB.addItemListener(this); |
---|
674 | | - |
---|
675 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
676 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
677 | | - textureCB.addItemListener(this); |
---|
678 | | - |
---|
679 | | - copyOptionsPanel.preferredHeight = 1; |
---|
680 | 850 | oe.treePanel.add(copyOptionsPanel); |
---|
681 | 851 | oe.treePanel.Return(); |
---|
| 852 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 853 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 854 | + sliderPane.preferredHeight = 1; |
---|
682 | 855 | |
---|
683 | 856 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
684 | 857 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
701 | 874 | dgr.addDragGestureListener(this); |
---|
702 | 875 | }catch(Exception e) {} |
---|
703 | 876 | */ |
---|
704 | | - radio.layout = sevenButton; |
---|
| 877 | + radio.layout = sixButton; // sevenButton; |
---|
705 | 878 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
706 | 879 | } |
---|
707 | 880 | |
---|
708 | 881 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
709 | 882 | { |
---|
| 883 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 884 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 885 | + colorCB.addItemListener(this); |
---|
| 886 | + |
---|
| 887 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 888 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 889 | + materialCB.addItemListener(this); |
---|
| 890 | + |
---|
| 891 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 892 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 893 | + textureCB.addItemListener(this); |
---|
| 894 | + |
---|
| 895 | + panel.Return(); |
---|
| 896 | + |
---|
710 | 897 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
711 | 898 | boxCB.setToolTipText("Display bounding boxes"); |
---|
712 | 899 | boxCB.addItemListener(this); |
---|
713 | 900 | |
---|
714 | 901 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
715 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 902 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
716 | 903 | zoomBoxCB.addItemListener(this); |
---|
717 | 904 | |
---|
718 | 905 | if (true) // Globals.ADVANCED) |
---|
719 | 906 | { |
---|
720 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
721 | | - supportCB.setToolTipText("Enable rigging"); |
---|
722 | | - supportCB.addItemListener(this); |
---|
| 907 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 908 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 909 | +// supportCB.addItemListener(this); |
---|
| 910 | + |
---|
| 911 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 912 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 913 | + freezeCB.addItemListener(this); |
---|
723 | 914 | |
---|
724 | 915 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
725 | 916 | // localCB.addItemListener(this); |
---|
726 | 917 | |
---|
| 918 | + panel.Return(); |
---|
| 919 | + |
---|
727 | 920 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
728 | 921 | crowdCB.setToolTipText("Used for crowds"); |
---|
729 | 922 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
740 | 933 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
741 | 934 | // speakerMocapCB.addItemListener(this); |
---|
742 | 935 | |
---|
| 936 | + panel.Return(); |
---|
| 937 | + |
---|
743 | 938 | if (false) |
---|
744 | 939 | { |
---|
745 | 940 | // handled in scripts |
---|
.. | .. |
---|
754 | 949 | //constraints.gridy += 1; |
---|
755 | 950 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
756 | 951 | smoothfocusCB.addItemListener(this); |
---|
| 952 | + panel.Return(); |
---|
757 | 953 | } |
---|
758 | 954 | |
---|
759 | 955 | //constraints.gridx += 1; |
---|
760 | 956 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
761 | 957 | // debugCB.addItemListener(this); |
---|
762 | 958 | |
---|
| 959 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 960 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 961 | + trackCB.addItemListener(this); |
---|
| 962 | + |
---|
763 | 963 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 964 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
764 | 965 | oeilCB.addItemListener(this); |
---|
765 | 966 | |
---|
| 967 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 968 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 969 | + shadowCB.addItemListener(this); |
---|
| 970 | + |
---|
| 971 | + panel.Return(); |
---|
| 972 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 973 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 974 | + toggleTextureCB.addItemListener(this); |
---|
| 975 | + |
---|
| 976 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 977 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 978 | + toggleSwitchCB.addItemListener(this); |
---|
| 979 | + |
---|
| 980 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 981 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 982 | + autokeepCB.addItemListener(this); |
---|
| 983 | + |
---|
| 984 | + panel.Return(); |
---|
| 985 | + if (Globals.ADVANCED) |
---|
| 986 | + { |
---|
766 | 987 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
767 | 988 | lookAtCB.setToolTipText("Look-at target"); |
---|
768 | 989 | lookAtCB.addItemListener(this); |
---|
| 990 | + } |
---|
769 | 991 | |
---|
770 | 992 | } |
---|
771 | 993 | |
---|
772 | 994 | cGridBag fill = new cGridBag(); |
---|
773 | | - |
---|
774 | 995 | fill.preferredHeight = 200; |
---|
| 996 | + cGridBag fill2 = new cGridBag(); |
---|
| 997 | + fill2.preferredHeight = 200; |
---|
| 998 | + cGridBag fill3 = new cGridBag(); |
---|
| 999 | + fill3.preferredHeight = 200; |
---|
775 | 1000 | |
---|
776 | 1001 | panel.add(fill); |
---|
| 1002 | + panel.add(fill2); |
---|
| 1003 | + panel.add(fill3); |
---|
777 | 1004 | |
---|
778 | 1005 | } |
---|
779 | 1006 | |
---|
780 | 1007 | void EditObject(Object3D obj) |
---|
781 | 1008 | { |
---|
782 | 1009 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1010 | + |
---|
| 1011 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1012 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1013 | + if (!radioButton.hadMaterial) |
---|
| 1014 | + { |
---|
| 1015 | + obj.material = new cMaterial(); |
---|
| 1016 | + } |
---|
| 1017 | + |
---|
783 | 1018 | radioButton.SetObject(obj); |
---|
784 | | - radioButton.layout = sevenButton; |
---|
| 1019 | + radioButton.layout = sixButton; // sevenButton; |
---|
785 | 1020 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
786 | 1021 | radioButton.addActionListener(this); |
---|
787 | 1022 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
791 | 1026 | |
---|
792 | 1027 | void SetupViews(ObjEditor oe) |
---|
793 | 1028 | { |
---|
| 1029 | + theFrame = this; |
---|
| 1030 | + |
---|
794 | 1031 | oe.SetupViews(); |
---|
795 | 1032 | |
---|
796 | 1033 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
799 | 1036 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
800 | 1037 | } |
---|
801 | 1038 | |
---|
802 | | - JCheckBox liveCB; |
---|
803 | | - JCheckBox supportCB; |
---|
804 | | - JCheckBox localCB; |
---|
805 | | - JCheckBox crowdCB; |
---|
806 | | - JCheckBox smoothCB; |
---|
807 | | - JCheckBox fastCB; |
---|
808 | | - JCheckBox slowCB; |
---|
809 | | - JCheckBox boxCB; |
---|
810 | | - JCheckBox zoomBoxCB; |
---|
811 | | - JCheckBox trackCB; |
---|
812 | | - JCheckBox smoothfocusCB; |
---|
| 1039 | + cToggleButton liveCB; |
---|
| 1040 | + cCheckBox supportCB; |
---|
| 1041 | + cCheckBox localCB; |
---|
| 1042 | + cCheckBox crowdCB; |
---|
| 1043 | + cCheckBox smoothCB; |
---|
| 1044 | + cToggleButton fastCB; |
---|
| 1045 | + cCheckBox slowCB; |
---|
| 1046 | + cCheckBox boxCB; |
---|
| 1047 | + cCheckBox zoomBoxCB; |
---|
| 1048 | + cCheckBox freezeCB; |
---|
| 1049 | + //cToggleButton trackCB; |
---|
| 1050 | + cCheckBox trackCB; |
---|
| 1051 | + cCheckBox smoothfocusCB; |
---|
813 | 1052 | // JCheckBox speakerMocapCB; |
---|
814 | | - JCheckBox speakerCameraCB; |
---|
815 | | - JCheckBox speakerFocusCB; |
---|
816 | | - JCheckBox debugCB; |
---|
817 | | - JCheckBox oeilCB; |
---|
818 | | - JCheckBox lookAtCB; |
---|
| 1053 | + cCheckBox speakerCameraCB; |
---|
| 1054 | + cCheckBox speakerFocusCB; |
---|
| 1055 | + cCheckBox debugCB; |
---|
| 1056 | + |
---|
| 1057 | + cCheckBox oeilCB; |
---|
| 1058 | + cCheckBox shadowCB; |
---|
| 1059 | + cCheckBox autokeepCB; |
---|
| 1060 | + cCheckBox lookAtCB; |
---|
819 | 1061 | |
---|
820 | 1062 | // static int COLOR = 1; |
---|
821 | 1063 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
823 | 1065 | |
---|
824 | 1066 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
825 | 1067 | |
---|
826 | | - JCheckBox colorCB; |
---|
827 | | - JCheckBox materialCB; |
---|
828 | | - JCheckBox textureCB; |
---|
| 1068 | + cCheckBox colorCB; |
---|
| 1069 | + cCheckBox materialCB; |
---|
| 1070 | + cCheckBox textureCB; |
---|
829 | 1071 | |
---|
830 | 1072 | public void itemStateChanged(ItemEvent e) |
---|
831 | 1073 | { |
---|
.. | .. |
---|
853 | 1095 | } else if(e.getSource() == liveCB) |
---|
854 | 1096 | { |
---|
855 | 1097 | cameraView.ToggleLive(); |
---|
| 1098 | + refreshContents(false); |
---|
856 | 1099 | } |
---|
857 | 1100 | else if(e.getSource() == supportCB) |
---|
858 | 1101 | { |
---|
.. | .. |
---|
917 | 1160 | { |
---|
918 | 1161 | cameraView.ToggleOeil(); |
---|
919 | 1162 | } |
---|
| 1163 | + else if(e.getSource() == shadowCB) |
---|
| 1164 | + { |
---|
| 1165 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1166 | + } |
---|
| 1167 | + else if(e.getSource() == freezeCB) |
---|
| 1168 | + { |
---|
| 1169 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1170 | + } |
---|
| 1171 | + else if(e.getSource() == autokeepCB) |
---|
| 1172 | + { |
---|
| 1173 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1174 | + } |
---|
920 | 1175 | else if(e.getSource() == lookAtCB) |
---|
921 | 1176 | { |
---|
922 | 1177 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
933 | 1188 | |
---|
934 | 1189 | /**/ |
---|
935 | 1190 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
936 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1191 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1192 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
937 | 1193 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
938 | 1194 | // We can't move the root node or an empty selection |
---|
939 | 1195 | return; |
---|
.. | .. |
---|
996 | 1252 | } |
---|
997 | 1253 | } |
---|
998 | 1254 | |
---|
999 | | - String string = (String) object; |
---|
1000 | | - |
---|
1001 | 1255 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1002 | 1256 | // if( object instanceof java.io.File[]) |
---|
1003 | 1257 | // { |
---|
.. | .. |
---|
1005 | 1259 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1006 | 1260 | // return; |
---|
1007 | 1261 | // } |
---|
| 1262 | + |
---|
| 1263 | + String string = object.toString(); |
---|
1008 | 1264 | |
---|
1009 | 1265 | // File path for Mac and Windows |
---|
1010 | 1266 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1050 | 1306 | |
---|
1051 | 1307 | assert target == objEditor.jTree; |
---|
1052 | 1308 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1309 | + Object3D destinationLeaf; |
---|
1053 | 1310 | try { |
---|
1054 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1311 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1055 | 1312 | } catch (Exception e) { |
---|
1056 | 1313 | System.out.println("destinationPath : " + destinationPath); |
---|
1057 | 1314 | return; |
---|
1058 | 1315 | } |
---|
1059 | 1316 | |
---|
1060 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1317 | + for (int i=group.selection.size(); --i>=0;) |
---|
1061 | 1318 | { |
---|
| 1319 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1320 | + |
---|
| 1321 | + // Cannot move into itself |
---|
| 1322 | + if (child == destinationLeaf) |
---|
| 1323 | + return; |
---|
| 1324 | + } |
---|
| 1325 | + |
---|
| 1326 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1327 | +// { |
---|
1062 | 1328 | loadClipboard(true); |
---|
1063 | 1329 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1064 | 1330 | pasteInto(false, false); |
---|
1065 | | - } else { |
---|
1066 | | - loadClipboard(false); |
---|
1067 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1068 | | - pasteInto(false, false); // true); // ??? |
---|
1069 | | - } |
---|
| 1331 | +// } else { |
---|
| 1332 | +// loadClipboard(false); |
---|
| 1333 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1334 | +// pasteInto(false, false); // true); // ??? |
---|
| 1335 | +// } |
---|
1070 | 1336 | } |
---|
1071 | 1337 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1072 | 1338 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1171 | 1437 | { |
---|
1172 | 1438 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1173 | 1439 | //heightFieldItem.addActionListener(this); |
---|
1174 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1175 | | - gridItem.addActionListener(this); |
---|
1176 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1177 | | - rectoidItem.addActionListener(this); |
---|
1178 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1179 | | - ellipsoidItem.addActionListener(this); |
---|
1180 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1181 | | - coneItem.addActionListener(this); |
---|
1182 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1183 | | - torusItem.addActionListener(this); |
---|
1184 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1185 | | - superItem.addActionListener(this); |
---|
| 1440 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1441 | +// gridItem.addActionListener(this); |
---|
| 1442 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1443 | +// rectoidItem.addActionListener(this); |
---|
| 1444 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1445 | +// ellipsoidItem.addActionListener(this); |
---|
| 1446 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1447 | +// coneItem.addActionListener(this); |
---|
| 1448 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1449 | +// torusItem.addActionListener(this); |
---|
| 1450 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1451 | +// superItem.addActionListener(this); |
---|
| 1452 | + |
---|
| 1453 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1454 | + cameraItem.addActionListener(this); |
---|
| 1455 | + |
---|
| 1456 | + if (!Globals.ADVANCED) |
---|
| 1457 | + { |
---|
1186 | 1458 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1187 | 1459 | kleinItem.addActionListener(this); |
---|
1188 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1189 | | - particleItem.addActionListener(this); |
---|
| 1460 | + } |
---|
| 1461 | + |
---|
| 1462 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1463 | +// particleItem.addActionListener(this); |
---|
1190 | 1464 | if (Globals.ADVANCED) |
---|
1191 | 1465 | { |
---|
1192 | 1466 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1212 | 1486 | } |
---|
1213 | 1487 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1214 | 1488 | bezierItem.addActionListener(this); |
---|
1215 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1216 | | - overlayItem.addActionListener(this); |
---|
1217 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1218 | | - lightItem.addActionListener(this); |
---|
| 1489 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1490 | +// overlayItem.addActionListener(this); |
---|
| 1491 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1492 | +// lightItem.addActionListener(this); |
---|
1219 | 1493 | menu.add("-"); |
---|
1220 | 1494 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1221 | 1495 | //superLoopItem.addActionListener(this); |
---|
1222 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1223 | | - loopItem.addActionListener(this); |
---|
| 1496 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1497 | +// loopItem.addActionListener(this); |
---|
1224 | 1498 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1225 | 1499 | doubleItem.addActionListener(this); |
---|
1226 | 1500 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1236 | 1510 | animationItem.addItemListener(this); |
---|
1237 | 1511 | animationItem.setState(Globals.ANIMATION); |
---|
1238 | 1512 | |
---|
| 1513 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1514 | + archiveItem.addActionListener(this); |
---|
| 1515 | + |
---|
1239 | 1516 | menu.add("-"); |
---|
1240 | 1517 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1241 | 1518 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1248 | 1525 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1249 | 1526 | reduce34MorphItem.addActionListener(this); |
---|
1250 | 1527 | menu.add("-"); |
---|
| 1528 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1529 | + memoryItem.addActionListener(this); |
---|
1251 | 1530 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1252 | 1531 | computeAOItem.addActionListener(this); |
---|
1253 | 1532 | |
---|
.. | .. |
---|
1256 | 1535 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1257 | 1536 | mirrorItem.addActionListener(this); |
---|
1258 | 1537 | menu.add("-"); |
---|
1259 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1260 | | - memoryItem.addActionListener(this); |
---|
1261 | 1538 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1262 | 1539 | analyzeItem.addActionListener(this); |
---|
1263 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1540 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1264 | 1541 | dumpItem.addActionListener(this); |
---|
1265 | 1542 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1266 | 1543 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1401 | 1678 | shadow.material = new cMaterial(obj.material); |
---|
1402 | 1679 | shadow.material.diffuse = 0.0001f; |
---|
1403 | 1680 | shadow.material.specular = 0.0001f; |
---|
| 1681 | + //shadow.projectedVertices[1].x = 300; |
---|
1404 | 1682 | |
---|
1405 | 1683 | makeSomething(shadow); |
---|
1406 | 1684 | } |
---|
| 1685 | + |
---|
| 1686 | + private void ClearUnpinned() |
---|
| 1687 | + { |
---|
| 1688 | + //for (Object3D obj : listUI) |
---|
| 1689 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1690 | + { |
---|
| 1691 | + Object3D obj = listUI.elementAt(i); |
---|
| 1692 | + if (!obj.pinned) |
---|
| 1693 | + { |
---|
| 1694 | + obj.CloseUI(); |
---|
| 1695 | + listUI.remove(i); |
---|
| 1696 | + } |
---|
| 1697 | + } |
---|
| 1698 | + } |
---|
| 1699 | + |
---|
| 1700 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1701 | + { |
---|
| 1702 | + // if (!(elem instanceof Composite)) |
---|
| 1703 | + // newWindow = false; |
---|
| 1704 | + listUI.add(elem); |
---|
| 1705 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1706 | + System.out.println("edit : " + elem); |
---|
| 1707 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1708 | + } |
---|
1407 | 1709 | |
---|
1408 | 1710 | /** |
---|
1409 | 1711 | * applyExample |
---|
.. | .. |
---|
1648 | 1950 | { |
---|
1649 | 1951 | ScreenFit(); |
---|
1650 | 1952 | } else |
---|
1651 | | - if (source == switchItem) |
---|
| 1953 | + if (source == switchViewItem) |
---|
1652 | 1954 | { |
---|
1653 | 1955 | cVector v1 = new cVector(); |
---|
1654 | 1956 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1657 | 1959 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1658 | 1960 | objEditor.cameraView.repaint(); |
---|
1659 | 1961 | } else |
---|
1660 | | - if (source == rectoidItem) |
---|
| 1962 | + if (source == rectoidItem || source == boxButton) |
---|
1661 | 1963 | { |
---|
1662 | 1964 | makeSomething(new Box()); |
---|
1663 | 1965 | } else |
---|
1664 | | - if (source == particleItem) |
---|
| 1966 | + if (source == particleItem || source == particlesButton) |
---|
1665 | 1967 | { |
---|
1666 | 1968 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1667 | 1969 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1740 | 2042 | |
---|
1741 | 2043 | makeSomething(obj); |
---|
1742 | 2044 | } else |
---|
1743 | | - if (source == gridItem) |
---|
| 2045 | + if (source == gridItem || source == gridButton) |
---|
1744 | 2046 | { |
---|
1745 | 2047 | makeSomething(new Grid()); |
---|
1746 | 2048 | } else |
---|
1747 | | - if (source == ellipsoidItem) |
---|
| 2049 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1748 | 2050 | { |
---|
1749 | 2051 | makeSomething(new Sphere()); |
---|
1750 | 2052 | } else |
---|
1751 | | - if (source == coneItem) |
---|
| 2053 | + if (source == coneItem || source == coneButton) |
---|
1752 | 2054 | { |
---|
1753 | 2055 | makeSomething(new Cone()); |
---|
1754 | 2056 | } else |
---|
1755 | | - if (source == torusItem) |
---|
| 2057 | + if (source == torusItem || source == torusButton) |
---|
1756 | 2058 | { |
---|
1757 | 2059 | makeSomething(new Torus()); |
---|
1758 | 2060 | } else |
---|
1759 | | - if (source == superItem) |
---|
| 2061 | + if (source == superItem || source == superButton) |
---|
1760 | 2062 | { |
---|
1761 | 2063 | makeSomething(new Superellipsoid()); |
---|
1762 | 2064 | } else |
---|
1763 | | - if (source == kleinItem) |
---|
| 2065 | + if (source == kleinItem || source == kleinButton) |
---|
1764 | 2066 | { |
---|
1765 | 2067 | makeSomething(new Klein()); |
---|
1766 | 2068 | } else |
---|
.. | .. |
---|
1780 | 2082 | { |
---|
1781 | 2083 | makeSomething(new BezierSurface()); |
---|
1782 | 2084 | } else |
---|
1783 | | - if (source == overlayItem) |
---|
| 2085 | + if (source == overlayItem || source == overlayButton) |
---|
1784 | 2086 | { |
---|
1785 | 2087 | /* |
---|
1786 | 2088 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1828 | 2130 | s.setup(); |
---|
1829 | 2131 | makeSomething(s); |
---|
1830 | 2132 | } else |
---|
1831 | | - if (source == lightItem) |
---|
| 2133 | + if (source == lightItem || source == lightButton) |
---|
1832 | 2134 | { |
---|
1833 | 2135 | makeSomething(new Light()); |
---|
1834 | 2136 | } else |
---|
.. | .. |
---|
1878 | 2180 | |
---|
1879 | 2181 | group(g); |
---|
1880 | 2182 | } else |
---|
1881 | | - if (source == loopItem) |
---|
| 2183 | + if (source == loopItem || source == loopButton) |
---|
1882 | 2184 | { |
---|
1883 | 2185 | Composite csg = new GroupLeaf(); |
---|
1884 | 2186 | csg.count = 5; |
---|
1885 | 2187 | group(csg); |
---|
1886 | | - Composite child = new cGroup(); |
---|
| 2188 | + Composite child = new cGroup("Branch"); |
---|
1887 | 2189 | csg.addChild(child); |
---|
1888 | 2190 | child.addChild(csg); |
---|
1889 | 2191 | } else |
---|
1890 | 2192 | if (source == doubleItem) |
---|
1891 | 2193 | { |
---|
1892 | | - Composite csg = new GroupLeaf(); |
---|
| 2194 | + Composite csg = new GroupLeaf("Fork"); |
---|
1893 | 2195 | csg.count = 5; |
---|
1894 | 2196 | group(csg); |
---|
1895 | | - Composite child = new cGroup(); |
---|
| 2197 | + Composite child = new cGroup("Branch A"); |
---|
1896 | 2198 | csg.addChild(child); |
---|
1897 | 2199 | child.addChild(csg); |
---|
1898 | | - child = new cGroup(); |
---|
| 2200 | + child = new cGroup("Branch B"); |
---|
1899 | 2201 | csg.addChild(child); |
---|
1900 | 2202 | child.addChild(csg); |
---|
1901 | 2203 | } else |
---|
1902 | 2204 | if (source == tripleItem) |
---|
1903 | 2205 | { |
---|
1904 | | - Composite csg = new GroupLeaf(); |
---|
| 2206 | + Composite csg = new GroupLeaf("Trident"); |
---|
1905 | 2207 | csg.count = 4; |
---|
1906 | 2208 | group(csg); |
---|
1907 | 2209 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1951 | 2253 | { |
---|
1952 | 2254 | DumpObject(); |
---|
1953 | 2255 | } else |
---|
| 2256 | + if (source == minButton) |
---|
| 2257 | + { |
---|
| 2258 | + Minimize(); |
---|
| 2259 | + } else |
---|
| 2260 | + if (source == maxButton) |
---|
| 2261 | + { |
---|
| 2262 | + Maximize(); |
---|
| 2263 | + } else |
---|
| 2264 | + if (source == fullButton) |
---|
| 2265 | + { |
---|
| 2266 | + ToggleFullScreen(); |
---|
| 2267 | + } else |
---|
| 2268 | + if (source == undoButton) |
---|
| 2269 | + { |
---|
| 2270 | + // Go to previous version |
---|
| 2271 | + //if (!Undo()) |
---|
| 2272 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2273 | + Undo(); |
---|
| 2274 | + } else |
---|
| 2275 | + if (source == restoreButton) |
---|
| 2276 | + { |
---|
| 2277 | + // Restore current version |
---|
| 2278 | + Restore(); |
---|
| 2279 | + } else |
---|
| 2280 | + if (source == replaceButton) |
---|
| 2281 | + { |
---|
| 2282 | + // Overwrite current version |
---|
| 2283 | + Replace(); |
---|
| 2284 | + } else |
---|
| 2285 | + if (source == redoButton) |
---|
| 2286 | + { |
---|
| 2287 | + // Go to next version |
---|
| 2288 | + Redo(); |
---|
| 2289 | + } else |
---|
| 2290 | + if (source == saveButton) |
---|
| 2291 | + { |
---|
| 2292 | + // Save a new version |
---|
| 2293 | + if (!Save(true)) |
---|
| 2294 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2295 | + } else |
---|
1954 | 2296 | if (source == oneStepButton) |
---|
1955 | 2297 | { |
---|
1956 | 2298 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1958 | 2300 | } else |
---|
1959 | 2301 | if (source == screenfitButton) |
---|
1960 | 2302 | { |
---|
1961 | | - //Reload(lastConverter, lastFilename, true); |
---|
1962 | 2303 | ScreenFit(); |
---|
1963 | 2304 | } else |
---|
1964 | 2305 | if (source == screenfitpointButton) |
---|
1965 | 2306 | { |
---|
1966 | | - //Reload(lastConverter, lastFilename, true); |
---|
1967 | 2307 | ScreenFitPoint(); |
---|
1968 | 2308 | } else |
---|
1969 | 2309 | if (source == snapobjectButton) |
---|
1970 | 2310 | { |
---|
1971 | | - //Reload(lastConverter, lastFilename, true); |
---|
1972 | 2311 | SnapObject(); |
---|
1973 | 2312 | } else |
---|
1974 | 2313 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2004 | 2343 | if (source == cutItem || source == clearButton) |
---|
2005 | 2344 | { |
---|
2006 | 2345 | loadClipboard(true); |
---|
| 2346 | + } else |
---|
| 2347 | + if (source == undoItem) |
---|
| 2348 | + { |
---|
| 2349 | + Undo(); |
---|
| 2350 | + } else |
---|
| 2351 | + if (source == redoItem) |
---|
| 2352 | + { |
---|
| 2353 | + Redo(); |
---|
2007 | 2354 | } else |
---|
2008 | 2355 | if (source == duplicateItem) |
---|
2009 | 2356 | { |
---|
.. | .. |
---|
2324 | 2671 | { |
---|
2325 | 2672 | StepAll(); |
---|
2326 | 2673 | } else |
---|
2327 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2674 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2328 | 2675 | { |
---|
2329 | 2676 | //int indices[] = jList.getSelectedIndices(); |
---|
2330 | 2677 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2336 | 2683 | { |
---|
2337 | 2684 | ClearSelection(true); |
---|
2338 | 2685 | } else |
---|
2339 | | - if (source == grabItem) |
---|
| 2686 | + if (source == grabItem || source == groupButton) |
---|
2340 | 2687 | { |
---|
2341 | | - group(new cGroup(), true); |
---|
| 2688 | + group(new cGroup(), false); // true); |
---|
2342 | 2689 | } else |
---|
2343 | 2690 | if (source == hideItem) |
---|
2344 | 2691 | { |
---|
.. | .. |
---|
2356 | 2703 | { |
---|
2357 | 2704 | makeSomething(new Camera()); |
---|
2358 | 2705 | } else |
---|
2359 | | - if (source == compositeItem) |
---|
| 2706 | + if (source == compositeItem || source == compositeButton) |
---|
2360 | 2707 | { |
---|
2361 | 2708 | group(new Composite()); |
---|
2362 | 2709 | } else |
---|
2363 | | - if (source == randomItem) |
---|
| 2710 | + if (source == switchItem || source == switchButton) |
---|
2364 | 2711 | { |
---|
2365 | 2712 | RandomNode random = new RandomNode(); |
---|
2366 | 2713 | group(random); |
---|
.. | .. |
---|
2462 | 2809 | { |
---|
2463 | 2810 | group(new cLinker()); |
---|
2464 | 2811 | } else |
---|
2465 | | - if (source == textureItem) |
---|
| 2812 | + if (source == textureItem || source == textureButton) |
---|
2466 | 2813 | { |
---|
2467 | 2814 | group(new TextureNode()); |
---|
2468 | 2815 | } else |
---|
.. | .. |
---|
2482 | 2829 | { |
---|
2483 | 2830 | CastShadow(2); |
---|
2484 | 2831 | } else |
---|
2485 | | - if (source == ungroupItem) |
---|
| 2832 | + if (source == ungroupItem || source == ungroupButton) |
---|
2486 | 2833 | { |
---|
2487 | | - //ungroup(); |
---|
| 2834 | + boolean hasRoot = false; |
---|
| 2835 | + |
---|
2488 | 2836 | for (int i=0; i<group.selection.size(); i++) |
---|
2489 | 2837 | { |
---|
2490 | | - Ungroup(group.selection.get(i)); |
---|
| 2838 | + if (group.selection.get(i) == group) |
---|
| 2839 | + { |
---|
| 2840 | + hasRoot = true; |
---|
| 2841 | + break; |
---|
| 2842 | + } |
---|
2491 | 2843 | } |
---|
2492 | 2844 | |
---|
2493 | | - ClearSelection(false); |
---|
2494 | | - |
---|
2495 | | - refreshContents(); |
---|
| 2845 | + if (!hasRoot) |
---|
| 2846 | + { |
---|
| 2847 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2848 | + { |
---|
| 2849 | + Ungroup(group.selection.get(i)); |
---|
| 2850 | + } |
---|
| 2851 | + |
---|
| 2852 | + ClearSelection(false); |
---|
| 2853 | + |
---|
| 2854 | + refreshContents(); |
---|
| 2855 | + } |
---|
2496 | 2856 | } else |
---|
2497 | 2857 | if (source == genUVItem) |
---|
2498 | 2858 | { |
---|
.. | .. |
---|
2504 | 2864 | } else |
---|
2505 | 2865 | if (source == genNormalsMESHItem) |
---|
2506 | 2866 | { |
---|
2507 | | - GenNormals(true); // TODO |
---|
| 2867 | + GenNormalsMESH(); |
---|
2508 | 2868 | } else |
---|
2509 | 2869 | if (source == genNormalsORGANItem) |
---|
2510 | 2870 | { |
---|
.. | .. |
---|
2569 | 2929 | if (source == unmarkleavesItem) |
---|
2570 | 2930 | { |
---|
2571 | 2931 | MarkLeaves(false); |
---|
| 2932 | + } else |
---|
| 2933 | + if (source == rewindleavesItem) |
---|
| 2934 | + { |
---|
| 2935 | + RewindLeaves(true); |
---|
| 2936 | + } else |
---|
| 2937 | + if (source == unrewindleavesItem) |
---|
| 2938 | + { |
---|
| 2939 | + RewindLeaves(false); |
---|
| 2940 | + } else |
---|
| 2941 | + if (source == randomleavesItem) |
---|
| 2942 | + { |
---|
| 2943 | + RandomLeaves(true); |
---|
| 2944 | + } else |
---|
| 2945 | + if (source == unrandomleavesItem) |
---|
| 2946 | + { |
---|
| 2947 | + RandomLeaves(false); |
---|
2572 | 2948 | } else |
---|
2573 | 2949 | if (source == flipVItem) |
---|
2574 | 2950 | { |
---|
.. | .. |
---|
2804 | 3180 | if (source == twoButton) |
---|
2805 | 3181 | { |
---|
2806 | 3182 | radio.layout = twoButton; |
---|
| 3183 | + |
---|
| 3184 | + if (CameraPane.FULLSCREEN) |
---|
| 3185 | + fullscreenLayout = radio.layout; |
---|
| 3186 | + |
---|
2807 | 3187 | // bug |
---|
2808 | 3188 | //gridPanel.setDividerLocation(1.0); |
---|
2809 | 3189 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2836 | 3216 | bigThree.ClearUI(); |
---|
2837 | 3217 | bigThree.add(centralPanel); |
---|
2838 | 3218 | bigThree.FlushUI(); |
---|
| 3219 | + |
---|
| 3220 | + cameraView.requestFocusInWindow(); |
---|
| 3221 | + |
---|
| 3222 | +// refreshContents(true); |
---|
| 3223 | +// |
---|
| 3224 | +// try |
---|
| 3225 | +// { |
---|
| 3226 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3227 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3228 | +// bot.mouseMove(100, 100); |
---|
| 3229 | +// bot.mousePress(mask); |
---|
| 3230 | +// bot.mouseRelease(mask); |
---|
| 3231 | +// } |
---|
| 3232 | +// catch (Exception e) |
---|
| 3233 | +// { |
---|
| 3234 | +// |
---|
| 3235 | +// } |
---|
| 3236 | + |
---|
2839 | 3237 | } else |
---|
2840 | 3238 | if (source == threeButton) |
---|
2841 | 3239 | { |
---|
2842 | 3240 | radio.layout = threeButton; |
---|
| 3241 | + |
---|
| 3242 | + if (CameraPane.FULLSCREEN) |
---|
| 3243 | + fullscreenLayout = radio.layout; |
---|
2843 | 3244 | |
---|
2844 | 3245 | // bigThree.remove(scenePanel); |
---|
2845 | 3246 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2872 | 3273 | bigThree.add(centralPanel); |
---|
2873 | 3274 | bigThree.add(XYZPanel); |
---|
2874 | 3275 | bigThree.FlushUI(); |
---|
| 3276 | + |
---|
| 3277 | + cameraView.requestFocusInWindow(); |
---|
2875 | 3278 | } else |
---|
2876 | 3279 | if (source == fourButton) |
---|
2877 | 3280 | { |
---|
2878 | 3281 | radio.layout = fourButton; |
---|
| 3282 | + |
---|
| 3283 | + if (CameraPane.FULLSCREEN) |
---|
| 3284 | + fullscreenLayout = radio.layout; |
---|
2879 | 3285 | |
---|
2880 | 3286 | // bigThree.remove(scenePanel); |
---|
2881 | 3287 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2907 | 3313 | bigThree.ClearUI(); |
---|
2908 | 3314 | bigThree.add(scenePanel); |
---|
2909 | 3315 | bigThree.FlushUI(); |
---|
| 3316 | + |
---|
| 3317 | + cameraView.requestFocusInWindow(); |
---|
2910 | 3318 | } else |
---|
2911 | 3319 | if (source == sixButton) |
---|
2912 | 3320 | { |
---|
2913 | 3321 | radio.layout = sixButton; |
---|
| 3322 | + |
---|
| 3323 | + if (CameraPane.FULLSCREEN) |
---|
| 3324 | + fullscreenLayout = radio.layout; |
---|
2914 | 3325 | |
---|
2915 | 3326 | // bigThree.remove(scenePanel); |
---|
2916 | 3327 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2943 | 3354 | bigThree.add(scenePanel); |
---|
2944 | 3355 | bigThree.add(centralPanel); |
---|
2945 | 3356 | bigThree.FlushUI(); |
---|
| 3357 | + |
---|
| 3358 | + cameraView.requestFocusInWindow(); |
---|
2946 | 3359 | } else |
---|
2947 | 3360 | if (source == sevenButton) |
---|
2948 | 3361 | { |
---|
2949 | 3362 | radio.layout = sevenButton; |
---|
| 3363 | + |
---|
| 3364 | + if (CameraPane.FULLSCREEN) |
---|
| 3365 | + fullscreenLayout = radio.layout; |
---|
2950 | 3366 | |
---|
2951 | 3367 | // bigThree.remove(scenePanel); |
---|
2952 | 3368 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2980 | 3396 | bigThree.add(centralPanel); |
---|
2981 | 3397 | bigThree.add(XYZPanel); |
---|
2982 | 3398 | bigThree.FlushUI(); |
---|
| 3399 | + |
---|
| 3400 | + cameraView.requestFocusInWindow(); |
---|
2983 | 3401 | } else |
---|
2984 | 3402 | if (source == rootButton) |
---|
2985 | 3403 | { |
---|
.. | .. |
---|
2991 | 3409 | EditObject(obj); |
---|
2992 | 3410 | } |
---|
2993 | 3411 | |
---|
| 3412 | + cameraView.requestFocusInWindow(); |
---|
2994 | 3413 | refreshContents(true); |
---|
2995 | 3414 | } else |
---|
2996 | 3415 | if (source == closeButton) |
---|
.. | .. |
---|
3000 | 3419 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3001 | 3420 | { |
---|
3002 | 3421 | ab = (cRadio)e.nextElement(); |
---|
3003 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3422 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3004 | 3423 | { |
---|
| 3424 | + // Patch to avoid bug with transparency. |
---|
| 3425 | + if (!ab.hadMaterial) |
---|
| 3426 | + { |
---|
| 3427 | + ab.object.material = null; |
---|
| 3428 | + } |
---|
| 3429 | + |
---|
3005 | 3430 | buttonGroup.remove(ab); |
---|
3006 | 3431 | radioPanel.remove(ab); |
---|
3007 | 3432 | |
---|
3008 | | - ab.GetObject().editWindow = null; |
---|
| 3433 | + //ab.GetObject().editWindow = null; |
---|
| 3434 | + ab.GetObject().manipWindow = null; |
---|
3009 | 3435 | // ab.GetObject().objectUI = null; // ????????? |
---|
3010 | 3436 | |
---|
3011 | 3437 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3012 | 3438 | break; |
---|
3013 | 3439 | } |
---|
3014 | 3440 | } |
---|
| 3441 | + |
---|
| 3442 | + cameraView.requestFocusInWindow(); |
---|
3015 | 3443 | refreshContents(true); |
---|
3016 | 3444 | } else |
---|
3017 | 3445 | if (source == editItem || source == editButton) |
---|
3018 | 3446 | { |
---|
| 3447 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3448 | + { |
---|
| 3449 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3450 | + child.pinned = true; |
---|
| 3451 | + } |
---|
| 3452 | + |
---|
3019 | 3453 | EditSelection(false); |
---|
3020 | 3454 | } else |
---|
3021 | 3455 | if (source == uneditButton) |
---|
.. | .. |
---|
3025 | 3459 | Object3D child = (Object3D)e.nextElement(); |
---|
3026 | 3460 | if(child.editWindow != null) |
---|
3027 | 3461 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3462 | + child.pinned = false; |
---|
3028 | 3463 | child.CloseUI(); |
---|
3029 | 3464 | listUI.remove(child); |
---|
3030 | 3465 | |
---|
3031 | | - child.editWindow = null; // ??????????? |
---|
| 3466 | + //child.editWindow = null; // ??????????? |
---|
3032 | 3467 | } |
---|
3033 | 3468 | objEditor.ctrlPanel.FlushUI(); |
---|
3034 | 3469 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3041 | 3476 | //copy.ClearUI(); |
---|
3042 | 3477 | for (Object3D obj : listUI) |
---|
3043 | 3478 | { |
---|
| 3479 | + obj.pinned = false; |
---|
3044 | 3480 | obj.CloseUI(); |
---|
3045 | 3481 | } |
---|
3046 | 3482 | listUI.clear(); |
---|
.. | .. |
---|
3050 | 3486 | { |
---|
3051 | 3487 | assert(copy == group); |
---|
3052 | 3488 | |
---|
3053 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3489 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3054 | 3490 | |
---|
3055 | 3491 | for (Object3D obj : listUI) |
---|
3056 | 3492 | { |
---|
.. | .. |
---|
3099 | 3535 | } |
---|
3100 | 3536 | |
---|
3101 | 3537 | copy = group; |
---|
| 3538 | + |
---|
| 3539 | + SetUndoStates(); |
---|
| 3540 | + |
---|
3102 | 3541 | //Globals.theRenderer.object = group; |
---|
3103 | 3542 | if(!useclient) |
---|
3104 | 3543 | { |
---|
.. | .. |
---|
3115 | 3554 | sideView.object = group; |
---|
3116 | 3555 | } |
---|
3117 | 3556 | |
---|
3118 | | -// fix "+" issue group.editWindow = this; |
---|
| 3557 | +// fix "+" issue |
---|
| 3558 | + //group.editWindow = this; |
---|
| 3559 | + group.manipWindow = this; |
---|
3119 | 3560 | |
---|
3120 | 3561 | /* |
---|
3121 | 3562 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3123 | 3564 | currentLayout = sevenButton; |
---|
3124 | 3565 | */ |
---|
3125 | 3566 | radio.layout.doClick(); |
---|
| 3567 | + |
---|
| 3568 | + ClearUnpinned(); |
---|
| 3569 | + //Grafreed.Assert(group != null); |
---|
| 3570 | + //Grafreed.Assert(group.selection != null); |
---|
| 3571 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3572 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3573 | + EditSelection(false); |
---|
3126 | 3574 | keepparent = group.parent; |
---|
3127 | 3575 | // PARENT = NULL or not??? |
---|
3128 | 3576 | //group.parent = null; // ROOT |
---|
3129 | 3577 | //group.attributes = -1; |
---|
3130 | 3578 | ResetModel(); |
---|
| 3579 | + |
---|
| 3580 | + cameraView.requestFocusInWindow(); |
---|
3131 | 3581 | refreshContents(true); |
---|
3132 | 3582 | } else if (event.getSource() == editCameraItem) |
---|
3133 | 3583 | { |
---|
3134 | 3584 | cameraView.ProtectCamera(); |
---|
3135 | 3585 | cameraView.repaint(); |
---|
3136 | 3586 | return; |
---|
3137 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3587 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3138 | 3588 | { |
---|
3139 | 3589 | cameraView.RevertCamera(); |
---|
3140 | 3590 | cameraView.repaint(); |
---|
.. | .. |
---|
3151 | 3601 | } |
---|
3152 | 3602 | |
---|
3153 | 3603 | boolean useclient = false; |
---|
3154 | | - cRadio radio; |
---|
3155 | 3604 | |
---|
3156 | 3605 | void ToggleRoot() |
---|
3157 | 3606 | { |
---|
.. | .. |
---|
3390 | 3839 | |
---|
3391 | 3840 | int size = obj.MemorySize(); |
---|
3392 | 3841 | |
---|
3393 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3842 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3843 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3394 | 3844 | } |
---|
3395 | 3845 | } |
---|
3396 | 3846 | catch (Exception e) |
---|
.. | .. |
---|
3471 | 3921 | void GenNormals(boolean crease) |
---|
3472 | 3922 | { |
---|
3473 | 3923 | group.GenNormalsS(crease); |
---|
| 3924 | + |
---|
| 3925 | + refreshContents(); |
---|
| 3926 | + } |
---|
| 3927 | + |
---|
| 3928 | + void GenNormalsMESH() |
---|
| 3929 | + { |
---|
| 3930 | + group.GenNormalsMeshS(); |
---|
3474 | 3931 | |
---|
3475 | 3932 | refreshContents(); |
---|
3476 | 3933 | } |
---|
.. | .. |
---|
4098 | 4555 | refreshContents(); |
---|
4099 | 4556 | } |
---|
4100 | 4557 | |
---|
| 4558 | + void RewindLeaves(boolean hide) |
---|
| 4559 | + { |
---|
| 4560 | + group.selection.RewindLeaves(hide); |
---|
| 4561 | + refreshContents(); |
---|
| 4562 | + } |
---|
| 4563 | + |
---|
| 4564 | + void RandomLeaves(boolean hide) |
---|
| 4565 | + { |
---|
| 4566 | + group.selection.RandomLeaves(hide); |
---|
| 4567 | + refreshContents(); |
---|
| 4568 | + } |
---|
| 4569 | + |
---|
4101 | 4570 | void SetTexRes(int tr) |
---|
4102 | 4571 | { |
---|
4103 | 4572 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4169 | 4638 | // } |
---|
4170 | 4639 | // } |
---|
4171 | 4640 | |
---|
4172 | | - static boolean allparams = true; |
---|
4173 | | - |
---|
4174 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4175 | | - |
---|
4176 | 4641 | void EditSelection(boolean newWindow) |
---|
4177 | 4642 | { |
---|
| 4643 | + if (group.selection == null) |
---|
| 4644 | + { |
---|
| 4645 | + EditElement(group, newWindow); // ? new |
---|
| 4646 | + return; |
---|
| 4647 | + } |
---|
| 4648 | + |
---|
4178 | 4649 | // aConstraints.gridy = 0; |
---|
4179 | 4650 | for (int i=0; i<group.selection.size(); i++) |
---|
4180 | 4651 | { |
---|
4181 | 4652 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4182 | 4653 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4183 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4654 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4184 | 4655 | |
---|
4185 | 4656 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4186 | 4657 | if(elem != group || !newWindow) |
---|
4187 | 4658 | { |
---|
4188 | | - // if (!(elem instanceof Composite)) |
---|
4189 | | - // newWindow = false; |
---|
4190 | | - listUI.add(elem); |
---|
4191 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4192 | | - System.out.println("edit : " + elem); |
---|
4193 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4659 | + EditElement(elem, newWindow); // ? new |
---|
4194 | 4660 | } |
---|
4195 | 4661 | } |
---|
4196 | 4662 | } |
---|
.. | .. |
---|
4265 | 4731 | //new Exception().printStackTrace(); |
---|
4266 | 4732 | |
---|
4267 | 4733 | freezemodel = true; |
---|
4268 | | - |
---|
| 4734 | + ClearUnpinned(); |
---|
| 4735 | + |
---|
4269 | 4736 | /**/ |
---|
4270 | 4737 | //switch (event.id) |
---|
4271 | 4738 | { |
---|
.. | .. |
---|
4273 | 4740 | //case 702: // Event.LIST_DESELECT |
---|
4274 | 4741 | group.deselectAll(); |
---|
4275 | 4742 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4276 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4277 | 4743 | if (tps != null) |
---|
4278 | 4744 | { |
---|
4279 | 4745 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4282 | 4748 | |
---|
4283 | 4749 | //if (child.parent != null) |
---|
4284 | 4750 | //child.parent.addSelectee(child); |
---|
| 4751 | + objEditor.SetMaterial(child); |
---|
4285 | 4752 | group.addSelectee(child); |
---|
4286 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4287 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4288 | | - System.err.println("info : " + child.GetPath()); |
---|
4289 | 4753 | } |
---|
4290 | 4754 | } |
---|
4291 | 4755 | // else |
---|
.. | .. |
---|
4295 | 4759 | // System.err.println("info : " + group.GetPath()); |
---|
4296 | 4760 | // } |
---|
4297 | 4761 | |
---|
4298 | | - objEditor.SetText(); // jan 2014 |
---|
4299 | | - |
---|
4300 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4762 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4301 | 4763 | CameraPane.flash = true; |
---|
4302 | 4764 | |
---|
4303 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4765 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4304 | 4766 | // a camera |
---|
4305 | 4767 | { |
---|
4306 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4307 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4768 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4769 | + { |
---|
| 4770 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4771 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4772 | + } |
---|
4308 | 4773 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4309 | 4774 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4310 | 4775 | } |
---|
4311 | 4776 | |
---|
| 4777 | + if (tps != null && tps.length == 1) |
---|
| 4778 | + { |
---|
| 4779 | + EditSelection(false); |
---|
| 4780 | + } |
---|
| 4781 | + |
---|
| 4782 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4783 | + |
---|
4312 | 4784 | refreshContents(); |
---|
4313 | 4785 | //return true; |
---|
4314 | 4786 | } |
---|
.. | .. |
---|
4317 | 4789 | |
---|
4318 | 4790 | freezemodel = false; |
---|
4319 | 4791 | } |
---|
| 4792 | + |
---|
| 4793 | + void SetPinStates(boolean enabled) |
---|
| 4794 | + { |
---|
| 4795 | + editButton.setEnabled(enabled); |
---|
| 4796 | + uneditButton.setEnabled(enabled); |
---|
| 4797 | + unselectButton.setEnabled(enabled); |
---|
| 4798 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4799 | + } |
---|
| 4800 | + |
---|
| 4801 | + void refreshContents(boolean cp) |
---|
| 4802 | + { |
---|
| 4803 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4804 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4805 | + { |
---|
| 4806 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4807 | + |
---|
| 4808 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4809 | + { |
---|
| 4810 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4811 | + |
---|
| 4812 | + objEditor.AddInfo(child, this, true); |
---|
| 4813 | + System.err.println("info : " + child.GetPath()); |
---|
| 4814 | + } |
---|
| 4815 | + |
---|
| 4816 | + objEditor.SetText(); // jan 2014 |
---|
| 4817 | + } |
---|
| 4818 | + |
---|
| 4819 | + super.refreshContents(cp); |
---|
| 4820 | + } |
---|
4320 | 4821 | |
---|
4321 | 4822 | void linkSomething(Object3D thing) |
---|
4322 | 4823 | { |
---|
.. | .. |
---|
4388 | 4889 | { |
---|
4389 | 4890 | if (group.selection.isEmpty()) |
---|
4390 | 4891 | return; |
---|
| 4892 | + |
---|
4391 | 4893 | Grafreed.clipboardIsTempGroup = false; |
---|
4392 | 4894 | Composite tGroup = null; |
---|
4393 | 4895 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4398 | 4900 | |
---|
4399 | 4901 | if (cut) |
---|
4400 | 4902 | { |
---|
| 4903 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4904 | +// Save(); |
---|
4401 | 4905 | //int indices[] = jList.getSelectedIndices(); |
---|
4402 | 4906 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4403 | 4907 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4487 | 4991 | } |
---|
4488 | 4992 | |
---|
4489 | 4993 | } |
---|
| 4994 | + |
---|
4490 | 4995 | if (Grafreed.clipboardIsTempGroup) |
---|
4491 | 4996 | Grafreed.clipboard = tGroup; |
---|
| 4997 | + |
---|
4492 | 4998 | if (cut) |
---|
4493 | 4999 | { |
---|
4494 | 5000 | ResetModel(); |
---|
.. | .. |
---|
4498 | 5004 | |
---|
4499 | 5005 | void paste(boolean expand) |
---|
4500 | 5006 | { |
---|
| 5007 | + if (Globals.REPLACEONMAKE) |
---|
| 5008 | + Save(); |
---|
| 5009 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5010 | + Globals.REPLACEONMAKE = false; |
---|
4501 | 5011 | // if (GrafreeD.clipboard == null) |
---|
4502 | 5012 | // return; |
---|
4503 | 5013 | boolean first = true; |
---|
.. | .. |
---|
4557 | 5067 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4558 | 5068 | } |
---|
4559 | 5069 | |
---|
| 5070 | + Globals.REPLACEONMAKE = keep; |
---|
4560 | 5071 | ResetModel(); |
---|
4561 | 5072 | refreshContents(); |
---|
4562 | 5073 | } |
---|
.. | .. |
---|
4692 | 5203 | |
---|
4693 | 5204 | void group(Object3D csg, boolean grab) |
---|
4694 | 5205 | { |
---|
| 5206 | + if (Globals.REPLACEONMAKE) |
---|
| 5207 | + Save(); |
---|
| 5208 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5209 | + Globals.REPLACEONMAKE = false; |
---|
4695 | 5210 | if (//false) // why?? |
---|
4696 | 5211 | !group.selection.isEmpty()) |
---|
4697 | 5212 | { |
---|
.. | .. |
---|
4805 | 5320 | //node.add(csg); |
---|
4806 | 5321 | //makeSomething(node); |
---|
4807 | 5322 | makeSomething(csg); |
---|
| 5323 | + Globals.REPLACEONMAKE = keep; |
---|
4808 | 5324 | } |
---|
4809 | 5325 | |
---|
4810 | 5326 | void Ungroup(Object3D g) |
---|
4811 | 5327 | { |
---|
| 5328 | + if (Globals.REPLACEONMAKE) |
---|
| 5329 | + Save(); |
---|
| 5330 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5331 | + Globals.REPLACEONMAKE = false; |
---|
4812 | 5332 | if (g instanceof HiddenObject) |
---|
4813 | 5333 | { |
---|
4814 | 5334 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4825 | 5345 | objEditor.makeSomething(g.get(i), false); |
---|
4826 | 5346 | } |
---|
4827 | 5347 | } |
---|
| 5348 | + Globals.REPLACEONMAKE = keep; |
---|
4828 | 5349 | } |
---|
4829 | 5350 | |
---|
4830 | 5351 | void ungroup() |
---|
.. | .. |
---|
5113 | 5634 | cButton clearpanelButton; |
---|
5114 | 5635 | cButton unselectButton; |
---|
5115 | 5636 | |
---|
| 5637 | + cButton restoreCameraButton; |
---|
| 5638 | + |
---|
| 5639 | + cButton saveButton; |
---|
5116 | 5640 | cButton oneStepButton; |
---|
| 5641 | + |
---|
| 5642 | + cButton groupButton; |
---|
| 5643 | + cButton ungroupButton; |
---|
| 5644 | + cButton compositeButton; |
---|
| 5645 | + cButton switchButton; |
---|
| 5646 | + cButton loopButton; |
---|
| 5647 | + cButton textureButton; |
---|
| 5648 | + |
---|
| 5649 | + cButton gridButton; |
---|
| 5650 | + cButton boxButton; |
---|
| 5651 | + cButton sphereButton; |
---|
| 5652 | + cButton coneButton; |
---|
| 5653 | + cButton torusButton; |
---|
| 5654 | + cButton superButton; |
---|
| 5655 | + cButton kleinButton; |
---|
| 5656 | + cButton particlesButton; |
---|
| 5657 | + cButton overlayButton; |
---|
| 5658 | + cButton lightButton; |
---|
5117 | 5659 | |
---|
5118 | 5660 | cButton screenfitButton; |
---|
5119 | 5661 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5126 | 5668 | |
---|
5127 | 5669 | cButton setsupportButton; |
---|
5128 | 5670 | |
---|
5129 | | - cButton twoButton; |
---|
5130 | | - cButton sixButton; |
---|
5131 | | - cButton threeButton; |
---|
5132 | | - cButton sevenButton; |
---|
5133 | | - cButton fourButton; // full panel |
---|
5134 | | - cButton oneButton; // full XYZ |
---|
5135 | | - //cButton currentLayout; |
---|
5136 | | - |
---|
5137 | 5671 | // |
---|
5138 | 5672 | //Composite |
---|
5139 | 5673 | Object3D // to do !! |
---|
.. | .. |
---|
5143 | 5677 | //JTree jTree; |
---|
5144 | 5678 | private MenuItem lookAtItem; |
---|
5145 | 5679 | private MenuItem lookFromItem; |
---|
5146 | | - private MenuItem switchItem; |
---|
| 5680 | + private MenuItem switchViewItem; |
---|
5147 | 5681 | private MenuItem cutItem; |
---|
5148 | | - private MenuItem duplicateItem; |
---|
| 5682 | + private MenuItem undoItem; |
---|
| 5683 | + private MenuItem redoItem; |
---|
| 5684 | + private JMenuItem duplicateItem; |
---|
5149 | 5685 | private MenuItem cloneItem; |
---|
5150 | 5686 | private MenuItem cloneSupportItem; |
---|
5151 | 5687 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5173 | 5709 | private MenuItem pasteLinkItem; |
---|
5174 | 5710 | private MenuItem pasteCloneItem; |
---|
5175 | 5711 | private MenuItem pasteExpandItem; |
---|
5176 | | - private MenuItem clearItem; |
---|
| 5712 | + private MenuItem deleteItem; |
---|
5177 | 5713 | private MenuItem clearAllItem; |
---|
5178 | 5714 | private MenuItem genUVItem; |
---|
5179 | 5715 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5208 | 5744 | private MenuItem showleavesItem; |
---|
5209 | 5745 | private MenuItem markleavesItem; |
---|
5210 | 5746 | private MenuItem unmarkleavesItem; |
---|
| 5747 | + private MenuItem rewindleavesItem; |
---|
| 5748 | + private MenuItem unrewindleavesItem; |
---|
| 5749 | + private MenuItem randomleavesItem; |
---|
| 5750 | + private MenuItem unrandomleavesItem; |
---|
5211 | 5751 | |
---|
5212 | 5752 | private MenuItem flipVItem; |
---|
5213 | 5753 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5229 | 5769 | private MenuItem frontItem; |
---|
5230 | 5770 | private MenuItem cameraItem; |
---|
5231 | 5771 | private MenuItem compositeItem; |
---|
5232 | | - private MenuItem randomItem; |
---|
| 5772 | + private MenuItem switchItem; |
---|
5233 | 5773 | private MenuItem physicsItem; |
---|
5234 | 5774 | private MenuItem frameselectorItem; |
---|
5235 | 5775 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5303 | 5843 | |
---|
5304 | 5844 | Menu cameraMenu; |
---|
5305 | 5845 | MenuItem editCameraItem; |
---|
5306 | | - MenuItem revertCameraItem; |
---|
| 5846 | + MenuItem restoreCameraItem; |
---|
5307 | 5847 | } |
---|