.. | .. |
---|
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 | { |
---|
| 87 | + if (Globals.SAVEONMAKE) |
---|
| 88 | + Save(); |
---|
| 89 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 90 | + Globals.SAVEONMAKE = false; |
---|
86 | 91 | // Object3D keep = GrafreeD.clipboard; |
---|
87 | 92 | //Object3D obj; |
---|
88 | 93 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
93 | 98 | |
---|
94 | 99 | makeSomething(clone, i==group.selection.size()-1); |
---|
95 | 100 | } |
---|
| 101 | + Globals.SAVEONMAKE = keep; |
---|
96 | 102 | } |
---|
97 | 103 | |
---|
98 | 104 | void CloneClipboard(boolean supports) |
---|
99 | 105 | { |
---|
100 | | - assert(GrafreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
102 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
104 | | - makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
| 106 | + assert(Grafreed.clipboard.parent == null); |
---|
| 107 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 108 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 109 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 110 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
105 | 111 | else |
---|
106 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
107 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 112 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 113 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 114 | } |
---|
109 | 115 | |
---|
110 | 116 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 124 | // obj.support = null; |
---|
119 | 125 | if (!supports) |
---|
120 | 126 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 127 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 128 | obj.parent = parent; |
---|
123 | 129 | // obj.support = support; |
---|
124 | 130 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
147 | 153 | |
---|
148 | 154 | //JTextField nameField; |
---|
149 | 155 | |
---|
150 | | - void SetupMenu2(ObjEditor oe) |
---|
| 156 | + void SetupMenu2(GroupEditor oe) |
---|
151 | 157 | { |
---|
152 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
155 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
156 | | - oe.cameraMenu.add("-"); |
---|
157 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
158 | | - openWindowItem.addActionListener(this); |
---|
159 | | - editLeafItem.addActionListener(this); |
---|
160 | | - lookAtItem.addActionListener(this); |
---|
161 | | - //lookFromItem.addActinoListener(this); |
---|
162 | | - //switchItem.addActionListener(this); |
---|
| 158 | + oe.jTree = new cTree(); |
---|
| 159 | + |
---|
163 | 160 | Menu menu; |
---|
164 | 161 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | 162 | //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | 163 | //editItem.addActionListener(this); |
---|
167 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 164 | + |
---|
| 165 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 166 | +// undoItem.addActionListener(this); |
---|
| 167 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 168 | +// redoItem.addActionListener(this); |
---|
| 169 | +// menu.add("-"); |
---|
| 170 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
168 | 171 | duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | 172 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | 173 | cloneItem.addActionListener(this); |
---|
| 174 | + if (Globals.ADVANCED) |
---|
| 175 | + { |
---|
172 | 176 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | 177 | cloneSupportItem.addActionListener(this); |
---|
| 178 | + } |
---|
174 | 179 | menu.add("-"); |
---|
175 | 180 | cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | 181 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
178 | 183 | copyItem.addActionListener(this); |
---|
179 | 184 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | 185 | pasteItem.addActionListener(this); |
---|
| 186 | + |
---|
| 187 | + menu.add("-"); |
---|
| 188 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 189 | + pasteIntoItem.addActionListener(this); |
---|
181 | 190 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | 191 | pasteLinkItem.addActionListener(this); |
---|
183 | 192 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | 193 | pasteCloneItem.addActionListener(this); |
---|
185 | 194 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | 195 | // pasteExpandItem.addActionListener(this); |
---|
| 196 | + menu.add("-"); |
---|
187 | 197 | clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | 198 | clearItem.addActionListener(this); |
---|
| 199 | + |
---|
| 200 | + if (Globals.ADVANCED) |
---|
| 201 | + { |
---|
| 202 | + // Deletes the cameras... |
---|
189 | 203 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | 204 | clearAllItem.addActionListener(this); |
---|
| 205 | + } |
---|
| 206 | + |
---|
| 207 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 208 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 209 | + //zBufferItem.addActionListener(this); |
---|
| 210 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 211 | + //normalLensItem.addActionListener(this); |
---|
| 212 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 213 | + restoreCameraItem.addActionListener(this); |
---|
| 214 | + |
---|
| 215 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 216 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 217 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 218 | +// cameraMenu.add("-"); |
---|
| 219 | +// |
---|
| 220 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 221 | +// toggleTextureItem.addItemListener(this); |
---|
| 222 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 223 | +// |
---|
| 224 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 225 | +// toggleSwitchItem.addItemListener(this); |
---|
| 226 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 227 | + |
---|
| 228 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 229 | + toggleHandleItem.addItemListener(this); |
---|
| 230 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 231 | + |
---|
| 232 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 233 | + togglePaintItem.addItemListener(this); |
---|
| 234 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 235 | + |
---|
| 236 | + if (Globals.ADVANCED) |
---|
| 237 | + { |
---|
| 238 | + cameraMenu.add("-"); |
---|
| 239 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 240 | + toggleLiveItem.addItemListener(this); |
---|
| 241 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
191 | 242 | |
---|
| 243 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 244 | + stepItem.addActionListener(this); |
---|
| 245 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 246 | + // toggleDLItem.addItemListener(this); |
---|
| 247 | + // toggleDLItem.setState(false); |
---|
| 248 | + |
---|
| 249 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 250 | + toggleRenderItem.addItemListener(this); |
---|
| 251 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 252 | + |
---|
| 253 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 254 | + toggleDebugItem.addItemListener(this); |
---|
| 255 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 256 | + |
---|
| 257 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 258 | + toggleFrustumItem.addItemListener(this); |
---|
| 259 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 260 | + |
---|
| 261 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 262 | + toggleFootContactItem.addItemListener(this); |
---|
| 263 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 264 | + |
---|
| 265 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 266 | + toggleTimelineItem.addItemListener(this); |
---|
| 267 | + } |
---|
| 268 | + |
---|
| 269 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 270 | +// toggleRootItem.addItemListener(this); |
---|
| 271 | +// toggleRootItem.setState(false); |
---|
| 272 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 273 | +// animationItem.addItemListener(this); |
---|
| 274 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 275 | + cameraMenu.add("-"); |
---|
| 276 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 277 | + editCameraItem.addActionListener(this); |
---|
| 278 | + |
---|
| 279 | + if (Globals.ADVANCED) |
---|
| 280 | + { |
---|
| 281 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 282 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 283 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 284 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 285 | + oe.cameraMenu.add("-"); |
---|
| 286 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 287 | + openWindowItem.addActionListener(this); |
---|
| 288 | + editLeafItem.addActionListener(this); |
---|
| 289 | + lookAtItem.addActionListener(this); |
---|
| 290 | + //lookFromItem.addActinoListener(this); |
---|
| 291 | + //switchViewItem.addActionListener(this); |
---|
| 292 | + } |
---|
| 293 | + |
---|
192 | 294 | 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); |
---|
| 295 | + if (Globals.ADVANCED) |
---|
| 296 | + { |
---|
197 | 297 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 298 | revertMeshItem.addActionListener(this); |
---|
199 | 299 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 300 | resetreferencesItem.addActionListener(this); |
---|
201 | 301 | menu.add("-"); |
---|
| 302 | + } |
---|
202 | 303 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 304 | overwriteGeoItem.addActionListener(this); |
---|
204 | 305 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 311 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 312 | overwriteUVItem.addActionListener(this); |
---|
212 | 313 | menu.add("-"); |
---|
| 314 | + if (Globals.ADVANCED) |
---|
| 315 | + { |
---|
213 | 316 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 317 | generateMeshItem.addActionListener(this); |
---|
215 | 318 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 319 | poseMeshItem.addActionListener(this); |
---|
217 | 320 | menu.add("-"); |
---|
| 321 | + } |
---|
218 | 322 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 323 | resetsupportItem.addActionListener(this); |
---|
220 | 324 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 325 | linkverticesItem.addActionListener(this); |
---|
222 | 326 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 327 | relinkverticesItem.addActionListener(this); |
---|
| 328 | + |
---|
| 329 | + if (Globals.ADVANCED) |
---|
| 330 | + { |
---|
224 | 331 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 332 | setMasterItem.addActionListener(this); |
---|
| 333 | + } |
---|
226 | 334 | |
---|
227 | 335 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
229 | | - grabItem.addActionListener(this); |
---|
| 336 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 337 | +// grabItem.addActionListener(this); |
---|
230 | 338 | backItem = menu.add(new MenuItem("Back")); |
---|
231 | 339 | backItem.addActionListener(this); |
---|
232 | 340 | frontItem = menu.add(new MenuItem("Front")); |
---|
233 | 341 | frontItem.addActionListener(this); |
---|
234 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | | - compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 342 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 343 | +// compositeItem.addActionListener(this); |
---|
| 344 | + |
---|
| 345 | + if (Globals.ADVANCED) |
---|
| 346 | + { |
---|
| 347 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 348 | hideItem.addActionListener(this); |
---|
| 349 | + } |
---|
238 | 350 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 351 | ungroupItem.addActionListener(this); |
---|
240 | | - menu.add("-"); |
---|
241 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
242 | | - randomItem.addActionListener(this); |
---|
243 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
244 | | - physicsItem.addActionListener(this); |
---|
245 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
246 | | - frameselectorItem.addActionListener(this); |
---|
| 352 | + |
---|
| 353 | +// menu.add("-"); |
---|
| 354 | +// |
---|
| 355 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 356 | +// switchItem.addActionListener(this); |
---|
| 357 | + if (Globals.ADVANCED) |
---|
| 358 | + { |
---|
247 | 359 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 360 | switchGeoItem.addActionListener(this); |
---|
249 | 361 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 362 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 363 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 364 | morphItem.addActionListener(this); |
---|
| 365 | + |
---|
| 366 | + menu.add("-"); |
---|
| 367 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 368 | + physicsItem.addActionListener(this); |
---|
| 369 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 370 | + frameselectorItem.addActionListener(this); |
---|
253 | 371 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 372 | scriptNodeItem.addActionListener(this); |
---|
255 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | | - cameraItem.addActionListener(this); |
---|
| 373 | + } |
---|
257 | 374 | |
---|
258 | 375 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
260 | | - textureItem.addActionListener(this); |
---|
| 376 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 377 | +// textureItem.addActionListener(this); |
---|
261 | 378 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
262 | 379 | billboardItem.addActionListener(this); |
---|
263 | 380 | csgItem = menu.add(new MenuItem("CSG")); |
---|
264 | 381 | csgItem.addActionListener(this); |
---|
265 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 382 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
266 | 383 | shadowXItem.addActionListener(this); |
---|
267 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 384 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
268 | 385 | shadowYItem.addActionListener(this); |
---|
269 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 386 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
270 | 387 | shadowZItem.addActionListener(this); |
---|
| 388 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 389 | + attributeItem.addActionListener(this); |
---|
| 390 | + |
---|
| 391 | + if (Globals.ADVANCED) |
---|
| 392 | + { |
---|
| 393 | + menu.add("-"); |
---|
271 | 394 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 395 | linkerItem.addActionListener(this); |
---|
273 | 396 | templateItem = menu.add(new MenuItem("Template")); |
---|
274 | 397 | templateItem.addActionListener(this); |
---|
275 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | | - attributeItem.addActionListener(this); |
---|
277 | 398 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 399 | pointflowItem.addActionListener(this); |
---|
| 400 | + } |
---|
279 | 401 | menu.add("-"); |
---|
280 | 402 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 403 | resetTransformItem.addActionListener(this); |
---|
282 | 404 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
283 | 405 | resetCentroidItem.addActionListener(this); |
---|
284 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
285 | | - transformgeometryItem.addActionListener(this); |
---|
| 406 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 407 | + resetCentroidXZItem.addActionListener(this); |
---|
| 408 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 409 | + transformGeometryItem.addActionListener(this); |
---|
| 410 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 411 | + transformChildrenItem.addActionListener(this); |
---|
286 | 412 | |
---|
287 | 413 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
288 | 414 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
293 | 419 | genNormalsCADItem.addActionListener(this); |
---|
294 | 420 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 421 | genNormalsMESHItem.addActionListener(this); |
---|
| 422 | + if (Globals.ADVANCED) |
---|
| 423 | + { |
---|
296 | 424 | genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
297 | 425 | genNormalsMINEItem.addActionListener(this); |
---|
| 426 | + } |
---|
298 | 427 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 428 | stripifyItem.addActionListener(this); |
---|
300 | 429 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 445 | reduce34MeshItem.addActionListener(this); |
---|
317 | 446 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 447 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 448 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 449 | clipMeshItem.addActionListener(this); |
---|
| 450 | + |
---|
| 451 | + if (Globals.ADVANCED) |
---|
| 452 | + { |
---|
| 453 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 454 | + smoothMeshItem.addActionListener(this); |
---|
| 455 | + } |
---|
323 | 456 | |
---|
324 | 457 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 458 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
326 | 459 | clearMaterialsItem.addActionListener(this); |
---|
| 460 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 461 | + resetAllItem.addActionListener(this); |
---|
| 462 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 463 | + stepAllItem.addActionListener(this); |
---|
327 | 464 | menu.add("-"); |
---|
328 | 465 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
329 | 466 | liveleavesItem.addActionListener(this); |
---|
330 | 467 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 468 | unliveleavesItem.addActionListener(this); |
---|
| 469 | + if (Globals.ADVANCED) |
---|
| 470 | + { |
---|
332 | 471 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 472 | supportleavesItem.addActionListener(this); |
---|
334 | 473 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 474 | unsupportleavesItem.addActionListener(this); |
---|
| 475 | + } |
---|
336 | 476 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 477 | hideleavesItem.addActionListener(this); |
---|
338 | 478 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
341 | 481 | markleavesItem.addActionListener(this); |
---|
342 | 482 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
343 | 483 | unmarkleavesItem.addActionListener(this); |
---|
| 484 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 485 | + rewindleavesItem.addActionListener(this); |
---|
| 486 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 487 | + unrewindleavesItem.addActionListener(this); |
---|
| 488 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 489 | + randomleavesItem.addActionListener(this); |
---|
| 490 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 491 | + unrandomleavesItem.addActionListener(this); |
---|
344 | 492 | menu.add("-"); |
---|
345 | 493 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
346 | 494 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
376 | 524 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 525 | sortbynameItem.addActionListener(this); |
---|
378 | 526 | menu.add("-"); |
---|
| 527 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 528 | + shareGeometriesItem.addActionListener(this); |
---|
| 529 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 530 | + mergeGeometriesItem.addActionListener(this); |
---|
| 531 | + if (Globals.ADVANCED) |
---|
| 532 | + { |
---|
| 533 | + // Pretty much the same as duplicate and clone. |
---|
379 | 534 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 535 | extractGeometriesItem.addActionListener(this); |
---|
381 | 536 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
382 | 537 | cloneGeometriesItem.addActionListener(this); |
---|
383 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
384 | | - shareGeometriesItem.addActionListener(this); |
---|
385 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
386 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 538 | + } |
---|
387 | 539 | |
---|
388 | 540 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 541 | buildCreateMenu(menu); |
---|
390 | 542 | |
---|
391 | | - |
---|
392 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
393 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
394 | | - importGFDItem.addActionListener(this); |
---|
395 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
396 | | - importVRMLX3DItem.addActionListener(this); |
---|
397 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
398 | | - importOBJItem.addActionListener(this); |
---|
399 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
400 | | - import3DSItem.addActionListener(this); |
---|
401 | | - |
---|
402 | 543 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 544 | buildToolsMenu(menu); |
---|
404 | 545 | } |
---|
405 | 546 | |
---|
406 | 547 | void SetupUI2(ObjEditor oe) |
---|
407 | 548 | { |
---|
| 549 | + // June 2019 |
---|
| 550 | + if (oe == null) |
---|
| 551 | + { |
---|
| 552 | + //super.SetupUI2(this); |
---|
| 553 | + //return; |
---|
| 554 | + } |
---|
| 555 | + |
---|
| 556 | + if (copy != group) |
---|
| 557 | + { |
---|
| 558 | + //super.SetupUI2(this); |
---|
| 559 | + } |
---|
| 560 | + |
---|
408 | 561 | //new Exception().printStackTrace(); |
---|
409 | 562 | |
---|
410 | 563 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
433 | 586 | oe.radioPanel.add(dummyButton); |
---|
434 | 587 | oe.buttonGroup.add(dummyButton); |
---|
435 | 588 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
437 | | - oe.aConstraints.gridwidth = 1; |
---|
438 | | - oe.aConstraints.gridx = 0; |
---|
| 589 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 590 | + |
---|
| 591 | + copyOptionsPanel.preferredHeight = 1; |
---|
439 | 592 | |
---|
440 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 593 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
| 594 | + |
---|
| 595 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + //minButton.setToolTipText("Minimize window"); |
---|
| 597 | + //minButton.addActionListener(this); |
---|
| 598 | + |
---|
| 599 | + if (Globals.ADVANCED) |
---|
| 600 | + { |
---|
| 601 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 602 | + maxButton.setToolTipText("Maximize window"); |
---|
| 603 | + maxButton.addActionListener(this); |
---|
| 604 | + } |
---|
| 605 | + |
---|
| 606 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 607 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 608 | + fullButton.addActionListener(this); |
---|
| 609 | + |
---|
| 610 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 611 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 612 | + screenfitButton.addActionListener(this); |
---|
| 613 | + |
---|
| 614 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 615 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 616 | + restoreCameraButton.addActionListener(this); |
---|
| 617 | + |
---|
| 618 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 619 | + undoButton.setToolTipText("Undo changes"); |
---|
| 620 | + undoButton.addActionListener(this); |
---|
| 621 | + undoButton.setEnabled(false); |
---|
| 622 | + |
---|
| 623 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 624 | + redoButton.setToolTipText("Redo changes"); |
---|
| 625 | + redoButton.addActionListener(this); |
---|
| 626 | + redoButton.setEnabled(false); |
---|
| 627 | + |
---|
| 628 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 629 | + saveButton.setToolTipText("Save changes"); |
---|
| 630 | + saveButton.addActionListener(this); |
---|
| 631 | + |
---|
| 632 | + copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 633 | + liveCB.setToolTipText("Enable animation"); |
---|
441 | 634 | liveCB.addItemListener(this); |
---|
442 | 635 | |
---|
443 | | - oe.aConstraints.gridx += 1; |
---|
444 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
445 | | - supportCB.addItemListener(this); |
---|
446 | | - |
---|
447 | | - // oe.aConstraints.gridx += 1; |
---|
448 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
449 | | - // localCB.addItemListener(this); |
---|
450 | | - |
---|
451 | | - oe.aConstraints.gridx += 1; |
---|
452 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
453 | | - crowdCB.addItemListener(this); |
---|
454 | | - |
---|
455 | | - oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
457 | | - smoothCB.addItemListener(this); |
---|
458 | | - |
---|
459 | | - oe.aConstraints.gridx += 1; |
---|
460 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 636 | + copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 637 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 638 | + oneStepButton.addActionListener(this); |
---|
| 639 | + |
---|
| 640 | + copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 641 | + fastCB.setToolTipText("Fast mode"); |
---|
461 | 642 | fastCB.addItemListener(this); |
---|
462 | | - oe.aConstraints.gridx += 1; |
---|
463 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
464 | | - slowCB.addItemListener(this); |
---|
465 | | - oe.aConstraints.gridx += 1; |
---|
466 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
467 | | - boxCB.addItemListener(this); |
---|
| 643 | + |
---|
| 644 | + //oe.toolboxPanel.Return(); |
---|
| 645 | + |
---|
| 646 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 647 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 648 | +// trackCB.addItemListener(this); |
---|
468 | 649 | |
---|
469 | | -// oe.aConstraints.gridx += 1; |
---|
470 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
471 | | -// speakerMocapCB.addItemListener(this); |
---|
472 | | - |
---|
473 | | - if (false) |
---|
474 | | - { |
---|
475 | | - // handled in scripts |
---|
476 | | - oe.aConstraints.gridx += 1; |
---|
477 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
478 | | - speakerCameraCB.addItemListener(this); |
---|
479 | | - |
---|
480 | | - oe.aConstraints.gridx += 1; |
---|
481 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
482 | | - speakerFocusCB.addItemListener(this); |
---|
483 | | - |
---|
484 | | - oe.aConstraints.gridx += 1; |
---|
485 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
486 | | - smoothfocusCB.addItemListener(this); |
---|
487 | | - } |
---|
488 | | - |
---|
489 | | -//oe.aConstraints.gridx += 1; |
---|
490 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
491 | | -// debugCB.addItemListener(this); |
---|
492 | | - |
---|
493 | | - oe.aConstraints.gridx += 1; |
---|
494 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
495 | | - oeilCB.addItemListener(this); |
---|
496 | | - |
---|
497 | | - oe.aConstraints.gridx += 1; |
---|
498 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
499 | | - lookAtCB.addItemListener(this); |
---|
500 | | - |
---|
501 | | - oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
503 | | - trackCB.addItemListener(this); |
---|
504 | | - |
---|
505 | | - oe.aConstraints.gridx += 1; |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
507 | | - screenfitButton.addActionListener(this); |
---|
508 | | - oe.aConstraints.gridx += 1; |
---|
509 | 650 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
510 | 651 | // screenfitpointButton.addActionListener(this); |
---|
511 | | -// oe.aConstraints.gridx += 1; |
---|
512 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
513 | | - snapobjectButton.addActionListener(this); |
---|
514 | | - oe.aConstraints.gridx += 1; |
---|
515 | 652 | |
---|
516 | | - //aConstraints.gridx = 0; |
---|
517 | | - //aConstraints.gridy += 1; |
---|
518 | | - oe.aConstraints.weighty = 0; |
---|
519 | | - oe.aConstraints.gridwidth = 1; |
---|
520 | | - |
---|
521 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
522 | | - flashSelectionButton.addActionListener(this); |
---|
| 653 | + if (Globals.ADVANCED) |
---|
| 654 | + { |
---|
| 655 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 656 | + snapobjectButton.addActionListener(this); |
---|
| 657 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 658 | + } |
---|
| 659 | + |
---|
| 660 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
523 | 661 | |
---|
524 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
525 | | - |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - // |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 663 | + twoButton.setToolTipText("Show center view only"); |
---|
532 | 664 | twoButton.addActionListener(this); |
---|
533 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 665 | + this.fullscreenLayout = twoButton; |
---|
| 666 | + |
---|
| 667 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
534 | 668 | fourButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 669 | + fourButton.setToolTipText("Show left panel only"); |
---|
| 670 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 671 | + sixButton.setToolTipText("2-column layout left"); |
---|
536 | 672 | sixButton.addActionListener(this); |
---|
537 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 673 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 674 | + threeButton.setToolTipText("2-column layout right"); |
---|
538 | 675 | threeButton.addActionListener(this); |
---|
539 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 676 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 677 | + sevenButton.setToolTipText("3-column layout"); |
---|
540 | 678 | sevenButton.addActionListener(this); |
---|
541 | 679 | // |
---|
542 | 680 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 681 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
544 | 683 | rootButton.addActionListener(this); |
---|
545 | | - oe.aConstraints.gridx += 1; |
---|
546 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 684 | + |
---|
| 685 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 686 | + closeButton.setToolTipText("Close tab"); |
---|
547 | 687 | closeButton.addActionListener(this); |
---|
548 | 688 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
549 | 689 | //clearButton.addActionListener(this); |
---|
550 | | - oe.aConstraints.gridx += 1; |
---|
551 | | - |
---|
552 | | - oe.aConstraints.gridx = 1; // |
---|
553 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
554 | | - editButton.addActionListener(this); |
---|
555 | | - oe.aConstraints.gridx += 1; |
---|
556 | | - oe.aConstraints.weighty = 0; |
---|
557 | | - oe.aConstraints.gridwidth = 1; |
---|
558 | 690 | |
---|
559 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 691 | + // INSERT |
---|
| 692 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 693 | + gridButton.setToolTipText("Create grid"); |
---|
| 694 | + gridButton.addActionListener(this); |
---|
| 695 | + |
---|
| 696 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 697 | + boxButton.setToolTipText("Create box"); |
---|
| 698 | + boxButton.addActionListener(this); |
---|
| 699 | + |
---|
| 700 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 701 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 702 | + sphereButton.addActionListener(this); |
---|
| 703 | + |
---|
| 704 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 705 | + coneButton.setToolTipText("Create cone"); |
---|
| 706 | + coneButton.addActionListener(this); |
---|
| 707 | + |
---|
| 708 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 709 | + torusButton.setToolTipText("Create torus"); |
---|
| 710 | + torusButton.addActionListener(this); |
---|
| 711 | + |
---|
| 712 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 713 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 714 | + superButton.addActionListener(this); |
---|
| 715 | + |
---|
| 716 | + if (Globals.ADVANCED) |
---|
| 717 | + { |
---|
| 718 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 719 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 720 | + kleinButton.addActionListener(this); |
---|
| 721 | + } |
---|
| 722 | + |
---|
| 723 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 724 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 725 | + particlesButton.addActionListener(this); |
---|
| 726 | + |
---|
| 727 | + oe.toolboxPanel.Return(); |
---|
| 728 | + |
---|
| 729 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 730 | + groupButton.setToolTipText("Create group"); |
---|
| 731 | + groupButton.addActionListener(this); |
---|
| 732 | + |
---|
| 733 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 734 | + compositeButton.setToolTipText("Create composite"); |
---|
| 735 | + compositeButton.addActionListener(this); |
---|
| 736 | + |
---|
| 737 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 738 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 739 | + switchButton.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 742 | + loopButton.setToolTipText("Create loop"); |
---|
| 743 | + loopButton.addActionListener(this); |
---|
| 744 | + |
---|
| 745 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 746 | + textureButton.setToolTipText("Create texture"); |
---|
| 747 | + textureButton.addActionListener(this); |
---|
| 748 | + |
---|
| 749 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 750 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 751 | + overlayButton.addActionListener(this); |
---|
| 752 | + |
---|
| 753 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 754 | + lightButton.setToolTipText("Create light"); |
---|
| 755 | + lightButton.addActionListener(this); |
---|
| 756 | + |
---|
| 757 | + for (int i=6; --i>=0;) |
---|
| 758 | + { |
---|
| 759 | + oe.toolboxPanel.Return(); |
---|
| 760 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 761 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 762 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 763 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 764 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 765 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 766 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 767 | + } |
---|
| 768 | + |
---|
| 769 | + // EDIT panel |
---|
| 770 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 771 | + editButton.setToolTipText("Pin selection controls"); |
---|
| 772 | + editButton.addActionListener(this); |
---|
| 773 | + |
---|
| 774 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 775 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
560 | 776 | uneditButton.addActionListener(this); |
---|
561 | 777 | |
---|
562 | | - oe.aConstraints.gridx += 1; |
---|
563 | | - oe.aConstraints.weighty = 0; |
---|
564 | | - oe.aConstraints.gridwidth = 1; |
---|
565 | | - |
---|
566 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
567 | | - clearPanelButton.addActionListener(this); |
---|
568 | | - |
---|
569 | | - oe.aConstraints.gridx += 1; |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 1; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 778 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 779 | + allParamsButton.setToolTipText("Show all controle"); |
---|
574 | 780 | allParamsButton.addActionListener(this); |
---|
575 | 781 | |
---|
576 | | - oe.aConstraints.gridx += 1; |
---|
577 | | - oe.aConstraints.weighty = 0; |
---|
578 | | - oe.aConstraints.gridwidth = 1; |
---|
579 | | - |
---|
580 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 782 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 783 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 784 | + clearPanelButton.addActionListener(this); |
---|
| 785 | + |
---|
| 786 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 787 | + unselectButton.setToolTipText("Unselect"); |
---|
581 | 788 | unselectButton.addActionListener(this); |
---|
582 | 789 | |
---|
| 790 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 791 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 792 | + flashSelectionButton.addActionListener(this); |
---|
| 793 | + |
---|
| 794 | + editCommandsPanel.preferredHeight = 1; |
---|
| 795 | + |
---|
| 796 | + SetPinStates(false); |
---|
| 797 | +// oe.treePanel.add(commandsPanel); |
---|
| 798 | +// oe.treePanel.Return(); |
---|
| 799 | + |
---|
583 | 800 | // oe.aConstraints.gridx += 1; |
---|
584 | 801 | // oe.aConstraints.weighty = 0; |
---|
585 | 802 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
591 | 808 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
592 | 809 | // gcButton.addActionListener(this); |
---|
593 | 810 | |
---|
594 | | - oe.aConstraints.gridx = 0; |
---|
595 | | - oe.aConstraints.gridy += 1; |
---|
596 | | - |
---|
597 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
598 | | - oe.aConstraints.gridwidth = 100; |
---|
599 | | - // oe.aConstraints.gridheight = 100; |
---|
600 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
601 | | - oe.aConstraints.gridheight = 1; |
---|
602 | | - oe.aConstraints.weighty = 0.5; |
---|
603 | | - oe.aConstraints.gridx = 0; |
---|
604 | | - JScrollPane jSP; |
---|
| 811 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 812 | + |
---|
| 813 | + JScrollPane jSP; |
---|
605 | 814 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
606 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 815 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
607 | 816 | ResetModel(); |
---|
608 | | - oe.aConstraints.weighty = 0.5; |
---|
609 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
610 | | - oe.aConstraints.gridy += 1; |
---|
611 | | - oe.aConstraints.gridwidth = 1; |
---|
612 | | - |
---|
613 | | - oe.aConstraints.weighty = 0; |
---|
614 | | - oe.aConstraints.gridwidth = 2; |
---|
615 | | - |
---|
616 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
617 | | - colorCB.addItemListener(this); |
---|
618 | | - oe.aConstraints.gridx += 2; |
---|
619 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
620 | | - materialCB.addItemListener(this); |
---|
621 | | - oe.aConstraints.gridx += 2; |
---|
622 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
623 | | - textureCB.addItemListener(this); |
---|
624 | | - |
---|
625 | | - oe.aConstraints.gridx = 0; |
---|
626 | | - oe.aConstraints.gridy += 1; |
---|
627 | 817 | |
---|
| 818 | + oe.treePanel.add(jSPPanel); |
---|
| 819 | + oe.treePanel.Return(); |
---|
| 820 | + |
---|
| 821 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 822 | + oe.treePanel.Return(); |
---|
| 823 | + |
---|
| 824 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 825 | +// mainPanel.setResizeWeight(0.5); |
---|
| 826 | + |
---|
628 | 827 | //jList.addListSelectionListener(this); |
---|
629 | 828 | oe.jTree.addTreeSelectionListener(this); |
---|
630 | 829 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
646 | 845 | radio.layout = sevenButton; |
---|
647 | 846 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
648 | 847 | } |
---|
| 848 | + |
---|
| 849 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 850 | + { |
---|
| 851 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 852 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 853 | + colorCB.addItemListener(this); |
---|
| 854 | + |
---|
| 855 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 856 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 857 | + materialCB.addItemListener(this); |
---|
| 858 | + |
---|
| 859 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 860 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 861 | + textureCB.addItemListener(this); |
---|
| 862 | + |
---|
| 863 | + panel.Return(); |
---|
| 864 | + |
---|
| 865 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 866 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 867 | + boxCB.addItemListener(this); |
---|
| 868 | + |
---|
| 869 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 870 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
| 871 | + zoomBoxCB.addItemListener(this); |
---|
| 872 | + |
---|
| 873 | + if (true) // Globals.ADVANCED) |
---|
| 874 | + { |
---|
| 875 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 876 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 877 | +// supportCB.addItemListener(this); |
---|
| 878 | + |
---|
| 879 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 880 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 881 | + freezeCB.addItemListener(this); |
---|
| 882 | + |
---|
| 883 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 884 | + // localCB.addItemListener(this); |
---|
| 885 | + |
---|
| 886 | + panel.Return(); |
---|
| 887 | + |
---|
| 888 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 889 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 890 | + crowdCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 893 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 894 | + smoothCB.addItemListener(this); |
---|
| 895 | + |
---|
| 896 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 897 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 898 | + slowCB.addItemListener(this); |
---|
| 899 | + |
---|
| 900 | +// constraints.gridy += 1; |
---|
| 901 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 902 | +// speakerMocapCB.addItemListener(this); |
---|
| 903 | + |
---|
| 904 | + panel.Return(); |
---|
| 905 | + |
---|
| 906 | + if (false) |
---|
| 907 | + { |
---|
| 908 | + // handled in scripts |
---|
| 909 | + //constraints.gridy += 1; |
---|
| 910 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 911 | + speakerCameraCB.addItemListener(this); |
---|
| 912 | + |
---|
| 913 | + //constraints.gridy += 1; |
---|
| 914 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 915 | + speakerFocusCB.addItemListener(this); |
---|
| 916 | + |
---|
| 917 | + //constraints.gridy += 1; |
---|
| 918 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 919 | + smoothfocusCB.addItemListener(this); |
---|
| 920 | + panel.Return(); |
---|
| 921 | + } |
---|
| 922 | + |
---|
| 923 | +//constraints.gridx += 1; |
---|
| 924 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 925 | +// debugCB.addItemListener(this); |
---|
| 926 | + |
---|
| 927 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 928 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 929 | + trackCB.addItemListener(this); |
---|
| 930 | + |
---|
| 931 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 932 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
| 933 | + oeilCB.addItemListener(this); |
---|
| 934 | + |
---|
| 935 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 936 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 937 | + shadowCB.addItemListener(this); |
---|
| 938 | + |
---|
| 939 | + panel.Return(); |
---|
| 940 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 941 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 942 | + toggleTextureCB.addItemListener(this); |
---|
| 943 | + |
---|
| 944 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 945 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 946 | + toggleSwitchCB.addItemListener(this); |
---|
| 947 | + |
---|
| 948 | + panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
| 949 | + autosaveCB.setToolTipText("On structure change"); |
---|
| 950 | + autosaveCB.addItemListener(this); |
---|
| 951 | + |
---|
| 952 | + panel.Return(); |
---|
| 953 | + if (Globals.ADVANCED) |
---|
| 954 | + { |
---|
| 955 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 956 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 957 | + lookAtCB.addItemListener(this); |
---|
| 958 | + } |
---|
| 959 | + |
---|
| 960 | + } |
---|
| 961 | + |
---|
| 962 | + cGridBag fill = new cGridBag(); |
---|
| 963 | + fill.preferredHeight = 200; |
---|
| 964 | + cGridBag fill2 = new cGridBag(); |
---|
| 965 | + fill2.preferredHeight = 200; |
---|
| 966 | + cGridBag fill3 = new cGridBag(); |
---|
| 967 | + fill3.preferredHeight = 200; |
---|
| 968 | + |
---|
| 969 | + panel.add(fill); |
---|
| 970 | + panel.add(fill2); |
---|
| 971 | + panel.add(fill3); |
---|
| 972 | + |
---|
| 973 | + } |
---|
649 | 974 | |
---|
650 | 975 | void EditObject(Object3D obj) |
---|
651 | 976 | { |
---|
652 | 977 | cRadio radioButton = new cRadio(obj.name); |
---|
| 978 | + |
---|
| 979 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 980 | + radioButton.hadMaterial = obj.material != null; |
---|
| 981 | + if (!radioButton.hadMaterial) |
---|
| 982 | + { |
---|
| 983 | + obj.material = new cMaterial(); |
---|
| 984 | + } |
---|
| 985 | + |
---|
653 | 986 | radioButton.SetObject(obj); |
---|
654 | 987 | radioButton.layout = sevenButton; |
---|
655 | 988 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
658 | 991 | buttonGroup.add(radioButton); |
---|
659 | 992 | radioButton.doClick(); |
---|
660 | 993 | } |
---|
| 994 | + |
---|
661 | 995 | void SetupViews(ObjEditor oe) |
---|
662 | 996 | { |
---|
| 997 | + theFrame = this; |
---|
| 998 | + |
---|
663 | 999 | oe.SetupViews(); |
---|
664 | 1000 | |
---|
665 | 1001 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
668 | 1004 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
669 | 1005 | } |
---|
670 | 1006 | |
---|
671 | | - JCheckBox liveCB; |
---|
672 | | - JCheckBox supportCB; |
---|
673 | | - JCheckBox localCB; |
---|
674 | | - JCheckBox crowdCB; |
---|
675 | | - JCheckBox smoothCB; |
---|
676 | | - JCheckBox fastCB; |
---|
677 | | - JCheckBox slowCB; |
---|
678 | | - JCheckBox boxCB; |
---|
679 | | - JCheckBox trackCB; |
---|
680 | | - JCheckBox smoothfocusCB; |
---|
| 1007 | + cToggleButton liveCB; |
---|
| 1008 | + cCheckBox supportCB; |
---|
| 1009 | + cCheckBox localCB; |
---|
| 1010 | + cCheckBox crowdCB; |
---|
| 1011 | + cCheckBox smoothCB; |
---|
| 1012 | + cToggleButton fastCB; |
---|
| 1013 | + cCheckBox slowCB; |
---|
| 1014 | + cCheckBox boxCB; |
---|
| 1015 | + cCheckBox zoomBoxCB; |
---|
| 1016 | + cCheckBox freezeCB; |
---|
| 1017 | + //cToggleButton trackCB; |
---|
| 1018 | + cCheckBox trackCB; |
---|
| 1019 | + cCheckBox smoothfocusCB; |
---|
681 | 1020 | // JCheckBox speakerMocapCB; |
---|
682 | | - JCheckBox speakerCameraCB; |
---|
683 | | - JCheckBox speakerFocusCB; |
---|
684 | | - JCheckBox debugCB; |
---|
685 | | - JCheckBox oeilCB; |
---|
686 | | - JCheckBox lookAtCB; |
---|
| 1021 | + cCheckBox speakerCameraCB; |
---|
| 1022 | + cCheckBox speakerFocusCB; |
---|
| 1023 | + cCheckBox debugCB; |
---|
| 1024 | + |
---|
| 1025 | + cCheckBox oeilCB; |
---|
| 1026 | + cCheckBox shadowCB; |
---|
| 1027 | + cCheckBox autosaveCB; |
---|
| 1028 | + cCheckBox lookAtCB; |
---|
687 | 1029 | |
---|
688 | 1030 | // static int COLOR = 1; |
---|
689 | 1031 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
691 | 1033 | |
---|
692 | 1034 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
693 | 1035 | |
---|
694 | | - JCheckBox colorCB; |
---|
695 | | - JCheckBox materialCB; |
---|
696 | | - JCheckBox textureCB; |
---|
| 1036 | + cCheckBox colorCB; |
---|
| 1037 | + cCheckBox materialCB; |
---|
| 1038 | + cCheckBox textureCB; |
---|
697 | 1039 | |
---|
698 | 1040 | public void itemStateChanged(ItemEvent e) |
---|
699 | 1041 | { |
---|
.. | .. |
---|
721 | 1063 | } else if(e.getSource() == liveCB) |
---|
722 | 1064 | { |
---|
723 | 1065 | cameraView.ToggleLive(); |
---|
| 1066 | + refreshContents(false); |
---|
724 | 1067 | } |
---|
725 | 1068 | else if(e.getSource() == supportCB) |
---|
726 | 1069 | { |
---|
.. | .. |
---|
756 | 1099 | cameraView.repaint(); |
---|
757 | 1100 | // refreshContents(); |
---|
758 | 1101 | } |
---|
| 1102 | + else if(e.getSource() == zoomBoxCB) |
---|
| 1103 | + { |
---|
| 1104 | + cameraView.ToggleZoomBoxMode(); |
---|
| 1105 | + } |
---|
759 | 1106 | else if(e.getSource() == smoothfocusCB) |
---|
760 | 1107 | { |
---|
761 | 1108 | cameraView.ToggleSmoothFocus(); |
---|
.. | .. |
---|
781 | 1128 | { |
---|
782 | 1129 | cameraView.ToggleOeil(); |
---|
783 | 1130 | } |
---|
| 1131 | + else if(e.getSource() == shadowCB) |
---|
| 1132 | + { |
---|
| 1133 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1134 | + } |
---|
| 1135 | + else if(e.getSource() == freezeCB) |
---|
| 1136 | + { |
---|
| 1137 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1138 | + } |
---|
| 1139 | + else if(e.getSource() == autosaveCB) |
---|
| 1140 | + { |
---|
| 1141 | + Globals.SAVEONMAKE ^= true; |
---|
| 1142 | + } |
---|
784 | 1143 | else if(e.getSource() == lookAtCB) |
---|
785 | 1144 | { |
---|
786 | 1145 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
797 | 1156 | |
---|
798 | 1157 | /**/ |
---|
799 | 1158 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
800 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1159 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1160 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
801 | 1161 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
802 | 1162 | // We can't move the root node or an empty selection |
---|
803 | 1163 | return; |
---|
.. | .. |
---|
860 | 1220 | } |
---|
861 | 1221 | } |
---|
862 | 1222 | |
---|
863 | | - String string = (String) object; |
---|
864 | | - |
---|
865 | 1223 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
866 | 1224 | // if( object instanceof java.io.File[]) |
---|
867 | 1225 | // { |
---|
.. | .. |
---|
869 | 1227 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
870 | 1228 | // return; |
---|
871 | 1229 | // } |
---|
872 | | - if (string.charAt(0) == '/') |
---|
| 1230 | + |
---|
| 1231 | + String string = object.toString(); |
---|
| 1232 | + |
---|
| 1233 | + // File path for Mac and Windows |
---|
| 1234 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
873 | 1235 | { |
---|
874 | 1236 | // file(s) |
---|
875 | 1237 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
896 | 1258 | |
---|
897 | 1259 | flashIt = false; |
---|
898 | 1260 | CameraPane pane = (CameraPane) target; |
---|
899 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1261 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
900 | 1262 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
901 | 1263 | |
---|
902 | 1264 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
912 | 1274 | |
---|
913 | 1275 | assert target == objEditor.jTree; |
---|
914 | 1276 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1277 | + Object3D destinationLeaf; |
---|
915 | 1278 | try { |
---|
916 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1279 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
917 | 1280 | } catch (Exception e) { |
---|
918 | 1281 | System.out.println("destinationPath : " + destinationPath); |
---|
919 | 1282 | return; |
---|
920 | 1283 | } |
---|
921 | 1284 | |
---|
922 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1285 | + for (int i=group.selection.size(); --i>=0;) |
---|
923 | 1286 | { |
---|
| 1287 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1288 | + |
---|
| 1289 | + // Cannot move into itself |
---|
| 1290 | + if (child == destinationLeaf) |
---|
| 1291 | + return; |
---|
| 1292 | + } |
---|
| 1293 | + |
---|
| 1294 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1295 | +// { |
---|
924 | 1296 | loadClipboard(true); |
---|
925 | 1297 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
926 | | - pasteInto(false); |
---|
927 | | - } else { |
---|
928 | | - loadClipboard(false); |
---|
929 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
930 | | - pasteInto(false); // true); // ??? |
---|
931 | | - } |
---|
| 1298 | + pasteInto(false, false); |
---|
| 1299 | +// } else { |
---|
| 1300 | +// loadClipboard(false); |
---|
| 1301 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1302 | +// pasteInto(false, false); // true); // ??? |
---|
| 1303 | +// } |
---|
932 | 1304 | } |
---|
933 | 1305 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
934 | 1306 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1033 | 1405 | { |
---|
1034 | 1406 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1035 | 1407 | //heightFieldItem.addActionListener(this); |
---|
1036 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1037 | | - gridItem.addActionListener(this); |
---|
1038 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1039 | | - rectoidItem.addActionListener(this); |
---|
1040 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1041 | | - ellipsoidItem.addActionListener(this); |
---|
1042 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1043 | | - coneItem.addActionListener(this); |
---|
1044 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1045 | | - torusItem.addActionListener(this); |
---|
1046 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1047 | | - superItem.addActionListener(this); |
---|
| 1408 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1409 | +// gridItem.addActionListener(this); |
---|
| 1410 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1411 | +// rectoidItem.addActionListener(this); |
---|
| 1412 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1413 | +// ellipsoidItem.addActionListener(this); |
---|
| 1414 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1415 | +// coneItem.addActionListener(this); |
---|
| 1416 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1417 | +// torusItem.addActionListener(this); |
---|
| 1418 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1419 | +// superItem.addActionListener(this); |
---|
| 1420 | + |
---|
| 1421 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1422 | + cameraItem.addActionListener(this); |
---|
| 1423 | + |
---|
| 1424 | + if (!Globals.ADVANCED) |
---|
| 1425 | + { |
---|
1048 | 1426 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1049 | 1427 | kleinItem.addActionListener(this); |
---|
1050 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1051 | | - particleItem.addActionListener(this); |
---|
| 1428 | + } |
---|
| 1429 | + |
---|
| 1430 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1431 | +// particleItem.addActionListener(this); |
---|
| 1432 | + if (Globals.ADVANCED) |
---|
| 1433 | + { |
---|
1052 | 1434 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1053 | 1435 | ragdollItem.addActionListener(this); |
---|
1054 | 1436 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1055 | 1437 | ragdoll2Item.addActionListener(this); |
---|
| 1438 | + } |
---|
1056 | 1439 | menu.add("-"); |
---|
1057 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1440 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1058 | 1441 | meshItem.addActionListener(this); |
---|
1059 | 1442 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1060 | 1443 | // meshGroupItem.addActionListener(this); |
---|
| 1444 | + if (Globals.ADVANCED) |
---|
| 1445 | + { |
---|
1061 | 1446 | springItem = menu.add(new MenuItem("Spring")); |
---|
1062 | 1447 | springItem.addActionListener(this); |
---|
1063 | 1448 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1064 | 1449 | flagItem.addActionListener(this); |
---|
1065 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1066 | | - bezierItem.addActionListener(this); |
---|
1067 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1068 | | - checkerItem.addActionListener(this); |
---|
1069 | 1450 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1070 | 1451 | blobItem.addActionListener(this); |
---|
1071 | 1452 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1072 | 1453 | latheItem.addActionListener(this); |
---|
1073 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1074 | | - lightItem.addActionListener(this); |
---|
| 1454 | + } |
---|
| 1455 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1456 | + bezierItem.addActionListener(this); |
---|
| 1457 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1458 | +// overlayItem.addActionListener(this); |
---|
| 1459 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1460 | +// lightItem.addActionListener(this); |
---|
1075 | 1461 | menu.add("-"); |
---|
1076 | 1462 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1077 | 1463 | //superLoopItem.addActionListener(this); |
---|
1078 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1079 | | - loopItem.addActionListener(this); |
---|
| 1464 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1465 | +// loopItem.addActionListener(this); |
---|
1080 | 1466 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1081 | 1467 | doubleItem.addActionListener(this); |
---|
| 1468 | + if (Globals.ADVANCED) |
---|
| 1469 | + { |
---|
1082 | 1470 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1083 | 1471 | tripleItem.addActionListener(this); |
---|
| 1472 | + } |
---|
1084 | 1473 | } |
---|
1085 | 1474 | |
---|
1086 | 1475 | void buildToolsMenu(Menu menu) |
---|
1087 | 1476 | { |
---|
1088 | 1477 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1089 | 1478 | animationItem.addItemListener(this); |
---|
1090 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1479 | + animationItem.setState(Globals.ANIMATION); |
---|
| 1480 | + |
---|
| 1481 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1482 | + archiveItem.addActionListener(this); |
---|
1091 | 1483 | |
---|
1092 | 1484 | menu.add("-"); |
---|
1093 | 1485 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1094 | 1486 | parseverticesItem.addActionListener(this); |
---|
1095 | 1487 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1096 | 1488 | textureFieldItem.addActionListener(this); |
---|
1097 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1489 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1098 | 1490 | alignItem.addActionListener(this); |
---|
1099 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1100 | | - mirrorItem.addActionListener(this); |
---|
1101 | 1491 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1102 | 1492 | reduceMorphItem.addActionListener(this); |
---|
1103 | 1493 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1104 | 1494 | reduce34MorphItem.addActionListener(this); |
---|
1105 | | - |
---|
1106 | | - menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1107 | | - computeAOItem.addActionListener(this); |
---|
1108 | 1495 | menu.add("-"); |
---|
1109 | | - |
---|
1110 | 1496 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1111 | 1497 | memoryItem.addActionListener(this); |
---|
| 1498 | + menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
| 1499 | + computeAOItem.addActionListener(this); |
---|
| 1500 | + |
---|
| 1501 | + if (Globals.ADVANCED) |
---|
| 1502 | + { |
---|
| 1503 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1504 | + mirrorItem.addActionListener(this); |
---|
| 1505 | + menu.add("-"); |
---|
1112 | 1506 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1113 | 1507 | analyzeItem.addActionListener(this); |
---|
1114 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1508 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1115 | 1509 | dumpItem.addActionListener(this); |
---|
1116 | 1510 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1117 | 1511 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1129 | 1523 | menu.add("-"); |
---|
1130 | 1524 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1131 | 1525 | editScriptItem.addActionListener(this); |
---|
| 1526 | + } |
---|
1132 | 1527 | } |
---|
1133 | 1528 | |
---|
1134 | 1529 | void ScreenFit() |
---|
.. | .. |
---|
1251 | 1646 | shadow.material = new cMaterial(obj.material); |
---|
1252 | 1647 | shadow.material.diffuse = 0.0001f; |
---|
1253 | 1648 | shadow.material.specular = 0.0001f; |
---|
| 1649 | + //shadow.projectedVertices[1].x = 300; |
---|
1254 | 1650 | |
---|
1255 | 1651 | makeSomething(shadow); |
---|
1256 | 1652 | } |
---|
| 1653 | + |
---|
| 1654 | + private void ClearUnpinned() |
---|
| 1655 | + { |
---|
| 1656 | + //for (Object3D obj : listUI) |
---|
| 1657 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1658 | + { |
---|
| 1659 | + Object3D obj = listUI.elementAt(i); |
---|
| 1660 | + if (!obj.pinned) |
---|
| 1661 | + { |
---|
| 1662 | + obj.CloseUI(); |
---|
| 1663 | + listUI.remove(i); |
---|
| 1664 | + } |
---|
| 1665 | + } |
---|
| 1666 | + } |
---|
1257 | 1667 | |
---|
1258 | 1668 | /** |
---|
1259 | 1669 | * applyExample |
---|
.. | .. |
---|
1457 | 1867 | |
---|
1458 | 1868 | void Overwrite(int mask) |
---|
1459 | 1869 | { |
---|
1460 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1870 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1461 | 1871 | { |
---|
1462 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1872 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1463 | 1873 | |
---|
1464 | 1874 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1465 | 1875 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1482 | 1892 | // |
---|
1483 | 1893 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1484 | 1894 | { |
---|
| 1895 | + Object source = event.getSource(); |
---|
1485 | 1896 | /* |
---|
1486 | 1897 | if (event.getSource() == nameField) |
---|
1487 | 1898 | { |
---|
.. | .. |
---|
1493 | 1904 | } |
---|
1494 | 1905 | else |
---|
1495 | 1906 | */ |
---|
1496 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1907 | + if (source == lookAtItem || source == lookFromItem) |
---|
1497 | 1908 | { |
---|
1498 | 1909 | ScreenFit(); |
---|
1499 | 1910 | } else |
---|
1500 | | - if (event.getSource() == switchItem) |
---|
| 1911 | + if (source == switchViewItem) |
---|
1501 | 1912 | { |
---|
1502 | 1913 | cVector v1 = new cVector(); |
---|
1503 | 1914 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1506 | 1917 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1507 | 1918 | objEditor.cameraView.repaint(); |
---|
1508 | 1919 | } else |
---|
1509 | | - if (event.getSource() == rectoidItem) |
---|
| 1920 | + if (source == rectoidItem || source == boxButton) |
---|
1510 | 1921 | { |
---|
1511 | 1922 | makeSomething(new Box()); |
---|
1512 | 1923 | } else |
---|
1513 | | - if (event.getSource() == particleItem) |
---|
| 1924 | + if (source == particleItem || source == particlesButton) |
---|
1514 | 1925 | { |
---|
1515 | 1926 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1516 | 1927 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1531 | 1942 | applyExample(particleGeom, "SMOKE"); |
---|
1532 | 1943 | makeSomething(particleGeom); |
---|
1533 | 1944 | } else |
---|
1534 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1945 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1535 | 1946 | { |
---|
1536 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1947 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1537 | 1948 | |
---|
1538 | 1949 | ragdoll.toParent = LA.newMatrix(); |
---|
1539 | 1950 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1551 | 1962 | } else |
---|
1552 | 1963 | /* |
---|
1553 | 1964 | */ |
---|
1554 | | - if (event.getSource() == heightFieldItem) |
---|
| 1965 | + if (source == heightFieldItem) |
---|
1555 | 1966 | { |
---|
1556 | 1967 | Object3D obj = new Object3D(); |
---|
1557 | 1968 | |
---|
.. | .. |
---|
1589 | 2000 | |
---|
1590 | 2001 | makeSomething(obj); |
---|
1591 | 2002 | } else |
---|
1592 | | - if (event.getSource() == gridItem) |
---|
| 2003 | + if (source == gridItem || source == gridButton) |
---|
1593 | 2004 | { |
---|
1594 | 2005 | makeSomething(new Grid()); |
---|
1595 | 2006 | } else |
---|
1596 | | - if (event.getSource() == ellipsoidItem) |
---|
| 2007 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1597 | 2008 | { |
---|
1598 | 2009 | makeSomething(new Sphere()); |
---|
1599 | 2010 | } else |
---|
1600 | | - if (event.getSource() == coneItem) |
---|
| 2011 | + if (source == coneItem || source == coneButton) |
---|
1601 | 2012 | { |
---|
1602 | 2013 | makeSomething(new Cone()); |
---|
1603 | 2014 | } else |
---|
1604 | | - if (event.getSource() == torusItem) |
---|
| 2015 | + if (source == torusItem || source == torusButton) |
---|
1605 | 2016 | { |
---|
1606 | 2017 | makeSomething(new Torus()); |
---|
1607 | 2018 | } else |
---|
1608 | | - if (event.getSource() == superItem) |
---|
| 2019 | + if (source == superItem || source == superButton) |
---|
1609 | 2020 | { |
---|
1610 | 2021 | makeSomething(new Superellipsoid()); |
---|
1611 | 2022 | } else |
---|
1612 | | - if (event.getSource() == kleinItem) |
---|
| 2023 | + if (source == kleinItem || source == kleinButton) |
---|
1613 | 2024 | { |
---|
1614 | 2025 | makeSomething(new Klein()); |
---|
1615 | 2026 | } else |
---|
1616 | | - if (event.getSource() == blobItem) |
---|
| 2027 | + if (source == blobItem) |
---|
1617 | 2028 | { |
---|
1618 | 2029 | Blob blob = new Blob(); |
---|
1619 | 2030 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1621 | 2032 | //blob.retile(); |
---|
1622 | 2033 | makeSomething(blob); |
---|
1623 | 2034 | } else |
---|
1624 | | - if (event.getSource() == latheItem) |
---|
| 2035 | + if (source == latheItem) |
---|
1625 | 2036 | { |
---|
1626 | 2037 | makeSomething(new Lathe()); |
---|
1627 | 2038 | } else |
---|
1628 | | - if (event.getSource() == bezierItem) |
---|
| 2039 | + if (source == bezierItem) |
---|
1629 | 2040 | { |
---|
1630 | 2041 | makeSomething(new BezierSurface()); |
---|
1631 | 2042 | } else |
---|
1632 | | - if (event.getSource() == checkerItem) |
---|
| 2043 | + if (source == overlayItem || source == overlayButton) |
---|
1633 | 2044 | { |
---|
1634 | 2045 | /* |
---|
1635 | 2046 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1644 | 2055 | */ |
---|
1645 | 2056 | makeSomething(new Checker()); |
---|
1646 | 2057 | } else |
---|
1647 | | - if (event.getSource() == meshItem) |
---|
| 2058 | + if (source == meshItem) |
---|
1648 | 2059 | { |
---|
1649 | 2060 | Object3D itemtomake = new Object3D(); |
---|
1650 | 2061 | Object3D child; |
---|
.. | .. |
---|
1665 | 2076 | makeSomething(child); |
---|
1666 | 2077 | } |
---|
1667 | 2078 | } else |
---|
1668 | | - if (event.getSource() == springItem) |
---|
| 2079 | + if (source == springItem) |
---|
1669 | 2080 | { |
---|
1670 | 2081 | cSpring s = new cSpring(); |
---|
1671 | 2082 | s.setup(); |
---|
1672 | 2083 | makeSomething(s); |
---|
1673 | 2084 | } else |
---|
1674 | | - if (event.getSource() == flagItem) |
---|
| 2085 | + if (source == flagItem) |
---|
1675 | 2086 | { |
---|
1676 | 2087 | cSpring s = new cFlag(); |
---|
1677 | 2088 | s.setup(); |
---|
1678 | 2089 | makeSomething(s); |
---|
1679 | 2090 | } else |
---|
1680 | | - if (event.getSource() == lightItem) |
---|
| 2091 | + if (source == lightItem || source == lightButton) |
---|
1681 | 2092 | { |
---|
1682 | 2093 | makeSomething(new Light()); |
---|
1683 | 2094 | } else |
---|
1684 | | - if (event.getSource() == csgItem) |
---|
| 2095 | + if (source == csgItem) |
---|
1685 | 2096 | { |
---|
1686 | 2097 | group(new CSG()); |
---|
1687 | 2098 | } else |
---|
1688 | | - if (event.getSource() == templateItem) |
---|
| 2099 | + if (source == templateItem) |
---|
1689 | 2100 | { |
---|
1690 | 2101 | group(new cTemplate()); |
---|
1691 | 2102 | } else |
---|
1692 | | - if (event.getSource() == attributeItem) |
---|
| 2103 | + if (source == attributeItem) |
---|
1693 | 2104 | { |
---|
1694 | 2105 | makeSomething(new Attribute()); |
---|
1695 | 2106 | } else |
---|
1696 | | - if (event.getSource() == pointflowItem) |
---|
| 2107 | + if (source == pointflowItem) |
---|
1697 | 2108 | { |
---|
1698 | 2109 | makeSomething(new PointFlow()); |
---|
1699 | 2110 | } else |
---|
.. | .. |
---|
1705 | 2116 | } else |
---|
1706 | 2117 | */ |
---|
1707 | 2118 | |
---|
1708 | | - if (event.getSource() == superLoopItem) |
---|
| 2119 | + if (source == superLoopItem) |
---|
1709 | 2120 | { |
---|
1710 | 2121 | Composite g = new cGroup(); |
---|
1711 | 2122 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1727 | 2138 | |
---|
1728 | 2139 | group(g); |
---|
1729 | 2140 | } else |
---|
1730 | | - if (event.getSource() == loopItem) |
---|
| 2141 | + if (source == loopItem || source == loopButton) |
---|
1731 | 2142 | { |
---|
1732 | 2143 | Composite csg = new GroupLeaf(); |
---|
1733 | 2144 | csg.count = 5; |
---|
1734 | 2145 | group(csg); |
---|
1735 | | - Composite child = new cGroup(); |
---|
| 2146 | + Composite child = new cGroup("Branch"); |
---|
1736 | 2147 | csg.addChild(child); |
---|
1737 | 2148 | child.addChild(csg); |
---|
1738 | 2149 | } else |
---|
1739 | | - if (event.getSource() == doubleItem) |
---|
| 2150 | + if (source == doubleItem) |
---|
1740 | 2151 | { |
---|
1741 | | - Composite csg = new GroupLeaf(); |
---|
| 2152 | + Composite csg = new GroupLeaf("Fork"); |
---|
1742 | 2153 | csg.count = 5; |
---|
1743 | 2154 | group(csg); |
---|
1744 | | - Composite child = new cGroup(); |
---|
| 2155 | + Composite child = new cGroup("Branch A"); |
---|
1745 | 2156 | csg.addChild(child); |
---|
1746 | 2157 | child.addChild(csg); |
---|
1747 | | - child = new cGroup(); |
---|
| 2158 | + child = new cGroup("Branch B"); |
---|
1748 | 2159 | csg.addChild(child); |
---|
1749 | 2160 | child.addChild(csg); |
---|
1750 | 2161 | } else |
---|
1751 | | - if (event.getSource() == tripleItem) |
---|
| 2162 | + if (source == tripleItem) |
---|
1752 | 2163 | { |
---|
1753 | | - Composite csg = new GroupLeaf(); |
---|
| 2164 | + Composite csg = new GroupLeaf("Trident"); |
---|
1754 | 2165 | csg.count = 4; |
---|
1755 | 2166 | group(csg); |
---|
1756 | 2167 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1763 | 2174 | csg.addChild(child); |
---|
1764 | 2175 | child.addChild(csg); |
---|
1765 | 2176 | } else |
---|
1766 | | - |
---|
1767 | | - if (event.getSource() == importGFDItem) |
---|
| 2177 | + if (source == computeAOItem) |
---|
1768 | 2178 | { |
---|
1769 | | - ImportGFD(); |
---|
| 2179 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 2180 | + Globals.theRenderer.repaint(); |
---|
1770 | 2181 | } else |
---|
1771 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1772 | | - { |
---|
1773 | | - ImportVRMLX3D(); |
---|
1774 | | - } else |
---|
1775 | | - if (event.getSource() == import3DSItem) |
---|
1776 | | - { |
---|
1777 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1778 | | - } else |
---|
1779 | | - if (event.getSource() == importOBJItem) |
---|
1780 | | - { |
---|
1781 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1782 | | - } else |
---|
1783 | | - if (event.getSource() == computeAOItem) |
---|
1784 | | - { |
---|
1785 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1786 | | - CameraPane.theRenderer.repaint(); |
---|
1787 | | - } else |
---|
1788 | | - if (event.getSource() == recompileItem) |
---|
| 2182 | + if (source == recompileItem) |
---|
1789 | 2183 | { |
---|
1790 | 2184 | Recompile(); |
---|
1791 | 2185 | refreshContents(); |
---|
1792 | 2186 | } else |
---|
1793 | | - if (event.getSource() == editScriptItem) |
---|
| 2187 | + if (source == editScriptItem) |
---|
1794 | 2188 | { |
---|
1795 | 2189 | OpenDialog(); |
---|
1796 | 2190 | refreshContents(); |
---|
1797 | 2191 | } else |
---|
1798 | | - if (event.getSource() == invariantsItem) |
---|
| 2192 | + if (source == invariantsItem) |
---|
1799 | 2193 | { |
---|
1800 | 2194 | System.out.println("Invariants:"); |
---|
1801 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2195 | + Grafreed.grafreeD.universe.invariants(); |
---|
1802 | 2196 | } else |
---|
1803 | | - if (event.getSource() == memoryItem) |
---|
| 2197 | + if (source == memoryItem) |
---|
1804 | 2198 | { |
---|
1805 | 2199 | //System.out.println("Invariants:"); |
---|
1806 | 2200 | PrintMemory(); |
---|
1807 | 2201 | } else |
---|
1808 | | - if (event.getSource() == pathItem) |
---|
| 2202 | + if (source == pathItem) |
---|
1809 | 2203 | { |
---|
1810 | 2204 | PrintPath(); |
---|
1811 | 2205 | } else |
---|
1812 | | - if (event.getSource() == analyzeItem) |
---|
| 2206 | + if (source == analyzeItem) |
---|
1813 | 2207 | { |
---|
1814 | 2208 | AnalyzeObject(); |
---|
1815 | 2209 | } else |
---|
1816 | | - if (event.getSource() == dumpItem) |
---|
| 2210 | + if (source == dumpItem) |
---|
1817 | 2211 | { |
---|
1818 | 2212 | DumpObject(); |
---|
1819 | 2213 | } else |
---|
1820 | | - if (event.getSource() == screenfitButton) |
---|
| 2214 | + if (source == minButton) |
---|
1821 | 2215 | { |
---|
1822 | | - //Reload(lastConverter, lastFilename, true); |
---|
| 2216 | + Minimize(); |
---|
| 2217 | + } else |
---|
| 2218 | + if (source == maxButton) |
---|
| 2219 | + { |
---|
| 2220 | + Maximize(); |
---|
| 2221 | + } else |
---|
| 2222 | + if (source == fullButton) |
---|
| 2223 | + { |
---|
| 2224 | + ToggleFullScreen(); |
---|
| 2225 | + } else |
---|
| 2226 | + if (source == undoButton) |
---|
| 2227 | + { |
---|
| 2228 | + if (!Undo()) |
---|
| 2229 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2230 | + } else |
---|
| 2231 | + if (source == redoButton) |
---|
| 2232 | + { |
---|
| 2233 | + Redo(); |
---|
| 2234 | + } else |
---|
| 2235 | + if (source == saveButton) |
---|
| 2236 | + { |
---|
| 2237 | + if (!Save(true)) |
---|
| 2238 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2239 | + } else |
---|
| 2240 | + if (source == oneStepButton) |
---|
| 2241 | + { |
---|
| 2242 | + Globals.ONESTEP = true; |
---|
| 2243 | + cameraView.repaint(); |
---|
| 2244 | + } else |
---|
| 2245 | + if (source == screenfitButton) |
---|
| 2246 | + { |
---|
1823 | 2247 | ScreenFit(); |
---|
1824 | 2248 | } else |
---|
1825 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2249 | + if (source == screenfitpointButton) |
---|
1826 | 2250 | { |
---|
1827 | | - //Reload(lastConverter, lastFilename, true); |
---|
1828 | 2251 | ScreenFitPoint(); |
---|
1829 | 2252 | } else |
---|
1830 | | - if (event.getSource() == snapobjectButton) |
---|
| 2253 | + if (source == snapobjectButton) |
---|
1831 | 2254 | { |
---|
1832 | | - //Reload(lastConverter, lastFilename, true); |
---|
1833 | 2255 | SnapObject(); |
---|
1834 | 2256 | } else |
---|
1835 | 2257 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1838 | 2260 | // Recompile(); |
---|
1839 | 2261 | // refreshContents(); |
---|
1840 | 2262 | // } else |
---|
1841 | | - if (event.getSource() == gcButton) |
---|
| 2263 | + if (source == gcButton) |
---|
1842 | 2264 | { |
---|
1843 | 2265 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1844 | 2266 | System.gc(); |
---|
1845 | 2267 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1846 | 2268 | } else |
---|
1847 | | - if (event.getSource() == editLeafItem) |
---|
| 2269 | + if (source == editLeafItem) |
---|
1848 | 2270 | { |
---|
1849 | 2271 | Object3D obj; |
---|
1850 | 2272 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1858 | 2280 | } |
---|
1859 | 2281 | refreshContents(true); |
---|
1860 | 2282 | } else |
---|
1861 | | - if (event.getSource() == openWindowItem) |
---|
| 2283 | + if (source == openWindowItem) |
---|
1862 | 2284 | { |
---|
1863 | 2285 | EditSelection(true); |
---|
1864 | 2286 | } else |
---|
1865 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2287 | + if (source == cutItem || source == clearButton) |
---|
1866 | 2288 | { |
---|
1867 | 2289 | loadClipboard(true); |
---|
1868 | 2290 | } else |
---|
1869 | | - if (event.getSource() == duplicateItem) |
---|
| 2291 | + if (source == undoItem) |
---|
1870 | 2292 | { |
---|
1871 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2293 | + Undo(); |
---|
| 2294 | + } else |
---|
| 2295 | + if (source == redoItem) |
---|
| 2296 | + { |
---|
| 2297 | + Redo(); |
---|
| 2298 | + } else |
---|
| 2299 | + if (source == duplicateItem) |
---|
| 2300 | + { |
---|
| 2301 | + Object3D keep = Grafreed.clipboard; |
---|
1872 | 2302 | loadClipboard(false); |
---|
1873 | 2303 | paste(false); |
---|
1874 | | - GrafreeD.clipboard = keep; |
---|
| 2304 | + Grafreed.clipboard = keep; |
---|
1875 | 2305 | } else |
---|
1876 | | - if (event.getSource() == cloneItem) |
---|
| 2306 | + if (source == cloneItem) |
---|
1877 | 2307 | { |
---|
1878 | 2308 | CloneSelection(false); |
---|
1879 | 2309 | } else |
---|
1880 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2310 | + if (source == cloneSupportItem) |
---|
1881 | 2311 | { |
---|
1882 | 2312 | CloneSelection(true); |
---|
1883 | 2313 | } else |
---|
1884 | | - if (event.getSource() == copyItem) |
---|
| 2314 | + if (source == copyItem) |
---|
1885 | 2315 | { |
---|
1886 | 2316 | loadClipboard(false); |
---|
1887 | 2317 | } else |
---|
1888 | | - if (event.getSource() == pasteItem) |
---|
| 2318 | + if (source == pasteItem) |
---|
1889 | 2319 | { |
---|
1890 | 2320 | paste(false); |
---|
1891 | 2321 | } else |
---|
1892 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2322 | + if (source == pasteIntoItem) |
---|
1893 | 2323 | { |
---|
1894 | | - pasteInto(false); |
---|
| 2324 | + pasteInto(true, false); |
---|
1895 | 2325 | } else |
---|
1896 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2326 | + if (source == pasteLinkItem) |
---|
1897 | 2327 | { |
---|
1898 | | - pasteInto(true); |
---|
| 2328 | + pasteInto(false, false); |
---|
1899 | 2329 | } else |
---|
1900 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2330 | + if (source == pasteCloneItem) |
---|
| 2331 | + { |
---|
| 2332 | + pasteInto(true, true); |
---|
| 2333 | + } else |
---|
| 2334 | + if (source == pasteExpandItem) |
---|
1901 | 2335 | { |
---|
1902 | 2336 | paste(true); |
---|
1903 | 2337 | } else |
---|
1904 | | - if (event.getSource() == synchronizeItem) |
---|
| 2338 | + if (source == synchronizeItem) |
---|
1905 | 2339 | { |
---|
1906 | 2340 | Overwrite(Object3D.TRANSFORM); |
---|
1907 | 2341 | } else |
---|
1908 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2342 | + if (source == overwriteNameItem) |
---|
1909 | 2343 | { |
---|
1910 | 2344 | Overwrite(Object3D.NAME); |
---|
1911 | 2345 | } else |
---|
1912 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2346 | + if (source == overwriteUVItem) |
---|
1913 | 2347 | { |
---|
1914 | 2348 | Overwrite(Object3D.UV); |
---|
1915 | 2349 | } else |
---|
1916 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2350 | + if (source == overwriteMatItem) |
---|
1917 | 2351 | { |
---|
1918 | 2352 | /* july 2015 |
---|
1919 | 2353 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1933 | 2367 | |
---|
1934 | 2368 | Overwrite(dropAttributes); |
---|
1935 | 2369 | } |
---|
1936 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2370 | + if (source == overwriteGeoItem) |
---|
1937 | 2371 | { |
---|
1938 | 2372 | Overwrite(Object3D.GEOMETRY); |
---|
1939 | 2373 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1950 | 2384 | // refreshContents(); |
---|
1951 | 2385 | // } |
---|
1952 | 2386 | } else |
---|
1953 | | - if (event.getSource() == generateMeshItem) |
---|
| 2387 | + if (source == generateMeshItem) |
---|
1954 | 2388 | { |
---|
1955 | 2389 | //if (group.selection.size() == 1) |
---|
1956 | 2390 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1961 | 2395 | ResetModel(); |
---|
1962 | 2396 | refreshContents(); |
---|
1963 | 2397 | } else |
---|
1964 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2398 | + if (source == extractGeometriesItem) |
---|
1965 | 2399 | { |
---|
1966 | 2400 | boolean one = false; |
---|
1967 | 2401 | |
---|
.. | .. |
---|
1988 | 2422 | ResetModel(); |
---|
1989 | 2423 | refreshContents(); |
---|
1990 | 2424 | } else |
---|
1991 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2425 | + if (source == cloneGeometriesItem) |
---|
1992 | 2426 | { |
---|
1993 | 2427 | boolean one = false; |
---|
1994 | 2428 | |
---|
.. | .. |
---|
2014 | 2448 | ResetModel(); |
---|
2015 | 2449 | refreshContents(); |
---|
2016 | 2450 | } else |
---|
2017 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2451 | + if (source == shareGeometriesItem) |
---|
2018 | 2452 | { |
---|
2019 | 2453 | boolean one = false; |
---|
2020 | 2454 | |
---|
.. | .. |
---|
2044 | 2478 | refreshContents(); |
---|
2045 | 2479 | } |
---|
2046 | 2480 | } else |
---|
2047 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2481 | + if (source == mergeGeometriesItem) |
---|
2048 | 2482 | { |
---|
2049 | 2483 | boolean one = false; |
---|
2050 | 2484 | |
---|
.. | .. |
---|
2074 | 2508 | ResetModel(); |
---|
2075 | 2509 | refreshContents(); |
---|
2076 | 2510 | } else |
---|
2077 | | - if (event.getSource() == linkverticesItem) |
---|
| 2511 | + if (source == linkverticesItem) |
---|
2078 | 2512 | { |
---|
2079 | 2513 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2080 | 2514 | // { |
---|
.. | .. |
---|
2087 | 2521 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2088 | 2522 | // refreshContents(); |
---|
2089 | 2523 | // } |
---|
2090 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2524 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2091 | 2525 | { |
---|
2092 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2526 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2093 | 2527 | |
---|
2094 | 2528 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2095 | 2529 | content = ((cGroup)content).get(0); |
---|
2096 | 2530 | |
---|
2097 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2531 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2098 | 2532 | for (int i=0; i<group.selection.size(); i++) |
---|
2099 | 2533 | { |
---|
2100 | | - boolean random = CameraPane.RANDOM; |
---|
2101 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2534 | + boolean random = CameraPane.SWITCH; |
---|
| 2535 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2102 | 2536 | group.selection.get(i).linkVerticesThis(content); |
---|
2103 | 2537 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2104 | | - CameraPane.RANDOM = random; |
---|
| 2538 | + CameraPane.SWITCH = random; |
---|
2105 | 2539 | } |
---|
2106 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2540 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2107 | 2541 | refreshContents(); |
---|
2108 | 2542 | } |
---|
2109 | 2543 | } else |
---|
2110 | | - if (event.getSource() == resetsupportItem) |
---|
| 2544 | + if (source == resetsupportItem) |
---|
2111 | 2545 | { |
---|
2112 | 2546 | for (int i=0; i<group.selection.size(); i++) |
---|
2113 | 2547 | { |
---|
2114 | | - boolean random = CameraPane.RANDOM; |
---|
2115 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2548 | + boolean random = CameraPane.SWITCH; |
---|
| 2549 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2116 | 2550 | group.selection.get(i).linkVerticesThis(null); |
---|
2117 | | - CameraPane.RANDOM = random; |
---|
| 2551 | + CameraPane.SWITCH = random; |
---|
2118 | 2552 | } |
---|
2119 | 2553 | |
---|
2120 | 2554 | refreshContents(); |
---|
2121 | 2555 | } else |
---|
2122 | | - if (event.getSource() == relinkverticesItem) |
---|
| 2556 | + if (source == relinkverticesItem) |
---|
2123 | 2557 | { |
---|
2124 | | - boolean random = CameraPane.RANDOM; |
---|
2125 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2558 | + boolean random = CameraPane.SWITCH; |
---|
| 2559 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2126 | 2560 | group.selection.RelinkToSupport(); |
---|
2127 | | - CameraPane.RANDOM = random; |
---|
| 2561 | + CameraPane.SWITCH = random; |
---|
2128 | 2562 | |
---|
2129 | 2563 | refreshContents(); |
---|
2130 | 2564 | } else |
---|
2131 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2565 | + if (source == resetreferencesItem) |
---|
2132 | 2566 | { |
---|
2133 | 2567 | for (int i=0; i<group.selection.size(); i++) |
---|
2134 | 2568 | { |
---|
.. | .. |
---|
2137 | 2571 | |
---|
2138 | 2572 | refreshContents(); |
---|
2139 | 2573 | } else |
---|
2140 | | - if (event.getSource() == setMasterItem) |
---|
| 2574 | + if (source == setMasterItem) |
---|
2141 | 2575 | { |
---|
2142 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2576 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2143 | 2577 | { |
---|
2144 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2578 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2145 | 2579 | |
---|
2146 | 2580 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2147 | 2581 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2150 | 2584 | refreshContents(); |
---|
2151 | 2585 | } |
---|
2152 | 2586 | } else |
---|
2153 | | - if (event.getSource() == poseMeshItem) |
---|
| 2587 | + if (source == poseMeshItem) |
---|
2154 | 2588 | { |
---|
2155 | 2589 | if (group.selection.size() == 1) |
---|
2156 | 2590 | { |
---|
2157 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2591 | + if (Grafreed.clipboard.size() == 1) |
---|
2158 | 2592 | { |
---|
2159 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2593 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2160 | 2594 | |
---|
2161 | 2595 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2162 | 2596 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2169 | 2603 | } |
---|
2170 | 2604 | |
---|
2171 | 2605 | } else |
---|
2172 | | - if (event.getSource() == revertMeshItem) |
---|
| 2606 | + if (source == revertMeshItem) |
---|
2173 | 2607 | { |
---|
2174 | 2608 | RevertMeshes(); |
---|
2175 | 2609 | } else |
---|
2176 | | - if (event.getSource() == resetMeshItem) |
---|
| 2610 | + if (source == resetAllItem) |
---|
2177 | 2611 | { |
---|
2178 | 2612 | ResetAll(); |
---|
2179 | 2613 | } else |
---|
2180 | | - if (event.getSource() == stepAllItem) |
---|
| 2614 | + if (source == stepAllItem) |
---|
2181 | 2615 | { |
---|
2182 | 2616 | StepAll(); |
---|
2183 | 2617 | } else |
---|
2184 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2618 | + if (source == clearItem) // || event.getSource() == clearButton) |
---|
2185 | 2619 | { |
---|
2186 | 2620 | //int indices[] = jList.getSelectedIndices(); |
---|
2187 | 2621 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2189 | 2623 | |
---|
2190 | 2624 | ClearSelection(false); |
---|
2191 | 2625 | } else |
---|
2192 | | - if (event.getSource() == clearAllItem) |
---|
| 2626 | + if (source == clearAllItem) |
---|
2193 | 2627 | { |
---|
2194 | 2628 | ClearSelection(true); |
---|
2195 | 2629 | } else |
---|
2196 | | - if (event.getSource() == grabItem) |
---|
| 2630 | + if (source == grabItem || source == groupButton) |
---|
2197 | 2631 | { |
---|
2198 | | - group(new cGroup(), true); |
---|
| 2632 | + group(new cGroup(), false); // true); |
---|
2199 | 2633 | } else |
---|
2200 | | - if (event.getSource() == hideItem) |
---|
| 2634 | + if (source == hideItem) |
---|
2201 | 2635 | { |
---|
2202 | 2636 | group(new HiddenObject()); |
---|
2203 | 2637 | } else |
---|
2204 | | - if (event.getSource() == frontItem) |
---|
| 2638 | + if (source == frontItem) |
---|
2205 | 2639 | { |
---|
2206 | 2640 | front(); |
---|
2207 | 2641 | } else |
---|
2208 | | - if (event.getSource() == backItem) |
---|
| 2642 | + if (source == backItem) |
---|
2209 | 2643 | { |
---|
2210 | 2644 | back(); |
---|
2211 | 2645 | } else |
---|
2212 | | - if (event.getSource() == cameraItem) |
---|
| 2646 | + if (source == cameraItem) |
---|
2213 | 2647 | { |
---|
2214 | 2648 | makeSomething(new Camera()); |
---|
2215 | 2649 | } else |
---|
2216 | | - if (event.getSource() == compositeItem) |
---|
| 2650 | + if (source == compositeItem || source == compositeButton) |
---|
2217 | 2651 | { |
---|
2218 | 2652 | group(new Composite()); |
---|
2219 | 2653 | } else |
---|
2220 | | - if (event.getSource() == randomItem) |
---|
| 2654 | + if (source == switchItem || source == switchButton) |
---|
2221 | 2655 | { |
---|
2222 | 2656 | RandomNode random = new RandomNode(); |
---|
2223 | 2657 | group(random); |
---|
2224 | 2658 | if (random.size() > 0) |
---|
2225 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2659 | + random.name = random.get(0).name + "Switch"; |
---|
2226 | 2660 | } else |
---|
2227 | | - if (event.getSource() == physicsItem) |
---|
| 2661 | + if (source == physicsItem) |
---|
2228 | 2662 | { |
---|
2229 | 2663 | group(new PhysicsNode()); |
---|
2230 | 2664 | } else |
---|
2231 | | - if (event.getSource() == frameselectorItem) |
---|
| 2665 | + if (source == frameselectorItem) |
---|
2232 | 2666 | { |
---|
2233 | 2667 | for (int i=0; i<group.selection.size(); i++) |
---|
2234 | 2668 | { |
---|
.. | .. |
---|
2240 | 2674 | ResetModel(); |
---|
2241 | 2675 | refreshContents(); |
---|
2242 | 2676 | } else |
---|
2243 | | - if (event.getSource() == switchGeoItem) |
---|
| 2677 | + if (source == switchGeoItem) |
---|
2244 | 2678 | { |
---|
2245 | 2679 | for (int i=0; i<group.selection.size(); i++) |
---|
2246 | 2680 | { |
---|
.. | .. |
---|
2252 | 2686 | ResetModel(); |
---|
2253 | 2687 | refreshContents(); |
---|
2254 | 2688 | } else |
---|
2255 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2689 | + if (source == switchTransfoItem) |
---|
2256 | 2690 | { |
---|
2257 | 2691 | for (int i=0; i<group.selection.size(); i++) |
---|
2258 | 2692 | { |
---|
.. | .. |
---|
2264 | 2698 | ResetModel(); |
---|
2265 | 2699 | refreshContents(); |
---|
2266 | 2700 | } else |
---|
2267 | | - if (event.getSource() == morphItem) |
---|
| 2701 | + if (source == morphItem) |
---|
2268 | 2702 | { |
---|
2269 | 2703 | for (int i=0; i<group.selection.size(); i++) |
---|
2270 | 2704 | { |
---|
.. | .. |
---|
2276 | 2710 | ResetModel(); |
---|
2277 | 2711 | refreshContents(); |
---|
2278 | 2712 | } else |
---|
2279 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2713 | + if (source == scriptNodeItem) |
---|
2280 | 2714 | { |
---|
2281 | 2715 | boolean atleastone = false; |
---|
2282 | 2716 | |
---|
.. | .. |
---|
2315 | 2749 | } |
---|
2316 | 2750 | } |
---|
2317 | 2751 | } else |
---|
2318 | | - if (event.getSource() == linkerItem) |
---|
| 2752 | + if (source == linkerItem) |
---|
2319 | 2753 | { |
---|
2320 | 2754 | group(new cLinker()); |
---|
2321 | 2755 | } else |
---|
2322 | | - if (event.getSource() == textureItem) |
---|
| 2756 | + if (source == textureItem || source == textureButton) |
---|
2323 | 2757 | { |
---|
2324 | 2758 | group(new TextureNode()); |
---|
2325 | 2759 | } else |
---|
2326 | | - if (event.getSource() == billboardItem) |
---|
| 2760 | + if (source == billboardItem) |
---|
2327 | 2761 | { |
---|
2328 | 2762 | group(new BillboardNode()); |
---|
2329 | 2763 | } else |
---|
2330 | | - if (event.getSource() == shadowXItem) |
---|
| 2764 | + if (source == shadowXItem) |
---|
2331 | 2765 | { |
---|
2332 | 2766 | CastShadow(0); |
---|
2333 | 2767 | } else |
---|
2334 | | - if (event.getSource() == shadowYItem) |
---|
| 2768 | + if (source == shadowYItem) |
---|
2335 | 2769 | { |
---|
2336 | 2770 | CastShadow(1); |
---|
2337 | 2771 | } else |
---|
2338 | | - if (event.getSource() == shadowZItem) |
---|
| 2772 | + if (source == shadowZItem) |
---|
2339 | 2773 | { |
---|
2340 | 2774 | CastShadow(2); |
---|
2341 | 2775 | } else |
---|
2342 | | - if (event.getSource() == ungroupItem) |
---|
| 2776 | + if (source == ungroupItem || source == ungroupButton) |
---|
2343 | 2777 | { |
---|
2344 | | - //ungroup(); |
---|
| 2778 | + boolean hasRoot = false; |
---|
| 2779 | + |
---|
2345 | 2780 | for (int i=0; i<group.selection.size(); i++) |
---|
2346 | 2781 | { |
---|
2347 | | - Ungroup(group.selection.get(i)); |
---|
| 2782 | + if (group.selection.get(i) == group) |
---|
| 2783 | + { |
---|
| 2784 | + hasRoot = true; |
---|
| 2785 | + break; |
---|
| 2786 | + } |
---|
2348 | 2787 | } |
---|
2349 | 2788 | |
---|
2350 | | - ClearSelection(false); |
---|
2351 | | - |
---|
2352 | | - refreshContents(); |
---|
| 2789 | + if (!hasRoot) |
---|
| 2790 | + { |
---|
| 2791 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2792 | + { |
---|
| 2793 | + Ungroup(group.selection.get(i)); |
---|
| 2794 | + } |
---|
| 2795 | + |
---|
| 2796 | + ClearSelection(false); |
---|
| 2797 | + |
---|
| 2798 | + refreshContents(); |
---|
| 2799 | + } |
---|
2353 | 2800 | } else |
---|
2354 | | - if (event.getSource() == genUVItem) |
---|
| 2801 | + if (source == genUVItem) |
---|
2355 | 2802 | { |
---|
2356 | 2803 | GenUV(); |
---|
2357 | 2804 | } else |
---|
2358 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2805 | + if (source == genNormalsCADItem) |
---|
2359 | 2806 | { |
---|
2360 | 2807 | GenNormals(true); |
---|
2361 | 2808 | } else |
---|
2362 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 2809 | + if (source == genNormalsMESHItem) |
---|
2363 | 2810 | { |
---|
2364 | | - GenNormals(true); // TODO |
---|
| 2811 | + GenNormalsMESH(); |
---|
2365 | 2812 | } else |
---|
2366 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2813 | + if (source == genNormalsORGANItem) |
---|
2367 | 2814 | { |
---|
2368 | 2815 | GenNormals(false); |
---|
2369 | 2816 | } else |
---|
2370 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 2817 | + if (source == genNormalsMINEItem) |
---|
2371 | 2818 | { |
---|
2372 | 2819 | GenNormalsMINE(); |
---|
2373 | 2820 | } else |
---|
2374 | | - if (event.getSource() == stripifyItem) |
---|
| 2821 | + if (source == stripifyItem) |
---|
2375 | 2822 | { |
---|
2376 | 2823 | Stripify(); |
---|
2377 | 2824 | } else |
---|
2378 | | - if (event.getSource() == unstripifyItem) |
---|
| 2825 | + if (source == unstripifyItem) |
---|
2379 | 2826 | { |
---|
2380 | 2827 | Unstripify(); |
---|
2381 | 2828 | } else |
---|
2382 | | - if (event.getSource() == trimItem) |
---|
| 2829 | + if (source == trimItem) |
---|
2383 | 2830 | { |
---|
2384 | 2831 | Trim(); |
---|
2385 | 2832 | } else |
---|
2386 | | - if (event.getSource() == untrimItem) |
---|
| 2833 | + if (source == untrimItem) |
---|
2387 | 2834 | { |
---|
2388 | 2835 | Untrim(); |
---|
2389 | 2836 | } else |
---|
2390 | | - if (event.getSource() == clearColorsItem) |
---|
| 2837 | + if (source == clearColorsItem) |
---|
2391 | 2838 | { |
---|
2392 | 2839 | ClearColors(); |
---|
2393 | 2840 | } else |
---|
2394 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2841 | + if (source == clearMaterialsItem) |
---|
2395 | 2842 | { |
---|
2396 | 2843 | ClearMaterials(); |
---|
2397 | 2844 | } else |
---|
2398 | | - if (event.getSource() == liveleavesItem) |
---|
| 2845 | + if (source == liveleavesItem) |
---|
2399 | 2846 | { |
---|
2400 | 2847 | LiveLeaves(true); |
---|
2401 | 2848 | } else |
---|
2402 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2849 | + if (source == unliveleavesItem) |
---|
2403 | 2850 | { |
---|
2404 | 2851 | LiveLeaves(false); |
---|
2405 | 2852 | } else |
---|
2406 | | - if (event.getSource() == supportleavesItem) |
---|
| 2853 | + if (source == supportleavesItem) |
---|
2407 | 2854 | { |
---|
2408 | 2855 | SupportLeaves(true); |
---|
2409 | 2856 | } else |
---|
2410 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2857 | + if (source == unsupportleavesItem) |
---|
2411 | 2858 | { |
---|
2412 | 2859 | SupportLeaves(false); |
---|
2413 | 2860 | } else |
---|
2414 | | - if (event.getSource() == hideleavesItem) |
---|
| 2861 | + if (source == hideleavesItem) |
---|
2415 | 2862 | { |
---|
2416 | 2863 | HideLeaves(true); |
---|
2417 | 2864 | } else |
---|
2418 | | - if (event.getSource() == showleavesItem) |
---|
| 2865 | + if (source == showleavesItem) |
---|
2419 | 2866 | { |
---|
2420 | 2867 | HideLeaves(false); |
---|
2421 | 2868 | } else |
---|
2422 | | - if (event.getSource() == markleavesItem) |
---|
| 2869 | + if (source == markleavesItem) |
---|
2423 | 2870 | { |
---|
2424 | 2871 | MarkLeaves(true); |
---|
2425 | 2872 | } else |
---|
2426 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2873 | + if (source == unmarkleavesItem) |
---|
2427 | 2874 | { |
---|
2428 | 2875 | MarkLeaves(false); |
---|
2429 | 2876 | } else |
---|
2430 | | - if (event.getSource() == flipVItem) |
---|
| 2877 | + if (source == rewindleavesItem) |
---|
| 2878 | + { |
---|
| 2879 | + RewindLeaves(true); |
---|
| 2880 | + } else |
---|
| 2881 | + if (source == unrewindleavesItem) |
---|
| 2882 | + { |
---|
| 2883 | + RewindLeaves(false); |
---|
| 2884 | + } else |
---|
| 2885 | + if (source == randomleavesItem) |
---|
| 2886 | + { |
---|
| 2887 | + RandomLeaves(true); |
---|
| 2888 | + } else |
---|
| 2889 | + if (source == unrandomleavesItem) |
---|
| 2890 | + { |
---|
| 2891 | + RandomLeaves(false); |
---|
| 2892 | + } else |
---|
| 2893 | + if (source == flipVItem) |
---|
2431 | 2894 | { |
---|
2432 | 2895 | FlipV(true); |
---|
2433 | 2896 | } else |
---|
2434 | | - if (event.getSource() == unflipVItem) |
---|
| 2897 | + if (source == unflipVItem) |
---|
2435 | 2898 | { |
---|
2436 | 2899 | FlipV(false); |
---|
2437 | 2900 | } else |
---|
2438 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2901 | + if (source == lowTexturesItem) |
---|
2439 | 2902 | { |
---|
2440 | 2903 | SetTexRes(0); |
---|
2441 | 2904 | } else |
---|
2442 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2905 | + if (source == normalTexturesItem) |
---|
2443 | 2906 | { |
---|
2444 | 2907 | SetTexRes(1); |
---|
2445 | 2908 | } else |
---|
2446 | | - if (event.getSource() == highTexturesItem) |
---|
| 2909 | + if (source == highTexturesItem) |
---|
2447 | 2910 | { |
---|
2448 | 2911 | SetTexRes(2); |
---|
2449 | 2912 | } else |
---|
2450 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2913 | + if (source == veryhighTexturesItem) |
---|
2451 | 2914 | { |
---|
2452 | 2915 | SetTexRes(3); |
---|
2453 | 2916 | } else |
---|
2454 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2917 | + if (source == maxTexturesItem) |
---|
2455 | 2918 | { |
---|
2456 | 2919 | SetTexRes(4); |
---|
2457 | 2920 | } else |
---|
2458 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2921 | + if (source == panoTexturesItem) |
---|
2459 | 2922 | { |
---|
2460 | 2923 | SetTexRes(5); |
---|
2461 | 2924 | } else |
---|
2462 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2925 | + if (source == reverseNormalsItem) |
---|
2463 | 2926 | { |
---|
2464 | 2927 | ReverseNormals(); |
---|
2465 | 2928 | } else |
---|
2466 | | - if (event.getSource() == parseverticesItem) |
---|
| 2929 | + if (source == parseverticesItem) |
---|
2467 | 2930 | { |
---|
2468 | 2931 | ParseVertices(); |
---|
2469 | 2932 | } else |
---|
2470 | | - if (event.getSource() == textureFieldItem) |
---|
| 2933 | + if (source == textureFieldItem) |
---|
2471 | 2934 | { |
---|
2472 | 2935 | TextureVertices(); |
---|
2473 | 2936 | } else |
---|
2474 | | - if (event.getSource() == alignItem) |
---|
| 2937 | + if (source == alignItem) |
---|
2475 | 2938 | { |
---|
2476 | 2939 | Align(); |
---|
2477 | 2940 | } else |
---|
2478 | | - if (event.getSource() == mirrorItem) |
---|
| 2941 | + if (source == mirrorItem) |
---|
2479 | 2942 | { |
---|
2480 | 2943 | MirrorPoses(); |
---|
2481 | 2944 | } else |
---|
2482 | | - if (event.getSource() == reduceMorphItem) |
---|
| 2945 | + if (source == reduceMorphItem) |
---|
2483 | 2946 | { |
---|
2484 | 2947 | MeshReduction(false); |
---|
2485 | 2948 | } else |
---|
2486 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 2949 | + if (source == reduce34MorphItem) |
---|
2487 | 2950 | { |
---|
2488 | 2951 | MeshReduction(true); |
---|
2489 | 2952 | } else |
---|
2490 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 2953 | + if (source == reverseTrianglesItem) |
---|
2491 | 2954 | { |
---|
2492 | 2955 | ReverseTriangles(); |
---|
2493 | 2956 | } else |
---|
2494 | | - if (event.getSource() == reduceMeshItem) |
---|
| 2957 | + if (source == reduceMeshItem) |
---|
2495 | 2958 | { |
---|
2496 | 2959 | ReduceMesh(false); |
---|
2497 | 2960 | } else |
---|
2498 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 2961 | + if (source == reduce34MeshItem) |
---|
2499 | 2962 | { |
---|
2500 | 2963 | ReduceMesh(true); |
---|
2501 | 2964 | } else |
---|
2502 | | - if (event.getSource() == increaseMeshItem) |
---|
| 2965 | + if (source == increaseMeshItem) |
---|
2503 | 2966 | { |
---|
2504 | 2967 | IncreaseMesh(); |
---|
2505 | 2968 | } else |
---|
2506 | | - if (event.getSource() == clipMeshItem) |
---|
| 2969 | + if (source == clipMeshItem) |
---|
2507 | 2970 | { |
---|
2508 | 2971 | ClipMesh(); |
---|
2509 | 2972 | } else |
---|
2510 | | - if (event.getSource() == smoothMeshItem) |
---|
| 2973 | + if (source == smoothMeshItem) |
---|
2511 | 2974 | { |
---|
2512 | 2975 | SmoothMesh(); |
---|
2513 | 2976 | } else |
---|
2514 | | - if (event.getSource() == transformgeometryItem) |
---|
| 2977 | + if (source == transformGeometryItem) |
---|
2515 | 2978 | { |
---|
2516 | 2979 | TransformGeometry(); |
---|
2517 | 2980 | } else |
---|
2518 | | - if (event.getSource() == resetTransformItem) |
---|
| 2981 | + if (source == transformChildrenItem) |
---|
| 2982 | + { |
---|
| 2983 | + TransformChildren(); |
---|
| 2984 | + } else |
---|
| 2985 | + if (source == resetTransformItem) |
---|
2519 | 2986 | { |
---|
2520 | 2987 | ResetTransform(); |
---|
2521 | 2988 | } else |
---|
2522 | | - if (event.getSource() == resetCentroidItem) |
---|
| 2989 | + if (source == resetCentroidItem) |
---|
2523 | 2990 | { |
---|
2524 | | - ResetCentroid(); |
---|
| 2991 | + ResetCentroid(true); |
---|
2525 | 2992 | } else |
---|
2526 | | - if (event.getSource() == resetParentItem) |
---|
| 2993 | + if (source == resetCentroidXZItem) |
---|
| 2994 | + { |
---|
| 2995 | + ResetCentroid(false); |
---|
| 2996 | + } else |
---|
| 2997 | + if (source == resetParentItem) |
---|
2527 | 2998 | { |
---|
2528 | 2999 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2529 | 3000 | { |
---|
.. | .. |
---|
2533 | 3004 | |
---|
2534 | 3005 | refreshContents(); |
---|
2535 | 3006 | } else |
---|
2536 | | - if (event.getSource() == repairParentItem) |
---|
| 3007 | + if (source == repairParentItem) |
---|
2537 | 3008 | { |
---|
2538 | 3009 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2539 | 3010 | { |
---|
.. | .. |
---|
2547 | 3018 | |
---|
2548 | 3019 | refreshContents(); |
---|
2549 | 3020 | } else |
---|
2550 | | - if (event.getSource() == repairShadowItem) |
---|
| 3021 | + if (source == repairShadowItem) |
---|
2551 | 3022 | { |
---|
2552 | 3023 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2553 | 3024 | { |
---|
.. | .. |
---|
2561 | 3032 | |
---|
2562 | 3033 | refreshContents(); |
---|
2563 | 3034 | } else |
---|
2564 | | - if (event.getSource() == sortbysizeItem) |
---|
| 3035 | + if (source == sortbysizeItem) |
---|
2565 | 3036 | { |
---|
2566 | 3037 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2567 | 3038 | { |
---|
.. | .. |
---|
2573 | 3044 | ResetModel(); |
---|
2574 | 3045 | refreshContents(); |
---|
2575 | 3046 | } else |
---|
2576 | | - if (event.getSource() == sortbynameItem) |
---|
| 3047 | + if (source == sortbynameItem) |
---|
2577 | 3048 | { |
---|
2578 | 3049 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2579 | 3050 | { |
---|
.. | .. |
---|
2585 | 3056 | ResetModel(); |
---|
2586 | 3057 | refreshContents(); |
---|
2587 | 3058 | } else |
---|
2588 | | - if (event.getSource() == attachPigmentItem) |
---|
| 3059 | + if (source == attachPigmentItem) |
---|
2589 | 3060 | { |
---|
2590 | 3061 | String texture = GetFile("Attach pigment"); |
---|
2591 | 3062 | Object3D obj; |
---|
.. | .. |
---|
2597 | 3068 | |
---|
2598 | 3069 | refreshContents(); |
---|
2599 | 3070 | } else |
---|
2600 | | - if (event.getSource() == detachPigmentItem) |
---|
| 3071 | + if (source == detachPigmentItem) |
---|
2601 | 3072 | { |
---|
2602 | 3073 | Object3D obj; |
---|
2603 | 3074 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2608 | 3079 | |
---|
2609 | 3080 | refreshContents(); |
---|
2610 | 3081 | } else |
---|
2611 | | - if (event.getSource() == attachBumpItem) |
---|
| 3082 | + if (source == attachBumpItem) |
---|
2612 | 3083 | { |
---|
2613 | 3084 | String texture = GetFile("Attach bump"); |
---|
2614 | 3085 | Object3D obj; |
---|
.. | .. |
---|
2620 | 3091 | |
---|
2621 | 3092 | refreshContents(); |
---|
2622 | 3093 | } else |
---|
2623 | | - if (event.getSource() == detachBumpItem) |
---|
| 3094 | + if (source == detachBumpItem) |
---|
2624 | 3095 | { |
---|
2625 | 3096 | Object3D obj; |
---|
2626 | 3097 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2631 | 3102 | |
---|
2632 | 3103 | refreshContents(); |
---|
2633 | 3104 | } else |
---|
2634 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 3105 | + if (source == pigmentBumpItem) |
---|
2635 | 3106 | { |
---|
2636 | 3107 | Object3D obj; |
---|
2637 | 3108 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2642 | 3113 | |
---|
2643 | 3114 | refreshContents(); |
---|
2644 | 3115 | } else |
---|
2645 | | - if (event.getSource() == flashSelectionButton) |
---|
| 3116 | + if (source == flashSelectionButton) |
---|
2646 | 3117 | { |
---|
2647 | 3118 | CameraPane.flash = true; |
---|
2648 | 3119 | refreshContents(); |
---|
2649 | 3120 | } else |
---|
2650 | | - if (event.getSource() == oneButton) |
---|
| 3121 | + if (source == oneButton) |
---|
2651 | 3122 | { |
---|
2652 | 3123 | } else |
---|
2653 | | - if (event.getSource() == twoButton) |
---|
| 3124 | + if (source == twoButton) |
---|
2654 | 3125 | { |
---|
2655 | 3126 | radio.layout = twoButton; |
---|
| 3127 | + |
---|
| 3128 | + if (CameraPane.FULLSCREEN) |
---|
| 3129 | + fullscreenLayout = radio.layout; |
---|
| 3130 | + |
---|
2656 | 3131 | // bug |
---|
2657 | 3132 | //gridPanel.setDividerLocation(1.0); |
---|
2658 | 3133 | //bigPanel.setDividerLocation(0.0); |
---|
2659 | | - bigThree.remove(scenePanel); |
---|
2660 | | - bigThree.remove(centralPanel); |
---|
2661 | | - bigThree.remove(XYZPanel); |
---|
2662 | | - aWindowConstraints.gridx = 0; |
---|
2663 | | - aWindowConstraints.gridy = 0; |
---|
2664 | | - aWindowConstraints.gridwidth = 1; |
---|
2665 | | - // aConstraints.gridheight = 3; |
---|
2666 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2667 | | - aWindowConstraints.weightx = 0; |
---|
2668 | | - aWindowConstraints.weighty = 1; |
---|
2669 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2670 | | - aWindowConstraints.weightx = 1; |
---|
2671 | | - aWindowConstraints.gridwidth = 3; |
---|
2672 | | - // aConstraints.gridheight = 3; |
---|
2673 | | - aWindowConstraints.gridx = 1; |
---|
2674 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2675 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2676 | | - aWindowConstraints.weightx = 0; |
---|
2677 | | - aWindowConstraints.gridx = 4; |
---|
2678 | | - aWindowConstraints.gridwidth = 1; |
---|
2679 | | - // aConstraints.gridheight = 3; |
---|
2680 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2681 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2682 | | - bigThree.revalidate(); |
---|
| 3134 | +// bigThree.remove(scenePanel); |
---|
| 3135 | +// bigThree.remove(centralPanel); |
---|
| 3136 | +// bigThree.remove(XYZPanel); |
---|
| 3137 | +// aWindowConstraints.gridx = 0; |
---|
| 3138 | +// aWindowConstraints.gridy = 0; |
---|
| 3139 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3140 | +// // aConstraints.gridheight = 3; |
---|
| 3141 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3142 | +// aWindowConstraints.weightx = 0; |
---|
| 3143 | +// aWindowConstraints.weighty = 1; |
---|
| 3144 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3145 | +// aWindowConstraints.weightx = 1; |
---|
| 3146 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3147 | +// // aConstraints.gridheight = 3; |
---|
| 3148 | +// aWindowConstraints.gridx = 1; |
---|
| 3149 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3150 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3151 | +// aWindowConstraints.weightx = 0; |
---|
| 3152 | +// aWindowConstraints.gridx = 4; |
---|
| 3153 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3154 | +// // aConstraints.gridheight = 3; |
---|
| 3155 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3156 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3157 | +// scenePanel.setVisible(false); |
---|
| 3158 | +// centralPanel.setVisible(true); |
---|
| 3159 | +// XYZPanel.setVisible(false); |
---|
| 3160 | + bigThree.ClearUI(); |
---|
| 3161 | + bigThree.add(centralPanel); |
---|
| 3162 | + bigThree.FlushUI(); |
---|
| 3163 | + |
---|
| 3164 | + cameraView.requestFocusInWindow(); |
---|
| 3165 | + |
---|
| 3166 | +// refreshContents(true); |
---|
| 3167 | +// |
---|
| 3168 | +// try |
---|
| 3169 | +// { |
---|
| 3170 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3171 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3172 | +// bot.mouseMove(100, 100); |
---|
| 3173 | +// bot.mousePress(mask); |
---|
| 3174 | +// bot.mouseRelease(mask); |
---|
| 3175 | +// } |
---|
| 3176 | +// catch (Exception e) |
---|
| 3177 | +// { |
---|
| 3178 | +// |
---|
| 3179 | +// } |
---|
| 3180 | + |
---|
2683 | 3181 | } else |
---|
2684 | | - if (event.getSource() == threeButton) |
---|
| 3182 | + if (source == threeButton) |
---|
2685 | 3183 | { |
---|
2686 | 3184 | radio.layout = threeButton; |
---|
2687 | | - bigThree.remove(scenePanel); |
---|
2688 | | - bigThree.remove(centralPanel); |
---|
2689 | | - bigThree.remove(XYZPanel); |
---|
2690 | | - aWindowConstraints.gridx = 0; |
---|
2691 | | - aWindowConstraints.gridy = 0; |
---|
2692 | | - aWindowConstraints.gridwidth = 1; |
---|
2693 | | - // aConstraints.gridheight = 3; |
---|
2694 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2695 | | - aWindowConstraints.weightx = 0; |
---|
2696 | | - aWindowConstraints.weighty = 1; |
---|
2697 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2698 | | - aWindowConstraints.weightx = 1; |
---|
2699 | | - aWindowConstraints.gridwidth = 3; |
---|
2700 | | - // aConstraints.gridheight = 3; |
---|
2701 | | - aWindowConstraints.gridx = 1; |
---|
2702 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2703 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2704 | | - aWindowConstraints.weightx = 0; |
---|
2705 | | - aWindowConstraints.gridx = 4; |
---|
2706 | | - aWindowConstraints.gridwidth = 1; |
---|
2707 | | - // aConstraints.gridheight = 3; |
---|
2708 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2709 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2710 | | - bigThree.revalidate(); |
---|
| 3185 | + |
---|
| 3186 | + if (CameraPane.FULLSCREEN) |
---|
| 3187 | + fullscreenLayout = radio.layout; |
---|
| 3188 | + |
---|
| 3189 | +// bigThree.remove(scenePanel); |
---|
| 3190 | +// bigThree.remove(centralPanel); |
---|
| 3191 | +// bigThree.remove(XYZPanel); |
---|
| 3192 | +// aWindowConstraints.gridx = 0; |
---|
| 3193 | +// aWindowConstraints.gridy = 0; |
---|
| 3194 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3195 | +// // aConstraints.gridheight = 3; |
---|
| 3196 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3197 | +// aWindowConstraints.weightx = 0; |
---|
| 3198 | +// aWindowConstraints.weighty = 1; |
---|
| 3199 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3200 | +// aWindowConstraints.weightx = 1; |
---|
| 3201 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3202 | +// // aConstraints.gridheight = 3; |
---|
| 3203 | +// aWindowConstraints.gridx = 1; |
---|
| 3204 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3205 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3206 | +// aWindowConstraints.weightx = 0; |
---|
| 3207 | +// aWindowConstraints.gridx = 4; |
---|
| 3208 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3209 | +// // aConstraints.gridheight = 3; |
---|
| 3210 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3211 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3212 | +// bigThree.validate(); |
---|
| 3213 | +// scenePanel.setVisible(false); |
---|
| 3214 | +// centralPanel.setVisible(true); |
---|
| 3215 | +// XYZPanel.setVisible(true); |
---|
| 3216 | + bigThree.ClearUI(); |
---|
| 3217 | + bigThree.add(centralPanel); |
---|
| 3218 | + bigThree.add(XYZPanel); |
---|
| 3219 | + bigThree.FlushUI(); |
---|
| 3220 | + |
---|
| 3221 | + cameraView.requestFocusInWindow(); |
---|
2711 | 3222 | } else |
---|
2712 | | - if (event.getSource() == fourButton) |
---|
| 3223 | + if (source == fourButton) |
---|
2713 | 3224 | { |
---|
2714 | 3225 | radio.layout = fourButton; |
---|
2715 | | - bigThree.remove(scenePanel); |
---|
2716 | | - bigThree.remove(centralPanel); |
---|
2717 | | - bigThree.remove(XYZPanel); |
---|
2718 | | - aWindowConstraints.gridx = 0; |
---|
2719 | | - aWindowConstraints.gridy = 0; |
---|
2720 | | - aWindowConstraints.gridwidth = 1; |
---|
2721 | | - // aWindowConstraints.gridheight = 3; |
---|
2722 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2723 | | - aWindowConstraints.weightx = 1; |
---|
2724 | | - aWindowConstraints.weighty = 1; |
---|
2725 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2726 | | - aWindowConstraints.weightx = 1; |
---|
2727 | | - aWindowConstraints.gridwidth = 3; |
---|
2728 | | - // aConstraints.gridheight = 3; |
---|
2729 | | - aWindowConstraints.gridx = 1; |
---|
2730 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2731 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2732 | | - aWindowConstraints.weightx = 0; |
---|
2733 | | - aWindowConstraints.gridx = 4; |
---|
2734 | | - aWindowConstraints.gridwidth = 1; |
---|
2735 | | - // aWindowConstraints.gridheight = 3; |
---|
2736 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2737 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2738 | | - bigThree.revalidate(); |
---|
| 3226 | + |
---|
| 3227 | + if (CameraPane.FULLSCREEN) |
---|
| 3228 | + fullscreenLayout = radio.layout; |
---|
| 3229 | + |
---|
| 3230 | +// bigThree.remove(scenePanel); |
---|
| 3231 | +// bigThree.remove(centralPanel); |
---|
| 3232 | +// bigThree.remove(XYZPanel); |
---|
| 3233 | +// aWindowConstraints.gridx = 0; |
---|
| 3234 | +// aWindowConstraints.gridy = 0; |
---|
| 3235 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3236 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3237 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3238 | +// aWindowConstraints.weightx = 1; |
---|
| 3239 | +// aWindowConstraints.weighty = 1; |
---|
| 3240 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3241 | +// aWindowConstraints.weightx = 1; |
---|
| 3242 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3243 | +// // aConstraints.gridheight = 3; |
---|
| 3244 | +// aWindowConstraints.gridx = 1; |
---|
| 3245 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3246 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3247 | +// aWindowConstraints.weightx = 0; |
---|
| 3248 | +// aWindowConstraints.gridx = 4; |
---|
| 3249 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3250 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3251 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3252 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3253 | +// bigThree.validate(); |
---|
| 3254 | +// scenePanel.setVisible(true); |
---|
| 3255 | +// centralPanel.setVisible(false); |
---|
| 3256 | +// XYZPanel.setVisible(false); |
---|
| 3257 | + bigThree.ClearUI(); |
---|
| 3258 | + bigThree.add(scenePanel); |
---|
| 3259 | + bigThree.FlushUI(); |
---|
| 3260 | + |
---|
| 3261 | + cameraView.requestFocusInWindow(); |
---|
2739 | 3262 | } else |
---|
2740 | | - if (event.getSource() == sixButton) |
---|
| 3263 | + if (source == sixButton) |
---|
2741 | 3264 | { |
---|
2742 | 3265 | radio.layout = sixButton; |
---|
2743 | | - bigThree.remove(scenePanel); |
---|
2744 | | - bigThree.remove(centralPanel); |
---|
2745 | | - bigThree.remove(XYZPanel); |
---|
2746 | | - aWindowConstraints.gridx = 0; |
---|
2747 | | - aWindowConstraints.gridy = 0; |
---|
2748 | | - aWindowConstraints.gridwidth = 1; |
---|
2749 | | - // aConstraints.gridheight = 3; |
---|
2750 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2751 | | - aWindowConstraints.weightx = 0; |
---|
2752 | | - aWindowConstraints.weighty = 1; |
---|
2753 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2754 | | - aWindowConstraints.weightx = 1; |
---|
2755 | | - aWindowConstraints.gridwidth = 3; |
---|
2756 | | - // aWindowConstraints.gridheight = 3; |
---|
2757 | | - aWindowConstraints.gridx = 1; |
---|
2758 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2759 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2760 | | - aWindowConstraints.weightx = 0; |
---|
2761 | | - aWindowConstraints.gridx = 4; |
---|
2762 | | - aWindowConstraints.gridwidth = 1; |
---|
2763 | | - // aWindowConstraints.gridheight = 3; |
---|
2764 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2765 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2766 | | - bigThree.revalidate(); |
---|
| 3266 | + |
---|
| 3267 | + if (CameraPane.FULLSCREEN) |
---|
| 3268 | + fullscreenLayout = radio.layout; |
---|
| 3269 | + |
---|
| 3270 | +// bigThree.remove(scenePanel); |
---|
| 3271 | +// bigThree.remove(centralPanel); |
---|
| 3272 | +// bigThree.remove(XYZPanel); |
---|
| 3273 | +// aWindowConstraints.gridx = 0; |
---|
| 3274 | +// aWindowConstraints.gridy = 0; |
---|
| 3275 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3276 | +// // aConstraints.gridheight = 3; |
---|
| 3277 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3278 | +// aWindowConstraints.weightx = 0; |
---|
| 3279 | +// aWindowConstraints.weighty = 1; |
---|
| 3280 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3281 | +// aWindowConstraints.weightx = 1; |
---|
| 3282 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3283 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3284 | +// aWindowConstraints.gridx = 1; |
---|
| 3285 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3286 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3287 | +// aWindowConstraints.weightx = 0; |
---|
| 3288 | +// aWindowConstraints.gridx = 4; |
---|
| 3289 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3290 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3291 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3292 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3293 | +// bigThree.validate(); |
---|
| 3294 | +// scenePanel.setVisible(true); |
---|
| 3295 | +// centralPanel.setVisible(true); |
---|
| 3296 | +// XYZPanel.setVisible(false); |
---|
| 3297 | + bigThree.ClearUI(); |
---|
| 3298 | + bigThree.add(scenePanel); |
---|
| 3299 | + bigThree.add(centralPanel); |
---|
| 3300 | + bigThree.FlushUI(); |
---|
| 3301 | + |
---|
| 3302 | + cameraView.requestFocusInWindow(); |
---|
2767 | 3303 | } else |
---|
2768 | | - if (event.getSource() == sevenButton) |
---|
| 3304 | + if (source == sevenButton) |
---|
2769 | 3305 | { |
---|
2770 | 3306 | radio.layout = sevenButton; |
---|
2771 | | - bigThree.remove(scenePanel); |
---|
2772 | | - bigThree.remove(centralPanel); |
---|
2773 | | - bigThree.remove(XYZPanel); |
---|
2774 | | - aWindowConstraints.gridx = 0; |
---|
2775 | | - aWindowConstraints.gridy = 0; |
---|
2776 | | - aWindowConstraints.gridwidth = 1; |
---|
2777 | | - // aWindowConstraints.gridheight = 3; |
---|
2778 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2779 | | - aWindowConstraints.weightx = 0; |
---|
2780 | | - aWindowConstraints.weighty = 1; |
---|
2781 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2782 | | - aWindowConstraints.weightx = 1; |
---|
2783 | | - aWindowConstraints.gridwidth = 3; |
---|
2784 | | - // aWindowConstraints.gridheight = 3; |
---|
2785 | | - aWindowConstraints.gridx = 1; |
---|
2786 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2787 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2788 | | - aWindowConstraints.weightx = 0; |
---|
2789 | | - aWindowConstraints.gridx = 4; |
---|
2790 | | - aWindowConstraints.gridwidth = 1; |
---|
2791 | | - // aConstraints.gridheight = 3; |
---|
2792 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2793 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2794 | | - bigThree.revalidate(); |
---|
| 3307 | + |
---|
| 3308 | + if (CameraPane.FULLSCREEN) |
---|
| 3309 | + fullscreenLayout = radio.layout; |
---|
| 3310 | + |
---|
| 3311 | +// bigThree.remove(scenePanel); |
---|
| 3312 | +// bigThree.remove(centralPanel); |
---|
| 3313 | +// bigThree.remove(XYZPanel); |
---|
| 3314 | +// aWindowConstraints.gridx = 0; |
---|
| 3315 | +// aWindowConstraints.gridy = 0; |
---|
| 3316 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3317 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3318 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3319 | +// aWindowConstraints.weightx = 0; |
---|
| 3320 | +// aWindowConstraints.weighty = 1; |
---|
| 3321 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3322 | +// aWindowConstraints.weightx = 1; |
---|
| 3323 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3324 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3325 | +// aWindowConstraints.gridx = 1; |
---|
| 3326 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3327 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3328 | +// aWindowConstraints.weightx = 0; |
---|
| 3329 | +// aWindowConstraints.gridx = 4; |
---|
| 3330 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3331 | +// // aConstraints.gridheight = 3; |
---|
| 3332 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3333 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3334 | +// bigThree.validate(); |
---|
| 3335 | +// scenePanel.setVisible(true); |
---|
| 3336 | +// centralPanel.setVisible(true); |
---|
| 3337 | +// XYZPanel.setVisible(true); |
---|
| 3338 | + bigThree.ClearUI(); |
---|
| 3339 | + bigThree.add(scenePanel); |
---|
| 3340 | + bigThree.add(centralPanel); |
---|
| 3341 | + bigThree.add(XYZPanel); |
---|
| 3342 | + bigThree.FlushUI(); |
---|
| 3343 | + |
---|
| 3344 | + cameraView.requestFocusInWindow(); |
---|
2795 | 3345 | } else |
---|
2796 | | - if (event.getSource() == rootButton) |
---|
| 3346 | + if (source == rootButton) |
---|
2797 | 3347 | { |
---|
2798 | 3348 | Object3D obj; |
---|
2799 | 3349 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2803 | 3353 | EditObject(obj); |
---|
2804 | 3354 | } |
---|
2805 | 3355 | |
---|
| 3356 | + cameraView.requestFocusInWindow(); |
---|
2806 | 3357 | refreshContents(true); |
---|
2807 | 3358 | } else |
---|
2808 | | - if (event.getSource() == closeButton) |
---|
| 3359 | + if (source == closeButton) |
---|
2809 | 3360 | { |
---|
2810 | 3361 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2811 | 3362 | cRadio ab; |
---|
2812 | 3363 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2813 | 3364 | { |
---|
2814 | 3365 | ab = (cRadio)e.nextElement(); |
---|
2815 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3366 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2816 | 3367 | { |
---|
| 3368 | + // Patch to avoid bug with transparency. |
---|
| 3369 | + if (!ab.hadMaterial) |
---|
| 3370 | + { |
---|
| 3371 | + ab.object.material = null; |
---|
| 3372 | + } |
---|
| 3373 | + |
---|
2817 | 3374 | buttonGroup.remove(ab); |
---|
2818 | 3375 | radioPanel.remove(ab); |
---|
2819 | 3376 | |
---|
2820 | | - ab.GetObject().editWindow = null; |
---|
| 3377 | + //ab.GetObject().editWindow = null; |
---|
| 3378 | + ab.GetObject().manipWindow = null; |
---|
2821 | 3379 | // ab.GetObject().objectUI = null; // ????????? |
---|
2822 | 3380 | |
---|
2823 | 3381 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2824 | 3382 | break; |
---|
2825 | 3383 | } |
---|
2826 | 3384 | } |
---|
| 3385 | + |
---|
| 3386 | + cameraView.requestFocusInWindow(); |
---|
2827 | 3387 | refreshContents(true); |
---|
2828 | 3388 | } else |
---|
2829 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3389 | + if (source == editItem || source == editButton) |
---|
2830 | 3390 | { |
---|
| 3391 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3392 | + { |
---|
| 3393 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3394 | + child.pinned = true; |
---|
| 3395 | + } |
---|
| 3396 | + |
---|
2831 | 3397 | EditSelection(false); |
---|
2832 | 3398 | } else |
---|
2833 | | - if (event.getSource() == uneditButton) |
---|
| 3399 | + if (source == uneditButton) |
---|
2834 | 3400 | { |
---|
2835 | 3401 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2836 | 3402 | { |
---|
2837 | 3403 | Object3D child = (Object3D)e.nextElement(); |
---|
2838 | 3404 | if(child.editWindow != null) |
---|
2839 | 3405 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3406 | + child.pinned = false; |
---|
2840 | 3407 | child.CloseUI(); |
---|
2841 | 3408 | listUI.remove(child); |
---|
2842 | 3409 | |
---|
2843 | | - child.editWindow = null; // ??????????? |
---|
| 3410 | + //child.editWindow = null; // ??????????? |
---|
2844 | 3411 | } |
---|
2845 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3412 | + objEditor.ctrlPanel.FlushUI(); |
---|
2846 | 3413 | //objEditor.jTree.clearSelection(); |
---|
2847 | 3414 | //objEditor.ResetSliders(); |
---|
2848 | 3415 | refreshContents(true); |
---|
2849 | 3416 | } else |
---|
2850 | | - if (event.getSource() == clearPanelButton) |
---|
| 3417 | + if (source == clearPanelButton) |
---|
2851 | 3418 | { |
---|
2852 | 3419 | assert(copy == group); |
---|
2853 | 3420 | //copy.ClearUI(); |
---|
2854 | 3421 | for (Object3D obj : listUI) |
---|
2855 | 3422 | { |
---|
| 3423 | + obj.pinned = false; |
---|
2856 | 3424 | obj.CloseUI(); |
---|
2857 | 3425 | } |
---|
2858 | 3426 | listUI.clear(); |
---|
2859 | 3427 | refreshContents(true); |
---|
2860 | 3428 | } else |
---|
2861 | | - if (event.getSource() == allParamsButton) |
---|
| 3429 | + if (source == allParamsButton) |
---|
2862 | 3430 | { |
---|
2863 | 3431 | assert(copy == group); |
---|
2864 | 3432 | |
---|
2865 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3433 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2866 | 3434 | |
---|
2867 | 3435 | for (Object3D obj : listUI) |
---|
2868 | 3436 | { |
---|
.. | .. |
---|
2879 | 3447 | |
---|
2880 | 3448 | refreshContents(true); |
---|
2881 | 3449 | } else |
---|
2882 | | - if (event.getSource() == unselectButton) |
---|
| 3450 | + if (source == unselectButton) |
---|
2883 | 3451 | { |
---|
2884 | 3452 | objEditor.jTree.clearSelection(); |
---|
2885 | 3453 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2886 | 3454 | objEditor.ResetSliders(); |
---|
2887 | 3455 | refreshContents(true); |
---|
2888 | 3456 | } else |
---|
2889 | | - if(event.getSource() instanceof cRadio) |
---|
| 3457 | + if(source instanceof cRadio) |
---|
2890 | 3458 | { |
---|
2891 | 3459 | group.parent = keepparent; |
---|
2892 | 3460 | group.attributes = 0; |
---|
2893 | 3461 | //group.editWindow = null; |
---|
2894 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3462 | + /*cRadio*/ radio = (cRadio)source; |
---|
2895 | 3463 | Object3D obj = radio.GetObject(); |
---|
2896 | 3464 | System.out.println("Edit " + obj); |
---|
2897 | 3465 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2911 | 3479 | } |
---|
2912 | 3480 | |
---|
2913 | 3481 | copy = group; |
---|
2914 | | - //CameraPane.theRenderer.object = group; |
---|
| 3482 | + //Globals.theRenderer.object = group; |
---|
2915 | 3483 | if(!useclient) |
---|
2916 | 3484 | { |
---|
2917 | 3485 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2920 | 3488 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2921 | 3489 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2922 | 3490 | cameraView.object = group; |
---|
2923 | | - cameraView.lighttouched = true; |
---|
| 3491 | + //cameraView.lighttouched = true; |
---|
| 3492 | + Globals.lighttouched = true; |
---|
2924 | 3493 | topView.object = group; |
---|
2925 | 3494 | frontView.object = group; |
---|
2926 | 3495 | sideView.object = group; |
---|
2927 | 3496 | } |
---|
2928 | | - group.editWindow = this; |
---|
| 3497 | + |
---|
| 3498 | +// fix "+" issue |
---|
| 3499 | + //group.editWindow = this; |
---|
| 3500 | + group.manipWindow = this; |
---|
| 3501 | + |
---|
2929 | 3502 | /* |
---|
2930 | 3503 | currentLayout = radio.layout; |
---|
2931 | 3504 | if (currentLayout == null) |
---|
2932 | 3505 | currentLayout = sevenButton; |
---|
2933 | 3506 | */ |
---|
2934 | 3507 | radio.layout.doClick(); |
---|
| 3508 | + |
---|
| 3509 | + ClearUnpinned(); |
---|
| 3510 | + SetPinStates(group.selection.size() > 0); |
---|
| 3511 | + if (group.selection.size() == 1) |
---|
| 3512 | + EditSelection(false); |
---|
2935 | 3513 | keepparent = group.parent; |
---|
2936 | 3514 | // PARENT = NULL or not??? |
---|
2937 | 3515 | //group.parent = null; // ROOT |
---|
2938 | 3516 | //group.attributes = -1; |
---|
2939 | 3517 | ResetModel(); |
---|
| 3518 | + |
---|
| 3519 | + cameraView.requestFocusInWindow(); |
---|
2940 | 3520 | refreshContents(true); |
---|
2941 | | - } |
---|
| 3521 | + } else if (event.getSource() == editCameraItem) |
---|
| 3522 | + { |
---|
| 3523 | + cameraView.ProtectCamera(); |
---|
| 3524 | + cameraView.repaint(); |
---|
| 3525 | + return; |
---|
| 3526 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3527 | + { |
---|
| 3528 | + cameraView.RevertCamera(); |
---|
| 3529 | + cameraView.repaint(); |
---|
| 3530 | + return; |
---|
| 3531 | + // } else if (event.getSource() == textureButton) |
---|
| 3532 | + // { |
---|
| 3533 | + // return; // true; |
---|
| 3534 | + } |
---|
2942 | 3535 | else |
---|
2943 | 3536 | { |
---|
2944 | 3537 | //return super.action(event, arg); |
---|
.. | .. |
---|
2947 | 3540 | } |
---|
2948 | 3541 | |
---|
2949 | 3542 | boolean useclient = false; |
---|
2950 | | - cRadio radio; |
---|
2951 | 3543 | |
---|
2952 | 3544 | void ToggleRoot() |
---|
2953 | 3545 | { |
---|
.. | .. |
---|
2956 | 3548 | if (useclient) |
---|
2957 | 3549 | { |
---|
2958 | 3550 | cameraView.object = client; |
---|
2959 | | - cameraView.lighttouched = true; |
---|
| 3551 | + Globals.lighttouched = true; |
---|
2960 | 3552 | //topView.object = client; |
---|
2961 | 3553 | //frontView.object = client; |
---|
2962 | 3554 | //sideView.object = client; |
---|
.. | .. |
---|
2964 | 3556 | else |
---|
2965 | 3557 | { |
---|
2966 | 3558 | cameraView.object = group; |
---|
2967 | | - cameraView.lighttouched = true; |
---|
| 3559 | + Globals.lighttouched = true; |
---|
2968 | 3560 | //topView.object = group; |
---|
2969 | 3561 | //frontView.object = group; |
---|
2970 | 3562 | //sideView.object = group; |
---|
.. | .. |
---|
2999 | 3591 | refreshContents(); |
---|
3000 | 3592 | } |
---|
3001 | 3593 | |
---|
| 3594 | + void TransformChildren() |
---|
| 3595 | + { |
---|
| 3596 | + Object3D obj; |
---|
| 3597 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3598 | + { |
---|
| 3599 | + obj = (Object3D)e.nextElement(); |
---|
| 3600 | + obj.KeepTextureMatrices(); |
---|
| 3601 | + obj.TransformChildren(); |
---|
| 3602 | + obj.RestoreTextureMatrices(); |
---|
| 3603 | + |
---|
| 3604 | +// if (obj.parent == null) |
---|
| 3605 | +// { |
---|
| 3606 | +// System.out.println("NULL PARENT!"); |
---|
| 3607 | +// new Exception().printStackTrace(); |
---|
| 3608 | +// } |
---|
| 3609 | +// else |
---|
| 3610 | +// TouchTransform(obj); |
---|
| 3611 | +// //obj.parent.Touch(); |
---|
| 3612 | + } |
---|
| 3613 | + |
---|
| 3614 | + refreshContents(); |
---|
| 3615 | + } |
---|
3002 | 3616 | |
---|
3003 | 3617 | void ResetTransform() |
---|
3004 | 3618 | { |
---|
.. | .. |
---|
3111 | 3725 | refreshContents(); |
---|
3112 | 3726 | } |
---|
3113 | 3727 | |
---|
3114 | | - void ResetCentroid() |
---|
| 3728 | + void ResetCentroid(boolean full) |
---|
3115 | 3729 | { |
---|
3116 | 3730 | Object3D obj; |
---|
3117 | 3731 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3126 | 3740 | LA.matIdentity(Object3D.mat); |
---|
3127 | 3741 | obj.getBounds(minima, maxima, false); |
---|
3128 | 3742 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3129 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3743 | + if (full) |
---|
| 3744 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3130 | 3745 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3131 | 3746 | obj.TransformMesh(Object3D.mat); |
---|
| 3747 | + |
---|
3132 | 3748 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3133 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3749 | + if (full) |
---|
| 3750 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3134 | 3751 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3752 | + |
---|
3135 | 3753 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3136 | 3754 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3137 | 3755 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3160 | 3778 | |
---|
3161 | 3779 | int size = obj.MemorySize(); |
---|
3162 | 3780 | |
---|
3163 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3781 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3782 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3164 | 3783 | } |
---|
3165 | 3784 | } |
---|
3166 | 3785 | catch (Exception e) |
---|
.. | .. |
---|
3197 | 3816 | obj = (Object3D)e.nextElement(); |
---|
3198 | 3817 | |
---|
3199 | 3818 | System.out.println("Object is: " + obj); |
---|
3200 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3819 | + Grafreed.AnalyzeObject(obj); |
---|
3201 | 3820 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3202 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3821 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3203 | 3822 | |
---|
3204 | 3823 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3205 | 3824 | } |
---|
.. | .. |
---|
3241 | 3860 | void GenNormals(boolean crease) |
---|
3242 | 3861 | { |
---|
3243 | 3862 | group.GenNormalsS(crease); |
---|
| 3863 | + |
---|
| 3864 | + refreshContents(); |
---|
| 3865 | + } |
---|
| 3866 | + |
---|
| 3867 | + void GenNormalsMESH() |
---|
| 3868 | + { |
---|
| 3869 | + group.GenNormalsMeshS(); |
---|
3244 | 3870 | |
---|
3245 | 3871 | refreshContents(); |
---|
3246 | 3872 | } |
---|
.. | .. |
---|
3413 | 4039 | |
---|
3414 | 4040 | void ParseVertices() |
---|
3415 | 4041 | { |
---|
3416 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3417 | | - GrafreeD.epsequal = true; |
---|
| 4042 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4043 | + Grafreed.epsequal = true; |
---|
3418 | 4044 | |
---|
3419 | 4045 | for (int i=0; i<group.selection.size(); i++) |
---|
3420 | 4046 | { |
---|
.. | .. |
---|
3439 | 4065 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3440 | 4066 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3441 | 4067 | |
---|
3442 | | - g.add(GrafreeD.clipboard); |
---|
| 4068 | + g.add(Grafreed.clipboard); |
---|
3443 | 4069 | |
---|
3444 | 4070 | buffer.add(g); |
---|
3445 | 4071 | } |
---|
.. | .. |
---|
3454 | 4080 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3455 | 4081 | } |
---|
3456 | 4082 | |
---|
3457 | | - GrafreeD.epsequal = epsequal; |
---|
| 4083 | + Grafreed.epsequal = epsequal; |
---|
3458 | 4084 | |
---|
3459 | 4085 | refreshContents(); |
---|
3460 | 4086 | } |
---|
.. | .. |
---|
3472 | 4098 | String pigment = Object3D.GetPigment(tex); |
---|
3473 | 4099 | //String bump = Object3D.GetBump(tex); |
---|
3474 | 4100 | |
---|
3475 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4101 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4102 | + |
---|
| 4103 | + try |
---|
| 4104 | + { |
---|
| 4105 | + texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4106 | + } |
---|
| 4107 | + catch (Exception e) |
---|
| 4108 | + { |
---|
| 4109 | + System.err.println("FAIL: " + node); |
---|
| 4110 | + } |
---|
3476 | 4111 | |
---|
3477 | 4112 | double s = v.s; |
---|
3478 | 4113 | |
---|
.. | .. |
---|
3560 | 4195 | |
---|
3561 | 4196 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3562 | 4197 | |
---|
3563 | | - boolean random = CameraPane.RANDOM; |
---|
3564 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4198 | + boolean random = CameraPane.SWITCH; |
---|
| 4199 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3565 | 4200 | lowres.linkVerticesThis(null); |
---|
3566 | 4201 | lowres.linkVerticesThis(sn); |
---|
3567 | | - CameraPane.RANDOM = random; |
---|
| 4202 | + CameraPane.SWITCH = random; |
---|
3568 | 4203 | |
---|
3569 | 4204 | System.err.flush(); |
---|
3570 | 4205 | |
---|
.. | .. |
---|
3604 | 4239 | return; |
---|
3605 | 4240 | |
---|
3606 | 4241 | Object3D poses = group.selection.get(0); |
---|
3607 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4242 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3608 | 4243 | |
---|
3609 | 4244 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3610 | 4245 | |
---|
.. | .. |
---|
3773 | 4408 | group.selection.RelinkToSupport(); // july 2014 |
---|
3774 | 4409 | System.out.println("DONE."); |
---|
3775 | 4410 | refreshContents(); |
---|
3776 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4411 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3777 | 4412 | } |
---|
3778 | 4413 | |
---|
3779 | 4414 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3798 | 4433 | |
---|
3799 | 4434 | void ClipMesh() |
---|
3800 | 4435 | { |
---|
3801 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4436 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3802 | 4437 | { |
---|
3803 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4438 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3804 | 4439 | |
---|
3805 | 4440 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3806 | 4441 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3809 | 4444 | // { |
---|
3810 | 4445 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3811 | 4446 | // } |
---|
3812 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4447 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3813 | 4448 | } |
---|
3814 | 4449 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3815 | 4450 | System.out.println("DONE."); |
---|
.. | .. |
---|
3856 | 4491 | void MarkLeaves(boolean hide) |
---|
3857 | 4492 | { |
---|
3858 | 4493 | group.selection.MarkLeaves(hide); |
---|
| 4494 | + refreshContents(); |
---|
| 4495 | + } |
---|
| 4496 | + |
---|
| 4497 | + void RewindLeaves(boolean hide) |
---|
| 4498 | + { |
---|
| 4499 | + group.selection.RewindLeaves(hide); |
---|
| 4500 | + refreshContents(); |
---|
| 4501 | + } |
---|
| 4502 | + |
---|
| 4503 | + void RandomLeaves(boolean hide) |
---|
| 4504 | + { |
---|
| 4505 | + group.selection.RandomLeaves(hide); |
---|
3859 | 4506 | refreshContents(); |
---|
3860 | 4507 | } |
---|
3861 | 4508 | |
---|
.. | .. |
---|
3930 | 4577 | // } |
---|
3931 | 4578 | // } |
---|
3932 | 4579 | |
---|
3933 | | - static boolean allparams = true; |
---|
3934 | | - |
---|
3935 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
3936 | | - |
---|
3937 | 4580 | void EditSelection(boolean newWindow) |
---|
3938 | 4581 | { |
---|
3939 | 4582 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
3941 | 4584 | { |
---|
3942 | 4585 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
3943 | 4586 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
3944 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4587 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3945 | 4588 | |
---|
3946 | 4589 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3947 | | - if(elem != group) |
---|
| 4590 | + if(elem != group || !newWindow) |
---|
3948 | 4591 | { |
---|
3949 | 4592 | // if (!(elem instanceof Composite)) |
---|
3950 | 4593 | // newWindow = false; |
---|
.. | .. |
---|
4026 | 4669 | //new Exception().printStackTrace(); |
---|
4027 | 4670 | |
---|
4028 | 4671 | freezemodel = true; |
---|
4029 | | - |
---|
| 4672 | + ClearUnpinned(); |
---|
| 4673 | + |
---|
4030 | 4674 | /**/ |
---|
4031 | 4675 | //switch (event.id) |
---|
4032 | 4676 | { |
---|
.. | .. |
---|
4034 | 4678 | //case 702: // Event.LIST_DESELECT |
---|
4035 | 4679 | group.deselectAll(); |
---|
4036 | 4680 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4037 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4038 | 4681 | if (tps != null) |
---|
4039 | 4682 | { |
---|
4040 | 4683 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4043 | 4686 | |
---|
4044 | 4687 | //if (child.parent != null) |
---|
4045 | 4688 | //child.parent.addSelectee(child); |
---|
| 4689 | + objEditor.SetMaterial(child); |
---|
4046 | 4690 | group.addSelectee(child); |
---|
4047 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4048 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4049 | | - System.err.println("info : " + child.GetPath()); |
---|
4050 | 4691 | } |
---|
4051 | 4692 | } |
---|
4052 | | - else |
---|
4053 | | - { |
---|
4054 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4055 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4056 | | - System.err.println("info : " + group.GetPath()); |
---|
4057 | | - } |
---|
| 4693 | +// else |
---|
| 4694 | +// { |
---|
| 4695 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4696 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4697 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4698 | +// } |
---|
4058 | 4699 | |
---|
4059 | | - objEditor.SetText(); // jan 2014 |
---|
4060 | | - |
---|
4061 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4700 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4062 | 4701 | CameraPane.flash = true; |
---|
4063 | 4702 | |
---|
4064 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4703 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4065 | 4704 | // a camera |
---|
4066 | 4705 | { |
---|
4067 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4068 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
4069 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
4070 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 4706 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4707 | + { |
---|
| 4708 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4709 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4710 | + } |
---|
| 4711 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 4712 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4071 | 4713 | } |
---|
4072 | 4714 | |
---|
| 4715 | + if (tps != null && tps.length == 1) |
---|
| 4716 | + { |
---|
| 4717 | + EditSelection(false); |
---|
| 4718 | + } |
---|
| 4719 | + |
---|
| 4720 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4721 | + |
---|
4073 | 4722 | refreshContents(); |
---|
4074 | 4723 | //return true; |
---|
4075 | 4724 | } |
---|
.. | .. |
---|
4078 | 4727 | |
---|
4079 | 4728 | freezemodel = false; |
---|
4080 | 4729 | } |
---|
| 4730 | + |
---|
| 4731 | + void SetPinStates(boolean enabled) |
---|
| 4732 | + { |
---|
| 4733 | + editButton.setEnabled(enabled); |
---|
| 4734 | + uneditButton.setEnabled(enabled); |
---|
| 4735 | + unselectButton.setEnabled(enabled); |
---|
| 4736 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4737 | + } |
---|
| 4738 | + |
---|
| 4739 | + void refreshContents(boolean cp) |
---|
| 4740 | + { |
---|
| 4741 | + if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 4742 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4743 | + { |
---|
| 4744 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4745 | + |
---|
| 4746 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4747 | + { |
---|
| 4748 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4749 | + |
---|
| 4750 | + objEditor.AddInfo(child, this, true); |
---|
| 4751 | + System.err.println("info : " + child.GetPath()); |
---|
| 4752 | + } |
---|
| 4753 | + |
---|
| 4754 | + objEditor.SetText(); // jan 2014 |
---|
| 4755 | + } |
---|
| 4756 | + |
---|
| 4757 | + super.refreshContents(cp); |
---|
| 4758 | + } |
---|
4081 | 4759 | |
---|
4082 | 4760 | void linkSomething(Object3D thing) |
---|
4083 | 4761 | { |
---|
.. | .. |
---|
4149 | 4827 | { |
---|
4150 | 4828 | if (group.selection.isEmpty()) |
---|
4151 | 4829 | return; |
---|
4152 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4830 | + |
---|
| 4831 | + Grafreed.clipboardIsTempGroup = false; |
---|
4153 | 4832 | Composite tGroup = null; |
---|
4154 | 4833 | if (group.selection.size() > 0) // 1) |
---|
4155 | 4834 | { |
---|
4156 | 4835 | tGroup = new cGroup(); |
---|
4157 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4836 | + Grafreed.clipboardIsTempGroup = true; |
---|
4158 | 4837 | } |
---|
4159 | 4838 | |
---|
4160 | 4839 | if (cut) |
---|
4161 | 4840 | { |
---|
| 4841 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4842 | +// Save(); |
---|
4162 | 4843 | //int indices[] = jList.getSelectedIndices(); |
---|
4163 | 4844 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4164 | 4845 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4194 | 4875 | //System.out.println("cut " + child); |
---|
4195 | 4876 | //System.out.println("parent = " + child.parent); |
---|
4196 | 4877 | // tmp.addChild(child); |
---|
4197 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4878 | + if (Grafreed.clipboardIsTempGroup) |
---|
4198 | 4879 | tGroup.add/*Child*/(tmp); |
---|
4199 | 4880 | else |
---|
4200 | | - GrafreeD.clipboard = tmp; |
---|
| 4881 | + Grafreed.clipboard = tmp; |
---|
4201 | 4882 | } |
---|
4202 | 4883 | else |
---|
4203 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4884 | + if (Grafreed.clipboardIsTempGroup) |
---|
4204 | 4885 | tGroup.add/*Child*/(child); |
---|
4205 | 4886 | else |
---|
4206 | | - GrafreeD.clipboard = child; |
---|
| 4887 | + Grafreed.clipboard = child; |
---|
4207 | 4888 | } |
---|
4208 | 4889 | |
---|
4209 | 4890 | //ResetModel(); |
---|
.. | .. |
---|
4235 | 4916 | //System.out.println("cut " + elem); |
---|
4236 | 4917 | //System.out.println("parent = " + elem.parent); |
---|
4237 | 4918 | // tmp.addChild(elem); |
---|
4238 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4919 | + if (Grafreed.clipboardIsTempGroup) |
---|
4239 | 4920 | tGroup.add/*Child*/(tmp); |
---|
4240 | 4921 | else |
---|
4241 | | - GrafreeD.clipboard = tmp; |
---|
| 4922 | + Grafreed.clipboard = tmp; |
---|
4242 | 4923 | } |
---|
4243 | 4924 | else |
---|
4244 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4925 | + if (Grafreed.clipboardIsTempGroup) |
---|
4245 | 4926 | tGroup.add/*Child*/(child); |
---|
4246 | 4927 | else |
---|
4247 | | - GrafreeD.clipboard = child; |
---|
| 4928 | + Grafreed.clipboard = child; |
---|
4248 | 4929 | } |
---|
4249 | 4930 | |
---|
4250 | 4931 | } |
---|
4251 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4252 | | - GrafreeD.clipboard = tGroup; |
---|
| 4932 | + |
---|
| 4933 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4934 | + Grafreed.clipboard = tGroup; |
---|
| 4935 | + |
---|
4253 | 4936 | if (cut) |
---|
4254 | 4937 | { |
---|
4255 | 4938 | ResetModel(); |
---|
.. | .. |
---|
4259 | 4942 | |
---|
4260 | 4943 | void paste(boolean expand) |
---|
4261 | 4944 | { |
---|
| 4945 | + if (Globals.SAVEONMAKE) |
---|
| 4946 | + Save(); |
---|
| 4947 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 4948 | + Globals.SAVEONMAKE = false; |
---|
4262 | 4949 | // if (GrafreeD.clipboard == null) |
---|
4263 | 4950 | // return; |
---|
4264 | 4951 | boolean first = true; |
---|
4265 | 4952 | |
---|
4266 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4953 | + if (Grafreed.clipboardIsTempGroup) |
---|
4267 | 4954 | { |
---|
4268 | 4955 | Composite temp; |
---|
4269 | 4956 | |
---|
.. | .. |
---|
4274 | 4961 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4275 | 4962 | */ |
---|
4276 | 4963 | Object3D elem; |
---|
4277 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4964 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4278 | 4965 | { |
---|
4279 | 4966 | Object3D child = (Object3D)e.nextElement(); |
---|
4280 | 4967 | |
---|
.. | .. |
---|
4308 | 4995 | //Object3D cb = Applet3D.clipboard; |
---|
4309 | 4996 | //temp.addChild(cb); |
---|
4310 | 4997 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4311 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4312 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4313 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4314 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4315 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 4998 | + assert(Grafreed.clipboard.parent == null); |
---|
| 4999 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5000 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5001 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5002 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4316 | 5003 | else |
---|
4317 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4318 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5004 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5005 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4319 | 5006 | } |
---|
4320 | 5007 | |
---|
| 5008 | + Globals.SAVEONMAKE = keep; |
---|
4321 | 5009 | ResetModel(); |
---|
4322 | 5010 | refreshContents(); |
---|
4323 | 5011 | } |
---|
4324 | 5012 | |
---|
4325 | | - void pasteInto(boolean copyit) |
---|
| 5013 | + void pasteInto(boolean copyit, boolean clone) |
---|
4326 | 5014 | { |
---|
4327 | 5015 | // if (GrafreeD.clipboard == null) |
---|
4328 | 5016 | // return; |
---|
.. | .. |
---|
4351 | 5039 | if (copyit) |
---|
4352 | 5040 | { |
---|
4353 | 5041 | // paste(false); |
---|
4354 | | - CloneClipboard(false); // sept 2014 |
---|
| 5042 | + if (clone) |
---|
| 5043 | + { |
---|
| 5044 | + CloneClipboard(false); // sept 2014 |
---|
| 5045 | + } |
---|
| 5046 | + else |
---|
| 5047 | + { |
---|
| 5048 | + paste(false); |
---|
| 5049 | + } |
---|
4355 | 5050 | } |
---|
4356 | 5051 | else |
---|
4357 | 5052 | { |
---|
4358 | 5053 | boolean first = true; |
---|
4359 | 5054 | |
---|
4360 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5055 | + if (Grafreed.clipboardIsTempGroup) |
---|
4361 | 5056 | { |
---|
4362 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5057 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4363 | 5058 | Object3D copy; |
---|
4364 | 5059 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4365 | 5060 | { |
---|
.. | .. |
---|
4369 | 5064 | } |
---|
4370 | 5065 | } else |
---|
4371 | 5066 | { |
---|
4372 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5067 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4373 | 5068 | } |
---|
4374 | 5069 | } |
---|
4375 | 5070 | } |
---|
.. | .. |
---|
4446 | 5141 | |
---|
4447 | 5142 | void group(Object3D csg, boolean grab) |
---|
4448 | 5143 | { |
---|
| 5144 | + if (Globals.SAVEONMAKE) |
---|
| 5145 | + Save(); |
---|
| 5146 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 5147 | + Globals.SAVEONMAKE = false; |
---|
4449 | 5148 | if (//false) // why?? |
---|
4450 | 5149 | !group.selection.isEmpty()) |
---|
4451 | 5150 | { |
---|
.. | .. |
---|
4559 | 5258 | //node.add(csg); |
---|
4560 | 5259 | //makeSomething(node); |
---|
4561 | 5260 | makeSomething(csg); |
---|
| 5261 | + Globals.SAVEONMAKE = keep; |
---|
4562 | 5262 | } |
---|
4563 | 5263 | |
---|
4564 | 5264 | void Ungroup(Object3D g) |
---|
4565 | 5265 | { |
---|
| 5266 | + if (Globals.SAVEONMAKE) |
---|
| 5267 | + Save(); |
---|
| 5268 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 5269 | + Globals.SAVEONMAKE = false; |
---|
4566 | 5270 | if (g instanceof HiddenObject) |
---|
4567 | 5271 | { |
---|
4568 | 5272 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4579 | 5283 | objEditor.makeSomething(g.get(i), false); |
---|
4580 | 5284 | } |
---|
4581 | 5285 | } |
---|
| 5286 | + Globals.SAVEONMAKE = keep; |
---|
4582 | 5287 | } |
---|
4583 | 5288 | |
---|
4584 | 5289 | void ungroup() |
---|
.. | .. |
---|
4774 | 5479 | } |
---|
4775 | 5480 | */ |
---|
4776 | 5481 | |
---|
4777 | | - void ImportGFD() |
---|
4778 | | - { |
---|
4779 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4780 | | - browser.show(); |
---|
4781 | | - String filename = browser.getFile(); |
---|
4782 | | - if (filename != null && filename.length() > 0) |
---|
4783 | | - { |
---|
4784 | | - String fullname = browser.getDirectory() + filename; |
---|
4785 | | - |
---|
4786 | | - //Object3D readobj = |
---|
4787 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4788 | | - //makeSomething(readobj); |
---|
4789 | | - } |
---|
4790 | | - } |
---|
4791 | | - |
---|
4792 | 5482 | /* |
---|
4793 | 5483 | public void Callback(Object obj) |
---|
4794 | 5484 | { |
---|
.. | .. |
---|
4812 | 5502 | } |
---|
4813 | 5503 | */ |
---|
4814 | 5504 | |
---|
4815 | | - void ImportVRMLX3D() |
---|
4816 | | - { |
---|
4817 | | - if (GrafreeD.standAlone) |
---|
4818 | | - { |
---|
4819 | | - /**/ |
---|
4820 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4821 | | - browser.show(); |
---|
4822 | | - String filename = browser.getFile(); |
---|
4823 | | - if (filename != null && filename.length() > 0) |
---|
4824 | | - { |
---|
4825 | | - String fullname = browser.getDirectory() + filename; |
---|
4826 | | - LoadVRMLX3D(fullname); |
---|
4827 | | - } |
---|
4828 | | - /**/ |
---|
4829 | | - } |
---|
4830 | | - } |
---|
4831 | | - |
---|
4832 | 5505 | String GetFile(String dialogName) |
---|
4833 | 5506 | { |
---|
4834 | | - if (GrafreeD.standAlone) |
---|
| 5507 | + if (Grafreed.standAlone) |
---|
4835 | 5508 | { |
---|
4836 | 5509 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4837 | 5510 | browser.show(); |
---|
.. | .. |
---|
4895 | 5568 | cButton flashSelectionButton; |
---|
4896 | 5569 | cButton editButton; |
---|
4897 | 5570 | cButton uneditButton; |
---|
| 5571 | + JCheckBox allParamsButton; |
---|
4898 | 5572 | cButton clearpanelButton; |
---|
4899 | | - cButton allParamsButton; |
---|
4900 | 5573 | cButton unselectButton; |
---|
4901 | 5574 | |
---|
| 5575 | + cButton restoreCameraButton; |
---|
| 5576 | + |
---|
| 5577 | + cButton saveButton; |
---|
| 5578 | + cButton oneStepButton; |
---|
| 5579 | + |
---|
| 5580 | + cButton groupButton; |
---|
| 5581 | + cButton ungroupButton; |
---|
| 5582 | + cButton compositeButton; |
---|
| 5583 | + cButton switchButton; |
---|
| 5584 | + cButton loopButton; |
---|
| 5585 | + cButton textureButton; |
---|
| 5586 | + |
---|
| 5587 | + cButton gridButton; |
---|
| 5588 | + cButton boxButton; |
---|
| 5589 | + cButton sphereButton; |
---|
| 5590 | + cButton coneButton; |
---|
| 5591 | + cButton torusButton; |
---|
| 5592 | + cButton superButton; |
---|
| 5593 | + cButton kleinButton; |
---|
| 5594 | + cButton particlesButton; |
---|
| 5595 | + cButton overlayButton; |
---|
| 5596 | + cButton lightButton; |
---|
| 5597 | + |
---|
4902 | 5598 | cButton screenfitButton; |
---|
4903 | 5599 | cButton screenfitpointButton; |
---|
4904 | 5600 | cButton snapobjectButton; |
---|
.. | .. |
---|
4910 | 5606 | |
---|
4911 | 5607 | cButton setsupportButton; |
---|
4912 | 5608 | |
---|
4913 | | - cButton twoButton; |
---|
4914 | | - cButton sixButton; |
---|
4915 | | - cButton threeButton; |
---|
4916 | | - cButton sevenButton; |
---|
4917 | | - cButton fourButton; // full panel |
---|
4918 | | - cButton oneButton; // full XYZ |
---|
4919 | | - //cButton currentLayout; |
---|
4920 | | - |
---|
4921 | 5609 | // |
---|
4922 | 5610 | //Composite |
---|
4923 | 5611 | Object3D // to do !! |
---|
.. | .. |
---|
4927 | 5615 | //JTree jTree; |
---|
4928 | 5616 | private MenuItem lookAtItem; |
---|
4929 | 5617 | private MenuItem lookFromItem; |
---|
4930 | | - private MenuItem switchItem; |
---|
| 5618 | + private MenuItem switchViewItem; |
---|
4931 | 5619 | private MenuItem cutItem; |
---|
4932 | | - private MenuItem duplicateItem; |
---|
| 5620 | + private MenuItem undoItem; |
---|
| 5621 | + private MenuItem redoItem; |
---|
| 5622 | + private JMenuItem duplicateItem; |
---|
4933 | 5623 | private MenuItem cloneItem; |
---|
4934 | 5624 | private MenuItem cloneSupportItem; |
---|
4935 | 5625 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
4942 | 5632 | private MenuItem linkverticesItem; |
---|
4943 | 5633 | private MenuItem relinkverticesItem; |
---|
4944 | 5634 | private MenuItem setMasterItem; |
---|
4945 | | - private MenuItem resetMeshItem; |
---|
| 5635 | + private MenuItem resetAllItem; |
---|
4946 | 5636 | private MenuItem stepAllItem; |
---|
4947 | 5637 | private MenuItem revertMeshItem; |
---|
4948 | 5638 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4953 | 5643 | private MenuItem mergeGeometriesItem; |
---|
4954 | 5644 | private MenuItem copyItem; |
---|
4955 | 5645 | private MenuItem pasteItem; |
---|
| 5646 | + private MenuItem pasteIntoItem; |
---|
4956 | 5647 | private MenuItem pasteLinkItem; |
---|
4957 | 5648 | private MenuItem pasteCloneItem; |
---|
4958 | 5649 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
4991 | 5682 | private MenuItem showleavesItem; |
---|
4992 | 5683 | private MenuItem markleavesItem; |
---|
4993 | 5684 | private MenuItem unmarkleavesItem; |
---|
| 5685 | + private MenuItem rewindleavesItem; |
---|
| 5686 | + private MenuItem unrewindleavesItem; |
---|
| 5687 | + private MenuItem randomleavesItem; |
---|
| 5688 | + private MenuItem unrandomleavesItem; |
---|
4994 | 5689 | |
---|
4995 | 5690 | private MenuItem flipVItem; |
---|
4996 | 5691 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5002 | 5697 | private MenuItem panoTexturesItem; |
---|
5003 | 5698 | |
---|
5004 | 5699 | private MenuItem resetCentroidItem; |
---|
5005 | | - private MenuItem transformgeometryItem; |
---|
| 5700 | + private MenuItem resetCentroidXZItem; |
---|
5006 | 5701 | private MenuItem resetTransformItem; |
---|
| 5702 | + private MenuItem transformGeometryItem; |
---|
| 5703 | + private MenuItem transformChildrenItem; |
---|
5007 | 5704 | private MenuItem hideItem; |
---|
5008 | 5705 | private MenuItem grabItem; |
---|
5009 | 5706 | private MenuItem backItem; |
---|
5010 | 5707 | private MenuItem frontItem; |
---|
5011 | 5708 | private MenuItem cameraItem; |
---|
5012 | 5709 | private MenuItem compositeItem; |
---|
5013 | | - private MenuItem randomItem; |
---|
| 5710 | + private MenuItem switchItem; |
---|
5014 | 5711 | private MenuItem physicsItem; |
---|
5015 | 5712 | private MenuItem frameselectorItem; |
---|
5016 | 5713 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5050 | 5747 | private MenuItem blobItem; |
---|
5051 | 5748 | private MenuItem latheItem; |
---|
5052 | 5749 | private MenuItem bezierItem; |
---|
5053 | | - private MenuItem checkerItem; |
---|
| 5750 | + private MenuItem overlayItem; |
---|
5054 | 5751 | private MenuItem meshItem; |
---|
5055 | 5752 | // private MenuItem meshGroupItem; |
---|
5056 | 5753 | private MenuItem springItem; |
---|
.. | .. |
---|
5072 | 5769 | private MenuItem doubleItem; |
---|
5073 | 5770 | private MenuItem tripleItem; |
---|
5074 | 5771 | |
---|
5075 | | - private MenuItem importGFDItem; |
---|
5076 | | - private MenuItem importVRMLX3DItem; |
---|
5077 | | - private MenuItem import3DSItem; |
---|
5078 | | - private MenuItem importOBJItem; |
---|
5079 | | - |
---|
5080 | 5772 | private MenuItem computeAOItem; |
---|
5081 | 5773 | private MenuItem recompileItem; |
---|
5082 | 5774 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5086 | 5778 | private MenuItem analyzeItem; |
---|
5087 | 5779 | private MenuItem dumpItem; |
---|
5088 | 5780 | //boolean freezemodel = false; |
---|
| 5781 | + |
---|
| 5782 | + Menu cameraMenu; |
---|
| 5783 | + MenuItem editCameraItem; |
---|
| 5784 | + MenuItem restoreCameraItem; |
---|
5089 | 5785 | } |
---|