.. | .. |
---|
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.addItemListener(this); |
---|
| 812 | + |
---|
| 813 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 814 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 815 | + lookAtCB.addItemListener(this); |
---|
| 816 | + |
---|
| 817 | + } |
---|
| 818 | + |
---|
| 819 | + cGridBag fill = new cGridBag(); |
---|
| 820 | + |
---|
| 821 | + fill.preferredHeight = 200; |
---|
| 822 | + |
---|
| 823 | + panel.add(fill); |
---|
| 824 | + |
---|
| 825 | + } |
---|
649 | 826 | |
---|
650 | 827 | void EditObject(Object3D obj) |
---|
651 | 828 | { |
---|
.. | .. |
---|
658 | 835 | buttonGroup.add(radioButton); |
---|
659 | 836 | radioButton.doClick(); |
---|
660 | 837 | } |
---|
| 838 | + |
---|
661 | 839 | void SetupViews(ObjEditor oe) |
---|
662 | 840 | { |
---|
| 841 | + theFrame = this; |
---|
| 842 | + |
---|
663 | 843 | oe.SetupViews(); |
---|
664 | 844 | |
---|
665 | 845 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
676 | 856 | JCheckBox fastCB; |
---|
677 | 857 | JCheckBox slowCB; |
---|
678 | 858 | JCheckBox boxCB; |
---|
| 859 | + JCheckBox zoomBoxCB; |
---|
679 | 860 | JCheckBox trackCB; |
---|
680 | 861 | JCheckBox smoothfocusCB; |
---|
681 | 862 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
721 | 902 | } else if(e.getSource() == liveCB) |
---|
722 | 903 | { |
---|
723 | 904 | cameraView.ToggleLive(); |
---|
| 905 | + refreshContents(false); |
---|
724 | 906 | } |
---|
725 | 907 | else if(e.getSource() == supportCB) |
---|
726 | 908 | { |
---|
.. | .. |
---|
755 | 937 | Recompile(); |
---|
756 | 938 | cameraView.repaint(); |
---|
757 | 939 | // refreshContents(); |
---|
| 940 | + } |
---|
| 941 | + else if(e.getSource() == zoomBoxCB) |
---|
| 942 | + { |
---|
| 943 | + cameraView.ToggleZoomBoxMode(); |
---|
758 | 944 | } |
---|
759 | 945 | else if(e.getSource() == smoothfocusCB) |
---|
760 | 946 | { |
---|
.. | .. |
---|
869 | 1055 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
870 | 1056 | // return; |
---|
871 | 1057 | // } |
---|
872 | | - if (string.charAt(0) == '/') |
---|
| 1058 | + |
---|
| 1059 | + // File path for Mac and Windows |
---|
| 1060 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
873 | 1061 | { |
---|
874 | 1062 | // file(s) |
---|
875 | 1063 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
896 | 1084 | |
---|
897 | 1085 | flashIt = false; |
---|
898 | 1086 | CameraPane pane = (CameraPane) target; |
---|
899 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1087 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
900 | 1088 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
901 | 1089 | |
---|
902 | 1090 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
923 | 1111 | { |
---|
924 | 1112 | loadClipboard(true); |
---|
925 | 1113 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
926 | | - pasteInto(false); |
---|
| 1114 | + pasteInto(false, false); |
---|
927 | 1115 | } else { |
---|
928 | 1116 | loadClipboard(false); |
---|
929 | 1117 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
930 | | - pasteInto(false); // true); // ??? |
---|
| 1118 | + pasteInto(false, false); // true); // ??? |
---|
931 | 1119 | } |
---|
932 | 1120 | } |
---|
933 | 1121 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1049 | 1237 | kleinItem.addActionListener(this); |
---|
1050 | 1238 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1051 | 1239 | particleItem.addActionListener(this); |
---|
| 1240 | + if (Globals.ADVANCED) |
---|
| 1241 | + { |
---|
1052 | 1242 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1053 | 1243 | ragdollItem.addActionListener(this); |
---|
1054 | 1244 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1055 | 1245 | ragdoll2Item.addActionListener(this); |
---|
| 1246 | + } |
---|
1056 | 1247 | menu.add("-"); |
---|
1057 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1248 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1058 | 1249 | meshItem.addActionListener(this); |
---|
1059 | 1250 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1060 | 1251 | // meshGroupItem.addActionListener(this); |
---|
| 1252 | + if (Globals.ADVANCED) |
---|
| 1253 | + { |
---|
1061 | 1254 | springItem = menu.add(new MenuItem("Spring")); |
---|
1062 | 1255 | springItem.addActionListener(this); |
---|
1063 | 1256 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1064 | 1257 | 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 | 1258 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1070 | 1259 | blobItem.addActionListener(this); |
---|
1071 | 1260 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1072 | 1261 | latheItem.addActionListener(this); |
---|
| 1262 | + } |
---|
| 1263 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1264 | + bezierItem.addActionListener(this); |
---|
| 1265 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1266 | + overlayItem.addActionListener(this); |
---|
1073 | 1267 | lightItem = menu.add(new MenuItem("Light")); |
---|
1074 | 1268 | lightItem.addActionListener(this); |
---|
1075 | 1269 | menu.add("-"); |
---|
.. | .. |
---|
1079 | 1273 | loopItem.addActionListener(this); |
---|
1080 | 1274 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1081 | 1275 | doubleItem.addActionListener(this); |
---|
| 1276 | + if (Globals.ADVANCED) |
---|
| 1277 | + { |
---|
1082 | 1278 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1083 | 1279 | tripleItem.addActionListener(this); |
---|
| 1280 | + } |
---|
1084 | 1281 | } |
---|
1085 | 1282 | |
---|
1086 | 1283 | void buildToolsMenu(Menu menu) |
---|
1087 | 1284 | { |
---|
1088 | 1285 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1089 | 1286 | animationItem.addItemListener(this); |
---|
1090 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1287 | + animationItem.setState(Globals.ANIMATION); |
---|
1091 | 1288 | |
---|
1092 | 1289 | menu.add("-"); |
---|
1093 | 1290 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1094 | 1291 | parseverticesItem.addActionListener(this); |
---|
1095 | 1292 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1096 | 1293 | textureFieldItem.addActionListener(this); |
---|
1097 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1294 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1098 | 1295 | alignItem.addActionListener(this); |
---|
1099 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1100 | | - mirrorItem.addActionListener(this); |
---|
1101 | 1296 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1102 | 1297 | reduceMorphItem.addActionListener(this); |
---|
1103 | 1298 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1104 | 1299 | reduce34MorphItem.addActionListener(this); |
---|
1105 | | - |
---|
| 1300 | + menu.add("-"); |
---|
1106 | 1301 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1107 | 1302 | computeAOItem.addActionListener(this); |
---|
1108 | | - menu.add("-"); |
---|
1109 | 1303 | |
---|
| 1304 | + if (Globals.ADVANCED) |
---|
| 1305 | + { |
---|
| 1306 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1307 | + mirrorItem.addActionListener(this); |
---|
| 1308 | + menu.add("-"); |
---|
1110 | 1309 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1111 | 1310 | memoryItem.addActionListener(this); |
---|
1112 | 1311 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1113 | 1312 | analyzeItem.addActionListener(this); |
---|
1114 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1313 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1115 | 1314 | dumpItem.addActionListener(this); |
---|
1116 | 1315 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1117 | 1316 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1129 | 1328 | menu.add("-"); |
---|
1130 | 1329 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1131 | 1330 | editScriptItem.addActionListener(this); |
---|
| 1331 | + } |
---|
1132 | 1332 | } |
---|
1133 | 1333 | |
---|
1134 | 1334 | void ScreenFit() |
---|
.. | .. |
---|
1251 | 1451 | shadow.material = new cMaterial(obj.material); |
---|
1252 | 1452 | shadow.material.diffuse = 0.0001f; |
---|
1253 | 1453 | shadow.material.specular = 0.0001f; |
---|
| 1454 | + //shadow.projectedVertices[1].x = 300; |
---|
1254 | 1455 | |
---|
1255 | 1456 | makeSomething(shadow); |
---|
1256 | 1457 | } |
---|
.. | .. |
---|
1457 | 1658 | |
---|
1458 | 1659 | void Overwrite(int mask) |
---|
1459 | 1660 | { |
---|
1460 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1661 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1461 | 1662 | { |
---|
1462 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1663 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1463 | 1664 | |
---|
1464 | 1665 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1465 | 1666 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1482 | 1683 | // |
---|
1483 | 1684 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1484 | 1685 | { |
---|
| 1686 | + Object source = event.getSource(); |
---|
1485 | 1687 | /* |
---|
1486 | 1688 | if (event.getSource() == nameField) |
---|
1487 | 1689 | { |
---|
.. | .. |
---|
1493 | 1695 | } |
---|
1494 | 1696 | else |
---|
1495 | 1697 | */ |
---|
1496 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1698 | + if (source == lookAtItem || source == lookFromItem) |
---|
1497 | 1699 | { |
---|
1498 | 1700 | ScreenFit(); |
---|
1499 | 1701 | } else |
---|
1500 | | - if (event.getSource() == switchItem) |
---|
| 1702 | + if (source == switchItem) |
---|
1501 | 1703 | { |
---|
1502 | 1704 | cVector v1 = new cVector(); |
---|
1503 | 1705 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1506 | 1708 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1507 | 1709 | objEditor.cameraView.repaint(); |
---|
1508 | 1710 | } else |
---|
1509 | | - if (event.getSource() == rectoidItem) |
---|
| 1711 | + if (source == rectoidItem) |
---|
1510 | 1712 | { |
---|
1511 | 1713 | makeSomething(new Box()); |
---|
1512 | 1714 | } else |
---|
1513 | | - if (event.getSource() == particleItem) |
---|
| 1715 | + if (source == particleItem) |
---|
1514 | 1716 | { |
---|
1515 | 1717 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1516 | 1718 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1531 | 1733 | applyExample(particleGeom, "SMOKE"); |
---|
1532 | 1734 | makeSomething(particleGeom); |
---|
1533 | 1735 | } else |
---|
1534 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1736 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1535 | 1737 | { |
---|
1536 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1738 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1537 | 1739 | |
---|
1538 | 1740 | ragdoll.toParent = LA.newMatrix(); |
---|
1539 | 1741 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1551 | 1753 | } else |
---|
1552 | 1754 | /* |
---|
1553 | 1755 | */ |
---|
1554 | | - if (event.getSource() == heightFieldItem) |
---|
| 1756 | + if (source == heightFieldItem) |
---|
1555 | 1757 | { |
---|
1556 | 1758 | Object3D obj = new Object3D(); |
---|
1557 | 1759 | |
---|
.. | .. |
---|
1589 | 1791 | |
---|
1590 | 1792 | makeSomething(obj); |
---|
1591 | 1793 | } else |
---|
1592 | | - if (event.getSource() == gridItem) |
---|
| 1794 | + if (source == gridItem) |
---|
1593 | 1795 | { |
---|
1594 | 1796 | makeSomething(new Grid()); |
---|
1595 | 1797 | } else |
---|
1596 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1798 | + if (source == ellipsoidItem) |
---|
1597 | 1799 | { |
---|
1598 | 1800 | makeSomething(new Sphere()); |
---|
1599 | 1801 | } else |
---|
1600 | | - if (event.getSource() == coneItem) |
---|
| 1802 | + if (source == coneItem) |
---|
1601 | 1803 | { |
---|
1602 | 1804 | makeSomething(new Cone()); |
---|
1603 | 1805 | } else |
---|
1604 | | - if (event.getSource() == torusItem) |
---|
| 1806 | + if (source == torusItem) |
---|
1605 | 1807 | { |
---|
1606 | 1808 | makeSomething(new Torus()); |
---|
1607 | 1809 | } else |
---|
1608 | | - if (event.getSource() == superItem) |
---|
| 1810 | + if (source == superItem) |
---|
1609 | 1811 | { |
---|
1610 | 1812 | makeSomething(new Superellipsoid()); |
---|
1611 | 1813 | } else |
---|
1612 | | - if (event.getSource() == kleinItem) |
---|
| 1814 | + if (source == kleinItem) |
---|
1613 | 1815 | { |
---|
1614 | 1816 | makeSomething(new Klein()); |
---|
1615 | 1817 | } else |
---|
1616 | | - if (event.getSource() == blobItem) |
---|
| 1818 | + if (source == blobItem) |
---|
1617 | 1819 | { |
---|
1618 | 1820 | Blob blob = new Blob(); |
---|
1619 | 1821 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1621 | 1823 | //blob.retile(); |
---|
1622 | 1824 | makeSomething(blob); |
---|
1623 | 1825 | } else |
---|
1624 | | - if (event.getSource() == latheItem) |
---|
| 1826 | + if (source == latheItem) |
---|
1625 | 1827 | { |
---|
1626 | 1828 | makeSomething(new Lathe()); |
---|
1627 | 1829 | } else |
---|
1628 | | - if (event.getSource() == bezierItem) |
---|
| 1830 | + if (source == bezierItem) |
---|
1629 | 1831 | { |
---|
1630 | 1832 | makeSomething(new BezierSurface()); |
---|
1631 | 1833 | } else |
---|
1632 | | - if (event.getSource() == checkerItem) |
---|
| 1834 | + if (source == overlayItem) |
---|
1633 | 1835 | { |
---|
1634 | 1836 | /* |
---|
1635 | 1837 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1644 | 1846 | */ |
---|
1645 | 1847 | makeSomething(new Checker()); |
---|
1646 | 1848 | } else |
---|
1647 | | - if (event.getSource() == meshItem) |
---|
| 1849 | + if (source == meshItem) |
---|
1648 | 1850 | { |
---|
1649 | 1851 | Object3D itemtomake = new Object3D(); |
---|
1650 | 1852 | Object3D child; |
---|
.. | .. |
---|
1665 | 1867 | makeSomething(child); |
---|
1666 | 1868 | } |
---|
1667 | 1869 | } else |
---|
1668 | | - if (event.getSource() == springItem) |
---|
| 1870 | + if (source == springItem) |
---|
1669 | 1871 | { |
---|
1670 | 1872 | cSpring s = new cSpring(); |
---|
1671 | 1873 | s.setup(); |
---|
1672 | 1874 | makeSomething(s); |
---|
1673 | 1875 | } else |
---|
1674 | | - if (event.getSource() == flagItem) |
---|
| 1876 | + if (source == flagItem) |
---|
1675 | 1877 | { |
---|
1676 | 1878 | cSpring s = new cFlag(); |
---|
1677 | 1879 | s.setup(); |
---|
1678 | 1880 | makeSomething(s); |
---|
1679 | 1881 | } else |
---|
1680 | | - if (event.getSource() == lightItem) |
---|
| 1882 | + if (source == lightItem) |
---|
1681 | 1883 | { |
---|
1682 | 1884 | makeSomething(new Light()); |
---|
1683 | 1885 | } else |
---|
1684 | | - if (event.getSource() == csgItem) |
---|
| 1886 | + if (source == csgItem) |
---|
1685 | 1887 | { |
---|
1686 | 1888 | group(new CSG()); |
---|
1687 | 1889 | } else |
---|
1688 | | - if (event.getSource() == templateItem) |
---|
| 1890 | + if (source == templateItem) |
---|
1689 | 1891 | { |
---|
1690 | 1892 | group(new cTemplate()); |
---|
1691 | 1893 | } else |
---|
1692 | | - if (event.getSource() == attributeItem) |
---|
| 1894 | + if (source == attributeItem) |
---|
1693 | 1895 | { |
---|
1694 | 1896 | makeSomething(new Attribute()); |
---|
1695 | 1897 | } else |
---|
1696 | | - if (event.getSource() == pointflowItem) |
---|
| 1898 | + if (source == pointflowItem) |
---|
1697 | 1899 | { |
---|
1698 | 1900 | makeSomething(new PointFlow()); |
---|
1699 | 1901 | } else |
---|
.. | .. |
---|
1705 | 1907 | } else |
---|
1706 | 1908 | */ |
---|
1707 | 1909 | |
---|
1708 | | - if (event.getSource() == superLoopItem) |
---|
| 1910 | + if (source == superLoopItem) |
---|
1709 | 1911 | { |
---|
1710 | 1912 | Composite g = new cGroup(); |
---|
1711 | 1913 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1727 | 1929 | |
---|
1728 | 1930 | group(g); |
---|
1729 | 1931 | } else |
---|
1730 | | - if (event.getSource() == loopItem) |
---|
| 1932 | + if (source == loopItem) |
---|
1731 | 1933 | { |
---|
1732 | 1934 | Composite csg = new GroupLeaf(); |
---|
1733 | 1935 | csg.count = 5; |
---|
.. | .. |
---|
1736 | 1938 | csg.addChild(child); |
---|
1737 | 1939 | child.addChild(csg); |
---|
1738 | 1940 | } else |
---|
1739 | | - if (event.getSource() == doubleItem) |
---|
| 1941 | + if (source == doubleItem) |
---|
1740 | 1942 | { |
---|
1741 | 1943 | Composite csg = new GroupLeaf(); |
---|
1742 | 1944 | csg.count = 5; |
---|
.. | .. |
---|
1748 | 1950 | csg.addChild(child); |
---|
1749 | 1951 | child.addChild(csg); |
---|
1750 | 1952 | } else |
---|
1751 | | - if (event.getSource() == tripleItem) |
---|
| 1953 | + if (source == tripleItem) |
---|
1752 | 1954 | { |
---|
1753 | 1955 | Composite csg = new GroupLeaf(); |
---|
1754 | 1956 | csg.count = 4; |
---|
.. | .. |
---|
1763 | 1965 | csg.addChild(child); |
---|
1764 | 1966 | child.addChild(csg); |
---|
1765 | 1967 | } else |
---|
1766 | | - |
---|
1767 | | - if (event.getSource() == importGFDItem) |
---|
| 1968 | + if (source == computeAOItem) |
---|
1768 | 1969 | { |
---|
1769 | | - ImportGFD(); |
---|
| 1970 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1971 | + Globals.theRenderer.repaint(); |
---|
1770 | 1972 | } else |
---|
1771 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1772 | | - { |
---|
1773 | | - ImportVRMLX3D(); |
---|
1774 | | - } else |
---|
1775 | | - if (event.getSource() == import3DSItem) |
---|
1776 | | - { |
---|
1777 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1778 | | - } else |
---|
1779 | | - if (event.getSource() == importOBJItem) |
---|
1780 | | - { |
---|
1781 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1782 | | - } else |
---|
1783 | | - if (event.getSource() == computeAOItem) |
---|
1784 | | - { |
---|
1785 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1786 | | - CameraPane.theRenderer.repaint(); |
---|
1787 | | - } else |
---|
1788 | | - if (event.getSource() == recompileItem) |
---|
| 1973 | + if (source == recompileItem) |
---|
1789 | 1974 | { |
---|
1790 | 1975 | Recompile(); |
---|
1791 | 1976 | refreshContents(); |
---|
1792 | 1977 | } else |
---|
1793 | | - if (event.getSource() == editScriptItem) |
---|
| 1978 | + if (source == editScriptItem) |
---|
1794 | 1979 | { |
---|
1795 | 1980 | OpenDialog(); |
---|
1796 | 1981 | refreshContents(); |
---|
1797 | 1982 | } else |
---|
1798 | | - if (event.getSource() == invariantsItem) |
---|
| 1983 | + if (source == invariantsItem) |
---|
1799 | 1984 | { |
---|
1800 | 1985 | System.out.println("Invariants:"); |
---|
1801 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 1986 | + Grafreed.grafreeD.universe.invariants(); |
---|
1802 | 1987 | } else |
---|
1803 | | - if (event.getSource() == memoryItem) |
---|
| 1988 | + if (source == memoryItem) |
---|
1804 | 1989 | { |
---|
1805 | 1990 | //System.out.println("Invariants:"); |
---|
1806 | 1991 | PrintMemory(); |
---|
1807 | 1992 | } else |
---|
1808 | | - if (event.getSource() == pathItem) |
---|
| 1993 | + if (source == pathItem) |
---|
1809 | 1994 | { |
---|
1810 | 1995 | PrintPath(); |
---|
1811 | 1996 | } else |
---|
1812 | | - if (event.getSource() == analyzeItem) |
---|
| 1997 | + if (source == analyzeItem) |
---|
1813 | 1998 | { |
---|
1814 | 1999 | AnalyzeObject(); |
---|
1815 | 2000 | } else |
---|
1816 | | - if (event.getSource() == dumpItem) |
---|
| 2001 | + if (source == dumpItem) |
---|
1817 | 2002 | { |
---|
1818 | 2003 | DumpObject(); |
---|
1819 | 2004 | } else |
---|
1820 | | - if (event.getSource() == screenfitButton) |
---|
| 2005 | + if (source == minButton) |
---|
| 2006 | + { |
---|
| 2007 | + Minimize(); |
---|
| 2008 | + } else |
---|
| 2009 | + if (source == maxButton) |
---|
| 2010 | + { |
---|
| 2011 | + Maximize(); |
---|
| 2012 | + } else |
---|
| 2013 | + if (source == fullButton) |
---|
| 2014 | + { |
---|
| 2015 | + ToggleFullScreen(); |
---|
| 2016 | + } else |
---|
| 2017 | + if (source == undoButton) |
---|
| 2018 | + { |
---|
| 2019 | + Undo(); |
---|
| 2020 | + } else |
---|
| 2021 | + if (source == redoButton) |
---|
| 2022 | + { |
---|
| 2023 | + Redo(); |
---|
| 2024 | + } else |
---|
| 2025 | + if (source == saveButton) |
---|
| 2026 | + { |
---|
| 2027 | + Save(); |
---|
| 2028 | + } else |
---|
| 2029 | + if (source == oneStepButton) |
---|
| 2030 | + { |
---|
| 2031 | + Globals.ONESTEP = true; |
---|
| 2032 | + cameraView.repaint(); |
---|
| 2033 | + } else |
---|
| 2034 | + if (source == screenfitButton) |
---|
1821 | 2035 | { |
---|
1822 | 2036 | //Reload(lastConverter, lastFilename, true); |
---|
1823 | 2037 | ScreenFit(); |
---|
1824 | 2038 | } else |
---|
1825 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2039 | + if (source == screenfitpointButton) |
---|
1826 | 2040 | { |
---|
1827 | 2041 | //Reload(lastConverter, lastFilename, true); |
---|
1828 | 2042 | ScreenFitPoint(); |
---|
1829 | 2043 | } else |
---|
1830 | | - if (event.getSource() == snapobjectButton) |
---|
| 2044 | + if (source == snapobjectButton) |
---|
1831 | 2045 | { |
---|
1832 | 2046 | //Reload(lastConverter, lastFilename, true); |
---|
1833 | 2047 | SnapObject(); |
---|
.. | .. |
---|
1838 | 2052 | // Recompile(); |
---|
1839 | 2053 | // refreshContents(); |
---|
1840 | 2054 | // } else |
---|
1841 | | - if (event.getSource() == gcButton) |
---|
| 2055 | + if (source == gcButton) |
---|
1842 | 2056 | { |
---|
1843 | 2057 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1844 | 2058 | System.gc(); |
---|
1845 | 2059 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1846 | 2060 | } else |
---|
1847 | | - if (event.getSource() == editLeafItem) |
---|
| 2061 | + if (source == editLeafItem) |
---|
1848 | 2062 | { |
---|
1849 | 2063 | Object3D obj; |
---|
1850 | 2064 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1858 | 2072 | } |
---|
1859 | 2073 | refreshContents(true); |
---|
1860 | 2074 | } else |
---|
1861 | | - if (event.getSource() == openWindowItem) |
---|
| 2075 | + if (source == openWindowItem) |
---|
1862 | 2076 | { |
---|
1863 | 2077 | EditSelection(true); |
---|
1864 | 2078 | } else |
---|
1865 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2079 | + if (source == cutItem || source == clearButton) |
---|
1866 | 2080 | { |
---|
1867 | 2081 | loadClipboard(true); |
---|
1868 | 2082 | } else |
---|
1869 | | - if (event.getSource() == duplicateItem) |
---|
| 2083 | + if (source == undoItem) |
---|
1870 | 2084 | { |
---|
1871 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2085 | + Undo(); |
---|
| 2086 | + } else |
---|
| 2087 | + if (source == redoItem) |
---|
| 2088 | + { |
---|
| 2089 | + Redo(); |
---|
| 2090 | + } else |
---|
| 2091 | + if (source == duplicateItem) |
---|
| 2092 | + { |
---|
| 2093 | + Object3D keep = Grafreed.clipboard; |
---|
1872 | 2094 | loadClipboard(false); |
---|
1873 | 2095 | paste(false); |
---|
1874 | | - GrafreeD.clipboard = keep; |
---|
| 2096 | + Grafreed.clipboard = keep; |
---|
1875 | 2097 | } else |
---|
1876 | | - if (event.getSource() == cloneItem) |
---|
| 2098 | + if (source == cloneItem) |
---|
1877 | 2099 | { |
---|
1878 | 2100 | CloneSelection(false); |
---|
1879 | 2101 | } else |
---|
1880 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2102 | + if (source == cloneSupportItem) |
---|
1881 | 2103 | { |
---|
1882 | 2104 | CloneSelection(true); |
---|
1883 | 2105 | } else |
---|
1884 | | - if (event.getSource() == copyItem) |
---|
| 2106 | + if (source == copyItem) |
---|
1885 | 2107 | { |
---|
1886 | 2108 | loadClipboard(false); |
---|
1887 | 2109 | } else |
---|
1888 | | - if (event.getSource() == pasteItem) |
---|
| 2110 | + if (source == pasteItem) |
---|
1889 | 2111 | { |
---|
1890 | 2112 | paste(false); |
---|
1891 | 2113 | } else |
---|
1892 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2114 | + if (source == pasteIntoItem) |
---|
1893 | 2115 | { |
---|
1894 | | - pasteInto(false); |
---|
| 2116 | + pasteInto(true, false); |
---|
1895 | 2117 | } else |
---|
1896 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2118 | + if (source == pasteLinkItem) |
---|
1897 | 2119 | { |
---|
1898 | | - pasteInto(true); |
---|
| 2120 | + pasteInto(false, false); |
---|
1899 | 2121 | } else |
---|
1900 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2122 | + if (source == pasteCloneItem) |
---|
| 2123 | + { |
---|
| 2124 | + pasteInto(true, true); |
---|
| 2125 | + } else |
---|
| 2126 | + if (source == pasteExpandItem) |
---|
1901 | 2127 | { |
---|
1902 | 2128 | paste(true); |
---|
1903 | 2129 | } else |
---|
1904 | | - if (event.getSource() == synchronizeItem) |
---|
| 2130 | + if (source == synchronizeItem) |
---|
1905 | 2131 | { |
---|
1906 | 2132 | Overwrite(Object3D.TRANSFORM); |
---|
1907 | 2133 | } else |
---|
1908 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2134 | + if (source == overwriteNameItem) |
---|
1909 | 2135 | { |
---|
1910 | 2136 | Overwrite(Object3D.NAME); |
---|
1911 | 2137 | } else |
---|
1912 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2138 | + if (source == overwriteUVItem) |
---|
1913 | 2139 | { |
---|
1914 | 2140 | Overwrite(Object3D.UV); |
---|
1915 | 2141 | } else |
---|
1916 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2142 | + if (source == overwriteMatItem) |
---|
1917 | 2143 | { |
---|
1918 | 2144 | /* july 2015 |
---|
1919 | 2145 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1933 | 2159 | |
---|
1934 | 2160 | Overwrite(dropAttributes); |
---|
1935 | 2161 | } |
---|
1936 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2162 | + if (source == overwriteGeoItem) |
---|
1937 | 2163 | { |
---|
1938 | 2164 | Overwrite(Object3D.GEOMETRY); |
---|
1939 | 2165 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1950 | 2176 | // refreshContents(); |
---|
1951 | 2177 | // } |
---|
1952 | 2178 | } else |
---|
1953 | | - if (event.getSource() == generateMeshItem) |
---|
| 2179 | + if (source == generateMeshItem) |
---|
1954 | 2180 | { |
---|
1955 | 2181 | //if (group.selection.size() == 1) |
---|
1956 | 2182 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1961 | 2187 | ResetModel(); |
---|
1962 | 2188 | refreshContents(); |
---|
1963 | 2189 | } else |
---|
1964 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2190 | + if (source == extractGeometriesItem) |
---|
1965 | 2191 | { |
---|
1966 | 2192 | boolean one = false; |
---|
1967 | 2193 | |
---|
.. | .. |
---|
1988 | 2214 | ResetModel(); |
---|
1989 | 2215 | refreshContents(); |
---|
1990 | 2216 | } else |
---|
1991 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2217 | + if (source == cloneGeometriesItem) |
---|
1992 | 2218 | { |
---|
1993 | 2219 | boolean one = false; |
---|
1994 | 2220 | |
---|
.. | .. |
---|
2014 | 2240 | ResetModel(); |
---|
2015 | 2241 | refreshContents(); |
---|
2016 | 2242 | } else |
---|
2017 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2243 | + if (source == shareGeometriesItem) |
---|
2018 | 2244 | { |
---|
2019 | 2245 | boolean one = false; |
---|
2020 | 2246 | |
---|
.. | .. |
---|
2044 | 2270 | refreshContents(); |
---|
2045 | 2271 | } |
---|
2046 | 2272 | } else |
---|
2047 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2273 | + if (source == mergeGeometriesItem) |
---|
2048 | 2274 | { |
---|
2049 | 2275 | boolean one = false; |
---|
2050 | 2276 | |
---|
.. | .. |
---|
2074 | 2300 | ResetModel(); |
---|
2075 | 2301 | refreshContents(); |
---|
2076 | 2302 | } else |
---|
2077 | | - if (event.getSource() == linkverticesItem) |
---|
| 2303 | + if (source == linkverticesItem) |
---|
2078 | 2304 | { |
---|
2079 | 2305 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2080 | 2306 | // { |
---|
.. | .. |
---|
2087 | 2313 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2088 | 2314 | // refreshContents(); |
---|
2089 | 2315 | // } |
---|
2090 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2316 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2091 | 2317 | { |
---|
2092 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2318 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2093 | 2319 | |
---|
2094 | 2320 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2095 | 2321 | content = ((cGroup)content).get(0); |
---|
2096 | 2322 | |
---|
2097 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2323 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2098 | 2324 | for (int i=0; i<group.selection.size(); i++) |
---|
2099 | 2325 | { |
---|
2100 | | - boolean random = CameraPane.RANDOM; |
---|
2101 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2326 | + boolean random = CameraPane.SWITCH; |
---|
| 2327 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2102 | 2328 | group.selection.get(i).linkVerticesThis(content); |
---|
2103 | 2329 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2104 | | - CameraPane.RANDOM = random; |
---|
| 2330 | + CameraPane.SWITCH = random; |
---|
2105 | 2331 | } |
---|
2106 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2332 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2107 | 2333 | refreshContents(); |
---|
2108 | 2334 | } |
---|
2109 | 2335 | } else |
---|
2110 | | - if (event.getSource() == resetsupportItem) |
---|
| 2336 | + if (source == resetsupportItem) |
---|
2111 | 2337 | { |
---|
2112 | 2338 | for (int i=0; i<group.selection.size(); i++) |
---|
2113 | 2339 | { |
---|
2114 | | - boolean random = CameraPane.RANDOM; |
---|
2115 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2340 | + boolean random = CameraPane.SWITCH; |
---|
| 2341 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2116 | 2342 | group.selection.get(i).linkVerticesThis(null); |
---|
2117 | | - CameraPane.RANDOM = random; |
---|
| 2343 | + CameraPane.SWITCH = random; |
---|
2118 | 2344 | } |
---|
2119 | 2345 | |
---|
2120 | 2346 | refreshContents(); |
---|
2121 | 2347 | } else |
---|
2122 | | - if (event.getSource() == relinkverticesItem) |
---|
| 2348 | + if (source == relinkverticesItem) |
---|
2123 | 2349 | { |
---|
2124 | | - boolean random = CameraPane.RANDOM; |
---|
2125 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2350 | + boolean random = CameraPane.SWITCH; |
---|
| 2351 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2126 | 2352 | group.selection.RelinkToSupport(); |
---|
2127 | | - CameraPane.RANDOM = random; |
---|
| 2353 | + CameraPane.SWITCH = random; |
---|
2128 | 2354 | |
---|
2129 | 2355 | refreshContents(); |
---|
2130 | 2356 | } else |
---|
2131 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2357 | + if (source == resetreferencesItem) |
---|
2132 | 2358 | { |
---|
2133 | 2359 | for (int i=0; i<group.selection.size(); i++) |
---|
2134 | 2360 | { |
---|
.. | .. |
---|
2137 | 2363 | |
---|
2138 | 2364 | refreshContents(); |
---|
2139 | 2365 | } else |
---|
2140 | | - if (event.getSource() == setMasterItem) |
---|
| 2366 | + if (source == setMasterItem) |
---|
2141 | 2367 | { |
---|
2142 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2368 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2143 | 2369 | { |
---|
2144 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2370 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2145 | 2371 | |
---|
2146 | 2372 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2147 | 2373 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2150 | 2376 | refreshContents(); |
---|
2151 | 2377 | } |
---|
2152 | 2378 | } else |
---|
2153 | | - if (event.getSource() == poseMeshItem) |
---|
| 2379 | + if (source == poseMeshItem) |
---|
2154 | 2380 | { |
---|
2155 | 2381 | if (group.selection.size() == 1) |
---|
2156 | 2382 | { |
---|
2157 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2383 | + if (Grafreed.clipboard.size() == 1) |
---|
2158 | 2384 | { |
---|
2159 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2385 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2160 | 2386 | |
---|
2161 | 2387 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2162 | 2388 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2169 | 2395 | } |
---|
2170 | 2396 | |
---|
2171 | 2397 | } else |
---|
2172 | | - if (event.getSource() == revertMeshItem) |
---|
| 2398 | + if (source == revertMeshItem) |
---|
2173 | 2399 | { |
---|
2174 | 2400 | RevertMeshes(); |
---|
2175 | 2401 | } else |
---|
2176 | | - if (event.getSource() == resetMeshItem) |
---|
| 2402 | + if (source == resetAllItem) |
---|
2177 | 2403 | { |
---|
2178 | 2404 | ResetAll(); |
---|
2179 | 2405 | } else |
---|
2180 | | - if (event.getSource() == stepAllItem) |
---|
| 2406 | + if (source == stepAllItem) |
---|
2181 | 2407 | { |
---|
2182 | 2408 | StepAll(); |
---|
2183 | 2409 | } else |
---|
2184 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2410 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2185 | 2411 | { |
---|
2186 | 2412 | //int indices[] = jList.getSelectedIndices(); |
---|
2187 | 2413 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2189 | 2415 | |
---|
2190 | 2416 | ClearSelection(false); |
---|
2191 | 2417 | } else |
---|
2192 | | - if (event.getSource() == clearAllItem) |
---|
| 2418 | + if (source == clearAllItem) |
---|
2193 | 2419 | { |
---|
2194 | 2420 | ClearSelection(true); |
---|
2195 | 2421 | } else |
---|
2196 | | - if (event.getSource() == grabItem) |
---|
| 2422 | + if (source == grabItem) |
---|
2197 | 2423 | { |
---|
2198 | 2424 | group(new cGroup(), true); |
---|
2199 | 2425 | } else |
---|
2200 | | - if (event.getSource() == hideItem) |
---|
| 2426 | + if (source == hideItem) |
---|
2201 | 2427 | { |
---|
2202 | 2428 | group(new HiddenObject()); |
---|
2203 | 2429 | } else |
---|
2204 | | - if (event.getSource() == frontItem) |
---|
| 2430 | + if (source == frontItem) |
---|
2205 | 2431 | { |
---|
2206 | 2432 | front(); |
---|
2207 | 2433 | } else |
---|
2208 | | - if (event.getSource() == backItem) |
---|
| 2434 | + if (source == backItem) |
---|
2209 | 2435 | { |
---|
2210 | 2436 | back(); |
---|
2211 | 2437 | } else |
---|
2212 | | - if (event.getSource() == cameraItem) |
---|
| 2438 | + if (source == cameraItem) |
---|
2213 | 2439 | { |
---|
2214 | 2440 | makeSomething(new Camera()); |
---|
2215 | 2441 | } else |
---|
2216 | | - if (event.getSource() == compositeItem) |
---|
| 2442 | + if (source == compositeItem) |
---|
2217 | 2443 | { |
---|
2218 | 2444 | group(new Composite()); |
---|
2219 | 2445 | } else |
---|
2220 | | - if (event.getSource() == randomItem) |
---|
| 2446 | + if (source == randomItem) |
---|
2221 | 2447 | { |
---|
2222 | 2448 | RandomNode random = new RandomNode(); |
---|
2223 | 2449 | group(random); |
---|
2224 | 2450 | if (random.size() > 0) |
---|
2225 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2451 | + random.name = random.get(0).name + "Switch"; |
---|
2226 | 2452 | } else |
---|
2227 | | - if (event.getSource() == physicsItem) |
---|
| 2453 | + if (source == physicsItem) |
---|
2228 | 2454 | { |
---|
2229 | 2455 | group(new PhysicsNode()); |
---|
2230 | 2456 | } else |
---|
2231 | | - if (event.getSource() == frameselectorItem) |
---|
| 2457 | + if (source == frameselectorItem) |
---|
2232 | 2458 | { |
---|
2233 | 2459 | for (int i=0; i<group.selection.size(); i++) |
---|
2234 | 2460 | { |
---|
.. | .. |
---|
2240 | 2466 | ResetModel(); |
---|
2241 | 2467 | refreshContents(); |
---|
2242 | 2468 | } else |
---|
2243 | | - if (event.getSource() == switchGeoItem) |
---|
| 2469 | + if (source == switchGeoItem) |
---|
2244 | 2470 | { |
---|
2245 | 2471 | for (int i=0; i<group.selection.size(); i++) |
---|
2246 | 2472 | { |
---|
.. | .. |
---|
2252 | 2478 | ResetModel(); |
---|
2253 | 2479 | refreshContents(); |
---|
2254 | 2480 | } else |
---|
2255 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2481 | + if (source == switchTransfoItem) |
---|
2256 | 2482 | { |
---|
2257 | 2483 | for (int i=0; i<group.selection.size(); i++) |
---|
2258 | 2484 | { |
---|
.. | .. |
---|
2264 | 2490 | ResetModel(); |
---|
2265 | 2491 | refreshContents(); |
---|
2266 | 2492 | } else |
---|
2267 | | - if (event.getSource() == morphItem) |
---|
| 2493 | + if (source == morphItem) |
---|
2268 | 2494 | { |
---|
2269 | 2495 | for (int i=0; i<group.selection.size(); i++) |
---|
2270 | 2496 | { |
---|
.. | .. |
---|
2276 | 2502 | ResetModel(); |
---|
2277 | 2503 | refreshContents(); |
---|
2278 | 2504 | } else |
---|
2279 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2505 | + if (source == scriptNodeItem) |
---|
2280 | 2506 | { |
---|
2281 | 2507 | boolean atleastone = false; |
---|
2282 | 2508 | |
---|
.. | .. |
---|
2315 | 2541 | } |
---|
2316 | 2542 | } |
---|
2317 | 2543 | } else |
---|
2318 | | - if (event.getSource() == linkerItem) |
---|
| 2544 | + if (source == linkerItem) |
---|
2319 | 2545 | { |
---|
2320 | 2546 | group(new cLinker()); |
---|
2321 | 2547 | } else |
---|
2322 | | - if (event.getSource() == textureItem) |
---|
| 2548 | + if (source == textureItem) |
---|
2323 | 2549 | { |
---|
2324 | 2550 | group(new TextureNode()); |
---|
2325 | 2551 | } else |
---|
2326 | | - if (event.getSource() == billboardItem) |
---|
| 2552 | + if (source == billboardItem) |
---|
2327 | 2553 | { |
---|
2328 | 2554 | group(new BillboardNode()); |
---|
2329 | 2555 | } else |
---|
2330 | | - if (event.getSource() == shadowXItem) |
---|
| 2556 | + if (source == shadowXItem) |
---|
2331 | 2557 | { |
---|
2332 | 2558 | CastShadow(0); |
---|
2333 | 2559 | } else |
---|
2334 | | - if (event.getSource() == shadowYItem) |
---|
| 2560 | + if (source == shadowYItem) |
---|
2335 | 2561 | { |
---|
2336 | 2562 | CastShadow(1); |
---|
2337 | 2563 | } else |
---|
2338 | | - if (event.getSource() == shadowZItem) |
---|
| 2564 | + if (source == shadowZItem) |
---|
2339 | 2565 | { |
---|
2340 | 2566 | CastShadow(2); |
---|
2341 | 2567 | } else |
---|
2342 | | - if (event.getSource() == ungroupItem) |
---|
| 2568 | + if (source == ungroupItem) |
---|
2343 | 2569 | { |
---|
2344 | 2570 | //ungroup(); |
---|
2345 | 2571 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2351 | 2577 | |
---|
2352 | 2578 | refreshContents(); |
---|
2353 | 2579 | } else |
---|
2354 | | - if (event.getSource() == genUVItem) |
---|
| 2580 | + if (source == genUVItem) |
---|
2355 | 2581 | { |
---|
2356 | 2582 | GenUV(); |
---|
2357 | 2583 | } else |
---|
2358 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2584 | + if (source == genNormalsCADItem) |
---|
2359 | 2585 | { |
---|
2360 | 2586 | GenNormals(true); |
---|
2361 | 2587 | } else |
---|
2362 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 2588 | + if (source == genNormalsMESHItem) |
---|
2363 | 2589 | { |
---|
2364 | | - GenNormals(true); // TODO |
---|
| 2590 | + GenNormalsMESH(); |
---|
2365 | 2591 | } else |
---|
2366 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2592 | + if (source == genNormalsORGANItem) |
---|
2367 | 2593 | { |
---|
2368 | 2594 | GenNormals(false); |
---|
2369 | 2595 | } else |
---|
2370 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 2596 | + if (source == genNormalsMINEItem) |
---|
2371 | 2597 | { |
---|
2372 | 2598 | GenNormalsMINE(); |
---|
2373 | 2599 | } else |
---|
2374 | | - if (event.getSource() == stripifyItem) |
---|
| 2600 | + if (source == stripifyItem) |
---|
2375 | 2601 | { |
---|
2376 | 2602 | Stripify(); |
---|
2377 | 2603 | } else |
---|
2378 | | - if (event.getSource() == unstripifyItem) |
---|
| 2604 | + if (source == unstripifyItem) |
---|
2379 | 2605 | { |
---|
2380 | 2606 | Unstripify(); |
---|
2381 | 2607 | } else |
---|
2382 | | - if (event.getSource() == trimItem) |
---|
| 2608 | + if (source == trimItem) |
---|
2383 | 2609 | { |
---|
2384 | 2610 | Trim(); |
---|
2385 | 2611 | } else |
---|
2386 | | - if (event.getSource() == untrimItem) |
---|
| 2612 | + if (source == untrimItem) |
---|
2387 | 2613 | { |
---|
2388 | 2614 | Untrim(); |
---|
2389 | 2615 | } else |
---|
2390 | | - if (event.getSource() == clearColorsItem) |
---|
| 2616 | + if (source == clearColorsItem) |
---|
2391 | 2617 | { |
---|
2392 | 2618 | ClearColors(); |
---|
2393 | 2619 | } else |
---|
2394 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2620 | + if (source == clearMaterialsItem) |
---|
2395 | 2621 | { |
---|
2396 | 2622 | ClearMaterials(); |
---|
2397 | 2623 | } else |
---|
2398 | | - if (event.getSource() == liveleavesItem) |
---|
| 2624 | + if (source == liveleavesItem) |
---|
2399 | 2625 | { |
---|
2400 | 2626 | LiveLeaves(true); |
---|
2401 | 2627 | } else |
---|
2402 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2628 | + if (source == unliveleavesItem) |
---|
2403 | 2629 | { |
---|
2404 | 2630 | LiveLeaves(false); |
---|
2405 | 2631 | } else |
---|
2406 | | - if (event.getSource() == supportleavesItem) |
---|
| 2632 | + if (source == supportleavesItem) |
---|
2407 | 2633 | { |
---|
2408 | 2634 | SupportLeaves(true); |
---|
2409 | 2635 | } else |
---|
2410 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2636 | + if (source == unsupportleavesItem) |
---|
2411 | 2637 | { |
---|
2412 | 2638 | SupportLeaves(false); |
---|
2413 | 2639 | } else |
---|
2414 | | - if (event.getSource() == hideleavesItem) |
---|
| 2640 | + if (source == hideleavesItem) |
---|
2415 | 2641 | { |
---|
2416 | 2642 | HideLeaves(true); |
---|
2417 | 2643 | } else |
---|
2418 | | - if (event.getSource() == showleavesItem) |
---|
| 2644 | + if (source == showleavesItem) |
---|
2419 | 2645 | { |
---|
2420 | 2646 | HideLeaves(false); |
---|
2421 | 2647 | } else |
---|
2422 | | - if (event.getSource() == markleavesItem) |
---|
| 2648 | + if (source == markleavesItem) |
---|
2423 | 2649 | { |
---|
2424 | 2650 | MarkLeaves(true); |
---|
2425 | 2651 | } else |
---|
2426 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2652 | + if (source == unmarkleavesItem) |
---|
2427 | 2653 | { |
---|
2428 | 2654 | MarkLeaves(false); |
---|
2429 | 2655 | } else |
---|
2430 | | - if (event.getSource() == flipVItem) |
---|
| 2656 | + if (source == rewindleavesItem) |
---|
| 2657 | + { |
---|
| 2658 | + RewindLeaves(true); |
---|
| 2659 | + } else |
---|
| 2660 | + if (source == unrewindleavesItem) |
---|
| 2661 | + { |
---|
| 2662 | + RewindLeaves(false); |
---|
| 2663 | + } else |
---|
| 2664 | + if (source == randomleavesItem) |
---|
| 2665 | + { |
---|
| 2666 | + RandomLeaves(true); |
---|
| 2667 | + } else |
---|
| 2668 | + if (source == unrandomleavesItem) |
---|
| 2669 | + { |
---|
| 2670 | + RandomLeaves(false); |
---|
| 2671 | + } else |
---|
| 2672 | + if (source == flipVItem) |
---|
2431 | 2673 | { |
---|
2432 | 2674 | FlipV(true); |
---|
2433 | 2675 | } else |
---|
2434 | | - if (event.getSource() == unflipVItem) |
---|
| 2676 | + if (source == unflipVItem) |
---|
2435 | 2677 | { |
---|
2436 | 2678 | FlipV(false); |
---|
2437 | 2679 | } else |
---|
2438 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2680 | + if (source == lowTexturesItem) |
---|
2439 | 2681 | { |
---|
2440 | 2682 | SetTexRes(0); |
---|
2441 | 2683 | } else |
---|
2442 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2684 | + if (source == normalTexturesItem) |
---|
2443 | 2685 | { |
---|
2444 | 2686 | SetTexRes(1); |
---|
2445 | 2687 | } else |
---|
2446 | | - if (event.getSource() == highTexturesItem) |
---|
| 2688 | + if (source == highTexturesItem) |
---|
2447 | 2689 | { |
---|
2448 | 2690 | SetTexRes(2); |
---|
2449 | 2691 | } else |
---|
2450 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2692 | + if (source == veryhighTexturesItem) |
---|
2451 | 2693 | { |
---|
2452 | 2694 | SetTexRes(3); |
---|
2453 | 2695 | } else |
---|
2454 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2696 | + if (source == maxTexturesItem) |
---|
2455 | 2697 | { |
---|
2456 | 2698 | SetTexRes(4); |
---|
2457 | 2699 | } else |
---|
2458 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2700 | + if (source == panoTexturesItem) |
---|
2459 | 2701 | { |
---|
2460 | 2702 | SetTexRes(5); |
---|
2461 | 2703 | } else |
---|
2462 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2704 | + if (source == reverseNormalsItem) |
---|
2463 | 2705 | { |
---|
2464 | 2706 | ReverseNormals(); |
---|
2465 | 2707 | } else |
---|
2466 | | - if (event.getSource() == parseverticesItem) |
---|
| 2708 | + if (source == parseverticesItem) |
---|
2467 | 2709 | { |
---|
2468 | 2710 | ParseVertices(); |
---|
2469 | 2711 | } else |
---|
2470 | | - if (event.getSource() == textureFieldItem) |
---|
| 2712 | + if (source == textureFieldItem) |
---|
2471 | 2713 | { |
---|
2472 | 2714 | TextureVertices(); |
---|
2473 | 2715 | } else |
---|
2474 | | - if (event.getSource() == alignItem) |
---|
| 2716 | + if (source == alignItem) |
---|
2475 | 2717 | { |
---|
2476 | 2718 | Align(); |
---|
2477 | 2719 | } else |
---|
2478 | | - if (event.getSource() == mirrorItem) |
---|
| 2720 | + if (source == mirrorItem) |
---|
2479 | 2721 | { |
---|
2480 | 2722 | MirrorPoses(); |
---|
2481 | 2723 | } else |
---|
2482 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2724 | + if (source == reduceMorphItem) |
---|
2483 | 2725 | { |
---|
2484 | 2726 | MeshReduction(false); |
---|
2485 | 2727 | } else |
---|
2486 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2728 | + if (source == reduce34MorphItem) |
---|
2487 | 2729 | { |
---|
2488 | 2730 | MeshReduction(true); |
---|
2489 | 2731 | } else |
---|
2490 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2732 | + if (source == reverseTrianglesItem) |
---|
2491 | 2733 | { |
---|
2492 | 2734 | ReverseTriangles(); |
---|
2493 | 2735 | } else |
---|
2494 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2736 | + if (source == reduceMeshItem) |
---|
2495 | 2737 | { |
---|
2496 | 2738 | ReduceMesh(false); |
---|
2497 | 2739 | } else |
---|
2498 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2740 | + if (source == reduce34MeshItem) |
---|
2499 | 2741 | { |
---|
2500 | 2742 | ReduceMesh(true); |
---|
2501 | 2743 | } else |
---|
2502 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2744 | + if (source == increaseMeshItem) |
---|
2503 | 2745 | { |
---|
2504 | 2746 | IncreaseMesh(); |
---|
2505 | 2747 | } else |
---|
2506 | | - if (event.getSource() == clipMeshItem) |
---|
| 2748 | + if (source == clipMeshItem) |
---|
2507 | 2749 | { |
---|
2508 | 2750 | ClipMesh(); |
---|
2509 | 2751 | } else |
---|
2510 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2752 | + if (source == smoothMeshItem) |
---|
2511 | 2753 | { |
---|
2512 | 2754 | SmoothMesh(); |
---|
2513 | 2755 | } else |
---|
2514 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2756 | + if (source == transformGeometryItem) |
---|
2515 | 2757 | { |
---|
2516 | 2758 | TransformGeometry(); |
---|
2517 | 2759 | } else |
---|
2518 | | - if (event.getSource() == resetTransformItem) |
---|
| 2760 | + if (source == transformChildrenItem) |
---|
| 2761 | + { |
---|
| 2762 | + TransformChildren(); |
---|
| 2763 | + } else |
---|
| 2764 | + if (source == resetTransformItem) |
---|
2519 | 2765 | { |
---|
2520 | 2766 | ResetTransform(); |
---|
2521 | 2767 | } else |
---|
2522 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2768 | + if (source == resetCentroidItem) |
---|
2523 | 2769 | { |
---|
2524 | | - ResetCentroid(); |
---|
| 2770 | + ResetCentroid(true); |
---|
2525 | 2771 | } else |
---|
2526 | | - if (event.getSource() == resetParentItem) |
---|
| 2772 | + if (source == resetCentroidXZItem) |
---|
| 2773 | + { |
---|
| 2774 | + ResetCentroid(false); |
---|
| 2775 | + } else |
---|
| 2776 | + if (source == resetParentItem) |
---|
2527 | 2777 | { |
---|
2528 | 2778 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2529 | 2779 | { |
---|
.. | .. |
---|
2533 | 2783 | |
---|
2534 | 2784 | refreshContents(); |
---|
2535 | 2785 | } else |
---|
2536 | | - if (event.getSource() == repairParentItem) |
---|
| 2786 | + if (source == repairParentItem) |
---|
2537 | 2787 | { |
---|
2538 | 2788 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2539 | 2789 | { |
---|
.. | .. |
---|
2547 | 2797 | |
---|
2548 | 2798 | refreshContents(); |
---|
2549 | 2799 | } else |
---|
2550 | | - if (event.getSource() == repairShadowItem) |
---|
| 2800 | + if (source == repairShadowItem) |
---|
2551 | 2801 | { |
---|
2552 | 2802 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2553 | 2803 | { |
---|
.. | .. |
---|
2561 | 2811 | |
---|
2562 | 2812 | refreshContents(); |
---|
2563 | 2813 | } else |
---|
2564 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2814 | + if (source == sortbysizeItem) |
---|
2565 | 2815 | { |
---|
2566 | 2816 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2567 | 2817 | { |
---|
.. | .. |
---|
2573 | 2823 | ResetModel(); |
---|
2574 | 2824 | refreshContents(); |
---|
2575 | 2825 | } else |
---|
2576 | | - if (event.getSource() == sortbynameItem) |
---|
| 2826 | + if (source == sortbynameItem) |
---|
2577 | 2827 | { |
---|
2578 | 2828 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2579 | 2829 | { |
---|
.. | .. |
---|
2585 | 2835 | ResetModel(); |
---|
2586 | 2836 | refreshContents(); |
---|
2587 | 2837 | } else |
---|
2588 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2838 | + if (source == attachPigmentItem) |
---|
2589 | 2839 | { |
---|
2590 | 2840 | String texture = GetFile("Attach pigment"); |
---|
2591 | 2841 | Object3D obj; |
---|
.. | .. |
---|
2597 | 2847 | |
---|
2598 | 2848 | refreshContents(); |
---|
2599 | 2849 | } else |
---|
2600 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2850 | + if (source == detachPigmentItem) |
---|
2601 | 2851 | { |
---|
2602 | 2852 | Object3D obj; |
---|
2603 | 2853 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2608 | 2858 | |
---|
2609 | 2859 | refreshContents(); |
---|
2610 | 2860 | } else |
---|
2611 | | - if (event.getSource() == attachBumpItem) |
---|
| 2861 | + if (source == attachBumpItem) |
---|
2612 | 2862 | { |
---|
2613 | 2863 | String texture = GetFile("Attach bump"); |
---|
2614 | 2864 | Object3D obj; |
---|
.. | .. |
---|
2620 | 2870 | |
---|
2621 | 2871 | refreshContents(); |
---|
2622 | 2872 | } else |
---|
2623 | | - if (event.getSource() == detachBumpItem) |
---|
| 2873 | + if (source == detachBumpItem) |
---|
2624 | 2874 | { |
---|
2625 | 2875 | Object3D obj; |
---|
2626 | 2876 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2631 | 2881 | |
---|
2632 | 2882 | refreshContents(); |
---|
2633 | 2883 | } else |
---|
2634 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2884 | + if (source == pigmentBumpItem) |
---|
2635 | 2885 | { |
---|
2636 | 2886 | Object3D obj; |
---|
2637 | 2887 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2642 | 2892 | |
---|
2643 | 2893 | refreshContents(); |
---|
2644 | 2894 | } else |
---|
2645 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2895 | + if (source == flashSelectionButton) |
---|
2646 | 2896 | { |
---|
2647 | 2897 | CameraPane.flash = true; |
---|
2648 | 2898 | refreshContents(); |
---|
2649 | 2899 | } else |
---|
2650 | | - if (event.getSource() == oneButton) |
---|
| 2900 | + if (source == oneButton) |
---|
2651 | 2901 | { |
---|
2652 | 2902 | } else |
---|
2653 | | - if (event.getSource() == twoButton) |
---|
| 2903 | + if (source == twoButton) |
---|
2654 | 2904 | { |
---|
2655 | 2905 | radio.layout = twoButton; |
---|
2656 | 2906 | // bug |
---|
2657 | 2907 | //gridPanel.setDividerLocation(1.0); |
---|
2658 | 2908 | //bigPanel.setDividerLocation(0.0); |
---|
2659 | | - bigThree.remove(scenePanel); |
---|
2660 | | - bigThree.remove(centralPanel); |
---|
2661 | | - bigThree.remove(XYZPanel); |
---|
2662 | | - aWindowConstraints.gridx = 0; |
---|
2663 | | - aWindowConstraints.gridy = 0; |
---|
2664 | | - aWindowConstraints.gridwidth = 1; |
---|
2665 | | - // aConstraints.gridheight = 3; |
---|
2666 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2667 | | - aWindowConstraints.weightx = 0; |
---|
2668 | | - aWindowConstraints.weighty = 1; |
---|
2669 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2670 | | - aWindowConstraints.weightx = 1; |
---|
2671 | | - aWindowConstraints.gridwidth = 3; |
---|
2672 | | - // aConstraints.gridheight = 3; |
---|
2673 | | - aWindowConstraints.gridx = 1; |
---|
2674 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2675 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2676 | | - aWindowConstraints.weightx = 0; |
---|
2677 | | - aWindowConstraints.gridx = 4; |
---|
2678 | | - aWindowConstraints.gridwidth = 1; |
---|
2679 | | - // aConstraints.gridheight = 3; |
---|
2680 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2681 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2682 | | - bigThree.revalidate(); |
---|
| 2909 | +// bigThree.remove(scenePanel); |
---|
| 2910 | +// bigThree.remove(centralPanel); |
---|
| 2911 | +// bigThree.remove(XYZPanel); |
---|
| 2912 | +// aWindowConstraints.gridx = 0; |
---|
| 2913 | +// aWindowConstraints.gridy = 0; |
---|
| 2914 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2915 | +// // aConstraints.gridheight = 3; |
---|
| 2916 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2917 | +// aWindowConstraints.weightx = 0; |
---|
| 2918 | +// aWindowConstraints.weighty = 1; |
---|
| 2919 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2920 | +// aWindowConstraints.weightx = 1; |
---|
| 2921 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2922 | +// // aConstraints.gridheight = 3; |
---|
| 2923 | +// aWindowConstraints.gridx = 1; |
---|
| 2924 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2925 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2926 | +// aWindowConstraints.weightx = 0; |
---|
| 2927 | +// aWindowConstraints.gridx = 4; |
---|
| 2928 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2929 | +// // aConstraints.gridheight = 3; |
---|
| 2930 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2931 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2932 | +// scenePanel.setVisible(false); |
---|
| 2933 | +// centralPanel.setVisible(true); |
---|
| 2934 | +// XYZPanel.setVisible(false); |
---|
| 2935 | + bigThree.ClearUI(); |
---|
| 2936 | + bigThree.add(centralPanel); |
---|
| 2937 | + bigThree.FlushUI(); |
---|
| 2938 | + |
---|
| 2939 | + cameraView.requestFocusInWindow(); |
---|
| 2940 | + |
---|
| 2941 | +// refreshContents(true); |
---|
| 2942 | +// |
---|
| 2943 | +// try |
---|
| 2944 | +// { |
---|
| 2945 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 2946 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 2947 | +// bot.mouseMove(100, 100); |
---|
| 2948 | +// bot.mousePress(mask); |
---|
| 2949 | +// bot.mouseRelease(mask); |
---|
| 2950 | +// } |
---|
| 2951 | +// catch (Exception e) |
---|
| 2952 | +// { |
---|
| 2953 | +// |
---|
| 2954 | +// } |
---|
| 2955 | + |
---|
2683 | 2956 | } else |
---|
2684 | | - if (event.getSource() == threeButton) |
---|
| 2957 | + if (source == threeButton) |
---|
2685 | 2958 | { |
---|
2686 | 2959 | radio.layout = threeButton; |
---|
2687 | | - bigThree.remove(scenePanel); |
---|
2688 | | - bigThree.remove(centralPanel); |
---|
2689 | | - bigThree.remove(XYZPanel); |
---|
2690 | | - aWindowConstraints.gridx = 0; |
---|
2691 | | - aWindowConstraints.gridy = 0; |
---|
2692 | | - aWindowConstraints.gridwidth = 1; |
---|
2693 | | - // aConstraints.gridheight = 3; |
---|
2694 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2695 | | - aWindowConstraints.weightx = 0; |
---|
2696 | | - aWindowConstraints.weighty = 1; |
---|
2697 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2698 | | - aWindowConstraints.weightx = 1; |
---|
2699 | | - aWindowConstraints.gridwidth = 3; |
---|
2700 | | - // aConstraints.gridheight = 3; |
---|
2701 | | - aWindowConstraints.gridx = 1; |
---|
2702 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2703 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2704 | | - aWindowConstraints.weightx = 0; |
---|
2705 | | - aWindowConstraints.gridx = 4; |
---|
2706 | | - aWindowConstraints.gridwidth = 1; |
---|
2707 | | - // aConstraints.gridheight = 3; |
---|
2708 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2709 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2710 | | - bigThree.revalidate(); |
---|
| 2960 | + |
---|
| 2961 | +// bigThree.remove(scenePanel); |
---|
| 2962 | +// bigThree.remove(centralPanel); |
---|
| 2963 | +// bigThree.remove(XYZPanel); |
---|
| 2964 | +// aWindowConstraints.gridx = 0; |
---|
| 2965 | +// aWindowConstraints.gridy = 0; |
---|
| 2966 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2967 | +// // aConstraints.gridheight = 3; |
---|
| 2968 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2969 | +// aWindowConstraints.weightx = 0; |
---|
| 2970 | +// aWindowConstraints.weighty = 1; |
---|
| 2971 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2972 | +// aWindowConstraints.weightx = 1; |
---|
| 2973 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2974 | +// // aConstraints.gridheight = 3; |
---|
| 2975 | +// aWindowConstraints.gridx = 1; |
---|
| 2976 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2977 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2978 | +// aWindowConstraints.weightx = 0; |
---|
| 2979 | +// aWindowConstraints.gridx = 4; |
---|
| 2980 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2981 | +// // aConstraints.gridheight = 3; |
---|
| 2982 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2983 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2984 | +// bigThree.validate(); |
---|
| 2985 | +// scenePanel.setVisible(false); |
---|
| 2986 | +// centralPanel.setVisible(true); |
---|
| 2987 | +// XYZPanel.setVisible(true); |
---|
| 2988 | + bigThree.ClearUI(); |
---|
| 2989 | + bigThree.add(centralPanel); |
---|
| 2990 | + bigThree.add(XYZPanel); |
---|
| 2991 | + bigThree.FlushUI(); |
---|
| 2992 | + |
---|
| 2993 | + cameraView.requestFocusInWindow(); |
---|
2711 | 2994 | } else |
---|
2712 | | - if (event.getSource() == fourButton) |
---|
| 2995 | + if (source == fourButton) |
---|
2713 | 2996 | { |
---|
2714 | 2997 | radio.layout = fourButton; |
---|
2715 | | - bigThree.remove(scenePanel); |
---|
2716 | | - bigThree.remove(centralPanel); |
---|
2717 | | - bigThree.remove(XYZPanel); |
---|
2718 | | - aWindowConstraints.gridx = 0; |
---|
2719 | | - aWindowConstraints.gridy = 0; |
---|
2720 | | - aWindowConstraints.gridwidth = 1; |
---|
2721 | | - // aWindowConstraints.gridheight = 3; |
---|
2722 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2723 | | - aWindowConstraints.weightx = 1; |
---|
2724 | | - aWindowConstraints.weighty = 1; |
---|
2725 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2726 | | - aWindowConstraints.weightx = 1; |
---|
2727 | | - aWindowConstraints.gridwidth = 3; |
---|
2728 | | - // aConstraints.gridheight = 3; |
---|
2729 | | - aWindowConstraints.gridx = 1; |
---|
2730 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2731 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2732 | | - aWindowConstraints.weightx = 0; |
---|
2733 | | - aWindowConstraints.gridx = 4; |
---|
2734 | | - aWindowConstraints.gridwidth = 1; |
---|
2735 | | - // aWindowConstraints.gridheight = 3; |
---|
2736 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2737 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2738 | | - bigThree.revalidate(); |
---|
| 2998 | + |
---|
| 2999 | +// bigThree.remove(scenePanel); |
---|
| 3000 | +// bigThree.remove(centralPanel); |
---|
| 3001 | +// bigThree.remove(XYZPanel); |
---|
| 3002 | +// aWindowConstraints.gridx = 0; |
---|
| 3003 | +// aWindowConstraints.gridy = 0; |
---|
| 3004 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3005 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3006 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3007 | +// aWindowConstraints.weightx = 1; |
---|
| 3008 | +// aWindowConstraints.weighty = 1; |
---|
| 3009 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3010 | +// aWindowConstraints.weightx = 1; |
---|
| 3011 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3012 | +// // aConstraints.gridheight = 3; |
---|
| 3013 | +// aWindowConstraints.gridx = 1; |
---|
| 3014 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3015 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3016 | +// aWindowConstraints.weightx = 0; |
---|
| 3017 | +// aWindowConstraints.gridx = 4; |
---|
| 3018 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3019 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3020 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3021 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3022 | +// bigThree.validate(); |
---|
| 3023 | +// scenePanel.setVisible(true); |
---|
| 3024 | +// centralPanel.setVisible(false); |
---|
| 3025 | +// XYZPanel.setVisible(false); |
---|
| 3026 | + bigThree.ClearUI(); |
---|
| 3027 | + bigThree.add(scenePanel); |
---|
| 3028 | + bigThree.FlushUI(); |
---|
| 3029 | + |
---|
| 3030 | + cameraView.requestFocusInWindow(); |
---|
2739 | 3031 | } else |
---|
2740 | | - if (event.getSource() == sixButton) |
---|
| 3032 | + if (source == sixButton) |
---|
2741 | 3033 | { |
---|
2742 | 3034 | radio.layout = sixButton; |
---|
2743 | | - bigThree.remove(scenePanel); |
---|
2744 | | - bigThree.remove(centralPanel); |
---|
2745 | | - bigThree.remove(XYZPanel); |
---|
2746 | | - aWindowConstraints.gridx = 0; |
---|
2747 | | - aWindowConstraints.gridy = 0; |
---|
2748 | | - aWindowConstraints.gridwidth = 1; |
---|
2749 | | - // aConstraints.gridheight = 3; |
---|
2750 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2751 | | - aWindowConstraints.weightx = 0; |
---|
2752 | | - aWindowConstraints.weighty = 1; |
---|
2753 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2754 | | - aWindowConstraints.weightx = 1; |
---|
2755 | | - aWindowConstraints.gridwidth = 3; |
---|
2756 | | - // aWindowConstraints.gridheight = 3; |
---|
2757 | | - aWindowConstraints.gridx = 1; |
---|
2758 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2759 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2760 | | - aWindowConstraints.weightx = 0; |
---|
2761 | | - aWindowConstraints.gridx = 4; |
---|
2762 | | - aWindowConstraints.gridwidth = 1; |
---|
2763 | | - // aWindowConstraints.gridheight = 3; |
---|
2764 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2765 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2766 | | - bigThree.revalidate(); |
---|
| 3035 | + |
---|
| 3036 | +// bigThree.remove(scenePanel); |
---|
| 3037 | +// bigThree.remove(centralPanel); |
---|
| 3038 | +// bigThree.remove(XYZPanel); |
---|
| 3039 | +// aWindowConstraints.gridx = 0; |
---|
| 3040 | +// aWindowConstraints.gridy = 0; |
---|
| 3041 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3042 | +// // aConstraints.gridheight = 3; |
---|
| 3043 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3044 | +// aWindowConstraints.weightx = 0; |
---|
| 3045 | +// aWindowConstraints.weighty = 1; |
---|
| 3046 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3047 | +// aWindowConstraints.weightx = 1; |
---|
| 3048 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3049 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3050 | +// aWindowConstraints.gridx = 1; |
---|
| 3051 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3052 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3053 | +// aWindowConstraints.weightx = 0; |
---|
| 3054 | +// aWindowConstraints.gridx = 4; |
---|
| 3055 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3056 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3057 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3058 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3059 | +// bigThree.validate(); |
---|
| 3060 | +// scenePanel.setVisible(true); |
---|
| 3061 | +// centralPanel.setVisible(true); |
---|
| 3062 | +// XYZPanel.setVisible(false); |
---|
| 3063 | + bigThree.ClearUI(); |
---|
| 3064 | + bigThree.add(scenePanel); |
---|
| 3065 | + bigThree.add(centralPanel); |
---|
| 3066 | + bigThree.FlushUI(); |
---|
| 3067 | + |
---|
| 3068 | + cameraView.requestFocusInWindow(); |
---|
2767 | 3069 | } else |
---|
2768 | | - if (event.getSource() == sevenButton) |
---|
| 3070 | + if (source == sevenButton) |
---|
2769 | 3071 | { |
---|
2770 | 3072 | radio.layout = sevenButton; |
---|
2771 | | - bigThree.remove(scenePanel); |
---|
2772 | | - bigThree.remove(centralPanel); |
---|
2773 | | - bigThree.remove(XYZPanel); |
---|
2774 | | - aWindowConstraints.gridx = 0; |
---|
2775 | | - aWindowConstraints.gridy = 0; |
---|
2776 | | - aWindowConstraints.gridwidth = 1; |
---|
2777 | | - // aWindowConstraints.gridheight = 3; |
---|
2778 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2779 | | - aWindowConstraints.weightx = 0; |
---|
2780 | | - aWindowConstraints.weighty = 1; |
---|
2781 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2782 | | - aWindowConstraints.weightx = 1; |
---|
2783 | | - aWindowConstraints.gridwidth = 3; |
---|
2784 | | - // aWindowConstraints.gridheight = 3; |
---|
2785 | | - aWindowConstraints.gridx = 1; |
---|
2786 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2787 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2788 | | - aWindowConstraints.weightx = 0; |
---|
2789 | | - aWindowConstraints.gridx = 4; |
---|
2790 | | - aWindowConstraints.gridwidth = 1; |
---|
2791 | | - // aConstraints.gridheight = 3; |
---|
2792 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2793 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2794 | | - bigThree.revalidate(); |
---|
| 3073 | + |
---|
| 3074 | +// bigThree.remove(scenePanel); |
---|
| 3075 | +// bigThree.remove(centralPanel); |
---|
| 3076 | +// bigThree.remove(XYZPanel); |
---|
| 3077 | +// aWindowConstraints.gridx = 0; |
---|
| 3078 | +// aWindowConstraints.gridy = 0; |
---|
| 3079 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3080 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3081 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3082 | +// aWindowConstraints.weightx = 0; |
---|
| 3083 | +// aWindowConstraints.weighty = 1; |
---|
| 3084 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3085 | +// aWindowConstraints.weightx = 1; |
---|
| 3086 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3087 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3088 | +// aWindowConstraints.gridx = 1; |
---|
| 3089 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3090 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3091 | +// aWindowConstraints.weightx = 0; |
---|
| 3092 | +// aWindowConstraints.gridx = 4; |
---|
| 3093 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3094 | +// // aConstraints.gridheight = 3; |
---|
| 3095 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3096 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3097 | +// bigThree.validate(); |
---|
| 3098 | +// scenePanel.setVisible(true); |
---|
| 3099 | +// centralPanel.setVisible(true); |
---|
| 3100 | +// XYZPanel.setVisible(true); |
---|
| 3101 | + bigThree.ClearUI(); |
---|
| 3102 | + bigThree.add(scenePanel); |
---|
| 3103 | + bigThree.add(centralPanel); |
---|
| 3104 | + bigThree.add(XYZPanel); |
---|
| 3105 | + bigThree.FlushUI(); |
---|
| 3106 | + |
---|
| 3107 | + cameraView.requestFocusInWindow(); |
---|
2795 | 3108 | } else |
---|
2796 | | - if (event.getSource() == rootButton) |
---|
| 3109 | + if (source == rootButton) |
---|
2797 | 3110 | { |
---|
2798 | 3111 | Object3D obj; |
---|
2799 | 3112 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2803 | 3116 | EditObject(obj); |
---|
2804 | 3117 | } |
---|
2805 | 3118 | |
---|
| 3119 | + cameraView.requestFocusInWindow(); |
---|
2806 | 3120 | refreshContents(true); |
---|
2807 | 3121 | } else |
---|
2808 | | - if (event.getSource() == closeButton) |
---|
| 3122 | + if (source == closeButton) |
---|
2809 | 3123 | { |
---|
2810 | 3124 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2811 | 3125 | cRadio ab; |
---|
.. | .. |
---|
2824 | 3138 | break; |
---|
2825 | 3139 | } |
---|
2826 | 3140 | } |
---|
| 3141 | + |
---|
| 3142 | + cameraView.requestFocusInWindow(); |
---|
2827 | 3143 | refreshContents(true); |
---|
2828 | 3144 | } else |
---|
2829 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3145 | + if (source == editItem || source == editButton) |
---|
2830 | 3146 | { |
---|
2831 | 3147 | EditSelection(false); |
---|
2832 | 3148 | } else |
---|
2833 | | - if (event.getSource() == uneditButton) |
---|
| 3149 | + if (source == uneditButton) |
---|
2834 | 3150 | { |
---|
2835 | 3151 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2836 | 3152 | { |
---|
.. | .. |
---|
2840 | 3156 | child.CloseUI(); |
---|
2841 | 3157 | listUI.remove(child); |
---|
2842 | 3158 | |
---|
2843 | | - child.editWindow = null; // ??????????? |
---|
| 3159 | + //child.editWindow = null; // ??????????? |
---|
2844 | 3160 | } |
---|
2845 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3161 | + objEditor.ctrlPanel.FlushUI(); |
---|
2846 | 3162 | //objEditor.jTree.clearSelection(); |
---|
2847 | 3163 | //objEditor.ResetSliders(); |
---|
2848 | 3164 | refreshContents(true); |
---|
2849 | 3165 | } else |
---|
2850 | | - if (event.getSource() == clearPanelButton) |
---|
| 3166 | + if (source == clearPanelButton) |
---|
2851 | 3167 | { |
---|
2852 | 3168 | assert(copy == group); |
---|
2853 | 3169 | //copy.ClearUI(); |
---|
.. | .. |
---|
2858 | 3174 | listUI.clear(); |
---|
2859 | 3175 | refreshContents(true); |
---|
2860 | 3176 | } else |
---|
2861 | | - if (event.getSource() == allParamsButton) |
---|
| 3177 | + if (source == allParamsButton) |
---|
2862 | 3178 | { |
---|
2863 | 3179 | assert(copy == group); |
---|
2864 | 3180 | |
---|
.. | .. |
---|
2879 | 3195 | |
---|
2880 | 3196 | refreshContents(true); |
---|
2881 | 3197 | } else |
---|
2882 | | - if (event.getSource() == unselectButton) |
---|
| 3198 | + if (source == unselectButton) |
---|
2883 | 3199 | { |
---|
2884 | 3200 | objEditor.jTree.clearSelection(); |
---|
2885 | 3201 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2886 | 3202 | objEditor.ResetSliders(); |
---|
2887 | 3203 | refreshContents(true); |
---|
2888 | 3204 | } else |
---|
2889 | | - if(event.getSource() instanceof cRadio) |
---|
| 3205 | + if(source instanceof cRadio) |
---|
2890 | 3206 | { |
---|
2891 | 3207 | group.parent = keepparent; |
---|
2892 | 3208 | group.attributes = 0; |
---|
2893 | 3209 | //group.editWindow = null; |
---|
2894 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3210 | + /*cRadio*/ radio = (cRadio)source; |
---|
2895 | 3211 | Object3D obj = radio.GetObject(); |
---|
2896 | 3212 | System.out.println("Edit " + obj); |
---|
2897 | 3213 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2911 | 3227 | } |
---|
2912 | 3228 | |
---|
2913 | 3229 | copy = group; |
---|
2914 | | - //CameraPane.theRenderer.object = group; |
---|
| 3230 | + //Globals.theRenderer.object = group; |
---|
2915 | 3231 | if(!useclient) |
---|
2916 | 3232 | { |
---|
2917 | 3233 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2920 | 3236 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2921 | 3237 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2922 | 3238 | cameraView.object = group; |
---|
2923 | | - cameraView.lighttouched = true; |
---|
| 3239 | + //cameraView.lighttouched = true; |
---|
| 3240 | + Globals.lighttouched = true; |
---|
2924 | 3241 | topView.object = group; |
---|
2925 | 3242 | frontView.object = group; |
---|
2926 | 3243 | sideView.object = group; |
---|
2927 | 3244 | } |
---|
2928 | | - group.editWindow = this; |
---|
| 3245 | + |
---|
| 3246 | +// fix "+" issue |
---|
| 3247 | + //group.editWindow = this; |
---|
| 3248 | + |
---|
2929 | 3249 | /* |
---|
2930 | 3250 | currentLayout = radio.layout; |
---|
2931 | 3251 | if (currentLayout == null) |
---|
.. | .. |
---|
2937 | 3257 | //group.parent = null; // ROOT |
---|
2938 | 3258 | //group.attributes = -1; |
---|
2939 | 3259 | ResetModel(); |
---|
| 3260 | + |
---|
| 3261 | + cameraView.requestFocusInWindow(); |
---|
2940 | 3262 | refreshContents(true); |
---|
2941 | | - } |
---|
| 3263 | + } else if (event.getSource() == editCameraItem) |
---|
| 3264 | + { |
---|
| 3265 | + cameraView.ProtectCamera(); |
---|
| 3266 | + cameraView.repaint(); |
---|
| 3267 | + return; |
---|
| 3268 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3269 | + { |
---|
| 3270 | + cameraView.RevertCamera(); |
---|
| 3271 | + cameraView.repaint(); |
---|
| 3272 | + return; |
---|
| 3273 | + // } else if (event.getSource() == textureButton) |
---|
| 3274 | + // { |
---|
| 3275 | + // return; // true; |
---|
| 3276 | + } |
---|
2942 | 3277 | else |
---|
2943 | 3278 | { |
---|
2944 | 3279 | //return super.action(event, arg); |
---|
.. | .. |
---|
2947 | 3282 | } |
---|
2948 | 3283 | |
---|
2949 | 3284 | boolean useclient = false; |
---|
2950 | | - cRadio radio; |
---|
2951 | 3285 | |
---|
2952 | 3286 | void ToggleRoot() |
---|
2953 | 3287 | { |
---|
.. | .. |
---|
2956 | 3290 | if (useclient) |
---|
2957 | 3291 | { |
---|
2958 | 3292 | cameraView.object = client; |
---|
2959 | | - cameraView.lighttouched = true; |
---|
| 3293 | + Globals.lighttouched = true; |
---|
2960 | 3294 | //topView.object = client; |
---|
2961 | 3295 | //frontView.object = client; |
---|
2962 | 3296 | //sideView.object = client; |
---|
.. | .. |
---|
2964 | 3298 | else |
---|
2965 | 3299 | { |
---|
2966 | 3300 | cameraView.object = group; |
---|
2967 | | - cameraView.lighttouched = true; |
---|
| 3301 | + Globals.lighttouched = true; |
---|
2968 | 3302 | //topView.object = group; |
---|
2969 | 3303 | //frontView.object = group; |
---|
2970 | 3304 | //sideView.object = group; |
---|
.. | .. |
---|
2999 | 3333 | refreshContents(); |
---|
3000 | 3334 | } |
---|
3001 | 3335 | |
---|
| 3336 | + void TransformChildren() |
---|
| 3337 | + { |
---|
| 3338 | + Object3D obj; |
---|
| 3339 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3340 | + { |
---|
| 3341 | + obj = (Object3D)e.nextElement(); |
---|
| 3342 | + obj.KeepTextureMatrices(); |
---|
| 3343 | + obj.TransformChildren(); |
---|
| 3344 | + obj.RestoreTextureMatrices(); |
---|
| 3345 | + |
---|
| 3346 | +// if (obj.parent == null) |
---|
| 3347 | +// { |
---|
| 3348 | +// System.out.println("NULL PARENT!"); |
---|
| 3349 | +// new Exception().printStackTrace(); |
---|
| 3350 | +// } |
---|
| 3351 | +// else |
---|
| 3352 | +// TouchTransform(obj); |
---|
| 3353 | +// //obj.parent.Touch(); |
---|
| 3354 | + } |
---|
| 3355 | + |
---|
| 3356 | + refreshContents(); |
---|
| 3357 | + } |
---|
3002 | 3358 | |
---|
3003 | 3359 | void ResetTransform() |
---|
3004 | 3360 | { |
---|
.. | .. |
---|
3111 | 3467 | refreshContents(); |
---|
3112 | 3468 | } |
---|
3113 | 3469 | |
---|
3114 | | - void ResetCentroid() |
---|
| 3470 | + void ResetCentroid(boolean full) |
---|
3115 | 3471 | { |
---|
3116 | 3472 | Object3D obj; |
---|
3117 | 3473 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3126 | 3482 | LA.matIdentity(Object3D.mat); |
---|
3127 | 3483 | obj.getBounds(minima, maxima, false); |
---|
3128 | 3484 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3129 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3485 | + if (full) |
---|
| 3486 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3130 | 3487 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3131 | 3488 | obj.TransformMesh(Object3D.mat); |
---|
| 3489 | + |
---|
3132 | 3490 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3133 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3491 | + if (full) |
---|
| 3492 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3134 | 3493 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3494 | + |
---|
3135 | 3495 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3136 | 3496 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3137 | 3497 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3160 | 3520 | |
---|
3161 | 3521 | int size = obj.MemorySize(); |
---|
3162 | 3522 | |
---|
3163 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3523 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3524 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3164 | 3525 | } |
---|
3165 | 3526 | } |
---|
3166 | 3527 | catch (Exception e) |
---|
.. | .. |
---|
3197 | 3558 | obj = (Object3D)e.nextElement(); |
---|
3198 | 3559 | |
---|
3199 | 3560 | System.out.println("Object is: " + obj); |
---|
3200 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3561 | + Grafreed.AnalyzeObject(obj); |
---|
3201 | 3562 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3202 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3563 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3203 | 3564 | |
---|
3204 | 3565 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3205 | 3566 | } |
---|
.. | .. |
---|
3241 | 3602 | void GenNormals(boolean crease) |
---|
3242 | 3603 | { |
---|
3243 | 3604 | group.GenNormalsS(crease); |
---|
| 3605 | + |
---|
| 3606 | + refreshContents(); |
---|
| 3607 | + } |
---|
| 3608 | + |
---|
| 3609 | + void GenNormalsMESH() |
---|
| 3610 | + { |
---|
| 3611 | + group.GenNormalsMeshS(); |
---|
3244 | 3612 | |
---|
3245 | 3613 | refreshContents(); |
---|
3246 | 3614 | } |
---|
.. | .. |
---|
3413 | 3781 | |
---|
3414 | 3782 | void ParseVertices() |
---|
3415 | 3783 | { |
---|
3416 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3417 | | - GrafreeD.epsequal = true; |
---|
| 3784 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3785 | + Grafreed.epsequal = true; |
---|
3418 | 3786 | |
---|
3419 | 3787 | for (int i=0; i<group.selection.size(); i++) |
---|
3420 | 3788 | { |
---|
.. | .. |
---|
3439 | 3807 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3440 | 3808 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3441 | 3809 | |
---|
3442 | | - g.add(GrafreeD.clipboard); |
---|
| 3810 | + g.add(Grafreed.clipboard); |
---|
3443 | 3811 | |
---|
3444 | 3812 | buffer.add(g); |
---|
3445 | 3813 | } |
---|
.. | .. |
---|
3454 | 3822 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3455 | 3823 | } |
---|
3456 | 3824 | |
---|
3457 | | - GrafreeD.epsequal = epsequal; |
---|
| 3825 | + Grafreed.epsequal = epsequal; |
---|
3458 | 3826 | |
---|
3459 | 3827 | refreshContents(); |
---|
3460 | 3828 | } |
---|
.. | .. |
---|
3472 | 3840 | String pigment = Object3D.GetPigment(tex); |
---|
3473 | 3841 | //String bump = Object3D.GetBump(tex); |
---|
3474 | 3842 | |
---|
3475 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3843 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3844 | + |
---|
| 3845 | + try |
---|
| 3846 | + { |
---|
| 3847 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3848 | + } |
---|
| 3849 | + catch (Exception e) |
---|
| 3850 | + { |
---|
| 3851 | + System.err.println("FAIL: " + node); |
---|
| 3852 | + } |
---|
3476 | 3853 | |
---|
3477 | 3854 | double s = v.s; |
---|
3478 | 3855 | |
---|
.. | .. |
---|
3560 | 3937 | |
---|
3561 | 3938 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3562 | 3939 | |
---|
3563 | | - boolean random = CameraPane.RANDOM; |
---|
3564 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3940 | + boolean random = CameraPane.SWITCH; |
---|
| 3941 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3565 | 3942 | lowres.linkVerticesThis(null); |
---|
3566 | 3943 | lowres.linkVerticesThis(sn); |
---|
3567 | | - CameraPane.RANDOM = random; |
---|
| 3944 | + CameraPane.SWITCH = random; |
---|
3568 | 3945 | |
---|
3569 | 3946 | System.err.flush(); |
---|
3570 | 3947 | |
---|
.. | .. |
---|
3604 | 3981 | return; |
---|
3605 | 3982 | |
---|
3606 | 3983 | Object3D poses = group.selection.get(0); |
---|
3607 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 3984 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3608 | 3985 | |
---|
3609 | 3986 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3610 | 3987 | |
---|
.. | .. |
---|
3773 | 4150 | group.selection.RelinkToSupport(); // july 2014 |
---|
3774 | 4151 | System.out.println("DONE."); |
---|
3775 | 4152 | refreshContents(); |
---|
3776 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4153 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3777 | 4154 | } |
---|
3778 | 4155 | |
---|
3779 | 4156 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3798 | 4175 | |
---|
3799 | 4176 | void ClipMesh() |
---|
3800 | 4177 | { |
---|
3801 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4178 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3802 | 4179 | { |
---|
3803 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4180 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3804 | 4181 | |
---|
3805 | 4182 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3806 | 4183 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3809 | 4186 | // { |
---|
3810 | 4187 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3811 | 4188 | // } |
---|
3812 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4189 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3813 | 4190 | } |
---|
3814 | 4191 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3815 | 4192 | System.out.println("DONE."); |
---|
.. | .. |
---|
3856 | 4233 | void MarkLeaves(boolean hide) |
---|
3857 | 4234 | { |
---|
3858 | 4235 | group.selection.MarkLeaves(hide); |
---|
| 4236 | + refreshContents(); |
---|
| 4237 | + } |
---|
| 4238 | + |
---|
| 4239 | + void RewindLeaves(boolean hide) |
---|
| 4240 | + { |
---|
| 4241 | + group.selection.RewindLeaves(hide); |
---|
| 4242 | + refreshContents(); |
---|
| 4243 | + } |
---|
| 4244 | + |
---|
| 4245 | + void RandomLeaves(boolean hide) |
---|
| 4246 | + { |
---|
| 4247 | + group.selection.RandomLeaves(hide); |
---|
3859 | 4248 | refreshContents(); |
---|
3860 | 4249 | } |
---|
3861 | 4250 | |
---|
.. | .. |
---|
3944 | 4333 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3945 | 4334 | |
---|
3946 | 4335 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3947 | | - if(elem != group) |
---|
| 4336 | + if(elem != group || !newWindow) |
---|
3948 | 4337 | { |
---|
3949 | 4338 | // if (!(elem instanceof Composite)) |
---|
3950 | 4339 | // newWindow = false; |
---|
.. | .. |
---|
4034 | 4423 | //case 702: // Event.LIST_DESELECT |
---|
4035 | 4424 | group.deselectAll(); |
---|
4036 | 4425 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4037 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4038 | 4426 | if (tps != null) |
---|
4039 | 4427 | { |
---|
4040 | 4428 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4043 | 4431 | |
---|
4044 | 4432 | //if (child.parent != null) |
---|
4045 | 4433 | //child.parent.addSelectee(child); |
---|
| 4434 | + objEditor.SetMaterial(child); |
---|
4046 | 4435 | group.addSelectee(child); |
---|
4047 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4048 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4049 | | - System.err.println("info : " + child.GetPath()); |
---|
4050 | 4436 | } |
---|
4051 | 4437 | } |
---|
4052 | | - else |
---|
4053 | | - { |
---|
4054 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4055 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4056 | | - System.err.println("info : " + group.GetPath()); |
---|
4057 | | - } |
---|
| 4438 | +// else |
---|
| 4439 | +// { |
---|
| 4440 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4441 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4442 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4443 | +// } |
---|
4058 | 4444 | |
---|
4059 | | - objEditor.SetText(); // jan 2014 |
---|
4060 | | - |
---|
4061 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4445 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4062 | 4446 | CameraPane.flash = true; |
---|
4063 | 4447 | |
---|
4064 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4448 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4065 | 4449 | // a camera |
---|
4066 | 4450 | { |
---|
4067 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4068 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
4069 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
4070 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4451 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4452 | + { |
---|
| 4453 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4454 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4455 | + } |
---|
| 4456 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4457 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4071 | 4458 | } |
---|
4072 | 4459 | |
---|
4073 | 4460 | refreshContents(); |
---|
.. | .. |
---|
4078 | 4465 | |
---|
4079 | 4466 | freezemodel = false; |
---|
4080 | 4467 | } |
---|
| 4468 | + |
---|
| 4469 | + void refreshContents(boolean cp) |
---|
| 4470 | + { |
---|
| 4471 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4472 | + { |
---|
| 4473 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4474 | + |
---|
| 4475 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4476 | + { |
---|
| 4477 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4478 | + |
---|
| 4479 | + objEditor.AddInfo(child, this, true); |
---|
| 4480 | + System.err.println("info : " + child.GetPath()); |
---|
| 4481 | + } |
---|
| 4482 | + |
---|
| 4483 | + objEditor.SetText(); // jan 2014 |
---|
| 4484 | + } |
---|
| 4485 | + |
---|
| 4486 | + super.refreshContents(cp); |
---|
| 4487 | + } |
---|
4081 | 4488 | |
---|
4082 | 4489 | void linkSomething(Object3D thing) |
---|
4083 | 4490 | { |
---|
.. | .. |
---|
4149 | 4556 | { |
---|
4150 | 4557 | if (group.selection.isEmpty()) |
---|
4151 | 4558 | return; |
---|
4152 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4559 | + |
---|
| 4560 | + Grafreed.clipboardIsTempGroup = false; |
---|
4153 | 4561 | Composite tGroup = null; |
---|
4154 | 4562 | if (group.selection.size() > 0) // 1) |
---|
4155 | 4563 | { |
---|
4156 | 4564 | tGroup = new cGroup(); |
---|
4157 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4565 | + Grafreed.clipboardIsTempGroup = true; |
---|
4158 | 4566 | } |
---|
4159 | 4567 | |
---|
4160 | 4568 | if (cut) |
---|
4161 | 4569 | { |
---|
| 4570 | + Save(); |
---|
4162 | 4571 | //int indices[] = jList.getSelectedIndices(); |
---|
4163 | 4572 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4164 | 4573 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4194 | 4603 | //System.out.println("cut " + child); |
---|
4195 | 4604 | //System.out.println("parent = " + child.parent); |
---|
4196 | 4605 | // tmp.addChild(child); |
---|
4197 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4606 | + if (Grafreed.clipboardIsTempGroup) |
---|
4198 | 4607 | tGroup.add/*Child*/(tmp); |
---|
4199 | 4608 | else |
---|
4200 | | - GrafreeD.clipboard = tmp; |
---|
| 4609 | + Grafreed.clipboard = tmp; |
---|
4201 | 4610 | } |
---|
4202 | 4611 | else |
---|
4203 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4612 | + if (Grafreed.clipboardIsTempGroup) |
---|
4204 | 4613 | tGroup.add/*Child*/(child); |
---|
4205 | 4614 | else |
---|
4206 | | - GrafreeD.clipboard = child; |
---|
| 4615 | + Grafreed.clipboard = child; |
---|
4207 | 4616 | } |
---|
4208 | 4617 | |
---|
4209 | 4618 | //ResetModel(); |
---|
.. | .. |
---|
4235 | 4644 | //System.out.println("cut " + elem); |
---|
4236 | 4645 | //System.out.println("parent = " + elem.parent); |
---|
4237 | 4646 | // tmp.addChild(elem); |
---|
4238 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4647 | + if (Grafreed.clipboardIsTempGroup) |
---|
4239 | 4648 | tGroup.add/*Child*/(tmp); |
---|
4240 | 4649 | else |
---|
4241 | | - GrafreeD.clipboard = tmp; |
---|
| 4650 | + Grafreed.clipboard = tmp; |
---|
4242 | 4651 | } |
---|
4243 | 4652 | else |
---|
4244 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4653 | + if (Grafreed.clipboardIsTempGroup) |
---|
4245 | 4654 | tGroup.add/*Child*/(child); |
---|
4246 | 4655 | else |
---|
4247 | | - GrafreeD.clipboard = child; |
---|
| 4656 | + Grafreed.clipboard = child; |
---|
4248 | 4657 | } |
---|
4249 | 4658 | |
---|
4250 | 4659 | } |
---|
4251 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4252 | | - GrafreeD.clipboard = tGroup; |
---|
| 4660 | + |
---|
| 4661 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4662 | + Grafreed.clipboard = tGroup; |
---|
| 4663 | + |
---|
4253 | 4664 | if (cut) |
---|
4254 | 4665 | { |
---|
4255 | 4666 | ResetModel(); |
---|
.. | .. |
---|
4263 | 4674 | // return; |
---|
4264 | 4675 | boolean first = true; |
---|
4265 | 4676 | |
---|
4266 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4677 | + if (Grafreed.clipboardIsTempGroup) |
---|
4267 | 4678 | { |
---|
4268 | 4679 | Composite temp; |
---|
4269 | 4680 | |
---|
.. | .. |
---|
4274 | 4685 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4275 | 4686 | */ |
---|
4276 | 4687 | Object3D elem; |
---|
4277 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4688 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4278 | 4689 | { |
---|
4279 | 4690 | Object3D child = (Object3D)e.nextElement(); |
---|
4280 | 4691 | |
---|
.. | .. |
---|
4308 | 4719 | //Object3D cb = Applet3D.clipboard; |
---|
4309 | 4720 | //temp.addChild(cb); |
---|
4310 | 4721 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4311 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4312 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4313 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4314 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4315 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4722 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4723 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4724 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4725 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4726 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4316 | 4727 | else |
---|
4317 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4318 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4728 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4729 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4319 | 4730 | } |
---|
4320 | 4731 | |
---|
4321 | 4732 | ResetModel(); |
---|
4322 | 4733 | refreshContents(); |
---|
4323 | 4734 | } |
---|
4324 | 4735 | |
---|
4325 | | - void pasteInto(boolean copyit) |
---|
| 4736 | + void pasteInto(boolean copyit, boolean clone) |
---|
4326 | 4737 | { |
---|
4327 | 4738 | // if (GrafreeD.clipboard == null) |
---|
4328 | 4739 | // return; |
---|
.. | .. |
---|
4351 | 4762 | if (copyit) |
---|
4352 | 4763 | { |
---|
4353 | 4764 | // paste(false); |
---|
4354 | | - CloneClipboard(false); // sept 2014 |
---|
| 4765 | + if (clone) |
---|
| 4766 | + { |
---|
| 4767 | + CloneClipboard(false); // sept 2014 |
---|
| 4768 | + } |
---|
| 4769 | + else |
---|
| 4770 | + { |
---|
| 4771 | + paste(false); |
---|
| 4772 | + } |
---|
4355 | 4773 | } |
---|
4356 | 4774 | else |
---|
4357 | 4775 | { |
---|
4358 | 4776 | boolean first = true; |
---|
4359 | 4777 | |
---|
4360 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4778 | + if (Grafreed.clipboardIsTempGroup) |
---|
4361 | 4779 | { |
---|
4362 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4780 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4363 | 4781 | Object3D copy; |
---|
4364 | 4782 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4365 | 4783 | { |
---|
.. | .. |
---|
4369 | 4787 | } |
---|
4370 | 4788 | } else |
---|
4371 | 4789 | { |
---|
4372 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4790 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4373 | 4791 | } |
---|
4374 | 4792 | } |
---|
4375 | 4793 | } |
---|
.. | .. |
---|
4774 | 5192 | } |
---|
4775 | 5193 | */ |
---|
4776 | 5194 | |
---|
4777 | | - void ImportGFD() |
---|
4778 | | - { |
---|
4779 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4780 | | - browser.show(); |
---|
4781 | | - String filename = browser.getFile(); |
---|
4782 | | - if (filename != null && filename.length() > 0) |
---|
4783 | | - { |
---|
4784 | | - String fullname = browser.getDirectory() + filename; |
---|
4785 | | - |
---|
4786 | | - //Object3D readobj = |
---|
4787 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4788 | | - //makeSomething(readobj); |
---|
4789 | | - } |
---|
4790 | | - } |
---|
4791 | | - |
---|
4792 | 5195 | /* |
---|
4793 | 5196 | public void Callback(Object obj) |
---|
4794 | 5197 | { |
---|
.. | .. |
---|
4812 | 5215 | } |
---|
4813 | 5216 | */ |
---|
4814 | 5217 | |
---|
4815 | | - void ImportVRMLX3D() |
---|
4816 | | - { |
---|
4817 | | - if (GrafreeD.standAlone) |
---|
4818 | | - { |
---|
4819 | | - /**/ |
---|
4820 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4821 | | - browser.show(); |
---|
4822 | | - String filename = browser.getFile(); |
---|
4823 | | - if (filename != null && filename.length() > 0) |
---|
4824 | | - { |
---|
4825 | | - String fullname = browser.getDirectory() + filename; |
---|
4826 | | - LoadVRMLX3D(fullname); |
---|
4827 | | - } |
---|
4828 | | - /**/ |
---|
4829 | | - } |
---|
4830 | | - } |
---|
4831 | | - |
---|
4832 | 5218 | String GetFile(String dialogName) |
---|
4833 | 5219 | { |
---|
4834 | | - if (GrafreeD.standAlone) |
---|
| 5220 | + if (Grafreed.standAlone) |
---|
4835 | 5221 | { |
---|
4836 | 5222 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4837 | 5223 | browser.show(); |
---|
.. | .. |
---|
4895 | 5281 | cButton flashSelectionButton; |
---|
4896 | 5282 | cButton editButton; |
---|
4897 | 5283 | cButton uneditButton; |
---|
| 5284 | + JCheckBox allParamsButton; |
---|
4898 | 5285 | cButton clearpanelButton; |
---|
4899 | | - cButton allParamsButton; |
---|
4900 | 5286 | cButton unselectButton; |
---|
4901 | 5287 | |
---|
| 5288 | + cButton minButton; |
---|
| 5289 | + cButton maxButton; |
---|
| 5290 | + cButton fullButton; |
---|
| 5291 | + cButton undoButton; |
---|
| 5292 | + cButton redoButton; |
---|
| 5293 | + cButton saveButton; |
---|
| 5294 | + cButton oneStepButton; |
---|
| 5295 | + |
---|
4902 | 5296 | cButton screenfitButton; |
---|
4903 | 5297 | cButton screenfitpointButton; |
---|
4904 | 5298 | cButton snapobjectButton; |
---|
.. | .. |
---|
4909 | 5303 | cButton closeButton; |
---|
4910 | 5304 | |
---|
4911 | 5305 | cButton setsupportButton; |
---|
4912 | | - |
---|
4913 | | - cButton twoButton; |
---|
4914 | | - cButton sixButton; |
---|
4915 | | - cButton threeButton; |
---|
4916 | | - cButton sevenButton; |
---|
4917 | | - cButton fourButton; // full panel |
---|
4918 | | - cButton oneButton; // full XYZ |
---|
4919 | | - //cButton currentLayout; |
---|
4920 | 5306 | |
---|
4921 | 5307 | // |
---|
4922 | 5308 | //Composite |
---|
.. | .. |
---|
4929 | 5315 | private MenuItem lookFromItem; |
---|
4930 | 5316 | private MenuItem switchItem; |
---|
4931 | 5317 | private MenuItem cutItem; |
---|
| 5318 | + private MenuItem undoItem; |
---|
| 5319 | + private MenuItem redoItem; |
---|
4932 | 5320 | private MenuItem duplicateItem; |
---|
4933 | 5321 | private MenuItem cloneItem; |
---|
4934 | 5322 | private MenuItem cloneSupportItem; |
---|
.. | .. |
---|
4942 | 5330 | private MenuItem linkverticesItem; |
---|
4943 | 5331 | private MenuItem relinkverticesItem; |
---|
4944 | 5332 | private MenuItem setMasterItem; |
---|
4945 | | - private MenuItem resetMeshItem; |
---|
| 5333 | + private MenuItem resetAllItem; |
---|
4946 | 5334 | private MenuItem stepAllItem; |
---|
4947 | 5335 | private MenuItem revertMeshItem; |
---|
4948 | 5336 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4953 | 5341 | private MenuItem mergeGeometriesItem; |
---|
4954 | 5342 | private MenuItem copyItem; |
---|
4955 | 5343 | private MenuItem pasteItem; |
---|
| 5344 | + private MenuItem pasteIntoItem; |
---|
4956 | 5345 | private MenuItem pasteLinkItem; |
---|
4957 | 5346 | private MenuItem pasteCloneItem; |
---|
4958 | 5347 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
4991 | 5380 | private MenuItem showleavesItem; |
---|
4992 | 5381 | private MenuItem markleavesItem; |
---|
4993 | 5382 | private MenuItem unmarkleavesItem; |
---|
| 5383 | + private MenuItem rewindleavesItem; |
---|
| 5384 | + private MenuItem unrewindleavesItem; |
---|
| 5385 | + private MenuItem randomleavesItem; |
---|
| 5386 | + private MenuItem unrandomleavesItem; |
---|
4994 | 5387 | |
---|
4995 | 5388 | private MenuItem flipVItem; |
---|
4996 | 5389 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5002 | 5395 | private MenuItem panoTexturesItem; |
---|
5003 | 5396 | |
---|
5004 | 5397 | private MenuItem resetCentroidItem; |
---|
5005 | | - private MenuItem transformgeometryItem; |
---|
| 5398 | + private MenuItem resetCentroidXZItem; |
---|
5006 | 5399 | private MenuItem resetTransformItem; |
---|
| 5400 | + private MenuItem transformGeometryItem; |
---|
| 5401 | + private MenuItem transformChildrenItem; |
---|
5007 | 5402 | private MenuItem hideItem; |
---|
5008 | 5403 | private MenuItem grabItem; |
---|
5009 | 5404 | private MenuItem backItem; |
---|
.. | .. |
---|
5050 | 5445 | private MenuItem blobItem; |
---|
5051 | 5446 | private MenuItem latheItem; |
---|
5052 | 5447 | private MenuItem bezierItem; |
---|
5053 | | - private MenuItem checkerItem; |
---|
| 5448 | + private MenuItem overlayItem; |
---|
5054 | 5449 | private MenuItem meshItem; |
---|
5055 | 5450 | // private MenuItem meshGroupItem; |
---|
5056 | 5451 | private MenuItem springItem; |
---|
.. | .. |
---|
5072 | 5467 | private MenuItem doubleItem; |
---|
5073 | 5468 | private MenuItem tripleItem; |
---|
5074 | 5469 | |
---|
5075 | | - private MenuItem importGFDItem; |
---|
5076 | | - private MenuItem importVRMLX3DItem; |
---|
5077 | | - private MenuItem import3DSItem; |
---|
5078 | | - private MenuItem importOBJItem; |
---|
5079 | | - |
---|
5080 | 5470 | private MenuItem computeAOItem; |
---|
5081 | 5471 | private MenuItem recompileItem; |
---|
5082 | 5472 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5086 | 5476 | private MenuItem analyzeItem; |
---|
5087 | 5477 | private MenuItem dumpItem; |
---|
5088 | 5478 | //boolean freezemodel = false; |
---|
| 5479 | + |
---|
| 5480 | + Menu cameraMenu; |
---|
| 5481 | + MenuItem editCameraItem; |
---|
| 5482 | + MenuItem revertCameraItem; |
---|
5089 | 5483 | } |
---|