.. | .. |
---|
12 | 12 | import com.jme.math.Vector3f; |
---|
13 | 13 | import com.jme.renderer.ColorRGBA; |
---|
14 | 14 | |
---|
| 15 | +import grafeme.ui.*; |
---|
15 | 16 | //import buoy.widget.BFileChooser; |
---|
16 | 17 | |
---|
17 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
.. | .. |
---|
73 | 74 | this.copy = this.group = copy; |
---|
74 | 75 | //selectees = this.group.selectees; |
---|
75 | 76 | |
---|
76 | | - SetupMenu2(objEditor); |
---|
| 77 | + SetupMenu2(this); //objEditor); |
---|
77 | 78 | SetupUI2(objEditor); |
---|
78 | 79 | objEditor.SetupUI(true); |
---|
79 | 80 | SetupViews(objEditor); |
---|
.. | .. |
---|
97 | 98 | |
---|
98 | 99 | void CloneClipboard(boolean supports) |
---|
99 | 100 | { |
---|
100 | | - assert(GrafreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
102 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
104 | | - makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
| 101 | + assert(Grafreed.clipboard.parent == null); |
---|
| 102 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 103 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 104 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 105 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
105 | 106 | else |
---|
106 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
107 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 107 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 108 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 109 | } |
---|
109 | 110 | |
---|
110 | 111 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 119 | // obj.support = null; |
---|
119 | 120 | if (!supports) |
---|
120 | 121 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 123 | obj.parent = parent; |
---|
123 | 124 | // obj.support = support; |
---|
124 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
147 | 148 | |
---|
148 | 149 | //JTextField nameField; |
---|
149 | 150 | |
---|
150 | | - void SetupMenu2(ObjEditor oe) |
---|
| 151 | + void SetupMenu2(GroupEditor oe) |
---|
151 | 152 | { |
---|
| 153 | + Menu menu; |
---|
| 154 | + oe.menuBar.add(menu = new Menu("Edit")); |
---|
| 155 | + //editItem = menu.add(new MenuItem("Edit")); |
---|
| 156 | + //editItem.addActionListener(this); |
---|
| 157 | + |
---|
| 158 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 159 | +// undoItem.addActionListener(this); |
---|
| 160 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 161 | +// redoItem.addActionListener(this); |
---|
| 162 | +// menu.add("-"); |
---|
| 163 | + duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 164 | + duplicateItem.addActionListener(this); |
---|
| 165 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 166 | + cloneItem.addActionListener(this); |
---|
| 167 | + if (Globals.ADVANCED) |
---|
| 168 | + { |
---|
| 169 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 170 | + cloneSupportItem.addActionListener(this); |
---|
| 171 | + } |
---|
| 172 | + menu.add("-"); |
---|
| 173 | + cutItem = menu.add(new MenuItem("Cut")); |
---|
| 174 | + cutItem.addActionListener(this); |
---|
| 175 | + copyItem = menu.add(new MenuItem("Copy")); |
---|
| 176 | + copyItem.addActionListener(this); |
---|
| 177 | + pasteItem = menu.add(new MenuItem("Paste")); |
---|
| 178 | + pasteItem.addActionListener(this); |
---|
| 179 | + menu.add("-"); |
---|
| 180 | + |
---|
| 181 | + menu.add("-"); |
---|
| 182 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 183 | + pasteIntoItem.addActionListener(this); |
---|
| 184 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 185 | + pasteLinkItem.addActionListener(this); |
---|
| 186 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 187 | + pasteCloneItem.addActionListener(this); |
---|
| 188 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 189 | +// pasteExpandItem.addActionListener(this); |
---|
| 190 | + menu.add("-"); |
---|
| 191 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 192 | + clearItem.addActionListener(this); |
---|
| 193 | + |
---|
| 194 | + if (Globals.ADVANCED) |
---|
| 195 | + { |
---|
| 196 | + // Deletes the cameras... |
---|
| 197 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 198 | + clearAllItem.addActionListener(this); |
---|
| 199 | + } |
---|
| 200 | + |
---|
| 201 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 202 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 203 | + //zBufferItem.addActionListener(this); |
---|
| 204 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 205 | + //normalLensItem.addActionListener(this); |
---|
| 206 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 207 | + revertCameraItem.addActionListener(this); |
---|
| 208 | + |
---|
| 209 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 210 | + toggleFullScreenItem.addItemListener(this); |
---|
| 211 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 212 | + cameraMenu.add("-"); |
---|
| 213 | + |
---|
| 214 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 215 | + toggleTextureItem.addItemListener(this); |
---|
| 216 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 217 | + |
---|
| 218 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 219 | + toggleSwitchItem.addItemListener(this); |
---|
| 220 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 221 | + |
---|
| 222 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 223 | + toggleHandleItem.addItemListener(this); |
---|
| 224 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 225 | + |
---|
| 226 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 227 | + togglePaintItem.addItemListener(this); |
---|
| 228 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 229 | + |
---|
| 230 | + if (Globals.ADVANCED) |
---|
| 231 | + { |
---|
| 232 | + cameraMenu.add("-"); |
---|
| 233 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 234 | + toggleLiveItem.addItemListener(this); |
---|
| 235 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 236 | + |
---|
| 237 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 238 | + stepItem.addActionListener(this); |
---|
| 239 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 240 | + // toggleDLItem.addItemListener(this); |
---|
| 241 | + // toggleDLItem.setState(false); |
---|
| 242 | + |
---|
| 243 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 244 | + toggleRenderItem.addItemListener(this); |
---|
| 245 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 246 | + |
---|
| 247 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 248 | + toggleDebugItem.addItemListener(this); |
---|
| 249 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 250 | + |
---|
| 251 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 252 | + toggleFrustumItem.addItemListener(this); |
---|
| 253 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 254 | + |
---|
| 255 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 256 | + toggleFootContactItem.addItemListener(this); |
---|
| 257 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 258 | + |
---|
| 259 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 260 | + toggleTimelineItem.addItemListener(this); |
---|
| 261 | + } |
---|
| 262 | + |
---|
| 263 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 264 | +// toggleRootItem.addItemListener(this); |
---|
| 265 | +// toggleRootItem.setState(false); |
---|
| 266 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 267 | +// animationItem.addItemListener(this); |
---|
| 268 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 269 | + cameraMenu.add("-"); |
---|
| 270 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 271 | + editCameraItem.addActionListener(this); |
---|
| 272 | + |
---|
| 273 | + if (Globals.ADVANCED) |
---|
| 274 | + { |
---|
152 | 275 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 276 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 277 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 283 | lookAtItem.addActionListener(this); |
---|
161 | 284 | //lookFromItem.addActinoListener(this); |
---|
162 | 285 | //switchItem.addActionListener(this); |
---|
163 | | - Menu menu; |
---|
164 | | - oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | | - //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | | - //editItem.addActionListener(this); |
---|
167 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
168 | | - duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | | - cloneItem.addActionListener(this); |
---|
172 | | - cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | | - cloneSupportItem.addActionListener(this); |
---|
174 | | - menu.add("-"); |
---|
175 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | | - cutItem.addActionListener(this); |
---|
177 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
178 | | - copyItem.addActionListener(this); |
---|
179 | | - pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | | - pasteItem.addActionListener(this); |
---|
181 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | | - pasteLinkItem.addActionListener(this); |
---|
183 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | | - pasteCloneItem.addActionListener(this); |
---|
185 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | | -// pasteExpandItem.addActionListener(this); |
---|
187 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | | - clearItem.addActionListener(this); |
---|
189 | | - clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | | - clearAllItem.addActionListener(this); |
---|
191 | | - |
---|
| 286 | + } |
---|
| 287 | + |
---|
192 | 288 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
193 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
194 | | - resetMeshItem.addActionListener(this); |
---|
195 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
196 | | - stepAllItem.addActionListener(this); |
---|
| 289 | + if (Globals.ADVANCED) |
---|
| 290 | + { |
---|
197 | 291 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 292 | revertMeshItem.addActionListener(this); |
---|
199 | 293 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 294 | resetreferencesItem.addActionListener(this); |
---|
201 | 295 | menu.add("-"); |
---|
| 296 | + } |
---|
202 | 297 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 298 | overwriteGeoItem.addActionListener(this); |
---|
204 | 299 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 305 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 306 | overwriteUVItem.addActionListener(this); |
---|
212 | 307 | menu.add("-"); |
---|
| 308 | + if (Globals.ADVANCED) |
---|
| 309 | + { |
---|
213 | 310 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 311 | generateMeshItem.addActionListener(this); |
---|
215 | 312 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 313 | poseMeshItem.addActionListener(this); |
---|
217 | 314 | menu.add("-"); |
---|
| 315 | + } |
---|
218 | 316 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 317 | resetsupportItem.addActionListener(this); |
---|
220 | 318 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 319 | linkverticesItem.addActionListener(this); |
---|
222 | 320 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 321 | relinkverticesItem.addActionListener(this); |
---|
| 322 | + |
---|
| 323 | + if (Globals.ADVANCED) |
---|
| 324 | + { |
---|
224 | 325 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 326 | setMasterItem.addActionListener(this); |
---|
| 327 | + } |
---|
226 | 328 | |
---|
227 | 329 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | 330 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
233 | 335 | frontItem.addActionListener(this); |
---|
234 | 336 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | 337 | compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 338 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 339 | hideItem.addActionListener(this); |
---|
238 | 340 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 341 | ungroupItem.addActionListener(this); |
---|
240 | 342 | menu.add("-"); |
---|
241 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 343 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
242 | 344 | randomItem.addActionListener(this); |
---|
243 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
244 | | - physicsItem.addActionListener(this); |
---|
245 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
246 | | - frameselectorItem.addActionListener(this); |
---|
247 | 345 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 346 | switchGeoItem.addActionListener(this); |
---|
249 | 347 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 348 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 349 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 350 | morphItem.addActionListener(this); |
---|
| 351 | + |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
| 354 | + menu.add("-"); |
---|
| 355 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 356 | + physicsItem.addActionListener(this); |
---|
| 357 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 358 | + frameselectorItem.addActionListener(this); |
---|
253 | 359 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 360 | scriptNodeItem.addActionListener(this); |
---|
255 | 361 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | 362 | cameraItem.addActionListener(this); |
---|
| 363 | + } |
---|
257 | 364 | |
---|
258 | 365 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | 366 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
268 | 375 | shadowYItem.addActionListener(this); |
---|
269 | 376 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
270 | 377 | shadowZItem.addActionListener(this); |
---|
| 378 | + if (Globals.ADVANCED) |
---|
| 379 | + { |
---|
| 380 | + menu.add("-"); |
---|
271 | 381 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 382 | linkerItem.addActionListener(this); |
---|
273 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
274 | | - templateItem.addActionListener(this); |
---|
275 | 383 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | 384 | attributeItem.addActionListener(this); |
---|
| 385 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 386 | + templateItem.addActionListener(this); |
---|
277 | 387 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 388 | pointflowItem.addActionListener(this); |
---|
| 389 | + } |
---|
279 | 390 | menu.add("-"); |
---|
280 | 391 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 392 | resetTransformItem.addActionListener(this); |
---|
282 | 393 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
283 | 394 | resetCentroidItem.addActionListener(this); |
---|
284 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
285 | | - transformgeometryItem.addActionListener(this); |
---|
| 395 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 396 | + resetCentroidXZItem.addActionListener(this); |
---|
| 397 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 398 | + transformGeometryItem.addActionListener(this); |
---|
| 399 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 400 | + transformChildrenItem.addActionListener(this); |
---|
286 | 401 | |
---|
287 | 402 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
288 | 403 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
293 | 408 | genNormalsCADItem.addActionListener(this); |
---|
294 | 409 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 410 | genNormalsMESHItem.addActionListener(this); |
---|
| 411 | + if (Globals.ADVANCED) |
---|
| 412 | + { |
---|
296 | 413 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
297 | 414 | genNormalsMINEItem.addActionListener(this); |
---|
| 415 | + } |
---|
298 | 416 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 417 | stripifyItem.addActionListener(this); |
---|
300 | 418 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 434 | reduce34MeshItem.addActionListener(this); |
---|
317 | 435 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 436 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 437 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 438 | clipMeshItem.addActionListener(this); |
---|
| 439 | + |
---|
| 440 | + if (Globals.ADVANCED) |
---|
| 441 | + { |
---|
| 442 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 443 | + smoothMeshItem.addActionListener(this); |
---|
| 444 | + } |
---|
323 | 445 | |
---|
324 | 446 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 447 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
326 | 448 | clearMaterialsItem.addActionListener(this); |
---|
| 449 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 450 | + resetAllItem.addActionListener(this); |
---|
| 451 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 452 | + stepAllItem.addActionListener(this); |
---|
327 | 453 | menu.add("-"); |
---|
328 | 454 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
329 | 455 | liveleavesItem.addActionListener(this); |
---|
330 | 456 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 457 | unliveleavesItem.addActionListener(this); |
---|
| 458 | + if (Globals.ADVANCED) |
---|
| 459 | + { |
---|
332 | 460 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 461 | supportleavesItem.addActionListener(this); |
---|
334 | 462 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 463 | unsupportleavesItem.addActionListener(this); |
---|
| 464 | + } |
---|
336 | 465 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 466 | hideleavesItem.addActionListener(this); |
---|
338 | 467 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
376 | 505 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 506 | sortbynameItem.addActionListener(this); |
---|
378 | 507 | menu.add("-"); |
---|
| 508 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 509 | + shareGeometriesItem.addActionListener(this); |
---|
| 510 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 511 | + mergeGeometriesItem.addActionListener(this); |
---|
| 512 | + if (Globals.ADVANCED) |
---|
| 513 | + { |
---|
| 514 | + // Pretty much the same as duplicate and clone. |
---|
379 | 515 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 516 | extractGeometriesItem.addActionListener(this); |
---|
381 | 517 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
382 | 518 | cloneGeometriesItem.addActionListener(this); |
---|
383 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
384 | | - shareGeometriesItem.addActionListener(this); |
---|
385 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
386 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 519 | + } |
---|
387 | 520 | |
---|
388 | 521 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 522 | buildCreateMenu(menu); |
---|
390 | 523 | |
---|
391 | | - |
---|
392 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
393 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
394 | | - importGFDItem.addActionListener(this); |
---|
395 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
396 | | - importVRMLX3DItem.addActionListener(this); |
---|
397 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
398 | | - importOBJItem.addActionListener(this); |
---|
399 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
400 | | - import3DSItem.addActionListener(this); |
---|
401 | | - |
---|
402 | 524 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 525 | buildToolsMenu(menu); |
---|
404 | 526 | } |
---|
.. | .. |
---|
433 | 555 | oe.radioPanel.add(dummyButton); |
---|
434 | 556 | oe.buttonGroup.add(dummyButton); |
---|
435 | 557 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
437 | | - |
---|
438 | 558 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
439 | 559 | |
---|
440 | | - oe.aConstraints.gridwidth = 1; |
---|
441 | | - oe.aConstraints.gridx = 0; |
---|
| 560 | + oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 561 | + undoButton.setToolTipText("Undo changes"); |
---|
| 562 | + undoButton.addActionListener(this); |
---|
442 | 563 | |
---|
443 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
444 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 564 | + oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 565 | + redoButton.setToolTipText("Redo changes"); |
---|
| 566 | + redoButton.addActionListener(this); |
---|
| 567 | + |
---|
| 568 | + oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 569 | + saveButton.setToolTipText("Save changes"); |
---|
| 570 | + saveButton.addActionListener(this); |
---|
| 571 | + |
---|
| 572 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 573 | + liveCB.setToolTipText("Enable animation"); |
---|
445 | 574 | liveCB.addItemListener(this); |
---|
446 | 575 | |
---|
447 | | - oe.aConstraints.gridx += 1; |
---|
448 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints); |
---|
| 576 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 577 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 578 | + oneStepButton.addActionListener(this); |
---|
| 579 | + |
---|
| 580 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 581 | + fastCB.setToolTipText("Fast mode"); |
---|
| 582 | + fastCB.addItemListener(this); |
---|
| 583 | + |
---|
| 584 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
449 | 585 | trackCB.setToolTipText("Enable tracking"); |
---|
450 | 586 | trackCB.addItemListener(this); |
---|
451 | 587 | |
---|
452 | | - oe.aConstraints.gridx += 1; |
---|
453 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 588 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
454 | 589 | screenfitButton.setToolTipText("Screen fit"); |
---|
455 | 590 | screenfitButton.addActionListener(this); |
---|
456 | | - oe.aConstraints.gridx += 1; |
---|
| 591 | + |
---|
457 | 592 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
458 | 593 | // screenfitpointButton.addActionListener(this); |
---|
459 | | -// oe.aConstraints.gridx += 1; |
---|
460 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
461 | | - snapobjectButton.addActionListener(this); |
---|
462 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
463 | | - oe.aConstraints.gridx += 1; |
---|
464 | 594 | |
---|
465 | | - //aConstraints.gridx = 0; |
---|
466 | | - //aConstraints.gridy += 1; |
---|
467 | | - oe.aConstraints.weighty = 0; |
---|
468 | | - oe.aConstraints.gridwidth = 1; |
---|
469 | | - |
---|
470 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 595 | + if (Globals.ADVANCED) |
---|
| 596 | + { |
---|
| 597 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 598 | + snapobjectButton.addActionListener(this); |
---|
| 599 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 600 | + } |
---|
| 601 | + |
---|
| 602 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
471 | 603 | flashSelectionButton.setToolTipText("Show selection"); |
---|
472 | 604 | flashSelectionButton.addActionListener(this); |
---|
473 | 605 | |
---|
474 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
| 606 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
475 | 607 | |
---|
476 | | - oe.aConstraints.gridx += 1; |
---|
477 | | - oe.aConstraints.weighty = 0; |
---|
478 | | - oe.aConstraints.gridwidth = 1; |
---|
479 | | - |
---|
480 | | - // |
---|
481 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 608 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
482 | 609 | twoButton.setToolTipText("Show center view only"); |
---|
483 | 610 | twoButton.addActionListener(this); |
---|
484 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 611 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
485 | 612 | fourButton.addActionListener(this); |
---|
486 | 613 | fourButton.setToolTipText("Show left panel only"); |
---|
487 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 614 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
488 | 615 | sixButton.setToolTipText("2-column layout left"); |
---|
489 | 616 | sixButton.addActionListener(this); |
---|
490 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 617 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
491 | 618 | threeButton.setToolTipText("2-column layout right"); |
---|
492 | 619 | threeButton.addActionListener(this); |
---|
493 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 620 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
494 | 621 | sevenButton.setToolTipText("3-column layout"); |
---|
495 | 622 | sevenButton.addActionListener(this); |
---|
496 | 623 | // |
---|
497 | 624 | |
---|
498 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints); |
---|
499 | | - rootButton.setToolTipText("Edit object in new tab"); |
---|
| 625 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 626 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
500 | 627 | rootButton.addActionListener(this); |
---|
501 | | - oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 628 | + |
---|
| 629 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
503 | 630 | closeButton.setToolTipText("Close tab"); |
---|
504 | 631 | closeButton.addActionListener(this); |
---|
505 | 632 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
506 | 633 | //clearButton.addActionListener(this); |
---|
507 | | - oe.aConstraints.gridx += 1; |
---|
508 | 634 | |
---|
509 | | - oe.aConstraints.gridx = 1; // |
---|
510 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 635 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 636 | + |
---|
| 637 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 638 | + editButton.setToolTipText("Edit selection"); |
---|
511 | 639 | editButton.addActionListener(this); |
---|
512 | | - oe.aConstraints.gridx += 1; |
---|
513 | | - oe.aConstraints.weighty = 0; |
---|
514 | | - oe.aConstraints.gridwidth = 1; |
---|
515 | 640 | |
---|
516 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 641 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 642 | + uneditButton.setToolTipText("Unedit selection"); |
---|
517 | 643 | uneditButton.addActionListener(this); |
---|
518 | 644 | |
---|
519 | | - oe.aConstraints.gridx += 1; |
---|
520 | | - oe.aConstraints.weighty = 0; |
---|
521 | | - oe.aConstraints.gridwidth = 1; |
---|
522 | | - |
---|
523 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
524 | | - clearPanelButton.addActionListener(this); |
---|
525 | | - |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 645 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 646 | + allParamsButton.setToolTipText("Edit all params"); |
---|
531 | 647 | allParamsButton.addActionListener(this); |
---|
532 | 648 | |
---|
533 | | - oe.aConstraints.gridx += 1; |
---|
534 | | - oe.aConstraints.weighty = 0; |
---|
535 | | - oe.aConstraints.gridwidth = 1; |
---|
536 | | - |
---|
537 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 649 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 650 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 651 | + clearPanelButton.addActionListener(this); |
---|
| 652 | + |
---|
| 653 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + unselectButton.setToolTipText("Unselect"); |
---|
538 | 655 | unselectButton.addActionListener(this); |
---|
539 | 656 | |
---|
| 657 | + commandsPanel.preferredHeight = 1; |
---|
| 658 | + |
---|
| 659 | + oe.treePanel.add(commandsPanel); |
---|
| 660 | + oe.treePanel.Return(); |
---|
| 661 | + |
---|
540 | 662 | // oe.aConstraints.gridx += 1; |
---|
541 | 663 | // oe.aConstraints.weighty = 0; |
---|
542 | 664 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
548 | 670 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
549 | 671 | // gcButton.addActionListener(this); |
---|
550 | 672 | |
---|
551 | | - oe.aConstraints.gridx = 0; |
---|
552 | | - oe.aConstraints.gridy += 1; |
---|
553 | | - |
---|
554 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
555 | | - oe.aConstraints.gridwidth = 100; |
---|
556 | | - // oe.aConstraints.gridheight = 100; |
---|
557 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
558 | | - oe.aConstraints.gridheight = 1; |
---|
559 | | - oe.aConstraints.weighty = 0.5; |
---|
560 | | - oe.aConstraints.gridx = 0; |
---|
561 | | - JScrollPane jSP; |
---|
| 673 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 674 | + |
---|
| 675 | + JScrollPane jSP; |
---|
562 | 676 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
563 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 677 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
564 | 678 | ResetModel(); |
---|
565 | | - oe.aConstraints.weighty = 0.5; |
---|
566 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
567 | | - oe.aConstraints.gridy += 1; |
---|
568 | | - oe.aConstraints.gridwidth = 1; |
---|
| 679 | + |
---|
| 680 | + oe.treePanel.add(jSPPanel); |
---|
| 681 | + oe.treePanel.Return(); |
---|
569 | 682 | |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 2; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 683 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 684 | + |
---|
| 685 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 686 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
574 | 687 | colorCB.addItemListener(this); |
---|
575 | | - oe.aConstraints.gridx += 2; |
---|
576 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 688 | + |
---|
| 689 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 690 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
577 | 691 | materialCB.addItemListener(this); |
---|
578 | | - oe.aConstraints.gridx += 2; |
---|
579 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 692 | + |
---|
| 693 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 694 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
580 | 695 | textureCB.addItemListener(this); |
---|
581 | 696 | |
---|
582 | | - oe.aConstraints.gridx = 0; |
---|
583 | | - oe.aConstraints.gridy += 1; |
---|
| 697 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 698 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 699 | + oe.treePanel.Return(); |
---|
584 | 700 | |
---|
| 701 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 702 | +// mainPanel.setResizeWeight(0.5); |
---|
| 703 | + |
---|
585 | 704 | //jList.addListSelectionListener(this); |
---|
586 | 705 | oe.jTree.addTreeSelectionListener(this); |
---|
587 | 706 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
604 | 723 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
605 | 724 | } |
---|
606 | 725 | |
---|
607 | | - void AddOptions(JPanel panel, GridBagConstraints constraints) |
---|
| 726 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
608 | 727 | { |
---|
609 | | - constraints.gridx = 0; |
---|
610 | | - constraints.gridy = 0; |
---|
611 | | - panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints); |
---|
612 | | - fastCB.setToolTipText("Fast mode"); |
---|
613 | | - fastCB.addItemListener(this); |
---|
614 | | - constraints.gridy += 1; |
---|
615 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints); |
---|
616 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
617 | | - supportCB.addItemListener(this); |
---|
618 | | - |
---|
619 | | - // constraints.gridy += 1; |
---|
620 | | - // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
621 | | - // localCB.addItemListener(this); |
---|
622 | | - |
---|
623 | | - constraints.gridy += 1; |
---|
624 | | - panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints); |
---|
625 | | - crowdCB.setToolTipText("Used for crowds"); |
---|
626 | | - crowdCB.addItemListener(this); |
---|
627 | | - |
---|
628 | | - constraints.gridy += 1; |
---|
629 | | - panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints); |
---|
630 | | - smoothCB.setToolTipText("Snapping delay"); |
---|
631 | | - smoothCB.addItemListener(this); |
---|
632 | | - |
---|
633 | | - constraints.gridy += 1; |
---|
634 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints); |
---|
635 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
636 | | - slowCB.addItemListener(this); |
---|
637 | | - constraints.gridy += 1; |
---|
638 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints); |
---|
| 728 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
639 | 729 | boxCB.setToolTipText("Display bounding boxes"); |
---|
640 | 730 | boxCB.addItemListener(this); |
---|
641 | | - constraints.gridy += 1; |
---|
642 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints); |
---|
| 731 | + |
---|
| 732 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
643 | 733 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
644 | 734 | zoomBoxCB.addItemListener(this); |
---|
645 | 735 | |
---|
| 736 | + if (true) // Globals.ADVANCED) |
---|
| 737 | + { |
---|
| 738 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 739 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 740 | + supportCB.addItemListener(this); |
---|
| 741 | + |
---|
| 742 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 743 | + // localCB.addItemListener(this); |
---|
| 744 | + |
---|
| 745 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 746 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 747 | + crowdCB.addItemListener(this); |
---|
| 748 | + |
---|
| 749 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 750 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 751 | + smoothCB.addItemListener(this); |
---|
| 752 | + |
---|
| 753 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 754 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 755 | + slowCB.addItemListener(this); |
---|
| 756 | + |
---|
646 | 757 | // constraints.gridy += 1; |
---|
647 | 758 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
648 | 759 | // speakerMocapCB.addItemListener(this); |
---|
.. | .. |
---|
650 | 761 | if (false) |
---|
651 | 762 | { |
---|
652 | 763 | // handled in scripts |
---|
653 | | - constraints.gridy += 1; |
---|
654 | | - panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints); |
---|
| 764 | + //constraints.gridy += 1; |
---|
| 765 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
655 | 766 | speakerCameraCB.addItemListener(this); |
---|
656 | 767 | |
---|
657 | | - constraints.gridy += 1; |
---|
658 | | - panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints); |
---|
| 768 | + //constraints.gridy += 1; |
---|
| 769 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
659 | 770 | speakerFocusCB.addItemListener(this); |
---|
660 | 771 | |
---|
661 | | - constraints.gridy += 1; |
---|
662 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints); |
---|
| 772 | + //constraints.gridy += 1; |
---|
| 773 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
663 | 774 | smoothfocusCB.addItemListener(this); |
---|
664 | 775 | } |
---|
665 | 776 | |
---|
.. | .. |
---|
667 | 778 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
668 | 779 | // debugCB.addItemListener(this); |
---|
669 | 780 | |
---|
670 | | - constraints.gridy += 1; |
---|
671 | | - panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints); |
---|
| 781 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
672 | 782 | oeilCB.addItemListener(this); |
---|
673 | 783 | |
---|
674 | | - constraints.gridy += 1; |
---|
675 | | - panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints); |
---|
| 784 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
676 | 785 | lookAtCB.setToolTipText("Look-at target"); |
---|
677 | 786 | lookAtCB.addItemListener(this); |
---|
| 787 | + |
---|
| 788 | + } |
---|
| 789 | + |
---|
| 790 | + cGridBag fill = new cGridBag(); |
---|
| 791 | + |
---|
| 792 | + fill.preferredHeight = 200; |
---|
| 793 | + |
---|
| 794 | + panel.add(fill); |
---|
678 | 795 | |
---|
679 | 796 | } |
---|
680 | 797 | |
---|
.. | .. |
---|
689 | 806 | buttonGroup.add(radioButton); |
---|
690 | 807 | radioButton.doClick(); |
---|
691 | 808 | } |
---|
| 809 | + |
---|
692 | 810 | void SetupViews(ObjEditor oe) |
---|
693 | 811 | { |
---|
694 | 812 | oe.SetupViews(); |
---|
.. | .. |
---|
753 | 871 | } else if(e.getSource() == liveCB) |
---|
754 | 872 | { |
---|
755 | 873 | cameraView.ToggleLive(); |
---|
| 874 | + refreshContents(false); |
---|
756 | 875 | } |
---|
757 | 876 | else if(e.getSource() == supportCB) |
---|
758 | 877 | { |
---|
.. | .. |
---|
905 | 1024 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
906 | 1025 | // return; |
---|
907 | 1026 | // } |
---|
908 | | - if (string.charAt(0) == '/') |
---|
| 1027 | + |
---|
| 1028 | + // File path for Mac and Windows |
---|
| 1029 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
909 | 1030 | { |
---|
910 | 1031 | // file(s) |
---|
911 | 1032 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
932 | 1053 | |
---|
933 | 1054 | flashIt = false; |
---|
934 | 1055 | CameraPane pane = (CameraPane) target; |
---|
935 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1056 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
936 | 1057 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
937 | 1058 | |
---|
938 | 1059 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
959 | 1080 | { |
---|
960 | 1081 | loadClipboard(true); |
---|
961 | 1082 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
962 | | - pasteInto(false); |
---|
| 1083 | + pasteInto(false, false); |
---|
963 | 1084 | } else { |
---|
964 | 1085 | loadClipboard(false); |
---|
965 | 1086 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
966 | | - pasteInto(false); // true); // ??? |
---|
| 1087 | + pasteInto(false, false); // true); // ??? |
---|
967 | 1088 | } |
---|
968 | 1089 | } |
---|
969 | 1090 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1085 | 1206 | kleinItem.addActionListener(this); |
---|
1086 | 1207 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1087 | 1208 | particleItem.addActionListener(this); |
---|
| 1209 | + if (Globals.ADVANCED) |
---|
| 1210 | + { |
---|
1088 | 1211 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1089 | 1212 | ragdollItem.addActionListener(this); |
---|
1090 | 1213 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1091 | 1214 | ragdoll2Item.addActionListener(this); |
---|
| 1215 | + } |
---|
1092 | 1216 | menu.add("-"); |
---|
1093 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1217 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1094 | 1218 | meshItem.addActionListener(this); |
---|
1095 | 1219 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1096 | 1220 | // meshGroupItem.addActionListener(this); |
---|
| 1221 | + if (Globals.ADVANCED) |
---|
| 1222 | + { |
---|
1097 | 1223 | springItem = menu.add(new MenuItem("Spring")); |
---|
1098 | 1224 | springItem.addActionListener(this); |
---|
1099 | 1225 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1100 | 1226 | flagItem.addActionListener(this); |
---|
1101 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1102 | | - bezierItem.addActionListener(this); |
---|
1103 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1104 | | - checkerItem.addActionListener(this); |
---|
1105 | 1227 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1106 | 1228 | blobItem.addActionListener(this); |
---|
1107 | 1229 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1108 | 1230 | latheItem.addActionListener(this); |
---|
| 1231 | + } |
---|
| 1232 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1233 | + bezierItem.addActionListener(this); |
---|
| 1234 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1235 | + overlayItem.addActionListener(this); |
---|
1109 | 1236 | lightItem = menu.add(new MenuItem("Light")); |
---|
1110 | 1237 | lightItem.addActionListener(this); |
---|
1111 | 1238 | menu.add("-"); |
---|
.. | .. |
---|
1115 | 1242 | loopItem.addActionListener(this); |
---|
1116 | 1243 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1117 | 1244 | doubleItem.addActionListener(this); |
---|
| 1245 | + if (Globals.ADVANCED) |
---|
| 1246 | + { |
---|
1118 | 1247 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1119 | 1248 | tripleItem.addActionListener(this); |
---|
| 1249 | + } |
---|
1120 | 1250 | } |
---|
1121 | 1251 | |
---|
1122 | 1252 | void buildToolsMenu(Menu menu) |
---|
1123 | 1253 | { |
---|
1124 | 1254 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1125 | 1255 | animationItem.addItemListener(this); |
---|
1126 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1256 | + animationItem.setState(Globals.ANIMATION); |
---|
1127 | 1257 | |
---|
1128 | 1258 | menu.add("-"); |
---|
1129 | 1259 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1130 | 1260 | parseverticesItem.addActionListener(this); |
---|
1131 | 1261 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1132 | 1262 | textureFieldItem.addActionListener(this); |
---|
1133 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1263 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1134 | 1264 | alignItem.addActionListener(this); |
---|
1135 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1136 | | - mirrorItem.addActionListener(this); |
---|
1137 | 1265 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1138 | 1266 | reduceMorphItem.addActionListener(this); |
---|
1139 | 1267 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1140 | 1268 | reduce34MorphItem.addActionListener(this); |
---|
1141 | | - |
---|
| 1269 | + menu.add("-"); |
---|
1142 | 1270 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1143 | 1271 | computeAOItem.addActionListener(this); |
---|
1144 | | - menu.add("-"); |
---|
1145 | 1272 | |
---|
| 1273 | + if (Globals.ADVANCED) |
---|
| 1274 | + { |
---|
| 1275 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1276 | + mirrorItem.addActionListener(this); |
---|
| 1277 | + menu.add("-"); |
---|
1146 | 1278 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1147 | 1279 | memoryItem.addActionListener(this); |
---|
1148 | 1280 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1149 | 1281 | analyzeItem.addActionListener(this); |
---|
1150 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1282 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1151 | 1283 | dumpItem.addActionListener(this); |
---|
1152 | 1284 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1153 | 1285 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1165 | 1297 | menu.add("-"); |
---|
1166 | 1298 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1167 | 1299 | editScriptItem.addActionListener(this); |
---|
| 1300 | + } |
---|
1168 | 1301 | } |
---|
1169 | 1302 | |
---|
1170 | 1303 | void ScreenFit() |
---|
.. | .. |
---|
1493 | 1626 | |
---|
1494 | 1627 | void Overwrite(int mask) |
---|
1495 | 1628 | { |
---|
1496 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1629 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1497 | 1630 | { |
---|
1498 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1631 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1499 | 1632 | |
---|
1500 | 1633 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1501 | 1634 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1666 | 1799 | { |
---|
1667 | 1800 | makeSomething(new BezierSurface()); |
---|
1668 | 1801 | } else |
---|
1669 | | - if (source == checkerItem) |
---|
| 1802 | + if (source == overlayItem) |
---|
1670 | 1803 | { |
---|
1671 | 1804 | /* |
---|
1672 | 1805 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1800 | 1933 | csg.addChild(child); |
---|
1801 | 1934 | child.addChild(csg); |
---|
1802 | 1935 | } else |
---|
1803 | | - |
---|
1804 | | - if (source == importGFDItem) |
---|
1805 | | - { |
---|
1806 | | - ImportGFD(); |
---|
1807 | | - } else |
---|
1808 | | - if (source == importVRMLX3DItem) |
---|
1809 | | - { |
---|
1810 | | - ImportVRMLX3D(); |
---|
1811 | | - } else |
---|
1812 | | - if (source == import3DSItem) |
---|
1813 | | - { |
---|
1814 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1815 | | - } else |
---|
1816 | | - if (source == importOBJItem) |
---|
1817 | | - { |
---|
1818 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1819 | | - } else |
---|
1820 | 1936 | if (source == computeAOItem) |
---|
1821 | 1937 | { |
---|
1822 | 1938 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1835 | 1951 | if (source == invariantsItem) |
---|
1836 | 1952 | { |
---|
1837 | 1953 | System.out.println("Invariants:"); |
---|
1838 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1954 | + Grafreed.grafreeD.universe.invariants(); |
---|
1839 | 1955 | } else |
---|
1840 | 1956 | if (source == memoryItem) |
---|
1841 | 1957 | { |
---|
.. | .. |
---|
1853 | 1969 | if (source == dumpItem) |
---|
1854 | 1970 | { |
---|
1855 | 1971 | DumpObject(); |
---|
| 1972 | + } else |
---|
| 1973 | + if (source == undoButton) |
---|
| 1974 | + { |
---|
| 1975 | + Undo(); |
---|
| 1976 | + } else |
---|
| 1977 | + if (source == redoButton) |
---|
| 1978 | + { |
---|
| 1979 | + Redo(); |
---|
| 1980 | + } else |
---|
| 1981 | + if (source == saveButton) |
---|
| 1982 | + { |
---|
| 1983 | + Save(); |
---|
| 1984 | + } else |
---|
| 1985 | + if (source == oneStepButton) |
---|
| 1986 | + { |
---|
| 1987 | + Globals.ONESTEP = true; |
---|
| 1988 | + cameraView.repaint(); |
---|
1856 | 1989 | } else |
---|
1857 | 1990 | if (source == screenfitButton) |
---|
1858 | 1991 | { |
---|
.. | .. |
---|
1903 | 2036 | { |
---|
1904 | 2037 | loadClipboard(true); |
---|
1905 | 2038 | } else |
---|
| 2039 | + if (source == undoItem) |
---|
| 2040 | + { |
---|
| 2041 | + Undo(); |
---|
| 2042 | + } else |
---|
| 2043 | + if (source == redoItem) |
---|
| 2044 | + { |
---|
| 2045 | + Redo(); |
---|
| 2046 | + } else |
---|
1906 | 2047 | if (source == duplicateItem) |
---|
1907 | 2048 | { |
---|
1908 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2049 | + Object3D keep = Grafreed.clipboard; |
---|
1909 | 2050 | loadClipboard(false); |
---|
1910 | 2051 | paste(false); |
---|
1911 | | - GrafreeD.clipboard = keep; |
---|
| 2052 | + Grafreed.clipboard = keep; |
---|
1912 | 2053 | } else |
---|
1913 | 2054 | if (source == cloneItem) |
---|
1914 | 2055 | { |
---|
.. | .. |
---|
1926 | 2067 | { |
---|
1927 | 2068 | paste(false); |
---|
1928 | 2069 | } else |
---|
| 2070 | + if (source == pasteIntoItem) |
---|
| 2071 | + { |
---|
| 2072 | + pasteInto(true, false); |
---|
| 2073 | + } else |
---|
1929 | 2074 | if (source == pasteLinkItem) |
---|
1930 | 2075 | { |
---|
1931 | | - pasteInto(false); |
---|
| 2076 | + pasteInto(false, false); |
---|
1932 | 2077 | } else |
---|
1933 | 2078 | if (source == pasteCloneItem) |
---|
1934 | 2079 | { |
---|
1935 | | - pasteInto(true); |
---|
| 2080 | + pasteInto(true, true); |
---|
1936 | 2081 | } else |
---|
1937 | 2082 | if (source == pasteExpandItem) |
---|
1938 | 2083 | { |
---|
.. | .. |
---|
2124 | 2269 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2125 | 2270 | // refreshContents(); |
---|
2126 | 2271 | // } |
---|
2127 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2272 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2128 | 2273 | { |
---|
2129 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2274 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2130 | 2275 | |
---|
2131 | 2276 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2132 | 2277 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2134 | 2279 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2135 | 2280 | for (int i=0; i<group.selection.size(); i++) |
---|
2136 | 2281 | { |
---|
2137 | | - boolean random = CameraPane.RANDOM; |
---|
2138 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2282 | + boolean random = CameraPane.SWITCH; |
---|
| 2283 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2139 | 2284 | group.selection.get(i).linkVerticesThis(content); |
---|
2140 | 2285 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2141 | | - CameraPane.RANDOM = random; |
---|
| 2286 | + CameraPane.SWITCH = random; |
---|
2142 | 2287 | } |
---|
2143 | 2288 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2144 | 2289 | refreshContents(); |
---|
.. | .. |
---|
2148 | 2293 | { |
---|
2149 | 2294 | for (int i=0; i<group.selection.size(); i++) |
---|
2150 | 2295 | { |
---|
2151 | | - boolean random = CameraPane.RANDOM; |
---|
2152 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2296 | + boolean random = CameraPane.SWITCH; |
---|
| 2297 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2153 | 2298 | group.selection.get(i).linkVerticesThis(null); |
---|
2154 | | - CameraPane.RANDOM = random; |
---|
| 2299 | + CameraPane.SWITCH = random; |
---|
2155 | 2300 | } |
---|
2156 | 2301 | |
---|
2157 | 2302 | refreshContents(); |
---|
2158 | 2303 | } else |
---|
2159 | 2304 | if (source == relinkverticesItem) |
---|
2160 | 2305 | { |
---|
2161 | | - boolean random = CameraPane.RANDOM; |
---|
2162 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2306 | + boolean random = CameraPane.SWITCH; |
---|
| 2307 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2163 | 2308 | group.selection.RelinkToSupport(); |
---|
2164 | | - CameraPane.RANDOM = random; |
---|
| 2309 | + CameraPane.SWITCH = random; |
---|
2165 | 2310 | |
---|
2166 | 2311 | refreshContents(); |
---|
2167 | 2312 | } else |
---|
.. | .. |
---|
2176 | 2321 | } else |
---|
2177 | 2322 | if (source == setMasterItem) |
---|
2178 | 2323 | { |
---|
2179 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2324 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2180 | 2325 | { |
---|
2181 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2326 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2182 | 2327 | |
---|
2183 | 2328 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2184 | 2329 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2191 | 2336 | { |
---|
2192 | 2337 | if (group.selection.size() == 1) |
---|
2193 | 2338 | { |
---|
2194 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2339 | + if (Grafreed.clipboard.size() == 1) |
---|
2195 | 2340 | { |
---|
2196 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2341 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2197 | 2342 | |
---|
2198 | 2343 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2199 | 2344 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2210 | 2355 | { |
---|
2211 | 2356 | RevertMeshes(); |
---|
2212 | 2357 | } else |
---|
2213 | | - if (source == resetMeshItem) |
---|
| 2358 | + if (source == resetAllItem) |
---|
2214 | 2359 | { |
---|
2215 | 2360 | ResetAll(); |
---|
2216 | 2361 | } else |
---|
.. | .. |
---|
2259 | 2404 | RandomNode random = new RandomNode(); |
---|
2260 | 2405 | group(random); |
---|
2261 | 2406 | if (random.size() > 0) |
---|
2262 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2407 | + random.name = random.get(0).name + "Switch"; |
---|
2263 | 2408 | } else |
---|
2264 | 2409 | if (source == physicsItem) |
---|
2265 | 2410 | { |
---|
.. | .. |
---|
2398 | 2543 | } else |
---|
2399 | 2544 | if (source == genNormalsMESHItem) |
---|
2400 | 2545 | { |
---|
2401 | | - GenNormals(true); // TODO |
---|
| 2546 | + GenNormalsMESH(); |
---|
2402 | 2547 | } else |
---|
2403 | 2548 | if (source == genNormalsORGANItem) |
---|
2404 | 2549 | { |
---|
.. | .. |
---|
2548 | 2693 | { |
---|
2549 | 2694 | SmoothMesh(); |
---|
2550 | 2695 | } else |
---|
2551 | | - if (source == transformgeometryItem) |
---|
| 2696 | + if (source == transformGeometryItem) |
---|
2552 | 2697 | { |
---|
2553 | 2698 | TransformGeometry(); |
---|
| 2699 | + } else |
---|
| 2700 | + if (source == transformChildrenItem) |
---|
| 2701 | + { |
---|
| 2702 | + TransformChildren(); |
---|
2554 | 2703 | } else |
---|
2555 | 2704 | if (source == resetTransformItem) |
---|
2556 | 2705 | { |
---|
.. | .. |
---|
2558 | 2707 | } else |
---|
2559 | 2708 | if (source == resetCentroidItem) |
---|
2560 | 2709 | { |
---|
2561 | | - ResetCentroid(); |
---|
| 2710 | + ResetCentroid(true); |
---|
| 2711 | + } else |
---|
| 2712 | + if (source == resetCentroidXZItem) |
---|
| 2713 | + { |
---|
| 2714 | + ResetCentroid(false); |
---|
2562 | 2715 | } else |
---|
2563 | 2716 | if (source == resetParentItem) |
---|
2564 | 2717 | { |
---|
.. | .. |
---|
2914 | 3067 | child.CloseUI(); |
---|
2915 | 3068 | listUI.remove(child); |
---|
2916 | 3069 | |
---|
2917 | | - child.editWindow = null; // ??????????? |
---|
| 3070 | + //child.editWindow = null; // ??????????? |
---|
2918 | 3071 | } |
---|
2919 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3072 | + objEditor.ctrlPanel.FlushUI(); |
---|
2920 | 3073 | //objEditor.jTree.clearSelection(); |
---|
2921 | 3074 | //objEditor.ResetSliders(); |
---|
2922 | 3075 | refreshContents(true); |
---|
.. | .. |
---|
3000 | 3153 | frontView.object = group; |
---|
3001 | 3154 | sideView.object = group; |
---|
3002 | 3155 | } |
---|
| 3156 | + |
---|
| 3157 | +// fix "+" issue |
---|
3003 | 3158 | group.editWindow = this; |
---|
| 3159 | + |
---|
3004 | 3160 | /* |
---|
3005 | 3161 | currentLayout = radio.layout; |
---|
3006 | 3162 | if (currentLayout == null) |
---|
.. | .. |
---|
3013 | 3169 | //group.attributes = -1; |
---|
3014 | 3170 | ResetModel(); |
---|
3015 | 3171 | refreshContents(true); |
---|
3016 | | - } |
---|
| 3172 | + } else if (event.getSource() == editCameraItem) |
---|
| 3173 | + { |
---|
| 3174 | + cameraView.ProtectCamera(); |
---|
| 3175 | + cameraView.repaint(); |
---|
| 3176 | + return; |
---|
| 3177 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3178 | + { |
---|
| 3179 | + cameraView.RevertCamera(); |
---|
| 3180 | + cameraView.repaint(); |
---|
| 3181 | + return; |
---|
| 3182 | + // } else if (event.getSource() == textureButton) |
---|
| 3183 | + // { |
---|
| 3184 | + // return; // true; |
---|
| 3185 | + } |
---|
3017 | 3186 | else |
---|
3018 | 3187 | { |
---|
3019 | 3188 | //return super.action(event, arg); |
---|
.. | .. |
---|
3074 | 3243 | refreshContents(); |
---|
3075 | 3244 | } |
---|
3076 | 3245 | |
---|
| 3246 | + void TransformChildren() |
---|
| 3247 | + { |
---|
| 3248 | + Object3D obj; |
---|
| 3249 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3250 | + { |
---|
| 3251 | + obj = (Object3D)e.nextElement(); |
---|
| 3252 | + obj.KeepTextureMatrices(); |
---|
| 3253 | + obj.TransformChildren(); |
---|
| 3254 | + obj.RestoreTextureMatrices(); |
---|
| 3255 | + |
---|
| 3256 | +// if (obj.parent == null) |
---|
| 3257 | +// { |
---|
| 3258 | +// System.out.println("NULL PARENT!"); |
---|
| 3259 | +// new Exception().printStackTrace(); |
---|
| 3260 | +// } |
---|
| 3261 | +// else |
---|
| 3262 | +// TouchTransform(obj); |
---|
| 3263 | +// //obj.parent.Touch(); |
---|
| 3264 | + } |
---|
| 3265 | + |
---|
| 3266 | + refreshContents(); |
---|
| 3267 | + } |
---|
3077 | 3268 | |
---|
3078 | 3269 | void ResetTransform() |
---|
3079 | 3270 | { |
---|
.. | .. |
---|
3186 | 3377 | refreshContents(); |
---|
3187 | 3378 | } |
---|
3188 | 3379 | |
---|
3189 | | - void ResetCentroid() |
---|
| 3380 | + void ResetCentroid(boolean full) |
---|
3190 | 3381 | { |
---|
3191 | 3382 | Object3D obj; |
---|
3192 | 3383 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3201 | 3392 | LA.matIdentity(Object3D.mat); |
---|
3202 | 3393 | obj.getBounds(minima, maxima, false); |
---|
3203 | 3394 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3204 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3395 | + if (full) |
---|
| 3396 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3205 | 3397 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3206 | 3398 | obj.TransformMesh(Object3D.mat); |
---|
| 3399 | + |
---|
3207 | 3400 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3208 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3401 | + if (full) |
---|
| 3402 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3209 | 3403 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3404 | + |
---|
3210 | 3405 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3211 | 3406 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3212 | 3407 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3235 | 3430 | |
---|
3236 | 3431 | int size = obj.MemorySize(); |
---|
3237 | 3432 | |
---|
3238 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3433 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3434 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3239 | 3435 | } |
---|
3240 | 3436 | } |
---|
3241 | 3437 | catch (Exception e) |
---|
.. | .. |
---|
3272 | 3468 | obj = (Object3D)e.nextElement(); |
---|
3273 | 3469 | |
---|
3274 | 3470 | System.out.println("Object is: " + obj); |
---|
3275 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3471 | + Grafreed.AnalyzeObject(obj); |
---|
3276 | 3472 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3277 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3473 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3278 | 3474 | |
---|
3279 | 3475 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3280 | 3476 | } |
---|
.. | .. |
---|
3316 | 3512 | void GenNormals(boolean crease) |
---|
3317 | 3513 | { |
---|
3318 | 3514 | group.GenNormalsS(crease); |
---|
| 3515 | + |
---|
| 3516 | + refreshContents(); |
---|
| 3517 | + } |
---|
| 3518 | + |
---|
| 3519 | + void GenNormalsMESH() |
---|
| 3520 | + { |
---|
| 3521 | + group.GenNormalsMeshS(); |
---|
3319 | 3522 | |
---|
3320 | 3523 | refreshContents(); |
---|
3321 | 3524 | } |
---|
.. | .. |
---|
3488 | 3691 | |
---|
3489 | 3692 | void ParseVertices() |
---|
3490 | 3693 | { |
---|
3491 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3492 | | - GrafreeD.epsequal = true; |
---|
| 3694 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3695 | + Grafreed.epsequal = true; |
---|
3493 | 3696 | |
---|
3494 | 3697 | for (int i=0; i<group.selection.size(); i++) |
---|
3495 | 3698 | { |
---|
.. | .. |
---|
3514 | 3717 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3515 | 3718 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3516 | 3719 | |
---|
3517 | | - g.add(GrafreeD.clipboard); |
---|
| 3720 | + g.add(Grafreed.clipboard); |
---|
3518 | 3721 | |
---|
3519 | 3722 | buffer.add(g); |
---|
3520 | 3723 | } |
---|
.. | .. |
---|
3529 | 3732 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3530 | 3733 | } |
---|
3531 | 3734 | |
---|
3532 | | - GrafreeD.epsequal = epsequal; |
---|
| 3735 | + Grafreed.epsequal = epsequal; |
---|
3533 | 3736 | |
---|
3534 | 3737 | refreshContents(); |
---|
3535 | 3738 | } |
---|
.. | .. |
---|
3547 | 3750 | String pigment = Object3D.GetPigment(tex); |
---|
3548 | 3751 | //String bump = Object3D.GetBump(tex); |
---|
3549 | 3752 | |
---|
3550 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3753 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3754 | + |
---|
| 3755 | + try |
---|
| 3756 | + { |
---|
| 3757 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3758 | + } |
---|
| 3759 | + catch (Exception e) |
---|
| 3760 | + { |
---|
| 3761 | + System.err.println("FAIL: " + node); |
---|
| 3762 | + } |
---|
3551 | 3763 | |
---|
3552 | 3764 | double s = v.s; |
---|
3553 | 3765 | |
---|
.. | .. |
---|
3635 | 3847 | |
---|
3636 | 3848 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3637 | 3849 | |
---|
3638 | | - boolean random = CameraPane.RANDOM; |
---|
3639 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3850 | + boolean random = CameraPane.SWITCH; |
---|
| 3851 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3640 | 3852 | lowres.linkVerticesThis(null); |
---|
3641 | 3853 | lowres.linkVerticesThis(sn); |
---|
3642 | | - CameraPane.RANDOM = random; |
---|
| 3854 | + CameraPane.SWITCH = random; |
---|
3643 | 3855 | |
---|
3644 | 3856 | System.err.flush(); |
---|
3645 | 3857 | |
---|
.. | .. |
---|
3679 | 3891 | return; |
---|
3680 | 3892 | |
---|
3681 | 3893 | Object3D poses = group.selection.get(0); |
---|
3682 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3894 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3683 | 3895 | |
---|
3684 | 3896 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3685 | 3897 | |
---|
.. | .. |
---|
3873 | 4085 | |
---|
3874 | 4086 | void ClipMesh() |
---|
3875 | 4087 | { |
---|
3876 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4088 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3877 | 4089 | { |
---|
3878 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4090 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3879 | 4091 | |
---|
3880 | 4092 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3881 | 4093 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3884 | 4096 | // { |
---|
3885 | 4097 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3886 | 4098 | // } |
---|
3887 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4099 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3888 | 4100 | } |
---|
3889 | 4101 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3890 | 4102 | System.out.println("DONE."); |
---|
.. | .. |
---|
4019 | 4231 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4020 | 4232 | |
---|
4021 | 4233 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4022 | | - if(elem != group) |
---|
| 4234 | + if(elem != group || !newWindow) |
---|
4023 | 4235 | { |
---|
4024 | 4236 | // if (!(elem instanceof Composite)) |
---|
4025 | 4237 | // newWindow = false; |
---|
.. | .. |
---|
4109 | 4321 | //case 702: // Event.LIST_DESELECT |
---|
4110 | 4322 | group.deselectAll(); |
---|
4111 | 4323 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4112 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4113 | 4324 | if (tps != null) |
---|
4114 | 4325 | { |
---|
4115 | 4326 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4119 | 4330 | //if (child.parent != null) |
---|
4120 | 4331 | //child.parent.addSelectee(child); |
---|
4121 | 4332 | group.addSelectee(child); |
---|
4122 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4123 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4124 | | - System.err.println("info : " + child.GetPath()); |
---|
4125 | 4333 | } |
---|
4126 | 4334 | } |
---|
4127 | | - else |
---|
4128 | | - { |
---|
4129 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4130 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4131 | | - System.err.println("info : " + group.GetPath()); |
---|
4132 | | - } |
---|
| 4335 | +// else |
---|
| 4336 | +// { |
---|
| 4337 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4338 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4339 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4340 | +// } |
---|
4133 | 4341 | |
---|
4134 | | - objEditor.SetText(); // jan 2014 |
---|
4135 | | - |
---|
4136 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4342 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4137 | 4343 | CameraPane.flash = true; |
---|
4138 | 4344 | |
---|
4139 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4345 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4140 | 4346 | // a camera |
---|
4141 | 4347 | { |
---|
4142 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4143 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4348 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4349 | + { |
---|
| 4350 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4351 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4352 | + } |
---|
4144 | 4353 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4145 | 4354 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4146 | 4355 | } |
---|
.. | .. |
---|
4153 | 4362 | |
---|
4154 | 4363 | freezemodel = false; |
---|
4155 | 4364 | } |
---|
| 4365 | + |
---|
| 4366 | + void refreshContents(boolean cp) |
---|
| 4367 | + { |
---|
| 4368 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4369 | + { |
---|
| 4370 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4371 | + |
---|
| 4372 | + for (int i=0; i < group.selection.size(); i++) |
---|
| 4373 | + { |
---|
| 4374 | + Object3D child = (Object3D) group.selection.reserve(i); |
---|
| 4375 | + |
---|
| 4376 | + objEditor.SetMaterial(child); |
---|
| 4377 | + objEditor.AddInfo(child, this, true); |
---|
| 4378 | + System.err.println("info : " + child.GetPath()); |
---|
| 4379 | + |
---|
| 4380 | + group.selection.release(i); |
---|
| 4381 | + } |
---|
| 4382 | + |
---|
| 4383 | + objEditor.SetText(); // jan 2014 |
---|
| 4384 | + } |
---|
| 4385 | + |
---|
| 4386 | + super.refreshContents(cp); |
---|
| 4387 | + } |
---|
4156 | 4388 | |
---|
4157 | 4389 | void linkSomething(Object3D thing) |
---|
4158 | 4390 | { |
---|
.. | .. |
---|
4224 | 4456 | { |
---|
4225 | 4457 | if (group.selection.isEmpty()) |
---|
4226 | 4458 | return; |
---|
4227 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4459 | + |
---|
| 4460 | + Grafreed.clipboardIsTempGroup = false; |
---|
4228 | 4461 | Composite tGroup = null; |
---|
4229 | 4462 | if (group.selection.size() > 0) // 1) |
---|
4230 | 4463 | { |
---|
4231 | 4464 | tGroup = new cGroup(); |
---|
4232 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4465 | + Grafreed.clipboardIsTempGroup = true; |
---|
4233 | 4466 | } |
---|
4234 | 4467 | |
---|
4235 | 4468 | if (cut) |
---|
4236 | 4469 | { |
---|
| 4470 | + Save(); |
---|
4237 | 4471 | //int indices[] = jList.getSelectedIndices(); |
---|
4238 | 4472 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4239 | 4473 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4269 | 4503 | //System.out.println("cut " + child); |
---|
4270 | 4504 | //System.out.println("parent = " + child.parent); |
---|
4271 | 4505 | // tmp.addChild(child); |
---|
4272 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4506 | + if (Grafreed.clipboardIsTempGroup) |
---|
4273 | 4507 | tGroup.add/*Child*/(tmp); |
---|
4274 | 4508 | else |
---|
4275 | | - GrafreeD.clipboard = tmp; |
---|
| 4509 | + Grafreed.clipboard = tmp; |
---|
4276 | 4510 | } |
---|
4277 | 4511 | else |
---|
4278 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4512 | + if (Grafreed.clipboardIsTempGroup) |
---|
4279 | 4513 | tGroup.add/*Child*/(child); |
---|
4280 | 4514 | else |
---|
4281 | | - GrafreeD.clipboard = child; |
---|
| 4515 | + Grafreed.clipboard = child; |
---|
4282 | 4516 | } |
---|
4283 | 4517 | |
---|
4284 | 4518 | //ResetModel(); |
---|
.. | .. |
---|
4310 | 4544 | //System.out.println("cut " + elem); |
---|
4311 | 4545 | //System.out.println("parent = " + elem.parent); |
---|
4312 | 4546 | // tmp.addChild(elem); |
---|
4313 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4547 | + if (Grafreed.clipboardIsTempGroup) |
---|
4314 | 4548 | tGroup.add/*Child*/(tmp); |
---|
4315 | 4549 | else |
---|
4316 | | - GrafreeD.clipboard = tmp; |
---|
| 4550 | + Grafreed.clipboard = tmp; |
---|
4317 | 4551 | } |
---|
4318 | 4552 | else |
---|
4319 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4553 | + if (Grafreed.clipboardIsTempGroup) |
---|
4320 | 4554 | tGroup.add/*Child*/(child); |
---|
4321 | 4555 | else |
---|
4322 | | - GrafreeD.clipboard = child; |
---|
| 4556 | + Grafreed.clipboard = child; |
---|
4323 | 4557 | } |
---|
4324 | 4558 | |
---|
4325 | 4559 | } |
---|
4326 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4327 | | - GrafreeD.clipboard = tGroup; |
---|
| 4560 | + |
---|
| 4561 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4562 | + Grafreed.clipboard = tGroup; |
---|
| 4563 | + |
---|
4328 | 4564 | if (cut) |
---|
4329 | 4565 | { |
---|
4330 | 4566 | ResetModel(); |
---|
.. | .. |
---|
4338 | 4574 | // return; |
---|
4339 | 4575 | boolean first = true; |
---|
4340 | 4576 | |
---|
4341 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4577 | + if (Grafreed.clipboardIsTempGroup) |
---|
4342 | 4578 | { |
---|
4343 | 4579 | Composite temp; |
---|
4344 | 4580 | |
---|
.. | .. |
---|
4349 | 4585 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4350 | 4586 | */ |
---|
4351 | 4587 | Object3D elem; |
---|
4352 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4588 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4353 | 4589 | { |
---|
4354 | 4590 | Object3D child = (Object3D)e.nextElement(); |
---|
4355 | 4591 | |
---|
.. | .. |
---|
4383 | 4619 | //Object3D cb = Applet3D.clipboard; |
---|
4384 | 4620 | //temp.addChild(cb); |
---|
4385 | 4621 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4386 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4387 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4388 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4389 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4390 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4622 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4623 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4624 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4625 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4626 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4391 | 4627 | else |
---|
4392 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4393 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4628 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4629 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4394 | 4630 | } |
---|
4395 | 4631 | |
---|
4396 | 4632 | ResetModel(); |
---|
4397 | 4633 | refreshContents(); |
---|
4398 | 4634 | } |
---|
4399 | 4635 | |
---|
4400 | | - void pasteInto(boolean copyit) |
---|
| 4636 | + void pasteInto(boolean copyit, boolean clone) |
---|
4401 | 4637 | { |
---|
4402 | 4638 | // if (GrafreeD.clipboard == null) |
---|
4403 | 4639 | // return; |
---|
.. | .. |
---|
4426 | 4662 | if (copyit) |
---|
4427 | 4663 | { |
---|
4428 | 4664 | // paste(false); |
---|
4429 | | - CloneClipboard(false); // sept 2014 |
---|
| 4665 | + if (clone) |
---|
| 4666 | + { |
---|
| 4667 | + CloneClipboard(false); // sept 2014 |
---|
| 4668 | + } |
---|
| 4669 | + else |
---|
| 4670 | + { |
---|
| 4671 | + paste(false); |
---|
| 4672 | + } |
---|
4430 | 4673 | } |
---|
4431 | 4674 | else |
---|
4432 | 4675 | { |
---|
4433 | 4676 | boolean first = true; |
---|
4434 | 4677 | |
---|
4435 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4678 | + if (Grafreed.clipboardIsTempGroup) |
---|
4436 | 4679 | { |
---|
4437 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4680 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4438 | 4681 | Object3D copy; |
---|
4439 | 4682 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4440 | 4683 | { |
---|
.. | .. |
---|
4444 | 4687 | } |
---|
4445 | 4688 | } else |
---|
4446 | 4689 | { |
---|
4447 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4690 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4448 | 4691 | } |
---|
4449 | 4692 | } |
---|
4450 | 4693 | } |
---|
.. | .. |
---|
4849 | 5092 | } |
---|
4850 | 5093 | */ |
---|
4851 | 5094 | |
---|
4852 | | - void ImportGFD() |
---|
4853 | | - { |
---|
4854 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4855 | | - browser.show(); |
---|
4856 | | - String filename = browser.getFile(); |
---|
4857 | | - if (filename != null && filename.length() > 0) |
---|
4858 | | - { |
---|
4859 | | - String fullname = browser.getDirectory() + filename; |
---|
4860 | | - |
---|
4861 | | - //Object3D readobj = |
---|
4862 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4863 | | - //makeSomething(readobj); |
---|
4864 | | - } |
---|
4865 | | - } |
---|
4866 | | - |
---|
4867 | 5095 | /* |
---|
4868 | 5096 | public void Callback(Object obj) |
---|
4869 | 5097 | { |
---|
.. | .. |
---|
4887 | 5115 | } |
---|
4888 | 5116 | */ |
---|
4889 | 5117 | |
---|
4890 | | - void ImportVRMLX3D() |
---|
4891 | | - { |
---|
4892 | | - if (GrafreeD.standAlone) |
---|
4893 | | - { |
---|
4894 | | - /**/ |
---|
4895 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4896 | | - browser.show(); |
---|
4897 | | - String filename = browser.getFile(); |
---|
4898 | | - if (filename != null && filename.length() > 0) |
---|
4899 | | - { |
---|
4900 | | - String fullname = browser.getDirectory() + filename; |
---|
4901 | | - LoadVRMLX3D(fullname); |
---|
4902 | | - } |
---|
4903 | | - /**/ |
---|
4904 | | - } |
---|
4905 | | - } |
---|
4906 | | - |
---|
4907 | 5118 | String GetFile(String dialogName) |
---|
4908 | 5119 | { |
---|
4909 | | - if (GrafreeD.standAlone) |
---|
| 5120 | + if (Grafreed.standAlone) |
---|
4910 | 5121 | { |
---|
4911 | 5122 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4912 | 5123 | browser.show(); |
---|
.. | .. |
---|
4970 | 5181 | cButton flashSelectionButton; |
---|
4971 | 5182 | cButton editButton; |
---|
4972 | 5183 | cButton uneditButton; |
---|
| 5184 | + JCheckBox allParamsButton; |
---|
4973 | 5185 | cButton clearpanelButton; |
---|
4974 | | - cButton allParamsButton; |
---|
4975 | 5186 | cButton unselectButton; |
---|
4976 | 5187 | |
---|
| 5188 | + cButton saveButton; |
---|
| 5189 | + cButton undoButton; |
---|
| 5190 | + cButton redoButton; |
---|
| 5191 | + cButton oneStepButton; |
---|
| 5192 | + |
---|
4977 | 5193 | cButton screenfitButton; |
---|
4978 | 5194 | cButton screenfitpointButton; |
---|
4979 | 5195 | cButton snapobjectButton; |
---|
.. | .. |
---|
5004 | 5220 | private MenuItem lookFromItem; |
---|
5005 | 5221 | private MenuItem switchItem; |
---|
5006 | 5222 | private MenuItem cutItem; |
---|
| 5223 | + private MenuItem undoItem; |
---|
| 5224 | + private MenuItem redoItem; |
---|
5007 | 5225 | private MenuItem duplicateItem; |
---|
5008 | 5226 | private MenuItem cloneItem; |
---|
5009 | 5227 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
5017 | 5235 | private MenuItem linkverticesItem; |
---|
5018 | 5236 | private MenuItem relinkverticesItem; |
---|
5019 | 5237 | private MenuItem setMasterItem; |
---|
5020 | | - private MenuItem resetMeshItem; |
---|
| 5238 | + private MenuItem resetAllItem; |
---|
5021 | 5239 | private MenuItem stepAllItem; |
---|
5022 | 5240 | private MenuItem revertMeshItem; |
---|
5023 | 5241 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5028 | 5246 | private MenuItem mergeGeometriesItem; |
---|
5029 | 5247 | private MenuItem copyItem; |
---|
5030 | 5248 | private MenuItem pasteItem; |
---|
| 5249 | + private MenuItem pasteIntoItem; |
---|
5031 | 5250 | private MenuItem pasteLinkItem; |
---|
5032 | 5251 | private MenuItem pasteCloneItem; |
---|
5033 | 5252 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5077 | 5296 | private MenuItem panoTexturesItem; |
---|
5078 | 5297 | |
---|
5079 | 5298 | private MenuItem resetCentroidItem; |
---|
5080 | | - private MenuItem transformgeometryItem; |
---|
| 5299 | + private MenuItem resetCentroidXZItem; |
---|
5081 | 5300 | private MenuItem resetTransformItem; |
---|
| 5301 | + private MenuItem transformGeometryItem; |
---|
| 5302 | + private MenuItem transformChildrenItem; |
---|
5082 | 5303 | private MenuItem hideItem; |
---|
5083 | 5304 | private MenuItem grabItem; |
---|
5084 | 5305 | private MenuItem backItem; |
---|
.. | .. |
---|
5125 | 5346 | private MenuItem blobItem; |
---|
5126 | 5347 | private MenuItem latheItem; |
---|
5127 | 5348 | private MenuItem bezierItem; |
---|
5128 | | - private MenuItem checkerItem; |
---|
| 5349 | + private MenuItem overlayItem; |
---|
5129 | 5350 | private MenuItem meshItem; |
---|
5130 | 5351 | // private MenuItem meshGroupItem; |
---|
5131 | 5352 | private MenuItem springItem; |
---|
.. | .. |
---|
5147 | 5368 | private MenuItem doubleItem; |
---|
5148 | 5369 | private MenuItem tripleItem; |
---|
5149 | 5370 | |
---|
5150 | | - private MenuItem importGFDItem; |
---|
5151 | | - private MenuItem importVRMLX3DItem; |
---|
5152 | | - private MenuItem import3DSItem; |
---|
5153 | | - private MenuItem importOBJItem; |
---|
5154 | | - |
---|
5155 | 5371 | private MenuItem computeAOItem; |
---|
5156 | 5372 | private MenuItem recompileItem; |
---|
5157 | 5373 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5161 | 5377 | private MenuItem analyzeItem; |
---|
5162 | 5378 | private MenuItem dumpItem; |
---|
5163 | 5379 | //boolean freezemodel = false; |
---|
| 5380 | + |
---|
| 5381 | + Menu cameraMenu; |
---|
| 5382 | + MenuItem editCameraItem; |
---|
| 5383 | + MenuItem revertCameraItem; |
---|
5164 | 5384 | } |
---|