.. | .. |
---|
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); |
---|
.. | .. |
---|
84 | 84 | |
---|
85 | 85 | void CloneSelection(boolean supports) |
---|
86 | 86 | { |
---|
| 87 | + if (Globals.REPLACEONMAKE) |
---|
| 88 | + Save(); |
---|
| 89 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 90 | + Globals.REPLACEONMAKE = false; |
---|
87 | 91 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 92 | //Object3D obj; |
---|
89 | 93 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 98 | |
---|
95 | 99 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 100 | } |
---|
| 101 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 102 | } |
---|
98 | 103 | |
---|
99 | 104 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
148 | 153 | |
---|
149 | 154 | //JTextField nameField; |
---|
150 | 155 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 156 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 157 | { |
---|
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 | | - |
---|
| 158 | + oe.jTree = new cTree(); |
---|
| 159 | + |
---|
168 | 160 | Menu menu; |
---|
169 | 161 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 162 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 163 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 164 | + |
---|
| 165 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 166 | +// undoItem.addActionListener(this); |
---|
| 167 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 168 | +// redoItem.addActionListener(this); |
---|
| 169 | +// menu.add("-"); |
---|
| 170 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 171 | duplicateItem.addActionListener(this); |
---|
174 | 172 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
175 | 173 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
185 | 183 | copyItem.addActionListener(this); |
---|
186 | 184 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 185 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 186 | |
---|
190 | 187 | menu.add("-"); |
---|
191 | 188 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
206 | 203 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 204 | clearAllItem.addActionListener(this); |
---|
208 | 205 | } |
---|
| 206 | + |
---|
| 207 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 208 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 209 | + //zBufferItem.addActionListener(this); |
---|
| 210 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 211 | + //normalLensItem.addActionListener(this); |
---|
| 212 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 213 | + restoreCameraItem.addActionListener(this); |
---|
| 214 | + |
---|
| 215 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 216 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 217 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 218 | +// cameraMenu.add("-"); |
---|
| 219 | +// |
---|
| 220 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 221 | +// toggleTextureItem.addItemListener(this); |
---|
| 222 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 223 | +// |
---|
| 224 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 225 | +// toggleSwitchItem.addItemListener(this); |
---|
| 226 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 227 | + |
---|
| 228 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 229 | + toggleHandleItem.addItemListener(this); |
---|
| 230 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 231 | + |
---|
| 232 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 233 | + togglePaintItem.addItemListener(this); |
---|
| 234 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 235 | + |
---|
| 236 | + if (Globals.ADVANCED) |
---|
| 237 | + { |
---|
| 238 | + cameraMenu.add("-"); |
---|
| 239 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 240 | + toggleLiveItem.addItemListener(this); |
---|
| 241 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 242 | |
---|
| 243 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 244 | + stepItem.addActionListener(this); |
---|
| 245 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 246 | + // toggleDLItem.addItemListener(this); |
---|
| 247 | + // toggleDLItem.setState(false); |
---|
| 248 | + |
---|
| 249 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 250 | + toggleRenderItem.addItemListener(this); |
---|
| 251 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 252 | + |
---|
| 253 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 254 | + toggleDebugItem.addItemListener(this); |
---|
| 255 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 256 | + |
---|
| 257 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 258 | + toggleFrustumItem.addItemListener(this); |
---|
| 259 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 260 | + |
---|
| 261 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 262 | + toggleFootContactItem.addItemListener(this); |
---|
| 263 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 264 | + |
---|
| 265 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 266 | + toggleTimelineItem.addItemListener(this); |
---|
| 267 | + } |
---|
| 268 | + |
---|
| 269 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 270 | +// toggleRootItem.addItemListener(this); |
---|
| 271 | +// toggleRootItem.setState(false); |
---|
| 272 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 273 | +// animationItem.addItemListener(this); |
---|
| 274 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 275 | + cameraMenu.add("-"); |
---|
| 276 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 277 | + editCameraItem.addActionListener(this); |
---|
| 278 | + |
---|
| 279 | + if (Globals.ADVANCED) |
---|
| 280 | + { |
---|
| 281 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 282 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 283 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 284 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 285 | + oe.cameraMenu.add("-"); |
---|
| 286 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 287 | + openWindowItem.addActionListener(this); |
---|
| 288 | + editLeafItem.addActionListener(this); |
---|
| 289 | + lookAtItem.addActionListener(this); |
---|
| 290 | + //lookFromItem.addActinoListener(this); |
---|
| 291 | + //switchViewItem.addActionListener(this); |
---|
| 292 | + } |
---|
| 293 | + |
---|
210 | 294 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 295 | if (Globals.ADVANCED) |
---|
212 | 296 | { |
---|
.. | .. |
---|
249 | 333 | } |
---|
250 | 334 | |
---|
251 | 335 | oe.menuBar.add(menu = new Menu("Group")); |
---|
252 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
253 | | - grabItem.addActionListener(this); |
---|
| 336 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 337 | +// grabItem.addActionListener(this); |
---|
254 | 338 | backItem = menu.add(new MenuItem("Back")); |
---|
255 | 339 | backItem.addActionListener(this); |
---|
256 | 340 | frontItem = menu.add(new MenuItem("Front")); |
---|
257 | 341 | frontItem.addActionListener(this); |
---|
258 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
259 | | - compositeItem.addActionListener(this); |
---|
| 342 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 343 | +// compositeItem.addActionListener(this); |
---|
| 344 | + |
---|
| 345 | + if (Globals.ADVANCED) |
---|
| 346 | + { |
---|
260 | 347 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
261 | 348 | hideItem.addActionListener(this); |
---|
| 349 | + } |
---|
262 | 350 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
263 | 351 | ungroupItem.addActionListener(this); |
---|
264 | | - menu.add("-"); |
---|
265 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
266 | | - randomItem.addActionListener(this); |
---|
| 352 | + |
---|
| 353 | +// menu.add("-"); |
---|
| 354 | +// |
---|
| 355 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 356 | +// switchItem.addActionListener(this); |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
267 | 359 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
268 | 360 | switchGeoItem.addActionListener(this); |
---|
269 | 361 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
271 | 363 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
272 | 364 | morphItem.addActionListener(this); |
---|
273 | 365 | |
---|
274 | | - if (Globals.ADVANCED) |
---|
275 | | - { |
---|
276 | 366 | menu.add("-"); |
---|
277 | 367 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
278 | 368 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
280 | 370 | frameselectorItem.addActionListener(this); |
---|
281 | 371 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
282 | 372 | scriptNodeItem.addActionListener(this); |
---|
283 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
284 | | - cameraItem.addActionListener(this); |
---|
285 | 373 | } |
---|
286 | 374 | |
---|
287 | 375 | oe.menuBar.add(menu = new Menu("Object")); |
---|
288 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
289 | | - textureItem.addActionListener(this); |
---|
| 376 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 377 | +// textureItem.addActionListener(this); |
---|
290 | 378 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
291 | 379 | billboardItem.addActionListener(this); |
---|
292 | 380 | csgItem = menu.add(new MenuItem("CSG")); |
---|
293 | 381 | csgItem.addActionListener(this); |
---|
294 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 382 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
295 | 383 | shadowXItem.addActionListener(this); |
---|
296 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 384 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
297 | 385 | shadowYItem.addActionListener(this); |
---|
298 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 386 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
299 | 387 | shadowZItem.addActionListener(this); |
---|
| 388 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 389 | + attributeItem.addActionListener(this); |
---|
| 390 | + |
---|
300 | 391 | if (Globals.ADVANCED) |
---|
301 | 392 | { |
---|
302 | 393 | menu.add("-"); |
---|
303 | 394 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
304 | 395 | linkerItem.addActionListener(this); |
---|
305 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
306 | | - attributeItem.addActionListener(this); |
---|
307 | 396 | templateItem = menu.add(new MenuItem("Template")); |
---|
308 | 397 | templateItem.addActionListener(this); |
---|
309 | 398 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
392 | 481 | markleavesItem.addActionListener(this); |
---|
393 | 482 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
394 | 483 | unmarkleavesItem.addActionListener(this); |
---|
| 484 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 485 | + rewindleavesItem.addActionListener(this); |
---|
| 486 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 487 | + unrewindleavesItem.addActionListener(this); |
---|
| 488 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 489 | + randomleavesItem.addActionListener(this); |
---|
| 490 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 491 | + unrandomleavesItem.addActionListener(this); |
---|
395 | 492 | menu.add("-"); |
---|
396 | 493 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
397 | 494 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
443 | 540 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
444 | 541 | buildCreateMenu(menu); |
---|
445 | 542 | |
---|
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 | 543 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
460 | 544 | buildToolsMenu(menu); |
---|
461 | 545 | } |
---|
462 | 546 | |
---|
| 547 | + |
---|
463 | 548 | void SetupUI2(ObjEditor oe) |
---|
464 | 549 | { |
---|
| 550 | + // June 2019 |
---|
| 551 | + if (oe == null) |
---|
| 552 | + { |
---|
| 553 | + //super.SetupUI2(this); |
---|
| 554 | + //return; |
---|
| 555 | + } |
---|
| 556 | + |
---|
| 557 | + if (copy != group) |
---|
| 558 | + { |
---|
| 559 | + //super.SetupUI2(this); |
---|
| 560 | + } |
---|
| 561 | + |
---|
465 | 562 | //new Exception().printStackTrace(); |
---|
466 | 563 | |
---|
467 | 564 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
490 | 587 | oe.radioPanel.add(dummyButton); |
---|
491 | 588 | oe.buttonGroup.add(dummyButton); |
---|
492 | 589 | */ |
---|
| 590 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 591 | + |
---|
| 592 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 593 | + |
---|
493 | 594 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
494 | 595 | |
---|
495 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 596 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 597 | + //minButton.setToolTipText("Minimize window"); |
---|
| 598 | + //minButton.addActionListener(this); |
---|
| 599 | + |
---|
| 600 | + if (Globals.ADVANCED) |
---|
| 601 | + { |
---|
| 602 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 603 | + maxButton.setToolTipText("Maximize window"); |
---|
| 604 | + maxButton.addActionListener(this); |
---|
| 605 | + } |
---|
| 606 | + |
---|
| 607 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 609 | + fullButton.addActionListener(this); |
---|
| 610 | + |
---|
| 611 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 613 | + screenfitButton.addActionListener(this); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 617 | + restoreCameraButton.addActionListener(this); |
---|
| 618 | + |
---|
| 619 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + saveButton.setToolTipText("New version"); |
---|
| 621 | + saveButton.addActionListener(this); |
---|
| 622 | + |
---|
| 623 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + undoButton.setToolTipText("Previous version"); |
---|
| 625 | + undoButton.addActionListener(this); |
---|
| 626 | + undoButton.setEnabled(false); |
---|
| 627 | + |
---|
| 628 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 629 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + restoreButton.setToolTipText("Restore current"); |
---|
| 631 | + restoreButton.addActionListener(this); |
---|
| 632 | + restoreButton.setEnabled(false); |
---|
| 633 | + |
---|
| 634 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 635 | + replaceButton.setToolTipText("Replace current"); |
---|
| 636 | + replaceButton.addActionListener(this); |
---|
| 637 | + replaceButton.setEnabled(false); |
---|
| 638 | + |
---|
| 639 | + copyOptionsPanel.add(updown); |
---|
| 640 | + |
---|
| 641 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + redoButton.setToolTipText("Next version"); |
---|
| 643 | + redoButton.addActionListener(this); |
---|
| 644 | + redoButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
496 | 647 | liveCB.setToolTipText("Enable animation"); |
---|
497 | 648 | liveCB.addItemListener(this); |
---|
498 | 649 | |
---|
499 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 650 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
500 | 651 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
501 | 652 | oneStepButton.addActionListener(this); |
---|
502 | 653 | |
---|
503 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 654 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
504 | 655 | fastCB.setToolTipText("Fast mode"); |
---|
505 | 656 | fastCB.addItemListener(this); |
---|
506 | 657 | |
---|
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); |
---|
512 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
513 | | - screenfitButton.addActionListener(this); |
---|
| 658 | + //oe.toolboxPanel.Return(); |
---|
| 659 | + |
---|
| 660 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 661 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 662 | +// trackCB.addItemListener(this); |
---|
514 | 663 | |
---|
515 | 664 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
516 | 665 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
522 | 671 | snapobjectButton.setToolTipText("Snap Object"); |
---|
523 | 672 | } |
---|
524 | 673 | |
---|
525 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
526 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
527 | | - flashSelectionButton.addActionListener(this); |
---|
| 674 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
528 | 675 | |
---|
529 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
530 | | - |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 676 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
532 | 677 | twoButton.setToolTipText("Show center view only"); |
---|
533 | 678 | twoButton.addActionListener(this); |
---|
534 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 679 | + this.fullscreenLayout = twoButton; |
---|
| 680 | + |
---|
| 681 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
535 | 682 | fourButton.addActionListener(this); |
---|
536 | 683 | fourButton.setToolTipText("Show left panel only"); |
---|
537 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 684 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
538 | 685 | sixButton.setToolTipText("2-column layout left"); |
---|
539 | 686 | sixButton.addActionListener(this); |
---|
540 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 687 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
541 | 688 | threeButton.setToolTipText("2-column layout right"); |
---|
542 | 689 | threeButton.addActionListener(this); |
---|
543 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 690 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | 691 | sevenButton.setToolTipText("3-column layout"); |
---|
545 | 692 | sevenButton.addActionListener(this); |
---|
546 | 693 | // |
---|
547 | 694 | |
---|
548 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 695 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
549 | 696 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
550 | 697 | rootButton.addActionListener(this); |
---|
551 | 698 | |
---|
552 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 699 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
553 | 700 | closeButton.setToolTipText("Close tab"); |
---|
554 | 701 | closeButton.addActionListener(this); |
---|
555 | 702 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
556 | 703 | //clearButton.addActionListener(this); |
---|
557 | | - |
---|
558 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 704 | + |
---|
| 705 | + // INSERT |
---|
| 706 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + gridButton.setToolTipText("Create grid"); |
---|
| 708 | + gridButton.addActionListener(this); |
---|
| 709 | + |
---|
| 710 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + boxButton.setToolTipText("Create box"); |
---|
| 712 | + boxButton.addActionListener(this); |
---|
| 713 | + |
---|
| 714 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 715 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 716 | + sphereButton.addActionListener(this); |
---|
| 717 | + |
---|
| 718 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + coneButton.setToolTipText("Create cone"); |
---|
| 720 | + coneButton.addActionListener(this); |
---|
| 721 | + |
---|
| 722 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 723 | + torusButton.setToolTipText("Create torus"); |
---|
| 724 | + torusButton.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 728 | + superButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + if (Globals.ADVANCED) |
---|
| 731 | + { |
---|
| 732 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 733 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 734 | + kleinButton.addActionListener(this); |
---|
| 735 | + } |
---|
559 | 736 | |
---|
560 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
561 | | - editButton.setToolTipText("Edit selection"); |
---|
| 737 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 739 | + particlesButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + oe.toolboxPanel.Return(); |
---|
| 742 | + |
---|
| 743 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 744 | + groupButton.setToolTipText("Create group"); |
---|
| 745 | + groupButton.addActionListener(this); |
---|
| 746 | + |
---|
| 747 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 748 | + compositeButton.setToolTipText("Create composite"); |
---|
| 749 | + compositeButton.addActionListener(this); |
---|
| 750 | + |
---|
| 751 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 752 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 753 | + switchButton.addActionListener(this); |
---|
| 754 | + |
---|
| 755 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 756 | + loopButton.setToolTipText("Create loop"); |
---|
| 757 | + loopButton.addActionListener(this); |
---|
| 758 | + |
---|
| 759 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 760 | + textureButton.setToolTipText("Create texture"); |
---|
| 761 | + textureButton.addActionListener(this); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 765 | + overlayButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + lightButton.setToolTipText("Create light"); |
---|
| 769 | + lightButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + for (int i=6; --i>=0;) |
---|
| 772 | + { |
---|
| 773 | + oe.toolboxPanel.Return(); |
---|
| 774 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 775 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 776 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 777 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 778 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 779 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 780 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 781 | + } |
---|
| 782 | + |
---|
| 783 | + // EDIT panel |
---|
| 784 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 785 | + editButton.setToolTipText("Pin selection controls"); |
---|
562 | 786 | editButton.addActionListener(this); |
---|
563 | 787 | |
---|
564 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 788 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 789 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
566 | 790 | uneditButton.addActionListener(this); |
---|
567 | 791 | |
---|
568 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
569 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 792 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 793 | + allParamsButton.setToolTipText("Show all controle"); |
---|
570 | 794 | allParamsButton.addActionListener(this); |
---|
571 | 795 | |
---|
572 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 796 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
573 | 797 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
574 | 798 | clearPanelButton.addActionListener(this); |
---|
575 | 799 | |
---|
576 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 800 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 801 | unselectButton.setToolTipText("Unselect"); |
---|
578 | 802 | unselectButton.addActionListener(this); |
---|
579 | 803 | |
---|
580 | | - commandsPanel.preferredHeight = 1; |
---|
| 804 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 806 | + flashSelectionButton.addActionListener(this); |
---|
581 | 807 | |
---|
582 | | - oe.treePanel.add(commandsPanel); |
---|
583 | | - oe.treePanel.Return(); |
---|
| 808 | + editCommandsPanel.preferredHeight = 1; |
---|
| 809 | + |
---|
| 810 | + SetPinStates(false); |
---|
| 811 | +// oe.treePanel.add(commandsPanel); |
---|
| 812 | +// oe.treePanel.Return(); |
---|
584 | 813 | |
---|
585 | 814 | // oe.aConstraints.gridx += 1; |
---|
586 | 815 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
597 | 826 | |
---|
598 | 827 | JScrollPane jSP; |
---|
599 | 828 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
600 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 829 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
601 | 830 | ResetModel(); |
---|
602 | 831 | |
---|
603 | 832 | oe.treePanel.add(jSPPanel); |
---|
604 | 833 | oe.treePanel.Return(); |
---|
605 | 834 | |
---|
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 | 835 | oe.treePanel.add(copyOptionsPanel); |
---|
622 | 836 | oe.treePanel.Return(); |
---|
| 837 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 10, 0); |
---|
| 838 | + versionField = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 839 | + sliderPane.preferredHeight = 1; |
---|
623 | 840 | |
---|
624 | 841 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
625 | 842 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
648 | 865 | |
---|
649 | 866 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
650 | 867 | { |
---|
| 868 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 869 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 870 | + colorCB.addItemListener(this); |
---|
| 871 | + |
---|
| 872 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 873 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 874 | + materialCB.addItemListener(this); |
---|
| 875 | + |
---|
| 876 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 877 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 878 | + textureCB.addItemListener(this); |
---|
| 879 | + |
---|
| 880 | + panel.Return(); |
---|
| 881 | + |
---|
651 | 882 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
652 | 883 | boxCB.setToolTipText("Display bounding boxes"); |
---|
653 | 884 | boxCB.addItemListener(this); |
---|
654 | 885 | |
---|
655 | 886 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
656 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 887 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
657 | 888 | zoomBoxCB.addItemListener(this); |
---|
658 | 889 | |
---|
659 | 890 | if (true) // Globals.ADVANCED) |
---|
660 | 891 | { |
---|
661 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
662 | | - supportCB.setToolTipText("Enable rigging"); |
---|
663 | | - supportCB.addItemListener(this); |
---|
| 892 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 893 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 894 | +// supportCB.addItemListener(this); |
---|
| 895 | + |
---|
| 896 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 897 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 898 | + freezeCB.addItemListener(this); |
---|
664 | 899 | |
---|
665 | 900 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
666 | 901 | // localCB.addItemListener(this); |
---|
667 | 902 | |
---|
| 903 | + panel.Return(); |
---|
| 904 | + |
---|
668 | 905 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
669 | 906 | crowdCB.setToolTipText("Used for crowds"); |
---|
670 | 907 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
681 | 918 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
682 | 919 | // speakerMocapCB.addItemListener(this); |
---|
683 | 920 | |
---|
| 921 | + panel.Return(); |
---|
| 922 | + |
---|
684 | 923 | if (false) |
---|
685 | 924 | { |
---|
686 | 925 | // handled in scripts |
---|
.. | .. |
---|
695 | 934 | //constraints.gridy += 1; |
---|
696 | 935 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
697 | 936 | smoothfocusCB.addItemListener(this); |
---|
| 937 | + panel.Return(); |
---|
698 | 938 | } |
---|
699 | 939 | |
---|
700 | 940 | //constraints.gridx += 1; |
---|
701 | 941 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
702 | 942 | // debugCB.addItemListener(this); |
---|
703 | 943 | |
---|
| 944 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 945 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 946 | + trackCB.addItemListener(this); |
---|
| 947 | + |
---|
704 | 948 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 949 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
705 | 950 | oeilCB.addItemListener(this); |
---|
706 | 951 | |
---|
| 952 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 953 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 954 | + shadowCB.addItemListener(this); |
---|
| 955 | + |
---|
| 956 | + panel.Return(); |
---|
| 957 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 958 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 959 | + toggleTextureCB.addItemListener(this); |
---|
| 960 | + |
---|
| 961 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 962 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 963 | + toggleSwitchCB.addItemListener(this); |
---|
| 964 | + |
---|
| 965 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 966 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 967 | + autokeepCB.addItemListener(this); |
---|
| 968 | + |
---|
| 969 | + panel.Return(); |
---|
| 970 | + if (Globals.ADVANCED) |
---|
| 971 | + { |
---|
707 | 972 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
708 | 973 | lookAtCB.setToolTipText("Look-at target"); |
---|
709 | 974 | lookAtCB.addItemListener(this); |
---|
| 975 | + } |
---|
710 | 976 | |
---|
711 | 977 | } |
---|
712 | 978 | |
---|
713 | 979 | cGridBag fill = new cGridBag(); |
---|
714 | | - |
---|
715 | 980 | fill.preferredHeight = 200; |
---|
| 981 | + cGridBag fill2 = new cGridBag(); |
---|
| 982 | + fill2.preferredHeight = 200; |
---|
| 983 | + cGridBag fill3 = new cGridBag(); |
---|
| 984 | + fill3.preferredHeight = 200; |
---|
716 | 985 | |
---|
717 | 986 | panel.add(fill); |
---|
| 987 | + panel.add(fill2); |
---|
| 988 | + panel.add(fill3); |
---|
718 | 989 | |
---|
719 | 990 | } |
---|
720 | 991 | |
---|
721 | 992 | void EditObject(Object3D obj) |
---|
722 | 993 | { |
---|
723 | 994 | cRadio radioButton = new cRadio(obj.name); |
---|
| 995 | + |
---|
| 996 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 997 | + radioButton.hadMaterial = obj.material != null; |
---|
| 998 | + if (!radioButton.hadMaterial) |
---|
| 999 | + { |
---|
| 1000 | + obj.material = new cMaterial(); |
---|
| 1001 | + } |
---|
| 1002 | + |
---|
724 | 1003 | radioButton.SetObject(obj); |
---|
725 | 1004 | radioButton.layout = sevenButton; |
---|
726 | 1005 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
732 | 1011 | |
---|
733 | 1012 | void SetupViews(ObjEditor oe) |
---|
734 | 1013 | { |
---|
| 1014 | + theFrame = this; |
---|
| 1015 | + |
---|
735 | 1016 | oe.SetupViews(); |
---|
736 | 1017 | |
---|
737 | 1018 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
740 | 1021 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
741 | 1022 | } |
---|
742 | 1023 | |
---|
743 | | - JCheckBox liveCB; |
---|
744 | | - JCheckBox supportCB; |
---|
745 | | - JCheckBox localCB; |
---|
746 | | - JCheckBox crowdCB; |
---|
747 | | - JCheckBox smoothCB; |
---|
748 | | - JCheckBox fastCB; |
---|
749 | | - JCheckBox slowCB; |
---|
750 | | - JCheckBox boxCB; |
---|
751 | | - JCheckBox zoomBoxCB; |
---|
752 | | - JCheckBox trackCB; |
---|
753 | | - JCheckBox smoothfocusCB; |
---|
| 1024 | + cToggleButton liveCB; |
---|
| 1025 | + cCheckBox supportCB; |
---|
| 1026 | + cCheckBox localCB; |
---|
| 1027 | + cCheckBox crowdCB; |
---|
| 1028 | + cCheckBox smoothCB; |
---|
| 1029 | + cToggleButton fastCB; |
---|
| 1030 | + cCheckBox slowCB; |
---|
| 1031 | + cCheckBox boxCB; |
---|
| 1032 | + cCheckBox zoomBoxCB; |
---|
| 1033 | + cCheckBox freezeCB; |
---|
| 1034 | + //cToggleButton trackCB; |
---|
| 1035 | + cCheckBox trackCB; |
---|
| 1036 | + cCheckBox smoothfocusCB; |
---|
754 | 1037 | // JCheckBox speakerMocapCB; |
---|
755 | | - JCheckBox speakerCameraCB; |
---|
756 | | - JCheckBox speakerFocusCB; |
---|
757 | | - JCheckBox debugCB; |
---|
758 | | - JCheckBox oeilCB; |
---|
759 | | - JCheckBox lookAtCB; |
---|
| 1038 | + cCheckBox speakerCameraCB; |
---|
| 1039 | + cCheckBox speakerFocusCB; |
---|
| 1040 | + cCheckBox debugCB; |
---|
| 1041 | + |
---|
| 1042 | + cCheckBox oeilCB; |
---|
| 1043 | + cCheckBox shadowCB; |
---|
| 1044 | + cCheckBox autokeepCB; |
---|
| 1045 | + cCheckBox lookAtCB; |
---|
760 | 1046 | |
---|
761 | 1047 | // static int COLOR = 1; |
---|
762 | 1048 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
764 | 1050 | |
---|
765 | 1051 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
766 | 1052 | |
---|
767 | | - JCheckBox colorCB; |
---|
768 | | - JCheckBox materialCB; |
---|
769 | | - JCheckBox textureCB; |
---|
| 1053 | + cCheckBox colorCB; |
---|
| 1054 | + cCheckBox materialCB; |
---|
| 1055 | + cCheckBox textureCB; |
---|
770 | 1056 | |
---|
771 | 1057 | public void itemStateChanged(ItemEvent e) |
---|
772 | 1058 | { |
---|
.. | .. |
---|
794 | 1080 | } else if(e.getSource() == liveCB) |
---|
795 | 1081 | { |
---|
796 | 1082 | cameraView.ToggleLive(); |
---|
| 1083 | + refreshContents(false); |
---|
797 | 1084 | } |
---|
798 | 1085 | else if(e.getSource() == supportCB) |
---|
799 | 1086 | { |
---|
.. | .. |
---|
858 | 1145 | { |
---|
859 | 1146 | cameraView.ToggleOeil(); |
---|
860 | 1147 | } |
---|
| 1148 | + else if(e.getSource() == shadowCB) |
---|
| 1149 | + { |
---|
| 1150 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1151 | + } |
---|
| 1152 | + else if(e.getSource() == freezeCB) |
---|
| 1153 | + { |
---|
| 1154 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1155 | + } |
---|
| 1156 | + else if(e.getSource() == autokeepCB) |
---|
| 1157 | + { |
---|
| 1158 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1159 | + } |
---|
861 | 1160 | else if(e.getSource() == lookAtCB) |
---|
862 | 1161 | { |
---|
863 | 1162 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
874 | 1173 | |
---|
875 | 1174 | /**/ |
---|
876 | 1175 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
877 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1176 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1177 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
878 | 1178 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
879 | 1179 | // We can't move the root node or an empty selection |
---|
880 | 1180 | return; |
---|
.. | .. |
---|
937 | 1237 | } |
---|
938 | 1238 | } |
---|
939 | 1239 | |
---|
940 | | - String string = (String) object; |
---|
941 | | - |
---|
942 | 1240 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
943 | 1241 | // if( object instanceof java.io.File[]) |
---|
944 | 1242 | // { |
---|
.. | .. |
---|
946 | 1244 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
947 | 1245 | // return; |
---|
948 | 1246 | // } |
---|
| 1247 | + |
---|
| 1248 | + String string = object.toString(); |
---|
949 | 1249 | |
---|
950 | 1250 | // File path for Mac and Windows |
---|
951 | 1251 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
991 | 1291 | |
---|
992 | 1292 | assert target == objEditor.jTree; |
---|
993 | 1293 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1294 | + Object3D destinationLeaf; |
---|
994 | 1295 | try { |
---|
995 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1296 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
996 | 1297 | } catch (Exception e) { |
---|
997 | 1298 | System.out.println("destinationPath : " + destinationPath); |
---|
998 | 1299 | return; |
---|
999 | 1300 | } |
---|
1000 | 1301 | |
---|
1001 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1302 | + for (int i=group.selection.size(); --i>=0;) |
---|
1002 | 1303 | { |
---|
| 1304 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1305 | + |
---|
| 1306 | + // Cannot move into itself |
---|
| 1307 | + if (child == destinationLeaf) |
---|
| 1308 | + return; |
---|
| 1309 | + } |
---|
| 1310 | + |
---|
| 1311 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1312 | +// { |
---|
1003 | 1313 | loadClipboard(true); |
---|
1004 | 1314 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1005 | 1315 | pasteInto(false, false); |
---|
1006 | | - } else { |
---|
1007 | | - loadClipboard(false); |
---|
1008 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1009 | | - pasteInto(false, false); // true); // ??? |
---|
1010 | | - } |
---|
| 1316 | +// } else { |
---|
| 1317 | +// loadClipboard(false); |
---|
| 1318 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1319 | +// pasteInto(false, false); // true); // ??? |
---|
| 1320 | +// } |
---|
1011 | 1321 | } |
---|
1012 | 1322 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1013 | 1323 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1112 | 1422 | { |
---|
1113 | 1423 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1114 | 1424 | //heightFieldItem.addActionListener(this); |
---|
1115 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1116 | | - gridItem.addActionListener(this); |
---|
1117 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1118 | | - rectoidItem.addActionListener(this); |
---|
1119 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1120 | | - ellipsoidItem.addActionListener(this); |
---|
1121 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1122 | | - coneItem.addActionListener(this); |
---|
1123 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1124 | | - torusItem.addActionListener(this); |
---|
1125 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1126 | | - superItem.addActionListener(this); |
---|
| 1425 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1426 | +// gridItem.addActionListener(this); |
---|
| 1427 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1428 | +// rectoidItem.addActionListener(this); |
---|
| 1429 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1430 | +// ellipsoidItem.addActionListener(this); |
---|
| 1431 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1432 | +// coneItem.addActionListener(this); |
---|
| 1433 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1434 | +// torusItem.addActionListener(this); |
---|
| 1435 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1436 | +// superItem.addActionListener(this); |
---|
| 1437 | + |
---|
| 1438 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1439 | + cameraItem.addActionListener(this); |
---|
| 1440 | + |
---|
| 1441 | + if (!Globals.ADVANCED) |
---|
| 1442 | + { |
---|
1127 | 1443 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1128 | 1444 | kleinItem.addActionListener(this); |
---|
1129 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1130 | | - particleItem.addActionListener(this); |
---|
| 1445 | + } |
---|
| 1446 | + |
---|
| 1447 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1448 | +// particleItem.addActionListener(this); |
---|
1131 | 1449 | if (Globals.ADVANCED) |
---|
1132 | 1450 | { |
---|
1133 | 1451 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1153 | 1471 | } |
---|
1154 | 1472 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1155 | 1473 | bezierItem.addActionListener(this); |
---|
1156 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1157 | | - overlayItem.addActionListener(this); |
---|
1158 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1159 | | - lightItem.addActionListener(this); |
---|
| 1474 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1475 | +// overlayItem.addActionListener(this); |
---|
| 1476 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1477 | +// lightItem.addActionListener(this); |
---|
1160 | 1478 | menu.add("-"); |
---|
1161 | 1479 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1162 | 1480 | //superLoopItem.addActionListener(this); |
---|
1163 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1164 | | - loopItem.addActionListener(this); |
---|
| 1481 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1482 | +// loopItem.addActionListener(this); |
---|
1165 | 1483 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1166 | 1484 | doubleItem.addActionListener(this); |
---|
1167 | 1485 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1177 | 1495 | animationItem.addItemListener(this); |
---|
1178 | 1496 | animationItem.setState(Globals.ANIMATION); |
---|
1179 | 1497 | |
---|
| 1498 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1499 | + archiveItem.addActionListener(this); |
---|
| 1500 | + |
---|
1180 | 1501 | menu.add("-"); |
---|
1181 | 1502 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1182 | 1503 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1189 | 1510 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1190 | 1511 | reduce34MorphItem.addActionListener(this); |
---|
1191 | 1512 | menu.add("-"); |
---|
| 1513 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1514 | + memoryItem.addActionListener(this); |
---|
1192 | 1515 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1193 | 1516 | computeAOItem.addActionListener(this); |
---|
1194 | 1517 | |
---|
.. | .. |
---|
1197 | 1520 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1198 | 1521 | mirrorItem.addActionListener(this); |
---|
1199 | 1522 | menu.add("-"); |
---|
1200 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1201 | | - memoryItem.addActionListener(this); |
---|
1202 | 1523 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1203 | 1524 | analyzeItem.addActionListener(this); |
---|
1204 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1525 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1205 | 1526 | dumpItem.addActionListener(this); |
---|
1206 | 1527 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1207 | 1528 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1342 | 1663 | shadow.material = new cMaterial(obj.material); |
---|
1343 | 1664 | shadow.material.diffuse = 0.0001f; |
---|
1344 | 1665 | shadow.material.specular = 0.0001f; |
---|
| 1666 | + //shadow.projectedVertices[1].x = 300; |
---|
1345 | 1667 | |
---|
1346 | 1668 | makeSomething(shadow); |
---|
1347 | 1669 | } |
---|
| 1670 | + |
---|
| 1671 | + private void ClearUnpinned() |
---|
| 1672 | + { |
---|
| 1673 | + //for (Object3D obj : listUI) |
---|
| 1674 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1675 | + { |
---|
| 1676 | + Object3D obj = listUI.elementAt(i); |
---|
| 1677 | + if (!obj.pinned) |
---|
| 1678 | + { |
---|
| 1679 | + obj.CloseUI(); |
---|
| 1680 | + listUI.remove(i); |
---|
| 1681 | + } |
---|
| 1682 | + } |
---|
| 1683 | + } |
---|
1348 | 1684 | |
---|
1349 | 1685 | /** |
---|
1350 | 1686 | * applyExample |
---|
.. | .. |
---|
1589 | 1925 | { |
---|
1590 | 1926 | ScreenFit(); |
---|
1591 | 1927 | } else |
---|
1592 | | - if (source == switchItem) |
---|
| 1928 | + if (source == switchViewItem) |
---|
1593 | 1929 | { |
---|
1594 | 1930 | cVector v1 = new cVector(); |
---|
1595 | 1931 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1598 | 1934 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1599 | 1935 | objEditor.cameraView.repaint(); |
---|
1600 | 1936 | } else |
---|
1601 | | - if (source == rectoidItem) |
---|
| 1937 | + if (source == rectoidItem || source == boxButton) |
---|
1602 | 1938 | { |
---|
1603 | 1939 | makeSomething(new Box()); |
---|
1604 | 1940 | } else |
---|
1605 | | - if (source == particleItem) |
---|
| 1941 | + if (source == particleItem || source == particlesButton) |
---|
1606 | 1942 | { |
---|
1607 | 1943 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1608 | 1944 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1681 | 2017 | |
---|
1682 | 2018 | makeSomething(obj); |
---|
1683 | 2019 | } else |
---|
1684 | | - if (source == gridItem) |
---|
| 2020 | + if (source == gridItem || source == gridButton) |
---|
1685 | 2021 | { |
---|
1686 | 2022 | makeSomething(new Grid()); |
---|
1687 | 2023 | } else |
---|
1688 | | - if (source == ellipsoidItem) |
---|
| 2024 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1689 | 2025 | { |
---|
1690 | 2026 | makeSomething(new Sphere()); |
---|
1691 | 2027 | } else |
---|
1692 | | - if (source == coneItem) |
---|
| 2028 | + if (source == coneItem || source == coneButton) |
---|
1693 | 2029 | { |
---|
1694 | 2030 | makeSomething(new Cone()); |
---|
1695 | 2031 | } else |
---|
1696 | | - if (source == torusItem) |
---|
| 2032 | + if (source == torusItem || source == torusButton) |
---|
1697 | 2033 | { |
---|
1698 | 2034 | makeSomething(new Torus()); |
---|
1699 | 2035 | } else |
---|
1700 | | - if (source == superItem) |
---|
| 2036 | + if (source == superItem || source == superButton) |
---|
1701 | 2037 | { |
---|
1702 | 2038 | makeSomething(new Superellipsoid()); |
---|
1703 | 2039 | } else |
---|
1704 | | - if (source == kleinItem) |
---|
| 2040 | + if (source == kleinItem || source == kleinButton) |
---|
1705 | 2041 | { |
---|
1706 | 2042 | makeSomething(new Klein()); |
---|
1707 | 2043 | } else |
---|
.. | .. |
---|
1721 | 2057 | { |
---|
1722 | 2058 | makeSomething(new BezierSurface()); |
---|
1723 | 2059 | } else |
---|
1724 | | - if (source == overlayItem) |
---|
| 2060 | + if (source == overlayItem || source == overlayButton) |
---|
1725 | 2061 | { |
---|
1726 | 2062 | /* |
---|
1727 | 2063 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1769 | 2105 | s.setup(); |
---|
1770 | 2106 | makeSomething(s); |
---|
1771 | 2107 | } else |
---|
1772 | | - if (source == lightItem) |
---|
| 2108 | + if (source == lightItem || source == lightButton) |
---|
1773 | 2109 | { |
---|
1774 | 2110 | makeSomething(new Light()); |
---|
1775 | 2111 | } else |
---|
.. | .. |
---|
1819 | 2155 | |
---|
1820 | 2156 | group(g); |
---|
1821 | 2157 | } else |
---|
1822 | | - if (source == loopItem) |
---|
| 2158 | + if (source == loopItem || source == loopButton) |
---|
1823 | 2159 | { |
---|
1824 | 2160 | Composite csg = new GroupLeaf(); |
---|
1825 | 2161 | csg.count = 5; |
---|
1826 | 2162 | group(csg); |
---|
1827 | | - Composite child = new cGroup(); |
---|
| 2163 | + Composite child = new cGroup("Branch"); |
---|
1828 | 2164 | csg.addChild(child); |
---|
1829 | 2165 | child.addChild(csg); |
---|
1830 | 2166 | } else |
---|
1831 | 2167 | if (source == doubleItem) |
---|
1832 | 2168 | { |
---|
1833 | | - Composite csg = new GroupLeaf(); |
---|
| 2169 | + Composite csg = new GroupLeaf("Fork"); |
---|
1834 | 2170 | csg.count = 5; |
---|
1835 | 2171 | group(csg); |
---|
1836 | | - Composite child = new cGroup(); |
---|
| 2172 | + Composite child = new cGroup("Branch A"); |
---|
1837 | 2173 | csg.addChild(child); |
---|
1838 | 2174 | child.addChild(csg); |
---|
1839 | | - child = new cGroup(); |
---|
| 2175 | + child = new cGroup("Branch B"); |
---|
1840 | 2176 | csg.addChild(child); |
---|
1841 | 2177 | child.addChild(csg); |
---|
1842 | 2178 | } else |
---|
1843 | 2179 | if (source == tripleItem) |
---|
1844 | 2180 | { |
---|
1845 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Trident"); |
---|
1846 | 2182 | csg.count = 4; |
---|
1847 | 2183 | group(csg); |
---|
1848 | 2184 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1854 | 2190 | child = new cGroup(); |
---|
1855 | 2191 | csg.addChild(child); |
---|
1856 | 2192 | child.addChild(csg); |
---|
1857 | | - } else |
---|
1858 | | - |
---|
1859 | | - if (source == importGFDItem) |
---|
1860 | | - { |
---|
1861 | | - ImportGFD(); |
---|
1862 | | - } else |
---|
1863 | | - if (source == importVRMLX3DItem) |
---|
1864 | | - { |
---|
1865 | | - ImportVRMLX3D(); |
---|
1866 | | - } else |
---|
1867 | | - if (source == import3DSItem) |
---|
1868 | | - { |
---|
1869 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1870 | | - } else |
---|
1871 | | - if (source == importOBJItem) |
---|
1872 | | - { |
---|
1873 | | - //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1874 | | - FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
1875 | | - browser.setVisible(true); |
---|
1876 | | - String filename = browser.getFile(); |
---|
1877 | | - if (filename != null && filename.length() > 0) |
---|
1878 | | - { |
---|
1879 | | - String fullname = browser.getDirectory() + filename; |
---|
1880 | | - makeSomething(ReadOBJ(fullname), true); |
---|
1881 | | - } |
---|
1882 | 2193 | } else |
---|
1883 | 2194 | if (source == computeAOItem) |
---|
1884 | 2195 | { |
---|
.. | .. |
---|
1917 | 2228 | { |
---|
1918 | 2229 | DumpObject(); |
---|
1919 | 2230 | } else |
---|
| 2231 | + if (source == minButton) |
---|
| 2232 | + { |
---|
| 2233 | + Minimize(); |
---|
| 2234 | + } else |
---|
| 2235 | + if (source == maxButton) |
---|
| 2236 | + { |
---|
| 2237 | + Maximize(); |
---|
| 2238 | + } else |
---|
| 2239 | + if (source == fullButton) |
---|
| 2240 | + { |
---|
| 2241 | + ToggleFullScreen(); |
---|
| 2242 | + } else |
---|
| 2243 | + if (source == undoButton) |
---|
| 2244 | + { |
---|
| 2245 | + // Go to previous version |
---|
| 2246 | + //if (!Undo()) |
---|
| 2247 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2248 | + Undo(); |
---|
| 2249 | + } else |
---|
| 2250 | + if (source == restoreButton) |
---|
| 2251 | + { |
---|
| 2252 | + // Restore current version |
---|
| 2253 | + Restore(); |
---|
| 2254 | + } else |
---|
| 2255 | + if (source == replaceButton) |
---|
| 2256 | + { |
---|
| 2257 | + // Overwrite current version |
---|
| 2258 | + Replace(); |
---|
| 2259 | + } else |
---|
| 2260 | + if (source == redoButton) |
---|
| 2261 | + { |
---|
| 2262 | + // Go to next version |
---|
| 2263 | + Redo(); |
---|
| 2264 | + } else |
---|
| 2265 | + if (source == saveButton) |
---|
| 2266 | + { |
---|
| 2267 | + // Save a new version |
---|
| 2268 | + if (!Save(true)) |
---|
| 2269 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2270 | + } else |
---|
1920 | 2271 | if (source == oneStepButton) |
---|
1921 | 2272 | { |
---|
1922 | 2273 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1924 | 2275 | } else |
---|
1925 | 2276 | if (source == screenfitButton) |
---|
1926 | 2277 | { |
---|
1927 | | - //Reload(lastConverter, lastFilename, true); |
---|
1928 | 2278 | ScreenFit(); |
---|
1929 | 2279 | } else |
---|
1930 | 2280 | if (source == screenfitpointButton) |
---|
1931 | 2281 | { |
---|
1932 | | - //Reload(lastConverter, lastFilename, true); |
---|
1933 | 2282 | ScreenFitPoint(); |
---|
1934 | 2283 | } else |
---|
1935 | 2284 | if (source == snapobjectButton) |
---|
1936 | 2285 | { |
---|
1937 | | - //Reload(lastConverter, lastFilename, true); |
---|
1938 | 2286 | SnapObject(); |
---|
1939 | 2287 | } else |
---|
1940 | 2288 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1970 | 2318 | if (source == cutItem || source == clearButton) |
---|
1971 | 2319 | { |
---|
1972 | 2320 | loadClipboard(true); |
---|
| 2321 | + } else |
---|
| 2322 | + if (source == undoItem) |
---|
| 2323 | + { |
---|
| 2324 | + Undo(); |
---|
| 2325 | + } else |
---|
| 2326 | + if (source == redoItem) |
---|
| 2327 | + { |
---|
| 2328 | + Redo(); |
---|
1973 | 2329 | } else |
---|
1974 | 2330 | if (source == duplicateItem) |
---|
1975 | 2331 | { |
---|
.. | .. |
---|
2302 | 2658 | { |
---|
2303 | 2659 | ClearSelection(true); |
---|
2304 | 2660 | } else |
---|
2305 | | - if (source == grabItem) |
---|
| 2661 | + if (source == grabItem || source == groupButton) |
---|
2306 | 2662 | { |
---|
2307 | | - group(new cGroup(), true); |
---|
| 2663 | + group(new cGroup(), false); // true); |
---|
2308 | 2664 | } else |
---|
2309 | 2665 | if (source == hideItem) |
---|
2310 | 2666 | { |
---|
.. | .. |
---|
2322 | 2678 | { |
---|
2323 | 2679 | makeSomething(new Camera()); |
---|
2324 | 2680 | } else |
---|
2325 | | - if (source == compositeItem) |
---|
| 2681 | + if (source == compositeItem || source == compositeButton) |
---|
2326 | 2682 | { |
---|
2327 | 2683 | group(new Composite()); |
---|
2328 | 2684 | } else |
---|
2329 | | - if (source == randomItem) |
---|
| 2685 | + if (source == switchItem || source == switchButton) |
---|
2330 | 2686 | { |
---|
2331 | 2687 | RandomNode random = new RandomNode(); |
---|
2332 | 2688 | group(random); |
---|
.. | .. |
---|
2428 | 2784 | { |
---|
2429 | 2785 | group(new cLinker()); |
---|
2430 | 2786 | } else |
---|
2431 | | - if (source == textureItem) |
---|
| 2787 | + if (source == textureItem || source == textureButton) |
---|
2432 | 2788 | { |
---|
2433 | 2789 | group(new TextureNode()); |
---|
2434 | 2790 | } else |
---|
.. | .. |
---|
2448 | 2804 | { |
---|
2449 | 2805 | CastShadow(2); |
---|
2450 | 2806 | } else |
---|
2451 | | - if (source == ungroupItem) |
---|
| 2807 | + if (source == ungroupItem || source == ungroupButton) |
---|
2452 | 2808 | { |
---|
2453 | | - //ungroup(); |
---|
| 2809 | + boolean hasRoot = false; |
---|
| 2810 | + |
---|
2454 | 2811 | for (int i=0; i<group.selection.size(); i++) |
---|
2455 | 2812 | { |
---|
2456 | | - Ungroup(group.selection.get(i)); |
---|
| 2813 | + if (group.selection.get(i) == group) |
---|
| 2814 | + { |
---|
| 2815 | + hasRoot = true; |
---|
| 2816 | + break; |
---|
| 2817 | + } |
---|
2457 | 2818 | } |
---|
2458 | 2819 | |
---|
2459 | | - ClearSelection(false); |
---|
2460 | | - |
---|
2461 | | - refreshContents(); |
---|
| 2820 | + if (!hasRoot) |
---|
| 2821 | + { |
---|
| 2822 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2823 | + { |
---|
| 2824 | + Ungroup(group.selection.get(i)); |
---|
| 2825 | + } |
---|
| 2826 | + |
---|
| 2827 | + ClearSelection(false); |
---|
| 2828 | + |
---|
| 2829 | + refreshContents(); |
---|
| 2830 | + } |
---|
2462 | 2831 | } else |
---|
2463 | 2832 | if (source == genUVItem) |
---|
2464 | 2833 | { |
---|
.. | .. |
---|
2470 | 2839 | } else |
---|
2471 | 2840 | if (source == genNormalsMESHItem) |
---|
2472 | 2841 | { |
---|
2473 | | - GenNormals(true); // TODO |
---|
| 2842 | + GenNormalsMESH(); |
---|
2474 | 2843 | } else |
---|
2475 | 2844 | if (source == genNormalsORGANItem) |
---|
2476 | 2845 | { |
---|
.. | .. |
---|
2535 | 2904 | if (source == unmarkleavesItem) |
---|
2536 | 2905 | { |
---|
2537 | 2906 | MarkLeaves(false); |
---|
| 2907 | + } else |
---|
| 2908 | + if (source == rewindleavesItem) |
---|
| 2909 | + { |
---|
| 2910 | + RewindLeaves(true); |
---|
| 2911 | + } else |
---|
| 2912 | + if (source == unrewindleavesItem) |
---|
| 2913 | + { |
---|
| 2914 | + RewindLeaves(false); |
---|
| 2915 | + } else |
---|
| 2916 | + if (source == randomleavesItem) |
---|
| 2917 | + { |
---|
| 2918 | + RandomLeaves(true); |
---|
| 2919 | + } else |
---|
| 2920 | + if (source == unrandomleavesItem) |
---|
| 2921 | + { |
---|
| 2922 | + RandomLeaves(false); |
---|
2538 | 2923 | } else |
---|
2539 | 2924 | if (source == flipVItem) |
---|
2540 | 2925 | { |
---|
.. | .. |
---|
2770 | 3155 | if (source == twoButton) |
---|
2771 | 3156 | { |
---|
2772 | 3157 | radio.layout = twoButton; |
---|
| 3158 | + |
---|
| 3159 | + if (CameraPane.FULLSCREEN) |
---|
| 3160 | + fullscreenLayout = radio.layout; |
---|
| 3161 | + |
---|
2773 | 3162 | // bug |
---|
2774 | 3163 | //gridPanel.setDividerLocation(1.0); |
---|
2775 | 3164 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2802 | 3191 | bigThree.ClearUI(); |
---|
2803 | 3192 | bigThree.add(centralPanel); |
---|
2804 | 3193 | bigThree.FlushUI(); |
---|
| 3194 | + |
---|
| 3195 | + cameraView.requestFocusInWindow(); |
---|
| 3196 | + |
---|
| 3197 | +// refreshContents(true); |
---|
| 3198 | +// |
---|
| 3199 | +// try |
---|
| 3200 | +// { |
---|
| 3201 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3202 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3203 | +// bot.mouseMove(100, 100); |
---|
| 3204 | +// bot.mousePress(mask); |
---|
| 3205 | +// bot.mouseRelease(mask); |
---|
| 3206 | +// } |
---|
| 3207 | +// catch (Exception e) |
---|
| 3208 | +// { |
---|
| 3209 | +// |
---|
| 3210 | +// } |
---|
| 3211 | + |
---|
2805 | 3212 | } else |
---|
2806 | 3213 | if (source == threeButton) |
---|
2807 | 3214 | { |
---|
2808 | 3215 | radio.layout = threeButton; |
---|
| 3216 | + |
---|
| 3217 | + if (CameraPane.FULLSCREEN) |
---|
| 3218 | + fullscreenLayout = radio.layout; |
---|
2809 | 3219 | |
---|
2810 | 3220 | // bigThree.remove(scenePanel); |
---|
2811 | 3221 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2838 | 3248 | bigThree.add(centralPanel); |
---|
2839 | 3249 | bigThree.add(XYZPanel); |
---|
2840 | 3250 | bigThree.FlushUI(); |
---|
| 3251 | + |
---|
| 3252 | + cameraView.requestFocusInWindow(); |
---|
2841 | 3253 | } else |
---|
2842 | 3254 | if (source == fourButton) |
---|
2843 | 3255 | { |
---|
2844 | 3256 | radio.layout = fourButton; |
---|
| 3257 | + |
---|
| 3258 | + if (CameraPane.FULLSCREEN) |
---|
| 3259 | + fullscreenLayout = radio.layout; |
---|
2845 | 3260 | |
---|
2846 | 3261 | // bigThree.remove(scenePanel); |
---|
2847 | 3262 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2873 | 3288 | bigThree.ClearUI(); |
---|
2874 | 3289 | bigThree.add(scenePanel); |
---|
2875 | 3290 | bigThree.FlushUI(); |
---|
| 3291 | + |
---|
| 3292 | + cameraView.requestFocusInWindow(); |
---|
2876 | 3293 | } else |
---|
2877 | 3294 | if (source == sixButton) |
---|
2878 | 3295 | { |
---|
2879 | 3296 | radio.layout = sixButton; |
---|
| 3297 | + |
---|
| 3298 | + if (CameraPane.FULLSCREEN) |
---|
| 3299 | + fullscreenLayout = radio.layout; |
---|
2880 | 3300 | |
---|
2881 | 3301 | // bigThree.remove(scenePanel); |
---|
2882 | 3302 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2909 | 3329 | bigThree.add(scenePanel); |
---|
2910 | 3330 | bigThree.add(centralPanel); |
---|
2911 | 3331 | bigThree.FlushUI(); |
---|
| 3332 | + |
---|
| 3333 | + cameraView.requestFocusInWindow(); |
---|
2912 | 3334 | } else |
---|
2913 | 3335 | if (source == sevenButton) |
---|
2914 | 3336 | { |
---|
2915 | 3337 | radio.layout = sevenButton; |
---|
| 3338 | + |
---|
| 3339 | + if (CameraPane.FULLSCREEN) |
---|
| 3340 | + fullscreenLayout = radio.layout; |
---|
2916 | 3341 | |
---|
2917 | 3342 | // bigThree.remove(scenePanel); |
---|
2918 | 3343 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2946 | 3371 | bigThree.add(centralPanel); |
---|
2947 | 3372 | bigThree.add(XYZPanel); |
---|
2948 | 3373 | bigThree.FlushUI(); |
---|
| 3374 | + |
---|
| 3375 | + cameraView.requestFocusInWindow(); |
---|
2949 | 3376 | } else |
---|
2950 | 3377 | if (source == rootButton) |
---|
2951 | 3378 | { |
---|
.. | .. |
---|
2957 | 3384 | EditObject(obj); |
---|
2958 | 3385 | } |
---|
2959 | 3386 | |
---|
| 3387 | + cameraView.requestFocusInWindow(); |
---|
2960 | 3388 | refreshContents(true); |
---|
2961 | 3389 | } else |
---|
2962 | 3390 | if (source == closeButton) |
---|
.. | .. |
---|
2966 | 3394 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2967 | 3395 | { |
---|
2968 | 3396 | ab = (cRadio)e.nextElement(); |
---|
2969 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3397 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2970 | 3398 | { |
---|
| 3399 | + // Patch to avoid bug with transparency. |
---|
| 3400 | + if (!ab.hadMaterial) |
---|
| 3401 | + { |
---|
| 3402 | + ab.object.material = null; |
---|
| 3403 | + } |
---|
| 3404 | + |
---|
2971 | 3405 | buttonGroup.remove(ab); |
---|
2972 | 3406 | radioPanel.remove(ab); |
---|
2973 | 3407 | |
---|
2974 | | - ab.GetObject().editWindow = null; |
---|
| 3408 | + //ab.GetObject().editWindow = null; |
---|
| 3409 | + ab.GetObject().manipWindow = null; |
---|
2975 | 3410 | // ab.GetObject().objectUI = null; // ????????? |
---|
2976 | 3411 | |
---|
2977 | 3412 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2978 | 3413 | break; |
---|
2979 | 3414 | } |
---|
2980 | 3415 | } |
---|
| 3416 | + |
---|
| 3417 | + cameraView.requestFocusInWindow(); |
---|
2981 | 3418 | refreshContents(true); |
---|
2982 | 3419 | } else |
---|
2983 | 3420 | if (source == editItem || source == editButton) |
---|
2984 | 3421 | { |
---|
| 3422 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3423 | + { |
---|
| 3424 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3425 | + child.pinned = true; |
---|
| 3426 | + } |
---|
| 3427 | + |
---|
2985 | 3428 | EditSelection(false); |
---|
2986 | 3429 | } else |
---|
2987 | 3430 | if (source == uneditButton) |
---|
.. | .. |
---|
2991 | 3434 | Object3D child = (Object3D)e.nextElement(); |
---|
2992 | 3435 | if(child.editWindow != null) |
---|
2993 | 3436 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3437 | + child.pinned = false; |
---|
2994 | 3438 | child.CloseUI(); |
---|
2995 | 3439 | listUI.remove(child); |
---|
2996 | 3440 | |
---|
2997 | | - child.editWindow = null; // ??????????? |
---|
| 3441 | + //child.editWindow = null; // ??????????? |
---|
2998 | 3442 | } |
---|
2999 | 3443 | objEditor.ctrlPanel.FlushUI(); |
---|
3000 | 3444 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3007 | 3451 | //copy.ClearUI(); |
---|
3008 | 3452 | for (Object3D obj : listUI) |
---|
3009 | 3453 | { |
---|
| 3454 | + obj.pinned = false; |
---|
3010 | 3455 | obj.CloseUI(); |
---|
3011 | 3456 | } |
---|
3012 | 3457 | listUI.clear(); |
---|
.. | .. |
---|
3016 | 3461 | { |
---|
3017 | 3462 | assert(copy == group); |
---|
3018 | 3463 | |
---|
3019 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3464 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3020 | 3465 | |
---|
3021 | 3466 | for (Object3D obj : listUI) |
---|
3022 | 3467 | { |
---|
.. | .. |
---|
3065 | 3510 | } |
---|
3066 | 3511 | |
---|
3067 | 3512 | copy = group; |
---|
| 3513 | + |
---|
| 3514 | + SetUndoStates(); |
---|
| 3515 | + |
---|
3068 | 3516 | //Globals.theRenderer.object = group; |
---|
3069 | 3517 | if(!useclient) |
---|
3070 | 3518 | { |
---|
.. | .. |
---|
3081 | 3529 | sideView.object = group; |
---|
3082 | 3530 | } |
---|
3083 | 3531 | |
---|
3084 | | -// fix "+" issue group.editWindow = this; |
---|
| 3532 | +// fix "+" issue |
---|
| 3533 | + //group.editWindow = this; |
---|
| 3534 | + group.manipWindow = this; |
---|
3085 | 3535 | |
---|
3086 | 3536 | /* |
---|
3087 | 3537 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3089 | 3539 | currentLayout = sevenButton; |
---|
3090 | 3540 | */ |
---|
3091 | 3541 | radio.layout.doClick(); |
---|
| 3542 | + |
---|
| 3543 | + ClearUnpinned(); |
---|
| 3544 | + SetPinStates(group.selection.size() > 0); |
---|
| 3545 | + if (group.selection.size() == 1) |
---|
| 3546 | + EditSelection(false); |
---|
3092 | 3547 | keepparent = group.parent; |
---|
3093 | 3548 | // PARENT = NULL or not??? |
---|
3094 | 3549 | //group.parent = null; // ROOT |
---|
3095 | 3550 | //group.attributes = -1; |
---|
3096 | 3551 | ResetModel(); |
---|
| 3552 | + |
---|
| 3553 | + cameraView.requestFocusInWindow(); |
---|
3097 | 3554 | refreshContents(true); |
---|
3098 | | - } |
---|
| 3555 | + } else if (event.getSource() == editCameraItem) |
---|
| 3556 | + { |
---|
| 3557 | + cameraView.ProtectCamera(); |
---|
| 3558 | + cameraView.repaint(); |
---|
| 3559 | + return; |
---|
| 3560 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3561 | + { |
---|
| 3562 | + cameraView.RevertCamera(); |
---|
| 3563 | + cameraView.repaint(); |
---|
| 3564 | + return; |
---|
| 3565 | + // } else if (event.getSource() == textureButton) |
---|
| 3566 | + // { |
---|
| 3567 | + // return; // true; |
---|
| 3568 | + } |
---|
3099 | 3569 | else |
---|
3100 | 3570 | { |
---|
3101 | 3571 | //return super.action(event, arg); |
---|
.. | .. |
---|
3104 | 3574 | } |
---|
3105 | 3575 | |
---|
3106 | 3576 | boolean useclient = false; |
---|
3107 | | - cRadio radio; |
---|
3108 | 3577 | |
---|
3109 | 3578 | void ToggleRoot() |
---|
3110 | 3579 | { |
---|
.. | .. |
---|
3343 | 3812 | |
---|
3344 | 3813 | int size = obj.MemorySize(); |
---|
3345 | 3814 | |
---|
3346 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3815 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3816 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3347 | 3817 | } |
---|
3348 | 3818 | } |
---|
3349 | 3819 | catch (Exception e) |
---|
.. | .. |
---|
3424 | 3894 | void GenNormals(boolean crease) |
---|
3425 | 3895 | { |
---|
3426 | 3896 | group.GenNormalsS(crease); |
---|
| 3897 | + |
---|
| 3898 | + refreshContents(); |
---|
| 3899 | + } |
---|
| 3900 | + |
---|
| 3901 | + void GenNormalsMESH() |
---|
| 3902 | + { |
---|
| 3903 | + group.GenNormalsMeshS(); |
---|
3427 | 3904 | |
---|
3428 | 3905 | refreshContents(); |
---|
3429 | 3906 | } |
---|
.. | .. |
---|
4051 | 4528 | refreshContents(); |
---|
4052 | 4529 | } |
---|
4053 | 4530 | |
---|
| 4531 | + void RewindLeaves(boolean hide) |
---|
| 4532 | + { |
---|
| 4533 | + group.selection.RewindLeaves(hide); |
---|
| 4534 | + refreshContents(); |
---|
| 4535 | + } |
---|
| 4536 | + |
---|
| 4537 | + void RandomLeaves(boolean hide) |
---|
| 4538 | + { |
---|
| 4539 | + group.selection.RandomLeaves(hide); |
---|
| 4540 | + refreshContents(); |
---|
| 4541 | + } |
---|
| 4542 | + |
---|
4054 | 4543 | void SetTexRes(int tr) |
---|
4055 | 4544 | { |
---|
4056 | 4545 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4122 | 4611 | // } |
---|
4123 | 4612 | // } |
---|
4124 | 4613 | |
---|
4125 | | - static boolean allparams = true; |
---|
4126 | | - |
---|
4127 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4128 | | - |
---|
4129 | 4614 | void EditSelection(boolean newWindow) |
---|
4130 | 4615 | { |
---|
4131 | 4616 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4133 | 4618 | { |
---|
4134 | 4619 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4135 | 4620 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4136 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4621 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4137 | 4622 | |
---|
4138 | 4623 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4139 | 4624 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4218 | 4703 | //new Exception().printStackTrace(); |
---|
4219 | 4704 | |
---|
4220 | 4705 | freezemodel = true; |
---|
4221 | | - |
---|
| 4706 | + ClearUnpinned(); |
---|
| 4707 | + |
---|
4222 | 4708 | /**/ |
---|
4223 | 4709 | //switch (event.id) |
---|
4224 | 4710 | { |
---|
.. | .. |
---|
4226 | 4712 | //case 702: // Event.LIST_DESELECT |
---|
4227 | 4713 | group.deselectAll(); |
---|
4228 | 4714 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4229 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4230 | 4715 | if (tps != null) |
---|
4231 | 4716 | { |
---|
4232 | 4717 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4235 | 4720 | |
---|
4236 | 4721 | //if (child.parent != null) |
---|
4237 | 4722 | //child.parent.addSelectee(child); |
---|
| 4723 | + objEditor.SetMaterial(child); |
---|
4238 | 4724 | group.addSelectee(child); |
---|
4239 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4240 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4241 | | - System.err.println("info : " + child.GetPath()); |
---|
4242 | 4725 | } |
---|
4243 | 4726 | } |
---|
4244 | 4727 | // else |
---|
.. | .. |
---|
4248 | 4731 | // System.err.println("info : " + group.GetPath()); |
---|
4249 | 4732 | // } |
---|
4250 | 4733 | |
---|
4251 | | - objEditor.SetText(); // jan 2014 |
---|
4252 | | - |
---|
4253 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4734 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4254 | 4735 | CameraPane.flash = true; |
---|
4255 | 4736 | |
---|
4256 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4737 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4257 | 4738 | // a camera |
---|
4258 | 4739 | { |
---|
4259 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4260 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4740 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4741 | + { |
---|
| 4742 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4743 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4744 | + } |
---|
4261 | 4745 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4262 | 4746 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4263 | 4747 | } |
---|
4264 | 4748 | |
---|
| 4749 | + if (tps != null && tps.length == 1) |
---|
| 4750 | + { |
---|
| 4751 | + EditSelection(false); |
---|
| 4752 | + } |
---|
| 4753 | + |
---|
| 4754 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4755 | + |
---|
4265 | 4756 | refreshContents(); |
---|
4266 | 4757 | //return true; |
---|
4267 | 4758 | } |
---|
.. | .. |
---|
4270 | 4761 | |
---|
4271 | 4762 | freezemodel = false; |
---|
4272 | 4763 | } |
---|
| 4764 | + |
---|
| 4765 | + void SetPinStates(boolean enabled) |
---|
| 4766 | + { |
---|
| 4767 | + editButton.setEnabled(enabled); |
---|
| 4768 | + uneditButton.setEnabled(enabled); |
---|
| 4769 | + unselectButton.setEnabled(enabled); |
---|
| 4770 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4771 | + } |
---|
| 4772 | + |
---|
| 4773 | + void refreshContents(boolean cp) |
---|
| 4774 | + { |
---|
| 4775 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4776 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4777 | + { |
---|
| 4778 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4779 | + |
---|
| 4780 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4781 | + { |
---|
| 4782 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4783 | + |
---|
| 4784 | + objEditor.AddInfo(child, this, true); |
---|
| 4785 | + System.err.println("info : " + child.GetPath()); |
---|
| 4786 | + } |
---|
| 4787 | + |
---|
| 4788 | + objEditor.SetText(); // jan 2014 |
---|
| 4789 | + } |
---|
| 4790 | + |
---|
| 4791 | + super.refreshContents(cp); |
---|
| 4792 | + } |
---|
4273 | 4793 | |
---|
4274 | 4794 | void linkSomething(Object3D thing) |
---|
4275 | 4795 | { |
---|
.. | .. |
---|
4341 | 4861 | { |
---|
4342 | 4862 | if (group.selection.isEmpty()) |
---|
4343 | 4863 | return; |
---|
| 4864 | + |
---|
4344 | 4865 | Grafreed.clipboardIsTempGroup = false; |
---|
4345 | 4866 | Composite tGroup = null; |
---|
4346 | 4867 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4351 | 4872 | |
---|
4352 | 4873 | if (cut) |
---|
4353 | 4874 | { |
---|
| 4875 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4876 | +// Save(); |
---|
4354 | 4877 | //int indices[] = jList.getSelectedIndices(); |
---|
4355 | 4878 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4356 | 4879 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4440 | 4963 | } |
---|
4441 | 4964 | |
---|
4442 | 4965 | } |
---|
| 4966 | + |
---|
4443 | 4967 | if (Grafreed.clipboardIsTempGroup) |
---|
4444 | 4968 | Grafreed.clipboard = tGroup; |
---|
| 4969 | + |
---|
4445 | 4970 | if (cut) |
---|
4446 | 4971 | { |
---|
4447 | 4972 | ResetModel(); |
---|
.. | .. |
---|
4451 | 4976 | |
---|
4452 | 4977 | void paste(boolean expand) |
---|
4453 | 4978 | { |
---|
| 4979 | + if (Globals.REPLACEONMAKE) |
---|
| 4980 | + Save(); |
---|
| 4981 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4982 | + Globals.REPLACEONMAKE = false; |
---|
4454 | 4983 | // if (GrafreeD.clipboard == null) |
---|
4455 | 4984 | // return; |
---|
4456 | 4985 | boolean first = true; |
---|
.. | .. |
---|
4510 | 5039 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4511 | 5040 | } |
---|
4512 | 5041 | |
---|
| 5042 | + Globals.REPLACEONMAKE = keep; |
---|
4513 | 5043 | ResetModel(); |
---|
4514 | 5044 | refreshContents(); |
---|
4515 | 5045 | } |
---|
.. | .. |
---|
4645 | 5175 | |
---|
4646 | 5176 | void group(Object3D csg, boolean grab) |
---|
4647 | 5177 | { |
---|
| 5178 | + if (Globals.REPLACEONMAKE) |
---|
| 5179 | + Save(); |
---|
| 5180 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5181 | + Globals.REPLACEONMAKE = false; |
---|
4648 | 5182 | if (//false) // why?? |
---|
4649 | 5183 | !group.selection.isEmpty()) |
---|
4650 | 5184 | { |
---|
.. | .. |
---|
4758 | 5292 | //node.add(csg); |
---|
4759 | 5293 | //makeSomething(node); |
---|
4760 | 5294 | makeSomething(csg); |
---|
| 5295 | + Globals.REPLACEONMAKE = keep; |
---|
4761 | 5296 | } |
---|
4762 | 5297 | |
---|
4763 | 5298 | void Ungroup(Object3D g) |
---|
4764 | 5299 | { |
---|
| 5300 | + if (Globals.REPLACEONMAKE) |
---|
| 5301 | + Save(); |
---|
| 5302 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5303 | + Globals.REPLACEONMAKE = false; |
---|
4765 | 5304 | if (g instanceof HiddenObject) |
---|
4766 | 5305 | { |
---|
4767 | 5306 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4778 | 5317 | objEditor.makeSomething(g.get(i), false); |
---|
4779 | 5318 | } |
---|
4780 | 5319 | } |
---|
| 5320 | + Globals.REPLACEONMAKE = keep; |
---|
4781 | 5321 | } |
---|
4782 | 5322 | |
---|
4783 | 5323 | void ungroup() |
---|
.. | .. |
---|
4973 | 5513 | } |
---|
4974 | 5514 | */ |
---|
4975 | 5515 | |
---|
4976 | | - void ImportGFD() |
---|
4977 | | - { |
---|
4978 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4979 | | - browser.show(); |
---|
4980 | | - String filename = browser.getFile(); |
---|
4981 | | - if (filename != null && filename.length() > 0) |
---|
4982 | | - { |
---|
4983 | | - String fullname = browser.getDirectory() + filename; |
---|
4984 | | - |
---|
4985 | | - //Object3D readobj = |
---|
4986 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4987 | | - //makeSomething(readobj); |
---|
4988 | | - } |
---|
4989 | | - } |
---|
4990 | | - |
---|
4991 | 5516 | /* |
---|
4992 | 5517 | public void Callback(Object obj) |
---|
4993 | 5518 | { |
---|
.. | .. |
---|
5011 | 5536 | } |
---|
5012 | 5537 | */ |
---|
5013 | 5538 | |
---|
5014 | | - void ImportVRMLX3D() |
---|
5015 | | - { |
---|
5016 | | - if (Grafreed.standAlone) |
---|
5017 | | - { |
---|
5018 | | - /**/ |
---|
5019 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
5020 | | - browser.show(); |
---|
5021 | | - String filename = browser.getFile(); |
---|
5022 | | - if (filename != null && filename.length() > 0) |
---|
5023 | | - { |
---|
5024 | | - String fullname = browser.getDirectory() + filename; |
---|
5025 | | - LoadVRMLX3D(fullname); |
---|
5026 | | - } |
---|
5027 | | - /**/ |
---|
5028 | | - } |
---|
5029 | | - } |
---|
5030 | | - |
---|
5031 | 5539 | String GetFile(String dialogName) |
---|
5032 | 5540 | { |
---|
5033 | 5541 | if (Grafreed.standAlone) |
---|
.. | .. |
---|
5098 | 5606 | cButton clearpanelButton; |
---|
5099 | 5607 | cButton unselectButton; |
---|
5100 | 5608 | |
---|
| 5609 | + cButton restoreCameraButton; |
---|
| 5610 | + |
---|
| 5611 | + cButton saveButton; |
---|
5101 | 5612 | cButton oneStepButton; |
---|
| 5613 | + |
---|
| 5614 | + cButton groupButton; |
---|
| 5615 | + cButton ungroupButton; |
---|
| 5616 | + cButton compositeButton; |
---|
| 5617 | + cButton switchButton; |
---|
| 5618 | + cButton loopButton; |
---|
| 5619 | + cButton textureButton; |
---|
| 5620 | + |
---|
| 5621 | + cButton gridButton; |
---|
| 5622 | + cButton boxButton; |
---|
| 5623 | + cButton sphereButton; |
---|
| 5624 | + cButton coneButton; |
---|
| 5625 | + cButton torusButton; |
---|
| 5626 | + cButton superButton; |
---|
| 5627 | + cButton kleinButton; |
---|
| 5628 | + cButton particlesButton; |
---|
| 5629 | + cButton overlayButton; |
---|
| 5630 | + cButton lightButton; |
---|
5102 | 5631 | |
---|
5103 | 5632 | cButton screenfitButton; |
---|
5104 | 5633 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5111 | 5640 | |
---|
5112 | 5641 | cButton setsupportButton; |
---|
5113 | 5642 | |
---|
5114 | | - cButton twoButton; |
---|
5115 | | - cButton sixButton; |
---|
5116 | | - cButton threeButton; |
---|
5117 | | - cButton sevenButton; |
---|
5118 | | - cButton fourButton; // full panel |
---|
5119 | | - cButton oneButton; // full XYZ |
---|
5120 | | - //cButton currentLayout; |
---|
5121 | | - |
---|
5122 | 5643 | // |
---|
5123 | 5644 | //Composite |
---|
5124 | 5645 | Object3D // to do !! |
---|
.. | .. |
---|
5128 | 5649 | //JTree jTree; |
---|
5129 | 5650 | private MenuItem lookAtItem; |
---|
5130 | 5651 | private MenuItem lookFromItem; |
---|
5131 | | - private MenuItem switchItem; |
---|
| 5652 | + private MenuItem switchViewItem; |
---|
5132 | 5653 | private MenuItem cutItem; |
---|
5133 | | - private MenuItem duplicateItem; |
---|
| 5654 | + private MenuItem undoItem; |
---|
| 5655 | + private MenuItem redoItem; |
---|
| 5656 | + private JMenuItem duplicateItem; |
---|
5134 | 5657 | private MenuItem cloneItem; |
---|
5135 | 5658 | private MenuItem cloneSupportItem; |
---|
5136 | 5659 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5193 | 5716 | private MenuItem showleavesItem; |
---|
5194 | 5717 | private MenuItem markleavesItem; |
---|
5195 | 5718 | private MenuItem unmarkleavesItem; |
---|
| 5719 | + private MenuItem rewindleavesItem; |
---|
| 5720 | + private MenuItem unrewindleavesItem; |
---|
| 5721 | + private MenuItem randomleavesItem; |
---|
| 5722 | + private MenuItem unrandomleavesItem; |
---|
5196 | 5723 | |
---|
5197 | 5724 | private MenuItem flipVItem; |
---|
5198 | 5725 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5214 | 5741 | private MenuItem frontItem; |
---|
5215 | 5742 | private MenuItem cameraItem; |
---|
5216 | 5743 | private MenuItem compositeItem; |
---|
5217 | | - private MenuItem randomItem; |
---|
| 5744 | + private MenuItem switchItem; |
---|
5218 | 5745 | private MenuItem physicsItem; |
---|
5219 | 5746 | private MenuItem frameselectorItem; |
---|
5220 | 5747 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5276 | 5803 | private MenuItem doubleItem; |
---|
5277 | 5804 | private MenuItem tripleItem; |
---|
5278 | 5805 | |
---|
5279 | | - private MenuItem importGFDItem; |
---|
5280 | | - private MenuItem importVRMLX3DItem; |
---|
5281 | | - private MenuItem import3DSItem; |
---|
5282 | | - private MenuItem importOBJItem; |
---|
5283 | | - |
---|
5284 | 5806 | private MenuItem computeAOItem; |
---|
5285 | 5807 | private MenuItem recompileItem; |
---|
5286 | 5808 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5290 | 5812 | private MenuItem analyzeItem; |
---|
5291 | 5813 | private MenuItem dumpItem; |
---|
5292 | 5814 | //boolean freezemodel = false; |
---|
| 5815 | + |
---|
| 5816 | + Menu cameraMenu; |
---|
| 5817 | + MenuItem editCameraItem; |
---|
| 5818 | + MenuItem restoreCameraItem; |
---|
5293 | 5819 | } |
---|