.. | .. |
---|
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 | + undoItem = menu.add(new MenuItem("Undo")); |
---|
| 158 | + undoItem.addActionListener(this); |
---|
| 159 | + redoItem = menu.add(new MenuItem("Redo")); |
---|
| 160 | + redoItem.addActionListener(this); |
---|
| 161 | + menu.add("-"); |
---|
| 162 | + duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 163 | + duplicateItem.addActionListener(this); |
---|
| 164 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 165 | + cloneItem.addActionListener(this); |
---|
| 166 | + if (Globals.ADVANCED) |
---|
| 167 | + { |
---|
| 168 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 169 | + cloneSupportItem.addActionListener(this); |
---|
| 170 | + } |
---|
| 171 | + menu.add("-"); |
---|
| 172 | + cutItem = menu.add(new MenuItem("Cut")); |
---|
| 173 | + cutItem.addActionListener(this); |
---|
| 174 | + copyItem = menu.add(new MenuItem("Copy")); |
---|
| 175 | + copyItem.addActionListener(this); |
---|
| 176 | + pasteItem = menu.add(new MenuItem("Paste")); |
---|
| 177 | + pasteItem.addActionListener(this); |
---|
| 178 | + menu.add("-"); |
---|
| 179 | + |
---|
| 180 | + menu.add("-"); |
---|
| 181 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 182 | + pasteIntoItem.addActionListener(this); |
---|
| 183 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 184 | + pasteLinkItem.addActionListener(this); |
---|
| 185 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 186 | + pasteCloneItem.addActionListener(this); |
---|
| 187 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 188 | +// pasteExpandItem.addActionListener(this); |
---|
| 189 | + menu.add("-"); |
---|
| 190 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 191 | + clearItem.addActionListener(this); |
---|
| 192 | + |
---|
| 193 | + if (Globals.ADVANCED) |
---|
| 194 | + { |
---|
| 195 | + // Deletes the cameras... |
---|
| 196 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 197 | + clearAllItem.addActionListener(this); |
---|
| 198 | + } |
---|
| 199 | + |
---|
| 200 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 201 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 202 | + //zBufferItem.addActionListener(this); |
---|
| 203 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 204 | + //normalLensItem.addActionListener(this); |
---|
| 205 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera")); |
---|
| 206 | + revertCameraItem.addActionListener(this); |
---|
| 207 | + |
---|
| 208 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 209 | + toggleFullScreenItem.addItemListener(this); |
---|
| 210 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 211 | + cameraMenu.add("-"); |
---|
| 212 | + |
---|
| 213 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 214 | + toggleTextureItem.addItemListener(this); |
---|
| 215 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 216 | + |
---|
| 217 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 218 | + toggleSwitchItem.addItemListener(this); |
---|
| 219 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 220 | + |
---|
| 221 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 222 | + toggleHandleItem.addItemListener(this); |
---|
| 223 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 224 | + |
---|
| 225 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 226 | + togglePaintItem.addItemListener(this); |
---|
| 227 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 228 | + |
---|
| 229 | + if (Globals.ADVANCED) |
---|
| 230 | + { |
---|
| 231 | + cameraMenu.add("-"); |
---|
| 232 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 233 | + toggleLiveItem.addItemListener(this); |
---|
| 234 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 235 | + |
---|
| 236 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 237 | + stepItem.addActionListener(this); |
---|
| 238 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 239 | + // toggleDLItem.addItemListener(this); |
---|
| 240 | + // toggleDLItem.setState(false); |
---|
| 241 | + |
---|
| 242 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 243 | + toggleRenderItem.addItemListener(this); |
---|
| 244 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 245 | + |
---|
| 246 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 247 | + toggleDebugItem.addItemListener(this); |
---|
| 248 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 249 | + |
---|
| 250 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 251 | + toggleFrustumItem.addItemListener(this); |
---|
| 252 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 253 | + |
---|
| 254 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 255 | + toggleFootContactItem.addItemListener(this); |
---|
| 256 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 257 | + |
---|
| 258 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 259 | + toggleTimelineItem.addItemListener(this); |
---|
| 260 | + } |
---|
| 261 | + |
---|
| 262 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 263 | +// toggleRootItem.addItemListener(this); |
---|
| 264 | +// toggleRootItem.setState(false); |
---|
| 265 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 266 | +// animationItem.addItemListener(this); |
---|
| 267 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 268 | + cameraMenu.add("-"); |
---|
| 269 | + cameraMenu.add(editCameraItem = new MenuItem("Save Camera")); |
---|
| 270 | + editCameraItem.addActionListener(this); |
---|
| 271 | + |
---|
| 272 | + if (Globals.ADVANCED) |
---|
| 273 | + { |
---|
152 | 274 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 275 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 276 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 282 | lookAtItem.addActionListener(this); |
---|
161 | 283 | //lookFromItem.addActinoListener(this); |
---|
162 | 284 | //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 | | - |
---|
| 285 | + } |
---|
| 286 | + |
---|
192 | 287 | 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); |
---|
| 288 | + if (Globals.ADVANCED) |
---|
| 289 | + { |
---|
197 | 290 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 291 | revertMeshItem.addActionListener(this); |
---|
199 | 292 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 293 | resetreferencesItem.addActionListener(this); |
---|
201 | 294 | menu.add("-"); |
---|
| 295 | + } |
---|
202 | 296 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 297 | overwriteGeoItem.addActionListener(this); |
---|
204 | 298 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 304 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 305 | overwriteUVItem.addActionListener(this); |
---|
212 | 306 | menu.add("-"); |
---|
| 307 | + if (Globals.ADVANCED) |
---|
| 308 | + { |
---|
213 | 309 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 310 | generateMeshItem.addActionListener(this); |
---|
215 | 311 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 312 | poseMeshItem.addActionListener(this); |
---|
217 | 313 | menu.add("-"); |
---|
| 314 | + } |
---|
218 | 315 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 316 | resetsupportItem.addActionListener(this); |
---|
220 | 317 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 318 | linkverticesItem.addActionListener(this); |
---|
| 319 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 320 | + relinkverticesItem.addActionListener(this); |
---|
| 321 | + |
---|
| 322 | + if (Globals.ADVANCED) |
---|
| 323 | + { |
---|
222 | 324 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
223 | 325 | setMasterItem.addActionListener(this); |
---|
| 326 | + } |
---|
224 | 327 | |
---|
225 | 328 | oe.menuBar.add(menu = new Menu("Group")); |
---|
226 | 329 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
231 | 334 | frontItem.addActionListener(this); |
---|
232 | 335 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
233 | 336 | compositeItem.addActionListener(this); |
---|
| 337 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
| 338 | + hideItem.addActionListener(this); |
---|
| 339 | + ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 340 | + ungroupItem.addActionListener(this); |
---|
234 | 341 | menu.add("-"); |
---|
235 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 342 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
236 | 343 | randomItem.addActionListener(this); |
---|
237 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
238 | | - physicsItem.addActionListener(this); |
---|
239 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
240 | | - frameselectorItem.addActionListener(this); |
---|
241 | 344 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
242 | 345 | switchGeoItem.addActionListener(this); |
---|
243 | 346 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
244 | 347 | switchTransfoItem.addActionListener(this); |
---|
245 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 348 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
246 | 349 | morphItem.addActionListener(this); |
---|
| 350 | + |
---|
| 351 | + if (Globals.ADVANCED) |
---|
| 352 | + { |
---|
| 353 | + menu.add("-"); |
---|
| 354 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 355 | + physicsItem.addActionListener(this); |
---|
| 356 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 357 | + frameselectorItem.addActionListener(this); |
---|
247 | 358 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
248 | 359 | scriptNodeItem.addActionListener(this); |
---|
249 | 360 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
250 | 361 | cameraItem.addActionListener(this); |
---|
| 362 | + } |
---|
251 | 363 | |
---|
252 | 364 | oe.menuBar.add(menu = new Menu("Object")); |
---|
253 | 365 | textureItem = menu.add(new MenuItem("Texture")); |
---|
254 | 366 | textureItem.addActionListener(this); |
---|
| 367 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 368 | + billboardItem.addActionListener(this); |
---|
255 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
256 | 370 | csgItem.addActionListener(this); |
---|
257 | 371 | shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
.. | .. |
---|
260 | 374 | shadowYItem.addActionListener(this); |
---|
261 | 375 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
262 | 376 | shadowZItem.addActionListener(this); |
---|
| 377 | + if (Globals.ADVANCED) |
---|
| 378 | + { |
---|
| 379 | + menu.add("-"); |
---|
263 | 380 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
264 | 381 | linkerItem.addActionListener(this); |
---|
265 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
266 | | - templateItem.addActionListener(this); |
---|
267 | 382 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
268 | 383 | attributeItem.addActionListener(this); |
---|
| 384 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 385 | + templateItem.addActionListener(this); |
---|
269 | 386 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
270 | 387 | pointflowItem.addActionListener(this); |
---|
| 388 | + } |
---|
271 | 389 | menu.add("-"); |
---|
272 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
273 | | - transformgeometryItem.addActionListener(this); |
---|
274 | 390 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
275 | 391 | resetTransformItem.addActionListener(this); |
---|
276 | 392 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
277 | 393 | resetCentroidItem.addActionListener(this); |
---|
278 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
279 | | - ungroupItem.addActionListener(this); |
---|
| 394 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 395 | + resetCentroidXZItem.addActionListener(this); |
---|
| 396 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 397 | + transformGeometryItem.addActionListener(this); |
---|
| 398 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 399 | + transformChildrenItem.addActionListener(this); |
---|
280 | 400 | |
---|
281 | 401 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
282 | 402 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
285 | 405 | genNormalsORGANItem.addActionListener(this); |
---|
286 | 406 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
287 | 407 | genNormalsCADItem.addActionListener(this); |
---|
| 408 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 409 | + genNormalsMESHItem.addActionListener(this); |
---|
| 410 | + if (Globals.ADVANCED) |
---|
| 411 | + { |
---|
| 412 | + genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 413 | + genNormalsMINEItem.addActionListener(this); |
---|
| 414 | + } |
---|
288 | 415 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
289 | 416 | stripifyItem.addActionListener(this); |
---|
290 | 417 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
306 | 433 | reduce34MeshItem.addActionListener(this); |
---|
307 | 434 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
308 | 435 | increaseMeshItem.addActionListener(this); |
---|
309 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
310 | | - smoothMeshItem.addActionListener(this); |
---|
311 | 436 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
312 | 437 | clipMeshItem.addActionListener(this); |
---|
| 438 | + |
---|
| 439 | + if (Globals.ADVANCED) |
---|
| 440 | + { |
---|
| 441 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 442 | + smoothMeshItem.addActionListener(this); |
---|
| 443 | + } |
---|
313 | 444 | |
---|
314 | 445 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
315 | 446 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
316 | 447 | clearMaterialsItem.addActionListener(this); |
---|
| 448 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 449 | + resetAllItem.addActionListener(this); |
---|
| 450 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 451 | + stepAllItem.addActionListener(this); |
---|
317 | 452 | menu.add("-"); |
---|
318 | 453 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
319 | 454 | liveleavesItem.addActionListener(this); |
---|
320 | 455 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
321 | 456 | unliveleavesItem.addActionListener(this); |
---|
| 457 | + if (Globals.ADVANCED) |
---|
| 458 | + { |
---|
322 | 459 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
323 | 460 | supportleavesItem.addActionListener(this); |
---|
324 | 461 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
325 | 462 | unsupportleavesItem.addActionListener(this); |
---|
| 463 | + } |
---|
326 | 464 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
327 | 465 | hideleavesItem.addActionListener(this); |
---|
328 | 466 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
366 | 504 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
367 | 505 | sortbynameItem.addActionListener(this); |
---|
368 | 506 | menu.add("-"); |
---|
| 507 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 508 | + shareGeometriesItem.addActionListener(this); |
---|
| 509 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 510 | + mergeGeometriesItem.addActionListener(this); |
---|
| 511 | + if (Globals.ADVANCED) |
---|
| 512 | + { |
---|
| 513 | + // Pretty much the same as duplicate and clone. |
---|
369 | 514 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
370 | 515 | extractGeometriesItem.addActionListener(this); |
---|
371 | 516 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
372 | 517 | cloneGeometriesItem.addActionListener(this); |
---|
373 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
374 | | - shareGeometriesItem.addActionListener(this); |
---|
375 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
376 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 518 | + } |
---|
377 | 519 | |
---|
378 | 520 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
379 | 521 | buildCreateMenu(menu); |
---|
380 | 522 | |
---|
381 | | - |
---|
382 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
383 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
384 | | - importGFDItem.addActionListener(this); |
---|
385 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
386 | | - importVRMLX3DItem.addActionListener(this); |
---|
387 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
388 | | - importOBJItem.addActionListener(this); |
---|
389 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
390 | | - import3DSItem.addActionListener(this); |
---|
391 | | - |
---|
392 | 523 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
393 | 524 | buildToolsMenu(menu); |
---|
394 | 525 | } |
---|
.. | .. |
---|
423 | 554 | oe.radioPanel.add(dummyButton); |
---|
424 | 555 | oe.buttonGroup.add(dummyButton); |
---|
425 | 556 | */ |
---|
426 | | - aConstraints.gridy += 1; |
---|
427 | | - oe.aConstraints.gridwidth = 1; |
---|
428 | | - oe.aConstraints.gridx = 0; |
---|
| 557 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
429 | 558 | |
---|
430 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 559 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 560 | + liveCB.setToolTipText("Enable animation"); |
---|
431 | 561 | liveCB.addItemListener(this); |
---|
432 | 562 | |
---|
433 | | - oe.aConstraints.gridx += 1; |
---|
434 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
435 | | - supportCB.addItemListener(this); |
---|
436 | | - |
---|
437 | | - // oe.aConstraints.gridx += 1; |
---|
438 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
439 | | - // localCB.addItemListener(this); |
---|
440 | | - |
---|
441 | | - oe.aConstraints.gridx += 1; |
---|
442 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
443 | | - crowdCB.addItemListener(this); |
---|
444 | | - |
---|
445 | | - oe.aConstraints.gridx += 1; |
---|
446 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
447 | | - smoothCB.addItemListener(this); |
---|
448 | | - |
---|
449 | | - oe.aConstraints.gridx += 1; |
---|
450 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 563 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 564 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 565 | + oneStepButton.addActionListener(this); |
---|
| 566 | + |
---|
| 567 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 568 | + fastCB.setToolTipText("Fast mode"); |
---|
451 | 569 | fastCB.addItemListener(this); |
---|
452 | | - oe.aConstraints.gridx += 1; |
---|
453 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
454 | | - slowCB.addItemListener(this); |
---|
455 | | - oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
457 | | - boxCB.addItemListener(this); |
---|
458 | | - |
---|
459 | | -// oe.aConstraints.gridx += 1; |
---|
460 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
461 | | -// speakerMocapCB.addItemListener(this); |
---|
462 | | - |
---|
463 | | - if (false) |
---|
464 | | - { |
---|
465 | | - // handled in scripts |
---|
466 | | - oe.aConstraints.gridx += 1; |
---|
467 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
468 | | - speakerCameraCB.addItemListener(this); |
---|
469 | | - |
---|
470 | | - oe.aConstraints.gridx += 1; |
---|
471 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
472 | | - speakerFocusCB.addItemListener(this); |
---|
473 | | - |
---|
474 | | - oe.aConstraints.gridx += 1; |
---|
475 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
476 | | - smoothfocusCB.addItemListener(this); |
---|
477 | | - } |
---|
478 | | - |
---|
479 | | -//oe.aConstraints.gridx += 1; |
---|
480 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
481 | | -// debugCB.addItemListener(this); |
---|
482 | | - |
---|
483 | | - oe.aConstraints.gridx += 1; |
---|
484 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
485 | | - oeilCB.addItemListener(this); |
---|
486 | | - |
---|
487 | | - oe.aConstraints.gridx += 1; |
---|
488 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
489 | | - lookAtCB.addItemListener(this); |
---|
490 | | - |
---|
491 | | - oe.aConstraints.gridx += 1; |
---|
492 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
| 570 | + |
---|
| 571 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 572 | + trackCB.setToolTipText("Enable tracking"); |
---|
493 | 573 | trackCB.addItemListener(this); |
---|
494 | 574 | |
---|
495 | | - oe.aConstraints.gridx += 1; |
---|
496 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 575 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 576 | + screenfitButton.setToolTipText("Screen fit"); |
---|
497 | 577 | screenfitButton.addActionListener(this); |
---|
498 | | - oe.aConstraints.gridx += 1; |
---|
| 578 | + |
---|
499 | 579 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
500 | 580 | // screenfitpointButton.addActionListener(this); |
---|
501 | | -// oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
503 | | - snapobjectButton.addActionListener(this); |
---|
504 | | - oe.aConstraints.gridx += 1; |
---|
505 | 581 | |
---|
506 | | - //aConstraints.gridx = 0; |
---|
507 | | - //aConstraints.gridy += 1; |
---|
508 | | - oe.aConstraints.weighty = 0; |
---|
509 | | - oe.aConstraints.gridwidth = 1; |
---|
510 | | - |
---|
511 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 582 | + if (Globals.ADVANCED) |
---|
| 583 | + { |
---|
| 584 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 585 | + snapobjectButton.addActionListener(this); |
---|
| 586 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 587 | + } |
---|
| 588 | + |
---|
| 589 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 590 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
512 | 591 | flashSelectionButton.addActionListener(this); |
---|
513 | | - oe.aConstraints.gridx += 1; |
---|
514 | | - oe.aConstraints.weighty = 0; |
---|
515 | | - oe.aConstraints.gridwidth = 1; |
---|
516 | 592 | |
---|
517 | | - // |
---|
518 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 593 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + twoButton.setToolTipText("Show center view only"); |
---|
519 | 597 | twoButton.addActionListener(this); |
---|
520 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 598 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | 599 | fourButton.addActionListener(this); |
---|
522 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 600 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 601 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 602 | + sixButton.setToolTipText("2-column layout left"); |
---|
523 | 603 | sixButton.addActionListener(this); |
---|
524 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 604 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 605 | + threeButton.setToolTipText("2-column layout right"); |
---|
525 | 606 | threeButton.addActionListener(this); |
---|
526 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + sevenButton.setToolTipText("3-column layout"); |
---|
527 | 609 | sevenButton.addActionListener(this); |
---|
528 | 610 | // |
---|
529 | 611 | |
---|
530 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 612 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 613 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
531 | 614 | rootButton.addActionListener(this); |
---|
532 | | - oe.aConstraints.gridx += 1; |
---|
533 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 615 | + |
---|
| 616 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 617 | + closeButton.setToolTipText("Close tab"); |
---|
534 | 618 | closeButton.addActionListener(this); |
---|
535 | 619 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
536 | 620 | //clearButton.addActionListener(this); |
---|
537 | | - oe.aConstraints.gridx += 1; |
---|
538 | 621 | |
---|
539 | | - oe.aConstraints.gridx = 1; // |
---|
540 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 622 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 623 | + |
---|
| 624 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 625 | + editButton.setToolTipText("Edit selection"); |
---|
541 | 626 | editButton.addActionListener(this); |
---|
542 | | - oe.aConstraints.gridx += 1; |
---|
543 | | - oe.aConstraints.weighty = 0; |
---|
544 | | - oe.aConstraints.gridwidth = 1; |
---|
545 | 627 | |
---|
546 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 628 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + uneditButton.setToolTipText("Unedit selection"); |
---|
547 | 630 | uneditButton.addActionListener(this); |
---|
548 | 631 | |
---|
549 | | - oe.aConstraints.gridx += 1; |
---|
550 | | - oe.aConstraints.weighty = 0; |
---|
551 | | - oe.aConstraints.gridwidth = 1; |
---|
552 | | - |
---|
553 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
554 | | - clearPanelButton.addActionListener(this); |
---|
555 | | - |
---|
556 | | - oe.aConstraints.gridx += 1; |
---|
557 | | - oe.aConstraints.weighty = 0; |
---|
558 | | - oe.aConstraints.gridwidth = 1; |
---|
559 | | - |
---|
560 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 632 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 633 | + allParamsButton.setToolTipText("Edit all params"); |
---|
561 | 634 | allParamsButton.addActionListener(this); |
---|
562 | 635 | |
---|
563 | | - oe.aConstraints.gridx += 1; |
---|
564 | | - oe.aConstraints.weighty = 0; |
---|
565 | | - oe.aConstraints.gridwidth = 1; |
---|
566 | | - |
---|
567 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 636 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 637 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 638 | + clearPanelButton.addActionListener(this); |
---|
| 639 | + |
---|
| 640 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 641 | + unselectButton.setToolTipText("Unselect"); |
---|
568 | 642 | unselectButton.addActionListener(this); |
---|
569 | 643 | |
---|
| 644 | + commandsPanel.preferredHeight = 1; |
---|
| 645 | + |
---|
| 646 | + oe.treePanel.add(commandsPanel); |
---|
| 647 | + oe.treePanel.Return(); |
---|
| 648 | + |
---|
570 | 649 | // oe.aConstraints.gridx += 1; |
---|
571 | 650 | // oe.aConstraints.weighty = 0; |
---|
572 | 651 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
578 | 657 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
579 | 658 | // gcButton.addActionListener(this); |
---|
580 | 659 | |
---|
581 | | - oe.aConstraints.gridx = 0; |
---|
582 | | - oe.aConstraints.gridy += 1; |
---|
583 | | - |
---|
584 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
585 | | - oe.aConstraints.gridwidth = 100; |
---|
586 | | - // oe.aConstraints.gridheight = 100; |
---|
587 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
588 | | - oe.aConstraints.gridheight = 1; |
---|
589 | | - oe.aConstraints.weighty = 0.5; |
---|
590 | | - oe.aConstraints.gridx = 0; |
---|
591 | | - JScrollPane jSP; |
---|
| 660 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 661 | + |
---|
| 662 | + JScrollPane jSP; |
---|
592 | 663 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
593 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 664 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
594 | 665 | ResetModel(); |
---|
595 | | - oe.aConstraints.weighty = 0.5; |
---|
596 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
597 | | - oe.aConstraints.gridy += 1; |
---|
598 | | - oe.aConstraints.gridwidth = 1; |
---|
| 666 | + |
---|
| 667 | + oe.treePanel.add(jSPPanel); |
---|
| 668 | + oe.treePanel.Return(); |
---|
599 | 669 | |
---|
600 | | - oe.aConstraints.weighty = 0; |
---|
601 | | - oe.aConstraints.gridwidth = 2; |
---|
602 | | - |
---|
603 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 670 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 671 | + |
---|
| 672 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 673 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
604 | 674 | colorCB.addItemListener(this); |
---|
605 | | - oe.aConstraints.gridx += 2; |
---|
606 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 675 | + |
---|
| 676 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 677 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
607 | 678 | materialCB.addItemListener(this); |
---|
608 | | - oe.aConstraints.gridx += 2; |
---|
609 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 679 | + |
---|
| 680 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 681 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
610 | 682 | textureCB.addItemListener(this); |
---|
611 | 683 | |
---|
612 | | - oe.aConstraints.gridx = 0; |
---|
613 | | - oe.aConstraints.gridy += 1; |
---|
| 684 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 685 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 686 | + oe.treePanel.Return(); |
---|
614 | 687 | |
---|
| 688 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 689 | +// mainPanel.setResizeWeight(0.5); |
---|
| 690 | + |
---|
615 | 691 | //jList.addListSelectionListener(this); |
---|
616 | 692 | oe.jTree.addTreeSelectionListener(this); |
---|
617 | 693 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
633 | 709 | radio.layout = sevenButton; |
---|
634 | 710 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
635 | 711 | } |
---|
| 712 | + |
---|
| 713 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 714 | + { |
---|
| 715 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 716 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 717 | + boxCB.addItemListener(this); |
---|
| 718 | + |
---|
| 719 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 720 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 721 | + zoomBoxCB.addItemListener(this); |
---|
| 722 | + |
---|
| 723 | + if (true) // Globals.ADVANCED) |
---|
| 724 | + { |
---|
| 725 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 726 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 727 | + supportCB.addItemListener(this); |
---|
| 728 | + |
---|
| 729 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 730 | + // localCB.addItemListener(this); |
---|
| 731 | + |
---|
| 732 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 733 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 734 | + crowdCB.addItemListener(this); |
---|
| 735 | + |
---|
| 736 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 737 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 738 | + smoothCB.addItemListener(this); |
---|
| 739 | + |
---|
| 740 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 741 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 742 | + slowCB.addItemListener(this); |
---|
| 743 | + |
---|
| 744 | +// constraints.gridy += 1; |
---|
| 745 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 746 | +// speakerMocapCB.addItemListener(this); |
---|
| 747 | + |
---|
| 748 | + if (false) |
---|
| 749 | + { |
---|
| 750 | + // handled in scripts |
---|
| 751 | + //constraints.gridy += 1; |
---|
| 752 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 753 | + speakerCameraCB.addItemListener(this); |
---|
| 754 | + |
---|
| 755 | + //constraints.gridy += 1; |
---|
| 756 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 757 | + speakerFocusCB.addItemListener(this); |
---|
| 758 | + |
---|
| 759 | + //constraints.gridy += 1; |
---|
| 760 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 761 | + smoothfocusCB.addItemListener(this); |
---|
| 762 | + } |
---|
| 763 | + |
---|
| 764 | +//constraints.gridx += 1; |
---|
| 765 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 766 | +// debugCB.addItemListener(this); |
---|
| 767 | + |
---|
| 768 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 769 | + oeilCB.addItemListener(this); |
---|
| 770 | + |
---|
| 771 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 772 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 773 | + lookAtCB.addItemListener(this); |
---|
| 774 | + |
---|
| 775 | + } |
---|
| 776 | + |
---|
| 777 | + cGridBag fill = new cGridBag(); |
---|
| 778 | + |
---|
| 779 | + fill.preferredHeight = 200; |
---|
| 780 | + |
---|
| 781 | + panel.add(fill); |
---|
| 782 | + |
---|
| 783 | + } |
---|
636 | 784 | |
---|
637 | 785 | void EditObject(Object3D obj) |
---|
638 | 786 | { |
---|
639 | | - cRadio dummyButton = new cRadio(obj.name); |
---|
640 | | - dummyButton.SetObject(obj); |
---|
641 | | - dummyButton.layout = sevenButton; |
---|
642 | | - dummyButton.SetCamera(cameraView.renderCamera, false); |
---|
643 | | - dummyButton.addActionListener(this); |
---|
644 | | - radioPanel.add(dummyButton); |
---|
645 | | - buttonGroup.add(dummyButton); |
---|
646 | | - dummyButton.doClick(); |
---|
| 787 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 788 | + radioButton.SetObject(obj); |
---|
| 789 | + radioButton.layout = sevenButton; |
---|
| 790 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 791 | + radioButton.addActionListener(this); |
---|
| 792 | + radioPanel.add(radioButton); |
---|
| 793 | + buttonGroup.add(radioButton); |
---|
| 794 | + radioButton.doClick(); |
---|
647 | 795 | } |
---|
| 796 | + |
---|
648 | 797 | void SetupViews(ObjEditor oe) |
---|
649 | 798 | { |
---|
650 | 799 | oe.SetupViews(); |
---|
.. | .. |
---|
663 | 812 | JCheckBox fastCB; |
---|
664 | 813 | JCheckBox slowCB; |
---|
665 | 814 | JCheckBox boxCB; |
---|
| 815 | + JCheckBox zoomBoxCB; |
---|
666 | 816 | JCheckBox trackCB; |
---|
667 | 817 | JCheckBox smoothfocusCB; |
---|
668 | 818 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
705 | 855 | dropAttributes |= Object3D.TEXTURE; |
---|
706 | 856 | else |
---|
707 | 857 | dropAttributes &= ~Object3D.TEXTURE; |
---|
708 | | - } |
---|
709 | | - else if(e.getSource() == liveCB) |
---|
| 858 | + } else if(e.getSource() == liveCB) |
---|
710 | 859 | { |
---|
711 | 860 | cameraView.ToggleLive(); |
---|
712 | 861 | } |
---|
.. | .. |
---|
743 | 892 | Recompile(); |
---|
744 | 893 | cameraView.repaint(); |
---|
745 | 894 | // refreshContents(); |
---|
| 895 | + } |
---|
| 896 | + else if(e.getSource() == zoomBoxCB) |
---|
| 897 | + { |
---|
| 898 | + cameraView.ToggleZoomBoxMode(); |
---|
746 | 899 | } |
---|
747 | 900 | else if(e.getSource() == smoothfocusCB) |
---|
748 | 901 | { |
---|
.. | .. |
---|
857 | 1010 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
858 | 1011 | // return; |
---|
859 | 1012 | // } |
---|
860 | | - if (string.charAt(0) == '/') |
---|
| 1013 | + |
---|
| 1014 | + // File path for Mac and Windows |
---|
| 1015 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
861 | 1016 | { |
---|
862 | 1017 | // file(s) |
---|
863 | 1018 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
884 | 1039 | |
---|
885 | 1040 | flashIt = false; |
---|
886 | 1041 | CameraPane pane = (CameraPane) target; |
---|
887 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1042 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
888 | 1043 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
889 | 1044 | |
---|
890 | 1045 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
911 | 1066 | { |
---|
912 | 1067 | loadClipboard(true); |
---|
913 | 1068 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
914 | | - pasteInto(false); |
---|
| 1069 | + pasteInto(false, false); |
---|
915 | 1070 | } else { |
---|
916 | 1071 | loadClipboard(false); |
---|
917 | 1072 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
918 | | - pasteInto(false); // true); // ??? |
---|
| 1073 | + pasteInto(false, false); // true); // ??? |
---|
919 | 1074 | } |
---|
920 | 1075 | } |
---|
921 | 1076 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1033 | 1188 | torusItem.addActionListener(this); |
---|
1034 | 1189 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1035 | 1190 | superItem.addActionListener(this); |
---|
| 1191 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1192 | + kleinItem.addActionListener(this); |
---|
1036 | 1193 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1037 | 1194 | particleItem.addActionListener(this); |
---|
| 1195 | + if (Globals.ADVANCED) |
---|
| 1196 | + { |
---|
1038 | 1197 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1039 | 1198 | ragdollItem.addActionListener(this); |
---|
1040 | 1199 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1041 | 1200 | ragdoll2Item.addActionListener(this); |
---|
| 1201 | + } |
---|
1042 | 1202 | menu.add("-"); |
---|
1043 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1203 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1044 | 1204 | meshItem.addActionListener(this); |
---|
1045 | 1205 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1046 | 1206 | // meshGroupItem.addActionListener(this); |
---|
| 1207 | + if (Globals.ADVANCED) |
---|
| 1208 | + { |
---|
1047 | 1209 | springItem = menu.add(new MenuItem("Spring")); |
---|
1048 | 1210 | springItem.addActionListener(this); |
---|
1049 | 1211 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1050 | 1212 | flagItem.addActionListener(this); |
---|
1051 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1052 | | - bezierItem.addActionListener(this); |
---|
1053 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1054 | | - checkerItem.addActionListener(this); |
---|
1055 | 1213 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1056 | 1214 | blobItem.addActionListener(this); |
---|
1057 | 1215 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1058 | 1216 | latheItem.addActionListener(this); |
---|
| 1217 | + } |
---|
| 1218 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1219 | + bezierItem.addActionListener(this); |
---|
| 1220 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1221 | + overlayItem.addActionListener(this); |
---|
1059 | 1222 | lightItem = menu.add(new MenuItem("Light")); |
---|
1060 | 1223 | lightItem.addActionListener(this); |
---|
1061 | 1224 | menu.add("-"); |
---|
.. | .. |
---|
1065 | 1228 | loopItem.addActionListener(this); |
---|
1066 | 1229 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1067 | 1230 | doubleItem.addActionListener(this); |
---|
| 1231 | + if (Globals.ADVANCED) |
---|
| 1232 | + { |
---|
1068 | 1233 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1069 | 1234 | tripleItem.addActionListener(this); |
---|
| 1235 | + } |
---|
1070 | 1236 | } |
---|
1071 | 1237 | |
---|
1072 | 1238 | void buildToolsMenu(Menu menu) |
---|
1073 | 1239 | { |
---|
1074 | 1240 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1075 | 1241 | animationItem.addItemListener(this); |
---|
1076 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1242 | + animationItem.setState(Globals.ANIMATION); |
---|
1077 | 1243 | |
---|
1078 | 1244 | menu.add("-"); |
---|
1079 | 1245 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1080 | 1246 | parseverticesItem.addActionListener(this); |
---|
1081 | 1247 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1082 | 1248 | textureFieldItem.addActionListener(this); |
---|
1083 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1249 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1084 | 1250 | alignItem.addActionListener(this); |
---|
1085 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1086 | | - mirrorItem.addActionListener(this); |
---|
1087 | 1251 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1088 | 1252 | reduceMorphItem.addActionListener(this); |
---|
1089 | 1253 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1090 | 1254 | reduce34MorphItem.addActionListener(this); |
---|
1091 | | - |
---|
| 1255 | + menu.add("-"); |
---|
1092 | 1256 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1093 | 1257 | computeAOItem.addActionListener(this); |
---|
1094 | | - menu.add("-"); |
---|
1095 | 1258 | |
---|
| 1259 | + if (Globals.ADVANCED) |
---|
| 1260 | + { |
---|
| 1261 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1262 | + mirrorItem.addActionListener(this); |
---|
| 1263 | + menu.add("-"); |
---|
1096 | 1264 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1097 | 1265 | memoryItem.addActionListener(this); |
---|
1098 | 1266 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1106 | 1274 | resetParentItem.addActionListener(this); |
---|
1107 | 1275 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1108 | 1276 | repairParentItem.addActionListener(this); |
---|
| 1277 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1278 | + repairShadowItem.addActionListener(this); |
---|
1109 | 1279 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1110 | 1280 | invariantsItem.addActionListener(this); |
---|
1111 | 1281 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1113 | 1283 | menu.add("-"); |
---|
1114 | 1284 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1115 | 1285 | editScriptItem.addActionListener(this); |
---|
| 1286 | + } |
---|
1116 | 1287 | } |
---|
1117 | 1288 | |
---|
1118 | 1289 | void ScreenFit() |
---|
.. | .. |
---|
1441 | 1612 | |
---|
1442 | 1613 | void Overwrite(int mask) |
---|
1443 | 1614 | { |
---|
1444 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1615 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1445 | 1616 | { |
---|
1446 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1617 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1447 | 1618 | |
---|
1448 | 1619 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1449 | 1620 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1466 | 1637 | // |
---|
1467 | 1638 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1468 | 1639 | { |
---|
| 1640 | + Object source = event.getSource(); |
---|
1469 | 1641 | /* |
---|
1470 | 1642 | if (event.getSource() == nameField) |
---|
1471 | 1643 | { |
---|
.. | .. |
---|
1477 | 1649 | } |
---|
1478 | 1650 | else |
---|
1479 | 1651 | */ |
---|
1480 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1652 | + if (source == lookAtItem || source == lookFromItem) |
---|
1481 | 1653 | { |
---|
1482 | 1654 | ScreenFit(); |
---|
1483 | 1655 | } else |
---|
1484 | | - if (event.getSource() == switchItem) |
---|
| 1656 | + if (source == switchItem) |
---|
1485 | 1657 | { |
---|
1486 | 1658 | cVector v1 = new cVector(); |
---|
1487 | 1659 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1490 | 1662 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1491 | 1663 | objEditor.cameraView.repaint(); |
---|
1492 | 1664 | } else |
---|
1493 | | - if (event.getSource() == rectoidItem) |
---|
| 1665 | + if (source == rectoidItem) |
---|
1494 | 1666 | { |
---|
1495 | 1667 | makeSomething(new Box()); |
---|
1496 | 1668 | } else |
---|
1497 | | - if (event.getSource() == particleItem) |
---|
| 1669 | + if (source == particleItem) |
---|
1498 | 1670 | { |
---|
1499 | 1671 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1500 | 1672 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1515 | 1687 | applyExample(particleGeom, "SMOKE"); |
---|
1516 | 1688 | makeSomething(particleGeom); |
---|
1517 | 1689 | } else |
---|
1518 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1690 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1519 | 1691 | { |
---|
1520 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1692 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1521 | 1693 | |
---|
1522 | 1694 | ragdoll.toParent = LA.newMatrix(); |
---|
1523 | 1695 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1535 | 1707 | } else |
---|
1536 | 1708 | /* |
---|
1537 | 1709 | */ |
---|
1538 | | - if (event.getSource() == heightFieldItem) |
---|
| 1710 | + if (source == heightFieldItem) |
---|
1539 | 1711 | { |
---|
1540 | 1712 | Object3D obj = new Object3D(); |
---|
1541 | 1713 | |
---|
.. | .. |
---|
1573 | 1745 | |
---|
1574 | 1746 | makeSomething(obj); |
---|
1575 | 1747 | } else |
---|
1576 | | - if (event.getSource() == gridItem) |
---|
| 1748 | + if (source == gridItem) |
---|
1577 | 1749 | { |
---|
1578 | 1750 | makeSomething(new Grid()); |
---|
1579 | 1751 | } else |
---|
1580 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1752 | + if (source == ellipsoidItem) |
---|
1581 | 1753 | { |
---|
1582 | 1754 | makeSomething(new Sphere()); |
---|
1583 | 1755 | } else |
---|
1584 | | - if (event.getSource() == coneItem) |
---|
| 1756 | + if (source == coneItem) |
---|
1585 | 1757 | { |
---|
1586 | 1758 | makeSomething(new Cone()); |
---|
1587 | 1759 | } else |
---|
1588 | | - if (event.getSource() == torusItem) |
---|
| 1760 | + if (source == torusItem) |
---|
1589 | 1761 | { |
---|
1590 | 1762 | makeSomething(new Torus()); |
---|
1591 | 1763 | } else |
---|
1592 | | - if (event.getSource() == superItem) |
---|
| 1764 | + if (source == superItem) |
---|
1593 | 1765 | { |
---|
1594 | 1766 | makeSomething(new Superellipsoid()); |
---|
1595 | 1767 | } else |
---|
1596 | | - if (event.getSource() == blobItem) |
---|
| 1768 | + if (source == kleinItem) |
---|
| 1769 | + { |
---|
| 1770 | + makeSomething(new Klein()); |
---|
| 1771 | + } else |
---|
| 1772 | + if (source == blobItem) |
---|
1597 | 1773 | { |
---|
1598 | 1774 | Blob blob = new Blob(); |
---|
1599 | 1775 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1601 | 1777 | //blob.retile(); |
---|
1602 | 1778 | makeSomething(blob); |
---|
1603 | 1779 | } else |
---|
1604 | | - if (event.getSource() == latheItem) |
---|
| 1780 | + if (source == latheItem) |
---|
1605 | 1781 | { |
---|
1606 | 1782 | makeSomething(new Lathe()); |
---|
1607 | 1783 | } else |
---|
1608 | | - if (event.getSource() == bezierItem) |
---|
| 1784 | + if (source == bezierItem) |
---|
1609 | 1785 | { |
---|
1610 | 1786 | makeSomething(new BezierSurface()); |
---|
1611 | 1787 | } else |
---|
1612 | | - if (event.getSource() == checkerItem) |
---|
| 1788 | + if (source == overlayItem) |
---|
1613 | 1789 | { |
---|
1614 | 1790 | /* |
---|
1615 | 1791 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1624 | 1800 | */ |
---|
1625 | 1801 | makeSomething(new Checker()); |
---|
1626 | 1802 | } else |
---|
1627 | | - if (event.getSource() == meshItem) |
---|
| 1803 | + if (source == meshItem) |
---|
1628 | 1804 | { |
---|
1629 | 1805 | Object3D itemtomake = new Object3D(); |
---|
1630 | 1806 | Object3D child; |
---|
.. | .. |
---|
1645 | 1821 | makeSomething(child); |
---|
1646 | 1822 | } |
---|
1647 | 1823 | } else |
---|
1648 | | - if (event.getSource() == springItem) |
---|
| 1824 | + if (source == springItem) |
---|
1649 | 1825 | { |
---|
1650 | 1826 | cSpring s = new cSpring(); |
---|
1651 | 1827 | s.setup(); |
---|
1652 | 1828 | makeSomething(s); |
---|
1653 | 1829 | } else |
---|
1654 | | - if (event.getSource() == flagItem) |
---|
| 1830 | + if (source == flagItem) |
---|
1655 | 1831 | { |
---|
1656 | 1832 | cSpring s = new cFlag(); |
---|
1657 | 1833 | s.setup(); |
---|
1658 | 1834 | makeSomething(s); |
---|
1659 | 1835 | } else |
---|
1660 | | - if (event.getSource() == lightItem) |
---|
| 1836 | + if (source == lightItem) |
---|
1661 | 1837 | { |
---|
1662 | 1838 | makeSomething(new Light()); |
---|
1663 | 1839 | } else |
---|
1664 | | - if (event.getSource() == csgItem) |
---|
| 1840 | + if (source == csgItem) |
---|
1665 | 1841 | { |
---|
1666 | 1842 | group(new CSG()); |
---|
1667 | 1843 | } else |
---|
1668 | | - if (event.getSource() == templateItem) |
---|
| 1844 | + if (source == templateItem) |
---|
1669 | 1845 | { |
---|
1670 | 1846 | group(new cTemplate()); |
---|
1671 | 1847 | } else |
---|
1672 | | - if (event.getSource() == attributeItem) |
---|
| 1848 | + if (source == attributeItem) |
---|
1673 | 1849 | { |
---|
1674 | 1850 | makeSomething(new Attribute()); |
---|
1675 | 1851 | } else |
---|
1676 | | - if (event.getSource() == pointflowItem) |
---|
| 1852 | + if (source == pointflowItem) |
---|
1677 | 1853 | { |
---|
1678 | 1854 | makeSomething(new PointFlow()); |
---|
1679 | 1855 | } else |
---|
.. | .. |
---|
1685 | 1861 | } else |
---|
1686 | 1862 | */ |
---|
1687 | 1863 | |
---|
1688 | | - if (event.getSource() == superLoopItem) |
---|
| 1864 | + if (source == superLoopItem) |
---|
1689 | 1865 | { |
---|
1690 | 1866 | Composite g = new cGroup(); |
---|
1691 | 1867 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1707 | 1883 | |
---|
1708 | 1884 | group(g); |
---|
1709 | 1885 | } else |
---|
1710 | | - if (event.getSource() == loopItem) |
---|
| 1886 | + if (source == loopItem) |
---|
1711 | 1887 | { |
---|
1712 | 1888 | Composite csg = new GroupLeaf(); |
---|
1713 | 1889 | csg.count = 5; |
---|
.. | .. |
---|
1716 | 1892 | csg.addChild(child); |
---|
1717 | 1893 | child.addChild(csg); |
---|
1718 | 1894 | } else |
---|
1719 | | - if (event.getSource() == doubleItem) |
---|
| 1895 | + if (source == doubleItem) |
---|
1720 | 1896 | { |
---|
1721 | 1897 | Composite csg = new GroupLeaf(); |
---|
1722 | 1898 | csg.count = 5; |
---|
.. | .. |
---|
1728 | 1904 | csg.addChild(child); |
---|
1729 | 1905 | child.addChild(csg); |
---|
1730 | 1906 | } else |
---|
1731 | | - if (event.getSource() == tripleItem) |
---|
| 1907 | + if (source == tripleItem) |
---|
1732 | 1908 | { |
---|
1733 | 1909 | Composite csg = new GroupLeaf(); |
---|
1734 | 1910 | csg.count = 4; |
---|
.. | .. |
---|
1743 | 1919 | csg.addChild(child); |
---|
1744 | 1920 | child.addChild(csg); |
---|
1745 | 1921 | } else |
---|
1746 | | - |
---|
1747 | | - if (event.getSource() == importGFDItem) |
---|
| 1922 | + if (source == computeAOItem) |
---|
1748 | 1923 | { |
---|
1749 | | - ImportGFD(); |
---|
| 1924 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1925 | + Globals.theRenderer.repaint(); |
---|
1750 | 1926 | } else |
---|
1751 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1752 | | - { |
---|
1753 | | - ImportVRMLX3D(); |
---|
1754 | | - } else |
---|
1755 | | - if (event.getSource() == import3DSItem) |
---|
1756 | | - { |
---|
1757 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1758 | | - } else |
---|
1759 | | - if (event.getSource() == importOBJItem) |
---|
1760 | | - { |
---|
1761 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1762 | | - } else |
---|
1763 | | - if (event.getSource() == computeAOItem) |
---|
1764 | | - { |
---|
1765 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1766 | | - CameraPane.theRenderer.repaint(); |
---|
1767 | | - } else |
---|
1768 | | - if (event.getSource() == recompileItem) |
---|
| 1927 | + if (source == recompileItem) |
---|
1769 | 1928 | { |
---|
1770 | 1929 | Recompile(); |
---|
1771 | 1930 | refreshContents(); |
---|
1772 | 1931 | } else |
---|
1773 | | - if (event.getSource() == editScriptItem) |
---|
| 1932 | + if (source == editScriptItem) |
---|
1774 | 1933 | { |
---|
1775 | 1934 | OpenDialog(); |
---|
1776 | 1935 | refreshContents(); |
---|
1777 | 1936 | } else |
---|
1778 | | - if (event.getSource() == invariantsItem) |
---|
| 1937 | + if (source == invariantsItem) |
---|
1779 | 1938 | { |
---|
1780 | 1939 | System.out.println("Invariants:"); |
---|
1781 | | - GrafreeD.theApplet3D.universe.invariants(); |
---|
| 1940 | + Grafreed.grafreeD.universe.invariants(); |
---|
1782 | 1941 | } else |
---|
1783 | | - if (event.getSource() == memoryItem) |
---|
| 1942 | + if (source == memoryItem) |
---|
1784 | 1943 | { |
---|
1785 | 1944 | //System.out.println("Invariants:"); |
---|
1786 | 1945 | PrintMemory(); |
---|
1787 | 1946 | } else |
---|
1788 | | - if (event.getSource() == pathItem) |
---|
| 1947 | + if (source == pathItem) |
---|
1789 | 1948 | { |
---|
1790 | 1949 | PrintPath(); |
---|
1791 | 1950 | } else |
---|
1792 | | - if (event.getSource() == analyzeItem) |
---|
| 1951 | + if (source == analyzeItem) |
---|
1793 | 1952 | { |
---|
1794 | 1953 | AnalyzeObject(); |
---|
1795 | 1954 | } else |
---|
1796 | | - if (event.getSource() == dumpItem) |
---|
| 1955 | + if (source == dumpItem) |
---|
1797 | 1956 | { |
---|
1798 | 1957 | DumpObject(); |
---|
1799 | 1958 | } else |
---|
1800 | | - if (event.getSource() == screenfitButton) |
---|
| 1959 | + if (source == oneStepButton) |
---|
| 1960 | + { |
---|
| 1961 | + Globals.ONESTEP = true; |
---|
| 1962 | + cameraView.repaint(); |
---|
| 1963 | + } else |
---|
| 1964 | + if (source == screenfitButton) |
---|
1801 | 1965 | { |
---|
1802 | 1966 | //Reload(lastConverter, lastFilename, true); |
---|
1803 | 1967 | ScreenFit(); |
---|
1804 | 1968 | } else |
---|
1805 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1969 | + if (source == screenfitpointButton) |
---|
1806 | 1970 | { |
---|
1807 | 1971 | //Reload(lastConverter, lastFilename, true); |
---|
1808 | 1972 | ScreenFitPoint(); |
---|
1809 | 1973 | } else |
---|
1810 | | - if (event.getSource() == snapobjectButton) |
---|
| 1974 | + if (source == snapobjectButton) |
---|
1811 | 1975 | { |
---|
1812 | 1976 | //Reload(lastConverter, lastFilename, true); |
---|
1813 | 1977 | SnapObject(); |
---|
.. | .. |
---|
1818 | 1982 | // Recompile(); |
---|
1819 | 1983 | // refreshContents(); |
---|
1820 | 1984 | // } else |
---|
1821 | | - if (event.getSource() == gcButton) |
---|
| 1985 | + if (source == gcButton) |
---|
1822 | 1986 | { |
---|
1823 | 1987 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1824 | 1988 | System.gc(); |
---|
1825 | 1989 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1826 | 1990 | } else |
---|
1827 | | - if (event.getSource() == editLeafItem) |
---|
| 1991 | + if (source == editLeafItem) |
---|
1828 | 1992 | { |
---|
1829 | 1993 | Object3D obj; |
---|
1830 | 1994 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1838 | 2002 | } |
---|
1839 | 2003 | refreshContents(true); |
---|
1840 | 2004 | } else |
---|
1841 | | - if (event.getSource() == openWindowItem) |
---|
| 2005 | + if (source == openWindowItem) |
---|
1842 | 2006 | { |
---|
1843 | 2007 | EditSelection(true); |
---|
1844 | 2008 | } else |
---|
1845 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2009 | + if (source == cutItem || source == clearButton) |
---|
1846 | 2010 | { |
---|
1847 | 2011 | loadClipboard(true); |
---|
1848 | 2012 | } else |
---|
1849 | | - if (event.getSource() == duplicateItem) |
---|
| 2013 | + if (source == undoItem) |
---|
1850 | 2014 | { |
---|
1851 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2015 | + Undo(); |
---|
| 2016 | + } else |
---|
| 2017 | + if (source == redoItem) |
---|
| 2018 | + { |
---|
| 2019 | + Redo(); |
---|
| 2020 | + } else |
---|
| 2021 | + if (source == duplicateItem) |
---|
| 2022 | + { |
---|
| 2023 | + Object3D keep = Grafreed.clipboard; |
---|
1852 | 2024 | loadClipboard(false); |
---|
1853 | 2025 | paste(false); |
---|
1854 | | - GrafreeD.clipboard = keep; |
---|
| 2026 | + Grafreed.clipboard = keep; |
---|
1855 | 2027 | } else |
---|
1856 | | - if (event.getSource() == cloneItem) |
---|
| 2028 | + if (source == cloneItem) |
---|
1857 | 2029 | { |
---|
1858 | 2030 | CloneSelection(false); |
---|
1859 | 2031 | } else |
---|
1860 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2032 | + if (source == cloneSupportItem) |
---|
1861 | 2033 | { |
---|
1862 | 2034 | CloneSelection(true); |
---|
1863 | 2035 | } else |
---|
1864 | | - if (event.getSource() == copyItem) |
---|
| 2036 | + if (source == copyItem) |
---|
1865 | 2037 | { |
---|
1866 | 2038 | loadClipboard(false); |
---|
1867 | 2039 | } else |
---|
1868 | | - if (event.getSource() == pasteItem) |
---|
| 2040 | + if (source == pasteItem) |
---|
1869 | 2041 | { |
---|
1870 | 2042 | paste(false); |
---|
1871 | 2043 | } else |
---|
1872 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2044 | + if (source == pasteIntoItem) |
---|
1873 | 2045 | { |
---|
1874 | | - pasteInto(false); |
---|
| 2046 | + pasteInto(true, false); |
---|
1875 | 2047 | } else |
---|
1876 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2048 | + if (source == pasteLinkItem) |
---|
1877 | 2049 | { |
---|
1878 | | - pasteInto(true); |
---|
| 2050 | + pasteInto(false, false); |
---|
1879 | 2051 | } else |
---|
1880 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2052 | + if (source == pasteCloneItem) |
---|
| 2053 | + { |
---|
| 2054 | + pasteInto(true, true); |
---|
| 2055 | + } else |
---|
| 2056 | + if (source == pasteExpandItem) |
---|
1881 | 2057 | { |
---|
1882 | 2058 | paste(true); |
---|
1883 | 2059 | } else |
---|
1884 | | - if (event.getSource() == synchronizeItem) |
---|
| 2060 | + if (source == synchronizeItem) |
---|
1885 | 2061 | { |
---|
1886 | 2062 | Overwrite(Object3D.TRANSFORM); |
---|
1887 | 2063 | } else |
---|
1888 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2064 | + if (source == overwriteNameItem) |
---|
1889 | 2065 | { |
---|
1890 | 2066 | Overwrite(Object3D.NAME); |
---|
1891 | 2067 | } else |
---|
1892 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2068 | + if (source == overwriteUVItem) |
---|
1893 | 2069 | { |
---|
1894 | 2070 | Overwrite(Object3D.UV); |
---|
1895 | 2071 | } else |
---|
1896 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2072 | + if (source == overwriteMatItem) |
---|
1897 | 2073 | { |
---|
1898 | 2074 | /* july 2015 |
---|
1899 | 2075 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1913 | 2089 | |
---|
1914 | 2090 | Overwrite(dropAttributes); |
---|
1915 | 2091 | } |
---|
1916 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2092 | + if (source == overwriteGeoItem) |
---|
1917 | 2093 | { |
---|
1918 | 2094 | Overwrite(Object3D.GEOMETRY); |
---|
1919 | 2095 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1930 | 2106 | // refreshContents(); |
---|
1931 | 2107 | // } |
---|
1932 | 2108 | } else |
---|
1933 | | - if (event.getSource() == generateMeshItem) |
---|
| 2109 | + if (source == generateMeshItem) |
---|
1934 | 2110 | { |
---|
1935 | 2111 | //if (group.selection.size() == 1) |
---|
1936 | 2112 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1941 | 2117 | ResetModel(); |
---|
1942 | 2118 | refreshContents(); |
---|
1943 | 2119 | } else |
---|
1944 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2120 | + if (source == extractGeometriesItem) |
---|
1945 | 2121 | { |
---|
1946 | 2122 | boolean one = false; |
---|
1947 | 2123 | |
---|
.. | .. |
---|
1968 | 2144 | ResetModel(); |
---|
1969 | 2145 | refreshContents(); |
---|
1970 | 2146 | } else |
---|
1971 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2147 | + if (source == cloneGeometriesItem) |
---|
1972 | 2148 | { |
---|
1973 | 2149 | boolean one = false; |
---|
1974 | 2150 | |
---|
.. | .. |
---|
1994 | 2170 | ResetModel(); |
---|
1995 | 2171 | refreshContents(); |
---|
1996 | 2172 | } else |
---|
1997 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2173 | + if (source == shareGeometriesItem) |
---|
1998 | 2174 | { |
---|
1999 | 2175 | boolean one = false; |
---|
2000 | 2176 | |
---|
2001 | 2177 | if (group.selection.size() == 1) |
---|
2002 | 2178 | one = true; |
---|
2003 | 2179 | |
---|
| 2180 | + Object3D merge = null; |
---|
| 2181 | + |
---|
2004 | 2182 | Object3D content = new cGroup(); |
---|
2005 | 2183 | |
---|
2006 | 2184 | for (int i=0; i<group.selection.size(); i++) |
---|
2007 | 2185 | { |
---|
2008 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2186 | + merge = new Merge(group.selection.get(i)); |
---|
2009 | 2187 | |
---|
2010 | 2188 | if (one) |
---|
2011 | | - makeSomething(sel, false); |
---|
| 2189 | + makeSomething(merge, false); |
---|
2012 | 2190 | else |
---|
2013 | | - content.addChild(sel); |
---|
| 2191 | + content.addChild(merge); |
---|
2014 | 2192 | } |
---|
2015 | 2193 | |
---|
2016 | 2194 | if (!one) |
---|
2017 | | - makeSomething(content, false); |
---|
2018 | | - |
---|
2019 | | - ResetModel(); |
---|
2020 | | - refreshContents(); |
---|
| 2195 | + makeSomething(content, true); |
---|
| 2196 | + else |
---|
| 2197 | + { |
---|
| 2198 | + ResetModel(); |
---|
| 2199 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2200 | + refreshContents(); |
---|
| 2201 | + } |
---|
2021 | 2202 | } else |
---|
2022 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2203 | + if (source == mergeGeometriesItem) |
---|
2023 | 2204 | { |
---|
2024 | 2205 | boolean one = false; |
---|
2025 | 2206 | |
---|
.. | .. |
---|
2049 | 2230 | ResetModel(); |
---|
2050 | 2231 | refreshContents(); |
---|
2051 | 2232 | } else |
---|
2052 | | - if (event.getSource() == linkverticesItem) |
---|
| 2233 | + if (source == linkverticesItem) |
---|
2053 | 2234 | { |
---|
2054 | 2235 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2055 | 2236 | // { |
---|
.. | .. |
---|
2062 | 2243 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2063 | 2244 | // refreshContents(); |
---|
2064 | 2245 | // } |
---|
2065 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2246 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2066 | 2247 | { |
---|
2067 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2248 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2068 | 2249 | |
---|
2069 | 2250 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2070 | 2251 | content = ((cGroup)content).get(0); |
---|
2071 | 2252 | |
---|
2072 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2253 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2073 | 2254 | for (int i=0; i<group.selection.size(); i++) |
---|
2074 | 2255 | { |
---|
2075 | | - boolean random = CameraPane.RANDOM; |
---|
2076 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2256 | + boolean random = CameraPane.SWITCH; |
---|
| 2257 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2077 | 2258 | group.selection.get(i).linkVerticesThis(content); |
---|
2078 | 2259 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2079 | | - CameraPane.RANDOM = random; |
---|
| 2260 | + CameraPane.SWITCH = random; |
---|
2080 | 2261 | } |
---|
2081 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2262 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2082 | 2263 | refreshContents(); |
---|
2083 | 2264 | } |
---|
2084 | 2265 | } else |
---|
2085 | | - if (event.getSource() == resetsupportItem) |
---|
| 2266 | + if (source == resetsupportItem) |
---|
2086 | 2267 | { |
---|
2087 | 2268 | for (int i=0; i<group.selection.size(); i++) |
---|
2088 | 2269 | { |
---|
2089 | | - boolean random = CameraPane.RANDOM; |
---|
2090 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2270 | + boolean random = CameraPane.SWITCH; |
---|
| 2271 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2091 | 2272 | group.selection.get(i).linkVerticesThis(null); |
---|
2092 | | - CameraPane.RANDOM = random; |
---|
| 2273 | + CameraPane.SWITCH = random; |
---|
2093 | 2274 | } |
---|
2094 | 2275 | |
---|
2095 | 2276 | refreshContents(); |
---|
2096 | 2277 | } else |
---|
2097 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2278 | + if (source == relinkverticesItem) |
---|
| 2279 | + { |
---|
| 2280 | + boolean random = CameraPane.SWITCH; |
---|
| 2281 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2282 | + group.selection.RelinkToSupport(); |
---|
| 2283 | + CameraPane.SWITCH = random; |
---|
| 2284 | + |
---|
| 2285 | + refreshContents(); |
---|
| 2286 | + } else |
---|
| 2287 | + if (source == resetreferencesItem) |
---|
2098 | 2288 | { |
---|
2099 | 2289 | for (int i=0; i<group.selection.size(); i++) |
---|
2100 | 2290 | { |
---|
.. | .. |
---|
2103 | 2293 | |
---|
2104 | 2294 | refreshContents(); |
---|
2105 | 2295 | } else |
---|
2106 | | - if (event.getSource() == setMasterItem) |
---|
| 2296 | + if (source == setMasterItem) |
---|
2107 | 2297 | { |
---|
2108 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2298 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2109 | 2299 | { |
---|
2110 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2300 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2111 | 2301 | |
---|
2112 | 2302 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2113 | 2303 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2116 | 2306 | refreshContents(); |
---|
2117 | 2307 | } |
---|
2118 | 2308 | } else |
---|
2119 | | - if (event.getSource() == poseMeshItem) |
---|
| 2309 | + if (source == poseMeshItem) |
---|
2120 | 2310 | { |
---|
2121 | 2311 | if (group.selection.size() == 1) |
---|
2122 | 2312 | { |
---|
2123 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2313 | + if (Grafreed.clipboard.size() == 1) |
---|
2124 | 2314 | { |
---|
2125 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2315 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2126 | 2316 | |
---|
2127 | 2317 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2128 | 2318 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2135 | 2325 | } |
---|
2136 | 2326 | |
---|
2137 | 2327 | } else |
---|
2138 | | - if (event.getSource() == revertMeshItem) |
---|
| 2328 | + if (source == revertMeshItem) |
---|
2139 | 2329 | { |
---|
2140 | 2330 | RevertMeshes(); |
---|
2141 | 2331 | } else |
---|
2142 | | - if (event.getSource() == resetMeshItem) |
---|
| 2332 | + if (source == resetAllItem) |
---|
2143 | 2333 | { |
---|
2144 | 2334 | ResetAll(); |
---|
2145 | 2335 | } else |
---|
2146 | | - if (event.getSource() == stepAllItem) |
---|
| 2336 | + if (source == stepAllItem) |
---|
2147 | 2337 | { |
---|
2148 | 2338 | StepAll(); |
---|
2149 | 2339 | } else |
---|
2150 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2340 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2151 | 2341 | { |
---|
2152 | 2342 | //int indices[] = jList.getSelectedIndices(); |
---|
2153 | 2343 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2155 | 2345 | |
---|
2156 | 2346 | ClearSelection(false); |
---|
2157 | 2347 | } else |
---|
2158 | | - if (event.getSource() == clearAllItem) |
---|
| 2348 | + if (source == clearAllItem) |
---|
2159 | 2349 | { |
---|
2160 | 2350 | ClearSelection(true); |
---|
2161 | 2351 | } else |
---|
2162 | | - if (event.getSource() == grabItem) |
---|
| 2352 | + if (source == grabItem) |
---|
2163 | 2353 | { |
---|
2164 | 2354 | group(new cGroup(), true); |
---|
2165 | 2355 | } else |
---|
2166 | | - if (event.getSource() == frontItem) |
---|
| 2356 | + if (source == hideItem) |
---|
| 2357 | + { |
---|
| 2358 | + group(new HiddenObject()); |
---|
| 2359 | + } else |
---|
| 2360 | + if (source == frontItem) |
---|
2167 | 2361 | { |
---|
2168 | 2362 | front(); |
---|
2169 | 2363 | } else |
---|
2170 | | - if (event.getSource() == backItem) |
---|
| 2364 | + if (source == backItem) |
---|
2171 | 2365 | { |
---|
2172 | 2366 | back(); |
---|
2173 | 2367 | } else |
---|
2174 | | - if (event.getSource() == cameraItem) |
---|
| 2368 | + if (source == cameraItem) |
---|
2175 | 2369 | { |
---|
2176 | 2370 | makeSomething(new Camera()); |
---|
2177 | 2371 | } else |
---|
2178 | | - if (event.getSource() == compositeItem) |
---|
| 2372 | + if (source == compositeItem) |
---|
2179 | 2373 | { |
---|
2180 | 2374 | group(new Composite()); |
---|
2181 | 2375 | } else |
---|
2182 | | - if (event.getSource() == randomItem) |
---|
| 2376 | + if (source == randomItem) |
---|
2183 | 2377 | { |
---|
2184 | 2378 | RandomNode random = new RandomNode(); |
---|
2185 | 2379 | group(random); |
---|
2186 | 2380 | if (random.size() > 0) |
---|
2187 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2381 | + random.name = random.get(0).name + "Switch"; |
---|
2188 | 2382 | } else |
---|
2189 | | - if (event.getSource() == physicsItem) |
---|
| 2383 | + if (source == physicsItem) |
---|
2190 | 2384 | { |
---|
2191 | 2385 | group(new PhysicsNode()); |
---|
2192 | 2386 | } else |
---|
2193 | | - if (event.getSource() == frameselectorItem) |
---|
| 2387 | + if (source == frameselectorItem) |
---|
2194 | 2388 | { |
---|
2195 | 2389 | for (int i=0; i<group.selection.size(); i++) |
---|
2196 | 2390 | { |
---|
.. | .. |
---|
2202 | 2396 | ResetModel(); |
---|
2203 | 2397 | refreshContents(); |
---|
2204 | 2398 | } else |
---|
2205 | | - if (event.getSource() == switchGeoItem) |
---|
| 2399 | + if (source == switchGeoItem) |
---|
2206 | 2400 | { |
---|
2207 | 2401 | for (int i=0; i<group.selection.size(); i++) |
---|
2208 | 2402 | { |
---|
.. | .. |
---|
2214 | 2408 | ResetModel(); |
---|
2215 | 2409 | refreshContents(); |
---|
2216 | 2410 | } else |
---|
2217 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2411 | + if (source == switchTransfoItem) |
---|
2218 | 2412 | { |
---|
2219 | 2413 | for (int i=0; i<group.selection.size(); i++) |
---|
2220 | 2414 | { |
---|
.. | .. |
---|
2226 | 2420 | ResetModel(); |
---|
2227 | 2421 | refreshContents(); |
---|
2228 | 2422 | } else |
---|
2229 | | - if (event.getSource() == morphItem) |
---|
| 2423 | + if (source == morphItem) |
---|
2230 | 2424 | { |
---|
2231 | 2425 | for (int i=0; i<group.selection.size(); i++) |
---|
2232 | 2426 | { |
---|
.. | .. |
---|
2238 | 2432 | ResetModel(); |
---|
2239 | 2433 | refreshContents(); |
---|
2240 | 2434 | } else |
---|
2241 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2435 | + if (source == scriptNodeItem) |
---|
2242 | 2436 | { |
---|
2243 | 2437 | boolean atleastone = false; |
---|
2244 | 2438 | |
---|
.. | .. |
---|
2277 | 2471 | } |
---|
2278 | 2472 | } |
---|
2279 | 2473 | } else |
---|
2280 | | - if (event.getSource() == linkerItem) |
---|
| 2474 | + if (source == linkerItem) |
---|
2281 | 2475 | { |
---|
2282 | 2476 | group(new cLinker()); |
---|
2283 | 2477 | } else |
---|
2284 | | - if (event.getSource() == textureItem) |
---|
| 2478 | + if (source == textureItem) |
---|
2285 | 2479 | { |
---|
2286 | 2480 | group(new TextureNode()); |
---|
2287 | 2481 | } else |
---|
2288 | | - if (event.getSource() == shadowXItem) |
---|
| 2482 | + if (source == billboardItem) |
---|
| 2483 | + { |
---|
| 2484 | + group(new BillboardNode()); |
---|
| 2485 | + } else |
---|
| 2486 | + if (source == shadowXItem) |
---|
2289 | 2487 | { |
---|
2290 | 2488 | CastShadow(0); |
---|
2291 | 2489 | } else |
---|
2292 | | - if (event.getSource() == shadowYItem) |
---|
| 2490 | + if (source == shadowYItem) |
---|
2293 | 2491 | { |
---|
2294 | 2492 | CastShadow(1); |
---|
2295 | 2493 | } else |
---|
2296 | | - if (event.getSource() == shadowZItem) |
---|
| 2494 | + if (source == shadowZItem) |
---|
2297 | 2495 | { |
---|
2298 | 2496 | CastShadow(2); |
---|
2299 | 2497 | } else |
---|
2300 | | - if (event.getSource() == ungroupItem) |
---|
| 2498 | + if (source == ungroupItem) |
---|
2301 | 2499 | { |
---|
2302 | | - ungroup(); |
---|
| 2500 | + //ungroup(); |
---|
| 2501 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2502 | + { |
---|
| 2503 | + Ungroup(group.selection.get(i)); |
---|
| 2504 | + } |
---|
| 2505 | + |
---|
| 2506 | + ClearSelection(false); |
---|
| 2507 | + |
---|
| 2508 | + refreshContents(); |
---|
2303 | 2509 | } else |
---|
2304 | | - if (event.getSource() == genUVItem) |
---|
| 2510 | + if (source == genUVItem) |
---|
2305 | 2511 | { |
---|
2306 | 2512 | GenUV(); |
---|
2307 | 2513 | } else |
---|
2308 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2514 | + if (source == genNormalsCADItem) |
---|
2309 | 2515 | { |
---|
2310 | 2516 | GenNormals(true); |
---|
2311 | 2517 | } else |
---|
2312 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2518 | + if (source == genNormalsMESHItem) |
---|
| 2519 | + { |
---|
| 2520 | + GenNormals(true); // TODO |
---|
| 2521 | + } else |
---|
| 2522 | + if (source == genNormalsORGANItem) |
---|
2313 | 2523 | { |
---|
2314 | 2524 | GenNormals(false); |
---|
2315 | 2525 | } else |
---|
2316 | | - if (event.getSource() == stripifyItem) |
---|
| 2526 | + if (source == genNormalsMINEItem) |
---|
| 2527 | + { |
---|
| 2528 | + GenNormalsMINE(); |
---|
| 2529 | + } else |
---|
| 2530 | + if (source == stripifyItem) |
---|
2317 | 2531 | { |
---|
2318 | 2532 | Stripify(); |
---|
2319 | 2533 | } else |
---|
2320 | | - if (event.getSource() == unstripifyItem) |
---|
| 2534 | + if (source == unstripifyItem) |
---|
2321 | 2535 | { |
---|
2322 | 2536 | Unstripify(); |
---|
2323 | 2537 | } else |
---|
2324 | | - if (event.getSource() == trimItem) |
---|
| 2538 | + if (source == trimItem) |
---|
2325 | 2539 | { |
---|
2326 | 2540 | Trim(); |
---|
2327 | 2541 | } else |
---|
2328 | | - if (event.getSource() == untrimItem) |
---|
| 2542 | + if (source == untrimItem) |
---|
2329 | 2543 | { |
---|
2330 | 2544 | Untrim(); |
---|
2331 | 2545 | } else |
---|
2332 | | - if (event.getSource() == clearColorsItem) |
---|
| 2546 | + if (source == clearColorsItem) |
---|
2333 | 2547 | { |
---|
2334 | 2548 | ClearColors(); |
---|
2335 | 2549 | } else |
---|
2336 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2550 | + if (source == clearMaterialsItem) |
---|
2337 | 2551 | { |
---|
2338 | 2552 | ClearMaterials(); |
---|
2339 | 2553 | } else |
---|
2340 | | - if (event.getSource() == liveleavesItem) |
---|
| 2554 | + if (source == liveleavesItem) |
---|
2341 | 2555 | { |
---|
2342 | 2556 | LiveLeaves(true); |
---|
2343 | 2557 | } else |
---|
2344 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2558 | + if (source == unliveleavesItem) |
---|
2345 | 2559 | { |
---|
2346 | 2560 | LiveLeaves(false); |
---|
2347 | 2561 | } else |
---|
2348 | | - if (event.getSource() == supportleavesItem) |
---|
| 2562 | + if (source == supportleavesItem) |
---|
2349 | 2563 | { |
---|
2350 | 2564 | SupportLeaves(true); |
---|
2351 | 2565 | } else |
---|
2352 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2566 | + if (source == unsupportleavesItem) |
---|
2353 | 2567 | { |
---|
2354 | 2568 | SupportLeaves(false); |
---|
2355 | 2569 | } else |
---|
2356 | | - if (event.getSource() == hideleavesItem) |
---|
| 2570 | + if (source == hideleavesItem) |
---|
2357 | 2571 | { |
---|
2358 | 2572 | HideLeaves(true); |
---|
2359 | 2573 | } else |
---|
2360 | | - if (event.getSource() == showleavesItem) |
---|
| 2574 | + if (source == showleavesItem) |
---|
2361 | 2575 | { |
---|
2362 | 2576 | HideLeaves(false); |
---|
2363 | 2577 | } else |
---|
2364 | | - if (event.getSource() == markleavesItem) |
---|
| 2578 | + if (source == markleavesItem) |
---|
2365 | 2579 | { |
---|
2366 | 2580 | MarkLeaves(true); |
---|
2367 | 2581 | } else |
---|
2368 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2582 | + if (source == unmarkleavesItem) |
---|
2369 | 2583 | { |
---|
2370 | 2584 | MarkLeaves(false); |
---|
2371 | 2585 | } else |
---|
2372 | | - if (event.getSource() == flipVItem) |
---|
| 2586 | + if (source == flipVItem) |
---|
2373 | 2587 | { |
---|
2374 | 2588 | FlipV(true); |
---|
2375 | 2589 | } else |
---|
2376 | | - if (event.getSource() == unflipVItem) |
---|
| 2590 | + if (source == unflipVItem) |
---|
2377 | 2591 | { |
---|
2378 | 2592 | FlipV(false); |
---|
2379 | 2593 | } else |
---|
2380 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2594 | + if (source == lowTexturesItem) |
---|
2381 | 2595 | { |
---|
2382 | 2596 | SetTexRes(0); |
---|
2383 | 2597 | } else |
---|
2384 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2598 | + if (source == normalTexturesItem) |
---|
2385 | 2599 | { |
---|
2386 | 2600 | SetTexRes(1); |
---|
2387 | 2601 | } else |
---|
2388 | | - if (event.getSource() == highTexturesItem) |
---|
| 2602 | + if (source == highTexturesItem) |
---|
2389 | 2603 | { |
---|
2390 | 2604 | SetTexRes(2); |
---|
2391 | 2605 | } else |
---|
2392 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2606 | + if (source == veryhighTexturesItem) |
---|
2393 | 2607 | { |
---|
2394 | 2608 | SetTexRes(3); |
---|
2395 | 2609 | } else |
---|
2396 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2610 | + if (source == maxTexturesItem) |
---|
2397 | 2611 | { |
---|
2398 | 2612 | SetTexRes(4); |
---|
2399 | 2613 | } else |
---|
2400 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2614 | + if (source == panoTexturesItem) |
---|
2401 | 2615 | { |
---|
2402 | 2616 | SetTexRes(5); |
---|
2403 | 2617 | } else |
---|
2404 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2618 | + if (source == reverseNormalsItem) |
---|
2405 | 2619 | { |
---|
2406 | 2620 | ReverseNormals(); |
---|
2407 | 2621 | } else |
---|
2408 | | - if (event.getSource() == parseverticesItem) |
---|
| 2622 | + if (source == parseverticesItem) |
---|
2409 | 2623 | { |
---|
2410 | 2624 | ParseVertices(); |
---|
2411 | 2625 | } else |
---|
2412 | | - if (event.getSource() == textureFieldItem) |
---|
| 2626 | + if (source == textureFieldItem) |
---|
2413 | 2627 | { |
---|
2414 | 2628 | TextureVertices(); |
---|
2415 | 2629 | } else |
---|
2416 | | - if (event.getSource() == alignItem) |
---|
| 2630 | + if (source == alignItem) |
---|
2417 | 2631 | { |
---|
2418 | 2632 | Align(); |
---|
2419 | 2633 | } else |
---|
2420 | | - if (event.getSource() == mirrorItem) |
---|
| 2634 | + if (source == mirrorItem) |
---|
2421 | 2635 | { |
---|
2422 | 2636 | MirrorPoses(); |
---|
2423 | 2637 | } else |
---|
2424 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2638 | + if (source == reduceMorphItem) |
---|
2425 | 2639 | { |
---|
2426 | 2640 | MeshReduction(false); |
---|
2427 | 2641 | } else |
---|
2428 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2642 | + if (source == reduce34MorphItem) |
---|
2429 | 2643 | { |
---|
2430 | 2644 | MeshReduction(true); |
---|
2431 | 2645 | } else |
---|
2432 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2646 | + if (source == reverseTrianglesItem) |
---|
2433 | 2647 | { |
---|
2434 | 2648 | ReverseTriangles(); |
---|
2435 | 2649 | } else |
---|
2436 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2650 | + if (source == reduceMeshItem) |
---|
2437 | 2651 | { |
---|
2438 | 2652 | ReduceMesh(false); |
---|
2439 | 2653 | } else |
---|
2440 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2654 | + if (source == reduce34MeshItem) |
---|
2441 | 2655 | { |
---|
2442 | 2656 | ReduceMesh(true); |
---|
2443 | 2657 | } else |
---|
2444 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2658 | + if (source == increaseMeshItem) |
---|
2445 | 2659 | { |
---|
2446 | 2660 | IncreaseMesh(); |
---|
2447 | 2661 | } else |
---|
2448 | | - if (event.getSource() == clipMeshItem) |
---|
| 2662 | + if (source == clipMeshItem) |
---|
2449 | 2663 | { |
---|
2450 | 2664 | ClipMesh(); |
---|
2451 | 2665 | } else |
---|
2452 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2666 | + if (source == smoothMeshItem) |
---|
2453 | 2667 | { |
---|
2454 | 2668 | SmoothMesh(); |
---|
2455 | 2669 | } else |
---|
2456 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2670 | + if (source == transformGeometryItem) |
---|
2457 | 2671 | { |
---|
2458 | 2672 | TransformGeometry(); |
---|
2459 | 2673 | } else |
---|
2460 | | - if (event.getSource() == resetTransformItem) |
---|
| 2674 | + if (source == transformChildrenItem) |
---|
| 2675 | + { |
---|
| 2676 | + TransformChildren(); |
---|
| 2677 | + } else |
---|
| 2678 | + if (source == resetTransformItem) |
---|
2461 | 2679 | { |
---|
2462 | 2680 | ResetTransform(); |
---|
2463 | 2681 | } else |
---|
2464 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2682 | + if (source == resetCentroidItem) |
---|
2465 | 2683 | { |
---|
2466 | | - ResetCentroid(); |
---|
| 2684 | + ResetCentroid(true); |
---|
2467 | 2685 | } else |
---|
2468 | | - if (event.getSource() == resetParentItem) |
---|
| 2686 | + if (source == resetCentroidXZItem) |
---|
| 2687 | + { |
---|
| 2688 | + ResetCentroid(false); |
---|
| 2689 | + } else |
---|
| 2690 | + if (source == resetParentItem) |
---|
2469 | 2691 | { |
---|
2470 | 2692 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2471 | 2693 | { |
---|
.. | .. |
---|
2475 | 2697 | |
---|
2476 | 2698 | refreshContents(); |
---|
2477 | 2699 | } else |
---|
2478 | | - if (event.getSource() == repairParentItem) |
---|
| 2700 | + if (source == repairParentItem) |
---|
2479 | 2701 | { |
---|
2480 | 2702 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2481 | 2703 | { |
---|
.. | .. |
---|
2489 | 2711 | |
---|
2490 | 2712 | refreshContents(); |
---|
2491 | 2713 | } else |
---|
2492 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2714 | + if (source == repairShadowItem) |
---|
| 2715 | + { |
---|
| 2716 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2717 | + { |
---|
| 2718 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2719 | + obj.RepairShadow(); |
---|
| 2720 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2721 | +// { |
---|
| 2722 | +// obj.get(i).parent = obj; |
---|
| 2723 | +// } |
---|
| 2724 | + } |
---|
| 2725 | + |
---|
| 2726 | + refreshContents(); |
---|
| 2727 | + } else |
---|
| 2728 | + if (source == sortbysizeItem) |
---|
2493 | 2729 | { |
---|
2494 | 2730 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2495 | 2731 | { |
---|
.. | .. |
---|
2501 | 2737 | ResetModel(); |
---|
2502 | 2738 | refreshContents(); |
---|
2503 | 2739 | } else |
---|
2504 | | - if (event.getSource() == sortbynameItem) |
---|
| 2740 | + if (source == sortbynameItem) |
---|
2505 | 2741 | { |
---|
2506 | 2742 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2507 | 2743 | { |
---|
.. | .. |
---|
2513 | 2749 | ResetModel(); |
---|
2514 | 2750 | refreshContents(); |
---|
2515 | 2751 | } else |
---|
2516 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2752 | + if (source == attachPigmentItem) |
---|
2517 | 2753 | { |
---|
2518 | 2754 | String texture = GetFile("Attach pigment"); |
---|
2519 | 2755 | Object3D obj; |
---|
.. | .. |
---|
2525 | 2761 | |
---|
2526 | 2762 | refreshContents(); |
---|
2527 | 2763 | } else |
---|
2528 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2764 | + if (source == detachPigmentItem) |
---|
2529 | 2765 | { |
---|
2530 | 2766 | Object3D obj; |
---|
2531 | 2767 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2536 | 2772 | |
---|
2537 | 2773 | refreshContents(); |
---|
2538 | 2774 | } else |
---|
2539 | | - if (event.getSource() == attachBumpItem) |
---|
| 2775 | + if (source == attachBumpItem) |
---|
2540 | 2776 | { |
---|
2541 | 2777 | String texture = GetFile("Attach bump"); |
---|
2542 | 2778 | Object3D obj; |
---|
.. | .. |
---|
2548 | 2784 | |
---|
2549 | 2785 | refreshContents(); |
---|
2550 | 2786 | } else |
---|
2551 | | - if (event.getSource() == detachBumpItem) |
---|
| 2787 | + if (source == detachBumpItem) |
---|
2552 | 2788 | { |
---|
2553 | 2789 | Object3D obj; |
---|
2554 | 2790 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2559 | 2795 | |
---|
2560 | 2796 | refreshContents(); |
---|
2561 | 2797 | } else |
---|
2562 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2798 | + if (source == pigmentBumpItem) |
---|
2563 | 2799 | { |
---|
2564 | 2800 | Object3D obj; |
---|
2565 | 2801 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2570 | 2806 | |
---|
2571 | 2807 | refreshContents(); |
---|
2572 | 2808 | } else |
---|
2573 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2809 | + if (source == flashSelectionButton) |
---|
2574 | 2810 | { |
---|
2575 | 2811 | CameraPane.flash = true; |
---|
2576 | 2812 | refreshContents(); |
---|
2577 | 2813 | } else |
---|
2578 | | - if (event.getSource() == oneButton) |
---|
| 2814 | + if (source == oneButton) |
---|
2579 | 2815 | { |
---|
2580 | 2816 | } else |
---|
2581 | | - if (event.getSource() == twoButton) |
---|
| 2817 | + if (source == twoButton) |
---|
2582 | 2818 | { |
---|
2583 | 2819 | radio.layout = twoButton; |
---|
2584 | 2820 | // bug |
---|
2585 | 2821 | //gridPanel.setDividerLocation(1.0); |
---|
2586 | 2822 | //bigPanel.setDividerLocation(0.0); |
---|
2587 | | - bigThree.remove(jtp); |
---|
2588 | | - bigThree.remove(cameraPanel); |
---|
2589 | | - bigThree.remove(XYZPanel); |
---|
2590 | | - aWindowConstraints.gridx = 0; |
---|
2591 | | - aWindowConstraints.gridy = 0; |
---|
2592 | | - aWindowConstraints.gridwidth = 1; |
---|
2593 | | - // aConstraints.gridheight = 3; |
---|
2594 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2595 | | - aWindowConstraints.weightx = 0; |
---|
2596 | | - aWindowConstraints.weighty = 1; |
---|
2597 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2598 | | - aWindowConstraints.weightx = 1; |
---|
2599 | | - aWindowConstraints.gridwidth = 3; |
---|
2600 | | - // aConstraints.gridheight = 3; |
---|
2601 | | - aWindowConstraints.gridx = 1; |
---|
2602 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2603 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2604 | | - aWindowConstraints.weightx = 0; |
---|
2605 | | - aWindowConstraints.gridx = 4; |
---|
2606 | | - aWindowConstraints.gridwidth = 1; |
---|
2607 | | - // aConstraints.gridheight = 3; |
---|
2608 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2609 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2610 | | - bigThree.revalidate(); |
---|
| 2823 | +// bigThree.remove(scenePanel); |
---|
| 2824 | +// bigThree.remove(centralPanel); |
---|
| 2825 | +// bigThree.remove(XYZPanel); |
---|
| 2826 | +// aWindowConstraints.gridx = 0; |
---|
| 2827 | +// aWindowConstraints.gridy = 0; |
---|
| 2828 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2829 | +// // aConstraints.gridheight = 3; |
---|
| 2830 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2831 | +// aWindowConstraints.weightx = 0; |
---|
| 2832 | +// aWindowConstraints.weighty = 1; |
---|
| 2833 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2834 | +// aWindowConstraints.weightx = 1; |
---|
| 2835 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2836 | +// // aConstraints.gridheight = 3; |
---|
| 2837 | +// aWindowConstraints.gridx = 1; |
---|
| 2838 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2839 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2840 | +// aWindowConstraints.weightx = 0; |
---|
| 2841 | +// aWindowConstraints.gridx = 4; |
---|
| 2842 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2843 | +// // aConstraints.gridheight = 3; |
---|
| 2844 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2845 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2846 | +// scenePanel.setVisible(false); |
---|
| 2847 | +// centralPanel.setVisible(true); |
---|
| 2848 | +// XYZPanel.setVisible(false); |
---|
| 2849 | + bigThree.ClearUI(); |
---|
| 2850 | + bigThree.add(centralPanel); |
---|
| 2851 | + bigThree.FlushUI(); |
---|
2611 | 2852 | } else |
---|
2612 | | - if (event.getSource() == threeButton) |
---|
| 2853 | + if (source == threeButton) |
---|
2613 | 2854 | { |
---|
2614 | 2855 | radio.layout = threeButton; |
---|
2615 | | - bigThree.remove(jtp); |
---|
2616 | | - bigThree.remove(cameraPanel); |
---|
2617 | | - bigThree.remove(XYZPanel); |
---|
2618 | | - aWindowConstraints.gridx = 0; |
---|
2619 | | - aWindowConstraints.gridy = 0; |
---|
2620 | | - aWindowConstraints.gridwidth = 1; |
---|
2621 | | - // aConstraints.gridheight = 3; |
---|
2622 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2623 | | - aWindowConstraints.weightx = 0; |
---|
2624 | | - aWindowConstraints.weighty = 1; |
---|
2625 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2626 | | - aWindowConstraints.weightx = 1; |
---|
2627 | | - aWindowConstraints.gridwidth = 3; |
---|
2628 | | - // aConstraints.gridheight = 3; |
---|
2629 | | - aWindowConstraints.gridx = 1; |
---|
2630 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2631 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2632 | | - aWindowConstraints.weightx = 0; |
---|
2633 | | - aWindowConstraints.gridx = 4; |
---|
2634 | | - aWindowConstraints.gridwidth = 1; |
---|
2635 | | - // aConstraints.gridheight = 3; |
---|
2636 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2637 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2638 | | - bigThree.revalidate(); |
---|
| 2856 | + |
---|
| 2857 | +// bigThree.remove(scenePanel); |
---|
| 2858 | +// bigThree.remove(centralPanel); |
---|
| 2859 | +// bigThree.remove(XYZPanel); |
---|
| 2860 | +// aWindowConstraints.gridx = 0; |
---|
| 2861 | +// aWindowConstraints.gridy = 0; |
---|
| 2862 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2863 | +// // aConstraints.gridheight = 3; |
---|
| 2864 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2865 | +// aWindowConstraints.weightx = 0; |
---|
| 2866 | +// aWindowConstraints.weighty = 1; |
---|
| 2867 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2868 | +// aWindowConstraints.weightx = 1; |
---|
| 2869 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2870 | +// // aConstraints.gridheight = 3; |
---|
| 2871 | +// aWindowConstraints.gridx = 1; |
---|
| 2872 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2873 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2874 | +// aWindowConstraints.weightx = 0; |
---|
| 2875 | +// aWindowConstraints.gridx = 4; |
---|
| 2876 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2877 | +// // aConstraints.gridheight = 3; |
---|
| 2878 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2879 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2880 | +// bigThree.validate(); |
---|
| 2881 | +// scenePanel.setVisible(false); |
---|
| 2882 | +// centralPanel.setVisible(true); |
---|
| 2883 | +// XYZPanel.setVisible(true); |
---|
| 2884 | + bigThree.ClearUI(); |
---|
| 2885 | + bigThree.add(centralPanel); |
---|
| 2886 | + bigThree.add(XYZPanel); |
---|
| 2887 | + bigThree.FlushUI(); |
---|
2639 | 2888 | } else |
---|
2640 | | - if (event.getSource() == fourButton) |
---|
| 2889 | + if (source == fourButton) |
---|
2641 | 2890 | { |
---|
2642 | 2891 | radio.layout = fourButton; |
---|
2643 | | - bigThree.remove(jtp); |
---|
2644 | | - bigThree.remove(cameraPanel); |
---|
2645 | | - bigThree.remove(XYZPanel); |
---|
2646 | | - aWindowConstraints.gridx = 0; |
---|
2647 | | - aWindowConstraints.gridy = 0; |
---|
2648 | | - aWindowConstraints.gridwidth = 1; |
---|
2649 | | - // aWindowConstraints.gridheight = 3; |
---|
2650 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2651 | | - aWindowConstraints.weightx = 1; |
---|
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(cameraPanel, aWindowConstraints); |
---|
2660 | | - aWindowConstraints.weightx = 0; |
---|
2661 | | - aWindowConstraints.gridx = 4; |
---|
2662 | | - aWindowConstraints.gridwidth = 1; |
---|
2663 | | - // aWindowConstraints.gridheight = 3; |
---|
2664 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2665 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2666 | | - bigThree.revalidate(); |
---|
| 2892 | + |
---|
| 2893 | +// bigThree.remove(scenePanel); |
---|
| 2894 | +// bigThree.remove(centralPanel); |
---|
| 2895 | +// bigThree.remove(XYZPanel); |
---|
| 2896 | +// aWindowConstraints.gridx = 0; |
---|
| 2897 | +// aWindowConstraints.gridy = 0; |
---|
| 2898 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2899 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2900 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2901 | +// aWindowConstraints.weightx = 1; |
---|
| 2902 | +// aWindowConstraints.weighty = 1; |
---|
| 2903 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2904 | +// aWindowConstraints.weightx = 1; |
---|
| 2905 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2906 | +// // aConstraints.gridheight = 3; |
---|
| 2907 | +// aWindowConstraints.gridx = 1; |
---|
| 2908 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2909 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2910 | +// aWindowConstraints.weightx = 0; |
---|
| 2911 | +// aWindowConstraints.gridx = 4; |
---|
| 2912 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2913 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2914 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2915 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2916 | +// bigThree.validate(); |
---|
| 2917 | +// scenePanel.setVisible(true); |
---|
| 2918 | +// centralPanel.setVisible(false); |
---|
| 2919 | +// XYZPanel.setVisible(false); |
---|
| 2920 | + bigThree.ClearUI(); |
---|
| 2921 | + bigThree.add(scenePanel); |
---|
| 2922 | + bigThree.FlushUI(); |
---|
2667 | 2923 | } else |
---|
2668 | | - if (event.getSource() == sixButton) |
---|
| 2924 | + if (source == sixButton) |
---|
2669 | 2925 | { |
---|
2670 | 2926 | radio.layout = sixButton; |
---|
2671 | | - bigThree.remove(jtp); |
---|
2672 | | - bigThree.remove(cameraPanel); |
---|
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 | | - // aWindowConstraints.gridheight = 3; |
---|
2685 | | - aWindowConstraints.gridx = 1; |
---|
2686 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2687 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2688 | | - aWindowConstraints.weightx = 0; |
---|
2689 | | - aWindowConstraints.gridx = 4; |
---|
2690 | | - aWindowConstraints.gridwidth = 1; |
---|
2691 | | - // aWindowConstraints.gridheight = 3; |
---|
2692 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2693 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2694 | | - bigThree.revalidate(); |
---|
| 2927 | + |
---|
| 2928 | +// bigThree.remove(scenePanel); |
---|
| 2929 | +// bigThree.remove(centralPanel); |
---|
| 2930 | +// bigThree.remove(XYZPanel); |
---|
| 2931 | +// aWindowConstraints.gridx = 0; |
---|
| 2932 | +// aWindowConstraints.gridy = 0; |
---|
| 2933 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2934 | +// // aConstraints.gridheight = 3; |
---|
| 2935 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2936 | +// aWindowConstraints.weightx = 0; |
---|
| 2937 | +// aWindowConstraints.weighty = 1; |
---|
| 2938 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2939 | +// aWindowConstraints.weightx = 1; |
---|
| 2940 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2941 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2942 | +// aWindowConstraints.gridx = 1; |
---|
| 2943 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2944 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2945 | +// aWindowConstraints.weightx = 0; |
---|
| 2946 | +// aWindowConstraints.gridx = 4; |
---|
| 2947 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2948 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2949 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2950 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2951 | +// bigThree.validate(); |
---|
| 2952 | +// scenePanel.setVisible(true); |
---|
| 2953 | +// centralPanel.setVisible(true); |
---|
| 2954 | +// XYZPanel.setVisible(false); |
---|
| 2955 | + bigThree.ClearUI(); |
---|
| 2956 | + bigThree.add(scenePanel); |
---|
| 2957 | + bigThree.add(centralPanel); |
---|
| 2958 | + bigThree.FlushUI(); |
---|
2695 | 2959 | } else |
---|
2696 | | - if (event.getSource() == sevenButton) |
---|
| 2960 | + if (source == sevenButton) |
---|
2697 | 2961 | { |
---|
2698 | 2962 | radio.layout = sevenButton; |
---|
2699 | | - bigThree.remove(jtp); |
---|
2700 | | - bigThree.remove(cameraPanel); |
---|
2701 | | - bigThree.remove(XYZPanel); |
---|
2702 | | - aWindowConstraints.gridx = 0; |
---|
2703 | | - aWindowConstraints.gridy = 0; |
---|
2704 | | - aWindowConstraints.gridwidth = 1; |
---|
2705 | | - // aWindowConstraints.gridheight = 3; |
---|
2706 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2707 | | - aWindowConstraints.weightx = 0; |
---|
2708 | | - aWindowConstraints.weighty = 1; |
---|
2709 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2710 | | - aWindowConstraints.weightx = 1; |
---|
2711 | | - aWindowConstraints.gridwidth = 3; |
---|
2712 | | - // aWindowConstraints.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 | | - // aConstraints.gridheight = 3; |
---|
2720 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2721 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2722 | | - bigThree.revalidate(); |
---|
| 2963 | + |
---|
| 2964 | +// bigThree.remove(scenePanel); |
---|
| 2965 | +// bigThree.remove(centralPanel); |
---|
| 2966 | +// bigThree.remove(XYZPanel); |
---|
| 2967 | +// aWindowConstraints.gridx = 0; |
---|
| 2968 | +// aWindowConstraints.gridy = 0; |
---|
| 2969 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2970 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2971 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2972 | +// aWindowConstraints.weightx = 0; |
---|
| 2973 | +// aWindowConstraints.weighty = 1; |
---|
| 2974 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2975 | +// aWindowConstraints.weightx = 1; |
---|
| 2976 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2977 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2978 | +// aWindowConstraints.gridx = 1; |
---|
| 2979 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2980 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2981 | +// aWindowConstraints.weightx = 0; |
---|
| 2982 | +// aWindowConstraints.gridx = 4; |
---|
| 2983 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2984 | +// // aConstraints.gridheight = 3; |
---|
| 2985 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2986 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2987 | +// bigThree.validate(); |
---|
| 2988 | +// scenePanel.setVisible(true); |
---|
| 2989 | +// centralPanel.setVisible(true); |
---|
| 2990 | +// XYZPanel.setVisible(true); |
---|
| 2991 | + bigThree.ClearUI(); |
---|
| 2992 | + bigThree.add(scenePanel); |
---|
| 2993 | + bigThree.add(centralPanel); |
---|
| 2994 | + bigThree.add(XYZPanel); |
---|
| 2995 | + bigThree.FlushUI(); |
---|
2723 | 2996 | } else |
---|
2724 | | - if (event.getSource() == rootButton) |
---|
| 2997 | + if (source == rootButton) |
---|
2725 | 2998 | { |
---|
2726 | 2999 | Object3D obj; |
---|
2727 | 3000 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2733 | 3006 | |
---|
2734 | 3007 | refreshContents(true); |
---|
2735 | 3008 | } else |
---|
2736 | | - if (event.getSource() == closeButton) |
---|
| 3009 | + if (source == closeButton) |
---|
2737 | 3010 | { |
---|
2738 | 3011 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2739 | 3012 | cRadio ab; |
---|
.. | .. |
---|
2754 | 3027 | } |
---|
2755 | 3028 | refreshContents(true); |
---|
2756 | 3029 | } else |
---|
2757 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3030 | + if (source == editItem || source == editButton) |
---|
2758 | 3031 | { |
---|
2759 | 3032 | EditSelection(false); |
---|
2760 | 3033 | } else |
---|
2761 | | - if (event.getSource() == uneditButton) |
---|
| 3034 | + if (source == uneditButton) |
---|
2762 | 3035 | { |
---|
2763 | 3036 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2764 | 3037 | { |
---|
.. | .. |
---|
2768 | 3041 | child.CloseUI(); |
---|
2769 | 3042 | listUI.remove(child); |
---|
2770 | 3043 | |
---|
2771 | | - child.editWindow = null; // ??????????? |
---|
| 3044 | + //child.editWindow = null; // ??????????? |
---|
2772 | 3045 | } |
---|
2773 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3046 | + objEditor.ctrlPanel.FlushUI(); |
---|
2774 | 3047 | //objEditor.jTree.clearSelection(); |
---|
2775 | 3048 | //objEditor.ResetSliders(); |
---|
2776 | 3049 | refreshContents(true); |
---|
2777 | 3050 | } else |
---|
2778 | | - if (event.getSource() == clearPanelButton) |
---|
| 3051 | + if (source == clearPanelButton) |
---|
2779 | 3052 | { |
---|
2780 | 3053 | assert(copy == group); |
---|
2781 | 3054 | //copy.ClearUI(); |
---|
.. | .. |
---|
2786 | 3059 | listUI.clear(); |
---|
2787 | 3060 | refreshContents(true); |
---|
2788 | 3061 | } else |
---|
2789 | | - if (event.getSource() == allParamsButton) |
---|
| 3062 | + if (source == allParamsButton) |
---|
2790 | 3063 | { |
---|
2791 | 3064 | assert(copy == group); |
---|
2792 | 3065 | |
---|
.. | .. |
---|
2807 | 3080 | |
---|
2808 | 3081 | refreshContents(true); |
---|
2809 | 3082 | } else |
---|
2810 | | - if (event.getSource() == unselectButton) |
---|
| 3083 | + if (source == unselectButton) |
---|
2811 | 3084 | { |
---|
2812 | 3085 | objEditor.jTree.clearSelection(); |
---|
2813 | 3086 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2814 | 3087 | objEditor.ResetSliders(); |
---|
2815 | 3088 | refreshContents(true); |
---|
2816 | 3089 | } else |
---|
2817 | | - if(event.getSource() instanceof cRadio) |
---|
| 3090 | + if(source instanceof cRadio) |
---|
2818 | 3091 | { |
---|
2819 | 3092 | group.parent = keepparent; |
---|
2820 | 3093 | group.attributes = 0; |
---|
2821 | 3094 | //group.editWindow = null; |
---|
2822 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3095 | + /*cRadio*/ radio = (cRadio)source; |
---|
2823 | 3096 | Object3D obj = radio.GetObject(); |
---|
2824 | 3097 | System.out.println("Edit " + obj); |
---|
2825 | 3098 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2839 | 3112 | } |
---|
2840 | 3113 | |
---|
2841 | 3114 | copy = group; |
---|
2842 | | - //CameraPane.theRenderer.object = group; |
---|
| 3115 | + //Globals.theRenderer.object = group; |
---|
2843 | 3116 | if(!useclient) |
---|
2844 | 3117 | { |
---|
2845 | 3118 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2848 | 3121 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2849 | 3122 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2850 | 3123 | cameraView.object = group; |
---|
2851 | | - cameraView.lighttouched = true; |
---|
| 3124 | + //cameraView.lighttouched = true; |
---|
| 3125 | + Globals.lighttouched = true; |
---|
2852 | 3126 | topView.object = group; |
---|
2853 | 3127 | frontView.object = group; |
---|
2854 | 3128 | sideView.object = group; |
---|
2855 | 3129 | } |
---|
2856 | | - group.editWindow = this; |
---|
| 3130 | + |
---|
| 3131 | +// fix "+" issue group.editWindow = this; |
---|
| 3132 | + |
---|
2857 | 3133 | /* |
---|
2858 | 3134 | currentLayout = radio.layout; |
---|
2859 | 3135 | if (currentLayout == null) |
---|
.. | .. |
---|
2866 | 3142 | //group.attributes = -1; |
---|
2867 | 3143 | ResetModel(); |
---|
2868 | 3144 | refreshContents(true); |
---|
2869 | | - } |
---|
| 3145 | + } else if (event.getSource() == editCameraItem) |
---|
| 3146 | + { |
---|
| 3147 | + cameraView.ProtectCamera(); |
---|
| 3148 | + cameraView.repaint(); |
---|
| 3149 | + return; |
---|
| 3150 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3151 | + { |
---|
| 3152 | + cameraView.RevertCamera(); |
---|
| 3153 | + cameraView.repaint(); |
---|
| 3154 | + return; |
---|
| 3155 | + // } else if (event.getSource() == textureButton) |
---|
| 3156 | + // { |
---|
| 3157 | + // return; // true; |
---|
| 3158 | + } |
---|
2870 | 3159 | else |
---|
2871 | 3160 | { |
---|
2872 | 3161 | //return super.action(event, arg); |
---|
.. | .. |
---|
2884 | 3173 | if (useclient) |
---|
2885 | 3174 | { |
---|
2886 | 3175 | cameraView.object = client; |
---|
2887 | | - cameraView.lighttouched = true; |
---|
| 3176 | + Globals.lighttouched = true; |
---|
2888 | 3177 | //topView.object = client; |
---|
2889 | 3178 | //frontView.object = client; |
---|
2890 | 3179 | //sideView.object = client; |
---|
.. | .. |
---|
2892 | 3181 | else |
---|
2893 | 3182 | { |
---|
2894 | 3183 | cameraView.object = group; |
---|
2895 | | - cameraView.lighttouched = true; |
---|
| 3184 | + Globals.lighttouched = true; |
---|
2896 | 3185 | //topView.object = group; |
---|
2897 | 3186 | //frontView.object = group; |
---|
2898 | 3187 | //sideView.object = group; |
---|
.. | .. |
---|
2927 | 3216 | refreshContents(); |
---|
2928 | 3217 | } |
---|
2929 | 3218 | |
---|
| 3219 | + void TransformChildren() |
---|
| 3220 | + { |
---|
| 3221 | + Object3D obj; |
---|
| 3222 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3223 | + { |
---|
| 3224 | + obj = (Object3D)e.nextElement(); |
---|
| 3225 | + obj.KeepTextureMatrices(); |
---|
| 3226 | + obj.TransformChildren(); |
---|
| 3227 | + obj.RestoreTextureMatrices(); |
---|
| 3228 | + |
---|
| 3229 | +// if (obj.parent == null) |
---|
| 3230 | +// { |
---|
| 3231 | +// System.out.println("NULL PARENT!"); |
---|
| 3232 | +// new Exception().printStackTrace(); |
---|
| 3233 | +// } |
---|
| 3234 | +// else |
---|
| 3235 | +// TouchTransform(obj); |
---|
| 3236 | +// //obj.parent.Touch(); |
---|
| 3237 | + } |
---|
| 3238 | + |
---|
| 3239 | + refreshContents(); |
---|
| 3240 | + } |
---|
2930 | 3241 | |
---|
2931 | 3242 | void ResetTransform() |
---|
2932 | 3243 | { |
---|
.. | .. |
---|
3039 | 3350 | refreshContents(); |
---|
3040 | 3351 | } |
---|
3041 | 3352 | |
---|
3042 | | - void ResetCentroid() |
---|
| 3353 | + void ResetCentroid(boolean full) |
---|
3043 | 3354 | { |
---|
3044 | 3355 | Object3D obj; |
---|
3045 | 3356 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3054 | 3365 | LA.matIdentity(Object3D.mat); |
---|
3055 | 3366 | obj.getBounds(minima, maxima, false); |
---|
3056 | 3367 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3057 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3368 | + if (full) |
---|
| 3369 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3058 | 3370 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3059 | 3371 | obj.TransformMesh(Object3D.mat); |
---|
| 3372 | + |
---|
3060 | 3373 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3061 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3374 | + if (full) |
---|
| 3375 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3062 | 3376 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3377 | + |
---|
3063 | 3378 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3064 | 3379 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3065 | 3380 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3125 | 3440 | obj = (Object3D)e.nextElement(); |
---|
3126 | 3441 | |
---|
3127 | 3442 | System.out.println("Object is: " + obj); |
---|
3128 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3443 | + Grafreed.AnalyzeObject(obj); |
---|
3129 | 3444 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3130 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3445 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3131 | 3446 | |
---|
3132 | 3447 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3133 | 3448 | } |
---|
.. | .. |
---|
3169 | 3484 | void GenNormals(boolean crease) |
---|
3170 | 3485 | { |
---|
3171 | 3486 | group.GenNormalsS(crease); |
---|
| 3487 | + |
---|
| 3488 | + refreshContents(); |
---|
| 3489 | + } |
---|
| 3490 | + |
---|
| 3491 | + void GenNormalsMINE() |
---|
| 3492 | + { |
---|
| 3493 | + group.selection.GenNormalsMINE(); |
---|
3172 | 3494 | |
---|
3173 | 3495 | refreshContents(); |
---|
3174 | 3496 | } |
---|
.. | .. |
---|
3334 | 3656 | |
---|
3335 | 3657 | void ParseVertices() |
---|
3336 | 3658 | { |
---|
3337 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3338 | | - GrafreeD.epsequal = true; |
---|
| 3659 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3660 | + Grafreed.epsequal = true; |
---|
3339 | 3661 | |
---|
3340 | 3662 | for (int i=0; i<group.selection.size(); i++) |
---|
3341 | 3663 | { |
---|
.. | .. |
---|
3360 | 3682 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3361 | 3683 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3362 | 3684 | |
---|
3363 | | - g.add(GrafreeD.clipboard); |
---|
| 3685 | + g.add(Grafreed.clipboard); |
---|
3364 | 3686 | |
---|
3365 | 3687 | buffer.add(g); |
---|
3366 | 3688 | } |
---|
.. | .. |
---|
3375 | 3697 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3376 | 3698 | } |
---|
3377 | 3699 | |
---|
3378 | | - GrafreeD.epsequal = epsequal; |
---|
| 3700 | + Grafreed.epsequal = epsequal; |
---|
3379 | 3701 | |
---|
3380 | 3702 | refreshContents(); |
---|
3381 | 3703 | } |
---|
.. | .. |
---|
3393 | 3715 | String pigment = Object3D.GetPigment(tex); |
---|
3394 | 3716 | //String bump = Object3D.GetBump(tex); |
---|
3395 | 3717 | |
---|
3396 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3718 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3719 | + |
---|
| 3720 | + try |
---|
| 3721 | + { |
---|
| 3722 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3723 | + } |
---|
| 3724 | + catch (Exception e) |
---|
| 3725 | + { |
---|
| 3726 | + System.err.println("FAIL: " + node); |
---|
| 3727 | + } |
---|
3397 | 3728 | |
---|
3398 | 3729 | double s = v.s; |
---|
3399 | 3730 | |
---|
.. | .. |
---|
3441 | 3772 | |
---|
3442 | 3773 | void Align() |
---|
3443 | 3774 | { |
---|
| 3775 | + if (group.selection.size() == 0) |
---|
| 3776 | + return; |
---|
| 3777 | + |
---|
| 3778 | + cVector bbmin = new cVector(); |
---|
| 3779 | + cVector bbmax = new cVector(); |
---|
| 3780 | + |
---|
| 3781 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3782 | + |
---|
| 3783 | + double dx = bbmax.x - bbmin.x; |
---|
| 3784 | + double dy = bbmax.y - bbmin.y; |
---|
| 3785 | + double dz = bbmax.z - bbmin.z; |
---|
| 3786 | + |
---|
| 3787 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3788 | + |
---|
3444 | 3789 | for (int i=0; i<group.selection.size(); i++) |
---|
3445 | 3790 | { |
---|
3446 | 3791 | Object3D obj = group.selection.get(i); |
---|
3447 | 3792 | |
---|
3448 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3449 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3793 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3794 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3450 | 3795 | } |
---|
3451 | 3796 | |
---|
3452 | 3797 | refreshContents(); |
---|
.. | .. |
---|
3467 | 3812 | |
---|
3468 | 3813 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3469 | 3814 | |
---|
3470 | | - boolean random = CameraPane.RANDOM; |
---|
3471 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3815 | + boolean random = CameraPane.SWITCH; |
---|
| 3816 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3472 | 3817 | lowres.linkVerticesThis(null); |
---|
3473 | 3818 | lowres.linkVerticesThis(sn); |
---|
3474 | | - CameraPane.RANDOM = random; |
---|
| 3819 | + CameraPane.SWITCH = random; |
---|
3475 | 3820 | |
---|
3476 | 3821 | System.err.flush(); |
---|
3477 | 3822 | |
---|
.. | .. |
---|
3511 | 3856 | return; |
---|
3512 | 3857 | |
---|
3513 | 3858 | Object3D poses = group.selection.get(0); |
---|
3514 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3859 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3515 | 3860 | |
---|
3516 | 3861 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3517 | 3862 | |
---|
.. | .. |
---|
3680 | 4025 | group.selection.RelinkToSupport(); // july 2014 |
---|
3681 | 4026 | System.out.println("DONE."); |
---|
3682 | 4027 | refreshContents(); |
---|
3683 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4028 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3684 | 4029 | } |
---|
3685 | 4030 | |
---|
3686 | 4031 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3705 | 4050 | |
---|
3706 | 4051 | void ClipMesh() |
---|
3707 | 4052 | { |
---|
3708 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4053 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3709 | 4054 | { |
---|
3710 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4055 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3711 | 4056 | |
---|
3712 | 4057 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3713 | 4058 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3716 | 4061 | // { |
---|
3717 | 4062 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3718 | 4063 | // } |
---|
3719 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4064 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3720 | 4065 | } |
---|
3721 | 4066 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3722 | 4067 | System.out.println("DONE."); |
---|
.. | .. |
---|
3851 | 4196 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3852 | 4197 | |
---|
3853 | 4198 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3854 | | - if(elem != group) |
---|
| 4199 | + if(elem != group || !newWindow) |
---|
3855 | 4200 | { |
---|
3856 | 4201 | // if (!(elem instanceof Composite)) |
---|
3857 | 4202 | // newWindow = false; |
---|
.. | .. |
---|
3956 | 4301 | System.err.println("info : " + child.GetPath()); |
---|
3957 | 4302 | } |
---|
3958 | 4303 | } |
---|
3959 | | - else |
---|
3960 | | - { |
---|
3961 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3962 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3963 | | - System.err.println("info : " + group.GetPath()); |
---|
3964 | | - } |
---|
| 4304 | +// else |
---|
| 4305 | +// { |
---|
| 4306 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4307 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4308 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4309 | +// } |
---|
3965 | 4310 | |
---|
3966 | 4311 | objEditor.SetText(); // jan 2014 |
---|
3967 | 4312 | |
---|
3968 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4313 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
3969 | 4314 | CameraPane.flash = true; |
---|
3970 | 4315 | |
---|
3971 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4316 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
3972 | 4317 | // a camera |
---|
3973 | 4318 | { |
---|
3974 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
3975 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
3976 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
3977 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4319 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4320 | + { |
---|
| 4321 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4322 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4323 | + } |
---|
| 4324 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4325 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3978 | 4326 | } |
---|
3979 | 4327 | |
---|
3980 | 4328 | refreshContents(); |
---|
.. | .. |
---|
4056 | 4404 | { |
---|
4057 | 4405 | if (group.selection.isEmpty()) |
---|
4058 | 4406 | return; |
---|
4059 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4407 | + Grafreed.clipboardIsTempGroup = false; |
---|
4060 | 4408 | Composite tGroup = null; |
---|
4061 | 4409 | if (group.selection.size() > 0) // 1) |
---|
4062 | 4410 | { |
---|
4063 | 4411 | tGroup = new cGroup(); |
---|
4064 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4412 | + Grafreed.clipboardIsTempGroup = true; |
---|
4065 | 4413 | } |
---|
4066 | 4414 | |
---|
4067 | 4415 | if (cut) |
---|
.. | .. |
---|
4101 | 4449 | //System.out.println("cut " + child); |
---|
4102 | 4450 | //System.out.println("parent = " + child.parent); |
---|
4103 | 4451 | // tmp.addChild(child); |
---|
4104 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4452 | + if (Grafreed.clipboardIsTempGroup) |
---|
4105 | 4453 | tGroup.add/*Child*/(tmp); |
---|
4106 | 4454 | else |
---|
4107 | | - GrafreeD.clipboard = tmp; |
---|
| 4455 | + Grafreed.clipboard = tmp; |
---|
4108 | 4456 | } |
---|
4109 | 4457 | else |
---|
4110 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4458 | + if (Grafreed.clipboardIsTempGroup) |
---|
4111 | 4459 | tGroup.add/*Child*/(child); |
---|
4112 | 4460 | else |
---|
4113 | | - GrafreeD.clipboard = child; |
---|
| 4461 | + Grafreed.clipboard = child; |
---|
4114 | 4462 | } |
---|
4115 | 4463 | |
---|
4116 | 4464 | //ResetModel(); |
---|
.. | .. |
---|
4142 | 4490 | //System.out.println("cut " + elem); |
---|
4143 | 4491 | //System.out.println("parent = " + elem.parent); |
---|
4144 | 4492 | // tmp.addChild(elem); |
---|
4145 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4493 | + if (Grafreed.clipboardIsTempGroup) |
---|
4146 | 4494 | tGroup.add/*Child*/(tmp); |
---|
4147 | 4495 | else |
---|
4148 | | - GrafreeD.clipboard = tmp; |
---|
| 4496 | + Grafreed.clipboard = tmp; |
---|
4149 | 4497 | } |
---|
4150 | 4498 | else |
---|
4151 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4499 | + if (Grafreed.clipboardIsTempGroup) |
---|
4152 | 4500 | tGroup.add/*Child*/(child); |
---|
4153 | 4501 | else |
---|
4154 | | - GrafreeD.clipboard = child; |
---|
| 4502 | + Grafreed.clipboard = child; |
---|
4155 | 4503 | } |
---|
4156 | 4504 | |
---|
4157 | 4505 | } |
---|
4158 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4159 | | - GrafreeD.clipboard = tGroup; |
---|
| 4506 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4507 | + Grafreed.clipboard = tGroup; |
---|
4160 | 4508 | if (cut) |
---|
4161 | 4509 | { |
---|
4162 | 4510 | ResetModel(); |
---|
.. | .. |
---|
4170 | 4518 | // return; |
---|
4171 | 4519 | boolean first = true; |
---|
4172 | 4520 | |
---|
4173 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4521 | + if (Grafreed.clipboardIsTempGroup) |
---|
4174 | 4522 | { |
---|
4175 | 4523 | Composite temp; |
---|
4176 | 4524 | |
---|
.. | .. |
---|
4181 | 4529 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4182 | 4530 | */ |
---|
4183 | 4531 | Object3D elem; |
---|
4184 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4532 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4185 | 4533 | { |
---|
4186 | 4534 | Object3D child = (Object3D)e.nextElement(); |
---|
4187 | 4535 | |
---|
.. | .. |
---|
4215 | 4563 | //Object3D cb = Applet3D.clipboard; |
---|
4216 | 4564 | //temp.addChild(cb); |
---|
4217 | 4565 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4218 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4219 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4220 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4221 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4222 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4566 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4567 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4568 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4569 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4570 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4223 | 4571 | else |
---|
4224 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4225 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4572 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4573 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4226 | 4574 | } |
---|
4227 | 4575 | |
---|
4228 | 4576 | ResetModel(); |
---|
4229 | 4577 | refreshContents(); |
---|
4230 | 4578 | } |
---|
4231 | 4579 | |
---|
4232 | | - void pasteInto(boolean copyit) |
---|
| 4580 | + void pasteInto(boolean copyit, boolean clone) |
---|
4233 | 4581 | { |
---|
4234 | 4582 | // if (GrafreeD.clipboard == null) |
---|
4235 | 4583 | // return; |
---|
.. | .. |
---|
4258 | 4606 | if (copyit) |
---|
4259 | 4607 | { |
---|
4260 | 4608 | // paste(false); |
---|
4261 | | - CloneClipboard(false); // sept 2014 |
---|
| 4609 | + if (clone) |
---|
| 4610 | + { |
---|
| 4611 | + CloneClipboard(false); // sept 2014 |
---|
| 4612 | + } |
---|
| 4613 | + else |
---|
| 4614 | + { |
---|
| 4615 | + paste(false); |
---|
| 4616 | + } |
---|
4262 | 4617 | } |
---|
4263 | 4618 | else |
---|
4264 | 4619 | { |
---|
4265 | 4620 | boolean first = true; |
---|
4266 | 4621 | |
---|
4267 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4622 | + if (Grafreed.clipboardIsTempGroup) |
---|
4268 | 4623 | { |
---|
4269 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4624 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4270 | 4625 | Object3D copy; |
---|
4271 | 4626 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4272 | 4627 | { |
---|
.. | .. |
---|
4276 | 4631 | } |
---|
4277 | 4632 | } else |
---|
4278 | 4633 | { |
---|
4279 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4634 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4280 | 4635 | } |
---|
4281 | 4636 | } |
---|
4282 | 4637 | } |
---|
.. | .. |
---|
4468 | 4823 | makeSomething(csg); |
---|
4469 | 4824 | } |
---|
4470 | 4825 | |
---|
| 4826 | + void Ungroup(Object3D g) |
---|
| 4827 | + { |
---|
| 4828 | + if (g instanceof HiddenObject) |
---|
| 4829 | + { |
---|
| 4830 | + HiddenObject h = (HiddenObject) g; |
---|
| 4831 | + |
---|
| 4832 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 4833 | + { |
---|
| 4834 | + objEditor.makeSomething(h.get(i), false); |
---|
| 4835 | + } |
---|
| 4836 | + } |
---|
| 4837 | + else |
---|
| 4838 | + { |
---|
| 4839 | + for (int i=0; i<g.Size(); i++) |
---|
| 4840 | + { |
---|
| 4841 | + objEditor.makeSomething(g.get(i), false); |
---|
| 4842 | + } |
---|
| 4843 | + } |
---|
| 4844 | + } |
---|
| 4845 | + |
---|
4471 | 4846 | void ungroup() |
---|
4472 | 4847 | { |
---|
4473 | 4848 | /* |
---|
.. | .. |
---|
4661 | 5036 | } |
---|
4662 | 5037 | */ |
---|
4663 | 5038 | |
---|
4664 | | - void ImportGFD() |
---|
4665 | | - { |
---|
4666 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4667 | | - browser.show(); |
---|
4668 | | - String filename = browser.getFile(); |
---|
4669 | | - if (filename != null && filename.length() > 0) |
---|
4670 | | - { |
---|
4671 | | - String fullname = browser.getDirectory() + filename; |
---|
4672 | | - |
---|
4673 | | - //Object3D readobj = |
---|
4674 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4675 | | - //makeSomething(readobj); |
---|
4676 | | - } |
---|
4677 | | - } |
---|
4678 | | - |
---|
4679 | 5039 | /* |
---|
4680 | 5040 | public void Callback(Object obj) |
---|
4681 | 5041 | { |
---|
.. | .. |
---|
4699 | 5059 | } |
---|
4700 | 5060 | */ |
---|
4701 | 5061 | |
---|
4702 | | - void ImportVRMLX3D() |
---|
4703 | | - { |
---|
4704 | | - if (GrafreeD.standAlone) |
---|
4705 | | - { |
---|
4706 | | - /**/ |
---|
4707 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4708 | | - browser.show(); |
---|
4709 | | - String filename = browser.getFile(); |
---|
4710 | | - if (filename != null && filename.length() > 0) |
---|
4711 | | - { |
---|
4712 | | - String fullname = browser.getDirectory() + filename; |
---|
4713 | | - LoadVRMLX3D(fullname); |
---|
4714 | | - } |
---|
4715 | | - /**/ |
---|
4716 | | - } |
---|
4717 | | - } |
---|
4718 | | - |
---|
4719 | 5062 | String GetFile(String dialogName) |
---|
4720 | 5063 | { |
---|
4721 | | - if (GrafreeD.standAlone) |
---|
| 5064 | + if (Grafreed.standAlone) |
---|
4722 | 5065 | { |
---|
4723 | 5066 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4724 | 5067 | browser.show(); |
---|
.. | .. |
---|
4782 | 5125 | cButton flashSelectionButton; |
---|
4783 | 5126 | cButton editButton; |
---|
4784 | 5127 | cButton uneditButton; |
---|
| 5128 | + JCheckBox allParamsButton; |
---|
4785 | 5129 | cButton clearpanelButton; |
---|
4786 | | - cButton allParamsButton; |
---|
4787 | 5130 | cButton unselectButton; |
---|
4788 | 5131 | |
---|
| 5132 | + cButton oneStepButton; |
---|
| 5133 | + |
---|
4789 | 5134 | cButton screenfitButton; |
---|
4790 | 5135 | cButton screenfitpointButton; |
---|
4791 | 5136 | cButton snapobjectButton; |
---|
.. | .. |
---|
4816 | 5161 | private MenuItem lookFromItem; |
---|
4817 | 5162 | private MenuItem switchItem; |
---|
4818 | 5163 | private MenuItem cutItem; |
---|
| 5164 | + private MenuItem undoItem; |
---|
| 5165 | + private MenuItem redoItem; |
---|
4819 | 5166 | private MenuItem duplicateItem; |
---|
4820 | 5167 | private MenuItem cloneItem; |
---|
4821 | 5168 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
4827 | 5174 | private MenuItem resetsupportItem; |
---|
4828 | 5175 | private MenuItem resetreferencesItem; |
---|
4829 | 5176 | private MenuItem linkverticesItem; |
---|
| 5177 | + private MenuItem relinkverticesItem; |
---|
4830 | 5178 | private MenuItem setMasterItem; |
---|
4831 | | - private MenuItem resetMeshItem; |
---|
| 5179 | + private MenuItem resetAllItem; |
---|
4832 | 5180 | private MenuItem stepAllItem; |
---|
4833 | 5181 | private MenuItem revertMeshItem; |
---|
4834 | 5182 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4839 | 5187 | private MenuItem mergeGeometriesItem; |
---|
4840 | 5188 | private MenuItem copyItem; |
---|
4841 | 5189 | private MenuItem pasteItem; |
---|
| 5190 | + private MenuItem pasteIntoItem; |
---|
4842 | 5191 | private MenuItem pasteLinkItem; |
---|
4843 | 5192 | private MenuItem pasteCloneItem; |
---|
4844 | 5193 | private MenuItem pasteExpandItem; |
---|
4845 | 5194 | private MenuItem clearItem; |
---|
4846 | 5195 | private MenuItem clearAllItem; |
---|
4847 | 5196 | private MenuItem genUVItem; |
---|
| 5197 | + private MenuItem genNormalsMESHItem; |
---|
4848 | 5198 | private MenuItem genNormalsCADItem; |
---|
4849 | 5199 | private MenuItem genNormalsORGANItem; |
---|
| 5200 | + private MenuItem genNormalsMINEItem; |
---|
4850 | 5201 | private MenuItem stripifyItem; |
---|
4851 | 5202 | private MenuItem unstripifyItem; |
---|
4852 | 5203 | private MenuItem trimItem; |
---|
.. | .. |
---|
4886 | 5237 | private MenuItem panoTexturesItem; |
---|
4887 | 5238 | |
---|
4888 | 5239 | private MenuItem resetCentroidItem; |
---|
4889 | | - private MenuItem transformgeometryItem; |
---|
| 5240 | + private MenuItem resetCentroidXZItem; |
---|
4890 | 5241 | private MenuItem resetTransformItem; |
---|
| 5242 | + private MenuItem transformGeometryItem; |
---|
| 5243 | + private MenuItem transformChildrenItem; |
---|
| 5244 | + private MenuItem hideItem; |
---|
4891 | 5245 | private MenuItem grabItem; |
---|
4892 | 5246 | private MenuItem backItem; |
---|
4893 | 5247 | private MenuItem frontItem; |
---|
.. | .. |
---|
4908 | 5262 | |
---|
4909 | 5263 | private MenuItem resetParentItem; |
---|
4910 | 5264 | private MenuItem repairParentItem; |
---|
| 5265 | + private MenuItem repairShadowItem; |
---|
4911 | 5266 | private MenuItem sortbysizeItem; |
---|
4912 | 5267 | private MenuItem sortbynameItem; |
---|
4913 | 5268 | |
---|
.. | .. |
---|
4928 | 5283 | private MenuItem coneItem; |
---|
4929 | 5284 | private MenuItem torusItem; |
---|
4930 | 5285 | private MenuItem superItem; |
---|
| 5286 | + private MenuItem kleinItem; |
---|
4931 | 5287 | private MenuItem blobItem; |
---|
4932 | 5288 | private MenuItem latheItem; |
---|
4933 | 5289 | private MenuItem bezierItem; |
---|
4934 | | - private MenuItem checkerItem; |
---|
| 5290 | + private MenuItem overlayItem; |
---|
4935 | 5291 | private MenuItem meshItem; |
---|
4936 | 5292 | // private MenuItem meshGroupItem; |
---|
4937 | 5293 | private MenuItem springItem; |
---|
.. | .. |
---|
4940 | 5296 | private MenuItem csgItem; |
---|
4941 | 5297 | private MenuItem templateItem; |
---|
4942 | 5298 | private MenuItem textureItem; |
---|
| 5299 | + private MenuItem billboardItem; |
---|
4943 | 5300 | private MenuItem shadowXItem; |
---|
4944 | 5301 | private MenuItem shadowYItem; |
---|
4945 | 5302 | private MenuItem shadowZItem; |
---|
.. | .. |
---|
4952 | 5309 | private MenuItem doubleItem; |
---|
4953 | 5310 | private MenuItem tripleItem; |
---|
4954 | 5311 | |
---|
4955 | | - private MenuItem importGFDItem; |
---|
4956 | | - private MenuItem importVRMLX3DItem; |
---|
4957 | | - private MenuItem import3DSItem; |
---|
4958 | | - private MenuItem importOBJItem; |
---|
4959 | | - |
---|
4960 | 5312 | private MenuItem computeAOItem; |
---|
4961 | 5313 | private MenuItem recompileItem; |
---|
4962 | 5314 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
4966 | 5318 | private MenuItem analyzeItem; |
---|
4967 | 5319 | private MenuItem dumpItem; |
---|
4968 | 5320 | //boolean freezemodel = false; |
---|
| 5321 | + |
---|
| 5322 | + Menu cameraMenu; |
---|
| 5323 | + MenuItem editCameraItem; |
---|
| 5324 | + MenuItem revertCameraItem; |
---|
4969 | 5325 | } |
---|