.. | .. |
---|
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); |
---|
.. | .. |
---|
98 | 98 | |
---|
99 | 99 | void CloneClipboard(boolean supports) |
---|
100 | 100 | { |
---|
101 | | - assert(GrafreeD.clipboard.parent == null); |
---|
102 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
103 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
104 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
105 | | - makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
| 101 | + assert(Grafreed.clipboard.parent == null); |
---|
| 102 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 103 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 104 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 105 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
106 | 106 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 109 | } |
---|
110 | 110 | |
---|
111 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 119 | // obj.support = null; |
---|
120 | 120 | if (!supports) |
---|
121 | 121 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 123 | obj.parent = parent; |
---|
124 | 124 | // obj.support = support; |
---|
125 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 148 | |
---|
149 | 149 | //JTextField nameField; |
---|
150 | 150 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 151 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 152 | { |
---|
153 | | - if (Globals.ADVANCED) |
---|
154 | | - { |
---|
155 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
156 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
157 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
158 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
159 | | - oe.cameraMenu.add("-"); |
---|
160 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
161 | | - openWindowItem.addActionListener(this); |
---|
162 | | - editLeafItem.addActionListener(this); |
---|
163 | | - lookAtItem.addActionListener(this); |
---|
164 | | - //lookFromItem.addActinoListener(this); |
---|
165 | | - //switchItem.addActionListener(this); |
---|
166 | | - } |
---|
167 | | - |
---|
| 153 | + oe.jTree = new cTree(); |
---|
| 154 | + |
---|
168 | 155 | Menu menu; |
---|
169 | 156 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 157 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 158 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 159 | + |
---|
| 160 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 161 | +// undoItem.addActionListener(this); |
---|
| 162 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 163 | +// redoItem.addActionListener(this); |
---|
| 164 | +// menu.add("-"); |
---|
| 165 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 166 | duplicateItem.addActionListener(this); |
---|
174 | 167 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
175 | 168 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
185 | 178 | copyItem.addActionListener(this); |
---|
186 | 179 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 180 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 181 | |
---|
190 | 182 | menu.add("-"); |
---|
191 | 183 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
206 | 198 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 199 | clearAllItem.addActionListener(this); |
---|
208 | 200 | } |
---|
| 201 | + |
---|
| 202 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 203 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 204 | + //zBufferItem.addActionListener(this); |
---|
| 205 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 206 | + //normalLensItem.addActionListener(this); |
---|
| 207 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 208 | + revertCameraItem.addActionListener(this); |
---|
| 209 | + |
---|
| 210 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 211 | + toggleFullScreenItem.addItemListener(this); |
---|
| 212 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 213 | + cameraMenu.add("-"); |
---|
| 214 | + |
---|
| 215 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 216 | + toggleTextureItem.addItemListener(this); |
---|
| 217 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 218 | + |
---|
| 219 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 220 | + toggleSwitchItem.addItemListener(this); |
---|
| 221 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 222 | + |
---|
| 223 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 224 | + toggleHandleItem.addItemListener(this); |
---|
| 225 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 226 | + |
---|
| 227 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 228 | + togglePaintItem.addItemListener(this); |
---|
| 229 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 230 | + |
---|
| 231 | + if (Globals.ADVANCED) |
---|
| 232 | + { |
---|
| 233 | + cameraMenu.add("-"); |
---|
| 234 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 235 | + toggleLiveItem.addItemListener(this); |
---|
| 236 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 237 | |
---|
| 238 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 239 | + stepItem.addActionListener(this); |
---|
| 240 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 241 | + // toggleDLItem.addItemListener(this); |
---|
| 242 | + // toggleDLItem.setState(false); |
---|
| 243 | + |
---|
| 244 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 245 | + toggleRenderItem.addItemListener(this); |
---|
| 246 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 247 | + |
---|
| 248 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 249 | + toggleDebugItem.addItemListener(this); |
---|
| 250 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 251 | + |
---|
| 252 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 253 | + toggleFrustumItem.addItemListener(this); |
---|
| 254 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 255 | + |
---|
| 256 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 257 | + toggleFootContactItem.addItemListener(this); |
---|
| 258 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 259 | + |
---|
| 260 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 261 | + toggleTimelineItem.addItemListener(this); |
---|
| 262 | + } |
---|
| 263 | + |
---|
| 264 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 265 | +// toggleRootItem.addItemListener(this); |
---|
| 266 | +// toggleRootItem.setState(false); |
---|
| 267 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 268 | +// animationItem.addItemListener(this); |
---|
| 269 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 270 | + cameraMenu.add("-"); |
---|
| 271 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 272 | + editCameraItem.addActionListener(this); |
---|
| 273 | + |
---|
| 274 | + if (Globals.ADVANCED) |
---|
| 275 | + { |
---|
| 276 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 277 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 278 | + //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 279 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 280 | + oe.cameraMenu.add("-"); |
---|
| 281 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 282 | + openWindowItem.addActionListener(this); |
---|
| 283 | + editLeafItem.addActionListener(this); |
---|
| 284 | + lookAtItem.addActionListener(this); |
---|
| 285 | + //lookFromItem.addActinoListener(this); |
---|
| 286 | + //switchItem.addActionListener(this); |
---|
| 287 | + } |
---|
| 288 | + |
---|
210 | 289 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 290 | if (Globals.ADVANCED) |
---|
212 | 291 | { |
---|
213 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
214 | | - resetMeshItem.addActionListener(this); |
---|
215 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
216 | | - stepAllItem.addActionListener(this); |
---|
217 | 292 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 293 | revertMeshItem.addActionListener(this); |
---|
219 | 294 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
261 | 336 | frontItem.addActionListener(this); |
---|
262 | 337 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
263 | 338 | compositeItem.addActionListener(this); |
---|
| 339 | + |
---|
| 340 | + if (Globals.ADVANCED) |
---|
| 341 | + { |
---|
264 | 342 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
265 | 343 | hideItem.addActionListener(this); |
---|
| 344 | + } |
---|
266 | 345 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
267 | 346 | ungroupItem.addActionListener(this); |
---|
| 347 | + |
---|
268 | 348 | menu.add("-"); |
---|
| 349 | + |
---|
269 | 350 | randomItem = menu.add(new MenuItem("Switch node")); |
---|
270 | 351 | randomItem.addActionListener(this); |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
271 | 354 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
272 | 355 | switchGeoItem.addActionListener(this); |
---|
273 | 356 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
275 | 358 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
276 | 359 | morphItem.addActionListener(this); |
---|
277 | 360 | |
---|
278 | | - if (Globals.ADVANCED) |
---|
279 | | - { |
---|
280 | 361 | menu.add("-"); |
---|
281 | 362 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
282 | 363 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
295 | 376 | billboardItem.addActionListener(this); |
---|
296 | 377 | csgItem = menu.add(new MenuItem("CSG")); |
---|
297 | 378 | csgItem.addActionListener(this); |
---|
298 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 379 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
299 | 380 | shadowXItem.addActionListener(this); |
---|
300 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 381 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
301 | 382 | shadowYItem.addActionListener(this); |
---|
302 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 383 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
303 | 384 | shadowZItem.addActionListener(this); |
---|
304 | 385 | if (Globals.ADVANCED) |
---|
305 | 386 | { |
---|
.. | .. |
---|
318 | 399 | resetTransformItem.addActionListener(this); |
---|
319 | 400 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 401 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 402 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 403 | + resetCentroidXZItem.addActionListener(this); |
---|
| 404 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 405 | + transformGeometryItem.addActionListener(this); |
---|
| 406 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 407 | + transformChildrenItem.addActionListener(this); |
---|
323 | 408 | |
---|
324 | 409 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 410 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
368 | 453 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 454 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 455 | clearMaterialsItem.addActionListener(this); |
---|
| 456 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 457 | + resetAllItem.addActionListener(this); |
---|
| 458 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 459 | + stepAllItem.addActionListener(this); |
---|
371 | 460 | menu.add("-"); |
---|
372 | 461 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 462 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
388 | 477 | markleavesItem.addActionListener(this); |
---|
389 | 478 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
390 | 479 | unmarkleavesItem.addActionListener(this); |
---|
| 480 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 481 | + rewindleavesItem.addActionListener(this); |
---|
| 482 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 483 | + unrewindleavesItem.addActionListener(this); |
---|
| 484 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 485 | + randomleavesItem.addActionListener(this); |
---|
| 486 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 487 | + unrandomleavesItem.addActionListener(this); |
---|
391 | 488 | menu.add("-"); |
---|
392 | 489 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
393 | 490 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
422 | 519 | sortbysizeItem.addActionListener(this); |
---|
423 | 520 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 521 | sortbynameItem.addActionListener(this); |
---|
| 522 | + menu.add("-"); |
---|
| 523 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 524 | + shareGeometriesItem.addActionListener(this); |
---|
| 525 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 526 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 527 | if (Globals.ADVANCED) |
---|
426 | 528 | { |
---|
427 | | - menu.add("-"); |
---|
| 529 | + // Pretty much the same as duplicate and clone. |
---|
428 | 530 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 531 | extractGeometriesItem.addActionListener(this); |
---|
430 | 532 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 533 | cloneGeometriesItem.addActionListener(this); |
---|
432 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
433 | | - shareGeometriesItem.addActionListener(this); |
---|
434 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
435 | | - mergeGeometriesItem.addActionListener(this); |
---|
436 | 534 | } |
---|
437 | 535 | |
---|
438 | 536 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 537 | buildCreateMenu(menu); |
---|
440 | 538 | |
---|
441 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
442 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
443 | | - importGFDItem.addActionListener(this); |
---|
444 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
445 | | - importVRMLX3DItem.addActionListener(this); |
---|
446 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
447 | | - importOBJItem.addActionListener(this); |
---|
448 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
449 | | - import3DSItem.addActionListener(this); |
---|
450 | | - |
---|
451 | 539 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
452 | 540 | buildToolsMenu(menu); |
---|
453 | 541 | } |
---|
454 | 542 | |
---|
455 | 543 | void SetupUI2(ObjEditor oe) |
---|
456 | 544 | { |
---|
| 545 | + // June 2019 |
---|
| 546 | + if (oe == null) |
---|
| 547 | + { |
---|
| 548 | + //super.SetupUI2(this); |
---|
| 549 | + //return; |
---|
| 550 | + } |
---|
| 551 | + |
---|
| 552 | + if (copy != group) |
---|
| 553 | + { |
---|
| 554 | + //super.SetupUI2(this); |
---|
| 555 | + } |
---|
| 556 | + |
---|
457 | 557 | //new Exception().printStackTrace(); |
---|
458 | 558 | |
---|
459 | 559 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
484 | 584 | */ |
---|
485 | 585 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
486 | 586 | |
---|
487 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
488 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 587 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + //minButton.setToolTipText("Minimize window"); |
---|
| 589 | + //minButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + maxButton.setToolTipText("Maximize window"); |
---|
| 593 | + maxButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 597 | + fullButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + undoButton.setToolTipText("Undo changes"); |
---|
| 601 | + undoButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 604 | + redoButton.setToolTipText("Redo changes"); |
---|
| 605 | + redoButton.addActionListener(this); |
---|
| 606 | + |
---|
| 607 | + oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + saveButton.setToolTipText("Save changes"); |
---|
| 609 | + saveButton.addActionListener(this); |
---|
| 610 | + |
---|
| 611 | + oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 612 | + liveCB.setToolTipText("Enable animation"); |
---|
489 | 613 | liveCB.addItemListener(this); |
---|
490 | 614 | |
---|
491 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
492 | 616 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
493 | 617 | oneStepButton.addActionListener(this); |
---|
494 | 618 | |
---|
495 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 619 | + oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
496 | 620 | fastCB.setToolTipText("Fast mode"); |
---|
497 | 621 | fastCB.addItemListener(this); |
---|
498 | 622 | |
---|
499 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 623 | + oe.toolboxPanel.Return(); |
---|
| 624 | + |
---|
| 625 | + oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
500 | 626 | trackCB.setToolTipText("Enable tracking"); |
---|
501 | 627 | trackCB.addItemListener(this); |
---|
502 | 628 | |
---|
503 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
504 | 630 | screenfitButton.setToolTipText("Screen fit"); |
---|
505 | 631 | screenfitButton.addActionListener(this); |
---|
506 | 632 | |
---|
.. | .. |
---|
509 | 635 | |
---|
510 | 636 | if (Globals.ADVANCED) |
---|
511 | 637 | { |
---|
512 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 638 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
513 | 639 | snapobjectButton.addActionListener(this); |
---|
514 | 640 | snapobjectButton.setToolTipText("Snap Object"); |
---|
515 | 641 | } |
---|
516 | 642 | |
---|
517 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
518 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
| 643 | + oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 644 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
519 | 645 | flashSelectionButton.addActionListener(this); |
---|
520 | 646 | |
---|
521 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 647 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
522 | 648 | |
---|
523 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
524 | 650 | twoButton.setToolTipText("Show center view only"); |
---|
525 | 651 | twoButton.addActionListener(this); |
---|
526 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 652 | + this.fullscreenLayout = twoButton; |
---|
| 653 | + |
---|
| 654 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | 655 | fourButton.addActionListener(this); |
---|
528 | 656 | fourButton.setToolTipText("Show left panel only"); |
---|
529 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 657 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | 658 | sixButton.setToolTipText("2-column layout left"); |
---|
531 | 659 | sixButton.addActionListener(this); |
---|
532 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 660 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | 661 | threeButton.setToolTipText("2-column layout right"); |
---|
534 | 662 | threeButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 663 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | 664 | sevenButton.setToolTipText("3-column layout"); |
---|
537 | 665 | sevenButton.addActionListener(this); |
---|
538 | 666 | // |
---|
539 | 667 | |
---|
540 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 668 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
541 | 669 | rootButton.setToolTipText("Edit selection in new tab"); |
---|
542 | 670 | rootButton.addActionListener(this); |
---|
543 | 671 | |
---|
544 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 672 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
545 | 673 | closeButton.setToolTipText("Close tab"); |
---|
546 | 674 | closeButton.addActionListener(this); |
---|
547 | 675 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
548 | 676 | //clearButton.addActionListener(this); |
---|
549 | | - |
---|
550 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 677 | + |
---|
| 678 | + // INSERT |
---|
| 679 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 680 | + gridButton.setToolTipText("Create grid"); |
---|
| 681 | + gridButton.addActionListener(this); |
---|
| 682 | + |
---|
| 683 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 684 | + boxButton.setToolTipText("Create box"); |
---|
| 685 | + boxButton.addActionListener(this); |
---|
| 686 | + |
---|
| 687 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 689 | + sphereButton.addActionListener(this); |
---|
| 690 | + |
---|
| 691 | + oe.toolboxPanel.Return(); |
---|
551 | 692 | |
---|
552 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 694 | + coneButton.setToolTipText("Create cone"); |
---|
| 695 | + coneButton.addActionListener(this); |
---|
| 696 | + |
---|
| 697 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 698 | + torusButton.setToolTipText("Create torus"); |
---|
| 699 | + torusButton.addActionListener(this); |
---|
| 700 | + |
---|
| 701 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 702 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 703 | + superButton.addActionListener(this); |
---|
| 704 | + |
---|
| 705 | + if (Globals.ADVANCED) |
---|
| 706 | + { |
---|
| 707 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 709 | + kleinButton.addActionListener(this); |
---|
| 710 | + } |
---|
| 711 | + |
---|
| 712 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 714 | + particlesButton.addActionListener(this); |
---|
| 715 | + |
---|
| 716 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 717 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 718 | + overlayButton.addActionListener(this); |
---|
| 719 | + |
---|
| 720 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 721 | + lightButton.setToolTipText("Create light"); |
---|
| 722 | + lightButton.addActionListener(this); |
---|
| 723 | + |
---|
| 724 | + // EDIT panel |
---|
| 725 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
553 | 726 | editButton.setToolTipText("Edit selection"); |
---|
554 | 727 | editButton.addActionListener(this); |
---|
555 | 728 | |
---|
556 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 729 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
557 | 730 | uneditButton.setToolTipText("Unedit selection"); |
---|
558 | 731 | uneditButton.addActionListener(this); |
---|
559 | 732 | |
---|
560 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 733 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
561 | 734 | allParamsButton.setToolTipText("Edit all params"); |
---|
562 | 735 | allParamsButton.addActionListener(this); |
---|
563 | 736 | |
---|
564 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 737 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | 738 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
566 | 739 | clearPanelButton.addActionListener(this); |
---|
567 | 740 | |
---|
568 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 741 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
569 | 742 | unselectButton.setToolTipText("Unselect"); |
---|
570 | 743 | unselectButton.addActionListener(this); |
---|
571 | 744 | |
---|
572 | | - commandsPanel.preferredHeight = 1; |
---|
| 745 | + editCommandsPanel.preferredHeight = 1; |
---|
573 | 746 | |
---|
574 | | - oe.treePanel.add(commandsPanel); |
---|
575 | | - oe.treePanel.Return(); |
---|
| 747 | +// oe.treePanel.add(commandsPanel); |
---|
| 748 | +// oe.treePanel.Return(); |
---|
576 | 749 | |
---|
577 | 750 | // oe.aConstraints.gridx += 1; |
---|
578 | 751 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
589 | 762 | |
---|
590 | 763 | JScrollPane jSP; |
---|
591 | 764 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
592 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 765 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
593 | 766 | ResetModel(); |
---|
594 | 767 | |
---|
595 | 768 | oe.treePanel.add(jSPPanel); |
---|
.. | .. |
---|
648 | 821 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
649 | 822 | zoomBoxCB.addItemListener(this); |
---|
650 | 823 | |
---|
651 | | - if (Globals.ADVANCED) |
---|
| 824 | + if (true) // Globals.ADVANCED) |
---|
652 | 825 | { |
---|
653 | 826 | panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
654 | 827 | supportCB.setToolTipText("Enable rigging"); |
---|
.. | .. |
---|
694 | 867 | // debugCB.addItemListener(this); |
---|
695 | 868 | |
---|
696 | 869 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 870 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
697 | 871 | oeilCB.addItemListener(this); |
---|
698 | 872 | |
---|
| 873 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 874 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 875 | + shadowCB.addItemListener(this); |
---|
| 876 | + |
---|
| 877 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 878 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 879 | + autosaveCB.addItemListener(this); |
---|
| 880 | + |
---|
| 881 | + if (Globals.ADVANCED) |
---|
| 882 | + { |
---|
699 | 883 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
700 | 884 | lookAtCB.setToolTipText("Look-at target"); |
---|
701 | 885 | lookAtCB.addItemListener(this); |
---|
| 886 | + } |
---|
702 | 887 | |
---|
703 | 888 | } |
---|
704 | 889 | |
---|
.. | .. |
---|
713 | 898 | void EditObject(Object3D obj) |
---|
714 | 899 | { |
---|
715 | 900 | cRadio radioButton = new cRadio(obj.name); |
---|
| 901 | + |
---|
| 902 | + // Patch to avoid bug with transparency. |
---|
| 903 | + radioButton.hadMaterial = obj.material != null; |
---|
| 904 | + if (!radioButton.hadMaterial) |
---|
| 905 | + { |
---|
| 906 | + obj.material = new cMaterial(); |
---|
| 907 | + } |
---|
| 908 | + |
---|
716 | 909 | radioButton.SetObject(obj); |
---|
717 | 910 | radioButton.layout = sevenButton; |
---|
718 | 911 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
721 | 914 | buttonGroup.add(radioButton); |
---|
722 | 915 | radioButton.doClick(); |
---|
723 | 916 | } |
---|
| 917 | + |
---|
724 | 918 | void SetupViews(ObjEditor oe) |
---|
725 | 919 | { |
---|
| 920 | + theFrame = this; |
---|
| 921 | + |
---|
726 | 922 | oe.SetupViews(); |
---|
727 | 923 | |
---|
728 | 924 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
731 | 927 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
732 | 928 | } |
---|
733 | 929 | |
---|
734 | | - JCheckBox liveCB; |
---|
735 | | - JCheckBox supportCB; |
---|
736 | | - JCheckBox localCB; |
---|
737 | | - JCheckBox crowdCB; |
---|
738 | | - JCheckBox smoothCB; |
---|
739 | | - JCheckBox fastCB; |
---|
740 | | - JCheckBox slowCB; |
---|
741 | | - JCheckBox boxCB; |
---|
742 | | - JCheckBox zoomBoxCB; |
---|
743 | | - JCheckBox trackCB; |
---|
744 | | - JCheckBox smoothfocusCB; |
---|
| 930 | + cToggleButton liveCB; |
---|
| 931 | + cCheckBox supportCB; |
---|
| 932 | + cCheckBox localCB; |
---|
| 933 | + cCheckBox crowdCB; |
---|
| 934 | + cCheckBox smoothCB; |
---|
| 935 | + cToggleButton fastCB; |
---|
| 936 | + cCheckBox slowCB; |
---|
| 937 | + cCheckBox boxCB; |
---|
| 938 | + cCheckBox zoomBoxCB; |
---|
| 939 | + cToggleButton trackCB; |
---|
| 940 | + cCheckBox smoothfocusCB; |
---|
745 | 941 | // JCheckBox speakerMocapCB; |
---|
746 | | - JCheckBox speakerCameraCB; |
---|
747 | | - JCheckBox speakerFocusCB; |
---|
748 | | - JCheckBox debugCB; |
---|
749 | | - JCheckBox oeilCB; |
---|
750 | | - JCheckBox lookAtCB; |
---|
| 942 | + cCheckBox speakerCameraCB; |
---|
| 943 | + cCheckBox speakerFocusCB; |
---|
| 944 | + cCheckBox debugCB; |
---|
| 945 | + |
---|
| 946 | + cCheckBox oeilCB; |
---|
| 947 | + cCheckBox shadowCB; |
---|
| 948 | + cCheckBox autosaveCB; |
---|
| 949 | + cCheckBox lookAtCB; |
---|
751 | 950 | |
---|
752 | 951 | // static int COLOR = 1; |
---|
753 | 952 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
755 | 954 | |
---|
756 | 955 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
757 | 956 | |
---|
758 | | - JCheckBox colorCB; |
---|
759 | | - JCheckBox materialCB; |
---|
760 | | - JCheckBox textureCB; |
---|
| 957 | + cCheckBox colorCB; |
---|
| 958 | + cCheckBox materialCB; |
---|
| 959 | + cCheckBox textureCB; |
---|
761 | 960 | |
---|
762 | 961 | public void itemStateChanged(ItemEvent e) |
---|
763 | 962 | { |
---|
.. | .. |
---|
785 | 984 | } else if(e.getSource() == liveCB) |
---|
786 | 985 | { |
---|
787 | 986 | cameraView.ToggleLive(); |
---|
| 987 | + refreshContents(false); |
---|
788 | 988 | } |
---|
789 | 989 | else if(e.getSource() == supportCB) |
---|
790 | 990 | { |
---|
.. | .. |
---|
849 | 1049 | { |
---|
850 | 1050 | cameraView.ToggleOeil(); |
---|
851 | 1051 | } |
---|
| 1052 | + else if(e.getSource() == shadowCB) |
---|
| 1053 | + { |
---|
| 1054 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1055 | + } |
---|
| 1056 | + else if(e.getSource() == autosaveCB) |
---|
| 1057 | + { |
---|
| 1058 | + Globals.SAVEONMAKE ^= true; |
---|
| 1059 | + } |
---|
852 | 1060 | else if(e.getSource() == lookAtCB) |
---|
853 | 1061 | { |
---|
854 | 1062 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
865 | 1073 | |
---|
866 | 1074 | /**/ |
---|
867 | 1075 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
868 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1076 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1077 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
869 | 1078 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
870 | 1079 | // We can't move the root node or an empty selection |
---|
871 | 1080 | return; |
---|
.. | .. |
---|
937 | 1146 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
938 | 1147 | // return; |
---|
939 | 1148 | // } |
---|
940 | | - if (string.charAt(0) == '/') |
---|
| 1149 | + |
---|
| 1150 | + // File path for Mac and Windows |
---|
| 1151 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
941 | 1152 | { |
---|
942 | 1153 | // file(s) |
---|
943 | 1154 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
964 | 1175 | |
---|
965 | 1176 | flashIt = false; |
---|
966 | 1177 | CameraPane pane = (CameraPane) target; |
---|
967 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1178 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
968 | 1179 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
969 | 1180 | |
---|
970 | 1181 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
987 | 1198 | return; |
---|
988 | 1199 | } |
---|
989 | 1200 | |
---|
990 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
991 | | - { |
---|
| 1201 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1202 | +// { |
---|
992 | 1203 | loadClipboard(true); |
---|
993 | 1204 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
994 | 1205 | pasteInto(false, false); |
---|
995 | | - } else { |
---|
996 | | - loadClipboard(false); |
---|
997 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
998 | | - pasteInto(false, false); // true); // ??? |
---|
999 | | - } |
---|
| 1206 | +// } else { |
---|
| 1207 | +// loadClipboard(false); |
---|
| 1208 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1209 | +// pasteInto(false, false); // true); // ??? |
---|
| 1210 | +// } |
---|
1000 | 1211 | } |
---|
1001 | 1212 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1002 | 1213 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1190 | 1401 | memoryItem.addActionListener(this); |
---|
1191 | 1402 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1192 | 1403 | analyzeItem.addActionListener(this); |
---|
1193 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1404 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1194 | 1405 | dumpItem.addActionListener(this); |
---|
1195 | 1406 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1196 | 1407 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1331 | 1542 | shadow.material = new cMaterial(obj.material); |
---|
1332 | 1543 | shadow.material.diffuse = 0.0001f; |
---|
1333 | 1544 | shadow.material.specular = 0.0001f; |
---|
| 1545 | + //shadow.projectedVertices[1].x = 300; |
---|
1334 | 1546 | |
---|
1335 | 1547 | makeSomething(shadow); |
---|
1336 | 1548 | } |
---|
.. | .. |
---|
1537 | 1749 | |
---|
1538 | 1750 | void Overwrite(int mask) |
---|
1539 | 1751 | { |
---|
1540 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1752 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1541 | 1753 | { |
---|
1542 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1754 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1543 | 1755 | |
---|
1544 | 1756 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1545 | 1757 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1587 | 1799 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1588 | 1800 | objEditor.cameraView.repaint(); |
---|
1589 | 1801 | } else |
---|
1590 | | - if (source == rectoidItem) |
---|
| 1802 | + if (source == rectoidItem || source == boxButton) |
---|
1591 | 1803 | { |
---|
1592 | 1804 | makeSomething(new Box()); |
---|
1593 | 1805 | } else |
---|
1594 | | - if (source == particleItem) |
---|
| 1806 | + if (source == particleItem || source == particlesButton) |
---|
1595 | 1807 | { |
---|
1596 | 1808 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1597 | 1809 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1670 | 1882 | |
---|
1671 | 1883 | makeSomething(obj); |
---|
1672 | 1884 | } else |
---|
1673 | | - if (source == gridItem) |
---|
| 1885 | + if (source == gridItem || source == gridButton) |
---|
1674 | 1886 | { |
---|
1675 | 1887 | makeSomething(new Grid()); |
---|
1676 | 1888 | } else |
---|
1677 | | - if (source == ellipsoidItem) |
---|
| 1889 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1678 | 1890 | { |
---|
1679 | 1891 | makeSomething(new Sphere()); |
---|
1680 | 1892 | } else |
---|
1681 | | - if (source == coneItem) |
---|
| 1893 | + if (source == coneItem || source == coneButton) |
---|
1682 | 1894 | { |
---|
1683 | 1895 | makeSomething(new Cone()); |
---|
1684 | 1896 | } else |
---|
1685 | | - if (source == torusItem) |
---|
| 1897 | + if (source == torusItem || source == torusButton) |
---|
1686 | 1898 | { |
---|
1687 | 1899 | makeSomething(new Torus()); |
---|
1688 | 1900 | } else |
---|
1689 | | - if (source == superItem) |
---|
| 1901 | + if (source == superItem || source == superButton) |
---|
1690 | 1902 | { |
---|
1691 | 1903 | makeSomething(new Superellipsoid()); |
---|
1692 | 1904 | } else |
---|
1693 | | - if (source == kleinItem) |
---|
| 1905 | + if (source == kleinItem || source == kleinButton) |
---|
1694 | 1906 | { |
---|
1695 | 1907 | makeSomething(new Klein()); |
---|
1696 | 1908 | } else |
---|
.. | .. |
---|
1710 | 1922 | { |
---|
1711 | 1923 | makeSomething(new BezierSurface()); |
---|
1712 | 1924 | } else |
---|
1713 | | - if (source == overlayItem) |
---|
| 1925 | + if (source == overlayItem || source == overlayButton) |
---|
1714 | 1926 | { |
---|
1715 | 1927 | /* |
---|
1716 | 1928 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1758 | 1970 | s.setup(); |
---|
1759 | 1971 | makeSomething(s); |
---|
1760 | 1972 | } else |
---|
1761 | | - if (source == lightItem) |
---|
| 1973 | + if (source == lightItem || source == lightButton) |
---|
1762 | 1974 | { |
---|
1763 | 1975 | makeSomething(new Light()); |
---|
1764 | 1976 | } else |
---|
.. | .. |
---|
1844 | 2056 | csg.addChild(child); |
---|
1845 | 2057 | child.addChild(csg); |
---|
1846 | 2058 | } else |
---|
1847 | | - |
---|
1848 | | - if (source == importGFDItem) |
---|
1849 | | - { |
---|
1850 | | - ImportGFD(); |
---|
1851 | | - } else |
---|
1852 | | - if (source == importVRMLX3DItem) |
---|
1853 | | - { |
---|
1854 | | - ImportVRMLX3D(); |
---|
1855 | | - } else |
---|
1856 | | - if (source == import3DSItem) |
---|
1857 | | - { |
---|
1858 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1859 | | - } else |
---|
1860 | | - if (source == importOBJItem) |
---|
1861 | | - { |
---|
1862 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1863 | | - } else |
---|
1864 | 2059 | if (source == computeAOItem) |
---|
1865 | 2060 | { |
---|
1866 | 2061 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1879 | 2074 | if (source == invariantsItem) |
---|
1880 | 2075 | { |
---|
1881 | 2076 | System.out.println("Invariants:"); |
---|
1882 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2077 | + Grafreed.grafreeD.universe.invariants(); |
---|
1883 | 2078 | } else |
---|
1884 | 2079 | if (source == memoryItem) |
---|
1885 | 2080 | { |
---|
.. | .. |
---|
1897 | 2092 | if (source == dumpItem) |
---|
1898 | 2093 | { |
---|
1899 | 2094 | DumpObject(); |
---|
| 2095 | + } else |
---|
| 2096 | + if (source == minButton) |
---|
| 2097 | + { |
---|
| 2098 | + Minimize(); |
---|
| 2099 | + } else |
---|
| 2100 | + if (source == maxButton) |
---|
| 2101 | + { |
---|
| 2102 | + Maximize(); |
---|
| 2103 | + } else |
---|
| 2104 | + if (source == fullButton) |
---|
| 2105 | + { |
---|
| 2106 | + ToggleFullScreen(); |
---|
| 2107 | + } else |
---|
| 2108 | + if (source == undoButton) |
---|
| 2109 | + { |
---|
| 2110 | + Undo(); |
---|
| 2111 | + } else |
---|
| 2112 | + if (source == redoButton) |
---|
| 2113 | + { |
---|
| 2114 | + Redo(); |
---|
| 2115 | + } else |
---|
| 2116 | + if (source == saveButton) |
---|
| 2117 | + { |
---|
| 2118 | + Save(); |
---|
1900 | 2119 | } else |
---|
1901 | 2120 | if (source == oneStepButton) |
---|
1902 | 2121 | { |
---|
.. | .. |
---|
1952 | 2171 | { |
---|
1953 | 2172 | loadClipboard(true); |
---|
1954 | 2173 | } else |
---|
| 2174 | + if (source == undoItem) |
---|
| 2175 | + { |
---|
| 2176 | + Undo(); |
---|
| 2177 | + } else |
---|
| 2178 | + if (source == redoItem) |
---|
| 2179 | + { |
---|
| 2180 | + Redo(); |
---|
| 2181 | + } else |
---|
1955 | 2182 | if (source == duplicateItem) |
---|
1956 | 2183 | { |
---|
1957 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2184 | + Object3D keep = Grafreed.clipboard; |
---|
1958 | 2185 | loadClipboard(false); |
---|
1959 | 2186 | paste(false); |
---|
1960 | | - GrafreeD.clipboard = keep; |
---|
| 2187 | + Grafreed.clipboard = keep; |
---|
1961 | 2188 | } else |
---|
1962 | 2189 | if (source == cloneItem) |
---|
1963 | 2190 | { |
---|
.. | .. |
---|
2177 | 2404 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2178 | 2405 | // refreshContents(); |
---|
2179 | 2406 | // } |
---|
2180 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2407 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2181 | 2408 | { |
---|
2182 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2409 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2183 | 2410 | |
---|
2184 | 2411 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2185 | 2412 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2229 | 2456 | } else |
---|
2230 | 2457 | if (source == setMasterItem) |
---|
2231 | 2458 | { |
---|
2232 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2459 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2233 | 2460 | { |
---|
2234 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2461 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2235 | 2462 | |
---|
2236 | 2463 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2237 | 2464 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2244 | 2471 | { |
---|
2245 | 2472 | if (group.selection.size() == 1) |
---|
2246 | 2473 | { |
---|
2247 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2474 | + if (Grafreed.clipboard.size() == 1) |
---|
2248 | 2475 | { |
---|
2249 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2476 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2250 | 2477 | |
---|
2251 | 2478 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2252 | 2479 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2263 | 2490 | { |
---|
2264 | 2491 | RevertMeshes(); |
---|
2265 | 2492 | } else |
---|
2266 | | - if (source == resetMeshItem) |
---|
| 2493 | + if (source == resetAllItem) |
---|
2267 | 2494 | { |
---|
2268 | 2495 | ResetAll(); |
---|
2269 | 2496 | } else |
---|
.. | .. |
---|
2429 | 2656 | { |
---|
2430 | 2657 | CastShadow(2); |
---|
2431 | 2658 | } else |
---|
2432 | | - if (source == ungroupItem) |
---|
| 2659 | + if (source == ungroupItem || source == ungroupButton) |
---|
2433 | 2660 | { |
---|
2434 | 2661 | //ungroup(); |
---|
2435 | 2662 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2451 | 2678 | } else |
---|
2452 | 2679 | if (source == genNormalsMESHItem) |
---|
2453 | 2680 | { |
---|
2454 | | - GenNormals(true); // TODO |
---|
| 2681 | + GenNormalsMESH(); |
---|
2455 | 2682 | } else |
---|
2456 | 2683 | if (source == genNormalsORGANItem) |
---|
2457 | 2684 | { |
---|
.. | .. |
---|
2516 | 2743 | if (source == unmarkleavesItem) |
---|
2517 | 2744 | { |
---|
2518 | 2745 | MarkLeaves(false); |
---|
| 2746 | + } else |
---|
| 2747 | + if (source == rewindleavesItem) |
---|
| 2748 | + { |
---|
| 2749 | + RewindLeaves(true); |
---|
| 2750 | + } else |
---|
| 2751 | + if (source == unrewindleavesItem) |
---|
| 2752 | + { |
---|
| 2753 | + RewindLeaves(false); |
---|
| 2754 | + } else |
---|
| 2755 | + if (source == randomleavesItem) |
---|
| 2756 | + { |
---|
| 2757 | + RandomLeaves(true); |
---|
| 2758 | + } else |
---|
| 2759 | + if (source == unrandomleavesItem) |
---|
| 2760 | + { |
---|
| 2761 | + RandomLeaves(false); |
---|
2519 | 2762 | } else |
---|
2520 | 2763 | if (source == flipVItem) |
---|
2521 | 2764 | { |
---|
.. | .. |
---|
2601 | 2844 | { |
---|
2602 | 2845 | SmoothMesh(); |
---|
2603 | 2846 | } else |
---|
2604 | | - if (source == transformgeometryItem) |
---|
| 2847 | + if (source == transformGeometryItem) |
---|
2605 | 2848 | { |
---|
2606 | 2849 | TransformGeometry(); |
---|
| 2850 | + } else |
---|
| 2851 | + if (source == transformChildrenItem) |
---|
| 2852 | + { |
---|
| 2853 | + TransformChildren(); |
---|
2607 | 2854 | } else |
---|
2608 | 2855 | if (source == resetTransformItem) |
---|
2609 | 2856 | { |
---|
.. | .. |
---|
2611 | 2858 | } else |
---|
2612 | 2859 | if (source == resetCentroidItem) |
---|
2613 | 2860 | { |
---|
2614 | | - ResetCentroid(); |
---|
| 2861 | + ResetCentroid(true); |
---|
| 2862 | + } else |
---|
| 2863 | + if (source == resetCentroidXZItem) |
---|
| 2864 | + { |
---|
| 2865 | + ResetCentroid(false); |
---|
2615 | 2866 | } else |
---|
2616 | 2867 | if (source == resetParentItem) |
---|
2617 | 2868 | { |
---|
.. | .. |
---|
2743 | 2994 | if (source == twoButton) |
---|
2744 | 2995 | { |
---|
2745 | 2996 | radio.layout = twoButton; |
---|
| 2997 | + |
---|
| 2998 | + if (CameraPane.FULLSCREEN) |
---|
| 2999 | + fullscreenLayout = radio.layout; |
---|
| 3000 | + |
---|
2746 | 3001 | // bug |
---|
2747 | 3002 | //gridPanel.setDividerLocation(1.0); |
---|
2748 | 3003 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2775 | 3030 | bigThree.ClearUI(); |
---|
2776 | 3031 | bigThree.add(centralPanel); |
---|
2777 | 3032 | bigThree.FlushUI(); |
---|
| 3033 | + |
---|
| 3034 | + cameraView.requestFocusInWindow(); |
---|
| 3035 | + |
---|
| 3036 | +// refreshContents(true); |
---|
| 3037 | +// |
---|
| 3038 | +// try |
---|
| 3039 | +// { |
---|
| 3040 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3041 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3042 | +// bot.mouseMove(100, 100); |
---|
| 3043 | +// bot.mousePress(mask); |
---|
| 3044 | +// bot.mouseRelease(mask); |
---|
| 3045 | +// } |
---|
| 3046 | +// catch (Exception e) |
---|
| 3047 | +// { |
---|
| 3048 | +// |
---|
| 3049 | +// } |
---|
| 3050 | + |
---|
2778 | 3051 | } else |
---|
2779 | 3052 | if (source == threeButton) |
---|
2780 | 3053 | { |
---|
2781 | 3054 | radio.layout = threeButton; |
---|
| 3055 | + |
---|
| 3056 | + if (CameraPane.FULLSCREEN) |
---|
| 3057 | + fullscreenLayout = radio.layout; |
---|
2782 | 3058 | |
---|
2783 | 3059 | // bigThree.remove(scenePanel); |
---|
2784 | 3060 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2811 | 3087 | bigThree.add(centralPanel); |
---|
2812 | 3088 | bigThree.add(XYZPanel); |
---|
2813 | 3089 | bigThree.FlushUI(); |
---|
| 3090 | + |
---|
| 3091 | + cameraView.requestFocusInWindow(); |
---|
2814 | 3092 | } else |
---|
2815 | 3093 | if (source == fourButton) |
---|
2816 | 3094 | { |
---|
2817 | 3095 | radio.layout = fourButton; |
---|
| 3096 | + |
---|
| 3097 | + if (CameraPane.FULLSCREEN) |
---|
| 3098 | + fullscreenLayout = radio.layout; |
---|
2818 | 3099 | |
---|
2819 | 3100 | // bigThree.remove(scenePanel); |
---|
2820 | 3101 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2846 | 3127 | bigThree.ClearUI(); |
---|
2847 | 3128 | bigThree.add(scenePanel); |
---|
2848 | 3129 | bigThree.FlushUI(); |
---|
| 3130 | + |
---|
| 3131 | + cameraView.requestFocusInWindow(); |
---|
2849 | 3132 | } else |
---|
2850 | 3133 | if (source == sixButton) |
---|
2851 | 3134 | { |
---|
2852 | 3135 | radio.layout = sixButton; |
---|
| 3136 | + |
---|
| 3137 | + if (CameraPane.FULLSCREEN) |
---|
| 3138 | + fullscreenLayout = radio.layout; |
---|
2853 | 3139 | |
---|
2854 | 3140 | // bigThree.remove(scenePanel); |
---|
2855 | 3141 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2882 | 3168 | bigThree.add(scenePanel); |
---|
2883 | 3169 | bigThree.add(centralPanel); |
---|
2884 | 3170 | bigThree.FlushUI(); |
---|
| 3171 | + |
---|
| 3172 | + cameraView.requestFocusInWindow(); |
---|
2885 | 3173 | } else |
---|
2886 | 3174 | if (source == sevenButton) |
---|
2887 | 3175 | { |
---|
2888 | 3176 | radio.layout = sevenButton; |
---|
| 3177 | + |
---|
| 3178 | + if (CameraPane.FULLSCREEN) |
---|
| 3179 | + fullscreenLayout = radio.layout; |
---|
2889 | 3180 | |
---|
2890 | 3181 | // bigThree.remove(scenePanel); |
---|
2891 | 3182 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2919 | 3210 | bigThree.add(centralPanel); |
---|
2920 | 3211 | bigThree.add(XYZPanel); |
---|
2921 | 3212 | bigThree.FlushUI(); |
---|
| 3213 | + |
---|
| 3214 | + cameraView.requestFocusInWindow(); |
---|
2922 | 3215 | } else |
---|
2923 | 3216 | if (source == rootButton) |
---|
2924 | 3217 | { |
---|
.. | .. |
---|
2930 | 3223 | EditObject(obj); |
---|
2931 | 3224 | } |
---|
2932 | 3225 | |
---|
| 3226 | + cameraView.requestFocusInWindow(); |
---|
2933 | 3227 | refreshContents(true); |
---|
2934 | 3228 | } else |
---|
2935 | 3229 | if (source == closeButton) |
---|
.. | .. |
---|
2939 | 3233 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2940 | 3234 | { |
---|
2941 | 3235 | ab = (cRadio)e.nextElement(); |
---|
2942 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3236 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2943 | 3237 | { |
---|
| 3238 | + // Patch to avoid bug with transparency. |
---|
| 3239 | + if (!ab.hadMaterial) |
---|
| 3240 | + { |
---|
| 3241 | + ab.object.material = null; |
---|
| 3242 | + } |
---|
| 3243 | + |
---|
2944 | 3244 | buttonGroup.remove(ab); |
---|
2945 | 3245 | radioPanel.remove(ab); |
---|
2946 | 3246 | |
---|
2947 | | - ab.GetObject().editWindow = null; |
---|
| 3247 | + //ab.GetObject().editWindow = null; |
---|
| 3248 | + ab.GetObject().manipWindow = null; |
---|
2948 | 3249 | // ab.GetObject().objectUI = null; // ????????? |
---|
2949 | 3250 | |
---|
2950 | 3251 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2951 | 3252 | break; |
---|
2952 | 3253 | } |
---|
2953 | 3254 | } |
---|
| 3255 | + |
---|
| 3256 | + cameraView.requestFocusInWindow(); |
---|
2954 | 3257 | refreshContents(true); |
---|
2955 | 3258 | } else |
---|
2956 | 3259 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
2967 | 3270 | child.CloseUI(); |
---|
2968 | 3271 | listUI.remove(child); |
---|
2969 | 3272 | |
---|
2970 | | - child.editWindow = null; // ??????????? |
---|
| 3273 | + //child.editWindow = null; // ??????????? |
---|
2971 | 3274 | } |
---|
2972 | 3275 | objEditor.ctrlPanel.FlushUI(); |
---|
2973 | 3276 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3053 | 3356 | frontView.object = group; |
---|
3054 | 3357 | sideView.object = group; |
---|
3055 | 3358 | } |
---|
3056 | | - group.editWindow = this; |
---|
| 3359 | + |
---|
| 3360 | +// fix "+" issue |
---|
| 3361 | + //group.editWindow = this; |
---|
| 3362 | + group.manipWindow = this; |
---|
| 3363 | + |
---|
3057 | 3364 | /* |
---|
3058 | 3365 | currentLayout = radio.layout; |
---|
3059 | 3366 | if (currentLayout == null) |
---|
.. | .. |
---|
3065 | 3372 | //group.parent = null; // ROOT |
---|
3066 | 3373 | //group.attributes = -1; |
---|
3067 | 3374 | ResetModel(); |
---|
| 3375 | + |
---|
| 3376 | + cameraView.requestFocusInWindow(); |
---|
3068 | 3377 | refreshContents(true); |
---|
3069 | | - } |
---|
| 3378 | + } else if (event.getSource() == editCameraItem) |
---|
| 3379 | + { |
---|
| 3380 | + cameraView.ProtectCamera(); |
---|
| 3381 | + cameraView.repaint(); |
---|
| 3382 | + return; |
---|
| 3383 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3384 | + { |
---|
| 3385 | + cameraView.RevertCamera(); |
---|
| 3386 | + cameraView.repaint(); |
---|
| 3387 | + return; |
---|
| 3388 | + // } else if (event.getSource() == textureButton) |
---|
| 3389 | + // { |
---|
| 3390 | + // return; // true; |
---|
| 3391 | + } |
---|
3070 | 3392 | else |
---|
3071 | 3393 | { |
---|
3072 | 3394 | //return super.action(event, arg); |
---|
.. | .. |
---|
3075 | 3397 | } |
---|
3076 | 3398 | |
---|
3077 | 3399 | boolean useclient = false; |
---|
3078 | | - cRadio radio; |
---|
3079 | 3400 | |
---|
3080 | 3401 | void ToggleRoot() |
---|
3081 | 3402 | { |
---|
.. | .. |
---|
3127 | 3448 | refreshContents(); |
---|
3128 | 3449 | } |
---|
3129 | 3450 | |
---|
| 3451 | + void TransformChildren() |
---|
| 3452 | + { |
---|
| 3453 | + Object3D obj; |
---|
| 3454 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3455 | + { |
---|
| 3456 | + obj = (Object3D)e.nextElement(); |
---|
| 3457 | + obj.KeepTextureMatrices(); |
---|
| 3458 | + obj.TransformChildren(); |
---|
| 3459 | + obj.RestoreTextureMatrices(); |
---|
| 3460 | + |
---|
| 3461 | +// if (obj.parent == null) |
---|
| 3462 | +// { |
---|
| 3463 | +// System.out.println("NULL PARENT!"); |
---|
| 3464 | +// new Exception().printStackTrace(); |
---|
| 3465 | +// } |
---|
| 3466 | +// else |
---|
| 3467 | +// TouchTransform(obj); |
---|
| 3468 | +// //obj.parent.Touch(); |
---|
| 3469 | + } |
---|
| 3470 | + |
---|
| 3471 | + refreshContents(); |
---|
| 3472 | + } |
---|
3130 | 3473 | |
---|
3131 | 3474 | void ResetTransform() |
---|
3132 | 3475 | { |
---|
.. | .. |
---|
3239 | 3582 | refreshContents(); |
---|
3240 | 3583 | } |
---|
3241 | 3584 | |
---|
3242 | | - void ResetCentroid() |
---|
| 3585 | + void ResetCentroid(boolean full) |
---|
3243 | 3586 | { |
---|
3244 | 3587 | Object3D obj; |
---|
3245 | 3588 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3254 | 3597 | LA.matIdentity(Object3D.mat); |
---|
3255 | 3598 | obj.getBounds(minima, maxima, false); |
---|
3256 | 3599 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3257 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3600 | + if (full) |
---|
| 3601 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3258 | 3602 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3259 | 3603 | obj.TransformMesh(Object3D.mat); |
---|
| 3604 | + |
---|
3260 | 3605 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3261 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3606 | + if (full) |
---|
| 3607 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3262 | 3608 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3609 | + |
---|
3263 | 3610 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3264 | 3611 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3265 | 3612 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3288 | 3635 | |
---|
3289 | 3636 | int size = obj.MemorySize(); |
---|
3290 | 3637 | |
---|
3291 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3638 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3639 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3292 | 3640 | } |
---|
3293 | 3641 | } |
---|
3294 | 3642 | catch (Exception e) |
---|
.. | .. |
---|
3325 | 3673 | obj = (Object3D)e.nextElement(); |
---|
3326 | 3674 | |
---|
3327 | 3675 | System.out.println("Object is: " + obj); |
---|
3328 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3676 | + Grafreed.AnalyzeObject(obj); |
---|
3329 | 3677 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3330 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3678 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3331 | 3679 | |
---|
3332 | 3680 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3333 | 3681 | } |
---|
.. | .. |
---|
3369 | 3717 | void GenNormals(boolean crease) |
---|
3370 | 3718 | { |
---|
3371 | 3719 | group.GenNormalsS(crease); |
---|
| 3720 | + |
---|
| 3721 | + refreshContents(); |
---|
| 3722 | + } |
---|
| 3723 | + |
---|
| 3724 | + void GenNormalsMESH() |
---|
| 3725 | + { |
---|
| 3726 | + group.GenNormalsMeshS(); |
---|
3372 | 3727 | |
---|
3373 | 3728 | refreshContents(); |
---|
3374 | 3729 | } |
---|
.. | .. |
---|
3541 | 3896 | |
---|
3542 | 3897 | void ParseVertices() |
---|
3543 | 3898 | { |
---|
3544 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3545 | | - GrafreeD.epsequal = true; |
---|
| 3899 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3900 | + Grafreed.epsequal = true; |
---|
3546 | 3901 | |
---|
3547 | 3902 | for (int i=0; i<group.selection.size(); i++) |
---|
3548 | 3903 | { |
---|
.. | .. |
---|
3567 | 3922 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3568 | 3923 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3569 | 3924 | |
---|
3570 | | - g.add(GrafreeD.clipboard); |
---|
| 3925 | + g.add(Grafreed.clipboard); |
---|
3571 | 3926 | |
---|
3572 | 3927 | buffer.add(g); |
---|
3573 | 3928 | } |
---|
.. | .. |
---|
3582 | 3937 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3583 | 3938 | } |
---|
3584 | 3939 | |
---|
3585 | | - GrafreeD.epsequal = epsequal; |
---|
| 3940 | + Grafreed.epsequal = epsequal; |
---|
3586 | 3941 | |
---|
3587 | 3942 | refreshContents(); |
---|
3588 | 3943 | } |
---|
.. | .. |
---|
3600 | 3955 | String pigment = Object3D.GetPigment(tex); |
---|
3601 | 3956 | //String bump = Object3D.GetBump(tex); |
---|
3602 | 3957 | |
---|
3603 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3958 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3959 | + |
---|
| 3960 | + try |
---|
| 3961 | + { |
---|
| 3962 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3963 | + } |
---|
| 3964 | + catch (Exception e) |
---|
| 3965 | + { |
---|
| 3966 | + System.err.println("FAIL: " + node); |
---|
| 3967 | + } |
---|
3604 | 3968 | |
---|
3605 | 3969 | double s = v.s; |
---|
3606 | 3970 | |
---|
.. | .. |
---|
3732 | 4096 | return; |
---|
3733 | 4097 | |
---|
3734 | 4098 | Object3D poses = group.selection.get(0); |
---|
3735 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4099 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3736 | 4100 | |
---|
3737 | 4101 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3738 | 4102 | |
---|
.. | .. |
---|
3926 | 4290 | |
---|
3927 | 4291 | void ClipMesh() |
---|
3928 | 4292 | { |
---|
3929 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4293 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3930 | 4294 | { |
---|
3931 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4295 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3932 | 4296 | |
---|
3933 | 4297 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3934 | 4298 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3937 | 4301 | // { |
---|
3938 | 4302 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3939 | 4303 | // } |
---|
3940 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4304 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3941 | 4305 | } |
---|
3942 | 4306 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3943 | 4307 | System.out.println("DONE."); |
---|
.. | .. |
---|
3984 | 4348 | void MarkLeaves(boolean hide) |
---|
3985 | 4349 | { |
---|
3986 | 4350 | group.selection.MarkLeaves(hide); |
---|
| 4351 | + refreshContents(); |
---|
| 4352 | + } |
---|
| 4353 | + |
---|
| 4354 | + void RewindLeaves(boolean hide) |
---|
| 4355 | + { |
---|
| 4356 | + group.selection.RewindLeaves(hide); |
---|
| 4357 | + refreshContents(); |
---|
| 4358 | + } |
---|
| 4359 | + |
---|
| 4360 | + void RandomLeaves(boolean hide) |
---|
| 4361 | + { |
---|
| 4362 | + group.selection.RandomLeaves(hide); |
---|
3987 | 4363 | refreshContents(); |
---|
3988 | 4364 | } |
---|
3989 | 4365 | |
---|
.. | .. |
---|
4069 | 4445 | { |
---|
4070 | 4446 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4071 | 4447 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4072 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4448 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4073 | 4449 | |
---|
4074 | 4450 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4075 | | - if(elem != group) |
---|
| 4451 | + if(elem != group || !newWindow) |
---|
4076 | 4452 | { |
---|
4077 | 4453 | // if (!(elem instanceof Composite)) |
---|
4078 | 4454 | // newWindow = false; |
---|
.. | .. |
---|
4162 | 4538 | //case 702: // Event.LIST_DESELECT |
---|
4163 | 4539 | group.deselectAll(); |
---|
4164 | 4540 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4165 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4166 | 4541 | if (tps != null) |
---|
4167 | 4542 | { |
---|
4168 | 4543 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4171 | 4546 | |
---|
4172 | 4547 | //if (child.parent != null) |
---|
4173 | 4548 | //child.parent.addSelectee(child); |
---|
| 4549 | + objEditor.SetMaterial(child); |
---|
4174 | 4550 | group.addSelectee(child); |
---|
4175 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4176 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4177 | | - System.err.println("info : " + child.GetPath()); |
---|
4178 | 4551 | } |
---|
4179 | 4552 | } |
---|
4180 | 4553 | // else |
---|
.. | .. |
---|
4184 | 4557 | // System.err.println("info : " + group.GetPath()); |
---|
4185 | 4558 | // } |
---|
4186 | 4559 | |
---|
4187 | | - objEditor.SetText(); // jan 2014 |
---|
4188 | | - |
---|
4189 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4560 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4190 | 4561 | CameraPane.flash = true; |
---|
4191 | 4562 | |
---|
4192 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4563 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4193 | 4564 | // a camera |
---|
4194 | 4565 | { |
---|
4195 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4196 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4566 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4567 | + { |
---|
| 4568 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4569 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4570 | + } |
---|
4197 | 4571 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4198 | 4572 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4199 | 4573 | } |
---|
.. | .. |
---|
4206 | 4580 | |
---|
4207 | 4581 | freezemodel = false; |
---|
4208 | 4582 | } |
---|
| 4583 | + |
---|
| 4584 | + void refreshContents(boolean cp) |
---|
| 4585 | + { |
---|
| 4586 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4587 | + { |
---|
| 4588 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4589 | + |
---|
| 4590 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4591 | + { |
---|
| 4592 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4593 | + |
---|
| 4594 | + objEditor.AddInfo(child, this, true); |
---|
| 4595 | + System.err.println("info : " + child.GetPath()); |
---|
| 4596 | + } |
---|
| 4597 | + |
---|
| 4598 | + objEditor.SetText(); // jan 2014 |
---|
| 4599 | + } |
---|
| 4600 | + |
---|
| 4601 | + super.refreshContents(cp); |
---|
| 4602 | + } |
---|
4209 | 4603 | |
---|
4210 | 4604 | void linkSomething(Object3D thing) |
---|
4211 | 4605 | { |
---|
.. | .. |
---|
4277 | 4671 | { |
---|
4278 | 4672 | if (group.selection.isEmpty()) |
---|
4279 | 4673 | return; |
---|
4280 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4674 | + |
---|
| 4675 | + Grafreed.clipboardIsTempGroup = false; |
---|
4281 | 4676 | Composite tGroup = null; |
---|
4282 | 4677 | if (group.selection.size() > 0) // 1) |
---|
4283 | 4678 | { |
---|
4284 | 4679 | tGroup = new cGroup(); |
---|
4285 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4680 | + Grafreed.clipboardIsTempGroup = true; |
---|
4286 | 4681 | } |
---|
4287 | 4682 | |
---|
4288 | 4683 | if (cut) |
---|
4289 | 4684 | { |
---|
| 4685 | + if (Globals.SAVEONMAKE) |
---|
| 4686 | + Save(); |
---|
4290 | 4687 | //int indices[] = jList.getSelectedIndices(); |
---|
4291 | 4688 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4292 | 4689 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4322 | 4719 | //System.out.println("cut " + child); |
---|
4323 | 4720 | //System.out.println("parent = " + child.parent); |
---|
4324 | 4721 | // tmp.addChild(child); |
---|
4325 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4722 | + if (Grafreed.clipboardIsTempGroup) |
---|
4326 | 4723 | tGroup.add/*Child*/(tmp); |
---|
4327 | 4724 | else |
---|
4328 | | - GrafreeD.clipboard = tmp; |
---|
| 4725 | + Grafreed.clipboard = tmp; |
---|
4329 | 4726 | } |
---|
4330 | 4727 | else |
---|
4331 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4728 | + if (Grafreed.clipboardIsTempGroup) |
---|
4332 | 4729 | tGroup.add/*Child*/(child); |
---|
4333 | 4730 | else |
---|
4334 | | - GrafreeD.clipboard = child; |
---|
| 4731 | + Grafreed.clipboard = child; |
---|
4335 | 4732 | } |
---|
4336 | 4733 | |
---|
4337 | 4734 | //ResetModel(); |
---|
.. | .. |
---|
4363 | 4760 | //System.out.println("cut " + elem); |
---|
4364 | 4761 | //System.out.println("parent = " + elem.parent); |
---|
4365 | 4762 | // tmp.addChild(elem); |
---|
4366 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4763 | + if (Grafreed.clipboardIsTempGroup) |
---|
4367 | 4764 | tGroup.add/*Child*/(tmp); |
---|
4368 | 4765 | else |
---|
4369 | | - GrafreeD.clipboard = tmp; |
---|
| 4766 | + Grafreed.clipboard = tmp; |
---|
4370 | 4767 | } |
---|
4371 | 4768 | else |
---|
4372 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4769 | + if (Grafreed.clipboardIsTempGroup) |
---|
4373 | 4770 | tGroup.add/*Child*/(child); |
---|
4374 | 4771 | else |
---|
4375 | | - GrafreeD.clipboard = child; |
---|
| 4772 | + Grafreed.clipboard = child; |
---|
4376 | 4773 | } |
---|
4377 | 4774 | |
---|
4378 | 4775 | } |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4380 | | - GrafreeD.clipboard = tGroup; |
---|
| 4776 | + |
---|
| 4777 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4778 | + Grafreed.clipboard = tGroup; |
---|
| 4779 | + |
---|
4381 | 4780 | if (cut) |
---|
4382 | 4781 | { |
---|
4383 | 4782 | ResetModel(); |
---|
.. | .. |
---|
4391 | 4790 | // return; |
---|
4392 | 4791 | boolean first = true; |
---|
4393 | 4792 | |
---|
4394 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4793 | + if (Grafreed.clipboardIsTempGroup) |
---|
4395 | 4794 | { |
---|
4396 | 4795 | Composite temp; |
---|
4397 | 4796 | |
---|
.. | .. |
---|
4402 | 4801 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4403 | 4802 | */ |
---|
4404 | 4803 | Object3D elem; |
---|
4405 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4804 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4406 | 4805 | { |
---|
4407 | 4806 | Object3D child = (Object3D)e.nextElement(); |
---|
4408 | 4807 | |
---|
.. | .. |
---|
4436 | 4835 | //Object3D cb = Applet3D.clipboard; |
---|
4437 | 4836 | //temp.addChild(cb); |
---|
4438 | 4837 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4439 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4440 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4441 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4442 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4443 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4838 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4839 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4840 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4841 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4842 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4444 | 4843 | else |
---|
4445 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4446 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4844 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4845 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4447 | 4846 | } |
---|
4448 | 4847 | |
---|
4449 | 4848 | ResetModel(); |
---|
.. | .. |
---|
4492 | 4891 | { |
---|
4493 | 4892 | boolean first = true; |
---|
4494 | 4893 | |
---|
4495 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4894 | + if (Grafreed.clipboardIsTempGroup) |
---|
4496 | 4895 | { |
---|
4497 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4896 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4498 | 4897 | Object3D copy; |
---|
4499 | 4898 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4500 | 4899 | { |
---|
.. | .. |
---|
4504 | 4903 | } |
---|
4505 | 4904 | } else |
---|
4506 | 4905 | { |
---|
4507 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4906 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4508 | 4907 | } |
---|
4509 | 4908 | } |
---|
4510 | 4909 | } |
---|
.. | .. |
---|
4909 | 5308 | } |
---|
4910 | 5309 | */ |
---|
4911 | 5310 | |
---|
4912 | | - void ImportGFD() |
---|
4913 | | - { |
---|
4914 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4915 | | - browser.show(); |
---|
4916 | | - String filename = browser.getFile(); |
---|
4917 | | - if (filename != null && filename.length() > 0) |
---|
4918 | | - { |
---|
4919 | | - String fullname = browser.getDirectory() + filename; |
---|
4920 | | - |
---|
4921 | | - //Object3D readobj = |
---|
4922 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4923 | | - //makeSomething(readobj); |
---|
4924 | | - } |
---|
4925 | | - } |
---|
4926 | | - |
---|
4927 | 5311 | /* |
---|
4928 | 5312 | public void Callback(Object obj) |
---|
4929 | 5313 | { |
---|
.. | .. |
---|
4947 | 5331 | } |
---|
4948 | 5332 | */ |
---|
4949 | 5333 | |
---|
4950 | | - void ImportVRMLX3D() |
---|
4951 | | - { |
---|
4952 | | - if (GrafreeD.standAlone) |
---|
4953 | | - { |
---|
4954 | | - /**/ |
---|
4955 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4956 | | - browser.show(); |
---|
4957 | | - String filename = browser.getFile(); |
---|
4958 | | - if (filename != null && filename.length() > 0) |
---|
4959 | | - { |
---|
4960 | | - String fullname = browser.getDirectory() + filename; |
---|
4961 | | - LoadVRMLX3D(fullname); |
---|
4962 | | - } |
---|
4963 | | - /**/ |
---|
4964 | | - } |
---|
4965 | | - } |
---|
4966 | | - |
---|
4967 | 5334 | String GetFile(String dialogName) |
---|
4968 | 5335 | { |
---|
4969 | | - if (GrafreeD.standAlone) |
---|
| 5336 | + if (Grafreed.standAlone) |
---|
4970 | 5337 | { |
---|
4971 | 5338 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4972 | 5339 | browser.show(); |
---|
.. | .. |
---|
5034 | 5401 | cButton clearpanelButton; |
---|
5035 | 5402 | cButton unselectButton; |
---|
5036 | 5403 | |
---|
| 5404 | + cButton minButton; |
---|
| 5405 | + cButton maxButton; |
---|
| 5406 | + cButton fullButton; |
---|
| 5407 | + cButton undoButton; |
---|
| 5408 | + cButton redoButton; |
---|
| 5409 | + cButton saveButton; |
---|
5037 | 5410 | cButton oneStepButton; |
---|
| 5411 | + |
---|
| 5412 | + cButton groupButton; |
---|
| 5413 | + cButton ungroupButton; |
---|
| 5414 | + cButton compositeButton; |
---|
| 5415 | + |
---|
| 5416 | + cButton gridButton; |
---|
| 5417 | + cButton boxButton; |
---|
| 5418 | + cButton sphereButton; |
---|
| 5419 | + cButton coneButton; |
---|
| 5420 | + cButton torusButton; |
---|
| 5421 | + cButton superButton; |
---|
| 5422 | + cButton kleinButton; |
---|
| 5423 | + cButton particlesButton; |
---|
| 5424 | + cButton overlayButton; |
---|
| 5425 | + cButton lightButton; |
---|
5038 | 5426 | |
---|
5039 | 5427 | cButton screenfitButton; |
---|
5040 | 5428 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5047 | 5435 | |
---|
5048 | 5436 | cButton setsupportButton; |
---|
5049 | 5437 | |
---|
5050 | | - cButton twoButton; |
---|
5051 | | - cButton sixButton; |
---|
5052 | | - cButton threeButton; |
---|
5053 | | - cButton sevenButton; |
---|
5054 | | - cButton fourButton; // full panel |
---|
5055 | | - cButton oneButton; // full XYZ |
---|
5056 | | - //cButton currentLayout; |
---|
5057 | | - |
---|
5058 | 5438 | // |
---|
5059 | 5439 | //Composite |
---|
5060 | 5440 | Object3D // to do !! |
---|
.. | .. |
---|
5066 | 5446 | private MenuItem lookFromItem; |
---|
5067 | 5447 | private MenuItem switchItem; |
---|
5068 | 5448 | private MenuItem cutItem; |
---|
5069 | | - private MenuItem duplicateItem; |
---|
| 5449 | + private MenuItem undoItem; |
---|
| 5450 | + private MenuItem redoItem; |
---|
| 5451 | + private JMenuItem duplicateItem; |
---|
5070 | 5452 | private MenuItem cloneItem; |
---|
5071 | 5453 | private MenuItem cloneSupportItem; |
---|
5072 | 5454 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5079 | 5461 | private MenuItem linkverticesItem; |
---|
5080 | 5462 | private MenuItem relinkverticesItem; |
---|
5081 | 5463 | private MenuItem setMasterItem; |
---|
5082 | | - private MenuItem resetMeshItem; |
---|
| 5464 | + private MenuItem resetAllItem; |
---|
5083 | 5465 | private MenuItem stepAllItem; |
---|
5084 | 5466 | private MenuItem revertMeshItem; |
---|
5085 | 5467 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5129 | 5511 | private MenuItem showleavesItem; |
---|
5130 | 5512 | private MenuItem markleavesItem; |
---|
5131 | 5513 | private MenuItem unmarkleavesItem; |
---|
| 5514 | + private MenuItem rewindleavesItem; |
---|
| 5515 | + private MenuItem unrewindleavesItem; |
---|
| 5516 | + private MenuItem randomleavesItem; |
---|
| 5517 | + private MenuItem unrandomleavesItem; |
---|
5132 | 5518 | |
---|
5133 | 5519 | private MenuItem flipVItem; |
---|
5134 | 5520 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5140 | 5526 | private MenuItem panoTexturesItem; |
---|
5141 | 5527 | |
---|
5142 | 5528 | private MenuItem resetCentroidItem; |
---|
5143 | | - private MenuItem transformgeometryItem; |
---|
| 5529 | + private MenuItem resetCentroidXZItem; |
---|
5144 | 5530 | private MenuItem resetTransformItem; |
---|
| 5531 | + private MenuItem transformGeometryItem; |
---|
| 5532 | + private MenuItem transformChildrenItem; |
---|
5145 | 5533 | private MenuItem hideItem; |
---|
5146 | 5534 | private MenuItem grabItem; |
---|
5147 | 5535 | private MenuItem backItem; |
---|
.. | .. |
---|
5210 | 5598 | private MenuItem doubleItem; |
---|
5211 | 5599 | private MenuItem tripleItem; |
---|
5212 | 5600 | |
---|
5213 | | - private MenuItem importGFDItem; |
---|
5214 | | - private MenuItem importVRMLX3DItem; |
---|
5215 | | - private MenuItem import3DSItem; |
---|
5216 | | - private MenuItem importOBJItem; |
---|
5217 | | - |
---|
5218 | 5601 | private MenuItem computeAOItem; |
---|
5219 | 5602 | private MenuItem recompileItem; |
---|
5220 | 5603 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5224 | 5607 | private MenuItem analyzeItem; |
---|
5225 | 5608 | private MenuItem dumpItem; |
---|
5226 | 5609 | //boolean freezemodel = false; |
---|
| 5610 | + |
---|
| 5611 | + Menu cameraMenu; |
---|
| 5612 | + MenuItem editCameraItem; |
---|
| 5613 | + MenuItem revertCameraItem; |
---|
5227 | 5614 | } |
---|