.. | .. |
---|
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 | } |
---|
.. | .. |
---|
74 | 80 | this.copy = this.group = copy; |
---|
75 | 81 | //selectees = this.group.selectees; |
---|
76 | 82 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 83 | + if (copy.versions == null) |
---|
| 84 | + { |
---|
| 85 | + copy.versions = new byte[100][]; |
---|
| 86 | + copy.versionindex = -1; |
---|
| 87 | + } |
---|
| 88 | + |
---|
| 89 | + SetupMenu2(this); //objEditor); |
---|
78 | 90 | SetupUI2(objEditor); |
---|
79 | 91 | objEditor.SetupUI(true); |
---|
80 | 92 | SetupViews(objEditor); |
---|
.. | .. |
---|
84 | 96 | |
---|
85 | 97 | void CloneSelection(boolean supports) |
---|
86 | 98 | { |
---|
| 99 | + if (Globals.REPLACEONMAKE) |
---|
| 100 | + Save(); |
---|
| 101 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 102 | + Globals.REPLACEONMAKE = false; |
---|
87 | 103 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 104 | //Object3D obj; |
---|
89 | 105 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 110 | |
---|
95 | 111 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 112 | } |
---|
| 113 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 114 | } |
---|
98 | 115 | |
---|
99 | 116 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
148 | 165 | |
---|
149 | 166 | //JTextField nameField; |
---|
150 | 167 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 168 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 169 | { |
---|
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 | | - |
---|
| 170 | + oe.jTree = new cTree(); |
---|
| 171 | + |
---|
168 | 172 | Menu menu; |
---|
169 | 173 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 174 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 175 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 176 | + |
---|
| 177 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 178 | +// undoItem.addActionListener(this); |
---|
| 179 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 180 | +// redoItem.addActionListener(this); |
---|
| 181 | +// menu.add("-"); |
---|
| 182 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 183 | duplicateItem.addActionListener(this); |
---|
174 | 184 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
175 | 185 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
185 | 195 | copyItem.addActionListener(this); |
---|
186 | 196 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 197 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 198 | |
---|
190 | 199 | menu.add("-"); |
---|
191 | 200 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
206 | 215 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 216 | clearAllItem.addActionListener(this); |
---|
208 | 217 | } |
---|
| 218 | + |
---|
| 219 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 220 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 221 | + //zBufferItem.addActionListener(this); |
---|
| 222 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 223 | + //normalLensItem.addActionListener(this); |
---|
| 224 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 225 | + restoreCameraItem.addActionListener(this); |
---|
| 226 | + |
---|
| 227 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 228 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 229 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 230 | +// cameraMenu.add("-"); |
---|
| 231 | +// |
---|
| 232 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 233 | +// toggleTextureItem.addItemListener(this); |
---|
| 234 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 235 | +// |
---|
| 236 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 237 | +// toggleSwitchItem.addItemListener(this); |
---|
| 238 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 239 | + |
---|
| 240 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 241 | + toggleHandleItem.addItemListener(this); |
---|
| 242 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 243 | + |
---|
| 244 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 245 | + togglePaintItem.addItemListener(this); |
---|
| 246 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 247 | + |
---|
| 248 | + if (Globals.ADVANCED) |
---|
| 249 | + { |
---|
| 250 | + cameraMenu.add("-"); |
---|
| 251 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 252 | + toggleLiveItem.addItemListener(this); |
---|
| 253 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 254 | |
---|
| 255 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 256 | + stepItem.addActionListener(this); |
---|
| 257 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 258 | + // toggleDLItem.addItemListener(this); |
---|
| 259 | + // toggleDLItem.setState(false); |
---|
| 260 | + |
---|
| 261 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 262 | + toggleRenderItem.addItemListener(this); |
---|
| 263 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 264 | + |
---|
| 265 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 266 | + toggleDebugItem.addItemListener(this); |
---|
| 267 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 268 | + |
---|
| 269 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 270 | + toggleFrustumItem.addItemListener(this); |
---|
| 271 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 272 | + |
---|
| 273 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 274 | + toggleFootContactItem.addItemListener(this); |
---|
| 275 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 276 | + |
---|
| 277 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 278 | + toggleTimelineItem.addItemListener(this); |
---|
| 279 | + } |
---|
| 280 | + |
---|
| 281 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 282 | +// toggleRootItem.addItemListener(this); |
---|
| 283 | +// toggleRootItem.setState(false); |
---|
| 284 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 285 | +// animationItem.addItemListener(this); |
---|
| 286 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 287 | + cameraMenu.add("-"); |
---|
| 288 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 289 | + editCameraItem.addActionListener(this); |
---|
| 290 | + |
---|
| 291 | + if (Globals.ADVANCED) |
---|
| 292 | + { |
---|
| 293 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 294 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 295 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 296 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 297 | + oe.cameraMenu.add("-"); |
---|
| 298 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 299 | + openWindowItem.addActionListener(this); |
---|
| 300 | + editLeafItem.addActionListener(this); |
---|
| 301 | + lookAtItem.addActionListener(this); |
---|
| 302 | + //lookFromItem.addActinoListener(this); |
---|
| 303 | + //switchViewItem.addActionListener(this); |
---|
| 304 | + } |
---|
| 305 | + |
---|
210 | 306 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 307 | if (Globals.ADVANCED) |
---|
212 | 308 | { |
---|
.. | .. |
---|
249 | 345 | } |
---|
250 | 346 | |
---|
251 | 347 | oe.menuBar.add(menu = new Menu("Group")); |
---|
252 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
253 | | - grabItem.addActionListener(this); |
---|
| 348 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 349 | +// grabItem.addActionListener(this); |
---|
254 | 350 | backItem = menu.add(new MenuItem("Back")); |
---|
255 | 351 | backItem.addActionListener(this); |
---|
256 | 352 | frontItem = menu.add(new MenuItem("Front")); |
---|
257 | 353 | frontItem.addActionListener(this); |
---|
258 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
259 | | - compositeItem.addActionListener(this); |
---|
| 354 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 355 | +// compositeItem.addActionListener(this); |
---|
| 356 | + |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
260 | 359 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
261 | 360 | hideItem.addActionListener(this); |
---|
| 361 | + } |
---|
262 | 362 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
263 | 363 | ungroupItem.addActionListener(this); |
---|
264 | | - menu.add("-"); |
---|
265 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
266 | | - randomItem.addActionListener(this); |
---|
| 364 | + |
---|
| 365 | +// menu.add("-"); |
---|
| 366 | +// |
---|
| 367 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 368 | +// switchItem.addActionListener(this); |
---|
| 369 | + if (Globals.ADVANCED) |
---|
| 370 | + { |
---|
267 | 371 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
268 | 372 | switchGeoItem.addActionListener(this); |
---|
269 | 373 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
271 | 375 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
272 | 376 | morphItem.addActionListener(this); |
---|
273 | 377 | |
---|
274 | | - if (Globals.ADVANCED) |
---|
275 | | - { |
---|
276 | 378 | menu.add("-"); |
---|
277 | 379 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
278 | 380 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
280 | 382 | frameselectorItem.addActionListener(this); |
---|
281 | 383 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
282 | 384 | scriptNodeItem.addActionListener(this); |
---|
283 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
284 | | - cameraItem.addActionListener(this); |
---|
285 | 385 | } |
---|
286 | 386 | |
---|
287 | 387 | oe.menuBar.add(menu = new Menu("Object")); |
---|
288 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
289 | | - textureItem.addActionListener(this); |
---|
| 388 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 389 | +// textureItem.addActionListener(this); |
---|
290 | 390 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
291 | 391 | billboardItem.addActionListener(this); |
---|
292 | 392 | csgItem = menu.add(new MenuItem("CSG")); |
---|
293 | 393 | csgItem.addActionListener(this); |
---|
294 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 394 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
295 | 395 | shadowXItem.addActionListener(this); |
---|
296 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 396 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
297 | 397 | shadowYItem.addActionListener(this); |
---|
298 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 398 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
299 | 399 | shadowZItem.addActionListener(this); |
---|
| 400 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 401 | + attributeItem.addActionListener(this); |
---|
| 402 | + |
---|
300 | 403 | if (Globals.ADVANCED) |
---|
301 | 404 | { |
---|
302 | 405 | menu.add("-"); |
---|
303 | 406 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
304 | 407 | linkerItem.addActionListener(this); |
---|
305 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
306 | | - attributeItem.addActionListener(this); |
---|
307 | 408 | templateItem = menu.add(new MenuItem("Template")); |
---|
308 | 409 | templateItem.addActionListener(this); |
---|
309 | 410 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
392 | 493 | markleavesItem.addActionListener(this); |
---|
393 | 494 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
394 | 495 | unmarkleavesItem.addActionListener(this); |
---|
| 496 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 497 | + rewindleavesItem.addActionListener(this); |
---|
| 498 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 499 | + unrewindleavesItem.addActionListener(this); |
---|
| 500 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 501 | + randomleavesItem.addActionListener(this); |
---|
| 502 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 503 | + unrandomleavesItem.addActionListener(this); |
---|
395 | 504 | menu.add("-"); |
---|
396 | 505 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
397 | 506 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
443 | 552 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
444 | 553 | buildCreateMenu(menu); |
---|
445 | 554 | |
---|
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 | 555 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
460 | 556 | buildToolsMenu(menu); |
---|
461 | 557 | } |
---|
462 | 558 | |
---|
| 559 | + |
---|
463 | 560 | void SetupUI2(ObjEditor oe) |
---|
464 | 561 | { |
---|
| 562 | + // June 2019 |
---|
| 563 | + if (oe == null) |
---|
| 564 | + { |
---|
| 565 | + //super.SetupUI2(this); |
---|
| 566 | + //return; |
---|
| 567 | + } |
---|
| 568 | + |
---|
| 569 | + if (copy != group) |
---|
| 570 | + { |
---|
| 571 | + //super.SetupUI2(this); |
---|
| 572 | + } |
---|
| 573 | + |
---|
465 | 574 | //new Exception().printStackTrace(); |
---|
466 | 575 | |
---|
467 | 576 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
490 | 599 | oe.radioPanel.add(dummyButton); |
---|
491 | 600 | oe.buttonGroup.add(dummyButton); |
---|
492 | 601 | */ |
---|
| 602 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 603 | + |
---|
| 604 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 605 | + |
---|
493 | 606 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
494 | 607 | |
---|
495 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 608 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 609 | + //minButton.setToolTipText("Minimize window"); |
---|
| 610 | + //minButton.addActionListener(this); |
---|
| 611 | + |
---|
| 612 | + if (Globals.ADVANCED) |
---|
| 613 | + { |
---|
| 614 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + maxButton.setToolTipText("Maximize window"); |
---|
| 616 | + maxButton.addActionListener(this); |
---|
| 617 | + } |
---|
| 618 | + |
---|
| 619 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 621 | + fullButton.addActionListener(this); |
---|
| 622 | + |
---|
| 623 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 625 | + screenfitButton.addActionListener(this); |
---|
| 626 | + |
---|
| 627 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 628 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 629 | + restoreCameraButton.addActionListener(this); |
---|
| 630 | + |
---|
| 631 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + saveButton.setToolTipText("New version"); |
---|
| 633 | + saveButton.addActionListener(this); |
---|
| 634 | + |
---|
| 635 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + undoButton.setToolTipText("Previous version"); |
---|
| 637 | + undoButton.addActionListener(this); |
---|
| 638 | + undoButton.setEnabled(false); |
---|
| 639 | + |
---|
| 640 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 641 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + restoreButton.setToolTipText("Restore current"); |
---|
| 643 | + restoreButton.addActionListener(this); |
---|
| 644 | + restoreButton.setEnabled(false); |
---|
| 645 | + |
---|
| 646 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 647 | + replaceButton.setToolTipText("Replace current"); |
---|
| 648 | + replaceButton.addActionListener(this); |
---|
| 649 | + replaceButton.setEnabled(false); |
---|
| 650 | + |
---|
| 651 | + copyOptionsPanel.add(updown); |
---|
| 652 | + |
---|
| 653 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + redoButton.setToolTipText("Next version"); |
---|
| 655 | + redoButton.addActionListener(this); |
---|
| 656 | + redoButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
496 | 659 | liveCB.setToolTipText("Enable animation"); |
---|
497 | 660 | liveCB.addItemListener(this); |
---|
498 | 661 | |
---|
499 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
500 | 663 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
501 | 664 | oneStepButton.addActionListener(this); |
---|
502 | 665 | |
---|
503 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 666 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
504 | 667 | fastCB.setToolTipText("Fast mode"); |
---|
505 | 668 | fastCB.addItemListener(this); |
---|
506 | 669 | |
---|
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); |
---|
| 670 | + //oe.toolboxPanel.Return(); |
---|
| 671 | + |
---|
| 672 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 673 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 674 | +// trackCB.addItemListener(this); |
---|
514 | 675 | |
---|
515 | 676 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
516 | 677 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
522 | 683 | snapobjectButton.setToolTipText("Snap Object"); |
---|
523 | 684 | } |
---|
524 | 685 | |
---|
525 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
526 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
527 | | - flashSelectionButton.addActionListener(this); |
---|
| 686 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
528 | 687 | |
---|
529 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
530 | | - |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
532 | 689 | twoButton.setToolTipText("Show center view only"); |
---|
533 | 690 | twoButton.addActionListener(this); |
---|
534 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 691 | + this.fullscreenLayout = twoButton; |
---|
| 692 | + |
---|
| 693 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
535 | 694 | fourButton.addActionListener(this); |
---|
536 | 695 | fourButton.setToolTipText("Show left panel only"); |
---|
537 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 696 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
538 | 697 | sixButton.setToolTipText("2-column layout left"); |
---|
539 | 698 | sixButton.addActionListener(this); |
---|
540 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 699 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
541 | 700 | threeButton.setToolTipText("2-column layout right"); |
---|
542 | 701 | threeButton.addActionListener(this); |
---|
543 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 702 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | 703 | sevenButton.setToolTipText("3-column layout"); |
---|
545 | 704 | sevenButton.addActionListener(this); |
---|
546 | 705 | // |
---|
547 | 706 | |
---|
548 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 707 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
549 | 708 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
550 | 709 | rootButton.addActionListener(this); |
---|
551 | 710 | |
---|
552 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
553 | 712 | closeButton.setToolTipText("Close tab"); |
---|
554 | 713 | closeButton.addActionListener(this); |
---|
555 | 714 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
556 | 715 | //clearButton.addActionListener(this); |
---|
557 | | - |
---|
558 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 716 | + |
---|
| 717 | + // INSERT |
---|
| 718 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + gridButton.setToolTipText("Create grid"); |
---|
| 720 | + gridButton.addActionListener(this); |
---|
| 721 | + |
---|
| 722 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 723 | + boxButton.setToolTipText("Create box"); |
---|
| 724 | + boxButton.addActionListener(this); |
---|
| 725 | + |
---|
| 726 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 728 | + sphereButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 731 | + coneButton.setToolTipText("Create cone"); |
---|
| 732 | + coneButton.addActionListener(this); |
---|
| 733 | + |
---|
| 734 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 735 | + torusButton.setToolTipText("Create torus"); |
---|
| 736 | + torusButton.addActionListener(this); |
---|
| 737 | + |
---|
| 738 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 739 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 740 | + superButton.addActionListener(this); |
---|
| 741 | + |
---|
| 742 | + if (Globals.ADVANCED) |
---|
| 743 | + { |
---|
| 744 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 745 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 746 | + kleinButton.addActionListener(this); |
---|
| 747 | + } |
---|
559 | 748 | |
---|
560 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
561 | | - editButton.setToolTipText("Edit selection"); |
---|
| 749 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 750 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 751 | + particlesButton.addActionListener(this); |
---|
| 752 | + |
---|
| 753 | + oe.toolboxPanel.Return(); |
---|
| 754 | + |
---|
| 755 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 756 | + groupButton.setToolTipText("Create group"); |
---|
| 757 | + groupButton.addActionListener(this); |
---|
| 758 | + |
---|
| 759 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 760 | + compositeButton.setToolTipText("Create composite"); |
---|
| 761 | + compositeButton.addActionListener(this); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 765 | + switchButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + loopButton.setToolTipText("Create loop"); |
---|
| 769 | + loopButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 772 | + textureButton.setToolTipText("Create texture"); |
---|
| 773 | + textureButton.addActionListener(this); |
---|
| 774 | + |
---|
| 775 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 776 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 777 | + overlayButton.addActionListener(this); |
---|
| 778 | + |
---|
| 779 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + lightButton.setToolTipText("Create light"); |
---|
| 781 | + lightButton.addActionListener(this); |
---|
| 782 | + |
---|
| 783 | + for (int i=6; --i>=0;) |
---|
| 784 | + { |
---|
| 785 | + oe.toolboxPanel.Return(); |
---|
| 786 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 787 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 788 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 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 | + } |
---|
| 794 | + |
---|
| 795 | + // EDIT panel |
---|
| 796 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 797 | + editButton.setToolTipText("Pin selection controls"); |
---|
562 | 798 | editButton.addActionListener(this); |
---|
563 | 799 | |
---|
564 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 800 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 801 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
566 | 802 | uneditButton.addActionListener(this); |
---|
567 | 803 | |
---|
568 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
569 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 804 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 805 | + allParamsButton.setToolTipText("Show all controle"); |
---|
570 | 806 | allParamsButton.addActionListener(this); |
---|
571 | 807 | |
---|
572 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 808 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
573 | 809 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
574 | 810 | clearPanelButton.addActionListener(this); |
---|
575 | 811 | |
---|
576 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 812 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 813 | unselectButton.setToolTipText("Unselect"); |
---|
578 | 814 | unselectButton.addActionListener(this); |
---|
579 | 815 | |
---|
580 | | - commandsPanel.preferredHeight = 1; |
---|
| 816 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 817 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 818 | + flashSelectionButton.addActionListener(this); |
---|
581 | 819 | |
---|
582 | | - oe.treePanel.add(commandsPanel); |
---|
583 | | - oe.treePanel.Return(); |
---|
| 820 | + editCommandsPanel.preferredHeight = 1; |
---|
| 821 | + |
---|
| 822 | + SetPinStates(false); |
---|
| 823 | +// oe.treePanel.add(commandsPanel); |
---|
| 824 | +// oe.treePanel.Return(); |
---|
584 | 825 | |
---|
585 | 826 | // oe.aConstraints.gridx += 1; |
---|
586 | 827 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
597 | 838 | |
---|
598 | 839 | JScrollPane jSP; |
---|
599 | 840 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
600 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 841 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
601 | 842 | ResetModel(); |
---|
602 | 843 | |
---|
603 | 844 | oe.treePanel.add(jSPPanel); |
---|
604 | 845 | oe.treePanel.Return(); |
---|
605 | 846 | |
---|
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 | 847 | oe.treePanel.add(copyOptionsPanel); |
---|
622 | 848 | oe.treePanel.Return(); |
---|
| 849 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 850 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 851 | + sliderPane.preferredHeight = 1; |
---|
623 | 852 | |
---|
624 | 853 | // mainPanel.setDividerLocation(0.5); //1.0); |
---|
625 | 854 | // mainPanel.setResizeWeight(0.5); |
---|
.. | .. |
---|
648 | 877 | |
---|
649 | 878 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
650 | 879 | { |
---|
| 880 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 881 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 882 | + colorCB.addItemListener(this); |
---|
| 883 | + |
---|
| 884 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 885 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 886 | + materialCB.addItemListener(this); |
---|
| 887 | + |
---|
| 888 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 889 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 890 | + textureCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.Return(); |
---|
| 893 | + |
---|
651 | 894 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
652 | 895 | boxCB.setToolTipText("Display bounding boxes"); |
---|
653 | 896 | boxCB.addItemListener(this); |
---|
654 | 897 | |
---|
655 | 898 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
656 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 899 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
657 | 900 | zoomBoxCB.addItemListener(this); |
---|
658 | 901 | |
---|
659 | 902 | if (true) // Globals.ADVANCED) |
---|
660 | 903 | { |
---|
661 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
662 | | - supportCB.setToolTipText("Enable rigging"); |
---|
663 | | - supportCB.addItemListener(this); |
---|
| 904 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 905 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 906 | +// supportCB.addItemListener(this); |
---|
| 907 | + |
---|
| 908 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 909 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 910 | + freezeCB.addItemListener(this); |
---|
664 | 911 | |
---|
665 | 912 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
666 | 913 | // localCB.addItemListener(this); |
---|
667 | 914 | |
---|
| 915 | + panel.Return(); |
---|
| 916 | + |
---|
668 | 917 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
669 | 918 | crowdCB.setToolTipText("Used for crowds"); |
---|
670 | 919 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
681 | 930 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
682 | 931 | // speakerMocapCB.addItemListener(this); |
---|
683 | 932 | |
---|
| 933 | + panel.Return(); |
---|
| 934 | + |
---|
684 | 935 | if (false) |
---|
685 | 936 | { |
---|
686 | 937 | // handled in scripts |
---|
.. | .. |
---|
695 | 946 | //constraints.gridy += 1; |
---|
696 | 947 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
697 | 948 | smoothfocusCB.addItemListener(this); |
---|
| 949 | + panel.Return(); |
---|
698 | 950 | } |
---|
699 | 951 | |
---|
700 | 952 | //constraints.gridx += 1; |
---|
701 | 953 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
702 | 954 | // debugCB.addItemListener(this); |
---|
703 | 955 | |
---|
| 956 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 957 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 958 | + trackCB.addItemListener(this); |
---|
| 959 | + |
---|
704 | 960 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 961 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
705 | 962 | oeilCB.addItemListener(this); |
---|
706 | 963 | |
---|
| 964 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 965 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 966 | + shadowCB.addItemListener(this); |
---|
| 967 | + |
---|
| 968 | + panel.Return(); |
---|
| 969 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 970 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 971 | + toggleTextureCB.addItemListener(this); |
---|
| 972 | + |
---|
| 973 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 974 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 975 | + toggleSwitchCB.addItemListener(this); |
---|
| 976 | + |
---|
| 977 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 978 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 979 | + autokeepCB.addItemListener(this); |
---|
| 980 | + |
---|
| 981 | + panel.Return(); |
---|
| 982 | + if (Globals.ADVANCED) |
---|
| 983 | + { |
---|
707 | 984 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
708 | 985 | lookAtCB.setToolTipText("Look-at target"); |
---|
709 | 986 | lookAtCB.addItemListener(this); |
---|
| 987 | + } |
---|
710 | 988 | |
---|
711 | 989 | } |
---|
712 | 990 | |
---|
713 | 991 | cGridBag fill = new cGridBag(); |
---|
714 | | - |
---|
715 | 992 | fill.preferredHeight = 200; |
---|
| 993 | + cGridBag fill2 = new cGridBag(); |
---|
| 994 | + fill2.preferredHeight = 200; |
---|
| 995 | + cGridBag fill3 = new cGridBag(); |
---|
| 996 | + fill3.preferredHeight = 200; |
---|
716 | 997 | |
---|
717 | 998 | panel.add(fill); |
---|
| 999 | + panel.add(fill2); |
---|
| 1000 | + panel.add(fill3); |
---|
718 | 1001 | |
---|
719 | 1002 | } |
---|
720 | 1003 | |
---|
721 | 1004 | void EditObject(Object3D obj) |
---|
722 | 1005 | { |
---|
723 | 1006 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1007 | + |
---|
| 1008 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1009 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1010 | + if (!radioButton.hadMaterial) |
---|
| 1011 | + { |
---|
| 1012 | + obj.material = new cMaterial(); |
---|
| 1013 | + } |
---|
| 1014 | + |
---|
724 | 1015 | radioButton.SetObject(obj); |
---|
725 | 1016 | radioButton.layout = sevenButton; |
---|
726 | 1017 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
732 | 1023 | |
---|
733 | 1024 | void SetupViews(ObjEditor oe) |
---|
734 | 1025 | { |
---|
| 1026 | + theFrame = this; |
---|
| 1027 | + |
---|
735 | 1028 | oe.SetupViews(); |
---|
736 | 1029 | |
---|
737 | 1030 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
740 | 1033 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
741 | 1034 | } |
---|
742 | 1035 | |
---|
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; |
---|
| 1036 | + cToggleButton liveCB; |
---|
| 1037 | + cCheckBox supportCB; |
---|
| 1038 | + cCheckBox localCB; |
---|
| 1039 | + cCheckBox crowdCB; |
---|
| 1040 | + cCheckBox smoothCB; |
---|
| 1041 | + cToggleButton fastCB; |
---|
| 1042 | + cCheckBox slowCB; |
---|
| 1043 | + cCheckBox boxCB; |
---|
| 1044 | + cCheckBox zoomBoxCB; |
---|
| 1045 | + cCheckBox freezeCB; |
---|
| 1046 | + //cToggleButton trackCB; |
---|
| 1047 | + cCheckBox trackCB; |
---|
| 1048 | + cCheckBox smoothfocusCB; |
---|
754 | 1049 | // JCheckBox speakerMocapCB; |
---|
755 | | - JCheckBox speakerCameraCB; |
---|
756 | | - JCheckBox speakerFocusCB; |
---|
757 | | - JCheckBox debugCB; |
---|
758 | | - JCheckBox oeilCB; |
---|
759 | | - JCheckBox lookAtCB; |
---|
| 1050 | + cCheckBox speakerCameraCB; |
---|
| 1051 | + cCheckBox speakerFocusCB; |
---|
| 1052 | + cCheckBox debugCB; |
---|
| 1053 | + |
---|
| 1054 | + cCheckBox oeilCB; |
---|
| 1055 | + cCheckBox shadowCB; |
---|
| 1056 | + cCheckBox autokeepCB; |
---|
| 1057 | + cCheckBox lookAtCB; |
---|
760 | 1058 | |
---|
761 | 1059 | // static int COLOR = 1; |
---|
762 | 1060 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
764 | 1062 | |
---|
765 | 1063 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
766 | 1064 | |
---|
767 | | - JCheckBox colorCB; |
---|
768 | | - JCheckBox materialCB; |
---|
769 | | - JCheckBox textureCB; |
---|
| 1065 | + cCheckBox colorCB; |
---|
| 1066 | + cCheckBox materialCB; |
---|
| 1067 | + cCheckBox textureCB; |
---|
770 | 1068 | |
---|
771 | 1069 | public void itemStateChanged(ItemEvent e) |
---|
772 | 1070 | { |
---|
.. | .. |
---|
794 | 1092 | } else if(e.getSource() == liveCB) |
---|
795 | 1093 | { |
---|
796 | 1094 | cameraView.ToggleLive(); |
---|
| 1095 | + refreshContents(false); |
---|
797 | 1096 | } |
---|
798 | 1097 | else if(e.getSource() == supportCB) |
---|
799 | 1098 | { |
---|
.. | .. |
---|
858 | 1157 | { |
---|
859 | 1158 | cameraView.ToggleOeil(); |
---|
860 | 1159 | } |
---|
| 1160 | + else if(e.getSource() == shadowCB) |
---|
| 1161 | + { |
---|
| 1162 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1163 | + } |
---|
| 1164 | + else if(e.getSource() == freezeCB) |
---|
| 1165 | + { |
---|
| 1166 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1167 | + } |
---|
| 1168 | + else if(e.getSource() == autokeepCB) |
---|
| 1169 | + { |
---|
| 1170 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1171 | + } |
---|
861 | 1172 | else if(e.getSource() == lookAtCB) |
---|
862 | 1173 | { |
---|
863 | 1174 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
874 | 1185 | |
---|
875 | 1186 | /**/ |
---|
876 | 1187 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
877 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1188 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1189 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
878 | 1190 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
879 | 1191 | // We can't move the root node or an empty selection |
---|
880 | 1192 | return; |
---|
.. | .. |
---|
937 | 1249 | } |
---|
938 | 1250 | } |
---|
939 | 1251 | |
---|
940 | | - String string = (String) object; |
---|
941 | | - |
---|
942 | 1252 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
943 | 1253 | // if( object instanceof java.io.File[]) |
---|
944 | 1254 | // { |
---|
.. | .. |
---|
946 | 1256 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
947 | 1257 | // return; |
---|
948 | 1258 | // } |
---|
| 1259 | + |
---|
| 1260 | + String string = object.toString(); |
---|
949 | 1261 | |
---|
950 | 1262 | // File path for Mac and Windows |
---|
951 | 1263 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
991 | 1303 | |
---|
992 | 1304 | assert target == objEditor.jTree; |
---|
993 | 1305 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1306 | + Object3D destinationLeaf; |
---|
994 | 1307 | try { |
---|
995 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1308 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
996 | 1309 | } catch (Exception e) { |
---|
997 | 1310 | System.out.println("destinationPath : " + destinationPath); |
---|
998 | 1311 | return; |
---|
999 | 1312 | } |
---|
1000 | 1313 | |
---|
1001 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1314 | + for (int i=group.selection.size(); --i>=0;) |
---|
1002 | 1315 | { |
---|
| 1316 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1317 | + |
---|
| 1318 | + // Cannot move into itself |
---|
| 1319 | + if (child == destinationLeaf) |
---|
| 1320 | + return; |
---|
| 1321 | + } |
---|
| 1322 | + |
---|
| 1323 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1324 | +// { |
---|
1003 | 1325 | loadClipboard(true); |
---|
1004 | 1326 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1005 | 1327 | pasteInto(false, false); |
---|
1006 | | - } else { |
---|
1007 | | - loadClipboard(false); |
---|
1008 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1009 | | - pasteInto(false, false); // true); // ??? |
---|
1010 | | - } |
---|
| 1328 | +// } else { |
---|
| 1329 | +// loadClipboard(false); |
---|
| 1330 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1331 | +// pasteInto(false, false); // true); // ??? |
---|
| 1332 | +// } |
---|
1011 | 1333 | } |
---|
1012 | 1334 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1013 | 1335 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1112 | 1434 | { |
---|
1113 | 1435 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1114 | 1436 | //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); |
---|
| 1437 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1438 | +// gridItem.addActionListener(this); |
---|
| 1439 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1440 | +// rectoidItem.addActionListener(this); |
---|
| 1441 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1442 | +// ellipsoidItem.addActionListener(this); |
---|
| 1443 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1444 | +// coneItem.addActionListener(this); |
---|
| 1445 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1446 | +// torusItem.addActionListener(this); |
---|
| 1447 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1448 | +// superItem.addActionListener(this); |
---|
| 1449 | + |
---|
| 1450 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1451 | + cameraItem.addActionListener(this); |
---|
| 1452 | + |
---|
| 1453 | + if (!Globals.ADVANCED) |
---|
| 1454 | + { |
---|
1127 | 1455 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1128 | 1456 | kleinItem.addActionListener(this); |
---|
1129 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1130 | | - particleItem.addActionListener(this); |
---|
| 1457 | + } |
---|
| 1458 | + |
---|
| 1459 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1460 | +// particleItem.addActionListener(this); |
---|
1131 | 1461 | if (Globals.ADVANCED) |
---|
1132 | 1462 | { |
---|
1133 | 1463 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1153 | 1483 | } |
---|
1154 | 1484 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1155 | 1485 | 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); |
---|
| 1486 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1487 | +// overlayItem.addActionListener(this); |
---|
| 1488 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1489 | +// lightItem.addActionListener(this); |
---|
1160 | 1490 | menu.add("-"); |
---|
1161 | 1491 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1162 | 1492 | //superLoopItem.addActionListener(this); |
---|
1163 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1164 | | - loopItem.addActionListener(this); |
---|
| 1493 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1494 | +// loopItem.addActionListener(this); |
---|
1165 | 1495 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1166 | 1496 | doubleItem.addActionListener(this); |
---|
1167 | 1497 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1177 | 1507 | animationItem.addItemListener(this); |
---|
1178 | 1508 | animationItem.setState(Globals.ANIMATION); |
---|
1179 | 1509 | |
---|
| 1510 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1511 | + archiveItem.addActionListener(this); |
---|
| 1512 | + |
---|
1180 | 1513 | menu.add("-"); |
---|
1181 | 1514 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1182 | 1515 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1189 | 1522 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1190 | 1523 | reduce34MorphItem.addActionListener(this); |
---|
1191 | 1524 | menu.add("-"); |
---|
| 1525 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1526 | + memoryItem.addActionListener(this); |
---|
1192 | 1527 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1193 | 1528 | computeAOItem.addActionListener(this); |
---|
1194 | 1529 | |
---|
.. | .. |
---|
1197 | 1532 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1198 | 1533 | mirrorItem.addActionListener(this); |
---|
1199 | 1534 | menu.add("-"); |
---|
1200 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1201 | | - memoryItem.addActionListener(this); |
---|
1202 | 1535 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1203 | 1536 | analyzeItem.addActionListener(this); |
---|
1204 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1537 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1205 | 1538 | dumpItem.addActionListener(this); |
---|
1206 | 1539 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1207 | 1540 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1342 | 1675 | shadow.material = new cMaterial(obj.material); |
---|
1343 | 1676 | shadow.material.diffuse = 0.0001f; |
---|
1344 | 1677 | shadow.material.specular = 0.0001f; |
---|
| 1678 | + //shadow.projectedVertices[1].x = 300; |
---|
1345 | 1679 | |
---|
1346 | 1680 | makeSomething(shadow); |
---|
1347 | 1681 | } |
---|
| 1682 | + |
---|
| 1683 | + private void ClearUnpinned() |
---|
| 1684 | + { |
---|
| 1685 | + //for (Object3D obj : listUI) |
---|
| 1686 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1687 | + { |
---|
| 1688 | + Object3D obj = listUI.elementAt(i); |
---|
| 1689 | + if (!obj.pinned) |
---|
| 1690 | + { |
---|
| 1691 | + obj.CloseUI(); |
---|
| 1692 | + listUI.remove(i); |
---|
| 1693 | + } |
---|
| 1694 | + } |
---|
| 1695 | + } |
---|
1348 | 1696 | |
---|
1349 | 1697 | /** |
---|
1350 | 1698 | * applyExample |
---|
.. | .. |
---|
1589 | 1937 | { |
---|
1590 | 1938 | ScreenFit(); |
---|
1591 | 1939 | } else |
---|
1592 | | - if (source == switchItem) |
---|
| 1940 | + if (source == switchViewItem) |
---|
1593 | 1941 | { |
---|
1594 | 1942 | cVector v1 = new cVector(); |
---|
1595 | 1943 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1598 | 1946 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1599 | 1947 | objEditor.cameraView.repaint(); |
---|
1600 | 1948 | } else |
---|
1601 | | - if (source == rectoidItem) |
---|
| 1949 | + if (source == rectoidItem || source == boxButton) |
---|
1602 | 1950 | { |
---|
1603 | 1951 | makeSomething(new Box()); |
---|
1604 | 1952 | } else |
---|
1605 | | - if (source == particleItem) |
---|
| 1953 | + if (source == particleItem || source == particlesButton) |
---|
1606 | 1954 | { |
---|
1607 | 1955 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1608 | 1956 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1681 | 2029 | |
---|
1682 | 2030 | makeSomething(obj); |
---|
1683 | 2031 | } else |
---|
1684 | | - if (source == gridItem) |
---|
| 2032 | + if (source == gridItem || source == gridButton) |
---|
1685 | 2033 | { |
---|
1686 | 2034 | makeSomething(new Grid()); |
---|
1687 | 2035 | } else |
---|
1688 | | - if (source == ellipsoidItem) |
---|
| 2036 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1689 | 2037 | { |
---|
1690 | 2038 | makeSomething(new Sphere()); |
---|
1691 | 2039 | } else |
---|
1692 | | - if (source == coneItem) |
---|
| 2040 | + if (source == coneItem || source == coneButton) |
---|
1693 | 2041 | { |
---|
1694 | 2042 | makeSomething(new Cone()); |
---|
1695 | 2043 | } else |
---|
1696 | | - if (source == torusItem) |
---|
| 2044 | + if (source == torusItem || source == torusButton) |
---|
1697 | 2045 | { |
---|
1698 | 2046 | makeSomething(new Torus()); |
---|
1699 | 2047 | } else |
---|
1700 | | - if (source == superItem) |
---|
| 2048 | + if (source == superItem || source == superButton) |
---|
1701 | 2049 | { |
---|
1702 | 2050 | makeSomething(new Superellipsoid()); |
---|
1703 | 2051 | } else |
---|
1704 | | - if (source == kleinItem) |
---|
| 2052 | + if (source == kleinItem || source == kleinButton) |
---|
1705 | 2053 | { |
---|
1706 | 2054 | makeSomething(new Klein()); |
---|
1707 | 2055 | } else |
---|
.. | .. |
---|
1721 | 2069 | { |
---|
1722 | 2070 | makeSomething(new BezierSurface()); |
---|
1723 | 2071 | } else |
---|
1724 | | - if (source == overlayItem) |
---|
| 2072 | + if (source == overlayItem || source == overlayButton) |
---|
1725 | 2073 | { |
---|
1726 | 2074 | /* |
---|
1727 | 2075 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1769 | 2117 | s.setup(); |
---|
1770 | 2118 | makeSomething(s); |
---|
1771 | 2119 | } else |
---|
1772 | | - if (source == lightItem) |
---|
| 2120 | + if (source == lightItem || source == lightButton) |
---|
1773 | 2121 | { |
---|
1774 | 2122 | makeSomething(new Light()); |
---|
1775 | 2123 | } else |
---|
.. | .. |
---|
1819 | 2167 | |
---|
1820 | 2168 | group(g); |
---|
1821 | 2169 | } else |
---|
1822 | | - if (source == loopItem) |
---|
| 2170 | + if (source == loopItem || source == loopButton) |
---|
1823 | 2171 | { |
---|
1824 | 2172 | Composite csg = new GroupLeaf(); |
---|
1825 | 2173 | csg.count = 5; |
---|
1826 | 2174 | group(csg); |
---|
1827 | | - Composite child = new cGroup(); |
---|
| 2175 | + Composite child = new cGroup("Branch"); |
---|
1828 | 2176 | csg.addChild(child); |
---|
1829 | 2177 | child.addChild(csg); |
---|
1830 | 2178 | } else |
---|
1831 | 2179 | if (source == doubleItem) |
---|
1832 | 2180 | { |
---|
1833 | | - Composite csg = new GroupLeaf(); |
---|
| 2181 | + Composite csg = new GroupLeaf("Fork"); |
---|
1834 | 2182 | csg.count = 5; |
---|
1835 | 2183 | group(csg); |
---|
1836 | | - Composite child = new cGroup(); |
---|
| 2184 | + Composite child = new cGroup("Branch A"); |
---|
1837 | 2185 | csg.addChild(child); |
---|
1838 | 2186 | child.addChild(csg); |
---|
1839 | | - child = new cGroup(); |
---|
| 2187 | + child = new cGroup("Branch B"); |
---|
1840 | 2188 | csg.addChild(child); |
---|
1841 | 2189 | child.addChild(csg); |
---|
1842 | 2190 | } else |
---|
1843 | 2191 | if (source == tripleItem) |
---|
1844 | 2192 | { |
---|
1845 | | - Composite csg = new GroupLeaf(); |
---|
| 2193 | + Composite csg = new GroupLeaf("Trident"); |
---|
1846 | 2194 | csg.count = 4; |
---|
1847 | 2195 | group(csg); |
---|
1848 | 2196 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1854 | 2202 | child = new cGroup(); |
---|
1855 | 2203 | csg.addChild(child); |
---|
1856 | 2204 | 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 | 2205 | } else |
---|
1883 | 2206 | if (source == computeAOItem) |
---|
1884 | 2207 | { |
---|
.. | .. |
---|
1917 | 2240 | { |
---|
1918 | 2241 | DumpObject(); |
---|
1919 | 2242 | } else |
---|
| 2243 | + if (source == minButton) |
---|
| 2244 | + { |
---|
| 2245 | + Minimize(); |
---|
| 2246 | + } else |
---|
| 2247 | + if (source == maxButton) |
---|
| 2248 | + { |
---|
| 2249 | + Maximize(); |
---|
| 2250 | + } else |
---|
| 2251 | + if (source == fullButton) |
---|
| 2252 | + { |
---|
| 2253 | + ToggleFullScreen(); |
---|
| 2254 | + } else |
---|
| 2255 | + if (source == undoButton) |
---|
| 2256 | + { |
---|
| 2257 | + // Go to previous version |
---|
| 2258 | + //if (!Undo()) |
---|
| 2259 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2260 | + Undo(); |
---|
| 2261 | + } else |
---|
| 2262 | + if (source == restoreButton) |
---|
| 2263 | + { |
---|
| 2264 | + // Restore current version |
---|
| 2265 | + Restore(); |
---|
| 2266 | + } else |
---|
| 2267 | + if (source == replaceButton) |
---|
| 2268 | + { |
---|
| 2269 | + // Overwrite current version |
---|
| 2270 | + Replace(); |
---|
| 2271 | + } else |
---|
| 2272 | + if (source == redoButton) |
---|
| 2273 | + { |
---|
| 2274 | + // Go to next version |
---|
| 2275 | + Redo(); |
---|
| 2276 | + } else |
---|
| 2277 | + if (source == saveButton) |
---|
| 2278 | + { |
---|
| 2279 | + // Save a new version |
---|
| 2280 | + if (!Save(true)) |
---|
| 2281 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2282 | + } else |
---|
1920 | 2283 | if (source == oneStepButton) |
---|
1921 | 2284 | { |
---|
1922 | 2285 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1924 | 2287 | } else |
---|
1925 | 2288 | if (source == screenfitButton) |
---|
1926 | 2289 | { |
---|
1927 | | - //Reload(lastConverter, lastFilename, true); |
---|
1928 | 2290 | ScreenFit(); |
---|
1929 | 2291 | } else |
---|
1930 | 2292 | if (source == screenfitpointButton) |
---|
1931 | 2293 | { |
---|
1932 | | - //Reload(lastConverter, lastFilename, true); |
---|
1933 | 2294 | ScreenFitPoint(); |
---|
1934 | 2295 | } else |
---|
1935 | 2296 | if (source == snapobjectButton) |
---|
1936 | 2297 | { |
---|
1937 | | - //Reload(lastConverter, lastFilename, true); |
---|
1938 | 2298 | SnapObject(); |
---|
1939 | 2299 | } else |
---|
1940 | 2300 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1970 | 2330 | if (source == cutItem || source == clearButton) |
---|
1971 | 2331 | { |
---|
1972 | 2332 | loadClipboard(true); |
---|
| 2333 | + } else |
---|
| 2334 | + if (source == undoItem) |
---|
| 2335 | + { |
---|
| 2336 | + Undo(); |
---|
| 2337 | + } else |
---|
| 2338 | + if (source == redoItem) |
---|
| 2339 | + { |
---|
| 2340 | + Redo(); |
---|
1973 | 2341 | } else |
---|
1974 | 2342 | if (source == duplicateItem) |
---|
1975 | 2343 | { |
---|
.. | .. |
---|
2302 | 2670 | { |
---|
2303 | 2671 | ClearSelection(true); |
---|
2304 | 2672 | } else |
---|
2305 | | - if (source == grabItem) |
---|
| 2673 | + if (source == grabItem || source == groupButton) |
---|
2306 | 2674 | { |
---|
2307 | | - group(new cGroup(), true); |
---|
| 2675 | + group(new cGroup(), false); // true); |
---|
2308 | 2676 | } else |
---|
2309 | 2677 | if (source == hideItem) |
---|
2310 | 2678 | { |
---|
.. | .. |
---|
2322 | 2690 | { |
---|
2323 | 2691 | makeSomething(new Camera()); |
---|
2324 | 2692 | } else |
---|
2325 | | - if (source == compositeItem) |
---|
| 2693 | + if (source == compositeItem || source == compositeButton) |
---|
2326 | 2694 | { |
---|
2327 | 2695 | group(new Composite()); |
---|
2328 | 2696 | } else |
---|
2329 | | - if (source == randomItem) |
---|
| 2697 | + if (source == switchItem || source == switchButton) |
---|
2330 | 2698 | { |
---|
2331 | 2699 | RandomNode random = new RandomNode(); |
---|
2332 | 2700 | group(random); |
---|
.. | .. |
---|
2428 | 2796 | { |
---|
2429 | 2797 | group(new cLinker()); |
---|
2430 | 2798 | } else |
---|
2431 | | - if (source == textureItem) |
---|
| 2799 | + if (source == textureItem || source == textureButton) |
---|
2432 | 2800 | { |
---|
2433 | 2801 | group(new TextureNode()); |
---|
2434 | 2802 | } else |
---|
.. | .. |
---|
2448 | 2816 | { |
---|
2449 | 2817 | CastShadow(2); |
---|
2450 | 2818 | } else |
---|
2451 | | - if (source == ungroupItem) |
---|
| 2819 | + if (source == ungroupItem || source == ungroupButton) |
---|
2452 | 2820 | { |
---|
2453 | | - //ungroup(); |
---|
| 2821 | + boolean hasRoot = false; |
---|
| 2822 | + |
---|
2454 | 2823 | for (int i=0; i<group.selection.size(); i++) |
---|
2455 | 2824 | { |
---|
2456 | | - Ungroup(group.selection.get(i)); |
---|
| 2825 | + if (group.selection.get(i) == group) |
---|
| 2826 | + { |
---|
| 2827 | + hasRoot = true; |
---|
| 2828 | + break; |
---|
| 2829 | + } |
---|
2457 | 2830 | } |
---|
2458 | 2831 | |
---|
2459 | | - ClearSelection(false); |
---|
2460 | | - |
---|
2461 | | - refreshContents(); |
---|
| 2832 | + if (!hasRoot) |
---|
| 2833 | + { |
---|
| 2834 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2835 | + { |
---|
| 2836 | + Ungroup(group.selection.get(i)); |
---|
| 2837 | + } |
---|
| 2838 | + |
---|
| 2839 | + ClearSelection(false); |
---|
| 2840 | + |
---|
| 2841 | + refreshContents(); |
---|
| 2842 | + } |
---|
2462 | 2843 | } else |
---|
2463 | 2844 | if (source == genUVItem) |
---|
2464 | 2845 | { |
---|
.. | .. |
---|
2470 | 2851 | } else |
---|
2471 | 2852 | if (source == genNormalsMESHItem) |
---|
2472 | 2853 | { |
---|
2473 | | - GenNormals(true); // TODO |
---|
| 2854 | + GenNormalsMESH(); |
---|
2474 | 2855 | } else |
---|
2475 | 2856 | if (source == genNormalsORGANItem) |
---|
2476 | 2857 | { |
---|
.. | .. |
---|
2535 | 2916 | if (source == unmarkleavesItem) |
---|
2536 | 2917 | { |
---|
2537 | 2918 | MarkLeaves(false); |
---|
| 2919 | + } else |
---|
| 2920 | + if (source == rewindleavesItem) |
---|
| 2921 | + { |
---|
| 2922 | + RewindLeaves(true); |
---|
| 2923 | + } else |
---|
| 2924 | + if (source == unrewindleavesItem) |
---|
| 2925 | + { |
---|
| 2926 | + RewindLeaves(false); |
---|
| 2927 | + } else |
---|
| 2928 | + if (source == randomleavesItem) |
---|
| 2929 | + { |
---|
| 2930 | + RandomLeaves(true); |
---|
| 2931 | + } else |
---|
| 2932 | + if (source == unrandomleavesItem) |
---|
| 2933 | + { |
---|
| 2934 | + RandomLeaves(false); |
---|
2538 | 2935 | } else |
---|
2539 | 2936 | if (source == flipVItem) |
---|
2540 | 2937 | { |
---|
.. | .. |
---|
2770 | 3167 | if (source == twoButton) |
---|
2771 | 3168 | { |
---|
2772 | 3169 | radio.layout = twoButton; |
---|
| 3170 | + |
---|
| 3171 | + if (CameraPane.FULLSCREEN) |
---|
| 3172 | + fullscreenLayout = radio.layout; |
---|
| 3173 | + |
---|
2773 | 3174 | // bug |
---|
2774 | 3175 | //gridPanel.setDividerLocation(1.0); |
---|
2775 | 3176 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2802 | 3203 | bigThree.ClearUI(); |
---|
2803 | 3204 | bigThree.add(centralPanel); |
---|
2804 | 3205 | bigThree.FlushUI(); |
---|
| 3206 | + |
---|
| 3207 | + cameraView.requestFocusInWindow(); |
---|
| 3208 | + |
---|
| 3209 | +// refreshContents(true); |
---|
| 3210 | +// |
---|
| 3211 | +// try |
---|
| 3212 | +// { |
---|
| 3213 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3214 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3215 | +// bot.mouseMove(100, 100); |
---|
| 3216 | +// bot.mousePress(mask); |
---|
| 3217 | +// bot.mouseRelease(mask); |
---|
| 3218 | +// } |
---|
| 3219 | +// catch (Exception e) |
---|
| 3220 | +// { |
---|
| 3221 | +// |
---|
| 3222 | +// } |
---|
| 3223 | + |
---|
2805 | 3224 | } else |
---|
2806 | 3225 | if (source == threeButton) |
---|
2807 | 3226 | { |
---|
2808 | 3227 | radio.layout = threeButton; |
---|
| 3228 | + |
---|
| 3229 | + if (CameraPane.FULLSCREEN) |
---|
| 3230 | + fullscreenLayout = radio.layout; |
---|
2809 | 3231 | |
---|
2810 | 3232 | // bigThree.remove(scenePanel); |
---|
2811 | 3233 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2838 | 3260 | bigThree.add(centralPanel); |
---|
2839 | 3261 | bigThree.add(XYZPanel); |
---|
2840 | 3262 | bigThree.FlushUI(); |
---|
| 3263 | + |
---|
| 3264 | + cameraView.requestFocusInWindow(); |
---|
2841 | 3265 | } else |
---|
2842 | 3266 | if (source == fourButton) |
---|
2843 | 3267 | { |
---|
2844 | 3268 | radio.layout = fourButton; |
---|
| 3269 | + |
---|
| 3270 | + if (CameraPane.FULLSCREEN) |
---|
| 3271 | + fullscreenLayout = radio.layout; |
---|
2845 | 3272 | |
---|
2846 | 3273 | // bigThree.remove(scenePanel); |
---|
2847 | 3274 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2873 | 3300 | bigThree.ClearUI(); |
---|
2874 | 3301 | bigThree.add(scenePanel); |
---|
2875 | 3302 | bigThree.FlushUI(); |
---|
| 3303 | + |
---|
| 3304 | + cameraView.requestFocusInWindow(); |
---|
2876 | 3305 | } else |
---|
2877 | 3306 | if (source == sixButton) |
---|
2878 | 3307 | { |
---|
2879 | 3308 | radio.layout = sixButton; |
---|
| 3309 | + |
---|
| 3310 | + if (CameraPane.FULLSCREEN) |
---|
| 3311 | + fullscreenLayout = radio.layout; |
---|
2880 | 3312 | |
---|
2881 | 3313 | // bigThree.remove(scenePanel); |
---|
2882 | 3314 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2909 | 3341 | bigThree.add(scenePanel); |
---|
2910 | 3342 | bigThree.add(centralPanel); |
---|
2911 | 3343 | bigThree.FlushUI(); |
---|
| 3344 | + |
---|
| 3345 | + cameraView.requestFocusInWindow(); |
---|
2912 | 3346 | } else |
---|
2913 | 3347 | if (source == sevenButton) |
---|
2914 | 3348 | { |
---|
2915 | 3349 | radio.layout = sevenButton; |
---|
| 3350 | + |
---|
| 3351 | + if (CameraPane.FULLSCREEN) |
---|
| 3352 | + fullscreenLayout = radio.layout; |
---|
2916 | 3353 | |
---|
2917 | 3354 | // bigThree.remove(scenePanel); |
---|
2918 | 3355 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2946 | 3383 | bigThree.add(centralPanel); |
---|
2947 | 3384 | bigThree.add(XYZPanel); |
---|
2948 | 3385 | bigThree.FlushUI(); |
---|
| 3386 | + |
---|
| 3387 | + cameraView.requestFocusInWindow(); |
---|
2949 | 3388 | } else |
---|
2950 | 3389 | if (source == rootButton) |
---|
2951 | 3390 | { |
---|
.. | .. |
---|
2957 | 3396 | EditObject(obj); |
---|
2958 | 3397 | } |
---|
2959 | 3398 | |
---|
| 3399 | + cameraView.requestFocusInWindow(); |
---|
2960 | 3400 | refreshContents(true); |
---|
2961 | 3401 | } else |
---|
2962 | 3402 | if (source == closeButton) |
---|
.. | .. |
---|
2966 | 3406 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2967 | 3407 | { |
---|
2968 | 3408 | ab = (cRadio)e.nextElement(); |
---|
2969 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3409 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2970 | 3410 | { |
---|
| 3411 | + // Patch to avoid bug with transparency. |
---|
| 3412 | + if (!ab.hadMaterial) |
---|
| 3413 | + { |
---|
| 3414 | + ab.object.material = null; |
---|
| 3415 | + } |
---|
| 3416 | + |
---|
2971 | 3417 | buttonGroup.remove(ab); |
---|
2972 | 3418 | radioPanel.remove(ab); |
---|
2973 | 3419 | |
---|
2974 | | - ab.GetObject().editWindow = null; |
---|
| 3420 | + //ab.GetObject().editWindow = null; |
---|
| 3421 | + ab.GetObject().manipWindow = null; |
---|
2975 | 3422 | // ab.GetObject().objectUI = null; // ????????? |
---|
2976 | 3423 | |
---|
2977 | 3424 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2978 | 3425 | break; |
---|
2979 | 3426 | } |
---|
2980 | 3427 | } |
---|
| 3428 | + |
---|
| 3429 | + cameraView.requestFocusInWindow(); |
---|
2981 | 3430 | refreshContents(true); |
---|
2982 | 3431 | } else |
---|
2983 | 3432 | if (source == editItem || source == editButton) |
---|
2984 | 3433 | { |
---|
| 3434 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3435 | + { |
---|
| 3436 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3437 | + child.pinned = true; |
---|
| 3438 | + } |
---|
| 3439 | + |
---|
2985 | 3440 | EditSelection(false); |
---|
2986 | 3441 | } else |
---|
2987 | 3442 | if (source == uneditButton) |
---|
.. | .. |
---|
2991 | 3446 | Object3D child = (Object3D)e.nextElement(); |
---|
2992 | 3447 | if(child.editWindow != null) |
---|
2993 | 3448 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3449 | + child.pinned = false; |
---|
2994 | 3450 | child.CloseUI(); |
---|
2995 | 3451 | listUI.remove(child); |
---|
2996 | 3452 | |
---|
2997 | | - child.editWindow = null; // ??????????? |
---|
| 3453 | + //child.editWindow = null; // ??????????? |
---|
2998 | 3454 | } |
---|
2999 | 3455 | objEditor.ctrlPanel.FlushUI(); |
---|
3000 | 3456 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3007 | 3463 | //copy.ClearUI(); |
---|
3008 | 3464 | for (Object3D obj : listUI) |
---|
3009 | 3465 | { |
---|
| 3466 | + obj.pinned = false; |
---|
3010 | 3467 | obj.CloseUI(); |
---|
3011 | 3468 | } |
---|
3012 | 3469 | listUI.clear(); |
---|
.. | .. |
---|
3016 | 3473 | { |
---|
3017 | 3474 | assert(copy == group); |
---|
3018 | 3475 | |
---|
3019 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3476 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3020 | 3477 | |
---|
3021 | 3478 | for (Object3D obj : listUI) |
---|
3022 | 3479 | { |
---|
.. | .. |
---|
3065 | 3522 | } |
---|
3066 | 3523 | |
---|
3067 | 3524 | copy = group; |
---|
| 3525 | + |
---|
| 3526 | + SetUndoStates(); |
---|
| 3527 | + |
---|
3068 | 3528 | //Globals.theRenderer.object = group; |
---|
3069 | 3529 | if(!useclient) |
---|
3070 | 3530 | { |
---|
.. | .. |
---|
3081 | 3541 | sideView.object = group; |
---|
3082 | 3542 | } |
---|
3083 | 3543 | |
---|
3084 | | -// fix "+" issue group.editWindow = this; |
---|
| 3544 | +// fix "+" issue |
---|
| 3545 | + //group.editWindow = this; |
---|
| 3546 | + group.manipWindow = this; |
---|
3085 | 3547 | |
---|
3086 | 3548 | /* |
---|
3087 | 3549 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3089 | 3551 | currentLayout = sevenButton; |
---|
3090 | 3552 | */ |
---|
3091 | 3553 | radio.layout.doClick(); |
---|
| 3554 | + |
---|
| 3555 | + ClearUnpinned(); |
---|
| 3556 | + Grafreed.Assert(group != null); |
---|
| 3557 | + Grafreed.Assert(group.selection != null); |
---|
| 3558 | + SetPinStates(group.selection.size() > 0); |
---|
| 3559 | + if (group.selection.size() == 1) |
---|
| 3560 | + EditSelection(false); |
---|
3092 | 3561 | keepparent = group.parent; |
---|
3093 | 3562 | // PARENT = NULL or not??? |
---|
3094 | 3563 | //group.parent = null; // ROOT |
---|
3095 | 3564 | //group.attributes = -1; |
---|
3096 | 3565 | ResetModel(); |
---|
| 3566 | + |
---|
| 3567 | + cameraView.requestFocusInWindow(); |
---|
3097 | 3568 | refreshContents(true); |
---|
3098 | | - } |
---|
| 3569 | + } else if (event.getSource() == editCameraItem) |
---|
| 3570 | + { |
---|
| 3571 | + cameraView.ProtectCamera(); |
---|
| 3572 | + cameraView.repaint(); |
---|
| 3573 | + return; |
---|
| 3574 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3575 | + { |
---|
| 3576 | + cameraView.RevertCamera(); |
---|
| 3577 | + cameraView.repaint(); |
---|
| 3578 | + return; |
---|
| 3579 | + // } else if (event.getSource() == textureButton) |
---|
| 3580 | + // { |
---|
| 3581 | + // return; // true; |
---|
| 3582 | + } |
---|
3099 | 3583 | else |
---|
3100 | 3584 | { |
---|
3101 | 3585 | //return super.action(event, arg); |
---|
.. | .. |
---|
3104 | 3588 | } |
---|
3105 | 3589 | |
---|
3106 | 3590 | boolean useclient = false; |
---|
3107 | | - cRadio radio; |
---|
3108 | 3591 | |
---|
3109 | 3592 | void ToggleRoot() |
---|
3110 | 3593 | { |
---|
.. | .. |
---|
3343 | 3826 | |
---|
3344 | 3827 | int size = obj.MemorySize(); |
---|
3345 | 3828 | |
---|
3346 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3829 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3830 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3347 | 3831 | } |
---|
3348 | 3832 | } |
---|
3349 | 3833 | catch (Exception e) |
---|
.. | .. |
---|
3424 | 3908 | void GenNormals(boolean crease) |
---|
3425 | 3909 | { |
---|
3426 | 3910 | group.GenNormalsS(crease); |
---|
| 3911 | + |
---|
| 3912 | + refreshContents(); |
---|
| 3913 | + } |
---|
| 3914 | + |
---|
| 3915 | + void GenNormalsMESH() |
---|
| 3916 | + { |
---|
| 3917 | + group.GenNormalsMeshS(); |
---|
3427 | 3918 | |
---|
3428 | 3919 | refreshContents(); |
---|
3429 | 3920 | } |
---|
.. | .. |
---|
4051 | 4542 | refreshContents(); |
---|
4052 | 4543 | } |
---|
4053 | 4544 | |
---|
| 4545 | + void RewindLeaves(boolean hide) |
---|
| 4546 | + { |
---|
| 4547 | + group.selection.RewindLeaves(hide); |
---|
| 4548 | + refreshContents(); |
---|
| 4549 | + } |
---|
| 4550 | + |
---|
| 4551 | + void RandomLeaves(boolean hide) |
---|
| 4552 | + { |
---|
| 4553 | + group.selection.RandomLeaves(hide); |
---|
| 4554 | + refreshContents(); |
---|
| 4555 | + } |
---|
| 4556 | + |
---|
4054 | 4557 | void SetTexRes(int tr) |
---|
4055 | 4558 | { |
---|
4056 | 4559 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4122 | 4625 | // } |
---|
4123 | 4626 | // } |
---|
4124 | 4627 | |
---|
4125 | | - static boolean allparams = true; |
---|
4126 | | - |
---|
4127 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4128 | | - |
---|
4129 | 4628 | void EditSelection(boolean newWindow) |
---|
4130 | 4629 | { |
---|
4131 | 4630 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4133 | 4632 | { |
---|
4134 | 4633 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4135 | 4634 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4136 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4635 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4137 | 4636 | |
---|
4138 | 4637 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4139 | 4638 | if(elem != group || !newWindow) |
---|
.. | .. |
---|
4218 | 4717 | //new Exception().printStackTrace(); |
---|
4219 | 4718 | |
---|
4220 | 4719 | freezemodel = true; |
---|
4221 | | - |
---|
| 4720 | + ClearUnpinned(); |
---|
| 4721 | + |
---|
4222 | 4722 | /**/ |
---|
4223 | 4723 | //switch (event.id) |
---|
4224 | 4724 | { |
---|
.. | .. |
---|
4226 | 4726 | //case 702: // Event.LIST_DESELECT |
---|
4227 | 4727 | group.deselectAll(); |
---|
4228 | 4728 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4229 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4230 | 4729 | if (tps != null) |
---|
4231 | 4730 | { |
---|
4232 | 4731 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4235 | 4734 | |
---|
4236 | 4735 | //if (child.parent != null) |
---|
4237 | 4736 | //child.parent.addSelectee(child); |
---|
| 4737 | + objEditor.SetMaterial(child); |
---|
4238 | 4738 | group.addSelectee(child); |
---|
4239 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4240 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4241 | | - System.err.println("info : " + child.GetPath()); |
---|
4242 | 4739 | } |
---|
4243 | 4740 | } |
---|
4244 | 4741 | // else |
---|
.. | .. |
---|
4248 | 4745 | // System.err.println("info : " + group.GetPath()); |
---|
4249 | 4746 | // } |
---|
4250 | 4747 | |
---|
4251 | | - objEditor.SetText(); // jan 2014 |
---|
4252 | | - |
---|
4253 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4748 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4254 | 4749 | CameraPane.flash = true; |
---|
4255 | 4750 | |
---|
4256 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4751 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4257 | 4752 | // a camera |
---|
4258 | 4753 | { |
---|
4259 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4260 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4754 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4755 | + { |
---|
| 4756 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4757 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4758 | + } |
---|
4261 | 4759 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4262 | 4760 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4263 | 4761 | } |
---|
4264 | 4762 | |
---|
| 4763 | + if (tps != null && tps.length == 1) |
---|
| 4764 | + { |
---|
| 4765 | + EditSelection(false); |
---|
| 4766 | + } |
---|
| 4767 | + |
---|
| 4768 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4769 | + |
---|
4265 | 4770 | refreshContents(); |
---|
4266 | 4771 | //return true; |
---|
4267 | 4772 | } |
---|
.. | .. |
---|
4270 | 4775 | |
---|
4271 | 4776 | freezemodel = false; |
---|
4272 | 4777 | } |
---|
| 4778 | + |
---|
| 4779 | + void SetPinStates(boolean enabled) |
---|
| 4780 | + { |
---|
| 4781 | + editButton.setEnabled(enabled); |
---|
| 4782 | + uneditButton.setEnabled(enabled); |
---|
| 4783 | + unselectButton.setEnabled(enabled); |
---|
| 4784 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4785 | + } |
---|
| 4786 | + |
---|
| 4787 | + void refreshContents(boolean cp) |
---|
| 4788 | + { |
---|
| 4789 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4790 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4791 | + { |
---|
| 4792 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4793 | + |
---|
| 4794 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4795 | + { |
---|
| 4796 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4797 | + |
---|
| 4798 | + objEditor.AddInfo(child, this, true); |
---|
| 4799 | + System.err.println("info : " + child.GetPath()); |
---|
| 4800 | + } |
---|
| 4801 | + |
---|
| 4802 | + objEditor.SetText(); // jan 2014 |
---|
| 4803 | + } |
---|
| 4804 | + |
---|
| 4805 | + super.refreshContents(cp); |
---|
| 4806 | + } |
---|
4273 | 4807 | |
---|
4274 | 4808 | void linkSomething(Object3D thing) |
---|
4275 | 4809 | { |
---|
.. | .. |
---|
4341 | 4875 | { |
---|
4342 | 4876 | if (group.selection.isEmpty()) |
---|
4343 | 4877 | return; |
---|
| 4878 | + |
---|
4344 | 4879 | Grafreed.clipboardIsTempGroup = false; |
---|
4345 | 4880 | Composite tGroup = null; |
---|
4346 | 4881 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4351 | 4886 | |
---|
4352 | 4887 | if (cut) |
---|
4353 | 4888 | { |
---|
| 4889 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4890 | +// Save(); |
---|
4354 | 4891 | //int indices[] = jList.getSelectedIndices(); |
---|
4355 | 4892 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4356 | 4893 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4440 | 4977 | } |
---|
4441 | 4978 | |
---|
4442 | 4979 | } |
---|
| 4980 | + |
---|
4443 | 4981 | if (Grafreed.clipboardIsTempGroup) |
---|
4444 | 4982 | Grafreed.clipboard = tGroup; |
---|
| 4983 | + |
---|
4445 | 4984 | if (cut) |
---|
4446 | 4985 | { |
---|
4447 | 4986 | ResetModel(); |
---|
.. | .. |
---|
4451 | 4990 | |
---|
4452 | 4991 | void paste(boolean expand) |
---|
4453 | 4992 | { |
---|
| 4993 | + if (Globals.REPLACEONMAKE) |
---|
| 4994 | + Save(); |
---|
| 4995 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 4996 | + Globals.REPLACEONMAKE = false; |
---|
4454 | 4997 | // if (GrafreeD.clipboard == null) |
---|
4455 | 4998 | // return; |
---|
4456 | 4999 | boolean first = true; |
---|
.. | .. |
---|
4510 | 5053 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4511 | 5054 | } |
---|
4512 | 5055 | |
---|
| 5056 | + Globals.REPLACEONMAKE = keep; |
---|
4513 | 5057 | ResetModel(); |
---|
4514 | 5058 | refreshContents(); |
---|
4515 | 5059 | } |
---|
.. | .. |
---|
4645 | 5189 | |
---|
4646 | 5190 | void group(Object3D csg, boolean grab) |
---|
4647 | 5191 | { |
---|
| 5192 | + if (Globals.REPLACEONMAKE) |
---|
| 5193 | + Save(); |
---|
| 5194 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5195 | + Globals.REPLACEONMAKE = false; |
---|
4648 | 5196 | if (//false) // why?? |
---|
4649 | 5197 | !group.selection.isEmpty()) |
---|
4650 | 5198 | { |
---|
.. | .. |
---|
4758 | 5306 | //node.add(csg); |
---|
4759 | 5307 | //makeSomething(node); |
---|
4760 | 5308 | makeSomething(csg); |
---|
| 5309 | + Globals.REPLACEONMAKE = keep; |
---|
4761 | 5310 | } |
---|
4762 | 5311 | |
---|
4763 | 5312 | void Ungroup(Object3D g) |
---|
4764 | 5313 | { |
---|
| 5314 | + if (Globals.REPLACEONMAKE) |
---|
| 5315 | + Save(); |
---|
| 5316 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5317 | + Globals.REPLACEONMAKE = false; |
---|
4765 | 5318 | if (g instanceof HiddenObject) |
---|
4766 | 5319 | { |
---|
4767 | 5320 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4778 | 5331 | objEditor.makeSomething(g.get(i), false); |
---|
4779 | 5332 | } |
---|
4780 | 5333 | } |
---|
| 5334 | + Globals.REPLACEONMAKE = keep; |
---|
4781 | 5335 | } |
---|
4782 | 5336 | |
---|
4783 | 5337 | void ungroup() |
---|
.. | .. |
---|
4973 | 5527 | } |
---|
4974 | 5528 | */ |
---|
4975 | 5529 | |
---|
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 | 5530 | /* |
---|
4992 | 5531 | public void Callback(Object obj) |
---|
4993 | 5532 | { |
---|
.. | .. |
---|
5011 | 5550 | } |
---|
5012 | 5551 | */ |
---|
5013 | 5552 | |
---|
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 | 5553 | String GetFile(String dialogName) |
---|
5032 | 5554 | { |
---|
5033 | 5555 | if (Grafreed.standAlone) |
---|
.. | .. |
---|
5098 | 5620 | cButton clearpanelButton; |
---|
5099 | 5621 | cButton unselectButton; |
---|
5100 | 5622 | |
---|
| 5623 | + cButton restoreCameraButton; |
---|
| 5624 | + |
---|
| 5625 | + cButton saveButton; |
---|
5101 | 5626 | cButton oneStepButton; |
---|
| 5627 | + |
---|
| 5628 | + cButton groupButton; |
---|
| 5629 | + cButton ungroupButton; |
---|
| 5630 | + cButton compositeButton; |
---|
| 5631 | + cButton switchButton; |
---|
| 5632 | + cButton loopButton; |
---|
| 5633 | + cButton textureButton; |
---|
| 5634 | + |
---|
| 5635 | + cButton gridButton; |
---|
| 5636 | + cButton boxButton; |
---|
| 5637 | + cButton sphereButton; |
---|
| 5638 | + cButton coneButton; |
---|
| 5639 | + cButton torusButton; |
---|
| 5640 | + cButton superButton; |
---|
| 5641 | + cButton kleinButton; |
---|
| 5642 | + cButton particlesButton; |
---|
| 5643 | + cButton overlayButton; |
---|
| 5644 | + cButton lightButton; |
---|
5102 | 5645 | |
---|
5103 | 5646 | cButton screenfitButton; |
---|
5104 | 5647 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5111 | 5654 | |
---|
5112 | 5655 | cButton setsupportButton; |
---|
5113 | 5656 | |
---|
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 | 5657 | // |
---|
5123 | 5658 | //Composite |
---|
5124 | 5659 | Object3D // to do !! |
---|
.. | .. |
---|
5128 | 5663 | //JTree jTree; |
---|
5129 | 5664 | private MenuItem lookAtItem; |
---|
5130 | 5665 | private MenuItem lookFromItem; |
---|
5131 | | - private MenuItem switchItem; |
---|
| 5666 | + private MenuItem switchViewItem; |
---|
5132 | 5667 | private MenuItem cutItem; |
---|
5133 | | - private MenuItem duplicateItem; |
---|
| 5668 | + private MenuItem undoItem; |
---|
| 5669 | + private MenuItem redoItem; |
---|
| 5670 | + private JMenuItem duplicateItem; |
---|
5134 | 5671 | private MenuItem cloneItem; |
---|
5135 | 5672 | private MenuItem cloneSupportItem; |
---|
5136 | 5673 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5193 | 5730 | private MenuItem showleavesItem; |
---|
5194 | 5731 | private MenuItem markleavesItem; |
---|
5195 | 5732 | private MenuItem unmarkleavesItem; |
---|
| 5733 | + private MenuItem rewindleavesItem; |
---|
| 5734 | + private MenuItem unrewindleavesItem; |
---|
| 5735 | + private MenuItem randomleavesItem; |
---|
| 5736 | + private MenuItem unrandomleavesItem; |
---|
5196 | 5737 | |
---|
5197 | 5738 | private MenuItem flipVItem; |
---|
5198 | 5739 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5214 | 5755 | private MenuItem frontItem; |
---|
5215 | 5756 | private MenuItem cameraItem; |
---|
5216 | 5757 | private MenuItem compositeItem; |
---|
5217 | | - private MenuItem randomItem; |
---|
| 5758 | + private MenuItem switchItem; |
---|
5218 | 5759 | private MenuItem physicsItem; |
---|
5219 | 5760 | private MenuItem frameselectorItem; |
---|
5220 | 5761 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5276 | 5817 | private MenuItem doubleItem; |
---|
5277 | 5818 | private MenuItem tripleItem; |
---|
5278 | 5819 | |
---|
5279 | | - private MenuItem importGFDItem; |
---|
5280 | | - private MenuItem importVRMLX3DItem; |
---|
5281 | | - private MenuItem import3DSItem; |
---|
5282 | | - private MenuItem importOBJItem; |
---|
5283 | | - |
---|
5284 | 5820 | private MenuItem computeAOItem; |
---|
5285 | 5821 | private MenuItem recompileItem; |
---|
5286 | 5822 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5290 | 5826 | private MenuItem analyzeItem; |
---|
5291 | 5827 | private MenuItem dumpItem; |
---|
5292 | 5828 | //boolean freezemodel = false; |
---|
| 5829 | + |
---|
| 5830 | + Menu cameraMenu; |
---|
| 5831 | + MenuItem editCameraItem; |
---|
| 5832 | + MenuItem restoreCameraItem; |
---|
5293 | 5833 | } |
---|