.. | .. |
---|
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 | | - oe.aConstraints.gridx += 1; |
---|
524 | | - oe.aConstraints.weighty = 0; |
---|
525 | | - oe.aConstraints.gridwidth = 1; |
---|
526 | 523 | |
---|
527 | | - // |
---|
528 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 524 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 525 | + |
---|
| 526 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 527 | + twoButton.setToolTipText("Show center view only"); |
---|
529 | 528 | twoButton.addActionListener(this); |
---|
530 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 529 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
531 | 530 | fourButton.addActionListener(this); |
---|
532 | | - 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"); |
---|
533 | 534 | sixButton.addActionListener(this); |
---|
534 | | - 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"); |
---|
535 | 537 | threeButton.addActionListener(this); |
---|
536 | | - 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"); |
---|
537 | 540 | sevenButton.addActionListener(this); |
---|
538 | 541 | // |
---|
539 | 542 | |
---|
540 | | - 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"); |
---|
541 | 545 | rootButton.addActionListener(this); |
---|
542 | | - oe.aConstraints.gridx += 1; |
---|
543 | | - 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"); |
---|
544 | 549 | closeButton.addActionListener(this); |
---|
545 | 550 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
546 | 551 | //clearButton.addActionListener(this); |
---|
547 | | - oe.aConstraints.gridx += 1; |
---|
548 | 552 | |
---|
549 | | - oe.aConstraints.gridx = 1; // |
---|
550 | | - 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"); |
---|
551 | 557 | editButton.addActionListener(this); |
---|
552 | | - oe.aConstraints.gridx += 1; |
---|
553 | | - oe.aConstraints.weighty = 0; |
---|
554 | | - oe.aConstraints.gridwidth = 1; |
---|
555 | 558 | |
---|
556 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 559 | + commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 560 | + uneditButton.setToolTipText("Unedit selection"); |
---|
557 | 561 | uneditButton.addActionListener(this); |
---|
558 | 562 | |
---|
559 | | - oe.aConstraints.gridx += 1; |
---|
560 | | - oe.aConstraints.weighty = 0; |
---|
561 | | - oe.aConstraints.gridwidth = 1; |
---|
562 | | - |
---|
563 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
564 | | - clearPanelButton.addActionListener(this); |
---|
565 | | - |
---|
566 | | - oe.aConstraints.gridx += 1; |
---|
567 | | - oe.aConstraints.weighty = 0; |
---|
568 | | - oe.aConstraints.gridwidth = 1; |
---|
569 | | - |
---|
570 | | - 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"); |
---|
571 | 565 | allParamsButton.addActionListener(this); |
---|
572 | 566 | |
---|
573 | | - oe.aConstraints.gridx += 1; |
---|
574 | | - oe.aConstraints.weighty = 0; |
---|
575 | | - oe.aConstraints.gridwidth = 1; |
---|
576 | | - |
---|
577 | | - 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"); |
---|
578 | 573 | unselectButton.addActionListener(this); |
---|
579 | 574 | |
---|
| 575 | + commandsPanel.preferredHeight = 1; |
---|
| 576 | + |
---|
| 577 | + oe.treePanel.add(commandsPanel); |
---|
| 578 | + oe.treePanel.Return(); |
---|
| 579 | + |
---|
580 | 580 | // oe.aConstraints.gridx += 1; |
---|
581 | 581 | // oe.aConstraints.weighty = 0; |
---|
582 | 582 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
588 | 588 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
589 | 589 | // gcButton.addActionListener(this); |
---|
590 | 590 | |
---|
591 | | - oe.aConstraints.gridx = 0; |
---|
592 | | - oe.aConstraints.gridy += 1; |
---|
593 | | - |
---|
594 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
595 | | - oe.aConstraints.gridwidth = 100; |
---|
596 | | - // oe.aConstraints.gridheight = 100; |
---|
597 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
598 | | - oe.aConstraints.gridheight = 1; |
---|
599 | | - oe.aConstraints.weighty = 0.5; |
---|
600 | | - oe.aConstraints.gridx = 0; |
---|
601 | | - JScrollPane jSP; |
---|
| 591 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 592 | + |
---|
| 593 | + JScrollPane jSP; |
---|
602 | 594 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
603 | | - 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); |
---|
604 | 596 | ResetModel(); |
---|
605 | | - oe.aConstraints.weighty = 0.5; |
---|
606 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
607 | | - oe.aConstraints.gridy += 1; |
---|
608 | | - oe.aConstraints.gridwidth = 1; |
---|
| 597 | + |
---|
| 598 | + oe.treePanel.add(jSPPanel); |
---|
| 599 | + oe.treePanel.Return(); |
---|
609 | 600 | |
---|
610 | | - oe.aConstraints.weighty = 0; |
---|
611 | | - oe.aConstraints.gridwidth = 2; |
---|
612 | | - |
---|
613 | | - 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"); |
---|
614 | 605 | colorCB.addItemListener(this); |
---|
615 | | - oe.aConstraints.gridx += 2; |
---|
616 | | - 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"); |
---|
617 | 609 | materialCB.addItemListener(this); |
---|
618 | | - oe.aConstraints.gridx += 2; |
---|
619 | | - 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"); |
---|
620 | 613 | textureCB.addItemListener(this); |
---|
621 | 614 | |
---|
622 | | - oe.aConstraints.gridx = 0; |
---|
623 | | - oe.aConstraints.gridy += 1; |
---|
| 615 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 616 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 617 | + oe.treePanel.Return(); |
---|
624 | 618 | |
---|
| 619 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 620 | +// mainPanel.setResizeWeight(0.5); |
---|
| 621 | + |
---|
625 | 622 | //jList.addListSelectionListener(this); |
---|
626 | 623 | oe.jTree.addTreeSelectionListener(this); |
---|
627 | 624 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
643 | 640 | radio.layout = sevenButton; |
---|
644 | 641 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
645 | 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 | + } |
---|
646 | 715 | |
---|
647 | 716 | void EditObject(Object3D obj) |
---|
648 | 717 | { |
---|
649 | | - cRadio dummyButton = new cRadio(obj.name); |
---|
650 | | - dummyButton.SetObject(obj); |
---|
651 | | - dummyButton.layout = sevenButton; |
---|
652 | | - dummyButton.SetCamera(cameraView.renderCamera, false); |
---|
653 | | - dummyButton.addActionListener(this); |
---|
654 | | - radioPanel.add(dummyButton); |
---|
655 | | - buttonGroup.add(dummyButton); |
---|
656 | | - dummyButton.doClick(); |
---|
| 718 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 719 | + radioButton.SetObject(obj); |
---|
| 720 | + radioButton.layout = sevenButton; |
---|
| 721 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 722 | + radioButton.addActionListener(this); |
---|
| 723 | + radioPanel.add(radioButton); |
---|
| 724 | + buttonGroup.add(radioButton); |
---|
| 725 | + radioButton.doClick(); |
---|
657 | 726 | } |
---|
658 | 727 | void SetupViews(ObjEditor oe) |
---|
659 | 728 | { |
---|
.. | .. |
---|
673 | 742 | JCheckBox fastCB; |
---|
674 | 743 | JCheckBox slowCB; |
---|
675 | 744 | JCheckBox boxCB; |
---|
| 745 | + JCheckBox zoomBoxCB; |
---|
676 | 746 | JCheckBox trackCB; |
---|
677 | 747 | JCheckBox smoothfocusCB; |
---|
678 | 748 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
715 | 785 | dropAttributes |= Object3D.TEXTURE; |
---|
716 | 786 | else |
---|
717 | 787 | dropAttributes &= ~Object3D.TEXTURE; |
---|
718 | | - } |
---|
719 | | - else if(e.getSource() == liveCB) |
---|
| 788 | + } else if(e.getSource() == liveCB) |
---|
720 | 789 | { |
---|
721 | 790 | cameraView.ToggleLive(); |
---|
722 | 791 | } |
---|
.. | .. |
---|
753 | 822 | Recompile(); |
---|
754 | 823 | cameraView.repaint(); |
---|
755 | 824 | // refreshContents(); |
---|
| 825 | + } |
---|
| 826 | + else if(e.getSource() == zoomBoxCB) |
---|
| 827 | + { |
---|
| 828 | + cameraView.ToggleZoomBoxMode(); |
---|
756 | 829 | } |
---|
757 | 830 | else if(e.getSource() == smoothfocusCB) |
---|
758 | 831 | { |
---|
.. | .. |
---|
867 | 940 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
868 | 941 | // return; |
---|
869 | 942 | // } |
---|
870 | | - if (string.charAt(0) == '/') |
---|
| 943 | + |
---|
| 944 | + // File path for Mac and Windows |
---|
| 945 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
871 | 946 | { |
---|
872 | 947 | // file(s) |
---|
873 | 948 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
894 | 969 | |
---|
895 | 970 | flashIt = false; |
---|
896 | 971 | CameraPane pane = (CameraPane) target; |
---|
897 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 972 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
898 | 973 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
899 | 974 | |
---|
900 | 975 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
921 | 996 | { |
---|
922 | 997 | loadClipboard(true); |
---|
923 | 998 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
924 | | - pasteInto(false); |
---|
| 999 | + pasteInto(false, false); |
---|
925 | 1000 | } else { |
---|
926 | 1001 | loadClipboard(false); |
---|
927 | 1002 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
928 | | - pasteInto(false); // true); // ??? |
---|
| 1003 | + pasteInto(false, false); // true); // ??? |
---|
929 | 1004 | } |
---|
930 | 1005 | } |
---|
931 | 1006 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1047 | 1122 | kleinItem.addActionListener(this); |
---|
1048 | 1123 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1049 | 1124 | particleItem.addActionListener(this); |
---|
| 1125 | + if (Globals.ADVANCED) |
---|
| 1126 | + { |
---|
1050 | 1127 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1051 | 1128 | ragdollItem.addActionListener(this); |
---|
1052 | 1129 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1053 | 1130 | ragdoll2Item.addActionListener(this); |
---|
| 1131 | + } |
---|
1054 | 1132 | menu.add("-"); |
---|
1055 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1133 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1056 | 1134 | meshItem.addActionListener(this); |
---|
1057 | 1135 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1058 | 1136 | // meshGroupItem.addActionListener(this); |
---|
| 1137 | + if (Globals.ADVANCED) |
---|
| 1138 | + { |
---|
1059 | 1139 | springItem = menu.add(new MenuItem("Spring")); |
---|
1060 | 1140 | springItem.addActionListener(this); |
---|
1061 | 1141 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1062 | 1142 | flagItem.addActionListener(this); |
---|
1063 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1064 | | - bezierItem.addActionListener(this); |
---|
1065 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1066 | | - checkerItem.addActionListener(this); |
---|
1067 | 1143 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1068 | 1144 | blobItem.addActionListener(this); |
---|
1069 | 1145 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1070 | 1146 | latheItem.addActionListener(this); |
---|
| 1147 | + } |
---|
| 1148 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1149 | + bezierItem.addActionListener(this); |
---|
| 1150 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1151 | + overlayItem.addActionListener(this); |
---|
1071 | 1152 | lightItem = menu.add(new MenuItem("Light")); |
---|
1072 | 1153 | lightItem.addActionListener(this); |
---|
1073 | 1154 | menu.add("-"); |
---|
.. | .. |
---|
1077 | 1158 | loopItem.addActionListener(this); |
---|
1078 | 1159 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1079 | 1160 | doubleItem.addActionListener(this); |
---|
| 1161 | + if (Globals.ADVANCED) |
---|
| 1162 | + { |
---|
1080 | 1163 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1081 | 1164 | tripleItem.addActionListener(this); |
---|
| 1165 | + } |
---|
1082 | 1166 | } |
---|
1083 | 1167 | |
---|
1084 | 1168 | void buildToolsMenu(Menu menu) |
---|
1085 | 1169 | { |
---|
1086 | 1170 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1087 | 1171 | animationItem.addItemListener(this); |
---|
1088 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1172 | + animationItem.setState(Globals.ANIMATION); |
---|
1089 | 1173 | |
---|
1090 | 1174 | menu.add("-"); |
---|
1091 | 1175 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1092 | 1176 | parseverticesItem.addActionListener(this); |
---|
1093 | 1177 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1094 | 1178 | textureFieldItem.addActionListener(this); |
---|
1095 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1179 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1096 | 1180 | alignItem.addActionListener(this); |
---|
1097 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1098 | | - mirrorItem.addActionListener(this); |
---|
1099 | 1181 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1100 | 1182 | reduceMorphItem.addActionListener(this); |
---|
1101 | 1183 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1102 | 1184 | reduce34MorphItem.addActionListener(this); |
---|
1103 | | - |
---|
| 1185 | + menu.add("-"); |
---|
1104 | 1186 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1105 | 1187 | computeAOItem.addActionListener(this); |
---|
1106 | | - menu.add("-"); |
---|
1107 | 1188 | |
---|
| 1189 | + if (Globals.ADVANCED) |
---|
| 1190 | + { |
---|
| 1191 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1192 | + mirrorItem.addActionListener(this); |
---|
| 1193 | + menu.add("-"); |
---|
1108 | 1194 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1109 | 1195 | memoryItem.addActionListener(this); |
---|
1110 | 1196 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1118 | 1204 | resetParentItem.addActionListener(this); |
---|
1119 | 1205 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1120 | 1206 | repairParentItem.addActionListener(this); |
---|
| 1207 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1208 | + repairShadowItem.addActionListener(this); |
---|
1121 | 1209 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1122 | 1210 | invariantsItem.addActionListener(this); |
---|
1123 | 1211 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1125 | 1213 | menu.add("-"); |
---|
1126 | 1214 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1127 | 1215 | editScriptItem.addActionListener(this); |
---|
| 1216 | + } |
---|
1128 | 1217 | } |
---|
1129 | 1218 | |
---|
1130 | 1219 | void ScreenFit() |
---|
.. | .. |
---|
1478 | 1567 | // |
---|
1479 | 1568 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1480 | 1569 | { |
---|
| 1570 | + Object source = event.getSource(); |
---|
1481 | 1571 | /* |
---|
1482 | 1572 | if (event.getSource() == nameField) |
---|
1483 | 1573 | { |
---|
.. | .. |
---|
1489 | 1579 | } |
---|
1490 | 1580 | else |
---|
1491 | 1581 | */ |
---|
1492 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1582 | + if (source == lookAtItem || source == lookFromItem) |
---|
1493 | 1583 | { |
---|
1494 | 1584 | ScreenFit(); |
---|
1495 | 1585 | } else |
---|
1496 | | - if (event.getSource() == switchItem) |
---|
| 1586 | + if (source == switchItem) |
---|
1497 | 1587 | { |
---|
1498 | 1588 | cVector v1 = new cVector(); |
---|
1499 | 1589 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1502 | 1592 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1503 | 1593 | objEditor.cameraView.repaint(); |
---|
1504 | 1594 | } else |
---|
1505 | | - if (event.getSource() == rectoidItem) |
---|
| 1595 | + if (source == rectoidItem) |
---|
1506 | 1596 | { |
---|
1507 | 1597 | makeSomething(new Box()); |
---|
1508 | 1598 | } else |
---|
1509 | | - if (event.getSource() == particleItem) |
---|
| 1599 | + if (source == particleItem) |
---|
1510 | 1600 | { |
---|
1511 | 1601 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1512 | 1602 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1527 | 1617 | applyExample(particleGeom, "SMOKE"); |
---|
1528 | 1618 | makeSomething(particleGeom); |
---|
1529 | 1619 | } else |
---|
1530 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1620 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1531 | 1621 | { |
---|
1532 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1622 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1533 | 1623 | |
---|
1534 | 1624 | ragdoll.toParent = LA.newMatrix(); |
---|
1535 | 1625 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1547 | 1637 | } else |
---|
1548 | 1638 | /* |
---|
1549 | 1639 | */ |
---|
1550 | | - if (event.getSource() == heightFieldItem) |
---|
| 1640 | + if (source == heightFieldItem) |
---|
1551 | 1641 | { |
---|
1552 | 1642 | Object3D obj = new Object3D(); |
---|
1553 | 1643 | |
---|
.. | .. |
---|
1585 | 1675 | |
---|
1586 | 1676 | makeSomething(obj); |
---|
1587 | 1677 | } else |
---|
1588 | | - if (event.getSource() == gridItem) |
---|
| 1678 | + if (source == gridItem) |
---|
1589 | 1679 | { |
---|
1590 | 1680 | makeSomething(new Grid()); |
---|
1591 | 1681 | } else |
---|
1592 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1682 | + if (source == ellipsoidItem) |
---|
1593 | 1683 | { |
---|
1594 | 1684 | makeSomething(new Sphere()); |
---|
1595 | 1685 | } else |
---|
1596 | | - if (event.getSource() == coneItem) |
---|
| 1686 | + if (source == coneItem) |
---|
1597 | 1687 | { |
---|
1598 | 1688 | makeSomething(new Cone()); |
---|
1599 | 1689 | } else |
---|
1600 | | - if (event.getSource() == torusItem) |
---|
| 1690 | + if (source == torusItem) |
---|
1601 | 1691 | { |
---|
1602 | 1692 | makeSomething(new Torus()); |
---|
1603 | 1693 | } else |
---|
1604 | | - if (event.getSource() == superItem) |
---|
| 1694 | + if (source == superItem) |
---|
1605 | 1695 | { |
---|
1606 | 1696 | makeSomething(new Superellipsoid()); |
---|
1607 | 1697 | } else |
---|
1608 | | - if (event.getSource() == kleinItem) |
---|
| 1698 | + if (source == kleinItem) |
---|
1609 | 1699 | { |
---|
1610 | 1700 | makeSomething(new Klein()); |
---|
1611 | 1701 | } else |
---|
1612 | | - if (event.getSource() == blobItem) |
---|
| 1702 | + if (source == blobItem) |
---|
1613 | 1703 | { |
---|
1614 | 1704 | Blob blob = new Blob(); |
---|
1615 | 1705 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1617 | 1707 | //blob.retile(); |
---|
1618 | 1708 | makeSomething(blob); |
---|
1619 | 1709 | } else |
---|
1620 | | - if (event.getSource() == latheItem) |
---|
| 1710 | + if (source == latheItem) |
---|
1621 | 1711 | { |
---|
1622 | 1712 | makeSomething(new Lathe()); |
---|
1623 | 1713 | } else |
---|
1624 | | - if (event.getSource() == bezierItem) |
---|
| 1714 | + if (source == bezierItem) |
---|
1625 | 1715 | { |
---|
1626 | 1716 | makeSomething(new BezierSurface()); |
---|
1627 | 1717 | } else |
---|
1628 | | - if (event.getSource() == checkerItem) |
---|
| 1718 | + if (source == overlayItem) |
---|
1629 | 1719 | { |
---|
1630 | 1720 | /* |
---|
1631 | 1721 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1640 | 1730 | */ |
---|
1641 | 1731 | makeSomething(new Checker()); |
---|
1642 | 1732 | } else |
---|
1643 | | - if (event.getSource() == meshItem) |
---|
| 1733 | + if (source == meshItem) |
---|
1644 | 1734 | { |
---|
1645 | 1735 | Object3D itemtomake = new Object3D(); |
---|
1646 | 1736 | Object3D child; |
---|
.. | .. |
---|
1661 | 1751 | makeSomething(child); |
---|
1662 | 1752 | } |
---|
1663 | 1753 | } else |
---|
1664 | | - if (event.getSource() == springItem) |
---|
| 1754 | + if (source == springItem) |
---|
1665 | 1755 | { |
---|
1666 | 1756 | cSpring s = new cSpring(); |
---|
1667 | 1757 | s.setup(); |
---|
1668 | 1758 | makeSomething(s); |
---|
1669 | 1759 | } else |
---|
1670 | | - if (event.getSource() == flagItem) |
---|
| 1760 | + if (source == flagItem) |
---|
1671 | 1761 | { |
---|
1672 | 1762 | cSpring s = new cFlag(); |
---|
1673 | 1763 | s.setup(); |
---|
1674 | 1764 | makeSomething(s); |
---|
1675 | 1765 | } else |
---|
1676 | | - if (event.getSource() == lightItem) |
---|
| 1766 | + if (source == lightItem) |
---|
1677 | 1767 | { |
---|
1678 | 1768 | makeSomething(new Light()); |
---|
1679 | 1769 | } else |
---|
1680 | | - if (event.getSource() == csgItem) |
---|
| 1770 | + if (source == csgItem) |
---|
1681 | 1771 | { |
---|
1682 | 1772 | group(new CSG()); |
---|
1683 | 1773 | } else |
---|
1684 | | - if (event.getSource() == templateItem) |
---|
| 1774 | + if (source == templateItem) |
---|
1685 | 1775 | { |
---|
1686 | 1776 | group(new cTemplate()); |
---|
1687 | 1777 | } else |
---|
1688 | | - if (event.getSource() == attributeItem) |
---|
| 1778 | + if (source == attributeItem) |
---|
1689 | 1779 | { |
---|
1690 | 1780 | makeSomething(new Attribute()); |
---|
1691 | 1781 | } else |
---|
1692 | | - if (event.getSource() == pointflowItem) |
---|
| 1782 | + if (source == pointflowItem) |
---|
1693 | 1783 | { |
---|
1694 | 1784 | makeSomething(new PointFlow()); |
---|
1695 | 1785 | } else |
---|
.. | .. |
---|
1701 | 1791 | } else |
---|
1702 | 1792 | */ |
---|
1703 | 1793 | |
---|
1704 | | - if (event.getSource() == superLoopItem) |
---|
| 1794 | + if (source == superLoopItem) |
---|
1705 | 1795 | { |
---|
1706 | 1796 | Composite g = new cGroup(); |
---|
1707 | 1797 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1723 | 1813 | |
---|
1724 | 1814 | group(g); |
---|
1725 | 1815 | } else |
---|
1726 | | - if (event.getSource() == loopItem) |
---|
| 1816 | + if (source == loopItem) |
---|
1727 | 1817 | { |
---|
1728 | 1818 | Composite csg = new GroupLeaf(); |
---|
1729 | 1819 | csg.count = 5; |
---|
.. | .. |
---|
1732 | 1822 | csg.addChild(child); |
---|
1733 | 1823 | child.addChild(csg); |
---|
1734 | 1824 | } else |
---|
1735 | | - if (event.getSource() == doubleItem) |
---|
| 1825 | + if (source == doubleItem) |
---|
1736 | 1826 | { |
---|
1737 | 1827 | Composite csg = new GroupLeaf(); |
---|
1738 | 1828 | csg.count = 5; |
---|
.. | .. |
---|
1744 | 1834 | csg.addChild(child); |
---|
1745 | 1835 | child.addChild(csg); |
---|
1746 | 1836 | } else |
---|
1747 | | - if (event.getSource() == tripleItem) |
---|
| 1837 | + if (source == tripleItem) |
---|
1748 | 1838 | { |
---|
1749 | 1839 | Composite csg = new GroupLeaf(); |
---|
1750 | 1840 | csg.count = 4; |
---|
.. | .. |
---|
1760 | 1850 | child.addChild(csg); |
---|
1761 | 1851 | } else |
---|
1762 | 1852 | |
---|
1763 | | - if (event.getSource() == importGFDItem) |
---|
| 1853 | + if (source == importGFDItem) |
---|
1764 | 1854 | { |
---|
1765 | 1855 | ImportGFD(); |
---|
1766 | 1856 | } else |
---|
1767 | | - if (event.getSource() == importVRMLX3DItem) |
---|
| 1857 | + if (source == importVRMLX3DItem) |
---|
1768 | 1858 | { |
---|
1769 | 1859 | ImportVRMLX3D(); |
---|
1770 | 1860 | } else |
---|
1771 | | - if (event.getSource() == import3DSItem) |
---|
| 1861 | + if (source == import3DSItem) |
---|
1772 | 1862 | { |
---|
1773 | 1863 | objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1774 | 1864 | } else |
---|
1775 | | - if (event.getSource() == importOBJItem) |
---|
| 1865 | + if (source == importOBJItem) |
---|
1776 | 1866 | { |
---|
1777 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1867 | + //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
| 1868 | + FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
| 1869 | + browser.setVisible(true); |
---|
| 1870 | + String filename = browser.getFile(); |
---|
| 1871 | + if (filename != null && filename.length() > 0) |
---|
| 1872 | + { |
---|
| 1873 | + String fullname = browser.getDirectory() + filename; |
---|
| 1874 | + makeSomething(ReadOBJ(fullname), true); |
---|
| 1875 | + } |
---|
1778 | 1876 | } else |
---|
1779 | | - if (event.getSource() == computeAOItem) |
---|
| 1877 | + if (source == computeAOItem) |
---|
1780 | 1878 | { |
---|
1781 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1782 | | - CameraPane.theRenderer.repaint(); |
---|
| 1879 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1880 | + Globals.theRenderer.repaint(); |
---|
1783 | 1881 | } else |
---|
1784 | | - if (event.getSource() == recompileItem) |
---|
| 1882 | + if (source == recompileItem) |
---|
1785 | 1883 | { |
---|
1786 | 1884 | Recompile(); |
---|
1787 | 1885 | refreshContents(); |
---|
1788 | 1886 | } else |
---|
1789 | | - if (event.getSource() == editScriptItem) |
---|
| 1887 | + if (source == editScriptItem) |
---|
1790 | 1888 | { |
---|
1791 | 1889 | OpenDialog(); |
---|
1792 | 1890 | refreshContents(); |
---|
1793 | 1891 | } else |
---|
1794 | | - if (event.getSource() == invariantsItem) |
---|
| 1892 | + if (source == invariantsItem) |
---|
1795 | 1893 | { |
---|
1796 | 1894 | System.out.println("Invariants:"); |
---|
1797 | 1895 | GrafreeD.grafreeD.universe.invariants(); |
---|
1798 | 1896 | } else |
---|
1799 | | - if (event.getSource() == memoryItem) |
---|
| 1897 | + if (source == memoryItem) |
---|
1800 | 1898 | { |
---|
1801 | 1899 | //System.out.println("Invariants:"); |
---|
1802 | 1900 | PrintMemory(); |
---|
1803 | 1901 | } else |
---|
1804 | | - if (event.getSource() == pathItem) |
---|
| 1902 | + if (source == pathItem) |
---|
1805 | 1903 | { |
---|
1806 | 1904 | PrintPath(); |
---|
1807 | 1905 | } else |
---|
1808 | | - if (event.getSource() == analyzeItem) |
---|
| 1906 | + if (source == analyzeItem) |
---|
1809 | 1907 | { |
---|
1810 | 1908 | AnalyzeObject(); |
---|
1811 | 1909 | } else |
---|
1812 | | - if (event.getSource() == dumpItem) |
---|
| 1910 | + if (source == dumpItem) |
---|
1813 | 1911 | { |
---|
1814 | 1912 | DumpObject(); |
---|
1815 | 1913 | } else |
---|
1816 | | - if (event.getSource() == screenfitButton) |
---|
| 1914 | + if (source == oneStepButton) |
---|
| 1915 | + { |
---|
| 1916 | + Globals.ONESTEP = true; |
---|
| 1917 | + cameraView.repaint(); |
---|
| 1918 | + } else |
---|
| 1919 | + if (source == screenfitButton) |
---|
1817 | 1920 | { |
---|
1818 | 1921 | //Reload(lastConverter, lastFilename, true); |
---|
1819 | 1922 | ScreenFit(); |
---|
1820 | 1923 | } else |
---|
1821 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1924 | + if (source == screenfitpointButton) |
---|
1822 | 1925 | { |
---|
1823 | 1926 | //Reload(lastConverter, lastFilename, true); |
---|
1824 | 1927 | ScreenFitPoint(); |
---|
1825 | 1928 | } else |
---|
1826 | | - if (event.getSource() == snapobjectButton) |
---|
| 1929 | + if (source == snapobjectButton) |
---|
1827 | 1930 | { |
---|
1828 | 1931 | //Reload(lastConverter, lastFilename, true); |
---|
1829 | 1932 | SnapObject(); |
---|
.. | .. |
---|
1834 | 1937 | // Recompile(); |
---|
1835 | 1938 | // refreshContents(); |
---|
1836 | 1939 | // } else |
---|
1837 | | - if (event.getSource() == gcButton) |
---|
| 1940 | + if (source == gcButton) |
---|
1838 | 1941 | { |
---|
1839 | 1942 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1840 | 1943 | System.gc(); |
---|
1841 | 1944 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1842 | 1945 | } else |
---|
1843 | | - if (event.getSource() == editLeafItem) |
---|
| 1946 | + if (source == editLeafItem) |
---|
1844 | 1947 | { |
---|
1845 | 1948 | Object3D obj; |
---|
1846 | 1949 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1854 | 1957 | } |
---|
1855 | 1958 | refreshContents(true); |
---|
1856 | 1959 | } else |
---|
1857 | | - if (event.getSource() == openWindowItem) |
---|
| 1960 | + if (source == openWindowItem) |
---|
1858 | 1961 | { |
---|
1859 | 1962 | EditSelection(true); |
---|
1860 | 1963 | } else |
---|
1861 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 1964 | + if (source == cutItem || source == clearButton) |
---|
1862 | 1965 | { |
---|
1863 | 1966 | loadClipboard(true); |
---|
1864 | 1967 | } else |
---|
1865 | | - if (event.getSource() == duplicateItem) |
---|
| 1968 | + if (source == duplicateItem) |
---|
1866 | 1969 | { |
---|
1867 | 1970 | Object3D keep = GrafreeD.clipboard; |
---|
1868 | 1971 | loadClipboard(false); |
---|
1869 | 1972 | paste(false); |
---|
1870 | 1973 | GrafreeD.clipboard = keep; |
---|
1871 | 1974 | } else |
---|
1872 | | - if (event.getSource() == cloneItem) |
---|
| 1975 | + if (source == cloneItem) |
---|
1873 | 1976 | { |
---|
1874 | 1977 | CloneSelection(false); |
---|
1875 | 1978 | } else |
---|
1876 | | - if (event.getSource() == cloneSupportItem) |
---|
| 1979 | + if (source == cloneSupportItem) |
---|
1877 | 1980 | { |
---|
1878 | 1981 | CloneSelection(true); |
---|
1879 | 1982 | } else |
---|
1880 | | - if (event.getSource() == copyItem) |
---|
| 1983 | + if (source == copyItem) |
---|
1881 | 1984 | { |
---|
1882 | 1985 | loadClipboard(false); |
---|
1883 | 1986 | } else |
---|
1884 | | - if (event.getSource() == pasteItem) |
---|
| 1987 | + if (source == pasteItem) |
---|
1885 | 1988 | { |
---|
1886 | 1989 | paste(false); |
---|
1887 | 1990 | } else |
---|
1888 | | - if (event.getSource() == pasteLinkItem) |
---|
| 1991 | + if (source == pasteIntoItem) |
---|
1889 | 1992 | { |
---|
1890 | | - pasteInto(false); |
---|
| 1993 | + pasteInto(true, false); |
---|
1891 | 1994 | } else |
---|
1892 | | - if (event.getSource() == pasteCloneItem) |
---|
| 1995 | + if (source == pasteLinkItem) |
---|
1893 | 1996 | { |
---|
1894 | | - pasteInto(true); |
---|
| 1997 | + pasteInto(false, false); |
---|
1895 | 1998 | } else |
---|
1896 | | - if (event.getSource() == pasteExpandItem) |
---|
| 1999 | + if (source == pasteCloneItem) |
---|
| 2000 | + { |
---|
| 2001 | + pasteInto(true, true); |
---|
| 2002 | + } else |
---|
| 2003 | + if (source == pasteExpandItem) |
---|
1897 | 2004 | { |
---|
1898 | 2005 | paste(true); |
---|
1899 | 2006 | } else |
---|
1900 | | - if (event.getSource() == synchronizeItem) |
---|
| 2007 | + if (source == synchronizeItem) |
---|
1901 | 2008 | { |
---|
1902 | 2009 | Overwrite(Object3D.TRANSFORM); |
---|
1903 | 2010 | } else |
---|
1904 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2011 | + if (source == overwriteNameItem) |
---|
1905 | 2012 | { |
---|
1906 | 2013 | Overwrite(Object3D.NAME); |
---|
1907 | 2014 | } else |
---|
1908 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2015 | + if (source == overwriteUVItem) |
---|
1909 | 2016 | { |
---|
1910 | 2017 | Overwrite(Object3D.UV); |
---|
1911 | 2018 | } else |
---|
1912 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2019 | + if (source == overwriteMatItem) |
---|
1913 | 2020 | { |
---|
1914 | 2021 | /* july 2015 |
---|
1915 | 2022 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1929 | 2036 | |
---|
1930 | 2037 | Overwrite(dropAttributes); |
---|
1931 | 2038 | } |
---|
1932 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2039 | + if (source == overwriteGeoItem) |
---|
1933 | 2040 | { |
---|
1934 | 2041 | Overwrite(Object3D.GEOMETRY); |
---|
1935 | 2042 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1946 | 2053 | // refreshContents(); |
---|
1947 | 2054 | // } |
---|
1948 | 2055 | } else |
---|
1949 | | - if (event.getSource() == generateMeshItem) |
---|
| 2056 | + if (source == generateMeshItem) |
---|
1950 | 2057 | { |
---|
1951 | 2058 | //if (group.selection.size() == 1) |
---|
1952 | 2059 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1957 | 2064 | ResetModel(); |
---|
1958 | 2065 | refreshContents(); |
---|
1959 | 2066 | } else |
---|
1960 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2067 | + if (source == extractGeometriesItem) |
---|
1961 | 2068 | { |
---|
1962 | 2069 | boolean one = false; |
---|
1963 | 2070 | |
---|
.. | .. |
---|
1984 | 2091 | ResetModel(); |
---|
1985 | 2092 | refreshContents(); |
---|
1986 | 2093 | } else |
---|
1987 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2094 | + if (source == cloneGeometriesItem) |
---|
1988 | 2095 | { |
---|
1989 | 2096 | boolean one = false; |
---|
1990 | 2097 | |
---|
.. | .. |
---|
2010 | 2117 | ResetModel(); |
---|
2011 | 2118 | refreshContents(); |
---|
2012 | 2119 | } else |
---|
2013 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2120 | + if (source == shareGeometriesItem) |
---|
2014 | 2121 | { |
---|
2015 | 2122 | boolean one = false; |
---|
2016 | 2123 | |
---|
.. | .. |
---|
2040 | 2147 | refreshContents(); |
---|
2041 | 2148 | } |
---|
2042 | 2149 | } else |
---|
2043 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2150 | + if (source == mergeGeometriesItem) |
---|
2044 | 2151 | { |
---|
2045 | 2152 | boolean one = false; |
---|
2046 | 2153 | |
---|
.. | .. |
---|
2070 | 2177 | ResetModel(); |
---|
2071 | 2178 | refreshContents(); |
---|
2072 | 2179 | } else |
---|
2073 | | - if (event.getSource() == linkverticesItem) |
---|
| 2180 | + if (source == linkverticesItem) |
---|
2074 | 2181 | { |
---|
2075 | 2182 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2076 | 2183 | // { |
---|
.. | .. |
---|
2090 | 2197 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2091 | 2198 | content = ((cGroup)content).get(0); |
---|
2092 | 2199 | |
---|
2093 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2200 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2094 | 2201 | for (int i=0; i<group.selection.size(); i++) |
---|
2095 | 2202 | { |
---|
2096 | | - boolean random = CameraPane.RANDOM; |
---|
2097 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2203 | + boolean random = CameraPane.SWITCH; |
---|
| 2204 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2098 | 2205 | group.selection.get(i).linkVerticesThis(content); |
---|
2099 | 2206 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2100 | | - CameraPane.RANDOM = random; |
---|
| 2207 | + CameraPane.SWITCH = random; |
---|
2101 | 2208 | } |
---|
2102 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2209 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2103 | 2210 | refreshContents(); |
---|
2104 | 2211 | } |
---|
2105 | 2212 | } else |
---|
2106 | | - if (event.getSource() == resetsupportItem) |
---|
| 2213 | + if (source == resetsupportItem) |
---|
2107 | 2214 | { |
---|
2108 | 2215 | for (int i=0; i<group.selection.size(); i++) |
---|
2109 | 2216 | { |
---|
2110 | | - boolean random = CameraPane.RANDOM; |
---|
2111 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2217 | + boolean random = CameraPane.SWITCH; |
---|
| 2218 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2112 | 2219 | group.selection.get(i).linkVerticesThis(null); |
---|
2113 | | - CameraPane.RANDOM = random; |
---|
| 2220 | + CameraPane.SWITCH = random; |
---|
2114 | 2221 | } |
---|
2115 | 2222 | |
---|
2116 | 2223 | refreshContents(); |
---|
2117 | 2224 | } else |
---|
2118 | | - if (event.getSource() == relinkverticesItem) |
---|
| 2225 | + if (source == relinkverticesItem) |
---|
2119 | 2226 | { |
---|
2120 | | - boolean random = CameraPane.RANDOM; |
---|
2121 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2227 | + boolean random = CameraPane.SWITCH; |
---|
| 2228 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2122 | 2229 | group.selection.RelinkToSupport(); |
---|
2123 | | - CameraPane.RANDOM = random; |
---|
| 2230 | + CameraPane.SWITCH = random; |
---|
2124 | 2231 | |
---|
2125 | 2232 | refreshContents(); |
---|
2126 | 2233 | } else |
---|
2127 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2234 | + if (source == resetreferencesItem) |
---|
2128 | 2235 | { |
---|
2129 | 2236 | for (int i=0; i<group.selection.size(); i++) |
---|
2130 | 2237 | { |
---|
.. | .. |
---|
2133 | 2240 | |
---|
2134 | 2241 | refreshContents(); |
---|
2135 | 2242 | } else |
---|
2136 | | - if (event.getSource() == setMasterItem) |
---|
| 2243 | + if (source == setMasterItem) |
---|
2137 | 2244 | { |
---|
2138 | 2245 | if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2139 | 2246 | { |
---|
.. | .. |
---|
2146 | 2253 | refreshContents(); |
---|
2147 | 2254 | } |
---|
2148 | 2255 | } else |
---|
2149 | | - if (event.getSource() == poseMeshItem) |
---|
| 2256 | + if (source == poseMeshItem) |
---|
2150 | 2257 | { |
---|
2151 | 2258 | if (group.selection.size() == 1) |
---|
2152 | 2259 | { |
---|
.. | .. |
---|
2165 | 2272 | } |
---|
2166 | 2273 | |
---|
2167 | 2274 | } else |
---|
2168 | | - if (event.getSource() == revertMeshItem) |
---|
| 2275 | + if (source == revertMeshItem) |
---|
2169 | 2276 | { |
---|
2170 | 2277 | RevertMeshes(); |
---|
2171 | 2278 | } else |
---|
2172 | | - if (event.getSource() == resetMeshItem) |
---|
| 2279 | + if (source == resetMeshItem) |
---|
2173 | 2280 | { |
---|
2174 | 2281 | ResetAll(); |
---|
2175 | 2282 | } else |
---|
2176 | | - if (event.getSource() == stepAllItem) |
---|
| 2283 | + if (source == stepAllItem) |
---|
2177 | 2284 | { |
---|
2178 | 2285 | StepAll(); |
---|
2179 | 2286 | } else |
---|
2180 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2287 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2181 | 2288 | { |
---|
2182 | 2289 | //int indices[] = jList.getSelectedIndices(); |
---|
2183 | 2290 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2185 | 2292 | |
---|
2186 | 2293 | ClearSelection(false); |
---|
2187 | 2294 | } else |
---|
2188 | | - if (event.getSource() == clearAllItem) |
---|
| 2295 | + if (source == clearAllItem) |
---|
2189 | 2296 | { |
---|
2190 | 2297 | ClearSelection(true); |
---|
2191 | 2298 | } else |
---|
2192 | | - if (event.getSource() == grabItem) |
---|
| 2299 | + if (source == grabItem) |
---|
2193 | 2300 | { |
---|
2194 | 2301 | group(new cGroup(), true); |
---|
2195 | 2302 | } else |
---|
2196 | | - if (event.getSource() == hideItem) |
---|
| 2303 | + if (source == hideItem) |
---|
2197 | 2304 | { |
---|
2198 | 2305 | group(new HiddenObject()); |
---|
2199 | 2306 | } else |
---|
2200 | | - if (event.getSource() == frontItem) |
---|
| 2307 | + if (source == frontItem) |
---|
2201 | 2308 | { |
---|
2202 | 2309 | front(); |
---|
2203 | 2310 | } else |
---|
2204 | | - if (event.getSource() == backItem) |
---|
| 2311 | + if (source == backItem) |
---|
2205 | 2312 | { |
---|
2206 | 2313 | back(); |
---|
2207 | 2314 | } else |
---|
2208 | | - if (event.getSource() == cameraItem) |
---|
| 2315 | + if (source == cameraItem) |
---|
2209 | 2316 | { |
---|
2210 | 2317 | makeSomething(new Camera()); |
---|
2211 | 2318 | } else |
---|
2212 | | - if (event.getSource() == compositeItem) |
---|
| 2319 | + if (source == compositeItem) |
---|
2213 | 2320 | { |
---|
2214 | 2321 | group(new Composite()); |
---|
2215 | 2322 | } else |
---|
2216 | | - if (event.getSource() == randomItem) |
---|
| 2323 | + if (source == randomItem) |
---|
2217 | 2324 | { |
---|
2218 | 2325 | RandomNode random = new RandomNode(); |
---|
2219 | 2326 | group(random); |
---|
2220 | 2327 | if (random.size() > 0) |
---|
2221 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2328 | + random.name = random.get(0).name + "Switch"; |
---|
2222 | 2329 | } else |
---|
2223 | | - if (event.getSource() == physicsItem) |
---|
| 2330 | + if (source == physicsItem) |
---|
2224 | 2331 | { |
---|
2225 | 2332 | group(new PhysicsNode()); |
---|
2226 | 2333 | } else |
---|
2227 | | - if (event.getSource() == frameselectorItem) |
---|
| 2334 | + if (source == frameselectorItem) |
---|
2228 | 2335 | { |
---|
2229 | 2336 | for (int i=0; i<group.selection.size(); i++) |
---|
2230 | 2337 | { |
---|
.. | .. |
---|
2236 | 2343 | ResetModel(); |
---|
2237 | 2344 | refreshContents(); |
---|
2238 | 2345 | } else |
---|
2239 | | - if (event.getSource() == switchGeoItem) |
---|
| 2346 | + if (source == switchGeoItem) |
---|
2240 | 2347 | { |
---|
2241 | 2348 | for (int i=0; i<group.selection.size(); i++) |
---|
2242 | 2349 | { |
---|
.. | .. |
---|
2248 | 2355 | ResetModel(); |
---|
2249 | 2356 | refreshContents(); |
---|
2250 | 2357 | } else |
---|
2251 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2358 | + if (source == switchTransfoItem) |
---|
2252 | 2359 | { |
---|
2253 | 2360 | for (int i=0; i<group.selection.size(); i++) |
---|
2254 | 2361 | { |
---|
.. | .. |
---|
2260 | 2367 | ResetModel(); |
---|
2261 | 2368 | refreshContents(); |
---|
2262 | 2369 | } else |
---|
2263 | | - if (event.getSource() == morphItem) |
---|
| 2370 | + if (source == morphItem) |
---|
2264 | 2371 | { |
---|
2265 | 2372 | for (int i=0; i<group.selection.size(); i++) |
---|
2266 | 2373 | { |
---|
.. | .. |
---|
2272 | 2379 | ResetModel(); |
---|
2273 | 2380 | refreshContents(); |
---|
2274 | 2381 | } else |
---|
2275 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2382 | + if (source == scriptNodeItem) |
---|
2276 | 2383 | { |
---|
2277 | 2384 | boolean atleastone = false; |
---|
2278 | 2385 | |
---|
.. | .. |
---|
2311 | 2418 | } |
---|
2312 | 2419 | } |
---|
2313 | 2420 | } else |
---|
2314 | | - if (event.getSource() == linkerItem) |
---|
| 2421 | + if (source == linkerItem) |
---|
2315 | 2422 | { |
---|
2316 | 2423 | group(new cLinker()); |
---|
2317 | 2424 | } else |
---|
2318 | | - if (event.getSource() == textureItem) |
---|
| 2425 | + if (source == textureItem) |
---|
2319 | 2426 | { |
---|
2320 | 2427 | group(new TextureNode()); |
---|
2321 | 2428 | } else |
---|
2322 | | - if (event.getSource() == billboardItem) |
---|
| 2429 | + if (source == billboardItem) |
---|
2323 | 2430 | { |
---|
2324 | 2431 | group(new BillboardNode()); |
---|
2325 | 2432 | } else |
---|
2326 | | - if (event.getSource() == shadowXItem) |
---|
| 2433 | + if (source == shadowXItem) |
---|
2327 | 2434 | { |
---|
2328 | 2435 | CastShadow(0); |
---|
2329 | 2436 | } else |
---|
2330 | | - if (event.getSource() == shadowYItem) |
---|
| 2437 | + if (source == shadowYItem) |
---|
2331 | 2438 | { |
---|
2332 | 2439 | CastShadow(1); |
---|
2333 | 2440 | } else |
---|
2334 | | - if (event.getSource() == shadowZItem) |
---|
| 2441 | + if (source == shadowZItem) |
---|
2335 | 2442 | { |
---|
2336 | 2443 | CastShadow(2); |
---|
2337 | 2444 | } else |
---|
2338 | | - if (event.getSource() == ungroupItem) |
---|
| 2445 | + if (source == ungroupItem) |
---|
2339 | 2446 | { |
---|
2340 | 2447 | //ungroup(); |
---|
2341 | 2448 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2347 | 2454 | |
---|
2348 | 2455 | refreshContents(); |
---|
2349 | 2456 | } else |
---|
2350 | | - if (event.getSource() == genUVItem) |
---|
| 2457 | + if (source == genUVItem) |
---|
2351 | 2458 | { |
---|
2352 | 2459 | GenUV(); |
---|
2353 | 2460 | } else |
---|
2354 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2461 | + if (source == genNormalsCADItem) |
---|
2355 | 2462 | { |
---|
2356 | 2463 | GenNormals(true); |
---|
2357 | 2464 | } else |
---|
2358 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 2465 | + if (source == genNormalsMESHItem) |
---|
2359 | 2466 | { |
---|
2360 | 2467 | GenNormals(true); // TODO |
---|
2361 | 2468 | } else |
---|
2362 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2469 | + if (source == genNormalsORGANItem) |
---|
2363 | 2470 | { |
---|
2364 | 2471 | GenNormals(false); |
---|
2365 | 2472 | } else |
---|
2366 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 2473 | + if (source == genNormalsMINEItem) |
---|
2367 | 2474 | { |
---|
2368 | 2475 | GenNormalsMINE(); |
---|
2369 | 2476 | } else |
---|
2370 | | - if (event.getSource() == stripifyItem) |
---|
| 2477 | + if (source == stripifyItem) |
---|
2371 | 2478 | { |
---|
2372 | 2479 | Stripify(); |
---|
2373 | 2480 | } else |
---|
2374 | | - if (event.getSource() == unstripifyItem) |
---|
| 2481 | + if (source == unstripifyItem) |
---|
2375 | 2482 | { |
---|
2376 | 2483 | Unstripify(); |
---|
2377 | 2484 | } else |
---|
2378 | | - if (event.getSource() == trimItem) |
---|
| 2485 | + if (source == trimItem) |
---|
2379 | 2486 | { |
---|
2380 | 2487 | Trim(); |
---|
2381 | 2488 | } else |
---|
2382 | | - if (event.getSource() == untrimItem) |
---|
| 2489 | + if (source == untrimItem) |
---|
2383 | 2490 | { |
---|
2384 | 2491 | Untrim(); |
---|
2385 | 2492 | } else |
---|
2386 | | - if (event.getSource() == clearColorsItem) |
---|
| 2493 | + if (source == clearColorsItem) |
---|
2387 | 2494 | { |
---|
2388 | 2495 | ClearColors(); |
---|
2389 | 2496 | } else |
---|
2390 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2497 | + if (source == clearMaterialsItem) |
---|
2391 | 2498 | { |
---|
2392 | 2499 | ClearMaterials(); |
---|
2393 | 2500 | } else |
---|
2394 | | - if (event.getSource() == liveleavesItem) |
---|
| 2501 | + if (source == liveleavesItem) |
---|
2395 | 2502 | { |
---|
2396 | 2503 | LiveLeaves(true); |
---|
2397 | 2504 | } else |
---|
2398 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2505 | + if (source == unliveleavesItem) |
---|
2399 | 2506 | { |
---|
2400 | 2507 | LiveLeaves(false); |
---|
2401 | 2508 | } else |
---|
2402 | | - if (event.getSource() == supportleavesItem) |
---|
| 2509 | + if (source == supportleavesItem) |
---|
2403 | 2510 | { |
---|
2404 | 2511 | SupportLeaves(true); |
---|
2405 | 2512 | } else |
---|
2406 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2513 | + if (source == unsupportleavesItem) |
---|
2407 | 2514 | { |
---|
2408 | 2515 | SupportLeaves(false); |
---|
2409 | 2516 | } else |
---|
2410 | | - if (event.getSource() == hideleavesItem) |
---|
| 2517 | + if (source == hideleavesItem) |
---|
2411 | 2518 | { |
---|
2412 | 2519 | HideLeaves(true); |
---|
2413 | 2520 | } else |
---|
2414 | | - if (event.getSource() == showleavesItem) |
---|
| 2521 | + if (source == showleavesItem) |
---|
2415 | 2522 | { |
---|
2416 | 2523 | HideLeaves(false); |
---|
2417 | 2524 | } else |
---|
2418 | | - if (event.getSource() == markleavesItem) |
---|
| 2525 | + if (source == markleavesItem) |
---|
2419 | 2526 | { |
---|
2420 | 2527 | MarkLeaves(true); |
---|
2421 | 2528 | } else |
---|
2422 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2529 | + if (source == unmarkleavesItem) |
---|
2423 | 2530 | { |
---|
2424 | 2531 | MarkLeaves(false); |
---|
2425 | 2532 | } else |
---|
2426 | | - if (event.getSource() == flipVItem) |
---|
| 2533 | + if (source == flipVItem) |
---|
2427 | 2534 | { |
---|
2428 | 2535 | FlipV(true); |
---|
2429 | 2536 | } else |
---|
2430 | | - if (event.getSource() == unflipVItem) |
---|
| 2537 | + if (source == unflipVItem) |
---|
2431 | 2538 | { |
---|
2432 | 2539 | FlipV(false); |
---|
2433 | 2540 | } else |
---|
2434 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2541 | + if (source == lowTexturesItem) |
---|
2435 | 2542 | { |
---|
2436 | 2543 | SetTexRes(0); |
---|
2437 | 2544 | } else |
---|
2438 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2545 | + if (source == normalTexturesItem) |
---|
2439 | 2546 | { |
---|
2440 | 2547 | SetTexRes(1); |
---|
2441 | 2548 | } else |
---|
2442 | | - if (event.getSource() == highTexturesItem) |
---|
| 2549 | + if (source == highTexturesItem) |
---|
2443 | 2550 | { |
---|
2444 | 2551 | SetTexRes(2); |
---|
2445 | 2552 | } else |
---|
2446 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2553 | + if (source == veryhighTexturesItem) |
---|
2447 | 2554 | { |
---|
2448 | 2555 | SetTexRes(3); |
---|
2449 | 2556 | } else |
---|
2450 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2557 | + if (source == maxTexturesItem) |
---|
2451 | 2558 | { |
---|
2452 | 2559 | SetTexRes(4); |
---|
2453 | 2560 | } else |
---|
2454 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2561 | + if (source == panoTexturesItem) |
---|
2455 | 2562 | { |
---|
2456 | 2563 | SetTexRes(5); |
---|
2457 | 2564 | } else |
---|
2458 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2565 | + if (source == reverseNormalsItem) |
---|
2459 | 2566 | { |
---|
2460 | 2567 | ReverseNormals(); |
---|
2461 | 2568 | } else |
---|
2462 | | - if (event.getSource() == parseverticesItem) |
---|
| 2569 | + if (source == parseverticesItem) |
---|
2463 | 2570 | { |
---|
2464 | 2571 | ParseVertices(); |
---|
2465 | 2572 | } else |
---|
2466 | | - if (event.getSource() == textureFieldItem) |
---|
| 2573 | + if (source == textureFieldItem) |
---|
2467 | 2574 | { |
---|
2468 | 2575 | TextureVertices(); |
---|
2469 | 2576 | } else |
---|
2470 | | - if (event.getSource() == alignItem) |
---|
| 2577 | + if (source == alignItem) |
---|
2471 | 2578 | { |
---|
2472 | 2579 | Align(); |
---|
2473 | 2580 | } else |
---|
2474 | | - if (event.getSource() == mirrorItem) |
---|
| 2581 | + if (source == mirrorItem) |
---|
2475 | 2582 | { |
---|
2476 | 2583 | MirrorPoses(); |
---|
2477 | 2584 | } else |
---|
2478 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2585 | + if (source == reduceMorphItem) |
---|
2479 | 2586 | { |
---|
2480 | 2587 | MeshReduction(false); |
---|
2481 | 2588 | } else |
---|
2482 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2589 | + if (source == reduce34MorphItem) |
---|
2483 | 2590 | { |
---|
2484 | 2591 | MeshReduction(true); |
---|
2485 | 2592 | } else |
---|
2486 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2593 | + if (source == reverseTrianglesItem) |
---|
2487 | 2594 | { |
---|
2488 | 2595 | ReverseTriangles(); |
---|
2489 | 2596 | } else |
---|
2490 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2597 | + if (source == reduceMeshItem) |
---|
2491 | 2598 | { |
---|
2492 | 2599 | ReduceMesh(false); |
---|
2493 | 2600 | } else |
---|
2494 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2601 | + if (source == reduce34MeshItem) |
---|
2495 | 2602 | { |
---|
2496 | 2603 | ReduceMesh(true); |
---|
2497 | 2604 | } else |
---|
2498 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2605 | + if (source == increaseMeshItem) |
---|
2499 | 2606 | { |
---|
2500 | 2607 | IncreaseMesh(); |
---|
2501 | 2608 | } else |
---|
2502 | | - if (event.getSource() == clipMeshItem) |
---|
| 2609 | + if (source == clipMeshItem) |
---|
2503 | 2610 | { |
---|
2504 | 2611 | ClipMesh(); |
---|
2505 | 2612 | } else |
---|
2506 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2613 | + if (source == smoothMeshItem) |
---|
2507 | 2614 | { |
---|
2508 | 2615 | SmoothMesh(); |
---|
2509 | 2616 | } else |
---|
2510 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2617 | + if (source == transformgeometryItem) |
---|
2511 | 2618 | { |
---|
2512 | 2619 | TransformGeometry(); |
---|
2513 | 2620 | } else |
---|
2514 | | - if (event.getSource() == resetTransformItem) |
---|
| 2621 | + if (source == resetTransformItem) |
---|
2515 | 2622 | { |
---|
2516 | 2623 | ResetTransform(); |
---|
2517 | 2624 | } else |
---|
2518 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2625 | + if (source == resetCentroidItem) |
---|
2519 | 2626 | { |
---|
2520 | 2627 | ResetCentroid(); |
---|
2521 | 2628 | } else |
---|
2522 | | - if (event.getSource() == resetParentItem) |
---|
| 2629 | + if (source == resetParentItem) |
---|
2523 | 2630 | { |
---|
2524 | 2631 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2525 | 2632 | { |
---|
.. | .. |
---|
2529 | 2636 | |
---|
2530 | 2637 | refreshContents(); |
---|
2531 | 2638 | } else |
---|
2532 | | - if (event.getSource() == repairParentItem) |
---|
| 2639 | + if (source == repairParentItem) |
---|
2533 | 2640 | { |
---|
2534 | 2641 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2535 | 2642 | { |
---|
.. | .. |
---|
2543 | 2650 | |
---|
2544 | 2651 | refreshContents(); |
---|
2545 | 2652 | } else |
---|
2546 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2653 | + if (source == repairShadowItem) |
---|
| 2654 | + { |
---|
| 2655 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2656 | + { |
---|
| 2657 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2658 | + obj.RepairShadow(); |
---|
| 2659 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2660 | +// { |
---|
| 2661 | +// obj.get(i).parent = obj; |
---|
| 2662 | +// } |
---|
| 2663 | + } |
---|
| 2664 | + |
---|
| 2665 | + refreshContents(); |
---|
| 2666 | + } else |
---|
| 2667 | + if (source == sortbysizeItem) |
---|
2547 | 2668 | { |
---|
2548 | 2669 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2549 | 2670 | { |
---|
.. | .. |
---|
2555 | 2676 | ResetModel(); |
---|
2556 | 2677 | refreshContents(); |
---|
2557 | 2678 | } else |
---|
2558 | | - if (event.getSource() == sortbynameItem) |
---|
| 2679 | + if (source == sortbynameItem) |
---|
2559 | 2680 | { |
---|
2560 | 2681 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2561 | 2682 | { |
---|
.. | .. |
---|
2567 | 2688 | ResetModel(); |
---|
2568 | 2689 | refreshContents(); |
---|
2569 | 2690 | } else |
---|
2570 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2691 | + if (source == attachPigmentItem) |
---|
2571 | 2692 | { |
---|
2572 | 2693 | String texture = GetFile("Attach pigment"); |
---|
2573 | 2694 | Object3D obj; |
---|
.. | .. |
---|
2579 | 2700 | |
---|
2580 | 2701 | refreshContents(); |
---|
2581 | 2702 | } else |
---|
2582 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2703 | + if (source == detachPigmentItem) |
---|
2583 | 2704 | { |
---|
2584 | 2705 | Object3D obj; |
---|
2585 | 2706 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2590 | 2711 | |
---|
2591 | 2712 | refreshContents(); |
---|
2592 | 2713 | } else |
---|
2593 | | - if (event.getSource() == attachBumpItem) |
---|
| 2714 | + if (source == attachBumpItem) |
---|
2594 | 2715 | { |
---|
2595 | 2716 | String texture = GetFile("Attach bump"); |
---|
2596 | 2717 | Object3D obj; |
---|
.. | .. |
---|
2602 | 2723 | |
---|
2603 | 2724 | refreshContents(); |
---|
2604 | 2725 | } else |
---|
2605 | | - if (event.getSource() == detachBumpItem) |
---|
| 2726 | + if (source == detachBumpItem) |
---|
2606 | 2727 | { |
---|
2607 | 2728 | Object3D obj; |
---|
2608 | 2729 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2613 | 2734 | |
---|
2614 | 2735 | refreshContents(); |
---|
2615 | 2736 | } else |
---|
2616 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2737 | + if (source == pigmentBumpItem) |
---|
2617 | 2738 | { |
---|
2618 | 2739 | Object3D obj; |
---|
2619 | 2740 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2624 | 2745 | |
---|
2625 | 2746 | refreshContents(); |
---|
2626 | 2747 | } else |
---|
2627 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2748 | + if (source == flashSelectionButton) |
---|
2628 | 2749 | { |
---|
2629 | 2750 | CameraPane.flash = true; |
---|
2630 | 2751 | refreshContents(); |
---|
2631 | 2752 | } else |
---|
2632 | | - if (event.getSource() == oneButton) |
---|
| 2753 | + if (source == oneButton) |
---|
2633 | 2754 | { |
---|
2634 | 2755 | } else |
---|
2635 | | - if (event.getSource() == twoButton) |
---|
| 2756 | + if (source == twoButton) |
---|
2636 | 2757 | { |
---|
2637 | 2758 | radio.layout = twoButton; |
---|
2638 | 2759 | // bug |
---|
2639 | 2760 | //gridPanel.setDividerLocation(1.0); |
---|
2640 | 2761 | //bigPanel.setDividerLocation(0.0); |
---|
2641 | | - bigThree.remove(scenePanel); |
---|
2642 | | - bigThree.remove(cameraPanel); |
---|
2643 | | - bigThree.remove(XYZPanel); |
---|
2644 | | - aWindowConstraints.gridx = 0; |
---|
2645 | | - aWindowConstraints.gridy = 0; |
---|
2646 | | - aWindowConstraints.gridwidth = 1; |
---|
2647 | | - // aConstraints.gridheight = 3; |
---|
2648 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2649 | | - aWindowConstraints.weightx = 0; |
---|
2650 | | - aWindowConstraints.weighty = 1; |
---|
2651 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2652 | | - aWindowConstraints.weightx = 1; |
---|
2653 | | - aWindowConstraints.gridwidth = 3; |
---|
2654 | | - // aConstraints.gridheight = 3; |
---|
2655 | | - aWindowConstraints.gridx = 1; |
---|
2656 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2657 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2658 | | - aWindowConstraints.weightx = 0; |
---|
2659 | | - aWindowConstraints.gridx = 4; |
---|
2660 | | - aWindowConstraints.gridwidth = 1; |
---|
2661 | | - // aConstraints.gridheight = 3; |
---|
2662 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2663 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2664 | | - bigThree.revalidate(); |
---|
| 2762 | +// bigThree.remove(scenePanel); |
---|
| 2763 | +// bigThree.remove(centralPanel); |
---|
| 2764 | +// bigThree.remove(XYZPanel); |
---|
| 2765 | +// aWindowConstraints.gridx = 0; |
---|
| 2766 | +// aWindowConstraints.gridy = 0; |
---|
| 2767 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2768 | +// // aConstraints.gridheight = 3; |
---|
| 2769 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2770 | +// aWindowConstraints.weightx = 0; |
---|
| 2771 | +// aWindowConstraints.weighty = 1; |
---|
| 2772 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2773 | +// aWindowConstraints.weightx = 1; |
---|
| 2774 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2775 | +// // aConstraints.gridheight = 3; |
---|
| 2776 | +// aWindowConstraints.gridx = 1; |
---|
| 2777 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2778 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2779 | +// aWindowConstraints.weightx = 0; |
---|
| 2780 | +// aWindowConstraints.gridx = 4; |
---|
| 2781 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2782 | +// // aConstraints.gridheight = 3; |
---|
| 2783 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2784 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2785 | +// scenePanel.setVisible(false); |
---|
| 2786 | +// centralPanel.setVisible(true); |
---|
| 2787 | +// XYZPanel.setVisible(false); |
---|
| 2788 | + bigThree.ClearUI(); |
---|
| 2789 | + bigThree.add(centralPanel); |
---|
| 2790 | + bigThree.FlushUI(); |
---|
2665 | 2791 | } else |
---|
2666 | | - if (event.getSource() == threeButton) |
---|
| 2792 | + if (source == threeButton) |
---|
2667 | 2793 | { |
---|
2668 | 2794 | radio.layout = threeButton; |
---|
2669 | | - bigThree.remove(scenePanel); |
---|
2670 | | - bigThree.remove(cameraPanel); |
---|
2671 | | - bigThree.remove(XYZPanel); |
---|
2672 | | - aWindowConstraints.gridx = 0; |
---|
2673 | | - aWindowConstraints.gridy = 0; |
---|
2674 | | - aWindowConstraints.gridwidth = 1; |
---|
2675 | | - // aConstraints.gridheight = 3; |
---|
2676 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2677 | | - aWindowConstraints.weightx = 0; |
---|
2678 | | - aWindowConstraints.weighty = 1; |
---|
2679 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2680 | | - aWindowConstraints.weightx = 1; |
---|
2681 | | - aWindowConstraints.gridwidth = 3; |
---|
2682 | | - // aConstraints.gridheight = 3; |
---|
2683 | | - aWindowConstraints.gridx = 1; |
---|
2684 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2685 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2686 | | - aWindowConstraints.weightx = 0; |
---|
2687 | | - aWindowConstraints.gridx = 4; |
---|
2688 | | - aWindowConstraints.gridwidth = 1; |
---|
2689 | | - // aConstraints.gridheight = 3; |
---|
2690 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2691 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2692 | | - bigThree.revalidate(); |
---|
| 2795 | + |
---|
| 2796 | +// bigThree.remove(scenePanel); |
---|
| 2797 | +// bigThree.remove(centralPanel); |
---|
| 2798 | +// bigThree.remove(XYZPanel); |
---|
| 2799 | +// aWindowConstraints.gridx = 0; |
---|
| 2800 | +// aWindowConstraints.gridy = 0; |
---|
| 2801 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2802 | +// // aConstraints.gridheight = 3; |
---|
| 2803 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2804 | +// aWindowConstraints.weightx = 0; |
---|
| 2805 | +// aWindowConstraints.weighty = 1; |
---|
| 2806 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2807 | +// aWindowConstraints.weightx = 1; |
---|
| 2808 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2809 | +// // aConstraints.gridheight = 3; |
---|
| 2810 | +// aWindowConstraints.gridx = 1; |
---|
| 2811 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2812 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2813 | +// aWindowConstraints.weightx = 0; |
---|
| 2814 | +// aWindowConstraints.gridx = 4; |
---|
| 2815 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2816 | +// // aConstraints.gridheight = 3; |
---|
| 2817 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2818 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2819 | +// bigThree.validate(); |
---|
| 2820 | +// scenePanel.setVisible(false); |
---|
| 2821 | +// centralPanel.setVisible(true); |
---|
| 2822 | +// XYZPanel.setVisible(true); |
---|
| 2823 | + bigThree.ClearUI(); |
---|
| 2824 | + bigThree.add(centralPanel); |
---|
| 2825 | + bigThree.add(XYZPanel); |
---|
| 2826 | + bigThree.FlushUI(); |
---|
2693 | 2827 | } else |
---|
2694 | | - if (event.getSource() == fourButton) |
---|
| 2828 | + if (source == fourButton) |
---|
2695 | 2829 | { |
---|
2696 | 2830 | radio.layout = fourButton; |
---|
2697 | | - bigThree.remove(scenePanel); |
---|
2698 | | - bigThree.remove(cameraPanel); |
---|
2699 | | - bigThree.remove(XYZPanel); |
---|
2700 | | - aWindowConstraints.gridx = 0; |
---|
2701 | | - aWindowConstraints.gridy = 0; |
---|
2702 | | - aWindowConstraints.gridwidth = 1; |
---|
2703 | | - // aWindowConstraints.gridheight = 3; |
---|
2704 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2705 | | - aWindowConstraints.weightx = 1; |
---|
2706 | | - aWindowConstraints.weighty = 1; |
---|
2707 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2708 | | - aWindowConstraints.weightx = 1; |
---|
2709 | | - aWindowConstraints.gridwidth = 3; |
---|
2710 | | - // aConstraints.gridheight = 3; |
---|
2711 | | - aWindowConstraints.gridx = 1; |
---|
2712 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2713 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2714 | | - aWindowConstraints.weightx = 0; |
---|
2715 | | - aWindowConstraints.gridx = 4; |
---|
2716 | | - aWindowConstraints.gridwidth = 1; |
---|
2717 | | - // aWindowConstraints.gridheight = 3; |
---|
2718 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2719 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2720 | | - bigThree.revalidate(); |
---|
| 2831 | + |
---|
| 2832 | +// bigThree.remove(scenePanel); |
---|
| 2833 | +// bigThree.remove(centralPanel); |
---|
| 2834 | +// bigThree.remove(XYZPanel); |
---|
| 2835 | +// aWindowConstraints.gridx = 0; |
---|
| 2836 | +// aWindowConstraints.gridy = 0; |
---|
| 2837 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2838 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2839 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2840 | +// aWindowConstraints.weightx = 1; |
---|
| 2841 | +// aWindowConstraints.weighty = 1; |
---|
| 2842 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2843 | +// aWindowConstraints.weightx = 1; |
---|
| 2844 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2845 | +// // aConstraints.gridheight = 3; |
---|
| 2846 | +// aWindowConstraints.gridx = 1; |
---|
| 2847 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2848 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2849 | +// aWindowConstraints.weightx = 0; |
---|
| 2850 | +// aWindowConstraints.gridx = 4; |
---|
| 2851 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2852 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2853 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2854 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2855 | +// bigThree.validate(); |
---|
| 2856 | +// scenePanel.setVisible(true); |
---|
| 2857 | +// centralPanel.setVisible(false); |
---|
| 2858 | +// XYZPanel.setVisible(false); |
---|
| 2859 | + bigThree.ClearUI(); |
---|
| 2860 | + bigThree.add(scenePanel); |
---|
| 2861 | + bigThree.FlushUI(); |
---|
2721 | 2862 | } else |
---|
2722 | | - if (event.getSource() == sixButton) |
---|
| 2863 | + if (source == sixButton) |
---|
2723 | 2864 | { |
---|
2724 | 2865 | radio.layout = sixButton; |
---|
2725 | | - bigThree.remove(scenePanel); |
---|
2726 | | - bigThree.remove(cameraPanel); |
---|
2727 | | - bigThree.remove(XYZPanel); |
---|
2728 | | - aWindowConstraints.gridx = 0; |
---|
2729 | | - aWindowConstraints.gridy = 0; |
---|
2730 | | - aWindowConstraints.gridwidth = 1; |
---|
2731 | | - // aConstraints.gridheight = 3; |
---|
2732 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2733 | | - aWindowConstraints.weightx = 0; |
---|
2734 | | - aWindowConstraints.weighty = 1; |
---|
2735 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2736 | | - aWindowConstraints.weightx = 1; |
---|
2737 | | - aWindowConstraints.gridwidth = 3; |
---|
2738 | | - // aWindowConstraints.gridheight = 3; |
---|
2739 | | - aWindowConstraints.gridx = 1; |
---|
2740 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2741 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2742 | | - aWindowConstraints.weightx = 0; |
---|
2743 | | - aWindowConstraints.gridx = 4; |
---|
2744 | | - aWindowConstraints.gridwidth = 1; |
---|
2745 | | - // aWindowConstraints.gridheight = 3; |
---|
2746 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2747 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2748 | | - bigThree.revalidate(); |
---|
| 2866 | + |
---|
| 2867 | +// bigThree.remove(scenePanel); |
---|
| 2868 | +// bigThree.remove(centralPanel); |
---|
| 2869 | +// bigThree.remove(XYZPanel); |
---|
| 2870 | +// aWindowConstraints.gridx = 0; |
---|
| 2871 | +// aWindowConstraints.gridy = 0; |
---|
| 2872 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2873 | +// // aConstraints.gridheight = 3; |
---|
| 2874 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2875 | +// aWindowConstraints.weightx = 0; |
---|
| 2876 | +// aWindowConstraints.weighty = 1; |
---|
| 2877 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2878 | +// aWindowConstraints.weightx = 1; |
---|
| 2879 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2880 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2881 | +// aWindowConstraints.gridx = 1; |
---|
| 2882 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2883 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2884 | +// aWindowConstraints.weightx = 0; |
---|
| 2885 | +// aWindowConstraints.gridx = 4; |
---|
| 2886 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2887 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2888 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2889 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2890 | +// bigThree.validate(); |
---|
| 2891 | +// scenePanel.setVisible(true); |
---|
| 2892 | +// centralPanel.setVisible(true); |
---|
| 2893 | +// XYZPanel.setVisible(false); |
---|
| 2894 | + bigThree.ClearUI(); |
---|
| 2895 | + bigThree.add(scenePanel); |
---|
| 2896 | + bigThree.add(centralPanel); |
---|
| 2897 | + bigThree.FlushUI(); |
---|
2749 | 2898 | } else |
---|
2750 | | - if (event.getSource() == sevenButton) |
---|
| 2899 | + if (source == sevenButton) |
---|
2751 | 2900 | { |
---|
2752 | 2901 | radio.layout = sevenButton; |
---|
2753 | | - bigThree.remove(scenePanel); |
---|
2754 | | - bigThree.remove(cameraPanel); |
---|
2755 | | - bigThree.remove(XYZPanel); |
---|
2756 | | - aWindowConstraints.gridx = 0; |
---|
2757 | | - aWindowConstraints.gridy = 0; |
---|
2758 | | - aWindowConstraints.gridwidth = 1; |
---|
2759 | | - // aWindowConstraints.gridheight = 3; |
---|
2760 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2761 | | - aWindowConstraints.weightx = 0; |
---|
2762 | | - aWindowConstraints.weighty = 1; |
---|
2763 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2764 | | - aWindowConstraints.weightx = 1; |
---|
2765 | | - aWindowConstraints.gridwidth = 3; |
---|
2766 | | - // aWindowConstraints.gridheight = 3; |
---|
2767 | | - aWindowConstraints.gridx = 1; |
---|
2768 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2769 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2770 | | - aWindowConstraints.weightx = 0; |
---|
2771 | | - aWindowConstraints.gridx = 4; |
---|
2772 | | - aWindowConstraints.gridwidth = 1; |
---|
2773 | | - // aConstraints.gridheight = 3; |
---|
2774 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2775 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2776 | | - bigThree.revalidate(); |
---|
| 2902 | + |
---|
| 2903 | +// bigThree.remove(scenePanel); |
---|
| 2904 | +// bigThree.remove(centralPanel); |
---|
| 2905 | +// bigThree.remove(XYZPanel); |
---|
| 2906 | +// aWindowConstraints.gridx = 0; |
---|
| 2907 | +// aWindowConstraints.gridy = 0; |
---|
| 2908 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2909 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2910 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2911 | +// aWindowConstraints.weightx = 0; |
---|
| 2912 | +// aWindowConstraints.weighty = 1; |
---|
| 2913 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2914 | +// aWindowConstraints.weightx = 1; |
---|
| 2915 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2916 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2917 | +// aWindowConstraints.gridx = 1; |
---|
| 2918 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2919 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2920 | +// aWindowConstraints.weightx = 0; |
---|
| 2921 | +// aWindowConstraints.gridx = 4; |
---|
| 2922 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2923 | +// // aConstraints.gridheight = 3; |
---|
| 2924 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2925 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2926 | +// bigThree.validate(); |
---|
| 2927 | +// scenePanel.setVisible(true); |
---|
| 2928 | +// centralPanel.setVisible(true); |
---|
| 2929 | +// XYZPanel.setVisible(true); |
---|
| 2930 | + bigThree.ClearUI(); |
---|
| 2931 | + bigThree.add(scenePanel); |
---|
| 2932 | + bigThree.add(centralPanel); |
---|
| 2933 | + bigThree.add(XYZPanel); |
---|
| 2934 | + bigThree.FlushUI(); |
---|
2777 | 2935 | } else |
---|
2778 | | - if (event.getSource() == rootButton) |
---|
| 2936 | + if (source == rootButton) |
---|
2779 | 2937 | { |
---|
2780 | 2938 | Object3D obj; |
---|
2781 | 2939 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2787 | 2945 | |
---|
2788 | 2946 | refreshContents(true); |
---|
2789 | 2947 | } else |
---|
2790 | | - if (event.getSource() == closeButton) |
---|
| 2948 | + if (source == closeButton) |
---|
2791 | 2949 | { |
---|
2792 | 2950 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2793 | 2951 | cRadio ab; |
---|
.. | .. |
---|
2808 | 2966 | } |
---|
2809 | 2967 | refreshContents(true); |
---|
2810 | 2968 | } else |
---|
2811 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 2969 | + if (source == editItem || source == editButton) |
---|
2812 | 2970 | { |
---|
2813 | 2971 | EditSelection(false); |
---|
2814 | 2972 | } else |
---|
2815 | | - if (event.getSource() == uneditButton) |
---|
| 2973 | + if (source == uneditButton) |
---|
2816 | 2974 | { |
---|
2817 | 2975 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2818 | 2976 | { |
---|
.. | .. |
---|
2824 | 2982 | |
---|
2825 | 2983 | child.editWindow = null; // ??????????? |
---|
2826 | 2984 | } |
---|
2827 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 2985 | + objEditor.ctrlPanel.FlushUI(); |
---|
2828 | 2986 | //objEditor.jTree.clearSelection(); |
---|
2829 | 2987 | //objEditor.ResetSliders(); |
---|
2830 | 2988 | refreshContents(true); |
---|
2831 | 2989 | } else |
---|
2832 | | - if (event.getSource() == clearPanelButton) |
---|
| 2990 | + if (source == clearPanelButton) |
---|
2833 | 2991 | { |
---|
2834 | 2992 | assert(copy == group); |
---|
2835 | 2993 | //copy.ClearUI(); |
---|
.. | .. |
---|
2840 | 2998 | listUI.clear(); |
---|
2841 | 2999 | refreshContents(true); |
---|
2842 | 3000 | } else |
---|
2843 | | - if (event.getSource() == allParamsButton) |
---|
| 3001 | + if (source == allParamsButton) |
---|
2844 | 3002 | { |
---|
2845 | 3003 | assert(copy == group); |
---|
2846 | 3004 | |
---|
.. | .. |
---|
2861 | 3019 | |
---|
2862 | 3020 | refreshContents(true); |
---|
2863 | 3021 | } else |
---|
2864 | | - if (event.getSource() == unselectButton) |
---|
| 3022 | + if (source == unselectButton) |
---|
2865 | 3023 | { |
---|
2866 | 3024 | objEditor.jTree.clearSelection(); |
---|
2867 | 3025 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2868 | 3026 | objEditor.ResetSliders(); |
---|
2869 | 3027 | refreshContents(true); |
---|
2870 | 3028 | } else |
---|
2871 | | - if(event.getSource() instanceof cRadio) |
---|
| 3029 | + if(source instanceof cRadio) |
---|
2872 | 3030 | { |
---|
2873 | 3031 | group.parent = keepparent; |
---|
2874 | 3032 | group.attributes = 0; |
---|
2875 | 3033 | //group.editWindow = null; |
---|
2876 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3034 | + /*cRadio*/ radio = (cRadio)source; |
---|
2877 | 3035 | Object3D obj = radio.GetObject(); |
---|
2878 | 3036 | System.out.println("Edit " + obj); |
---|
2879 | 3037 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2893 | 3051 | } |
---|
2894 | 3052 | |
---|
2895 | 3053 | copy = group; |
---|
2896 | | - //CameraPane.theRenderer.object = group; |
---|
| 3054 | + //Globals.theRenderer.object = group; |
---|
2897 | 3055 | if(!useclient) |
---|
2898 | 3056 | { |
---|
2899 | 3057 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2902 | 3060 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2903 | 3061 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2904 | 3062 | cameraView.object = group; |
---|
2905 | | - cameraView.lighttouched = true; |
---|
| 3063 | + //cameraView.lighttouched = true; |
---|
| 3064 | + Globals.lighttouched = true; |
---|
2906 | 3065 | topView.object = group; |
---|
2907 | 3066 | frontView.object = group; |
---|
2908 | 3067 | sideView.object = group; |
---|
.. | .. |
---|
2938 | 3097 | if (useclient) |
---|
2939 | 3098 | { |
---|
2940 | 3099 | cameraView.object = client; |
---|
2941 | | - cameraView.lighttouched = true; |
---|
| 3100 | + Globals.lighttouched = true; |
---|
2942 | 3101 | //topView.object = client; |
---|
2943 | 3102 | //frontView.object = client; |
---|
2944 | 3103 | //sideView.object = client; |
---|
.. | .. |
---|
2946 | 3105 | else |
---|
2947 | 3106 | { |
---|
2948 | 3107 | cameraView.object = group; |
---|
2949 | | - cameraView.lighttouched = true; |
---|
| 3108 | + Globals.lighttouched = true; |
---|
2950 | 3109 | //topView.object = group; |
---|
2951 | 3110 | //frontView.object = group; |
---|
2952 | 3111 | //sideView.object = group; |
---|
.. | .. |
---|
3454 | 3613 | String pigment = Object3D.GetPigment(tex); |
---|
3455 | 3614 | //String bump = Object3D.GetBump(tex); |
---|
3456 | 3615 | |
---|
3457 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3616 | + com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
3458 | 3617 | |
---|
3459 | 3618 | double s = v.s; |
---|
3460 | 3619 | |
---|
.. | .. |
---|
3542 | 3701 | |
---|
3543 | 3702 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3544 | 3703 | |
---|
3545 | | - boolean random = CameraPane.RANDOM; |
---|
3546 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3704 | + boolean random = CameraPane.SWITCH; |
---|
| 3705 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3547 | 3706 | lowres.linkVerticesThis(null); |
---|
3548 | 3707 | lowres.linkVerticesThis(sn); |
---|
3549 | | - CameraPane.RANDOM = random; |
---|
| 3708 | + CameraPane.SWITCH = random; |
---|
3550 | 3709 | |
---|
3551 | 3710 | System.err.flush(); |
---|
3552 | 3711 | |
---|
.. | .. |
---|
3755 | 3914 | group.selection.RelinkToSupport(); // july 2014 |
---|
3756 | 3915 | System.out.println("DONE."); |
---|
3757 | 3916 | refreshContents(); |
---|
3758 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 3917 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3759 | 3918 | } |
---|
3760 | 3919 | |
---|
3761 | 3920 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
4031 | 4190 | System.err.println("info : " + child.GetPath()); |
---|
4032 | 4191 | } |
---|
4033 | 4192 | } |
---|
4034 | | - else |
---|
4035 | | - { |
---|
4036 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4037 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4038 | | - System.err.println("info : " + group.GetPath()); |
---|
4039 | | - } |
---|
| 4193 | +// else |
---|
| 4194 | +// { |
---|
| 4195 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4196 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4197 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4198 | +// } |
---|
4040 | 4199 | |
---|
4041 | 4200 | objEditor.SetText(); // jan 2014 |
---|
4042 | 4201 | |
---|
4043 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4202 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
4044 | 4203 | CameraPane.flash = true; |
---|
4045 | 4204 | |
---|
4046 | 4205 | if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
4047 | 4206 | // a camera |
---|
4048 | 4207 | { |
---|
4049 | 4208 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4050 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
4051 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
4052 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4209 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4210 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4211 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4053 | 4212 | } |
---|
4054 | 4213 | |
---|
4055 | 4214 | refreshContents(); |
---|
.. | .. |
---|
4304 | 4463 | refreshContents(); |
---|
4305 | 4464 | } |
---|
4306 | 4465 | |
---|
4307 | | - void pasteInto(boolean copyit) |
---|
| 4466 | + void pasteInto(boolean copyit, boolean clone) |
---|
4308 | 4467 | { |
---|
4309 | 4468 | // if (GrafreeD.clipboard == null) |
---|
4310 | 4469 | // return; |
---|
.. | .. |
---|
4333 | 4492 | if (copyit) |
---|
4334 | 4493 | { |
---|
4335 | 4494 | // paste(false); |
---|
4336 | | - CloneClipboard(false); // sept 2014 |
---|
| 4495 | + if (clone) |
---|
| 4496 | + { |
---|
| 4497 | + CloneClipboard(false); // sept 2014 |
---|
| 4498 | + } |
---|
| 4499 | + else |
---|
| 4500 | + { |
---|
| 4501 | + paste(false); |
---|
| 4502 | + } |
---|
4337 | 4503 | } |
---|
4338 | 4504 | else |
---|
4339 | 4505 | { |
---|
.. | .. |
---|
4877 | 5043 | cButton flashSelectionButton; |
---|
4878 | 5044 | cButton editButton; |
---|
4879 | 5045 | cButton uneditButton; |
---|
| 5046 | + JCheckBox allParamsButton; |
---|
4880 | 5047 | cButton clearpanelButton; |
---|
4881 | | - cButton allParamsButton; |
---|
4882 | 5048 | cButton unselectButton; |
---|
4883 | 5049 | |
---|
| 5050 | + cButton oneStepButton; |
---|
| 5051 | + |
---|
4884 | 5052 | cButton screenfitButton; |
---|
4885 | 5053 | cButton screenfitpointButton; |
---|
4886 | 5054 | cButton snapobjectButton; |
---|
.. | .. |
---|
4935 | 5103 | private MenuItem mergeGeometriesItem; |
---|
4936 | 5104 | private MenuItem copyItem; |
---|
4937 | 5105 | private MenuItem pasteItem; |
---|
| 5106 | + private MenuItem pasteIntoItem; |
---|
4938 | 5107 | private MenuItem pasteLinkItem; |
---|
4939 | 5108 | private MenuItem pasteCloneItem; |
---|
4940 | 5109 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5007 | 5176 | |
---|
5008 | 5177 | private MenuItem resetParentItem; |
---|
5009 | 5178 | private MenuItem repairParentItem; |
---|
| 5179 | + private MenuItem repairShadowItem; |
---|
5010 | 5180 | private MenuItem sortbysizeItem; |
---|
5011 | 5181 | private MenuItem sortbynameItem; |
---|
5012 | 5182 | |
---|
.. | .. |
---|
5031 | 5201 | private MenuItem blobItem; |
---|
5032 | 5202 | private MenuItem latheItem; |
---|
5033 | 5203 | private MenuItem bezierItem; |
---|
5034 | | - private MenuItem checkerItem; |
---|
| 5204 | + private MenuItem overlayItem; |
---|
5035 | 5205 | private MenuItem meshItem; |
---|
5036 | 5206 | // private MenuItem meshGroupItem; |
---|
5037 | 5207 | private MenuItem springItem; |
---|