.. | .. |
---|
12 | 12 | import com.jme.math.Vector3f; |
---|
13 | 13 | import com.jme.renderer.ColorRGBA; |
---|
14 | 14 | |
---|
| 15 | +import grafeme.ui.*; |
---|
15 | 16 | //import buoy.widget.BFileChooser; |
---|
16 | 17 | |
---|
17 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
.. | .. |
---|
149 | 150 | |
---|
150 | 151 | void SetupMenu2(ObjEditor oe) |
---|
151 | 152 | { |
---|
| 153 | + if (Globals.ADVANCED) |
---|
| 154 | + { |
---|
152 | 155 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 156 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 157 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 163 | lookAtItem.addActionListener(this); |
---|
161 | 164 | //lookFromItem.addActinoListener(this); |
---|
162 | 165 | //switchItem.addActionListener(this); |
---|
| 166 | + } |
---|
| 167 | + |
---|
163 | 168 | Menu menu; |
---|
164 | 169 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | 170 | //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | 171 | //editItem.addActionListener(this); |
---|
167 | 172 | duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
168 | 173 | duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | 174 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | 175 | cloneItem.addActionListener(this); |
---|
| 176 | + if (Globals.ADVANCED) |
---|
| 177 | + { |
---|
172 | 178 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | 179 | cloneSupportItem.addActionListener(this); |
---|
| 180 | + } |
---|
174 | 181 | menu.add("-"); |
---|
175 | 182 | cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | 183 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
178 | 185 | copyItem.addActionListener(this); |
---|
179 | 186 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | 187 | pasteItem.addActionListener(this); |
---|
| 188 | + menu.add("-"); |
---|
| 189 | + |
---|
| 190 | + menu.add("-"); |
---|
| 191 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 192 | + pasteIntoItem.addActionListener(this); |
---|
181 | 193 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | 194 | pasteLinkItem.addActionListener(this); |
---|
183 | 195 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | 196 | pasteCloneItem.addActionListener(this); |
---|
185 | 197 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | 198 | // pasteExpandItem.addActionListener(this); |
---|
| 199 | + menu.add("-"); |
---|
187 | 200 | clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | 201 | clearItem.addActionListener(this); |
---|
| 202 | + |
---|
| 203 | + if (Globals.ADVANCED) |
---|
| 204 | + { |
---|
| 205 | + // Deletes the cameras... |
---|
189 | 206 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | 207 | clearAllItem.addActionListener(this); |
---|
| 208 | + } |
---|
191 | 209 | |
---|
192 | 210 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
| 211 | + if (Globals.ADVANCED) |
---|
| 212 | + { |
---|
193 | 213 | resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
194 | 214 | resetMeshItem.addActionListener(this); |
---|
195 | 215 | stepAllItem = menu.add(new MenuItem("Step All")); |
---|
.. | .. |
---|
199 | 219 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 220 | resetreferencesItem.addActionListener(this); |
---|
201 | 221 | menu.add("-"); |
---|
| 222 | + } |
---|
202 | 223 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 224 | overwriteGeoItem.addActionListener(this); |
---|
204 | 225 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 231 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 232 | overwriteUVItem.addActionListener(this); |
---|
212 | 233 | menu.add("-"); |
---|
| 234 | + if (Globals.ADVANCED) |
---|
| 235 | + { |
---|
213 | 236 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 237 | generateMeshItem.addActionListener(this); |
---|
215 | 238 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 239 | poseMeshItem.addActionListener(this); |
---|
217 | 240 | menu.add("-"); |
---|
| 241 | + } |
---|
218 | 242 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 243 | resetsupportItem.addActionListener(this); |
---|
220 | 244 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 245 | linkverticesItem.addActionListener(this); |
---|
222 | 246 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 247 | relinkverticesItem.addActionListener(this); |
---|
| 248 | + |
---|
| 249 | + if (Globals.ADVANCED) |
---|
| 250 | + { |
---|
224 | 251 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 252 | setMasterItem.addActionListener(this); |
---|
| 253 | + } |
---|
226 | 254 | |
---|
227 | 255 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | 256 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
233 | 261 | frontItem.addActionListener(this); |
---|
234 | 262 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | 263 | compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 264 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 265 | hideItem.addActionListener(this); |
---|
238 | 266 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 267 | ungroupItem.addActionListener(this); |
---|
240 | 268 | menu.add("-"); |
---|
241 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 269 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
242 | 270 | randomItem.addActionListener(this); |
---|
243 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
244 | | - physicsItem.addActionListener(this); |
---|
245 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
246 | | - frameselectorItem.addActionListener(this); |
---|
247 | 271 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 272 | switchGeoItem.addActionListener(this); |
---|
249 | 273 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 274 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 275 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 276 | morphItem.addActionListener(this); |
---|
| 277 | + |
---|
| 278 | + if (Globals.ADVANCED) |
---|
| 279 | + { |
---|
| 280 | + menu.add("-"); |
---|
| 281 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 282 | + physicsItem.addActionListener(this); |
---|
| 283 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 284 | + frameselectorItem.addActionListener(this); |
---|
253 | 285 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 286 | scriptNodeItem.addActionListener(this); |
---|
255 | 287 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | 288 | cameraItem.addActionListener(this); |
---|
| 289 | + } |
---|
257 | 290 | |
---|
258 | 291 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | 292 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
268 | 301 | shadowYItem.addActionListener(this); |
---|
269 | 302 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
270 | 303 | shadowZItem.addActionListener(this); |
---|
| 304 | + if (Globals.ADVANCED) |
---|
| 305 | + { |
---|
| 306 | + menu.add("-"); |
---|
271 | 307 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 308 | linkerItem.addActionListener(this); |
---|
273 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
274 | | - templateItem.addActionListener(this); |
---|
275 | 309 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | 310 | attributeItem.addActionListener(this); |
---|
| 311 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 312 | + templateItem.addActionListener(this); |
---|
277 | 313 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 314 | pointflowItem.addActionListener(this); |
---|
| 315 | + } |
---|
279 | 316 | menu.add("-"); |
---|
280 | 317 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 318 | resetTransformItem.addActionListener(this); |
---|
.. | .. |
---|
293 | 330 | genNormalsCADItem.addActionListener(this); |
---|
294 | 331 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 332 | genNormalsMESHItem.addActionListener(this); |
---|
| 333 | + if (Globals.ADVANCED) |
---|
| 334 | + { |
---|
296 | 335 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
297 | 336 | genNormalsMINEItem.addActionListener(this); |
---|
| 337 | + } |
---|
298 | 338 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 339 | stripifyItem.addActionListener(this); |
---|
300 | 340 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 356 | reduce34MeshItem.addActionListener(this); |
---|
317 | 357 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 358 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 359 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 360 | clipMeshItem.addActionListener(this); |
---|
| 361 | + |
---|
| 362 | + if (Globals.ADVANCED) |
---|
| 363 | + { |
---|
| 364 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 365 | + smoothMeshItem.addActionListener(this); |
---|
| 366 | + } |
---|
323 | 367 | |
---|
324 | 368 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 369 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
.. | .. |
---|
329 | 373 | liveleavesItem.addActionListener(this); |
---|
330 | 374 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 375 | unliveleavesItem.addActionListener(this); |
---|
| 376 | + if (Globals.ADVANCED) |
---|
| 377 | + { |
---|
332 | 378 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 379 | supportleavesItem.addActionListener(this); |
---|
334 | 380 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 381 | unsupportleavesItem.addActionListener(this); |
---|
| 382 | + } |
---|
336 | 383 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 384 | hideleavesItem.addActionListener(this); |
---|
338 | 385 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
375 | 422 | sortbysizeItem.addActionListener(this); |
---|
376 | 423 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 424 | sortbynameItem.addActionListener(this); |
---|
| 425 | + if (Globals.ADVANCED) |
---|
| 426 | + { |
---|
378 | 427 | menu.add("-"); |
---|
379 | 428 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 429 | extractGeometriesItem.addActionListener(this); |
---|
.. | .. |
---|
384 | 433 | shareGeometriesItem.addActionListener(this); |
---|
385 | 434 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
386 | 435 | mergeGeometriesItem.addActionListener(this); |
---|
| 436 | + } |
---|
387 | 437 | |
---|
388 | 438 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 439 | buildCreateMenu(menu); |
---|
390 | 440 | |
---|
391 | | - |
---|
392 | 441 | oe.menuBar.add(menu = new Menu("Include")); |
---|
393 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
394 | | - importGFDItem.addActionListener(this); |
---|
395 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
396 | | - importVRMLX3DItem.addActionListener(this); |
---|
397 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
| 442 | + importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
398 | 443 | importOBJItem.addActionListener(this); |
---|
399 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
| 444 | + menu.add("-"); |
---|
| 445 | + import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
400 | 446 | import3DSItem.addActionListener(this); |
---|
| 447 | + menu.add("-"); |
---|
| 448 | + importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
| 449 | + importVRMLX3DItem.addActionListener(this); |
---|
| 450 | + menu.add("-"); |
---|
| 451 | + importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
| 452 | + importGFDItem.addActionListener(this); |
---|
401 | 453 | |
---|
402 | 454 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 455 | buildToolsMenu(menu); |
---|
.. | .. |
---|
433 | 485 | oe.radioPanel.add(dummyButton); |
---|
434 | 486 | oe.buttonGroup.add(dummyButton); |
---|
435 | 487 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
437 | | - oe.aConstraints.gridwidth = 1; |
---|
438 | | - oe.aConstraints.gridx = 0; |
---|
| 488 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
439 | 489 | |
---|
440 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 490 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 491 | + liveCB.setToolTipText("Enabled animation"); |
---|
441 | 492 | liveCB.addItemListener(this); |
---|
442 | 493 | |
---|
443 | | - oe.aConstraints.gridx += 1; |
---|
444 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
445 | | - supportCB.addItemListener(this); |
---|
446 | | - |
---|
447 | | - // oe.aConstraints.gridx += 1; |
---|
448 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
449 | | - // localCB.addItemListener(this); |
---|
450 | | - |
---|
451 | | - oe.aConstraints.gridx += 1; |
---|
452 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
453 | | - crowdCB.addItemListener(this); |
---|
454 | | - |
---|
455 | | - oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
457 | | - smoothCB.addItemListener(this); |
---|
458 | | - |
---|
459 | | - oe.aConstraints.gridx += 1; |
---|
460 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 494 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 495 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 496 | + oneStepButton.addActionListener(this); |
---|
| 497 | + |
---|
| 498 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 499 | + fastCB.setToolTipText("Fast mode"); |
---|
461 | 500 | fastCB.addItemListener(this); |
---|
462 | | - oe.aConstraints.gridx += 1; |
---|
463 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
464 | | - slowCB.addItemListener(this); |
---|
465 | | - oe.aConstraints.gridx += 1; |
---|
466 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
467 | | - boxCB.addItemListener(this); |
---|
468 | | - |
---|
469 | | -// oe.aConstraints.gridx += 1; |
---|
470 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
471 | | -// speakerMocapCB.addItemListener(this); |
---|
472 | | - |
---|
473 | | - if (false) |
---|
474 | | - { |
---|
475 | | - // handled in scripts |
---|
476 | | - oe.aConstraints.gridx += 1; |
---|
477 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
478 | | - speakerCameraCB.addItemListener(this); |
---|
479 | | - |
---|
480 | | - oe.aConstraints.gridx += 1; |
---|
481 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
482 | | - speakerFocusCB.addItemListener(this); |
---|
483 | | - |
---|
484 | | - oe.aConstraints.gridx += 1; |
---|
485 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
486 | | - smoothfocusCB.addItemListener(this); |
---|
487 | | - } |
---|
488 | | - |
---|
489 | | -//oe.aConstraints.gridx += 1; |
---|
490 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
491 | | -// debugCB.addItemListener(this); |
---|
492 | | - |
---|
493 | | - oe.aConstraints.gridx += 1; |
---|
494 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
495 | | - oeilCB.addItemListener(this); |
---|
496 | | - |
---|
497 | | - oe.aConstraints.gridx += 1; |
---|
498 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
499 | | - lookAtCB.addItemListener(this); |
---|
500 | | - |
---|
501 | | - oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
| 501 | + |
---|
| 502 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 503 | + trackCB.setToolTipText("Enable tracking"); |
---|
503 | 504 | trackCB.addItemListener(this); |
---|
504 | 505 | |
---|
505 | | - oe.aConstraints.gridx += 1; |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 506 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 507 | + screenfitButton.setToolTipText("Screen fit"); |
---|
507 | 508 | screenfitButton.addActionListener(this); |
---|
508 | | - oe.aConstraints.gridx += 1; |
---|
| 509 | + |
---|
509 | 510 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
510 | 511 | // screenfitpointButton.addActionListener(this); |
---|
511 | | -// oe.aConstraints.gridx += 1; |
---|
512 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
513 | | - snapobjectButton.addActionListener(this); |
---|
514 | | - oe.aConstraints.gridx += 1; |
---|
515 | 512 | |
---|
516 | | - //aConstraints.gridx = 0; |
---|
517 | | - //aConstraints.gridy += 1; |
---|
518 | | - oe.aConstraints.weighty = 0; |
---|
519 | | - oe.aConstraints.gridwidth = 1; |
---|
520 | | - |
---|
521 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 513 | + if (Globals.ADVANCED) |
---|
| 514 | + { |
---|
| 515 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 516 | + snapobjectButton.addActionListener(this); |
---|
| 517 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 518 | + } |
---|
| 519 | + |
---|
| 520 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 521 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | 522 | flashSelectionButton.addActionListener(this); |
---|
523 | 523 | |
---|
524 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
| 524 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | 525 | |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - // |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 526 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 527 | + twoButton.setToolTipText("Show center view only"); |
---|
532 | 528 | twoButton.addActionListener(this); |
---|
533 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 529 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
534 | 530 | fourButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 531 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 532 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 533 | + sixButton.setToolTipText("2-column layout left"); |
---|
536 | 534 | sixButton.addActionListener(this); |
---|
537 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 535 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 536 | + threeButton.setToolTipText("2-column layout right"); |
---|
538 | 537 | threeButton.addActionListener(this); |
---|
539 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 538 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 539 | + sevenButton.setToolTipText("3-column layout"); |
---|
540 | 540 | sevenButton.addActionListener(this); |
---|
541 | 541 | // |
---|
542 | 542 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 543 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 544 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
544 | 545 | rootButton.addActionListener(this); |
---|
545 | | - oe.aConstraints.gridx += 1; |
---|
546 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 546 | + |
---|
| 547 | + oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 548 | + closeButton.setToolTipText("Close tab"); |
---|
547 | 549 | closeButton.addActionListener(this); |
---|
548 | 550 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
549 | 551 | //clearButton.addActionListener(this); |
---|
550 | | - oe.aConstraints.gridx += 1; |
---|
551 | 552 | |
---|
552 | | - oe.aConstraints.gridx = 1; // |
---|
553 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 553 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 554 | + |
---|
| 555 | + commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 556 | + editButton.setToolTipText("Edit selection"); |
---|
554 | 557 | editButton.addActionListener(this); |
---|
555 | | - oe.aConstraints.gridx += 1; |
---|
556 | | - oe.aConstraints.weighty = 0; |
---|
557 | | - oe.aConstraints.gridwidth = 1; |
---|
558 | 558 | |
---|
559 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 559 | + commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 560 | + uneditButton.setToolTipText("Unedit selection"); |
---|
560 | 561 | uneditButton.addActionListener(this); |
---|
561 | 562 | |
---|
562 | | - oe.aConstraints.gridx += 1; |
---|
563 | | - oe.aConstraints.weighty = 0; |
---|
564 | | - oe.aConstraints.gridwidth = 1; |
---|
565 | | - |
---|
566 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
567 | | - clearPanelButton.addActionListener(this); |
---|
568 | | - |
---|
569 | | - oe.aConstraints.gridx += 1; |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 1; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 563 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 564 | + allParamsButton.setToolTipText("Edit all params"); |
---|
574 | 565 | allParamsButton.addActionListener(this); |
---|
575 | 566 | |
---|
576 | | - oe.aConstraints.gridx += 1; |
---|
577 | | - oe.aConstraints.weighty = 0; |
---|
578 | | - oe.aConstraints.gridwidth = 1; |
---|
579 | | - |
---|
580 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 567 | + commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 568 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 569 | + clearPanelButton.addActionListener(this); |
---|
| 570 | + |
---|
| 571 | + commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 572 | + unselectButton.setToolTipText("Unselect"); |
---|
581 | 573 | unselectButton.addActionListener(this); |
---|
582 | 574 | |
---|
| 575 | + commandsPanel.preferredHeight = 1; |
---|
| 576 | + |
---|
| 577 | + oe.treePanel.add(commandsPanel); |
---|
| 578 | + oe.treePanel.Return(); |
---|
| 579 | + |
---|
583 | 580 | // oe.aConstraints.gridx += 1; |
---|
584 | 581 | // oe.aConstraints.weighty = 0; |
---|
585 | 582 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
591 | 588 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
592 | 589 | // gcButton.addActionListener(this); |
---|
593 | 590 | |
---|
594 | | - oe.aConstraints.gridx = 0; |
---|
595 | | - oe.aConstraints.gridy += 1; |
---|
596 | | - |
---|
597 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
598 | | - oe.aConstraints.gridwidth = 100; |
---|
599 | | - // oe.aConstraints.gridheight = 100; |
---|
600 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
601 | | - oe.aConstraints.gridheight = 1; |
---|
602 | | - oe.aConstraints.weighty = 0.5; |
---|
603 | | - oe.aConstraints.gridx = 0; |
---|
604 | | - JScrollPane jSP; |
---|
| 591 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 592 | + |
---|
| 593 | + JScrollPane jSP; |
---|
605 | 594 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
606 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 595 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
607 | 596 | ResetModel(); |
---|
608 | | - oe.aConstraints.weighty = 0.5; |
---|
609 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
610 | | - oe.aConstraints.gridy += 1; |
---|
611 | | - oe.aConstraints.gridwidth = 1; |
---|
| 597 | + |
---|
| 598 | + oe.treePanel.add(jSPPanel); |
---|
| 599 | + oe.treePanel.Return(); |
---|
612 | 600 | |
---|
613 | | - oe.aConstraints.weighty = 0; |
---|
614 | | - oe.aConstraints.gridwidth = 2; |
---|
615 | | - |
---|
616 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 601 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 602 | + |
---|
| 603 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 604 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
617 | 605 | colorCB.addItemListener(this); |
---|
618 | | - oe.aConstraints.gridx += 2; |
---|
619 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 606 | + |
---|
| 607 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 608 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
620 | 609 | materialCB.addItemListener(this); |
---|
621 | | - oe.aConstraints.gridx += 2; |
---|
622 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 610 | + |
---|
| 611 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 612 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
623 | 613 | textureCB.addItemListener(this); |
---|
624 | 614 | |
---|
625 | | - oe.aConstraints.gridx = 0; |
---|
626 | | - oe.aConstraints.gridy += 1; |
---|
| 615 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 616 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 617 | + oe.treePanel.Return(); |
---|
627 | 618 | |
---|
| 619 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 620 | +// mainPanel.setResizeWeight(0.5); |
---|
| 621 | + |
---|
628 | 622 | //jList.addListSelectionListener(this); |
---|
629 | 623 | oe.jTree.addTreeSelectionListener(this); |
---|
630 | 624 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
646 | 640 | radio.layout = sevenButton; |
---|
647 | 641 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
648 | 642 | } |
---|
| 643 | + |
---|
| 644 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 645 | + { |
---|
| 646 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 647 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 648 | + boxCB.addItemListener(this); |
---|
| 649 | + |
---|
| 650 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 651 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 652 | + zoomBoxCB.addItemListener(this); |
---|
| 653 | + |
---|
| 654 | + if (Globals.ADVANCED) |
---|
| 655 | + { |
---|
| 656 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 657 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 658 | + supportCB.addItemListener(this); |
---|
| 659 | + |
---|
| 660 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 661 | + // localCB.addItemListener(this); |
---|
| 662 | + |
---|
| 663 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 664 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 665 | + crowdCB.addItemListener(this); |
---|
| 666 | + |
---|
| 667 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 668 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 669 | + smoothCB.addItemListener(this); |
---|
| 670 | + |
---|
| 671 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 672 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 673 | + slowCB.addItemListener(this); |
---|
| 674 | + |
---|
| 675 | +// constraints.gridy += 1; |
---|
| 676 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 677 | +// speakerMocapCB.addItemListener(this); |
---|
| 678 | + |
---|
| 679 | + if (false) |
---|
| 680 | + { |
---|
| 681 | + // handled in scripts |
---|
| 682 | + //constraints.gridy += 1; |
---|
| 683 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 684 | + speakerCameraCB.addItemListener(this); |
---|
| 685 | + |
---|
| 686 | + //constraints.gridy += 1; |
---|
| 687 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 688 | + speakerFocusCB.addItemListener(this); |
---|
| 689 | + |
---|
| 690 | + //constraints.gridy += 1; |
---|
| 691 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 692 | + smoothfocusCB.addItemListener(this); |
---|
| 693 | + } |
---|
| 694 | + |
---|
| 695 | +//constraints.gridx += 1; |
---|
| 696 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 697 | +// debugCB.addItemListener(this); |
---|
| 698 | + |
---|
| 699 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 700 | + oeilCB.addItemListener(this); |
---|
| 701 | + |
---|
| 702 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 703 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 704 | + lookAtCB.addItemListener(this); |
---|
| 705 | + |
---|
| 706 | + } |
---|
| 707 | + |
---|
| 708 | + cGridBag fill = new cGridBag(); |
---|
| 709 | + |
---|
| 710 | + fill.preferredHeight = 200; |
---|
| 711 | + |
---|
| 712 | + panel.add(fill); |
---|
| 713 | + |
---|
| 714 | + } |
---|
649 | 715 | |
---|
650 | 716 | void EditObject(Object3D obj) |
---|
651 | 717 | { |
---|
.. | .. |
---|
676 | 742 | JCheckBox fastCB; |
---|
677 | 743 | JCheckBox slowCB; |
---|
678 | 744 | JCheckBox boxCB; |
---|
| 745 | + JCheckBox zoomBoxCB; |
---|
679 | 746 | JCheckBox trackCB; |
---|
680 | 747 | JCheckBox smoothfocusCB; |
---|
681 | 748 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
755 | 822 | Recompile(); |
---|
756 | 823 | cameraView.repaint(); |
---|
757 | 824 | // refreshContents(); |
---|
| 825 | + } |
---|
| 826 | + else if(e.getSource() == zoomBoxCB) |
---|
| 827 | + { |
---|
| 828 | + cameraView.ToggleZoomBoxMode(); |
---|
758 | 829 | } |
---|
759 | 830 | else if(e.getSource() == smoothfocusCB) |
---|
760 | 831 | { |
---|
.. | .. |
---|
923 | 994 | { |
---|
924 | 995 | loadClipboard(true); |
---|
925 | 996 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
926 | | - pasteInto(false); |
---|
| 997 | + pasteInto(false, false); |
---|
927 | 998 | } else { |
---|
928 | 999 | loadClipboard(false); |
---|
929 | 1000 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
930 | | - pasteInto(false); // true); // ??? |
---|
| 1001 | + pasteInto(false, false); // true); // ??? |
---|
931 | 1002 | } |
---|
932 | 1003 | } |
---|
933 | 1004 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1049 | 1120 | kleinItem.addActionListener(this); |
---|
1050 | 1121 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1051 | 1122 | particleItem.addActionListener(this); |
---|
| 1123 | + if (Globals.ADVANCED) |
---|
| 1124 | + { |
---|
1052 | 1125 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1053 | 1126 | ragdollItem.addActionListener(this); |
---|
1054 | 1127 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1055 | 1128 | ragdoll2Item.addActionListener(this); |
---|
| 1129 | + } |
---|
1056 | 1130 | menu.add("-"); |
---|
1057 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1131 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1058 | 1132 | meshItem.addActionListener(this); |
---|
1059 | 1133 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1060 | 1134 | // meshGroupItem.addActionListener(this); |
---|
| 1135 | + if (Globals.ADVANCED) |
---|
| 1136 | + { |
---|
1061 | 1137 | springItem = menu.add(new MenuItem("Spring")); |
---|
1062 | 1138 | springItem.addActionListener(this); |
---|
1063 | 1139 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1064 | 1140 | flagItem.addActionListener(this); |
---|
1065 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1066 | | - bezierItem.addActionListener(this); |
---|
1067 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1068 | | - checkerItem.addActionListener(this); |
---|
1069 | 1141 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1070 | 1142 | blobItem.addActionListener(this); |
---|
1071 | 1143 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1072 | 1144 | latheItem.addActionListener(this); |
---|
| 1145 | + } |
---|
| 1146 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1147 | + bezierItem.addActionListener(this); |
---|
| 1148 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1149 | + overlayItem.addActionListener(this); |
---|
1073 | 1150 | lightItem = menu.add(new MenuItem("Light")); |
---|
1074 | 1151 | lightItem.addActionListener(this); |
---|
1075 | 1152 | menu.add("-"); |
---|
.. | .. |
---|
1079 | 1156 | loopItem.addActionListener(this); |
---|
1080 | 1157 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1081 | 1158 | doubleItem.addActionListener(this); |
---|
| 1159 | + if (Globals.ADVANCED) |
---|
| 1160 | + { |
---|
1082 | 1161 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1083 | 1162 | tripleItem.addActionListener(this); |
---|
| 1163 | + } |
---|
1084 | 1164 | } |
---|
1085 | 1165 | |
---|
1086 | 1166 | void buildToolsMenu(Menu menu) |
---|
1087 | 1167 | { |
---|
1088 | 1168 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1089 | 1169 | animationItem.addItemListener(this); |
---|
1090 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1170 | + animationItem.setState(Globals.ANIMATION); |
---|
1091 | 1171 | |
---|
1092 | 1172 | menu.add("-"); |
---|
1093 | 1173 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1094 | 1174 | parseverticesItem.addActionListener(this); |
---|
1095 | 1175 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1096 | 1176 | textureFieldItem.addActionListener(this); |
---|
1097 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1177 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1098 | 1178 | alignItem.addActionListener(this); |
---|
1099 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1100 | | - mirrorItem.addActionListener(this); |
---|
1101 | 1179 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1102 | 1180 | reduceMorphItem.addActionListener(this); |
---|
1103 | 1181 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1104 | 1182 | reduce34MorphItem.addActionListener(this); |
---|
1105 | | - |
---|
| 1183 | + menu.add("-"); |
---|
1106 | 1184 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1107 | 1185 | computeAOItem.addActionListener(this); |
---|
1108 | | - menu.add("-"); |
---|
1109 | 1186 | |
---|
| 1187 | + if (Globals.ADVANCED) |
---|
| 1188 | + { |
---|
| 1189 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1190 | + mirrorItem.addActionListener(this); |
---|
| 1191 | + menu.add("-"); |
---|
1110 | 1192 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1111 | 1193 | memoryItem.addActionListener(this); |
---|
1112 | 1194 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1120 | 1202 | resetParentItem.addActionListener(this); |
---|
1121 | 1203 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1122 | 1204 | repairParentItem.addActionListener(this); |
---|
| 1205 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1206 | + repairShadowItem.addActionListener(this); |
---|
1123 | 1207 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1124 | 1208 | invariantsItem.addActionListener(this); |
---|
1125 | 1209 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1127 | 1211 | menu.add("-"); |
---|
1128 | 1212 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1129 | 1213 | editScriptItem.addActionListener(this); |
---|
| 1214 | + } |
---|
1130 | 1215 | } |
---|
1131 | 1216 | |
---|
1132 | 1217 | void ScreenFit() |
---|
.. | .. |
---|
1480 | 1565 | // |
---|
1481 | 1566 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1482 | 1567 | { |
---|
| 1568 | + Object source = event.getSource(); |
---|
1483 | 1569 | /* |
---|
1484 | 1570 | if (event.getSource() == nameField) |
---|
1485 | 1571 | { |
---|
.. | .. |
---|
1491 | 1577 | } |
---|
1492 | 1578 | else |
---|
1493 | 1579 | */ |
---|
1494 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1580 | + if (source == lookAtItem || source == lookFromItem) |
---|
1495 | 1581 | { |
---|
1496 | 1582 | ScreenFit(); |
---|
1497 | 1583 | } else |
---|
1498 | | - if (event.getSource() == switchItem) |
---|
| 1584 | + if (source == switchItem) |
---|
1499 | 1585 | { |
---|
1500 | 1586 | cVector v1 = new cVector(); |
---|
1501 | 1587 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1504 | 1590 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1505 | 1591 | objEditor.cameraView.repaint(); |
---|
1506 | 1592 | } else |
---|
1507 | | - if (event.getSource() == rectoidItem) |
---|
| 1593 | + if (source == rectoidItem) |
---|
1508 | 1594 | { |
---|
1509 | 1595 | makeSomething(new Box()); |
---|
1510 | 1596 | } else |
---|
1511 | | - if (event.getSource() == particleItem) |
---|
| 1597 | + if (source == particleItem) |
---|
1512 | 1598 | { |
---|
1513 | 1599 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1514 | 1600 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1529 | 1615 | applyExample(particleGeom, "SMOKE"); |
---|
1530 | 1616 | makeSomething(particleGeom); |
---|
1531 | 1617 | } else |
---|
1532 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1618 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1533 | 1619 | { |
---|
1534 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1620 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1535 | 1621 | |
---|
1536 | 1622 | ragdoll.toParent = LA.newMatrix(); |
---|
1537 | 1623 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1549 | 1635 | } else |
---|
1550 | 1636 | /* |
---|
1551 | 1637 | */ |
---|
1552 | | - if (event.getSource() == heightFieldItem) |
---|
| 1638 | + if (source == heightFieldItem) |
---|
1553 | 1639 | { |
---|
1554 | 1640 | Object3D obj = new Object3D(); |
---|
1555 | 1641 | |
---|
.. | .. |
---|
1587 | 1673 | |
---|
1588 | 1674 | makeSomething(obj); |
---|
1589 | 1675 | } else |
---|
1590 | | - if (event.getSource() == gridItem) |
---|
| 1676 | + if (source == gridItem) |
---|
1591 | 1677 | { |
---|
1592 | 1678 | makeSomething(new Grid()); |
---|
1593 | 1679 | } else |
---|
1594 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1680 | + if (source == ellipsoidItem) |
---|
1595 | 1681 | { |
---|
1596 | 1682 | makeSomething(new Sphere()); |
---|
1597 | 1683 | } else |
---|
1598 | | - if (event.getSource() == coneItem) |
---|
| 1684 | + if (source == coneItem) |
---|
1599 | 1685 | { |
---|
1600 | 1686 | makeSomething(new Cone()); |
---|
1601 | 1687 | } else |
---|
1602 | | - if (event.getSource() == torusItem) |
---|
| 1688 | + if (source == torusItem) |
---|
1603 | 1689 | { |
---|
1604 | 1690 | makeSomething(new Torus()); |
---|
1605 | 1691 | } else |
---|
1606 | | - if (event.getSource() == superItem) |
---|
| 1692 | + if (source == superItem) |
---|
1607 | 1693 | { |
---|
1608 | 1694 | makeSomething(new Superellipsoid()); |
---|
1609 | 1695 | } else |
---|
1610 | | - if (event.getSource() == kleinItem) |
---|
| 1696 | + if (source == kleinItem) |
---|
1611 | 1697 | { |
---|
1612 | 1698 | makeSomething(new Klein()); |
---|
1613 | 1699 | } else |
---|
1614 | | - if (event.getSource() == blobItem) |
---|
| 1700 | + if (source == blobItem) |
---|
1615 | 1701 | { |
---|
1616 | 1702 | Blob blob = new Blob(); |
---|
1617 | 1703 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1619 | 1705 | //blob.retile(); |
---|
1620 | 1706 | makeSomething(blob); |
---|
1621 | 1707 | } else |
---|
1622 | | - if (event.getSource() == latheItem) |
---|
| 1708 | + if (source == latheItem) |
---|
1623 | 1709 | { |
---|
1624 | 1710 | makeSomething(new Lathe()); |
---|
1625 | 1711 | } else |
---|
1626 | | - if (event.getSource() == bezierItem) |
---|
| 1712 | + if (source == bezierItem) |
---|
1627 | 1713 | { |
---|
1628 | 1714 | makeSomething(new BezierSurface()); |
---|
1629 | 1715 | } else |
---|
1630 | | - if (event.getSource() == checkerItem) |
---|
| 1716 | + if (source == overlayItem) |
---|
1631 | 1717 | { |
---|
1632 | 1718 | /* |
---|
1633 | 1719 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1642 | 1728 | */ |
---|
1643 | 1729 | makeSomething(new Checker()); |
---|
1644 | 1730 | } else |
---|
1645 | | - if (event.getSource() == meshItem) |
---|
| 1731 | + if (source == meshItem) |
---|
1646 | 1732 | { |
---|
1647 | 1733 | Object3D itemtomake = new Object3D(); |
---|
1648 | 1734 | Object3D child; |
---|
.. | .. |
---|
1663 | 1749 | makeSomething(child); |
---|
1664 | 1750 | } |
---|
1665 | 1751 | } else |
---|
1666 | | - if (event.getSource() == springItem) |
---|
| 1752 | + if (source == springItem) |
---|
1667 | 1753 | { |
---|
1668 | 1754 | cSpring s = new cSpring(); |
---|
1669 | 1755 | s.setup(); |
---|
1670 | 1756 | makeSomething(s); |
---|
1671 | 1757 | } else |
---|
1672 | | - if (event.getSource() == flagItem) |
---|
| 1758 | + if (source == flagItem) |
---|
1673 | 1759 | { |
---|
1674 | 1760 | cSpring s = new cFlag(); |
---|
1675 | 1761 | s.setup(); |
---|
1676 | 1762 | makeSomething(s); |
---|
1677 | 1763 | } else |
---|
1678 | | - if (event.getSource() == lightItem) |
---|
| 1764 | + if (source == lightItem) |
---|
1679 | 1765 | { |
---|
1680 | 1766 | makeSomething(new Light()); |
---|
1681 | 1767 | } else |
---|
1682 | | - if (event.getSource() == csgItem) |
---|
| 1768 | + if (source == csgItem) |
---|
1683 | 1769 | { |
---|
1684 | 1770 | group(new CSG()); |
---|
1685 | 1771 | } else |
---|
1686 | | - if (event.getSource() == templateItem) |
---|
| 1772 | + if (source == templateItem) |
---|
1687 | 1773 | { |
---|
1688 | 1774 | group(new cTemplate()); |
---|
1689 | 1775 | } else |
---|
1690 | | - if (event.getSource() == attributeItem) |
---|
| 1776 | + if (source == attributeItem) |
---|
1691 | 1777 | { |
---|
1692 | 1778 | makeSomething(new Attribute()); |
---|
1693 | 1779 | } else |
---|
1694 | | - if (event.getSource() == pointflowItem) |
---|
| 1780 | + if (source == pointflowItem) |
---|
1695 | 1781 | { |
---|
1696 | 1782 | makeSomething(new PointFlow()); |
---|
1697 | 1783 | } else |
---|
.. | .. |
---|
1703 | 1789 | } else |
---|
1704 | 1790 | */ |
---|
1705 | 1791 | |
---|
1706 | | - if (event.getSource() == superLoopItem) |
---|
| 1792 | + if (source == superLoopItem) |
---|
1707 | 1793 | { |
---|
1708 | 1794 | Composite g = new cGroup(); |
---|
1709 | 1795 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1725 | 1811 | |
---|
1726 | 1812 | group(g); |
---|
1727 | 1813 | } else |
---|
1728 | | - if (event.getSource() == loopItem) |
---|
| 1814 | + if (source == loopItem) |
---|
1729 | 1815 | { |
---|
1730 | 1816 | Composite csg = new GroupLeaf(); |
---|
1731 | 1817 | csg.count = 5; |
---|
.. | .. |
---|
1734 | 1820 | csg.addChild(child); |
---|
1735 | 1821 | child.addChild(csg); |
---|
1736 | 1822 | } else |
---|
1737 | | - if (event.getSource() == doubleItem) |
---|
| 1823 | + if (source == doubleItem) |
---|
1738 | 1824 | { |
---|
1739 | 1825 | Composite csg = new GroupLeaf(); |
---|
1740 | 1826 | csg.count = 5; |
---|
.. | .. |
---|
1746 | 1832 | csg.addChild(child); |
---|
1747 | 1833 | child.addChild(csg); |
---|
1748 | 1834 | } else |
---|
1749 | | - if (event.getSource() == tripleItem) |
---|
| 1835 | + if (source == tripleItem) |
---|
1750 | 1836 | { |
---|
1751 | 1837 | Composite csg = new GroupLeaf(); |
---|
1752 | 1838 | csg.count = 4; |
---|
.. | .. |
---|
1762 | 1848 | child.addChild(csg); |
---|
1763 | 1849 | } else |
---|
1764 | 1850 | |
---|
1765 | | - if (event.getSource() == importGFDItem) |
---|
| 1851 | + if (source == importGFDItem) |
---|
1766 | 1852 | { |
---|
1767 | 1853 | ImportGFD(); |
---|
1768 | 1854 | } else |
---|
1769 | | - if (event.getSource() == importVRMLX3DItem) |
---|
| 1855 | + if (source == importVRMLX3DItem) |
---|
1770 | 1856 | { |
---|
1771 | 1857 | ImportVRMLX3D(); |
---|
1772 | 1858 | } else |
---|
1773 | | - if (event.getSource() == import3DSItem) |
---|
| 1859 | + if (source == import3DSItem) |
---|
1774 | 1860 | { |
---|
1775 | 1861 | objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1776 | 1862 | } else |
---|
1777 | | - if (event.getSource() == importOBJItem) |
---|
| 1863 | + if (source == importOBJItem) |
---|
1778 | 1864 | { |
---|
1779 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1865 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1866 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 1867 | + browser.setVisible(true); |
---|
| 1868 | + String filename = browser.getFile(); |
---|
| 1869 | + if (filename != null && filename.length() > 0) |
---|
| 1870 | + { |
---|
| 1871 | + String fullname = browser.getDirectory() + filename; |
---|
| 1872 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 1873 | + } |
---|
1780 | 1874 | } else |
---|
1781 | | - if (event.getSource() == computeAOItem) |
---|
| 1875 | + if (source == computeAOItem) |
---|
1782 | 1876 | { |
---|
1783 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1784 | | - CameraPane.theRenderer.repaint(); |
---|
| 1877 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1878 | + Globals.theRenderer.repaint(); |
---|
1785 | 1879 | } else |
---|
1786 | | - if (event.getSource() == recompileItem) |
---|
| 1880 | + if (source == recompileItem) |
---|
1787 | 1881 | { |
---|
1788 | 1882 | Recompile(); |
---|
1789 | 1883 | refreshContents(); |
---|
1790 | 1884 | } else |
---|
1791 | | - if (event.getSource() == editScriptItem) |
---|
| 1885 | + if (source == editScriptItem) |
---|
1792 | 1886 | { |
---|
1793 | 1887 | OpenDialog(); |
---|
1794 | 1888 | refreshContents(); |
---|
1795 | 1889 | } else |
---|
1796 | | - if (event.getSource() == invariantsItem) |
---|
| 1890 | + if (source == invariantsItem) |
---|
1797 | 1891 | { |
---|
1798 | 1892 | System.out.println("Invariants:"); |
---|
1799 | 1893 | GrafreeD.grafreeD.universe.invariants(); |
---|
1800 | 1894 | } else |
---|
1801 | | - if (event.getSource() == memoryItem) |
---|
| 1895 | + if (source == memoryItem) |
---|
1802 | 1896 | { |
---|
1803 | 1897 | //System.out.println("Invariants:"); |
---|
1804 | 1898 | PrintMemory(); |
---|
1805 | 1899 | } else |
---|
1806 | | - if (event.getSource() == pathItem) |
---|
| 1900 | + if (source == pathItem) |
---|
1807 | 1901 | { |
---|
1808 | 1902 | PrintPath(); |
---|
1809 | 1903 | } else |
---|
1810 | | - if (event.getSource() == analyzeItem) |
---|
| 1904 | + if (source == analyzeItem) |
---|
1811 | 1905 | { |
---|
1812 | 1906 | AnalyzeObject(); |
---|
1813 | 1907 | } else |
---|
1814 | | - if (event.getSource() == dumpItem) |
---|
| 1908 | + if (source == dumpItem) |
---|
1815 | 1909 | { |
---|
1816 | 1910 | DumpObject(); |
---|
1817 | 1911 | } else |
---|
1818 | | - if (event.getSource() == screenfitButton) |
---|
| 1912 | + if (source == oneStepButton) |
---|
| 1913 | + { |
---|
| 1914 | + Globals.ONESTEP = true; |
---|
| 1915 | + cameraView.repaint(); |
---|
| 1916 | + } else |
---|
| 1917 | + if (source == screenfitButton) |
---|
1819 | 1918 | { |
---|
1820 | 1919 | //Reload(lastConverter, lastFilename, true); |
---|
1821 | 1920 | ScreenFit(); |
---|
1822 | 1921 | } else |
---|
1823 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1922 | + if (source == screenfitpointButton) |
---|
1824 | 1923 | { |
---|
1825 | 1924 | //Reload(lastConverter, lastFilename, true); |
---|
1826 | 1925 | ScreenFitPoint(); |
---|
1827 | 1926 | } else |
---|
1828 | | - if (event.getSource() == snapobjectButton) |
---|
| 1927 | + if (source == snapobjectButton) |
---|
1829 | 1928 | { |
---|
1830 | 1929 | //Reload(lastConverter, lastFilename, true); |
---|
1831 | 1930 | SnapObject(); |
---|
.. | .. |
---|
1836 | 1935 | // Recompile(); |
---|
1837 | 1936 | // refreshContents(); |
---|
1838 | 1937 | // } else |
---|
1839 | | - if (event.getSource() == gcButton) |
---|
| 1938 | + if (source == gcButton) |
---|
1840 | 1939 | { |
---|
1841 | 1940 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1842 | 1941 | System.gc(); |
---|
1843 | 1942 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1844 | 1943 | } else |
---|
1845 | | - if (event.getSource() == editLeafItem) |
---|
| 1944 | + if (source == editLeafItem) |
---|
1846 | 1945 | { |
---|
1847 | 1946 | Object3D obj; |
---|
1848 | 1947 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1856 | 1955 | } |
---|
1857 | 1956 | refreshContents(true); |
---|
1858 | 1957 | } else |
---|
1859 | | - if (event.getSource() == openWindowItem) |
---|
| 1958 | + if (source == openWindowItem) |
---|
1860 | 1959 | { |
---|
1861 | 1960 | EditSelection(true); |
---|
1862 | 1961 | } else |
---|
1863 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 1962 | + if (source == cutItem || source == clearButton) |
---|
1864 | 1963 | { |
---|
1865 | 1964 | loadClipboard(true); |
---|
1866 | 1965 | } else |
---|
1867 | | - if (event.getSource() == duplicateItem) |
---|
| 1966 | + if (source == duplicateItem) |
---|
1868 | 1967 | { |
---|
1869 | 1968 | Object3D keep = GrafreeD.clipboard; |
---|
1870 | 1969 | loadClipboard(false); |
---|
1871 | 1970 | paste(false); |
---|
1872 | 1971 | GrafreeD.clipboard = keep; |
---|
1873 | 1972 | } else |
---|
1874 | | - if (event.getSource() == cloneItem) |
---|
| 1973 | + if (source == cloneItem) |
---|
1875 | 1974 | { |
---|
1876 | 1975 | CloneSelection(false); |
---|
1877 | 1976 | } else |
---|
1878 | | - if (event.getSource() == cloneSupportItem) |
---|
| 1977 | + if (source == cloneSupportItem) |
---|
1879 | 1978 | { |
---|
1880 | 1979 | CloneSelection(true); |
---|
1881 | 1980 | } else |
---|
1882 | | - if (event.getSource() == copyItem) |
---|
| 1981 | + if (source == copyItem) |
---|
1883 | 1982 | { |
---|
1884 | 1983 | loadClipboard(false); |
---|
1885 | 1984 | } else |
---|
1886 | | - if (event.getSource() == pasteItem) |
---|
| 1985 | + if (source == pasteItem) |
---|
1887 | 1986 | { |
---|
1888 | 1987 | paste(false); |
---|
1889 | 1988 | } else |
---|
1890 | | - if (event.getSource() == pasteLinkItem) |
---|
| 1989 | + if (source == pasteIntoItem) |
---|
1891 | 1990 | { |
---|
1892 | | - pasteInto(false); |
---|
| 1991 | + pasteInto(true, false); |
---|
1893 | 1992 | } else |
---|
1894 | | - if (event.getSource() == pasteCloneItem) |
---|
| 1993 | + if (source == pasteLinkItem) |
---|
1895 | 1994 | { |
---|
1896 | | - pasteInto(true); |
---|
| 1995 | + pasteInto(false, false); |
---|
1897 | 1996 | } else |
---|
1898 | | - if (event.getSource() == pasteExpandItem) |
---|
| 1997 | + if (source == pasteCloneItem) |
---|
| 1998 | + { |
---|
| 1999 | + pasteInto(true, true); |
---|
| 2000 | + } else |
---|
| 2001 | + if (source == pasteExpandItem) |
---|
1899 | 2002 | { |
---|
1900 | 2003 | paste(true); |
---|
1901 | 2004 | } else |
---|
1902 | | - if (event.getSource() == synchronizeItem) |
---|
| 2005 | + if (source == synchronizeItem) |
---|
1903 | 2006 | { |
---|
1904 | 2007 | Overwrite(Object3D.TRANSFORM); |
---|
1905 | 2008 | } else |
---|
1906 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2009 | + if (source == overwriteNameItem) |
---|
1907 | 2010 | { |
---|
1908 | 2011 | Overwrite(Object3D.NAME); |
---|
1909 | 2012 | } else |
---|
1910 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2013 | + if (source == overwriteUVItem) |
---|
1911 | 2014 | { |
---|
1912 | 2015 | Overwrite(Object3D.UV); |
---|
1913 | 2016 | } else |
---|
1914 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2017 | + if (source == overwriteMatItem) |
---|
1915 | 2018 | { |
---|
1916 | 2019 | /* july 2015 |
---|
1917 | 2020 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1931 | 2034 | |
---|
1932 | 2035 | Overwrite(dropAttributes); |
---|
1933 | 2036 | } |
---|
1934 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2037 | + if (source == overwriteGeoItem) |
---|
1935 | 2038 | { |
---|
1936 | 2039 | Overwrite(Object3D.GEOMETRY); |
---|
1937 | 2040 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1948 | 2051 | // refreshContents(); |
---|
1949 | 2052 | // } |
---|
1950 | 2053 | } else |
---|
1951 | | - if (event.getSource() == generateMeshItem) |
---|
| 2054 | + if (source == generateMeshItem) |
---|
1952 | 2055 | { |
---|
1953 | 2056 | //if (group.selection.size() == 1) |
---|
1954 | 2057 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1959 | 2062 | ResetModel(); |
---|
1960 | 2063 | refreshContents(); |
---|
1961 | 2064 | } else |
---|
1962 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2065 | + if (source == extractGeometriesItem) |
---|
1963 | 2066 | { |
---|
1964 | 2067 | boolean one = false; |
---|
1965 | 2068 | |
---|
.. | .. |
---|
1986 | 2089 | ResetModel(); |
---|
1987 | 2090 | refreshContents(); |
---|
1988 | 2091 | } else |
---|
1989 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2092 | + if (source == cloneGeometriesItem) |
---|
1990 | 2093 | { |
---|
1991 | 2094 | boolean one = false; |
---|
1992 | 2095 | |
---|
.. | .. |
---|
2012 | 2115 | ResetModel(); |
---|
2013 | 2116 | refreshContents(); |
---|
2014 | 2117 | } else |
---|
2015 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2118 | + if (source == shareGeometriesItem) |
---|
2016 | 2119 | { |
---|
2017 | 2120 | boolean one = false; |
---|
2018 | 2121 | |
---|
.. | .. |
---|
2042 | 2145 | refreshContents(); |
---|
2043 | 2146 | } |
---|
2044 | 2147 | } else |
---|
2045 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2148 | + if (source == mergeGeometriesItem) |
---|
2046 | 2149 | { |
---|
2047 | 2150 | boolean one = false; |
---|
2048 | 2151 | |
---|
.. | .. |
---|
2072 | 2175 | ResetModel(); |
---|
2073 | 2176 | refreshContents(); |
---|
2074 | 2177 | } else |
---|
2075 | | - if (event.getSource() == linkverticesItem) |
---|
| 2178 | + if (source == linkverticesItem) |
---|
2076 | 2179 | { |
---|
2077 | 2180 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2078 | 2181 | // { |
---|
.. | .. |
---|
2092 | 2195 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2093 | 2196 | content = ((cGroup)content).get(0); |
---|
2094 | 2197 | |
---|
2095 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2198 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2096 | 2199 | for (int i=0; i<group.selection.size(); i++) |
---|
2097 | 2200 | { |
---|
2098 | | - boolean random = CameraPane.RANDOM; |
---|
2099 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2201 | + boolean random = CameraPane.SWITCH; |
---|
| 2202 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2100 | 2203 | group.selection.get(i).linkVerticesThis(content); |
---|
2101 | 2204 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2102 | | - CameraPane.RANDOM = random; |
---|
| 2205 | + CameraPane.SWITCH = random; |
---|
2103 | 2206 | } |
---|
2104 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2207 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2105 | 2208 | refreshContents(); |
---|
2106 | 2209 | } |
---|
2107 | 2210 | } else |
---|
2108 | | - if (event.getSource() == resetsupportItem) |
---|
| 2211 | + if (source == resetsupportItem) |
---|
2109 | 2212 | { |
---|
2110 | 2213 | for (int i=0; i<group.selection.size(); i++) |
---|
2111 | 2214 | { |
---|
2112 | | - boolean random = CameraPane.RANDOM; |
---|
2113 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2215 | + boolean random = CameraPane.SWITCH; |
---|
| 2216 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2114 | 2217 | group.selection.get(i).linkVerticesThis(null); |
---|
2115 | | - CameraPane.RANDOM = random; |
---|
| 2218 | + CameraPane.SWITCH = random; |
---|
2116 | 2219 | } |
---|
2117 | 2220 | |
---|
2118 | 2221 | refreshContents(); |
---|
2119 | 2222 | } else |
---|
2120 | | - if (event.getSource() == relinkverticesItem) |
---|
| 2223 | + if (source == relinkverticesItem) |
---|
2121 | 2224 | { |
---|
2122 | | - boolean random = CameraPane.RANDOM; |
---|
2123 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2225 | + boolean random = CameraPane.SWITCH; |
---|
| 2226 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2124 | 2227 | group.selection.RelinkToSupport(); |
---|
2125 | | - CameraPane.RANDOM = random; |
---|
| 2228 | + CameraPane.SWITCH = random; |
---|
2126 | 2229 | |
---|
2127 | 2230 | refreshContents(); |
---|
2128 | 2231 | } else |
---|
2129 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2232 | + if (source == resetreferencesItem) |
---|
2130 | 2233 | { |
---|
2131 | 2234 | for (int i=0; i<group.selection.size(); i++) |
---|
2132 | 2235 | { |
---|
.. | .. |
---|
2135 | 2238 | |
---|
2136 | 2239 | refreshContents(); |
---|
2137 | 2240 | } else |
---|
2138 | | - if (event.getSource() == setMasterItem) |
---|
| 2241 | + if (source == setMasterItem) |
---|
2139 | 2242 | { |
---|
2140 | 2243 | if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2141 | 2244 | { |
---|
.. | .. |
---|
2148 | 2251 | refreshContents(); |
---|
2149 | 2252 | } |
---|
2150 | 2253 | } else |
---|
2151 | | - if (event.getSource() == poseMeshItem) |
---|
| 2254 | + if (source == poseMeshItem) |
---|
2152 | 2255 | { |
---|
2153 | 2256 | if (group.selection.size() == 1) |
---|
2154 | 2257 | { |
---|
.. | .. |
---|
2167 | 2270 | } |
---|
2168 | 2271 | |
---|
2169 | 2272 | } else |
---|
2170 | | - if (event.getSource() == revertMeshItem) |
---|
| 2273 | + if (source == revertMeshItem) |
---|
2171 | 2274 | { |
---|
2172 | 2275 | RevertMeshes(); |
---|
2173 | 2276 | } else |
---|
2174 | | - if (event.getSource() == resetMeshItem) |
---|
| 2277 | + if (source == resetMeshItem) |
---|
2175 | 2278 | { |
---|
2176 | 2279 | ResetAll(); |
---|
2177 | 2280 | } else |
---|
2178 | | - if (event.getSource() == stepAllItem) |
---|
| 2281 | + if (source == stepAllItem) |
---|
2179 | 2282 | { |
---|
2180 | 2283 | StepAll(); |
---|
2181 | 2284 | } else |
---|
2182 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2285 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2183 | 2286 | { |
---|
2184 | 2287 | //int indices[] = jList.getSelectedIndices(); |
---|
2185 | 2288 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2187 | 2290 | |
---|
2188 | 2291 | ClearSelection(false); |
---|
2189 | 2292 | } else |
---|
2190 | | - if (event.getSource() == clearAllItem) |
---|
| 2293 | + if (source == clearAllItem) |
---|
2191 | 2294 | { |
---|
2192 | 2295 | ClearSelection(true); |
---|
2193 | 2296 | } else |
---|
2194 | | - if (event.getSource() == grabItem) |
---|
| 2297 | + if (source == grabItem) |
---|
2195 | 2298 | { |
---|
2196 | 2299 | group(new cGroup(), true); |
---|
2197 | 2300 | } else |
---|
2198 | | - if (event.getSource() == hideItem) |
---|
| 2301 | + if (source == hideItem) |
---|
2199 | 2302 | { |
---|
2200 | 2303 | group(new HiddenObject()); |
---|
2201 | 2304 | } else |
---|
2202 | | - if (event.getSource() == frontItem) |
---|
| 2305 | + if (source == frontItem) |
---|
2203 | 2306 | { |
---|
2204 | 2307 | front(); |
---|
2205 | 2308 | } else |
---|
2206 | | - if (event.getSource() == backItem) |
---|
| 2309 | + if (source == backItem) |
---|
2207 | 2310 | { |
---|
2208 | 2311 | back(); |
---|
2209 | 2312 | } else |
---|
2210 | | - if (event.getSource() == cameraItem) |
---|
| 2313 | + if (source == cameraItem) |
---|
2211 | 2314 | { |
---|
2212 | 2315 | makeSomething(new Camera()); |
---|
2213 | 2316 | } else |
---|
2214 | | - if (event.getSource() == compositeItem) |
---|
| 2317 | + if (source == compositeItem) |
---|
2215 | 2318 | { |
---|
2216 | 2319 | group(new Composite()); |
---|
2217 | 2320 | } else |
---|
2218 | | - if (event.getSource() == randomItem) |
---|
| 2321 | + if (source == randomItem) |
---|
2219 | 2322 | { |
---|
2220 | 2323 | RandomNode random = new RandomNode(); |
---|
2221 | 2324 | group(random); |
---|
2222 | 2325 | if (random.size() > 0) |
---|
2223 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2326 | + random.name = random.get(0).name + "Switch"; |
---|
2224 | 2327 | } else |
---|
2225 | | - if (event.getSource() == physicsItem) |
---|
| 2328 | + if (source == physicsItem) |
---|
2226 | 2329 | { |
---|
2227 | 2330 | group(new PhysicsNode()); |
---|
2228 | 2331 | } else |
---|
2229 | | - if (event.getSource() == frameselectorItem) |
---|
| 2332 | + if (source == frameselectorItem) |
---|
2230 | 2333 | { |
---|
2231 | 2334 | for (int i=0; i<group.selection.size(); i++) |
---|
2232 | 2335 | { |
---|
.. | .. |
---|
2238 | 2341 | ResetModel(); |
---|
2239 | 2342 | refreshContents(); |
---|
2240 | 2343 | } else |
---|
2241 | | - if (event.getSource() == switchGeoItem) |
---|
| 2344 | + if (source == switchGeoItem) |
---|
2242 | 2345 | { |
---|
2243 | 2346 | for (int i=0; i<group.selection.size(); i++) |
---|
2244 | 2347 | { |
---|
.. | .. |
---|
2250 | 2353 | ResetModel(); |
---|
2251 | 2354 | refreshContents(); |
---|
2252 | 2355 | } else |
---|
2253 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2356 | + if (source == switchTransfoItem) |
---|
2254 | 2357 | { |
---|
2255 | 2358 | for (int i=0; i<group.selection.size(); i++) |
---|
2256 | 2359 | { |
---|
.. | .. |
---|
2262 | 2365 | ResetModel(); |
---|
2263 | 2366 | refreshContents(); |
---|
2264 | 2367 | } else |
---|
2265 | | - if (event.getSource() == morphItem) |
---|
| 2368 | + if (source == morphItem) |
---|
2266 | 2369 | { |
---|
2267 | 2370 | for (int i=0; i<group.selection.size(); i++) |
---|
2268 | 2371 | { |
---|
.. | .. |
---|
2274 | 2377 | ResetModel(); |
---|
2275 | 2378 | refreshContents(); |
---|
2276 | 2379 | } else |
---|
2277 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2380 | + if (source == scriptNodeItem) |
---|
2278 | 2381 | { |
---|
2279 | 2382 | boolean atleastone = false; |
---|
2280 | 2383 | |
---|
.. | .. |
---|
2313 | 2416 | } |
---|
2314 | 2417 | } |
---|
2315 | 2418 | } else |
---|
2316 | | - if (event.getSource() == linkerItem) |
---|
| 2419 | + if (source == linkerItem) |
---|
2317 | 2420 | { |
---|
2318 | 2421 | group(new cLinker()); |
---|
2319 | 2422 | } else |
---|
2320 | | - if (event.getSource() == textureItem) |
---|
| 2423 | + if (source == textureItem) |
---|
2321 | 2424 | { |
---|
2322 | 2425 | group(new TextureNode()); |
---|
2323 | 2426 | } else |
---|
2324 | | - if (event.getSource() == billboardItem) |
---|
| 2427 | + if (source == billboardItem) |
---|
2325 | 2428 | { |
---|
2326 | 2429 | group(new BillboardNode()); |
---|
2327 | 2430 | } else |
---|
2328 | | - if (event.getSource() == shadowXItem) |
---|
| 2431 | + if (source == shadowXItem) |
---|
2329 | 2432 | { |
---|
2330 | 2433 | CastShadow(0); |
---|
2331 | 2434 | } else |
---|
2332 | | - if (event.getSource() == shadowYItem) |
---|
| 2435 | + if (source == shadowYItem) |
---|
2333 | 2436 | { |
---|
2334 | 2437 | CastShadow(1); |
---|
2335 | 2438 | } else |
---|
2336 | | - if (event.getSource() == shadowZItem) |
---|
| 2439 | + if (source == shadowZItem) |
---|
2337 | 2440 | { |
---|
2338 | 2441 | CastShadow(2); |
---|
2339 | 2442 | } else |
---|
2340 | | - if (event.getSource() == ungroupItem) |
---|
| 2443 | + if (source == ungroupItem) |
---|
2341 | 2444 | { |
---|
2342 | 2445 | //ungroup(); |
---|
2343 | 2446 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2349 | 2452 | |
---|
2350 | 2453 | refreshContents(); |
---|
2351 | 2454 | } else |
---|
2352 | | - if (event.getSource() == genUVItem) |
---|
| 2455 | + if (source == genUVItem) |
---|
2353 | 2456 | { |
---|
2354 | 2457 | GenUV(); |
---|
2355 | 2458 | } else |
---|
2356 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2459 | + if (source == genNormalsCADItem) |
---|
2357 | 2460 | { |
---|
2358 | 2461 | GenNormals(true); |
---|
2359 | 2462 | } else |
---|
2360 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 2463 | + if (source == genNormalsMESHItem) |
---|
2361 | 2464 | { |
---|
2362 | 2465 | GenNormals(true); // TODO |
---|
2363 | 2466 | } else |
---|
2364 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2467 | + if (source == genNormalsORGANItem) |
---|
2365 | 2468 | { |
---|
2366 | 2469 | GenNormals(false); |
---|
2367 | 2470 | } else |
---|
2368 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 2471 | + if (source == genNormalsMINEItem) |
---|
2369 | 2472 | { |
---|
2370 | 2473 | GenNormalsMINE(); |
---|
2371 | 2474 | } else |
---|
2372 | | - if (event.getSource() == stripifyItem) |
---|
| 2475 | + if (source == stripifyItem) |
---|
2373 | 2476 | { |
---|
2374 | 2477 | Stripify(); |
---|
2375 | 2478 | } else |
---|
2376 | | - if (event.getSource() == unstripifyItem) |
---|
| 2479 | + if (source == unstripifyItem) |
---|
2377 | 2480 | { |
---|
2378 | 2481 | Unstripify(); |
---|
2379 | 2482 | } else |
---|
2380 | | - if (event.getSource() == trimItem) |
---|
| 2483 | + if (source == trimItem) |
---|
2381 | 2484 | { |
---|
2382 | 2485 | Trim(); |
---|
2383 | 2486 | } else |
---|
2384 | | - if (event.getSource() == untrimItem) |
---|
| 2487 | + if (source == untrimItem) |
---|
2385 | 2488 | { |
---|
2386 | 2489 | Untrim(); |
---|
2387 | 2490 | } else |
---|
2388 | | - if (event.getSource() == clearColorsItem) |
---|
| 2491 | + if (source == clearColorsItem) |
---|
2389 | 2492 | { |
---|
2390 | 2493 | ClearColors(); |
---|
2391 | 2494 | } else |
---|
2392 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2495 | + if (source == clearMaterialsItem) |
---|
2393 | 2496 | { |
---|
2394 | 2497 | ClearMaterials(); |
---|
2395 | 2498 | } else |
---|
2396 | | - if (event.getSource() == liveleavesItem) |
---|
| 2499 | + if (source == liveleavesItem) |
---|
2397 | 2500 | { |
---|
2398 | 2501 | LiveLeaves(true); |
---|
2399 | 2502 | } else |
---|
2400 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2503 | + if (source == unliveleavesItem) |
---|
2401 | 2504 | { |
---|
2402 | 2505 | LiveLeaves(false); |
---|
2403 | 2506 | } else |
---|
2404 | | - if (event.getSource() == supportleavesItem) |
---|
| 2507 | + if (source == supportleavesItem) |
---|
2405 | 2508 | { |
---|
2406 | 2509 | SupportLeaves(true); |
---|
2407 | 2510 | } else |
---|
2408 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2511 | + if (source == unsupportleavesItem) |
---|
2409 | 2512 | { |
---|
2410 | 2513 | SupportLeaves(false); |
---|
2411 | 2514 | } else |
---|
2412 | | - if (event.getSource() == hideleavesItem) |
---|
| 2515 | + if (source == hideleavesItem) |
---|
2413 | 2516 | { |
---|
2414 | 2517 | HideLeaves(true); |
---|
2415 | 2518 | } else |
---|
2416 | | - if (event.getSource() == showleavesItem) |
---|
| 2519 | + if (source == showleavesItem) |
---|
2417 | 2520 | { |
---|
2418 | 2521 | HideLeaves(false); |
---|
2419 | 2522 | } else |
---|
2420 | | - if (event.getSource() == markleavesItem) |
---|
| 2523 | + if (source == markleavesItem) |
---|
2421 | 2524 | { |
---|
2422 | 2525 | MarkLeaves(true); |
---|
2423 | 2526 | } else |
---|
2424 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2527 | + if (source == unmarkleavesItem) |
---|
2425 | 2528 | { |
---|
2426 | 2529 | MarkLeaves(false); |
---|
2427 | 2530 | } else |
---|
2428 | | - if (event.getSource() == flipVItem) |
---|
| 2531 | + if (source == flipVItem) |
---|
2429 | 2532 | { |
---|
2430 | 2533 | FlipV(true); |
---|
2431 | 2534 | } else |
---|
2432 | | - if (event.getSource() == unflipVItem) |
---|
| 2535 | + if (source == unflipVItem) |
---|
2433 | 2536 | { |
---|
2434 | 2537 | FlipV(false); |
---|
2435 | 2538 | } else |
---|
2436 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2539 | + if (source == lowTexturesItem) |
---|
2437 | 2540 | { |
---|
2438 | 2541 | SetTexRes(0); |
---|
2439 | 2542 | } else |
---|
2440 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2543 | + if (source == normalTexturesItem) |
---|
2441 | 2544 | { |
---|
2442 | 2545 | SetTexRes(1); |
---|
2443 | 2546 | } else |
---|
2444 | | - if (event.getSource() == highTexturesItem) |
---|
| 2547 | + if (source == highTexturesItem) |
---|
2445 | 2548 | { |
---|
2446 | 2549 | SetTexRes(2); |
---|
2447 | 2550 | } else |
---|
2448 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2551 | + if (source == veryhighTexturesItem) |
---|
2449 | 2552 | { |
---|
2450 | 2553 | SetTexRes(3); |
---|
2451 | 2554 | } else |
---|
2452 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2555 | + if (source == maxTexturesItem) |
---|
2453 | 2556 | { |
---|
2454 | 2557 | SetTexRes(4); |
---|
2455 | 2558 | } else |
---|
2456 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2559 | + if (source == panoTexturesItem) |
---|
2457 | 2560 | { |
---|
2458 | 2561 | SetTexRes(5); |
---|
2459 | 2562 | } else |
---|
2460 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2563 | + if (source == reverseNormalsItem) |
---|
2461 | 2564 | { |
---|
2462 | 2565 | ReverseNormals(); |
---|
2463 | 2566 | } else |
---|
2464 | | - if (event.getSource() == parseverticesItem) |
---|
| 2567 | + if (source == parseverticesItem) |
---|
2465 | 2568 | { |
---|
2466 | 2569 | ParseVertices(); |
---|
2467 | 2570 | } else |
---|
2468 | | - if (event.getSource() == textureFieldItem) |
---|
| 2571 | + if (source == textureFieldItem) |
---|
2469 | 2572 | { |
---|
2470 | 2573 | TextureVertices(); |
---|
2471 | 2574 | } else |
---|
2472 | | - if (event.getSource() == alignItem) |
---|
| 2575 | + if (source == alignItem) |
---|
2473 | 2576 | { |
---|
2474 | 2577 | Align(); |
---|
2475 | 2578 | } else |
---|
2476 | | - if (event.getSource() == mirrorItem) |
---|
| 2579 | + if (source == mirrorItem) |
---|
2477 | 2580 | { |
---|
2478 | 2581 | MirrorPoses(); |
---|
2479 | 2582 | } else |
---|
2480 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2583 | + if (source == reduceMorphItem) |
---|
2481 | 2584 | { |
---|
2482 | 2585 | MeshReduction(false); |
---|
2483 | 2586 | } else |
---|
2484 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2587 | + if (source == reduce34MorphItem) |
---|
2485 | 2588 | { |
---|
2486 | 2589 | MeshReduction(true); |
---|
2487 | 2590 | } else |
---|
2488 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2591 | + if (source == reverseTrianglesItem) |
---|
2489 | 2592 | { |
---|
2490 | 2593 | ReverseTriangles(); |
---|
2491 | 2594 | } else |
---|
2492 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2595 | + if (source == reduceMeshItem) |
---|
2493 | 2596 | { |
---|
2494 | 2597 | ReduceMesh(false); |
---|
2495 | 2598 | } else |
---|
2496 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2599 | + if (source == reduce34MeshItem) |
---|
2497 | 2600 | { |
---|
2498 | 2601 | ReduceMesh(true); |
---|
2499 | 2602 | } else |
---|
2500 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2603 | + if (source == increaseMeshItem) |
---|
2501 | 2604 | { |
---|
2502 | 2605 | IncreaseMesh(); |
---|
2503 | 2606 | } else |
---|
2504 | | - if (event.getSource() == clipMeshItem) |
---|
| 2607 | + if (source == clipMeshItem) |
---|
2505 | 2608 | { |
---|
2506 | 2609 | ClipMesh(); |
---|
2507 | 2610 | } else |
---|
2508 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2611 | + if (source == smoothMeshItem) |
---|
2509 | 2612 | { |
---|
2510 | 2613 | SmoothMesh(); |
---|
2511 | 2614 | } else |
---|
2512 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2615 | + if (source == transformgeometryItem) |
---|
2513 | 2616 | { |
---|
2514 | 2617 | TransformGeometry(); |
---|
2515 | 2618 | } else |
---|
2516 | | - if (event.getSource() == resetTransformItem) |
---|
| 2619 | + if (source == resetTransformItem) |
---|
2517 | 2620 | { |
---|
2518 | 2621 | ResetTransform(); |
---|
2519 | 2622 | } else |
---|
2520 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2623 | + if (source == resetCentroidItem) |
---|
2521 | 2624 | { |
---|
2522 | 2625 | ResetCentroid(); |
---|
2523 | 2626 | } else |
---|
2524 | | - if (event.getSource() == resetParentItem) |
---|
| 2627 | + if (source == resetParentItem) |
---|
2525 | 2628 | { |
---|
2526 | 2629 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2527 | 2630 | { |
---|
.. | .. |
---|
2531 | 2634 | |
---|
2532 | 2635 | refreshContents(); |
---|
2533 | 2636 | } else |
---|
2534 | | - if (event.getSource() == repairParentItem) |
---|
| 2637 | + if (source == repairParentItem) |
---|
2535 | 2638 | { |
---|
2536 | 2639 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2537 | 2640 | { |
---|
.. | .. |
---|
2545 | 2648 | |
---|
2546 | 2649 | refreshContents(); |
---|
2547 | 2650 | } else |
---|
2548 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2651 | + if (source == repairShadowItem) |
---|
| 2652 | + { |
---|
| 2653 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2654 | + { |
---|
| 2655 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2656 | + obj.RepairShadow(); |
---|
| 2657 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2658 | +// { |
---|
| 2659 | +// obj.get(i).parent = obj; |
---|
| 2660 | +// } |
---|
| 2661 | + } |
---|
| 2662 | + |
---|
| 2663 | + refreshContents(); |
---|
| 2664 | + } else |
---|
| 2665 | + if (source == sortbysizeItem) |
---|
2549 | 2666 | { |
---|
2550 | 2667 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2551 | 2668 | { |
---|
.. | .. |
---|
2557 | 2674 | ResetModel(); |
---|
2558 | 2675 | refreshContents(); |
---|
2559 | 2676 | } else |
---|
2560 | | - if (event.getSource() == sortbynameItem) |
---|
| 2677 | + if (source == sortbynameItem) |
---|
2561 | 2678 | { |
---|
2562 | 2679 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2563 | 2680 | { |
---|
.. | .. |
---|
2569 | 2686 | ResetModel(); |
---|
2570 | 2687 | refreshContents(); |
---|
2571 | 2688 | } else |
---|
2572 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2689 | + if (source == attachPigmentItem) |
---|
2573 | 2690 | { |
---|
2574 | 2691 | String texture = GetFile("Attach pigment"); |
---|
2575 | 2692 | Object3D obj; |
---|
.. | .. |
---|
2581 | 2698 | |
---|
2582 | 2699 | refreshContents(); |
---|
2583 | 2700 | } else |
---|
2584 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2701 | + if (source == detachPigmentItem) |
---|
2585 | 2702 | { |
---|
2586 | 2703 | Object3D obj; |
---|
2587 | 2704 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2592 | 2709 | |
---|
2593 | 2710 | refreshContents(); |
---|
2594 | 2711 | } else |
---|
2595 | | - if (event.getSource() == attachBumpItem) |
---|
| 2712 | + if (source == attachBumpItem) |
---|
2596 | 2713 | { |
---|
2597 | 2714 | String texture = GetFile("Attach bump"); |
---|
2598 | 2715 | Object3D obj; |
---|
.. | .. |
---|
2604 | 2721 | |
---|
2605 | 2722 | refreshContents(); |
---|
2606 | 2723 | } else |
---|
2607 | | - if (event.getSource() == detachBumpItem) |
---|
| 2724 | + if (source == detachBumpItem) |
---|
2608 | 2725 | { |
---|
2609 | 2726 | Object3D obj; |
---|
2610 | 2727 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2615 | 2732 | |
---|
2616 | 2733 | refreshContents(); |
---|
2617 | 2734 | } else |
---|
2618 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2735 | + if (source == pigmentBumpItem) |
---|
2619 | 2736 | { |
---|
2620 | 2737 | Object3D obj; |
---|
2621 | 2738 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2626 | 2743 | |
---|
2627 | 2744 | refreshContents(); |
---|
2628 | 2745 | } else |
---|
2629 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2746 | + if (source == flashSelectionButton) |
---|
2630 | 2747 | { |
---|
2631 | 2748 | CameraPane.flash = true; |
---|
2632 | 2749 | refreshContents(); |
---|
2633 | 2750 | } else |
---|
2634 | | - if (event.getSource() == oneButton) |
---|
| 2751 | + if (source == oneButton) |
---|
2635 | 2752 | { |
---|
2636 | 2753 | } else |
---|
2637 | | - if (event.getSource() == twoButton) |
---|
| 2754 | + if (source == twoButton) |
---|
2638 | 2755 | { |
---|
2639 | 2756 | radio.layout = twoButton; |
---|
2640 | 2757 | // bug |
---|
2641 | 2758 | //gridPanel.setDividerLocation(1.0); |
---|
2642 | 2759 | //bigPanel.setDividerLocation(0.0); |
---|
2643 | | - bigThree.remove(scenePanel); |
---|
2644 | | - bigThree.remove(centralPanel); |
---|
2645 | | - bigThree.remove(XYZPanel); |
---|
2646 | | - aWindowConstraints.gridx = 0; |
---|
2647 | | - aWindowConstraints.gridy = 0; |
---|
2648 | | - aWindowConstraints.gridwidth = 1; |
---|
2649 | | - // aConstraints.gridheight = 3; |
---|
2650 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2651 | | - aWindowConstraints.weightx = 0; |
---|
2652 | | - aWindowConstraints.weighty = 1; |
---|
2653 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2654 | | - aWindowConstraints.weightx = 1; |
---|
2655 | | - aWindowConstraints.gridwidth = 3; |
---|
2656 | | - // aConstraints.gridheight = 3; |
---|
2657 | | - aWindowConstraints.gridx = 1; |
---|
2658 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2659 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2660 | | - aWindowConstraints.weightx = 0; |
---|
2661 | | - aWindowConstraints.gridx = 4; |
---|
2662 | | - aWindowConstraints.gridwidth = 1; |
---|
2663 | | - // aConstraints.gridheight = 3; |
---|
2664 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2665 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2666 | | - bigThree.revalidate(); |
---|
| 2760 | +// bigThree.remove(scenePanel); |
---|
| 2761 | +// bigThree.remove(centralPanel); |
---|
| 2762 | +// bigThree.remove(XYZPanel); |
---|
| 2763 | +// aWindowConstraints.gridx = 0; |
---|
| 2764 | +// aWindowConstraints.gridy = 0; |
---|
| 2765 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2766 | +// // aConstraints.gridheight = 3; |
---|
| 2767 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2768 | +// aWindowConstraints.weightx = 0; |
---|
| 2769 | +// aWindowConstraints.weighty = 1; |
---|
| 2770 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2771 | +// aWindowConstraints.weightx = 1; |
---|
| 2772 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2773 | +// // aConstraints.gridheight = 3; |
---|
| 2774 | +// aWindowConstraints.gridx = 1; |
---|
| 2775 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2776 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2777 | +// aWindowConstraints.weightx = 0; |
---|
| 2778 | +// aWindowConstraints.gridx = 4; |
---|
| 2779 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2780 | +// // aConstraints.gridheight = 3; |
---|
| 2781 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2782 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2783 | +// scenePanel.setVisible(false); |
---|
| 2784 | +// centralPanel.setVisible(true); |
---|
| 2785 | +// XYZPanel.setVisible(false); |
---|
| 2786 | + bigThree.ClearUI(); |
---|
| 2787 | + bigThree.add(centralPanel); |
---|
| 2788 | + bigThree.FlushUI(); |
---|
2667 | 2789 | } else |
---|
2668 | | - if (event.getSource() == threeButton) |
---|
| 2790 | + if (source == threeButton) |
---|
2669 | 2791 | { |
---|
2670 | 2792 | radio.layout = threeButton; |
---|
2671 | | - bigThree.remove(scenePanel); |
---|
2672 | | - bigThree.remove(centralPanel); |
---|
2673 | | - bigThree.remove(XYZPanel); |
---|
2674 | | - aWindowConstraints.gridx = 0; |
---|
2675 | | - aWindowConstraints.gridy = 0; |
---|
2676 | | - aWindowConstraints.gridwidth = 1; |
---|
2677 | | - // aConstraints.gridheight = 3; |
---|
2678 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2679 | | - aWindowConstraints.weightx = 0; |
---|
2680 | | - aWindowConstraints.weighty = 1; |
---|
2681 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2682 | | - aWindowConstraints.weightx = 1; |
---|
2683 | | - aWindowConstraints.gridwidth = 3; |
---|
2684 | | - // aConstraints.gridheight = 3; |
---|
2685 | | - aWindowConstraints.gridx = 1; |
---|
2686 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2687 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2688 | | - aWindowConstraints.weightx = 0; |
---|
2689 | | - aWindowConstraints.gridx = 4; |
---|
2690 | | - aWindowConstraints.gridwidth = 1; |
---|
2691 | | - // aConstraints.gridheight = 3; |
---|
2692 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2693 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2694 | | - bigThree.revalidate(); |
---|
| 2793 | + |
---|
| 2794 | +// bigThree.remove(scenePanel); |
---|
| 2795 | +// bigThree.remove(centralPanel); |
---|
| 2796 | +// bigThree.remove(XYZPanel); |
---|
| 2797 | +// aWindowConstraints.gridx = 0; |
---|
| 2798 | +// aWindowConstraints.gridy = 0; |
---|
| 2799 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2800 | +// // aConstraints.gridheight = 3; |
---|
| 2801 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2802 | +// aWindowConstraints.weightx = 0; |
---|
| 2803 | +// aWindowConstraints.weighty = 1; |
---|
| 2804 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2805 | +// aWindowConstraints.weightx = 1; |
---|
| 2806 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2807 | +// // aConstraints.gridheight = 3; |
---|
| 2808 | +// aWindowConstraints.gridx = 1; |
---|
| 2809 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2810 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2811 | +// aWindowConstraints.weightx = 0; |
---|
| 2812 | +// aWindowConstraints.gridx = 4; |
---|
| 2813 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2814 | +// // aConstraints.gridheight = 3; |
---|
| 2815 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2816 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2817 | +// bigThree.validate(); |
---|
| 2818 | +// scenePanel.setVisible(false); |
---|
| 2819 | +// centralPanel.setVisible(true); |
---|
| 2820 | +// XYZPanel.setVisible(true); |
---|
| 2821 | + bigThree.ClearUI(); |
---|
| 2822 | + bigThree.add(centralPanel); |
---|
| 2823 | + bigThree.add(XYZPanel); |
---|
| 2824 | + bigThree.FlushUI(); |
---|
2695 | 2825 | } else |
---|
2696 | | - if (event.getSource() == fourButton) |
---|
| 2826 | + if (source == fourButton) |
---|
2697 | 2827 | { |
---|
2698 | 2828 | radio.layout = fourButton; |
---|
2699 | | - bigThree.remove(scenePanel); |
---|
2700 | | - bigThree.remove(centralPanel); |
---|
2701 | | - bigThree.remove(XYZPanel); |
---|
2702 | | - aWindowConstraints.gridx = 0; |
---|
2703 | | - aWindowConstraints.gridy = 0; |
---|
2704 | | - aWindowConstraints.gridwidth = 1; |
---|
2705 | | - // aWindowConstraints.gridheight = 3; |
---|
2706 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2707 | | - aWindowConstraints.weightx = 1; |
---|
2708 | | - aWindowConstraints.weighty = 1; |
---|
2709 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2710 | | - aWindowConstraints.weightx = 1; |
---|
2711 | | - aWindowConstraints.gridwidth = 3; |
---|
2712 | | - // aConstraints.gridheight = 3; |
---|
2713 | | - aWindowConstraints.gridx = 1; |
---|
2714 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2715 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2716 | | - aWindowConstraints.weightx = 0; |
---|
2717 | | - aWindowConstraints.gridx = 4; |
---|
2718 | | - aWindowConstraints.gridwidth = 1; |
---|
2719 | | - // aWindowConstraints.gridheight = 3; |
---|
2720 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2721 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2722 | | - bigThree.revalidate(); |
---|
| 2829 | + |
---|
| 2830 | +// bigThree.remove(scenePanel); |
---|
| 2831 | +// bigThree.remove(centralPanel); |
---|
| 2832 | +// bigThree.remove(XYZPanel); |
---|
| 2833 | +// aWindowConstraints.gridx = 0; |
---|
| 2834 | +// aWindowConstraints.gridy = 0; |
---|
| 2835 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2836 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2837 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2838 | +// aWindowConstraints.weightx = 1; |
---|
| 2839 | +// aWindowConstraints.weighty = 1; |
---|
| 2840 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2841 | +// aWindowConstraints.weightx = 1; |
---|
| 2842 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2843 | +// // aConstraints.gridheight = 3; |
---|
| 2844 | +// aWindowConstraints.gridx = 1; |
---|
| 2845 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2846 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2847 | +// aWindowConstraints.weightx = 0; |
---|
| 2848 | +// aWindowConstraints.gridx = 4; |
---|
| 2849 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2850 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2851 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2852 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2853 | +// bigThree.validate(); |
---|
| 2854 | +// scenePanel.setVisible(true); |
---|
| 2855 | +// centralPanel.setVisible(false); |
---|
| 2856 | +// XYZPanel.setVisible(false); |
---|
| 2857 | + bigThree.ClearUI(); |
---|
| 2858 | + bigThree.add(scenePanel); |
---|
| 2859 | + bigThree.FlushUI(); |
---|
2723 | 2860 | } else |
---|
2724 | | - if (event.getSource() == sixButton) |
---|
| 2861 | + if (source == sixButton) |
---|
2725 | 2862 | { |
---|
2726 | 2863 | radio.layout = sixButton; |
---|
2727 | | - bigThree.remove(scenePanel); |
---|
2728 | | - bigThree.remove(centralPanel); |
---|
2729 | | - bigThree.remove(XYZPanel); |
---|
2730 | | - aWindowConstraints.gridx = 0; |
---|
2731 | | - aWindowConstraints.gridy = 0; |
---|
2732 | | - aWindowConstraints.gridwidth = 1; |
---|
2733 | | - // aConstraints.gridheight = 3; |
---|
2734 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2735 | | - aWindowConstraints.weightx = 0; |
---|
2736 | | - aWindowConstraints.weighty = 1; |
---|
2737 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2738 | | - aWindowConstraints.weightx = 1; |
---|
2739 | | - aWindowConstraints.gridwidth = 3; |
---|
2740 | | - // aWindowConstraints.gridheight = 3; |
---|
2741 | | - aWindowConstraints.gridx = 1; |
---|
2742 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2743 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2744 | | - aWindowConstraints.weightx = 0; |
---|
2745 | | - aWindowConstraints.gridx = 4; |
---|
2746 | | - aWindowConstraints.gridwidth = 1; |
---|
2747 | | - // aWindowConstraints.gridheight = 3; |
---|
2748 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2749 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2750 | | - bigThree.revalidate(); |
---|
| 2864 | + |
---|
| 2865 | +// bigThree.remove(scenePanel); |
---|
| 2866 | +// bigThree.remove(centralPanel); |
---|
| 2867 | +// bigThree.remove(XYZPanel); |
---|
| 2868 | +// aWindowConstraints.gridx = 0; |
---|
| 2869 | +// aWindowConstraints.gridy = 0; |
---|
| 2870 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2871 | +// // aConstraints.gridheight = 3; |
---|
| 2872 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2873 | +// aWindowConstraints.weightx = 0; |
---|
| 2874 | +// aWindowConstraints.weighty = 1; |
---|
| 2875 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2876 | +// aWindowConstraints.weightx = 1; |
---|
| 2877 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2878 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2879 | +// aWindowConstraints.gridx = 1; |
---|
| 2880 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2881 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2882 | +// aWindowConstraints.weightx = 0; |
---|
| 2883 | +// aWindowConstraints.gridx = 4; |
---|
| 2884 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2885 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2886 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2887 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2888 | +// bigThree.validate(); |
---|
| 2889 | +// scenePanel.setVisible(true); |
---|
| 2890 | +// centralPanel.setVisible(true); |
---|
| 2891 | +// XYZPanel.setVisible(false); |
---|
| 2892 | + bigThree.ClearUI(); |
---|
| 2893 | + bigThree.add(scenePanel); |
---|
| 2894 | + bigThree.add(centralPanel); |
---|
| 2895 | + bigThree.FlushUI(); |
---|
2751 | 2896 | } else |
---|
2752 | | - if (event.getSource() == sevenButton) |
---|
| 2897 | + if (source == sevenButton) |
---|
2753 | 2898 | { |
---|
2754 | 2899 | radio.layout = sevenButton; |
---|
2755 | | - bigThree.remove(scenePanel); |
---|
2756 | | - bigThree.remove(centralPanel); |
---|
2757 | | - bigThree.remove(XYZPanel); |
---|
2758 | | - aWindowConstraints.gridx = 0; |
---|
2759 | | - aWindowConstraints.gridy = 0; |
---|
2760 | | - aWindowConstraints.gridwidth = 1; |
---|
2761 | | - // aWindowConstraints.gridheight = 3; |
---|
2762 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2763 | | - aWindowConstraints.weightx = 0; |
---|
2764 | | - aWindowConstraints.weighty = 1; |
---|
2765 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2766 | | - aWindowConstraints.weightx = 1; |
---|
2767 | | - aWindowConstraints.gridwidth = 3; |
---|
2768 | | - // aWindowConstraints.gridheight = 3; |
---|
2769 | | - aWindowConstraints.gridx = 1; |
---|
2770 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2771 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2772 | | - aWindowConstraints.weightx = 0; |
---|
2773 | | - aWindowConstraints.gridx = 4; |
---|
2774 | | - aWindowConstraints.gridwidth = 1; |
---|
2775 | | - // aConstraints.gridheight = 3; |
---|
2776 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2777 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2778 | | - bigThree.revalidate(); |
---|
| 2900 | + |
---|
| 2901 | +// bigThree.remove(scenePanel); |
---|
| 2902 | +// bigThree.remove(centralPanel); |
---|
| 2903 | +// bigThree.remove(XYZPanel); |
---|
| 2904 | +// aWindowConstraints.gridx = 0; |
---|
| 2905 | +// aWindowConstraints.gridy = 0; |
---|
| 2906 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2907 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2908 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2909 | +// aWindowConstraints.weightx = 0; |
---|
| 2910 | +// aWindowConstraints.weighty = 1; |
---|
| 2911 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2912 | +// aWindowConstraints.weightx = 1; |
---|
| 2913 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2914 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2915 | +// aWindowConstraints.gridx = 1; |
---|
| 2916 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2917 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2918 | +// aWindowConstraints.weightx = 0; |
---|
| 2919 | +// aWindowConstraints.gridx = 4; |
---|
| 2920 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2921 | +// // aConstraints.gridheight = 3; |
---|
| 2922 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2923 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2924 | +// bigThree.validate(); |
---|
| 2925 | +// scenePanel.setVisible(true); |
---|
| 2926 | +// centralPanel.setVisible(true); |
---|
| 2927 | +// XYZPanel.setVisible(true); |
---|
| 2928 | + bigThree.ClearUI(); |
---|
| 2929 | + bigThree.add(scenePanel); |
---|
| 2930 | + bigThree.add(centralPanel); |
---|
| 2931 | + bigThree.add(XYZPanel); |
---|
| 2932 | + bigThree.FlushUI(); |
---|
2779 | 2933 | } else |
---|
2780 | | - if (event.getSource() == rootButton) |
---|
| 2934 | + if (source == rootButton) |
---|
2781 | 2935 | { |
---|
2782 | 2936 | Object3D obj; |
---|
2783 | 2937 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2789 | 2943 | |
---|
2790 | 2944 | refreshContents(true); |
---|
2791 | 2945 | } else |
---|
2792 | | - if (event.getSource() == closeButton) |
---|
| 2946 | + if (source == closeButton) |
---|
2793 | 2947 | { |
---|
2794 | 2948 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2795 | 2949 | cRadio ab; |
---|
.. | .. |
---|
2810 | 2964 | } |
---|
2811 | 2965 | refreshContents(true); |
---|
2812 | 2966 | } else |
---|
2813 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 2967 | + if (source == editItem || source == editButton) |
---|
2814 | 2968 | { |
---|
2815 | 2969 | EditSelection(false); |
---|
2816 | 2970 | } else |
---|
2817 | | - if (event.getSource() == uneditButton) |
---|
| 2971 | + if (source == uneditButton) |
---|
2818 | 2972 | { |
---|
2819 | 2973 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2820 | 2974 | { |
---|
.. | .. |
---|
2826 | 2980 | |
---|
2827 | 2981 | child.editWindow = null; // ??????????? |
---|
2828 | 2982 | } |
---|
2829 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 2983 | + objEditor.ctrlPanel.FlushUI(); |
---|
2830 | 2984 | //objEditor.jTree.clearSelection(); |
---|
2831 | 2985 | //objEditor.ResetSliders(); |
---|
2832 | 2986 | refreshContents(true); |
---|
2833 | 2987 | } else |
---|
2834 | | - if (event.getSource() == clearPanelButton) |
---|
| 2988 | + if (source == clearPanelButton) |
---|
2835 | 2989 | { |
---|
2836 | 2990 | assert(copy == group); |
---|
2837 | 2991 | //copy.ClearUI(); |
---|
.. | .. |
---|
2842 | 2996 | listUI.clear(); |
---|
2843 | 2997 | refreshContents(true); |
---|
2844 | 2998 | } else |
---|
2845 | | - if (event.getSource() == allParamsButton) |
---|
| 2999 | + if (source == allParamsButton) |
---|
2846 | 3000 | { |
---|
2847 | 3001 | assert(copy == group); |
---|
2848 | 3002 | |
---|
.. | .. |
---|
2863 | 3017 | |
---|
2864 | 3018 | refreshContents(true); |
---|
2865 | 3019 | } else |
---|
2866 | | - if (event.getSource() == unselectButton) |
---|
| 3020 | + if (source == unselectButton) |
---|
2867 | 3021 | { |
---|
2868 | 3022 | objEditor.jTree.clearSelection(); |
---|
2869 | 3023 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2870 | 3024 | objEditor.ResetSliders(); |
---|
2871 | 3025 | refreshContents(true); |
---|
2872 | 3026 | } else |
---|
2873 | | - if(event.getSource() instanceof cRadio) |
---|
| 3027 | + if(source instanceof cRadio) |
---|
2874 | 3028 | { |
---|
2875 | 3029 | group.parent = keepparent; |
---|
2876 | 3030 | group.attributes = 0; |
---|
2877 | 3031 | //group.editWindow = null; |
---|
2878 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3032 | + /*cRadio*/ radio = (cRadio)source; |
---|
2879 | 3033 | Object3D obj = radio.GetObject(); |
---|
2880 | 3034 | System.out.println("Edit " + obj); |
---|
2881 | 3035 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2895 | 3049 | } |
---|
2896 | 3050 | |
---|
2897 | 3051 | copy = group; |
---|
2898 | | - //CameraPane.theRenderer.object = group; |
---|
| 3052 | + //Globals.theRenderer.object = group; |
---|
2899 | 3053 | if(!useclient) |
---|
2900 | 3054 | { |
---|
2901 | 3055 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2904 | 3058 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2905 | 3059 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2906 | 3060 | cameraView.object = group; |
---|
2907 | | - cameraView.lighttouched = true; |
---|
| 3061 | + //cameraView.lighttouched = true; |
---|
| 3062 | + Globals.lighttouched = true; |
---|
2908 | 3063 | topView.object = group; |
---|
2909 | 3064 | frontView.object = group; |
---|
2910 | 3065 | sideView.object = group; |
---|
.. | .. |
---|
2940 | 3095 | if (useclient) |
---|
2941 | 3096 | { |
---|
2942 | 3097 | cameraView.object = client; |
---|
2943 | | - cameraView.lighttouched = true; |
---|
| 3098 | + Globals.lighttouched = true; |
---|
2944 | 3099 | //topView.object = client; |
---|
2945 | 3100 | //frontView.object = client; |
---|
2946 | 3101 | //sideView.object = client; |
---|
.. | .. |
---|
2948 | 3103 | else |
---|
2949 | 3104 | { |
---|
2950 | 3105 | cameraView.object = group; |
---|
2951 | | - cameraView.lighttouched = true; |
---|
| 3106 | + Globals.lighttouched = true; |
---|
2952 | 3107 | //topView.object = group; |
---|
2953 | 3108 | //frontView.object = group; |
---|
2954 | 3109 | //sideView.object = group; |
---|
.. | .. |
---|
3456 | 3611 | String pigment = Object3D.GetPigment(tex); |
---|
3457 | 3612 | //String bump = Object3D.GetBump(tex); |
---|
3458 | 3613 | |
---|
3459 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3614 | + com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
3460 | 3615 | |
---|
3461 | 3616 | double s = v.s; |
---|
3462 | 3617 | |
---|
.. | .. |
---|
3544 | 3699 | |
---|
3545 | 3700 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3546 | 3701 | |
---|
3547 | | - boolean random = CameraPane.RANDOM; |
---|
3548 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3702 | + boolean random = CameraPane.SWITCH; |
---|
| 3703 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3549 | 3704 | lowres.linkVerticesThis(null); |
---|
3550 | 3705 | lowres.linkVerticesThis(sn); |
---|
3551 | | - CameraPane.RANDOM = random; |
---|
| 3706 | + CameraPane.SWITCH = random; |
---|
3552 | 3707 | |
---|
3553 | 3708 | System.err.flush(); |
---|
3554 | 3709 | |
---|
.. | .. |
---|
3757 | 3912 | group.selection.RelinkToSupport(); // july 2014 |
---|
3758 | 3913 | System.out.println("DONE."); |
---|
3759 | 3914 | refreshContents(); |
---|
3760 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 3915 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3761 | 3916 | } |
---|
3762 | 3917 | |
---|
3763 | 3918 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
4033 | 4188 | System.err.println("info : " + child.GetPath()); |
---|
4034 | 4189 | } |
---|
4035 | 4190 | } |
---|
4036 | | - else |
---|
4037 | | - { |
---|
4038 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4039 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4040 | | - System.err.println("info : " + group.GetPath()); |
---|
4041 | | - } |
---|
| 4191 | +// else |
---|
| 4192 | +// { |
---|
| 4193 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4194 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4195 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4196 | +// } |
---|
4042 | 4197 | |
---|
4043 | 4198 | objEditor.SetText(); // jan 2014 |
---|
4044 | 4199 | |
---|
4045 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4200 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
4046 | 4201 | CameraPane.flash = true; |
---|
4047 | 4202 | |
---|
4048 | 4203 | if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
4049 | 4204 | // a camera |
---|
4050 | 4205 | { |
---|
4051 | 4206 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4052 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
4053 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
4054 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4207 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4208 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4209 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4055 | 4210 | } |
---|
4056 | 4211 | |
---|
4057 | 4212 | refreshContents(); |
---|
.. | .. |
---|
4306 | 4461 | refreshContents(); |
---|
4307 | 4462 | } |
---|
4308 | 4463 | |
---|
4309 | | - void pasteInto(boolean copyit) |
---|
| 4464 | + void pasteInto(boolean copyit, boolean clone) |
---|
4310 | 4465 | { |
---|
4311 | 4466 | // if (GrafreeD.clipboard == null) |
---|
4312 | 4467 | // return; |
---|
.. | .. |
---|
4335 | 4490 | if (copyit) |
---|
4336 | 4491 | { |
---|
4337 | 4492 | // paste(false); |
---|
4338 | | - CloneClipboard(false); // sept 2014 |
---|
| 4493 | + if (clone) |
---|
| 4494 | + { |
---|
| 4495 | + CloneClipboard(false); // sept 2014 |
---|
| 4496 | + } |
---|
| 4497 | + else |
---|
| 4498 | + { |
---|
| 4499 | + paste(false); |
---|
| 4500 | + } |
---|
4339 | 4501 | } |
---|
4340 | 4502 | else |
---|
4341 | 4503 | { |
---|
.. | .. |
---|
4879 | 5041 | cButton flashSelectionButton; |
---|
4880 | 5042 | cButton editButton; |
---|
4881 | 5043 | cButton uneditButton; |
---|
| 5044 | + JCheckBox allParamsButton; |
---|
4882 | 5045 | cButton clearpanelButton; |
---|
4883 | | - cButton allParamsButton; |
---|
4884 | 5046 | cButton unselectButton; |
---|
4885 | 5047 | |
---|
| 5048 | + cButton oneStepButton; |
---|
| 5049 | + |
---|
4886 | 5050 | cButton screenfitButton; |
---|
4887 | 5051 | cButton screenfitpointButton; |
---|
4888 | 5052 | cButton snapobjectButton; |
---|
.. | .. |
---|
4937 | 5101 | private MenuItem mergeGeometriesItem; |
---|
4938 | 5102 | private MenuItem copyItem; |
---|
4939 | 5103 | private MenuItem pasteItem; |
---|
| 5104 | + private MenuItem pasteIntoItem; |
---|
4940 | 5105 | private MenuItem pasteLinkItem; |
---|
4941 | 5106 | private MenuItem pasteCloneItem; |
---|
4942 | 5107 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5009 | 5174 | |
---|
5010 | 5175 | private MenuItem resetParentItem; |
---|
5011 | 5176 | private MenuItem repairParentItem; |
---|
| 5177 | + private MenuItem repairShadowItem; |
---|
5012 | 5178 | private MenuItem sortbysizeItem; |
---|
5013 | 5179 | private MenuItem sortbynameItem; |
---|
5014 | 5180 | |
---|
.. | .. |
---|
5033 | 5199 | private MenuItem blobItem; |
---|
5034 | 5200 | private MenuItem latheItem; |
---|
5035 | 5201 | private MenuItem bezierItem; |
---|
5036 | | - private MenuItem checkerItem; |
---|
| 5202 | + private MenuItem overlayItem; |
---|
5037 | 5203 | private MenuItem meshItem; |
---|
5038 | 5204 | // private MenuItem meshGroupItem; |
---|
5039 | 5205 | private MenuItem springItem; |
---|