.. | .. |
---|
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; |
---|
| 589 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 590 | + |
---|
| 591 | + copyOptionsPanel.preferredHeight = 1; |
---|
437 | 592 | |
---|
438 | 593 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
439 | 594 | |
---|
440 | | - oe.aConstraints.gridwidth = 1; |
---|
441 | | - oe.aConstraints.gridx = 0; |
---|
| 595 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 596 | + //minButton.setToolTipText("Minimize window"); |
---|
| 597 | + //minButton.addActionListener(this); |
---|
442 | 598 | |
---|
443 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
444 | | - liveCB.setToolTipText("Enabled animation"); |
---|
445 | | - liveCB.addItemListener(this); |
---|
446 | | - |
---|
447 | | - oe.aConstraints.gridx += 1; |
---|
448 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints); |
---|
449 | | - trackCB.setToolTipText("Enable tracking"); |
---|
450 | | - trackCB.addItemListener(this); |
---|
451 | | - |
---|
452 | | - oe.aConstraints.gridx += 1; |
---|
453 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 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); |
---|
454 | 611 | screenfitButton.setToolTipText("Screen fit"); |
---|
455 | 612 | screenfitButton.addActionListener(this); |
---|
456 | | - oe.aConstraints.gridx += 1; |
---|
| 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"); |
---|
| 634 | + liveCB.addItemListener(this); |
---|
| 635 | + |
---|
| 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"); |
---|
| 642 | + fastCB.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); |
---|
| 649 | + |
---|
457 | 650 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
458 | 651 | // screenfitpointButton.addActionListener(this); |
---|
459 | | -// oe.aConstraints.gridx += 1; |
---|
460 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
461 | | - snapobjectButton.addActionListener(this); |
---|
462 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
463 | | - oe.aConstraints.gridx += 1; |
---|
464 | 652 | |
---|
465 | | - //aConstraints.gridx = 0; |
---|
466 | | - //aConstraints.gridy += 1; |
---|
467 | | - oe.aConstraints.weighty = 0; |
---|
468 | | - oe.aConstraints.gridwidth = 1; |
---|
469 | | - |
---|
470 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
471 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
472 | | - 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)); |
---|
473 | 661 | |
---|
474 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
475 | | - |
---|
476 | | - oe.aConstraints.gridx += 1; |
---|
477 | | - oe.aConstraints.weighty = 0; |
---|
478 | | - oe.aConstraints.gridwidth = 1; |
---|
479 | | - |
---|
480 | | - // |
---|
481 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
| 662 | + oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
482 | 663 | twoButton.setToolTipText("Show center view only"); |
---|
483 | 664 | twoButton.addActionListener(this); |
---|
484 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 665 | + this.fullscreenLayout = twoButton; |
---|
| 666 | + |
---|
| 667 | + oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
485 | 668 | fourButton.addActionListener(this); |
---|
486 | 669 | fourButton.setToolTipText("Show left panel only"); |
---|
487 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
| 670 | + oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
488 | 671 | sixButton.setToolTipText("2-column layout left"); |
---|
489 | 672 | sixButton.addActionListener(this); |
---|
490 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 673 | + oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
491 | 674 | threeButton.setToolTipText("2-column layout right"); |
---|
492 | 675 | threeButton.addActionListener(this); |
---|
493 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
| 676 | + oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
494 | 677 | sevenButton.setToolTipText("3-column layout"); |
---|
495 | 678 | sevenButton.addActionListener(this); |
---|
496 | 679 | // |
---|
497 | 680 | |
---|
498 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints); |
---|
499 | | - rootButton.setToolTipText("Edit object in new tab"); |
---|
| 681 | + oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 682 | + rootButton.setToolTipText("Edit selection in new tab"); |
---|
500 | 683 | rootButton.addActionListener(this); |
---|
501 | | - oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 684 | + |
---|
| 685 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
503 | 686 | closeButton.setToolTipText("Close tab"); |
---|
504 | 687 | closeButton.addActionListener(this); |
---|
505 | 688 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
506 | 689 | //clearButton.addActionListener(this); |
---|
507 | | - oe.aConstraints.gridx += 1; |
---|
508 | | - |
---|
509 | | - oe.aConstraints.gridx = 1; // |
---|
510 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
511 | | - editButton.addActionListener(this); |
---|
512 | | - oe.aConstraints.gridx += 1; |
---|
513 | | - oe.aConstraints.weighty = 0; |
---|
514 | | - oe.aConstraints.gridwidth = 1; |
---|
515 | 690 | |
---|
516 | | - 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"); |
---|
517 | 776 | uneditButton.addActionListener(this); |
---|
518 | 777 | |
---|
519 | | - oe.aConstraints.gridx += 1; |
---|
520 | | - oe.aConstraints.weighty = 0; |
---|
521 | | - oe.aConstraints.gridwidth = 1; |
---|
522 | | - |
---|
523 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
524 | | - clearPanelButton.addActionListener(this); |
---|
525 | | - |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 778 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 779 | + allParamsButton.setToolTipText("Show all controle"); |
---|
531 | 780 | allParamsButton.addActionListener(this); |
---|
532 | 781 | |
---|
533 | | - oe.aConstraints.gridx += 1; |
---|
534 | | - oe.aConstraints.weighty = 0; |
---|
535 | | - oe.aConstraints.gridwidth = 1; |
---|
536 | | - |
---|
537 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 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"); |
---|
538 | 788 | unselectButton.addActionListener(this); |
---|
539 | 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 | + |
---|
540 | 800 | // oe.aConstraints.gridx += 1; |
---|
541 | 801 | // oe.aConstraints.weighty = 0; |
---|
542 | 802 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
548 | 808 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
549 | 809 | // gcButton.addActionListener(this); |
---|
550 | 810 | |
---|
551 | | - oe.aConstraints.gridx = 0; |
---|
552 | | - oe.aConstraints.gridy += 1; |
---|
553 | | - |
---|
554 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
555 | | - oe.aConstraints.gridwidth = 100; |
---|
556 | | - // oe.aConstraints.gridheight = 100; |
---|
557 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
558 | | - oe.aConstraints.gridheight = 1; |
---|
559 | | - oe.aConstraints.weighty = 0.5; |
---|
560 | | - oe.aConstraints.gridx = 0; |
---|
561 | | - JScrollPane jSP; |
---|
| 811 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 812 | + |
---|
| 813 | + JScrollPane jSP; |
---|
562 | 814 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
563 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 815 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
564 | 816 | ResetModel(); |
---|
565 | | - oe.aConstraints.weighty = 0.5; |
---|
566 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
567 | | - oe.aConstraints.gridy += 1; |
---|
568 | | - oe.aConstraints.gridwidth = 1; |
---|
569 | | - |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 2; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
574 | | - colorCB.addItemListener(this); |
---|
575 | | - oe.aConstraints.gridx += 2; |
---|
576 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
577 | | - materialCB.addItemListener(this); |
---|
578 | | - oe.aConstraints.gridx += 2; |
---|
579 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
580 | | - textureCB.addItemListener(this); |
---|
581 | | - |
---|
582 | | - oe.aConstraints.gridx = 0; |
---|
583 | | - oe.aConstraints.gridy += 1; |
---|
584 | 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 | + |
---|
585 | 827 | //jList.addListSelectionListener(this); |
---|
586 | 828 | oe.jTree.addTreeSelectionListener(this); |
---|
587 | 829 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
604 | 846 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
605 | 847 | } |
---|
606 | 848 | |
---|
607 | | - void AddOptions(JPanel panel, GridBagConstraints constraints) |
---|
| 849 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
608 | 850 | { |
---|
609 | | - constraints.gridx = 0; |
---|
610 | | - constraints.gridy = 0; |
---|
611 | | - panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints); |
---|
612 | | - fastCB.setToolTipText("Fast mode"); |
---|
613 | | - fastCB.addItemListener(this); |
---|
614 | | - constraints.gridy += 1; |
---|
615 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints); |
---|
616 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
617 | | - supportCB.addItemListener(this); |
---|
| 851 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 852 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 853 | + colorCB.addItemListener(this); |
---|
618 | 854 | |
---|
619 | | - // constraints.gridy += 1; |
---|
| 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 | + |
---|
620 | 883 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
621 | 884 | // localCB.addItemListener(this); |
---|
622 | 885 | |
---|
623 | | - constraints.gridy += 1; |
---|
624 | | - panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints); |
---|
| 886 | + panel.Return(); |
---|
| 887 | + |
---|
| 888 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
625 | 889 | crowdCB.setToolTipText("Used for crowds"); |
---|
626 | 890 | crowdCB.addItemListener(this); |
---|
627 | 891 | |
---|
628 | | - constraints.gridy += 1; |
---|
629 | | - panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints); |
---|
| 892 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
630 | 893 | smoothCB.setToolTipText("Snapping delay"); |
---|
631 | 894 | smoothCB.addItemListener(this); |
---|
632 | 895 | |
---|
633 | | - constraints.gridy += 1; |
---|
634 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints); |
---|
| 896 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
635 | 897 | slowCB.setToolTipText("Smooth interpolation"); |
---|
636 | 898 | slowCB.addItemListener(this); |
---|
637 | | - constraints.gridy += 1; |
---|
638 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints); |
---|
639 | | - boxCB.setToolTipText("Display bounding boxes"); |
---|
640 | | - boxCB.addItemListener(this); |
---|
641 | | - constraints.gridy += 1; |
---|
642 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints); |
---|
643 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
644 | | - zoomBoxCB.addItemListener(this); |
---|
645 | | - |
---|
| 899 | + |
---|
646 | 900 | // constraints.gridy += 1; |
---|
647 | 901 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
648 | 902 | // speakerMocapCB.addItemListener(this); |
---|
649 | 903 | |
---|
| 904 | + panel.Return(); |
---|
| 905 | + |
---|
650 | 906 | if (false) |
---|
651 | 907 | { |
---|
652 | 908 | // handled in scripts |
---|
653 | | - constraints.gridy += 1; |
---|
654 | | - panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints); |
---|
| 909 | + //constraints.gridy += 1; |
---|
| 910 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
655 | 911 | speakerCameraCB.addItemListener(this); |
---|
656 | 912 | |
---|
657 | | - constraints.gridy += 1; |
---|
658 | | - panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints); |
---|
| 913 | + //constraints.gridy += 1; |
---|
| 914 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
659 | 915 | speakerFocusCB.addItemListener(this); |
---|
660 | 916 | |
---|
661 | | - constraints.gridy += 1; |
---|
662 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints); |
---|
| 917 | + //constraints.gridy += 1; |
---|
| 918 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
663 | 919 | smoothfocusCB.addItemListener(this); |
---|
| 920 | + panel.Return(); |
---|
664 | 921 | } |
---|
665 | 922 | |
---|
666 | 923 | //constraints.gridx += 1; |
---|
667 | 924 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
668 | 925 | // debugCB.addItemListener(this); |
---|
669 | 926 | |
---|
670 | | - constraints.gridy += 1; |
---|
671 | | - panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints); |
---|
| 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"); |
---|
672 | 933 | oeilCB.addItemListener(this); |
---|
673 | 934 | |
---|
674 | | - constraints.gridy += 1; |
---|
675 | | - panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints); |
---|
| 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); |
---|
676 | 956 | lookAtCB.setToolTipText("Look-at target"); |
---|
677 | 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); |
---|
678 | 972 | |
---|
679 | 973 | } |
---|
680 | 974 | |
---|
681 | 975 | void EditObject(Object3D obj) |
---|
682 | 976 | { |
---|
683 | 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 | + |
---|
684 | 986 | radioButton.SetObject(obj); |
---|
685 | 987 | radioButton.layout = sevenButton; |
---|
686 | 988 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
.. | .. |
---|
689 | 991 | buttonGroup.add(radioButton); |
---|
690 | 992 | radioButton.doClick(); |
---|
691 | 993 | } |
---|
| 994 | + |
---|
692 | 995 | void SetupViews(ObjEditor oe) |
---|
693 | 996 | { |
---|
| 997 | + theFrame = this; |
---|
| 998 | + |
---|
694 | 999 | oe.SetupViews(); |
---|
695 | 1000 | |
---|
696 | 1001 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
699 | 1004 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
700 | 1005 | } |
---|
701 | 1006 | |
---|
702 | | - JCheckBox liveCB; |
---|
703 | | - JCheckBox supportCB; |
---|
704 | | - JCheckBox localCB; |
---|
705 | | - JCheckBox crowdCB; |
---|
706 | | - JCheckBox smoothCB; |
---|
707 | | - JCheckBox fastCB; |
---|
708 | | - JCheckBox slowCB; |
---|
709 | | - JCheckBox boxCB; |
---|
710 | | - JCheckBox zoomBoxCB; |
---|
711 | | - JCheckBox trackCB; |
---|
712 | | - JCheckBox smoothfocusCB; |
---|
| 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; |
---|
713 | 1020 | // JCheckBox speakerMocapCB; |
---|
714 | | - JCheckBox speakerCameraCB; |
---|
715 | | - JCheckBox speakerFocusCB; |
---|
716 | | - JCheckBox debugCB; |
---|
717 | | - JCheckBox oeilCB; |
---|
718 | | - JCheckBox lookAtCB; |
---|
| 1021 | + cCheckBox speakerCameraCB; |
---|
| 1022 | + cCheckBox speakerFocusCB; |
---|
| 1023 | + cCheckBox debugCB; |
---|
| 1024 | + |
---|
| 1025 | + cCheckBox oeilCB; |
---|
| 1026 | + cCheckBox shadowCB; |
---|
| 1027 | + cCheckBox autosaveCB; |
---|
| 1028 | + cCheckBox lookAtCB; |
---|
719 | 1029 | |
---|
720 | 1030 | // static int COLOR = 1; |
---|
721 | 1031 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
723 | 1033 | |
---|
724 | 1034 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
725 | 1035 | |
---|
726 | | - JCheckBox colorCB; |
---|
727 | | - JCheckBox materialCB; |
---|
728 | | - JCheckBox textureCB; |
---|
| 1036 | + cCheckBox colorCB; |
---|
| 1037 | + cCheckBox materialCB; |
---|
| 1038 | + cCheckBox textureCB; |
---|
729 | 1039 | |
---|
730 | 1040 | public void itemStateChanged(ItemEvent e) |
---|
731 | 1041 | { |
---|
.. | .. |
---|
753 | 1063 | } else if(e.getSource() == liveCB) |
---|
754 | 1064 | { |
---|
755 | 1065 | cameraView.ToggleLive(); |
---|
| 1066 | + refreshContents(false); |
---|
756 | 1067 | } |
---|
757 | 1068 | else if(e.getSource() == supportCB) |
---|
758 | 1069 | { |
---|
.. | .. |
---|
817 | 1128 | { |
---|
818 | 1129 | cameraView.ToggleOeil(); |
---|
819 | 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 | + } |
---|
820 | 1143 | else if(e.getSource() == lookAtCB) |
---|
821 | 1144 | { |
---|
822 | 1145 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
833 | 1156 | |
---|
834 | 1157 | /**/ |
---|
835 | 1158 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
836 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1159 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1160 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
837 | 1161 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
838 | 1162 | // We can't move the root node or an empty selection |
---|
839 | 1163 | return; |
---|
.. | .. |
---|
896 | 1220 | } |
---|
897 | 1221 | } |
---|
898 | 1222 | |
---|
899 | | - String string = (String) object; |
---|
900 | | - |
---|
901 | 1223 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
902 | 1224 | // if( object instanceof java.io.File[]) |
---|
903 | 1225 | // { |
---|
.. | .. |
---|
905 | 1227 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
906 | 1228 | // return; |
---|
907 | 1229 | // } |
---|
908 | | - 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) == ':') |
---|
909 | 1235 | { |
---|
910 | 1236 | // file(s) |
---|
911 | 1237 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
932 | 1258 | |
---|
933 | 1259 | flashIt = false; |
---|
934 | 1260 | CameraPane pane = (CameraPane) target; |
---|
935 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1261 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
936 | 1262 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
937 | 1263 | |
---|
938 | 1264 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
948 | 1274 | |
---|
949 | 1275 | assert target == objEditor.jTree; |
---|
950 | 1276 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1277 | + Object3D destinationLeaf; |
---|
951 | 1278 | try { |
---|
952 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1279 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
953 | 1280 | } catch (Exception e) { |
---|
954 | 1281 | System.out.println("destinationPath : " + destinationPath); |
---|
955 | 1282 | return; |
---|
956 | 1283 | } |
---|
957 | 1284 | |
---|
958 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1285 | + for (int i=group.selection.size(); --i>=0;) |
---|
959 | 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 | +// { |
---|
960 | 1296 | loadClipboard(true); |
---|
961 | 1297 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
962 | | - pasteInto(false); |
---|
963 | | - } else { |
---|
964 | | - loadClipboard(false); |
---|
965 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
966 | | - pasteInto(false); // true); // ??? |
---|
967 | | - } |
---|
| 1298 | + pasteInto(false, false); |
---|
| 1299 | +// } else { |
---|
| 1300 | +// loadClipboard(false); |
---|
| 1301 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1302 | +// pasteInto(false, false); // true); // ??? |
---|
| 1303 | +// } |
---|
968 | 1304 | } |
---|
969 | 1305 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
970 | 1306 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1069 | 1405 | { |
---|
1070 | 1406 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1071 | 1407 | //heightFieldItem.addActionListener(this); |
---|
1072 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1073 | | - gridItem.addActionListener(this); |
---|
1074 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1075 | | - rectoidItem.addActionListener(this); |
---|
1076 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1077 | | - ellipsoidItem.addActionListener(this); |
---|
1078 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1079 | | - coneItem.addActionListener(this); |
---|
1080 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1081 | | - torusItem.addActionListener(this); |
---|
1082 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1083 | | - 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 | + { |
---|
1084 | 1426 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1085 | 1427 | kleinItem.addActionListener(this); |
---|
1086 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1087 | | - particleItem.addActionListener(this); |
---|
| 1428 | + } |
---|
| 1429 | + |
---|
| 1430 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1431 | +// particleItem.addActionListener(this); |
---|
| 1432 | + if (Globals.ADVANCED) |
---|
| 1433 | + { |
---|
1088 | 1434 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1089 | 1435 | ragdollItem.addActionListener(this); |
---|
1090 | 1436 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1091 | 1437 | ragdoll2Item.addActionListener(this); |
---|
| 1438 | + } |
---|
1092 | 1439 | menu.add("-"); |
---|
1093 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1440 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1094 | 1441 | meshItem.addActionListener(this); |
---|
1095 | 1442 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1096 | 1443 | // meshGroupItem.addActionListener(this); |
---|
| 1444 | + if (Globals.ADVANCED) |
---|
| 1445 | + { |
---|
1097 | 1446 | springItem = menu.add(new MenuItem("Spring")); |
---|
1098 | 1447 | springItem.addActionListener(this); |
---|
1099 | 1448 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1100 | 1449 | flagItem.addActionListener(this); |
---|
1101 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1102 | | - bezierItem.addActionListener(this); |
---|
1103 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1104 | | - checkerItem.addActionListener(this); |
---|
1105 | 1450 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1106 | 1451 | blobItem.addActionListener(this); |
---|
1107 | 1452 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1108 | 1453 | latheItem.addActionListener(this); |
---|
1109 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1110 | | - 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); |
---|
1111 | 1461 | menu.add("-"); |
---|
1112 | 1462 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1113 | 1463 | //superLoopItem.addActionListener(this); |
---|
1114 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1115 | | - loopItem.addActionListener(this); |
---|
| 1464 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1465 | +// loopItem.addActionListener(this); |
---|
1116 | 1466 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1117 | 1467 | doubleItem.addActionListener(this); |
---|
| 1468 | + if (Globals.ADVANCED) |
---|
| 1469 | + { |
---|
1118 | 1470 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1119 | 1471 | tripleItem.addActionListener(this); |
---|
| 1472 | + } |
---|
1120 | 1473 | } |
---|
1121 | 1474 | |
---|
1122 | 1475 | void buildToolsMenu(Menu menu) |
---|
1123 | 1476 | { |
---|
1124 | 1477 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1125 | 1478 | animationItem.addItemListener(this); |
---|
1126 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1479 | + animationItem.setState(Globals.ANIMATION); |
---|
| 1480 | + |
---|
| 1481 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1482 | + archiveItem.addActionListener(this); |
---|
1127 | 1483 | |
---|
1128 | 1484 | menu.add("-"); |
---|
1129 | 1485 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1130 | 1486 | parseverticesItem.addActionListener(this); |
---|
1131 | 1487 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1132 | 1488 | textureFieldItem.addActionListener(this); |
---|
1133 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1489 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1134 | 1490 | alignItem.addActionListener(this); |
---|
1135 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1136 | | - mirrorItem.addActionListener(this); |
---|
1137 | 1491 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1138 | 1492 | reduceMorphItem.addActionListener(this); |
---|
1139 | 1493 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1140 | 1494 | reduce34MorphItem.addActionListener(this); |
---|
1141 | | - |
---|
1142 | | - menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1143 | | - computeAOItem.addActionListener(this); |
---|
1144 | 1495 | menu.add("-"); |
---|
1145 | | - |
---|
1146 | 1496 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1147 | 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("-"); |
---|
1148 | 1506 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1149 | 1507 | analyzeItem.addActionListener(this); |
---|
1150 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1508 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1151 | 1509 | dumpItem.addActionListener(this); |
---|
1152 | 1510 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1153 | 1511 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1165 | 1523 | menu.add("-"); |
---|
1166 | 1524 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1167 | 1525 | editScriptItem.addActionListener(this); |
---|
| 1526 | + } |
---|
1168 | 1527 | } |
---|
1169 | 1528 | |
---|
1170 | 1529 | void ScreenFit() |
---|
.. | .. |
---|
1287 | 1646 | shadow.material = new cMaterial(obj.material); |
---|
1288 | 1647 | shadow.material.diffuse = 0.0001f; |
---|
1289 | 1648 | shadow.material.specular = 0.0001f; |
---|
| 1649 | + //shadow.projectedVertices[1].x = 300; |
---|
1290 | 1650 | |
---|
1291 | 1651 | makeSomething(shadow); |
---|
1292 | 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 | + } |
---|
1293 | 1667 | |
---|
1294 | 1668 | /** |
---|
1295 | 1669 | * applyExample |
---|
.. | .. |
---|
1493 | 1867 | |
---|
1494 | 1868 | void Overwrite(int mask) |
---|
1495 | 1869 | { |
---|
1496 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1870 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1497 | 1871 | { |
---|
1498 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1872 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1499 | 1873 | |
---|
1500 | 1874 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1501 | 1875 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1534 | 1908 | { |
---|
1535 | 1909 | ScreenFit(); |
---|
1536 | 1910 | } else |
---|
1537 | | - if (source == switchItem) |
---|
| 1911 | + if (source == switchViewItem) |
---|
1538 | 1912 | { |
---|
1539 | 1913 | cVector v1 = new cVector(); |
---|
1540 | 1914 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1543 | 1917 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1544 | 1918 | objEditor.cameraView.repaint(); |
---|
1545 | 1919 | } else |
---|
1546 | | - if (source == rectoidItem) |
---|
| 1920 | + if (source == rectoidItem || source == boxButton) |
---|
1547 | 1921 | { |
---|
1548 | 1922 | makeSomething(new Box()); |
---|
1549 | 1923 | } else |
---|
1550 | | - if (source == particleItem) |
---|
| 1924 | + if (source == particleItem || source == particlesButton) |
---|
1551 | 1925 | { |
---|
1552 | 1926 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1553 | 1927 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1626 | 2000 | |
---|
1627 | 2001 | makeSomething(obj); |
---|
1628 | 2002 | } else |
---|
1629 | | - if (source == gridItem) |
---|
| 2003 | + if (source == gridItem || source == gridButton) |
---|
1630 | 2004 | { |
---|
1631 | 2005 | makeSomething(new Grid()); |
---|
1632 | 2006 | } else |
---|
1633 | | - if (source == ellipsoidItem) |
---|
| 2007 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1634 | 2008 | { |
---|
1635 | 2009 | makeSomething(new Sphere()); |
---|
1636 | 2010 | } else |
---|
1637 | | - if (source == coneItem) |
---|
| 2011 | + if (source == coneItem || source == coneButton) |
---|
1638 | 2012 | { |
---|
1639 | 2013 | makeSomething(new Cone()); |
---|
1640 | 2014 | } else |
---|
1641 | | - if (source == torusItem) |
---|
| 2015 | + if (source == torusItem || source == torusButton) |
---|
1642 | 2016 | { |
---|
1643 | 2017 | makeSomething(new Torus()); |
---|
1644 | 2018 | } else |
---|
1645 | | - if (source == superItem) |
---|
| 2019 | + if (source == superItem || source == superButton) |
---|
1646 | 2020 | { |
---|
1647 | 2021 | makeSomething(new Superellipsoid()); |
---|
1648 | 2022 | } else |
---|
1649 | | - if (source == kleinItem) |
---|
| 2023 | + if (source == kleinItem || source == kleinButton) |
---|
1650 | 2024 | { |
---|
1651 | 2025 | makeSomething(new Klein()); |
---|
1652 | 2026 | } else |
---|
.. | .. |
---|
1666 | 2040 | { |
---|
1667 | 2041 | makeSomething(new BezierSurface()); |
---|
1668 | 2042 | } else |
---|
1669 | | - if (source == checkerItem) |
---|
| 2043 | + if (source == overlayItem || source == overlayButton) |
---|
1670 | 2044 | { |
---|
1671 | 2045 | /* |
---|
1672 | 2046 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1714 | 2088 | s.setup(); |
---|
1715 | 2089 | makeSomething(s); |
---|
1716 | 2090 | } else |
---|
1717 | | - if (source == lightItem) |
---|
| 2091 | + if (source == lightItem || source == lightButton) |
---|
1718 | 2092 | { |
---|
1719 | 2093 | makeSomething(new Light()); |
---|
1720 | 2094 | } else |
---|
.. | .. |
---|
1764 | 2138 | |
---|
1765 | 2139 | group(g); |
---|
1766 | 2140 | } else |
---|
1767 | | - if (source == loopItem) |
---|
| 2141 | + if (source == loopItem || source == loopButton) |
---|
1768 | 2142 | { |
---|
1769 | 2143 | Composite csg = new GroupLeaf(); |
---|
1770 | 2144 | csg.count = 5; |
---|
1771 | 2145 | group(csg); |
---|
1772 | | - Composite child = new cGroup(); |
---|
| 2146 | + Composite child = new cGroup("Branch"); |
---|
1773 | 2147 | csg.addChild(child); |
---|
1774 | 2148 | child.addChild(csg); |
---|
1775 | 2149 | } else |
---|
1776 | 2150 | if (source == doubleItem) |
---|
1777 | 2151 | { |
---|
1778 | | - Composite csg = new GroupLeaf(); |
---|
| 2152 | + Composite csg = new GroupLeaf("Fork"); |
---|
1779 | 2153 | csg.count = 5; |
---|
1780 | 2154 | group(csg); |
---|
1781 | | - Composite child = new cGroup(); |
---|
| 2155 | + Composite child = new cGroup("Branch A"); |
---|
1782 | 2156 | csg.addChild(child); |
---|
1783 | 2157 | child.addChild(csg); |
---|
1784 | | - child = new cGroup(); |
---|
| 2158 | + child = new cGroup("Branch B"); |
---|
1785 | 2159 | csg.addChild(child); |
---|
1786 | 2160 | child.addChild(csg); |
---|
1787 | 2161 | } else |
---|
1788 | 2162 | if (source == tripleItem) |
---|
1789 | 2163 | { |
---|
1790 | | - Composite csg = new GroupLeaf(); |
---|
| 2164 | + Composite csg = new GroupLeaf("Trident"); |
---|
1791 | 2165 | csg.count = 4; |
---|
1792 | 2166 | group(csg); |
---|
1793 | 2167 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1799 | 2173 | child = new cGroup(); |
---|
1800 | 2174 | csg.addChild(child); |
---|
1801 | 2175 | child.addChild(csg); |
---|
1802 | | - } else |
---|
1803 | | - |
---|
1804 | | - if (source == importGFDItem) |
---|
1805 | | - { |
---|
1806 | | - ImportGFD(); |
---|
1807 | | - } else |
---|
1808 | | - if (source == importVRMLX3DItem) |
---|
1809 | | - { |
---|
1810 | | - ImportVRMLX3D(); |
---|
1811 | | - } else |
---|
1812 | | - if (source == import3DSItem) |
---|
1813 | | - { |
---|
1814 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1815 | | - } else |
---|
1816 | | - if (source == importOBJItem) |
---|
1817 | | - { |
---|
1818 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1819 | 2176 | } else |
---|
1820 | 2177 | if (source == computeAOItem) |
---|
1821 | 2178 | { |
---|
.. | .. |
---|
1835 | 2192 | if (source == invariantsItem) |
---|
1836 | 2193 | { |
---|
1837 | 2194 | System.out.println("Invariants:"); |
---|
1838 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2195 | + Grafreed.grafreeD.universe.invariants(); |
---|
1839 | 2196 | } else |
---|
1840 | 2197 | if (source == memoryItem) |
---|
1841 | 2198 | { |
---|
.. | .. |
---|
1854 | 2211 | { |
---|
1855 | 2212 | DumpObject(); |
---|
1856 | 2213 | } else |
---|
| 2214 | + if (source == minButton) |
---|
| 2215 | + { |
---|
| 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 |
---|
1857 | 2245 | if (source == screenfitButton) |
---|
1858 | 2246 | { |
---|
1859 | | - //Reload(lastConverter, lastFilename, true); |
---|
1860 | 2247 | ScreenFit(); |
---|
1861 | 2248 | } else |
---|
1862 | 2249 | if (source == screenfitpointButton) |
---|
1863 | 2250 | { |
---|
1864 | | - //Reload(lastConverter, lastFilename, true); |
---|
1865 | 2251 | ScreenFitPoint(); |
---|
1866 | 2252 | } else |
---|
1867 | 2253 | if (source == snapobjectButton) |
---|
1868 | 2254 | { |
---|
1869 | | - //Reload(lastConverter, lastFilename, true); |
---|
1870 | 2255 | SnapObject(); |
---|
1871 | 2256 | } else |
---|
1872 | 2257 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1903 | 2288 | { |
---|
1904 | 2289 | loadClipboard(true); |
---|
1905 | 2290 | } else |
---|
| 2291 | + if (source == undoItem) |
---|
| 2292 | + { |
---|
| 2293 | + Undo(); |
---|
| 2294 | + } else |
---|
| 2295 | + if (source == redoItem) |
---|
| 2296 | + { |
---|
| 2297 | + Redo(); |
---|
| 2298 | + } else |
---|
1906 | 2299 | if (source == duplicateItem) |
---|
1907 | 2300 | { |
---|
1908 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2301 | + Object3D keep = Grafreed.clipboard; |
---|
1909 | 2302 | loadClipboard(false); |
---|
1910 | 2303 | paste(false); |
---|
1911 | | - GrafreeD.clipboard = keep; |
---|
| 2304 | + Grafreed.clipboard = keep; |
---|
1912 | 2305 | } else |
---|
1913 | 2306 | if (source == cloneItem) |
---|
1914 | 2307 | { |
---|
.. | .. |
---|
1926 | 2319 | { |
---|
1927 | 2320 | paste(false); |
---|
1928 | 2321 | } else |
---|
| 2322 | + if (source == pasteIntoItem) |
---|
| 2323 | + { |
---|
| 2324 | + pasteInto(true, false); |
---|
| 2325 | + } else |
---|
1929 | 2326 | if (source == pasteLinkItem) |
---|
1930 | 2327 | { |
---|
1931 | | - pasteInto(false); |
---|
| 2328 | + pasteInto(false, false); |
---|
1932 | 2329 | } else |
---|
1933 | 2330 | if (source == pasteCloneItem) |
---|
1934 | 2331 | { |
---|
1935 | | - pasteInto(true); |
---|
| 2332 | + pasteInto(true, true); |
---|
1936 | 2333 | } else |
---|
1937 | 2334 | if (source == pasteExpandItem) |
---|
1938 | 2335 | { |
---|
.. | .. |
---|
2124 | 2521 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2125 | 2522 | // refreshContents(); |
---|
2126 | 2523 | // } |
---|
2127 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2524 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2128 | 2525 | { |
---|
2129 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2526 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2130 | 2527 | |
---|
2131 | 2528 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2132 | 2529 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2134 | 2531 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2135 | 2532 | for (int i=0; i<group.selection.size(); i++) |
---|
2136 | 2533 | { |
---|
2137 | | - boolean random = CameraPane.RANDOM; |
---|
2138 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2534 | + boolean random = CameraPane.SWITCH; |
---|
| 2535 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2139 | 2536 | group.selection.get(i).linkVerticesThis(content); |
---|
2140 | 2537 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2141 | | - CameraPane.RANDOM = random; |
---|
| 2538 | + CameraPane.SWITCH = random; |
---|
2142 | 2539 | } |
---|
2143 | 2540 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2144 | 2541 | refreshContents(); |
---|
.. | .. |
---|
2148 | 2545 | { |
---|
2149 | 2546 | for (int i=0; i<group.selection.size(); i++) |
---|
2150 | 2547 | { |
---|
2151 | | - boolean random = CameraPane.RANDOM; |
---|
2152 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2548 | + boolean random = CameraPane.SWITCH; |
---|
| 2549 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2153 | 2550 | group.selection.get(i).linkVerticesThis(null); |
---|
2154 | | - CameraPane.RANDOM = random; |
---|
| 2551 | + CameraPane.SWITCH = random; |
---|
2155 | 2552 | } |
---|
2156 | 2553 | |
---|
2157 | 2554 | refreshContents(); |
---|
2158 | 2555 | } else |
---|
2159 | 2556 | if (source == relinkverticesItem) |
---|
2160 | 2557 | { |
---|
2161 | | - boolean random = CameraPane.RANDOM; |
---|
2162 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2558 | + boolean random = CameraPane.SWITCH; |
---|
| 2559 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2163 | 2560 | group.selection.RelinkToSupport(); |
---|
2164 | | - CameraPane.RANDOM = random; |
---|
| 2561 | + CameraPane.SWITCH = random; |
---|
2165 | 2562 | |
---|
2166 | 2563 | refreshContents(); |
---|
2167 | 2564 | } else |
---|
.. | .. |
---|
2176 | 2573 | } else |
---|
2177 | 2574 | if (source == setMasterItem) |
---|
2178 | 2575 | { |
---|
2179 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2576 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2180 | 2577 | { |
---|
2181 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2578 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2182 | 2579 | |
---|
2183 | 2580 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2184 | 2581 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2191 | 2588 | { |
---|
2192 | 2589 | if (group.selection.size() == 1) |
---|
2193 | 2590 | { |
---|
2194 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2591 | + if (Grafreed.clipboard.size() == 1) |
---|
2195 | 2592 | { |
---|
2196 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2593 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2197 | 2594 | |
---|
2198 | 2595 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2199 | 2596 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2210 | 2607 | { |
---|
2211 | 2608 | RevertMeshes(); |
---|
2212 | 2609 | } else |
---|
2213 | | - if (source == resetMeshItem) |
---|
| 2610 | + if (source == resetAllItem) |
---|
2214 | 2611 | { |
---|
2215 | 2612 | ResetAll(); |
---|
2216 | 2613 | } else |
---|
.. | .. |
---|
2230 | 2627 | { |
---|
2231 | 2628 | ClearSelection(true); |
---|
2232 | 2629 | } else |
---|
2233 | | - if (source == grabItem) |
---|
| 2630 | + if (source == grabItem || source == groupButton) |
---|
2234 | 2631 | { |
---|
2235 | | - group(new cGroup(), true); |
---|
| 2632 | + group(new cGroup(), false); // true); |
---|
2236 | 2633 | } else |
---|
2237 | 2634 | if (source == hideItem) |
---|
2238 | 2635 | { |
---|
.. | .. |
---|
2250 | 2647 | { |
---|
2251 | 2648 | makeSomething(new Camera()); |
---|
2252 | 2649 | } else |
---|
2253 | | - if (source == compositeItem) |
---|
| 2650 | + if (source == compositeItem || source == compositeButton) |
---|
2254 | 2651 | { |
---|
2255 | 2652 | group(new Composite()); |
---|
2256 | 2653 | } else |
---|
2257 | | - if (source == randomItem) |
---|
| 2654 | + if (source == switchItem || source == switchButton) |
---|
2258 | 2655 | { |
---|
2259 | 2656 | RandomNode random = new RandomNode(); |
---|
2260 | 2657 | group(random); |
---|
2261 | 2658 | if (random.size() > 0) |
---|
2262 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2659 | + random.name = random.get(0).name + "Switch"; |
---|
2263 | 2660 | } else |
---|
2264 | 2661 | if (source == physicsItem) |
---|
2265 | 2662 | { |
---|
.. | .. |
---|
2356 | 2753 | { |
---|
2357 | 2754 | group(new cLinker()); |
---|
2358 | 2755 | } else |
---|
2359 | | - if (source == textureItem) |
---|
| 2756 | + if (source == textureItem || source == textureButton) |
---|
2360 | 2757 | { |
---|
2361 | 2758 | group(new TextureNode()); |
---|
2362 | 2759 | } else |
---|
.. | .. |
---|
2376 | 2773 | { |
---|
2377 | 2774 | CastShadow(2); |
---|
2378 | 2775 | } else |
---|
2379 | | - if (source == ungroupItem) |
---|
| 2776 | + if (source == ungroupItem || source == ungroupButton) |
---|
2380 | 2777 | { |
---|
2381 | | - //ungroup(); |
---|
| 2778 | + boolean hasRoot = false; |
---|
| 2779 | + |
---|
2382 | 2780 | for (int i=0; i<group.selection.size(); i++) |
---|
2383 | 2781 | { |
---|
2384 | | - Ungroup(group.selection.get(i)); |
---|
| 2782 | + if (group.selection.get(i) == group) |
---|
| 2783 | + { |
---|
| 2784 | + hasRoot = true; |
---|
| 2785 | + break; |
---|
| 2786 | + } |
---|
2385 | 2787 | } |
---|
2386 | 2788 | |
---|
2387 | | - ClearSelection(false); |
---|
2388 | | - |
---|
2389 | | - 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 | + } |
---|
2390 | 2800 | } else |
---|
2391 | 2801 | if (source == genUVItem) |
---|
2392 | 2802 | { |
---|
.. | .. |
---|
2398 | 2808 | } else |
---|
2399 | 2809 | if (source == genNormalsMESHItem) |
---|
2400 | 2810 | { |
---|
2401 | | - GenNormals(true); // TODO |
---|
| 2811 | + GenNormalsMESH(); |
---|
2402 | 2812 | } else |
---|
2403 | 2813 | if (source == genNormalsORGANItem) |
---|
2404 | 2814 | { |
---|
.. | .. |
---|
2463 | 2873 | if (source == unmarkleavesItem) |
---|
2464 | 2874 | { |
---|
2465 | 2875 | MarkLeaves(false); |
---|
| 2876 | + } else |
---|
| 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); |
---|
2466 | 2892 | } else |
---|
2467 | 2893 | if (source == flipVItem) |
---|
2468 | 2894 | { |
---|
.. | .. |
---|
2548 | 2974 | { |
---|
2549 | 2975 | SmoothMesh(); |
---|
2550 | 2976 | } else |
---|
2551 | | - if (source == transformgeometryItem) |
---|
| 2977 | + if (source == transformGeometryItem) |
---|
2552 | 2978 | { |
---|
2553 | 2979 | TransformGeometry(); |
---|
| 2980 | + } else |
---|
| 2981 | + if (source == transformChildrenItem) |
---|
| 2982 | + { |
---|
| 2983 | + TransformChildren(); |
---|
2554 | 2984 | } else |
---|
2555 | 2985 | if (source == resetTransformItem) |
---|
2556 | 2986 | { |
---|
.. | .. |
---|
2558 | 2988 | } else |
---|
2559 | 2989 | if (source == resetCentroidItem) |
---|
2560 | 2990 | { |
---|
2561 | | - ResetCentroid(); |
---|
| 2991 | + ResetCentroid(true); |
---|
| 2992 | + } else |
---|
| 2993 | + if (source == resetCentroidXZItem) |
---|
| 2994 | + { |
---|
| 2995 | + ResetCentroid(false); |
---|
2562 | 2996 | } else |
---|
2563 | 2997 | if (source == resetParentItem) |
---|
2564 | 2998 | { |
---|
.. | .. |
---|
2690 | 3124 | if (source == twoButton) |
---|
2691 | 3125 | { |
---|
2692 | 3126 | radio.layout = twoButton; |
---|
| 3127 | + |
---|
| 3128 | + if (CameraPane.FULLSCREEN) |
---|
| 3129 | + fullscreenLayout = radio.layout; |
---|
| 3130 | + |
---|
2693 | 3131 | // bug |
---|
2694 | 3132 | //gridPanel.setDividerLocation(1.0); |
---|
2695 | 3133 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2720 | 3158 | // centralPanel.setVisible(true); |
---|
2721 | 3159 | // XYZPanel.setVisible(false); |
---|
2722 | 3160 | bigThree.ClearUI(); |
---|
2723 | | - bigThree.addComponent(centralPanel); |
---|
| 3161 | + bigThree.add(centralPanel); |
---|
2724 | 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 | + |
---|
2725 | 3181 | } else |
---|
2726 | 3182 | if (source == threeButton) |
---|
2727 | 3183 | { |
---|
2728 | 3184 | radio.layout = threeButton; |
---|
| 3185 | + |
---|
| 3186 | + if (CameraPane.FULLSCREEN) |
---|
| 3187 | + fullscreenLayout = radio.layout; |
---|
2729 | 3188 | |
---|
2730 | 3189 | // bigThree.remove(scenePanel); |
---|
2731 | 3190 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2755 | 3214 | // centralPanel.setVisible(true); |
---|
2756 | 3215 | // XYZPanel.setVisible(true); |
---|
2757 | 3216 | bigThree.ClearUI(); |
---|
2758 | | - bigThree.addComponent(centralPanel); |
---|
2759 | | - bigThree.addComponent(XYZPanel); |
---|
| 3217 | + bigThree.add(centralPanel); |
---|
| 3218 | + bigThree.add(XYZPanel); |
---|
2760 | 3219 | bigThree.FlushUI(); |
---|
| 3220 | + |
---|
| 3221 | + cameraView.requestFocusInWindow(); |
---|
2761 | 3222 | } else |
---|
2762 | 3223 | if (source == fourButton) |
---|
2763 | 3224 | { |
---|
2764 | 3225 | radio.layout = fourButton; |
---|
| 3226 | + |
---|
| 3227 | + if (CameraPane.FULLSCREEN) |
---|
| 3228 | + fullscreenLayout = radio.layout; |
---|
2765 | 3229 | |
---|
2766 | 3230 | // bigThree.remove(scenePanel); |
---|
2767 | 3231 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2791 | 3255 | // centralPanel.setVisible(false); |
---|
2792 | 3256 | // XYZPanel.setVisible(false); |
---|
2793 | 3257 | bigThree.ClearUI(); |
---|
2794 | | - bigThree.addComponent(scenePanel); |
---|
| 3258 | + bigThree.add(scenePanel); |
---|
2795 | 3259 | bigThree.FlushUI(); |
---|
| 3260 | + |
---|
| 3261 | + cameraView.requestFocusInWindow(); |
---|
2796 | 3262 | } else |
---|
2797 | 3263 | if (source == sixButton) |
---|
2798 | 3264 | { |
---|
2799 | 3265 | radio.layout = sixButton; |
---|
| 3266 | + |
---|
| 3267 | + if (CameraPane.FULLSCREEN) |
---|
| 3268 | + fullscreenLayout = radio.layout; |
---|
2800 | 3269 | |
---|
2801 | 3270 | // bigThree.remove(scenePanel); |
---|
2802 | 3271 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2826 | 3295 | // centralPanel.setVisible(true); |
---|
2827 | 3296 | // XYZPanel.setVisible(false); |
---|
2828 | 3297 | bigThree.ClearUI(); |
---|
2829 | | - bigThree.addComponent(scenePanel); |
---|
2830 | | - bigThree.addComponent(centralPanel); |
---|
| 3298 | + bigThree.add(scenePanel); |
---|
| 3299 | + bigThree.add(centralPanel); |
---|
2831 | 3300 | bigThree.FlushUI(); |
---|
| 3301 | + |
---|
| 3302 | + cameraView.requestFocusInWindow(); |
---|
2832 | 3303 | } else |
---|
2833 | 3304 | if (source == sevenButton) |
---|
2834 | 3305 | { |
---|
2835 | 3306 | radio.layout = sevenButton; |
---|
| 3307 | + |
---|
| 3308 | + if (CameraPane.FULLSCREEN) |
---|
| 3309 | + fullscreenLayout = radio.layout; |
---|
2836 | 3310 | |
---|
2837 | 3311 | // bigThree.remove(scenePanel); |
---|
2838 | 3312 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2862 | 3336 | // centralPanel.setVisible(true); |
---|
2863 | 3337 | // XYZPanel.setVisible(true); |
---|
2864 | 3338 | bigThree.ClearUI(); |
---|
2865 | | - bigThree.addComponent(scenePanel); |
---|
2866 | | - bigThree.addComponent(centralPanel); |
---|
2867 | | - bigThree.addComponent(XYZPanel); |
---|
| 3339 | + bigThree.add(scenePanel); |
---|
| 3340 | + bigThree.add(centralPanel); |
---|
| 3341 | + bigThree.add(XYZPanel); |
---|
2868 | 3342 | bigThree.FlushUI(); |
---|
| 3343 | + |
---|
| 3344 | + cameraView.requestFocusInWindow(); |
---|
2869 | 3345 | } else |
---|
2870 | 3346 | if (source == rootButton) |
---|
2871 | 3347 | { |
---|
.. | .. |
---|
2877 | 3353 | EditObject(obj); |
---|
2878 | 3354 | } |
---|
2879 | 3355 | |
---|
| 3356 | + cameraView.requestFocusInWindow(); |
---|
2880 | 3357 | refreshContents(true); |
---|
2881 | 3358 | } else |
---|
2882 | 3359 | if (source == closeButton) |
---|
.. | .. |
---|
2886 | 3363 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2887 | 3364 | { |
---|
2888 | 3365 | ab = (cRadio)e.nextElement(); |
---|
2889 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3366 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2890 | 3367 | { |
---|
| 3368 | + // Patch to avoid bug with transparency. |
---|
| 3369 | + if (!ab.hadMaterial) |
---|
| 3370 | + { |
---|
| 3371 | + ab.object.material = null; |
---|
| 3372 | + } |
---|
| 3373 | + |
---|
2891 | 3374 | buttonGroup.remove(ab); |
---|
2892 | 3375 | radioPanel.remove(ab); |
---|
2893 | 3376 | |
---|
2894 | | - ab.GetObject().editWindow = null; |
---|
| 3377 | + //ab.GetObject().editWindow = null; |
---|
| 3378 | + ab.GetObject().manipWindow = null; |
---|
2895 | 3379 | // ab.GetObject().objectUI = null; // ????????? |
---|
2896 | 3380 | |
---|
2897 | 3381 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2898 | 3382 | break; |
---|
2899 | 3383 | } |
---|
2900 | 3384 | } |
---|
| 3385 | + |
---|
| 3386 | + cameraView.requestFocusInWindow(); |
---|
2901 | 3387 | refreshContents(true); |
---|
2902 | 3388 | } else |
---|
2903 | 3389 | if (source == editItem || source == editButton) |
---|
2904 | 3390 | { |
---|
| 3391 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3392 | + { |
---|
| 3393 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3394 | + child.pinned = true; |
---|
| 3395 | + } |
---|
| 3396 | + |
---|
2905 | 3397 | EditSelection(false); |
---|
2906 | 3398 | } else |
---|
2907 | 3399 | if (source == uneditButton) |
---|
.. | .. |
---|
2911 | 3403 | Object3D child = (Object3D)e.nextElement(); |
---|
2912 | 3404 | if(child.editWindow != null) |
---|
2913 | 3405 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3406 | + child.pinned = false; |
---|
2914 | 3407 | child.CloseUI(); |
---|
2915 | 3408 | listUI.remove(child); |
---|
2916 | 3409 | |
---|
2917 | | - child.editWindow = null; // ??????????? |
---|
| 3410 | + //child.editWindow = null; // ??????????? |
---|
2918 | 3411 | } |
---|
2919 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3412 | + objEditor.ctrlPanel.FlushUI(); |
---|
2920 | 3413 | //objEditor.jTree.clearSelection(); |
---|
2921 | 3414 | //objEditor.ResetSliders(); |
---|
2922 | 3415 | refreshContents(true); |
---|
.. | .. |
---|
2927 | 3420 | //copy.ClearUI(); |
---|
2928 | 3421 | for (Object3D obj : listUI) |
---|
2929 | 3422 | { |
---|
| 3423 | + obj.pinned = false; |
---|
2930 | 3424 | obj.CloseUI(); |
---|
2931 | 3425 | } |
---|
2932 | 3426 | listUI.clear(); |
---|
.. | .. |
---|
2936 | 3430 | { |
---|
2937 | 3431 | assert(copy == group); |
---|
2938 | 3432 | |
---|
2939 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3433 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2940 | 3434 | |
---|
2941 | 3435 | for (Object3D obj : listUI) |
---|
2942 | 3436 | { |
---|
.. | .. |
---|
3000 | 3494 | frontView.object = group; |
---|
3001 | 3495 | sideView.object = group; |
---|
3002 | 3496 | } |
---|
3003 | | - group.editWindow = this; |
---|
| 3497 | + |
---|
| 3498 | +// fix "+" issue |
---|
| 3499 | + //group.editWindow = this; |
---|
| 3500 | + group.manipWindow = this; |
---|
| 3501 | + |
---|
3004 | 3502 | /* |
---|
3005 | 3503 | currentLayout = radio.layout; |
---|
3006 | 3504 | if (currentLayout == null) |
---|
3007 | 3505 | currentLayout = sevenButton; |
---|
3008 | 3506 | */ |
---|
3009 | 3507 | radio.layout.doClick(); |
---|
| 3508 | + |
---|
| 3509 | + ClearUnpinned(); |
---|
| 3510 | + SetPinStates(group.selection.size() > 0); |
---|
| 3511 | + if (group.selection.size() == 1) |
---|
| 3512 | + EditSelection(false); |
---|
3010 | 3513 | keepparent = group.parent; |
---|
3011 | 3514 | // PARENT = NULL or not??? |
---|
3012 | 3515 | //group.parent = null; // ROOT |
---|
3013 | 3516 | //group.attributes = -1; |
---|
3014 | 3517 | ResetModel(); |
---|
| 3518 | + |
---|
| 3519 | + cameraView.requestFocusInWindow(); |
---|
3015 | 3520 | refreshContents(true); |
---|
3016 | | - } |
---|
| 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 | + } |
---|
3017 | 3535 | else |
---|
3018 | 3536 | { |
---|
3019 | 3537 | //return super.action(event, arg); |
---|
.. | .. |
---|
3022 | 3540 | } |
---|
3023 | 3541 | |
---|
3024 | 3542 | boolean useclient = false; |
---|
3025 | | - cRadio radio; |
---|
3026 | 3543 | |
---|
3027 | 3544 | void ToggleRoot() |
---|
3028 | 3545 | { |
---|
.. | .. |
---|
3074 | 3591 | refreshContents(); |
---|
3075 | 3592 | } |
---|
3076 | 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 | + } |
---|
3077 | 3616 | |
---|
3078 | 3617 | void ResetTransform() |
---|
3079 | 3618 | { |
---|
.. | .. |
---|
3186 | 3725 | refreshContents(); |
---|
3187 | 3726 | } |
---|
3188 | 3727 | |
---|
3189 | | - void ResetCentroid() |
---|
| 3728 | + void ResetCentroid(boolean full) |
---|
3190 | 3729 | { |
---|
3191 | 3730 | Object3D obj; |
---|
3192 | 3731 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3201 | 3740 | LA.matIdentity(Object3D.mat); |
---|
3202 | 3741 | obj.getBounds(minima, maxima, false); |
---|
3203 | 3742 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3204 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3743 | + if (full) |
---|
| 3744 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3205 | 3745 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3206 | 3746 | obj.TransformMesh(Object3D.mat); |
---|
| 3747 | + |
---|
3207 | 3748 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3208 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3749 | + if (full) |
---|
| 3750 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3209 | 3751 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3752 | + |
---|
3210 | 3753 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3211 | 3754 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3212 | 3755 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3235 | 3778 | |
---|
3236 | 3779 | int size = obj.MemorySize(); |
---|
3237 | 3780 | |
---|
3238 | | - 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)"); |
---|
3239 | 3783 | } |
---|
3240 | 3784 | } |
---|
3241 | 3785 | catch (Exception e) |
---|
.. | .. |
---|
3272 | 3816 | obj = (Object3D)e.nextElement(); |
---|
3273 | 3817 | |
---|
3274 | 3818 | System.out.println("Object is: " + obj); |
---|
3275 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3819 | + Grafreed.AnalyzeObject(obj); |
---|
3276 | 3820 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3277 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3821 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3278 | 3822 | |
---|
3279 | 3823 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3280 | 3824 | } |
---|
.. | .. |
---|
3316 | 3860 | void GenNormals(boolean crease) |
---|
3317 | 3861 | { |
---|
3318 | 3862 | group.GenNormalsS(crease); |
---|
| 3863 | + |
---|
| 3864 | + refreshContents(); |
---|
| 3865 | + } |
---|
| 3866 | + |
---|
| 3867 | + void GenNormalsMESH() |
---|
| 3868 | + { |
---|
| 3869 | + group.GenNormalsMeshS(); |
---|
3319 | 3870 | |
---|
3320 | 3871 | refreshContents(); |
---|
3321 | 3872 | } |
---|
.. | .. |
---|
3488 | 4039 | |
---|
3489 | 4040 | void ParseVertices() |
---|
3490 | 4041 | { |
---|
3491 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3492 | | - GrafreeD.epsequal = true; |
---|
| 4042 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4043 | + Grafreed.epsequal = true; |
---|
3493 | 4044 | |
---|
3494 | 4045 | for (int i=0; i<group.selection.size(); i++) |
---|
3495 | 4046 | { |
---|
.. | .. |
---|
3514 | 4065 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3515 | 4066 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3516 | 4067 | |
---|
3517 | | - g.add(GrafreeD.clipboard); |
---|
| 4068 | + g.add(Grafreed.clipboard); |
---|
3518 | 4069 | |
---|
3519 | 4070 | buffer.add(g); |
---|
3520 | 4071 | } |
---|
.. | .. |
---|
3529 | 4080 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3530 | 4081 | } |
---|
3531 | 4082 | |
---|
3532 | | - GrafreeD.epsequal = epsequal; |
---|
| 4083 | + Grafreed.epsequal = epsequal; |
---|
3533 | 4084 | |
---|
3534 | 4085 | refreshContents(); |
---|
3535 | 4086 | } |
---|
.. | .. |
---|
3547 | 4098 | String pigment = Object3D.GetPigment(tex); |
---|
3548 | 4099 | //String bump = Object3D.GetBump(tex); |
---|
3549 | 4100 | |
---|
3550 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.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 | + } |
---|
3551 | 4111 | |
---|
3552 | 4112 | double s = v.s; |
---|
3553 | 4113 | |
---|
.. | .. |
---|
3635 | 4195 | |
---|
3636 | 4196 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3637 | 4197 | |
---|
3638 | | - boolean random = CameraPane.RANDOM; |
---|
3639 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4198 | + boolean random = CameraPane.SWITCH; |
---|
| 4199 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3640 | 4200 | lowres.linkVerticesThis(null); |
---|
3641 | 4201 | lowres.linkVerticesThis(sn); |
---|
3642 | | - CameraPane.RANDOM = random; |
---|
| 4202 | + CameraPane.SWITCH = random; |
---|
3643 | 4203 | |
---|
3644 | 4204 | System.err.flush(); |
---|
3645 | 4205 | |
---|
.. | .. |
---|
3679 | 4239 | return; |
---|
3680 | 4240 | |
---|
3681 | 4241 | Object3D poses = group.selection.get(0); |
---|
3682 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4242 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3683 | 4243 | |
---|
3684 | 4244 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3685 | 4245 | |
---|
.. | .. |
---|
3873 | 4433 | |
---|
3874 | 4434 | void ClipMesh() |
---|
3875 | 4435 | { |
---|
3876 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4436 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3877 | 4437 | { |
---|
3878 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4438 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3879 | 4439 | |
---|
3880 | 4440 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3881 | 4441 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3884 | 4444 | // { |
---|
3885 | 4445 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3886 | 4446 | // } |
---|
3887 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4447 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3888 | 4448 | } |
---|
3889 | 4449 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3890 | 4450 | System.out.println("DONE."); |
---|
.. | .. |
---|
3931 | 4491 | void MarkLeaves(boolean hide) |
---|
3932 | 4492 | { |
---|
3933 | 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); |
---|
3934 | 4506 | refreshContents(); |
---|
3935 | 4507 | } |
---|
3936 | 4508 | |
---|
.. | .. |
---|
4005 | 4577 | // } |
---|
4006 | 4578 | // } |
---|
4007 | 4579 | |
---|
4008 | | - static boolean allparams = true; |
---|
4009 | | - |
---|
4010 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4011 | | - |
---|
4012 | 4580 | void EditSelection(boolean newWindow) |
---|
4013 | 4581 | { |
---|
4014 | 4582 | // aConstraints.gridy = 0; |
---|
.. | .. |
---|
4016 | 4584 | { |
---|
4017 | 4585 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4018 | 4586 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4019 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4587 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4020 | 4588 | |
---|
4021 | 4589 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4022 | | - if(elem != group) |
---|
| 4590 | + if(elem != group || !newWindow) |
---|
4023 | 4591 | { |
---|
4024 | 4592 | // if (!(elem instanceof Composite)) |
---|
4025 | 4593 | // newWindow = false; |
---|
.. | .. |
---|
4101 | 4669 | //new Exception().printStackTrace(); |
---|
4102 | 4670 | |
---|
4103 | 4671 | freezemodel = true; |
---|
4104 | | - |
---|
| 4672 | + ClearUnpinned(); |
---|
| 4673 | + |
---|
4105 | 4674 | /**/ |
---|
4106 | 4675 | //switch (event.id) |
---|
4107 | 4676 | { |
---|
.. | .. |
---|
4109 | 4678 | //case 702: // Event.LIST_DESELECT |
---|
4110 | 4679 | group.deselectAll(); |
---|
4111 | 4680 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4112 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4113 | 4681 | if (tps != null) |
---|
4114 | 4682 | { |
---|
4115 | 4683 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4118 | 4686 | |
---|
4119 | 4687 | //if (child.parent != null) |
---|
4120 | 4688 | //child.parent.addSelectee(child); |
---|
| 4689 | + objEditor.SetMaterial(child); |
---|
4121 | 4690 | group.addSelectee(child); |
---|
4122 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4123 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4124 | | - System.err.println("info : " + child.GetPath()); |
---|
4125 | 4691 | } |
---|
4126 | 4692 | } |
---|
4127 | | - else |
---|
4128 | | - { |
---|
4129 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4130 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4131 | | - System.err.println("info : " + group.GetPath()); |
---|
4132 | | - } |
---|
| 4693 | +// else |
---|
| 4694 | +// { |
---|
| 4695 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4696 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4697 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4698 | +// } |
---|
4133 | 4699 | |
---|
4134 | | - objEditor.SetText(); // jan 2014 |
---|
4135 | | - |
---|
4136 | | - if (flashIt && !Globals.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)) |
---|
4137 | 4701 | CameraPane.flash = true; |
---|
4138 | 4702 | |
---|
4139 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4703 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4140 | 4704 | // a camera |
---|
4141 | 4705 | { |
---|
4142 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4143 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 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 | + } |
---|
4144 | 4711 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4145 | 4712 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4146 | 4713 | } |
---|
4147 | 4714 | |
---|
| 4715 | + if (tps != null && tps.length == 1) |
---|
| 4716 | + { |
---|
| 4717 | + EditSelection(false); |
---|
| 4718 | + } |
---|
| 4719 | + |
---|
| 4720 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4721 | + |
---|
4148 | 4722 | refreshContents(); |
---|
4149 | 4723 | //return true; |
---|
4150 | 4724 | } |
---|
.. | .. |
---|
4153 | 4727 | |
---|
4154 | 4728 | freezemodel = false; |
---|
4155 | 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 | + } |
---|
4156 | 4759 | |
---|
4157 | 4760 | void linkSomething(Object3D thing) |
---|
4158 | 4761 | { |
---|
.. | .. |
---|
4224 | 4827 | { |
---|
4225 | 4828 | if (group.selection.isEmpty()) |
---|
4226 | 4829 | return; |
---|
4227 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4830 | + |
---|
| 4831 | + Grafreed.clipboardIsTempGroup = false; |
---|
4228 | 4832 | Composite tGroup = null; |
---|
4229 | 4833 | if (group.selection.size() > 0) // 1) |
---|
4230 | 4834 | { |
---|
4231 | 4835 | tGroup = new cGroup(); |
---|
4232 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4836 | + Grafreed.clipboardIsTempGroup = true; |
---|
4233 | 4837 | } |
---|
4234 | 4838 | |
---|
4235 | 4839 | if (cut) |
---|
4236 | 4840 | { |
---|
| 4841 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4842 | +// Save(); |
---|
4237 | 4843 | //int indices[] = jList.getSelectedIndices(); |
---|
4238 | 4844 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4239 | 4845 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4269 | 4875 | //System.out.println("cut " + child); |
---|
4270 | 4876 | //System.out.println("parent = " + child.parent); |
---|
4271 | 4877 | // tmp.addChild(child); |
---|
4272 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4878 | + if (Grafreed.clipboardIsTempGroup) |
---|
4273 | 4879 | tGroup.add/*Child*/(tmp); |
---|
4274 | 4880 | else |
---|
4275 | | - GrafreeD.clipboard = tmp; |
---|
| 4881 | + Grafreed.clipboard = tmp; |
---|
4276 | 4882 | } |
---|
4277 | 4883 | else |
---|
4278 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4884 | + if (Grafreed.clipboardIsTempGroup) |
---|
4279 | 4885 | tGroup.add/*Child*/(child); |
---|
4280 | 4886 | else |
---|
4281 | | - GrafreeD.clipboard = child; |
---|
| 4887 | + Grafreed.clipboard = child; |
---|
4282 | 4888 | } |
---|
4283 | 4889 | |
---|
4284 | 4890 | //ResetModel(); |
---|
.. | .. |
---|
4310 | 4916 | //System.out.println("cut " + elem); |
---|
4311 | 4917 | //System.out.println("parent = " + elem.parent); |
---|
4312 | 4918 | // tmp.addChild(elem); |
---|
4313 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4919 | + if (Grafreed.clipboardIsTempGroup) |
---|
4314 | 4920 | tGroup.add/*Child*/(tmp); |
---|
4315 | 4921 | else |
---|
4316 | | - GrafreeD.clipboard = tmp; |
---|
| 4922 | + Grafreed.clipboard = tmp; |
---|
4317 | 4923 | } |
---|
4318 | 4924 | else |
---|
4319 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4925 | + if (Grafreed.clipboardIsTempGroup) |
---|
4320 | 4926 | tGroup.add/*Child*/(child); |
---|
4321 | 4927 | else |
---|
4322 | | - GrafreeD.clipboard = child; |
---|
| 4928 | + Grafreed.clipboard = child; |
---|
4323 | 4929 | } |
---|
4324 | 4930 | |
---|
4325 | 4931 | } |
---|
4326 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4327 | | - GrafreeD.clipboard = tGroup; |
---|
| 4932 | + |
---|
| 4933 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 4934 | + Grafreed.clipboard = tGroup; |
---|
| 4935 | + |
---|
4328 | 4936 | if (cut) |
---|
4329 | 4937 | { |
---|
4330 | 4938 | ResetModel(); |
---|
.. | .. |
---|
4334 | 4942 | |
---|
4335 | 4943 | void paste(boolean expand) |
---|
4336 | 4944 | { |
---|
| 4945 | + if (Globals.SAVEONMAKE) |
---|
| 4946 | + Save(); |
---|
| 4947 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 4948 | + Globals.SAVEONMAKE = false; |
---|
4337 | 4949 | // if (GrafreeD.clipboard == null) |
---|
4338 | 4950 | // return; |
---|
4339 | 4951 | boolean first = true; |
---|
4340 | 4952 | |
---|
4341 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4953 | + if (Grafreed.clipboardIsTempGroup) |
---|
4342 | 4954 | { |
---|
4343 | 4955 | Composite temp; |
---|
4344 | 4956 | |
---|
.. | .. |
---|
4349 | 4961 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4350 | 4962 | */ |
---|
4351 | 4963 | Object3D elem; |
---|
4352 | | - 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)) |
---|
4353 | 4965 | { |
---|
4354 | 4966 | Object3D child = (Object3D)e.nextElement(); |
---|
4355 | 4967 | |
---|
.. | .. |
---|
4383 | 4995 | //Object3D cb = Applet3D.clipboard; |
---|
4384 | 4996 | //temp.addChild(cb); |
---|
4385 | 4997 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4386 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4387 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4388 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4389 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4390 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 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()); |
---|
4391 | 5003 | else |
---|
4392 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4393 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5004 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5005 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4394 | 5006 | } |
---|
4395 | 5007 | |
---|
| 5008 | + Globals.SAVEONMAKE = keep; |
---|
4396 | 5009 | ResetModel(); |
---|
4397 | 5010 | refreshContents(); |
---|
4398 | 5011 | } |
---|
4399 | 5012 | |
---|
4400 | | - void pasteInto(boolean copyit) |
---|
| 5013 | + void pasteInto(boolean copyit, boolean clone) |
---|
4401 | 5014 | { |
---|
4402 | 5015 | // if (GrafreeD.clipboard == null) |
---|
4403 | 5016 | // return; |
---|
.. | .. |
---|
4426 | 5039 | if (copyit) |
---|
4427 | 5040 | { |
---|
4428 | 5041 | // paste(false); |
---|
4429 | | - CloneClipboard(false); // sept 2014 |
---|
| 5042 | + if (clone) |
---|
| 5043 | + { |
---|
| 5044 | + CloneClipboard(false); // sept 2014 |
---|
| 5045 | + } |
---|
| 5046 | + else |
---|
| 5047 | + { |
---|
| 5048 | + paste(false); |
---|
| 5049 | + } |
---|
4430 | 5050 | } |
---|
4431 | 5051 | else |
---|
4432 | 5052 | { |
---|
4433 | 5053 | boolean first = true; |
---|
4434 | 5054 | |
---|
4435 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5055 | + if (Grafreed.clipboardIsTempGroup) |
---|
4436 | 5056 | { |
---|
4437 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5057 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4438 | 5058 | Object3D copy; |
---|
4439 | 5059 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4440 | 5060 | { |
---|
.. | .. |
---|
4444 | 5064 | } |
---|
4445 | 5065 | } else |
---|
4446 | 5066 | { |
---|
4447 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5067 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4448 | 5068 | } |
---|
4449 | 5069 | } |
---|
4450 | 5070 | } |
---|
.. | .. |
---|
4521 | 5141 | |
---|
4522 | 5142 | void group(Object3D csg, boolean grab) |
---|
4523 | 5143 | { |
---|
| 5144 | + if (Globals.SAVEONMAKE) |
---|
| 5145 | + Save(); |
---|
| 5146 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 5147 | + Globals.SAVEONMAKE = false; |
---|
4524 | 5148 | if (//false) // why?? |
---|
4525 | 5149 | !group.selection.isEmpty()) |
---|
4526 | 5150 | { |
---|
.. | .. |
---|
4634 | 5258 | //node.add(csg); |
---|
4635 | 5259 | //makeSomething(node); |
---|
4636 | 5260 | makeSomething(csg); |
---|
| 5261 | + Globals.SAVEONMAKE = keep; |
---|
4637 | 5262 | } |
---|
4638 | 5263 | |
---|
4639 | 5264 | void Ungroup(Object3D g) |
---|
4640 | 5265 | { |
---|
| 5266 | + if (Globals.SAVEONMAKE) |
---|
| 5267 | + Save(); |
---|
| 5268 | + boolean keep = Globals.SAVEONMAKE; |
---|
| 5269 | + Globals.SAVEONMAKE = false; |
---|
4641 | 5270 | if (g instanceof HiddenObject) |
---|
4642 | 5271 | { |
---|
4643 | 5272 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4654 | 5283 | objEditor.makeSomething(g.get(i), false); |
---|
4655 | 5284 | } |
---|
4656 | 5285 | } |
---|
| 5286 | + Globals.SAVEONMAKE = keep; |
---|
4657 | 5287 | } |
---|
4658 | 5288 | |
---|
4659 | 5289 | void ungroup() |
---|
.. | .. |
---|
4849 | 5479 | } |
---|
4850 | 5480 | */ |
---|
4851 | 5481 | |
---|
4852 | | - void ImportGFD() |
---|
4853 | | - { |
---|
4854 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4855 | | - browser.show(); |
---|
4856 | | - String filename = browser.getFile(); |
---|
4857 | | - if (filename != null && filename.length() > 0) |
---|
4858 | | - { |
---|
4859 | | - String fullname = browser.getDirectory() + filename; |
---|
4860 | | - |
---|
4861 | | - //Object3D readobj = |
---|
4862 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4863 | | - //makeSomething(readobj); |
---|
4864 | | - } |
---|
4865 | | - } |
---|
4866 | | - |
---|
4867 | 5482 | /* |
---|
4868 | 5483 | public void Callback(Object obj) |
---|
4869 | 5484 | { |
---|
.. | .. |
---|
4887 | 5502 | } |
---|
4888 | 5503 | */ |
---|
4889 | 5504 | |
---|
4890 | | - void ImportVRMLX3D() |
---|
4891 | | - { |
---|
4892 | | - if (GrafreeD.standAlone) |
---|
4893 | | - { |
---|
4894 | | - /**/ |
---|
4895 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4896 | | - browser.show(); |
---|
4897 | | - String filename = browser.getFile(); |
---|
4898 | | - if (filename != null && filename.length() > 0) |
---|
4899 | | - { |
---|
4900 | | - String fullname = browser.getDirectory() + filename; |
---|
4901 | | - LoadVRMLX3D(fullname); |
---|
4902 | | - } |
---|
4903 | | - /**/ |
---|
4904 | | - } |
---|
4905 | | - } |
---|
4906 | | - |
---|
4907 | 5505 | String GetFile(String dialogName) |
---|
4908 | 5506 | { |
---|
4909 | | - if (GrafreeD.standAlone) |
---|
| 5507 | + if (Grafreed.standAlone) |
---|
4910 | 5508 | { |
---|
4911 | 5509 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4912 | 5510 | browser.show(); |
---|
.. | .. |
---|
4970 | 5568 | cButton flashSelectionButton; |
---|
4971 | 5569 | cButton editButton; |
---|
4972 | 5570 | cButton uneditButton; |
---|
| 5571 | + JCheckBox allParamsButton; |
---|
4973 | 5572 | cButton clearpanelButton; |
---|
4974 | | - cButton allParamsButton; |
---|
4975 | 5573 | cButton unselectButton; |
---|
4976 | 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 | + |
---|
4977 | 5598 | cButton screenfitButton; |
---|
4978 | 5599 | cButton screenfitpointButton; |
---|
4979 | 5600 | cButton snapobjectButton; |
---|
.. | .. |
---|
4985 | 5606 | |
---|
4986 | 5607 | cButton setsupportButton; |
---|
4987 | 5608 | |
---|
4988 | | - cButton twoButton; |
---|
4989 | | - cButton sixButton; |
---|
4990 | | - cButton threeButton; |
---|
4991 | | - cButton sevenButton; |
---|
4992 | | - cButton fourButton; // full panel |
---|
4993 | | - cButton oneButton; // full XYZ |
---|
4994 | | - //cButton currentLayout; |
---|
4995 | | - |
---|
4996 | 5609 | // |
---|
4997 | 5610 | //Composite |
---|
4998 | 5611 | Object3D // to do !! |
---|
.. | .. |
---|
5002 | 5615 | //JTree jTree; |
---|
5003 | 5616 | private MenuItem lookAtItem; |
---|
5004 | 5617 | private MenuItem lookFromItem; |
---|
5005 | | - private MenuItem switchItem; |
---|
| 5618 | + private MenuItem switchViewItem; |
---|
5006 | 5619 | private MenuItem cutItem; |
---|
5007 | | - private MenuItem duplicateItem; |
---|
| 5620 | + private MenuItem undoItem; |
---|
| 5621 | + private MenuItem redoItem; |
---|
| 5622 | + private JMenuItem duplicateItem; |
---|
5008 | 5623 | private MenuItem cloneItem; |
---|
5009 | 5624 | private MenuItem cloneSupportItem; |
---|
5010 | 5625 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5017 | 5632 | private MenuItem linkverticesItem; |
---|
5018 | 5633 | private MenuItem relinkverticesItem; |
---|
5019 | 5634 | private MenuItem setMasterItem; |
---|
5020 | | - private MenuItem resetMeshItem; |
---|
| 5635 | + private MenuItem resetAllItem; |
---|
5021 | 5636 | private MenuItem stepAllItem; |
---|
5022 | 5637 | private MenuItem revertMeshItem; |
---|
5023 | 5638 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5028 | 5643 | private MenuItem mergeGeometriesItem; |
---|
5029 | 5644 | private MenuItem copyItem; |
---|
5030 | 5645 | private MenuItem pasteItem; |
---|
| 5646 | + private MenuItem pasteIntoItem; |
---|
5031 | 5647 | private MenuItem pasteLinkItem; |
---|
5032 | 5648 | private MenuItem pasteCloneItem; |
---|
5033 | 5649 | private MenuItem pasteExpandItem; |
---|
.. | .. |
---|
5066 | 5682 | private MenuItem showleavesItem; |
---|
5067 | 5683 | private MenuItem markleavesItem; |
---|
5068 | 5684 | private MenuItem unmarkleavesItem; |
---|
| 5685 | + private MenuItem rewindleavesItem; |
---|
| 5686 | + private MenuItem unrewindleavesItem; |
---|
| 5687 | + private MenuItem randomleavesItem; |
---|
| 5688 | + private MenuItem unrandomleavesItem; |
---|
5069 | 5689 | |
---|
5070 | 5690 | private MenuItem flipVItem; |
---|
5071 | 5691 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5077 | 5697 | private MenuItem panoTexturesItem; |
---|
5078 | 5698 | |
---|
5079 | 5699 | private MenuItem resetCentroidItem; |
---|
5080 | | - private MenuItem transformgeometryItem; |
---|
| 5700 | + private MenuItem resetCentroidXZItem; |
---|
5081 | 5701 | private MenuItem resetTransformItem; |
---|
| 5702 | + private MenuItem transformGeometryItem; |
---|
| 5703 | + private MenuItem transformChildrenItem; |
---|
5082 | 5704 | private MenuItem hideItem; |
---|
5083 | 5705 | private MenuItem grabItem; |
---|
5084 | 5706 | private MenuItem backItem; |
---|
5085 | 5707 | private MenuItem frontItem; |
---|
5086 | 5708 | private MenuItem cameraItem; |
---|
5087 | 5709 | private MenuItem compositeItem; |
---|
5088 | | - private MenuItem randomItem; |
---|
| 5710 | + private MenuItem switchItem; |
---|
5089 | 5711 | private MenuItem physicsItem; |
---|
5090 | 5712 | private MenuItem frameselectorItem; |
---|
5091 | 5713 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5125 | 5747 | private MenuItem blobItem; |
---|
5126 | 5748 | private MenuItem latheItem; |
---|
5127 | 5749 | private MenuItem bezierItem; |
---|
5128 | | - private MenuItem checkerItem; |
---|
| 5750 | + private MenuItem overlayItem; |
---|
5129 | 5751 | private MenuItem meshItem; |
---|
5130 | 5752 | // private MenuItem meshGroupItem; |
---|
5131 | 5753 | private MenuItem springItem; |
---|
.. | .. |
---|
5147 | 5769 | private MenuItem doubleItem; |
---|
5148 | 5770 | private MenuItem tripleItem; |
---|
5149 | 5771 | |
---|
5150 | | - private MenuItem importGFDItem; |
---|
5151 | | - private MenuItem importVRMLX3DItem; |
---|
5152 | | - private MenuItem import3DSItem; |
---|
5153 | | - private MenuItem importOBJItem; |
---|
5154 | | - |
---|
5155 | 5772 | private MenuItem computeAOItem; |
---|
5156 | 5773 | private MenuItem recompileItem; |
---|
5157 | 5774 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5161 | 5778 | private MenuItem analyzeItem; |
---|
5162 | 5779 | private MenuItem dumpItem; |
---|
5163 | 5780 | //boolean freezemodel = false; |
---|
| 5781 | + |
---|
| 5782 | + Menu cameraMenu; |
---|
| 5783 | + MenuItem editCameraItem; |
---|
| 5784 | + MenuItem restoreCameraItem; |
---|
5164 | 5785 | } |
---|