.. | .. |
---|
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 | | - |
---|
438 | 585 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
439 | 586 | |
---|
440 | | - oe.aConstraints.gridwidth = 1; |
---|
441 | | - oe.aConstraints.gridx = 0; |
---|
| 587 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 588 | + //minButton.setToolTipText("Minimize window"); |
---|
| 589 | + //minButton.addActionListener(this); |
---|
442 | 590 | |
---|
443 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
444 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 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"); |
---|
445 | 613 | liveCB.addItemListener(this); |
---|
446 | 614 | |
---|
447 | | - oe.aConstraints.gridx += 1; |
---|
448 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), 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"); |
---|
| 621 | + fastCB.addItemListener(this); |
---|
| 622 | + |
---|
| 623 | + oe.toolboxPanel.Return(); |
---|
| 624 | + |
---|
| 625 | + oe.toolboxPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
449 | 626 | trackCB.setToolTipText("Enable tracking"); |
---|
450 | 627 | trackCB.addItemListener(this); |
---|
451 | 628 | |
---|
452 | | - oe.aConstraints.gridx += 1; |
---|
453 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 629 | + oe.toolboxPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
454 | 630 | screenfitButton.setToolTipText("Screen fit"); |
---|
455 | 631 | screenfitButton.addActionListener(this); |
---|
456 | | - oe.aConstraints.gridx += 1; |
---|
| 632 | + |
---|
457 | 633 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
458 | 634 | // screenfitpointButton.addActionListener(this); |
---|
459 | | -// oe.aConstraints.gridx += 1; |
---|
460 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
461 | | - snapobjectButton.addActionListener(this); |
---|
462 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
463 | | - oe.aConstraints.gridx += 1; |
---|
464 | 635 | |
---|
465 | | - //aConstraints.gridx = 0; |
---|
466 | | - //aConstraints.gridy += 1; |
---|
467 | | - oe.aConstraints.weighty = 0; |
---|
468 | | - oe.aConstraints.gridwidth = 1; |
---|
469 | | - |
---|
470 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
471 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
| 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"); |
---|
472 | 645 | flashSelectionButton.addActionListener(this); |
---|
473 | 646 | |
---|
474 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
| 647 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
475 | 648 | |
---|
476 | | - oe.aConstraints.gridx += 1; |
---|
477 | | - oe.aConstraints.weighty = 0; |
---|
478 | | - oe.aConstraints.gridwidth = 1; |
---|
479 | | - |
---|
480 | | - // |
---|
481 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 649 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
482 | 650 | twoButton.setToolTipText("Show center view only"); |
---|
483 | 651 | twoButton.addActionListener(this); |
---|
484 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 652 | + this.fullscreenLayout = twoButton; |
---|
| 653 | + |
---|
| 654 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
485 | 655 | fourButton.addActionListener(this); |
---|
486 | 656 | fourButton.setToolTipText("Show left panel only"); |
---|
487 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 657 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
488 | 658 | sixButton.setToolTipText("2-column layout left"); |
---|
489 | 659 | sixButton.addActionListener(this); |
---|
490 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 660 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
491 | 661 | threeButton.setToolTipText("2-column layout right"); |
---|
492 | 662 | threeButton.addActionListener(this); |
---|
493 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 663 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
494 | 664 | sevenButton.setToolTipText("3-column layout"); |
---|
495 | 665 | sevenButton.addActionListener(this); |
---|
496 | 666 | // |
---|
497 | 667 | |
---|
498 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints); |
---|
499 | | - rootButton.setToolTipText("Edit object in new tab"); |
---|
| 668 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 669 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
500 | 670 | rootButton.addActionListener(this); |
---|
501 | | - oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 671 | + |
---|
| 672 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
503 | 673 | closeButton.setToolTipText("Close tab"); |
---|
504 | 674 | closeButton.addActionListener(this); |
---|
505 | 675 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
506 | 676 | //clearButton.addActionListener(this); |
---|
507 | | - oe.aConstraints.gridx += 1; |
---|
508 | | - |
---|
509 | | - oe.aConstraints.gridx = 1; // |
---|
510 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
511 | | - editButton.addActionListener(this); |
---|
512 | | - oe.aConstraints.gridx += 1; |
---|
513 | | - oe.aConstraints.weighty = 0; |
---|
514 | | - oe.aConstraints.gridwidth = 1; |
---|
515 | 677 | |
---|
516 | | - 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"); |
---|
517 | 731 | uneditButton.addActionListener(this); |
---|
518 | 732 | |
---|
519 | | - oe.aConstraints.gridx += 1; |
---|
520 | | - oe.aConstraints.weighty = 0; |
---|
521 | | - oe.aConstraints.gridwidth = 1; |
---|
522 | | - |
---|
523 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
524 | | - clearPanelButton.addActionListener(this); |
---|
525 | | - |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 733 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 734 | + allParamsButton.setToolTipText("Edit all params"); |
---|
531 | 735 | allParamsButton.addActionListener(this); |
---|
532 | 736 | |
---|
533 | | - oe.aConstraints.gridx += 1; |
---|
534 | | - oe.aConstraints.weighty = 0; |
---|
535 | | - oe.aConstraints.gridwidth = 1; |
---|
536 | | - |
---|
537 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 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"); |
---|
538 | 743 | unselectButton.addActionListener(this); |
---|
539 | 744 | |
---|
| 745 | + editCommandsPanel.preferredHeight = 1; |
---|
| 746 | + |
---|
| 747 | +// oe.treePanel.add(commandsPanel); |
---|
| 748 | +// oe.treePanel.Return(); |
---|
| 749 | + |
---|
540 | 750 | // oe.aConstraints.gridx += 1; |
---|
541 | 751 | // oe.aConstraints.weighty = 0; |
---|
542 | 752 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
548 | 758 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
549 | 759 | // gcButton.addActionListener(this); |
---|
550 | 760 | |
---|
551 | | - oe.aConstraints.gridx = 0; |
---|
552 | | - oe.aConstraints.gridy += 1; |
---|
553 | | - |
---|
554 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
555 | | - oe.aConstraints.gridwidth = 100; |
---|
556 | | - // oe.aConstraints.gridheight = 100; |
---|
557 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
558 | | - oe.aConstraints.gridheight = 1; |
---|
559 | | - oe.aConstraints.weighty = 0.5; |
---|
560 | | - oe.aConstraints.gridx = 0; |
---|
561 | | - JScrollPane jSP; |
---|
| 761 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 762 | + |
---|
| 763 | + JScrollPane jSP; |
---|
562 | 764 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
563 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 765 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
564 | 766 | ResetModel(); |
---|
565 | | - oe.aConstraints.weighty = 0.5; |
---|
566 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
567 | | - oe.aConstraints.gridy += 1; |
---|
568 | | - oe.aConstraints.gridwidth = 1; |
---|
| 767 | + |
---|
| 768 | + oe.treePanel.add(jSPPanel); |
---|
| 769 | + oe.treePanel.Return(); |
---|
569 | 770 | |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 2; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 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"); |
---|
574 | 775 | colorCB.addItemListener(this); |
---|
575 | | - oe.aConstraints.gridx += 2; |
---|
576 | | - 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"); |
---|
577 | 779 | materialCB.addItemListener(this); |
---|
578 | | - oe.aConstraints.gridx += 2; |
---|
579 | | - 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"); |
---|
580 | 783 | textureCB.addItemListener(this); |
---|
581 | 784 | |
---|
582 | | - oe.aConstraints.gridx = 0; |
---|
583 | | - oe.aConstraints.gridy += 1; |
---|
| 785 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 786 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 787 | + oe.treePanel.Return(); |
---|
584 | 788 | |
---|
| 789 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 790 | +// mainPanel.setResizeWeight(0.5); |
---|
| 791 | + |
---|
585 | 792 | //jList.addListSelectionListener(this); |
---|
586 | 793 | oe.jTree.addTreeSelectionListener(this); |
---|
587 | 794 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
604 | 811 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
605 | 812 | } |
---|
606 | 813 | |
---|
607 | | - void AddOptions(JPanel panel, GridBagConstraints constraints) |
---|
| 814 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
608 | 815 | { |
---|
609 | | - constraints.gridx = 0; |
---|
610 | | - constraints.gridy = 0; |
---|
611 | | - panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints); |
---|
612 | | - fastCB.setToolTipText("Fast mode"); |
---|
613 | | - fastCB.addItemListener(this); |
---|
614 | | - constraints.gridy += 1; |
---|
615 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints); |
---|
616 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
617 | | - supportCB.addItemListener(this); |
---|
618 | | - |
---|
619 | | - // constraints.gridy += 1; |
---|
620 | | - // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
621 | | - // localCB.addItemListener(this); |
---|
622 | | - |
---|
623 | | - constraints.gridy += 1; |
---|
624 | | - panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints); |
---|
625 | | - crowdCB.setToolTipText("Used for crowds"); |
---|
626 | | - crowdCB.addItemListener(this); |
---|
627 | | - |
---|
628 | | - constraints.gridy += 1; |
---|
629 | | - panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints); |
---|
630 | | - smoothCB.setToolTipText("Snapping delay"); |
---|
631 | | - smoothCB.addItemListener(this); |
---|
632 | | - |
---|
633 | | - constraints.gridy += 1; |
---|
634 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints); |
---|
635 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
636 | | - slowCB.addItemListener(this); |
---|
637 | | - constraints.gridy += 1; |
---|
638 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints); |
---|
| 816 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
639 | 817 | boxCB.setToolTipText("Display bounding boxes"); |
---|
640 | 818 | boxCB.addItemListener(this); |
---|
641 | | - constraints.gridy += 1; |
---|
642 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints); |
---|
| 819 | + |
---|
| 820 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
643 | 821 | zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
644 | 822 | zoomBoxCB.addItemListener(this); |
---|
645 | 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 | + |
---|
646 | 845 | // constraints.gridy += 1; |
---|
647 | 846 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
648 | 847 | // speakerMocapCB.addItemListener(this); |
---|
.. | .. |
---|
650 | 849 | if (false) |
---|
651 | 850 | { |
---|
652 | 851 | // handled in scripts |
---|
653 | | - constraints.gridy += 1; |
---|
654 | | - panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints); |
---|
| 852 | + //constraints.gridy += 1; |
---|
| 853 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
655 | 854 | speakerCameraCB.addItemListener(this); |
---|
656 | 855 | |
---|
657 | | - constraints.gridy += 1; |
---|
658 | | - panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints); |
---|
| 856 | + //constraints.gridy += 1; |
---|
| 857 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
659 | 858 | speakerFocusCB.addItemListener(this); |
---|
660 | 859 | |
---|
661 | | - constraints.gridy += 1; |
---|
662 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints); |
---|
| 860 | + //constraints.gridy += 1; |
---|
| 861 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
663 | 862 | smoothfocusCB.addItemListener(this); |
---|
664 | 863 | } |
---|
665 | 864 | |
---|
.. | .. |
---|
667 | 866 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
668 | 867 | // debugCB.addItemListener(this); |
---|
669 | 868 | |
---|
670 | | - constraints.gridy += 1; |
---|
671 | | - panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints); |
---|
| 869 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 870 | + oeilCB.setToolTipText("Move camera when tracking target"); |
---|
672 | 871 | oeilCB.addItemListener(this); |
---|
673 | 872 | |
---|
674 | | - constraints.gridy += 1; |
---|
675 | | - panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints); |
---|
| 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); |
---|
676 | 884 | lookAtCB.setToolTipText("Look-at target"); |
---|
677 | 885 | lookAtCB.addItemListener(this); |
---|
| 886 | + } |
---|
| 887 | + |
---|
| 888 | + } |
---|
| 889 | + |
---|
| 890 | + cGridBag fill = new cGridBag(); |
---|
| 891 | + |
---|
| 892 | + fill.preferredHeight = 200; |
---|
| 893 | + |
---|
| 894 | + panel.add(fill); |
---|
678 | 895 | |
---|
679 | 896 | } |
---|
680 | 897 | |
---|
681 | 898 | void EditObject(Object3D obj) |
---|
682 | 899 | { |
---|
683 | 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 | + |
---|
684 | 909 | radioButton.SetObject(obj); |
---|
685 | 910 | radioButton.layout = sevenButton; |
---|
686 | 911 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
689 | 914 | buttonGroup.add(radioButton); |
---|
690 | 915 | radioButton.doClick(); |
---|
691 | 916 | } |
---|
| 917 | + |
---|
692 | 918 | void SetupViews(ObjEditor oe) |
---|
693 | 919 | { |
---|
| 920 | + theFrame = this; |
---|
| 921 | + |
---|
694 | 922 | oe.SetupViews(); |
---|
695 | 923 | |
---|
696 | 924 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
699 | 927 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
700 | 928 | } |
---|
701 | 929 | |
---|
702 | | - JCheckBox liveCB; |
---|
703 | | - JCheckBox supportCB; |
---|
704 | | - JCheckBox localCB; |
---|
705 | | - JCheckBox crowdCB; |
---|
706 | | - JCheckBox smoothCB; |
---|
707 | | - JCheckBox fastCB; |
---|
708 | | - JCheckBox slowCB; |
---|
709 | | - JCheckBox boxCB; |
---|
710 | | - JCheckBox zoomBoxCB; |
---|
711 | | - JCheckBox trackCB; |
---|
712 | | - 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; |
---|
713 | 941 | // JCheckBox speakerMocapCB; |
---|
714 | | - JCheckBox speakerCameraCB; |
---|
715 | | - JCheckBox speakerFocusCB; |
---|
716 | | - JCheckBox debugCB; |
---|
717 | | - JCheckBox oeilCB; |
---|
718 | | - JCheckBox lookAtCB; |
---|
| 942 | + cCheckBox speakerCameraCB; |
---|
| 943 | + cCheckBox speakerFocusCB; |
---|
| 944 | + cCheckBox debugCB; |
---|
| 945 | + |
---|
| 946 | + cCheckBox oeilCB; |
---|
| 947 | + cCheckBox shadowCB; |
---|
| 948 | + cCheckBox autosaveCB; |
---|
| 949 | + cCheckBox lookAtCB; |
---|
719 | 950 | |
---|
720 | 951 | // static int COLOR = 1; |
---|
721 | 952 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
723 | 954 | |
---|
724 | 955 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
725 | 956 | |
---|
726 | | - JCheckBox colorCB; |
---|
727 | | - JCheckBox materialCB; |
---|
728 | | - JCheckBox textureCB; |
---|
| 957 | + cCheckBox colorCB; |
---|
| 958 | + cCheckBox materialCB; |
---|
| 959 | + cCheckBox textureCB; |
---|
729 | 960 | |
---|
730 | 961 | public void itemStateChanged(ItemEvent e) |
---|
731 | 962 | { |
---|
.. | .. |
---|
753 | 984 | } else if(e.getSource() == liveCB) |
---|
754 | 985 | { |
---|
755 | 986 | cameraView.ToggleLive(); |
---|
| 987 | + refreshContents(false); |
---|
756 | 988 | } |
---|
757 | 989 | else if(e.getSource() == supportCB) |
---|
758 | 990 | { |
---|
.. | .. |
---|
817 | 1049 | { |
---|
818 | 1050 | cameraView.ToggleOeil(); |
---|
819 | 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 | + } |
---|
820 | 1060 | else if(e.getSource() == lookAtCB) |
---|
821 | 1061 | { |
---|
822 | 1062 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
833 | 1073 | |
---|
834 | 1074 | /**/ |
---|
835 | 1075 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
836 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1076 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1077 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
837 | 1078 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
838 | 1079 | // We can't move the root node or an empty selection |
---|
839 | 1080 | return; |
---|
.. | .. |
---|
905 | 1146 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
906 | 1147 | // return; |
---|
907 | 1148 | // } |
---|
908 | | - if (string.charAt(0) == '/') |
---|
| 1149 | + |
---|
| 1150 | + // File path for Mac and Windows |
---|
| 1151 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
909 | 1152 | { |
---|
910 | 1153 | // file(s) |
---|
911 | 1154 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
932 | 1175 | |
---|
933 | 1176 | flashIt = false; |
---|
934 | 1177 | CameraPane pane = (CameraPane) target; |
---|
935 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1178 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
936 | 1179 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
937 | 1180 | |
---|
938 | 1181 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
955 | 1198 | return; |
---|
956 | 1199 | } |
---|
957 | 1200 | |
---|
958 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
959 | | - { |
---|
| 1201 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1202 | +// { |
---|
960 | 1203 | loadClipboard(true); |
---|
961 | 1204 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
962 | | - pasteInto(false); |
---|
963 | | - } else { |
---|
964 | | - loadClipboard(false); |
---|
965 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
966 | | - pasteInto(false); // true); // ??? |
---|
967 | | - } |
---|
| 1205 | + pasteInto(false, false); |
---|
| 1206 | +// } else { |
---|
| 1207 | +// loadClipboard(false); |
---|
| 1208 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1209 | +// pasteInto(false, false); // true); // ??? |
---|
| 1210 | +// } |
---|
968 | 1211 | } |
---|
969 | 1212 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
970 | 1213 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1085 | 1328 | kleinItem.addActionListener(this); |
---|
1086 | 1329 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1087 | 1330 | particleItem.addActionListener(this); |
---|
| 1331 | + if (Globals.ADVANCED) |
---|
| 1332 | + { |
---|
1088 | 1333 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1089 | 1334 | ragdollItem.addActionListener(this); |
---|
1090 | 1335 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1091 | 1336 | ragdoll2Item.addActionListener(this); |
---|
| 1337 | + } |
---|
1092 | 1338 | menu.add("-"); |
---|
1093 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1339 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1094 | 1340 | meshItem.addActionListener(this); |
---|
1095 | 1341 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1096 | 1342 | // meshGroupItem.addActionListener(this); |
---|
| 1343 | + if (Globals.ADVANCED) |
---|
| 1344 | + { |
---|
1097 | 1345 | springItem = menu.add(new MenuItem("Spring")); |
---|
1098 | 1346 | springItem.addActionListener(this); |
---|
1099 | 1347 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1100 | 1348 | flagItem.addActionListener(this); |
---|
1101 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1102 | | - bezierItem.addActionListener(this); |
---|
1103 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1104 | | - checkerItem.addActionListener(this); |
---|
1105 | 1349 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1106 | 1350 | blobItem.addActionListener(this); |
---|
1107 | 1351 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1108 | 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); |
---|
1109 | 1358 | lightItem = menu.add(new MenuItem("Light")); |
---|
1110 | 1359 | lightItem.addActionListener(this); |
---|
1111 | 1360 | menu.add("-"); |
---|
.. | .. |
---|
1115 | 1364 | loopItem.addActionListener(this); |
---|
1116 | 1365 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1117 | 1366 | doubleItem.addActionListener(this); |
---|
| 1367 | + if (Globals.ADVANCED) |
---|
| 1368 | + { |
---|
1118 | 1369 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1119 | 1370 | tripleItem.addActionListener(this); |
---|
| 1371 | + } |
---|
1120 | 1372 | } |
---|
1121 | 1373 | |
---|
1122 | 1374 | void buildToolsMenu(Menu menu) |
---|
1123 | 1375 | { |
---|
1124 | 1376 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1125 | 1377 | animationItem.addItemListener(this); |
---|
1126 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1378 | + animationItem.setState(Globals.ANIMATION); |
---|
1127 | 1379 | |
---|
1128 | 1380 | menu.add("-"); |
---|
1129 | 1381 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1130 | 1382 | parseverticesItem.addActionListener(this); |
---|
1131 | 1383 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1132 | 1384 | textureFieldItem.addActionListener(this); |
---|
1133 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1385 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1134 | 1386 | alignItem.addActionListener(this); |
---|
1135 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1136 | | - mirrorItem.addActionListener(this); |
---|
1137 | 1387 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1138 | 1388 | reduceMorphItem.addActionListener(this); |
---|
1139 | 1389 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1140 | 1390 | reduce34MorphItem.addActionListener(this); |
---|
1141 | | - |
---|
| 1391 | + menu.add("-"); |
---|
1142 | 1392 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1143 | 1393 | computeAOItem.addActionListener(this); |
---|
1144 | | - menu.add("-"); |
---|
1145 | 1394 | |
---|
| 1395 | + if (Globals.ADVANCED) |
---|
| 1396 | + { |
---|
| 1397 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1398 | + mirrorItem.addActionListener(this); |
---|
| 1399 | + menu.add("-"); |
---|
1146 | 1400 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1147 | 1401 | memoryItem.addActionListener(this); |
---|
1148 | 1402 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1149 | 1403 | analyzeItem.addActionListener(this); |
---|
1150 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1404 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1151 | 1405 | dumpItem.addActionListener(this); |
---|
1152 | 1406 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1153 | 1407 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1165 | 1419 | menu.add("-"); |
---|
1166 | 1420 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1167 | 1421 | editScriptItem.addActionListener(this); |
---|
| 1422 | + } |
---|
1168 | 1423 | } |
---|
1169 | 1424 | |
---|
1170 | 1425 | void ScreenFit() |
---|
.. | .. |
---|
1287 | 1542 | shadow.material = new cMaterial(obj.material); |
---|
1288 | 1543 | shadow.material.diffuse = 0.0001f; |
---|
1289 | 1544 | shadow.material.specular = 0.0001f; |
---|
| 1545 | + //shadow.projectedVertices[1].x = 300; |
---|
1290 | 1546 | |
---|
1291 | 1547 | makeSomething(shadow); |
---|
1292 | 1548 | } |
---|
.. | .. |
---|
1493 | 1749 | |
---|
1494 | 1750 | void Overwrite(int mask) |
---|
1495 | 1751 | { |
---|
1496 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1752 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1497 | 1753 | { |
---|
1498 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1754 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1499 | 1755 | |
---|
1500 | 1756 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1501 | 1757 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1543 | 1799 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1544 | 1800 | objEditor.cameraView.repaint(); |
---|
1545 | 1801 | } else |
---|
1546 | | - if (source == rectoidItem) |
---|
| 1802 | + if (source == rectoidItem || source == boxButton) |
---|
1547 | 1803 | { |
---|
1548 | 1804 | makeSomething(new Box()); |
---|
1549 | 1805 | } else |
---|
1550 | | - if (source == particleItem) |
---|
| 1806 | + if (source == particleItem || source == particlesButton) |
---|
1551 | 1807 | { |
---|
1552 | 1808 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1553 | 1809 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1626 | 1882 | |
---|
1627 | 1883 | makeSomething(obj); |
---|
1628 | 1884 | } else |
---|
1629 | | - if (source == gridItem) |
---|
| 1885 | + if (source == gridItem || source == gridButton) |
---|
1630 | 1886 | { |
---|
1631 | 1887 | makeSomething(new Grid()); |
---|
1632 | 1888 | } else |
---|
1633 | | - if (source == ellipsoidItem) |
---|
| 1889 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1634 | 1890 | { |
---|
1635 | 1891 | makeSomething(new Sphere()); |
---|
1636 | 1892 | } else |
---|
1637 | | - if (source == coneItem) |
---|
| 1893 | + if (source == coneItem || source == coneButton) |
---|
1638 | 1894 | { |
---|
1639 | 1895 | makeSomething(new Cone()); |
---|
1640 | 1896 | } else |
---|
1641 | | - if (source == torusItem) |
---|
| 1897 | + if (source == torusItem || source == torusButton) |
---|
1642 | 1898 | { |
---|
1643 | 1899 | makeSomething(new Torus()); |
---|
1644 | 1900 | } else |
---|
1645 | | - if (source == superItem) |
---|
| 1901 | + if (source == superItem || source == superButton) |
---|
1646 | 1902 | { |
---|
1647 | 1903 | makeSomething(new Superellipsoid()); |
---|
1648 | 1904 | } else |
---|
1649 | | - if (source == kleinItem) |
---|
| 1905 | + if (source == kleinItem || source == kleinButton) |
---|
1650 | 1906 | { |
---|
1651 | 1907 | makeSomething(new Klein()); |
---|
1652 | 1908 | } else |
---|
.. | .. |
---|
1666 | 1922 | { |
---|
1667 | 1923 | makeSomething(new BezierSurface()); |
---|
1668 | 1924 | } else |
---|
1669 | | - if (source == checkerItem) |
---|
| 1925 | + if (source == overlayItem || source == overlayButton) |
---|
1670 | 1926 | { |
---|
1671 | 1927 | /* |
---|
1672 | 1928 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1714 | 1970 | s.setup(); |
---|
1715 | 1971 | makeSomething(s); |
---|
1716 | 1972 | } else |
---|
1717 | | - if (source == lightItem) |
---|
| 1973 | + if (source == lightItem || source == lightButton) |
---|
1718 | 1974 | { |
---|
1719 | 1975 | makeSomething(new Light()); |
---|
1720 | 1976 | } else |
---|
.. | .. |
---|
1800 | 2056 | csg.addChild(child); |
---|
1801 | 2057 | child.addChild(csg); |
---|
1802 | 2058 | } else |
---|
1803 | | - |
---|
1804 | | - if (source == importGFDItem) |
---|
1805 | | - { |
---|
1806 | | - ImportGFD(); |
---|
1807 | | - } else |
---|
1808 | | - if (source == importVRMLX3DItem) |
---|
1809 | | - { |
---|
1810 | | - ImportVRMLX3D(); |
---|
1811 | | - } else |
---|
1812 | | - if (source == import3DSItem) |
---|
1813 | | - { |
---|
1814 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1815 | | - } else |
---|
1816 | | - if (source == importOBJItem) |
---|
1817 | | - { |
---|
1818 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1819 | | - } else |
---|
1820 | 2059 | if (source == computeAOItem) |
---|
1821 | 2060 | { |
---|
1822 | 2061 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
.. | .. |
---|
1835 | 2074 | if (source == invariantsItem) |
---|
1836 | 2075 | { |
---|
1837 | 2076 | System.out.println("Invariants:"); |
---|
1838 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2077 | + Grafreed.grafreeD.universe.invariants(); |
---|
1839 | 2078 | } else |
---|
1840 | 2079 | if (source == memoryItem) |
---|
1841 | 2080 | { |
---|
.. | .. |
---|
1853 | 2092 | if (source == dumpItem) |
---|
1854 | 2093 | { |
---|
1855 | 2094 | DumpObject(); |
---|
| 2095 | + } else |
---|
| 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(); |
---|
1856 | 2124 | } else |
---|
1857 | 2125 | if (source == screenfitButton) |
---|
1858 | 2126 | { |
---|
.. | .. |
---|
1903 | 2171 | { |
---|
1904 | 2172 | loadClipboard(true); |
---|
1905 | 2173 | } else |
---|
| 2174 | + if (source == undoItem) |
---|
| 2175 | + { |
---|
| 2176 | + Undo(); |
---|
| 2177 | + } else |
---|
| 2178 | + if (source == redoItem) |
---|
| 2179 | + { |
---|
| 2180 | + Redo(); |
---|
| 2181 | + } else |
---|
1906 | 2182 | if (source == duplicateItem) |
---|
1907 | 2183 | { |
---|
1908 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2184 | + Object3D keep = Grafreed.clipboard; |
---|
1909 | 2185 | loadClipboard(false); |
---|
1910 | 2186 | paste(false); |
---|
1911 | | - GrafreeD.clipboard = keep; |
---|
| 2187 | + Grafreed.clipboard = keep; |
---|
1912 | 2188 | } else |
---|
1913 | 2189 | if (source == cloneItem) |
---|
1914 | 2190 | { |
---|
.. | .. |
---|
1926 | 2202 | { |
---|
1927 | 2203 | paste(false); |
---|
1928 | 2204 | } else |
---|
| 2205 | + if (source == pasteIntoItem) |
---|
| 2206 | + { |
---|
| 2207 | + pasteInto(true, false); |
---|
| 2208 | + } else |
---|
1929 | 2209 | if (source == pasteLinkItem) |
---|
1930 | 2210 | { |
---|
1931 | | - pasteInto(false); |
---|
| 2211 | + pasteInto(false, false); |
---|
1932 | 2212 | } else |
---|
1933 | 2213 | if (source == pasteCloneItem) |
---|
1934 | 2214 | { |
---|
1935 | | - pasteInto(true); |
---|
| 2215 | + pasteInto(true, true); |
---|
1936 | 2216 | } else |
---|
1937 | 2217 | if (source == pasteExpandItem) |
---|
1938 | 2218 | { |
---|
.. | .. |
---|
2124 | 2404 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2125 | 2405 | // refreshContents(); |
---|
2126 | 2406 | // } |
---|
2127 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2407 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2128 | 2408 | { |
---|
2129 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2409 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2130 | 2410 | |
---|
2131 | 2411 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2132 | 2412 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2134 | 2414 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2135 | 2415 | for (int i=0; i<group.selection.size(); i++) |
---|
2136 | 2416 | { |
---|
2137 | | - boolean random = CameraPane.RANDOM; |
---|
2138 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2417 | + boolean random = CameraPane.SWITCH; |
---|
| 2418 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2139 | 2419 | group.selection.get(i).linkVerticesThis(content); |
---|
2140 | 2420 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2141 | | - CameraPane.RANDOM = random; |
---|
| 2421 | + CameraPane.SWITCH = random; |
---|
2142 | 2422 | } |
---|
2143 | 2423 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2144 | 2424 | refreshContents(); |
---|
.. | .. |
---|
2148 | 2428 | { |
---|
2149 | 2429 | for (int i=0; i<group.selection.size(); i++) |
---|
2150 | 2430 | { |
---|
2151 | | - boolean random = CameraPane.RANDOM; |
---|
2152 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2431 | + boolean random = CameraPane.SWITCH; |
---|
| 2432 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2153 | 2433 | group.selection.get(i).linkVerticesThis(null); |
---|
2154 | | - CameraPane.RANDOM = random; |
---|
| 2434 | + CameraPane.SWITCH = random; |
---|
2155 | 2435 | } |
---|
2156 | 2436 | |
---|
2157 | 2437 | refreshContents(); |
---|
2158 | 2438 | } else |
---|
2159 | 2439 | if (source == relinkverticesItem) |
---|
2160 | 2440 | { |
---|
2161 | | - boolean random = CameraPane.RANDOM; |
---|
2162 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2441 | + boolean random = CameraPane.SWITCH; |
---|
| 2442 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2163 | 2443 | group.selection.RelinkToSupport(); |
---|
2164 | | - CameraPane.RANDOM = random; |
---|
| 2444 | + CameraPane.SWITCH = random; |
---|
2165 | 2445 | |
---|
2166 | 2446 | refreshContents(); |
---|
2167 | 2447 | } else |
---|
.. | .. |
---|
2176 | 2456 | } else |
---|
2177 | 2457 | if (source == setMasterItem) |
---|
2178 | 2458 | { |
---|
2179 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2459 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2180 | 2460 | { |
---|
2181 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2461 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2182 | 2462 | |
---|
2183 | 2463 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2184 | 2464 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2191 | 2471 | { |
---|
2192 | 2472 | if (group.selection.size() == 1) |
---|
2193 | 2473 | { |
---|
2194 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2474 | + if (Grafreed.clipboard.size() == 1) |
---|
2195 | 2475 | { |
---|
2196 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2476 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2197 | 2477 | |
---|
2198 | 2478 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2199 | 2479 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2210 | 2490 | { |
---|
2211 | 2491 | RevertMeshes(); |
---|
2212 | 2492 | } else |
---|
2213 | | - if (source == resetMeshItem) |
---|
| 2493 | + if (source == resetAllItem) |
---|
2214 | 2494 | { |
---|
2215 | 2495 | ResetAll(); |
---|
2216 | 2496 | } else |
---|
.. | .. |
---|
2259 | 2539 | RandomNode random = new RandomNode(); |
---|
2260 | 2540 | group(random); |
---|
2261 | 2541 | if (random.size() > 0) |
---|
2262 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2542 | + random.name = random.get(0).name + "Switch"; |
---|
2263 | 2543 | } else |
---|
2264 | 2544 | if (source == physicsItem) |
---|
2265 | 2545 | { |
---|
.. | .. |
---|
2376 | 2656 | { |
---|
2377 | 2657 | CastShadow(2); |
---|
2378 | 2658 | } else |
---|
2379 | | - if (source == ungroupItem) |
---|
| 2659 | + if (source == ungroupItem || source == ungroupButton) |
---|
2380 | 2660 | { |
---|
2381 | 2661 | //ungroup(); |
---|
2382 | 2662 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2398 | 2678 | } else |
---|
2399 | 2679 | if (source == genNormalsMESHItem) |
---|
2400 | 2680 | { |
---|
2401 | | - GenNormals(true); // TODO |
---|
| 2681 | + GenNormalsMESH(); |
---|
2402 | 2682 | } else |
---|
2403 | 2683 | if (source == genNormalsORGANItem) |
---|
2404 | 2684 | { |
---|
.. | .. |
---|
2463 | 2743 | if (source == unmarkleavesItem) |
---|
2464 | 2744 | { |
---|
2465 | 2745 | MarkLeaves(false); |
---|
| 2746 | + } else |
---|
| 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); |
---|
2466 | 2762 | } else |
---|
2467 | 2763 | if (source == flipVItem) |
---|
2468 | 2764 | { |
---|
.. | .. |
---|
2548 | 2844 | { |
---|
2549 | 2845 | SmoothMesh(); |
---|
2550 | 2846 | } else |
---|
2551 | | - if (source == transformgeometryItem) |
---|
| 2847 | + if (source == transformGeometryItem) |
---|
2552 | 2848 | { |
---|
2553 | 2849 | TransformGeometry(); |
---|
| 2850 | + } else |
---|
| 2851 | + if (source == transformChildrenItem) |
---|
| 2852 | + { |
---|
| 2853 | + TransformChildren(); |
---|
2554 | 2854 | } else |
---|
2555 | 2855 | if (source == resetTransformItem) |
---|
2556 | 2856 | { |
---|
.. | .. |
---|
2558 | 2858 | } else |
---|
2559 | 2859 | if (source == resetCentroidItem) |
---|
2560 | 2860 | { |
---|
2561 | | - ResetCentroid(); |
---|
| 2861 | + ResetCentroid(true); |
---|
| 2862 | + } else |
---|
| 2863 | + if (source == resetCentroidXZItem) |
---|
| 2864 | + { |
---|
| 2865 | + ResetCentroid(false); |
---|
2562 | 2866 | } else |
---|
2563 | 2867 | if (source == resetParentItem) |
---|
2564 | 2868 | { |
---|
.. | .. |
---|
2690 | 2994 | if (source == twoButton) |
---|
2691 | 2995 | { |
---|
2692 | 2996 | radio.layout = twoButton; |
---|
| 2997 | + |
---|
| 2998 | + if (CameraPane.FULLSCREEN) |
---|
| 2999 | + fullscreenLayout = radio.layout; |
---|
| 3000 | + |
---|
2693 | 3001 | // bug |
---|
2694 | 3002 | //gridPanel.setDividerLocation(1.0); |
---|
2695 | 3003 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2722 | 3030 | bigThree.ClearUI(); |
---|
2723 | 3031 | bigThree.add(centralPanel); |
---|
2724 | 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 | + |
---|
2725 | 3051 | } else |
---|
2726 | 3052 | if (source == threeButton) |
---|
2727 | 3053 | { |
---|
2728 | 3054 | radio.layout = threeButton; |
---|
| 3055 | + |
---|
| 3056 | + if (CameraPane.FULLSCREEN) |
---|
| 3057 | + fullscreenLayout = radio.layout; |
---|
2729 | 3058 | |
---|
2730 | 3059 | // bigThree.remove(scenePanel); |
---|
2731 | 3060 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2758 | 3087 | bigThree.add(centralPanel); |
---|
2759 | 3088 | bigThree.add(XYZPanel); |
---|
2760 | 3089 | bigThree.FlushUI(); |
---|
| 3090 | + |
---|
| 3091 | + cameraView.requestFocusInWindow(); |
---|
2761 | 3092 | } else |
---|
2762 | 3093 | if (source == fourButton) |
---|
2763 | 3094 | { |
---|
2764 | 3095 | radio.layout = fourButton; |
---|
| 3096 | + |
---|
| 3097 | + if (CameraPane.FULLSCREEN) |
---|
| 3098 | + fullscreenLayout = radio.layout; |
---|
2765 | 3099 | |
---|
2766 | 3100 | // bigThree.remove(scenePanel); |
---|
2767 | 3101 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2793 | 3127 | bigThree.ClearUI(); |
---|
2794 | 3128 | bigThree.add(scenePanel); |
---|
2795 | 3129 | bigThree.FlushUI(); |
---|
| 3130 | + |
---|
| 3131 | + cameraView.requestFocusInWindow(); |
---|
2796 | 3132 | } else |
---|
2797 | 3133 | if (source == sixButton) |
---|
2798 | 3134 | { |
---|
2799 | 3135 | radio.layout = sixButton; |
---|
| 3136 | + |
---|
| 3137 | + if (CameraPane.FULLSCREEN) |
---|
| 3138 | + fullscreenLayout = radio.layout; |
---|
2800 | 3139 | |
---|
2801 | 3140 | // bigThree.remove(scenePanel); |
---|
2802 | 3141 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2829 | 3168 | bigThree.add(scenePanel); |
---|
2830 | 3169 | bigThree.add(centralPanel); |
---|
2831 | 3170 | bigThree.FlushUI(); |
---|
| 3171 | + |
---|
| 3172 | + cameraView.requestFocusInWindow(); |
---|
2832 | 3173 | } else |
---|
2833 | 3174 | if (source == sevenButton) |
---|
2834 | 3175 | { |
---|
2835 | 3176 | radio.layout = sevenButton; |
---|
| 3177 | + |
---|
| 3178 | + if (CameraPane.FULLSCREEN) |
---|
| 3179 | + fullscreenLayout = radio.layout; |
---|
2836 | 3180 | |
---|
2837 | 3181 | // bigThree.remove(scenePanel); |
---|
2838 | 3182 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2866 | 3210 | bigThree.add(centralPanel); |
---|
2867 | 3211 | bigThree.add(XYZPanel); |
---|
2868 | 3212 | bigThree.FlushUI(); |
---|
| 3213 | + |
---|
| 3214 | + cameraView.requestFocusInWindow(); |
---|
2869 | 3215 | } else |
---|
2870 | 3216 | if (source == rootButton) |
---|
2871 | 3217 | { |
---|
.. | .. |
---|
2877 | 3223 | EditObject(obj); |
---|
2878 | 3224 | } |
---|
2879 | 3225 | |
---|
| 3226 | + cameraView.requestFocusInWindow(); |
---|
2880 | 3227 | refreshContents(true); |
---|
2881 | 3228 | } else |
---|
2882 | 3229 | if (source == closeButton) |
---|
.. | .. |
---|
2886 | 3233 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2887 | 3234 | { |
---|
2888 | 3235 | ab = (cRadio)e.nextElement(); |
---|
2889 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3236 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2890 | 3237 | { |
---|
| 3238 | + // Patch to avoid bug with transparency. |
---|
| 3239 | + if (!ab.hadMaterial) |
---|
| 3240 | + { |
---|
| 3241 | + ab.object.material = null; |
---|
| 3242 | + } |
---|
| 3243 | + |
---|
2891 | 3244 | buttonGroup.remove(ab); |
---|
2892 | 3245 | radioPanel.remove(ab); |
---|
2893 | 3246 | |
---|
2894 | | - ab.GetObject().editWindow = null; |
---|
| 3247 | + //ab.GetObject().editWindow = null; |
---|
| 3248 | + ab.GetObject().manipWindow = null; |
---|
2895 | 3249 | // ab.GetObject().objectUI = null; // ????????? |
---|
2896 | 3250 | |
---|
2897 | 3251 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2898 | 3252 | break; |
---|
2899 | 3253 | } |
---|
2900 | 3254 | } |
---|
| 3255 | + |
---|
| 3256 | + cameraView.requestFocusInWindow(); |
---|
2901 | 3257 | refreshContents(true); |
---|
2902 | 3258 | } else |
---|
2903 | 3259 | if (source == editItem || source == editButton) |
---|
.. | .. |
---|
2914 | 3270 | child.CloseUI(); |
---|
2915 | 3271 | listUI.remove(child); |
---|
2916 | 3272 | |
---|
2917 | | - child.editWindow = null; // ??????????? |
---|
| 3273 | + //child.editWindow = null; // ??????????? |
---|
2918 | 3274 | } |
---|
2919 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3275 | + objEditor.ctrlPanel.FlushUI(); |
---|
2920 | 3276 | //objEditor.jTree.clearSelection(); |
---|
2921 | 3277 | //objEditor.ResetSliders(); |
---|
2922 | 3278 | refreshContents(true); |
---|
.. | .. |
---|
3000 | 3356 | frontView.object = group; |
---|
3001 | 3357 | sideView.object = group; |
---|
3002 | 3358 | } |
---|
3003 | | - group.editWindow = this; |
---|
| 3359 | + |
---|
| 3360 | +// fix "+" issue |
---|
| 3361 | + //group.editWindow = this; |
---|
| 3362 | + group.manipWindow = this; |
---|
| 3363 | + |
---|
3004 | 3364 | /* |
---|
3005 | 3365 | currentLayout = radio.layout; |
---|
3006 | 3366 | if (currentLayout == null) |
---|
.. | .. |
---|
3012 | 3372 | //group.parent = null; // ROOT |
---|
3013 | 3373 | //group.attributes = -1; |
---|
3014 | 3374 | ResetModel(); |
---|
| 3375 | + |
---|
| 3376 | + cameraView.requestFocusInWindow(); |
---|
3015 | 3377 | refreshContents(true); |
---|
3016 | | - } |
---|
| 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 | + } |
---|
3017 | 3392 | else |
---|
3018 | 3393 | { |
---|
3019 | 3394 | //return super.action(event, arg); |
---|
.. | .. |
---|
3022 | 3397 | } |
---|
3023 | 3398 | |
---|
3024 | 3399 | boolean useclient = false; |
---|
3025 | | - cRadio radio; |
---|
3026 | 3400 | |
---|
3027 | 3401 | void ToggleRoot() |
---|
3028 | 3402 | { |
---|
.. | .. |
---|
3074 | 3448 | refreshContents(); |
---|
3075 | 3449 | } |
---|
3076 | 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 | + } |
---|
3077 | 3473 | |
---|
3078 | 3474 | void ResetTransform() |
---|
3079 | 3475 | { |
---|
.. | .. |
---|
3186 | 3582 | refreshContents(); |
---|
3187 | 3583 | } |
---|
3188 | 3584 | |
---|
3189 | | - void ResetCentroid() |
---|
| 3585 | + void ResetCentroid(boolean full) |
---|
3190 | 3586 | { |
---|
3191 | 3587 | Object3D obj; |
---|
3192 | 3588 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3201 | 3597 | LA.matIdentity(Object3D.mat); |
---|
3202 | 3598 | obj.getBounds(minima, maxima, false); |
---|
3203 | 3599 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3204 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3600 | + if (full) |
---|
| 3601 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3205 | 3602 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3206 | 3603 | obj.TransformMesh(Object3D.mat); |
---|
| 3604 | + |
---|
3207 | 3605 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3208 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3606 | + if (full) |
---|
| 3607 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3209 | 3608 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3609 | + |
---|
3210 | 3610 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3211 | 3611 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3212 | 3612 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3235 | 3635 | |
---|
3236 | 3636 | int size = obj.MemorySize(); |
---|
3237 | 3637 | |
---|
3238 | | - 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)"); |
---|
3239 | 3640 | } |
---|
3240 | 3641 | } |
---|
3241 | 3642 | catch (Exception e) |
---|
.. | .. |
---|
3272 | 3673 | obj = (Object3D)e.nextElement(); |
---|
3273 | 3674 | |
---|
3274 | 3675 | System.out.println("Object is: " + obj); |
---|
3275 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3676 | + Grafreed.AnalyzeObject(obj); |
---|
3276 | 3677 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3277 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3678 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3278 | 3679 | |
---|
3279 | 3680 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3280 | 3681 | } |
---|
.. | .. |
---|
3316 | 3717 | void GenNormals(boolean crease) |
---|
3317 | 3718 | { |
---|
3318 | 3719 | group.GenNormalsS(crease); |
---|
| 3720 | + |
---|
| 3721 | + refreshContents(); |
---|
| 3722 | + } |
---|
| 3723 | + |
---|
| 3724 | + void GenNormalsMESH() |
---|
| 3725 | + { |
---|
| 3726 | + group.GenNormalsMeshS(); |
---|
3319 | 3727 | |
---|
3320 | 3728 | refreshContents(); |
---|
3321 | 3729 | } |
---|
.. | .. |
---|
3488 | 3896 | |
---|
3489 | 3897 | void ParseVertices() |
---|
3490 | 3898 | { |
---|
3491 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3492 | | - GrafreeD.epsequal = true; |
---|
| 3899 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3900 | + Grafreed.epsequal = true; |
---|
3493 | 3901 | |
---|
3494 | 3902 | for (int i=0; i<group.selection.size(); i++) |
---|
3495 | 3903 | { |
---|
.. | .. |
---|
3514 | 3922 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3515 | 3923 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3516 | 3924 | |
---|
3517 | | - g.add(GrafreeD.clipboard); |
---|
| 3925 | + g.add(Grafreed.clipboard); |
---|
3518 | 3926 | |
---|
3519 | 3927 | buffer.add(g); |
---|
3520 | 3928 | } |
---|
.. | .. |
---|
3529 | 3937 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3530 | 3938 | } |
---|
3531 | 3939 | |
---|
3532 | | - GrafreeD.epsequal = epsequal; |
---|
| 3940 | + Grafreed.epsequal = epsequal; |
---|
3533 | 3941 | |
---|
3534 | 3942 | refreshContents(); |
---|
3535 | 3943 | } |
---|
.. | .. |
---|
3547 | 3955 | String pigment = Object3D.GetPigment(tex); |
---|
3548 | 3956 | //String bump = Object3D.GetBump(tex); |
---|
3549 | 3957 | |
---|
3550 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.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 | + } |
---|
3551 | 3968 | |
---|
3552 | 3969 | double s = v.s; |
---|
3553 | 3970 | |
---|
.. | .. |
---|
3635 | 4052 | |
---|
3636 | 4053 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3637 | 4054 | |
---|
3638 | | - boolean random = CameraPane.RANDOM; |
---|
3639 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4055 | + boolean random = CameraPane.SWITCH; |
---|
| 4056 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3640 | 4057 | lowres.linkVerticesThis(null); |
---|
3641 | 4058 | lowres.linkVerticesThis(sn); |
---|
3642 | | - CameraPane.RANDOM = random; |
---|
| 4059 | + CameraPane.SWITCH = random; |
---|
3643 | 4060 | |
---|
3644 | 4061 | System.err.flush(); |
---|
3645 | 4062 | |
---|
.. | .. |
---|
3679 | 4096 | return; |
---|
3680 | 4097 | |
---|
3681 | 4098 | Object3D poses = group.selection.get(0); |
---|
3682 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4099 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3683 | 4100 | |
---|
3684 | 4101 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3685 | 4102 | |
---|
.. | .. |
---|
3873 | 4290 | |
---|
3874 | 4291 | void ClipMesh() |
---|
3875 | 4292 | { |
---|
3876 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4293 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3877 | 4294 | { |
---|
3878 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4295 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3879 | 4296 | |
---|
3880 | 4297 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3881 | 4298 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3884 | 4301 | // { |
---|
3885 | 4302 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3886 | 4303 | // } |
---|
3887 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4304 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3888 | 4305 | } |
---|
3889 | 4306 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3890 | 4307 | System.out.println("DONE."); |
---|
.. | .. |
---|
3931 | 4348 | void MarkLeaves(boolean hide) |
---|
3932 | 4349 | { |
---|
3933 | 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); |
---|
3934 | 4363 | refreshContents(); |
---|
3935 | 4364 | } |
---|
3936 | 4365 | |
---|
.. | .. |
---|
4016 | 4445 | { |
---|
4017 | 4446 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4018 | 4447 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4019 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4448 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4020 | 4449 | |
---|
4021 | 4450 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4022 | | - if(elem != group) |
---|
| 4451 | + if(elem != group || !newWindow) |
---|
4023 | 4452 | { |
---|
4024 | 4453 | // if (!(elem instanceof Composite)) |
---|
4025 | 4454 | // newWindow = false; |
---|
.. | .. |
---|
4109 | 4538 | //case 702: // Event.LIST_DESELECT |
---|
4110 | 4539 | group.deselectAll(); |
---|
4111 | 4540 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4112 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4113 | 4541 | if (tps != null) |
---|
4114 | 4542 | { |
---|
4115 | 4543 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4118 | 4546 | |
---|
4119 | 4547 | //if (child.parent != null) |
---|
4120 | 4548 | //child.parent.addSelectee(child); |
---|
| 4549 | + objEditor.SetMaterial(child); |
---|
4121 | 4550 | group.addSelectee(child); |
---|
4122 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4123 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4124 | | - System.err.println("info : " + child.GetPath()); |
---|
4125 | 4551 | } |
---|
4126 | 4552 | } |
---|
4127 | | - else |
---|
4128 | | - { |
---|
4129 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4130 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4131 | | - System.err.println("info : " + group.GetPath()); |
---|
4132 | | - } |
---|
| 4553 | +// else |
---|
| 4554 | +// { |
---|
| 4555 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4556 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4557 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4558 | +// } |
---|
4133 | 4559 | |
---|
4134 | | - objEditor.SetText(); // jan 2014 |
---|
4135 | | - |
---|
4136 | | - if (flashIt && !Globals.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)) |
---|
4137 | 4561 | CameraPane.flash = true; |
---|
4138 | 4562 | |
---|
4139 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4563 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4140 | 4564 | // a camera |
---|
4141 | 4565 | { |
---|
4142 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4143 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 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 | + } |
---|
4144 | 4571 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4145 | 4572 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4146 | 4573 | } |
---|
.. | .. |
---|
4153 | 4580 | |
---|
4154 | 4581 | freezemodel = false; |
---|
4155 | 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 | + } |
---|
4156 | 4603 | |
---|
4157 | 4604 | void linkSomething(Object3D thing) |
---|
4158 | 4605 | { |
---|
.. | .. |
---|
4224 | 4671 | { |
---|
4225 | 4672 | if (group.selection.isEmpty()) |
---|
4226 | 4673 | return; |
---|
4227 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4674 | + |
---|
| 4675 | + Grafreed.clipboardIsTempGroup = false; |
---|
4228 | 4676 | Composite tGroup = null; |
---|
4229 | 4677 | if (group.selection.size() > 0) // 1) |
---|
4230 | 4678 | { |
---|
4231 | 4679 | tGroup = new cGroup(); |
---|
4232 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4680 | + Grafreed.clipboardIsTempGroup = true; |
---|
4233 | 4681 | } |
---|
4234 | 4682 | |
---|
4235 | 4683 | if (cut) |
---|
4236 | 4684 | { |
---|
| 4685 | + if (Globals.SAVEONMAKE) |
---|
| 4686 | + Save(); |
---|
4237 | 4687 | //int indices[] = jList.getSelectedIndices(); |
---|
4238 | 4688 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4239 | 4689 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4269 | 4719 | //System.out.println("cut " + child); |
---|
4270 | 4720 | //System.out.println("parent = " + child.parent); |
---|
4271 | 4721 | // tmp.addChild(child); |
---|
4272 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4722 | + if (Grafreed.clipboardIsTempGroup) |
---|
4273 | 4723 | tGroup.add/*Child*/(tmp); |
---|
4274 | 4724 | else |
---|
4275 | | - GrafreeD.clipboard = tmp; |
---|
| 4725 | + Grafreed.clipboard = tmp; |
---|
4276 | 4726 | } |
---|
4277 | 4727 | else |
---|
4278 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4728 | + if (Grafreed.clipboardIsTempGroup) |
---|
4279 | 4729 | tGroup.add/*Child*/(child); |
---|
4280 | 4730 | else |
---|
4281 | | - GrafreeD.clipboard = child; |
---|
| 4731 | + Grafreed.clipboard = child; |
---|
4282 | 4732 | } |
---|
4283 | 4733 | |
---|
4284 | 4734 | //ResetModel(); |
---|
.. | .. |
---|
4310 | 4760 | //System.out.println("cut " + elem); |
---|
4311 | 4761 | //System.out.println("parent = " + elem.parent); |
---|
4312 | 4762 | // tmp.addChild(elem); |
---|
4313 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4763 | + if (Grafreed.clipboardIsTempGroup) |
---|
4314 | 4764 | tGroup.add/*Child*/(tmp); |
---|
4315 | 4765 | else |
---|
4316 | | - GrafreeD.clipboard = tmp; |
---|
| 4766 | + Grafreed.clipboard = tmp; |
---|
4317 | 4767 | } |
---|
4318 | 4768 | else |
---|
4319 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4769 | + if (Grafreed.clipboardIsTempGroup) |
---|
4320 | 4770 | tGroup.add/*Child*/(child); |
---|
4321 | 4771 | else |
---|
4322 | | - GrafreeD.clipboard = child; |
---|
| 4772 | + Grafreed.clipboard = child; |
---|
4323 | 4773 | } |
---|
4324 | 4774 | |
---|
4325 | 4775 | } |
---|
4326 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4327 | | - GrafreeD.clipboard = tGroup; |
---|
| 4776 | + |
---|
| 4777 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4778 | + Grafreed.clipboard = tGroup; |
---|
| 4779 | + |
---|
4328 | 4780 | if (cut) |
---|
4329 | 4781 | { |
---|
4330 | 4782 | ResetModel(); |
---|
.. | .. |
---|
4338 | 4790 | // return; |
---|
4339 | 4791 | boolean first = true; |
---|
4340 | 4792 | |
---|
4341 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4793 | + if (Grafreed.clipboardIsTempGroup) |
---|
4342 | 4794 | { |
---|
4343 | 4795 | Composite temp; |
---|
4344 | 4796 | |
---|
.. | .. |
---|
4349 | 4801 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4350 | 4802 | */ |
---|
4351 | 4803 | Object3D elem; |
---|
4352 | | - 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)) |
---|
4353 | 4805 | { |
---|
4354 | 4806 | Object3D child = (Object3D)e.nextElement(); |
---|
4355 | 4807 | |
---|
.. | .. |
---|
4383 | 4835 | //Object3D cb = Applet3D.clipboard; |
---|
4384 | 4836 | //temp.addChild(cb); |
---|
4385 | 4837 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4386 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4387 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4388 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4389 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4390 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 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()); |
---|
4391 | 4843 | else |
---|
4392 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4393 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 4844 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4845 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4394 | 4846 | } |
---|
4395 | 4847 | |
---|
4396 | 4848 | ResetModel(); |
---|
4397 | 4849 | refreshContents(); |
---|
4398 | 4850 | } |
---|
4399 | 4851 | |
---|
4400 | | - void pasteInto(boolean copyit) |
---|
| 4852 | + void pasteInto(boolean copyit, boolean clone) |
---|
4401 | 4853 | { |
---|
4402 | 4854 | // if (GrafreeD.clipboard == null) |
---|
4403 | 4855 | // return; |
---|
.. | .. |
---|
4426 | 4878 | if (copyit) |
---|
4427 | 4879 | { |
---|
4428 | 4880 | // paste(false); |
---|
4429 | | - CloneClipboard(false); // sept 2014 |
---|
| 4881 | + if (clone) |
---|
| 4882 | + { |
---|
| 4883 | + CloneClipboard(false); // sept 2014 |
---|
| 4884 | + } |
---|
| 4885 | + else |
---|
| 4886 | + { |
---|
| 4887 | + paste(false); |
---|
| 4888 | + } |
---|
4430 | 4889 | } |
---|
4431 | 4890 | else |
---|
4432 | 4891 | { |
---|
4433 | 4892 | boolean first = true; |
---|
4434 | 4893 | |
---|
4435 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4894 | + if (Grafreed.clipboardIsTempGroup) |
---|
4436 | 4895 | { |
---|
4437 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 4896 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4438 | 4897 | Object3D copy; |
---|
4439 | 4898 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4440 | 4899 | { |
---|
.. | .. |
---|
4444 | 4903 | } |
---|
4445 | 4904 | } else |
---|
4446 | 4905 | { |
---|
4447 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 4906 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4448 | 4907 | } |
---|
4449 | 4908 | } |
---|
4450 | 4909 | } |
---|
.. | .. |
---|
4849 | 5308 | } |
---|
4850 | 5309 | */ |
---|
4851 | 5310 | |
---|
4852 | | - void ImportGFD() |
---|
4853 | | - { |
---|
4854 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4855 | | - browser.show(); |
---|
4856 | | - String filename = browser.getFile(); |
---|
4857 | | - if (filename != null && filename.length() > 0) |
---|
4858 | | - { |
---|
4859 | | - String fullname = browser.getDirectory() + filename; |
---|
4860 | | - |
---|
4861 | | - //Object3D readobj = |
---|
4862 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4863 | | - //makeSomething(readobj); |
---|
4864 | | - } |
---|
4865 | | - } |
---|
4866 | | - |
---|
4867 | 5311 | /* |
---|
4868 | 5312 | public void Callback(Object obj) |
---|
4869 | 5313 | { |
---|
.. | .. |
---|
4887 | 5331 | } |
---|
4888 | 5332 | */ |
---|
4889 | 5333 | |
---|
4890 | | - void ImportVRMLX3D() |
---|
4891 | | - { |
---|
4892 | | - if (GrafreeD.standAlone) |
---|
4893 | | - { |
---|
4894 | | - /**/ |
---|
4895 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4896 | | - browser.show(); |
---|
4897 | | - String filename = browser.getFile(); |
---|
4898 | | - if (filename != null && filename.length() > 0) |
---|
4899 | | - { |
---|
4900 | | - String fullname = browser.getDirectory() + filename; |
---|
4901 | | - LoadVRMLX3D(fullname); |
---|
4902 | | - } |
---|
4903 | | - /**/ |
---|
4904 | | - } |
---|
4905 | | - } |
---|
4906 | | - |
---|
4907 | 5334 | String GetFile(String dialogName) |
---|
4908 | 5335 | { |
---|
4909 | | - if (GrafreeD.standAlone) |
---|
| 5336 | + if (Grafreed.standAlone) |
---|
4910 | 5337 | { |
---|
4911 | 5338 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4912 | 5339 | browser.show(); |
---|
.. | .. |
---|
4970 | 5397 | cButton flashSelectionButton; |
---|
4971 | 5398 | cButton editButton; |
---|
4972 | 5399 | cButton uneditButton; |
---|
| 5400 | + JCheckBox allParamsButton; |
---|
4973 | 5401 | cButton clearpanelButton; |
---|
4974 | | - cButton allParamsButton; |
---|
4975 | 5402 | cButton unselectButton; |
---|
4976 | 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 | + |
---|
4977 | 5427 | cButton screenfitButton; |
---|
4978 | 5428 | cButton screenfitpointButton; |
---|
4979 | 5429 | cButton snapobjectButton; |
---|
.. | .. |
---|
4984 | 5434 | cButton closeButton; |
---|
4985 | 5435 | |
---|
4986 | 5436 | cButton setsupportButton; |
---|
4987 | | - |
---|
4988 | | - cButton twoButton; |
---|
4989 | | - cButton sixButton; |
---|
4990 | | - cButton threeButton; |
---|
4991 | | - cButton sevenButton; |
---|
4992 | | - cButton fourButton; // full panel |
---|
4993 | | - cButton oneButton; // full XYZ |
---|
4994 | | - //cButton currentLayout; |
---|
4995 | 5437 | |
---|
4996 | 5438 | // |
---|
4997 | 5439 | //Composite |
---|
.. | .. |
---|
5004 | 5446 | private MenuItem lookFromItem; |
---|
5005 | 5447 | private MenuItem switchItem; |
---|
5006 | 5448 | private MenuItem cutItem; |
---|
5007 | | - private MenuItem duplicateItem; |
---|
| 5449 | + private MenuItem undoItem; |
---|
| 5450 | + private MenuItem redoItem; |
---|
| 5451 | + private JMenuItem duplicateItem; |
---|
5008 | 5452 | private MenuItem cloneItem; |
---|
5009 | 5453 | private MenuItem cloneSupportItem; |
---|
5010 | 5454 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5017 | 5461 | private MenuItem linkverticesItem; |
---|
5018 | 5462 | private MenuItem relinkverticesItem; |
---|
5019 | 5463 | private MenuItem setMasterItem; |
---|
5020 | | - private MenuItem resetMeshItem; |
---|
| 5464 | + private MenuItem resetAllItem; |
---|
5021 | 5465 | private MenuItem stepAllItem; |
---|
5022 | 5466 | private MenuItem revertMeshItem; |
---|
5023 | 5467 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5028 | 5472 | private MenuItem mergeGeometriesItem; |
---|
5029 | 5473 | private MenuItem copyItem; |
---|
5030 | 5474 | private MenuItem pasteItem; |
---|
| 5475 | + private MenuItem pasteIntoItem; |
---|
5031 | 5476 | private MenuItem pasteLinkItem; |
---|
5032 | 5477 | private MenuItem pasteCloneItem; |
---|
5033 | 5478 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5066 | 5511 | private MenuItem showleavesItem; |
---|
5067 | 5512 | private MenuItem markleavesItem; |
---|
5068 | 5513 | private MenuItem unmarkleavesItem; |
---|
| 5514 | + private MenuItem rewindleavesItem; |
---|
| 5515 | + private MenuItem unrewindleavesItem; |
---|
| 5516 | + private MenuItem randomleavesItem; |
---|
| 5517 | + private MenuItem unrandomleavesItem; |
---|
5069 | 5518 | |
---|
5070 | 5519 | private MenuItem flipVItem; |
---|
5071 | 5520 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5077 | 5526 | private MenuItem panoTexturesItem; |
---|
5078 | 5527 | |
---|
5079 | 5528 | private MenuItem resetCentroidItem; |
---|
5080 | | - private MenuItem transformgeometryItem; |
---|
| 5529 | + private MenuItem resetCentroidXZItem; |
---|
5081 | 5530 | private MenuItem resetTransformItem; |
---|
| 5531 | + private MenuItem transformGeometryItem; |
---|
| 5532 | + private MenuItem transformChildrenItem; |
---|
5082 | 5533 | private MenuItem hideItem; |
---|
5083 | 5534 | private MenuItem grabItem; |
---|
5084 | 5535 | private MenuItem backItem; |
---|
.. | .. |
---|
5125 | 5576 | private MenuItem blobItem; |
---|
5126 | 5577 | private MenuItem latheItem; |
---|
5127 | 5578 | private MenuItem bezierItem; |
---|
5128 | | - private MenuItem checkerItem; |
---|
| 5579 | + private MenuItem overlayItem; |
---|
5129 | 5580 | private MenuItem meshItem; |
---|
5130 | 5581 | // private MenuItem meshGroupItem; |
---|
5131 | 5582 | private MenuItem springItem; |
---|
.. | .. |
---|
5147 | 5598 | private MenuItem doubleItem; |
---|
5148 | 5599 | private MenuItem tripleItem; |
---|
5149 | 5600 | |
---|
5150 | | - private MenuItem importGFDItem; |
---|
5151 | | - private MenuItem importVRMLX3DItem; |
---|
5152 | | - private MenuItem import3DSItem; |
---|
5153 | | - private MenuItem importOBJItem; |
---|
5154 | | - |
---|
5155 | 5601 | private MenuItem computeAOItem; |
---|
5156 | 5602 | private MenuItem recompileItem; |
---|
5157 | 5603 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5161 | 5607 | private MenuItem analyzeItem; |
---|
5162 | 5608 | private MenuItem dumpItem; |
---|
5163 | 5609 | //boolean freezemodel = false; |
---|
| 5610 | + |
---|
| 5611 | + Menu cameraMenu; |
---|
| 5612 | + MenuItem editCameraItem; |
---|
| 5613 | + MenuItem revertCameraItem; |
---|
5164 | 5614 | } |
---|