.. | .. |
---|
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, |
---|
.. | .. |
---|
73 | 74 | this.copy = this.group = copy; |
---|
74 | 75 | //selectees = this.group.selectees; |
---|
75 | 76 | |
---|
76 | | - SetupMenu2(objEditor); |
---|
| 77 | + SetupMenu2(this); //objEditor); |
---|
77 | 78 | SetupUI2(objEditor); |
---|
78 | 79 | objEditor.SetupUI(true); |
---|
79 | 80 | SetupViews(objEditor); |
---|
.. | .. |
---|
97 | 98 | |
---|
98 | 99 | void CloneClipboard(boolean supports) |
---|
99 | 100 | { |
---|
100 | | - assert(GrafreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
102 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
104 | | - makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
| 101 | + assert(Grafreed.clipboard.parent == null); |
---|
| 102 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 103 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 104 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 105 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
105 | 106 | else |
---|
106 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
107 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 109 | } |
---|
109 | 110 | |
---|
110 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 119 | // obj.support = null; |
---|
119 | 120 | if (!supports) |
---|
120 | 121 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 123 | obj.parent = parent; |
---|
123 | 124 | // obj.support = support; |
---|
124 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
147 | 148 | |
---|
148 | 149 | //JTextField nameField; |
---|
149 | 150 | |
---|
150 | | - void SetupMenu2(ObjEditor oe) |
---|
| 151 | + void SetupMenu2(GroupEditor oe) |
---|
151 | 152 | { |
---|
| 153 | + Menu menu; |
---|
| 154 | + oe.menuBar.add(menu = new Menu("Edit")); |
---|
| 155 | + //editItem = menu.add(new MenuItem("Edit")); |
---|
| 156 | + //editItem.addActionListener(this); |
---|
| 157 | + |
---|
| 158 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 159 | +// undoItem.addActionListener(this); |
---|
| 160 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 161 | +// redoItem.addActionListener(this); |
---|
| 162 | +// menu.add("-"); |
---|
| 163 | + duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 164 | + duplicateItem.addActionListener(this); |
---|
| 165 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 166 | + cloneItem.addActionListener(this); |
---|
| 167 | + if (Globals.ADVANCED) |
---|
| 168 | + { |
---|
| 169 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 170 | + cloneSupportItem.addActionListener(this); |
---|
| 171 | + } |
---|
| 172 | + menu.add("-"); |
---|
| 173 | + cutItem = menu.add(new MenuItem("Cut")); |
---|
| 174 | + cutItem.addActionListener(this); |
---|
| 175 | + copyItem = menu.add(new MenuItem("Copy")); |
---|
| 176 | + copyItem.addActionListener(this); |
---|
| 177 | + pasteItem = menu.add(new MenuItem("Paste")); |
---|
| 178 | + pasteItem.addActionListener(this); |
---|
| 179 | + menu.add("-"); |
---|
| 180 | + |
---|
| 181 | + menu.add("-"); |
---|
| 182 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 183 | + pasteIntoItem.addActionListener(this); |
---|
| 184 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 185 | + pasteLinkItem.addActionListener(this); |
---|
| 186 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 187 | + pasteCloneItem.addActionListener(this); |
---|
| 188 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 189 | +// pasteExpandItem.addActionListener(this); |
---|
| 190 | + menu.add("-"); |
---|
| 191 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 192 | + clearItem.addActionListener(this); |
---|
| 193 | + |
---|
| 194 | + if (Globals.ADVANCED) |
---|
| 195 | + { |
---|
| 196 | + // Deletes the cameras... |
---|
| 197 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 198 | + clearAllItem.addActionListener(this); |
---|
| 199 | + } |
---|
| 200 | + |
---|
| 201 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 202 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 203 | + //zBufferItem.addActionListener(this); |
---|
| 204 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 205 | + //normalLensItem.addActionListener(this); |
---|
| 206 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 207 | + revertCameraItem.addActionListener(this); |
---|
| 208 | + |
---|
| 209 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 210 | + toggleFullScreenItem.addItemListener(this); |
---|
| 211 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 212 | + cameraMenu.add("-"); |
---|
| 213 | + |
---|
| 214 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 215 | + toggleTextureItem.addItemListener(this); |
---|
| 216 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 217 | + |
---|
| 218 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 219 | + toggleSwitchItem.addItemListener(this); |
---|
| 220 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 221 | + |
---|
| 222 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 223 | + toggleHandleItem.addItemListener(this); |
---|
| 224 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 225 | + |
---|
| 226 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 227 | + togglePaintItem.addItemListener(this); |
---|
| 228 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 229 | + |
---|
| 230 | + if (Globals.ADVANCED) |
---|
| 231 | + { |
---|
| 232 | + cameraMenu.add("-"); |
---|
| 233 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 234 | + toggleLiveItem.addItemListener(this); |
---|
| 235 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 236 | + |
---|
| 237 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 238 | + stepItem.addActionListener(this); |
---|
| 239 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 240 | + // toggleDLItem.addItemListener(this); |
---|
| 241 | + // toggleDLItem.setState(false); |
---|
| 242 | + |
---|
| 243 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 244 | + toggleRenderItem.addItemListener(this); |
---|
| 245 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 246 | + |
---|
| 247 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 248 | + toggleDebugItem.addItemListener(this); |
---|
| 249 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 250 | + |
---|
| 251 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 252 | + toggleFrustumItem.addItemListener(this); |
---|
| 253 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 254 | + |
---|
| 255 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 256 | + toggleFootContactItem.addItemListener(this); |
---|
| 257 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 258 | + |
---|
| 259 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 260 | + toggleTimelineItem.addItemListener(this); |
---|
| 261 | + } |
---|
| 262 | + |
---|
| 263 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 264 | +// toggleRootItem.addItemListener(this); |
---|
| 265 | +// toggleRootItem.setState(false); |
---|
| 266 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 267 | +// animationItem.addItemListener(this); |
---|
| 268 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 269 | + cameraMenu.add("-"); |
---|
| 270 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 271 | + editCameraItem.addActionListener(this); |
---|
| 272 | + |
---|
| 273 | + if (Globals.ADVANCED) |
---|
| 274 | + { |
---|
152 | 275 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 276 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 277 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 283 | lookAtItem.addActionListener(this); |
---|
161 | 284 | //lookFromItem.addActinoListener(this); |
---|
162 | 285 | //switchItem.addActionListener(this); |
---|
163 | | - Menu menu; |
---|
164 | | - oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | | - //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | | - //editItem.addActionListener(this); |
---|
167 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
168 | | - duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | | - cloneItem.addActionListener(this); |
---|
172 | | - cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | | - cloneSupportItem.addActionListener(this); |
---|
174 | | - menu.add("-"); |
---|
175 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | | - cutItem.addActionListener(this); |
---|
177 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
178 | | - copyItem.addActionListener(this); |
---|
179 | | - pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | | - pasteItem.addActionListener(this); |
---|
181 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | | - pasteLinkItem.addActionListener(this); |
---|
183 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | | - pasteCloneItem.addActionListener(this); |
---|
185 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | | -// pasteExpandItem.addActionListener(this); |
---|
187 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | | - clearItem.addActionListener(this); |
---|
189 | | - clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | | - clearAllItem.addActionListener(this); |
---|
191 | | - |
---|
| 286 | + } |
---|
| 287 | + |
---|
192 | 288 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
193 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
194 | | - resetMeshItem.addActionListener(this); |
---|
195 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
196 | | - stepAllItem.addActionListener(this); |
---|
| 289 | + if (Globals.ADVANCED) |
---|
| 290 | + { |
---|
197 | 291 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 292 | revertMeshItem.addActionListener(this); |
---|
199 | 293 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 294 | resetreferencesItem.addActionListener(this); |
---|
201 | 295 | menu.add("-"); |
---|
| 296 | + } |
---|
202 | 297 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 298 | overwriteGeoItem.addActionListener(this); |
---|
204 | 299 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 305 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 306 | overwriteUVItem.addActionListener(this); |
---|
212 | 307 | menu.add("-"); |
---|
| 308 | + if (Globals.ADVANCED) |
---|
| 309 | + { |
---|
213 | 310 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 311 | generateMeshItem.addActionListener(this); |
---|
215 | 312 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 313 | poseMeshItem.addActionListener(this); |
---|
217 | 314 | menu.add("-"); |
---|
| 315 | + } |
---|
218 | 316 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 317 | resetsupportItem.addActionListener(this); |
---|
220 | 318 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 319 | linkverticesItem.addActionListener(this); |
---|
222 | 320 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 321 | relinkverticesItem.addActionListener(this); |
---|
| 322 | + |
---|
| 323 | + if (Globals.ADVANCED) |
---|
| 324 | + { |
---|
224 | 325 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 326 | setMasterItem.addActionListener(this); |
---|
| 327 | + } |
---|
226 | 328 | |
---|
227 | 329 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | 330 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
233 | 335 | frontItem.addActionListener(this); |
---|
234 | 336 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | 337 | compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 338 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 339 | hideItem.addActionListener(this); |
---|
238 | 340 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 341 | ungroupItem.addActionListener(this); |
---|
240 | 342 | menu.add("-"); |
---|
241 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 343 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
242 | 344 | 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 | 345 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 346 | switchGeoItem.addActionListener(this); |
---|
249 | 347 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 348 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 349 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 350 | morphItem.addActionListener(this); |
---|
| 351 | + |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
| 354 | + menu.add("-"); |
---|
| 355 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 356 | + physicsItem.addActionListener(this); |
---|
| 357 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 358 | + frameselectorItem.addActionListener(this); |
---|
253 | 359 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 360 | scriptNodeItem.addActionListener(this); |
---|
255 | 361 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | 362 | cameraItem.addActionListener(this); |
---|
| 363 | + } |
---|
257 | 364 | |
---|
258 | 365 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | 366 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
268 | 375 | shadowYItem.addActionListener(this); |
---|
269 | 376 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
270 | 377 | shadowZItem.addActionListener(this); |
---|
| 378 | + if (Globals.ADVANCED) |
---|
| 379 | + { |
---|
| 380 | + menu.add("-"); |
---|
271 | 381 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 382 | linkerItem.addActionListener(this); |
---|
273 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
274 | | - templateItem.addActionListener(this); |
---|
275 | 383 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | 384 | attributeItem.addActionListener(this); |
---|
| 385 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 386 | + templateItem.addActionListener(this); |
---|
277 | 387 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 388 | pointflowItem.addActionListener(this); |
---|
| 389 | + } |
---|
279 | 390 | menu.add("-"); |
---|
280 | 391 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 392 | resetTransformItem.addActionListener(this); |
---|
282 | 393 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
283 | 394 | resetCentroidItem.addActionListener(this); |
---|
284 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
285 | | - transformgeometryItem.addActionListener(this); |
---|
| 395 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 396 | + resetCentroidXZItem.addActionListener(this); |
---|
| 397 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 398 | + transformGeometryItem.addActionListener(this); |
---|
| 399 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 400 | + transformChildrenItem.addActionListener(this); |
---|
286 | 401 | |
---|
287 | 402 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
288 | 403 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
293 | 408 | genNormalsCADItem.addActionListener(this); |
---|
294 | 409 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 410 | genNormalsMESHItem.addActionListener(this); |
---|
| 411 | + if (Globals.ADVANCED) |
---|
| 412 | + { |
---|
296 | 413 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
297 | 414 | genNormalsMINEItem.addActionListener(this); |
---|
| 415 | + } |
---|
298 | 416 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 417 | stripifyItem.addActionListener(this); |
---|
300 | 418 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 434 | reduce34MeshItem.addActionListener(this); |
---|
317 | 435 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 436 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 437 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 438 | clipMeshItem.addActionListener(this); |
---|
| 439 | + |
---|
| 440 | + if (Globals.ADVANCED) |
---|
| 441 | + { |
---|
| 442 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 443 | + smoothMeshItem.addActionListener(this); |
---|
| 444 | + } |
---|
323 | 445 | |
---|
324 | 446 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 447 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
326 | 448 | clearMaterialsItem.addActionListener(this); |
---|
| 449 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 450 | + resetAllItem.addActionListener(this); |
---|
| 451 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 452 | + stepAllItem.addActionListener(this); |
---|
327 | 453 | menu.add("-"); |
---|
328 | 454 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
329 | 455 | liveleavesItem.addActionListener(this); |
---|
330 | 456 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 457 | unliveleavesItem.addActionListener(this); |
---|
| 458 | + if (Globals.ADVANCED) |
---|
| 459 | + { |
---|
332 | 460 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 461 | supportleavesItem.addActionListener(this); |
---|
334 | 462 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 463 | unsupportleavesItem.addActionListener(this); |
---|
| 464 | + } |
---|
336 | 465 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 466 | hideleavesItem.addActionListener(this); |
---|
338 | 467 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
376 | 505 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 506 | sortbynameItem.addActionListener(this); |
---|
378 | 507 | menu.add("-"); |
---|
| 508 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 509 | + shareGeometriesItem.addActionListener(this); |
---|
| 510 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 511 | + mergeGeometriesItem.addActionListener(this); |
---|
| 512 | + if (Globals.ADVANCED) |
---|
| 513 | + { |
---|
| 514 | + // Pretty much the same as duplicate and clone. |
---|
379 | 515 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 516 | extractGeometriesItem.addActionListener(this); |
---|
381 | 517 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
382 | 518 | cloneGeometriesItem.addActionListener(this); |
---|
383 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
384 | | - shareGeometriesItem.addActionListener(this); |
---|
385 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
386 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 519 | + } |
---|
387 | 520 | |
---|
388 | 521 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 522 | buildCreateMenu(menu); |
---|
390 | 523 | |
---|
391 | | - |
---|
392 | | - 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...")); |
---|
398 | | - importOBJItem.addActionListener(this); |
---|
399 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
400 | | - import3DSItem.addActionListener(this); |
---|
401 | | - |
---|
402 | 524 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 525 | buildToolsMenu(menu); |
---|
404 | 526 | } |
---|
.. | .. |
---|
433 | 555 | oe.radioPanel.add(dummyButton); |
---|
434 | 556 | oe.buttonGroup.add(dummyButton); |
---|
435 | 557 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
437 | | - oe.aConstraints.gridwidth = 1; |
---|
438 | | - oe.aConstraints.gridx = 0; |
---|
| 558 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
439 | 559 | |
---|
440 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 560 | + oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 561 | + undoButton.setToolTipText("Undo changes"); |
---|
| 562 | + undoButton.addActionListener(this); |
---|
| 563 | + |
---|
| 564 | + oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 565 | + redoButton.setToolTipText("Redo changes"); |
---|
| 566 | + redoButton.addActionListener(this); |
---|
| 567 | + |
---|
| 568 | + oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 569 | + saveButton.setToolTipText("Save changes"); |
---|
| 570 | + saveButton.addActionListener(this); |
---|
| 571 | + |
---|
| 572 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 573 | + liveCB.setToolTipText("Enable animation"); |
---|
441 | 574 | liveCB.addItemListener(this); |
---|
442 | 575 | |
---|
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); |
---|
| 576 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 577 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 578 | + oneStepButton.addActionListener(this); |
---|
| 579 | + |
---|
| 580 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 581 | + fastCB.setToolTipText("Fast mode"); |
---|
461 | 582 | 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); |
---|
| 583 | + |
---|
| 584 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 585 | + trackCB.setToolTipText("Enable tracking"); |
---|
503 | 586 | trackCB.addItemListener(this); |
---|
504 | 587 | |
---|
505 | | - oe.aConstraints.gridx += 1; |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 588 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 589 | + screenfitButton.setToolTipText("Screen fit"); |
---|
507 | 590 | screenfitButton.addActionListener(this); |
---|
508 | | - oe.aConstraints.gridx += 1; |
---|
| 591 | + |
---|
509 | 592 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
510 | 593 | // 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 | 594 | |
---|
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); |
---|
| 595 | + if (Globals.ADVANCED) |
---|
| 596 | + { |
---|
| 597 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 598 | + snapobjectButton.addActionListener(this); |
---|
| 599 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 600 | + } |
---|
| 601 | + |
---|
| 602 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 603 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | 604 | flashSelectionButton.addActionListener(this); |
---|
523 | 605 | |
---|
524 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
| 606 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | 607 | |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - // |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 608 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 609 | + twoButton.setToolTipText("Show center view only"); |
---|
532 | 610 | twoButton.addActionListener(this); |
---|
533 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 611 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
534 | 612 | fourButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 613 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 614 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + sixButton.setToolTipText("2-column layout left"); |
---|
536 | 616 | sixButton.addActionListener(this); |
---|
537 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 617 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 618 | + threeButton.setToolTipText("2-column layout right"); |
---|
538 | 619 | threeButton.addActionListener(this); |
---|
539 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 620 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 621 | + sevenButton.setToolTipText("3-column layout"); |
---|
540 | 622 | sevenButton.addActionListener(this); |
---|
541 | 623 | // |
---|
542 | 624 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 625 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 626 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
544 | 627 | rootButton.addActionListener(this); |
---|
545 | | - oe.aConstraints.gridx += 1; |
---|
546 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 628 | + |
---|
| 629 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + closeButton.setToolTipText("Close tab"); |
---|
547 | 631 | closeButton.addActionListener(this); |
---|
548 | 632 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
549 | 633 | //clearButton.addActionListener(this); |
---|
550 | | - oe.aConstraints.gridx += 1; |
---|
551 | 634 | |
---|
552 | | - oe.aConstraints.gridx = 1; // |
---|
553 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 635 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 636 | + |
---|
| 637 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 638 | + editButton.setToolTipText("Edit selection"); |
---|
554 | 639 | editButton.addActionListener(this); |
---|
555 | | - oe.aConstraints.gridx += 1; |
---|
556 | | - oe.aConstraints.weighty = 0; |
---|
557 | | - oe.aConstraints.gridwidth = 1; |
---|
558 | 640 | |
---|
559 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 641 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + uneditButton.setToolTipText("Unedit selection"); |
---|
560 | 643 | uneditButton.addActionListener(this); |
---|
561 | 644 | |
---|
562 | | - oe.aConstraints.gridx += 1; |
---|
563 | | - oe.aConstraints.weighty = 0; |
---|
564 | | - oe.aConstraints.gridwidth = 1; |
---|
565 | | - |
---|
566 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
567 | | - clearPanelButton.addActionListener(this); |
---|
568 | | - |
---|
569 | | - oe.aConstraints.gridx += 1; |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 1; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 645 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 646 | + allParamsButton.setToolTipText("Edit all params"); |
---|
574 | 647 | allParamsButton.addActionListener(this); |
---|
575 | 648 | |
---|
576 | | - oe.aConstraints.gridx += 1; |
---|
577 | | - oe.aConstraints.weighty = 0; |
---|
578 | | - oe.aConstraints.gridwidth = 1; |
---|
579 | | - |
---|
580 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 649 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 650 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 651 | + clearPanelButton.addActionListener(this); |
---|
| 652 | + |
---|
| 653 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + unselectButton.setToolTipText("Unselect"); |
---|
581 | 655 | unselectButton.addActionListener(this); |
---|
582 | 656 | |
---|
| 657 | + commandsPanel.preferredHeight = 1; |
---|
| 658 | + |
---|
| 659 | + oe.treePanel.add(commandsPanel); |
---|
| 660 | + oe.treePanel.Return(); |
---|
| 661 | + |
---|
583 | 662 | // oe.aConstraints.gridx += 1; |
---|
584 | 663 | // oe.aConstraints.weighty = 0; |
---|
585 | 664 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
591 | 670 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
592 | 671 | // gcButton.addActionListener(this); |
---|
593 | 672 | |
---|
594 | | - oe.aConstraints.gridx = 0; |
---|
595 | | - oe.aConstraints.gridy += 1; |
---|
596 | | - |
---|
597 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
598 | | - oe.aConstraints.gridwidth = 100; |
---|
599 | | - // oe.aConstraints.gridheight = 100; |
---|
600 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
601 | | - oe.aConstraints.gridheight = 1; |
---|
602 | | - oe.aConstraints.weighty = 0.5; |
---|
603 | | - oe.aConstraints.gridx = 0; |
---|
604 | | - JScrollPane jSP; |
---|
| 673 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 674 | + |
---|
| 675 | + JScrollPane jSP; |
---|
605 | 676 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
606 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 677 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
607 | 678 | ResetModel(); |
---|
608 | | - oe.aConstraints.weighty = 0.5; |
---|
609 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
610 | | - oe.aConstraints.gridy += 1; |
---|
611 | | - oe.aConstraints.gridwidth = 1; |
---|
| 679 | + |
---|
| 680 | + oe.treePanel.add(jSPPanel); |
---|
| 681 | + oe.treePanel.Return(); |
---|
612 | 682 | |
---|
613 | | - oe.aConstraints.weighty = 0; |
---|
614 | | - oe.aConstraints.gridwidth = 2; |
---|
615 | | - |
---|
616 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 683 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 684 | + |
---|
| 685 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 686 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
617 | 687 | colorCB.addItemListener(this); |
---|
618 | | - oe.aConstraints.gridx += 2; |
---|
619 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 688 | + |
---|
| 689 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 690 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
620 | 691 | materialCB.addItemListener(this); |
---|
621 | | - oe.aConstraints.gridx += 2; |
---|
622 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 692 | + |
---|
| 693 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 694 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
623 | 695 | textureCB.addItemListener(this); |
---|
624 | 696 | |
---|
625 | | - oe.aConstraints.gridx = 0; |
---|
626 | | - oe.aConstraints.gridy += 1; |
---|
| 697 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 698 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 699 | + oe.treePanel.Return(); |
---|
627 | 700 | |
---|
| 701 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 702 | +// mainPanel.setResizeWeight(0.5); |
---|
| 703 | + |
---|
628 | 704 | //jList.addListSelectionListener(this); |
---|
629 | 705 | oe.jTree.addTreeSelectionListener(this); |
---|
630 | 706 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
646 | 722 | radio.layout = sevenButton; |
---|
647 | 723 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
648 | 724 | } |
---|
| 725 | + |
---|
| 726 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 727 | + { |
---|
| 728 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 729 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 730 | + boxCB.addItemListener(this); |
---|
| 731 | + |
---|
| 732 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 733 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 734 | + zoomBoxCB.addItemListener(this); |
---|
| 735 | + |
---|
| 736 | + if (true) // Globals.ADVANCED) |
---|
| 737 | + { |
---|
| 738 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 739 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 740 | + supportCB.addItemListener(this); |
---|
| 741 | + |
---|
| 742 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 743 | + // localCB.addItemListener(this); |
---|
| 744 | + |
---|
| 745 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 746 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 747 | + crowdCB.addItemListener(this); |
---|
| 748 | + |
---|
| 749 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 750 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 751 | + smoothCB.addItemListener(this); |
---|
| 752 | + |
---|
| 753 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 754 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 755 | + slowCB.addItemListener(this); |
---|
| 756 | + |
---|
| 757 | +// constraints.gridy += 1; |
---|
| 758 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 759 | +// speakerMocapCB.addItemListener(this); |
---|
| 760 | + |
---|
| 761 | + if (false) |
---|
| 762 | + { |
---|
| 763 | + // handled in scripts |
---|
| 764 | + //constraints.gridy += 1; |
---|
| 765 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 766 | + speakerCameraCB.addItemListener(this); |
---|
| 767 | + |
---|
| 768 | + //constraints.gridy += 1; |
---|
| 769 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 770 | + speakerFocusCB.addItemListener(this); |
---|
| 771 | + |
---|
| 772 | + //constraints.gridy += 1; |
---|
| 773 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 774 | + smoothfocusCB.addItemListener(this); |
---|
| 775 | + } |
---|
| 776 | + |
---|
| 777 | +//constraints.gridx += 1; |
---|
| 778 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 779 | +// debugCB.addItemListener(this); |
---|
| 780 | + |
---|
| 781 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 782 | + oeilCB.addItemListener(this); |
---|
| 783 | + |
---|
| 784 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 785 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 786 | + lookAtCB.addItemListener(this); |
---|
| 787 | + |
---|
| 788 | + } |
---|
| 789 | + |
---|
| 790 | + cGridBag fill = new cGridBag(); |
---|
| 791 | + |
---|
| 792 | + fill.preferredHeight = 200; |
---|
| 793 | + |
---|
| 794 | + panel.add(fill); |
---|
| 795 | + |
---|
| 796 | + } |
---|
649 | 797 | |
---|
650 | 798 | void EditObject(Object3D obj) |
---|
651 | 799 | { |
---|
.. | .. |
---|
658 | 806 | buttonGroup.add(radioButton); |
---|
659 | 807 | radioButton.doClick(); |
---|
660 | 808 | } |
---|
| 809 | + |
---|
661 | 810 | void SetupViews(ObjEditor oe) |
---|
662 | 811 | { |
---|
663 | 812 | oe.SetupViews(); |
---|
.. | .. |
---|
676 | 825 | JCheckBox fastCB; |
---|
677 | 826 | JCheckBox slowCB; |
---|
678 | 827 | JCheckBox boxCB; |
---|
| 828 | + JCheckBox zoomBoxCB; |
---|
679 | 829 | JCheckBox trackCB; |
---|
680 | 830 | JCheckBox smoothfocusCB; |
---|
681 | 831 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
721 | 871 | } else if(e.getSource() == liveCB) |
---|
722 | 872 | { |
---|
723 | 873 | cameraView.ToggleLive(); |
---|
| 874 | + refreshContents(false); |
---|
724 | 875 | } |
---|
725 | 876 | else if(e.getSource() == supportCB) |
---|
726 | 877 | { |
---|
.. | .. |
---|
755 | 906 | Recompile(); |
---|
756 | 907 | cameraView.repaint(); |
---|
757 | 908 | // refreshContents(); |
---|
| 909 | + } |
---|
| 910 | + else if(e.getSource() == zoomBoxCB) |
---|
| 911 | + { |
---|
| 912 | + cameraView.ToggleZoomBoxMode(); |
---|
758 | 913 | } |
---|
759 | 914 | else if(e.getSource() == smoothfocusCB) |
---|
760 | 915 | { |
---|
.. | .. |
---|
869 | 1024 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
870 | 1025 | // return; |
---|
871 | 1026 | // } |
---|
872 | | - if (string.charAt(0) == '/') |
---|
| 1027 | + |
---|
| 1028 | + // File path for Mac and Windows |
---|
| 1029 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
873 | 1030 | { |
---|
874 | 1031 | // file(s) |
---|
875 | 1032 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
896 | 1053 | |
---|
897 | 1054 | flashIt = false; |
---|
898 | 1055 | CameraPane pane = (CameraPane) target; |
---|
899 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1056 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
900 | 1057 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
901 | 1058 | |
---|
902 | 1059 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
923 | 1080 | { |
---|
924 | 1081 | loadClipboard(true); |
---|
925 | 1082 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
926 | | - pasteInto(false); |
---|
| 1083 | + pasteInto(false, false); |
---|
927 | 1084 | } else { |
---|
928 | 1085 | loadClipboard(false); |
---|
929 | 1086 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
930 | | - pasteInto(false); // true); // ??? |
---|
| 1087 | + pasteInto(false, false); // true); // ??? |
---|
931 | 1088 | } |
---|
932 | 1089 | } |
---|
933 | 1090 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1049 | 1206 | kleinItem.addActionListener(this); |
---|
1050 | 1207 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1051 | 1208 | particleItem.addActionListener(this); |
---|
| 1209 | + if (Globals.ADVANCED) |
---|
| 1210 | + { |
---|
1052 | 1211 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1053 | 1212 | ragdollItem.addActionListener(this); |
---|
1054 | 1213 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1055 | 1214 | ragdoll2Item.addActionListener(this); |
---|
| 1215 | + } |
---|
1056 | 1216 | menu.add("-"); |
---|
1057 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1217 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1058 | 1218 | meshItem.addActionListener(this); |
---|
1059 | 1219 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1060 | 1220 | // meshGroupItem.addActionListener(this); |
---|
| 1221 | + if (Globals.ADVANCED) |
---|
| 1222 | + { |
---|
1061 | 1223 | springItem = menu.add(new MenuItem("Spring")); |
---|
1062 | 1224 | springItem.addActionListener(this); |
---|
1063 | 1225 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1064 | 1226 | flagItem.addActionListener(this); |
---|
1065 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1066 | | - bezierItem.addActionListener(this); |
---|
1067 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1068 | | - checkerItem.addActionListener(this); |
---|
1069 | 1227 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1070 | 1228 | blobItem.addActionListener(this); |
---|
1071 | 1229 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1072 | 1230 | latheItem.addActionListener(this); |
---|
| 1231 | + } |
---|
| 1232 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1233 | + bezierItem.addActionListener(this); |
---|
| 1234 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1235 | + overlayItem.addActionListener(this); |
---|
1073 | 1236 | lightItem = menu.add(new MenuItem("Light")); |
---|
1074 | 1237 | lightItem.addActionListener(this); |
---|
1075 | 1238 | menu.add("-"); |
---|
.. | .. |
---|
1079 | 1242 | loopItem.addActionListener(this); |
---|
1080 | 1243 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1081 | 1244 | doubleItem.addActionListener(this); |
---|
| 1245 | + if (Globals.ADVANCED) |
---|
| 1246 | + { |
---|
1082 | 1247 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1083 | 1248 | tripleItem.addActionListener(this); |
---|
| 1249 | + } |
---|
1084 | 1250 | } |
---|
1085 | 1251 | |
---|
1086 | 1252 | void buildToolsMenu(Menu menu) |
---|
1087 | 1253 | { |
---|
1088 | 1254 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1089 | 1255 | animationItem.addItemListener(this); |
---|
1090 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1256 | + animationItem.setState(Globals.ANIMATION); |
---|
1091 | 1257 | |
---|
1092 | 1258 | menu.add("-"); |
---|
1093 | 1259 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1094 | 1260 | parseverticesItem.addActionListener(this); |
---|
1095 | 1261 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1096 | 1262 | textureFieldItem.addActionListener(this); |
---|
1097 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1263 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1098 | 1264 | alignItem.addActionListener(this); |
---|
1099 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1100 | | - mirrorItem.addActionListener(this); |
---|
1101 | 1265 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1102 | 1266 | reduceMorphItem.addActionListener(this); |
---|
1103 | 1267 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1104 | 1268 | reduce34MorphItem.addActionListener(this); |
---|
1105 | | - |
---|
| 1269 | + menu.add("-"); |
---|
1106 | 1270 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1107 | 1271 | computeAOItem.addActionListener(this); |
---|
1108 | | - menu.add("-"); |
---|
1109 | 1272 | |
---|
| 1273 | + if (Globals.ADVANCED) |
---|
| 1274 | + { |
---|
| 1275 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1276 | + mirrorItem.addActionListener(this); |
---|
| 1277 | + menu.add("-"); |
---|
1110 | 1278 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1111 | 1279 | memoryItem.addActionListener(this); |
---|
1112 | 1280 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1113 | 1281 | analyzeItem.addActionListener(this); |
---|
1114 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1282 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1115 | 1283 | dumpItem.addActionListener(this); |
---|
1116 | 1284 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1117 | 1285 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1120 | 1288 | resetParentItem.addActionListener(this); |
---|
1121 | 1289 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1122 | 1290 | repairParentItem.addActionListener(this); |
---|
| 1291 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1292 | + repairShadowItem.addActionListener(this); |
---|
1123 | 1293 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1124 | 1294 | invariantsItem.addActionListener(this); |
---|
1125 | 1295 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1127 | 1297 | menu.add("-"); |
---|
1128 | 1298 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1129 | 1299 | editScriptItem.addActionListener(this); |
---|
| 1300 | + } |
---|
1130 | 1301 | } |
---|
1131 | 1302 | |
---|
1132 | 1303 | void ScreenFit() |
---|
.. | .. |
---|
1455 | 1626 | |
---|
1456 | 1627 | void Overwrite(int mask) |
---|
1457 | 1628 | { |
---|
1458 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1629 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1459 | 1630 | { |
---|
1460 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1631 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1461 | 1632 | |
---|
1462 | 1633 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1463 | 1634 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1480 | 1651 | // |
---|
1481 | 1652 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1482 | 1653 | { |
---|
| 1654 | + Object source = event.getSource(); |
---|
1483 | 1655 | /* |
---|
1484 | 1656 | if (event.getSource() == nameField) |
---|
1485 | 1657 | { |
---|
.. | .. |
---|
1491 | 1663 | } |
---|
1492 | 1664 | else |
---|
1493 | 1665 | */ |
---|
1494 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1666 | + if (source == lookAtItem || source == lookFromItem) |
---|
1495 | 1667 | { |
---|
1496 | 1668 | ScreenFit(); |
---|
1497 | 1669 | } else |
---|
1498 | | - if (event.getSource() == switchItem) |
---|
| 1670 | + if (source == switchItem) |
---|
1499 | 1671 | { |
---|
1500 | 1672 | cVector v1 = new cVector(); |
---|
1501 | 1673 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1504 | 1676 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1505 | 1677 | objEditor.cameraView.repaint(); |
---|
1506 | 1678 | } else |
---|
1507 | | - if (event.getSource() == rectoidItem) |
---|
| 1679 | + if (source == rectoidItem) |
---|
1508 | 1680 | { |
---|
1509 | 1681 | makeSomething(new Box()); |
---|
1510 | 1682 | } else |
---|
1511 | | - if (event.getSource() == particleItem) |
---|
| 1683 | + if (source == particleItem) |
---|
1512 | 1684 | { |
---|
1513 | 1685 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1514 | 1686 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1529 | 1701 | applyExample(particleGeom, "SMOKE"); |
---|
1530 | 1702 | makeSomething(particleGeom); |
---|
1531 | 1703 | } else |
---|
1532 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1704 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1533 | 1705 | { |
---|
1534 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1706 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1535 | 1707 | |
---|
1536 | 1708 | ragdoll.toParent = LA.newMatrix(); |
---|
1537 | 1709 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1549 | 1721 | } else |
---|
1550 | 1722 | /* |
---|
1551 | 1723 | */ |
---|
1552 | | - if (event.getSource() == heightFieldItem) |
---|
| 1724 | + if (source == heightFieldItem) |
---|
1553 | 1725 | { |
---|
1554 | 1726 | Object3D obj = new Object3D(); |
---|
1555 | 1727 | |
---|
.. | .. |
---|
1587 | 1759 | |
---|
1588 | 1760 | makeSomething(obj); |
---|
1589 | 1761 | } else |
---|
1590 | | - if (event.getSource() == gridItem) |
---|
| 1762 | + if (source == gridItem) |
---|
1591 | 1763 | { |
---|
1592 | 1764 | makeSomething(new Grid()); |
---|
1593 | 1765 | } else |
---|
1594 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1766 | + if (source == ellipsoidItem) |
---|
1595 | 1767 | { |
---|
1596 | 1768 | makeSomething(new Sphere()); |
---|
1597 | 1769 | } else |
---|
1598 | | - if (event.getSource() == coneItem) |
---|
| 1770 | + if (source == coneItem) |
---|
1599 | 1771 | { |
---|
1600 | 1772 | makeSomething(new Cone()); |
---|
1601 | 1773 | } else |
---|
1602 | | - if (event.getSource() == torusItem) |
---|
| 1774 | + if (source == torusItem) |
---|
1603 | 1775 | { |
---|
1604 | 1776 | makeSomething(new Torus()); |
---|
1605 | 1777 | } else |
---|
1606 | | - if (event.getSource() == superItem) |
---|
| 1778 | + if (source == superItem) |
---|
1607 | 1779 | { |
---|
1608 | 1780 | makeSomething(new Superellipsoid()); |
---|
1609 | 1781 | } else |
---|
1610 | | - if (event.getSource() == kleinItem) |
---|
| 1782 | + if (source == kleinItem) |
---|
1611 | 1783 | { |
---|
1612 | 1784 | makeSomething(new Klein()); |
---|
1613 | 1785 | } else |
---|
1614 | | - if (event.getSource() == blobItem) |
---|
| 1786 | + if (source == blobItem) |
---|
1615 | 1787 | { |
---|
1616 | 1788 | Blob blob = new Blob(); |
---|
1617 | 1789 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1619 | 1791 | //blob.retile(); |
---|
1620 | 1792 | makeSomething(blob); |
---|
1621 | 1793 | } else |
---|
1622 | | - if (event.getSource() == latheItem) |
---|
| 1794 | + if (source == latheItem) |
---|
1623 | 1795 | { |
---|
1624 | 1796 | makeSomething(new Lathe()); |
---|
1625 | 1797 | } else |
---|
1626 | | - if (event.getSource() == bezierItem) |
---|
| 1798 | + if (source == bezierItem) |
---|
1627 | 1799 | { |
---|
1628 | 1800 | makeSomething(new BezierSurface()); |
---|
1629 | 1801 | } else |
---|
1630 | | - if (event.getSource() == checkerItem) |
---|
| 1802 | + if (source == overlayItem) |
---|
1631 | 1803 | { |
---|
1632 | 1804 | /* |
---|
1633 | 1805 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1642 | 1814 | */ |
---|
1643 | 1815 | makeSomething(new Checker()); |
---|
1644 | 1816 | } else |
---|
1645 | | - if (event.getSource() == meshItem) |
---|
| 1817 | + if (source == meshItem) |
---|
1646 | 1818 | { |
---|
1647 | 1819 | Object3D itemtomake = new Object3D(); |
---|
1648 | 1820 | Object3D child; |
---|
.. | .. |
---|
1663 | 1835 | makeSomething(child); |
---|
1664 | 1836 | } |
---|
1665 | 1837 | } else |
---|
1666 | | - if (event.getSource() == springItem) |
---|
| 1838 | + if (source == springItem) |
---|
1667 | 1839 | { |
---|
1668 | 1840 | cSpring s = new cSpring(); |
---|
1669 | 1841 | s.setup(); |
---|
1670 | 1842 | makeSomething(s); |
---|
1671 | 1843 | } else |
---|
1672 | | - if (event.getSource() == flagItem) |
---|
| 1844 | + if (source == flagItem) |
---|
1673 | 1845 | { |
---|
1674 | 1846 | cSpring s = new cFlag(); |
---|
1675 | 1847 | s.setup(); |
---|
1676 | 1848 | makeSomething(s); |
---|
1677 | 1849 | } else |
---|
1678 | | - if (event.getSource() == lightItem) |
---|
| 1850 | + if (source == lightItem) |
---|
1679 | 1851 | { |
---|
1680 | 1852 | makeSomething(new Light()); |
---|
1681 | 1853 | } else |
---|
1682 | | - if (event.getSource() == csgItem) |
---|
| 1854 | + if (source == csgItem) |
---|
1683 | 1855 | { |
---|
1684 | 1856 | group(new CSG()); |
---|
1685 | 1857 | } else |
---|
1686 | | - if (event.getSource() == templateItem) |
---|
| 1858 | + if (source == templateItem) |
---|
1687 | 1859 | { |
---|
1688 | 1860 | group(new cTemplate()); |
---|
1689 | 1861 | } else |
---|
1690 | | - if (event.getSource() == attributeItem) |
---|
| 1862 | + if (source == attributeItem) |
---|
1691 | 1863 | { |
---|
1692 | 1864 | makeSomething(new Attribute()); |
---|
1693 | 1865 | } else |
---|
1694 | | - if (event.getSource() == pointflowItem) |
---|
| 1866 | + if (source == pointflowItem) |
---|
1695 | 1867 | { |
---|
1696 | 1868 | makeSomething(new PointFlow()); |
---|
1697 | 1869 | } else |
---|
.. | .. |
---|
1703 | 1875 | } else |
---|
1704 | 1876 | */ |
---|
1705 | 1877 | |
---|
1706 | | - if (event.getSource() == superLoopItem) |
---|
| 1878 | + if (source == superLoopItem) |
---|
1707 | 1879 | { |
---|
1708 | 1880 | Composite g = new cGroup(); |
---|
1709 | 1881 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1725 | 1897 | |
---|
1726 | 1898 | group(g); |
---|
1727 | 1899 | } else |
---|
1728 | | - if (event.getSource() == loopItem) |
---|
| 1900 | + if (source == loopItem) |
---|
1729 | 1901 | { |
---|
1730 | 1902 | Composite csg = new GroupLeaf(); |
---|
1731 | 1903 | csg.count = 5; |
---|
.. | .. |
---|
1734 | 1906 | csg.addChild(child); |
---|
1735 | 1907 | child.addChild(csg); |
---|
1736 | 1908 | } else |
---|
1737 | | - if (event.getSource() == doubleItem) |
---|
| 1909 | + if (source == doubleItem) |
---|
1738 | 1910 | { |
---|
1739 | 1911 | Composite csg = new GroupLeaf(); |
---|
1740 | 1912 | csg.count = 5; |
---|
.. | .. |
---|
1746 | 1918 | csg.addChild(child); |
---|
1747 | 1919 | child.addChild(csg); |
---|
1748 | 1920 | } else |
---|
1749 | | - if (event.getSource() == tripleItem) |
---|
| 1921 | + if (source == tripleItem) |
---|
1750 | 1922 | { |
---|
1751 | 1923 | Composite csg = new GroupLeaf(); |
---|
1752 | 1924 | csg.count = 4; |
---|
.. | .. |
---|
1761 | 1933 | csg.addChild(child); |
---|
1762 | 1934 | child.addChild(csg); |
---|
1763 | 1935 | } else |
---|
1764 | | - |
---|
1765 | | - if (event.getSource() == importGFDItem) |
---|
| 1936 | + if (source == computeAOItem) |
---|
1766 | 1937 | { |
---|
1767 | | - ImportGFD(); |
---|
| 1938 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1939 | + Globals.theRenderer.repaint(); |
---|
1768 | 1940 | } else |
---|
1769 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1770 | | - { |
---|
1771 | | - ImportVRMLX3D(); |
---|
1772 | | - } else |
---|
1773 | | - if (event.getSource() == import3DSItem) |
---|
1774 | | - { |
---|
1775 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1776 | | - } else |
---|
1777 | | - if (event.getSource() == importOBJItem) |
---|
1778 | | - { |
---|
1779 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1780 | | - } else |
---|
1781 | | - if (event.getSource() == computeAOItem) |
---|
1782 | | - { |
---|
1783 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1784 | | - CameraPane.theRenderer.repaint(); |
---|
1785 | | - } else |
---|
1786 | | - if (event.getSource() == recompileItem) |
---|
| 1941 | + if (source == recompileItem) |
---|
1787 | 1942 | { |
---|
1788 | 1943 | Recompile(); |
---|
1789 | 1944 | refreshContents(); |
---|
1790 | 1945 | } else |
---|
1791 | | - if (event.getSource() == editScriptItem) |
---|
| 1946 | + if (source == editScriptItem) |
---|
1792 | 1947 | { |
---|
1793 | 1948 | OpenDialog(); |
---|
1794 | 1949 | refreshContents(); |
---|
1795 | 1950 | } else |
---|
1796 | | - if (event.getSource() == invariantsItem) |
---|
| 1951 | + if (source == invariantsItem) |
---|
1797 | 1952 | { |
---|
1798 | 1953 | System.out.println("Invariants:"); |
---|
1799 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1954 | + Grafreed.grafreeD.universe.invariants(); |
---|
1800 | 1955 | } else |
---|
1801 | | - if (event.getSource() == memoryItem) |
---|
| 1956 | + if (source == memoryItem) |
---|
1802 | 1957 | { |
---|
1803 | 1958 | //System.out.println("Invariants:"); |
---|
1804 | 1959 | PrintMemory(); |
---|
1805 | 1960 | } else |
---|
1806 | | - if (event.getSource() == pathItem) |
---|
| 1961 | + if (source == pathItem) |
---|
1807 | 1962 | { |
---|
1808 | 1963 | PrintPath(); |
---|
1809 | 1964 | } else |
---|
1810 | | - if (event.getSource() == analyzeItem) |
---|
| 1965 | + if (source == analyzeItem) |
---|
1811 | 1966 | { |
---|
1812 | 1967 | AnalyzeObject(); |
---|
1813 | 1968 | } else |
---|
1814 | | - if (event.getSource() == dumpItem) |
---|
| 1969 | + if (source == dumpItem) |
---|
1815 | 1970 | { |
---|
1816 | 1971 | DumpObject(); |
---|
1817 | 1972 | } else |
---|
1818 | | - if (event.getSource() == screenfitButton) |
---|
| 1973 | + if (source == undoButton) |
---|
| 1974 | + { |
---|
| 1975 | + Undo(); |
---|
| 1976 | + } else |
---|
| 1977 | + if (source == redoButton) |
---|
| 1978 | + { |
---|
| 1979 | + Redo(); |
---|
| 1980 | + } else |
---|
| 1981 | + if (source == saveButton) |
---|
| 1982 | + { |
---|
| 1983 | + Save(); |
---|
| 1984 | + } else |
---|
| 1985 | + if (source == oneStepButton) |
---|
| 1986 | + { |
---|
| 1987 | + Globals.ONESTEP = true; |
---|
| 1988 | + cameraView.repaint(); |
---|
| 1989 | + } else |
---|
| 1990 | + if (source == screenfitButton) |
---|
1819 | 1991 | { |
---|
1820 | 1992 | //Reload(lastConverter, lastFilename, true); |
---|
1821 | 1993 | ScreenFit(); |
---|
1822 | 1994 | } else |
---|
1823 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1995 | + if (source == screenfitpointButton) |
---|
1824 | 1996 | { |
---|
1825 | 1997 | //Reload(lastConverter, lastFilename, true); |
---|
1826 | 1998 | ScreenFitPoint(); |
---|
1827 | 1999 | } else |
---|
1828 | | - if (event.getSource() == snapobjectButton) |
---|
| 2000 | + if (source == snapobjectButton) |
---|
1829 | 2001 | { |
---|
1830 | 2002 | //Reload(lastConverter, lastFilename, true); |
---|
1831 | 2003 | SnapObject(); |
---|
.. | .. |
---|
1836 | 2008 | // Recompile(); |
---|
1837 | 2009 | // refreshContents(); |
---|
1838 | 2010 | // } else |
---|
1839 | | - if (event.getSource() == gcButton) |
---|
| 2011 | + if (source == gcButton) |
---|
1840 | 2012 | { |
---|
1841 | 2013 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1842 | 2014 | System.gc(); |
---|
1843 | 2015 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1844 | 2016 | } else |
---|
1845 | | - if (event.getSource() == editLeafItem) |
---|
| 2017 | + if (source == editLeafItem) |
---|
1846 | 2018 | { |
---|
1847 | 2019 | Object3D obj; |
---|
1848 | 2020 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1856 | 2028 | } |
---|
1857 | 2029 | refreshContents(true); |
---|
1858 | 2030 | } else |
---|
1859 | | - if (event.getSource() == openWindowItem) |
---|
| 2031 | + if (source == openWindowItem) |
---|
1860 | 2032 | { |
---|
1861 | 2033 | EditSelection(true); |
---|
1862 | 2034 | } else |
---|
1863 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2035 | + if (source == cutItem || source == clearButton) |
---|
1864 | 2036 | { |
---|
1865 | 2037 | loadClipboard(true); |
---|
1866 | 2038 | } else |
---|
1867 | | - if (event.getSource() == duplicateItem) |
---|
| 2039 | + if (source == undoItem) |
---|
1868 | 2040 | { |
---|
1869 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2041 | + Undo(); |
---|
| 2042 | + } else |
---|
| 2043 | + if (source == redoItem) |
---|
| 2044 | + { |
---|
| 2045 | + Redo(); |
---|
| 2046 | + } else |
---|
| 2047 | + if (source == duplicateItem) |
---|
| 2048 | + { |
---|
| 2049 | + Object3D keep = Grafreed.clipboard; |
---|
1870 | 2050 | loadClipboard(false); |
---|
1871 | 2051 | paste(false); |
---|
1872 | | - GrafreeD.clipboard = keep; |
---|
| 2052 | + Grafreed.clipboard = keep; |
---|
1873 | 2053 | } else |
---|
1874 | | - if (event.getSource() == cloneItem) |
---|
| 2054 | + if (source == cloneItem) |
---|
1875 | 2055 | { |
---|
1876 | 2056 | CloneSelection(false); |
---|
1877 | 2057 | } else |
---|
1878 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2058 | + if (source == cloneSupportItem) |
---|
1879 | 2059 | { |
---|
1880 | 2060 | CloneSelection(true); |
---|
1881 | 2061 | } else |
---|
1882 | | - if (event.getSource() == copyItem) |
---|
| 2062 | + if (source == copyItem) |
---|
1883 | 2063 | { |
---|
1884 | 2064 | loadClipboard(false); |
---|
1885 | 2065 | } else |
---|
1886 | | - if (event.getSource() == pasteItem) |
---|
| 2066 | + if (source == pasteItem) |
---|
1887 | 2067 | { |
---|
1888 | 2068 | paste(false); |
---|
1889 | 2069 | } else |
---|
1890 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2070 | + if (source == pasteIntoItem) |
---|
1891 | 2071 | { |
---|
1892 | | - pasteInto(false); |
---|
| 2072 | + pasteInto(true, false); |
---|
1893 | 2073 | } else |
---|
1894 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2074 | + if (source == pasteLinkItem) |
---|
1895 | 2075 | { |
---|
1896 | | - pasteInto(true); |
---|
| 2076 | + pasteInto(false, false); |
---|
1897 | 2077 | } else |
---|
1898 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2078 | + if (source == pasteCloneItem) |
---|
| 2079 | + { |
---|
| 2080 | + pasteInto(true, true); |
---|
| 2081 | + } else |
---|
| 2082 | + if (source == pasteExpandItem) |
---|
1899 | 2083 | { |
---|
1900 | 2084 | paste(true); |
---|
1901 | 2085 | } else |
---|
1902 | | - if (event.getSource() == synchronizeItem) |
---|
| 2086 | + if (source == synchronizeItem) |
---|
1903 | 2087 | { |
---|
1904 | 2088 | Overwrite(Object3D.TRANSFORM); |
---|
1905 | 2089 | } else |
---|
1906 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2090 | + if (source == overwriteNameItem) |
---|
1907 | 2091 | { |
---|
1908 | 2092 | Overwrite(Object3D.NAME); |
---|
1909 | 2093 | } else |
---|
1910 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2094 | + if (source == overwriteUVItem) |
---|
1911 | 2095 | { |
---|
1912 | 2096 | Overwrite(Object3D.UV); |
---|
1913 | 2097 | } else |
---|
1914 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2098 | + if (source == overwriteMatItem) |
---|
1915 | 2099 | { |
---|
1916 | 2100 | /* july 2015 |
---|
1917 | 2101 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1931 | 2115 | |
---|
1932 | 2116 | Overwrite(dropAttributes); |
---|
1933 | 2117 | } |
---|
1934 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2118 | + if (source == overwriteGeoItem) |
---|
1935 | 2119 | { |
---|
1936 | 2120 | Overwrite(Object3D.GEOMETRY); |
---|
1937 | 2121 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1948 | 2132 | // refreshContents(); |
---|
1949 | 2133 | // } |
---|
1950 | 2134 | } else |
---|
1951 | | - if (event.getSource() == generateMeshItem) |
---|
| 2135 | + if (source == generateMeshItem) |
---|
1952 | 2136 | { |
---|
1953 | 2137 | //if (group.selection.size() == 1) |
---|
1954 | 2138 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1959 | 2143 | ResetModel(); |
---|
1960 | 2144 | refreshContents(); |
---|
1961 | 2145 | } else |
---|
1962 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2146 | + if (source == extractGeometriesItem) |
---|
1963 | 2147 | { |
---|
1964 | 2148 | boolean one = false; |
---|
1965 | 2149 | |
---|
.. | .. |
---|
1986 | 2170 | ResetModel(); |
---|
1987 | 2171 | refreshContents(); |
---|
1988 | 2172 | } else |
---|
1989 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2173 | + if (source == cloneGeometriesItem) |
---|
1990 | 2174 | { |
---|
1991 | 2175 | boolean one = false; |
---|
1992 | 2176 | |
---|
.. | .. |
---|
2012 | 2196 | ResetModel(); |
---|
2013 | 2197 | refreshContents(); |
---|
2014 | 2198 | } else |
---|
2015 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2199 | + if (source == shareGeometriesItem) |
---|
2016 | 2200 | { |
---|
2017 | 2201 | boolean one = false; |
---|
2018 | 2202 | |
---|
.. | .. |
---|
2042 | 2226 | refreshContents(); |
---|
2043 | 2227 | } |
---|
2044 | 2228 | } else |
---|
2045 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2229 | + if (source == mergeGeometriesItem) |
---|
2046 | 2230 | { |
---|
2047 | 2231 | boolean one = false; |
---|
2048 | 2232 | |
---|
.. | .. |
---|
2072 | 2256 | ResetModel(); |
---|
2073 | 2257 | refreshContents(); |
---|
2074 | 2258 | } else |
---|
2075 | | - if (event.getSource() == linkverticesItem) |
---|
| 2259 | + if (source == linkverticesItem) |
---|
2076 | 2260 | { |
---|
2077 | 2261 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2078 | 2262 | // { |
---|
.. | .. |
---|
2085 | 2269 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2086 | 2270 | // refreshContents(); |
---|
2087 | 2271 | // } |
---|
2088 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2272 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2089 | 2273 | { |
---|
2090 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2274 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2091 | 2275 | |
---|
2092 | 2276 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2093 | 2277 | content = ((cGroup)content).get(0); |
---|
2094 | 2278 | |
---|
2095 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2279 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2096 | 2280 | for (int i=0; i<group.selection.size(); i++) |
---|
2097 | 2281 | { |
---|
2098 | | - boolean random = CameraPane.RANDOM; |
---|
2099 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2282 | + boolean random = CameraPane.SWITCH; |
---|
| 2283 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2100 | 2284 | group.selection.get(i).linkVerticesThis(content); |
---|
2101 | 2285 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2102 | | - CameraPane.RANDOM = random; |
---|
| 2286 | + CameraPane.SWITCH = random; |
---|
2103 | 2287 | } |
---|
2104 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2288 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2105 | 2289 | refreshContents(); |
---|
2106 | 2290 | } |
---|
2107 | 2291 | } else |
---|
2108 | | - if (event.getSource() == resetsupportItem) |
---|
| 2292 | + if (source == resetsupportItem) |
---|
2109 | 2293 | { |
---|
2110 | 2294 | for (int i=0; i<group.selection.size(); i++) |
---|
2111 | 2295 | { |
---|
2112 | | - boolean random = CameraPane.RANDOM; |
---|
2113 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2296 | + boolean random = CameraPane.SWITCH; |
---|
| 2297 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2114 | 2298 | group.selection.get(i).linkVerticesThis(null); |
---|
2115 | | - CameraPane.RANDOM = random; |
---|
| 2299 | + CameraPane.SWITCH = random; |
---|
2116 | 2300 | } |
---|
2117 | 2301 | |
---|
2118 | 2302 | refreshContents(); |
---|
2119 | 2303 | } else |
---|
2120 | | - if (event.getSource() == relinkverticesItem) |
---|
| 2304 | + if (source == relinkverticesItem) |
---|
2121 | 2305 | { |
---|
2122 | | - boolean random = CameraPane.RANDOM; |
---|
2123 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2306 | + boolean random = CameraPane.SWITCH; |
---|
| 2307 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2124 | 2308 | group.selection.RelinkToSupport(); |
---|
2125 | | - CameraPane.RANDOM = random; |
---|
| 2309 | + CameraPane.SWITCH = random; |
---|
2126 | 2310 | |
---|
2127 | 2311 | refreshContents(); |
---|
2128 | 2312 | } else |
---|
2129 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2313 | + if (source == resetreferencesItem) |
---|
2130 | 2314 | { |
---|
2131 | 2315 | for (int i=0; i<group.selection.size(); i++) |
---|
2132 | 2316 | { |
---|
.. | .. |
---|
2135 | 2319 | |
---|
2136 | 2320 | refreshContents(); |
---|
2137 | 2321 | } else |
---|
2138 | | - if (event.getSource() == setMasterItem) |
---|
| 2322 | + if (source == setMasterItem) |
---|
2139 | 2323 | { |
---|
2140 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2324 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2141 | 2325 | { |
---|
2142 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2326 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2143 | 2327 | |
---|
2144 | 2328 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2145 | 2329 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2148 | 2332 | refreshContents(); |
---|
2149 | 2333 | } |
---|
2150 | 2334 | } else |
---|
2151 | | - if (event.getSource() == poseMeshItem) |
---|
| 2335 | + if (source == poseMeshItem) |
---|
2152 | 2336 | { |
---|
2153 | 2337 | if (group.selection.size() == 1) |
---|
2154 | 2338 | { |
---|
2155 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2339 | + if (Grafreed.clipboard.size() == 1) |
---|
2156 | 2340 | { |
---|
2157 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2341 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2158 | 2342 | |
---|
2159 | 2343 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2160 | 2344 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2167 | 2351 | } |
---|
2168 | 2352 | |
---|
2169 | 2353 | } else |
---|
2170 | | - if (event.getSource() == revertMeshItem) |
---|
| 2354 | + if (source == revertMeshItem) |
---|
2171 | 2355 | { |
---|
2172 | 2356 | RevertMeshes(); |
---|
2173 | 2357 | } else |
---|
2174 | | - if (event.getSource() == resetMeshItem) |
---|
| 2358 | + if (source == resetAllItem) |
---|
2175 | 2359 | { |
---|
2176 | 2360 | ResetAll(); |
---|
2177 | 2361 | } else |
---|
2178 | | - if (event.getSource() == stepAllItem) |
---|
| 2362 | + if (source == stepAllItem) |
---|
2179 | 2363 | { |
---|
2180 | 2364 | StepAll(); |
---|
2181 | 2365 | } else |
---|
2182 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2366 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2183 | 2367 | { |
---|
2184 | 2368 | //int indices[] = jList.getSelectedIndices(); |
---|
2185 | 2369 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2187 | 2371 | |
---|
2188 | 2372 | ClearSelection(false); |
---|
2189 | 2373 | } else |
---|
2190 | | - if (event.getSource() == clearAllItem) |
---|
| 2374 | + if (source == clearAllItem) |
---|
2191 | 2375 | { |
---|
2192 | 2376 | ClearSelection(true); |
---|
2193 | 2377 | } else |
---|
2194 | | - if (event.getSource() == grabItem) |
---|
| 2378 | + if (source == grabItem) |
---|
2195 | 2379 | { |
---|
2196 | 2380 | group(new cGroup(), true); |
---|
2197 | 2381 | } else |
---|
2198 | | - if (event.getSource() == hideItem) |
---|
| 2382 | + if (source == hideItem) |
---|
2199 | 2383 | { |
---|
2200 | 2384 | group(new HiddenObject()); |
---|
2201 | 2385 | } else |
---|
2202 | | - if (event.getSource() == frontItem) |
---|
| 2386 | + if (source == frontItem) |
---|
2203 | 2387 | { |
---|
2204 | 2388 | front(); |
---|
2205 | 2389 | } else |
---|
2206 | | - if (event.getSource() == backItem) |
---|
| 2390 | + if (source == backItem) |
---|
2207 | 2391 | { |
---|
2208 | 2392 | back(); |
---|
2209 | 2393 | } else |
---|
2210 | | - if (event.getSource() == cameraItem) |
---|
| 2394 | + if (source == cameraItem) |
---|
2211 | 2395 | { |
---|
2212 | 2396 | makeSomething(new Camera()); |
---|
2213 | 2397 | } else |
---|
2214 | | - if (event.getSource() == compositeItem) |
---|
| 2398 | + if (source == compositeItem) |
---|
2215 | 2399 | { |
---|
2216 | 2400 | group(new Composite()); |
---|
2217 | 2401 | } else |
---|
2218 | | - if (event.getSource() == randomItem) |
---|
| 2402 | + if (source == randomItem) |
---|
2219 | 2403 | { |
---|
2220 | 2404 | RandomNode random = new RandomNode(); |
---|
2221 | 2405 | group(random); |
---|
2222 | 2406 | if (random.size() > 0) |
---|
2223 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2407 | + random.name = random.get(0).name + "Switch"; |
---|
2224 | 2408 | } else |
---|
2225 | | - if (event.getSource() == physicsItem) |
---|
| 2409 | + if (source == physicsItem) |
---|
2226 | 2410 | { |
---|
2227 | 2411 | group(new PhysicsNode()); |
---|
2228 | 2412 | } else |
---|
2229 | | - if (event.getSource() == frameselectorItem) |
---|
| 2413 | + if (source == frameselectorItem) |
---|
2230 | 2414 | { |
---|
2231 | 2415 | for (int i=0; i<group.selection.size(); i++) |
---|
2232 | 2416 | { |
---|
.. | .. |
---|
2238 | 2422 | ResetModel(); |
---|
2239 | 2423 | refreshContents(); |
---|
2240 | 2424 | } else |
---|
2241 | | - if (event.getSource() == switchGeoItem) |
---|
| 2425 | + if (source == switchGeoItem) |
---|
2242 | 2426 | { |
---|
2243 | 2427 | for (int i=0; i<group.selection.size(); i++) |
---|
2244 | 2428 | { |
---|
.. | .. |
---|
2250 | 2434 | ResetModel(); |
---|
2251 | 2435 | refreshContents(); |
---|
2252 | 2436 | } else |
---|
2253 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2437 | + if (source == switchTransfoItem) |
---|
2254 | 2438 | { |
---|
2255 | 2439 | for (int i=0; i<group.selection.size(); i++) |
---|
2256 | 2440 | { |
---|
.. | .. |
---|
2262 | 2446 | ResetModel(); |
---|
2263 | 2447 | refreshContents(); |
---|
2264 | 2448 | } else |
---|
2265 | | - if (event.getSource() == morphItem) |
---|
| 2449 | + if (source == morphItem) |
---|
2266 | 2450 | { |
---|
2267 | 2451 | for (int i=0; i<group.selection.size(); i++) |
---|
2268 | 2452 | { |
---|
.. | .. |
---|
2274 | 2458 | ResetModel(); |
---|
2275 | 2459 | refreshContents(); |
---|
2276 | 2460 | } else |
---|
2277 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2461 | + if (source == scriptNodeItem) |
---|
2278 | 2462 | { |
---|
2279 | 2463 | boolean atleastone = false; |
---|
2280 | 2464 | |
---|
.. | .. |
---|
2313 | 2497 | } |
---|
2314 | 2498 | } |
---|
2315 | 2499 | } else |
---|
2316 | | - if (event.getSource() == linkerItem) |
---|
| 2500 | + if (source == linkerItem) |
---|
2317 | 2501 | { |
---|
2318 | 2502 | group(new cLinker()); |
---|
2319 | 2503 | } else |
---|
2320 | | - if (event.getSource() == textureItem) |
---|
| 2504 | + if (source == textureItem) |
---|
2321 | 2505 | { |
---|
2322 | 2506 | group(new TextureNode()); |
---|
2323 | 2507 | } else |
---|
2324 | | - if (event.getSource() == billboardItem) |
---|
| 2508 | + if (source == billboardItem) |
---|
2325 | 2509 | { |
---|
2326 | 2510 | group(new BillboardNode()); |
---|
2327 | 2511 | } else |
---|
2328 | | - if (event.getSource() == shadowXItem) |
---|
| 2512 | + if (source == shadowXItem) |
---|
2329 | 2513 | { |
---|
2330 | 2514 | CastShadow(0); |
---|
2331 | 2515 | } else |
---|
2332 | | - if (event.getSource() == shadowYItem) |
---|
| 2516 | + if (source == shadowYItem) |
---|
2333 | 2517 | { |
---|
2334 | 2518 | CastShadow(1); |
---|
2335 | 2519 | } else |
---|
2336 | | - if (event.getSource() == shadowZItem) |
---|
| 2520 | + if (source == shadowZItem) |
---|
2337 | 2521 | { |
---|
2338 | 2522 | CastShadow(2); |
---|
2339 | 2523 | } else |
---|
2340 | | - if (event.getSource() == ungroupItem) |
---|
| 2524 | + if (source == ungroupItem) |
---|
2341 | 2525 | { |
---|
2342 | 2526 | //ungroup(); |
---|
2343 | 2527 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2349 | 2533 | |
---|
2350 | 2534 | refreshContents(); |
---|
2351 | 2535 | } else |
---|
2352 | | - if (event.getSource() == genUVItem) |
---|
| 2536 | + if (source == genUVItem) |
---|
2353 | 2537 | { |
---|
2354 | 2538 | GenUV(); |
---|
2355 | 2539 | } else |
---|
2356 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2540 | + if (source == genNormalsCADItem) |
---|
2357 | 2541 | { |
---|
2358 | 2542 | GenNormals(true); |
---|
2359 | 2543 | } else |
---|
2360 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 2544 | + if (source == genNormalsMESHItem) |
---|
2361 | 2545 | { |
---|
2362 | | - GenNormals(true); // TODO |
---|
| 2546 | + GenNormalsMESH(); |
---|
2363 | 2547 | } else |
---|
2364 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2548 | + if (source == genNormalsORGANItem) |
---|
2365 | 2549 | { |
---|
2366 | 2550 | GenNormals(false); |
---|
2367 | 2551 | } else |
---|
2368 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 2552 | + if (source == genNormalsMINEItem) |
---|
2369 | 2553 | { |
---|
2370 | 2554 | GenNormalsMINE(); |
---|
2371 | 2555 | } else |
---|
2372 | | - if (event.getSource() == stripifyItem) |
---|
| 2556 | + if (source == stripifyItem) |
---|
2373 | 2557 | { |
---|
2374 | 2558 | Stripify(); |
---|
2375 | 2559 | } else |
---|
2376 | | - if (event.getSource() == unstripifyItem) |
---|
| 2560 | + if (source == unstripifyItem) |
---|
2377 | 2561 | { |
---|
2378 | 2562 | Unstripify(); |
---|
2379 | 2563 | } else |
---|
2380 | | - if (event.getSource() == trimItem) |
---|
| 2564 | + if (source == trimItem) |
---|
2381 | 2565 | { |
---|
2382 | 2566 | Trim(); |
---|
2383 | 2567 | } else |
---|
2384 | | - if (event.getSource() == untrimItem) |
---|
| 2568 | + if (source == untrimItem) |
---|
2385 | 2569 | { |
---|
2386 | 2570 | Untrim(); |
---|
2387 | 2571 | } else |
---|
2388 | | - if (event.getSource() == clearColorsItem) |
---|
| 2572 | + if (source == clearColorsItem) |
---|
2389 | 2573 | { |
---|
2390 | 2574 | ClearColors(); |
---|
2391 | 2575 | } else |
---|
2392 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2576 | + if (source == clearMaterialsItem) |
---|
2393 | 2577 | { |
---|
2394 | 2578 | ClearMaterials(); |
---|
2395 | 2579 | } else |
---|
2396 | | - if (event.getSource() == liveleavesItem) |
---|
| 2580 | + if (source == liveleavesItem) |
---|
2397 | 2581 | { |
---|
2398 | 2582 | LiveLeaves(true); |
---|
2399 | 2583 | } else |
---|
2400 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2584 | + if (source == unliveleavesItem) |
---|
2401 | 2585 | { |
---|
2402 | 2586 | LiveLeaves(false); |
---|
2403 | 2587 | } else |
---|
2404 | | - if (event.getSource() == supportleavesItem) |
---|
| 2588 | + if (source == supportleavesItem) |
---|
2405 | 2589 | { |
---|
2406 | 2590 | SupportLeaves(true); |
---|
2407 | 2591 | } else |
---|
2408 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2592 | + if (source == unsupportleavesItem) |
---|
2409 | 2593 | { |
---|
2410 | 2594 | SupportLeaves(false); |
---|
2411 | 2595 | } else |
---|
2412 | | - if (event.getSource() == hideleavesItem) |
---|
| 2596 | + if (source == hideleavesItem) |
---|
2413 | 2597 | { |
---|
2414 | 2598 | HideLeaves(true); |
---|
2415 | 2599 | } else |
---|
2416 | | - if (event.getSource() == showleavesItem) |
---|
| 2600 | + if (source == showleavesItem) |
---|
2417 | 2601 | { |
---|
2418 | 2602 | HideLeaves(false); |
---|
2419 | 2603 | } else |
---|
2420 | | - if (event.getSource() == markleavesItem) |
---|
| 2604 | + if (source == markleavesItem) |
---|
2421 | 2605 | { |
---|
2422 | 2606 | MarkLeaves(true); |
---|
2423 | 2607 | } else |
---|
2424 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2608 | + if (source == unmarkleavesItem) |
---|
2425 | 2609 | { |
---|
2426 | 2610 | MarkLeaves(false); |
---|
2427 | 2611 | } else |
---|
2428 | | - if (event.getSource() == flipVItem) |
---|
| 2612 | + if (source == flipVItem) |
---|
2429 | 2613 | { |
---|
2430 | 2614 | FlipV(true); |
---|
2431 | 2615 | } else |
---|
2432 | | - if (event.getSource() == unflipVItem) |
---|
| 2616 | + if (source == unflipVItem) |
---|
2433 | 2617 | { |
---|
2434 | 2618 | FlipV(false); |
---|
2435 | 2619 | } else |
---|
2436 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2620 | + if (source == lowTexturesItem) |
---|
2437 | 2621 | { |
---|
2438 | 2622 | SetTexRes(0); |
---|
2439 | 2623 | } else |
---|
2440 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2624 | + if (source == normalTexturesItem) |
---|
2441 | 2625 | { |
---|
2442 | 2626 | SetTexRes(1); |
---|
2443 | 2627 | } else |
---|
2444 | | - if (event.getSource() == highTexturesItem) |
---|
| 2628 | + if (source == highTexturesItem) |
---|
2445 | 2629 | { |
---|
2446 | 2630 | SetTexRes(2); |
---|
2447 | 2631 | } else |
---|
2448 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2632 | + if (source == veryhighTexturesItem) |
---|
2449 | 2633 | { |
---|
2450 | 2634 | SetTexRes(3); |
---|
2451 | 2635 | } else |
---|
2452 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2636 | + if (source == maxTexturesItem) |
---|
2453 | 2637 | { |
---|
2454 | 2638 | SetTexRes(4); |
---|
2455 | 2639 | } else |
---|
2456 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2640 | + if (source == panoTexturesItem) |
---|
2457 | 2641 | { |
---|
2458 | 2642 | SetTexRes(5); |
---|
2459 | 2643 | } else |
---|
2460 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2644 | + if (source == reverseNormalsItem) |
---|
2461 | 2645 | { |
---|
2462 | 2646 | ReverseNormals(); |
---|
2463 | 2647 | } else |
---|
2464 | | - if (event.getSource() == parseverticesItem) |
---|
| 2648 | + if (source == parseverticesItem) |
---|
2465 | 2649 | { |
---|
2466 | 2650 | ParseVertices(); |
---|
2467 | 2651 | } else |
---|
2468 | | - if (event.getSource() == textureFieldItem) |
---|
| 2652 | + if (source == textureFieldItem) |
---|
2469 | 2653 | { |
---|
2470 | 2654 | TextureVertices(); |
---|
2471 | 2655 | } else |
---|
2472 | | - if (event.getSource() == alignItem) |
---|
| 2656 | + if (source == alignItem) |
---|
2473 | 2657 | { |
---|
2474 | 2658 | Align(); |
---|
2475 | 2659 | } else |
---|
2476 | | - if (event.getSource() == mirrorItem) |
---|
| 2660 | + if (source == mirrorItem) |
---|
2477 | 2661 | { |
---|
2478 | 2662 | MirrorPoses(); |
---|
2479 | 2663 | } else |
---|
2480 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2664 | + if (source == reduceMorphItem) |
---|
2481 | 2665 | { |
---|
2482 | 2666 | MeshReduction(false); |
---|
2483 | 2667 | } else |
---|
2484 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2668 | + if (source == reduce34MorphItem) |
---|
2485 | 2669 | { |
---|
2486 | 2670 | MeshReduction(true); |
---|
2487 | 2671 | } else |
---|
2488 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2672 | + if (source == reverseTrianglesItem) |
---|
2489 | 2673 | { |
---|
2490 | 2674 | ReverseTriangles(); |
---|
2491 | 2675 | } else |
---|
2492 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2676 | + if (source == reduceMeshItem) |
---|
2493 | 2677 | { |
---|
2494 | 2678 | ReduceMesh(false); |
---|
2495 | 2679 | } else |
---|
2496 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2680 | + if (source == reduce34MeshItem) |
---|
2497 | 2681 | { |
---|
2498 | 2682 | ReduceMesh(true); |
---|
2499 | 2683 | } else |
---|
2500 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2684 | + if (source == increaseMeshItem) |
---|
2501 | 2685 | { |
---|
2502 | 2686 | IncreaseMesh(); |
---|
2503 | 2687 | } else |
---|
2504 | | - if (event.getSource() == clipMeshItem) |
---|
| 2688 | + if (source == clipMeshItem) |
---|
2505 | 2689 | { |
---|
2506 | 2690 | ClipMesh(); |
---|
2507 | 2691 | } else |
---|
2508 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2692 | + if (source == smoothMeshItem) |
---|
2509 | 2693 | { |
---|
2510 | 2694 | SmoothMesh(); |
---|
2511 | 2695 | } else |
---|
2512 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2696 | + if (source == transformGeometryItem) |
---|
2513 | 2697 | { |
---|
2514 | 2698 | TransformGeometry(); |
---|
2515 | 2699 | } else |
---|
2516 | | - if (event.getSource() == resetTransformItem) |
---|
| 2700 | + if (source == transformChildrenItem) |
---|
| 2701 | + { |
---|
| 2702 | + TransformChildren(); |
---|
| 2703 | + } else |
---|
| 2704 | + if (source == resetTransformItem) |
---|
2517 | 2705 | { |
---|
2518 | 2706 | ResetTransform(); |
---|
2519 | 2707 | } else |
---|
2520 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2708 | + if (source == resetCentroidItem) |
---|
2521 | 2709 | { |
---|
2522 | | - ResetCentroid(); |
---|
| 2710 | + ResetCentroid(true); |
---|
2523 | 2711 | } else |
---|
2524 | | - if (event.getSource() == resetParentItem) |
---|
| 2712 | + if (source == resetCentroidXZItem) |
---|
| 2713 | + { |
---|
| 2714 | + ResetCentroid(false); |
---|
| 2715 | + } else |
---|
| 2716 | + if (source == resetParentItem) |
---|
2525 | 2717 | { |
---|
2526 | 2718 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2527 | 2719 | { |
---|
.. | .. |
---|
2531 | 2723 | |
---|
2532 | 2724 | refreshContents(); |
---|
2533 | 2725 | } else |
---|
2534 | | - if (event.getSource() == repairParentItem) |
---|
| 2726 | + if (source == repairParentItem) |
---|
2535 | 2727 | { |
---|
2536 | 2728 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2537 | 2729 | { |
---|
.. | .. |
---|
2545 | 2737 | |
---|
2546 | 2738 | refreshContents(); |
---|
2547 | 2739 | } else |
---|
2548 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2740 | + if (source == repairShadowItem) |
---|
| 2741 | + { |
---|
| 2742 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2743 | + { |
---|
| 2744 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2745 | + obj.RepairShadow(); |
---|
| 2746 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2747 | +// { |
---|
| 2748 | +// obj.get(i).parent = obj; |
---|
| 2749 | +// } |
---|
| 2750 | + } |
---|
| 2751 | + |
---|
| 2752 | + refreshContents(); |
---|
| 2753 | + } else |
---|
| 2754 | + if (source == sortbysizeItem) |
---|
2549 | 2755 | { |
---|
2550 | 2756 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2551 | 2757 | { |
---|
.. | .. |
---|
2557 | 2763 | ResetModel(); |
---|
2558 | 2764 | refreshContents(); |
---|
2559 | 2765 | } else |
---|
2560 | | - if (event.getSource() == sortbynameItem) |
---|
| 2766 | + if (source == sortbynameItem) |
---|
2561 | 2767 | { |
---|
2562 | 2768 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2563 | 2769 | { |
---|
.. | .. |
---|
2569 | 2775 | ResetModel(); |
---|
2570 | 2776 | refreshContents(); |
---|
2571 | 2777 | } else |
---|
2572 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2778 | + if (source == attachPigmentItem) |
---|
2573 | 2779 | { |
---|
2574 | 2780 | String texture = GetFile("Attach pigment"); |
---|
2575 | 2781 | Object3D obj; |
---|
.. | .. |
---|
2581 | 2787 | |
---|
2582 | 2788 | refreshContents(); |
---|
2583 | 2789 | } else |
---|
2584 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2790 | + if (source == detachPigmentItem) |
---|
2585 | 2791 | { |
---|
2586 | 2792 | Object3D obj; |
---|
2587 | 2793 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2592 | 2798 | |
---|
2593 | 2799 | refreshContents(); |
---|
2594 | 2800 | } else |
---|
2595 | | - if (event.getSource() == attachBumpItem) |
---|
| 2801 | + if (source == attachBumpItem) |
---|
2596 | 2802 | { |
---|
2597 | 2803 | String texture = GetFile("Attach bump"); |
---|
2598 | 2804 | Object3D obj; |
---|
.. | .. |
---|
2604 | 2810 | |
---|
2605 | 2811 | refreshContents(); |
---|
2606 | 2812 | } else |
---|
2607 | | - if (event.getSource() == detachBumpItem) |
---|
| 2813 | + if (source == detachBumpItem) |
---|
2608 | 2814 | { |
---|
2609 | 2815 | Object3D obj; |
---|
2610 | 2816 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2615 | 2821 | |
---|
2616 | 2822 | refreshContents(); |
---|
2617 | 2823 | } else |
---|
2618 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2824 | + if (source == pigmentBumpItem) |
---|
2619 | 2825 | { |
---|
2620 | 2826 | Object3D obj; |
---|
2621 | 2827 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2626 | 2832 | |
---|
2627 | 2833 | refreshContents(); |
---|
2628 | 2834 | } else |
---|
2629 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2835 | + if (source == flashSelectionButton) |
---|
2630 | 2836 | { |
---|
2631 | 2837 | CameraPane.flash = true; |
---|
2632 | 2838 | refreshContents(); |
---|
2633 | 2839 | } else |
---|
2634 | | - if (event.getSource() == oneButton) |
---|
| 2840 | + if (source == oneButton) |
---|
2635 | 2841 | { |
---|
2636 | 2842 | } else |
---|
2637 | | - if (event.getSource() == twoButton) |
---|
| 2843 | + if (source == twoButton) |
---|
2638 | 2844 | { |
---|
2639 | 2845 | radio.layout = twoButton; |
---|
2640 | 2846 | // bug |
---|
2641 | 2847 | //gridPanel.setDividerLocation(1.0); |
---|
2642 | 2848 | //bigPanel.setDividerLocation(0.0); |
---|
2643 | | - bigThree.remove(scenePanel); |
---|
2644 | | - bigThree.remove(centralPanel); |
---|
2645 | | - bigThree.remove(XYZPanel); |
---|
2646 | | - aWindowConstraints.gridx = 0; |
---|
2647 | | - aWindowConstraints.gridy = 0; |
---|
2648 | | - aWindowConstraints.gridwidth = 1; |
---|
2649 | | - // aConstraints.gridheight = 3; |
---|
2650 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2651 | | - aWindowConstraints.weightx = 0; |
---|
2652 | | - aWindowConstraints.weighty = 1; |
---|
2653 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2654 | | - aWindowConstraints.weightx = 1; |
---|
2655 | | - aWindowConstraints.gridwidth = 3; |
---|
2656 | | - // aConstraints.gridheight = 3; |
---|
2657 | | - aWindowConstraints.gridx = 1; |
---|
2658 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2659 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2660 | | - aWindowConstraints.weightx = 0; |
---|
2661 | | - aWindowConstraints.gridx = 4; |
---|
2662 | | - aWindowConstraints.gridwidth = 1; |
---|
2663 | | - // aConstraints.gridheight = 3; |
---|
2664 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2665 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2666 | | - bigThree.revalidate(); |
---|
| 2849 | +// bigThree.remove(scenePanel); |
---|
| 2850 | +// bigThree.remove(centralPanel); |
---|
| 2851 | +// bigThree.remove(XYZPanel); |
---|
| 2852 | +// aWindowConstraints.gridx = 0; |
---|
| 2853 | +// aWindowConstraints.gridy = 0; |
---|
| 2854 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2855 | +// // aConstraints.gridheight = 3; |
---|
| 2856 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2857 | +// aWindowConstraints.weightx = 0; |
---|
| 2858 | +// aWindowConstraints.weighty = 1; |
---|
| 2859 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2860 | +// aWindowConstraints.weightx = 1; |
---|
| 2861 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2862 | +// // aConstraints.gridheight = 3; |
---|
| 2863 | +// aWindowConstraints.gridx = 1; |
---|
| 2864 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2865 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2866 | +// aWindowConstraints.weightx = 0; |
---|
| 2867 | +// aWindowConstraints.gridx = 4; |
---|
| 2868 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2869 | +// // aConstraints.gridheight = 3; |
---|
| 2870 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2871 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2872 | +// scenePanel.setVisible(false); |
---|
| 2873 | +// centralPanel.setVisible(true); |
---|
| 2874 | +// XYZPanel.setVisible(false); |
---|
| 2875 | + bigThree.ClearUI(); |
---|
| 2876 | + bigThree.add(centralPanel); |
---|
| 2877 | + bigThree.FlushUI(); |
---|
2667 | 2878 | } else |
---|
2668 | | - if (event.getSource() == threeButton) |
---|
| 2879 | + if (source == threeButton) |
---|
2669 | 2880 | { |
---|
2670 | 2881 | radio.layout = threeButton; |
---|
2671 | | - bigThree.remove(scenePanel); |
---|
2672 | | - bigThree.remove(centralPanel); |
---|
2673 | | - bigThree.remove(XYZPanel); |
---|
2674 | | - aWindowConstraints.gridx = 0; |
---|
2675 | | - aWindowConstraints.gridy = 0; |
---|
2676 | | - aWindowConstraints.gridwidth = 1; |
---|
2677 | | - // aConstraints.gridheight = 3; |
---|
2678 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2679 | | - aWindowConstraints.weightx = 0; |
---|
2680 | | - aWindowConstraints.weighty = 1; |
---|
2681 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2682 | | - aWindowConstraints.weightx = 1; |
---|
2683 | | - aWindowConstraints.gridwidth = 3; |
---|
2684 | | - // aConstraints.gridheight = 3; |
---|
2685 | | - aWindowConstraints.gridx = 1; |
---|
2686 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2687 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2688 | | - aWindowConstraints.weightx = 0; |
---|
2689 | | - aWindowConstraints.gridx = 4; |
---|
2690 | | - aWindowConstraints.gridwidth = 1; |
---|
2691 | | - // aConstraints.gridheight = 3; |
---|
2692 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2693 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2694 | | - bigThree.revalidate(); |
---|
| 2882 | + |
---|
| 2883 | +// bigThree.remove(scenePanel); |
---|
| 2884 | +// bigThree.remove(centralPanel); |
---|
| 2885 | +// bigThree.remove(XYZPanel); |
---|
| 2886 | +// aWindowConstraints.gridx = 0; |
---|
| 2887 | +// aWindowConstraints.gridy = 0; |
---|
| 2888 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2889 | +// // aConstraints.gridheight = 3; |
---|
| 2890 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2891 | +// aWindowConstraints.weightx = 0; |
---|
| 2892 | +// aWindowConstraints.weighty = 1; |
---|
| 2893 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2894 | +// aWindowConstraints.weightx = 1; |
---|
| 2895 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2896 | +// // aConstraints.gridheight = 3; |
---|
| 2897 | +// aWindowConstraints.gridx = 1; |
---|
| 2898 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2899 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2900 | +// aWindowConstraints.weightx = 0; |
---|
| 2901 | +// aWindowConstraints.gridx = 4; |
---|
| 2902 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2903 | +// // aConstraints.gridheight = 3; |
---|
| 2904 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2905 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2906 | +// bigThree.validate(); |
---|
| 2907 | +// scenePanel.setVisible(false); |
---|
| 2908 | +// centralPanel.setVisible(true); |
---|
| 2909 | +// XYZPanel.setVisible(true); |
---|
| 2910 | + bigThree.ClearUI(); |
---|
| 2911 | + bigThree.add(centralPanel); |
---|
| 2912 | + bigThree.add(XYZPanel); |
---|
| 2913 | + bigThree.FlushUI(); |
---|
2695 | 2914 | } else |
---|
2696 | | - if (event.getSource() == fourButton) |
---|
| 2915 | + if (source == fourButton) |
---|
2697 | 2916 | { |
---|
2698 | 2917 | radio.layout = fourButton; |
---|
2699 | | - bigThree.remove(scenePanel); |
---|
2700 | | - bigThree.remove(centralPanel); |
---|
2701 | | - bigThree.remove(XYZPanel); |
---|
2702 | | - aWindowConstraints.gridx = 0; |
---|
2703 | | - aWindowConstraints.gridy = 0; |
---|
2704 | | - aWindowConstraints.gridwidth = 1; |
---|
2705 | | - // aWindowConstraints.gridheight = 3; |
---|
2706 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2707 | | - aWindowConstraints.weightx = 1; |
---|
2708 | | - aWindowConstraints.weighty = 1; |
---|
2709 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2710 | | - aWindowConstraints.weightx = 1; |
---|
2711 | | - aWindowConstraints.gridwidth = 3; |
---|
2712 | | - // aConstraints.gridheight = 3; |
---|
2713 | | - aWindowConstraints.gridx = 1; |
---|
2714 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2715 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2716 | | - aWindowConstraints.weightx = 0; |
---|
2717 | | - aWindowConstraints.gridx = 4; |
---|
2718 | | - aWindowConstraints.gridwidth = 1; |
---|
2719 | | - // aWindowConstraints.gridheight = 3; |
---|
2720 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2721 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2722 | | - bigThree.revalidate(); |
---|
| 2918 | + |
---|
| 2919 | +// bigThree.remove(scenePanel); |
---|
| 2920 | +// bigThree.remove(centralPanel); |
---|
| 2921 | +// bigThree.remove(XYZPanel); |
---|
| 2922 | +// aWindowConstraints.gridx = 0; |
---|
| 2923 | +// aWindowConstraints.gridy = 0; |
---|
| 2924 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2925 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2926 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2927 | +// aWindowConstraints.weightx = 1; |
---|
| 2928 | +// aWindowConstraints.weighty = 1; |
---|
| 2929 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2930 | +// aWindowConstraints.weightx = 1; |
---|
| 2931 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2932 | +// // aConstraints.gridheight = 3; |
---|
| 2933 | +// aWindowConstraints.gridx = 1; |
---|
| 2934 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2935 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2936 | +// aWindowConstraints.weightx = 0; |
---|
| 2937 | +// aWindowConstraints.gridx = 4; |
---|
| 2938 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2939 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2940 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2941 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2942 | +// bigThree.validate(); |
---|
| 2943 | +// scenePanel.setVisible(true); |
---|
| 2944 | +// centralPanel.setVisible(false); |
---|
| 2945 | +// XYZPanel.setVisible(false); |
---|
| 2946 | + bigThree.ClearUI(); |
---|
| 2947 | + bigThree.add(scenePanel); |
---|
| 2948 | + bigThree.FlushUI(); |
---|
2723 | 2949 | } else |
---|
2724 | | - if (event.getSource() == sixButton) |
---|
| 2950 | + if (source == sixButton) |
---|
2725 | 2951 | { |
---|
2726 | 2952 | radio.layout = sixButton; |
---|
2727 | | - bigThree.remove(scenePanel); |
---|
2728 | | - bigThree.remove(centralPanel); |
---|
2729 | | - bigThree.remove(XYZPanel); |
---|
2730 | | - aWindowConstraints.gridx = 0; |
---|
2731 | | - aWindowConstraints.gridy = 0; |
---|
2732 | | - aWindowConstraints.gridwidth = 1; |
---|
2733 | | - // aConstraints.gridheight = 3; |
---|
2734 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2735 | | - aWindowConstraints.weightx = 0; |
---|
2736 | | - aWindowConstraints.weighty = 1; |
---|
2737 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2738 | | - aWindowConstraints.weightx = 1; |
---|
2739 | | - aWindowConstraints.gridwidth = 3; |
---|
2740 | | - // aWindowConstraints.gridheight = 3; |
---|
2741 | | - aWindowConstraints.gridx = 1; |
---|
2742 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2743 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2744 | | - aWindowConstraints.weightx = 0; |
---|
2745 | | - aWindowConstraints.gridx = 4; |
---|
2746 | | - aWindowConstraints.gridwidth = 1; |
---|
2747 | | - // aWindowConstraints.gridheight = 3; |
---|
2748 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2749 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2750 | | - bigThree.revalidate(); |
---|
| 2953 | + |
---|
| 2954 | +// bigThree.remove(scenePanel); |
---|
| 2955 | +// bigThree.remove(centralPanel); |
---|
| 2956 | +// bigThree.remove(XYZPanel); |
---|
| 2957 | +// aWindowConstraints.gridx = 0; |
---|
| 2958 | +// aWindowConstraints.gridy = 0; |
---|
| 2959 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2960 | +// // aConstraints.gridheight = 3; |
---|
| 2961 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2962 | +// aWindowConstraints.weightx = 0; |
---|
| 2963 | +// aWindowConstraints.weighty = 1; |
---|
| 2964 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2965 | +// aWindowConstraints.weightx = 1; |
---|
| 2966 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2967 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2968 | +// aWindowConstraints.gridx = 1; |
---|
| 2969 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2970 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2971 | +// aWindowConstraints.weightx = 0; |
---|
| 2972 | +// aWindowConstraints.gridx = 4; |
---|
| 2973 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2974 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2975 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2976 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2977 | +// bigThree.validate(); |
---|
| 2978 | +// scenePanel.setVisible(true); |
---|
| 2979 | +// centralPanel.setVisible(true); |
---|
| 2980 | +// XYZPanel.setVisible(false); |
---|
| 2981 | + bigThree.ClearUI(); |
---|
| 2982 | + bigThree.add(scenePanel); |
---|
| 2983 | + bigThree.add(centralPanel); |
---|
| 2984 | + bigThree.FlushUI(); |
---|
2751 | 2985 | } else |
---|
2752 | | - if (event.getSource() == sevenButton) |
---|
| 2986 | + if (source == sevenButton) |
---|
2753 | 2987 | { |
---|
2754 | 2988 | radio.layout = sevenButton; |
---|
2755 | | - bigThree.remove(scenePanel); |
---|
2756 | | - bigThree.remove(centralPanel); |
---|
2757 | | - bigThree.remove(XYZPanel); |
---|
2758 | | - aWindowConstraints.gridx = 0; |
---|
2759 | | - aWindowConstraints.gridy = 0; |
---|
2760 | | - aWindowConstraints.gridwidth = 1; |
---|
2761 | | - // aWindowConstraints.gridheight = 3; |
---|
2762 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2763 | | - aWindowConstraints.weightx = 0; |
---|
2764 | | - aWindowConstraints.weighty = 1; |
---|
2765 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2766 | | - aWindowConstraints.weightx = 1; |
---|
2767 | | - aWindowConstraints.gridwidth = 3; |
---|
2768 | | - // aWindowConstraints.gridheight = 3; |
---|
2769 | | - aWindowConstraints.gridx = 1; |
---|
2770 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2771 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2772 | | - aWindowConstraints.weightx = 0; |
---|
2773 | | - aWindowConstraints.gridx = 4; |
---|
2774 | | - aWindowConstraints.gridwidth = 1; |
---|
2775 | | - // aConstraints.gridheight = 3; |
---|
2776 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2777 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2778 | | - bigThree.revalidate(); |
---|
| 2989 | + |
---|
| 2990 | +// bigThree.remove(scenePanel); |
---|
| 2991 | +// bigThree.remove(centralPanel); |
---|
| 2992 | +// bigThree.remove(XYZPanel); |
---|
| 2993 | +// aWindowConstraints.gridx = 0; |
---|
| 2994 | +// aWindowConstraints.gridy = 0; |
---|
| 2995 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2996 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2997 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2998 | +// aWindowConstraints.weightx = 0; |
---|
| 2999 | +// aWindowConstraints.weighty = 1; |
---|
| 3000 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3001 | +// aWindowConstraints.weightx = 1; |
---|
| 3002 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3003 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3004 | +// aWindowConstraints.gridx = 1; |
---|
| 3005 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3006 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3007 | +// aWindowConstraints.weightx = 0; |
---|
| 3008 | +// aWindowConstraints.gridx = 4; |
---|
| 3009 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3010 | +// // aConstraints.gridheight = 3; |
---|
| 3011 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3012 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3013 | +// bigThree.validate(); |
---|
| 3014 | +// scenePanel.setVisible(true); |
---|
| 3015 | +// centralPanel.setVisible(true); |
---|
| 3016 | +// XYZPanel.setVisible(true); |
---|
| 3017 | + bigThree.ClearUI(); |
---|
| 3018 | + bigThree.add(scenePanel); |
---|
| 3019 | + bigThree.add(centralPanel); |
---|
| 3020 | + bigThree.add(XYZPanel); |
---|
| 3021 | + bigThree.FlushUI(); |
---|
2779 | 3022 | } else |
---|
2780 | | - if (event.getSource() == rootButton) |
---|
| 3023 | + if (source == rootButton) |
---|
2781 | 3024 | { |
---|
2782 | 3025 | Object3D obj; |
---|
2783 | 3026 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2789 | 3032 | |
---|
2790 | 3033 | refreshContents(true); |
---|
2791 | 3034 | } else |
---|
2792 | | - if (event.getSource() == closeButton) |
---|
| 3035 | + if (source == closeButton) |
---|
2793 | 3036 | { |
---|
2794 | 3037 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2795 | 3038 | cRadio ab; |
---|
.. | .. |
---|
2810 | 3053 | } |
---|
2811 | 3054 | refreshContents(true); |
---|
2812 | 3055 | } else |
---|
2813 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3056 | + if (source == editItem || source == editButton) |
---|
2814 | 3057 | { |
---|
2815 | 3058 | EditSelection(false); |
---|
2816 | 3059 | } else |
---|
2817 | | - if (event.getSource() == uneditButton) |
---|
| 3060 | + if (source == uneditButton) |
---|
2818 | 3061 | { |
---|
2819 | 3062 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2820 | 3063 | { |
---|
.. | .. |
---|
2824 | 3067 | child.CloseUI(); |
---|
2825 | 3068 | listUI.remove(child); |
---|
2826 | 3069 | |
---|
2827 | | - child.editWindow = null; // ??????????? |
---|
| 3070 | + //child.editWindow = null; // ??????????? |
---|
2828 | 3071 | } |
---|
2829 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3072 | + objEditor.ctrlPanel.FlushUI(); |
---|
2830 | 3073 | //objEditor.jTree.clearSelection(); |
---|
2831 | 3074 | //objEditor.ResetSliders(); |
---|
2832 | 3075 | refreshContents(true); |
---|
2833 | 3076 | } else |
---|
2834 | | - if (event.getSource() == clearPanelButton) |
---|
| 3077 | + if (source == clearPanelButton) |
---|
2835 | 3078 | { |
---|
2836 | 3079 | assert(copy == group); |
---|
2837 | 3080 | //copy.ClearUI(); |
---|
.. | .. |
---|
2842 | 3085 | listUI.clear(); |
---|
2843 | 3086 | refreshContents(true); |
---|
2844 | 3087 | } else |
---|
2845 | | - if (event.getSource() == allParamsButton) |
---|
| 3088 | + if (source == allParamsButton) |
---|
2846 | 3089 | { |
---|
2847 | 3090 | assert(copy == group); |
---|
2848 | 3091 | |
---|
.. | .. |
---|
2863 | 3106 | |
---|
2864 | 3107 | refreshContents(true); |
---|
2865 | 3108 | } else |
---|
2866 | | - if (event.getSource() == unselectButton) |
---|
| 3109 | + if (source == unselectButton) |
---|
2867 | 3110 | { |
---|
2868 | 3111 | objEditor.jTree.clearSelection(); |
---|
2869 | 3112 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2870 | 3113 | objEditor.ResetSliders(); |
---|
2871 | 3114 | refreshContents(true); |
---|
2872 | 3115 | } else |
---|
2873 | | - if(event.getSource() instanceof cRadio) |
---|
| 3116 | + if(source instanceof cRadio) |
---|
2874 | 3117 | { |
---|
2875 | 3118 | group.parent = keepparent; |
---|
2876 | 3119 | group.attributes = 0; |
---|
2877 | 3120 | //group.editWindow = null; |
---|
2878 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3121 | + /*cRadio*/ radio = (cRadio)source; |
---|
2879 | 3122 | Object3D obj = radio.GetObject(); |
---|
2880 | 3123 | System.out.println("Edit " + obj); |
---|
2881 | 3124 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2895 | 3138 | } |
---|
2896 | 3139 | |
---|
2897 | 3140 | copy = group; |
---|
2898 | | - //CameraPane.theRenderer.object = group; |
---|
| 3141 | + //Globals.theRenderer.object = group; |
---|
2899 | 3142 | if(!useclient) |
---|
2900 | 3143 | { |
---|
2901 | 3144 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2904 | 3147 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2905 | 3148 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2906 | 3149 | cameraView.object = group; |
---|
2907 | | - cameraView.lighttouched = true; |
---|
| 3150 | + //cameraView.lighttouched = true; |
---|
| 3151 | + Globals.lighttouched = true; |
---|
2908 | 3152 | topView.object = group; |
---|
2909 | 3153 | frontView.object = group; |
---|
2910 | 3154 | sideView.object = group; |
---|
2911 | 3155 | } |
---|
| 3156 | + |
---|
| 3157 | +// fix "+" issue |
---|
2912 | 3158 | group.editWindow = this; |
---|
| 3159 | + |
---|
2913 | 3160 | /* |
---|
2914 | 3161 | currentLayout = radio.layout; |
---|
2915 | 3162 | if (currentLayout == null) |
---|
.. | .. |
---|
2922 | 3169 | //group.attributes = -1; |
---|
2923 | 3170 | ResetModel(); |
---|
2924 | 3171 | refreshContents(true); |
---|
2925 | | - } |
---|
| 3172 | + } else if (event.getSource() == editCameraItem) |
---|
| 3173 | + { |
---|
| 3174 | + cameraView.ProtectCamera(); |
---|
| 3175 | + cameraView.repaint(); |
---|
| 3176 | + return; |
---|
| 3177 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3178 | + { |
---|
| 3179 | + cameraView.RevertCamera(); |
---|
| 3180 | + cameraView.repaint(); |
---|
| 3181 | + return; |
---|
| 3182 | + // } else if (event.getSource() == textureButton) |
---|
| 3183 | + // { |
---|
| 3184 | + // return; // true; |
---|
| 3185 | + } |
---|
2926 | 3186 | else |
---|
2927 | 3187 | { |
---|
2928 | 3188 | //return super.action(event, arg); |
---|
.. | .. |
---|
2940 | 3200 | if (useclient) |
---|
2941 | 3201 | { |
---|
2942 | 3202 | cameraView.object = client; |
---|
2943 | | - cameraView.lighttouched = true; |
---|
| 3203 | + Globals.lighttouched = true; |
---|
2944 | 3204 | //topView.object = client; |
---|
2945 | 3205 | //frontView.object = client; |
---|
2946 | 3206 | //sideView.object = client; |
---|
.. | .. |
---|
2948 | 3208 | else |
---|
2949 | 3209 | { |
---|
2950 | 3210 | cameraView.object = group; |
---|
2951 | | - cameraView.lighttouched = true; |
---|
| 3211 | + Globals.lighttouched = true; |
---|
2952 | 3212 | //topView.object = group; |
---|
2953 | 3213 | //frontView.object = group; |
---|
2954 | 3214 | //sideView.object = group; |
---|
.. | .. |
---|
2983 | 3243 | refreshContents(); |
---|
2984 | 3244 | } |
---|
2985 | 3245 | |
---|
| 3246 | + void TransformChildren() |
---|
| 3247 | + { |
---|
| 3248 | + Object3D obj; |
---|
| 3249 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3250 | + { |
---|
| 3251 | + obj = (Object3D)e.nextElement(); |
---|
| 3252 | + obj.KeepTextureMatrices(); |
---|
| 3253 | + obj.TransformChildren(); |
---|
| 3254 | + obj.RestoreTextureMatrices(); |
---|
| 3255 | + |
---|
| 3256 | +// if (obj.parent == null) |
---|
| 3257 | +// { |
---|
| 3258 | +// System.out.println("NULL PARENT!"); |
---|
| 3259 | +// new Exception().printStackTrace(); |
---|
| 3260 | +// } |
---|
| 3261 | +// else |
---|
| 3262 | +// TouchTransform(obj); |
---|
| 3263 | +// //obj.parent.Touch(); |
---|
| 3264 | + } |
---|
| 3265 | + |
---|
| 3266 | + refreshContents(); |
---|
| 3267 | + } |
---|
2986 | 3268 | |
---|
2987 | 3269 | void ResetTransform() |
---|
2988 | 3270 | { |
---|
.. | .. |
---|
3095 | 3377 | refreshContents(); |
---|
3096 | 3378 | } |
---|
3097 | 3379 | |
---|
3098 | | - void ResetCentroid() |
---|
| 3380 | + void ResetCentroid(boolean full) |
---|
3099 | 3381 | { |
---|
3100 | 3382 | Object3D obj; |
---|
3101 | 3383 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3110 | 3392 | LA.matIdentity(Object3D.mat); |
---|
3111 | 3393 | obj.getBounds(minima, maxima, false); |
---|
3112 | 3394 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3113 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3395 | + if (full) |
---|
| 3396 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3114 | 3397 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3115 | 3398 | obj.TransformMesh(Object3D.mat); |
---|
| 3399 | + |
---|
3116 | 3400 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3117 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3401 | + if (full) |
---|
| 3402 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3118 | 3403 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3404 | + |
---|
3119 | 3405 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3120 | 3406 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3121 | 3407 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3144 | 3430 | |
---|
3145 | 3431 | int size = obj.MemorySize(); |
---|
3146 | 3432 | |
---|
3147 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3433 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3434 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3148 | 3435 | } |
---|
3149 | 3436 | } |
---|
3150 | 3437 | catch (Exception e) |
---|
.. | .. |
---|
3181 | 3468 | obj = (Object3D)e.nextElement(); |
---|
3182 | 3469 | |
---|
3183 | 3470 | System.out.println("Object is: " + obj); |
---|
3184 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3471 | + Grafreed.AnalyzeObject(obj); |
---|
3185 | 3472 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3186 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3473 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3187 | 3474 | |
---|
3188 | 3475 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3189 | 3476 | } |
---|
.. | .. |
---|
3225 | 3512 | void GenNormals(boolean crease) |
---|
3226 | 3513 | { |
---|
3227 | 3514 | group.GenNormalsS(crease); |
---|
| 3515 | + |
---|
| 3516 | + refreshContents(); |
---|
| 3517 | + } |
---|
| 3518 | + |
---|
| 3519 | + void GenNormalsMESH() |
---|
| 3520 | + { |
---|
| 3521 | + group.GenNormalsMeshS(); |
---|
3228 | 3522 | |
---|
3229 | 3523 | refreshContents(); |
---|
3230 | 3524 | } |
---|
.. | .. |
---|
3397 | 3691 | |
---|
3398 | 3692 | void ParseVertices() |
---|
3399 | 3693 | { |
---|
3400 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3401 | | - GrafreeD.epsequal = true; |
---|
| 3694 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3695 | + Grafreed.epsequal = true; |
---|
3402 | 3696 | |
---|
3403 | 3697 | for (int i=0; i<group.selection.size(); i++) |
---|
3404 | 3698 | { |
---|
.. | .. |
---|
3423 | 3717 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3424 | 3718 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3425 | 3719 | |
---|
3426 | | - g.add(GrafreeD.clipboard); |
---|
| 3720 | + g.add(Grafreed.clipboard); |
---|
3427 | 3721 | |
---|
3428 | 3722 | buffer.add(g); |
---|
3429 | 3723 | } |
---|
.. | .. |
---|
3438 | 3732 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3439 | 3733 | } |
---|
3440 | 3734 | |
---|
3441 | | - GrafreeD.epsequal = epsequal; |
---|
| 3735 | + Grafreed.epsequal = epsequal; |
---|
3442 | 3736 | |
---|
3443 | 3737 | refreshContents(); |
---|
3444 | 3738 | } |
---|
.. | .. |
---|
3456 | 3750 | String pigment = Object3D.GetPigment(tex); |
---|
3457 | 3751 | //String bump = Object3D.GetBump(tex); |
---|
3458 | 3752 | |
---|
3459 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3753 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3754 | + |
---|
| 3755 | + try |
---|
| 3756 | + { |
---|
| 3757 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3758 | + } |
---|
| 3759 | + catch (Exception e) |
---|
| 3760 | + { |
---|
| 3761 | + System.err.println("FAIL: " + node); |
---|
| 3762 | + } |
---|
3460 | 3763 | |
---|
3461 | 3764 | double s = v.s; |
---|
3462 | 3765 | |
---|
.. | .. |
---|
3544 | 3847 | |
---|
3545 | 3848 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3546 | 3849 | |
---|
3547 | | - boolean random = CameraPane.RANDOM; |
---|
3548 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3850 | + boolean random = CameraPane.SWITCH; |
---|
| 3851 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3549 | 3852 | lowres.linkVerticesThis(null); |
---|
3550 | 3853 | lowres.linkVerticesThis(sn); |
---|
3551 | | - CameraPane.RANDOM = random; |
---|
| 3854 | + CameraPane.SWITCH = random; |
---|
3552 | 3855 | |
---|
3553 | 3856 | System.err.flush(); |
---|
3554 | 3857 | |
---|
.. | .. |
---|
3588 | 3891 | return; |
---|
3589 | 3892 | |
---|
3590 | 3893 | Object3D poses = group.selection.get(0); |
---|
3591 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3894 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3592 | 3895 | |
---|
3593 | 3896 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3594 | 3897 | |
---|
.. | .. |
---|
3757 | 4060 | group.selection.RelinkToSupport(); // july 2014 |
---|
3758 | 4061 | System.out.println("DONE."); |
---|
3759 | 4062 | refreshContents(); |
---|
3760 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4063 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3761 | 4064 | } |
---|
3762 | 4065 | |
---|
3763 | 4066 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3782 | 4085 | |
---|
3783 | 4086 | void ClipMesh() |
---|
3784 | 4087 | { |
---|
3785 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4088 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3786 | 4089 | { |
---|
3787 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4090 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3788 | 4091 | |
---|
3789 | 4092 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3790 | 4093 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3793 | 4096 | // { |
---|
3794 | 4097 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3795 | 4098 | // } |
---|
3796 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4099 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3797 | 4100 | } |
---|
3798 | 4101 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3799 | 4102 | System.out.println("DONE."); |
---|
.. | .. |
---|
3928 | 4231 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3929 | 4232 | |
---|
3930 | 4233 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3931 | | - if(elem != group) |
---|
| 4234 | + if(elem != group || !newWindow) |
---|
3932 | 4235 | { |
---|
3933 | 4236 | // if (!(elem instanceof Composite)) |
---|
3934 | 4237 | // newWindow = false; |
---|
.. | .. |
---|
4018 | 4321 | //case 702: // Event.LIST_DESELECT |
---|
4019 | 4322 | group.deselectAll(); |
---|
4020 | 4323 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4021 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4022 | 4324 | if (tps != null) |
---|
4023 | 4325 | { |
---|
4024 | 4326 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4028 | 4330 | //if (child.parent != null) |
---|
4029 | 4331 | //child.parent.addSelectee(child); |
---|
4030 | 4332 | group.addSelectee(child); |
---|
4031 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4032 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4033 | | - System.err.println("info : " + child.GetPath()); |
---|
4034 | 4333 | } |
---|
4035 | 4334 | } |
---|
4036 | | - else |
---|
4037 | | - { |
---|
4038 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4039 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4040 | | - System.err.println("info : " + group.GetPath()); |
---|
4041 | | - } |
---|
| 4335 | +// else |
---|
| 4336 | +// { |
---|
| 4337 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4338 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4339 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4340 | +// } |
---|
4042 | 4341 | |
---|
4043 | | - objEditor.SetText(); // jan 2014 |
---|
4044 | | - |
---|
4045 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4342 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4046 | 4343 | CameraPane.flash = true; |
---|
4047 | 4344 | |
---|
4048 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4345 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4049 | 4346 | // a camera |
---|
4050 | 4347 | { |
---|
4051 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4052 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
4053 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
4054 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4348 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4349 | + { |
---|
| 4350 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4351 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4352 | + } |
---|
| 4353 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4354 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4055 | 4355 | } |
---|
4056 | 4356 | |
---|
4057 | 4357 | refreshContents(); |
---|
.. | .. |
---|
4062 | 4362 | |
---|
4063 | 4363 | freezemodel = false; |
---|
4064 | 4364 | } |
---|
| 4365 | + |
---|
| 4366 | + void refreshContents(boolean cp) |
---|
| 4367 | + { |
---|
| 4368 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4369 | + { |
---|
| 4370 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4371 | + |
---|
| 4372 | + for (int i=0; i < group.selection.size(); i++) |
---|
| 4373 | + { |
---|
| 4374 | + Object3D child = (Object3D) group.selection.reserve(i); |
---|
| 4375 | + |
---|
| 4376 | + objEditor.SetMaterial(child); |
---|
| 4377 | + objEditor.AddInfo(child, this, true); |
---|
| 4378 | + System.err.println("info : " + child.GetPath()); |
---|
| 4379 | + |
---|
| 4380 | + group.selection.release(i); |
---|
| 4381 | + } |
---|
| 4382 | + |
---|
| 4383 | + objEditor.SetText(); // jan 2014 |
---|
| 4384 | + } |
---|
| 4385 | + |
---|
| 4386 | + super.refreshContents(cp); |
---|
| 4387 | + } |
---|
4065 | 4388 | |
---|
4066 | 4389 | void linkSomething(Object3D thing) |
---|
4067 | 4390 | { |
---|
.. | .. |
---|
4133 | 4456 | { |
---|
4134 | 4457 | if (group.selection.isEmpty()) |
---|
4135 | 4458 | return; |
---|
4136 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4459 | + |
---|
| 4460 | + Grafreed.clipboardIsTempGroup = false; |
---|
4137 | 4461 | Composite tGroup = null; |
---|
4138 | 4462 | if (group.selection.size() > 0) // 1) |
---|
4139 | 4463 | { |
---|
4140 | 4464 | tGroup = new cGroup(); |
---|
4141 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4465 | + Grafreed.clipboardIsTempGroup = true; |
---|
4142 | 4466 | } |
---|
4143 | 4467 | |
---|
4144 | 4468 | if (cut) |
---|
4145 | 4469 | { |
---|
| 4470 | + Save(); |
---|
4146 | 4471 | //int indices[] = jList.getSelectedIndices(); |
---|
4147 | 4472 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4148 | 4473 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4178 | 4503 | //System.out.println("cut " + child); |
---|
4179 | 4504 | //System.out.println("parent = " + child.parent); |
---|
4180 | 4505 | // tmp.addChild(child); |
---|
4181 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4506 | + if (Grafreed.clipboardIsTempGroup) |
---|
4182 | 4507 | tGroup.add/*Child*/(tmp); |
---|
4183 | 4508 | else |
---|
4184 | | - GrafreeD.clipboard = tmp; |
---|
| 4509 | + Grafreed.clipboard = tmp; |
---|
4185 | 4510 | } |
---|
4186 | 4511 | else |
---|
4187 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4512 | + if (Grafreed.clipboardIsTempGroup) |
---|
4188 | 4513 | tGroup.add/*Child*/(child); |
---|
4189 | 4514 | else |
---|
4190 | | - GrafreeD.clipboard = child; |
---|
| 4515 | + Grafreed.clipboard = child; |
---|
4191 | 4516 | } |
---|
4192 | 4517 | |
---|
4193 | 4518 | //ResetModel(); |
---|
.. | .. |
---|
4219 | 4544 | //System.out.println("cut " + elem); |
---|
4220 | 4545 | //System.out.println("parent = " + elem.parent); |
---|
4221 | 4546 | // tmp.addChild(elem); |
---|
4222 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4547 | + if (Grafreed.clipboardIsTempGroup) |
---|
4223 | 4548 | tGroup.add/*Child*/(tmp); |
---|
4224 | 4549 | else |
---|
4225 | | - GrafreeD.clipboard = tmp; |
---|
| 4550 | + Grafreed.clipboard = tmp; |
---|
4226 | 4551 | } |
---|
4227 | 4552 | else |
---|
4228 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4553 | + if (Grafreed.clipboardIsTempGroup) |
---|
4229 | 4554 | tGroup.add/*Child*/(child); |
---|
4230 | 4555 | else |
---|
4231 | | - GrafreeD.clipboard = child; |
---|
| 4556 | + Grafreed.clipboard = child; |
---|
4232 | 4557 | } |
---|
4233 | 4558 | |
---|
4234 | 4559 | } |
---|
4235 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4236 | | - GrafreeD.clipboard = tGroup; |
---|
| 4560 | + |
---|
| 4561 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4562 | + Grafreed.clipboard = tGroup; |
---|
| 4563 | + |
---|
4237 | 4564 | if (cut) |
---|
4238 | 4565 | { |
---|
4239 | 4566 | ResetModel(); |
---|
.. | .. |
---|
4247 | 4574 | // return; |
---|
4248 | 4575 | boolean first = true; |
---|
4249 | 4576 | |
---|
4250 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4577 | + if (Grafreed.clipboardIsTempGroup) |
---|
4251 | 4578 | { |
---|
4252 | 4579 | Composite temp; |
---|
4253 | 4580 | |
---|
.. | .. |
---|
4258 | 4585 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4259 | 4586 | */ |
---|
4260 | 4587 | Object3D elem; |
---|
4261 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4588 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4262 | 4589 | { |
---|
4263 | 4590 | Object3D child = (Object3D)e.nextElement(); |
---|
4264 | 4591 | |
---|
.. | .. |
---|
4292 | 4619 | //Object3D cb = Applet3D.clipboard; |
---|
4293 | 4620 | //temp.addChild(cb); |
---|
4294 | 4621 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4295 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4296 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4297 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4298 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4299 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4622 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4623 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4624 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4625 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4626 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4300 | 4627 | else |
---|
4301 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4302 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4628 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4629 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4303 | 4630 | } |
---|
4304 | 4631 | |
---|
4305 | 4632 | ResetModel(); |
---|
4306 | 4633 | refreshContents(); |
---|
4307 | 4634 | } |
---|
4308 | 4635 | |
---|
4309 | | - void pasteInto(boolean copyit) |
---|
| 4636 | + void pasteInto(boolean copyit, boolean clone) |
---|
4310 | 4637 | { |
---|
4311 | 4638 | // if (GrafreeD.clipboard == null) |
---|
4312 | 4639 | // return; |
---|
.. | .. |
---|
4335 | 4662 | if (copyit) |
---|
4336 | 4663 | { |
---|
4337 | 4664 | // paste(false); |
---|
4338 | | - CloneClipboard(false); // sept 2014 |
---|
| 4665 | + if (clone) |
---|
| 4666 | + { |
---|
| 4667 | + CloneClipboard(false); // sept 2014 |
---|
| 4668 | + } |
---|
| 4669 | + else |
---|
| 4670 | + { |
---|
| 4671 | + paste(false); |
---|
| 4672 | + } |
---|
4339 | 4673 | } |
---|
4340 | 4674 | else |
---|
4341 | 4675 | { |
---|
4342 | 4676 | boolean first = true; |
---|
4343 | 4677 | |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4678 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 4679 | { |
---|
4346 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4680 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4347 | 4681 | Object3D copy; |
---|
4348 | 4682 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4349 | 4683 | { |
---|
.. | .. |
---|
4353 | 4687 | } |
---|
4354 | 4688 | } else |
---|
4355 | 4689 | { |
---|
4356 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4690 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4357 | 4691 | } |
---|
4358 | 4692 | } |
---|
4359 | 4693 | } |
---|
.. | .. |
---|
4758 | 5092 | } |
---|
4759 | 5093 | */ |
---|
4760 | 5094 | |
---|
4761 | | - void ImportGFD() |
---|
4762 | | - { |
---|
4763 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4764 | | - browser.show(); |
---|
4765 | | - String filename = browser.getFile(); |
---|
4766 | | - if (filename != null && filename.length() > 0) |
---|
4767 | | - { |
---|
4768 | | - String fullname = browser.getDirectory() + filename; |
---|
4769 | | - |
---|
4770 | | - //Object3D readobj = |
---|
4771 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4772 | | - //makeSomething(readobj); |
---|
4773 | | - } |
---|
4774 | | - } |
---|
4775 | | - |
---|
4776 | 5095 | /* |
---|
4777 | 5096 | public void Callback(Object obj) |
---|
4778 | 5097 | { |
---|
.. | .. |
---|
4796 | 5115 | } |
---|
4797 | 5116 | */ |
---|
4798 | 5117 | |
---|
4799 | | - void ImportVRMLX3D() |
---|
4800 | | - { |
---|
4801 | | - if (GrafreeD.standAlone) |
---|
4802 | | - { |
---|
4803 | | - /**/ |
---|
4804 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4805 | | - browser.show(); |
---|
4806 | | - String filename = browser.getFile(); |
---|
4807 | | - if (filename != null && filename.length() > 0) |
---|
4808 | | - { |
---|
4809 | | - String fullname = browser.getDirectory() + filename; |
---|
4810 | | - LoadVRMLX3D(fullname); |
---|
4811 | | - } |
---|
4812 | | - /**/ |
---|
4813 | | - } |
---|
4814 | | - } |
---|
4815 | | - |
---|
4816 | 5118 | String GetFile(String dialogName) |
---|
4817 | 5119 | { |
---|
4818 | | - if (GrafreeD.standAlone) |
---|
| 5120 | + if (Grafreed.standAlone) |
---|
4819 | 5121 | { |
---|
4820 | 5122 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4821 | 5123 | browser.show(); |
---|
.. | .. |
---|
4879 | 5181 | cButton flashSelectionButton; |
---|
4880 | 5182 | cButton editButton; |
---|
4881 | 5183 | cButton uneditButton; |
---|
| 5184 | + JCheckBox allParamsButton; |
---|
4882 | 5185 | cButton clearpanelButton; |
---|
4883 | | - cButton allParamsButton; |
---|
4884 | 5186 | cButton unselectButton; |
---|
4885 | 5187 | |
---|
| 5188 | + cButton saveButton; |
---|
| 5189 | + cButton undoButton; |
---|
| 5190 | + cButton redoButton; |
---|
| 5191 | + cButton oneStepButton; |
---|
| 5192 | + |
---|
4886 | 5193 | cButton screenfitButton; |
---|
4887 | 5194 | cButton screenfitpointButton; |
---|
4888 | 5195 | cButton snapobjectButton; |
---|
.. | .. |
---|
4913 | 5220 | private MenuItem lookFromItem; |
---|
4914 | 5221 | private MenuItem switchItem; |
---|
4915 | 5222 | private MenuItem cutItem; |
---|
| 5223 | + private MenuItem undoItem; |
---|
| 5224 | + private MenuItem redoItem; |
---|
4916 | 5225 | private MenuItem duplicateItem; |
---|
4917 | 5226 | private MenuItem cloneItem; |
---|
4918 | 5227 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
4926 | 5235 | private MenuItem linkverticesItem; |
---|
4927 | 5236 | private MenuItem relinkverticesItem; |
---|
4928 | 5237 | private MenuItem setMasterItem; |
---|
4929 | | - private MenuItem resetMeshItem; |
---|
| 5238 | + private MenuItem resetAllItem; |
---|
4930 | 5239 | private MenuItem stepAllItem; |
---|
4931 | 5240 | private MenuItem revertMeshItem; |
---|
4932 | 5241 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4937 | 5246 | private MenuItem mergeGeometriesItem; |
---|
4938 | 5247 | private MenuItem copyItem; |
---|
4939 | 5248 | private MenuItem pasteItem; |
---|
| 5249 | + private MenuItem pasteIntoItem; |
---|
4940 | 5250 | private MenuItem pasteLinkItem; |
---|
4941 | 5251 | private MenuItem pasteCloneItem; |
---|
4942 | 5252 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
4986 | 5296 | private MenuItem panoTexturesItem; |
---|
4987 | 5297 | |
---|
4988 | 5298 | private MenuItem resetCentroidItem; |
---|
4989 | | - private MenuItem transformgeometryItem; |
---|
| 5299 | + private MenuItem resetCentroidXZItem; |
---|
4990 | 5300 | private MenuItem resetTransformItem; |
---|
| 5301 | + private MenuItem transformGeometryItem; |
---|
| 5302 | + private MenuItem transformChildrenItem; |
---|
4991 | 5303 | private MenuItem hideItem; |
---|
4992 | 5304 | private MenuItem grabItem; |
---|
4993 | 5305 | private MenuItem backItem; |
---|
.. | .. |
---|
5009 | 5321 | |
---|
5010 | 5322 | private MenuItem resetParentItem; |
---|
5011 | 5323 | private MenuItem repairParentItem; |
---|
| 5324 | + private MenuItem repairShadowItem; |
---|
5012 | 5325 | private MenuItem sortbysizeItem; |
---|
5013 | 5326 | private MenuItem sortbynameItem; |
---|
5014 | 5327 | |
---|
.. | .. |
---|
5033 | 5346 | private MenuItem blobItem; |
---|
5034 | 5347 | private MenuItem latheItem; |
---|
5035 | 5348 | private MenuItem bezierItem; |
---|
5036 | | - private MenuItem checkerItem; |
---|
| 5349 | + private MenuItem overlayItem; |
---|
5037 | 5350 | private MenuItem meshItem; |
---|
5038 | 5351 | // private MenuItem meshGroupItem; |
---|
5039 | 5352 | private MenuItem springItem; |
---|
.. | .. |
---|
5055 | 5368 | private MenuItem doubleItem; |
---|
5056 | 5369 | private MenuItem tripleItem; |
---|
5057 | 5370 | |
---|
5058 | | - private MenuItem importGFDItem; |
---|
5059 | | - private MenuItem importVRMLX3DItem; |
---|
5060 | | - private MenuItem import3DSItem; |
---|
5061 | | - private MenuItem importOBJItem; |
---|
5062 | | - |
---|
5063 | 5371 | private MenuItem computeAOItem; |
---|
5064 | 5372 | private MenuItem recompileItem; |
---|
5065 | 5373 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5069 | 5377 | private MenuItem analyzeItem; |
---|
5070 | 5378 | private MenuItem dumpItem; |
---|
5071 | 5379 | //boolean freezemodel = false; |
---|
| 5380 | + |
---|
| 5381 | + Menu cameraMenu; |
---|
| 5382 | + MenuItem editCameraItem; |
---|
| 5383 | + MenuItem revertCameraItem; |
---|
5072 | 5384 | } |
---|