.. | .. |
---|
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); |
---|
.. | .. |
---|
83 | 84 | |
---|
84 | 85 | void CloneSelection(boolean supports) |
---|
85 | 86 | { |
---|
86 | | - // Object3D keep = GraphreeD.clipboard; |
---|
| 87 | + // Object3D keep = GrafreeD.clipboard; |
---|
87 | 88 | //Object3D obj; |
---|
88 | 89 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
89 | 90 | { |
---|
.. | .. |
---|
97 | 98 | |
---|
98 | 99 | void CloneClipboard(boolean supports) |
---|
99 | 100 | { |
---|
100 | | - assert(GraphreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent; |
---|
102 | | - GraphreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GraphreeD.clipboard.toParent)) |
---|
104 | | - makeSomething(CloneObject(GraphreeD.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(GraphreeD.clipboard, false)); |
---|
107 | | - GraphreeD.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)GraphreeD.clone(obj); |
---|
| 122 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 123 | obj.parent = parent; |
---|
123 | 124 | // obj.support = support; |
---|
124 | 125 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
147 | 148 | |
---|
148 | 149 | //JTextField nameField; |
---|
149 | 150 | |
---|
150 | | - void SetupMenu2(ObjEditor oe) |
---|
| 151 | + void SetupMenu2(GroupEditor oe) |
---|
151 | 152 | { |
---|
| 153 | + Menu menu; |
---|
| 154 | + oe.menuBar.add(menu = new Menu("Edit")); |
---|
| 155 | + //editItem = menu.add(new MenuItem("Edit")); |
---|
| 156 | + //editItem.addActionListener(this); |
---|
| 157 | + duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 158 | + duplicateItem.addActionListener(this); |
---|
| 159 | + cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 160 | + cloneItem.addActionListener(this); |
---|
| 161 | + if (Globals.ADVANCED) |
---|
| 162 | + { |
---|
| 163 | + cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
| 164 | + cloneSupportItem.addActionListener(this); |
---|
| 165 | + } |
---|
| 166 | + menu.add("-"); |
---|
| 167 | + cutItem = menu.add(new MenuItem("Cut")); |
---|
| 168 | + cutItem.addActionListener(this); |
---|
| 169 | + copyItem = menu.add(new MenuItem("Copy")); |
---|
| 170 | + copyItem.addActionListener(this); |
---|
| 171 | + pasteItem = menu.add(new MenuItem("Paste")); |
---|
| 172 | + pasteItem.addActionListener(this); |
---|
| 173 | + menu.add("-"); |
---|
| 174 | + |
---|
| 175 | + menu.add("-"); |
---|
| 176 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 177 | + pasteIntoItem.addActionListener(this); |
---|
| 178 | + pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 179 | + pasteLinkItem.addActionListener(this); |
---|
| 180 | + pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 181 | + pasteCloneItem.addActionListener(this); |
---|
| 182 | +// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 183 | +// pasteExpandItem.addActionListener(this); |
---|
| 184 | + menu.add("-"); |
---|
| 185 | + clearItem = menu.add(new MenuItem("Clear")); |
---|
| 186 | + clearItem.addActionListener(this); |
---|
| 187 | + |
---|
| 188 | + if (Globals.ADVANCED) |
---|
| 189 | + { |
---|
| 190 | + // Deletes the cameras... |
---|
| 191 | + clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
| 192 | + clearAllItem.addActionListener(this); |
---|
| 193 | + } |
---|
| 194 | + |
---|
| 195 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 196 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 197 | + //zBufferItem.addActionListener(this); |
---|
| 198 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 199 | + //normalLensItem.addActionListener(this); |
---|
| 200 | + cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera")); |
---|
| 201 | + revertCameraItem.addActionListener(this); |
---|
| 202 | + |
---|
| 203 | + cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 204 | + toggleFullScreenItem.addItemListener(this); |
---|
| 205 | + toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 206 | + cameraMenu.add("-"); |
---|
| 207 | + |
---|
| 208 | + cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 209 | + toggleTextureItem.addItemListener(this); |
---|
| 210 | + toggleTextureItem.setState(CameraPane.textureon); |
---|
| 211 | + |
---|
| 212 | + cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 213 | + toggleSwitchItem.addItemListener(this); |
---|
| 214 | + toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 215 | + |
---|
| 216 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 217 | + toggleHandleItem.addItemListener(this); |
---|
| 218 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 219 | + |
---|
| 220 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 221 | + togglePaintItem.addItemListener(this); |
---|
| 222 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 223 | + |
---|
| 224 | + if (Globals.ADVANCED) |
---|
| 225 | + { |
---|
| 226 | + cameraMenu.add("-"); |
---|
| 227 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 228 | + toggleLiveItem.addItemListener(this); |
---|
| 229 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
| 230 | + |
---|
| 231 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 232 | + stepItem.addActionListener(this); |
---|
| 233 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 234 | + // toggleDLItem.addItemListener(this); |
---|
| 235 | + // toggleDLItem.setState(false); |
---|
| 236 | + |
---|
| 237 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 238 | + toggleRenderItem.addItemListener(this); |
---|
| 239 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 240 | + |
---|
| 241 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 242 | + toggleDebugItem.addItemListener(this); |
---|
| 243 | + toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 244 | + |
---|
| 245 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 246 | + toggleFrustumItem.addItemListener(this); |
---|
| 247 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 248 | + |
---|
| 249 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 250 | + toggleFootContactItem.addItemListener(this); |
---|
| 251 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 252 | + |
---|
| 253 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 254 | + toggleTimelineItem.addItemListener(this); |
---|
| 255 | + } |
---|
| 256 | + |
---|
| 257 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 258 | +// toggleRootItem.addItemListener(this); |
---|
| 259 | +// toggleRootItem.setState(false); |
---|
| 260 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 261 | +// animationItem.addItemListener(this); |
---|
| 262 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 263 | + cameraMenu.add("-"); |
---|
| 264 | + cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera")); |
---|
| 265 | + editCameraItem.addActionListener(this); |
---|
| 266 | + |
---|
| 267 | + if (Globals.ADVANCED) |
---|
| 268 | + { |
---|
152 | 269 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | 270 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | 271 | //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
.. | .. |
---|
160 | 277 | lookAtItem.addActionListener(this); |
---|
161 | 278 | //lookFromItem.addActinoListener(this); |
---|
162 | 279 | //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 | | - |
---|
| 280 | + } |
---|
| 281 | + |
---|
192 | 282 | 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); |
---|
| 283 | + if (Globals.ADVANCED) |
---|
| 284 | + { |
---|
197 | 285 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 286 | revertMeshItem.addActionListener(this); |
---|
199 | 287 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 288 | resetreferencesItem.addActionListener(this); |
---|
201 | 289 | menu.add("-"); |
---|
| 290 | + } |
---|
202 | 291 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 292 | overwriteGeoItem.addActionListener(this); |
---|
204 | 293 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 299 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 300 | overwriteUVItem.addActionListener(this); |
---|
212 | 301 | menu.add("-"); |
---|
| 302 | + if (Globals.ADVANCED) |
---|
| 303 | + { |
---|
213 | 304 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 305 | generateMeshItem.addActionListener(this); |
---|
215 | 306 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 307 | poseMeshItem.addActionListener(this); |
---|
217 | 308 | menu.add("-"); |
---|
| 309 | + } |
---|
218 | 310 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 311 | resetsupportItem.addActionListener(this); |
---|
220 | 312 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 313 | linkverticesItem.addActionListener(this); |
---|
| 314 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 315 | + relinkverticesItem.addActionListener(this); |
---|
| 316 | + |
---|
| 317 | + if (Globals.ADVANCED) |
---|
| 318 | + { |
---|
222 | 319 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
223 | 320 | setMasterItem.addActionListener(this); |
---|
| 321 | + } |
---|
224 | 322 | |
---|
225 | 323 | oe.menuBar.add(menu = new Menu("Group")); |
---|
226 | 324 | grabItem = menu.add(new MenuItem("Grab")); |
---|
227 | 325 | grabItem.addActionListener(this); |
---|
228 | | - frontItem = menu.add(new MenuItem("Front")); |
---|
229 | | - frontItem.addActionListener(this); |
---|
230 | 326 | backItem = menu.add(new MenuItem("Back")); |
---|
231 | 327 | backItem.addActionListener(this); |
---|
| 328 | + frontItem = menu.add(new MenuItem("Front")); |
---|
| 329 | + frontItem.addActionListener(this); |
---|
232 | 330 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
233 | 331 | compositeItem.addActionListener(this); |
---|
| 332 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
| 333 | + hideItem.addActionListener(this); |
---|
| 334 | + ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 335 | + ungroupItem.addActionListener(this); |
---|
234 | 336 | menu.add("-"); |
---|
235 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
| 337 | + randomItem = menu.add(new MenuItem("Switch node")); |
---|
236 | 338 | randomItem.addActionListener(this); |
---|
237 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
238 | | - physicsItem.addActionListener(this); |
---|
239 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
240 | | - frameselectorItem.addActionListener(this); |
---|
241 | 339 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
242 | 340 | switchGeoItem.addActionListener(this); |
---|
243 | 341 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
244 | 342 | switchTransfoItem.addActionListener(this); |
---|
245 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 343 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
246 | 344 | morphItem.addActionListener(this); |
---|
| 345 | + |
---|
| 346 | + if (Globals.ADVANCED) |
---|
| 347 | + { |
---|
| 348 | + menu.add("-"); |
---|
| 349 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 350 | + physicsItem.addActionListener(this); |
---|
| 351 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 352 | + frameselectorItem.addActionListener(this); |
---|
247 | 353 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
248 | 354 | scriptNodeItem.addActionListener(this); |
---|
249 | 355 | cameraItem = menu.add(new MenuItem("Camera")); |
---|
250 | 356 | cameraItem.addActionListener(this); |
---|
| 357 | + } |
---|
251 | 358 | |
---|
252 | 359 | oe.menuBar.add(menu = new Menu("Object")); |
---|
253 | 360 | textureItem = menu.add(new MenuItem("Texture")); |
---|
254 | 361 | textureItem.addActionListener(this); |
---|
| 362 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 363 | + billboardItem.addActionListener(this); |
---|
255 | 364 | csgItem = menu.add(new MenuItem("CSG")); |
---|
256 | 365 | csgItem.addActionListener(this); |
---|
257 | 366 | shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
.. | .. |
---|
260 | 369 | shadowYItem.addActionListener(this); |
---|
261 | 370 | shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
262 | 371 | shadowZItem.addActionListener(this); |
---|
| 372 | + if (Globals.ADVANCED) |
---|
| 373 | + { |
---|
| 374 | + menu.add("-"); |
---|
263 | 375 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
264 | 376 | linkerItem.addActionListener(this); |
---|
265 | | - templateItem = menu.add(new MenuItem("Template")); |
---|
266 | | - templateItem.addActionListener(this); |
---|
267 | 377 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
268 | 378 | attributeItem.addActionListener(this); |
---|
| 379 | + templateItem = menu.add(new MenuItem("Template")); |
---|
| 380 | + templateItem.addActionListener(this); |
---|
269 | 381 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
270 | 382 | pointflowItem.addActionListener(this); |
---|
| 383 | + } |
---|
271 | 384 | menu.add("-"); |
---|
272 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
273 | | - transformgeometryItem.addActionListener(this); |
---|
274 | 385 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
275 | 386 | resetTransformItem.addActionListener(this); |
---|
276 | 387 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
277 | 388 | resetCentroidItem.addActionListener(this); |
---|
278 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
279 | | - ungroupItem.addActionListener(this); |
---|
| 389 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 390 | + resetCentroidXZItem.addActionListener(this); |
---|
| 391 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 392 | + transformGeometryItem.addActionListener(this); |
---|
| 393 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 394 | + transformChildrenItem.addActionListener(this); |
---|
280 | 395 | |
---|
281 | 396 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
282 | 397 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
285 | 400 | genNormalsORGANItem.addActionListener(this); |
---|
286 | 401 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
287 | 402 | genNormalsCADItem.addActionListener(this); |
---|
| 403 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 404 | + genNormalsMESHItem.addActionListener(this); |
---|
| 405 | + if (Globals.ADVANCED) |
---|
| 406 | + { |
---|
| 407 | + genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 408 | + genNormalsMINEItem.addActionListener(this); |
---|
| 409 | + } |
---|
288 | 410 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
289 | 411 | stripifyItem.addActionListener(this); |
---|
290 | 412 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
306 | 428 | reduce34MeshItem.addActionListener(this); |
---|
307 | 429 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
308 | 430 | increaseMeshItem.addActionListener(this); |
---|
309 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
310 | | - smoothMeshItem.addActionListener(this); |
---|
311 | 431 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
312 | 432 | clipMeshItem.addActionListener(this); |
---|
| 433 | + |
---|
| 434 | + if (Globals.ADVANCED) |
---|
| 435 | + { |
---|
| 436 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 437 | + smoothMeshItem.addActionListener(this); |
---|
| 438 | + } |
---|
313 | 439 | |
---|
314 | 440 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
315 | 441 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
316 | 442 | clearMaterialsItem.addActionListener(this); |
---|
| 443 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 444 | + resetAllItem.addActionListener(this); |
---|
| 445 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 446 | + stepAllItem.addActionListener(this); |
---|
317 | 447 | menu.add("-"); |
---|
318 | 448 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
319 | 449 | liveleavesItem.addActionListener(this); |
---|
320 | 450 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
321 | 451 | unliveleavesItem.addActionListener(this); |
---|
| 452 | + if (Globals.ADVANCED) |
---|
| 453 | + { |
---|
322 | 454 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
323 | 455 | supportleavesItem.addActionListener(this); |
---|
324 | 456 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
325 | 457 | unsupportleavesItem.addActionListener(this); |
---|
| 458 | + } |
---|
326 | 459 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
327 | 460 | hideleavesItem.addActionListener(this); |
---|
328 | 461 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
366 | 499 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
367 | 500 | sortbynameItem.addActionListener(this); |
---|
368 | 501 | menu.add("-"); |
---|
| 502 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 503 | + shareGeometriesItem.addActionListener(this); |
---|
| 504 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 505 | + mergeGeometriesItem.addActionListener(this); |
---|
| 506 | + if (Globals.ADVANCED) |
---|
| 507 | + { |
---|
| 508 | + // Pretty much the same as duplicate and clone. |
---|
369 | 509 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
370 | 510 | extractGeometriesItem.addActionListener(this); |
---|
371 | 511 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
372 | 512 | cloneGeometriesItem.addActionListener(this); |
---|
373 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
374 | | - shareGeometriesItem.addActionListener(this); |
---|
375 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
376 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 513 | + } |
---|
377 | 514 | |
---|
378 | 515 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
379 | 516 | buildCreateMenu(menu); |
---|
380 | 517 | |
---|
381 | | - |
---|
382 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
383 | | - importGFDItem = menu.add(new MenuItem("GraphreeD Object...")); |
---|
384 | | - importGFDItem.addActionListener(this); |
---|
385 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
386 | | - importVRMLX3DItem.addActionListener(this); |
---|
387 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
388 | | - importOBJItem.addActionListener(this); |
---|
389 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
390 | | - import3DSItem.addActionListener(this); |
---|
391 | | - |
---|
392 | 518 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
393 | 519 | buildToolsMenu(menu); |
---|
394 | 520 | } |
---|
.. | .. |
---|
423 | 549 | oe.radioPanel.add(dummyButton); |
---|
424 | 550 | oe.buttonGroup.add(dummyButton); |
---|
425 | 551 | */ |
---|
426 | | - aConstraints.gridy += 1; |
---|
427 | | - oe.aConstraints.gridwidth = 1; |
---|
428 | | - oe.aConstraints.gridx = 0; |
---|
| 552 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
429 | 553 | |
---|
430 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 554 | + oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 555 | + liveCB.setToolTipText("Enable animation"); |
---|
431 | 556 | liveCB.addItemListener(this); |
---|
432 | 557 | |
---|
433 | | - oe.aConstraints.gridx += 1; |
---|
434 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
435 | | - supportCB.addItemListener(this); |
---|
436 | | - |
---|
437 | | - // oe.aConstraints.gridx += 1; |
---|
438 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
439 | | - // localCB.addItemListener(this); |
---|
440 | | - |
---|
441 | | - oe.aConstraints.gridx += 1; |
---|
442 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
443 | | - crowdCB.addItemListener(this); |
---|
444 | | - |
---|
445 | | - oe.aConstraints.gridx += 1; |
---|
446 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
447 | | - smoothCB.addItemListener(this); |
---|
448 | | - |
---|
449 | | - oe.aConstraints.gridx += 1; |
---|
450 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 558 | + oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 559 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 560 | + oneStepButton.addActionListener(this); |
---|
| 561 | + |
---|
| 562 | + oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 563 | + fastCB.setToolTipText("Fast mode"); |
---|
451 | 564 | fastCB.addItemListener(this); |
---|
452 | | - oe.aConstraints.gridx += 1; |
---|
453 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
454 | | - slowCB.addItemListener(this); |
---|
455 | | - oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
457 | | - boxCB.addItemListener(this); |
---|
458 | | - |
---|
459 | | -// oe.aConstraints.gridx += 1; |
---|
460 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
461 | | -// speakerMocapCB.addItemListener(this); |
---|
462 | | - |
---|
463 | | - if (false) |
---|
464 | | - { |
---|
465 | | - // handled in scripts |
---|
466 | | - oe.aConstraints.gridx += 1; |
---|
467 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
468 | | - speakerCameraCB.addItemListener(this); |
---|
469 | | - |
---|
470 | | - oe.aConstraints.gridx += 1; |
---|
471 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
472 | | - speakerFocusCB.addItemListener(this); |
---|
473 | | - |
---|
474 | | - oe.aConstraints.gridx += 1; |
---|
475 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
476 | | - smoothfocusCB.addItemListener(this); |
---|
477 | | - } |
---|
478 | | - |
---|
479 | | -//oe.aConstraints.gridx += 1; |
---|
480 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
481 | | -// debugCB.addItemListener(this); |
---|
482 | | - |
---|
483 | | - oe.aConstraints.gridx += 1; |
---|
484 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
485 | | - oeilCB.addItemListener(this); |
---|
486 | | - |
---|
487 | | - oe.aConstraints.gridx += 1; |
---|
488 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
489 | | - lookAtCB.addItemListener(this); |
---|
490 | | - |
---|
491 | | - oe.aConstraints.gridx += 1; |
---|
492 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
| 565 | + |
---|
| 566 | + oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 567 | + trackCB.setToolTipText("Enable tracking"); |
---|
493 | 568 | trackCB.addItemListener(this); |
---|
494 | 569 | |
---|
495 | | - oe.aConstraints.gridx += 1; |
---|
496 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 570 | + oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 571 | + screenfitButton.setToolTipText("Screen fit"); |
---|
497 | 572 | screenfitButton.addActionListener(this); |
---|
498 | | - oe.aConstraints.gridx += 1; |
---|
| 573 | + |
---|
499 | 574 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
500 | 575 | // screenfitpointButton.addActionListener(this); |
---|
501 | | -// oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
503 | | - snapobjectButton.addActionListener(this); |
---|
504 | | - oe.aConstraints.gridx += 1; |
---|
505 | 576 | |
---|
506 | | - //aConstraints.gridx = 0; |
---|
507 | | - //aConstraints.gridy += 1; |
---|
508 | | - oe.aConstraints.weighty = 0; |
---|
509 | | - oe.aConstraints.gridwidth = 1; |
---|
510 | | - |
---|
511 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
| 577 | + if (Globals.ADVANCED) |
---|
| 578 | + { |
---|
| 579 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 580 | + snapobjectButton.addActionListener(this); |
---|
| 581 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 582 | + } |
---|
| 583 | + |
---|
| 584 | + oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 585 | + flashSelectionButton.setToolTipText("Show selection"); |
---|
512 | 586 | flashSelectionButton.addActionListener(this); |
---|
513 | | - oe.aConstraints.gridx += 1; |
---|
514 | | - oe.aConstraints.weighty = 0; |
---|
515 | | - oe.aConstraints.gridwidth = 1; |
---|
516 | 587 | |
---|
517 | | - // |
---|
518 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 588 | + oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 589 | + |
---|
| 590 | + oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 591 | + twoButton.setToolTipText("Show center view only"); |
---|
519 | 592 | twoButton.addActionListener(this); |
---|
520 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 593 | + oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | 594 | fourButton.addActionListener(this); |
---|
522 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 595 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 596 | + oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 597 | + sixButton.setToolTipText("2-column layout left"); |
---|
523 | 598 | sixButton.addActionListener(this); |
---|
524 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 599 | + oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 600 | + threeButton.setToolTipText("2-column layout right"); |
---|
525 | 601 | threeButton.addActionListener(this); |
---|
526 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 602 | + oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 603 | + sevenButton.setToolTipText("3-column layout"); |
---|
527 | 604 | sevenButton.addActionListener(this); |
---|
528 | 605 | // |
---|
529 | 606 | |
---|
530 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 607 | + oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 608 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
531 | 609 | rootButton.addActionListener(this); |
---|
532 | | - oe.aConstraints.gridx += 1; |
---|
533 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 610 | + |
---|
| 611 | + oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 612 | + closeButton.setToolTipText("Close tab"); |
---|
534 | 613 | closeButton.addActionListener(this); |
---|
535 | 614 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
536 | 615 | //clearButton.addActionListener(this); |
---|
537 | | - oe.aConstraints.gridx += 1; |
---|
538 | 616 | |
---|
539 | | - oe.aConstraints.gridx = 1; // |
---|
540 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
| 617 | + cGridBag commandsPanel = new cGridBag(); |
---|
| 618 | + |
---|
| 619 | + commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 620 | + editButton.setToolTipText("Edit selection"); |
---|
541 | 621 | editButton.addActionListener(this); |
---|
542 | | - oe.aConstraints.gridx += 1; |
---|
543 | | - oe.aConstraints.weighty = 0; |
---|
544 | | - oe.aConstraints.gridwidth = 1; |
---|
545 | 622 | |
---|
546 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 623 | + commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + uneditButton.setToolTipText("Unedit selection"); |
---|
547 | 625 | uneditButton.addActionListener(this); |
---|
548 | 626 | |
---|
549 | | - oe.aConstraints.gridx += 1; |
---|
550 | | - oe.aConstraints.weighty = 0; |
---|
551 | | - oe.aConstraints.gridwidth = 1; |
---|
552 | | - |
---|
553 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
554 | | - clearPanelButton.addActionListener(this); |
---|
555 | | - |
---|
556 | | - oe.aConstraints.gridx += 1; |
---|
557 | | - oe.aConstraints.weighty = 0; |
---|
558 | | - oe.aConstraints.gridwidth = 1; |
---|
559 | | - |
---|
560 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 627 | + commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 628 | + allParamsButton.setToolTipText("Edit all params"); |
---|
561 | 629 | allParamsButton.addActionListener(this); |
---|
562 | 630 | |
---|
563 | | - oe.aConstraints.gridx += 1; |
---|
564 | | - oe.aConstraints.weighty = 0; |
---|
565 | | - oe.aConstraints.gridwidth = 1; |
---|
566 | | - |
---|
567 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 631 | + commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 632 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 633 | + clearPanelButton.addActionListener(this); |
---|
| 634 | + |
---|
| 635 | + commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 636 | + unselectButton.setToolTipText("Unselect"); |
---|
568 | 637 | unselectButton.addActionListener(this); |
---|
569 | 638 | |
---|
| 639 | + commandsPanel.preferredHeight = 1; |
---|
| 640 | + |
---|
| 641 | + oe.treePanel.add(commandsPanel); |
---|
| 642 | + oe.treePanel.Return(); |
---|
| 643 | + |
---|
570 | 644 | // oe.aConstraints.gridx += 1; |
---|
571 | 645 | // oe.aConstraints.weighty = 0; |
---|
572 | 646 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
578 | 652 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
579 | 653 | // gcButton.addActionListener(this); |
---|
580 | 654 | |
---|
581 | | - oe.aConstraints.gridx = 0; |
---|
582 | | - oe.aConstraints.gridy += 1; |
---|
583 | | - |
---|
584 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
585 | | - oe.aConstraints.gridwidth = 100; |
---|
586 | | - // oe.aConstraints.gridheight = 100; |
---|
587 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
588 | | - oe.aConstraints.gridheight = 1; |
---|
589 | | - oe.aConstraints.weighty = 0.5; |
---|
590 | | - oe.aConstraints.gridx = 0; |
---|
591 | | - JScrollPane jSP; |
---|
| 655 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 656 | + |
---|
| 657 | + JScrollPane jSP; |
---|
592 | 658 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
593 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 659 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
594 | 660 | ResetModel(); |
---|
595 | | - oe.aConstraints.weighty = 0.5; |
---|
596 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
597 | | - oe.aConstraints.gridy += 1; |
---|
598 | | - oe.aConstraints.gridwidth = 1; |
---|
| 661 | + |
---|
| 662 | + oe.treePanel.add(jSPPanel); |
---|
| 663 | + oe.treePanel.Return(); |
---|
599 | 664 | |
---|
600 | | - oe.aConstraints.weighty = 0; |
---|
601 | | - oe.aConstraints.gridwidth = 2; |
---|
602 | | - |
---|
603 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
| 665 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 666 | + |
---|
| 667 | + copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 668 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
604 | 669 | colorCB.addItemListener(this); |
---|
605 | | - oe.aConstraints.gridx += 2; |
---|
606 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
| 670 | + |
---|
| 671 | + copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 672 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
607 | 673 | materialCB.addItemListener(this); |
---|
608 | | - oe.aConstraints.gridx += 2; |
---|
609 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
| 674 | + |
---|
| 675 | + copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 676 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
610 | 677 | textureCB.addItemListener(this); |
---|
611 | 678 | |
---|
612 | | - oe.aConstraints.gridx = 0; |
---|
613 | | - oe.aConstraints.gridy += 1; |
---|
| 679 | + copyOptionsPanel.preferredHeight = 1; |
---|
| 680 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 681 | + oe.treePanel.Return(); |
---|
614 | 682 | |
---|
| 683 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 684 | +// mainPanel.setResizeWeight(0.5); |
---|
| 685 | + |
---|
615 | 686 | //jList.addListSelectionListener(this); |
---|
616 | 687 | oe.jTree.addTreeSelectionListener(this); |
---|
617 | 688 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
633 | 704 | radio.layout = sevenButton; |
---|
634 | 705 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
635 | 706 | } |
---|
| 707 | + |
---|
| 708 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 709 | + { |
---|
| 710 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 711 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 712 | + boxCB.addItemListener(this); |
---|
| 713 | + |
---|
| 714 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 715 | + zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 716 | + zoomBoxCB.addItemListener(this); |
---|
| 717 | + |
---|
| 718 | + if (true) // Globals.ADVANCED) |
---|
| 719 | + { |
---|
| 720 | + panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 721 | + supportCB.setToolTipText("Enable rigging"); |
---|
| 722 | + supportCB.addItemListener(this); |
---|
| 723 | + |
---|
| 724 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 725 | + // localCB.addItemListener(this); |
---|
| 726 | + |
---|
| 727 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 728 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 729 | + crowdCB.addItemListener(this); |
---|
| 730 | + |
---|
| 731 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 732 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 733 | + smoothCB.addItemListener(this); |
---|
| 734 | + |
---|
| 735 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 736 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 737 | + slowCB.addItemListener(this); |
---|
| 738 | + |
---|
| 739 | +// constraints.gridy += 1; |
---|
| 740 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 741 | +// speakerMocapCB.addItemListener(this); |
---|
| 742 | + |
---|
| 743 | + if (false) |
---|
| 744 | + { |
---|
| 745 | + // handled in scripts |
---|
| 746 | + //constraints.gridy += 1; |
---|
| 747 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 748 | + speakerCameraCB.addItemListener(this); |
---|
| 749 | + |
---|
| 750 | + //constraints.gridy += 1; |
---|
| 751 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 752 | + speakerFocusCB.addItemListener(this); |
---|
| 753 | + |
---|
| 754 | + //constraints.gridy += 1; |
---|
| 755 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 756 | + smoothfocusCB.addItemListener(this); |
---|
| 757 | + } |
---|
| 758 | + |
---|
| 759 | +//constraints.gridx += 1; |
---|
| 760 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 761 | +// debugCB.addItemListener(this); |
---|
| 762 | + |
---|
| 763 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 764 | + oeilCB.addItemListener(this); |
---|
| 765 | + |
---|
| 766 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 767 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 768 | + lookAtCB.addItemListener(this); |
---|
| 769 | + |
---|
| 770 | + } |
---|
| 771 | + |
---|
| 772 | + cGridBag fill = new cGridBag(); |
---|
| 773 | + |
---|
| 774 | + fill.preferredHeight = 200; |
---|
| 775 | + |
---|
| 776 | + panel.add(fill); |
---|
| 777 | + |
---|
| 778 | + } |
---|
636 | 779 | |
---|
637 | 780 | void EditObject(Object3D obj) |
---|
638 | 781 | { |
---|
639 | | - cRadio dummyButton = new cRadio(obj.name); |
---|
640 | | - dummyButton.SetObject(obj); |
---|
641 | | - dummyButton.layout = sevenButton; |
---|
642 | | - dummyButton.SetCamera(cameraView.renderCamera, false); |
---|
643 | | - dummyButton.addActionListener(this); |
---|
644 | | - radioPanel.add(dummyButton); |
---|
645 | | - buttonGroup.add(dummyButton); |
---|
646 | | - dummyButton.doClick(); |
---|
| 782 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 783 | + radioButton.SetObject(obj); |
---|
| 784 | + radioButton.layout = sevenButton; |
---|
| 785 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 786 | + radioButton.addActionListener(this); |
---|
| 787 | + radioPanel.add(radioButton); |
---|
| 788 | + buttonGroup.add(radioButton); |
---|
| 789 | + radioButton.doClick(); |
---|
647 | 790 | } |
---|
| 791 | + |
---|
648 | 792 | void SetupViews(ObjEditor oe) |
---|
649 | 793 | { |
---|
650 | 794 | oe.SetupViews(); |
---|
.. | .. |
---|
663 | 807 | JCheckBox fastCB; |
---|
664 | 808 | JCheckBox slowCB; |
---|
665 | 809 | JCheckBox boxCB; |
---|
| 810 | + JCheckBox zoomBoxCB; |
---|
666 | 811 | JCheckBox trackCB; |
---|
667 | 812 | JCheckBox smoothfocusCB; |
---|
668 | 813 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
705 | 850 | dropAttributes |= Object3D.TEXTURE; |
---|
706 | 851 | else |
---|
707 | 852 | dropAttributes &= ~Object3D.TEXTURE; |
---|
708 | | - } |
---|
709 | | - else if(e.getSource() == liveCB) |
---|
| 853 | + } else if(e.getSource() == liveCB) |
---|
710 | 854 | { |
---|
711 | 855 | cameraView.ToggleLive(); |
---|
712 | 856 | } |
---|
.. | .. |
---|
743 | 887 | Recompile(); |
---|
744 | 888 | cameraView.repaint(); |
---|
745 | 889 | // refreshContents(); |
---|
| 890 | + } |
---|
| 891 | + else if(e.getSource() == zoomBoxCB) |
---|
| 892 | + { |
---|
| 893 | + cameraView.ToggleZoomBoxMode(); |
---|
746 | 894 | } |
---|
747 | 895 | else if(e.getSource() == smoothfocusCB) |
---|
748 | 896 | { |
---|
.. | .. |
---|
857 | 1005 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
858 | 1006 | // return; |
---|
859 | 1007 | // } |
---|
860 | | - if (string.charAt(0) == '/') |
---|
| 1008 | + |
---|
| 1009 | + // File path for Mac and Windows |
---|
| 1010 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
861 | 1011 | { |
---|
862 | 1012 | // file(s) |
---|
863 | 1013 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
884 | 1034 | |
---|
885 | 1035 | flashIt = false; |
---|
886 | 1036 | CameraPane pane = (CameraPane) target; |
---|
887 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1037 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
888 | 1038 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
889 | 1039 | |
---|
890 | 1040 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
911 | 1061 | { |
---|
912 | 1062 | loadClipboard(true); |
---|
913 | 1063 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
914 | | - pasteInto(false); |
---|
| 1064 | + pasteInto(false, false); |
---|
915 | 1065 | } else { |
---|
916 | 1066 | loadClipboard(false); |
---|
917 | 1067 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
918 | | - pasteInto(false); // true); // ??? |
---|
| 1068 | + pasteInto(false, false); // true); // ??? |
---|
919 | 1069 | } |
---|
920 | 1070 | } |
---|
921 | 1071 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
.. | .. |
---|
1033 | 1183 | torusItem.addActionListener(this); |
---|
1034 | 1184 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1035 | 1185 | superItem.addActionListener(this); |
---|
| 1186 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1187 | + kleinItem.addActionListener(this); |
---|
1036 | 1188 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1037 | 1189 | particleItem.addActionListener(this); |
---|
| 1190 | + if (Globals.ADVANCED) |
---|
| 1191 | + { |
---|
1038 | 1192 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1039 | 1193 | ragdollItem.addActionListener(this); |
---|
1040 | 1194 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1041 | 1195 | ragdoll2Item.addActionListener(this); |
---|
| 1196 | + } |
---|
1042 | 1197 | menu.add("-"); |
---|
1043 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1198 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1044 | 1199 | meshItem.addActionListener(this); |
---|
1045 | 1200 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1046 | 1201 | // meshGroupItem.addActionListener(this); |
---|
| 1202 | + if (Globals.ADVANCED) |
---|
| 1203 | + { |
---|
1047 | 1204 | springItem = menu.add(new MenuItem("Spring")); |
---|
1048 | 1205 | springItem.addActionListener(this); |
---|
1049 | 1206 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1050 | 1207 | flagItem.addActionListener(this); |
---|
1051 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1052 | | - bezierItem.addActionListener(this); |
---|
1053 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1054 | | - checkerItem.addActionListener(this); |
---|
1055 | 1208 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1056 | 1209 | blobItem.addActionListener(this); |
---|
1057 | 1210 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1058 | 1211 | latheItem.addActionListener(this); |
---|
| 1212 | + } |
---|
| 1213 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1214 | + bezierItem.addActionListener(this); |
---|
| 1215 | + overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1216 | + overlayItem.addActionListener(this); |
---|
1059 | 1217 | lightItem = menu.add(new MenuItem("Light")); |
---|
1060 | 1218 | lightItem.addActionListener(this); |
---|
1061 | 1219 | menu.add("-"); |
---|
.. | .. |
---|
1065 | 1223 | loopItem.addActionListener(this); |
---|
1066 | 1224 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1067 | 1225 | doubleItem.addActionListener(this); |
---|
| 1226 | + if (Globals.ADVANCED) |
---|
| 1227 | + { |
---|
1068 | 1228 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1069 | 1229 | tripleItem.addActionListener(this); |
---|
| 1230 | + } |
---|
1070 | 1231 | } |
---|
1071 | 1232 | |
---|
1072 | 1233 | void buildToolsMenu(Menu menu) |
---|
1073 | 1234 | { |
---|
1074 | 1235 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1075 | 1236 | animationItem.addItemListener(this); |
---|
1076 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1237 | + animationItem.setState(Globals.ANIMATION); |
---|
1077 | 1238 | |
---|
1078 | 1239 | menu.add("-"); |
---|
1079 | 1240 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1080 | 1241 | parseverticesItem.addActionListener(this); |
---|
1081 | 1242 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1082 | 1243 | textureFieldItem.addActionListener(this); |
---|
1083 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1244 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1084 | 1245 | alignItem.addActionListener(this); |
---|
1085 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1086 | | - mirrorItem.addActionListener(this); |
---|
1087 | 1246 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1088 | 1247 | reduceMorphItem.addActionListener(this); |
---|
1089 | 1248 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1090 | 1249 | reduce34MorphItem.addActionListener(this); |
---|
1091 | | - |
---|
| 1250 | + menu.add("-"); |
---|
1092 | 1251 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1093 | 1252 | computeAOItem.addActionListener(this); |
---|
1094 | | - menu.add("-"); |
---|
1095 | 1253 | |
---|
| 1254 | + if (Globals.ADVANCED) |
---|
| 1255 | + { |
---|
| 1256 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1257 | + mirrorItem.addActionListener(this); |
---|
| 1258 | + menu.add("-"); |
---|
1096 | 1259 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1097 | 1260 | memoryItem.addActionListener(this); |
---|
1098 | 1261 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
.. | .. |
---|
1106 | 1269 | resetParentItem.addActionListener(this); |
---|
1107 | 1270 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1108 | 1271 | repairParentItem.addActionListener(this); |
---|
| 1272 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1273 | + repairShadowItem.addActionListener(this); |
---|
1109 | 1274 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1110 | 1275 | invariantsItem.addActionListener(this); |
---|
1111 | 1276 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1113 | 1278 | menu.add("-"); |
---|
1114 | 1279 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1115 | 1280 | editScriptItem.addActionListener(this); |
---|
| 1281 | + } |
---|
1116 | 1282 | } |
---|
1117 | 1283 | |
---|
1118 | 1284 | void ScreenFit() |
---|
.. | .. |
---|
1441 | 1607 | |
---|
1442 | 1608 | void Overwrite(int mask) |
---|
1443 | 1609 | { |
---|
1444 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1610 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1445 | 1611 | { |
---|
1446 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1612 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1447 | 1613 | |
---|
1448 | 1614 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1449 | 1615 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1466 | 1632 | // |
---|
1467 | 1633 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1468 | 1634 | { |
---|
| 1635 | + Object source = event.getSource(); |
---|
1469 | 1636 | /* |
---|
1470 | 1637 | if (event.getSource() == nameField) |
---|
1471 | 1638 | { |
---|
.. | .. |
---|
1477 | 1644 | } |
---|
1478 | 1645 | else |
---|
1479 | 1646 | */ |
---|
1480 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1647 | + if (source == lookAtItem || source == lookFromItem) |
---|
1481 | 1648 | { |
---|
1482 | 1649 | ScreenFit(); |
---|
1483 | 1650 | } else |
---|
1484 | | - if (event.getSource() == switchItem) |
---|
| 1651 | + if (source == switchItem) |
---|
1485 | 1652 | { |
---|
1486 | 1653 | cVector v1 = new cVector(); |
---|
1487 | 1654 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1490 | 1657 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1491 | 1658 | objEditor.cameraView.repaint(); |
---|
1492 | 1659 | } else |
---|
1493 | | - if (event.getSource() == rectoidItem) |
---|
| 1660 | + if (source == rectoidItem) |
---|
1494 | 1661 | { |
---|
1495 | 1662 | makeSomething(new Box()); |
---|
1496 | 1663 | } else |
---|
1497 | | - if (event.getSource() == particleItem) |
---|
| 1664 | + if (source == particleItem) |
---|
1498 | 1665 | { |
---|
1499 | 1666 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1500 | 1667 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1515 | 1682 | applyExample(particleGeom, "SMOKE"); |
---|
1516 | 1683 | makeSomething(particleGeom); |
---|
1517 | 1684 | } else |
---|
1518 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1685 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1519 | 1686 | { |
---|
1520 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1687 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1521 | 1688 | |
---|
1522 | 1689 | ragdoll.toParent = LA.newMatrix(); |
---|
1523 | 1690 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1535 | 1702 | } else |
---|
1536 | 1703 | /* |
---|
1537 | 1704 | */ |
---|
1538 | | - if (event.getSource() == heightFieldItem) |
---|
| 1705 | + if (source == heightFieldItem) |
---|
1539 | 1706 | { |
---|
1540 | 1707 | Object3D obj = new Object3D(); |
---|
1541 | 1708 | |
---|
.. | .. |
---|
1573 | 1740 | |
---|
1574 | 1741 | makeSomething(obj); |
---|
1575 | 1742 | } else |
---|
1576 | | - if (event.getSource() == gridItem) |
---|
| 1743 | + if (source == gridItem) |
---|
1577 | 1744 | { |
---|
1578 | 1745 | makeSomething(new Grid()); |
---|
1579 | 1746 | } else |
---|
1580 | | - if (event.getSource() == ellipsoidItem) |
---|
| 1747 | + if (source == ellipsoidItem) |
---|
1581 | 1748 | { |
---|
1582 | 1749 | makeSomething(new Sphere()); |
---|
1583 | 1750 | } else |
---|
1584 | | - if (event.getSource() == coneItem) |
---|
| 1751 | + if (source == coneItem) |
---|
1585 | 1752 | { |
---|
1586 | 1753 | makeSomething(new Cone()); |
---|
1587 | 1754 | } else |
---|
1588 | | - if (event.getSource() == torusItem) |
---|
| 1755 | + if (source == torusItem) |
---|
1589 | 1756 | { |
---|
1590 | 1757 | makeSomething(new Torus()); |
---|
1591 | 1758 | } else |
---|
1592 | | - if (event.getSource() == superItem) |
---|
| 1759 | + if (source == superItem) |
---|
1593 | 1760 | { |
---|
1594 | 1761 | makeSomething(new Superellipsoid()); |
---|
1595 | 1762 | } else |
---|
1596 | | - if (event.getSource() == blobItem) |
---|
| 1763 | + if (source == kleinItem) |
---|
| 1764 | + { |
---|
| 1765 | + makeSomething(new Klein()); |
---|
| 1766 | + } else |
---|
| 1767 | + if (source == blobItem) |
---|
1597 | 1768 | { |
---|
1598 | 1769 | Blob blob = new Blob(); |
---|
1599 | 1770 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1601 | 1772 | //blob.retile(); |
---|
1602 | 1773 | makeSomething(blob); |
---|
1603 | 1774 | } else |
---|
1604 | | - if (event.getSource() == latheItem) |
---|
| 1775 | + if (source == latheItem) |
---|
1605 | 1776 | { |
---|
1606 | 1777 | makeSomething(new Lathe()); |
---|
1607 | 1778 | } else |
---|
1608 | | - if (event.getSource() == bezierItem) |
---|
| 1779 | + if (source == bezierItem) |
---|
1609 | 1780 | { |
---|
1610 | 1781 | makeSomething(new BezierSurface()); |
---|
1611 | 1782 | } else |
---|
1612 | | - if (event.getSource() == checkerItem) |
---|
| 1783 | + if (source == overlayItem) |
---|
1613 | 1784 | { |
---|
1614 | 1785 | /* |
---|
1615 | 1786 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1624 | 1795 | */ |
---|
1625 | 1796 | makeSomething(new Checker()); |
---|
1626 | 1797 | } else |
---|
1627 | | - if (event.getSource() == meshItem) |
---|
| 1798 | + if (source == meshItem) |
---|
1628 | 1799 | { |
---|
1629 | 1800 | Object3D itemtomake = new Object3D(); |
---|
1630 | 1801 | Object3D child; |
---|
.. | .. |
---|
1645 | 1816 | makeSomething(child); |
---|
1646 | 1817 | } |
---|
1647 | 1818 | } else |
---|
1648 | | - if (event.getSource() == springItem) |
---|
| 1819 | + if (source == springItem) |
---|
1649 | 1820 | { |
---|
1650 | 1821 | cSpring s = new cSpring(); |
---|
1651 | 1822 | s.setup(); |
---|
1652 | 1823 | makeSomething(s); |
---|
1653 | 1824 | } else |
---|
1654 | | - if (event.getSource() == flagItem) |
---|
| 1825 | + if (source == flagItem) |
---|
1655 | 1826 | { |
---|
1656 | 1827 | cSpring s = new cFlag(); |
---|
1657 | 1828 | s.setup(); |
---|
1658 | 1829 | makeSomething(s); |
---|
1659 | 1830 | } else |
---|
1660 | | - if (event.getSource() == lightItem) |
---|
| 1831 | + if (source == lightItem) |
---|
1661 | 1832 | { |
---|
1662 | 1833 | makeSomething(new Light()); |
---|
1663 | 1834 | } else |
---|
1664 | | - if (event.getSource() == csgItem) |
---|
| 1835 | + if (source == csgItem) |
---|
1665 | 1836 | { |
---|
1666 | 1837 | group(new CSG()); |
---|
1667 | 1838 | } else |
---|
1668 | | - if (event.getSource() == templateItem) |
---|
| 1839 | + if (source == templateItem) |
---|
1669 | 1840 | { |
---|
1670 | 1841 | group(new cTemplate()); |
---|
1671 | 1842 | } else |
---|
1672 | | - if (event.getSource() == attributeItem) |
---|
| 1843 | + if (source == attributeItem) |
---|
1673 | 1844 | { |
---|
1674 | 1845 | makeSomething(new Attribute()); |
---|
1675 | 1846 | } else |
---|
1676 | | - if (event.getSource() == pointflowItem) |
---|
| 1847 | + if (source == pointflowItem) |
---|
1677 | 1848 | { |
---|
1678 | 1849 | makeSomething(new PointFlow()); |
---|
1679 | 1850 | } else |
---|
.. | .. |
---|
1685 | 1856 | } else |
---|
1686 | 1857 | */ |
---|
1687 | 1858 | |
---|
1688 | | - if (event.getSource() == superLoopItem) |
---|
| 1859 | + if (source == superLoopItem) |
---|
1689 | 1860 | { |
---|
1690 | 1861 | Composite g = new cGroup(); |
---|
1691 | 1862 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1707 | 1878 | |
---|
1708 | 1879 | group(g); |
---|
1709 | 1880 | } else |
---|
1710 | | - if (event.getSource() == loopItem) |
---|
| 1881 | + if (source == loopItem) |
---|
1711 | 1882 | { |
---|
1712 | 1883 | Composite csg = new GroupLeaf(); |
---|
1713 | 1884 | csg.count = 5; |
---|
.. | .. |
---|
1716 | 1887 | csg.addChild(child); |
---|
1717 | 1888 | child.addChild(csg); |
---|
1718 | 1889 | } else |
---|
1719 | | - if (event.getSource() == doubleItem) |
---|
| 1890 | + if (source == doubleItem) |
---|
1720 | 1891 | { |
---|
1721 | 1892 | Composite csg = new GroupLeaf(); |
---|
1722 | 1893 | csg.count = 5; |
---|
.. | .. |
---|
1728 | 1899 | csg.addChild(child); |
---|
1729 | 1900 | child.addChild(csg); |
---|
1730 | 1901 | } else |
---|
1731 | | - if (event.getSource() == tripleItem) |
---|
| 1902 | + if (source == tripleItem) |
---|
1732 | 1903 | { |
---|
1733 | 1904 | Composite csg = new GroupLeaf(); |
---|
1734 | 1905 | csg.count = 4; |
---|
.. | .. |
---|
1743 | 1914 | csg.addChild(child); |
---|
1744 | 1915 | child.addChild(csg); |
---|
1745 | 1916 | } else |
---|
1746 | | - |
---|
1747 | | - if (event.getSource() == importGFDItem) |
---|
| 1917 | + if (source == computeAOItem) |
---|
1748 | 1918 | { |
---|
1749 | | - ImportGFD(); |
---|
| 1919 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 1920 | + Globals.theRenderer.repaint(); |
---|
1750 | 1921 | } else |
---|
1751 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1752 | | - { |
---|
1753 | | - ImportVRMLX3D(); |
---|
1754 | | - } else |
---|
1755 | | - if (event.getSource() == import3DSItem) |
---|
1756 | | - { |
---|
1757 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1758 | | - } else |
---|
1759 | | - if (event.getSource() == importOBJItem) |
---|
1760 | | - { |
---|
1761 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1762 | | - } else |
---|
1763 | | - if (event.getSource() == computeAOItem) |
---|
1764 | | - { |
---|
1765 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1766 | | - CameraPane.theRenderer.repaint(); |
---|
1767 | | - } else |
---|
1768 | | - if (event.getSource() == recompileItem) |
---|
| 1922 | + if (source == recompileItem) |
---|
1769 | 1923 | { |
---|
1770 | 1924 | Recompile(); |
---|
1771 | 1925 | refreshContents(); |
---|
1772 | 1926 | } else |
---|
1773 | | - if (event.getSource() == editScriptItem) |
---|
| 1927 | + if (source == editScriptItem) |
---|
1774 | 1928 | { |
---|
1775 | 1929 | OpenDialog(); |
---|
1776 | 1930 | refreshContents(); |
---|
1777 | 1931 | } else |
---|
1778 | | - if (event.getSource() == invariantsItem) |
---|
| 1932 | + if (source == invariantsItem) |
---|
1779 | 1933 | { |
---|
1780 | 1934 | System.out.println("Invariants:"); |
---|
1781 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 1935 | + Grafreed.grafreeD.universe.invariants(); |
---|
1782 | 1936 | } else |
---|
1783 | | - if (event.getSource() == memoryItem) |
---|
| 1937 | + if (source == memoryItem) |
---|
1784 | 1938 | { |
---|
1785 | 1939 | //System.out.println("Invariants:"); |
---|
1786 | 1940 | PrintMemory(); |
---|
1787 | 1941 | } else |
---|
1788 | | - if (event.getSource() == pathItem) |
---|
| 1942 | + if (source == pathItem) |
---|
1789 | 1943 | { |
---|
1790 | 1944 | PrintPath(); |
---|
1791 | 1945 | } else |
---|
1792 | | - if (event.getSource() == analyzeItem) |
---|
| 1946 | + if (source == analyzeItem) |
---|
1793 | 1947 | { |
---|
1794 | 1948 | AnalyzeObject(); |
---|
1795 | 1949 | } else |
---|
1796 | | - if (event.getSource() == dumpItem) |
---|
| 1950 | + if (source == dumpItem) |
---|
1797 | 1951 | { |
---|
1798 | 1952 | DumpObject(); |
---|
1799 | 1953 | } else |
---|
1800 | | - if (event.getSource() == screenfitButton) |
---|
| 1954 | + if (source == oneStepButton) |
---|
| 1955 | + { |
---|
| 1956 | + Globals.ONESTEP = true; |
---|
| 1957 | + cameraView.repaint(); |
---|
| 1958 | + } else |
---|
| 1959 | + if (source == screenfitButton) |
---|
1801 | 1960 | { |
---|
1802 | 1961 | //Reload(lastConverter, lastFilename, true); |
---|
1803 | 1962 | ScreenFit(); |
---|
1804 | 1963 | } else |
---|
1805 | | - if (event.getSource() == screenfitpointButton) |
---|
| 1964 | + if (source == screenfitpointButton) |
---|
1806 | 1965 | { |
---|
1807 | 1966 | //Reload(lastConverter, lastFilename, true); |
---|
1808 | 1967 | ScreenFitPoint(); |
---|
1809 | 1968 | } else |
---|
1810 | | - if (event.getSource() == snapobjectButton) |
---|
| 1969 | + if (source == snapobjectButton) |
---|
1811 | 1970 | { |
---|
1812 | 1971 | //Reload(lastConverter, lastFilename, true); |
---|
1813 | 1972 | SnapObject(); |
---|
.. | .. |
---|
1818 | 1977 | // Recompile(); |
---|
1819 | 1978 | // refreshContents(); |
---|
1820 | 1979 | // } else |
---|
1821 | | - if (event.getSource() == gcButton) |
---|
| 1980 | + if (source == gcButton) |
---|
1822 | 1981 | { |
---|
1823 | 1982 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1824 | 1983 | System.gc(); |
---|
1825 | 1984 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1826 | 1985 | } else |
---|
1827 | | - if (event.getSource() == editLeafItem) |
---|
| 1986 | + if (source == editLeafItem) |
---|
1828 | 1987 | { |
---|
1829 | 1988 | Object3D obj; |
---|
1830 | 1989 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1838 | 1997 | } |
---|
1839 | 1998 | refreshContents(true); |
---|
1840 | 1999 | } else |
---|
1841 | | - if (event.getSource() == openWindowItem) |
---|
| 2000 | + if (source == openWindowItem) |
---|
1842 | 2001 | { |
---|
1843 | 2002 | EditSelection(true); |
---|
1844 | 2003 | } else |
---|
1845 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2004 | + if (source == cutItem || source == clearButton) |
---|
1846 | 2005 | { |
---|
1847 | 2006 | loadClipboard(true); |
---|
1848 | 2007 | } else |
---|
1849 | | - if (event.getSource() == duplicateItem) |
---|
| 2008 | + if (source == duplicateItem) |
---|
1850 | 2009 | { |
---|
1851 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 2010 | + Object3D keep = Grafreed.clipboard; |
---|
1852 | 2011 | loadClipboard(false); |
---|
1853 | 2012 | paste(false); |
---|
1854 | | - GraphreeD.clipboard = keep; |
---|
| 2013 | + Grafreed.clipboard = keep; |
---|
1855 | 2014 | } else |
---|
1856 | | - if (event.getSource() == cloneItem) |
---|
| 2015 | + if (source == cloneItem) |
---|
1857 | 2016 | { |
---|
1858 | 2017 | CloneSelection(false); |
---|
1859 | 2018 | } else |
---|
1860 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2019 | + if (source == cloneSupportItem) |
---|
1861 | 2020 | { |
---|
1862 | 2021 | CloneSelection(true); |
---|
1863 | 2022 | } else |
---|
1864 | | - if (event.getSource() == copyItem) |
---|
| 2023 | + if (source == copyItem) |
---|
1865 | 2024 | { |
---|
1866 | 2025 | loadClipboard(false); |
---|
1867 | 2026 | } else |
---|
1868 | | - if (event.getSource() == pasteItem) |
---|
| 2027 | + if (source == pasteItem) |
---|
1869 | 2028 | { |
---|
1870 | 2029 | paste(false); |
---|
1871 | 2030 | } else |
---|
1872 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2031 | + if (source == pasteIntoItem) |
---|
1873 | 2032 | { |
---|
1874 | | - pasteInto(false); |
---|
| 2033 | + pasteInto(true, false); |
---|
1875 | 2034 | } else |
---|
1876 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2035 | + if (source == pasteLinkItem) |
---|
1877 | 2036 | { |
---|
1878 | | - pasteInto(true); |
---|
| 2037 | + pasteInto(false, false); |
---|
1879 | 2038 | } else |
---|
1880 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2039 | + if (source == pasteCloneItem) |
---|
| 2040 | + { |
---|
| 2041 | + pasteInto(true, true); |
---|
| 2042 | + } else |
---|
| 2043 | + if (source == pasteExpandItem) |
---|
1881 | 2044 | { |
---|
1882 | 2045 | paste(true); |
---|
1883 | 2046 | } else |
---|
1884 | | - if (event.getSource() == synchronizeItem) |
---|
| 2047 | + if (source == synchronizeItem) |
---|
1885 | 2048 | { |
---|
1886 | 2049 | Overwrite(Object3D.TRANSFORM); |
---|
1887 | 2050 | } else |
---|
1888 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2051 | + if (source == overwriteNameItem) |
---|
1889 | 2052 | { |
---|
1890 | 2053 | Overwrite(Object3D.NAME); |
---|
1891 | 2054 | } else |
---|
1892 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2055 | + if (source == overwriteUVItem) |
---|
1893 | 2056 | { |
---|
1894 | 2057 | Overwrite(Object3D.UV); |
---|
1895 | 2058 | } else |
---|
1896 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2059 | + if (source == overwriteMatItem) |
---|
1897 | 2060 | { |
---|
| 2061 | + /* july 2015 |
---|
1898 | 2062 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1899 | | - Overwrite(Object3D.MATERIAL); |
---|
| 2063 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1900 | 2064 | else |
---|
1901 | 2065 | { |
---|
1902 | 2066 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1908 | 2072 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1909 | 2073 | } |
---|
1910 | 2074 | } |
---|
| 2075 | + */ |
---|
| 2076 | + |
---|
| 2077 | + Overwrite(dropAttributes); |
---|
1911 | 2078 | } |
---|
1912 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2079 | + if (source == overwriteGeoItem) |
---|
1913 | 2080 | { |
---|
1914 | 2081 | Overwrite(Object3D.GEOMETRY); |
---|
1915 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2082 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1916 | 2083 | // { |
---|
1917 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2084 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1918 | 2085 | // |
---|
1919 | 2086 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1920 | 2087 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1926 | 2093 | // refreshContents(); |
---|
1927 | 2094 | // } |
---|
1928 | 2095 | } else |
---|
1929 | | - if (event.getSource() == generateMeshItem) |
---|
| 2096 | + if (source == generateMeshItem) |
---|
1930 | 2097 | { |
---|
1931 | 2098 | //if (group.selection.size() == 1) |
---|
1932 | 2099 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1937 | 2104 | ResetModel(); |
---|
1938 | 2105 | refreshContents(); |
---|
1939 | 2106 | } else |
---|
1940 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2107 | + if (source == extractGeometriesItem) |
---|
1941 | 2108 | { |
---|
1942 | 2109 | boolean one = false; |
---|
1943 | 2110 | |
---|
.. | .. |
---|
1964 | 2131 | ResetModel(); |
---|
1965 | 2132 | refreshContents(); |
---|
1966 | 2133 | } else |
---|
1967 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2134 | + if (source == cloneGeometriesItem) |
---|
1968 | 2135 | { |
---|
1969 | 2136 | boolean one = false; |
---|
1970 | 2137 | |
---|
.. | .. |
---|
1990 | 2157 | ResetModel(); |
---|
1991 | 2158 | refreshContents(); |
---|
1992 | 2159 | } else |
---|
1993 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2160 | + if (source == shareGeometriesItem) |
---|
1994 | 2161 | { |
---|
1995 | 2162 | boolean one = false; |
---|
1996 | 2163 | |
---|
1997 | 2164 | if (group.selection.size() == 1) |
---|
1998 | 2165 | one = true; |
---|
1999 | 2166 | |
---|
| 2167 | + Object3D merge = null; |
---|
| 2168 | + |
---|
2000 | 2169 | Object3D content = new cGroup(); |
---|
2001 | 2170 | |
---|
2002 | 2171 | for (int i=0; i<group.selection.size(); i++) |
---|
2003 | 2172 | { |
---|
2004 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2173 | + merge = new Merge(group.selection.get(i)); |
---|
2005 | 2174 | |
---|
2006 | 2175 | if (one) |
---|
2007 | | - makeSomething(sel, false); |
---|
| 2176 | + makeSomething(merge, false); |
---|
2008 | 2177 | else |
---|
2009 | | - content.addChild(sel); |
---|
| 2178 | + content.addChild(merge); |
---|
2010 | 2179 | } |
---|
2011 | 2180 | |
---|
2012 | 2181 | if (!one) |
---|
2013 | | - makeSomething(content, false); |
---|
2014 | | - |
---|
2015 | | - ResetModel(); |
---|
2016 | | - refreshContents(); |
---|
| 2182 | + makeSomething(content, true); |
---|
| 2183 | + else |
---|
| 2184 | + { |
---|
| 2185 | + ResetModel(); |
---|
| 2186 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2187 | + refreshContents(); |
---|
| 2188 | + } |
---|
2017 | 2189 | } else |
---|
2018 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2190 | + if (source == mergeGeometriesItem) |
---|
2019 | 2191 | { |
---|
2020 | 2192 | boolean one = false; |
---|
2021 | 2193 | |
---|
.. | .. |
---|
2045 | 2217 | ResetModel(); |
---|
2046 | 2218 | refreshContents(); |
---|
2047 | 2219 | } else |
---|
2048 | | - if (event.getSource() == linkverticesItem) |
---|
| 2220 | + if (source == linkverticesItem) |
---|
2049 | 2221 | { |
---|
2050 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2222 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2051 | 2223 | // { |
---|
2052 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2224 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2053 | 2225 | // |
---|
2054 | 2226 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2055 | 2227 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2058 | 2230 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2059 | 2231 | // refreshContents(); |
---|
2060 | 2232 | // } |
---|
2061 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2233 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2062 | 2234 | { |
---|
2063 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2235 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2064 | 2236 | |
---|
2065 | 2237 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2066 | 2238 | content = ((cGroup)content).get(0); |
---|
2067 | 2239 | |
---|
2068 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2240 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2069 | 2241 | for (int i=0; i<group.selection.size(); i++) |
---|
2070 | 2242 | { |
---|
2071 | | - boolean random = CameraPane.RANDOM; |
---|
2072 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2243 | + boolean random = CameraPane.SWITCH; |
---|
| 2244 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2073 | 2245 | group.selection.get(i).linkVerticesThis(content); |
---|
2074 | 2246 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2075 | | - CameraPane.RANDOM = random; |
---|
| 2247 | + CameraPane.SWITCH = random; |
---|
2076 | 2248 | } |
---|
2077 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2249 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2078 | 2250 | refreshContents(); |
---|
2079 | 2251 | } |
---|
2080 | 2252 | } else |
---|
2081 | | - if (event.getSource() == resetsupportItem) |
---|
| 2253 | + if (source == resetsupportItem) |
---|
2082 | 2254 | { |
---|
2083 | 2255 | for (int i=0; i<group.selection.size(); i++) |
---|
2084 | 2256 | { |
---|
2085 | | - boolean random = CameraPane.RANDOM; |
---|
2086 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2257 | + boolean random = CameraPane.SWITCH; |
---|
| 2258 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2087 | 2259 | group.selection.get(i).linkVerticesThis(null); |
---|
2088 | | - CameraPane.RANDOM = random; |
---|
| 2260 | + CameraPane.SWITCH = random; |
---|
2089 | 2261 | } |
---|
2090 | 2262 | |
---|
2091 | 2263 | refreshContents(); |
---|
2092 | 2264 | } else |
---|
2093 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2265 | + if (source == relinkverticesItem) |
---|
| 2266 | + { |
---|
| 2267 | + boolean random = CameraPane.SWITCH; |
---|
| 2268 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2269 | + group.selection.RelinkToSupport(); |
---|
| 2270 | + CameraPane.SWITCH = random; |
---|
| 2271 | + |
---|
| 2272 | + refreshContents(); |
---|
| 2273 | + } else |
---|
| 2274 | + if (source == resetreferencesItem) |
---|
2094 | 2275 | { |
---|
2095 | 2276 | for (int i=0; i<group.selection.size(); i++) |
---|
2096 | 2277 | { |
---|
.. | .. |
---|
2099 | 2280 | |
---|
2100 | 2281 | refreshContents(); |
---|
2101 | 2282 | } else |
---|
2102 | | - if (event.getSource() == setMasterItem) |
---|
| 2283 | + if (source == setMasterItem) |
---|
2103 | 2284 | { |
---|
2104 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2285 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2105 | 2286 | { |
---|
2106 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2287 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2107 | 2288 | |
---|
2108 | 2289 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2109 | 2290 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2112 | 2293 | refreshContents(); |
---|
2113 | 2294 | } |
---|
2114 | 2295 | } else |
---|
2115 | | - if (event.getSource() == poseMeshItem) |
---|
| 2296 | + if (source == poseMeshItem) |
---|
2116 | 2297 | { |
---|
2117 | 2298 | if (group.selection.size() == 1) |
---|
2118 | 2299 | { |
---|
2119 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2300 | + if (Grafreed.clipboard.size() == 1) |
---|
2120 | 2301 | { |
---|
2121 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2302 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2122 | 2303 | |
---|
2123 | 2304 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2124 | 2305 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2131 | 2312 | } |
---|
2132 | 2313 | |
---|
2133 | 2314 | } else |
---|
2134 | | - if (event.getSource() == revertMeshItem) |
---|
| 2315 | + if (source == revertMeshItem) |
---|
2135 | 2316 | { |
---|
2136 | 2317 | RevertMeshes(); |
---|
2137 | 2318 | } else |
---|
2138 | | - if (event.getSource() == resetMeshItem) |
---|
| 2319 | + if (source == resetAllItem) |
---|
2139 | 2320 | { |
---|
2140 | 2321 | ResetAll(); |
---|
2141 | 2322 | } else |
---|
2142 | | - if (event.getSource() == stepAllItem) |
---|
| 2323 | + if (source == stepAllItem) |
---|
2143 | 2324 | { |
---|
2144 | 2325 | StepAll(); |
---|
2145 | 2326 | } else |
---|
2146 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2327 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2147 | 2328 | { |
---|
2148 | 2329 | //int indices[] = jList.getSelectedIndices(); |
---|
2149 | 2330 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2151 | 2332 | |
---|
2152 | 2333 | ClearSelection(false); |
---|
2153 | 2334 | } else |
---|
2154 | | - if (event.getSource() == clearAllItem) |
---|
| 2335 | + if (source == clearAllItem) |
---|
2155 | 2336 | { |
---|
2156 | 2337 | ClearSelection(true); |
---|
2157 | 2338 | } else |
---|
2158 | | - if (event.getSource() == grabItem) |
---|
| 2339 | + if (source == grabItem) |
---|
2159 | 2340 | { |
---|
2160 | 2341 | group(new cGroup(), true); |
---|
2161 | 2342 | } else |
---|
2162 | | - if (event.getSource() == frontItem) |
---|
| 2343 | + if (source == hideItem) |
---|
| 2344 | + { |
---|
| 2345 | + group(new HiddenObject()); |
---|
| 2346 | + } else |
---|
| 2347 | + if (source == frontItem) |
---|
2163 | 2348 | { |
---|
2164 | 2349 | front(); |
---|
2165 | 2350 | } else |
---|
2166 | | - if (event.getSource() == backItem) |
---|
| 2351 | + if (source == backItem) |
---|
2167 | 2352 | { |
---|
2168 | 2353 | back(); |
---|
2169 | 2354 | } else |
---|
2170 | | - if (event.getSource() == cameraItem) |
---|
| 2355 | + if (source == cameraItem) |
---|
2171 | 2356 | { |
---|
2172 | 2357 | makeSomething(new Camera()); |
---|
2173 | 2358 | } else |
---|
2174 | | - if (event.getSource() == compositeItem) |
---|
| 2359 | + if (source == compositeItem) |
---|
2175 | 2360 | { |
---|
2176 | 2361 | group(new Composite()); |
---|
2177 | 2362 | } else |
---|
2178 | | - if (event.getSource() == randomItem) |
---|
| 2363 | + if (source == randomItem) |
---|
2179 | 2364 | { |
---|
2180 | 2365 | RandomNode random = new RandomNode(); |
---|
2181 | 2366 | group(random); |
---|
2182 | 2367 | if (random.size() > 0) |
---|
2183 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2368 | + random.name = random.get(0).name + "Switch"; |
---|
2184 | 2369 | } else |
---|
2185 | | - if (event.getSource() == physicsItem) |
---|
| 2370 | + if (source == physicsItem) |
---|
2186 | 2371 | { |
---|
2187 | 2372 | group(new PhysicsNode()); |
---|
2188 | 2373 | } else |
---|
2189 | | - if (event.getSource() == frameselectorItem) |
---|
| 2374 | + if (source == frameselectorItem) |
---|
2190 | 2375 | { |
---|
2191 | 2376 | for (int i=0; i<group.selection.size(); i++) |
---|
2192 | 2377 | { |
---|
.. | .. |
---|
2198 | 2383 | ResetModel(); |
---|
2199 | 2384 | refreshContents(); |
---|
2200 | 2385 | } else |
---|
2201 | | - if (event.getSource() == switchGeoItem) |
---|
| 2386 | + if (source == switchGeoItem) |
---|
2202 | 2387 | { |
---|
2203 | 2388 | for (int i=0; i<group.selection.size(); i++) |
---|
2204 | 2389 | { |
---|
.. | .. |
---|
2210 | 2395 | ResetModel(); |
---|
2211 | 2396 | refreshContents(); |
---|
2212 | 2397 | } else |
---|
2213 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2398 | + if (source == switchTransfoItem) |
---|
2214 | 2399 | { |
---|
2215 | 2400 | for (int i=0; i<group.selection.size(); i++) |
---|
2216 | 2401 | { |
---|
.. | .. |
---|
2222 | 2407 | ResetModel(); |
---|
2223 | 2408 | refreshContents(); |
---|
2224 | 2409 | } else |
---|
2225 | | - if (event.getSource() == morphItem) |
---|
| 2410 | + if (source == morphItem) |
---|
2226 | 2411 | { |
---|
2227 | 2412 | for (int i=0; i<group.selection.size(); i++) |
---|
2228 | 2413 | { |
---|
.. | .. |
---|
2234 | 2419 | ResetModel(); |
---|
2235 | 2420 | refreshContents(); |
---|
2236 | 2421 | } else |
---|
2237 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2422 | + if (source == scriptNodeItem) |
---|
2238 | 2423 | { |
---|
2239 | 2424 | boolean atleastone = false; |
---|
2240 | 2425 | |
---|
.. | .. |
---|
2273 | 2458 | } |
---|
2274 | 2459 | } |
---|
2275 | 2460 | } else |
---|
2276 | | - if (event.getSource() == linkerItem) |
---|
| 2461 | + if (source == linkerItem) |
---|
2277 | 2462 | { |
---|
2278 | 2463 | group(new cLinker()); |
---|
2279 | 2464 | } else |
---|
2280 | | - if (event.getSource() == textureItem) |
---|
| 2465 | + if (source == textureItem) |
---|
2281 | 2466 | { |
---|
2282 | 2467 | group(new TextureNode()); |
---|
2283 | 2468 | } else |
---|
2284 | | - if (event.getSource() == shadowXItem) |
---|
| 2469 | + if (source == billboardItem) |
---|
| 2470 | + { |
---|
| 2471 | + group(new BillboardNode()); |
---|
| 2472 | + } else |
---|
| 2473 | + if (source == shadowXItem) |
---|
2285 | 2474 | { |
---|
2286 | 2475 | CastShadow(0); |
---|
2287 | 2476 | } else |
---|
2288 | | - if (event.getSource() == shadowYItem) |
---|
| 2477 | + if (source == shadowYItem) |
---|
2289 | 2478 | { |
---|
2290 | 2479 | CastShadow(1); |
---|
2291 | 2480 | } else |
---|
2292 | | - if (event.getSource() == shadowZItem) |
---|
| 2481 | + if (source == shadowZItem) |
---|
2293 | 2482 | { |
---|
2294 | 2483 | CastShadow(2); |
---|
2295 | 2484 | } else |
---|
2296 | | - if (event.getSource() == ungroupItem) |
---|
| 2485 | + if (source == ungroupItem) |
---|
2297 | 2486 | { |
---|
2298 | | - ungroup(); |
---|
| 2487 | + //ungroup(); |
---|
| 2488 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2489 | + { |
---|
| 2490 | + Ungroup(group.selection.get(i)); |
---|
| 2491 | + } |
---|
| 2492 | + |
---|
| 2493 | + ClearSelection(false); |
---|
| 2494 | + |
---|
| 2495 | + refreshContents(); |
---|
2299 | 2496 | } else |
---|
2300 | | - if (event.getSource() == genUVItem) |
---|
| 2497 | + if (source == genUVItem) |
---|
2301 | 2498 | { |
---|
2302 | 2499 | GenUV(); |
---|
2303 | 2500 | } else |
---|
2304 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2501 | + if (source == genNormalsCADItem) |
---|
2305 | 2502 | { |
---|
2306 | 2503 | GenNormals(true); |
---|
2307 | 2504 | } else |
---|
2308 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2505 | + if (source == genNormalsMESHItem) |
---|
| 2506 | + { |
---|
| 2507 | + GenNormals(true); // TODO |
---|
| 2508 | + } else |
---|
| 2509 | + if (source == genNormalsORGANItem) |
---|
2309 | 2510 | { |
---|
2310 | 2511 | GenNormals(false); |
---|
2311 | 2512 | } else |
---|
2312 | | - if (event.getSource() == stripifyItem) |
---|
| 2513 | + if (source == genNormalsMINEItem) |
---|
| 2514 | + { |
---|
| 2515 | + GenNormalsMINE(); |
---|
| 2516 | + } else |
---|
| 2517 | + if (source == stripifyItem) |
---|
2313 | 2518 | { |
---|
2314 | 2519 | Stripify(); |
---|
2315 | 2520 | } else |
---|
2316 | | - if (event.getSource() == unstripifyItem) |
---|
| 2521 | + if (source == unstripifyItem) |
---|
2317 | 2522 | { |
---|
2318 | 2523 | Unstripify(); |
---|
2319 | 2524 | } else |
---|
2320 | | - if (event.getSource() == trimItem) |
---|
| 2525 | + if (source == trimItem) |
---|
2321 | 2526 | { |
---|
2322 | 2527 | Trim(); |
---|
2323 | 2528 | } else |
---|
2324 | | - if (event.getSource() == untrimItem) |
---|
| 2529 | + if (source == untrimItem) |
---|
2325 | 2530 | { |
---|
2326 | 2531 | Untrim(); |
---|
2327 | 2532 | } else |
---|
2328 | | - if (event.getSource() == clearColorsItem) |
---|
| 2533 | + if (source == clearColorsItem) |
---|
2329 | 2534 | { |
---|
2330 | 2535 | ClearColors(); |
---|
2331 | 2536 | } else |
---|
2332 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2537 | + if (source == clearMaterialsItem) |
---|
2333 | 2538 | { |
---|
2334 | 2539 | ClearMaterials(); |
---|
2335 | 2540 | } else |
---|
2336 | | - if (event.getSource() == liveleavesItem) |
---|
| 2541 | + if (source == liveleavesItem) |
---|
2337 | 2542 | { |
---|
2338 | 2543 | LiveLeaves(true); |
---|
2339 | 2544 | } else |
---|
2340 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2545 | + if (source == unliveleavesItem) |
---|
2341 | 2546 | { |
---|
2342 | 2547 | LiveLeaves(false); |
---|
2343 | 2548 | } else |
---|
2344 | | - if (event.getSource() == supportleavesItem) |
---|
| 2549 | + if (source == supportleavesItem) |
---|
2345 | 2550 | { |
---|
2346 | 2551 | SupportLeaves(true); |
---|
2347 | 2552 | } else |
---|
2348 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2553 | + if (source == unsupportleavesItem) |
---|
2349 | 2554 | { |
---|
2350 | 2555 | SupportLeaves(false); |
---|
2351 | 2556 | } else |
---|
2352 | | - if (event.getSource() == hideleavesItem) |
---|
| 2557 | + if (source == hideleavesItem) |
---|
2353 | 2558 | { |
---|
2354 | 2559 | HideLeaves(true); |
---|
2355 | 2560 | } else |
---|
2356 | | - if (event.getSource() == showleavesItem) |
---|
| 2561 | + if (source == showleavesItem) |
---|
2357 | 2562 | { |
---|
2358 | 2563 | HideLeaves(false); |
---|
2359 | 2564 | } else |
---|
2360 | | - if (event.getSource() == markleavesItem) |
---|
| 2565 | + if (source == markleavesItem) |
---|
2361 | 2566 | { |
---|
2362 | 2567 | MarkLeaves(true); |
---|
2363 | 2568 | } else |
---|
2364 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2569 | + if (source == unmarkleavesItem) |
---|
2365 | 2570 | { |
---|
2366 | 2571 | MarkLeaves(false); |
---|
2367 | 2572 | } else |
---|
2368 | | - if (event.getSource() == flipVItem) |
---|
| 2573 | + if (source == flipVItem) |
---|
2369 | 2574 | { |
---|
2370 | 2575 | FlipV(true); |
---|
2371 | 2576 | } else |
---|
2372 | | - if (event.getSource() == unflipVItem) |
---|
| 2577 | + if (source == unflipVItem) |
---|
2373 | 2578 | { |
---|
2374 | 2579 | FlipV(false); |
---|
2375 | 2580 | } else |
---|
2376 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2581 | + if (source == lowTexturesItem) |
---|
2377 | 2582 | { |
---|
2378 | 2583 | SetTexRes(0); |
---|
2379 | 2584 | } else |
---|
2380 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2585 | + if (source == normalTexturesItem) |
---|
2381 | 2586 | { |
---|
2382 | 2587 | SetTexRes(1); |
---|
2383 | 2588 | } else |
---|
2384 | | - if (event.getSource() == highTexturesItem) |
---|
| 2589 | + if (source == highTexturesItem) |
---|
2385 | 2590 | { |
---|
2386 | 2591 | SetTexRes(2); |
---|
2387 | 2592 | } else |
---|
2388 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2593 | + if (source == veryhighTexturesItem) |
---|
2389 | 2594 | { |
---|
2390 | 2595 | SetTexRes(3); |
---|
2391 | 2596 | } else |
---|
2392 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2597 | + if (source == maxTexturesItem) |
---|
2393 | 2598 | { |
---|
2394 | 2599 | SetTexRes(4); |
---|
2395 | 2600 | } else |
---|
2396 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2601 | + if (source == panoTexturesItem) |
---|
2397 | 2602 | { |
---|
2398 | 2603 | SetTexRes(5); |
---|
2399 | 2604 | } else |
---|
2400 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2605 | + if (source == reverseNormalsItem) |
---|
2401 | 2606 | { |
---|
2402 | 2607 | ReverseNormals(); |
---|
2403 | 2608 | } else |
---|
2404 | | - if (event.getSource() == parseverticesItem) |
---|
| 2609 | + if (source == parseverticesItem) |
---|
2405 | 2610 | { |
---|
2406 | 2611 | ParseVertices(); |
---|
2407 | 2612 | } else |
---|
2408 | | - if (event.getSource() == textureFieldItem) |
---|
| 2613 | + if (source == textureFieldItem) |
---|
2409 | 2614 | { |
---|
2410 | 2615 | TextureVertices(); |
---|
2411 | 2616 | } else |
---|
2412 | | - if (event.getSource() == alignItem) |
---|
| 2617 | + if (source == alignItem) |
---|
2413 | 2618 | { |
---|
2414 | 2619 | Align(); |
---|
2415 | 2620 | } else |
---|
2416 | | - if (event.getSource() == mirrorItem) |
---|
| 2621 | + if (source == mirrorItem) |
---|
2417 | 2622 | { |
---|
2418 | 2623 | MirrorPoses(); |
---|
2419 | 2624 | } else |
---|
2420 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2625 | + if (source == reduceMorphItem) |
---|
2421 | 2626 | { |
---|
2422 | 2627 | MeshReduction(false); |
---|
2423 | 2628 | } else |
---|
2424 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2629 | + if (source == reduce34MorphItem) |
---|
2425 | 2630 | { |
---|
2426 | 2631 | MeshReduction(true); |
---|
2427 | 2632 | } else |
---|
2428 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2633 | + if (source == reverseTrianglesItem) |
---|
2429 | 2634 | { |
---|
2430 | 2635 | ReverseTriangles(); |
---|
2431 | 2636 | } else |
---|
2432 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2637 | + if (source == reduceMeshItem) |
---|
2433 | 2638 | { |
---|
2434 | 2639 | ReduceMesh(false); |
---|
2435 | 2640 | } else |
---|
2436 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2641 | + if (source == reduce34MeshItem) |
---|
2437 | 2642 | { |
---|
2438 | 2643 | ReduceMesh(true); |
---|
2439 | 2644 | } else |
---|
2440 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2645 | + if (source == increaseMeshItem) |
---|
2441 | 2646 | { |
---|
2442 | 2647 | IncreaseMesh(); |
---|
2443 | 2648 | } else |
---|
2444 | | - if (event.getSource() == clipMeshItem) |
---|
| 2649 | + if (source == clipMeshItem) |
---|
2445 | 2650 | { |
---|
2446 | 2651 | ClipMesh(); |
---|
2447 | 2652 | } else |
---|
2448 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2653 | + if (source == smoothMeshItem) |
---|
2449 | 2654 | { |
---|
2450 | 2655 | SmoothMesh(); |
---|
2451 | 2656 | } else |
---|
2452 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2657 | + if (source == transformGeometryItem) |
---|
2453 | 2658 | { |
---|
2454 | 2659 | TransformGeometry(); |
---|
2455 | 2660 | } else |
---|
2456 | | - if (event.getSource() == resetTransformItem) |
---|
| 2661 | + if (source == transformChildrenItem) |
---|
| 2662 | + { |
---|
| 2663 | + TransformChildren(); |
---|
| 2664 | + } else |
---|
| 2665 | + if (source == resetTransformItem) |
---|
2457 | 2666 | { |
---|
2458 | 2667 | ResetTransform(); |
---|
2459 | 2668 | } else |
---|
2460 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2669 | + if (source == resetCentroidItem) |
---|
2461 | 2670 | { |
---|
2462 | | - ResetCentroid(); |
---|
| 2671 | + ResetCentroid(true); |
---|
2463 | 2672 | } else |
---|
2464 | | - if (event.getSource() == resetParentItem) |
---|
| 2673 | + if (source == resetCentroidXZItem) |
---|
| 2674 | + { |
---|
| 2675 | + ResetCentroid(false); |
---|
| 2676 | + } else |
---|
| 2677 | + if (source == resetParentItem) |
---|
2465 | 2678 | { |
---|
2466 | 2679 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2467 | 2680 | { |
---|
.. | .. |
---|
2471 | 2684 | |
---|
2472 | 2685 | refreshContents(); |
---|
2473 | 2686 | } else |
---|
2474 | | - if (event.getSource() == repairParentItem) |
---|
| 2687 | + if (source == repairParentItem) |
---|
2475 | 2688 | { |
---|
2476 | 2689 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2477 | 2690 | { |
---|
.. | .. |
---|
2485 | 2698 | |
---|
2486 | 2699 | refreshContents(); |
---|
2487 | 2700 | } else |
---|
2488 | | - if (event.getSource() == sortbysizeItem) |
---|
| 2701 | + if (source == repairShadowItem) |
---|
| 2702 | + { |
---|
| 2703 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2704 | + { |
---|
| 2705 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2706 | + obj.RepairShadow(); |
---|
| 2707 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2708 | +// { |
---|
| 2709 | +// obj.get(i).parent = obj; |
---|
| 2710 | +// } |
---|
| 2711 | + } |
---|
| 2712 | + |
---|
| 2713 | + refreshContents(); |
---|
| 2714 | + } else |
---|
| 2715 | + if (source == sortbysizeItem) |
---|
2489 | 2716 | { |
---|
2490 | 2717 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2491 | 2718 | { |
---|
.. | .. |
---|
2497 | 2724 | ResetModel(); |
---|
2498 | 2725 | refreshContents(); |
---|
2499 | 2726 | } else |
---|
2500 | | - if (event.getSource() == sortbynameItem) |
---|
| 2727 | + if (source == sortbynameItem) |
---|
2501 | 2728 | { |
---|
2502 | 2729 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2503 | 2730 | { |
---|
.. | .. |
---|
2509 | 2736 | ResetModel(); |
---|
2510 | 2737 | refreshContents(); |
---|
2511 | 2738 | } else |
---|
2512 | | - if (event.getSource() == attachPigmentItem) |
---|
| 2739 | + if (source == attachPigmentItem) |
---|
2513 | 2740 | { |
---|
2514 | 2741 | String texture = GetFile("Attach pigment"); |
---|
2515 | 2742 | Object3D obj; |
---|
.. | .. |
---|
2521 | 2748 | |
---|
2522 | 2749 | refreshContents(); |
---|
2523 | 2750 | } else |
---|
2524 | | - if (event.getSource() == detachPigmentItem) |
---|
| 2751 | + if (source == detachPigmentItem) |
---|
2525 | 2752 | { |
---|
2526 | 2753 | Object3D obj; |
---|
2527 | 2754 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2532 | 2759 | |
---|
2533 | 2760 | refreshContents(); |
---|
2534 | 2761 | } else |
---|
2535 | | - if (event.getSource() == attachBumpItem) |
---|
| 2762 | + if (source == attachBumpItem) |
---|
2536 | 2763 | { |
---|
2537 | 2764 | String texture = GetFile("Attach bump"); |
---|
2538 | 2765 | Object3D obj; |
---|
.. | .. |
---|
2544 | 2771 | |
---|
2545 | 2772 | refreshContents(); |
---|
2546 | 2773 | } else |
---|
2547 | | - if (event.getSource() == detachBumpItem) |
---|
| 2774 | + if (source == detachBumpItem) |
---|
2548 | 2775 | { |
---|
2549 | 2776 | Object3D obj; |
---|
2550 | 2777 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2555 | 2782 | |
---|
2556 | 2783 | refreshContents(); |
---|
2557 | 2784 | } else |
---|
2558 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 2785 | + if (source == pigmentBumpItem) |
---|
2559 | 2786 | { |
---|
2560 | 2787 | Object3D obj; |
---|
2561 | 2788 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2566 | 2793 | |
---|
2567 | 2794 | refreshContents(); |
---|
2568 | 2795 | } else |
---|
2569 | | - if (event.getSource() == flashSelectionButton) |
---|
| 2796 | + if (source == flashSelectionButton) |
---|
2570 | 2797 | { |
---|
2571 | 2798 | CameraPane.flash = true; |
---|
2572 | 2799 | refreshContents(); |
---|
2573 | 2800 | } else |
---|
2574 | | - if (event.getSource() == oneButton) |
---|
| 2801 | + if (source == oneButton) |
---|
2575 | 2802 | { |
---|
2576 | 2803 | } else |
---|
2577 | | - if (event.getSource() == twoButton) |
---|
| 2804 | + if (source == twoButton) |
---|
2578 | 2805 | { |
---|
2579 | 2806 | radio.layout = twoButton; |
---|
2580 | 2807 | // bug |
---|
2581 | 2808 | //gridPanel.setDividerLocation(1.0); |
---|
2582 | 2809 | //bigPanel.setDividerLocation(0.0); |
---|
2583 | | - bigThree.remove(jtp); |
---|
2584 | | - bigThree.remove(cameraPanel); |
---|
2585 | | - bigThree.remove(XYZPanel); |
---|
2586 | | - aWindowConstraints.gridx = 0; |
---|
2587 | | - aWindowConstraints.gridy = 0; |
---|
2588 | | - aWindowConstraints.gridwidth = 1; |
---|
2589 | | - // aConstraints.gridheight = 3; |
---|
2590 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2591 | | - aWindowConstraints.weightx = 0; |
---|
2592 | | - aWindowConstraints.weighty = 1; |
---|
2593 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2594 | | - aWindowConstraints.weightx = 1; |
---|
2595 | | - aWindowConstraints.gridwidth = 3; |
---|
2596 | | - // aConstraints.gridheight = 3; |
---|
2597 | | - aWindowConstraints.gridx = 1; |
---|
2598 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2599 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2600 | | - aWindowConstraints.weightx = 0; |
---|
2601 | | - aWindowConstraints.gridx = 4; |
---|
2602 | | - aWindowConstraints.gridwidth = 1; |
---|
2603 | | - // aConstraints.gridheight = 3; |
---|
2604 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2605 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2606 | | - bigThree.revalidate(); |
---|
| 2810 | +// bigThree.remove(scenePanel); |
---|
| 2811 | +// bigThree.remove(centralPanel); |
---|
| 2812 | +// bigThree.remove(XYZPanel); |
---|
| 2813 | +// aWindowConstraints.gridx = 0; |
---|
| 2814 | +// aWindowConstraints.gridy = 0; |
---|
| 2815 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2816 | +// // aConstraints.gridheight = 3; |
---|
| 2817 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2818 | +// aWindowConstraints.weightx = 0; |
---|
| 2819 | +// aWindowConstraints.weighty = 1; |
---|
| 2820 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2821 | +// aWindowConstraints.weightx = 1; |
---|
| 2822 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2823 | +// // aConstraints.gridheight = 3; |
---|
| 2824 | +// aWindowConstraints.gridx = 1; |
---|
| 2825 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2826 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2827 | +// aWindowConstraints.weightx = 0; |
---|
| 2828 | +// aWindowConstraints.gridx = 4; |
---|
| 2829 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2830 | +// // aConstraints.gridheight = 3; |
---|
| 2831 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2832 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2833 | +// scenePanel.setVisible(false); |
---|
| 2834 | +// centralPanel.setVisible(true); |
---|
| 2835 | +// XYZPanel.setVisible(false); |
---|
| 2836 | + bigThree.ClearUI(); |
---|
| 2837 | + bigThree.add(centralPanel); |
---|
| 2838 | + bigThree.FlushUI(); |
---|
2607 | 2839 | } else |
---|
2608 | | - if (event.getSource() == threeButton) |
---|
| 2840 | + if (source == threeButton) |
---|
2609 | 2841 | { |
---|
2610 | 2842 | radio.layout = threeButton; |
---|
2611 | | - bigThree.remove(jtp); |
---|
2612 | | - bigThree.remove(cameraPanel); |
---|
2613 | | - bigThree.remove(XYZPanel); |
---|
2614 | | - aWindowConstraints.gridx = 0; |
---|
2615 | | - aWindowConstraints.gridy = 0; |
---|
2616 | | - aWindowConstraints.gridwidth = 1; |
---|
2617 | | - // aConstraints.gridheight = 3; |
---|
2618 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2619 | | - aWindowConstraints.weightx = 0; |
---|
2620 | | - aWindowConstraints.weighty = 1; |
---|
2621 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2622 | | - aWindowConstraints.weightx = 1; |
---|
2623 | | - aWindowConstraints.gridwidth = 3; |
---|
2624 | | - // aConstraints.gridheight = 3; |
---|
2625 | | - aWindowConstraints.gridx = 1; |
---|
2626 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2627 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2628 | | - aWindowConstraints.weightx = 0; |
---|
2629 | | - aWindowConstraints.gridx = 4; |
---|
2630 | | - aWindowConstraints.gridwidth = 1; |
---|
2631 | | - // aConstraints.gridheight = 3; |
---|
2632 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2633 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2634 | | - bigThree.revalidate(); |
---|
| 2843 | + |
---|
| 2844 | +// bigThree.remove(scenePanel); |
---|
| 2845 | +// bigThree.remove(centralPanel); |
---|
| 2846 | +// bigThree.remove(XYZPanel); |
---|
| 2847 | +// aWindowConstraints.gridx = 0; |
---|
| 2848 | +// aWindowConstraints.gridy = 0; |
---|
| 2849 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2850 | +// // aConstraints.gridheight = 3; |
---|
| 2851 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2852 | +// aWindowConstraints.weightx = 0; |
---|
| 2853 | +// aWindowConstraints.weighty = 1; |
---|
| 2854 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 2855 | +// aWindowConstraints.weightx = 1; |
---|
| 2856 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2857 | +// // aConstraints.gridheight = 3; |
---|
| 2858 | +// aWindowConstraints.gridx = 1; |
---|
| 2859 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2860 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2861 | +// aWindowConstraints.weightx = 0; |
---|
| 2862 | +// aWindowConstraints.gridx = 4; |
---|
| 2863 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2864 | +// // aConstraints.gridheight = 3; |
---|
| 2865 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2866 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2867 | +// bigThree.validate(); |
---|
| 2868 | +// scenePanel.setVisible(false); |
---|
| 2869 | +// centralPanel.setVisible(true); |
---|
| 2870 | +// XYZPanel.setVisible(true); |
---|
| 2871 | + bigThree.ClearUI(); |
---|
| 2872 | + bigThree.add(centralPanel); |
---|
| 2873 | + bigThree.add(XYZPanel); |
---|
| 2874 | + bigThree.FlushUI(); |
---|
2635 | 2875 | } else |
---|
2636 | | - if (event.getSource() == fourButton) |
---|
| 2876 | + if (source == fourButton) |
---|
2637 | 2877 | { |
---|
2638 | 2878 | radio.layout = fourButton; |
---|
2639 | | - bigThree.remove(jtp); |
---|
2640 | | - bigThree.remove(cameraPanel); |
---|
2641 | | - bigThree.remove(XYZPanel); |
---|
2642 | | - aWindowConstraints.gridx = 0; |
---|
2643 | | - aWindowConstraints.gridy = 0; |
---|
2644 | | - aWindowConstraints.gridwidth = 1; |
---|
2645 | | - // aWindowConstraints.gridheight = 3; |
---|
2646 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2647 | | - aWindowConstraints.weightx = 1; |
---|
2648 | | - aWindowConstraints.weighty = 1; |
---|
2649 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2650 | | - aWindowConstraints.weightx = 1; |
---|
2651 | | - aWindowConstraints.gridwidth = 3; |
---|
2652 | | - // aConstraints.gridheight = 3; |
---|
2653 | | - aWindowConstraints.gridx = 1; |
---|
2654 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2655 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2656 | | - aWindowConstraints.weightx = 0; |
---|
2657 | | - aWindowConstraints.gridx = 4; |
---|
2658 | | - aWindowConstraints.gridwidth = 1; |
---|
2659 | | - // aWindowConstraints.gridheight = 3; |
---|
2660 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2661 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2662 | | - bigThree.revalidate(); |
---|
| 2879 | + |
---|
| 2880 | +// bigThree.remove(scenePanel); |
---|
| 2881 | +// bigThree.remove(centralPanel); |
---|
| 2882 | +// bigThree.remove(XYZPanel); |
---|
| 2883 | +// aWindowConstraints.gridx = 0; |
---|
| 2884 | +// aWindowConstraints.gridy = 0; |
---|
| 2885 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2886 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2887 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2888 | +// aWindowConstraints.weightx = 1; |
---|
| 2889 | +// aWindowConstraints.weighty = 1; |
---|
| 2890 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2891 | +// aWindowConstraints.weightx = 1; |
---|
| 2892 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2893 | +// // aConstraints.gridheight = 3; |
---|
| 2894 | +// aWindowConstraints.gridx = 1; |
---|
| 2895 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2896 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2897 | +// aWindowConstraints.weightx = 0; |
---|
| 2898 | +// aWindowConstraints.gridx = 4; |
---|
| 2899 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2900 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2901 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2902 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2903 | +// bigThree.validate(); |
---|
| 2904 | +// scenePanel.setVisible(true); |
---|
| 2905 | +// centralPanel.setVisible(false); |
---|
| 2906 | +// XYZPanel.setVisible(false); |
---|
| 2907 | + bigThree.ClearUI(); |
---|
| 2908 | + bigThree.add(scenePanel); |
---|
| 2909 | + bigThree.FlushUI(); |
---|
2663 | 2910 | } else |
---|
2664 | | - if (event.getSource() == sixButton) |
---|
| 2911 | + if (source == sixButton) |
---|
2665 | 2912 | { |
---|
2666 | 2913 | radio.layout = sixButton; |
---|
2667 | | - bigThree.remove(jtp); |
---|
2668 | | - bigThree.remove(cameraPanel); |
---|
2669 | | - bigThree.remove(XYZPanel); |
---|
2670 | | - aWindowConstraints.gridx = 0; |
---|
2671 | | - aWindowConstraints.gridy = 0; |
---|
2672 | | - aWindowConstraints.gridwidth = 1; |
---|
2673 | | - // aConstraints.gridheight = 3; |
---|
2674 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2675 | | - aWindowConstraints.weightx = 0; |
---|
2676 | | - aWindowConstraints.weighty = 1; |
---|
2677 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2678 | | - aWindowConstraints.weightx = 1; |
---|
2679 | | - aWindowConstraints.gridwidth = 3; |
---|
2680 | | - // aWindowConstraints.gridheight = 3; |
---|
2681 | | - aWindowConstraints.gridx = 1; |
---|
2682 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2683 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2684 | | - aWindowConstraints.weightx = 0; |
---|
2685 | | - aWindowConstraints.gridx = 4; |
---|
2686 | | - aWindowConstraints.gridwidth = 1; |
---|
2687 | | - // aWindowConstraints.gridheight = 3; |
---|
2688 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2689 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2690 | | - bigThree.revalidate(); |
---|
| 2914 | + |
---|
| 2915 | +// bigThree.remove(scenePanel); |
---|
| 2916 | +// bigThree.remove(centralPanel); |
---|
| 2917 | +// bigThree.remove(XYZPanel); |
---|
| 2918 | +// aWindowConstraints.gridx = 0; |
---|
| 2919 | +// aWindowConstraints.gridy = 0; |
---|
| 2920 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2921 | +// // aConstraints.gridheight = 3; |
---|
| 2922 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2923 | +// aWindowConstraints.weightx = 0; |
---|
| 2924 | +// aWindowConstraints.weighty = 1; |
---|
| 2925 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2926 | +// aWindowConstraints.weightx = 1; |
---|
| 2927 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2928 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2929 | +// aWindowConstraints.gridx = 1; |
---|
| 2930 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2931 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2932 | +// aWindowConstraints.weightx = 0; |
---|
| 2933 | +// aWindowConstraints.gridx = 4; |
---|
| 2934 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2935 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2936 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2937 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 2938 | +// bigThree.validate(); |
---|
| 2939 | +// scenePanel.setVisible(true); |
---|
| 2940 | +// centralPanel.setVisible(true); |
---|
| 2941 | +// XYZPanel.setVisible(false); |
---|
| 2942 | + bigThree.ClearUI(); |
---|
| 2943 | + bigThree.add(scenePanel); |
---|
| 2944 | + bigThree.add(centralPanel); |
---|
| 2945 | + bigThree.FlushUI(); |
---|
2691 | 2946 | } else |
---|
2692 | | - if (event.getSource() == sevenButton) |
---|
| 2947 | + if (source == sevenButton) |
---|
2693 | 2948 | { |
---|
2694 | 2949 | radio.layout = sevenButton; |
---|
2695 | | - bigThree.remove(jtp); |
---|
2696 | | - bigThree.remove(cameraPanel); |
---|
2697 | | - bigThree.remove(XYZPanel); |
---|
2698 | | - aWindowConstraints.gridx = 0; |
---|
2699 | | - aWindowConstraints.gridy = 0; |
---|
2700 | | - aWindowConstraints.gridwidth = 1; |
---|
2701 | | - // aWindowConstraints.gridheight = 3; |
---|
2702 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2703 | | - aWindowConstraints.weightx = 0; |
---|
2704 | | - aWindowConstraints.weighty = 1; |
---|
2705 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2706 | | - aWindowConstraints.weightx = 1; |
---|
2707 | | - aWindowConstraints.gridwidth = 3; |
---|
2708 | | - // aWindowConstraints.gridheight = 3; |
---|
2709 | | - aWindowConstraints.gridx = 1; |
---|
2710 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2711 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2712 | | - aWindowConstraints.weightx = 0; |
---|
2713 | | - aWindowConstraints.gridx = 4; |
---|
2714 | | - aWindowConstraints.gridwidth = 1; |
---|
2715 | | - // aConstraints.gridheight = 3; |
---|
2716 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2717 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2718 | | - bigThree.revalidate(); |
---|
| 2950 | + |
---|
| 2951 | +// bigThree.remove(scenePanel); |
---|
| 2952 | +// bigThree.remove(centralPanel); |
---|
| 2953 | +// bigThree.remove(XYZPanel); |
---|
| 2954 | +// aWindowConstraints.gridx = 0; |
---|
| 2955 | +// aWindowConstraints.gridy = 0; |
---|
| 2956 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2957 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2958 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2959 | +// aWindowConstraints.weightx = 0; |
---|
| 2960 | +// aWindowConstraints.weighty = 1; |
---|
| 2961 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 2962 | +// aWindowConstraints.weightx = 1; |
---|
| 2963 | +// aWindowConstraints.gridwidth = 3; |
---|
| 2964 | +// // aWindowConstraints.gridheight = 3; |
---|
| 2965 | +// aWindowConstraints.gridx = 1; |
---|
| 2966 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 2967 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 2968 | +// aWindowConstraints.weightx = 0; |
---|
| 2969 | +// aWindowConstraints.gridx = 4; |
---|
| 2970 | +// aWindowConstraints.gridwidth = 1; |
---|
| 2971 | +// // aConstraints.gridheight = 3; |
---|
| 2972 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 2973 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 2974 | +// bigThree.validate(); |
---|
| 2975 | +// scenePanel.setVisible(true); |
---|
| 2976 | +// centralPanel.setVisible(true); |
---|
| 2977 | +// XYZPanel.setVisible(true); |
---|
| 2978 | + bigThree.ClearUI(); |
---|
| 2979 | + bigThree.add(scenePanel); |
---|
| 2980 | + bigThree.add(centralPanel); |
---|
| 2981 | + bigThree.add(XYZPanel); |
---|
| 2982 | + bigThree.FlushUI(); |
---|
2719 | 2983 | } else |
---|
2720 | | - if (event.getSource() == rootButton) |
---|
| 2984 | + if (source == rootButton) |
---|
2721 | 2985 | { |
---|
2722 | 2986 | Object3D obj; |
---|
2723 | 2987 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2729 | 2993 | |
---|
2730 | 2994 | refreshContents(true); |
---|
2731 | 2995 | } else |
---|
2732 | | - if (event.getSource() == closeButton) |
---|
| 2996 | + if (source == closeButton) |
---|
2733 | 2997 | { |
---|
2734 | 2998 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2735 | 2999 | cRadio ab; |
---|
.. | .. |
---|
2750 | 3014 | } |
---|
2751 | 3015 | refreshContents(true); |
---|
2752 | 3016 | } else |
---|
2753 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3017 | + if (source == editItem || source == editButton) |
---|
2754 | 3018 | { |
---|
2755 | 3019 | EditSelection(false); |
---|
2756 | 3020 | } else |
---|
2757 | | - if (event.getSource() == uneditButton) |
---|
| 3021 | + if (source == uneditButton) |
---|
2758 | 3022 | { |
---|
2759 | 3023 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2760 | 3024 | { |
---|
.. | .. |
---|
2766 | 3030 | |
---|
2767 | 3031 | child.editWindow = null; // ??????????? |
---|
2768 | 3032 | } |
---|
2769 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3033 | + objEditor.ctrlPanel.FlushUI(); |
---|
2770 | 3034 | //objEditor.jTree.clearSelection(); |
---|
2771 | 3035 | //objEditor.ResetSliders(); |
---|
2772 | 3036 | refreshContents(true); |
---|
2773 | 3037 | } else |
---|
2774 | | - if (event.getSource() == clearPanelButton) |
---|
| 3038 | + if (source == clearPanelButton) |
---|
2775 | 3039 | { |
---|
2776 | 3040 | assert(copy == group); |
---|
2777 | 3041 | //copy.ClearUI(); |
---|
.. | .. |
---|
2782 | 3046 | listUI.clear(); |
---|
2783 | 3047 | refreshContents(true); |
---|
2784 | 3048 | } else |
---|
2785 | | - if (event.getSource() == allParamsButton) |
---|
| 3049 | + if (source == allParamsButton) |
---|
2786 | 3050 | { |
---|
2787 | 3051 | assert(copy == group); |
---|
2788 | 3052 | |
---|
.. | .. |
---|
2803 | 3067 | |
---|
2804 | 3068 | refreshContents(true); |
---|
2805 | 3069 | } else |
---|
2806 | | - if (event.getSource() == unselectButton) |
---|
| 3070 | + if (source == unselectButton) |
---|
2807 | 3071 | { |
---|
2808 | 3072 | objEditor.jTree.clearSelection(); |
---|
2809 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 3073 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2810 | 3074 | objEditor.ResetSliders(); |
---|
2811 | 3075 | refreshContents(true); |
---|
2812 | 3076 | } else |
---|
2813 | | - if(event.getSource() instanceof cRadio) |
---|
| 3077 | + if(source instanceof cRadio) |
---|
2814 | 3078 | { |
---|
2815 | 3079 | group.parent = keepparent; |
---|
2816 | 3080 | group.attributes = 0; |
---|
2817 | 3081 | //group.editWindow = null; |
---|
2818 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3082 | + /*cRadio*/ radio = (cRadio)source; |
---|
2819 | 3083 | Object3D obj = radio.GetObject(); |
---|
2820 | 3084 | System.out.println("Edit " + obj); |
---|
2821 | 3085 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2835 | 3099 | } |
---|
2836 | 3100 | |
---|
2837 | 3101 | copy = group; |
---|
2838 | | - //CameraPane.theRenderer.object = group; |
---|
| 3102 | + //Globals.theRenderer.object = group; |
---|
2839 | 3103 | if(!useclient) |
---|
2840 | 3104 | { |
---|
2841 | 3105 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2844 | 3108 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2845 | 3109 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2846 | 3110 | cameraView.object = group; |
---|
2847 | | - cameraView.lighttouched = true; |
---|
| 3111 | + //cameraView.lighttouched = true; |
---|
| 3112 | + Globals.lighttouched = true; |
---|
2848 | 3113 | topView.object = group; |
---|
2849 | 3114 | frontView.object = group; |
---|
2850 | 3115 | sideView.object = group; |
---|
2851 | 3116 | } |
---|
2852 | | - group.editWindow = this; |
---|
| 3117 | + |
---|
| 3118 | +// fix "+" issue group.editWindow = this; |
---|
| 3119 | + |
---|
2853 | 3120 | /* |
---|
2854 | 3121 | currentLayout = radio.layout; |
---|
2855 | 3122 | if (currentLayout == null) |
---|
.. | .. |
---|
2862 | 3129 | //group.attributes = -1; |
---|
2863 | 3130 | ResetModel(); |
---|
2864 | 3131 | refreshContents(true); |
---|
2865 | | - } |
---|
| 3132 | + } else if (event.getSource() == editCameraItem) |
---|
| 3133 | + { |
---|
| 3134 | + cameraView.ProtectCamera(); |
---|
| 3135 | + cameraView.repaint(); |
---|
| 3136 | + return; |
---|
| 3137 | + } else if (event.getSource() == revertCameraItem) |
---|
| 3138 | + { |
---|
| 3139 | + cameraView.RevertCamera(); |
---|
| 3140 | + cameraView.repaint(); |
---|
| 3141 | + return; |
---|
| 3142 | + // } else if (event.getSource() == textureButton) |
---|
| 3143 | + // { |
---|
| 3144 | + // return; // true; |
---|
| 3145 | + } |
---|
2866 | 3146 | else |
---|
2867 | 3147 | { |
---|
2868 | 3148 | //return super.action(event, arg); |
---|
.. | .. |
---|
2880 | 3160 | if (useclient) |
---|
2881 | 3161 | { |
---|
2882 | 3162 | cameraView.object = client; |
---|
2883 | | - cameraView.lighttouched = true; |
---|
| 3163 | + Globals.lighttouched = true; |
---|
2884 | 3164 | //topView.object = client; |
---|
2885 | 3165 | //frontView.object = client; |
---|
2886 | 3166 | //sideView.object = client; |
---|
.. | .. |
---|
2888 | 3168 | else |
---|
2889 | 3169 | { |
---|
2890 | 3170 | cameraView.object = group; |
---|
2891 | | - cameraView.lighttouched = true; |
---|
| 3171 | + Globals.lighttouched = true; |
---|
2892 | 3172 | //topView.object = group; |
---|
2893 | 3173 | //frontView.object = group; |
---|
2894 | 3174 | //sideView.object = group; |
---|
.. | .. |
---|
2923 | 3203 | refreshContents(); |
---|
2924 | 3204 | } |
---|
2925 | 3205 | |
---|
| 3206 | + void TransformChildren() |
---|
| 3207 | + { |
---|
| 3208 | + Object3D obj; |
---|
| 3209 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3210 | + { |
---|
| 3211 | + obj = (Object3D)e.nextElement(); |
---|
| 3212 | + obj.KeepTextureMatrices(); |
---|
| 3213 | + obj.TransformChildren(); |
---|
| 3214 | + obj.RestoreTextureMatrices(); |
---|
| 3215 | + |
---|
| 3216 | +// if (obj.parent == null) |
---|
| 3217 | +// { |
---|
| 3218 | +// System.out.println("NULL PARENT!"); |
---|
| 3219 | +// new Exception().printStackTrace(); |
---|
| 3220 | +// } |
---|
| 3221 | +// else |
---|
| 3222 | +// TouchTransform(obj); |
---|
| 3223 | +// //obj.parent.Touch(); |
---|
| 3224 | + } |
---|
| 3225 | + |
---|
| 3226 | + refreshContents(); |
---|
| 3227 | + } |
---|
2926 | 3228 | |
---|
2927 | 3229 | void ResetTransform() |
---|
2928 | 3230 | { |
---|
.. | .. |
---|
3035 | 3337 | refreshContents(); |
---|
3036 | 3338 | } |
---|
3037 | 3339 | |
---|
3038 | | - void ResetCentroid() |
---|
| 3340 | + void ResetCentroid(boolean full) |
---|
3039 | 3341 | { |
---|
3040 | 3342 | Object3D obj; |
---|
3041 | 3343 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3050 | 3352 | LA.matIdentity(Object3D.mat); |
---|
3051 | 3353 | obj.getBounds(minima, maxima, false); |
---|
3052 | 3354 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3053 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3355 | + if (full) |
---|
| 3356 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3054 | 3357 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3055 | 3358 | obj.TransformMesh(Object3D.mat); |
---|
| 3359 | + |
---|
3056 | 3360 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3057 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3361 | + if (full) |
---|
| 3362 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3058 | 3363 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3364 | + |
---|
3059 | 3365 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3060 | 3366 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3061 | 3367 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3121 | 3427 | obj = (Object3D)e.nextElement(); |
---|
3122 | 3428 | |
---|
3123 | 3429 | System.out.println("Object is: " + obj); |
---|
3124 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3430 | + Grafreed.AnalyzeObject(obj); |
---|
3125 | 3431 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3126 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3432 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3127 | 3433 | |
---|
3128 | 3434 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3129 | 3435 | } |
---|
.. | .. |
---|
3165 | 3471 | void GenNormals(boolean crease) |
---|
3166 | 3472 | { |
---|
3167 | 3473 | group.GenNormalsS(crease); |
---|
| 3474 | + |
---|
| 3475 | + refreshContents(); |
---|
| 3476 | + } |
---|
| 3477 | + |
---|
| 3478 | + void GenNormalsMINE() |
---|
| 3479 | + { |
---|
| 3480 | + group.selection.GenNormalsMINE(); |
---|
3168 | 3481 | |
---|
3169 | 3482 | refreshContents(); |
---|
3170 | 3483 | } |
---|
.. | .. |
---|
3250 | 3563 | // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3251 | 3564 | // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3252 | 3565 | // |
---|
3253 | | -// g.add(GraphreeD.clipboard); |
---|
| 3566 | +// g.add(GrafreeD.clipboard); |
---|
3254 | 3567 | // |
---|
3255 | 3568 | // buffer.add(g); |
---|
3256 | 3569 | // } |
---|
.. | .. |
---|
3269 | 3582 | // nodes = new Object3D(); |
---|
3270 | 3583 | // vertices = new Vector<Vertex>(); |
---|
3271 | 3584 | // |
---|
3272 | | -// boolean epsequal = GraphreeD.epsequal; |
---|
3273 | | -// GraphreeD.epsequal = true; |
---|
| 3585 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3586 | +// GrafreeD.epsequal = true; |
---|
3274 | 3587 | // |
---|
3275 | 3588 | // for (int i=0; i<group.selection.size(); i++) |
---|
3276 | 3589 | // { |
---|
.. | .. |
---|
3311 | 3624 | // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3312 | 3625 | // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3313 | 3626 | // |
---|
3314 | | -// g.add(GraphreeD.clipboard); |
---|
| 3627 | +// g.add(GrafreeD.clipboard); |
---|
3315 | 3628 | // |
---|
3316 | 3629 | // buffer.add(g); |
---|
3317 | 3630 | // } |
---|
.. | .. |
---|
3319 | 3632 | // makeSomething(buffer, i==group.selection.size()-1); |
---|
3320 | 3633 | // } |
---|
3321 | 3634 | // |
---|
3322 | | -// GraphreeD.epsequal = epsequal; |
---|
| 3635 | +// GrafreeD.epsequal = epsequal; |
---|
3323 | 3636 | // |
---|
3324 | 3637 | // //buffer = null; |
---|
3325 | 3638 | // temprep = null; |
---|
.. | .. |
---|
3330 | 3643 | |
---|
3331 | 3644 | void ParseVertices() |
---|
3332 | 3645 | { |
---|
3333 | | - boolean epsequal = GraphreeD.epsequal; |
---|
3334 | | - GraphreeD.epsequal = true; |
---|
| 3646 | + boolean epsequal = Grafreed.epsequal; |
---|
| 3647 | + Grafreed.epsequal = true; |
---|
3335 | 3648 | |
---|
3336 | 3649 | for (int i=0; i<group.selection.size(); i++) |
---|
3337 | 3650 | { |
---|
.. | .. |
---|
3356 | 3669 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3357 | 3670 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3358 | 3671 | |
---|
3359 | | - g.add(GraphreeD.clipboard); |
---|
| 3672 | + g.add(Grafreed.clipboard); |
---|
3360 | 3673 | |
---|
3361 | 3674 | buffer.add(g); |
---|
3362 | 3675 | } |
---|
.. | .. |
---|
3371 | 3684 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3372 | 3685 | } |
---|
3373 | 3686 | |
---|
3374 | | - GraphreeD.epsequal = epsequal; |
---|
| 3687 | + Grafreed.epsequal = epsequal; |
---|
3375 | 3688 | |
---|
3376 | 3689 | refreshContents(); |
---|
3377 | 3690 | } |
---|
.. | .. |
---|
3389 | 3702 | String pigment = Object3D.GetPigment(tex); |
---|
3390 | 3703 | //String bump = Object3D.GetBump(tex); |
---|
3391 | 3704 | |
---|
3392 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3705 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 3706 | + |
---|
| 3707 | + try |
---|
| 3708 | + { |
---|
| 3709 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 3710 | + } |
---|
| 3711 | + catch (Exception e) |
---|
| 3712 | + { |
---|
| 3713 | + System.err.println("FAIL: " + node); |
---|
| 3714 | + } |
---|
3393 | 3715 | |
---|
3394 | 3716 | double s = v.s; |
---|
3395 | 3717 | |
---|
.. | .. |
---|
3416 | 3738 | scale /= 3; |
---|
3417 | 3739 | |
---|
3418 | 3740 | scale /= 0xFF; |
---|
3419 | | - scale /= 4; |
---|
| 3741 | + // c'est quoi ca? scale /= 4; |
---|
3420 | 3742 | |
---|
3421 | 3743 | //v.AO = scale; |
---|
3422 | 3744 | |
---|
.. | .. |
---|
3437 | 3759 | |
---|
3438 | 3760 | void Align() |
---|
3439 | 3761 | { |
---|
| 3762 | + if (group.selection.size() == 0) |
---|
| 3763 | + return; |
---|
| 3764 | + |
---|
| 3765 | + cVector bbmin = new cVector(); |
---|
| 3766 | + cVector bbmax = new cVector(); |
---|
| 3767 | + |
---|
| 3768 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3769 | + |
---|
| 3770 | + double dx = bbmax.x - bbmin.x; |
---|
| 3771 | + double dy = bbmax.y - bbmin.y; |
---|
| 3772 | + double dz = bbmax.z - bbmin.z; |
---|
| 3773 | + |
---|
| 3774 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3775 | + |
---|
3440 | 3776 | for (int i=0; i<group.selection.size(); i++) |
---|
3441 | 3777 | { |
---|
3442 | 3778 | Object3D obj = group.selection.get(i); |
---|
3443 | 3779 | |
---|
3444 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3445 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3780 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3781 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3446 | 3782 | } |
---|
3447 | 3783 | |
---|
3448 | 3784 | refreshContents(); |
---|
.. | .. |
---|
3455 | 3791 | // ref.SaveSupports(); |
---|
3456 | 3792 | // Object3D par = ref.parent; |
---|
3457 | 3793 | // ref.parent = null; |
---|
3458 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 3794 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3459 | 3795 | // ref.parent = par; |
---|
3460 | 3796 | // ref.RestoreSupports(); |
---|
3461 | 3797 | |
---|
.. | .. |
---|
3463 | 3799 | |
---|
3464 | 3800 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3465 | 3801 | |
---|
3466 | | - boolean random = CameraPane.RANDOM; |
---|
3467 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3802 | + boolean random = CameraPane.SWITCH; |
---|
| 3803 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3468 | 3804 | lowres.linkVerticesThis(null); |
---|
3469 | 3805 | lowres.linkVerticesThis(sn); |
---|
3470 | | - CameraPane.RANDOM = random; |
---|
| 3806 | + CameraPane.SWITCH = random; |
---|
3471 | 3807 | |
---|
3472 | 3808 | System.err.flush(); |
---|
3473 | 3809 | |
---|
.. | .. |
---|
3485 | 3821 | // lowres.SaveSupports(); |
---|
3486 | 3822 | // par = lowres.parent; |
---|
3487 | 3823 | // lowres.parent = null; |
---|
3488 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 3824 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3489 | 3825 | Object3D newlow = CloneObject(lowres, false); |
---|
3490 | 3826 | newlow.name = sn.switchobject.get(i).name; |
---|
3491 | 3827 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3507 | 3843 | return; |
---|
3508 | 3844 | |
---|
3509 | 3845 | Object3D poses = group.selection.get(0); |
---|
3510 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 3846 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3511 | 3847 | |
---|
3512 | 3848 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3513 | 3849 | |
---|
.. | .. |
---|
3676 | 4012 | group.selection.RelinkToSupport(); // july 2014 |
---|
3677 | 4013 | System.out.println("DONE."); |
---|
3678 | 4014 | refreshContents(); |
---|
3679 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4015 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3680 | 4016 | } |
---|
3681 | 4017 | |
---|
3682 | 4018 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3701 | 4037 | |
---|
3702 | 4038 | void ClipMesh() |
---|
3703 | 4039 | { |
---|
3704 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 4040 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3705 | 4041 | { |
---|
3706 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 4042 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3707 | 4043 | |
---|
3708 | 4044 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3709 | 4045 | content = ((cGroup)content).get(0); |
---|
3710 | 4046 | |
---|
3711 | 4047 | // for (int i=0; i<group.selection.size(); i++) |
---|
3712 | 4048 | // { |
---|
3713 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 4049 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3714 | 4050 | // } |
---|
3715 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4051 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3716 | 4052 | } |
---|
3717 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 4053 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3718 | 4054 | System.out.println("DONE."); |
---|
3719 | 4055 | refreshContents(); |
---|
3720 | 4056 | } |
---|
.. | .. |
---|
3847 | 4183 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3848 | 4184 | |
---|
3849 | 4185 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3850 | | - if(elem != group) |
---|
| 4186 | + if(elem != group || !newWindow) |
---|
3851 | 4187 | { |
---|
3852 | 4188 | // if (!(elem instanceof Composite)) |
---|
3853 | 4189 | // newWindow = false; |
---|
.. | .. |
---|
3952 | 4288 | System.err.println("info : " + child.GetPath()); |
---|
3953 | 4289 | } |
---|
3954 | 4290 | } |
---|
3955 | | - else |
---|
3956 | | - { |
---|
3957 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3958 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3959 | | - System.err.println("info : " + group.GetPath()); |
---|
3960 | | - } |
---|
| 4291 | +// else |
---|
| 4292 | +// { |
---|
| 4293 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4294 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4295 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4296 | +// } |
---|
3961 | 4297 | |
---|
3962 | 4298 | objEditor.SetText(); // jan 2014 |
---|
3963 | 4299 | |
---|
3964 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4300 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
3965 | 4301 | CameraPane.flash = true; |
---|
3966 | 4302 | |
---|
3967 | 4303 | if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
3968 | 4304 | // a camera |
---|
3969 | 4305 | { |
---|
3970 | 4306 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
3971 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
3972 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
3973 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4307 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4308 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4309 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3974 | 4310 | } |
---|
3975 | 4311 | |
---|
3976 | 4312 | refreshContents(); |
---|
.. | .. |
---|
4052 | 4388 | { |
---|
4053 | 4389 | if (group.selection.isEmpty()) |
---|
4054 | 4390 | return; |
---|
4055 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4391 | + Grafreed.clipboardIsTempGroup = false; |
---|
4056 | 4392 | Composite tGroup = null; |
---|
4057 | 4393 | if (group.selection.size() > 0) // 1) |
---|
4058 | 4394 | { |
---|
4059 | 4395 | tGroup = new cGroup(); |
---|
4060 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4396 | + Grafreed.clipboardIsTempGroup = true; |
---|
4061 | 4397 | } |
---|
4062 | 4398 | |
---|
4063 | 4399 | if (cut) |
---|
.. | .. |
---|
4097 | 4433 | //System.out.println("cut " + child); |
---|
4098 | 4434 | //System.out.println("parent = " + child.parent); |
---|
4099 | 4435 | // tmp.addChild(child); |
---|
4100 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4436 | + if (Grafreed.clipboardIsTempGroup) |
---|
4101 | 4437 | tGroup.add/*Child*/(tmp); |
---|
4102 | 4438 | else |
---|
4103 | | - GraphreeD.clipboard = tmp; |
---|
| 4439 | + Grafreed.clipboard = tmp; |
---|
4104 | 4440 | } |
---|
4105 | 4441 | else |
---|
4106 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4442 | + if (Grafreed.clipboardIsTempGroup) |
---|
4107 | 4443 | tGroup.add/*Child*/(child); |
---|
4108 | 4444 | else |
---|
4109 | | - GraphreeD.clipboard = child; |
---|
| 4445 | + Grafreed.clipboard = child; |
---|
4110 | 4446 | } |
---|
4111 | 4447 | |
---|
4112 | 4448 | //ResetModel(); |
---|
.. | .. |
---|
4138 | 4474 | //System.out.println("cut " + elem); |
---|
4139 | 4475 | //System.out.println("parent = " + elem.parent); |
---|
4140 | 4476 | // tmp.addChild(elem); |
---|
4141 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4477 | + if (Grafreed.clipboardIsTempGroup) |
---|
4142 | 4478 | tGroup.add/*Child*/(tmp); |
---|
4143 | 4479 | else |
---|
4144 | | - GraphreeD.clipboard = tmp; |
---|
| 4480 | + Grafreed.clipboard = tmp; |
---|
4145 | 4481 | } |
---|
4146 | 4482 | else |
---|
4147 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4483 | + if (Grafreed.clipboardIsTempGroup) |
---|
4148 | 4484 | tGroup.add/*Child*/(child); |
---|
4149 | 4485 | else |
---|
4150 | | - GraphreeD.clipboard = child; |
---|
| 4486 | + Grafreed.clipboard = child; |
---|
4151 | 4487 | } |
---|
4152 | 4488 | |
---|
4153 | 4489 | } |
---|
4154 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
4155 | | - GraphreeD.clipboard = tGroup; |
---|
| 4490 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4491 | + Grafreed.clipboard = tGroup; |
---|
4156 | 4492 | if (cut) |
---|
4157 | 4493 | { |
---|
4158 | 4494 | ResetModel(); |
---|
.. | .. |
---|
4162 | 4498 | |
---|
4163 | 4499 | void paste(boolean expand) |
---|
4164 | 4500 | { |
---|
4165 | | - // if (GraphreeD.clipboard == null) |
---|
| 4501 | + // if (GrafreeD.clipboard == null) |
---|
4166 | 4502 | // return; |
---|
4167 | 4503 | boolean first = true; |
---|
4168 | 4504 | |
---|
4169 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4505 | + if (Grafreed.clipboardIsTempGroup) |
---|
4170 | 4506 | { |
---|
4171 | 4507 | Composite temp; |
---|
4172 | 4508 | |
---|
.. | .. |
---|
4177 | 4513 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4178 | 4514 | */ |
---|
4179 | 4515 | Object3D elem; |
---|
4180 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4516 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4181 | 4517 | { |
---|
4182 | 4518 | Object3D child = (Object3D)e.nextElement(); |
---|
4183 | 4519 | |
---|
.. | .. |
---|
4191 | 4527 | else |
---|
4192 | 4528 | elem = child.deepCopy(); // ? |
---|
4193 | 4529 | child.parent = keepparent; |
---|
4194 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4530 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4195 | 4531 | // elem = elem.get(0); |
---|
4196 | 4532 | makeSomething(elem, true); // ?? first); |
---|
4197 | 4533 | //group.addChild(elem); |
---|
.. | .. |
---|
4211 | 4547 | //Object3D cb = Applet3D.clipboard; |
---|
4212 | 4548 | //temp.addChild(cb); |
---|
4213 | 4549 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4214 | | - assert(GraphreeD.clipboard.parent == null); |
---|
4215 | | - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent; |
---|
4216 | | - GraphreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4217 | | - if (LA.isIdentity(GraphreeD.clipboard.toParent)) |
---|
4218 | | - makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy()); |
---|
| 4550 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4551 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 4552 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4553 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 4554 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4219 | 4555 | else |
---|
4220 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4221 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4556 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 4557 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4222 | 4558 | } |
---|
4223 | 4559 | |
---|
4224 | 4560 | ResetModel(); |
---|
4225 | 4561 | refreshContents(); |
---|
4226 | 4562 | } |
---|
4227 | 4563 | |
---|
4228 | | - void pasteInto(boolean copyit) |
---|
| 4564 | + void pasteInto(boolean copyit, boolean clone) |
---|
4229 | 4565 | { |
---|
4230 | | -// if (GraphreeD.clipboard == null) |
---|
| 4566 | +// if (GrafreeD.clipboard == null) |
---|
4231 | 4567 | // return; |
---|
4232 | 4568 | |
---|
4233 | 4569 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4254 | 4590 | if (copyit) |
---|
4255 | 4591 | { |
---|
4256 | 4592 | // paste(false); |
---|
4257 | | - CloneClipboard(false); // sept 2014 |
---|
| 4593 | + if (clone) |
---|
| 4594 | + { |
---|
| 4595 | + CloneClipboard(false); // sept 2014 |
---|
| 4596 | + } |
---|
| 4597 | + else |
---|
| 4598 | + { |
---|
| 4599 | + paste(false); |
---|
| 4600 | + } |
---|
4258 | 4601 | } |
---|
4259 | 4602 | else |
---|
4260 | 4603 | { |
---|
4261 | 4604 | boolean first = true; |
---|
4262 | 4605 | |
---|
4263 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4606 | + if (Grafreed.clipboardIsTempGroup) |
---|
4264 | 4607 | { |
---|
4265 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 4608 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4266 | 4609 | Object3D copy; |
---|
4267 | 4610 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4268 | 4611 | { |
---|
.. | .. |
---|
4272 | 4615 | } |
---|
4273 | 4616 | } else |
---|
4274 | 4617 | { |
---|
4275 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 4618 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4276 | 4619 | } |
---|
4277 | 4620 | } |
---|
4278 | 4621 | } |
---|
.. | .. |
---|
4464 | 4807 | makeSomething(csg); |
---|
4465 | 4808 | } |
---|
4466 | 4809 | |
---|
| 4810 | + void Ungroup(Object3D g) |
---|
| 4811 | + { |
---|
| 4812 | + if (g instanceof HiddenObject) |
---|
| 4813 | + { |
---|
| 4814 | + HiddenObject h = (HiddenObject) g; |
---|
| 4815 | + |
---|
| 4816 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 4817 | + { |
---|
| 4818 | + objEditor.makeSomething(h.get(i), false); |
---|
| 4819 | + } |
---|
| 4820 | + } |
---|
| 4821 | + else |
---|
| 4822 | + { |
---|
| 4823 | + for (int i=0; i<g.Size(); i++) |
---|
| 4824 | + { |
---|
| 4825 | + objEditor.makeSomething(g.get(i), false); |
---|
| 4826 | + } |
---|
| 4827 | + } |
---|
| 4828 | + } |
---|
| 4829 | + |
---|
4467 | 4830 | void ungroup() |
---|
4468 | 4831 | { |
---|
4469 | 4832 | /* |
---|
.. | .. |
---|
4657 | 5020 | } |
---|
4658 | 5021 | */ |
---|
4659 | 5022 | |
---|
4660 | | - void ImportGFD() |
---|
4661 | | - { |
---|
4662 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD); |
---|
4663 | | - browser.show(); |
---|
4664 | | - String filename = browser.getFile(); |
---|
4665 | | - if (filename != null && filename.length() > 0) |
---|
4666 | | - { |
---|
4667 | | - String fullname = browser.getDirectory() + filename; |
---|
4668 | | - |
---|
4669 | | - //Object3D readobj = |
---|
4670 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4671 | | - //makeSomething(readobj); |
---|
4672 | | - } |
---|
4673 | | - } |
---|
4674 | | - |
---|
4675 | 5023 | /* |
---|
4676 | 5024 | public void Callback(Object obj) |
---|
4677 | 5025 | { |
---|
.. | .. |
---|
4695 | 5043 | } |
---|
4696 | 5044 | */ |
---|
4697 | 5045 | |
---|
4698 | | - void ImportVRMLX3D() |
---|
4699 | | - { |
---|
4700 | | - if (GraphreeD.standAlone) |
---|
4701 | | - { |
---|
4702 | | - /**/ |
---|
4703 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4704 | | - browser.show(); |
---|
4705 | | - String filename = browser.getFile(); |
---|
4706 | | - if (filename != null && filename.length() > 0) |
---|
4707 | | - { |
---|
4708 | | - String fullname = browser.getDirectory() + filename; |
---|
4709 | | - LoadVRMLX3D(fullname); |
---|
4710 | | - } |
---|
4711 | | - /**/ |
---|
4712 | | - } |
---|
4713 | | - } |
---|
4714 | | - |
---|
4715 | 5046 | String GetFile(String dialogName) |
---|
4716 | 5047 | { |
---|
4717 | | - if (GraphreeD.standAlone) |
---|
| 5048 | + if (Grafreed.standAlone) |
---|
4718 | 5049 | { |
---|
4719 | 5050 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4720 | 5051 | browser.show(); |
---|
.. | .. |
---|
4778 | 5109 | cButton flashSelectionButton; |
---|
4779 | 5110 | cButton editButton; |
---|
4780 | 5111 | cButton uneditButton; |
---|
| 5112 | + JCheckBox allParamsButton; |
---|
4781 | 5113 | cButton clearpanelButton; |
---|
4782 | | - cButton allParamsButton; |
---|
4783 | 5114 | cButton unselectButton; |
---|
4784 | 5115 | |
---|
| 5116 | + cButton oneStepButton; |
---|
| 5117 | + |
---|
4785 | 5118 | cButton screenfitButton; |
---|
4786 | 5119 | cButton screenfitpointButton; |
---|
4787 | 5120 | cButton snapobjectButton; |
---|
.. | .. |
---|
4823 | 5156 | private MenuItem resetsupportItem; |
---|
4824 | 5157 | private MenuItem resetreferencesItem; |
---|
4825 | 5158 | private MenuItem linkverticesItem; |
---|
| 5159 | + private MenuItem relinkverticesItem; |
---|
4826 | 5160 | private MenuItem setMasterItem; |
---|
4827 | | - private MenuItem resetMeshItem; |
---|
| 5161 | + private MenuItem resetAllItem; |
---|
4828 | 5162 | private MenuItem stepAllItem; |
---|
4829 | 5163 | private MenuItem revertMeshItem; |
---|
4830 | 5164 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4835 | 5169 | private MenuItem mergeGeometriesItem; |
---|
4836 | 5170 | private MenuItem copyItem; |
---|
4837 | 5171 | private MenuItem pasteItem; |
---|
| 5172 | + private MenuItem pasteIntoItem; |
---|
4838 | 5173 | private MenuItem pasteLinkItem; |
---|
4839 | 5174 | private MenuItem pasteCloneItem; |
---|
4840 | 5175 | private MenuItem pasteExpandItem; |
---|
4841 | 5176 | private MenuItem clearItem; |
---|
4842 | 5177 | private MenuItem clearAllItem; |
---|
4843 | 5178 | private MenuItem genUVItem; |
---|
| 5179 | + private MenuItem genNormalsMESHItem; |
---|
4844 | 5180 | private MenuItem genNormalsCADItem; |
---|
4845 | 5181 | private MenuItem genNormalsORGANItem; |
---|
| 5182 | + private MenuItem genNormalsMINEItem; |
---|
4846 | 5183 | private MenuItem stripifyItem; |
---|
4847 | 5184 | private MenuItem unstripifyItem; |
---|
4848 | 5185 | private MenuItem trimItem; |
---|
.. | .. |
---|
4882 | 5219 | private MenuItem panoTexturesItem; |
---|
4883 | 5220 | |
---|
4884 | 5221 | private MenuItem resetCentroidItem; |
---|
4885 | | - private MenuItem transformgeometryItem; |
---|
| 5222 | + private MenuItem resetCentroidXZItem; |
---|
4886 | 5223 | private MenuItem resetTransformItem; |
---|
| 5224 | + private MenuItem transformGeometryItem; |
---|
| 5225 | + private MenuItem transformChildrenItem; |
---|
| 5226 | + private MenuItem hideItem; |
---|
4887 | 5227 | private MenuItem grabItem; |
---|
4888 | 5228 | private MenuItem backItem; |
---|
4889 | 5229 | private MenuItem frontItem; |
---|
.. | .. |
---|
4904 | 5244 | |
---|
4905 | 5245 | private MenuItem resetParentItem; |
---|
4906 | 5246 | private MenuItem repairParentItem; |
---|
| 5247 | + private MenuItem repairShadowItem; |
---|
4907 | 5248 | private MenuItem sortbysizeItem; |
---|
4908 | 5249 | private MenuItem sortbynameItem; |
---|
4909 | 5250 | |
---|
.. | .. |
---|
4924 | 5265 | private MenuItem coneItem; |
---|
4925 | 5266 | private MenuItem torusItem; |
---|
4926 | 5267 | private MenuItem superItem; |
---|
| 5268 | + private MenuItem kleinItem; |
---|
4927 | 5269 | private MenuItem blobItem; |
---|
4928 | 5270 | private MenuItem latheItem; |
---|
4929 | 5271 | private MenuItem bezierItem; |
---|
4930 | | - private MenuItem checkerItem; |
---|
| 5272 | + private MenuItem overlayItem; |
---|
4931 | 5273 | private MenuItem meshItem; |
---|
4932 | 5274 | // private MenuItem meshGroupItem; |
---|
4933 | 5275 | private MenuItem springItem; |
---|
.. | .. |
---|
4936 | 5278 | private MenuItem csgItem; |
---|
4937 | 5279 | private MenuItem templateItem; |
---|
4938 | 5280 | private MenuItem textureItem; |
---|
| 5281 | + private MenuItem billboardItem; |
---|
4939 | 5282 | private MenuItem shadowXItem; |
---|
4940 | 5283 | private MenuItem shadowYItem; |
---|
4941 | 5284 | private MenuItem shadowZItem; |
---|
.. | .. |
---|
4948 | 5291 | private MenuItem doubleItem; |
---|
4949 | 5292 | private MenuItem tripleItem; |
---|
4950 | 5293 | |
---|
4951 | | - private MenuItem importGFDItem; |
---|
4952 | | - private MenuItem importVRMLX3DItem; |
---|
4953 | | - private MenuItem import3DSItem; |
---|
4954 | | - private MenuItem importOBJItem; |
---|
4955 | | - |
---|
4956 | 5294 | private MenuItem computeAOItem; |
---|
4957 | 5295 | private MenuItem recompileItem; |
---|
4958 | 5296 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
4962 | 5300 | private MenuItem analyzeItem; |
---|
4963 | 5301 | private MenuItem dumpItem; |
---|
4964 | 5302 | //boolean freezemodel = false; |
---|
| 5303 | + |
---|
| 5304 | + Menu cameraMenu; |
---|
| 5305 | + MenuItem editCameraItem; |
---|
| 5306 | + MenuItem revertCameraItem; |
---|
4965 | 5307 | } |
---|