.. | .. |
---|
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 | + oe.jTree = new cTree(); |
---|
| 154 | + |
---|
| 155 | + Menu menu; |
---|
| 156 | + oe.menuBar.add(menu = new Menu("Edit")); |
---|
| 157 | + //editItem = menu.add(new MenuItem("Edit")); |
---|
| 158 | + //editItem.addActionListener(this); |
---|
| 159 | + |
---|
| 160 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 161 | +// undoItem.addActionListener(this); |
---|
| 162 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 163 | +// redoItem.addActionListener(this); |
---|
| 164 | +// menu.add("-"); |
---|
| 165 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
| 166 | + duplicateItem.addActionListener(this); |
---|
| 167 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 168 | + cloneItem.addActionListener(this); |
---|
| 169 | + if (Globals.ADVANCED) |
---|
| 170 | + { |
---|
| 171 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 172 | + cloneSupportItem.addActionListener(this); |
---|
| 173 | + } |
---|
| 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 | + |
---|
| 182 | + menu.add("-"); |
---|
| 183 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 184 | + pasteIntoItem.addActionListener(this); |
---|
| 185 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 186 | + pasteLinkItem.addActionListener(this); |
---|
| 187 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 188 | + pasteCloneItem.addActionListener(this); |
---|
| 189 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 190 | +// pasteExpandItem.addActionListener(this); |
---|
| 191 | + menu.add("-"); |
---|
| 192 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 193 | + clearItem.addActionListener(this); |
---|
| 194 | + |
---|
| 195 | + if (Globals.ADVANCED) |
---|
| 196 | + { |
---|
| 197 | + // Deletes the cameras... |
---|
| 198 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 199 | + clearAllItem.addActionListener(this); |
---|
| 200 | + } |
---|
| 201 | + |
---|
| 202 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 203 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 204 | + //zBufferItem.addActionListener(this); |
---|
| 205 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 206 | + //normalLensItem.addActionListener(this); |
---|
| 207 | + cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 208 | + revertCameraItem.addActionListener(this); |
---|
| 209 | + |
---|
| 210 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 211 | + toggleFullScreenItem.addItemListener(this); |
---|
| 212 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 213 | + cameraMenu.add("-"); |
---|
| 214 | + |
---|
| 215 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 216 | + toggleTextureItem.addItemListener(this); |
---|
| 217 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 218 | + |
---|
| 219 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 220 | + toggleSwitchItem.addItemListener(this); |
---|
| 221 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 222 | + |
---|
| 223 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 224 | + toggleHandleItem.addItemListener(this); |
---|
| 225 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 226 | + |
---|
| 227 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 228 | + togglePaintItem.addItemListener(this); |
---|
| 229 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 230 | + |
---|
| 231 | + if (Globals.ADVANCED) |
---|
| 232 | + { |
---|
| 233 | + cameraMenu.add("-"); |
---|
| 234 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 235 | + toggleLiveItem.addItemListener(this); |
---|
| 236 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 237 | + |
---|
| 238 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 239 | + stepItem.addActionListener(this); |
---|
| 240 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 241 | + // toggleDLItem.addItemListener(this); |
---|
| 242 | + // toggleDLItem.setState(false); |
---|
| 243 | + |
---|
| 244 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 245 | + toggleRenderItem.addItemListener(this); |
---|
| 246 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 247 | + |
---|
| 248 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 249 | + toggleDebugItem.addItemListener(this); |
---|
| 250 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 251 | + |
---|
| 252 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 253 | + toggleFrustumItem.addItemListener(this); |
---|
| 254 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 255 | + |
---|
| 256 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 257 | + toggleFootContactItem.addItemListener(this); |
---|
| 258 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 259 | + |
---|
| 260 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 261 | + toggleTimelineItem.addItemListener(this); |
---|
| 262 | + } |
---|
| 263 | + |
---|
| 264 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 265 | +// toggleRootItem.addItemListener(this); |
---|
| 266 | +// toggleRootItem.setState(false); |
---|
| 267 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 268 | +// animationItem.addItemListener(this); |
---|
| 269 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 270 | + cameraMenu.add("-"); |
---|
| 271 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 272 | + editCameraItem.addActionListener(this); |
---|
| 273 | + |
---|
| 274 | + if (Globals.ADVANCED) |
---|
| 275 | + { |
---|
152 | 276 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 277 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 278 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 284 | lookAtItem.addActionListener(this); |
---|
161 | 285 | //lookFromItem.addActinoListener(this); |
---|
162 | 286 | //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 | | - |
---|
| 287 | + } |
---|
| 288 | + |
---|
192 | 289 | 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); |
---|
| 290 | + if (Globals.ADVANCED) |
---|
| 291 | + { |
---|
197 | 292 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 293 | revertMeshItem.addActionListener(this); |
---|
199 | 294 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 295 | resetreferencesItem.addActionListener(this); |
---|
201 | 296 | menu.add("-"); |
---|
| 297 | + } |
---|
202 | 298 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 299 | overwriteGeoItem.addActionListener(this); |
---|
204 | 300 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 306 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 307 | overwriteUVItem.addActionListener(this); |
---|
212 | 308 | menu.add("-"); |
---|
| 309 | + if (Globals.ADVANCED) |
---|
| 310 | + { |
---|
213 | 311 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 312 | generateMeshItem.addActionListener(this); |
---|
215 | 313 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 314 | poseMeshItem.addActionListener(this); |
---|
217 | 315 | menu.add("-"); |
---|
| 316 | + } |
---|
218 | 317 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 318 | resetsupportItem.addActionListener(this); |
---|
220 | 319 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 320 | linkverticesItem.addActionListener(this); |
---|
222 | 321 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 322 | relinkverticesItem.addActionListener(this); |
---|
| 323 | + |
---|
| 324 | + if (Globals.ADVANCED) |
---|
| 325 | + { |
---|
224 | 326 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 327 | setMasterItem.addActionListener(this); |
---|
| 328 | + } |
---|
226 | 329 | |
---|
227 | 330 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | 331 | grabItem = menu.add(new MenuItem("Grab")); |
---|
.. | .. |
---|
233 | 336 | frontItem.addActionListener(this); |
---|
234 | 337 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | 338 | compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 339 | + |
---|
| 340 | + if (Globals.ADVANCED) |
---|
| 341 | + { |
---|
| 342 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 343 | hideItem.addActionListener(this); |
---|
| 344 | + } |
---|
238 | 345 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 346 | ungroupItem.addActionListener(this); |
---|
| 347 | + |
---|
240 | 348 | menu.add("-"); |
---|
241 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 349 | + |
---|
| 350 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
242 | 351 | 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); |
---|
| 352 | + if (Globals.ADVANCED) |
---|
| 353 | + { |
---|
247 | 354 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 355 | switchGeoItem.addActionListener(this); |
---|
249 | 356 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 357 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 358 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 359 | morphItem.addActionListener(this); |
---|
| 360 | + |
---|
| 361 | + menu.add("-"); |
---|
| 362 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 363 | + physicsItem.addActionListener(this); |
---|
| 364 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 365 | + frameselectorItem.addActionListener(this); |
---|
253 | 366 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 367 | scriptNodeItem.addActionListener(this); |
---|
255 | 368 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | 369 | cameraItem.addActionListener(this); |
---|
| 370 | + } |
---|
257 | 371 | |
---|
258 | 372 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | 373 | textureItem = menu.add(new MenuItem("Texture")); |
---|
.. | .. |
---|
262 | 376 | billboardItem.addActionListener(this); |
---|
263 | 377 | csgItem = menu.add(new MenuItem("CSG")); |
---|
264 | 378 | csgItem.addActionListener(this); |
---|
265 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 379 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
266 | 380 | shadowXItem.addActionListener(this); |
---|
267 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 381 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
268 | 382 | shadowYItem.addActionListener(this); |
---|
269 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 383 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
270 | 384 | shadowZItem.addActionListener(this); |
---|
| 385 | + if (Globals.ADVANCED) |
---|
| 386 | + { |
---|
| 387 | + menu.add("-"); |
---|
271 | 388 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 389 | linkerItem.addActionListener(this); |
---|
273 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
274 | | - templateItem.addActionListener(this); |
---|
275 | 390 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | 391 | attributeItem.addActionListener(this); |
---|
| 392 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 393 | + templateItem.addActionListener(this); |
---|
277 | 394 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 395 | pointflowItem.addActionListener(this); |
---|
| 396 | + } |
---|
279 | 397 | menu.add("-"); |
---|
280 | 398 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 399 | resetTransformItem.addActionListener(this); |
---|
282 | 400 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
283 | 401 | resetCentroidItem.addActionListener(this); |
---|
284 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
285 | | - transformgeometryItem.addActionListener(this); |
---|
| 402 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 403 | + resetCentroidXZItem.addActionListener(this); |
---|
| 404 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 405 | + transformGeometryItem.addActionListener(this); |
---|
| 406 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 407 | + transformChildrenItem.addActionListener(this); |
---|
286 | 408 | |
---|
287 | 409 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
288 | 410 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
293 | 415 | genNormalsCADItem.addActionListener(this); |
---|
294 | 416 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 417 | genNormalsMESHItem.addActionListener(this); |
---|
| 418 | + if (Globals.ADVANCED) |
---|
| 419 | + { |
---|
296 | 420 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
297 | 421 | genNormalsMINEItem.addActionListener(this); |
---|
| 422 | + } |
---|
298 | 423 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 424 | stripifyItem.addActionListener(this); |
---|
300 | 425 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 441 | reduce34MeshItem.addActionListener(this); |
---|
317 | 442 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 443 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 444 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 445 | clipMeshItem.addActionListener(this); |
---|
| 446 | + |
---|
| 447 | + if (Globals.ADVANCED) |
---|
| 448 | + { |
---|
| 449 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 450 | + smoothMeshItem.addActionListener(this); |
---|
| 451 | + } |
---|
323 | 452 | |
---|
324 | 453 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 454 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
326 | 455 | clearMaterialsItem.addActionListener(this); |
---|
| 456 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 457 | + resetAllItem.addActionListener(this); |
---|
| 458 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 459 | + stepAllItem.addActionListener(this); |
---|
327 | 460 | menu.add("-"); |
---|
328 | 461 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
329 | 462 | liveleavesItem.addActionListener(this); |
---|
330 | 463 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 464 | unliveleavesItem.addActionListener(this); |
---|
| 465 | + if (Globals.ADVANCED) |
---|
| 466 | + { |
---|
332 | 467 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 468 | supportleavesItem.addActionListener(this); |
---|
334 | 469 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 470 | unsupportleavesItem.addActionListener(this); |
---|
| 471 | + } |
---|
336 | 472 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 473 | hideleavesItem.addActionListener(this); |
---|
338 | 474 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
341 | 477 | markleavesItem.addActionListener(this); |
---|
342 | 478 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
343 | 479 | unmarkleavesItem.addActionListener(this); |
---|
| 480 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 481 | + rewindleavesItem.addActionListener(this); |
---|
| 482 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 483 | + unrewindleavesItem.addActionListener(this); |
---|
| 484 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 485 | + randomleavesItem.addActionListener(this); |
---|
| 486 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 487 | + unrandomleavesItem.addActionListener(this); |
---|
344 | 488 | menu.add("-"); |
---|
345 | 489 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
346 | 490 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
376 | 520 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 521 | sortbynameItem.addActionListener(this); |
---|
378 | 522 | menu.add("-"); |
---|
| 523 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 524 | + shareGeometriesItem.addActionListener(this); |
---|
| 525 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 526 | + mergeGeometriesItem.addActionListener(this); |
---|
| 527 | + if (Globals.ADVANCED) |
---|
| 528 | + { |
---|
| 529 | + // Pretty much the same as duplicate and clone. |
---|
379 | 530 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 531 | extractGeometriesItem.addActionListener(this); |
---|
381 | 532 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
382 | 533 | 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); |
---|
| 534 | + } |
---|
387 | 535 | |
---|
388 | 536 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 537 | buildCreateMenu(menu); |
---|
390 | 538 | |
---|
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 | 539 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 540 | buildToolsMenu(menu); |
---|
404 | 541 | } |
---|
405 | 542 | |
---|
406 | 543 | void SetupUI2(ObjEditor oe) |
---|
407 | 544 | { |
---|
| 545 | + // June 2019 |
---|
| 546 | + if (oe == null) |
---|
| 547 | + { |
---|
| 548 | + //super.SetupUI2(this); |
---|
| 549 | + //return; |
---|
| 550 | + } |
---|
| 551 | + |
---|
| 552 | + if (copy != group) |
---|
| 553 | + { |
---|
| 554 | + //super.SetupUI2(this); |
---|
| 555 | + } |
---|
| 556 | + |
---|
408 | 557 | //new Exception().printStackTrace(); |
---|
409 | 558 | |
---|
410 | 559 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
433 | 582 | oe.radioPanel.add(dummyButton); |
---|
434 | 583 | oe.buttonGroup.add(dummyButton); |
---|
435 | 584 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
437 | | - oe.aConstraints.gridwidth = 1; |
---|
438 | | - oe.aConstraints.gridx = 0; |
---|
| 585 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
439 | 586 | |
---|
440 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 587 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + //minButton.setToolTipText("Minimize window"); |
---|
| 589 | + //minButton.addActionListener(this); |
---|
| 590 | + |
---|
| 591 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 592 | + maxButton.setToolTipText("Maximize window"); |
---|
| 593 | + maxButton.addActionListener(this); |
---|
| 594 | + |
---|
| 595 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 597 | + fullButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + oe.toolboxPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + undoButton.setToolTipText("Undo changes"); |
---|
| 601 | + undoButton.addActionListener(this); |
---|
| 602 | + |
---|
| 603 | + oe.toolboxPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 604 | + redoButton.setToolTipText("Redo changes"); |
---|
| 605 | + redoButton.addActionListener(this); |
---|
| 606 | + |
---|
| 607 | + oe.toolboxPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + saveButton.setToolTipText("Save changes"); |
---|
| 609 | + saveButton.addActionListener(this); |
---|
| 610 | + |
---|
| 611 | + oe.toolboxPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 612 | + liveCB.setToolTipText("Enable animation"); |
---|
441 | 613 | liveCB.addItemListener(this); |
---|
442 | 614 | |
---|
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); |
---|
| 615 | + oe.toolboxPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 617 | + oneStepButton.addActionListener(this); |
---|
| 618 | + |
---|
| 619 | + oe.toolboxPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 620 | + fastCB.setToolTipText("Fast mode"); |
---|
461 | 621 | 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); |
---|
| 622 | + |
---|
| 623 | + oe.toolboxPanel.Return(); |
---|
| 624 | + |
---|
| 625 | + oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 626 | + trackCB.setToolTipText("Enable tracking"); |
---|
503 | 627 | trackCB.addItemListener(this); |
---|
504 | 628 | |
---|
505 | | - oe.aConstraints.gridx += 1; |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 629 | + oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 630 | + screenfitButton.setToolTipText("Screen fit"); |
---|
507 | 631 | screenfitButton.addActionListener(this); |
---|
508 | | - oe.aConstraints.gridx += 1; |
---|
| 632 | + |
---|
509 | 633 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
510 | 634 | // 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 | 635 | |
---|
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); |
---|
| 636 | + if (Globals.ADVANCED) |
---|
| 637 | + { |
---|
| 638 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + snapobjectButton.addActionListener(this); |
---|
| 640 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 641 | + } |
---|
| 642 | + |
---|
| 643 | + oe.toolboxPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 644 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
522 | 645 | flashSelectionButton.addActionListener(this); |
---|
523 | | - oe.aConstraints.gridx += 1; |
---|
524 | | - oe.aConstraints.weighty = 0; |
---|
525 | | - oe.aConstraints.gridwidth = 1; |
---|
526 | 646 | |
---|
527 | | - // |
---|
528 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 647 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 648 | + |
---|
| 649 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 650 | + twoButton.setToolTipText("Show center view only"); |
---|
529 | 651 | twoButton.addActionListener(this); |
---|
530 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 652 | + this.fullscreenLayout = twoButton; |
---|
| 653 | + |
---|
| 654 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
531 | 655 | fourButton.addActionListener(this); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 656 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 657 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 658 | + sixButton.setToolTipText("2-column layout left"); |
---|
533 | 659 | sixButton.addActionListener(this); |
---|
534 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 660 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + threeButton.setToolTipText("2-column layout right"); |
---|
535 | 662 | threeButton.addActionListener(this); |
---|
536 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 663 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 664 | + sevenButton.setToolTipText("3-column layout"); |
---|
537 | 665 | sevenButton.addActionListener(this); |
---|
538 | 666 | // |
---|
539 | 667 | |
---|
540 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 668 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 669 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
541 | 670 | rootButton.addActionListener(this); |
---|
542 | | - oe.aConstraints.gridx += 1; |
---|
543 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 671 | + |
---|
| 672 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 673 | + closeButton.setToolTipText("Close tab"); |
---|
544 | 674 | closeButton.addActionListener(this); |
---|
545 | 675 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
546 | 676 | //clearButton.addActionListener(this); |
---|
547 | | - oe.aConstraints.gridx += 1; |
---|
548 | | - |
---|
549 | | - oe.aConstraints.gridx = 1; // |
---|
550 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
551 | | - editButton.addActionListener(this); |
---|
552 | | - oe.aConstraints.gridx += 1; |
---|
553 | | - oe.aConstraints.weighty = 0; |
---|
554 | | - oe.aConstraints.gridwidth = 1; |
---|
555 | 677 | |
---|
556 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 678 | + // INSERT |
---|
| 679 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 680 | + gridButton.setToolTipText("Create grid"); |
---|
| 681 | + gridButton.addActionListener(this); |
---|
| 682 | + |
---|
| 683 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 684 | + boxButton.setToolTipText("Create box"); |
---|
| 685 | + boxButton.addActionListener(this); |
---|
| 686 | + |
---|
| 687 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 688 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 689 | + sphereButton.addActionListener(this); |
---|
| 690 | + |
---|
| 691 | + oe.toolboxPanel.Return(); |
---|
| 692 | + |
---|
| 693 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 694 | + coneButton.setToolTipText("Create cone"); |
---|
| 695 | + coneButton.addActionListener(this); |
---|
| 696 | + |
---|
| 697 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 698 | + torusButton.setToolTipText("Create torus"); |
---|
| 699 | + torusButton.addActionListener(this); |
---|
| 700 | + |
---|
| 701 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 702 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 703 | + superButton.addActionListener(this); |
---|
| 704 | + |
---|
| 705 | + if (Globals.ADVANCED) |
---|
| 706 | + { |
---|
| 707 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 709 | + kleinButton.addActionListener(this); |
---|
| 710 | + } |
---|
| 711 | + |
---|
| 712 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 714 | + particlesButton.addActionListener(this); |
---|
| 715 | + |
---|
| 716 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 717 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 718 | + overlayButton.addActionListener(this); |
---|
| 719 | + |
---|
| 720 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 721 | + lightButton.setToolTipText("Create light"); |
---|
| 722 | + lightButton.addActionListener(this); |
---|
| 723 | + |
---|
| 724 | + // EDIT panel |
---|
| 725 | + editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 726 | + editButton.setToolTipText("Edit selection"); |
---|
| 727 | + editButton.addActionListener(this); |
---|
| 728 | + |
---|
| 729 | + editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 730 | + uneditButton.setToolTipText("Unedit selection"); |
---|
557 | 731 | uneditButton.addActionListener(this); |
---|
558 | 732 | |
---|
559 | | - oe.aConstraints.gridx += 1; |
---|
560 | | - oe.aConstraints.weighty = 0; |
---|
561 | | - oe.aConstraints.gridwidth = 1; |
---|
562 | | - |
---|
563 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
564 | | - clearPanelButton.addActionListener(this); |
---|
565 | | - |
---|
566 | | - oe.aConstraints.gridx += 1; |
---|
567 | | - oe.aConstraints.weighty = 0; |
---|
568 | | - oe.aConstraints.gridwidth = 1; |
---|
569 | | - |
---|
570 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 733 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 734 | + allParamsButton.setToolTipText("Edit all params"); |
---|
571 | 735 | allParamsButton.addActionListener(this); |
---|
572 | 736 | |
---|
573 | | - oe.aConstraints.gridx += 1; |
---|
574 | | - oe.aConstraints.weighty = 0; |
---|
575 | | - oe.aConstraints.gridwidth = 1; |
---|
576 | | - |
---|
577 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 737 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 739 | + clearPanelButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 742 | + unselectButton.setToolTipText("Unselect"); |
---|
578 | 743 | unselectButton.addActionListener(this); |
---|
579 | 744 | |
---|
| 745 | + editCommandsPanel.preferredHeight = 1; |
---|
| 746 | + |
---|
| 747 | +// oe.treePanel.add(commandsPanel); |
---|
| 748 | +// oe.treePanel.Return(); |
---|
| 749 | + |
---|
580 | 750 | // oe.aConstraints.gridx += 1; |
---|
581 | 751 | // oe.aConstraints.weighty = 0; |
---|
582 | 752 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
588 | 758 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
589 | 759 | // gcButton.addActionListener(this); |
---|
590 | 760 | |
---|
591 | | - oe.aConstraints.gridx = 0; |
---|
592 | | - oe.aConstraints.gridy += 1; |
---|
593 | | - |
---|
594 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
595 | | - oe.aConstraints.gridwidth = 100; |
---|
596 | | - // oe.aConstraints.gridheight = 100; |
---|
597 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
598 | | - oe.aConstraints.gridheight = 1; |
---|
599 | | - oe.aConstraints.weighty = 0.5; |
---|
600 | | - oe.aConstraints.gridx = 0; |
---|
601 | | - JScrollPane jSP; |
---|
| 761 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 762 | + |
---|
| 763 | + JScrollPane jSP; |
---|
602 | 764 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
603 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 765 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
604 | 766 | ResetModel(); |
---|
605 | | - oe.aConstraints.weighty = 0.5; |
---|
606 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
607 | | - oe.aConstraints.gridy += 1; |
---|
608 | | - oe.aConstraints.gridwidth = 1; |
---|
| 767 | + |
---|
| 768 | + oe.treePanel.add(jSPPanel); |
---|
| 769 | + oe.treePanel.Return(); |
---|
609 | 770 | |
---|
610 | | - oe.aConstraints.weighty = 0; |
---|
611 | | - oe.aConstraints.gridwidth = 2; |
---|
612 | | - |
---|
613 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 771 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 772 | + |
---|
| 773 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 774 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
614 | 775 | colorCB.addItemListener(this); |
---|
615 | | - oe.aConstraints.gridx += 2; |
---|
616 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 776 | + |
---|
| 777 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 778 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
617 | 779 | materialCB.addItemListener(this); |
---|
618 | | - oe.aConstraints.gridx += 2; |
---|
619 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 780 | + |
---|
| 781 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 782 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
620 | 783 | textureCB.addItemListener(this); |
---|
621 | 784 | |
---|
622 | | - oe.aConstraints.gridx = 0; |
---|
623 | | - oe.aConstraints.gridy += 1; |
---|
| 785 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 786 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 787 | + oe.treePanel.Return(); |
---|
624 | 788 | |
---|
| 789 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 790 | +// mainPanel.setResizeWeight(0.5); |
---|
| 791 | + |
---|
625 | 792 | //jList.addListSelectionListener(this); |
---|
626 | 793 | oe.jTree.addTreeSelectionListener(this); |
---|
627 | 794 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
643 | 810 | radio.layout = sevenButton; |
---|
644 | 811 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
645 | 812 | } |
---|
| 813 | + |
---|
| 814 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 815 | + { |
---|
| 816 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 817 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 818 | + boxCB.addItemListener(this); |
---|
| 819 | + |
---|
| 820 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 821 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 822 | + zoomBoxCB.addItemListener(this); |
---|
| 823 | + |
---|
| 824 | + if (true) // Globals.ADVANCED) |
---|
| 825 | + { |
---|
| 826 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 827 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 828 | + supportCB.addItemListener(this); |
---|
| 829 | + |
---|
| 830 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 831 | + // localCB.addItemListener(this); |
---|
| 832 | + |
---|
| 833 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 834 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 835 | + crowdCB.addItemListener(this); |
---|
| 836 | + |
---|
| 837 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 838 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 839 | + smoothCB.addItemListener(this); |
---|
| 840 | + |
---|
| 841 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 842 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 843 | + slowCB.addItemListener(this); |
---|
| 844 | + |
---|
| 845 | +// constraints.gridy += 1; |
---|
| 846 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 847 | +// speakerMocapCB.addItemListener(this); |
---|
| 848 | + |
---|
| 849 | + if (false) |
---|
| 850 | + { |
---|
| 851 | + // handled in scripts |
---|
| 852 | + //constraints.gridy += 1; |
---|
| 853 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 854 | + speakerCameraCB.addItemListener(this); |
---|
| 855 | + |
---|
| 856 | + //constraints.gridy += 1; |
---|
| 857 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 858 | + speakerFocusCB.addItemListener(this); |
---|
| 859 | + |
---|
| 860 | + //constraints.gridy += 1; |
---|
| 861 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 862 | + smoothfocusCB.addItemListener(this); |
---|
| 863 | + } |
---|
| 864 | + |
---|
| 865 | +//constraints.gridx += 1; |
---|
| 866 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 867 | +// debugCB.addItemListener(this); |
---|
| 868 | + |
---|
| 869 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 870 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 871 | + oeilCB.addItemListener(this); |
---|
| 872 | + |
---|
| 873 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 874 | + shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 875 | + shadowCB.addItemListener(this); |
---|
| 876 | + |
---|
| 877 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 878 | + autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
| 879 | + autosaveCB.addItemListener(this); |
---|
| 880 | + |
---|
| 881 | + if (Globals.ADVANCED) |
---|
| 882 | + { |
---|
| 883 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 884 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 885 | + lookAtCB.addItemListener(this); |
---|
| 886 | + } |
---|
| 887 | + |
---|
| 888 | + } |
---|
| 889 | + |
---|
| 890 | + cGridBag fill = new cGridBag(); |
---|
| 891 | + |
---|
| 892 | + fill.preferredHeight = 200; |
---|
| 893 | + |
---|
| 894 | + panel.add(fill); |
---|
| 895 | + |
---|
| 896 | + } |
---|
646 | 897 | |
---|
647 | 898 | void EditObject(Object3D obj) |
---|
648 | 899 | { |
---|
649 | | - cRadio dummyButton = new cRadio(obj.name); |
---|
650 | | - dummyButton.SetObject(obj); |
---|
651 | | - dummyButton.layout = sevenButton; |
---|
652 | | - dummyButton.SetCamera(cameraView.renderCamera, false); |
---|
653 | | - dummyButton.addActionListener(this); |
---|
654 | | - radioPanel.add(dummyButton); |
---|
655 | | - buttonGroup.add(dummyButton); |
---|
656 | | - dummyButton.doClick(); |
---|
| 900 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 901 | + |
---|
| 902 | + // Patch to avoid bug with transparency. |
---|
| 903 | + radioButton.hadMaterial = obj.material != null; |
---|
| 904 | + if (!radioButton.hadMaterial) |
---|
| 905 | + { |
---|
| 906 | + obj.material = new cMaterial(); |
---|
| 907 | + } |
---|
| 908 | + |
---|
| 909 | + radioButton.SetObject(obj); |
---|
| 910 | + radioButton.layout = sevenButton; |
---|
| 911 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 912 | + radioButton.addActionListener(this); |
---|
| 913 | + radioPanel.add(radioButton); |
---|
| 914 | + buttonGroup.add(radioButton); |
---|
| 915 | + radioButton.doClick(); |
---|
657 | 916 | } |
---|
| 917 | + |
---|
658 | 918 | void SetupViews(ObjEditor oe) |
---|
659 | 919 | { |
---|
| 920 | + theFrame = this; |
---|
| 921 | + |
---|
660 | 922 | oe.SetupViews(); |
---|
661 | 923 | |
---|
662 | 924 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
665 | 927 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
666 | 928 | } |
---|
667 | 929 | |
---|
668 | | - JCheckBox liveCB; |
---|
669 | | - JCheckBox supportCB; |
---|
670 | | - JCheckBox localCB; |
---|
671 | | - JCheckBox crowdCB; |
---|
672 | | - JCheckBox smoothCB; |
---|
673 | | - JCheckBox fastCB; |
---|
674 | | - JCheckBox slowCB; |
---|
675 | | - JCheckBox boxCB; |
---|
676 | | - JCheckBox trackCB; |
---|
677 | | - JCheckBox smoothfocusCB; |
---|
| 930 | + cToggleButton liveCB; |
---|
| 931 | + cCheckBox supportCB; |
---|
| 932 | + cCheckBox localCB; |
---|
| 933 | + cCheckBox crowdCB; |
---|
| 934 | + cCheckBox smoothCB; |
---|
| 935 | + cToggleButton fastCB; |
---|
| 936 | + cCheckBox slowCB; |
---|
| 937 | + cCheckBox boxCB; |
---|
| 938 | + cCheckBox zoomBoxCB; |
---|
| 939 | + cToggleButton trackCB; |
---|
| 940 | + cCheckBox smoothfocusCB; |
---|
678 | 941 | // JCheckBox speakerMocapCB; |
---|
679 | | - JCheckBox speakerCameraCB; |
---|
680 | | - JCheckBox speakerFocusCB; |
---|
681 | | - JCheckBox debugCB; |
---|
682 | | - JCheckBox oeilCB; |
---|
683 | | - JCheckBox lookAtCB; |
---|
| 942 | + cCheckBox speakerCameraCB; |
---|
| 943 | + cCheckBox speakerFocusCB; |
---|
| 944 | + cCheckBox debugCB; |
---|
| 945 | + |
---|
| 946 | + cCheckBox oeilCB; |
---|
| 947 | + cCheckBox shadowCB; |
---|
| 948 | + cCheckBox autosaveCB; |
---|
| 949 | + cCheckBox lookAtCB; |
---|
684 | 950 | |
---|
685 | 951 | // static int COLOR = 1; |
---|
686 | 952 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
688 | 954 | |
---|
689 | 955 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
690 | 956 | |
---|
691 | | - JCheckBox colorCB; |
---|
692 | | - JCheckBox materialCB; |
---|
693 | | - JCheckBox textureCB; |
---|
| 957 | + cCheckBox colorCB; |
---|
| 958 | + cCheckBox materialCB; |
---|
| 959 | + cCheckBox textureCB; |
---|
694 | 960 | |
---|
695 | 961 | public void itemStateChanged(ItemEvent e) |
---|
696 | 962 | { |
---|
.. | .. |
---|
715 | 981 | dropAttributes |= Object3D.TEXTURE; |
---|
716 | 982 | else |
---|
717 | 983 | dropAttributes &= ~Object3D.TEXTURE; |
---|
718 | | - } |
---|
719 | | - else if(e.getSource() == liveCB) |
---|
| 984 | + } else if(e.getSource() == liveCB) |
---|
720 | 985 | { |
---|
721 | 986 | cameraView.ToggleLive(); |
---|
| 987 | + refreshContents(false); |
---|
722 | 988 | } |
---|
723 | 989 | else if(e.getSource() == supportCB) |
---|
724 | 990 | { |
---|
.. | .. |
---|
754 | 1020 | cameraView.repaint(); |
---|
755 | 1021 | // refreshContents(); |
---|
756 | 1022 | } |
---|
| 1023 | + else if(e.getSource() == zoomBoxCB) |
---|
| 1024 | + { |
---|
| 1025 | + cameraView.ToggleZoomBoxMode(); |
---|
| 1026 | + } |
---|
757 | 1027 | else if(e.getSource() == smoothfocusCB) |
---|
758 | 1028 | { |
---|
759 | 1029 | cameraView.ToggleSmoothFocus(); |
---|
.. | .. |
---|
779 | 1049 | { |
---|
780 | 1050 | cameraView.ToggleOeil(); |
---|
781 | 1051 | } |
---|
| 1052 | + else if(e.getSource() == shadowCB) |
---|
| 1053 | + { |
---|
| 1054 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1055 | + } |
---|
| 1056 | + else if(e.getSource() == autosaveCB) |
---|
| 1057 | + { |
---|
| 1058 | + Globals.SAVEONMAKE ^= true; |
---|
| 1059 | + } |
---|
782 | 1060 | else if(e.getSource() == lookAtCB) |
---|
783 | 1061 | { |
---|
784 | 1062 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
795 | 1073 | |
---|
796 | 1074 | /**/ |
---|
797 | 1075 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
798 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1076 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1077 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
799 | 1078 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
800 | 1079 | // We can't move the root node or an empty selection |
---|
801 | 1080 | return; |
---|
.. | .. |
---|
867 | 1146 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
868 | 1147 | // return; |
---|
869 | 1148 | // } |
---|
870 | | - if (string.charAt(0) == '/') |
---|
| 1149 | + |
---|
| 1150 | + // File path for Mac and Windows |
---|
| 1151 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
871 | 1152 | { |
---|
872 | 1153 | // file(s) |
---|
873 | 1154 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
894 | 1175 | |
---|
895 | 1176 | flashIt = false; |
---|
896 | 1177 | CameraPane pane = (CameraPane) target; |
---|
897 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1178 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
898 | 1179 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
899 | 1180 | |
---|
900 | 1181 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
917 | 1198 | return; |
---|
918 | 1199 | } |
---|
919 | 1200 | |
---|
920 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
921 | | - { |
---|
| 1201 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1202 | +// { |
---|
922 | 1203 | loadClipboard(true); |
---|
923 | 1204 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
924 | | - pasteInto(false); |
---|
925 | | - } else { |
---|
926 | | - loadClipboard(false); |
---|
927 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
928 | | - pasteInto(false); // true); // ??? |
---|
929 | | - } |
---|
| 1205 | + pasteInto(false, false); |
---|
| 1206 | +// } else { |
---|
| 1207 | +// loadClipboard(false); |
---|
| 1208 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1209 | +// pasteInto(false, false); // true); // ??? |
---|
| 1210 | +// } |
---|
930 | 1211 | } |
---|
931 | 1212 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
932 | 1213 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1047 | 1328 | kleinItem.addActionListener(this); |
---|
1048 | 1329 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1049 | 1330 | particleItem.addActionListener(this); |
---|
| 1331 | + if (Globals.ADVANCED) |
---|
| 1332 | + { |
---|
1050 | 1333 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1051 | 1334 | ragdollItem.addActionListener(this); |
---|
1052 | 1335 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1053 | 1336 | ragdoll2Item.addActionListener(this); |
---|
| 1337 | + } |
---|
1054 | 1338 | menu.add("-"); |
---|
1055 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1339 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1056 | 1340 | meshItem.addActionListener(this); |
---|
1057 | 1341 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1058 | 1342 | // meshGroupItem.addActionListener(this); |
---|
| 1343 | + if (Globals.ADVANCED) |
---|
| 1344 | + { |
---|
1059 | 1345 | springItem = menu.add(new MenuItem("Spring")); |
---|
1060 | 1346 | springItem.addActionListener(this); |
---|
1061 | 1347 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1062 | 1348 | flagItem.addActionListener(this); |
---|
1063 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1064 | | - bezierItem.addActionListener(this); |
---|
1065 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1066 | | - checkerItem.addActionListener(this); |
---|
1067 | 1349 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1068 | 1350 | blobItem.addActionListener(this); |
---|
1069 | 1351 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1070 | 1352 | latheItem.addActionListener(this); |
---|
| 1353 | + } |
---|
| 1354 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1355 | + bezierItem.addActionListener(this); |
---|
| 1356 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1357 | + overlayItem.addActionListener(this); |
---|
1071 | 1358 | lightItem = menu.add(new MenuItem("Light")); |
---|
1072 | 1359 | lightItem.addActionListener(this); |
---|
1073 | 1360 | menu.add("-"); |
---|
.. | .. |
---|
1077 | 1364 | loopItem.addActionListener(this); |
---|
1078 | 1365 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1079 | 1366 | doubleItem.addActionListener(this); |
---|
| 1367 | + if (Globals.ADVANCED) |
---|
| 1368 | + { |
---|
1080 | 1369 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1081 | 1370 | tripleItem.addActionListener(this); |
---|
| 1371 | + } |
---|
1082 | 1372 | } |
---|
1083 | 1373 | |
---|
1084 | 1374 | void buildToolsMenu(Menu menu) |
---|
1085 | 1375 | { |
---|
1086 | 1376 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1087 | 1377 | animationItem.addItemListener(this); |
---|
1088 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1378 | + animationItem.setState(Globals.ANIMATION); |
---|
1089 | 1379 | |
---|
1090 | 1380 | menu.add("-"); |
---|
1091 | 1381 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1092 | 1382 | parseverticesItem.addActionListener(this); |
---|
1093 | 1383 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1094 | 1384 | textureFieldItem.addActionListener(this); |
---|
1095 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1385 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1096 | 1386 | alignItem.addActionListener(this); |
---|
1097 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1098 | | - mirrorItem.addActionListener(this); |
---|
1099 | 1387 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1100 | 1388 | reduceMorphItem.addActionListener(this); |
---|
1101 | 1389 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1102 | 1390 | reduce34MorphItem.addActionListener(this); |
---|
1103 | | - |
---|
| 1391 | + menu.add("-"); |
---|
1104 | 1392 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1105 | 1393 | computeAOItem.addActionListener(this); |
---|
1106 | | - menu.add("-"); |
---|
1107 | 1394 | |
---|
| 1395 | + if (Globals.ADVANCED) |
---|
| 1396 | + { |
---|
| 1397 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1398 | + mirrorItem.addActionListener(this); |
---|
| 1399 | + menu.add("-"); |
---|
1108 | 1400 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1109 | 1401 | memoryItem.addActionListener(this); |
---|
1110 | 1402 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1111 | 1403 | analyzeItem.addActionListener(this); |
---|
1112 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1404 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1113 | 1405 | dumpItem.addActionListener(this); |
---|
1114 | 1406 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1115 | 1407 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1118 | 1410 | resetParentItem.addActionListener(this); |
---|
1119 | 1411 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1120 | 1412 | repairParentItem.addActionListener(this); |
---|
| 1413 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1414 | + repairShadowItem.addActionListener(this); |
---|
1121 | 1415 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1122 | 1416 | invariantsItem.addActionListener(this); |
---|
1123 | 1417 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1125 | 1419 | menu.add("-"); |
---|
1126 | 1420 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1127 | 1421 | editScriptItem.addActionListener(this); |
---|
| 1422 | + } |
---|
1128 | 1423 | } |
---|
1129 | 1424 | |
---|
1130 | 1425 | void ScreenFit() |
---|
.. | .. |
---|
1247 | 1542 | shadow.material = new cMaterial(obj.material); |
---|
1248 | 1543 | shadow.material.diffuse = 0.0001f; |
---|
1249 | 1544 | shadow.material.specular = 0.0001f; |
---|
| 1545 | + //shadow.projectedVertices[1].x = 300; |
---|
1250 | 1546 | |
---|
1251 | 1547 | makeSomething(shadow); |
---|
1252 | 1548 | } |
---|
.. | .. |
---|
1453 | 1749 | |
---|
1454 | 1750 | void Overwrite(int mask) |
---|
1455 | 1751 | { |
---|
1456 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1752 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1457 | 1753 | { |
---|
1458 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1754 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1459 | 1755 | |
---|
1460 | 1756 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1461 | 1757 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1478 | 1774 | // |
---|
1479 | 1775 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1480 | 1776 | { |
---|
| 1777 | + Object source = event.getSource(); |
---|
1481 | 1778 | /* |
---|
1482 | 1779 | if (event.getSource() == nameField) |
---|
1483 | 1780 | { |
---|
.. | .. |
---|
1489 | 1786 | } |
---|
1490 | 1787 | else |
---|
1491 | 1788 | */ |
---|
1492 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1789 | + if (source == lookAtItem || source == lookFromItem) |
---|
1493 | 1790 | { |
---|
1494 | 1791 | ScreenFit(); |
---|
1495 | 1792 | } else |
---|
1496 | | - if (event.getSource() == switchItem) |
---|
| 1793 | + if (source == switchItem) |
---|
1497 | 1794 | { |
---|
1498 | 1795 | cVector v1 = new cVector(); |
---|
1499 | 1796 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1502 | 1799 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1503 | 1800 | objEditor.cameraView.repaint(); |
---|
1504 | 1801 | } else |
---|
1505 | | - if (event.getSource() == rectoidItem) |
---|
| 1802 | + if (source == rectoidItem || source == boxButton) |
---|
1506 | 1803 | { |
---|
1507 | 1804 | makeSomething(new Box()); |
---|
1508 | 1805 | } else |
---|
1509 | | - if (event.getSource() == particleItem) |
---|
| 1806 | + if (source == particleItem || source == particlesButton) |
---|
1510 | 1807 | { |
---|
1511 | 1808 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1512 | 1809 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1527 | 1824 | applyExample(particleGeom, "SMOKE"); |
---|
1528 | 1825 | makeSomething(particleGeom); |
---|
1529 | 1826 | } else |
---|
1530 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1827 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1531 | 1828 | { |
---|
1532 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1829 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1533 | 1830 | |
---|
1534 | 1831 | ragdoll.toParent = LA.newMatrix(); |
---|
1535 | 1832 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1547 | 1844 | } else |
---|
1548 | 1845 | /* |
---|
1549 | 1846 | */ |
---|
1550 | | - if (event.getSource() == heightFieldItem) |
---|
| 1847 | + if (source == heightFieldItem) |
---|
1551 | 1848 | { |
---|
1552 | 1849 | Object3D obj = new Object3D(); |
---|
1553 | 1850 | |
---|
.. | .. |
---|
1585 | 1882 | |
---|
1586 | 1883 | makeSomething(obj); |
---|
1587 | 1884 | } else |
---|
1588 | | - if (event.getSource() == gridItem) |
---|
| 1885 | + if (source == gridItem || source == gridButton) |
---|
1589 | 1886 | { |
---|
1590 | 1887 | makeSomething(new Grid()); |
---|
1591 | 1888 | } else |
---|
1592 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1889 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1593 | 1890 | { |
---|
1594 | 1891 | makeSomething(new Sphere()); |
---|
1595 | 1892 | } else |
---|
1596 | | - if (event.getSource() == coneItem) |
---|
| 1893 | + if (source == coneItem || source == coneButton) |
---|
1597 | 1894 | { |
---|
1598 | 1895 | makeSomething(new Cone()); |
---|
1599 | 1896 | } else |
---|
1600 | | - if (event.getSource() == torusItem) |
---|
| 1897 | + if (source == torusItem || source == torusButton) |
---|
1601 | 1898 | { |
---|
1602 | 1899 | makeSomething(new Torus()); |
---|
1603 | 1900 | } else |
---|
1604 | | - if (event.getSource() == superItem) |
---|
| 1901 | + if (source == superItem || source == superButton) |
---|
1605 | 1902 | { |
---|
1606 | 1903 | makeSomething(new Superellipsoid()); |
---|
1607 | 1904 | } else |
---|
1608 | | - if (event.getSource() == kleinItem) |
---|
| 1905 | + if (source == kleinItem || source == kleinButton) |
---|
1609 | 1906 | { |
---|
1610 | 1907 | makeSomething(new Klein()); |
---|
1611 | 1908 | } else |
---|
1612 | | - if (event.getSource() == blobItem) |
---|
| 1909 | + if (source == blobItem) |
---|
1613 | 1910 | { |
---|
1614 | 1911 | Blob blob = new Blob(); |
---|
1615 | 1912 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1617 | 1914 | //blob.retile(); |
---|
1618 | 1915 | makeSomething(blob); |
---|
1619 | 1916 | } else |
---|
1620 | | - if (event.getSource() == latheItem) |
---|
| 1917 | + if (source == latheItem) |
---|
1621 | 1918 | { |
---|
1622 | 1919 | makeSomething(new Lathe()); |
---|
1623 | 1920 | } else |
---|
1624 | | - if (event.getSource() == bezierItem) |
---|
| 1921 | + if (source == bezierItem) |
---|
1625 | 1922 | { |
---|
1626 | 1923 | makeSomething(new BezierSurface()); |
---|
1627 | 1924 | } else |
---|
1628 | | - if (event.getSource() == checkerItem) |
---|
| 1925 | + if (source == overlayItem || source == overlayButton) |
---|
1629 | 1926 | { |
---|
1630 | 1927 | /* |
---|
1631 | 1928 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1640 | 1937 | */ |
---|
1641 | 1938 | makeSomething(new Checker()); |
---|
1642 | 1939 | } else |
---|
1643 | | - if (event.getSource() == meshItem) |
---|
| 1940 | + if (source == meshItem) |
---|
1644 | 1941 | { |
---|
1645 | 1942 | Object3D itemtomake = new Object3D(); |
---|
1646 | 1943 | Object3D child; |
---|
.. | .. |
---|
1661 | 1958 | makeSomething(child); |
---|
1662 | 1959 | } |
---|
1663 | 1960 | } else |
---|
1664 | | - if (event.getSource() == springItem) |
---|
| 1961 | + if (source == springItem) |
---|
1665 | 1962 | { |
---|
1666 | 1963 | cSpring s = new cSpring(); |
---|
1667 | 1964 | s.setup(); |
---|
1668 | 1965 | makeSomething(s); |
---|
1669 | 1966 | } else |
---|
1670 | | - if (event.getSource() == flagItem) |
---|
| 1967 | + if (source == flagItem) |
---|
1671 | 1968 | { |
---|
1672 | 1969 | cSpring s = new cFlag(); |
---|
1673 | 1970 | s.setup(); |
---|
1674 | 1971 | makeSomething(s); |
---|
1675 | 1972 | } else |
---|
1676 | | - if (event.getSource() == lightItem) |
---|
| 1973 | + if (source == lightItem || source == lightButton) |
---|
1677 | 1974 | { |
---|
1678 | 1975 | makeSomething(new Light()); |
---|
1679 | 1976 | } else |
---|
1680 | | - if (event.getSource() == csgItem) |
---|
| 1977 | + if (source == csgItem) |
---|
1681 | 1978 | { |
---|
1682 | 1979 | group(new CSG()); |
---|
1683 | 1980 | } else |
---|
1684 | | - if (event.getSource() == templateItem) |
---|
| 1981 | + if (source == templateItem) |
---|
1685 | 1982 | { |
---|
1686 | 1983 | group(new cTemplate()); |
---|
1687 | 1984 | } else |
---|
1688 | | - if (event.getSource() == attributeItem) |
---|
| 1985 | + if (source == attributeItem) |
---|
1689 | 1986 | { |
---|
1690 | 1987 | makeSomething(new Attribute()); |
---|
1691 | 1988 | } else |
---|
1692 | | - if (event.getSource() == pointflowItem) |
---|
| 1989 | + if (source == pointflowItem) |
---|
1693 | 1990 | { |
---|
1694 | 1991 | makeSomething(new PointFlow()); |
---|
1695 | 1992 | } else |
---|
.. | .. |
---|
1701 | 1998 | } else |
---|
1702 | 1999 | */ |
---|
1703 | 2000 | |
---|
1704 | | - if (event.getSource() == superLoopItem) |
---|
| 2001 | + if (source == superLoopItem) |
---|
1705 | 2002 | { |
---|
1706 | 2003 | Composite g = new cGroup(); |
---|
1707 | 2004 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1723 | 2020 | |
---|
1724 | 2021 | group(g); |
---|
1725 | 2022 | } else |
---|
1726 | | - if (event.getSource() == loopItem) |
---|
| 2023 | + if (source == loopItem) |
---|
1727 | 2024 | { |
---|
1728 | 2025 | Composite csg = new GroupLeaf(); |
---|
1729 | 2026 | csg.count = 5; |
---|
.. | .. |
---|
1732 | 2029 | csg.addChild(child); |
---|
1733 | 2030 | child.addChild(csg); |
---|
1734 | 2031 | } else |
---|
1735 | | - if (event.getSource() == doubleItem) |
---|
| 2032 | + if (source == doubleItem) |
---|
1736 | 2033 | { |
---|
1737 | 2034 | Composite csg = new GroupLeaf(); |
---|
1738 | 2035 | csg.count = 5; |
---|
.. | .. |
---|
1744 | 2041 | csg.addChild(child); |
---|
1745 | 2042 | child.addChild(csg); |
---|
1746 | 2043 | } else |
---|
1747 | | - if (event.getSource() == tripleItem) |
---|
| 2044 | + if (source == tripleItem) |
---|
1748 | 2045 | { |
---|
1749 | 2046 | Composite csg = new GroupLeaf(); |
---|
1750 | 2047 | csg.count = 4; |
---|
.. | .. |
---|
1759 | 2056 | csg.addChild(child); |
---|
1760 | 2057 | child.addChild(csg); |
---|
1761 | 2058 | } else |
---|
1762 | | - |
---|
1763 | | - if (event.getSource() == importGFDItem) |
---|
| 2059 | + if (source == computeAOItem) |
---|
1764 | 2060 | { |
---|
1765 | | - ImportGFD(); |
---|
| 2061 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 2062 | + Globals.theRenderer.repaint(); |
---|
1766 | 2063 | } else |
---|
1767 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1768 | | - { |
---|
1769 | | - ImportVRMLX3D(); |
---|
1770 | | - } else |
---|
1771 | | - if (event.getSource() == import3DSItem) |
---|
1772 | | - { |
---|
1773 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1774 | | - } else |
---|
1775 | | - if (event.getSource() == importOBJItem) |
---|
1776 | | - { |
---|
1777 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1778 | | - } else |
---|
1779 | | - if (event.getSource() == computeAOItem) |
---|
1780 | | - { |
---|
1781 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1782 | | - CameraPane.theRenderer.repaint(); |
---|
1783 | | - } else |
---|
1784 | | - if (event.getSource() == recompileItem) |
---|
| 2064 | + if (source == recompileItem) |
---|
1785 | 2065 | { |
---|
1786 | 2066 | Recompile(); |
---|
1787 | 2067 | refreshContents(); |
---|
1788 | 2068 | } else |
---|
1789 | | - if (event.getSource() == editScriptItem) |
---|
| 2069 | + if (source == editScriptItem) |
---|
1790 | 2070 | { |
---|
1791 | 2071 | OpenDialog(); |
---|
1792 | 2072 | refreshContents(); |
---|
1793 | 2073 | } else |
---|
1794 | | - if (event.getSource() == invariantsItem) |
---|
| 2074 | + if (source == invariantsItem) |
---|
1795 | 2075 | { |
---|
1796 | 2076 | System.out.println("Invariants:"); |
---|
1797 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2077 | + Grafreed.grafreeD.universe.invariants(); |
---|
1798 | 2078 | } else |
---|
1799 | | - if (event.getSource() == memoryItem) |
---|
| 2079 | + if (source == memoryItem) |
---|
1800 | 2080 | { |
---|
1801 | 2081 | //System.out.println("Invariants:"); |
---|
1802 | 2082 | PrintMemory(); |
---|
1803 | 2083 | } else |
---|
1804 | | - if (event.getSource() == pathItem) |
---|
| 2084 | + if (source == pathItem) |
---|
1805 | 2085 | { |
---|
1806 | 2086 | PrintPath(); |
---|
1807 | 2087 | } else |
---|
1808 | | - if (event.getSource() == analyzeItem) |
---|
| 2088 | + if (source == analyzeItem) |
---|
1809 | 2089 | { |
---|
1810 | 2090 | AnalyzeObject(); |
---|
1811 | 2091 | } else |
---|
1812 | | - if (event.getSource() == dumpItem) |
---|
| 2092 | + if (source == dumpItem) |
---|
1813 | 2093 | { |
---|
1814 | 2094 | DumpObject(); |
---|
1815 | 2095 | } else |
---|
1816 | | - if (event.getSource() == screenfitButton) |
---|
| 2096 | + if (source == minButton) |
---|
| 2097 | + { |
---|
| 2098 | + Minimize(); |
---|
| 2099 | + } else |
---|
| 2100 | + if (source == maxButton) |
---|
| 2101 | + { |
---|
| 2102 | + Maximize(); |
---|
| 2103 | + } else |
---|
| 2104 | + if (source == fullButton) |
---|
| 2105 | + { |
---|
| 2106 | + ToggleFullScreen(); |
---|
| 2107 | + } else |
---|
| 2108 | + if (source == undoButton) |
---|
| 2109 | + { |
---|
| 2110 | + Undo(); |
---|
| 2111 | + } else |
---|
| 2112 | + if (source == redoButton) |
---|
| 2113 | + { |
---|
| 2114 | + Redo(); |
---|
| 2115 | + } else |
---|
| 2116 | + if (source == saveButton) |
---|
| 2117 | + { |
---|
| 2118 | + Save(); |
---|
| 2119 | + } else |
---|
| 2120 | + if (source == oneStepButton) |
---|
| 2121 | + { |
---|
| 2122 | + Globals.ONESTEP = true; |
---|
| 2123 | + cameraView.repaint(); |
---|
| 2124 | + } else |
---|
| 2125 | + if (source == screenfitButton) |
---|
1817 | 2126 | { |
---|
1818 | 2127 | //Reload(lastConverter, lastFilename, true); |
---|
1819 | 2128 | ScreenFit(); |
---|
1820 | 2129 | } else |
---|
1821 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2130 | + if (source == screenfitpointButton) |
---|
1822 | 2131 | { |
---|
1823 | 2132 | //Reload(lastConverter, lastFilename, true); |
---|
1824 | 2133 | ScreenFitPoint(); |
---|
1825 | 2134 | } else |
---|
1826 | | - if (event.getSource() == snapobjectButton) |
---|
| 2135 | + if (source == snapobjectButton) |
---|
1827 | 2136 | { |
---|
1828 | 2137 | //Reload(lastConverter, lastFilename, true); |
---|
1829 | 2138 | SnapObject(); |
---|
.. | .. |
---|
1834 | 2143 | // Recompile(); |
---|
1835 | 2144 | // refreshContents(); |
---|
1836 | 2145 | // } else |
---|
1837 | | - if (event.getSource() == gcButton) |
---|
| 2146 | + if (source == gcButton) |
---|
1838 | 2147 | { |
---|
1839 | 2148 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1840 | 2149 | System.gc(); |
---|
1841 | 2150 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1842 | 2151 | } else |
---|
1843 | | - if (event.getSource() == editLeafItem) |
---|
| 2152 | + if (source == editLeafItem) |
---|
1844 | 2153 | { |
---|
1845 | 2154 | Object3D obj; |
---|
1846 | 2155 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1854 | 2163 | } |
---|
1855 | 2164 | refreshContents(true); |
---|
1856 | 2165 | } else |
---|
1857 | | - if (event.getSource() == openWindowItem) |
---|
| 2166 | + if (source == openWindowItem) |
---|
1858 | 2167 | { |
---|
1859 | 2168 | EditSelection(true); |
---|
1860 | 2169 | } else |
---|
1861 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2170 | + if (source == cutItem || source == clearButton) |
---|
1862 | 2171 | { |
---|
1863 | 2172 | loadClipboard(true); |
---|
1864 | 2173 | } else |
---|
1865 | | - if (event.getSource() == duplicateItem) |
---|
| 2174 | + if (source == undoItem) |
---|
1866 | 2175 | { |
---|
1867 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2176 | + Undo(); |
---|
| 2177 | + } else |
---|
| 2178 | + if (source == redoItem) |
---|
| 2179 | + { |
---|
| 2180 | + Redo(); |
---|
| 2181 | + } else |
---|
| 2182 | + if (source == duplicateItem) |
---|
| 2183 | + { |
---|
| 2184 | + Object3D keep = Grafreed.clipboard; |
---|
1868 | 2185 | loadClipboard(false); |
---|
1869 | 2186 | paste(false); |
---|
1870 | | - GrafreeD.clipboard = keep; |
---|
| 2187 | + Grafreed.clipboard = keep; |
---|
1871 | 2188 | } else |
---|
1872 | | - if (event.getSource() == cloneItem) |
---|
| 2189 | + if (source == cloneItem) |
---|
1873 | 2190 | { |
---|
1874 | 2191 | CloneSelection(false); |
---|
1875 | 2192 | } else |
---|
1876 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2193 | + if (source == cloneSupportItem) |
---|
1877 | 2194 | { |
---|
1878 | 2195 | CloneSelection(true); |
---|
1879 | 2196 | } else |
---|
1880 | | - if (event.getSource() == copyItem) |
---|
| 2197 | + if (source == copyItem) |
---|
1881 | 2198 | { |
---|
1882 | 2199 | loadClipboard(false); |
---|
1883 | 2200 | } else |
---|
1884 | | - if (event.getSource() == pasteItem) |
---|
| 2201 | + if (source == pasteItem) |
---|
1885 | 2202 | { |
---|
1886 | 2203 | paste(false); |
---|
1887 | 2204 | } else |
---|
1888 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2205 | + if (source == pasteIntoItem) |
---|
1889 | 2206 | { |
---|
1890 | | - pasteInto(false); |
---|
| 2207 | + pasteInto(true, false); |
---|
1891 | 2208 | } else |
---|
1892 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2209 | + if (source == pasteLinkItem) |
---|
1893 | 2210 | { |
---|
1894 | | - pasteInto(true); |
---|
| 2211 | + pasteInto(false, false); |
---|
1895 | 2212 | } else |
---|
1896 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2213 | + if (source == pasteCloneItem) |
---|
| 2214 | + { |
---|
| 2215 | + pasteInto(true, true); |
---|
| 2216 | + } else |
---|
| 2217 | + if (source == pasteExpandItem) |
---|
1897 | 2218 | { |
---|
1898 | 2219 | paste(true); |
---|
1899 | 2220 | } else |
---|
1900 | | - if (event.getSource() == synchronizeItem) |
---|
| 2221 | + if (source == synchronizeItem) |
---|
1901 | 2222 | { |
---|
1902 | 2223 | Overwrite(Object3D.TRANSFORM); |
---|
1903 | 2224 | } else |
---|
1904 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2225 | + if (source == overwriteNameItem) |
---|
1905 | 2226 | { |
---|
1906 | 2227 | Overwrite(Object3D.NAME); |
---|
1907 | 2228 | } else |
---|
1908 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2229 | + if (source == overwriteUVItem) |
---|
1909 | 2230 | { |
---|
1910 | 2231 | Overwrite(Object3D.UV); |
---|
1911 | 2232 | } else |
---|
1912 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2233 | + if (source == overwriteMatItem) |
---|
1913 | 2234 | { |
---|
1914 | 2235 | /* july 2015 |
---|
1915 | 2236 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1929 | 2250 | |
---|
1930 | 2251 | Overwrite(dropAttributes); |
---|
1931 | 2252 | } |
---|
1932 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2253 | + if (source == overwriteGeoItem) |
---|
1933 | 2254 | { |
---|
1934 | 2255 | Overwrite(Object3D.GEOMETRY); |
---|
1935 | 2256 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1946 | 2267 | // refreshContents(); |
---|
1947 | 2268 | // } |
---|
1948 | 2269 | } else |
---|
1949 | | - if (event.getSource() == generateMeshItem) |
---|
| 2270 | + if (source == generateMeshItem) |
---|
1950 | 2271 | { |
---|
1951 | 2272 | //if (group.selection.size() == 1) |
---|
1952 | 2273 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1957 | 2278 | ResetModel(); |
---|
1958 | 2279 | refreshContents(); |
---|
1959 | 2280 | } else |
---|
1960 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2281 | + if (source == extractGeometriesItem) |
---|
1961 | 2282 | { |
---|
1962 | 2283 | boolean one = false; |
---|
1963 | 2284 | |
---|
.. | .. |
---|
1984 | 2305 | ResetModel(); |
---|
1985 | 2306 | refreshContents(); |
---|
1986 | 2307 | } else |
---|
1987 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2308 | + if (source == cloneGeometriesItem) |
---|
1988 | 2309 | { |
---|
1989 | 2310 | boolean one = false; |
---|
1990 | 2311 | |
---|
.. | .. |
---|
2010 | 2331 | ResetModel(); |
---|
2011 | 2332 | refreshContents(); |
---|
2012 | 2333 | } else |
---|
2013 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2334 | + if (source == shareGeometriesItem) |
---|
2014 | 2335 | { |
---|
2015 | 2336 | boolean one = false; |
---|
2016 | 2337 | |
---|
.. | .. |
---|
2040 | 2361 | refreshContents(); |
---|
2041 | 2362 | } |
---|
2042 | 2363 | } else |
---|
2043 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2364 | + if (source == mergeGeometriesItem) |
---|
2044 | 2365 | { |
---|
2045 | 2366 | boolean one = false; |
---|
2046 | 2367 | |
---|
.. | .. |
---|
2070 | 2391 | ResetModel(); |
---|
2071 | 2392 | refreshContents(); |
---|
2072 | 2393 | } else |
---|
2073 | | - if (event.getSource() == linkverticesItem) |
---|
| 2394 | + if (source == linkverticesItem) |
---|
2074 | 2395 | { |
---|
2075 | 2396 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2076 | 2397 | // { |
---|
.. | .. |
---|
2083 | 2404 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2084 | 2405 | // refreshContents(); |
---|
2085 | 2406 | // } |
---|
2086 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2407 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2087 | 2408 | { |
---|
2088 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2409 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2089 | 2410 | |
---|
2090 | 2411 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2091 | 2412 | content = ((cGroup)content).get(0); |
---|
2092 | 2413 | |
---|
2093 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2414 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2094 | 2415 | for (int i=0; i<group.selection.size(); i++) |
---|
2095 | 2416 | { |
---|
2096 | | - boolean random = CameraPane.RANDOM; |
---|
2097 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2417 | + boolean random = CameraPane.SWITCH; |
---|
| 2418 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2098 | 2419 | group.selection.get(i).linkVerticesThis(content); |
---|
2099 | 2420 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2100 | | - CameraPane.RANDOM = random; |
---|
| 2421 | + CameraPane.SWITCH = random; |
---|
2101 | 2422 | } |
---|
2102 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2423 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2103 | 2424 | refreshContents(); |
---|
2104 | 2425 | } |
---|
2105 | 2426 | } else |
---|
2106 | | - if (event.getSource() == resetsupportItem) |
---|
| 2427 | + if (source == resetsupportItem) |
---|
2107 | 2428 | { |
---|
2108 | 2429 | for (int i=0; i<group.selection.size(); i++) |
---|
2109 | 2430 | { |
---|
2110 | | - boolean random = CameraPane.RANDOM; |
---|
2111 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2431 | + boolean random = CameraPane.SWITCH; |
---|
| 2432 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2112 | 2433 | group.selection.get(i).linkVerticesThis(null); |
---|
2113 | | - CameraPane.RANDOM = random; |
---|
| 2434 | + CameraPane.SWITCH = random; |
---|
2114 | 2435 | } |
---|
2115 | 2436 | |
---|
2116 | 2437 | refreshContents(); |
---|
2117 | 2438 | } else |
---|
2118 | | - if (event.getSource() == relinkverticesItem) |
---|
| 2439 | + if (source == relinkverticesItem) |
---|
2119 | 2440 | { |
---|
2120 | | - boolean random = CameraPane.RANDOM; |
---|
2121 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2441 | + boolean random = CameraPane.SWITCH; |
---|
| 2442 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2122 | 2443 | group.selection.RelinkToSupport(); |
---|
2123 | | - CameraPane.RANDOM = random; |
---|
| 2444 | + CameraPane.SWITCH = random; |
---|
2124 | 2445 | |
---|
2125 | 2446 | refreshContents(); |
---|
2126 | 2447 | } else |
---|
2127 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2448 | + if (source == resetreferencesItem) |
---|
2128 | 2449 | { |
---|
2129 | 2450 | for (int i=0; i<group.selection.size(); i++) |
---|
2130 | 2451 | { |
---|
.. | .. |
---|
2133 | 2454 | |
---|
2134 | 2455 | refreshContents(); |
---|
2135 | 2456 | } else |
---|
2136 | | - if (event.getSource() == setMasterItem) |
---|
| 2457 | + if (source == setMasterItem) |
---|
2137 | 2458 | { |
---|
2138 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2459 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2139 | 2460 | { |
---|
2140 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2461 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2141 | 2462 | |
---|
2142 | 2463 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2143 | 2464 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2146 | 2467 | refreshContents(); |
---|
2147 | 2468 | } |
---|
2148 | 2469 | } else |
---|
2149 | | - if (event.getSource() == poseMeshItem) |
---|
| 2470 | + if (source == poseMeshItem) |
---|
2150 | 2471 | { |
---|
2151 | 2472 | if (group.selection.size() == 1) |
---|
2152 | 2473 | { |
---|
2153 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2474 | + if (Grafreed.clipboard.size() == 1) |
---|
2154 | 2475 | { |
---|
2155 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2476 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2156 | 2477 | |
---|
2157 | 2478 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2158 | 2479 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2165 | 2486 | } |
---|
2166 | 2487 | |
---|
2167 | 2488 | } else |
---|
2168 | | - if (event.getSource() == revertMeshItem) |
---|
| 2489 | + if (source == revertMeshItem) |
---|
2169 | 2490 | { |
---|
2170 | 2491 | RevertMeshes(); |
---|
2171 | 2492 | } else |
---|
2172 | | - if (event.getSource() == resetMeshItem) |
---|
| 2493 | + if (source == resetAllItem) |
---|
2173 | 2494 | { |
---|
2174 | 2495 | ResetAll(); |
---|
2175 | 2496 | } else |
---|
2176 | | - if (event.getSource() == stepAllItem) |
---|
| 2497 | + if (source == stepAllItem) |
---|
2177 | 2498 | { |
---|
2178 | 2499 | StepAll(); |
---|
2179 | 2500 | } else |
---|
2180 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2501 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2181 | 2502 | { |
---|
2182 | 2503 | //int indices[] = jList.getSelectedIndices(); |
---|
2183 | 2504 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2185 | 2506 | |
---|
2186 | 2507 | ClearSelection(false); |
---|
2187 | 2508 | } else |
---|
2188 | | - if (event.getSource() == clearAllItem) |
---|
| 2509 | + if (source == clearAllItem) |
---|
2189 | 2510 | { |
---|
2190 | 2511 | ClearSelection(true); |
---|
2191 | 2512 | } else |
---|
2192 | | - if (event.getSource() == grabItem) |
---|
| 2513 | + if (source == grabItem) |
---|
2193 | 2514 | { |
---|
2194 | 2515 | group(new cGroup(), true); |
---|
2195 | 2516 | } else |
---|
2196 | | - if (event.getSource() == hideItem) |
---|
| 2517 | + if (source == hideItem) |
---|
2197 | 2518 | { |
---|
2198 | 2519 | group(new HiddenObject()); |
---|
2199 | 2520 | } else |
---|
2200 | | - if (event.getSource() == frontItem) |
---|
| 2521 | + if (source == frontItem) |
---|
2201 | 2522 | { |
---|
2202 | 2523 | front(); |
---|
2203 | 2524 | } else |
---|
2204 | | - if (event.getSource() == backItem) |
---|
| 2525 | + if (source == backItem) |
---|
2205 | 2526 | { |
---|
2206 | 2527 | back(); |
---|
2207 | 2528 | } else |
---|
2208 | | - if (event.getSource() == cameraItem) |
---|
| 2529 | + if (source == cameraItem) |
---|
2209 | 2530 | { |
---|
2210 | 2531 | makeSomething(new Camera()); |
---|
2211 | 2532 | } else |
---|
2212 | | - if (event.getSource() == compositeItem) |
---|
| 2533 | + if (source == compositeItem) |
---|
2213 | 2534 | { |
---|
2214 | 2535 | group(new Composite()); |
---|
2215 | 2536 | } else |
---|
2216 | | - if (event.getSource() == randomItem) |
---|
| 2537 | + if (source == randomItem) |
---|
2217 | 2538 | { |
---|
2218 | 2539 | RandomNode random = new RandomNode(); |
---|
2219 | 2540 | group(random); |
---|
2220 | 2541 | if (random.size() > 0) |
---|
2221 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2542 | + random.name = random.get(0).name + "Switch"; |
---|
2222 | 2543 | } else |
---|
2223 | | - if (event.getSource() == physicsItem) |
---|
| 2544 | + if (source == physicsItem) |
---|
2224 | 2545 | { |
---|
2225 | 2546 | group(new PhysicsNode()); |
---|
2226 | 2547 | } else |
---|
2227 | | - if (event.getSource() == frameselectorItem) |
---|
| 2548 | + if (source == frameselectorItem) |
---|
2228 | 2549 | { |
---|
2229 | 2550 | for (int i=0; i<group.selection.size(); i++) |
---|
2230 | 2551 | { |
---|
.. | .. |
---|
2236 | 2557 | ResetModel(); |
---|
2237 | 2558 | refreshContents(); |
---|
2238 | 2559 | } else |
---|
2239 | | - if (event.getSource() == switchGeoItem) |
---|
| 2560 | + if (source == switchGeoItem) |
---|
2240 | 2561 | { |
---|
2241 | 2562 | for (int i=0; i<group.selection.size(); i++) |
---|
2242 | 2563 | { |
---|
.. | .. |
---|
2248 | 2569 | ResetModel(); |
---|
2249 | 2570 | refreshContents(); |
---|
2250 | 2571 | } else |
---|
2251 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2572 | + if (source == switchTransfoItem) |
---|
2252 | 2573 | { |
---|
2253 | 2574 | for (int i=0; i<group.selection.size(); i++) |
---|
2254 | 2575 | { |
---|
.. | .. |
---|
2260 | 2581 | ResetModel(); |
---|
2261 | 2582 | refreshContents(); |
---|
2262 | 2583 | } else |
---|
2263 | | - if (event.getSource() == morphItem) |
---|
| 2584 | + if (source == morphItem) |
---|
2264 | 2585 | { |
---|
2265 | 2586 | for (int i=0; i<group.selection.size(); i++) |
---|
2266 | 2587 | { |
---|
.. | .. |
---|
2272 | 2593 | ResetModel(); |
---|
2273 | 2594 | refreshContents(); |
---|
2274 | 2595 | } else |
---|
2275 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2596 | + if (source == scriptNodeItem) |
---|
2276 | 2597 | { |
---|
2277 | 2598 | boolean atleastone = false; |
---|
2278 | 2599 | |
---|
.. | .. |
---|
2311 | 2632 | } |
---|
2312 | 2633 | } |
---|
2313 | 2634 | } else |
---|
2314 | | - if (event.getSource() == linkerItem) |
---|
| 2635 | + if (source == linkerItem) |
---|
2315 | 2636 | { |
---|
2316 | 2637 | group(new cLinker()); |
---|
2317 | 2638 | } else |
---|
2318 | | - if (event.getSource() == textureItem) |
---|
| 2639 | + if (source == textureItem) |
---|
2319 | 2640 | { |
---|
2320 | 2641 | group(new TextureNode()); |
---|
2321 | 2642 | } else |
---|
2322 | | - if (event.getSource() == billboardItem) |
---|
| 2643 | + if (source == billboardItem) |
---|
2323 | 2644 | { |
---|
2324 | 2645 | group(new BillboardNode()); |
---|
2325 | 2646 | } else |
---|
2326 | | - if (event.getSource() == shadowXItem) |
---|
| 2647 | + if (source == shadowXItem) |
---|
2327 | 2648 | { |
---|
2328 | 2649 | CastShadow(0); |
---|
2329 | 2650 | } else |
---|
2330 | | - if (event.getSource() == shadowYItem) |
---|
| 2651 | + if (source == shadowYItem) |
---|
2331 | 2652 | { |
---|
2332 | 2653 | CastShadow(1); |
---|
2333 | 2654 | } else |
---|
2334 | | - if (event.getSource() == shadowZItem) |
---|
| 2655 | + if (source == shadowZItem) |
---|
2335 | 2656 | { |
---|
2336 | 2657 | CastShadow(2); |
---|
2337 | 2658 | } else |
---|
2338 | | - if (event.getSource() == ungroupItem) |
---|
| 2659 | + if (source == ungroupItem || source == ungroupButton) |
---|
2339 | 2660 | { |
---|
2340 | 2661 | //ungroup(); |
---|
2341 | 2662 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2347 | 2668 | |
---|
2348 | 2669 | refreshContents(); |
---|
2349 | 2670 | } else |
---|
2350 | | - if (event.getSource() == genUVItem) |
---|
| 2671 | + if (source == genUVItem) |
---|
2351 | 2672 | { |
---|
2352 | 2673 | GenUV(); |
---|
2353 | 2674 | } else |
---|
2354 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2675 | + if (source == genNormalsCADItem) |
---|
2355 | 2676 | { |
---|
2356 | 2677 | GenNormals(true); |
---|
2357 | 2678 | } else |
---|
2358 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 2679 | + if (source == genNormalsMESHItem) |
---|
2359 | 2680 | { |
---|
2360 | | - GenNormals(true); // TODO |
---|
| 2681 | + GenNormalsMESH(); |
---|
2361 | 2682 | } else |
---|
2362 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2683 | + if (source == genNormalsORGANItem) |
---|
2363 | 2684 | { |
---|
2364 | 2685 | GenNormals(false); |
---|
2365 | 2686 | } else |
---|
2366 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 2687 | + if (source == genNormalsMINEItem) |
---|
2367 | 2688 | { |
---|
2368 | 2689 | GenNormalsMINE(); |
---|
2369 | 2690 | } else |
---|
2370 | | - if (event.getSource() == stripifyItem) |
---|
| 2691 | + if (source == stripifyItem) |
---|
2371 | 2692 | { |
---|
2372 | 2693 | Stripify(); |
---|
2373 | 2694 | } else |
---|
2374 | | - if (event.getSource() == unstripifyItem) |
---|
| 2695 | + if (source == unstripifyItem) |
---|
2375 | 2696 | { |
---|
2376 | 2697 | Unstripify(); |
---|
2377 | 2698 | } else |
---|
2378 | | - if (event.getSource() == trimItem) |
---|
| 2699 | + if (source == trimItem) |
---|
2379 | 2700 | { |
---|
2380 | 2701 | Trim(); |
---|
2381 | 2702 | } else |
---|
2382 | | - if (event.getSource() == untrimItem) |
---|
| 2703 | + if (source == untrimItem) |
---|
2383 | 2704 | { |
---|
2384 | 2705 | Untrim(); |
---|
2385 | 2706 | } else |
---|
2386 | | - if (event.getSource() == clearColorsItem) |
---|
| 2707 | + if (source == clearColorsItem) |
---|
2387 | 2708 | { |
---|
2388 | 2709 | ClearColors(); |
---|
2389 | 2710 | } else |
---|
2390 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2711 | + if (source == clearMaterialsItem) |
---|
2391 | 2712 | { |
---|
2392 | 2713 | ClearMaterials(); |
---|
2393 | 2714 | } else |
---|
2394 | | - if (event.getSource() == liveleavesItem) |
---|
| 2715 | + if (source == liveleavesItem) |
---|
2395 | 2716 | { |
---|
2396 | 2717 | LiveLeaves(true); |
---|
2397 | 2718 | } else |
---|
2398 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2719 | + if (source == unliveleavesItem) |
---|
2399 | 2720 | { |
---|
2400 | 2721 | LiveLeaves(false); |
---|
2401 | 2722 | } else |
---|
2402 | | - if (event.getSource() == supportleavesItem) |
---|
| 2723 | + if (source == supportleavesItem) |
---|
2403 | 2724 | { |
---|
2404 | 2725 | SupportLeaves(true); |
---|
2405 | 2726 | } else |
---|
2406 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2727 | + if (source == unsupportleavesItem) |
---|
2407 | 2728 | { |
---|
2408 | 2729 | SupportLeaves(false); |
---|
2409 | 2730 | } else |
---|
2410 | | - if (event.getSource() == hideleavesItem) |
---|
| 2731 | + if (source == hideleavesItem) |
---|
2411 | 2732 | { |
---|
2412 | 2733 | HideLeaves(true); |
---|
2413 | 2734 | } else |
---|
2414 | | - if (event.getSource() == showleavesItem) |
---|
| 2735 | + if (source == showleavesItem) |
---|
2415 | 2736 | { |
---|
2416 | 2737 | HideLeaves(false); |
---|
2417 | 2738 | } else |
---|
2418 | | - if (event.getSource() == markleavesItem) |
---|
| 2739 | + if (source == markleavesItem) |
---|
2419 | 2740 | { |
---|
2420 | 2741 | MarkLeaves(true); |
---|
2421 | 2742 | } else |
---|
2422 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2743 | + if (source == unmarkleavesItem) |
---|
2423 | 2744 | { |
---|
2424 | 2745 | MarkLeaves(false); |
---|
2425 | 2746 | } else |
---|
2426 | | - if (event.getSource() == flipVItem) |
---|
| 2747 | + if (source == rewindleavesItem) |
---|
| 2748 | + { |
---|
| 2749 | + RewindLeaves(true); |
---|
| 2750 | + } else |
---|
| 2751 | + if (source == unrewindleavesItem) |
---|
| 2752 | + { |
---|
| 2753 | + RewindLeaves(false); |
---|
| 2754 | + } else |
---|
| 2755 | + if (source == randomleavesItem) |
---|
| 2756 | + { |
---|
| 2757 | + RandomLeaves(true); |
---|
| 2758 | + } else |
---|
| 2759 | + if (source == unrandomleavesItem) |
---|
| 2760 | + { |
---|
| 2761 | + RandomLeaves(false); |
---|
| 2762 | + } else |
---|
| 2763 | + if (source == flipVItem) |
---|
2427 | 2764 | { |
---|
2428 | 2765 | FlipV(true); |
---|
2429 | 2766 | } else |
---|
2430 | | - if (event.getSource() == unflipVItem) |
---|
| 2767 | + if (source == unflipVItem) |
---|
2431 | 2768 | { |
---|
2432 | 2769 | FlipV(false); |
---|
2433 | 2770 | } else |
---|
2434 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2771 | + if (source == lowTexturesItem) |
---|
2435 | 2772 | { |
---|
2436 | 2773 | SetTexRes(0); |
---|
2437 | 2774 | } else |
---|
2438 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2775 | + if (source == normalTexturesItem) |
---|
2439 | 2776 | { |
---|
2440 | 2777 | SetTexRes(1); |
---|
2441 | 2778 | } else |
---|
2442 | | - if (event.getSource() == highTexturesItem) |
---|
| 2779 | + if (source == highTexturesItem) |
---|
2443 | 2780 | { |
---|
2444 | 2781 | SetTexRes(2); |
---|
2445 | 2782 | } else |
---|
2446 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2783 | + if (source == veryhighTexturesItem) |
---|
2447 | 2784 | { |
---|
2448 | 2785 | SetTexRes(3); |
---|
2449 | 2786 | } else |
---|
2450 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2787 | + if (source == maxTexturesItem) |
---|
2451 | 2788 | { |
---|
2452 | 2789 | SetTexRes(4); |
---|
2453 | 2790 | } else |
---|
2454 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2791 | + if (source == panoTexturesItem) |
---|
2455 | 2792 | { |
---|
2456 | 2793 | SetTexRes(5); |
---|
2457 | 2794 | } else |
---|
2458 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2795 | + if (source == reverseNormalsItem) |
---|
2459 | 2796 | { |
---|
2460 | 2797 | ReverseNormals(); |
---|
2461 | 2798 | } else |
---|
2462 | | - if (event.getSource() == parseverticesItem) |
---|
| 2799 | + if (source == parseverticesItem) |
---|
2463 | 2800 | { |
---|
2464 | 2801 | ParseVertices(); |
---|
2465 | 2802 | } else |
---|
2466 | | - if (event.getSource() == textureFieldItem) |
---|
| 2803 | + if (source == textureFieldItem) |
---|
2467 | 2804 | { |
---|
2468 | 2805 | TextureVertices(); |
---|
2469 | 2806 | } else |
---|
2470 | | - if (event.getSource() == alignItem) |
---|
| 2807 | + if (source == alignItem) |
---|
2471 | 2808 | { |
---|
2472 | 2809 | Align(); |
---|
2473 | 2810 | } else |
---|
2474 | | - if (event.getSource() == mirrorItem) |
---|
| 2811 | + if (source == mirrorItem) |
---|
2475 | 2812 | { |
---|
2476 | 2813 | MirrorPoses(); |
---|
2477 | 2814 | } else |
---|
2478 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2815 | + if (source == reduceMorphItem) |
---|
2479 | 2816 | { |
---|
2480 | 2817 | MeshReduction(false); |
---|
2481 | 2818 | } else |
---|
2482 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2819 | + if (source == reduce34MorphItem) |
---|
2483 | 2820 | { |
---|
2484 | 2821 | MeshReduction(true); |
---|
2485 | 2822 | } else |
---|
2486 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2823 | + if (source == reverseTrianglesItem) |
---|
2487 | 2824 | { |
---|
2488 | 2825 | ReverseTriangles(); |
---|
2489 | 2826 | } else |
---|
2490 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2827 | + if (source == reduceMeshItem) |
---|
2491 | 2828 | { |
---|
2492 | 2829 | ReduceMesh(false); |
---|
2493 | 2830 | } else |
---|
2494 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2831 | + if (source == reduce34MeshItem) |
---|
2495 | 2832 | { |
---|
2496 | 2833 | ReduceMesh(true); |
---|
2497 | 2834 | } else |
---|
2498 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2835 | + if (source == increaseMeshItem) |
---|
2499 | 2836 | { |
---|
2500 | 2837 | IncreaseMesh(); |
---|
2501 | 2838 | } else |
---|
2502 | | - if (event.getSource() == clipMeshItem) |
---|
| 2839 | + if (source == clipMeshItem) |
---|
2503 | 2840 | { |
---|
2504 | 2841 | ClipMesh(); |
---|
2505 | 2842 | } else |
---|
2506 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2843 | + if (source == smoothMeshItem) |
---|
2507 | 2844 | { |
---|
2508 | 2845 | SmoothMesh(); |
---|
2509 | 2846 | } else |
---|
2510 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2847 | + if (source == transformGeometryItem) |
---|
2511 | 2848 | { |
---|
2512 | 2849 | TransformGeometry(); |
---|
2513 | 2850 | } else |
---|
2514 | | - if (event.getSource() == resetTransformItem) |
---|
| 2851 | + if (source == transformChildrenItem) |
---|
| 2852 | + { |
---|
| 2853 | + TransformChildren(); |
---|
| 2854 | + } else |
---|
| 2855 | + if (source == resetTransformItem) |
---|
2515 | 2856 | { |
---|
2516 | 2857 | ResetTransform(); |
---|
2517 | 2858 | } else |
---|
2518 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2859 | + if (source == resetCentroidItem) |
---|
2519 | 2860 | { |
---|
2520 | | - ResetCentroid(); |
---|
| 2861 | + ResetCentroid(true); |
---|
2521 | 2862 | } else |
---|
2522 | | - if (event.getSource() == resetParentItem) |
---|
| 2863 | + if (source == resetCentroidXZItem) |
---|
| 2864 | + { |
---|
| 2865 | + ResetCentroid(false); |
---|
| 2866 | + } else |
---|
| 2867 | + if (source == resetParentItem) |
---|
2523 | 2868 | { |
---|
2524 | 2869 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2525 | 2870 | { |
---|
.. | .. |
---|
2529 | 2874 | |
---|
2530 | 2875 | refreshContents(); |
---|
2531 | 2876 | } else |
---|
2532 | | - if (event.getSource() == repairParentItem) |
---|
| 2877 | + if (source == repairParentItem) |
---|
2533 | 2878 | { |
---|
2534 | 2879 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2535 | 2880 | { |
---|
.. | .. |
---|
2543 | 2888 | |
---|
2544 | 2889 | refreshContents(); |
---|
2545 | 2890 | } else |
---|
2546 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2891 | + if (source == repairShadowItem) |
---|
| 2892 | + { |
---|
| 2893 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2894 | + { |
---|
| 2895 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2896 | + obj.RepairShadow(); |
---|
| 2897 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2898 | +// { |
---|
| 2899 | +// obj.get(i).parent = obj; |
---|
| 2900 | +// } |
---|
| 2901 | + } |
---|
| 2902 | + |
---|
| 2903 | + refreshContents(); |
---|
| 2904 | + } else |
---|
| 2905 | + if (source == sortbysizeItem) |
---|
2547 | 2906 | { |
---|
2548 | 2907 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2549 | 2908 | { |
---|
.. | .. |
---|
2555 | 2914 | ResetModel(); |
---|
2556 | 2915 | refreshContents(); |
---|
2557 | 2916 | } else |
---|
2558 | | - if (event.getSource() == sortbynameItem) |
---|
| 2917 | + if (source == sortbynameItem) |
---|
2559 | 2918 | { |
---|
2560 | 2919 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2561 | 2920 | { |
---|
.. | .. |
---|
2567 | 2926 | ResetModel(); |
---|
2568 | 2927 | refreshContents(); |
---|
2569 | 2928 | } else |
---|
2570 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2929 | + if (source == attachPigmentItem) |
---|
2571 | 2930 | { |
---|
2572 | 2931 | String texture = GetFile("Attach pigment"); |
---|
2573 | 2932 | Object3D obj; |
---|
.. | .. |
---|
2579 | 2938 | |
---|
2580 | 2939 | refreshContents(); |
---|
2581 | 2940 | } else |
---|
2582 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2941 | + if (source == detachPigmentItem) |
---|
2583 | 2942 | { |
---|
2584 | 2943 | Object3D obj; |
---|
2585 | 2944 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2590 | 2949 | |
---|
2591 | 2950 | refreshContents(); |
---|
2592 | 2951 | } else |
---|
2593 | | - if (event.getSource() == attachBumpItem) |
---|
| 2952 | + if (source == attachBumpItem) |
---|
2594 | 2953 | { |
---|
2595 | 2954 | String texture = GetFile("Attach bump"); |
---|
2596 | 2955 | Object3D obj; |
---|
.. | .. |
---|
2602 | 2961 | |
---|
2603 | 2962 | refreshContents(); |
---|
2604 | 2963 | } else |
---|
2605 | | - if (event.getSource() == detachBumpItem) |
---|
| 2964 | + if (source == detachBumpItem) |
---|
2606 | 2965 | { |
---|
2607 | 2966 | Object3D obj; |
---|
2608 | 2967 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2613 | 2972 | |
---|
2614 | 2973 | refreshContents(); |
---|
2615 | 2974 | } else |
---|
2616 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2975 | + if (source == pigmentBumpItem) |
---|
2617 | 2976 | { |
---|
2618 | 2977 | Object3D obj; |
---|
2619 | 2978 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2624 | 2983 | |
---|
2625 | 2984 | refreshContents(); |
---|
2626 | 2985 | } else |
---|
2627 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2986 | + if (source == flashSelectionButton) |
---|
2628 | 2987 | { |
---|
2629 | 2988 | CameraPane.flash = true; |
---|
2630 | 2989 | refreshContents(); |
---|
2631 | 2990 | } else |
---|
2632 | | - if (event.getSource() == oneButton) |
---|
| 2991 | + if (source == oneButton) |
---|
2633 | 2992 | { |
---|
2634 | 2993 | } else |
---|
2635 | | - if (event.getSource() == twoButton) |
---|
| 2994 | + if (source == twoButton) |
---|
2636 | 2995 | { |
---|
2637 | 2996 | radio.layout = twoButton; |
---|
| 2997 | + |
---|
| 2998 | + if (CameraPane.FULLSCREEN) |
---|
| 2999 | + fullscreenLayout = radio.layout; |
---|
| 3000 | + |
---|
2638 | 3001 | // bug |
---|
2639 | 3002 | //gridPanel.setDividerLocation(1.0); |
---|
2640 | 3003 | //bigPanel.setDividerLocation(0.0); |
---|
2641 | | - bigThree.remove(scenePanel); |
---|
2642 | | - bigThree.remove(cameraPanel); |
---|
2643 | | - bigThree.remove(XYZPanel); |
---|
2644 | | - aWindowConstraints.gridx = 0; |
---|
2645 | | - aWindowConstraints.gridy = 0; |
---|
2646 | | - aWindowConstraints.gridwidth = 1; |
---|
2647 | | - // aConstraints.gridheight = 3; |
---|
2648 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2649 | | - aWindowConstraints.weightx = 0; |
---|
2650 | | - aWindowConstraints.weighty = 1; |
---|
2651 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2652 | | - aWindowConstraints.weightx = 1; |
---|
2653 | | - aWindowConstraints.gridwidth = 3; |
---|
2654 | | - // aConstraints.gridheight = 3; |
---|
2655 | | - aWindowConstraints.gridx = 1; |
---|
2656 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2657 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2658 | | - aWindowConstraints.weightx = 0; |
---|
2659 | | - aWindowConstraints.gridx = 4; |
---|
2660 | | - aWindowConstraints.gridwidth = 1; |
---|
2661 | | - // aConstraints.gridheight = 3; |
---|
2662 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2663 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2664 | | - bigThree.revalidate(); |
---|
| 3004 | +// bigThree.remove(scenePanel); |
---|
| 3005 | +// bigThree.remove(centralPanel); |
---|
| 3006 | +// bigThree.remove(XYZPanel); |
---|
| 3007 | +// aWindowConstraints.gridx = 0; |
---|
| 3008 | +// aWindowConstraints.gridy = 0; |
---|
| 3009 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3010 | +// // aConstraints.gridheight = 3; |
---|
| 3011 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3012 | +// aWindowConstraints.weightx = 0; |
---|
| 3013 | +// aWindowConstraints.weighty = 1; |
---|
| 3014 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3015 | +// aWindowConstraints.weightx = 1; |
---|
| 3016 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3017 | +// // aConstraints.gridheight = 3; |
---|
| 3018 | +// aWindowConstraints.gridx = 1; |
---|
| 3019 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3020 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3021 | +// aWindowConstraints.weightx = 0; |
---|
| 3022 | +// aWindowConstraints.gridx = 4; |
---|
| 3023 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3024 | +// // aConstraints.gridheight = 3; |
---|
| 3025 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3026 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3027 | +// scenePanel.setVisible(false); |
---|
| 3028 | +// centralPanel.setVisible(true); |
---|
| 3029 | +// XYZPanel.setVisible(false); |
---|
| 3030 | + bigThree.ClearUI(); |
---|
| 3031 | + bigThree.add(centralPanel); |
---|
| 3032 | + bigThree.FlushUI(); |
---|
| 3033 | + |
---|
| 3034 | + cameraView.requestFocusInWindow(); |
---|
| 3035 | + |
---|
| 3036 | +// refreshContents(true); |
---|
| 3037 | +// |
---|
| 3038 | +// try |
---|
| 3039 | +// { |
---|
| 3040 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3041 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3042 | +// bot.mouseMove(100, 100); |
---|
| 3043 | +// bot.mousePress(mask); |
---|
| 3044 | +// bot.mouseRelease(mask); |
---|
| 3045 | +// } |
---|
| 3046 | +// catch (Exception e) |
---|
| 3047 | +// { |
---|
| 3048 | +// |
---|
| 3049 | +// } |
---|
| 3050 | + |
---|
2665 | 3051 | } else |
---|
2666 | | - if (event.getSource() == threeButton) |
---|
| 3052 | + if (source == threeButton) |
---|
2667 | 3053 | { |
---|
2668 | 3054 | radio.layout = threeButton; |
---|
2669 | | - bigThree.remove(scenePanel); |
---|
2670 | | - bigThree.remove(cameraPanel); |
---|
2671 | | - bigThree.remove(XYZPanel); |
---|
2672 | | - aWindowConstraints.gridx = 0; |
---|
2673 | | - aWindowConstraints.gridy = 0; |
---|
2674 | | - aWindowConstraints.gridwidth = 1; |
---|
2675 | | - // aConstraints.gridheight = 3; |
---|
2676 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2677 | | - aWindowConstraints.weightx = 0; |
---|
2678 | | - aWindowConstraints.weighty = 1; |
---|
2679 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2680 | | - aWindowConstraints.weightx = 1; |
---|
2681 | | - aWindowConstraints.gridwidth = 3; |
---|
2682 | | - // aConstraints.gridheight = 3; |
---|
2683 | | - aWindowConstraints.gridx = 1; |
---|
2684 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2685 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2686 | | - aWindowConstraints.weightx = 0; |
---|
2687 | | - aWindowConstraints.gridx = 4; |
---|
2688 | | - aWindowConstraints.gridwidth = 1; |
---|
2689 | | - // aConstraints.gridheight = 3; |
---|
2690 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2691 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2692 | | - bigThree.revalidate(); |
---|
| 3055 | + |
---|
| 3056 | + if (CameraPane.FULLSCREEN) |
---|
| 3057 | + fullscreenLayout = radio.layout; |
---|
| 3058 | + |
---|
| 3059 | +// bigThree.remove(scenePanel); |
---|
| 3060 | +// bigThree.remove(centralPanel); |
---|
| 3061 | +// bigThree.remove(XYZPanel); |
---|
| 3062 | +// aWindowConstraints.gridx = 0; |
---|
| 3063 | +// aWindowConstraints.gridy = 0; |
---|
| 3064 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3065 | +// // aConstraints.gridheight = 3; |
---|
| 3066 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3067 | +// aWindowConstraints.weightx = 0; |
---|
| 3068 | +// aWindowConstraints.weighty = 1; |
---|
| 3069 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3070 | +// aWindowConstraints.weightx = 1; |
---|
| 3071 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3072 | +// // aConstraints.gridheight = 3; |
---|
| 3073 | +// aWindowConstraints.gridx = 1; |
---|
| 3074 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3075 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3076 | +// aWindowConstraints.weightx = 0; |
---|
| 3077 | +// aWindowConstraints.gridx = 4; |
---|
| 3078 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3079 | +// // aConstraints.gridheight = 3; |
---|
| 3080 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3081 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3082 | +// bigThree.validate(); |
---|
| 3083 | +// scenePanel.setVisible(false); |
---|
| 3084 | +// centralPanel.setVisible(true); |
---|
| 3085 | +// XYZPanel.setVisible(true); |
---|
| 3086 | + bigThree.ClearUI(); |
---|
| 3087 | + bigThree.add(centralPanel); |
---|
| 3088 | + bigThree.add(XYZPanel); |
---|
| 3089 | + bigThree.FlushUI(); |
---|
| 3090 | + |
---|
| 3091 | + cameraView.requestFocusInWindow(); |
---|
2693 | 3092 | } else |
---|
2694 | | - if (event.getSource() == fourButton) |
---|
| 3093 | + if (source == fourButton) |
---|
2695 | 3094 | { |
---|
2696 | 3095 | radio.layout = fourButton; |
---|
2697 | | - bigThree.remove(scenePanel); |
---|
2698 | | - bigThree.remove(cameraPanel); |
---|
2699 | | - bigThree.remove(XYZPanel); |
---|
2700 | | - aWindowConstraints.gridx = 0; |
---|
2701 | | - aWindowConstraints.gridy = 0; |
---|
2702 | | - aWindowConstraints.gridwidth = 1; |
---|
2703 | | - // aWindowConstraints.gridheight = 3; |
---|
2704 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2705 | | - aWindowConstraints.weightx = 1; |
---|
2706 | | - aWindowConstraints.weighty = 1; |
---|
2707 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2708 | | - aWindowConstraints.weightx = 1; |
---|
2709 | | - aWindowConstraints.gridwidth = 3; |
---|
2710 | | - // aConstraints.gridheight = 3; |
---|
2711 | | - aWindowConstraints.gridx = 1; |
---|
2712 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2713 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2714 | | - aWindowConstraints.weightx = 0; |
---|
2715 | | - aWindowConstraints.gridx = 4; |
---|
2716 | | - aWindowConstraints.gridwidth = 1; |
---|
2717 | | - // aWindowConstraints.gridheight = 3; |
---|
2718 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2719 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2720 | | - bigThree.revalidate(); |
---|
| 3096 | + |
---|
| 3097 | + if (CameraPane.FULLSCREEN) |
---|
| 3098 | + fullscreenLayout = radio.layout; |
---|
| 3099 | + |
---|
| 3100 | +// bigThree.remove(scenePanel); |
---|
| 3101 | +// bigThree.remove(centralPanel); |
---|
| 3102 | +// bigThree.remove(XYZPanel); |
---|
| 3103 | +// aWindowConstraints.gridx = 0; |
---|
| 3104 | +// aWindowConstraints.gridy = 0; |
---|
| 3105 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3106 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3107 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3108 | +// aWindowConstraints.weightx = 1; |
---|
| 3109 | +// aWindowConstraints.weighty = 1; |
---|
| 3110 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3111 | +// aWindowConstraints.weightx = 1; |
---|
| 3112 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3113 | +// // aConstraints.gridheight = 3; |
---|
| 3114 | +// aWindowConstraints.gridx = 1; |
---|
| 3115 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3116 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3117 | +// aWindowConstraints.weightx = 0; |
---|
| 3118 | +// aWindowConstraints.gridx = 4; |
---|
| 3119 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3120 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3121 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3122 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3123 | +// bigThree.validate(); |
---|
| 3124 | +// scenePanel.setVisible(true); |
---|
| 3125 | +// centralPanel.setVisible(false); |
---|
| 3126 | +// XYZPanel.setVisible(false); |
---|
| 3127 | + bigThree.ClearUI(); |
---|
| 3128 | + bigThree.add(scenePanel); |
---|
| 3129 | + bigThree.FlushUI(); |
---|
| 3130 | + |
---|
| 3131 | + cameraView.requestFocusInWindow(); |
---|
2721 | 3132 | } else |
---|
2722 | | - if (event.getSource() == sixButton) |
---|
| 3133 | + if (source == sixButton) |
---|
2723 | 3134 | { |
---|
2724 | 3135 | radio.layout = sixButton; |
---|
2725 | | - bigThree.remove(scenePanel); |
---|
2726 | | - bigThree.remove(cameraPanel); |
---|
2727 | | - bigThree.remove(XYZPanel); |
---|
2728 | | - aWindowConstraints.gridx = 0; |
---|
2729 | | - aWindowConstraints.gridy = 0; |
---|
2730 | | - aWindowConstraints.gridwidth = 1; |
---|
2731 | | - // aConstraints.gridheight = 3; |
---|
2732 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2733 | | - aWindowConstraints.weightx = 0; |
---|
2734 | | - aWindowConstraints.weighty = 1; |
---|
2735 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2736 | | - aWindowConstraints.weightx = 1; |
---|
2737 | | - aWindowConstraints.gridwidth = 3; |
---|
2738 | | - // aWindowConstraints.gridheight = 3; |
---|
2739 | | - aWindowConstraints.gridx = 1; |
---|
2740 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2741 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2742 | | - aWindowConstraints.weightx = 0; |
---|
2743 | | - aWindowConstraints.gridx = 4; |
---|
2744 | | - aWindowConstraints.gridwidth = 1; |
---|
2745 | | - // aWindowConstraints.gridheight = 3; |
---|
2746 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2747 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2748 | | - bigThree.revalidate(); |
---|
| 3136 | + |
---|
| 3137 | + if (CameraPane.FULLSCREEN) |
---|
| 3138 | + fullscreenLayout = radio.layout; |
---|
| 3139 | + |
---|
| 3140 | +// bigThree.remove(scenePanel); |
---|
| 3141 | +// bigThree.remove(centralPanel); |
---|
| 3142 | +// bigThree.remove(XYZPanel); |
---|
| 3143 | +// aWindowConstraints.gridx = 0; |
---|
| 3144 | +// aWindowConstraints.gridy = 0; |
---|
| 3145 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3146 | +// // aConstraints.gridheight = 3; |
---|
| 3147 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3148 | +// aWindowConstraints.weightx = 0; |
---|
| 3149 | +// aWindowConstraints.weighty = 1; |
---|
| 3150 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3151 | +// aWindowConstraints.weightx = 1; |
---|
| 3152 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3153 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3154 | +// aWindowConstraints.gridx = 1; |
---|
| 3155 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3156 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3157 | +// aWindowConstraints.weightx = 0; |
---|
| 3158 | +// aWindowConstraints.gridx = 4; |
---|
| 3159 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3160 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3161 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3162 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3163 | +// bigThree.validate(); |
---|
| 3164 | +// scenePanel.setVisible(true); |
---|
| 3165 | +// centralPanel.setVisible(true); |
---|
| 3166 | +// XYZPanel.setVisible(false); |
---|
| 3167 | + bigThree.ClearUI(); |
---|
| 3168 | + bigThree.add(scenePanel); |
---|
| 3169 | + bigThree.add(centralPanel); |
---|
| 3170 | + bigThree.FlushUI(); |
---|
| 3171 | + |
---|
| 3172 | + cameraView.requestFocusInWindow(); |
---|
2749 | 3173 | } else |
---|
2750 | | - if (event.getSource() == sevenButton) |
---|
| 3174 | + if (source == sevenButton) |
---|
2751 | 3175 | { |
---|
2752 | 3176 | radio.layout = sevenButton; |
---|
2753 | | - bigThree.remove(scenePanel); |
---|
2754 | | - bigThree.remove(cameraPanel); |
---|
2755 | | - bigThree.remove(XYZPanel); |
---|
2756 | | - aWindowConstraints.gridx = 0; |
---|
2757 | | - aWindowConstraints.gridy = 0; |
---|
2758 | | - aWindowConstraints.gridwidth = 1; |
---|
2759 | | - // aWindowConstraints.gridheight = 3; |
---|
2760 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2761 | | - aWindowConstraints.weightx = 0; |
---|
2762 | | - aWindowConstraints.weighty = 1; |
---|
2763 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2764 | | - aWindowConstraints.weightx = 1; |
---|
2765 | | - aWindowConstraints.gridwidth = 3; |
---|
2766 | | - // aWindowConstraints.gridheight = 3; |
---|
2767 | | - aWindowConstraints.gridx = 1; |
---|
2768 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2769 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2770 | | - aWindowConstraints.weightx = 0; |
---|
2771 | | - aWindowConstraints.gridx = 4; |
---|
2772 | | - aWindowConstraints.gridwidth = 1; |
---|
2773 | | - // aConstraints.gridheight = 3; |
---|
2774 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2775 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2776 | | - bigThree.revalidate(); |
---|
| 3177 | + |
---|
| 3178 | + if (CameraPane.FULLSCREEN) |
---|
| 3179 | + fullscreenLayout = radio.layout; |
---|
| 3180 | + |
---|
| 3181 | +// bigThree.remove(scenePanel); |
---|
| 3182 | +// bigThree.remove(centralPanel); |
---|
| 3183 | +// bigThree.remove(XYZPanel); |
---|
| 3184 | +// aWindowConstraints.gridx = 0; |
---|
| 3185 | +// aWindowConstraints.gridy = 0; |
---|
| 3186 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3187 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3188 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3189 | +// aWindowConstraints.weightx = 0; |
---|
| 3190 | +// aWindowConstraints.weighty = 1; |
---|
| 3191 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3192 | +// aWindowConstraints.weightx = 1; |
---|
| 3193 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3194 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3195 | +// aWindowConstraints.gridx = 1; |
---|
| 3196 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3197 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3198 | +// aWindowConstraints.weightx = 0; |
---|
| 3199 | +// aWindowConstraints.gridx = 4; |
---|
| 3200 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3201 | +// // aConstraints.gridheight = 3; |
---|
| 3202 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3203 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3204 | +// bigThree.validate(); |
---|
| 3205 | +// scenePanel.setVisible(true); |
---|
| 3206 | +// centralPanel.setVisible(true); |
---|
| 3207 | +// XYZPanel.setVisible(true); |
---|
| 3208 | + bigThree.ClearUI(); |
---|
| 3209 | + bigThree.add(scenePanel); |
---|
| 3210 | + bigThree.add(centralPanel); |
---|
| 3211 | + bigThree.add(XYZPanel); |
---|
| 3212 | + bigThree.FlushUI(); |
---|
| 3213 | + |
---|
| 3214 | + cameraView.requestFocusInWindow(); |
---|
2777 | 3215 | } else |
---|
2778 | | - if (event.getSource() == rootButton) |
---|
| 3216 | + if (source == rootButton) |
---|
2779 | 3217 | { |
---|
2780 | 3218 | Object3D obj; |
---|
2781 | 3219 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2785 | 3223 | EditObject(obj); |
---|
2786 | 3224 | } |
---|
2787 | 3225 | |
---|
| 3226 | + cameraView.requestFocusInWindow(); |
---|
2788 | 3227 | refreshContents(true); |
---|
2789 | 3228 | } else |
---|
2790 | | - if (event.getSource() == closeButton) |
---|
| 3229 | + if (source == closeButton) |
---|
2791 | 3230 | { |
---|
2792 | 3231 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2793 | 3232 | cRadio ab; |
---|
2794 | 3233 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2795 | 3234 | { |
---|
2796 | 3235 | ab = (cRadio)e.nextElement(); |
---|
2797 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3236 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2798 | 3237 | { |
---|
| 3238 | + // Patch to avoid bug with transparency. |
---|
| 3239 | + if (!ab.hadMaterial) |
---|
| 3240 | + { |
---|
| 3241 | + ab.object.material = null; |
---|
| 3242 | + } |
---|
| 3243 | + |
---|
2799 | 3244 | buttonGroup.remove(ab); |
---|
2800 | 3245 | radioPanel.remove(ab); |
---|
2801 | 3246 | |
---|
2802 | | - ab.GetObject().editWindow = null; |
---|
| 3247 | + //ab.GetObject().editWindow = null; |
---|
| 3248 | + ab.GetObject().manipWindow = null; |
---|
2803 | 3249 | // ab.GetObject().objectUI = null; // ????????? |
---|
2804 | 3250 | |
---|
2805 | 3251 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2806 | 3252 | break; |
---|
2807 | 3253 | } |
---|
2808 | 3254 | } |
---|
| 3255 | + |
---|
| 3256 | + cameraView.requestFocusInWindow(); |
---|
2809 | 3257 | refreshContents(true); |
---|
2810 | 3258 | } else |
---|
2811 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3259 | + if (source == editItem || source == editButton) |
---|
2812 | 3260 | { |
---|
2813 | 3261 | EditSelection(false); |
---|
2814 | 3262 | } else |
---|
2815 | | - if (event.getSource() == uneditButton) |
---|
| 3263 | + if (source == uneditButton) |
---|
2816 | 3264 | { |
---|
2817 | 3265 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2818 | 3266 | { |
---|
.. | .. |
---|
2822 | 3270 | child.CloseUI(); |
---|
2823 | 3271 | listUI.remove(child); |
---|
2824 | 3272 | |
---|
2825 | | - child.editWindow = null; // ??????????? |
---|
| 3273 | + //child.editWindow = null; // ??????????? |
---|
2826 | 3274 | } |
---|
2827 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3275 | + objEditor.ctrlPanel.FlushUI(); |
---|
2828 | 3276 | //objEditor.jTree.clearSelection(); |
---|
2829 | 3277 | //objEditor.ResetSliders(); |
---|
2830 | 3278 | refreshContents(true); |
---|
2831 | 3279 | } else |
---|
2832 | | - if (event.getSource() == clearPanelButton) |
---|
| 3280 | + if (source == clearPanelButton) |
---|
2833 | 3281 | { |
---|
2834 | 3282 | assert(copy == group); |
---|
2835 | 3283 | //copy.ClearUI(); |
---|
.. | .. |
---|
2840 | 3288 | listUI.clear(); |
---|
2841 | 3289 | refreshContents(true); |
---|
2842 | 3290 | } else |
---|
2843 | | - if (event.getSource() == allParamsButton) |
---|
| 3291 | + if (source == allParamsButton) |
---|
2844 | 3292 | { |
---|
2845 | 3293 | assert(copy == group); |
---|
2846 | 3294 | |
---|
.. | .. |
---|
2861 | 3309 | |
---|
2862 | 3310 | refreshContents(true); |
---|
2863 | 3311 | } else |
---|
2864 | | - if (event.getSource() == unselectButton) |
---|
| 3312 | + if (source == unselectButton) |
---|
2865 | 3313 | { |
---|
2866 | 3314 | objEditor.jTree.clearSelection(); |
---|
2867 | 3315 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2868 | 3316 | objEditor.ResetSliders(); |
---|
2869 | 3317 | refreshContents(true); |
---|
2870 | 3318 | } else |
---|
2871 | | - if(event.getSource() instanceof cRadio) |
---|
| 3319 | + if(source instanceof cRadio) |
---|
2872 | 3320 | { |
---|
2873 | 3321 | group.parent = keepparent; |
---|
2874 | 3322 | group.attributes = 0; |
---|
2875 | 3323 | //group.editWindow = null; |
---|
2876 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3324 | + /*cRadio*/ radio = (cRadio)source; |
---|
2877 | 3325 | Object3D obj = radio.GetObject(); |
---|
2878 | 3326 | System.out.println("Edit " + obj); |
---|
2879 | 3327 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2893 | 3341 | } |
---|
2894 | 3342 | |
---|
2895 | 3343 | copy = group; |
---|
2896 | | - //CameraPane.theRenderer.object = group; |
---|
| 3344 | + //Globals.theRenderer.object = group; |
---|
2897 | 3345 | if(!useclient) |
---|
2898 | 3346 | { |
---|
2899 | 3347 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2902 | 3350 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2903 | 3351 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2904 | 3352 | cameraView.object = group; |
---|
2905 | | - cameraView.lighttouched = true; |
---|
| 3353 | + //cameraView.lighttouched = true; |
---|
| 3354 | + Globals.lighttouched = true; |
---|
2906 | 3355 | topView.object = group; |
---|
2907 | 3356 | frontView.object = group; |
---|
2908 | 3357 | sideView.object = group; |
---|
2909 | 3358 | } |
---|
2910 | | - group.editWindow = this; |
---|
| 3359 | + |
---|
| 3360 | +// fix "+" issue |
---|
| 3361 | + //group.editWindow = this; |
---|
| 3362 | + group.manipWindow = this; |
---|
| 3363 | + |
---|
2911 | 3364 | /* |
---|
2912 | 3365 | currentLayout = radio.layout; |
---|
2913 | 3366 | if (currentLayout == null) |
---|
.. | .. |
---|
2919 | 3372 | //group.parent = null; // ROOT |
---|
2920 | 3373 | //group.attributes = -1; |
---|
2921 | 3374 | ResetModel(); |
---|
| 3375 | + |
---|
| 3376 | + cameraView.requestFocusInWindow(); |
---|
2922 | 3377 | refreshContents(true); |
---|
2923 | | - } |
---|
| 3378 | + } else if (event.getSource() == editCameraItem) |
---|
| 3379 | + { |
---|
| 3380 | + cameraView.ProtectCamera(); |
---|
| 3381 | + cameraView.repaint(); |
---|
| 3382 | + return; |
---|
| 3383 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3384 | + { |
---|
| 3385 | + cameraView.RevertCamera(); |
---|
| 3386 | + cameraView.repaint(); |
---|
| 3387 | + return; |
---|
| 3388 | + // } else if (event.getSource() == textureButton) |
---|
| 3389 | + // { |
---|
| 3390 | + // return; // true; |
---|
| 3391 | + } |
---|
2924 | 3392 | else |
---|
2925 | 3393 | { |
---|
2926 | 3394 | //return super.action(event, arg); |
---|
.. | .. |
---|
2929 | 3397 | } |
---|
2930 | 3398 | |
---|
2931 | 3399 | boolean useclient = false; |
---|
2932 | | - cRadio radio; |
---|
2933 | 3400 | |
---|
2934 | 3401 | void ToggleRoot() |
---|
2935 | 3402 | { |
---|
.. | .. |
---|
2938 | 3405 | if (useclient) |
---|
2939 | 3406 | { |
---|
2940 | 3407 | cameraView.object = client; |
---|
2941 | | - cameraView.lighttouched = true; |
---|
| 3408 | + Globals.lighttouched = true; |
---|
2942 | 3409 | //topView.object = client; |
---|
2943 | 3410 | //frontView.object = client; |
---|
2944 | 3411 | //sideView.object = client; |
---|
.. | .. |
---|
2946 | 3413 | else |
---|
2947 | 3414 | { |
---|
2948 | 3415 | cameraView.object = group; |
---|
2949 | | - cameraView.lighttouched = true; |
---|
| 3416 | + Globals.lighttouched = true; |
---|
2950 | 3417 | //topView.object = group; |
---|
2951 | 3418 | //frontView.object = group; |
---|
2952 | 3419 | //sideView.object = group; |
---|
.. | .. |
---|
2981 | 3448 | refreshContents(); |
---|
2982 | 3449 | } |
---|
2983 | 3450 | |
---|
| 3451 | + void TransformChildren() |
---|
| 3452 | + { |
---|
| 3453 | + Object3D obj; |
---|
| 3454 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3455 | + { |
---|
| 3456 | + obj = (Object3D)e.nextElement(); |
---|
| 3457 | + obj.KeepTextureMatrices(); |
---|
| 3458 | + obj.TransformChildren(); |
---|
| 3459 | + obj.RestoreTextureMatrices(); |
---|
| 3460 | + |
---|
| 3461 | +// if (obj.parent == null) |
---|
| 3462 | +// { |
---|
| 3463 | +// System.out.println("NULL PARENT!"); |
---|
| 3464 | +// new Exception().printStackTrace(); |
---|
| 3465 | +// } |
---|
| 3466 | +// else |
---|
| 3467 | +// TouchTransform(obj); |
---|
| 3468 | +// //obj.parent.Touch(); |
---|
| 3469 | + } |
---|
| 3470 | + |
---|
| 3471 | + refreshContents(); |
---|
| 3472 | + } |
---|
2984 | 3473 | |
---|
2985 | 3474 | void ResetTransform() |
---|
2986 | 3475 | { |
---|
.. | .. |
---|
3093 | 3582 | refreshContents(); |
---|
3094 | 3583 | } |
---|
3095 | 3584 | |
---|
3096 | | - void ResetCentroid() |
---|
| 3585 | + void ResetCentroid(boolean full) |
---|
3097 | 3586 | { |
---|
3098 | 3587 | Object3D obj; |
---|
3099 | 3588 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3108 | 3597 | LA.matIdentity(Object3D.mat); |
---|
3109 | 3598 | obj.getBounds(minima, maxima, false); |
---|
3110 | 3599 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3111 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3600 | + if (full) |
---|
| 3601 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3112 | 3602 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3113 | 3603 | obj.TransformMesh(Object3D.mat); |
---|
| 3604 | + |
---|
3114 | 3605 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3115 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3606 | + if (full) |
---|
| 3607 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3116 | 3608 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3609 | + |
---|
3117 | 3610 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3118 | 3611 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3119 | 3612 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3142 | 3635 | |
---|
3143 | 3636 | int size = obj.MemorySize(); |
---|
3144 | 3637 | |
---|
3145 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3638 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3639 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3146 | 3640 | } |
---|
3147 | 3641 | } |
---|
3148 | 3642 | catch (Exception e) |
---|
.. | .. |
---|
3179 | 3673 | obj = (Object3D)e.nextElement(); |
---|
3180 | 3674 | |
---|
3181 | 3675 | System.out.println("Object is: " + obj); |
---|
3182 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3676 | + Grafreed.AnalyzeObject(obj); |
---|
3183 | 3677 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3184 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3678 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3185 | 3679 | |
---|
3186 | 3680 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3187 | 3681 | } |
---|
.. | .. |
---|
3223 | 3717 | void GenNormals(boolean crease) |
---|
3224 | 3718 | { |
---|
3225 | 3719 | group.GenNormalsS(crease); |
---|
| 3720 | + |
---|
| 3721 | + refreshContents(); |
---|
| 3722 | + } |
---|
| 3723 | + |
---|
| 3724 | + void GenNormalsMESH() |
---|
| 3725 | + { |
---|
| 3726 | + group.GenNormalsMeshS(); |
---|
3226 | 3727 | |
---|
3227 | 3728 | refreshContents(); |
---|
3228 | 3729 | } |
---|
.. | .. |
---|
3395 | 3896 | |
---|
3396 | 3897 | void ParseVertices() |
---|
3397 | 3898 | { |
---|
3398 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3399 | | - GrafreeD.epsequal = true; |
---|
| 3899 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3900 | + Grafreed.epsequal = true; |
---|
3400 | 3901 | |
---|
3401 | 3902 | for (int i=0; i<group.selection.size(); i++) |
---|
3402 | 3903 | { |
---|
.. | .. |
---|
3421 | 3922 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3422 | 3923 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3423 | 3924 | |
---|
3424 | | - g.add(GrafreeD.clipboard); |
---|
| 3925 | + g.add(Grafreed.clipboard); |
---|
3425 | 3926 | |
---|
3426 | 3927 | buffer.add(g); |
---|
3427 | 3928 | } |
---|
.. | .. |
---|
3436 | 3937 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3437 | 3938 | } |
---|
3438 | 3939 | |
---|
3439 | | - GrafreeD.epsequal = epsequal; |
---|
| 3940 | + Grafreed.epsequal = epsequal; |
---|
3440 | 3941 | |
---|
3441 | 3942 | refreshContents(); |
---|
3442 | 3943 | } |
---|
.. | .. |
---|
3454 | 3955 | String pigment = Object3D.GetPigment(tex); |
---|
3455 | 3956 | //String bump = Object3D.GetBump(tex); |
---|
3456 | 3957 | |
---|
3457 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3958 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3959 | + |
---|
| 3960 | + try |
---|
| 3961 | + { |
---|
| 3962 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3963 | + } |
---|
| 3964 | + catch (Exception e) |
---|
| 3965 | + { |
---|
| 3966 | + System.err.println("FAIL: " + node); |
---|
| 3967 | + } |
---|
3458 | 3968 | |
---|
3459 | 3969 | double s = v.s; |
---|
3460 | 3970 | |
---|
.. | .. |
---|
3542 | 4052 | |
---|
3543 | 4053 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3544 | 4054 | |
---|
3545 | | - boolean random = CameraPane.RANDOM; |
---|
3546 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4055 | + boolean random = CameraPane.SWITCH; |
---|
| 4056 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3547 | 4057 | lowres.linkVerticesThis(null); |
---|
3548 | 4058 | lowres.linkVerticesThis(sn); |
---|
3549 | | - CameraPane.RANDOM = random; |
---|
| 4059 | + CameraPane.SWITCH = random; |
---|
3550 | 4060 | |
---|
3551 | 4061 | System.err.flush(); |
---|
3552 | 4062 | |
---|
.. | .. |
---|
3586 | 4096 | return; |
---|
3587 | 4097 | |
---|
3588 | 4098 | Object3D poses = group.selection.get(0); |
---|
3589 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4099 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3590 | 4100 | |
---|
3591 | 4101 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3592 | 4102 | |
---|
.. | .. |
---|
3755 | 4265 | group.selection.RelinkToSupport(); // july 2014 |
---|
3756 | 4266 | System.out.println("DONE."); |
---|
3757 | 4267 | refreshContents(); |
---|
3758 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4268 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3759 | 4269 | } |
---|
3760 | 4270 | |
---|
3761 | 4271 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3780 | 4290 | |
---|
3781 | 4291 | void ClipMesh() |
---|
3782 | 4292 | { |
---|
3783 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4293 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3784 | 4294 | { |
---|
3785 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4295 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3786 | 4296 | |
---|
3787 | 4297 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3788 | 4298 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3791 | 4301 | // { |
---|
3792 | 4302 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3793 | 4303 | // } |
---|
3794 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4304 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3795 | 4305 | } |
---|
3796 | 4306 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3797 | 4307 | System.out.println("DONE."); |
---|
.. | .. |
---|
3838 | 4348 | void MarkLeaves(boolean hide) |
---|
3839 | 4349 | { |
---|
3840 | 4350 | group.selection.MarkLeaves(hide); |
---|
| 4351 | + refreshContents(); |
---|
| 4352 | + } |
---|
| 4353 | + |
---|
| 4354 | + void RewindLeaves(boolean hide) |
---|
| 4355 | + { |
---|
| 4356 | + group.selection.RewindLeaves(hide); |
---|
| 4357 | + refreshContents(); |
---|
| 4358 | + } |
---|
| 4359 | + |
---|
| 4360 | + void RandomLeaves(boolean hide) |
---|
| 4361 | + { |
---|
| 4362 | + group.selection.RandomLeaves(hide); |
---|
3841 | 4363 | refreshContents(); |
---|
3842 | 4364 | } |
---|
3843 | 4365 | |
---|
.. | .. |
---|
3923 | 4445 | { |
---|
3924 | 4446 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
3925 | 4447 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
3926 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4448 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3927 | 4449 | |
---|
3928 | 4450 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3929 | | - if(elem != group) |
---|
| 4451 | + if(elem != group || !newWindow) |
---|
3930 | 4452 | { |
---|
3931 | 4453 | // if (!(elem instanceof Composite)) |
---|
3932 | 4454 | // newWindow = false; |
---|
.. | .. |
---|
4016 | 4538 | //case 702: // Event.LIST_DESELECT |
---|
4017 | 4539 | group.deselectAll(); |
---|
4018 | 4540 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4019 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4020 | 4541 | if (tps != null) |
---|
4021 | 4542 | { |
---|
4022 | 4543 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4025 | 4546 | |
---|
4026 | 4547 | //if (child.parent != null) |
---|
4027 | 4548 | //child.parent.addSelectee(child); |
---|
| 4549 | + objEditor.SetMaterial(child); |
---|
4028 | 4550 | group.addSelectee(child); |
---|
4029 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4030 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4031 | | - System.err.println("info : " + child.GetPath()); |
---|
4032 | 4551 | } |
---|
4033 | 4552 | } |
---|
4034 | | - else |
---|
4035 | | - { |
---|
4036 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4037 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4038 | | - System.err.println("info : " + group.GetPath()); |
---|
4039 | | - } |
---|
| 4553 | +// else |
---|
| 4554 | +// { |
---|
| 4555 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4556 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4557 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4558 | +// } |
---|
4040 | 4559 | |
---|
4041 | | - objEditor.SetText(); // jan 2014 |
---|
4042 | | - |
---|
4043 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4560 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4044 | 4561 | CameraPane.flash = true; |
---|
4045 | 4562 | |
---|
4046 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4563 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4047 | 4564 | // a camera |
---|
4048 | 4565 | { |
---|
4049 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4050 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
4051 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
4052 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4566 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 4567 | + { |
---|
| 4568 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4569 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4570 | + } |
---|
| 4571 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4572 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4053 | 4573 | } |
---|
4054 | 4574 | |
---|
4055 | 4575 | refreshContents(); |
---|
.. | .. |
---|
4060 | 4580 | |
---|
4061 | 4581 | freezemodel = false; |
---|
4062 | 4582 | } |
---|
| 4583 | + |
---|
| 4584 | + void refreshContents(boolean cp) |
---|
| 4585 | + { |
---|
| 4586 | + if (!Globals.MOUSEDRAGGED) |
---|
| 4587 | + { |
---|
| 4588 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4589 | + |
---|
| 4590 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4591 | + { |
---|
| 4592 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4593 | + |
---|
| 4594 | + objEditor.AddInfo(child, this, true); |
---|
| 4595 | + System.err.println("info : " + child.GetPath()); |
---|
| 4596 | + } |
---|
| 4597 | + |
---|
| 4598 | + objEditor.SetText(); // jan 2014 |
---|
| 4599 | + } |
---|
| 4600 | + |
---|
| 4601 | + super.refreshContents(cp); |
---|
| 4602 | + } |
---|
4063 | 4603 | |
---|
4064 | 4604 | void linkSomething(Object3D thing) |
---|
4065 | 4605 | { |
---|
.. | .. |
---|
4131 | 4671 | { |
---|
4132 | 4672 | if (group.selection.isEmpty()) |
---|
4133 | 4673 | return; |
---|
4134 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4674 | + |
---|
| 4675 | + Grafreed.clipboardIsTempGroup = false; |
---|
4135 | 4676 | Composite tGroup = null; |
---|
4136 | 4677 | if (group.selection.size() > 0) // 1) |
---|
4137 | 4678 | { |
---|
4138 | 4679 | tGroup = new cGroup(); |
---|
4139 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4680 | + Grafreed.clipboardIsTempGroup = true; |
---|
4140 | 4681 | } |
---|
4141 | 4682 | |
---|
4142 | 4683 | if (cut) |
---|
4143 | 4684 | { |
---|
| 4685 | + if (Globals.SAVEONMAKE) |
---|
| 4686 | + Save(); |
---|
4144 | 4687 | //int indices[] = jList.getSelectedIndices(); |
---|
4145 | 4688 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4146 | 4689 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4176 | 4719 | //System.out.println("cut " + child); |
---|
4177 | 4720 | //System.out.println("parent = " + child.parent); |
---|
4178 | 4721 | // tmp.addChild(child); |
---|
4179 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4722 | + if (Grafreed.clipboardIsTempGroup) |
---|
4180 | 4723 | tGroup.add/*Child*/(tmp); |
---|
4181 | 4724 | else |
---|
4182 | | - GrafreeD.clipboard = tmp; |
---|
| 4725 | + Grafreed.clipboard = tmp; |
---|
4183 | 4726 | } |
---|
4184 | 4727 | else |
---|
4185 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4728 | + if (Grafreed.clipboardIsTempGroup) |
---|
4186 | 4729 | tGroup.add/*Child*/(child); |
---|
4187 | 4730 | else |
---|
4188 | | - GrafreeD.clipboard = child; |
---|
| 4731 | + Grafreed.clipboard = child; |
---|
4189 | 4732 | } |
---|
4190 | 4733 | |
---|
4191 | 4734 | //ResetModel(); |
---|
.. | .. |
---|
4217 | 4760 | //System.out.println("cut " + elem); |
---|
4218 | 4761 | //System.out.println("parent = " + elem.parent); |
---|
4219 | 4762 | // tmp.addChild(elem); |
---|
4220 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4763 | + if (Grafreed.clipboardIsTempGroup) |
---|
4221 | 4764 | tGroup.add/*Child*/(tmp); |
---|
4222 | 4765 | else |
---|
4223 | | - GrafreeD.clipboard = tmp; |
---|
| 4766 | + Grafreed.clipboard = tmp; |
---|
4224 | 4767 | } |
---|
4225 | 4768 | else |
---|
4226 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4769 | + if (Grafreed.clipboardIsTempGroup) |
---|
4227 | 4770 | tGroup.add/*Child*/(child); |
---|
4228 | 4771 | else |
---|
4229 | | - GrafreeD.clipboard = child; |
---|
| 4772 | + Grafreed.clipboard = child; |
---|
4230 | 4773 | } |
---|
4231 | 4774 | |
---|
4232 | 4775 | } |
---|
4233 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4234 | | - GrafreeD.clipboard = tGroup; |
---|
| 4776 | + |
---|
| 4777 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4778 | + Grafreed.clipboard = tGroup; |
---|
| 4779 | + |
---|
4235 | 4780 | if (cut) |
---|
4236 | 4781 | { |
---|
4237 | 4782 | ResetModel(); |
---|
.. | .. |
---|
4245 | 4790 | // return; |
---|
4246 | 4791 | boolean first = true; |
---|
4247 | 4792 | |
---|
4248 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4793 | + if (Grafreed.clipboardIsTempGroup) |
---|
4249 | 4794 | { |
---|
4250 | 4795 | Composite temp; |
---|
4251 | 4796 | |
---|
.. | .. |
---|
4256 | 4801 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4257 | 4802 | */ |
---|
4258 | 4803 | Object3D elem; |
---|
4259 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4804 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4260 | 4805 | { |
---|
4261 | 4806 | Object3D child = (Object3D)e.nextElement(); |
---|
4262 | 4807 | |
---|
.. | .. |
---|
4290 | 4835 | //Object3D cb = Applet3D.clipboard; |
---|
4291 | 4836 | //temp.addChild(cb); |
---|
4292 | 4837 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4293 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4294 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4295 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4296 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4297 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4838 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4839 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4840 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4841 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4842 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4298 | 4843 | else |
---|
4299 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4300 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4844 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4845 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4301 | 4846 | } |
---|
4302 | 4847 | |
---|
4303 | 4848 | ResetModel(); |
---|
4304 | 4849 | refreshContents(); |
---|
4305 | 4850 | } |
---|
4306 | 4851 | |
---|
4307 | | - void pasteInto(boolean copyit) |
---|
| 4852 | + void pasteInto(boolean copyit, boolean clone) |
---|
4308 | 4853 | { |
---|
4309 | 4854 | // if (GrafreeD.clipboard == null) |
---|
4310 | 4855 | // return; |
---|
.. | .. |
---|
4333 | 4878 | if (copyit) |
---|
4334 | 4879 | { |
---|
4335 | 4880 | // paste(false); |
---|
4336 | | - CloneClipboard(false); // sept 2014 |
---|
| 4881 | + if (clone) |
---|
| 4882 | + { |
---|
| 4883 | + CloneClipboard(false); // sept 2014 |
---|
| 4884 | + } |
---|
| 4885 | + else |
---|
| 4886 | + { |
---|
| 4887 | + paste(false); |
---|
| 4888 | + } |
---|
4337 | 4889 | } |
---|
4338 | 4890 | else |
---|
4339 | 4891 | { |
---|
4340 | 4892 | boolean first = true; |
---|
4341 | 4893 | |
---|
4342 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4894 | + if (Grafreed.clipboardIsTempGroup) |
---|
4343 | 4895 | { |
---|
4344 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4896 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4345 | 4897 | Object3D copy; |
---|
4346 | 4898 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4347 | 4899 | { |
---|
.. | .. |
---|
4351 | 4903 | } |
---|
4352 | 4904 | } else |
---|
4353 | 4905 | { |
---|
4354 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4906 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4355 | 4907 | } |
---|
4356 | 4908 | } |
---|
4357 | 4909 | } |
---|
.. | .. |
---|
4756 | 5308 | } |
---|
4757 | 5309 | */ |
---|
4758 | 5310 | |
---|
4759 | | - void ImportGFD() |
---|
4760 | | - { |
---|
4761 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4762 | | - browser.show(); |
---|
4763 | | - String filename = browser.getFile(); |
---|
4764 | | - if (filename != null && filename.length() > 0) |
---|
4765 | | - { |
---|
4766 | | - String fullname = browser.getDirectory() + filename; |
---|
4767 | | - |
---|
4768 | | - //Object3D readobj = |
---|
4769 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4770 | | - //makeSomething(readobj); |
---|
4771 | | - } |
---|
4772 | | - } |
---|
4773 | | - |
---|
4774 | 5311 | /* |
---|
4775 | 5312 | public void Callback(Object obj) |
---|
4776 | 5313 | { |
---|
.. | .. |
---|
4794 | 5331 | } |
---|
4795 | 5332 | */ |
---|
4796 | 5333 | |
---|
4797 | | - void ImportVRMLX3D() |
---|
4798 | | - { |
---|
4799 | | - if (GrafreeD.standAlone) |
---|
4800 | | - { |
---|
4801 | | - /**/ |
---|
4802 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4803 | | - browser.show(); |
---|
4804 | | - String filename = browser.getFile(); |
---|
4805 | | - if (filename != null && filename.length() > 0) |
---|
4806 | | - { |
---|
4807 | | - String fullname = browser.getDirectory() + filename; |
---|
4808 | | - LoadVRMLX3D(fullname); |
---|
4809 | | - } |
---|
4810 | | - /**/ |
---|
4811 | | - } |
---|
4812 | | - } |
---|
4813 | | - |
---|
4814 | 5334 | String GetFile(String dialogName) |
---|
4815 | 5335 | { |
---|
4816 | | - if (GrafreeD.standAlone) |
---|
| 5336 | + if (Grafreed.standAlone) |
---|
4817 | 5337 | { |
---|
4818 | 5338 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4819 | 5339 | browser.show(); |
---|
.. | .. |
---|
4877 | 5397 | cButton flashSelectionButton; |
---|
4878 | 5398 | cButton editButton; |
---|
4879 | 5399 | cButton uneditButton; |
---|
| 5400 | + JCheckBox allParamsButton; |
---|
4880 | 5401 | cButton clearpanelButton; |
---|
4881 | | - cButton allParamsButton; |
---|
4882 | 5402 | cButton unselectButton; |
---|
4883 | 5403 | |
---|
| 5404 | + cButton minButton; |
---|
| 5405 | + cButton maxButton; |
---|
| 5406 | + cButton fullButton; |
---|
| 5407 | + cButton undoButton; |
---|
| 5408 | + cButton redoButton; |
---|
| 5409 | + cButton saveButton; |
---|
| 5410 | + cButton oneStepButton; |
---|
| 5411 | + |
---|
| 5412 | + cButton groupButton; |
---|
| 5413 | + cButton ungroupButton; |
---|
| 5414 | + cButton compositeButton; |
---|
| 5415 | + |
---|
| 5416 | + cButton gridButton; |
---|
| 5417 | + cButton boxButton; |
---|
| 5418 | + cButton sphereButton; |
---|
| 5419 | + cButton coneButton; |
---|
| 5420 | + cButton torusButton; |
---|
| 5421 | + cButton superButton; |
---|
| 5422 | + cButton kleinButton; |
---|
| 5423 | + cButton particlesButton; |
---|
| 5424 | + cButton overlayButton; |
---|
| 5425 | + cButton lightButton; |
---|
| 5426 | + |
---|
4884 | 5427 | cButton screenfitButton; |
---|
4885 | 5428 | cButton screenfitpointButton; |
---|
4886 | 5429 | cButton snapobjectButton; |
---|
.. | .. |
---|
4891 | 5434 | cButton closeButton; |
---|
4892 | 5435 | |
---|
4893 | 5436 | cButton setsupportButton; |
---|
4894 | | - |
---|
4895 | | - cButton twoButton; |
---|
4896 | | - cButton sixButton; |
---|
4897 | | - cButton threeButton; |
---|
4898 | | - cButton sevenButton; |
---|
4899 | | - cButton fourButton; // full panel |
---|
4900 | | - cButton oneButton; // full XYZ |
---|
4901 | | - //cButton currentLayout; |
---|
4902 | 5437 | |
---|
4903 | 5438 | // |
---|
4904 | 5439 | //Composite |
---|
.. | .. |
---|
4911 | 5446 | private MenuItem lookFromItem; |
---|
4912 | 5447 | private MenuItem switchItem; |
---|
4913 | 5448 | private MenuItem cutItem; |
---|
4914 | | - private MenuItem duplicateItem; |
---|
| 5449 | + private MenuItem undoItem; |
---|
| 5450 | + private MenuItem redoItem; |
---|
| 5451 | + private JMenuItem duplicateItem; |
---|
4915 | 5452 | private MenuItem cloneItem; |
---|
4916 | 5453 | private MenuItem cloneSupportItem; |
---|
4917 | 5454 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
4924 | 5461 | private MenuItem linkverticesItem; |
---|
4925 | 5462 | private MenuItem relinkverticesItem; |
---|
4926 | 5463 | private MenuItem setMasterItem; |
---|
4927 | | - private MenuItem resetMeshItem; |
---|
| 5464 | + private MenuItem resetAllItem; |
---|
4928 | 5465 | private MenuItem stepAllItem; |
---|
4929 | 5466 | private MenuItem revertMeshItem; |
---|
4930 | 5467 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4935 | 5472 | private MenuItem mergeGeometriesItem; |
---|
4936 | 5473 | private MenuItem copyItem; |
---|
4937 | 5474 | private MenuItem pasteItem; |
---|
| 5475 | + private MenuItem pasteIntoItem; |
---|
4938 | 5476 | private MenuItem pasteLinkItem; |
---|
4939 | 5477 | private MenuItem pasteCloneItem; |
---|
4940 | 5478 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
4973 | 5511 | private MenuItem showleavesItem; |
---|
4974 | 5512 | private MenuItem markleavesItem; |
---|
4975 | 5513 | private MenuItem unmarkleavesItem; |
---|
| 5514 | + private MenuItem rewindleavesItem; |
---|
| 5515 | + private MenuItem unrewindleavesItem; |
---|
| 5516 | + private MenuItem randomleavesItem; |
---|
| 5517 | + private MenuItem unrandomleavesItem; |
---|
4976 | 5518 | |
---|
4977 | 5519 | private MenuItem flipVItem; |
---|
4978 | 5520 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
4984 | 5526 | private MenuItem panoTexturesItem; |
---|
4985 | 5527 | |
---|
4986 | 5528 | private MenuItem resetCentroidItem; |
---|
4987 | | - private MenuItem transformgeometryItem; |
---|
| 5529 | + private MenuItem resetCentroidXZItem; |
---|
4988 | 5530 | private MenuItem resetTransformItem; |
---|
| 5531 | + private MenuItem transformGeometryItem; |
---|
| 5532 | + private MenuItem transformChildrenItem; |
---|
4989 | 5533 | private MenuItem hideItem; |
---|
4990 | 5534 | private MenuItem grabItem; |
---|
4991 | 5535 | private MenuItem backItem; |
---|
.. | .. |
---|
5007 | 5551 | |
---|
5008 | 5552 | private MenuItem resetParentItem; |
---|
5009 | 5553 | private MenuItem repairParentItem; |
---|
| 5554 | + private MenuItem repairShadowItem; |
---|
5010 | 5555 | private MenuItem sortbysizeItem; |
---|
5011 | 5556 | private MenuItem sortbynameItem; |
---|
5012 | 5557 | |
---|
.. | .. |
---|
5031 | 5576 | private MenuItem blobItem; |
---|
5032 | 5577 | private MenuItem latheItem; |
---|
5033 | 5578 | private MenuItem bezierItem; |
---|
5034 | | - private MenuItem checkerItem; |
---|
| 5579 | + private MenuItem overlayItem; |
---|
5035 | 5580 | private MenuItem meshItem; |
---|
5036 | 5581 | // private MenuItem meshGroupItem; |
---|
5037 | 5582 | private MenuItem springItem; |
---|
.. | .. |
---|
5053 | 5598 | private MenuItem doubleItem; |
---|
5054 | 5599 | private MenuItem tripleItem; |
---|
5055 | 5600 | |
---|
5056 | | - private MenuItem importGFDItem; |
---|
5057 | | - private MenuItem importVRMLX3DItem; |
---|
5058 | | - private MenuItem import3DSItem; |
---|
5059 | | - private MenuItem importOBJItem; |
---|
5060 | | - |
---|
5061 | 5601 | private MenuItem computeAOItem; |
---|
5062 | 5602 | private MenuItem recompileItem; |
---|
5063 | 5603 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5067 | 5607 | private MenuItem analyzeItem; |
---|
5068 | 5608 | private MenuItem dumpItem; |
---|
5069 | 5609 | //boolean freezemodel = false; |
---|
| 5610 | + |
---|
| 5611 | + Menu cameraMenu; |
---|
| 5612 | + MenuItem editCameraItem; |
---|
| 5613 | + MenuItem revertCameraItem; |
---|
5070 | 5614 | } |
---|