.. | .. |
---|
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 | + |
---|
| 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 Viewpoint")); |
---|
| 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(Globals.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 Viewpoint")); |
---|
| 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); |
---|
222 | 319 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 320 | relinkverticesItem.addActionListener(this); |
---|
| 321 | + |
---|
| 322 | + if (Globals.ADVANCED) |
---|
| 323 | + { |
---|
224 | 324 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 325 | setMasterItem.addActionListener(this); |
---|
| 326 | + } |
---|
226 | 327 | |
---|
227 | 328 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | 329 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
233 | 334 | frontItem.addActionListener(this); |
---|
234 | 335 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | 336 | compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 337 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 338 | hideItem.addActionListener(this); |
---|
238 | 339 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 340 | ungroupItem.addActionListener(this); |
---|
240 | 341 | menu.add("-"); |
---|
241 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 342 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
242 | 343 | 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 | 344 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 345 | switchGeoItem.addActionListener(this); |
---|
249 | 346 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 347 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 348 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 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); |
---|
253 | 358 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 359 | scriptNodeItem.addActionListener(this); |
---|
255 | 360 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | 361 | cameraItem.addActionListener(this); |
---|
| 362 | + } |
---|
257 | 363 | |
---|
258 | 364 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | 365 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
262 | 368 | billboardItem.addActionListener(this); |
---|
263 | 369 | csgItem = menu.add(new MenuItem("CSG")); |
---|
264 | 370 | csgItem.addActionListener(this); |
---|
265 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 371 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
266 | 372 | shadowXItem.addActionListener(this); |
---|
267 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 373 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
268 | 374 | shadowYItem.addActionListener(this); |
---|
269 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 375 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
270 | 376 | shadowZItem.addActionListener(this); |
---|
| 377 | + if (Globals.ADVANCED) |
---|
| 378 | + { |
---|
| 379 | + menu.add("-"); |
---|
271 | 380 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 381 | linkerItem.addActionListener(this); |
---|
273 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
274 | | - templateItem.addActionListener(this); |
---|
275 | 382 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | 383 | attributeItem.addActionListener(this); |
---|
| 384 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 385 | + templateItem.addActionListener(this); |
---|
277 | 386 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 387 | pointflowItem.addActionListener(this); |
---|
| 388 | + } |
---|
279 | 389 | menu.add("-"); |
---|
280 | 390 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 391 | resetTransformItem.addActionListener(this); |
---|
282 | 392 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
283 | 393 | resetCentroidItem.addActionListener(this); |
---|
284 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
285 | | - transformgeometryItem.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); |
---|
286 | 400 | |
---|
287 | 401 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
288 | 402 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
293 | 407 | genNormalsCADItem.addActionListener(this); |
---|
294 | 408 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 409 | genNormalsMESHItem.addActionListener(this); |
---|
| 410 | + if (Globals.ADVANCED) |
---|
| 411 | + { |
---|
296 | 412 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
297 | 413 | genNormalsMINEItem.addActionListener(this); |
---|
| 414 | + } |
---|
298 | 415 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 416 | stripifyItem.addActionListener(this); |
---|
300 | 417 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 433 | reduce34MeshItem.addActionListener(this); |
---|
317 | 434 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 435 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 436 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 437 | clipMeshItem.addActionListener(this); |
---|
| 438 | + |
---|
| 439 | + if (Globals.ADVANCED) |
---|
| 440 | + { |
---|
| 441 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 442 | + smoothMeshItem.addActionListener(this); |
---|
| 443 | + } |
---|
323 | 444 | |
---|
324 | 445 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 446 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
326 | 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); |
---|
327 | 452 | menu.add("-"); |
---|
328 | 453 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
329 | 454 | liveleavesItem.addActionListener(this); |
---|
330 | 455 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 456 | unliveleavesItem.addActionListener(this); |
---|
| 457 | + if (Globals.ADVANCED) |
---|
| 458 | + { |
---|
332 | 459 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 460 | supportleavesItem.addActionListener(this); |
---|
334 | 461 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 462 | unsupportleavesItem.addActionListener(this); |
---|
| 463 | + } |
---|
336 | 464 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 465 | hideleavesItem.addActionListener(this); |
---|
338 | 466 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
341 | 469 | markleavesItem.addActionListener(this); |
---|
342 | 470 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
343 | 471 | unmarkleavesItem.addActionListener(this); |
---|
| 472 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 473 | + rewindleavesItem.addActionListener(this); |
---|
| 474 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 475 | + unrewindleavesItem.addActionListener(this); |
---|
| 476 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 477 | + randomleavesItem.addActionListener(this); |
---|
| 478 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 479 | + unrandomleavesItem.addActionListener(this); |
---|
344 | 480 | menu.add("-"); |
---|
345 | 481 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
346 | 482 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
376 | 512 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 513 | sortbynameItem.addActionListener(this); |
---|
378 | 514 | menu.add("-"); |
---|
| 515 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 516 | + shareGeometriesItem.addActionListener(this); |
---|
| 517 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 518 | + mergeGeometriesItem.addActionListener(this); |
---|
| 519 | + if (Globals.ADVANCED) |
---|
| 520 | + { |
---|
| 521 | + // Pretty much the same as duplicate and clone. |
---|
379 | 522 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 523 | extractGeometriesItem.addActionListener(this); |
---|
381 | 524 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
382 | 525 | 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); |
---|
| 526 | + } |
---|
387 | 527 | |
---|
388 | 528 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 529 | buildCreateMenu(menu); |
---|
390 | 530 | |
---|
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 | 531 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 532 | buildToolsMenu(menu); |
---|
404 | 533 | } |
---|
405 | 534 | |
---|
406 | 535 | void SetupUI2(ObjEditor oe) |
---|
407 | 536 | { |
---|
| 537 | + // June 2019 |
---|
| 538 | + if (oe == null) |
---|
| 539 | + { |
---|
| 540 | + //super.SetupUI2(this); |
---|
| 541 | + //return; |
---|
| 542 | + } |
---|
| 543 | + |
---|
| 544 | + if (copy != group) |
---|
| 545 | + { |
---|
| 546 | + //super.SetupUI2(this); |
---|
| 547 | + } |
---|
| 548 | + |
---|
408 | 549 | //new Exception().printStackTrace(); |
---|
409 | 550 | |
---|
410 | 551 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
433 | 574 | oe.radioPanel.add(dummyButton); |
---|
434 | 575 | oe.buttonGroup.add(dummyButton); |
---|
435 | 576 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
437 | | - oe.aConstraints.gridwidth = 1; |
---|
438 | | - oe.aConstraints.gridx = 0; |
---|
| 577 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
439 | 578 | |
---|
440 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 579 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 580 | + //minButton.setToolTipText("Minimize window"); |
---|
| 581 | + //minButton.addActionListener(this); |
---|
| 582 | + |
---|
| 583 | + oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 584 | + maxButton.setToolTipText("Maximize window"); |
---|
| 585 | + maxButton.addActionListener(this); |
---|
| 586 | + |
---|
| 587 | + oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 589 | + fullButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + undoButton.setToolTipText("Undo changes"); |
---|
| 593 | + undoButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + redoButton.setToolTipText("Redo changes"); |
---|
| 597 | + redoButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + saveButton.setToolTipText("Save changes"); |
---|
| 601 | + saveButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 604 | + liveCB.setToolTipText("Enable animation"); |
---|
441 | 605 | liveCB.addItemListener(this); |
---|
442 | 606 | |
---|
443 | | - oe.aConstraints.gridx += 1; |
---|
444 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
445 | | - supportCB.addItemListener(this); |
---|
446 | | - |
---|
447 | | - // oe.aConstraints.gridx += 1; |
---|
448 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
449 | | - // localCB.addItemListener(this); |
---|
450 | | - |
---|
451 | | - oe.aConstraints.gridx += 1; |
---|
452 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
453 | | - crowdCB.addItemListener(this); |
---|
454 | | - |
---|
455 | | - oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
457 | | - smoothCB.addItemListener(this); |
---|
458 | | - |
---|
459 | | - oe.aConstraints.gridx += 1; |
---|
460 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 609 | + oneStepButton.addActionListener(this); |
---|
| 610 | + |
---|
| 611 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 612 | + fastCB.setToolTipText("Fast mode"); |
---|
461 | 613 | fastCB.addItemListener(this); |
---|
462 | | - oe.aConstraints.gridx += 1; |
---|
463 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
464 | | - slowCB.addItemListener(this); |
---|
465 | | - oe.aConstraints.gridx += 1; |
---|
466 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
467 | | - boxCB.addItemListener(this); |
---|
468 | | - |
---|
469 | | -// oe.aConstraints.gridx += 1; |
---|
470 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
471 | | -// speakerMocapCB.addItemListener(this); |
---|
472 | | - |
---|
473 | | - if (false) |
---|
474 | | - { |
---|
475 | | - // handled in scripts |
---|
476 | | - oe.aConstraints.gridx += 1; |
---|
477 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
478 | | - speakerCameraCB.addItemListener(this); |
---|
479 | | - |
---|
480 | | - oe.aConstraints.gridx += 1; |
---|
481 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
482 | | - speakerFocusCB.addItemListener(this); |
---|
483 | | - |
---|
484 | | - oe.aConstraints.gridx += 1; |
---|
485 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
486 | | - smoothfocusCB.addItemListener(this); |
---|
487 | | - } |
---|
488 | | - |
---|
489 | | -//oe.aConstraints.gridx += 1; |
---|
490 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
491 | | -// debugCB.addItemListener(this); |
---|
492 | | - |
---|
493 | | - oe.aConstraints.gridx += 1; |
---|
494 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
495 | | - oeilCB.addItemListener(this); |
---|
496 | | - |
---|
497 | | - oe.aConstraints.gridx += 1; |
---|
498 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
499 | | - lookAtCB.addItemListener(this); |
---|
500 | | - |
---|
501 | | - oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
| 614 | + |
---|
| 615 | + oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 616 | + trackCB.setToolTipText("Enable tracking"); |
---|
503 | 617 | trackCB.addItemListener(this); |
---|
504 | 618 | |
---|
505 | | - oe.aConstraints.gridx += 1; |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 619 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + screenfitButton.setToolTipText("Screen fit"); |
---|
507 | 621 | screenfitButton.addActionListener(this); |
---|
508 | | - oe.aConstraints.gridx += 1; |
---|
| 622 | + |
---|
509 | 623 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
510 | 624 | // screenfitpointButton.addActionListener(this); |
---|
511 | | -// oe.aConstraints.gridx += 1; |
---|
512 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
513 | | - snapobjectButton.addActionListener(this); |
---|
514 | | - oe.aConstraints.gridx += 1; |
---|
515 | 625 | |
---|
516 | | - //aConstraints.gridx = 0; |
---|
517 | | - //aConstraints.gridy += 1; |
---|
518 | | - oe.aConstraints.weighty = 0; |
---|
519 | | - oe.aConstraints.gridwidth = 1; |
---|
520 | | - |
---|
521 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 626 | + if (Globals.ADVANCED) |
---|
| 627 | + { |
---|
| 628 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + snapobjectButton.addActionListener(this); |
---|
| 630 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 631 | + } |
---|
| 632 | + |
---|
| 633 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 634 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | 635 | flashSelectionButton.addActionListener(this); |
---|
523 | 636 | |
---|
524 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
| 637 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | 638 | |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - // |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 639 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 640 | + twoButton.setToolTipText("Show center view only"); |
---|
532 | 641 | twoButton.addActionListener(this); |
---|
533 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 642 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
534 | 643 | fourButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 644 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 645 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 646 | + sixButton.setToolTipText("2-column layout left"); |
---|
536 | 647 | sixButton.addActionListener(this); |
---|
537 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 648 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + threeButton.setToolTipText("2-column layout right"); |
---|
538 | 650 | threeButton.addActionListener(this); |
---|
539 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 651 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 652 | + sevenButton.setToolTipText("3-column layout"); |
---|
540 | 653 | sevenButton.addActionListener(this); |
---|
541 | 654 | // |
---|
542 | 655 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 656 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 657 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
544 | 658 | rootButton.addActionListener(this); |
---|
545 | | - oe.aConstraints.gridx += 1; |
---|
546 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 659 | + |
---|
| 660 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + closeButton.setToolTipText("Close tab"); |
---|
547 | 662 | closeButton.addActionListener(this); |
---|
548 | 663 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
549 | 664 | //clearButton.addActionListener(this); |
---|
550 | | - oe.aConstraints.gridx += 1; |
---|
551 | 665 | |
---|
552 | | - oe.aConstraints.gridx = 1; // |
---|
553 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 666 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 667 | + editButton.setToolTipText("Edit selection"); |
---|
554 | 668 | editButton.addActionListener(this); |
---|
555 | | - oe.aConstraints.gridx += 1; |
---|
556 | | - oe.aConstraints.weighty = 0; |
---|
557 | | - oe.aConstraints.gridwidth = 1; |
---|
558 | 669 | |
---|
559 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 670 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 671 | + uneditButton.setToolTipText("Unedit selection"); |
---|
560 | 672 | uneditButton.addActionListener(this); |
---|
561 | 673 | |
---|
562 | | - oe.aConstraints.gridx += 1; |
---|
563 | | - oe.aConstraints.weighty = 0; |
---|
564 | | - oe.aConstraints.gridwidth = 1; |
---|
565 | | - |
---|
566 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
567 | | - clearPanelButton.addActionListener(this); |
---|
568 | | - |
---|
569 | | - oe.aConstraints.gridx += 1; |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 1; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 674 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 675 | + allParamsButton.setToolTipText("Edit all params"); |
---|
574 | 676 | allParamsButton.addActionListener(this); |
---|
575 | 677 | |
---|
576 | | - oe.aConstraints.gridx += 1; |
---|
577 | | - oe.aConstraints.weighty = 0; |
---|
578 | | - oe.aConstraints.gridwidth = 1; |
---|
579 | | - |
---|
580 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 678 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 679 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 680 | + clearPanelButton.addActionListener(this); |
---|
| 681 | + |
---|
| 682 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 683 | + unselectButton.setToolTipText("Unselect"); |
---|
581 | 684 | unselectButton.addActionListener(this); |
---|
582 | 685 | |
---|
| 686 | + editCommandsPanel.preferredHeight = 1; |
---|
| 687 | + |
---|
| 688 | +// oe.treePanel.add(commandsPanel); |
---|
| 689 | +// oe.treePanel.Return(); |
---|
| 690 | + |
---|
583 | 691 | // oe.aConstraints.gridx += 1; |
---|
584 | 692 | // oe.aConstraints.weighty = 0; |
---|
585 | 693 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
591 | 699 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
592 | 700 | // gcButton.addActionListener(this); |
---|
593 | 701 | |
---|
594 | | - oe.aConstraints.gridx = 0; |
---|
595 | | - oe.aConstraints.gridy += 1; |
---|
596 | | - |
---|
597 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
598 | | - oe.aConstraints.gridwidth = 100; |
---|
599 | | - // oe.aConstraints.gridheight = 100; |
---|
600 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
601 | | - oe.aConstraints.gridheight = 1; |
---|
602 | | - oe.aConstraints.weighty = 0.5; |
---|
603 | | - oe.aConstraints.gridx = 0; |
---|
604 | | - JScrollPane jSP; |
---|
| 702 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 703 | + |
---|
| 704 | + JScrollPane jSP; |
---|
605 | 705 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
606 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 706 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
607 | 707 | ResetModel(); |
---|
608 | | - oe.aConstraints.weighty = 0.5; |
---|
609 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
610 | | - oe.aConstraints.gridy += 1; |
---|
611 | | - oe.aConstraints.gridwidth = 1; |
---|
| 708 | + |
---|
| 709 | + oe.treePanel.add(jSPPanel); |
---|
| 710 | + oe.treePanel.Return(); |
---|
612 | 711 | |
---|
613 | | - oe.aConstraints.weighty = 0; |
---|
614 | | - oe.aConstraints.gridwidth = 2; |
---|
615 | | - |
---|
616 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 712 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 713 | + |
---|
| 714 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 715 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
617 | 716 | colorCB.addItemListener(this); |
---|
618 | | - oe.aConstraints.gridx += 2; |
---|
619 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 717 | + |
---|
| 718 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 719 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
620 | 720 | materialCB.addItemListener(this); |
---|
621 | | - oe.aConstraints.gridx += 2; |
---|
622 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 721 | + |
---|
| 722 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 723 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
623 | 724 | textureCB.addItemListener(this); |
---|
624 | 725 | |
---|
625 | | - oe.aConstraints.gridx = 0; |
---|
626 | | - oe.aConstraints.gridy += 1; |
---|
| 726 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 727 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 728 | + oe.treePanel.Return(); |
---|
627 | 729 | |
---|
| 730 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 731 | +// mainPanel.setResizeWeight(0.5); |
---|
| 732 | + |
---|
628 | 733 | //jList.addListSelectionListener(this); |
---|
629 | 734 | oe.jTree.addTreeSelectionListener(this); |
---|
630 | 735 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
646 | 751 | radio.layout = sevenButton; |
---|
647 | 752 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
648 | 753 | } |
---|
| 754 | + |
---|
| 755 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 756 | + { |
---|
| 757 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 758 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 759 | + boxCB.addItemListener(this); |
---|
| 760 | + |
---|
| 761 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 762 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 763 | + zoomBoxCB.addItemListener(this); |
---|
| 764 | + |
---|
| 765 | + if (true) // Globals.ADVANCED) |
---|
| 766 | + { |
---|
| 767 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 768 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 769 | + supportCB.addItemListener(this); |
---|
| 770 | + |
---|
| 771 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 772 | + // localCB.addItemListener(this); |
---|
| 773 | + |
---|
| 774 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 775 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 776 | + crowdCB.addItemListener(this); |
---|
| 777 | + |
---|
| 778 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 779 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 780 | + smoothCB.addItemListener(this); |
---|
| 781 | + |
---|
| 782 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 783 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 784 | + slowCB.addItemListener(this); |
---|
| 785 | + |
---|
| 786 | +// constraints.gridy += 1; |
---|
| 787 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 788 | +// speakerMocapCB.addItemListener(this); |
---|
| 789 | + |
---|
| 790 | + if (false) |
---|
| 791 | + { |
---|
| 792 | + // handled in scripts |
---|
| 793 | + //constraints.gridy += 1; |
---|
| 794 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 795 | + speakerCameraCB.addItemListener(this); |
---|
| 796 | + |
---|
| 797 | + //constraints.gridy += 1; |
---|
| 798 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 799 | + speakerFocusCB.addItemListener(this); |
---|
| 800 | + |
---|
| 801 | + //constraints.gridy += 1; |
---|
| 802 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 803 | + smoothfocusCB.addItemListener(this); |
---|
| 804 | + } |
---|
| 805 | + |
---|
| 806 | +//constraints.gridx += 1; |
---|
| 807 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 808 | +// debugCB.addItemListener(this); |
---|
| 809 | + |
---|
| 810 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 811 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 812 | + oeilCB.addItemListener(this); |
---|
| 813 | + |
---|
| 814 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 815 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 816 | + shadowCB.addItemListener(this); |
---|
| 817 | + |
---|
| 818 | + if (Globals.ADVANCED) |
---|
| 819 | + { |
---|
| 820 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 821 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 822 | + lookAtCB.addItemListener(this); |
---|
| 823 | + } |
---|
| 824 | + |
---|
| 825 | + } |
---|
| 826 | + |
---|
| 827 | + cGridBag fill = new cGridBag(); |
---|
| 828 | + |
---|
| 829 | + fill.preferredHeight = 200; |
---|
| 830 | + |
---|
| 831 | + panel.add(fill); |
---|
| 832 | + |
---|
| 833 | + } |
---|
649 | 834 | |
---|
650 | 835 | void EditObject(Object3D obj) |
---|
651 | 836 | { |
---|
652 | 837 | cRadio radioButton = new cRadio(obj.name); |
---|
| 838 | + |
---|
| 839 | + // Patch to avoid bug with transparency. |
---|
| 840 | + radioButton.hadMaterial = obj.material != null; |
---|
| 841 | + if (!radioButton.hadMaterial) |
---|
| 842 | + { |
---|
| 843 | + obj.material = new cMaterial(); |
---|
| 844 | + } |
---|
| 845 | + |
---|
653 | 846 | radioButton.SetObject(obj); |
---|
654 | 847 | radioButton.layout = sevenButton; |
---|
655 | 848 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
658 | 851 | buttonGroup.add(radioButton); |
---|
659 | 852 | radioButton.doClick(); |
---|
660 | 853 | } |
---|
| 854 | + |
---|
661 | 855 | void SetupViews(ObjEditor oe) |
---|
662 | 856 | { |
---|
| 857 | + theFrame = this; |
---|
| 858 | + |
---|
663 | 859 | oe.SetupViews(); |
---|
664 | 860 | |
---|
665 | 861 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
676 | 872 | JCheckBox fastCB; |
---|
677 | 873 | JCheckBox slowCB; |
---|
678 | 874 | JCheckBox boxCB; |
---|
| 875 | + JCheckBox zoomBoxCB; |
---|
679 | 876 | JCheckBox trackCB; |
---|
680 | 877 | JCheckBox smoothfocusCB; |
---|
681 | 878 | // JCheckBox speakerMocapCB; |
---|
682 | 879 | JCheckBox speakerCameraCB; |
---|
683 | 880 | JCheckBox speakerFocusCB; |
---|
684 | 881 | JCheckBox debugCB; |
---|
| 882 | + |
---|
685 | 883 | JCheckBox oeilCB; |
---|
| 884 | + JCheckBox shadowCB; |
---|
686 | 885 | JCheckBox lookAtCB; |
---|
687 | 886 | |
---|
688 | 887 | // static int COLOR = 1; |
---|
.. | .. |
---|
721 | 920 | } else if(e.getSource() == liveCB) |
---|
722 | 921 | { |
---|
723 | 922 | cameraView.ToggleLive(); |
---|
| 923 | + refreshContents(false); |
---|
724 | 924 | } |
---|
725 | 925 | else if(e.getSource() == supportCB) |
---|
726 | 926 | { |
---|
.. | .. |
---|
756 | 956 | cameraView.repaint(); |
---|
757 | 957 | // refreshContents(); |
---|
758 | 958 | } |
---|
| 959 | + else if(e.getSource() == zoomBoxCB) |
---|
| 960 | + { |
---|
| 961 | + cameraView.ToggleZoomBoxMode(); |
---|
| 962 | + } |
---|
759 | 963 | else if(e.getSource() == smoothfocusCB) |
---|
760 | 964 | { |
---|
761 | 965 | cameraView.ToggleSmoothFocus(); |
---|
.. | .. |
---|
780 | 984 | else if(e.getSource() == oeilCB) |
---|
781 | 985 | { |
---|
782 | 986 | cameraView.ToggleOeil(); |
---|
| 987 | + } |
---|
| 988 | + else if(e.getSource() == shadowCB) |
---|
| 989 | + { |
---|
| 990 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
783 | 991 | } |
---|
784 | 992 | else if(e.getSource() == lookAtCB) |
---|
785 | 993 | { |
---|
.. | .. |
---|
869 | 1077 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
870 | 1078 | // return; |
---|
871 | 1079 | // } |
---|
872 | | - if (string.charAt(0) == '/') |
---|
| 1080 | + |
---|
| 1081 | + // File path for Mac and Windows |
---|
| 1082 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
873 | 1083 | { |
---|
874 | 1084 | // file(s) |
---|
875 | 1085 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
896 | 1106 | |
---|
897 | 1107 | flashIt = false; |
---|
898 | 1108 | CameraPane pane = (CameraPane) target; |
---|
899 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1109 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
900 | 1110 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
901 | 1111 | |
---|
902 | 1112 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
923 | 1133 | { |
---|
924 | 1134 | loadClipboard(true); |
---|
925 | 1135 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
926 | | - pasteInto(false); |
---|
| 1136 | + pasteInto(false, false); |
---|
927 | 1137 | } else { |
---|
928 | 1138 | loadClipboard(false); |
---|
929 | 1139 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
930 | | - pasteInto(false); // true); // ??? |
---|
| 1140 | + pasteInto(false, false); // true); // ??? |
---|
931 | 1141 | } |
---|
932 | 1142 | } |
---|
933 | 1143 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1049 | 1259 | kleinItem.addActionListener(this); |
---|
1050 | 1260 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1051 | 1261 | particleItem.addActionListener(this); |
---|
| 1262 | + if (Globals.ADVANCED) |
---|
| 1263 | + { |
---|
1052 | 1264 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1053 | 1265 | ragdollItem.addActionListener(this); |
---|
1054 | 1266 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1055 | 1267 | ragdoll2Item.addActionListener(this); |
---|
| 1268 | + } |
---|
1056 | 1269 | menu.add("-"); |
---|
1057 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1270 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1058 | 1271 | meshItem.addActionListener(this); |
---|
1059 | 1272 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1060 | 1273 | // meshGroupItem.addActionListener(this); |
---|
| 1274 | + if (Globals.ADVANCED) |
---|
| 1275 | + { |
---|
1061 | 1276 | springItem = menu.add(new MenuItem("Spring")); |
---|
1062 | 1277 | springItem.addActionListener(this); |
---|
1063 | 1278 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1064 | 1279 | flagItem.addActionListener(this); |
---|
1065 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1066 | | - bezierItem.addActionListener(this); |
---|
1067 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1068 | | - checkerItem.addActionListener(this); |
---|
1069 | 1280 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1070 | 1281 | blobItem.addActionListener(this); |
---|
1071 | 1282 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1072 | 1283 | latheItem.addActionListener(this); |
---|
| 1284 | + } |
---|
| 1285 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1286 | + bezierItem.addActionListener(this); |
---|
| 1287 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1288 | + overlayItem.addActionListener(this); |
---|
1073 | 1289 | lightItem = menu.add(new MenuItem("Light")); |
---|
1074 | 1290 | lightItem.addActionListener(this); |
---|
1075 | 1291 | menu.add("-"); |
---|
.. | .. |
---|
1079 | 1295 | loopItem.addActionListener(this); |
---|
1080 | 1296 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1081 | 1297 | doubleItem.addActionListener(this); |
---|
| 1298 | + if (Globals.ADVANCED) |
---|
| 1299 | + { |
---|
1082 | 1300 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1083 | 1301 | tripleItem.addActionListener(this); |
---|
| 1302 | + } |
---|
1084 | 1303 | } |
---|
1085 | 1304 | |
---|
1086 | 1305 | void buildToolsMenu(Menu menu) |
---|
1087 | 1306 | { |
---|
1088 | 1307 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1089 | 1308 | animationItem.addItemListener(this); |
---|
1090 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1309 | + animationItem.setState(Globals.ANIMATION); |
---|
1091 | 1310 | |
---|
1092 | 1311 | menu.add("-"); |
---|
1093 | 1312 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1094 | 1313 | parseverticesItem.addActionListener(this); |
---|
1095 | 1314 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1096 | 1315 | textureFieldItem.addActionListener(this); |
---|
1097 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1316 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1098 | 1317 | alignItem.addActionListener(this); |
---|
1099 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1100 | | - mirrorItem.addActionListener(this); |
---|
1101 | 1318 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1102 | 1319 | reduceMorphItem.addActionListener(this); |
---|
1103 | 1320 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1104 | 1321 | reduce34MorphItem.addActionListener(this); |
---|
1105 | | - |
---|
| 1322 | + menu.add("-"); |
---|
1106 | 1323 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1107 | 1324 | computeAOItem.addActionListener(this); |
---|
1108 | | - menu.add("-"); |
---|
1109 | 1325 | |
---|
| 1326 | + if (Globals.ADVANCED) |
---|
| 1327 | + { |
---|
| 1328 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1329 | + mirrorItem.addActionListener(this); |
---|
| 1330 | + menu.add("-"); |
---|
1110 | 1331 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1111 | 1332 | memoryItem.addActionListener(this); |
---|
1112 | 1333 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1113 | 1334 | analyzeItem.addActionListener(this); |
---|
1114 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1335 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1115 | 1336 | dumpItem.addActionListener(this); |
---|
1116 | 1337 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1117 | 1338 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1120 | 1341 | resetParentItem.addActionListener(this); |
---|
1121 | 1342 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1122 | 1343 | repairParentItem.addActionListener(this); |
---|
| 1344 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1345 | + repairShadowItem.addActionListener(this); |
---|
1123 | 1346 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1124 | 1347 | invariantsItem.addActionListener(this); |
---|
1125 | 1348 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1127 | 1350 | menu.add("-"); |
---|
1128 | 1351 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1129 | 1352 | editScriptItem.addActionListener(this); |
---|
| 1353 | + } |
---|
1130 | 1354 | } |
---|
1131 | 1355 | |
---|
1132 | 1356 | void ScreenFit() |
---|
.. | .. |
---|
1249 | 1473 | shadow.material = new cMaterial(obj.material); |
---|
1250 | 1474 | shadow.material.diffuse = 0.0001f; |
---|
1251 | 1475 | shadow.material.specular = 0.0001f; |
---|
| 1476 | + //shadow.projectedVertices[1].x = 300; |
---|
1252 | 1477 | |
---|
1253 | 1478 | makeSomething(shadow); |
---|
1254 | 1479 | } |
---|
.. | .. |
---|
1455 | 1680 | |
---|
1456 | 1681 | void Overwrite(int mask) |
---|
1457 | 1682 | { |
---|
1458 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1683 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1459 | 1684 | { |
---|
1460 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1685 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1461 | 1686 | |
---|
1462 | 1687 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1463 | 1688 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1480 | 1705 | // |
---|
1481 | 1706 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1482 | 1707 | { |
---|
| 1708 | + Object source = event.getSource(); |
---|
1483 | 1709 | /* |
---|
1484 | 1710 | if (event.getSource() == nameField) |
---|
1485 | 1711 | { |
---|
.. | .. |
---|
1491 | 1717 | } |
---|
1492 | 1718 | else |
---|
1493 | 1719 | */ |
---|
1494 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1720 | + if (source == lookAtItem || source == lookFromItem) |
---|
1495 | 1721 | { |
---|
1496 | 1722 | ScreenFit(); |
---|
1497 | 1723 | } else |
---|
1498 | | - if (event.getSource() == switchItem) |
---|
| 1724 | + if (source == switchItem) |
---|
1499 | 1725 | { |
---|
1500 | 1726 | cVector v1 = new cVector(); |
---|
1501 | 1727 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1504 | 1730 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1505 | 1731 | objEditor.cameraView.repaint(); |
---|
1506 | 1732 | } else |
---|
1507 | | - if (event.getSource() == rectoidItem) |
---|
| 1733 | + if (source == rectoidItem) |
---|
1508 | 1734 | { |
---|
1509 | 1735 | makeSomething(new Box()); |
---|
1510 | 1736 | } else |
---|
1511 | | - if (event.getSource() == particleItem) |
---|
| 1737 | + if (source == particleItem) |
---|
1512 | 1738 | { |
---|
1513 | 1739 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1514 | 1740 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1529 | 1755 | applyExample(particleGeom, "SMOKE"); |
---|
1530 | 1756 | makeSomething(particleGeom); |
---|
1531 | 1757 | } else |
---|
1532 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1758 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1533 | 1759 | { |
---|
1534 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1760 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1535 | 1761 | |
---|
1536 | 1762 | ragdoll.toParent = LA.newMatrix(); |
---|
1537 | 1763 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1549 | 1775 | } else |
---|
1550 | 1776 | /* |
---|
1551 | 1777 | */ |
---|
1552 | | - if (event.getSource() == heightFieldItem) |
---|
| 1778 | + if (source == heightFieldItem) |
---|
1553 | 1779 | { |
---|
1554 | 1780 | Object3D obj = new Object3D(); |
---|
1555 | 1781 | |
---|
.. | .. |
---|
1587 | 1813 | |
---|
1588 | 1814 | makeSomething(obj); |
---|
1589 | 1815 | } else |
---|
1590 | | - if (event.getSource() == gridItem) |
---|
| 1816 | + if (source == gridItem) |
---|
1591 | 1817 | { |
---|
1592 | 1818 | makeSomething(new Grid()); |
---|
1593 | 1819 | } else |
---|
1594 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1820 | + if (source == ellipsoidItem) |
---|
1595 | 1821 | { |
---|
1596 | 1822 | makeSomething(new Sphere()); |
---|
1597 | 1823 | } else |
---|
1598 | | - if (event.getSource() == coneItem) |
---|
| 1824 | + if (source == coneItem) |
---|
1599 | 1825 | { |
---|
1600 | 1826 | makeSomething(new Cone()); |
---|
1601 | 1827 | } else |
---|
1602 | | - if (event.getSource() == torusItem) |
---|
| 1828 | + if (source == torusItem) |
---|
1603 | 1829 | { |
---|
1604 | 1830 | makeSomething(new Torus()); |
---|
1605 | 1831 | } else |
---|
1606 | | - if (event.getSource() == superItem) |
---|
| 1832 | + if (source == superItem) |
---|
1607 | 1833 | { |
---|
1608 | 1834 | makeSomething(new Superellipsoid()); |
---|
1609 | 1835 | } else |
---|
1610 | | - if (event.getSource() == kleinItem) |
---|
| 1836 | + if (source == kleinItem) |
---|
1611 | 1837 | { |
---|
1612 | 1838 | makeSomething(new Klein()); |
---|
1613 | 1839 | } else |
---|
1614 | | - if (event.getSource() == blobItem) |
---|
| 1840 | + if (source == blobItem) |
---|
1615 | 1841 | { |
---|
1616 | 1842 | Blob blob = new Blob(); |
---|
1617 | 1843 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1619 | 1845 | //blob.retile(); |
---|
1620 | 1846 | makeSomething(blob); |
---|
1621 | 1847 | } else |
---|
1622 | | - if (event.getSource() == latheItem) |
---|
| 1848 | + if (source == latheItem) |
---|
1623 | 1849 | { |
---|
1624 | 1850 | makeSomething(new Lathe()); |
---|
1625 | 1851 | } else |
---|
1626 | | - if (event.getSource() == bezierItem) |
---|
| 1852 | + if (source == bezierItem) |
---|
1627 | 1853 | { |
---|
1628 | 1854 | makeSomething(new BezierSurface()); |
---|
1629 | 1855 | } else |
---|
1630 | | - if (event.getSource() == checkerItem) |
---|
| 1856 | + if (source == overlayItem) |
---|
1631 | 1857 | { |
---|
1632 | 1858 | /* |
---|
1633 | 1859 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1642 | 1868 | */ |
---|
1643 | 1869 | makeSomething(new Checker()); |
---|
1644 | 1870 | } else |
---|
1645 | | - if (event.getSource() == meshItem) |
---|
| 1871 | + if (source == meshItem) |
---|
1646 | 1872 | { |
---|
1647 | 1873 | Object3D itemtomake = new Object3D(); |
---|
1648 | 1874 | Object3D child; |
---|
.. | .. |
---|
1663 | 1889 | makeSomething(child); |
---|
1664 | 1890 | } |
---|
1665 | 1891 | } else |
---|
1666 | | - if (event.getSource() == springItem) |
---|
| 1892 | + if (source == springItem) |
---|
1667 | 1893 | { |
---|
1668 | 1894 | cSpring s = new cSpring(); |
---|
1669 | 1895 | s.setup(); |
---|
1670 | 1896 | makeSomething(s); |
---|
1671 | 1897 | } else |
---|
1672 | | - if (event.getSource() == flagItem) |
---|
| 1898 | + if (source == flagItem) |
---|
1673 | 1899 | { |
---|
1674 | 1900 | cSpring s = new cFlag(); |
---|
1675 | 1901 | s.setup(); |
---|
1676 | 1902 | makeSomething(s); |
---|
1677 | 1903 | } else |
---|
1678 | | - if (event.getSource() == lightItem) |
---|
| 1904 | + if (source == lightItem) |
---|
1679 | 1905 | { |
---|
1680 | 1906 | makeSomething(new Light()); |
---|
1681 | 1907 | } else |
---|
1682 | | - if (event.getSource() == csgItem) |
---|
| 1908 | + if (source == csgItem) |
---|
1683 | 1909 | { |
---|
1684 | 1910 | group(new CSG()); |
---|
1685 | 1911 | } else |
---|
1686 | | - if (event.getSource() == templateItem) |
---|
| 1912 | + if (source == templateItem) |
---|
1687 | 1913 | { |
---|
1688 | 1914 | group(new cTemplate()); |
---|
1689 | 1915 | } else |
---|
1690 | | - if (event.getSource() == attributeItem) |
---|
| 1916 | + if (source == attributeItem) |
---|
1691 | 1917 | { |
---|
1692 | 1918 | makeSomething(new Attribute()); |
---|
1693 | 1919 | } else |
---|
1694 | | - if (event.getSource() == pointflowItem) |
---|
| 1920 | + if (source == pointflowItem) |
---|
1695 | 1921 | { |
---|
1696 | 1922 | makeSomething(new PointFlow()); |
---|
1697 | 1923 | } else |
---|
.. | .. |
---|
1703 | 1929 | } else |
---|
1704 | 1930 | */ |
---|
1705 | 1931 | |
---|
1706 | | - if (event.getSource() == superLoopItem) |
---|
| 1932 | + if (source == superLoopItem) |
---|
1707 | 1933 | { |
---|
1708 | 1934 | Composite g = new cGroup(); |
---|
1709 | 1935 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1725 | 1951 | |
---|
1726 | 1952 | group(g); |
---|
1727 | 1953 | } else |
---|
1728 | | - if (event.getSource() == loopItem) |
---|
| 1954 | + if (source == loopItem) |
---|
1729 | 1955 | { |
---|
1730 | 1956 | Composite csg = new GroupLeaf(); |
---|
1731 | 1957 | csg.count = 5; |
---|
.. | .. |
---|
1734 | 1960 | csg.addChild(child); |
---|
1735 | 1961 | child.addChild(csg); |
---|
1736 | 1962 | } else |
---|
1737 | | - if (event.getSource() == doubleItem) |
---|
| 1963 | + if (source == doubleItem) |
---|
1738 | 1964 | { |
---|
1739 | 1965 | Composite csg = new GroupLeaf(); |
---|
1740 | 1966 | csg.count = 5; |
---|
.. | .. |
---|
1746 | 1972 | csg.addChild(child); |
---|
1747 | 1973 | child.addChild(csg); |
---|
1748 | 1974 | } else |
---|
1749 | | - if (event.getSource() == tripleItem) |
---|
| 1975 | + if (source == tripleItem) |
---|
1750 | 1976 | { |
---|
1751 | 1977 | Composite csg = new GroupLeaf(); |
---|
1752 | 1978 | csg.count = 4; |
---|
.. | .. |
---|
1761 | 1987 | csg.addChild(child); |
---|
1762 | 1988 | child.addChild(csg); |
---|
1763 | 1989 | } else |
---|
1764 | | - |
---|
1765 | | - if (event.getSource() == importGFDItem) |
---|
| 1990 | + if (source == computeAOItem) |
---|
1766 | 1991 | { |
---|
1767 | | - ImportGFD(); |
---|
| 1992 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1993 | + Globals.theRenderer.repaint(); |
---|
1768 | 1994 | } else |
---|
1769 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1770 | | - { |
---|
1771 | | - ImportVRMLX3D(); |
---|
1772 | | - } else |
---|
1773 | | - if (event.getSource() == import3DSItem) |
---|
1774 | | - { |
---|
1775 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1776 | | - } else |
---|
1777 | | - if (event.getSource() == importOBJItem) |
---|
1778 | | - { |
---|
1779 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1780 | | - } else |
---|
1781 | | - if (event.getSource() == computeAOItem) |
---|
1782 | | - { |
---|
1783 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1784 | | - CameraPane.theRenderer.repaint(); |
---|
1785 | | - } else |
---|
1786 | | - if (event.getSource() == recompileItem) |
---|
| 1995 | + if (source == recompileItem) |
---|
1787 | 1996 | { |
---|
1788 | 1997 | Recompile(); |
---|
1789 | 1998 | refreshContents(); |
---|
1790 | 1999 | } else |
---|
1791 | | - if (event.getSource() == editScriptItem) |
---|
| 2000 | + if (source == editScriptItem) |
---|
1792 | 2001 | { |
---|
1793 | 2002 | OpenDialog(); |
---|
1794 | 2003 | refreshContents(); |
---|
1795 | 2004 | } else |
---|
1796 | | - if (event.getSource() == invariantsItem) |
---|
| 2005 | + if (source == invariantsItem) |
---|
1797 | 2006 | { |
---|
1798 | 2007 | System.out.println("Invariants:"); |
---|
1799 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2008 | + Grafreed.grafreeD.universe.invariants(); |
---|
1800 | 2009 | } else |
---|
1801 | | - if (event.getSource() == memoryItem) |
---|
| 2010 | + if (source == memoryItem) |
---|
1802 | 2011 | { |
---|
1803 | 2012 | //System.out.println("Invariants:"); |
---|
1804 | 2013 | PrintMemory(); |
---|
1805 | 2014 | } else |
---|
1806 | | - if (event.getSource() == pathItem) |
---|
| 2015 | + if (source == pathItem) |
---|
1807 | 2016 | { |
---|
1808 | 2017 | PrintPath(); |
---|
1809 | 2018 | } else |
---|
1810 | | - if (event.getSource() == analyzeItem) |
---|
| 2019 | + if (source == analyzeItem) |
---|
1811 | 2020 | { |
---|
1812 | 2021 | AnalyzeObject(); |
---|
1813 | 2022 | } else |
---|
1814 | | - if (event.getSource() == dumpItem) |
---|
| 2023 | + if (source == dumpItem) |
---|
1815 | 2024 | { |
---|
1816 | 2025 | DumpObject(); |
---|
1817 | 2026 | } else |
---|
1818 | | - if (event.getSource() == screenfitButton) |
---|
| 2027 | + if (source == minButton) |
---|
| 2028 | + { |
---|
| 2029 | + Minimize(); |
---|
| 2030 | + } else |
---|
| 2031 | + if (source == maxButton) |
---|
| 2032 | + { |
---|
| 2033 | + Maximize(); |
---|
| 2034 | + } else |
---|
| 2035 | + if (source == fullButton) |
---|
| 2036 | + { |
---|
| 2037 | + ToggleFullScreen(); |
---|
| 2038 | + } else |
---|
| 2039 | + if (source == undoButton) |
---|
| 2040 | + { |
---|
| 2041 | + Undo(); |
---|
| 2042 | + } else |
---|
| 2043 | + if (source == redoButton) |
---|
| 2044 | + { |
---|
| 2045 | + Redo(); |
---|
| 2046 | + } else |
---|
| 2047 | + if (source == saveButton) |
---|
| 2048 | + { |
---|
| 2049 | + Save(); |
---|
| 2050 | + } else |
---|
| 2051 | + if (source == oneStepButton) |
---|
| 2052 | + { |
---|
| 2053 | + Globals.ONESTEP = true; |
---|
| 2054 | + cameraView.repaint(); |
---|
| 2055 | + } else |
---|
| 2056 | + if (source == screenfitButton) |
---|
1819 | 2057 | { |
---|
1820 | 2058 | //Reload(lastConverter, lastFilename, true); |
---|
1821 | 2059 | ScreenFit(); |
---|
1822 | 2060 | } else |
---|
1823 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2061 | + if (source == screenfitpointButton) |
---|
1824 | 2062 | { |
---|
1825 | 2063 | //Reload(lastConverter, lastFilename, true); |
---|
1826 | 2064 | ScreenFitPoint(); |
---|
1827 | 2065 | } else |
---|
1828 | | - if (event.getSource() == snapobjectButton) |
---|
| 2066 | + if (source == snapobjectButton) |
---|
1829 | 2067 | { |
---|
1830 | 2068 | //Reload(lastConverter, lastFilename, true); |
---|
1831 | 2069 | SnapObject(); |
---|
.. | .. |
---|
1836 | 2074 | // Recompile(); |
---|
1837 | 2075 | // refreshContents(); |
---|
1838 | 2076 | // } else |
---|
1839 | | - if (event.getSource() == gcButton) |
---|
| 2077 | + if (source == gcButton) |
---|
1840 | 2078 | { |
---|
1841 | 2079 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1842 | 2080 | System.gc(); |
---|
1843 | 2081 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1844 | 2082 | } else |
---|
1845 | | - if (event.getSource() == editLeafItem) |
---|
| 2083 | + if (source == editLeafItem) |
---|
1846 | 2084 | { |
---|
1847 | 2085 | Object3D obj; |
---|
1848 | 2086 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1856 | 2094 | } |
---|
1857 | 2095 | refreshContents(true); |
---|
1858 | 2096 | } else |
---|
1859 | | - if (event.getSource() == openWindowItem) |
---|
| 2097 | + if (source == openWindowItem) |
---|
1860 | 2098 | { |
---|
1861 | 2099 | EditSelection(true); |
---|
1862 | 2100 | } else |
---|
1863 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2101 | + if (source == cutItem || source == clearButton) |
---|
1864 | 2102 | { |
---|
1865 | 2103 | loadClipboard(true); |
---|
1866 | 2104 | } else |
---|
1867 | | - if (event.getSource() == duplicateItem) |
---|
| 2105 | + if (source == undoItem) |
---|
1868 | 2106 | { |
---|
1869 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2107 | + Undo(); |
---|
| 2108 | + } else |
---|
| 2109 | + if (source == redoItem) |
---|
| 2110 | + { |
---|
| 2111 | + Redo(); |
---|
| 2112 | + } else |
---|
| 2113 | + if (source == duplicateItem) |
---|
| 2114 | + { |
---|
| 2115 | + Object3D keep = Grafreed.clipboard; |
---|
1870 | 2116 | loadClipboard(false); |
---|
1871 | 2117 | paste(false); |
---|
1872 | | - GrafreeD.clipboard = keep; |
---|
| 2118 | + Grafreed.clipboard = keep; |
---|
1873 | 2119 | } else |
---|
1874 | | - if (event.getSource() == cloneItem) |
---|
| 2120 | + if (source == cloneItem) |
---|
1875 | 2121 | { |
---|
1876 | 2122 | CloneSelection(false); |
---|
1877 | 2123 | } else |
---|
1878 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2124 | + if (source == cloneSupportItem) |
---|
1879 | 2125 | { |
---|
1880 | 2126 | CloneSelection(true); |
---|
1881 | 2127 | } else |
---|
1882 | | - if (event.getSource() == copyItem) |
---|
| 2128 | + if (source == copyItem) |
---|
1883 | 2129 | { |
---|
1884 | 2130 | loadClipboard(false); |
---|
1885 | 2131 | } else |
---|
1886 | | - if (event.getSource() == pasteItem) |
---|
| 2132 | + if (source == pasteItem) |
---|
1887 | 2133 | { |
---|
1888 | 2134 | paste(false); |
---|
1889 | 2135 | } else |
---|
1890 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2136 | + if (source == pasteIntoItem) |
---|
1891 | 2137 | { |
---|
1892 | | - pasteInto(false); |
---|
| 2138 | + pasteInto(true, false); |
---|
1893 | 2139 | } else |
---|
1894 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2140 | + if (source == pasteLinkItem) |
---|
1895 | 2141 | { |
---|
1896 | | - pasteInto(true); |
---|
| 2142 | + pasteInto(false, false); |
---|
1897 | 2143 | } else |
---|
1898 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2144 | + if (source == pasteCloneItem) |
---|
| 2145 | + { |
---|
| 2146 | + pasteInto(true, true); |
---|
| 2147 | + } else |
---|
| 2148 | + if (source == pasteExpandItem) |
---|
1899 | 2149 | { |
---|
1900 | 2150 | paste(true); |
---|
1901 | 2151 | } else |
---|
1902 | | - if (event.getSource() == synchronizeItem) |
---|
| 2152 | + if (source == synchronizeItem) |
---|
1903 | 2153 | { |
---|
1904 | 2154 | Overwrite(Object3D.TRANSFORM); |
---|
1905 | 2155 | } else |
---|
1906 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2156 | + if (source == overwriteNameItem) |
---|
1907 | 2157 | { |
---|
1908 | 2158 | Overwrite(Object3D.NAME); |
---|
1909 | 2159 | } else |
---|
1910 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2160 | + if (source == overwriteUVItem) |
---|
1911 | 2161 | { |
---|
1912 | 2162 | Overwrite(Object3D.UV); |
---|
1913 | 2163 | } else |
---|
1914 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2164 | + if (source == overwriteMatItem) |
---|
1915 | 2165 | { |
---|
1916 | 2166 | /* july 2015 |
---|
1917 | 2167 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1931 | 2181 | |
---|
1932 | 2182 | Overwrite(dropAttributes); |
---|
1933 | 2183 | } |
---|
1934 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2184 | + if (source == overwriteGeoItem) |
---|
1935 | 2185 | { |
---|
1936 | 2186 | Overwrite(Object3D.GEOMETRY); |
---|
1937 | 2187 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1948 | 2198 | // refreshContents(); |
---|
1949 | 2199 | // } |
---|
1950 | 2200 | } else |
---|
1951 | | - if (event.getSource() == generateMeshItem) |
---|
| 2201 | + if (source == generateMeshItem) |
---|
1952 | 2202 | { |
---|
1953 | 2203 | //if (group.selection.size() == 1) |
---|
1954 | 2204 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1959 | 2209 | ResetModel(); |
---|
1960 | 2210 | refreshContents(); |
---|
1961 | 2211 | } else |
---|
1962 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2212 | + if (source == extractGeometriesItem) |
---|
1963 | 2213 | { |
---|
1964 | 2214 | boolean one = false; |
---|
1965 | 2215 | |
---|
.. | .. |
---|
1986 | 2236 | ResetModel(); |
---|
1987 | 2237 | refreshContents(); |
---|
1988 | 2238 | } else |
---|
1989 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2239 | + if (source == cloneGeometriesItem) |
---|
1990 | 2240 | { |
---|
1991 | 2241 | boolean one = false; |
---|
1992 | 2242 | |
---|
.. | .. |
---|
2012 | 2262 | ResetModel(); |
---|
2013 | 2263 | refreshContents(); |
---|
2014 | 2264 | } else |
---|
2015 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2265 | + if (source == shareGeometriesItem) |
---|
2016 | 2266 | { |
---|
2017 | 2267 | boolean one = false; |
---|
2018 | 2268 | |
---|
.. | .. |
---|
2042 | 2292 | refreshContents(); |
---|
2043 | 2293 | } |
---|
2044 | 2294 | } else |
---|
2045 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2295 | + if (source == mergeGeometriesItem) |
---|
2046 | 2296 | { |
---|
2047 | 2297 | boolean one = false; |
---|
2048 | 2298 | |
---|
.. | .. |
---|
2072 | 2322 | ResetModel(); |
---|
2073 | 2323 | refreshContents(); |
---|
2074 | 2324 | } else |
---|
2075 | | - if (event.getSource() == linkverticesItem) |
---|
| 2325 | + if (source == linkverticesItem) |
---|
2076 | 2326 | { |
---|
2077 | 2327 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2078 | 2328 | // { |
---|
.. | .. |
---|
2085 | 2335 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2086 | 2336 | // refreshContents(); |
---|
2087 | 2337 | // } |
---|
2088 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2338 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2089 | 2339 | { |
---|
2090 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2340 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2091 | 2341 | |
---|
2092 | 2342 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2093 | 2343 | content = ((cGroup)content).get(0); |
---|
2094 | 2344 | |
---|
2095 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2345 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2096 | 2346 | for (int i=0; i<group.selection.size(); i++) |
---|
2097 | 2347 | { |
---|
2098 | | - boolean random = CameraPane.RANDOM; |
---|
2099 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2348 | + boolean random = CameraPane.SWITCH; |
---|
| 2349 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2100 | 2350 | group.selection.get(i).linkVerticesThis(content); |
---|
2101 | 2351 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2102 | | - CameraPane.RANDOM = random; |
---|
| 2352 | + CameraPane.SWITCH = random; |
---|
2103 | 2353 | } |
---|
2104 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2354 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2105 | 2355 | refreshContents(); |
---|
2106 | 2356 | } |
---|
2107 | 2357 | } else |
---|
2108 | | - if (event.getSource() == resetsupportItem) |
---|
| 2358 | + if (source == resetsupportItem) |
---|
2109 | 2359 | { |
---|
2110 | 2360 | for (int i=0; i<group.selection.size(); i++) |
---|
2111 | 2361 | { |
---|
2112 | | - boolean random = CameraPane.RANDOM; |
---|
2113 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2362 | + boolean random = CameraPane.SWITCH; |
---|
| 2363 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2114 | 2364 | group.selection.get(i).linkVerticesThis(null); |
---|
2115 | | - CameraPane.RANDOM = random; |
---|
| 2365 | + CameraPane.SWITCH = random; |
---|
2116 | 2366 | } |
---|
2117 | 2367 | |
---|
2118 | 2368 | refreshContents(); |
---|
2119 | 2369 | } else |
---|
2120 | | - if (event.getSource() == relinkverticesItem) |
---|
| 2370 | + if (source == relinkverticesItem) |
---|
2121 | 2371 | { |
---|
2122 | | - boolean random = CameraPane.RANDOM; |
---|
2123 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2372 | + boolean random = CameraPane.SWITCH; |
---|
| 2373 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2124 | 2374 | group.selection.RelinkToSupport(); |
---|
2125 | | - CameraPane.RANDOM = random; |
---|
| 2375 | + CameraPane.SWITCH = random; |
---|
2126 | 2376 | |
---|
2127 | 2377 | refreshContents(); |
---|
2128 | 2378 | } else |
---|
2129 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2379 | + if (source == resetreferencesItem) |
---|
2130 | 2380 | { |
---|
2131 | 2381 | for (int i=0; i<group.selection.size(); i++) |
---|
2132 | 2382 | { |
---|
.. | .. |
---|
2135 | 2385 | |
---|
2136 | 2386 | refreshContents(); |
---|
2137 | 2387 | } else |
---|
2138 | | - if (event.getSource() == setMasterItem) |
---|
| 2388 | + if (source == setMasterItem) |
---|
2139 | 2389 | { |
---|
2140 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2390 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2141 | 2391 | { |
---|
2142 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2392 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2143 | 2393 | |
---|
2144 | 2394 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2145 | 2395 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2148 | 2398 | refreshContents(); |
---|
2149 | 2399 | } |
---|
2150 | 2400 | } else |
---|
2151 | | - if (event.getSource() == poseMeshItem) |
---|
| 2401 | + if (source == poseMeshItem) |
---|
2152 | 2402 | { |
---|
2153 | 2403 | if (group.selection.size() == 1) |
---|
2154 | 2404 | { |
---|
2155 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2405 | + if (Grafreed.clipboard.size() == 1) |
---|
2156 | 2406 | { |
---|
2157 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2407 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2158 | 2408 | |
---|
2159 | 2409 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2160 | 2410 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2167 | 2417 | } |
---|
2168 | 2418 | |
---|
2169 | 2419 | } else |
---|
2170 | | - if (event.getSource() == revertMeshItem) |
---|
| 2420 | + if (source == revertMeshItem) |
---|
2171 | 2421 | { |
---|
2172 | 2422 | RevertMeshes(); |
---|
2173 | 2423 | } else |
---|
2174 | | - if (event.getSource() == resetMeshItem) |
---|
| 2424 | + if (source == resetAllItem) |
---|
2175 | 2425 | { |
---|
2176 | 2426 | ResetAll(); |
---|
2177 | 2427 | } else |
---|
2178 | | - if (event.getSource() == stepAllItem) |
---|
| 2428 | + if (source == stepAllItem) |
---|
2179 | 2429 | { |
---|
2180 | 2430 | StepAll(); |
---|
2181 | 2431 | } else |
---|
2182 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2432 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2183 | 2433 | { |
---|
2184 | 2434 | //int indices[] = jList.getSelectedIndices(); |
---|
2185 | 2435 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2187 | 2437 | |
---|
2188 | 2438 | ClearSelection(false); |
---|
2189 | 2439 | } else |
---|
2190 | | - if (event.getSource() == clearAllItem) |
---|
| 2440 | + if (source == clearAllItem) |
---|
2191 | 2441 | { |
---|
2192 | 2442 | ClearSelection(true); |
---|
2193 | 2443 | } else |
---|
2194 | | - if (event.getSource() == grabItem) |
---|
| 2444 | + if (source == grabItem) |
---|
2195 | 2445 | { |
---|
2196 | 2446 | group(new cGroup(), true); |
---|
2197 | 2447 | } else |
---|
2198 | | - if (event.getSource() == hideItem) |
---|
| 2448 | + if (source == hideItem) |
---|
2199 | 2449 | { |
---|
2200 | 2450 | group(new HiddenObject()); |
---|
2201 | 2451 | } else |
---|
2202 | | - if (event.getSource() == frontItem) |
---|
| 2452 | + if (source == frontItem) |
---|
2203 | 2453 | { |
---|
2204 | 2454 | front(); |
---|
2205 | 2455 | } else |
---|
2206 | | - if (event.getSource() == backItem) |
---|
| 2456 | + if (source == backItem) |
---|
2207 | 2457 | { |
---|
2208 | 2458 | back(); |
---|
2209 | 2459 | } else |
---|
2210 | | - if (event.getSource() == cameraItem) |
---|
| 2460 | + if (source == cameraItem) |
---|
2211 | 2461 | { |
---|
2212 | 2462 | makeSomething(new Camera()); |
---|
2213 | 2463 | } else |
---|
2214 | | - if (event.getSource() == compositeItem) |
---|
| 2464 | + if (source == compositeItem) |
---|
2215 | 2465 | { |
---|
2216 | 2466 | group(new Composite()); |
---|
2217 | 2467 | } else |
---|
2218 | | - if (event.getSource() == randomItem) |
---|
| 2468 | + if (source == randomItem) |
---|
2219 | 2469 | { |
---|
2220 | 2470 | RandomNode random = new RandomNode(); |
---|
2221 | 2471 | group(random); |
---|
2222 | 2472 | if (random.size() > 0) |
---|
2223 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2473 | + random.name = random.get(0).name + "Switch"; |
---|
2224 | 2474 | } else |
---|
2225 | | - if (event.getSource() == physicsItem) |
---|
| 2475 | + if (source == physicsItem) |
---|
2226 | 2476 | { |
---|
2227 | 2477 | group(new PhysicsNode()); |
---|
2228 | 2478 | } else |
---|
2229 | | - if (event.getSource() == frameselectorItem) |
---|
| 2479 | + if (source == frameselectorItem) |
---|
2230 | 2480 | { |
---|
2231 | 2481 | for (int i=0; i<group.selection.size(); i++) |
---|
2232 | 2482 | { |
---|
.. | .. |
---|
2238 | 2488 | ResetModel(); |
---|
2239 | 2489 | refreshContents(); |
---|
2240 | 2490 | } else |
---|
2241 | | - if (event.getSource() == switchGeoItem) |
---|
| 2491 | + if (source == switchGeoItem) |
---|
2242 | 2492 | { |
---|
2243 | 2493 | for (int i=0; i<group.selection.size(); i++) |
---|
2244 | 2494 | { |
---|
.. | .. |
---|
2250 | 2500 | ResetModel(); |
---|
2251 | 2501 | refreshContents(); |
---|
2252 | 2502 | } else |
---|
2253 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2503 | + if (source == switchTransfoItem) |
---|
2254 | 2504 | { |
---|
2255 | 2505 | for (int i=0; i<group.selection.size(); i++) |
---|
2256 | 2506 | { |
---|
.. | .. |
---|
2262 | 2512 | ResetModel(); |
---|
2263 | 2513 | refreshContents(); |
---|
2264 | 2514 | } else |
---|
2265 | | - if (event.getSource() == morphItem) |
---|
| 2515 | + if (source == morphItem) |
---|
2266 | 2516 | { |
---|
2267 | 2517 | for (int i=0; i<group.selection.size(); i++) |
---|
2268 | 2518 | { |
---|
.. | .. |
---|
2274 | 2524 | ResetModel(); |
---|
2275 | 2525 | refreshContents(); |
---|
2276 | 2526 | } else |
---|
2277 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2527 | + if (source == scriptNodeItem) |
---|
2278 | 2528 | { |
---|
2279 | 2529 | boolean atleastone = false; |
---|
2280 | 2530 | |
---|
.. | .. |
---|
2313 | 2563 | } |
---|
2314 | 2564 | } |
---|
2315 | 2565 | } else |
---|
2316 | | - if (event.getSource() == linkerItem) |
---|
| 2566 | + if (source == linkerItem) |
---|
2317 | 2567 | { |
---|
2318 | 2568 | group(new cLinker()); |
---|
2319 | 2569 | } else |
---|
2320 | | - if (event.getSource() == textureItem) |
---|
| 2570 | + if (source == textureItem) |
---|
2321 | 2571 | { |
---|
2322 | 2572 | group(new TextureNode()); |
---|
2323 | 2573 | } else |
---|
2324 | | - if (event.getSource() == billboardItem) |
---|
| 2574 | + if (source == billboardItem) |
---|
2325 | 2575 | { |
---|
2326 | 2576 | group(new BillboardNode()); |
---|
2327 | 2577 | } else |
---|
2328 | | - if (event.getSource() == shadowXItem) |
---|
| 2578 | + if (source == shadowXItem) |
---|
2329 | 2579 | { |
---|
2330 | 2580 | CastShadow(0); |
---|
2331 | 2581 | } else |
---|
2332 | | - if (event.getSource() == shadowYItem) |
---|
| 2582 | + if (source == shadowYItem) |
---|
2333 | 2583 | { |
---|
2334 | 2584 | CastShadow(1); |
---|
2335 | 2585 | } else |
---|
2336 | | - if (event.getSource() == shadowZItem) |
---|
| 2586 | + if (source == shadowZItem) |
---|
2337 | 2587 | { |
---|
2338 | 2588 | CastShadow(2); |
---|
2339 | 2589 | } else |
---|
2340 | | - if (event.getSource() == ungroupItem) |
---|
| 2590 | + if (source == ungroupItem) |
---|
2341 | 2591 | { |
---|
2342 | 2592 | //ungroup(); |
---|
2343 | 2593 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2349 | 2599 | |
---|
2350 | 2600 | refreshContents(); |
---|
2351 | 2601 | } else |
---|
2352 | | - if (event.getSource() == genUVItem) |
---|
| 2602 | + if (source == genUVItem) |
---|
2353 | 2603 | { |
---|
2354 | 2604 | GenUV(); |
---|
2355 | 2605 | } else |
---|
2356 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2606 | + if (source == genNormalsCADItem) |
---|
2357 | 2607 | { |
---|
2358 | 2608 | GenNormals(true); |
---|
2359 | 2609 | } else |
---|
2360 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 2610 | + if (source == genNormalsMESHItem) |
---|
2361 | 2611 | { |
---|
2362 | | - GenNormals(true); // TODO |
---|
| 2612 | + GenNormalsMESH(); |
---|
2363 | 2613 | } else |
---|
2364 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2614 | + if (source == genNormalsORGANItem) |
---|
2365 | 2615 | { |
---|
2366 | 2616 | GenNormals(false); |
---|
2367 | 2617 | } else |
---|
2368 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 2618 | + if (source == genNormalsMINEItem) |
---|
2369 | 2619 | { |
---|
2370 | 2620 | GenNormalsMINE(); |
---|
2371 | 2621 | } else |
---|
2372 | | - if (event.getSource() == stripifyItem) |
---|
| 2622 | + if (source == stripifyItem) |
---|
2373 | 2623 | { |
---|
2374 | 2624 | Stripify(); |
---|
2375 | 2625 | } else |
---|
2376 | | - if (event.getSource() == unstripifyItem) |
---|
| 2626 | + if (source == unstripifyItem) |
---|
2377 | 2627 | { |
---|
2378 | 2628 | Unstripify(); |
---|
2379 | 2629 | } else |
---|
2380 | | - if (event.getSource() == trimItem) |
---|
| 2630 | + if (source == trimItem) |
---|
2381 | 2631 | { |
---|
2382 | 2632 | Trim(); |
---|
2383 | 2633 | } else |
---|
2384 | | - if (event.getSource() == untrimItem) |
---|
| 2634 | + if (source == untrimItem) |
---|
2385 | 2635 | { |
---|
2386 | 2636 | Untrim(); |
---|
2387 | 2637 | } else |
---|
2388 | | - if (event.getSource() == clearColorsItem) |
---|
| 2638 | + if (source == clearColorsItem) |
---|
2389 | 2639 | { |
---|
2390 | 2640 | ClearColors(); |
---|
2391 | 2641 | } else |
---|
2392 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2642 | + if (source == clearMaterialsItem) |
---|
2393 | 2643 | { |
---|
2394 | 2644 | ClearMaterials(); |
---|
2395 | 2645 | } else |
---|
2396 | | - if (event.getSource() == liveleavesItem) |
---|
| 2646 | + if (source == liveleavesItem) |
---|
2397 | 2647 | { |
---|
2398 | 2648 | LiveLeaves(true); |
---|
2399 | 2649 | } else |
---|
2400 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2650 | + if (source == unliveleavesItem) |
---|
2401 | 2651 | { |
---|
2402 | 2652 | LiveLeaves(false); |
---|
2403 | 2653 | } else |
---|
2404 | | - if (event.getSource() == supportleavesItem) |
---|
| 2654 | + if (source == supportleavesItem) |
---|
2405 | 2655 | { |
---|
2406 | 2656 | SupportLeaves(true); |
---|
2407 | 2657 | } else |
---|
2408 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2658 | + if (source == unsupportleavesItem) |
---|
2409 | 2659 | { |
---|
2410 | 2660 | SupportLeaves(false); |
---|
2411 | 2661 | } else |
---|
2412 | | - if (event.getSource() == hideleavesItem) |
---|
| 2662 | + if (source == hideleavesItem) |
---|
2413 | 2663 | { |
---|
2414 | 2664 | HideLeaves(true); |
---|
2415 | 2665 | } else |
---|
2416 | | - if (event.getSource() == showleavesItem) |
---|
| 2666 | + if (source == showleavesItem) |
---|
2417 | 2667 | { |
---|
2418 | 2668 | HideLeaves(false); |
---|
2419 | 2669 | } else |
---|
2420 | | - if (event.getSource() == markleavesItem) |
---|
| 2670 | + if (source == markleavesItem) |
---|
2421 | 2671 | { |
---|
2422 | 2672 | MarkLeaves(true); |
---|
2423 | 2673 | } else |
---|
2424 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2674 | + if (source == unmarkleavesItem) |
---|
2425 | 2675 | { |
---|
2426 | 2676 | MarkLeaves(false); |
---|
2427 | 2677 | } else |
---|
2428 | | - if (event.getSource() == flipVItem) |
---|
| 2678 | + if (source == rewindleavesItem) |
---|
| 2679 | + { |
---|
| 2680 | + RewindLeaves(true); |
---|
| 2681 | + } else |
---|
| 2682 | + if (source == unrewindleavesItem) |
---|
| 2683 | + { |
---|
| 2684 | + RewindLeaves(false); |
---|
| 2685 | + } else |
---|
| 2686 | + if (source == randomleavesItem) |
---|
| 2687 | + { |
---|
| 2688 | + RandomLeaves(true); |
---|
| 2689 | + } else |
---|
| 2690 | + if (source == unrandomleavesItem) |
---|
| 2691 | + { |
---|
| 2692 | + RandomLeaves(false); |
---|
| 2693 | + } else |
---|
| 2694 | + if (source == flipVItem) |
---|
2429 | 2695 | { |
---|
2430 | 2696 | FlipV(true); |
---|
2431 | 2697 | } else |
---|
2432 | | - if (event.getSource() == unflipVItem) |
---|
| 2698 | + if (source == unflipVItem) |
---|
2433 | 2699 | { |
---|
2434 | 2700 | FlipV(false); |
---|
2435 | 2701 | } else |
---|
2436 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2702 | + if (source == lowTexturesItem) |
---|
2437 | 2703 | { |
---|
2438 | 2704 | SetTexRes(0); |
---|
2439 | 2705 | } else |
---|
2440 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2706 | + if (source == normalTexturesItem) |
---|
2441 | 2707 | { |
---|
2442 | 2708 | SetTexRes(1); |
---|
2443 | 2709 | } else |
---|
2444 | | - if (event.getSource() == highTexturesItem) |
---|
| 2710 | + if (source == highTexturesItem) |
---|
2445 | 2711 | { |
---|
2446 | 2712 | SetTexRes(2); |
---|
2447 | 2713 | } else |
---|
2448 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2714 | + if (source == veryhighTexturesItem) |
---|
2449 | 2715 | { |
---|
2450 | 2716 | SetTexRes(3); |
---|
2451 | 2717 | } else |
---|
2452 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2718 | + if (source == maxTexturesItem) |
---|
2453 | 2719 | { |
---|
2454 | 2720 | SetTexRes(4); |
---|
2455 | 2721 | } else |
---|
2456 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2722 | + if (source == panoTexturesItem) |
---|
2457 | 2723 | { |
---|
2458 | 2724 | SetTexRes(5); |
---|
2459 | 2725 | } else |
---|
2460 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2726 | + if (source == reverseNormalsItem) |
---|
2461 | 2727 | { |
---|
2462 | 2728 | ReverseNormals(); |
---|
2463 | 2729 | } else |
---|
2464 | | - if (event.getSource() == parseverticesItem) |
---|
| 2730 | + if (source == parseverticesItem) |
---|
2465 | 2731 | { |
---|
2466 | 2732 | ParseVertices(); |
---|
2467 | 2733 | } else |
---|
2468 | | - if (event.getSource() == textureFieldItem) |
---|
| 2734 | + if (source == textureFieldItem) |
---|
2469 | 2735 | { |
---|
2470 | 2736 | TextureVertices(); |
---|
2471 | 2737 | } else |
---|
2472 | | - if (event.getSource() == alignItem) |
---|
| 2738 | + if (source == alignItem) |
---|
2473 | 2739 | { |
---|
2474 | 2740 | Align(); |
---|
2475 | 2741 | } else |
---|
2476 | | - if (event.getSource() == mirrorItem) |
---|
| 2742 | + if (source == mirrorItem) |
---|
2477 | 2743 | { |
---|
2478 | 2744 | MirrorPoses(); |
---|
2479 | 2745 | } else |
---|
2480 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2746 | + if (source == reduceMorphItem) |
---|
2481 | 2747 | { |
---|
2482 | 2748 | MeshReduction(false); |
---|
2483 | 2749 | } else |
---|
2484 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2750 | + if (source == reduce34MorphItem) |
---|
2485 | 2751 | { |
---|
2486 | 2752 | MeshReduction(true); |
---|
2487 | 2753 | } else |
---|
2488 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2754 | + if (source == reverseTrianglesItem) |
---|
2489 | 2755 | { |
---|
2490 | 2756 | ReverseTriangles(); |
---|
2491 | 2757 | } else |
---|
2492 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2758 | + if (source == reduceMeshItem) |
---|
2493 | 2759 | { |
---|
2494 | 2760 | ReduceMesh(false); |
---|
2495 | 2761 | } else |
---|
2496 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2762 | + if (source == reduce34MeshItem) |
---|
2497 | 2763 | { |
---|
2498 | 2764 | ReduceMesh(true); |
---|
2499 | 2765 | } else |
---|
2500 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2766 | + if (source == increaseMeshItem) |
---|
2501 | 2767 | { |
---|
2502 | 2768 | IncreaseMesh(); |
---|
2503 | 2769 | } else |
---|
2504 | | - if (event.getSource() == clipMeshItem) |
---|
| 2770 | + if (source == clipMeshItem) |
---|
2505 | 2771 | { |
---|
2506 | 2772 | ClipMesh(); |
---|
2507 | 2773 | } else |
---|
2508 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2774 | + if (source == smoothMeshItem) |
---|
2509 | 2775 | { |
---|
2510 | 2776 | SmoothMesh(); |
---|
2511 | 2777 | } else |
---|
2512 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2778 | + if (source == transformGeometryItem) |
---|
2513 | 2779 | { |
---|
2514 | 2780 | TransformGeometry(); |
---|
2515 | 2781 | } else |
---|
2516 | | - if (event.getSource() == resetTransformItem) |
---|
| 2782 | + if (source == transformChildrenItem) |
---|
| 2783 | + { |
---|
| 2784 | + TransformChildren(); |
---|
| 2785 | + } else |
---|
| 2786 | + if (source == resetTransformItem) |
---|
2517 | 2787 | { |
---|
2518 | 2788 | ResetTransform(); |
---|
2519 | 2789 | } else |
---|
2520 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2790 | + if (source == resetCentroidItem) |
---|
2521 | 2791 | { |
---|
2522 | | - ResetCentroid(); |
---|
| 2792 | + ResetCentroid(true); |
---|
2523 | 2793 | } else |
---|
2524 | | - if (event.getSource() == resetParentItem) |
---|
| 2794 | + if (source == resetCentroidXZItem) |
---|
| 2795 | + { |
---|
| 2796 | + ResetCentroid(false); |
---|
| 2797 | + } else |
---|
| 2798 | + if (source == resetParentItem) |
---|
2525 | 2799 | { |
---|
2526 | 2800 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2527 | 2801 | { |
---|
.. | .. |
---|
2531 | 2805 | |
---|
2532 | 2806 | refreshContents(); |
---|
2533 | 2807 | } else |
---|
2534 | | - if (event.getSource() == repairParentItem) |
---|
| 2808 | + if (source == repairParentItem) |
---|
2535 | 2809 | { |
---|
2536 | 2810 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2537 | 2811 | { |
---|
.. | .. |
---|
2545 | 2819 | |
---|
2546 | 2820 | refreshContents(); |
---|
2547 | 2821 | } else |
---|
2548 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2822 | + if (source == repairShadowItem) |
---|
| 2823 | + { |
---|
| 2824 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2825 | + { |
---|
| 2826 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2827 | + obj.RepairShadow(); |
---|
| 2828 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2829 | +// { |
---|
| 2830 | +// obj.get(i).parent = obj; |
---|
| 2831 | +// } |
---|
| 2832 | + } |
---|
| 2833 | + |
---|
| 2834 | + refreshContents(); |
---|
| 2835 | + } else |
---|
| 2836 | + if (source == sortbysizeItem) |
---|
2549 | 2837 | { |
---|
2550 | 2838 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2551 | 2839 | { |
---|
.. | .. |
---|
2557 | 2845 | ResetModel(); |
---|
2558 | 2846 | refreshContents(); |
---|
2559 | 2847 | } else |
---|
2560 | | - if (event.getSource() == sortbynameItem) |
---|
| 2848 | + if (source == sortbynameItem) |
---|
2561 | 2849 | { |
---|
2562 | 2850 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2563 | 2851 | { |
---|
.. | .. |
---|
2569 | 2857 | ResetModel(); |
---|
2570 | 2858 | refreshContents(); |
---|
2571 | 2859 | } else |
---|
2572 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2860 | + if (source == attachPigmentItem) |
---|
2573 | 2861 | { |
---|
2574 | 2862 | String texture = GetFile("Attach pigment"); |
---|
2575 | 2863 | Object3D obj; |
---|
.. | .. |
---|
2581 | 2869 | |
---|
2582 | 2870 | refreshContents(); |
---|
2583 | 2871 | } else |
---|
2584 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2872 | + if (source == detachPigmentItem) |
---|
2585 | 2873 | { |
---|
2586 | 2874 | Object3D obj; |
---|
2587 | 2875 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2592 | 2880 | |
---|
2593 | 2881 | refreshContents(); |
---|
2594 | 2882 | } else |
---|
2595 | | - if (event.getSource() == attachBumpItem) |
---|
| 2883 | + if (source == attachBumpItem) |
---|
2596 | 2884 | { |
---|
2597 | 2885 | String texture = GetFile("Attach bump"); |
---|
2598 | 2886 | Object3D obj; |
---|
.. | .. |
---|
2604 | 2892 | |
---|
2605 | 2893 | refreshContents(); |
---|
2606 | 2894 | } else |
---|
2607 | | - if (event.getSource() == detachBumpItem) |
---|
| 2895 | + if (source == detachBumpItem) |
---|
2608 | 2896 | { |
---|
2609 | 2897 | Object3D obj; |
---|
2610 | 2898 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2615 | 2903 | |
---|
2616 | 2904 | refreshContents(); |
---|
2617 | 2905 | } else |
---|
2618 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2906 | + if (source == pigmentBumpItem) |
---|
2619 | 2907 | { |
---|
2620 | 2908 | Object3D obj; |
---|
2621 | 2909 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2626 | 2914 | |
---|
2627 | 2915 | refreshContents(); |
---|
2628 | 2916 | } else |
---|
2629 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2917 | + if (source == flashSelectionButton) |
---|
2630 | 2918 | { |
---|
2631 | 2919 | CameraPane.flash = true; |
---|
2632 | 2920 | refreshContents(); |
---|
2633 | 2921 | } else |
---|
2634 | | - if (event.getSource() == oneButton) |
---|
| 2922 | + if (source == oneButton) |
---|
2635 | 2923 | { |
---|
2636 | 2924 | } else |
---|
2637 | | - if (event.getSource() == twoButton) |
---|
| 2925 | + if (source == twoButton) |
---|
2638 | 2926 | { |
---|
2639 | 2927 | radio.layout = twoButton; |
---|
2640 | 2928 | // bug |
---|
2641 | 2929 | //gridPanel.setDividerLocation(1.0); |
---|
2642 | 2930 | //bigPanel.setDividerLocation(0.0); |
---|
2643 | | - bigThree.remove(scenePanel); |
---|
2644 | | - bigThree.remove(centralPanel); |
---|
2645 | | - bigThree.remove(XYZPanel); |
---|
2646 | | - aWindowConstraints.gridx = 0; |
---|
2647 | | - aWindowConstraints.gridy = 0; |
---|
2648 | | - aWindowConstraints.gridwidth = 1; |
---|
2649 | | - // aConstraints.gridheight = 3; |
---|
2650 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2651 | | - aWindowConstraints.weightx = 0; |
---|
2652 | | - aWindowConstraints.weighty = 1; |
---|
2653 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2654 | | - aWindowConstraints.weightx = 1; |
---|
2655 | | - aWindowConstraints.gridwidth = 3; |
---|
2656 | | - // aConstraints.gridheight = 3; |
---|
2657 | | - aWindowConstraints.gridx = 1; |
---|
2658 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2659 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2660 | | - aWindowConstraints.weightx = 0; |
---|
2661 | | - aWindowConstraints.gridx = 4; |
---|
2662 | | - aWindowConstraints.gridwidth = 1; |
---|
2663 | | - // aConstraints.gridheight = 3; |
---|
2664 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2665 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2666 | | - bigThree.revalidate(); |
---|
| 2931 | +// bigThree.remove(scenePanel); |
---|
| 2932 | +// bigThree.remove(centralPanel); |
---|
| 2933 | +// bigThree.remove(XYZPanel); |
---|
| 2934 | +// aWindowConstraints.gridx = 0; |
---|
| 2935 | +// aWindowConstraints.gridy = 0; |
---|
| 2936 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2937 | +// // aConstraints.gridheight = 3; |
---|
| 2938 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2939 | +// aWindowConstraints.weightx = 0; |
---|
| 2940 | +// aWindowConstraints.weighty = 1; |
---|
| 2941 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2942 | +// aWindowConstraints.weightx = 1; |
---|
| 2943 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2944 | +// // aConstraints.gridheight = 3; |
---|
| 2945 | +// aWindowConstraints.gridx = 1; |
---|
| 2946 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2947 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2948 | +// aWindowConstraints.weightx = 0; |
---|
| 2949 | +// aWindowConstraints.gridx = 4; |
---|
| 2950 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2951 | +// // aConstraints.gridheight = 3; |
---|
| 2952 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2953 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2954 | +// scenePanel.setVisible(false); |
---|
| 2955 | +// centralPanel.setVisible(true); |
---|
| 2956 | +// XYZPanel.setVisible(false); |
---|
| 2957 | + bigThree.ClearUI(); |
---|
| 2958 | + bigThree.add(centralPanel); |
---|
| 2959 | + bigThree.FlushUI(); |
---|
| 2960 | + |
---|
| 2961 | + cameraView.requestFocusInWindow(); |
---|
| 2962 | + |
---|
| 2963 | +// refreshContents(true); |
---|
| 2964 | +// |
---|
| 2965 | +// try |
---|
| 2966 | +// { |
---|
| 2967 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2968 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2969 | +// bot.mouseMove(100, 100); |
---|
| 2970 | +// bot.mousePress(mask); |
---|
| 2971 | +// bot.mouseRelease(mask); |
---|
| 2972 | +// } |
---|
| 2973 | +// catch (Exception e) |
---|
| 2974 | +// { |
---|
| 2975 | +// |
---|
| 2976 | +// } |
---|
| 2977 | + |
---|
2667 | 2978 | } else |
---|
2668 | | - if (event.getSource() == threeButton) |
---|
| 2979 | + if (source == threeButton) |
---|
2669 | 2980 | { |
---|
2670 | 2981 | radio.layout = threeButton; |
---|
2671 | | - bigThree.remove(scenePanel); |
---|
2672 | | - bigThree.remove(centralPanel); |
---|
2673 | | - bigThree.remove(XYZPanel); |
---|
2674 | | - aWindowConstraints.gridx = 0; |
---|
2675 | | - aWindowConstraints.gridy = 0; |
---|
2676 | | - aWindowConstraints.gridwidth = 1; |
---|
2677 | | - // aConstraints.gridheight = 3; |
---|
2678 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2679 | | - aWindowConstraints.weightx = 0; |
---|
2680 | | - aWindowConstraints.weighty = 1; |
---|
2681 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2682 | | - aWindowConstraints.weightx = 1; |
---|
2683 | | - aWindowConstraints.gridwidth = 3; |
---|
2684 | | - // aConstraints.gridheight = 3; |
---|
2685 | | - aWindowConstraints.gridx = 1; |
---|
2686 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2687 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2688 | | - aWindowConstraints.weightx = 0; |
---|
2689 | | - aWindowConstraints.gridx = 4; |
---|
2690 | | - aWindowConstraints.gridwidth = 1; |
---|
2691 | | - // aConstraints.gridheight = 3; |
---|
2692 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2693 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2694 | | - bigThree.revalidate(); |
---|
| 2982 | + |
---|
| 2983 | +// bigThree.remove(scenePanel); |
---|
| 2984 | +// bigThree.remove(centralPanel); |
---|
| 2985 | +// bigThree.remove(XYZPanel); |
---|
| 2986 | +// aWindowConstraints.gridx = 0; |
---|
| 2987 | +// aWindowConstraints.gridy = 0; |
---|
| 2988 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2989 | +// // aConstraints.gridheight = 3; |
---|
| 2990 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2991 | +// aWindowConstraints.weightx = 0; |
---|
| 2992 | +// aWindowConstraints.weighty = 1; |
---|
| 2993 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2994 | +// aWindowConstraints.weightx = 1; |
---|
| 2995 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2996 | +// // aConstraints.gridheight = 3; |
---|
| 2997 | +// aWindowConstraints.gridx = 1; |
---|
| 2998 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2999 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3000 | +// aWindowConstraints.weightx = 0; |
---|
| 3001 | +// aWindowConstraints.gridx = 4; |
---|
| 3002 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3003 | +// // aConstraints.gridheight = 3; |
---|
| 3004 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3005 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3006 | +// bigThree.validate(); |
---|
| 3007 | +// scenePanel.setVisible(false); |
---|
| 3008 | +// centralPanel.setVisible(true); |
---|
| 3009 | +// XYZPanel.setVisible(true); |
---|
| 3010 | + bigThree.ClearUI(); |
---|
| 3011 | + bigThree.add(centralPanel); |
---|
| 3012 | + bigThree.add(XYZPanel); |
---|
| 3013 | + bigThree.FlushUI(); |
---|
| 3014 | + |
---|
| 3015 | + cameraView.requestFocusInWindow(); |
---|
2695 | 3016 | } else |
---|
2696 | | - if (event.getSource() == fourButton) |
---|
| 3017 | + if (source == fourButton) |
---|
2697 | 3018 | { |
---|
2698 | 3019 | radio.layout = fourButton; |
---|
2699 | | - bigThree.remove(scenePanel); |
---|
2700 | | - bigThree.remove(centralPanel); |
---|
2701 | | - bigThree.remove(XYZPanel); |
---|
2702 | | - aWindowConstraints.gridx = 0; |
---|
2703 | | - aWindowConstraints.gridy = 0; |
---|
2704 | | - aWindowConstraints.gridwidth = 1; |
---|
2705 | | - // aWindowConstraints.gridheight = 3; |
---|
2706 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2707 | | - aWindowConstraints.weightx = 1; |
---|
2708 | | - aWindowConstraints.weighty = 1; |
---|
2709 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2710 | | - aWindowConstraints.weightx = 1; |
---|
2711 | | - aWindowConstraints.gridwidth = 3; |
---|
2712 | | - // aConstraints.gridheight = 3; |
---|
2713 | | - aWindowConstraints.gridx = 1; |
---|
2714 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2715 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2716 | | - aWindowConstraints.weightx = 0; |
---|
2717 | | - aWindowConstraints.gridx = 4; |
---|
2718 | | - aWindowConstraints.gridwidth = 1; |
---|
2719 | | - // aWindowConstraints.gridheight = 3; |
---|
2720 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2721 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2722 | | - bigThree.revalidate(); |
---|
| 3020 | + |
---|
| 3021 | +// bigThree.remove(scenePanel); |
---|
| 3022 | +// bigThree.remove(centralPanel); |
---|
| 3023 | +// bigThree.remove(XYZPanel); |
---|
| 3024 | +// aWindowConstraints.gridx = 0; |
---|
| 3025 | +// aWindowConstraints.gridy = 0; |
---|
| 3026 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3027 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3028 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3029 | +// aWindowConstraints.weightx = 1; |
---|
| 3030 | +// aWindowConstraints.weighty = 1; |
---|
| 3031 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3032 | +// aWindowConstraints.weightx = 1; |
---|
| 3033 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3034 | +// // aConstraints.gridheight = 3; |
---|
| 3035 | +// aWindowConstraints.gridx = 1; |
---|
| 3036 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3037 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3038 | +// aWindowConstraints.weightx = 0; |
---|
| 3039 | +// aWindowConstraints.gridx = 4; |
---|
| 3040 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3041 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3042 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3043 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3044 | +// bigThree.validate(); |
---|
| 3045 | +// scenePanel.setVisible(true); |
---|
| 3046 | +// centralPanel.setVisible(false); |
---|
| 3047 | +// XYZPanel.setVisible(false); |
---|
| 3048 | + bigThree.ClearUI(); |
---|
| 3049 | + bigThree.add(scenePanel); |
---|
| 3050 | + bigThree.FlushUI(); |
---|
| 3051 | + |
---|
| 3052 | + cameraView.requestFocusInWindow(); |
---|
2723 | 3053 | } else |
---|
2724 | | - if (event.getSource() == sixButton) |
---|
| 3054 | + if (source == sixButton) |
---|
2725 | 3055 | { |
---|
2726 | 3056 | radio.layout = sixButton; |
---|
2727 | | - bigThree.remove(scenePanel); |
---|
2728 | | - bigThree.remove(centralPanel); |
---|
2729 | | - bigThree.remove(XYZPanel); |
---|
2730 | | - aWindowConstraints.gridx = 0; |
---|
2731 | | - aWindowConstraints.gridy = 0; |
---|
2732 | | - aWindowConstraints.gridwidth = 1; |
---|
2733 | | - // aConstraints.gridheight = 3; |
---|
2734 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2735 | | - aWindowConstraints.weightx = 0; |
---|
2736 | | - aWindowConstraints.weighty = 1; |
---|
2737 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2738 | | - aWindowConstraints.weightx = 1; |
---|
2739 | | - aWindowConstraints.gridwidth = 3; |
---|
2740 | | - // aWindowConstraints.gridheight = 3; |
---|
2741 | | - aWindowConstraints.gridx = 1; |
---|
2742 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2743 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2744 | | - aWindowConstraints.weightx = 0; |
---|
2745 | | - aWindowConstraints.gridx = 4; |
---|
2746 | | - aWindowConstraints.gridwidth = 1; |
---|
2747 | | - // aWindowConstraints.gridheight = 3; |
---|
2748 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2749 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2750 | | - bigThree.revalidate(); |
---|
| 3057 | + |
---|
| 3058 | +// bigThree.remove(scenePanel); |
---|
| 3059 | +// bigThree.remove(centralPanel); |
---|
| 3060 | +// bigThree.remove(XYZPanel); |
---|
| 3061 | +// aWindowConstraints.gridx = 0; |
---|
| 3062 | +// aWindowConstraints.gridy = 0; |
---|
| 3063 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3064 | +// // aConstraints.gridheight = 3; |
---|
| 3065 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3066 | +// aWindowConstraints.weightx = 0; |
---|
| 3067 | +// aWindowConstraints.weighty = 1; |
---|
| 3068 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3069 | +// aWindowConstraints.weightx = 1; |
---|
| 3070 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3071 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3072 | +// aWindowConstraints.gridx = 1; |
---|
| 3073 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3074 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3075 | +// aWindowConstraints.weightx = 0; |
---|
| 3076 | +// aWindowConstraints.gridx = 4; |
---|
| 3077 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3078 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3079 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3080 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3081 | +// bigThree.validate(); |
---|
| 3082 | +// scenePanel.setVisible(true); |
---|
| 3083 | +// centralPanel.setVisible(true); |
---|
| 3084 | +// XYZPanel.setVisible(false); |
---|
| 3085 | + bigThree.ClearUI(); |
---|
| 3086 | + bigThree.add(scenePanel); |
---|
| 3087 | + bigThree.add(centralPanel); |
---|
| 3088 | + bigThree.FlushUI(); |
---|
| 3089 | + |
---|
| 3090 | + cameraView.requestFocusInWindow(); |
---|
2751 | 3091 | } else |
---|
2752 | | - if (event.getSource() == sevenButton) |
---|
| 3092 | + if (source == sevenButton) |
---|
2753 | 3093 | { |
---|
2754 | 3094 | radio.layout = sevenButton; |
---|
2755 | | - bigThree.remove(scenePanel); |
---|
2756 | | - bigThree.remove(centralPanel); |
---|
2757 | | - bigThree.remove(XYZPanel); |
---|
2758 | | - aWindowConstraints.gridx = 0; |
---|
2759 | | - aWindowConstraints.gridy = 0; |
---|
2760 | | - aWindowConstraints.gridwidth = 1; |
---|
2761 | | - // aWindowConstraints.gridheight = 3; |
---|
2762 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2763 | | - aWindowConstraints.weightx = 0; |
---|
2764 | | - aWindowConstraints.weighty = 1; |
---|
2765 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2766 | | - aWindowConstraints.weightx = 1; |
---|
2767 | | - aWindowConstraints.gridwidth = 3; |
---|
2768 | | - // aWindowConstraints.gridheight = 3; |
---|
2769 | | - aWindowConstraints.gridx = 1; |
---|
2770 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2771 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2772 | | - aWindowConstraints.weightx = 0; |
---|
2773 | | - aWindowConstraints.gridx = 4; |
---|
2774 | | - aWindowConstraints.gridwidth = 1; |
---|
2775 | | - // aConstraints.gridheight = 3; |
---|
2776 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2777 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2778 | | - bigThree.revalidate(); |
---|
| 3095 | + |
---|
| 3096 | +// bigThree.remove(scenePanel); |
---|
| 3097 | +// bigThree.remove(centralPanel); |
---|
| 3098 | +// bigThree.remove(XYZPanel); |
---|
| 3099 | +// aWindowConstraints.gridx = 0; |
---|
| 3100 | +// aWindowConstraints.gridy = 0; |
---|
| 3101 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3102 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3103 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3104 | +// aWindowConstraints.weightx = 0; |
---|
| 3105 | +// aWindowConstraints.weighty = 1; |
---|
| 3106 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3107 | +// aWindowConstraints.weightx = 1; |
---|
| 3108 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3109 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3110 | +// aWindowConstraints.gridx = 1; |
---|
| 3111 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3112 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3113 | +// aWindowConstraints.weightx = 0; |
---|
| 3114 | +// aWindowConstraints.gridx = 4; |
---|
| 3115 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3116 | +// // aConstraints.gridheight = 3; |
---|
| 3117 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3118 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3119 | +// bigThree.validate(); |
---|
| 3120 | +// scenePanel.setVisible(true); |
---|
| 3121 | +// centralPanel.setVisible(true); |
---|
| 3122 | +// XYZPanel.setVisible(true); |
---|
| 3123 | + bigThree.ClearUI(); |
---|
| 3124 | + bigThree.add(scenePanel); |
---|
| 3125 | + bigThree.add(centralPanel); |
---|
| 3126 | + bigThree.add(XYZPanel); |
---|
| 3127 | + bigThree.FlushUI(); |
---|
| 3128 | + |
---|
| 3129 | + cameraView.requestFocusInWindow(); |
---|
2779 | 3130 | } else |
---|
2780 | | - if (event.getSource() == rootButton) |
---|
| 3131 | + if (source == rootButton) |
---|
2781 | 3132 | { |
---|
2782 | 3133 | Object3D obj; |
---|
2783 | 3134 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2787 | 3138 | EditObject(obj); |
---|
2788 | 3139 | } |
---|
2789 | 3140 | |
---|
| 3141 | + cameraView.requestFocusInWindow(); |
---|
2790 | 3142 | refreshContents(true); |
---|
2791 | 3143 | } else |
---|
2792 | | - if (event.getSource() == closeButton) |
---|
| 3144 | + if (source == closeButton) |
---|
2793 | 3145 | { |
---|
2794 | 3146 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2795 | 3147 | cRadio ab; |
---|
2796 | 3148 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2797 | 3149 | { |
---|
2798 | 3150 | ab = (cRadio)e.nextElement(); |
---|
2799 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3151 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2800 | 3152 | { |
---|
| 3153 | + // Patch to avoid bug with transparency. |
---|
| 3154 | + if (!ab.hadMaterial) |
---|
| 3155 | + { |
---|
| 3156 | + ab.object.material = null; |
---|
| 3157 | + } |
---|
| 3158 | + |
---|
2801 | 3159 | buttonGroup.remove(ab); |
---|
2802 | 3160 | radioPanel.remove(ab); |
---|
2803 | 3161 | |
---|
.. | .. |
---|
2808 | 3166 | break; |
---|
2809 | 3167 | } |
---|
2810 | 3168 | } |
---|
| 3169 | + |
---|
| 3170 | + cameraView.requestFocusInWindow(); |
---|
2811 | 3171 | refreshContents(true); |
---|
2812 | 3172 | } else |
---|
2813 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3173 | + if (source == editItem || source == editButton) |
---|
2814 | 3174 | { |
---|
2815 | 3175 | EditSelection(false); |
---|
2816 | 3176 | } else |
---|
2817 | | - if (event.getSource() == uneditButton) |
---|
| 3177 | + if (source == uneditButton) |
---|
2818 | 3178 | { |
---|
2819 | 3179 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2820 | 3180 | { |
---|
.. | .. |
---|
2824 | 3184 | child.CloseUI(); |
---|
2825 | 3185 | listUI.remove(child); |
---|
2826 | 3186 | |
---|
2827 | | - child.editWindow = null; // ??????????? |
---|
| 3187 | + //child.editWindow = null; // ??????????? |
---|
2828 | 3188 | } |
---|
2829 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3189 | + objEditor.ctrlPanel.FlushUI(); |
---|
2830 | 3190 | //objEditor.jTree.clearSelection(); |
---|
2831 | 3191 | //objEditor.ResetSliders(); |
---|
2832 | 3192 | refreshContents(true); |
---|
2833 | 3193 | } else |
---|
2834 | | - if (event.getSource() == clearPanelButton) |
---|
| 3194 | + if (source == clearPanelButton) |
---|
2835 | 3195 | { |
---|
2836 | 3196 | assert(copy == group); |
---|
2837 | 3197 | //copy.ClearUI(); |
---|
.. | .. |
---|
2842 | 3202 | listUI.clear(); |
---|
2843 | 3203 | refreshContents(true); |
---|
2844 | 3204 | } else |
---|
2845 | | - if (event.getSource() == allParamsButton) |
---|
| 3205 | + if (source == allParamsButton) |
---|
2846 | 3206 | { |
---|
2847 | 3207 | assert(copy == group); |
---|
2848 | 3208 | |
---|
.. | .. |
---|
2863 | 3223 | |
---|
2864 | 3224 | refreshContents(true); |
---|
2865 | 3225 | } else |
---|
2866 | | - if (event.getSource() == unselectButton) |
---|
| 3226 | + if (source == unselectButton) |
---|
2867 | 3227 | { |
---|
2868 | 3228 | objEditor.jTree.clearSelection(); |
---|
2869 | 3229 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2870 | 3230 | objEditor.ResetSliders(); |
---|
2871 | 3231 | refreshContents(true); |
---|
2872 | 3232 | } else |
---|
2873 | | - if(event.getSource() instanceof cRadio) |
---|
| 3233 | + if(source instanceof cRadio) |
---|
2874 | 3234 | { |
---|
2875 | 3235 | group.parent = keepparent; |
---|
2876 | 3236 | group.attributes = 0; |
---|
2877 | 3237 | //group.editWindow = null; |
---|
2878 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3238 | + /*cRadio*/ radio = (cRadio)source; |
---|
2879 | 3239 | Object3D obj = radio.GetObject(); |
---|
2880 | 3240 | System.out.println("Edit " + obj); |
---|
2881 | 3241 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2895 | 3255 | } |
---|
2896 | 3256 | |
---|
2897 | 3257 | copy = group; |
---|
2898 | | - //CameraPane.theRenderer.object = group; |
---|
| 3258 | + //Globals.theRenderer.object = group; |
---|
2899 | 3259 | if(!useclient) |
---|
2900 | 3260 | { |
---|
2901 | 3261 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2904 | 3264 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2905 | 3265 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2906 | 3266 | cameraView.object = group; |
---|
2907 | | - cameraView.lighttouched = true; |
---|
| 3267 | + //cameraView.lighttouched = true; |
---|
| 3268 | + Globals.lighttouched = true; |
---|
2908 | 3269 | topView.object = group; |
---|
2909 | 3270 | frontView.object = group; |
---|
2910 | 3271 | sideView.object = group; |
---|
2911 | 3272 | } |
---|
2912 | | - group.editWindow = this; |
---|
| 3273 | + |
---|
| 3274 | +// fix "+" issue |
---|
| 3275 | + //group.editWindow = this; |
---|
| 3276 | + |
---|
2913 | 3277 | /* |
---|
2914 | 3278 | currentLayout = radio.layout; |
---|
2915 | 3279 | if (currentLayout == null) |
---|
.. | .. |
---|
2921 | 3285 | //group.parent = null; // ROOT |
---|
2922 | 3286 | //group.attributes = -1; |
---|
2923 | 3287 | ResetModel(); |
---|
| 3288 | + |
---|
| 3289 | + cameraView.requestFocusInWindow(); |
---|
2924 | 3290 | refreshContents(true); |
---|
2925 | | - } |
---|
| 3291 | + } else if (event.getSource() == editCameraItem) |
---|
| 3292 | + { |
---|
| 3293 | + cameraView.ProtectCamera(); |
---|
| 3294 | + cameraView.repaint(); |
---|
| 3295 | + return; |
---|
| 3296 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3297 | + { |
---|
| 3298 | + cameraView.RevertCamera(); |
---|
| 3299 | + cameraView.repaint(); |
---|
| 3300 | + return; |
---|
| 3301 | + // } else if (event.getSource() == textureButton) |
---|
| 3302 | + // { |
---|
| 3303 | + // return; // true; |
---|
| 3304 | + } |
---|
2926 | 3305 | else |
---|
2927 | 3306 | { |
---|
2928 | 3307 | //return super.action(event, arg); |
---|
.. | .. |
---|
2931 | 3310 | } |
---|
2932 | 3311 | |
---|
2933 | 3312 | boolean useclient = false; |
---|
2934 | | - cRadio radio; |
---|
2935 | 3313 | |
---|
2936 | 3314 | void ToggleRoot() |
---|
2937 | 3315 | { |
---|
.. | .. |
---|
2940 | 3318 | if (useclient) |
---|
2941 | 3319 | { |
---|
2942 | 3320 | cameraView.object = client; |
---|
2943 | | - cameraView.lighttouched = true; |
---|
| 3321 | + Globals.lighttouched = true; |
---|
2944 | 3322 | //topView.object = client; |
---|
2945 | 3323 | //frontView.object = client; |
---|
2946 | 3324 | //sideView.object = client; |
---|
.. | .. |
---|
2948 | 3326 | else |
---|
2949 | 3327 | { |
---|
2950 | 3328 | cameraView.object = group; |
---|
2951 | | - cameraView.lighttouched = true; |
---|
| 3329 | + Globals.lighttouched = true; |
---|
2952 | 3330 | //topView.object = group; |
---|
2953 | 3331 | //frontView.object = group; |
---|
2954 | 3332 | //sideView.object = group; |
---|
.. | .. |
---|
2983 | 3361 | refreshContents(); |
---|
2984 | 3362 | } |
---|
2985 | 3363 | |
---|
| 3364 | + void TransformChildren() |
---|
| 3365 | + { |
---|
| 3366 | + Object3D obj; |
---|
| 3367 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3368 | + { |
---|
| 3369 | + obj = (Object3D)e.nextElement(); |
---|
| 3370 | + obj.KeepTextureMatrices(); |
---|
| 3371 | + obj.TransformChildren(); |
---|
| 3372 | + obj.RestoreTextureMatrices(); |
---|
| 3373 | + |
---|
| 3374 | +// if (obj.parent == null) |
---|
| 3375 | +// { |
---|
| 3376 | +// System.out.println("NULL PARENT!"); |
---|
| 3377 | +// new Exception().printStackTrace(); |
---|
| 3378 | +// } |
---|
| 3379 | +// else |
---|
| 3380 | +// TouchTransform(obj); |
---|
| 3381 | +// //obj.parent.Touch(); |
---|
| 3382 | + } |
---|
| 3383 | + |
---|
| 3384 | + refreshContents(); |
---|
| 3385 | + } |
---|
2986 | 3386 | |
---|
2987 | 3387 | void ResetTransform() |
---|
2988 | 3388 | { |
---|
.. | .. |
---|
3095 | 3495 | refreshContents(); |
---|
3096 | 3496 | } |
---|
3097 | 3497 | |
---|
3098 | | - void ResetCentroid() |
---|
| 3498 | + void ResetCentroid(boolean full) |
---|
3099 | 3499 | { |
---|
3100 | 3500 | Object3D obj; |
---|
3101 | 3501 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3110 | 3510 | LA.matIdentity(Object3D.mat); |
---|
3111 | 3511 | obj.getBounds(minima, maxima, false); |
---|
3112 | 3512 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3113 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3513 | + if (full) |
---|
| 3514 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3114 | 3515 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3115 | 3516 | obj.TransformMesh(Object3D.mat); |
---|
| 3517 | + |
---|
3116 | 3518 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3117 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3519 | + if (full) |
---|
| 3520 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3118 | 3521 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3522 | + |
---|
3119 | 3523 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3120 | 3524 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3121 | 3525 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3144 | 3548 | |
---|
3145 | 3549 | int size = obj.MemorySize(); |
---|
3146 | 3550 | |
---|
3147 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3551 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3552 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3148 | 3553 | } |
---|
3149 | 3554 | } |
---|
3150 | 3555 | catch (Exception e) |
---|
.. | .. |
---|
3181 | 3586 | obj = (Object3D)e.nextElement(); |
---|
3182 | 3587 | |
---|
3183 | 3588 | System.out.println("Object is: " + obj); |
---|
3184 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3589 | + Grafreed.AnalyzeObject(obj); |
---|
3185 | 3590 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3186 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3591 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3187 | 3592 | |
---|
3188 | 3593 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3189 | 3594 | } |
---|
.. | .. |
---|
3225 | 3630 | void GenNormals(boolean crease) |
---|
3226 | 3631 | { |
---|
3227 | 3632 | group.GenNormalsS(crease); |
---|
| 3633 | + |
---|
| 3634 | + refreshContents(); |
---|
| 3635 | + } |
---|
| 3636 | + |
---|
| 3637 | + void GenNormalsMESH() |
---|
| 3638 | + { |
---|
| 3639 | + group.GenNormalsMeshS(); |
---|
3228 | 3640 | |
---|
3229 | 3641 | refreshContents(); |
---|
3230 | 3642 | } |
---|
.. | .. |
---|
3397 | 3809 | |
---|
3398 | 3810 | void ParseVertices() |
---|
3399 | 3811 | { |
---|
3400 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3401 | | - GrafreeD.epsequal = true; |
---|
| 3812 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3813 | + Grafreed.epsequal = true; |
---|
3402 | 3814 | |
---|
3403 | 3815 | for (int i=0; i<group.selection.size(); i++) |
---|
3404 | 3816 | { |
---|
.. | .. |
---|
3423 | 3835 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3424 | 3836 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3425 | 3837 | |
---|
3426 | | - g.add(GrafreeD.clipboard); |
---|
| 3838 | + g.add(Grafreed.clipboard); |
---|
3427 | 3839 | |
---|
3428 | 3840 | buffer.add(g); |
---|
3429 | 3841 | } |
---|
.. | .. |
---|
3438 | 3850 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3439 | 3851 | } |
---|
3440 | 3852 | |
---|
3441 | | - GrafreeD.epsequal = epsequal; |
---|
| 3853 | + Grafreed.epsequal = epsequal; |
---|
3442 | 3854 | |
---|
3443 | 3855 | refreshContents(); |
---|
3444 | 3856 | } |
---|
.. | .. |
---|
3456 | 3868 | String pigment = Object3D.GetPigment(tex); |
---|
3457 | 3869 | //String bump = Object3D.GetBump(tex); |
---|
3458 | 3870 | |
---|
3459 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3871 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3872 | + |
---|
| 3873 | + try |
---|
| 3874 | + { |
---|
| 3875 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3876 | + } |
---|
| 3877 | + catch (Exception e) |
---|
| 3878 | + { |
---|
| 3879 | + System.err.println("FAIL: " + node); |
---|
| 3880 | + } |
---|
3460 | 3881 | |
---|
3461 | 3882 | double s = v.s; |
---|
3462 | 3883 | |
---|
.. | .. |
---|
3544 | 3965 | |
---|
3545 | 3966 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3546 | 3967 | |
---|
3547 | | - boolean random = CameraPane.RANDOM; |
---|
3548 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3968 | + boolean random = CameraPane.SWITCH; |
---|
| 3969 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3549 | 3970 | lowres.linkVerticesThis(null); |
---|
3550 | 3971 | lowres.linkVerticesThis(sn); |
---|
3551 | | - CameraPane.RANDOM = random; |
---|
| 3972 | + CameraPane.SWITCH = random; |
---|
3552 | 3973 | |
---|
3553 | 3974 | System.err.flush(); |
---|
3554 | 3975 | |
---|
.. | .. |
---|
3588 | 4009 | return; |
---|
3589 | 4010 | |
---|
3590 | 4011 | Object3D poses = group.selection.get(0); |
---|
3591 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4012 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3592 | 4013 | |
---|
3593 | 4014 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3594 | 4015 | |
---|
.. | .. |
---|
3757 | 4178 | group.selection.RelinkToSupport(); // july 2014 |
---|
3758 | 4179 | System.out.println("DONE."); |
---|
3759 | 4180 | refreshContents(); |
---|
3760 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4181 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3761 | 4182 | } |
---|
3762 | 4183 | |
---|
3763 | 4184 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3782 | 4203 | |
---|
3783 | 4204 | void ClipMesh() |
---|
3784 | 4205 | { |
---|
3785 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4206 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3786 | 4207 | { |
---|
3787 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4208 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3788 | 4209 | |
---|
3789 | 4210 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3790 | 4211 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3793 | 4214 | // { |
---|
3794 | 4215 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3795 | 4216 | // } |
---|
3796 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4217 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3797 | 4218 | } |
---|
3798 | 4219 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3799 | 4220 | System.out.println("DONE."); |
---|
.. | .. |
---|
3840 | 4261 | void MarkLeaves(boolean hide) |
---|
3841 | 4262 | { |
---|
3842 | 4263 | group.selection.MarkLeaves(hide); |
---|
| 4264 | + refreshContents(); |
---|
| 4265 | + } |
---|
| 4266 | + |
---|
| 4267 | + void RewindLeaves(boolean hide) |
---|
| 4268 | + { |
---|
| 4269 | + group.selection.RewindLeaves(hide); |
---|
| 4270 | + refreshContents(); |
---|
| 4271 | + } |
---|
| 4272 | + |
---|
| 4273 | + void RandomLeaves(boolean hide) |
---|
| 4274 | + { |
---|
| 4275 | + group.selection.RandomLeaves(hide); |
---|
3843 | 4276 | refreshContents(); |
---|
3844 | 4277 | } |
---|
3845 | 4278 | |
---|
.. | .. |
---|
3928 | 4361 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3929 | 4362 | |
---|
3930 | 4363 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3931 | | - if(elem != group) |
---|
| 4364 | + if(elem != group || !newWindow) |
---|
3932 | 4365 | { |
---|
3933 | 4366 | // if (!(elem instanceof Composite)) |
---|
3934 | 4367 | // newWindow = false; |
---|
.. | .. |
---|
4018 | 4451 | //case 702: // Event.LIST_DESELECT |
---|
4019 | 4452 | group.deselectAll(); |
---|
4020 | 4453 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4021 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4022 | 4454 | if (tps != null) |
---|
4023 | 4455 | { |
---|
4024 | 4456 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4027 | 4459 | |
---|
4028 | 4460 | //if (child.parent != null) |
---|
4029 | 4461 | //child.parent.addSelectee(child); |
---|
| 4462 | + objEditor.SetMaterial(child); |
---|
4030 | 4463 | group.addSelectee(child); |
---|
4031 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4032 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4033 | | - System.err.println("info : " + child.GetPath()); |
---|
4034 | 4464 | } |
---|
4035 | 4465 | } |
---|
4036 | | - else |
---|
4037 | | - { |
---|
4038 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4039 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4040 | | - System.err.println("info : " + group.GetPath()); |
---|
4041 | | - } |
---|
| 4466 | +// else |
---|
| 4467 | +// { |
---|
| 4468 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4469 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4470 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4471 | +// } |
---|
4042 | 4472 | |
---|
4043 | | - objEditor.SetText(); // jan 2014 |
---|
4044 | | - |
---|
4045 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4473 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4046 | 4474 | CameraPane.flash = true; |
---|
4047 | 4475 | |
---|
4048 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4476 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4049 | 4477 | // a camera |
---|
4050 | 4478 | { |
---|
4051 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4052 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
4053 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
4054 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4479 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4480 | + { |
---|
| 4481 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4482 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4483 | + } |
---|
| 4484 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4485 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4055 | 4486 | } |
---|
4056 | 4487 | |
---|
4057 | 4488 | refreshContents(); |
---|
.. | .. |
---|
4062 | 4493 | |
---|
4063 | 4494 | freezemodel = false; |
---|
4064 | 4495 | } |
---|
| 4496 | + |
---|
| 4497 | + void refreshContents(boolean cp) |
---|
| 4498 | + { |
---|
| 4499 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4500 | + { |
---|
| 4501 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4502 | + |
---|
| 4503 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4504 | + { |
---|
| 4505 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4506 | + |
---|
| 4507 | + objEditor.AddInfo(child, this, true); |
---|
| 4508 | + System.err.println("info : " + child.GetPath()); |
---|
| 4509 | + } |
---|
| 4510 | + |
---|
| 4511 | + objEditor.SetText(); // jan 2014 |
---|
| 4512 | + } |
---|
| 4513 | + |
---|
| 4514 | + super.refreshContents(cp); |
---|
| 4515 | + } |
---|
4065 | 4516 | |
---|
4066 | 4517 | void linkSomething(Object3D thing) |
---|
4067 | 4518 | { |
---|
.. | .. |
---|
4133 | 4584 | { |
---|
4134 | 4585 | if (group.selection.isEmpty()) |
---|
4135 | 4586 | return; |
---|
4136 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4587 | + |
---|
| 4588 | + Grafreed.clipboardIsTempGroup = false; |
---|
4137 | 4589 | Composite tGroup = null; |
---|
4138 | 4590 | if (group.selection.size() > 0) // 1) |
---|
4139 | 4591 | { |
---|
4140 | 4592 | tGroup = new cGroup(); |
---|
4141 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4593 | + Grafreed.clipboardIsTempGroup = true; |
---|
4142 | 4594 | } |
---|
4143 | 4595 | |
---|
4144 | 4596 | if (cut) |
---|
4145 | 4597 | { |
---|
| 4598 | + Save(); |
---|
4146 | 4599 | //int indices[] = jList.getSelectedIndices(); |
---|
4147 | 4600 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4148 | 4601 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4178 | 4631 | //System.out.println("cut " + child); |
---|
4179 | 4632 | //System.out.println("parent = " + child.parent); |
---|
4180 | 4633 | // tmp.addChild(child); |
---|
4181 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4634 | + if (Grafreed.clipboardIsTempGroup) |
---|
4182 | 4635 | tGroup.add/*Child*/(tmp); |
---|
4183 | 4636 | else |
---|
4184 | | - GrafreeD.clipboard = tmp; |
---|
| 4637 | + Grafreed.clipboard = tmp; |
---|
4185 | 4638 | } |
---|
4186 | 4639 | else |
---|
4187 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4640 | + if (Grafreed.clipboardIsTempGroup) |
---|
4188 | 4641 | tGroup.add/*Child*/(child); |
---|
4189 | 4642 | else |
---|
4190 | | - GrafreeD.clipboard = child; |
---|
| 4643 | + Grafreed.clipboard = child; |
---|
4191 | 4644 | } |
---|
4192 | 4645 | |
---|
4193 | 4646 | //ResetModel(); |
---|
.. | .. |
---|
4219 | 4672 | //System.out.println("cut " + elem); |
---|
4220 | 4673 | //System.out.println("parent = " + elem.parent); |
---|
4221 | 4674 | // tmp.addChild(elem); |
---|
4222 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4675 | + if (Grafreed.clipboardIsTempGroup) |
---|
4223 | 4676 | tGroup.add/*Child*/(tmp); |
---|
4224 | 4677 | else |
---|
4225 | | - GrafreeD.clipboard = tmp; |
---|
| 4678 | + Grafreed.clipboard = tmp; |
---|
4226 | 4679 | } |
---|
4227 | 4680 | else |
---|
4228 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4681 | + if (Grafreed.clipboardIsTempGroup) |
---|
4229 | 4682 | tGroup.add/*Child*/(child); |
---|
4230 | 4683 | else |
---|
4231 | | - GrafreeD.clipboard = child; |
---|
| 4684 | + Grafreed.clipboard = child; |
---|
4232 | 4685 | } |
---|
4233 | 4686 | |
---|
4234 | 4687 | } |
---|
4235 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4236 | | - GrafreeD.clipboard = tGroup; |
---|
| 4688 | + |
---|
| 4689 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4690 | + Grafreed.clipboard = tGroup; |
---|
| 4691 | + |
---|
4237 | 4692 | if (cut) |
---|
4238 | 4693 | { |
---|
4239 | 4694 | ResetModel(); |
---|
.. | .. |
---|
4247 | 4702 | // return; |
---|
4248 | 4703 | boolean first = true; |
---|
4249 | 4704 | |
---|
4250 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4705 | + if (Grafreed.clipboardIsTempGroup) |
---|
4251 | 4706 | { |
---|
4252 | 4707 | Composite temp; |
---|
4253 | 4708 | |
---|
.. | .. |
---|
4258 | 4713 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4259 | 4714 | */ |
---|
4260 | 4715 | Object3D elem; |
---|
4261 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4716 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4262 | 4717 | { |
---|
4263 | 4718 | Object3D child = (Object3D)e.nextElement(); |
---|
4264 | 4719 | |
---|
.. | .. |
---|
4292 | 4747 | //Object3D cb = Applet3D.clipboard; |
---|
4293 | 4748 | //temp.addChild(cb); |
---|
4294 | 4749 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4295 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4296 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4297 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4298 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4299 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4750 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4751 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4752 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4753 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4754 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4300 | 4755 | else |
---|
4301 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4302 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4756 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4757 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4303 | 4758 | } |
---|
4304 | 4759 | |
---|
4305 | 4760 | ResetModel(); |
---|
4306 | 4761 | refreshContents(); |
---|
4307 | 4762 | } |
---|
4308 | 4763 | |
---|
4309 | | - void pasteInto(boolean copyit) |
---|
| 4764 | + void pasteInto(boolean copyit, boolean clone) |
---|
4310 | 4765 | { |
---|
4311 | 4766 | // if (GrafreeD.clipboard == null) |
---|
4312 | 4767 | // return; |
---|
.. | .. |
---|
4335 | 4790 | if (copyit) |
---|
4336 | 4791 | { |
---|
4337 | 4792 | // paste(false); |
---|
4338 | | - CloneClipboard(false); // sept 2014 |
---|
| 4793 | + if (clone) |
---|
| 4794 | + { |
---|
| 4795 | + CloneClipboard(false); // sept 2014 |
---|
| 4796 | + } |
---|
| 4797 | + else |
---|
| 4798 | + { |
---|
| 4799 | + paste(false); |
---|
| 4800 | + } |
---|
4339 | 4801 | } |
---|
4340 | 4802 | else |
---|
4341 | 4803 | { |
---|
4342 | 4804 | boolean first = true; |
---|
4343 | 4805 | |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4806 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 4807 | { |
---|
4346 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4808 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4347 | 4809 | Object3D copy; |
---|
4348 | 4810 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4349 | 4811 | { |
---|
.. | .. |
---|
4353 | 4815 | } |
---|
4354 | 4816 | } else |
---|
4355 | 4817 | { |
---|
4356 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4818 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4357 | 4819 | } |
---|
4358 | 4820 | } |
---|
4359 | 4821 | } |
---|
.. | .. |
---|
4758 | 5220 | } |
---|
4759 | 5221 | */ |
---|
4760 | 5222 | |
---|
4761 | | - void ImportGFD() |
---|
4762 | | - { |
---|
4763 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4764 | | - browser.show(); |
---|
4765 | | - String filename = browser.getFile(); |
---|
4766 | | - if (filename != null && filename.length() > 0) |
---|
4767 | | - { |
---|
4768 | | - String fullname = browser.getDirectory() + filename; |
---|
4769 | | - |
---|
4770 | | - //Object3D readobj = |
---|
4771 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4772 | | - //makeSomething(readobj); |
---|
4773 | | - } |
---|
4774 | | - } |
---|
4775 | | - |
---|
4776 | 5223 | /* |
---|
4777 | 5224 | public void Callback(Object obj) |
---|
4778 | 5225 | { |
---|
.. | .. |
---|
4796 | 5243 | } |
---|
4797 | 5244 | */ |
---|
4798 | 5245 | |
---|
4799 | | - void ImportVRMLX3D() |
---|
4800 | | - { |
---|
4801 | | - if (GrafreeD.standAlone) |
---|
4802 | | - { |
---|
4803 | | - /**/ |
---|
4804 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4805 | | - browser.show(); |
---|
4806 | | - String filename = browser.getFile(); |
---|
4807 | | - if (filename != null && filename.length() > 0) |
---|
4808 | | - { |
---|
4809 | | - String fullname = browser.getDirectory() + filename; |
---|
4810 | | - LoadVRMLX3D(fullname); |
---|
4811 | | - } |
---|
4812 | | - /**/ |
---|
4813 | | - } |
---|
4814 | | - } |
---|
4815 | | - |
---|
4816 | 5246 | String GetFile(String dialogName) |
---|
4817 | 5247 | { |
---|
4818 | | - if (GrafreeD.standAlone) |
---|
| 5248 | + if (Grafreed.standAlone) |
---|
4819 | 5249 | { |
---|
4820 | 5250 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4821 | 5251 | browser.show(); |
---|
.. | .. |
---|
4879 | 5309 | cButton flashSelectionButton; |
---|
4880 | 5310 | cButton editButton; |
---|
4881 | 5311 | cButton uneditButton; |
---|
| 5312 | + JCheckBox allParamsButton; |
---|
4882 | 5313 | cButton clearpanelButton; |
---|
4883 | | - cButton allParamsButton; |
---|
4884 | 5314 | cButton unselectButton; |
---|
4885 | 5315 | |
---|
| 5316 | + cButton minButton; |
---|
| 5317 | + cButton maxButton; |
---|
| 5318 | + cButton fullButton; |
---|
| 5319 | + cButton undoButton; |
---|
| 5320 | + cButton redoButton; |
---|
| 5321 | + cButton saveButton; |
---|
| 5322 | + cButton oneStepButton; |
---|
| 5323 | + |
---|
4886 | 5324 | cButton screenfitButton; |
---|
4887 | 5325 | cButton screenfitpointButton; |
---|
4888 | 5326 | cButton snapobjectButton; |
---|
.. | .. |
---|
4893 | 5331 | cButton closeButton; |
---|
4894 | 5332 | |
---|
4895 | 5333 | cButton setsupportButton; |
---|
4896 | | - |
---|
4897 | | - cButton twoButton; |
---|
4898 | | - cButton sixButton; |
---|
4899 | | - cButton threeButton; |
---|
4900 | | - cButton sevenButton; |
---|
4901 | | - cButton fourButton; // full panel |
---|
4902 | | - cButton oneButton; // full XYZ |
---|
4903 | | - //cButton currentLayout; |
---|
4904 | 5334 | |
---|
4905 | 5335 | // |
---|
4906 | 5336 | //Composite |
---|
.. | .. |
---|
4913 | 5343 | private MenuItem lookFromItem; |
---|
4914 | 5344 | private MenuItem switchItem; |
---|
4915 | 5345 | private MenuItem cutItem; |
---|
| 5346 | + private MenuItem undoItem; |
---|
| 5347 | + private MenuItem redoItem; |
---|
4916 | 5348 | private MenuItem duplicateItem; |
---|
4917 | 5349 | private MenuItem cloneItem; |
---|
4918 | 5350 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
4926 | 5358 | private MenuItem linkverticesItem; |
---|
4927 | 5359 | private MenuItem relinkverticesItem; |
---|
4928 | 5360 | private MenuItem setMasterItem; |
---|
4929 | | - private MenuItem resetMeshItem; |
---|
| 5361 | + private MenuItem resetAllItem; |
---|
4930 | 5362 | private MenuItem stepAllItem; |
---|
4931 | 5363 | private MenuItem revertMeshItem; |
---|
4932 | 5364 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4937 | 5369 | private MenuItem mergeGeometriesItem; |
---|
4938 | 5370 | private MenuItem copyItem; |
---|
4939 | 5371 | private MenuItem pasteItem; |
---|
| 5372 | + private MenuItem pasteIntoItem; |
---|
4940 | 5373 | private MenuItem pasteLinkItem; |
---|
4941 | 5374 | private MenuItem pasteCloneItem; |
---|
4942 | 5375 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
4975 | 5408 | private MenuItem showleavesItem; |
---|
4976 | 5409 | private MenuItem markleavesItem; |
---|
4977 | 5410 | private MenuItem unmarkleavesItem; |
---|
| 5411 | + private MenuItem rewindleavesItem; |
---|
| 5412 | + private MenuItem unrewindleavesItem; |
---|
| 5413 | + private MenuItem randomleavesItem; |
---|
| 5414 | + private MenuItem unrandomleavesItem; |
---|
4978 | 5415 | |
---|
4979 | 5416 | private MenuItem flipVItem; |
---|
4980 | 5417 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
4986 | 5423 | private MenuItem panoTexturesItem; |
---|
4987 | 5424 | |
---|
4988 | 5425 | private MenuItem resetCentroidItem; |
---|
4989 | | - private MenuItem transformgeometryItem; |
---|
| 5426 | + private MenuItem resetCentroidXZItem; |
---|
4990 | 5427 | private MenuItem resetTransformItem; |
---|
| 5428 | + private MenuItem transformGeometryItem; |
---|
| 5429 | + private MenuItem transformChildrenItem; |
---|
4991 | 5430 | private MenuItem hideItem; |
---|
4992 | 5431 | private MenuItem grabItem; |
---|
4993 | 5432 | private MenuItem backItem; |
---|
.. | .. |
---|
5009 | 5448 | |
---|
5010 | 5449 | private MenuItem resetParentItem; |
---|
5011 | 5450 | private MenuItem repairParentItem; |
---|
| 5451 | + private MenuItem repairShadowItem; |
---|
5012 | 5452 | private MenuItem sortbysizeItem; |
---|
5013 | 5453 | private MenuItem sortbynameItem; |
---|
5014 | 5454 | |
---|
.. | .. |
---|
5033 | 5473 | private MenuItem blobItem; |
---|
5034 | 5474 | private MenuItem latheItem; |
---|
5035 | 5475 | private MenuItem bezierItem; |
---|
5036 | | - private MenuItem checkerItem; |
---|
| 5476 | + private MenuItem overlayItem; |
---|
5037 | 5477 | private MenuItem meshItem; |
---|
5038 | 5478 | // private MenuItem meshGroupItem; |
---|
5039 | 5479 | private MenuItem springItem; |
---|
.. | .. |
---|
5055 | 5495 | private MenuItem doubleItem; |
---|
5056 | 5496 | private MenuItem tripleItem; |
---|
5057 | 5497 | |
---|
5058 | | - private MenuItem importGFDItem; |
---|
5059 | | - private MenuItem importVRMLX3DItem; |
---|
5060 | | - private MenuItem import3DSItem; |
---|
5061 | | - private MenuItem importOBJItem; |
---|
5062 | | - |
---|
5063 | 5498 | private MenuItem computeAOItem; |
---|
5064 | 5499 | private MenuItem recompileItem; |
---|
5065 | 5500 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5069 | 5504 | private MenuItem analyzeItem; |
---|
5070 | 5505 | private MenuItem dumpItem; |
---|
5071 | 5506 | //boolean freezemodel = false; |
---|
| 5507 | + |
---|
| 5508 | + Menu cameraMenu; |
---|
| 5509 | + MenuItem editCameraItem; |
---|
| 5510 | + MenuItem revertCameraItem; |
---|
5072 | 5511 | } |
---|