.. | .. |
---|
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, |
---|
.. | .. |
---|
59 | 60 | this.copy = this.group = group; |
---|
60 | 61 | //selectees = this.group.selectees; |
---|
61 | 62 | |
---|
| 63 | + if (copy.versions == null) |
---|
| 64 | + { |
---|
| 65 | + copy.versions = new byte[100][]; |
---|
| 66 | + copy.versionindex = -1; |
---|
| 67 | + } |
---|
| 68 | + |
---|
62 | 69 | if(ui) |
---|
63 | 70 | SetupUI(objEditor); |
---|
64 | 71 | } |
---|
.. | .. |
---|
73 | 80 | this.copy = this.group = copy; |
---|
74 | 81 | //selectees = this.group.selectees; |
---|
75 | 82 | |
---|
76 | | - SetupMenu2(objEditor); |
---|
| 83 | + SetupMenu2(this); //objEditor); |
---|
77 | 84 | SetupUI2(objEditor); |
---|
78 | 85 | objEditor.SetupUI(true); |
---|
79 | 86 | SetupViews(objEditor); |
---|
80 | 87 | |
---|
81 | 88 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 89 | + |
---|
| 90 | + if (copy.versions == null) |
---|
| 91 | + { |
---|
| 92 | + copy.versions = new byte[100][]; |
---|
| 93 | + copy.versionindex = -1; |
---|
| 94 | + |
---|
| 95 | + Save(true); |
---|
| 96 | + } |
---|
82 | 97 | } |
---|
83 | 98 | |
---|
84 | 99 | void CloneSelection(boolean supports) |
---|
85 | 100 | { |
---|
| 101 | + if (Globals.REPLACEONMAKE) |
---|
| 102 | + Save(); |
---|
| 103 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 104 | + Globals.REPLACEONMAKE = false; |
---|
86 | 105 | // Object3D keep = GrafreeD.clipboard; |
---|
87 | 106 | //Object3D obj; |
---|
88 | 107 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
93 | 112 | |
---|
94 | 113 | makeSomething(clone, i==group.selection.size()-1); |
---|
95 | 114 | } |
---|
| 115 | + Globals.REPLACEONMAKE = keep; |
---|
96 | 116 | } |
---|
97 | 117 | |
---|
98 | 118 | void CloneClipboard(boolean supports) |
---|
99 | 119 | { |
---|
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)); |
---|
| 120 | + assert(Grafreed.clipboard.parent == null); |
---|
| 121 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 122 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 123 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 124 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
105 | 125 | else |
---|
106 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
107 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 126 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 127 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 128 | } |
---|
109 | 129 | |
---|
110 | 130 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 138 | // obj.support = null; |
---|
119 | 139 | if (!supports) |
---|
120 | 140 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 141 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 142 | obj.parent = parent; |
---|
123 | 143 | // obj.support = support; |
---|
124 | 144 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
147 | 167 | |
---|
148 | 168 | //JTextField nameField; |
---|
149 | 169 | |
---|
150 | | - void SetupMenu2(ObjEditor oe) |
---|
| 170 | + void SetupMenu2(GroupEditor oe) |
---|
151 | 171 | { |
---|
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); |
---|
| 172 | + oe.jTree = new cTree(); |
---|
| 173 | + |
---|
163 | 174 | Menu menu; |
---|
164 | 175 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | 176 | //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | 177 | //editItem.addActionListener(this); |
---|
167 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 178 | + |
---|
| 179 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 180 | +// undoItem.addActionListener(this); |
---|
| 181 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 182 | +// redoItem.addActionListener(this); |
---|
| 183 | +// menu.add("-"); |
---|
| 184 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
168 | 185 | duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | 186 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | 187 | cloneItem.addActionListener(this); |
---|
| 188 | + if (Globals.ADVANCED) |
---|
| 189 | + { |
---|
172 | 190 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | 191 | cloneSupportItem.addActionListener(this); |
---|
| 192 | + } |
---|
174 | 193 | menu.add("-"); |
---|
175 | 194 | cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | 195 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
178 | 197 | copyItem.addActionListener(this); |
---|
179 | 198 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | 199 | pasteItem.addActionListener(this); |
---|
| 200 | + |
---|
| 201 | + menu.add("-"); |
---|
| 202 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 203 | + pasteIntoItem.addActionListener(this); |
---|
181 | 204 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | 205 | pasteLinkItem.addActionListener(this); |
---|
183 | 206 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | 207 | pasteCloneItem.addActionListener(this); |
---|
185 | 208 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | 209 | // pasteExpandItem.addActionListener(this); |
---|
187 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | | - clearItem.addActionListener(this); |
---|
| 210 | + menu.add("-"); |
---|
| 211 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 212 | + deleteItem.addActionListener(this); |
---|
| 213 | + |
---|
| 214 | + if (Globals.ADVANCED) |
---|
| 215 | + { |
---|
| 216 | + // Deletes the cameras... |
---|
189 | 217 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | 218 | clearAllItem.addActionListener(this); |
---|
| 219 | + } |
---|
| 220 | + |
---|
| 221 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 222 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 223 | + //zBufferItem.addActionListener(this); |
---|
| 224 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 225 | + //normalLensItem.addActionListener(this); |
---|
| 226 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 227 | + restoreCameraItem.addActionListener(this); |
---|
| 228 | + |
---|
| 229 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 230 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 231 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 232 | +// cameraMenu.add("-"); |
---|
| 233 | +// |
---|
| 234 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 235 | +// toggleTextureItem.addItemListener(this); |
---|
| 236 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 237 | +// |
---|
| 238 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 239 | +// toggleSwitchItem.addItemListener(this); |
---|
| 240 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 241 | + |
---|
| 242 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 243 | + toggleHandleItem.addItemListener(this); |
---|
| 244 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 245 | + |
---|
| 246 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 247 | + togglePaintItem.addItemListener(this); |
---|
| 248 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 249 | + |
---|
| 250 | + if (Globals.ADVANCED) |
---|
| 251 | + { |
---|
| 252 | + cameraMenu.add("-"); |
---|
| 253 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 254 | + toggleLiveItem.addItemListener(this); |
---|
| 255 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
191 | 256 | |
---|
| 257 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 258 | + stepItem.addActionListener(this); |
---|
| 259 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 260 | + // toggleDLItem.addItemListener(this); |
---|
| 261 | + // toggleDLItem.setState(false); |
---|
| 262 | + |
---|
| 263 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 264 | + toggleRenderItem.addItemListener(this); |
---|
| 265 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 266 | + |
---|
| 267 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 268 | + toggleDebugItem.addItemListener(this); |
---|
| 269 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 270 | + |
---|
| 271 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 272 | + toggleFrustumItem.addItemListener(this); |
---|
| 273 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 274 | + |
---|
| 275 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 276 | + toggleFootContactItem.addItemListener(this); |
---|
| 277 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 278 | + |
---|
| 279 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 280 | + toggleTimelineItem.addItemListener(this); |
---|
| 281 | + } |
---|
| 282 | + |
---|
| 283 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 284 | +// toggleRootItem.addItemListener(this); |
---|
| 285 | +// toggleRootItem.setState(false); |
---|
| 286 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 287 | +// animationItem.addItemListener(this); |
---|
| 288 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 289 | + cameraMenu.add("-"); |
---|
| 290 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 291 | + editCameraItem.addActionListener(this); |
---|
| 292 | + |
---|
| 293 | + if (Globals.ADVANCED) |
---|
| 294 | + { |
---|
| 295 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 296 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 297 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 298 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 299 | + oe.cameraMenu.add("-"); |
---|
| 300 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 301 | + openWindowItem.addActionListener(this); |
---|
| 302 | + editLeafItem.addActionListener(this); |
---|
| 303 | + lookAtItem.addActionListener(this); |
---|
| 304 | + //lookFromItem.addActinoListener(this); |
---|
| 305 | + //switchViewItem.addActionListener(this); |
---|
| 306 | + } |
---|
| 307 | + |
---|
192 | 308 | 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); |
---|
| 309 | + if (Globals.ADVANCED) |
---|
| 310 | + { |
---|
197 | 311 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 312 | revertMeshItem.addActionListener(this); |
---|
199 | 313 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 314 | resetreferencesItem.addActionListener(this); |
---|
201 | 315 | menu.add("-"); |
---|
| 316 | + } |
---|
202 | 317 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 318 | overwriteGeoItem.addActionListener(this); |
---|
204 | 319 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 325 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 326 | overwriteUVItem.addActionListener(this); |
---|
212 | 327 | menu.add("-"); |
---|
| 328 | + if (Globals.ADVANCED) |
---|
| 329 | + { |
---|
213 | 330 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 331 | generateMeshItem.addActionListener(this); |
---|
215 | 332 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 333 | poseMeshItem.addActionListener(this); |
---|
217 | 334 | menu.add("-"); |
---|
| 335 | + } |
---|
218 | 336 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 337 | resetsupportItem.addActionListener(this); |
---|
220 | 338 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 339 | linkverticesItem.addActionListener(this); |
---|
222 | 340 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 341 | relinkverticesItem.addActionListener(this); |
---|
| 342 | + |
---|
| 343 | + if (Globals.ADVANCED) |
---|
| 344 | + { |
---|
224 | 345 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 346 | setMasterItem.addActionListener(this); |
---|
| 347 | + } |
---|
226 | 348 | |
---|
227 | 349 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
229 | | - grabItem.addActionListener(this); |
---|
| 350 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 351 | +// grabItem.addActionListener(this); |
---|
230 | 352 | backItem = menu.add(new MenuItem("Back")); |
---|
231 | 353 | backItem.addActionListener(this); |
---|
232 | 354 | frontItem = menu.add(new MenuItem("Front")); |
---|
233 | 355 | frontItem.addActionListener(this); |
---|
234 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | | - compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 356 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 357 | +// compositeItem.addActionListener(this); |
---|
| 358 | + |
---|
| 359 | + if (Globals.ADVANCED) |
---|
| 360 | + { |
---|
| 361 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 362 | hideItem.addActionListener(this); |
---|
| 363 | + } |
---|
238 | 364 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 365 | 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); |
---|
| 366 | + |
---|
| 367 | +// menu.add("-"); |
---|
| 368 | +// |
---|
| 369 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 370 | +// switchItem.addActionListener(this); |
---|
| 371 | + if (Globals.ADVANCED) |
---|
| 372 | + { |
---|
247 | 373 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 374 | switchGeoItem.addActionListener(this); |
---|
249 | 375 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 376 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 377 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 378 | morphItem.addActionListener(this); |
---|
| 379 | + |
---|
| 380 | + menu.add("-"); |
---|
| 381 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 382 | + physicsItem.addActionListener(this); |
---|
| 383 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 384 | + frameselectorItem.addActionListener(this); |
---|
253 | 385 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 386 | scriptNodeItem.addActionListener(this); |
---|
255 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | | - cameraItem.addActionListener(this); |
---|
| 387 | + } |
---|
257 | 388 | |
---|
258 | 389 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
260 | | - textureItem.addActionListener(this); |
---|
| 390 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 391 | +// textureItem.addActionListener(this); |
---|
261 | 392 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
262 | 393 | billboardItem.addActionListener(this); |
---|
263 | 394 | csgItem = menu.add(new MenuItem("CSG")); |
---|
264 | 395 | csgItem.addActionListener(this); |
---|
265 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 396 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
266 | 397 | shadowXItem.addActionListener(this); |
---|
267 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 398 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
268 | 399 | shadowYItem.addActionListener(this); |
---|
269 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 400 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
270 | 401 | shadowZItem.addActionListener(this); |
---|
| 402 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 403 | + attributeItem.addActionListener(this); |
---|
| 404 | + |
---|
| 405 | + if (Globals.ADVANCED) |
---|
| 406 | + { |
---|
| 407 | + menu.add("-"); |
---|
271 | 408 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 409 | linkerItem.addActionListener(this); |
---|
273 | 410 | templateItem = menu.add(new MenuItem("Template")); |
---|
274 | 411 | templateItem.addActionListener(this); |
---|
275 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | | - attributeItem.addActionListener(this); |
---|
277 | 412 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 413 | pointflowItem.addActionListener(this); |
---|
| 414 | + } |
---|
279 | 415 | menu.add("-"); |
---|
280 | 416 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 417 | resetTransformItem.addActionListener(this); |
---|
282 | 418 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
283 | 419 | resetCentroidItem.addActionListener(this); |
---|
284 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
285 | | - transformgeometryItem.addActionListener(this); |
---|
| 420 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 421 | + resetCentroidXZItem.addActionListener(this); |
---|
| 422 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 423 | + transformGeometryItem.addActionListener(this); |
---|
| 424 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 425 | + transformChildrenItem.addActionListener(this); |
---|
286 | 426 | |
---|
287 | 427 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
288 | 428 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
293 | 433 | genNormalsCADItem.addActionListener(this); |
---|
294 | 434 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 435 | genNormalsMESHItem.addActionListener(this); |
---|
296 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 436 | + if (Globals.ADVANCED) |
---|
| 437 | + { |
---|
| 438 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
297 | 439 | genNormalsMINEItem.addActionListener(this); |
---|
| 440 | + } |
---|
298 | 441 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 442 | stripifyItem.addActionListener(this); |
---|
300 | 443 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 459 | reduce34MeshItem.addActionListener(this); |
---|
317 | 460 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 461 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 462 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 463 | clipMeshItem.addActionListener(this); |
---|
| 464 | + |
---|
| 465 | + if (Globals.ADVANCED) |
---|
| 466 | + { |
---|
| 467 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 468 | + smoothMeshItem.addActionListener(this); |
---|
| 469 | + } |
---|
323 | 470 | |
---|
324 | 471 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 472 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
326 | 473 | clearMaterialsItem.addActionListener(this); |
---|
| 474 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 475 | + resetAllItem.addActionListener(this); |
---|
| 476 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 477 | + stepAllItem.addActionListener(this); |
---|
327 | 478 | menu.add("-"); |
---|
328 | 479 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
329 | 480 | liveleavesItem.addActionListener(this); |
---|
330 | 481 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 482 | unliveleavesItem.addActionListener(this); |
---|
| 483 | + if (Globals.ADVANCED) |
---|
| 484 | + { |
---|
332 | 485 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 486 | supportleavesItem.addActionListener(this); |
---|
334 | 487 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 488 | unsupportleavesItem.addActionListener(this); |
---|
| 489 | + } |
---|
336 | 490 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 491 | hideleavesItem.addActionListener(this); |
---|
338 | 492 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
341 | 495 | markleavesItem.addActionListener(this); |
---|
342 | 496 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
343 | 497 | unmarkleavesItem.addActionListener(this); |
---|
| 498 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 499 | + rewindleavesItem.addActionListener(this); |
---|
| 500 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 501 | + unrewindleavesItem.addActionListener(this); |
---|
| 502 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 503 | + randomleavesItem.addActionListener(this); |
---|
| 504 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 505 | + unrandomleavesItem.addActionListener(this); |
---|
344 | 506 | menu.add("-"); |
---|
345 | 507 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
346 | 508 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
366 | 528 | attachBumpItem.addActionListener(this); |
---|
367 | 529 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
368 | 530 | pigmentBumpItem.addActionListener(this); |
---|
| 531 | + //embedTexturesItem |
---|
369 | 532 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
370 | 533 | detachPigmentItem.addActionListener(this); |
---|
371 | 534 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
372 | 535 | detachBumpItem.addActionListener(this); |
---|
| 536 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 537 | + embedTexturesItem.addActionListener(this); |
---|
| 538 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 539 | + deEmbedTexturesItem.addActionListener(this); |
---|
373 | 540 | menu.add("-"); |
---|
374 | 541 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
375 | 542 | sortbysizeItem.addActionListener(this); |
---|
376 | 543 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 544 | sortbynameItem.addActionListener(this); |
---|
378 | 545 | menu.add("-"); |
---|
| 546 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 547 | + shareGeometriesItem.addActionListener(this); |
---|
| 548 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 549 | + mergeGeometriesItem.addActionListener(this); |
---|
| 550 | + if (Globals.ADVANCED) |
---|
| 551 | + { |
---|
| 552 | + // Pretty much the same as duplicate and clone. |
---|
379 | 553 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 554 | extractGeometriesItem.addActionListener(this); |
---|
381 | 555 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
382 | 556 | 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); |
---|
| 557 | + } |
---|
387 | 558 | |
---|
388 | 559 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 560 | buildCreateMenu(menu); |
---|
390 | 561 | |
---|
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 | 562 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 563 | buildToolsMenu(menu); |
---|
404 | 564 | } |
---|
405 | 565 | |
---|
| 566 | + |
---|
406 | 567 | void SetupUI2(ObjEditor oe) |
---|
407 | 568 | { |
---|
| 569 | + // June 2019 |
---|
| 570 | + if (oe == null) |
---|
| 571 | + { |
---|
| 572 | + //super.SetupUI2(this); |
---|
| 573 | + //return; |
---|
| 574 | + } |
---|
| 575 | + |
---|
| 576 | + if (copy != group) |
---|
| 577 | + { |
---|
| 578 | + //super.SetupUI2(this); |
---|
| 579 | + } |
---|
| 580 | + |
---|
408 | 581 | //new Exception().printStackTrace(); |
---|
409 | 582 | |
---|
410 | 583 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
433 | 606 | oe.radioPanel.add(dummyButton); |
---|
434 | 607 | oe.buttonGroup.add(dummyButton); |
---|
435 | 608 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
437 | | - oe.aConstraints.gridwidth = 1; |
---|
438 | | - oe.aConstraints.gridx = 0; |
---|
| 609 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 610 | + |
---|
| 611 | + copyOptionsPanel.preferredHeight = 1; |
---|
439 | 612 | |
---|
440 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
441 | | - liveCB.setToolTipText("Enabled animation"); |
---|
442 | | - liveCB.addItemListener(this); |
---|
443 | | - |
---|
444 | | - oe.aConstraints.gridx += 1; |
---|
445 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
446 | | - fastCB.setToolTipText("Fast mode"); |
---|
447 | | - fastCB.addItemListener(this); |
---|
448 | | - oe.aConstraints.gridx += 1; |
---|
449 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
450 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
451 | | - supportCB.addItemListener(this); |
---|
452 | | - |
---|
453 | | - // oe.aConstraints.gridx += 1; |
---|
454 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
455 | | - // localCB.addItemListener(this); |
---|
456 | | - |
---|
457 | | - oe.aConstraints.gridx += 1; |
---|
458 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints); |
---|
459 | | - crowdCB.setToolTipText("Used for crowds"); |
---|
460 | | - crowdCB.addItemListener(this); |
---|
461 | | - |
---|
462 | | - oe.aConstraints.gridx += 1; |
---|
463 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
464 | | - smoothCB.setToolTipText("Snapping delay"); |
---|
465 | | - smoothCB.addItemListener(this); |
---|
466 | | - |
---|
467 | | - oe.aConstraints.gridx += 1; |
---|
468 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
469 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
470 | | - slowCB.addItemListener(this); |
---|
471 | | - oe.aConstraints.gridx += 1; |
---|
472 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints); |
---|
473 | | - boxCB.setToolTipText("Display bounding boxes"); |
---|
474 | | - boxCB.addItemListener(this); |
---|
475 | | - oe.aConstraints.gridx += 1; |
---|
476 | | - oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints); |
---|
477 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
478 | | - zoomBoxCB.addItemListener(this); |
---|
479 | | - |
---|
480 | | -// oe.aConstraints.gridx += 1; |
---|
481 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
482 | | -// speakerMocapCB.addItemListener(this); |
---|
483 | | - |
---|
484 | | - if (false) |
---|
485 | | - { |
---|
486 | | - // handled in scripts |
---|
487 | | - oe.aConstraints.gridx += 1; |
---|
488 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
489 | | - speakerCameraCB.addItemListener(this); |
---|
490 | | - |
---|
491 | | - oe.aConstraints.gridx += 1; |
---|
492 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
493 | | - speakerFocusCB.addItemListener(this); |
---|
494 | | - |
---|
495 | | - oe.aConstraints.gridx += 1; |
---|
496 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
497 | | - smoothfocusCB.addItemListener(this); |
---|
498 | | - } |
---|
499 | | - |
---|
500 | | -//oe.aConstraints.gridx += 1; |
---|
501 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
502 | | -// debugCB.addItemListener(this); |
---|
503 | | - |
---|
504 | | - oe.aConstraints.gridx += 1; |
---|
505 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints); |
---|
506 | | - oeilCB.addItemListener(this); |
---|
507 | | - |
---|
508 | | - oe.aConstraints.gridx += 1; |
---|
509 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints); |
---|
510 | | - lookAtCB.setToolTipText("Look-at target"); |
---|
511 | | - lookAtCB.addItemListener(this); |
---|
512 | | - |
---|
513 | | - oe.aConstraints.gridx += 1; |
---|
514 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
515 | | - trackCB.setToolTipText("Enable tracking"); |
---|
516 | | - trackCB.addItemListener(this); |
---|
517 | | - |
---|
518 | | - oe.aConstraints.gridx += 1; |
---|
519 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 613 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
| 614 | + |
---|
| 615 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 616 | + //minButton.setToolTipText("Minimize window"); |
---|
| 617 | + //minButton.addActionListener(this); |
---|
| 618 | + |
---|
| 619 | + if (Globals.ADVANCED) |
---|
| 620 | + { |
---|
| 621 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 622 | + maxButton.setToolTipText("Maximize window"); |
---|
| 623 | + maxButton.addActionListener(this); |
---|
| 624 | + } |
---|
| 625 | + |
---|
| 626 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 627 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 628 | + fullButton.addActionListener(this); |
---|
| 629 | + |
---|
| 630 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
520 | 631 | screenfitButton.setToolTipText("Screen fit"); |
---|
521 | 632 | screenfitButton.addActionListener(this); |
---|
522 | | - oe.aConstraints.gridx += 1; |
---|
| 633 | + |
---|
| 634 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 635 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 636 | + restoreCameraButton.addActionListener(this); |
---|
| 637 | + |
---|
| 638 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 639 | + saveButton.setToolTipText("New version"); |
---|
| 640 | + saveButton.addActionListener(this); |
---|
| 641 | + |
---|
| 642 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 643 | + undoButton.setToolTipText("Previous version"); |
---|
| 644 | + undoButton.addActionListener(this); |
---|
| 645 | + undoButton.setEnabled(false); |
---|
| 646 | + |
---|
| 647 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 648 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 649 | + restoreButton.setToolTipText("Restore current"); |
---|
| 650 | + restoreButton.addActionListener(this); |
---|
| 651 | + restoreButton.setEnabled(false); |
---|
| 652 | + |
---|
| 653 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 654 | + replaceButton.setToolTipText("Replace current"); |
---|
| 655 | + replaceButton.addActionListener(this); |
---|
| 656 | + replaceButton.setEnabled(false); |
---|
| 657 | + |
---|
| 658 | + copyOptionsPanel.add(updown); |
---|
| 659 | + |
---|
| 660 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 661 | + redoButton.setToolTipText("Next version"); |
---|
| 662 | + redoButton.addActionListener(this); |
---|
| 663 | + redoButton.setEnabled(false); |
---|
| 664 | + |
---|
| 665 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 666 | + liveCB.setToolTipText("Enable animation"); |
---|
| 667 | + liveCB.addItemListener(this); |
---|
| 668 | + |
---|
| 669 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 670 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 671 | + oneStepButton.addActionListener(this); |
---|
| 672 | + |
---|
| 673 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 674 | + fastCB.setToolTipText("Fast mode"); |
---|
| 675 | + fastCB.addItemListener(this); |
---|
| 676 | + |
---|
| 677 | + //oe.toolboxPanel.Return(); |
---|
| 678 | + |
---|
| 679 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 680 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 681 | +// trackCB.addItemListener(this); |
---|
| 682 | + |
---|
523 | 683 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
524 | 684 | // screenfitpointButton.addActionListener(this); |
---|
525 | | -// oe.aConstraints.gridx += 1; |
---|
526 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
527 | | - snapobjectButton.addActionListener(this); |
---|
528 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
529 | | - oe.aConstraints.gridx += 1; |
---|
530 | 685 | |
---|
531 | | - //aConstraints.gridx = 0; |
---|
532 | | - //aConstraints.gridy += 1; |
---|
533 | | - oe.aConstraints.weighty = 0; |
---|
534 | | - oe.aConstraints.gridwidth = 1; |
---|
535 | | - |
---|
536 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
537 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
538 | | - flashSelectionButton.addActionListener(this); |
---|
539 | | - |
---|
540 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
541 | | - |
---|
542 | | - oe.aConstraints.gridx += 1; |
---|
543 | | - oe.aConstraints.weighty = 0; |
---|
544 | | - oe.aConstraints.gridwidth = 1; |
---|
545 | | - |
---|
546 | | - // |
---|
547 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
548 | | - twoButton.setToolTipText("Show center view only"); |
---|
549 | | - twoButton.addActionListener(this); |
---|
550 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 686 | + if (Globals.ADVANCED) |
---|
| 687 | + { |
---|
| 688 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 689 | + snapobjectButton.addActionListener(this); |
---|
| 690 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 691 | + |
---|
| 692 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
551 | 693 | fourButton.addActionListener(this); |
---|
552 | | - fourButton.setToolTipText("Show left panel only"); |
---|
553 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
554 | | - sixButton.setToolTipText("2-column layout left"); |
---|
555 | | - sixButton.addActionListener(this); |
---|
556 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
557 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 694 | + fourButton.setToolTipText("Show control panel only"); |
---|
| 695 | + } |
---|
| 696 | + |
---|
| 697 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 698 | + |
---|
| 699 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 700 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 701 | + twoButton.addActionListener(this); |
---|
| 702 | + this.fullscreenLayout = twoButton; |
---|
| 703 | + |
---|
| 704 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 705 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
558 | 706 | threeButton.addActionListener(this); |
---|
559 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
560 | | - sevenButton.setToolTipText("3-column layout"); |
---|
561 | | - sevenButton.addActionListener(this); |
---|
| 707 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 708 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 709 | + sixButton.addActionListener(this); |
---|
| 710 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 711 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 712 | +// sevenButton.addActionListener(this); |
---|
562 | 713 | // |
---|
563 | 714 | |
---|
564 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints); |
---|
565 | | - rootButton.setToolTipText("Edit object in new tab"); |
---|
| 715 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 716 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
566 | 717 | rootButton.addActionListener(this); |
---|
567 | | - oe.aConstraints.gridx += 1; |
---|
568 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 718 | + |
---|
| 719 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
569 | 720 | closeButton.setToolTipText("Close tab"); |
---|
570 | 721 | closeButton.addActionListener(this); |
---|
571 | 722 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
572 | 723 | //clearButton.addActionListener(this); |
---|
573 | | - oe.aConstraints.gridx += 1; |
---|
574 | | - |
---|
575 | | - oe.aConstraints.gridx = 1; // |
---|
576 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
577 | | - editButton.addActionListener(this); |
---|
578 | | - oe.aConstraints.gridx += 1; |
---|
579 | | - oe.aConstraints.weighty = 0; |
---|
580 | | - oe.aConstraints.gridwidth = 1; |
---|
581 | 724 | |
---|
582 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 725 | + // INSERT |
---|
| 726 | + oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 727 | + gridButton.setToolTipText("Create grid"); |
---|
| 728 | + gridButton.addActionListener(this); |
---|
| 729 | + |
---|
| 730 | + oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 731 | + boxButton.setToolTipText("Create box"); |
---|
| 732 | + boxButton.addActionListener(this); |
---|
| 733 | + |
---|
| 734 | + oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 735 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 736 | + sphereButton.addActionListener(this); |
---|
| 737 | + |
---|
| 738 | + oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 739 | + coneButton.setToolTipText("Create cone"); |
---|
| 740 | + coneButton.addActionListener(this); |
---|
| 741 | + |
---|
| 742 | + oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 743 | + torusButton.setToolTipText("Create torus"); |
---|
| 744 | + torusButton.addActionListener(this); |
---|
| 745 | + |
---|
| 746 | + oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 747 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 748 | + superButton.addActionListener(this); |
---|
| 749 | + |
---|
| 750 | + if (Globals.ADVANCED) |
---|
| 751 | + { |
---|
| 752 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 753 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 754 | + kleinButton.addActionListener(this); |
---|
| 755 | + } |
---|
| 756 | + |
---|
| 757 | + oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 758 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 759 | + particlesButton.addActionListener(this); |
---|
| 760 | + |
---|
| 761 | + oe.toolboxPanel.Return(); |
---|
| 762 | + |
---|
| 763 | + oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 764 | + groupButton.setToolTipText("Create group"); |
---|
| 765 | + groupButton.addActionListener(this); |
---|
| 766 | + |
---|
| 767 | + oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 768 | + compositeButton.setToolTipText("Create composite"); |
---|
| 769 | + compositeButton.addActionListener(this); |
---|
| 770 | + |
---|
| 771 | + oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 772 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 773 | + switchButton.addActionListener(this); |
---|
| 774 | + |
---|
| 775 | + oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 776 | + loopButton.setToolTipText("Create loop"); |
---|
| 777 | + loopButton.addActionListener(this); |
---|
| 778 | + |
---|
| 779 | + oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 780 | + textureButton.setToolTipText("Create texture"); |
---|
| 781 | + textureButton.addActionListener(this); |
---|
| 782 | + |
---|
| 783 | + oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 784 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 785 | + overlayButton.addActionListener(this); |
---|
| 786 | + |
---|
| 787 | + oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 788 | + lightButton.setToolTipText("Create light"); |
---|
| 789 | + lightButton.addActionListener(this); |
---|
| 790 | + |
---|
| 791 | + for (int i=6; --i>=0;) |
---|
| 792 | + { |
---|
| 793 | + oe.toolboxPanel.Return(); |
---|
| 794 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 795 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 796 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 797 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 798 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 799 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 800 | + oe.toolboxPanel.add(new cGridBag()); |
---|
| 801 | + } |
---|
| 802 | + |
---|
| 803 | + // EDIT panel |
---|
| 804 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 805 | + editButton.setToolTipText("Pin selection controls"); |
---|
| 806 | + editButton.addActionListener(this); |
---|
| 807 | + |
---|
| 808 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 809 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
583 | 810 | uneditButton.addActionListener(this); |
---|
584 | 811 | |
---|
585 | | - oe.aConstraints.gridx += 1; |
---|
586 | | - oe.aConstraints.weighty = 0; |
---|
587 | | - oe.aConstraints.gridwidth = 1; |
---|
588 | | - |
---|
589 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
590 | | - clearPanelButton.addActionListener(this); |
---|
591 | | - |
---|
592 | | - oe.aConstraints.gridx += 1; |
---|
593 | | - oe.aConstraints.weighty = 0; |
---|
594 | | - oe.aConstraints.gridwidth = 1; |
---|
595 | | - |
---|
596 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 812 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 813 | + allParamsButton.setToolTipText("Show all controle"); |
---|
597 | 814 | allParamsButton.addActionListener(this); |
---|
598 | 815 | |
---|
599 | | - oe.aConstraints.gridx += 1; |
---|
600 | | - oe.aConstraints.weighty = 0; |
---|
601 | | - oe.aConstraints.gridwidth = 1; |
---|
602 | | - |
---|
603 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 816 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 817 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 818 | + clearPanelButton.addActionListener(this); |
---|
| 819 | + |
---|
| 820 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 821 | + unselectButton.setToolTipText("Unselect"); |
---|
604 | 822 | unselectButton.addActionListener(this); |
---|
605 | 823 | |
---|
| 824 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 825 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 826 | + flashSelectionButton.addActionListener(this); |
---|
| 827 | + |
---|
| 828 | + editCommandsPanel.preferredHeight = 1; |
---|
| 829 | + |
---|
| 830 | + SetPinStates(false); |
---|
| 831 | +// oe.treePanel.add(commandsPanel); |
---|
| 832 | +// oe.treePanel.Return(); |
---|
| 833 | + |
---|
606 | 834 | // oe.aConstraints.gridx += 1; |
---|
607 | 835 | // oe.aConstraints.weighty = 0; |
---|
608 | 836 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
614 | 842 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
615 | 843 | // gcButton.addActionListener(this); |
---|
616 | 844 | |
---|
617 | | - oe.aConstraints.gridx = 0; |
---|
618 | | - oe.aConstraints.gridy += 1; |
---|
619 | | - |
---|
620 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
621 | | - oe.aConstraints.gridwidth = 100; |
---|
622 | | - // oe.aConstraints.gridheight = 100; |
---|
623 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
624 | | - oe.aConstraints.gridheight = 1; |
---|
625 | | - oe.aConstraints.weighty = 0.5; |
---|
626 | | - oe.aConstraints.gridx = 0; |
---|
627 | | - JScrollPane jSP; |
---|
| 845 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 846 | + |
---|
| 847 | + JScrollPane jSP; |
---|
628 | 848 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
629 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 849 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
630 | 850 | ResetModel(); |
---|
631 | | - oe.aConstraints.weighty = 0.5; |
---|
632 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
633 | | - oe.aConstraints.gridy += 1; |
---|
634 | | - oe.aConstraints.gridwidth = 1; |
---|
635 | | - |
---|
636 | | - oe.aConstraints.weighty = 0; |
---|
637 | | - oe.aConstraints.gridwidth = 2; |
---|
638 | | - |
---|
639 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
640 | | - colorCB.addItemListener(this); |
---|
641 | | - oe.aConstraints.gridx += 2; |
---|
642 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
643 | | - materialCB.addItemListener(this); |
---|
644 | | - oe.aConstraints.gridx += 2; |
---|
645 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
646 | | - textureCB.addItemListener(this); |
---|
647 | | - |
---|
648 | | - oe.aConstraints.gridx = 0; |
---|
649 | | - oe.aConstraints.gridy += 1; |
---|
650 | 851 | |
---|
| 852 | + oe.treePanel.add(jSPPanel); |
---|
| 853 | + oe.treePanel.Return(); |
---|
| 854 | + |
---|
| 855 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 856 | + oe.treePanel.Return(); |
---|
| 857 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 858 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 859 | + sliderPane.preferredHeight = 1; |
---|
| 860 | + |
---|
| 861 | +// mainPanel.setDividerLocation(0.5); //1.0); |
---|
| 862 | +// mainPanel.setResizeWeight(0.5); |
---|
| 863 | + |
---|
651 | 864 | //jList.addListSelectionListener(this); |
---|
652 | 865 | oe.jTree.addTreeSelectionListener(this); |
---|
653 | 866 | //jTree.setRootVisible(false); |
---|
.. | .. |
---|
666 | 879 | dgr.addDragGestureListener(this); |
---|
667 | 880 | }catch(Exception e) {} |
---|
668 | 881 | */ |
---|
669 | | - radio.layout = sevenButton; |
---|
| 882 | + radio.layout = sixButton; // sevenButton; |
---|
670 | 883 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
671 | 884 | } |
---|
| 885 | + |
---|
| 886 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 887 | + { |
---|
| 888 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 889 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 890 | + colorCB.addItemListener(this); |
---|
| 891 | + |
---|
| 892 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 893 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 894 | + materialCB.addItemListener(this); |
---|
| 895 | + |
---|
| 896 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 897 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 898 | + textureCB.addItemListener(this); |
---|
| 899 | + |
---|
| 900 | + panel.Return(); |
---|
| 901 | + |
---|
| 902 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 903 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 904 | + boxCB.addItemListener(this); |
---|
| 905 | + |
---|
| 906 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 907 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
| 908 | + zoomBoxCB.addItemListener(this); |
---|
| 909 | + |
---|
| 910 | + if (true) // Globals.ADVANCED) |
---|
| 911 | + { |
---|
| 912 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 913 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 914 | +// supportCB.addItemListener(this); |
---|
| 915 | + |
---|
| 916 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 917 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 918 | + freezeCB.addItemListener(this); |
---|
| 919 | + |
---|
| 920 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 921 | + // localCB.addItemListener(this); |
---|
| 922 | + |
---|
| 923 | + panel.Return(); |
---|
| 924 | + |
---|
| 925 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 926 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 927 | + crowdCB.addItemListener(this); |
---|
| 928 | + |
---|
| 929 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 930 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 931 | + smoothCB.addItemListener(this); |
---|
| 932 | + |
---|
| 933 | + panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 934 | + slowCB.setToolTipText("Smooth interpolation"); |
---|
| 935 | + slowCB.addItemListener(this); |
---|
| 936 | + |
---|
| 937 | +// constraints.gridy += 1; |
---|
| 938 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 939 | +// speakerMocapCB.addItemListener(this); |
---|
| 940 | + |
---|
| 941 | + panel.Return(); |
---|
| 942 | + |
---|
| 943 | + if (false) |
---|
| 944 | + { |
---|
| 945 | + // handled in scripts |
---|
| 946 | + //constraints.gridy += 1; |
---|
| 947 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 948 | + speakerCameraCB.addItemListener(this); |
---|
| 949 | + |
---|
| 950 | + //constraints.gridy += 1; |
---|
| 951 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 952 | + speakerFocusCB.addItemListener(this); |
---|
| 953 | + |
---|
| 954 | + //constraints.gridy += 1; |
---|
| 955 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 956 | + smoothfocusCB.addItemListener(this); |
---|
| 957 | + panel.Return(); |
---|
| 958 | + } |
---|
| 959 | + |
---|
| 960 | +//constraints.gridx += 1; |
---|
| 961 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 962 | +// debugCB.addItemListener(this); |
---|
| 963 | + |
---|
| 964 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 965 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 966 | + trackCB.addItemListener(this); |
---|
| 967 | + |
---|
| 968 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 969 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
| 970 | + oeilCB.addItemListener(this); |
---|
| 971 | + |
---|
| 972 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 973 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 974 | + shadowCB.addItemListener(this); |
---|
| 975 | + |
---|
| 976 | + panel.Return(); |
---|
| 977 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 978 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 979 | + toggleTextureCB.addItemListener(this); |
---|
| 980 | + |
---|
| 981 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 982 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 983 | + toggleSwitchCB.addItemListener(this); |
---|
| 984 | + |
---|
| 985 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 986 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 987 | + autokeepCB.addItemListener(this); |
---|
| 988 | + |
---|
| 989 | + panel.Return(); |
---|
| 990 | + if (Globals.ADVANCED) |
---|
| 991 | + { |
---|
| 992 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 993 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 994 | + lookAtCB.addItemListener(this); |
---|
| 995 | + } |
---|
| 996 | + |
---|
| 997 | + } |
---|
| 998 | + |
---|
| 999 | + cGridBag fill = new cGridBag(); |
---|
| 1000 | + fill.preferredHeight = 200; |
---|
| 1001 | + cGridBag fill2 = new cGridBag(); |
---|
| 1002 | + fill2.preferredHeight = 200; |
---|
| 1003 | + cGridBag fill3 = new cGridBag(); |
---|
| 1004 | + fill3.preferredHeight = 200; |
---|
| 1005 | + |
---|
| 1006 | + panel.add(fill); |
---|
| 1007 | + panel.add(fill2); |
---|
| 1008 | + panel.add(fill3); |
---|
| 1009 | + |
---|
| 1010 | + } |
---|
672 | 1011 | |
---|
673 | 1012 | void EditObject(Object3D obj) |
---|
674 | 1013 | { |
---|
675 | 1014 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1015 | + |
---|
| 1016 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1017 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1018 | + if (!radioButton.hadMaterial) |
---|
| 1019 | + { |
---|
| 1020 | + obj.material = new cMaterial(); |
---|
| 1021 | + } |
---|
| 1022 | + |
---|
676 | 1023 | radioButton.SetObject(obj); |
---|
677 | | - radioButton.layout = sevenButton; |
---|
| 1024 | + radioButton.layout = sixButton; // sevenButton; |
---|
678 | 1025 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
679 | 1026 | radioButton.addActionListener(this); |
---|
680 | 1027 | radioPanel.add(radioButton); |
---|
681 | 1028 | buttonGroup.add(radioButton); |
---|
682 | 1029 | radioButton.doClick(); |
---|
683 | 1030 | } |
---|
| 1031 | + |
---|
684 | 1032 | void SetupViews(ObjEditor oe) |
---|
685 | 1033 | { |
---|
| 1034 | + theFrame = this; |
---|
| 1035 | + |
---|
686 | 1036 | oe.SetupViews(); |
---|
687 | 1037 | |
---|
688 | 1038 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
691 | 1041 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
692 | 1042 | } |
---|
693 | 1043 | |
---|
694 | | - JCheckBox liveCB; |
---|
695 | | - JCheckBox supportCB; |
---|
696 | | - JCheckBox localCB; |
---|
697 | | - JCheckBox crowdCB; |
---|
698 | | - JCheckBox smoothCB; |
---|
699 | | - JCheckBox fastCB; |
---|
700 | | - JCheckBox slowCB; |
---|
701 | | - JCheckBox boxCB; |
---|
702 | | - JCheckBox zoomBoxCB; |
---|
703 | | - JCheckBox trackCB; |
---|
704 | | - JCheckBox smoothfocusCB; |
---|
| 1044 | + cToggleButton liveCB; |
---|
| 1045 | + cCheckBox supportCB; |
---|
| 1046 | + cCheckBox localCB; |
---|
| 1047 | + cCheckBox crowdCB; |
---|
| 1048 | + cCheckBox smoothCB; |
---|
| 1049 | + cToggleButton fastCB; |
---|
| 1050 | + cCheckBox slowCB; |
---|
| 1051 | + cCheckBox boxCB; |
---|
| 1052 | + cCheckBox zoomBoxCB; |
---|
| 1053 | + cCheckBox freezeCB; |
---|
| 1054 | + //cToggleButton trackCB; |
---|
| 1055 | + cCheckBox trackCB; |
---|
| 1056 | + cCheckBox smoothfocusCB; |
---|
705 | 1057 | // JCheckBox speakerMocapCB; |
---|
706 | | - JCheckBox speakerCameraCB; |
---|
707 | | - JCheckBox speakerFocusCB; |
---|
708 | | - JCheckBox debugCB; |
---|
709 | | - JCheckBox oeilCB; |
---|
710 | | - JCheckBox lookAtCB; |
---|
| 1058 | + cCheckBox speakerCameraCB; |
---|
| 1059 | + cCheckBox speakerFocusCB; |
---|
| 1060 | + cCheckBox debugCB; |
---|
| 1061 | + |
---|
| 1062 | + cCheckBox oeilCB; |
---|
| 1063 | + cCheckBox shadowCB; |
---|
| 1064 | + cCheckBox autokeepCB; |
---|
| 1065 | + cCheckBox lookAtCB; |
---|
711 | 1066 | |
---|
712 | 1067 | // static int COLOR = 1; |
---|
713 | 1068 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
715 | 1070 | |
---|
716 | 1071 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
717 | 1072 | |
---|
718 | | - JCheckBox colorCB; |
---|
719 | | - JCheckBox materialCB; |
---|
720 | | - JCheckBox textureCB; |
---|
| 1073 | + cCheckBox colorCB; |
---|
| 1074 | + cCheckBox materialCB; |
---|
| 1075 | + cCheckBox textureCB; |
---|
721 | 1076 | |
---|
722 | 1077 | public void itemStateChanged(ItemEvent e) |
---|
723 | 1078 | { |
---|
.. | .. |
---|
745 | 1100 | } else if(e.getSource() == liveCB) |
---|
746 | 1101 | { |
---|
747 | 1102 | cameraView.ToggleLive(); |
---|
| 1103 | + refreshContents(false); |
---|
748 | 1104 | } |
---|
749 | 1105 | else if(e.getSource() == supportCB) |
---|
750 | 1106 | { |
---|
.. | .. |
---|
809 | 1165 | { |
---|
810 | 1166 | cameraView.ToggleOeil(); |
---|
811 | 1167 | } |
---|
| 1168 | + else if(e.getSource() == shadowCB) |
---|
| 1169 | + { |
---|
| 1170 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1171 | + } |
---|
| 1172 | + else if(e.getSource() == freezeCB) |
---|
| 1173 | + { |
---|
| 1174 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1175 | + } |
---|
| 1176 | + else if(e.getSource() == autokeepCB) |
---|
| 1177 | + { |
---|
| 1178 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1179 | + } |
---|
812 | 1180 | else if(e.getSource() == lookAtCB) |
---|
813 | 1181 | { |
---|
814 | 1182 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
825 | 1193 | |
---|
826 | 1194 | /**/ |
---|
827 | 1195 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
828 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1196 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1197 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
829 | 1198 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
830 | 1199 | // We can't move the root node or an empty selection |
---|
831 | 1200 | return; |
---|
.. | .. |
---|
888 | 1257 | } |
---|
889 | 1258 | } |
---|
890 | 1259 | |
---|
891 | | - String string = (String) object; |
---|
892 | | - |
---|
893 | 1260 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
894 | 1261 | // if( object instanceof java.io.File[]) |
---|
895 | 1262 | // { |
---|
.. | .. |
---|
897 | 1264 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
898 | 1265 | // return; |
---|
899 | 1266 | // } |
---|
900 | | - if (string.charAt(0) == '/') |
---|
| 1267 | + |
---|
| 1268 | + String string = object.toString(); |
---|
| 1269 | + |
---|
| 1270 | + // File path for Mac and Windows |
---|
| 1271 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
901 | 1272 | { |
---|
902 | 1273 | // file(s) |
---|
903 | 1274 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
924 | 1295 | |
---|
925 | 1296 | flashIt = false; |
---|
926 | 1297 | CameraPane pane = (CameraPane) target; |
---|
927 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1298 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
928 | 1299 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
929 | 1300 | |
---|
930 | 1301 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
940 | 1311 | |
---|
941 | 1312 | assert target == objEditor.jTree; |
---|
942 | 1313 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1314 | + Object3D destinationLeaf; |
---|
943 | 1315 | try { |
---|
944 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1316 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
945 | 1317 | } catch (Exception e) { |
---|
946 | 1318 | System.out.println("destinationPath : " + destinationPath); |
---|
947 | 1319 | return; |
---|
948 | 1320 | } |
---|
949 | 1321 | |
---|
950 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1322 | + for (int i=group.selection.size(); --i>=0;) |
---|
951 | 1323 | { |
---|
| 1324 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1325 | + |
---|
| 1326 | + // Cannot move into itself |
---|
| 1327 | + if (child == destinationLeaf) |
---|
| 1328 | + return; |
---|
| 1329 | + } |
---|
| 1330 | + |
---|
| 1331 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1332 | +// { |
---|
952 | 1333 | loadClipboard(true); |
---|
953 | 1334 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
954 | | - pasteInto(false); |
---|
955 | | - } else { |
---|
956 | | - loadClipboard(false); |
---|
957 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
958 | | - pasteInto(false); // true); // ??? |
---|
959 | | - } |
---|
| 1335 | + pasteInto(false, false); |
---|
| 1336 | +// } else { |
---|
| 1337 | +// loadClipboard(false); |
---|
| 1338 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1339 | +// pasteInto(false, false); // true); // ??? |
---|
| 1340 | +// } |
---|
960 | 1341 | } |
---|
961 | 1342 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
962 | 1343 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1061 | 1442 | { |
---|
1062 | 1443 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1063 | 1444 | //heightFieldItem.addActionListener(this); |
---|
1064 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1065 | | - gridItem.addActionListener(this); |
---|
1066 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1067 | | - rectoidItem.addActionListener(this); |
---|
1068 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1069 | | - ellipsoidItem.addActionListener(this); |
---|
1070 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1071 | | - coneItem.addActionListener(this); |
---|
1072 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1073 | | - torusItem.addActionListener(this); |
---|
1074 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1075 | | - superItem.addActionListener(this); |
---|
| 1445 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1446 | +// gridItem.addActionListener(this); |
---|
| 1447 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1448 | +// rectoidItem.addActionListener(this); |
---|
| 1449 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1450 | +// ellipsoidItem.addActionListener(this); |
---|
| 1451 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1452 | +// coneItem.addActionListener(this); |
---|
| 1453 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1454 | +// torusItem.addActionListener(this); |
---|
| 1455 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1456 | +// superItem.addActionListener(this); |
---|
| 1457 | + |
---|
| 1458 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1459 | + cameraItem.addActionListener(this); |
---|
| 1460 | + |
---|
| 1461 | + if (!Globals.ADVANCED) |
---|
| 1462 | + { |
---|
1076 | 1463 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1077 | 1464 | kleinItem.addActionListener(this); |
---|
1078 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1079 | | - particleItem.addActionListener(this); |
---|
| 1465 | + } |
---|
| 1466 | + |
---|
| 1467 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1468 | +// particleItem.addActionListener(this); |
---|
| 1469 | + if (Globals.ADVANCED) |
---|
| 1470 | + { |
---|
1080 | 1471 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1081 | 1472 | ragdollItem.addActionListener(this); |
---|
1082 | 1473 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1083 | 1474 | ragdoll2Item.addActionListener(this); |
---|
| 1475 | + } |
---|
1084 | 1476 | menu.add("-"); |
---|
1085 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1477 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1086 | 1478 | meshItem.addActionListener(this); |
---|
1087 | 1479 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1088 | 1480 | // meshGroupItem.addActionListener(this); |
---|
| 1481 | + if (Globals.ADVANCED) |
---|
| 1482 | + { |
---|
1089 | 1483 | springItem = menu.add(new MenuItem("Spring")); |
---|
1090 | 1484 | springItem.addActionListener(this); |
---|
1091 | 1485 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1092 | 1486 | flagItem.addActionListener(this); |
---|
1093 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1094 | | - bezierItem.addActionListener(this); |
---|
1095 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1096 | | - checkerItem.addActionListener(this); |
---|
1097 | 1487 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1098 | 1488 | blobItem.addActionListener(this); |
---|
1099 | 1489 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1100 | 1490 | latheItem.addActionListener(this); |
---|
1101 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1102 | | - lightItem.addActionListener(this); |
---|
| 1491 | + } |
---|
| 1492 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1493 | + bezierItem.addActionListener(this); |
---|
| 1494 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1495 | +// overlayItem.addActionListener(this); |
---|
| 1496 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1497 | +// lightItem.addActionListener(this); |
---|
1103 | 1498 | menu.add("-"); |
---|
1104 | 1499 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1105 | 1500 | //superLoopItem.addActionListener(this); |
---|
1106 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1107 | | - loopItem.addActionListener(this); |
---|
| 1501 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1502 | +// loopItem.addActionListener(this); |
---|
1108 | 1503 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1109 | 1504 | doubleItem.addActionListener(this); |
---|
| 1505 | + if (Globals.ADVANCED) |
---|
| 1506 | + { |
---|
1110 | 1507 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1111 | 1508 | tripleItem.addActionListener(this); |
---|
| 1509 | + } |
---|
1112 | 1510 | } |
---|
1113 | 1511 | |
---|
1114 | 1512 | void buildToolsMenu(Menu menu) |
---|
1115 | 1513 | { |
---|
1116 | 1514 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1117 | 1515 | animationItem.addItemListener(this); |
---|
1118 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1516 | + animationItem.setState(Globals.ANIMATION); |
---|
| 1517 | + |
---|
| 1518 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1519 | + archiveItem.addActionListener(this); |
---|
1119 | 1520 | |
---|
1120 | 1521 | menu.add("-"); |
---|
1121 | 1522 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1122 | 1523 | parseverticesItem.addActionListener(this); |
---|
1123 | 1524 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1124 | 1525 | textureFieldItem.addActionListener(this); |
---|
1125 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1526 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1126 | 1527 | alignItem.addActionListener(this); |
---|
1127 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1128 | | - mirrorItem.addActionListener(this); |
---|
1129 | 1528 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1130 | 1529 | reduceMorphItem.addActionListener(this); |
---|
1131 | 1530 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1132 | 1531 | reduce34MorphItem.addActionListener(this); |
---|
1133 | | - |
---|
1134 | | - menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1135 | | - computeAOItem.addActionListener(this); |
---|
1136 | 1532 | menu.add("-"); |
---|
1137 | | - |
---|
1138 | 1533 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1139 | 1534 | memoryItem.addActionListener(this); |
---|
| 1535 | + menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
| 1536 | + computeAOItem.addActionListener(this); |
---|
| 1537 | + |
---|
| 1538 | + if (Globals.ADVANCED) |
---|
| 1539 | + { |
---|
| 1540 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1541 | + mirrorItem.addActionListener(this); |
---|
| 1542 | + menu.add("-"); |
---|
1140 | 1543 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1141 | 1544 | analyzeItem.addActionListener(this); |
---|
1142 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1545 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1143 | 1546 | dumpItem.addActionListener(this); |
---|
1144 | 1547 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1145 | 1548 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1157 | 1560 | menu.add("-"); |
---|
1158 | 1561 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1159 | 1562 | editScriptItem.addActionListener(this); |
---|
| 1563 | + } |
---|
1160 | 1564 | } |
---|
1161 | 1565 | |
---|
1162 | 1566 | void ScreenFit() |
---|
.. | .. |
---|
1279 | 1683 | shadow.material = new cMaterial(obj.material); |
---|
1280 | 1684 | shadow.material.diffuse = 0.0001f; |
---|
1281 | 1685 | shadow.material.specular = 0.0001f; |
---|
| 1686 | + //shadow.projectedVertices[1].x = 300; |
---|
1282 | 1687 | |
---|
1283 | 1688 | makeSomething(shadow); |
---|
1284 | 1689 | } |
---|
| 1690 | + |
---|
| 1691 | + private void ClearUnpinned() |
---|
| 1692 | + { |
---|
| 1693 | + //for (Object3D obj : listUI) |
---|
| 1694 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1695 | + { |
---|
| 1696 | + Object3D obj = listUI.elementAt(i); |
---|
| 1697 | + if (!obj.pinned) |
---|
| 1698 | + { |
---|
| 1699 | + obj.CloseUI(); |
---|
| 1700 | + listUI.remove(i); |
---|
| 1701 | + } |
---|
| 1702 | + } |
---|
| 1703 | + } |
---|
| 1704 | + |
---|
| 1705 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1706 | + { |
---|
| 1707 | + // if (!(elem instanceof Composite)) |
---|
| 1708 | + // newWindow = false; |
---|
| 1709 | + listUI.add(elem); |
---|
| 1710 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1711 | + System.out.println("edit : " + elem); |
---|
| 1712 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 1713 | + } |
---|
1285 | 1714 | |
---|
1286 | 1715 | /** |
---|
1287 | 1716 | * applyExample |
---|
.. | .. |
---|
1485 | 1914 | |
---|
1486 | 1915 | void Overwrite(int mask) |
---|
1487 | 1916 | { |
---|
1488 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 1917 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1489 | 1918 | { |
---|
1490 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 1919 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1491 | 1920 | |
---|
1492 | 1921 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1493 | 1922 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1510 | 1939 | // |
---|
1511 | 1940 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1512 | 1941 | { |
---|
| 1942 | + Object source = event.getSource(); |
---|
1513 | 1943 | /* |
---|
1514 | 1944 | if (event.getSource() == nameField) |
---|
1515 | 1945 | { |
---|
.. | .. |
---|
1521 | 1951 | } |
---|
1522 | 1952 | else |
---|
1523 | 1953 | */ |
---|
1524 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 1954 | + if (source == lookAtItem || source == lookFromItem) |
---|
1525 | 1955 | { |
---|
1526 | 1956 | ScreenFit(); |
---|
1527 | 1957 | } else |
---|
1528 | | - if (event.getSource() == switchItem) |
---|
| 1958 | + if (source == switchViewItem) |
---|
1529 | 1959 | { |
---|
1530 | 1960 | cVector v1 = new cVector(); |
---|
1531 | 1961 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1534 | 1964 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1535 | 1965 | objEditor.cameraView.repaint(); |
---|
1536 | 1966 | } else |
---|
1537 | | - if (event.getSource() == rectoidItem) |
---|
| 1967 | + if (source == rectoidItem || source == boxButton) |
---|
1538 | 1968 | { |
---|
1539 | 1969 | makeSomething(new Box()); |
---|
1540 | 1970 | } else |
---|
1541 | | - if (event.getSource() == particleItem) |
---|
| 1971 | + if (source == particleItem || source == particlesButton) |
---|
1542 | 1972 | { |
---|
1543 | 1973 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1544 | 1974 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1559 | 1989 | applyExample(particleGeom, "SMOKE"); |
---|
1560 | 1990 | makeSomething(particleGeom); |
---|
1561 | 1991 | } else |
---|
1562 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 1992 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1563 | 1993 | { |
---|
1564 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 1994 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1565 | 1995 | |
---|
1566 | 1996 | ragdoll.toParent = LA.newMatrix(); |
---|
1567 | 1997 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1579 | 2009 | } else |
---|
1580 | 2010 | /* |
---|
1581 | 2011 | */ |
---|
1582 | | - if (event.getSource() == heightFieldItem) |
---|
| 2012 | + if (source == heightFieldItem) |
---|
1583 | 2013 | { |
---|
1584 | 2014 | Object3D obj = new Object3D(); |
---|
1585 | 2015 | |
---|
.. | .. |
---|
1617 | 2047 | |
---|
1618 | 2048 | makeSomething(obj); |
---|
1619 | 2049 | } else |
---|
1620 | | - if (event.getSource() == gridItem) |
---|
| 2050 | + if (source == gridItem || source == gridButton) |
---|
1621 | 2051 | { |
---|
1622 | 2052 | makeSomething(new Grid()); |
---|
1623 | 2053 | } else |
---|
1624 | | - if (event.getSource() == ellipsoidItem) |
---|
| 2054 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1625 | 2055 | { |
---|
1626 | 2056 | makeSomething(new Sphere()); |
---|
1627 | 2057 | } else |
---|
1628 | | - if (event.getSource() == coneItem) |
---|
| 2058 | + if (source == coneItem || source == coneButton) |
---|
1629 | 2059 | { |
---|
1630 | 2060 | makeSomething(new Cone()); |
---|
1631 | 2061 | } else |
---|
1632 | | - if (event.getSource() == torusItem) |
---|
| 2062 | + if (source == torusItem || source == torusButton) |
---|
1633 | 2063 | { |
---|
1634 | 2064 | makeSomething(new Torus()); |
---|
1635 | 2065 | } else |
---|
1636 | | - if (event.getSource() == superItem) |
---|
| 2066 | + if (source == superItem || source == superButton) |
---|
1637 | 2067 | { |
---|
1638 | 2068 | makeSomething(new Superellipsoid()); |
---|
1639 | 2069 | } else |
---|
1640 | | - if (event.getSource() == kleinItem) |
---|
| 2070 | + if (source == kleinItem || source == kleinButton) |
---|
1641 | 2071 | { |
---|
1642 | 2072 | makeSomething(new Klein()); |
---|
1643 | 2073 | } else |
---|
1644 | | - if (event.getSource() == blobItem) |
---|
| 2074 | + if (source == blobItem) |
---|
1645 | 2075 | { |
---|
1646 | 2076 | Blob blob = new Blob(); |
---|
1647 | 2077 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1649 | 2079 | //blob.retile(); |
---|
1650 | 2080 | makeSomething(blob); |
---|
1651 | 2081 | } else |
---|
1652 | | - if (event.getSource() == latheItem) |
---|
| 2082 | + if (source == latheItem) |
---|
1653 | 2083 | { |
---|
1654 | 2084 | makeSomething(new Lathe()); |
---|
1655 | 2085 | } else |
---|
1656 | | - if (event.getSource() == bezierItem) |
---|
| 2086 | + if (source == bezierItem) |
---|
1657 | 2087 | { |
---|
1658 | 2088 | makeSomething(new BezierSurface()); |
---|
1659 | 2089 | } else |
---|
1660 | | - if (event.getSource() == checkerItem) |
---|
| 2090 | + if (source == overlayItem || source == overlayButton) |
---|
1661 | 2091 | { |
---|
1662 | 2092 | /* |
---|
1663 | 2093 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1672 | 2102 | */ |
---|
1673 | 2103 | makeSomething(new Checker()); |
---|
1674 | 2104 | } else |
---|
1675 | | - if (event.getSource() == meshItem) |
---|
| 2105 | + if (source == meshItem) |
---|
1676 | 2106 | { |
---|
1677 | 2107 | Object3D itemtomake = new Object3D(); |
---|
1678 | 2108 | Object3D child; |
---|
.. | .. |
---|
1693 | 2123 | makeSomething(child); |
---|
1694 | 2124 | } |
---|
1695 | 2125 | } else |
---|
1696 | | - if (event.getSource() == springItem) |
---|
| 2126 | + if (source == springItem) |
---|
1697 | 2127 | { |
---|
1698 | 2128 | cSpring s = new cSpring(); |
---|
1699 | 2129 | s.setup(); |
---|
1700 | 2130 | makeSomething(s); |
---|
1701 | 2131 | } else |
---|
1702 | | - if (event.getSource() == flagItem) |
---|
| 2132 | + if (source == flagItem) |
---|
1703 | 2133 | { |
---|
1704 | 2134 | cSpring s = new cFlag(); |
---|
1705 | 2135 | s.setup(); |
---|
1706 | 2136 | makeSomething(s); |
---|
1707 | 2137 | } else |
---|
1708 | | - if (event.getSource() == lightItem) |
---|
| 2138 | + if (source == lightItem || source == lightButton) |
---|
1709 | 2139 | { |
---|
1710 | 2140 | makeSomething(new Light()); |
---|
1711 | 2141 | } else |
---|
1712 | | - if (event.getSource() == csgItem) |
---|
| 2142 | + if (source == csgItem) |
---|
1713 | 2143 | { |
---|
1714 | 2144 | group(new CSG()); |
---|
1715 | 2145 | } else |
---|
1716 | | - if (event.getSource() == templateItem) |
---|
| 2146 | + if (source == templateItem) |
---|
1717 | 2147 | { |
---|
1718 | 2148 | group(new cTemplate()); |
---|
1719 | 2149 | } else |
---|
1720 | | - if (event.getSource() == attributeItem) |
---|
| 2150 | + if (source == attributeItem) |
---|
1721 | 2151 | { |
---|
1722 | 2152 | makeSomething(new Attribute()); |
---|
1723 | 2153 | } else |
---|
1724 | | - if (event.getSource() == pointflowItem) |
---|
| 2154 | + if (source == pointflowItem) |
---|
1725 | 2155 | { |
---|
1726 | 2156 | makeSomething(new PointFlow()); |
---|
1727 | 2157 | } else |
---|
.. | .. |
---|
1733 | 2163 | } else |
---|
1734 | 2164 | */ |
---|
1735 | 2165 | |
---|
1736 | | - if (event.getSource() == superLoopItem) |
---|
| 2166 | + if (source == superLoopItem) |
---|
1737 | 2167 | { |
---|
1738 | 2168 | Composite g = new cGroup(); |
---|
1739 | 2169 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1755 | 2185 | |
---|
1756 | 2186 | group(g); |
---|
1757 | 2187 | } else |
---|
1758 | | - if (event.getSource() == loopItem) |
---|
| 2188 | + if (source == loopItem || source == loopButton) |
---|
1759 | 2189 | { |
---|
1760 | 2190 | Composite csg = new GroupLeaf(); |
---|
1761 | 2191 | csg.count = 5; |
---|
1762 | 2192 | group(csg); |
---|
1763 | | - Composite child = new cGroup(); |
---|
| 2193 | + Composite child = new cGroup("Branch"); |
---|
1764 | 2194 | csg.addChild(child); |
---|
1765 | 2195 | child.addChild(csg); |
---|
1766 | 2196 | } else |
---|
1767 | | - if (event.getSource() == doubleItem) |
---|
| 2197 | + if (source == doubleItem) |
---|
1768 | 2198 | { |
---|
1769 | | - Composite csg = new GroupLeaf(); |
---|
| 2199 | + Composite csg = new GroupLeaf("Fork"); |
---|
1770 | 2200 | csg.count = 5; |
---|
1771 | 2201 | group(csg); |
---|
1772 | | - Composite child = new cGroup(); |
---|
| 2202 | + Composite child = new cGroup("Branch A"); |
---|
1773 | 2203 | csg.addChild(child); |
---|
1774 | 2204 | child.addChild(csg); |
---|
1775 | | - child = new cGroup(); |
---|
| 2205 | + child = new cGroup("Branch B"); |
---|
1776 | 2206 | csg.addChild(child); |
---|
1777 | 2207 | child.addChild(csg); |
---|
1778 | 2208 | } else |
---|
1779 | | - if (event.getSource() == tripleItem) |
---|
| 2209 | + if (source == tripleItem) |
---|
1780 | 2210 | { |
---|
1781 | | - Composite csg = new GroupLeaf(); |
---|
| 2211 | + Composite csg = new GroupLeaf("Trident"); |
---|
1782 | 2212 | csg.count = 4; |
---|
1783 | 2213 | group(csg); |
---|
1784 | 2214 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1791 | 2221 | csg.addChild(child); |
---|
1792 | 2222 | child.addChild(csg); |
---|
1793 | 2223 | } else |
---|
1794 | | - |
---|
1795 | | - if (event.getSource() == importGFDItem) |
---|
1796 | | - { |
---|
1797 | | - ImportGFD(); |
---|
1798 | | - } else |
---|
1799 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1800 | | - { |
---|
1801 | | - ImportVRMLX3D(); |
---|
1802 | | - } else |
---|
1803 | | - if (event.getSource() == import3DSItem) |
---|
1804 | | - { |
---|
1805 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1806 | | - } else |
---|
1807 | | - if (event.getSource() == importOBJItem) |
---|
1808 | | - { |
---|
1809 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1810 | | - } else |
---|
1811 | | - if (event.getSource() == computeAOItem) |
---|
| 2224 | + if (source == computeAOItem) |
---|
1812 | 2225 | { |
---|
1813 | 2226 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1814 | 2227 | Globals.theRenderer.repaint(); |
---|
1815 | 2228 | } else |
---|
1816 | | - if (event.getSource() == recompileItem) |
---|
| 2229 | + if (source == recompileItem) |
---|
1817 | 2230 | { |
---|
1818 | 2231 | Recompile(); |
---|
1819 | 2232 | refreshContents(); |
---|
1820 | 2233 | } else |
---|
1821 | | - if (event.getSource() == editScriptItem) |
---|
| 2234 | + if (source == editScriptItem) |
---|
1822 | 2235 | { |
---|
1823 | 2236 | OpenDialog(); |
---|
1824 | 2237 | refreshContents(); |
---|
1825 | 2238 | } else |
---|
1826 | | - if (event.getSource() == invariantsItem) |
---|
| 2239 | + if (source == invariantsItem) |
---|
1827 | 2240 | { |
---|
1828 | 2241 | System.out.println("Invariants:"); |
---|
1829 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2242 | + Grafreed.grafreeD.universe.invariants(); |
---|
1830 | 2243 | } else |
---|
1831 | | - if (event.getSource() == memoryItem) |
---|
| 2244 | + if (source == memoryItem) |
---|
1832 | 2245 | { |
---|
1833 | 2246 | //System.out.println("Invariants:"); |
---|
1834 | 2247 | PrintMemory(); |
---|
1835 | 2248 | } else |
---|
1836 | | - if (event.getSource() == pathItem) |
---|
| 2249 | + if (source == pathItem) |
---|
1837 | 2250 | { |
---|
1838 | 2251 | PrintPath(); |
---|
1839 | 2252 | } else |
---|
1840 | | - if (event.getSource() == analyzeItem) |
---|
| 2253 | + if (source == analyzeItem) |
---|
1841 | 2254 | { |
---|
1842 | 2255 | AnalyzeObject(); |
---|
1843 | 2256 | } else |
---|
1844 | | - if (event.getSource() == dumpItem) |
---|
| 2257 | + if (source == dumpItem) |
---|
1845 | 2258 | { |
---|
1846 | 2259 | DumpObject(); |
---|
1847 | 2260 | } else |
---|
1848 | | - if (event.getSource() == screenfitButton) |
---|
| 2261 | + if (source == minButton) |
---|
1849 | 2262 | { |
---|
1850 | | - //Reload(lastConverter, lastFilename, true); |
---|
| 2263 | + Minimize(); |
---|
| 2264 | + } else |
---|
| 2265 | + if (source == maxButton) |
---|
| 2266 | + { |
---|
| 2267 | + Maximize(); |
---|
| 2268 | + } else |
---|
| 2269 | + if (source == fullButton) |
---|
| 2270 | + { |
---|
| 2271 | + ToggleFullScreen(); |
---|
| 2272 | + } else |
---|
| 2273 | + if (source == undoButton) |
---|
| 2274 | + { |
---|
| 2275 | + // Go to previous version |
---|
| 2276 | + //if (!Undo()) |
---|
| 2277 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2278 | + Undo(); |
---|
| 2279 | + } else |
---|
| 2280 | + if (source == restoreButton) |
---|
| 2281 | + { |
---|
| 2282 | + // Restore current version |
---|
| 2283 | + Restore(); |
---|
| 2284 | + } else |
---|
| 2285 | + if (source == replaceButton) |
---|
| 2286 | + { |
---|
| 2287 | + // Overwrite current version |
---|
| 2288 | + Replace(); |
---|
| 2289 | + } else |
---|
| 2290 | + if (source == redoButton) |
---|
| 2291 | + { |
---|
| 2292 | + // Go to next version |
---|
| 2293 | + Redo(); |
---|
| 2294 | + } else |
---|
| 2295 | + if (source == saveButton) |
---|
| 2296 | + { |
---|
| 2297 | + // Save a new version |
---|
| 2298 | + if (!Save(true)) |
---|
| 2299 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2300 | + } else |
---|
| 2301 | + if (source == oneStepButton) |
---|
| 2302 | + { |
---|
| 2303 | + Globals.ONESTEP = true; |
---|
| 2304 | + cameraView.repaint(); |
---|
| 2305 | + } else |
---|
| 2306 | + if (source == screenfitButton) |
---|
| 2307 | + { |
---|
1851 | 2308 | ScreenFit(); |
---|
1852 | 2309 | } else |
---|
1853 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2310 | + if (source == screenfitpointButton) |
---|
1854 | 2311 | { |
---|
1855 | | - //Reload(lastConverter, lastFilename, true); |
---|
1856 | 2312 | ScreenFitPoint(); |
---|
1857 | 2313 | } else |
---|
1858 | | - if (event.getSource() == snapobjectButton) |
---|
| 2314 | + if (source == snapobjectButton) |
---|
1859 | 2315 | { |
---|
1860 | | - //Reload(lastConverter, lastFilename, true); |
---|
1861 | 2316 | SnapObject(); |
---|
1862 | 2317 | } else |
---|
1863 | 2318 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1866 | 2321 | // Recompile(); |
---|
1867 | 2322 | // refreshContents(); |
---|
1868 | 2323 | // } else |
---|
1869 | | - if (event.getSource() == gcButton) |
---|
| 2324 | + if (source == gcButton) |
---|
1870 | 2325 | { |
---|
1871 | 2326 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1872 | 2327 | System.gc(); |
---|
1873 | 2328 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1874 | 2329 | } else |
---|
1875 | | - if (event.getSource() == editLeafItem) |
---|
| 2330 | + if (source == editLeafItem) |
---|
1876 | 2331 | { |
---|
1877 | 2332 | Object3D obj; |
---|
1878 | 2333 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1886 | 2341 | } |
---|
1887 | 2342 | refreshContents(true); |
---|
1888 | 2343 | } else |
---|
1889 | | - if (event.getSource() == openWindowItem) |
---|
| 2344 | + if (source == openWindowItem) |
---|
1890 | 2345 | { |
---|
1891 | 2346 | EditSelection(true); |
---|
1892 | 2347 | } else |
---|
1893 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2348 | + if (source == cutItem || source == clearButton) |
---|
1894 | 2349 | { |
---|
1895 | 2350 | loadClipboard(true); |
---|
1896 | 2351 | } else |
---|
1897 | | - if (event.getSource() == duplicateItem) |
---|
| 2352 | + if (source == undoItem) |
---|
1898 | 2353 | { |
---|
1899 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2354 | + Undo(); |
---|
| 2355 | + } else |
---|
| 2356 | + if (source == redoItem) |
---|
| 2357 | + { |
---|
| 2358 | + Redo(); |
---|
| 2359 | + } else |
---|
| 2360 | + if (source == duplicateItem) |
---|
| 2361 | + { |
---|
| 2362 | + Object3D keep = Grafreed.clipboard; |
---|
1900 | 2363 | loadClipboard(false); |
---|
1901 | 2364 | paste(false); |
---|
1902 | | - GrafreeD.clipboard = keep; |
---|
| 2365 | + Grafreed.clipboard = keep; |
---|
1903 | 2366 | } else |
---|
1904 | | - if (event.getSource() == cloneItem) |
---|
| 2367 | + if (source == cloneItem) |
---|
1905 | 2368 | { |
---|
1906 | 2369 | CloneSelection(false); |
---|
1907 | 2370 | } else |
---|
1908 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2371 | + if (source == cloneSupportItem) |
---|
1909 | 2372 | { |
---|
1910 | 2373 | CloneSelection(true); |
---|
1911 | 2374 | } else |
---|
1912 | | - if (event.getSource() == copyItem) |
---|
| 2375 | + if (source == copyItem) |
---|
1913 | 2376 | { |
---|
1914 | 2377 | loadClipboard(false); |
---|
1915 | 2378 | } else |
---|
1916 | | - if (event.getSource() == pasteItem) |
---|
| 2379 | + if (source == pasteItem) |
---|
1917 | 2380 | { |
---|
1918 | 2381 | paste(false); |
---|
1919 | 2382 | } else |
---|
1920 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2383 | + if (source == pasteIntoItem) |
---|
1921 | 2384 | { |
---|
1922 | | - pasteInto(false); |
---|
| 2385 | + pasteInto(true, false); |
---|
1923 | 2386 | } else |
---|
1924 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2387 | + if (source == pasteLinkItem) |
---|
1925 | 2388 | { |
---|
1926 | | - pasteInto(true); |
---|
| 2389 | + pasteInto(false, false); |
---|
1927 | 2390 | } else |
---|
1928 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2391 | + if (source == pasteCloneItem) |
---|
| 2392 | + { |
---|
| 2393 | + pasteInto(true, true); |
---|
| 2394 | + } else |
---|
| 2395 | + if (source == pasteExpandItem) |
---|
1929 | 2396 | { |
---|
1930 | 2397 | paste(true); |
---|
1931 | 2398 | } else |
---|
1932 | | - if (event.getSource() == synchronizeItem) |
---|
| 2399 | + if (source == synchronizeItem) |
---|
1933 | 2400 | { |
---|
1934 | 2401 | Overwrite(Object3D.TRANSFORM); |
---|
1935 | 2402 | } else |
---|
1936 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2403 | + if (source == overwriteNameItem) |
---|
1937 | 2404 | { |
---|
1938 | 2405 | Overwrite(Object3D.NAME); |
---|
1939 | 2406 | } else |
---|
1940 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2407 | + if (source == overwriteUVItem) |
---|
1941 | 2408 | { |
---|
1942 | 2409 | Overwrite(Object3D.UV); |
---|
1943 | 2410 | } else |
---|
1944 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2411 | + if (source == overwriteMatItem) |
---|
1945 | 2412 | { |
---|
1946 | 2413 | /* july 2015 |
---|
1947 | 2414 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1961 | 2428 | |
---|
1962 | 2429 | Overwrite(dropAttributes); |
---|
1963 | 2430 | } |
---|
1964 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2431 | + if (source == overwriteGeoItem) |
---|
1965 | 2432 | { |
---|
1966 | 2433 | Overwrite(Object3D.GEOMETRY); |
---|
1967 | 2434 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1978 | 2445 | // refreshContents(); |
---|
1979 | 2446 | // } |
---|
1980 | 2447 | } else |
---|
1981 | | - if (event.getSource() == generateMeshItem) |
---|
| 2448 | + if (source == generateMeshItem) |
---|
1982 | 2449 | { |
---|
1983 | 2450 | //if (group.selection.size() == 1) |
---|
1984 | 2451 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1989 | 2456 | ResetModel(); |
---|
1990 | 2457 | refreshContents(); |
---|
1991 | 2458 | } else |
---|
1992 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2459 | + if (source == extractGeometriesItem) |
---|
1993 | 2460 | { |
---|
1994 | 2461 | boolean one = false; |
---|
1995 | 2462 | |
---|
.. | .. |
---|
2016 | 2483 | ResetModel(); |
---|
2017 | 2484 | refreshContents(); |
---|
2018 | 2485 | } else |
---|
2019 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2486 | + if (source == cloneGeometriesItem) |
---|
2020 | 2487 | { |
---|
2021 | 2488 | boolean one = false; |
---|
2022 | 2489 | |
---|
.. | .. |
---|
2042 | 2509 | ResetModel(); |
---|
2043 | 2510 | refreshContents(); |
---|
2044 | 2511 | } else |
---|
2045 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2512 | + if (source == shareGeometriesItem) |
---|
2046 | 2513 | { |
---|
2047 | 2514 | boolean one = false; |
---|
2048 | 2515 | |
---|
.. | .. |
---|
2072 | 2539 | refreshContents(); |
---|
2073 | 2540 | } |
---|
2074 | 2541 | } else |
---|
2075 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2542 | + if (source == mergeGeometriesItem) |
---|
2076 | 2543 | { |
---|
2077 | 2544 | boolean one = false; |
---|
2078 | 2545 | |
---|
.. | .. |
---|
2102 | 2569 | ResetModel(); |
---|
2103 | 2570 | refreshContents(); |
---|
2104 | 2571 | } else |
---|
2105 | | - if (event.getSource() == linkverticesItem) |
---|
| 2572 | + if (source == linkverticesItem) |
---|
2106 | 2573 | { |
---|
2107 | 2574 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2108 | 2575 | // { |
---|
.. | .. |
---|
2115 | 2582 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2116 | 2583 | // refreshContents(); |
---|
2117 | 2584 | // } |
---|
2118 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2585 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2119 | 2586 | { |
---|
2120 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2587 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2121 | 2588 | |
---|
2122 | 2589 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2123 | 2590 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2125 | 2592 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2126 | 2593 | for (int i=0; i<group.selection.size(); i++) |
---|
2127 | 2594 | { |
---|
2128 | | - boolean random = CameraPane.RANDOM; |
---|
2129 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2595 | + boolean random = CameraPane.SWITCH; |
---|
| 2596 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2130 | 2597 | group.selection.get(i).linkVerticesThis(content); |
---|
2131 | 2598 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2132 | | - CameraPane.RANDOM = random; |
---|
| 2599 | + CameraPane.SWITCH = random; |
---|
2133 | 2600 | } |
---|
2134 | 2601 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2135 | 2602 | refreshContents(); |
---|
2136 | 2603 | } |
---|
2137 | 2604 | } else |
---|
2138 | | - if (event.getSource() == resetsupportItem) |
---|
| 2605 | + if (source == resetsupportItem) |
---|
2139 | 2606 | { |
---|
2140 | 2607 | for (int i=0; i<group.selection.size(); i++) |
---|
2141 | 2608 | { |
---|
2142 | | - boolean random = CameraPane.RANDOM; |
---|
2143 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2609 | + boolean random = CameraPane.SWITCH; |
---|
| 2610 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2144 | 2611 | group.selection.get(i).linkVerticesThis(null); |
---|
2145 | | - CameraPane.RANDOM = random; |
---|
| 2612 | + CameraPane.SWITCH = random; |
---|
2146 | 2613 | } |
---|
2147 | 2614 | |
---|
2148 | 2615 | refreshContents(); |
---|
2149 | 2616 | } else |
---|
2150 | | - if (event.getSource() == relinkverticesItem) |
---|
| 2617 | + if (source == relinkverticesItem) |
---|
2151 | 2618 | { |
---|
2152 | | - boolean random = CameraPane.RANDOM; |
---|
2153 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2619 | + boolean random = CameraPane.SWITCH; |
---|
| 2620 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2154 | 2621 | group.selection.RelinkToSupport(); |
---|
2155 | | - CameraPane.RANDOM = random; |
---|
| 2622 | + CameraPane.SWITCH = random; |
---|
2156 | 2623 | |
---|
2157 | 2624 | refreshContents(); |
---|
2158 | 2625 | } else |
---|
2159 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2626 | + if (source == resetreferencesItem) |
---|
2160 | 2627 | { |
---|
2161 | 2628 | for (int i=0; i<group.selection.size(); i++) |
---|
2162 | 2629 | { |
---|
.. | .. |
---|
2165 | 2632 | |
---|
2166 | 2633 | refreshContents(); |
---|
2167 | 2634 | } else |
---|
2168 | | - if (event.getSource() == setMasterItem) |
---|
| 2635 | + if (source == setMasterItem) |
---|
2169 | 2636 | { |
---|
2170 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2637 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2171 | 2638 | { |
---|
2172 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2639 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2173 | 2640 | |
---|
2174 | 2641 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2175 | 2642 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2178 | 2645 | refreshContents(); |
---|
2179 | 2646 | } |
---|
2180 | 2647 | } else |
---|
2181 | | - if (event.getSource() == poseMeshItem) |
---|
| 2648 | + if (source == poseMeshItem) |
---|
2182 | 2649 | { |
---|
2183 | 2650 | if (group.selection.size() == 1) |
---|
2184 | 2651 | { |
---|
2185 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2652 | + if (Grafreed.clipboard.size() == 1) |
---|
2186 | 2653 | { |
---|
2187 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2654 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2188 | 2655 | |
---|
2189 | 2656 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2190 | 2657 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2197 | 2664 | } |
---|
2198 | 2665 | |
---|
2199 | 2666 | } else |
---|
2200 | | - if (event.getSource() == revertMeshItem) |
---|
| 2667 | + if (source == revertMeshItem) |
---|
2201 | 2668 | { |
---|
2202 | 2669 | RevertMeshes(); |
---|
2203 | 2670 | } else |
---|
2204 | | - if (event.getSource() == resetMeshItem) |
---|
| 2671 | + if (source == resetAllItem) |
---|
2205 | 2672 | { |
---|
2206 | 2673 | ResetAll(); |
---|
2207 | 2674 | } else |
---|
2208 | | - if (event.getSource() == stepAllItem) |
---|
| 2675 | + if (source == stepAllItem) |
---|
2209 | 2676 | { |
---|
2210 | 2677 | StepAll(); |
---|
2211 | 2678 | } else |
---|
2212 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 2679 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2213 | 2680 | { |
---|
2214 | 2681 | //int indices[] = jList.getSelectedIndices(); |
---|
2215 | 2682 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2217 | 2684 | |
---|
2218 | 2685 | ClearSelection(false); |
---|
2219 | 2686 | } else |
---|
2220 | | - if (event.getSource() == clearAllItem) |
---|
| 2687 | + if (source == clearAllItem) |
---|
2221 | 2688 | { |
---|
2222 | 2689 | ClearSelection(true); |
---|
2223 | 2690 | } else |
---|
2224 | | - if (event.getSource() == grabItem) |
---|
| 2691 | + if (source == grabItem || source == groupButton) |
---|
2225 | 2692 | { |
---|
2226 | | - group(new cGroup(), true); |
---|
| 2693 | + group(new cGroup(), false); // true); |
---|
2227 | 2694 | } else |
---|
2228 | | - if (event.getSource() == hideItem) |
---|
| 2695 | + if (source == hideItem) |
---|
2229 | 2696 | { |
---|
2230 | 2697 | group(new HiddenObject()); |
---|
2231 | 2698 | } else |
---|
2232 | | - if (event.getSource() == frontItem) |
---|
| 2699 | + if (source == frontItem) |
---|
2233 | 2700 | { |
---|
2234 | 2701 | front(); |
---|
2235 | 2702 | } else |
---|
2236 | | - if (event.getSource() == backItem) |
---|
| 2703 | + if (source == backItem) |
---|
2237 | 2704 | { |
---|
2238 | 2705 | back(); |
---|
2239 | 2706 | } else |
---|
2240 | | - if (event.getSource() == cameraItem) |
---|
| 2707 | + if (source == cameraItem) |
---|
2241 | 2708 | { |
---|
2242 | 2709 | makeSomething(new Camera()); |
---|
2243 | 2710 | } else |
---|
2244 | | - if (event.getSource() == compositeItem) |
---|
| 2711 | + if (source == compositeItem || source == compositeButton) |
---|
2245 | 2712 | { |
---|
2246 | 2713 | group(new Composite()); |
---|
2247 | 2714 | } else |
---|
2248 | | - if (event.getSource() == randomItem) |
---|
| 2715 | + if (source == switchItem || source == switchButton) |
---|
2249 | 2716 | { |
---|
2250 | 2717 | RandomNode random = new RandomNode(); |
---|
2251 | 2718 | group(random); |
---|
2252 | 2719 | if (random.size() > 0) |
---|
2253 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 2720 | + random.name = random.get(0).name + "Switch"; |
---|
2254 | 2721 | } else |
---|
2255 | | - if (event.getSource() == physicsItem) |
---|
| 2722 | + if (source == physicsItem) |
---|
2256 | 2723 | { |
---|
2257 | 2724 | group(new PhysicsNode()); |
---|
2258 | 2725 | } else |
---|
2259 | | - if (event.getSource() == frameselectorItem) |
---|
| 2726 | + if (source == frameselectorItem) |
---|
2260 | 2727 | { |
---|
2261 | 2728 | for (int i=0; i<group.selection.size(); i++) |
---|
2262 | 2729 | { |
---|
.. | .. |
---|
2268 | 2735 | ResetModel(); |
---|
2269 | 2736 | refreshContents(); |
---|
2270 | 2737 | } else |
---|
2271 | | - if (event.getSource() == switchGeoItem) |
---|
| 2738 | + if (source == switchGeoItem) |
---|
2272 | 2739 | { |
---|
2273 | 2740 | for (int i=0; i<group.selection.size(); i++) |
---|
2274 | 2741 | { |
---|
.. | .. |
---|
2280 | 2747 | ResetModel(); |
---|
2281 | 2748 | refreshContents(); |
---|
2282 | 2749 | } else |
---|
2283 | | - if (event.getSource() == switchTransfoItem) |
---|
| 2750 | + if (source == switchTransfoItem) |
---|
2284 | 2751 | { |
---|
2285 | 2752 | for (int i=0; i<group.selection.size(); i++) |
---|
2286 | 2753 | { |
---|
.. | .. |
---|
2292 | 2759 | ResetModel(); |
---|
2293 | 2760 | refreshContents(); |
---|
2294 | 2761 | } else |
---|
2295 | | - if (event.getSource() == morphItem) |
---|
| 2762 | + if (source == morphItem) |
---|
2296 | 2763 | { |
---|
2297 | 2764 | for (int i=0; i<group.selection.size(); i++) |
---|
2298 | 2765 | { |
---|
.. | .. |
---|
2304 | 2771 | ResetModel(); |
---|
2305 | 2772 | refreshContents(); |
---|
2306 | 2773 | } else |
---|
2307 | | - if (event.getSource() == scriptNodeItem) |
---|
| 2774 | + if (source == scriptNodeItem) |
---|
2308 | 2775 | { |
---|
2309 | 2776 | boolean atleastone = false; |
---|
2310 | 2777 | |
---|
.. | .. |
---|
2343 | 2810 | } |
---|
2344 | 2811 | } |
---|
2345 | 2812 | } else |
---|
2346 | | - if (event.getSource() == linkerItem) |
---|
| 2813 | + if (source == linkerItem) |
---|
2347 | 2814 | { |
---|
2348 | 2815 | group(new cLinker()); |
---|
2349 | 2816 | } else |
---|
2350 | | - if (event.getSource() == textureItem) |
---|
| 2817 | + if (source == textureItem || source == textureButton) |
---|
2351 | 2818 | { |
---|
2352 | 2819 | group(new TextureNode()); |
---|
2353 | 2820 | } else |
---|
2354 | | - if (event.getSource() == billboardItem) |
---|
| 2821 | + if (source == billboardItem) |
---|
2355 | 2822 | { |
---|
2356 | 2823 | group(new BillboardNode()); |
---|
2357 | 2824 | } else |
---|
2358 | | - if (event.getSource() == shadowXItem) |
---|
| 2825 | + if (source == shadowXItem) |
---|
2359 | 2826 | { |
---|
2360 | 2827 | CastShadow(0); |
---|
2361 | 2828 | } else |
---|
2362 | | - if (event.getSource() == shadowYItem) |
---|
| 2829 | + if (source == shadowYItem) |
---|
2363 | 2830 | { |
---|
2364 | 2831 | CastShadow(1); |
---|
2365 | 2832 | } else |
---|
2366 | | - if (event.getSource() == shadowZItem) |
---|
| 2833 | + if (source == shadowZItem) |
---|
2367 | 2834 | { |
---|
2368 | 2835 | CastShadow(2); |
---|
2369 | 2836 | } else |
---|
2370 | | - if (event.getSource() == ungroupItem) |
---|
| 2837 | + if (source == ungroupItem || source == ungroupButton) |
---|
2371 | 2838 | { |
---|
2372 | | - //ungroup(); |
---|
| 2839 | + boolean hasRoot = false; |
---|
| 2840 | + |
---|
2373 | 2841 | for (int i=0; i<group.selection.size(); i++) |
---|
2374 | 2842 | { |
---|
2375 | | - Ungroup(group.selection.get(i)); |
---|
| 2843 | + if (group.selection.get(i) == group) |
---|
| 2844 | + { |
---|
| 2845 | + hasRoot = true; |
---|
| 2846 | + break; |
---|
| 2847 | + } |
---|
2376 | 2848 | } |
---|
2377 | 2849 | |
---|
2378 | | - ClearSelection(false); |
---|
2379 | | - |
---|
2380 | | - refreshContents(); |
---|
| 2850 | + if (!hasRoot) |
---|
| 2851 | + { |
---|
| 2852 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2853 | + { |
---|
| 2854 | + Ungroup(group.selection.get(i)); |
---|
| 2855 | + } |
---|
| 2856 | + |
---|
| 2857 | + ClearSelection(false); |
---|
| 2858 | + |
---|
| 2859 | + refreshContents(); |
---|
| 2860 | + } |
---|
2381 | 2861 | } else |
---|
2382 | | - if (event.getSource() == genUVItem) |
---|
| 2862 | + if (source == genUVItem) |
---|
2383 | 2863 | { |
---|
2384 | 2864 | GenUV(); |
---|
2385 | 2865 | } else |
---|
2386 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 2866 | + if (source == genNormalsCADItem) |
---|
2387 | 2867 | { |
---|
2388 | 2868 | GenNormals(true); |
---|
2389 | 2869 | } else |
---|
2390 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 2870 | + if (source == genNormalsMESHItem) |
---|
2391 | 2871 | { |
---|
2392 | | - GenNormals(true); // TODO |
---|
| 2872 | + GenNormalsMESH(); |
---|
2393 | 2873 | } else |
---|
2394 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 2874 | + if (source == genNormalsORGANItem) |
---|
2395 | 2875 | { |
---|
2396 | 2876 | GenNormals(false); |
---|
2397 | 2877 | } else |
---|
2398 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 2878 | + if (source == genNormalsMINEItem) |
---|
2399 | 2879 | { |
---|
2400 | 2880 | GenNormalsMINE(); |
---|
2401 | 2881 | } else |
---|
2402 | | - if (event.getSource() == stripifyItem) |
---|
| 2882 | + if (source == stripifyItem) |
---|
2403 | 2883 | { |
---|
2404 | 2884 | Stripify(); |
---|
2405 | 2885 | } else |
---|
2406 | | - if (event.getSource() == unstripifyItem) |
---|
| 2886 | + if (source == unstripifyItem) |
---|
2407 | 2887 | { |
---|
2408 | 2888 | Unstripify(); |
---|
2409 | 2889 | } else |
---|
2410 | | - if (event.getSource() == trimItem) |
---|
| 2890 | + if (source == trimItem) |
---|
2411 | 2891 | { |
---|
2412 | 2892 | Trim(); |
---|
2413 | 2893 | } else |
---|
2414 | | - if (event.getSource() == untrimItem) |
---|
| 2894 | + if (source == untrimItem) |
---|
2415 | 2895 | { |
---|
2416 | 2896 | Untrim(); |
---|
2417 | 2897 | } else |
---|
2418 | | - if (event.getSource() == clearColorsItem) |
---|
| 2898 | + if (source == clearColorsItem) |
---|
2419 | 2899 | { |
---|
2420 | 2900 | ClearColors(); |
---|
2421 | 2901 | } else |
---|
2422 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 2902 | + if (source == clearMaterialsItem) |
---|
2423 | 2903 | { |
---|
2424 | 2904 | ClearMaterials(); |
---|
2425 | 2905 | } else |
---|
2426 | | - if (event.getSource() == liveleavesItem) |
---|
| 2906 | + if (source == liveleavesItem) |
---|
2427 | 2907 | { |
---|
2428 | 2908 | LiveLeaves(true); |
---|
2429 | 2909 | } else |
---|
2430 | | - if (event.getSource() == unliveleavesItem) |
---|
| 2910 | + if (source == unliveleavesItem) |
---|
2431 | 2911 | { |
---|
2432 | 2912 | LiveLeaves(false); |
---|
2433 | 2913 | } else |
---|
2434 | | - if (event.getSource() == supportleavesItem) |
---|
| 2914 | + if (source == supportleavesItem) |
---|
2435 | 2915 | { |
---|
2436 | 2916 | SupportLeaves(true); |
---|
2437 | 2917 | } else |
---|
2438 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 2918 | + if (source == unsupportleavesItem) |
---|
2439 | 2919 | { |
---|
2440 | 2920 | SupportLeaves(false); |
---|
2441 | 2921 | } else |
---|
2442 | | - if (event.getSource() == hideleavesItem) |
---|
| 2922 | + if (source == hideleavesItem) |
---|
2443 | 2923 | { |
---|
2444 | 2924 | HideLeaves(true); |
---|
2445 | 2925 | } else |
---|
2446 | | - if (event.getSource() == showleavesItem) |
---|
| 2926 | + if (source == showleavesItem) |
---|
2447 | 2927 | { |
---|
2448 | 2928 | HideLeaves(false); |
---|
2449 | 2929 | } else |
---|
2450 | | - if (event.getSource() == markleavesItem) |
---|
| 2930 | + if (source == markleavesItem) |
---|
2451 | 2931 | { |
---|
2452 | 2932 | MarkLeaves(true); |
---|
2453 | 2933 | } else |
---|
2454 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 2934 | + if (source == unmarkleavesItem) |
---|
2455 | 2935 | { |
---|
2456 | 2936 | MarkLeaves(false); |
---|
2457 | 2937 | } else |
---|
2458 | | - if (event.getSource() == flipVItem) |
---|
| 2938 | + if (source == rewindleavesItem) |
---|
| 2939 | + { |
---|
| 2940 | + RewindLeaves(true); |
---|
| 2941 | + } else |
---|
| 2942 | + if (source == unrewindleavesItem) |
---|
| 2943 | + { |
---|
| 2944 | + RewindLeaves(false); |
---|
| 2945 | + } else |
---|
| 2946 | + if (source == randomleavesItem) |
---|
| 2947 | + { |
---|
| 2948 | + RandomLeaves(true); |
---|
| 2949 | + } else |
---|
| 2950 | + if (source == unrandomleavesItem) |
---|
| 2951 | + { |
---|
| 2952 | + RandomLeaves(false); |
---|
| 2953 | + } else |
---|
| 2954 | + if (source == flipVItem) |
---|
2459 | 2955 | { |
---|
2460 | 2956 | FlipV(true); |
---|
2461 | 2957 | } else |
---|
2462 | | - if (event.getSource() == unflipVItem) |
---|
| 2958 | + if (source == unflipVItem) |
---|
2463 | 2959 | { |
---|
2464 | 2960 | FlipV(false); |
---|
2465 | 2961 | } else |
---|
2466 | | - if (event.getSource() == lowTexturesItem) |
---|
| 2962 | + if (source == lowTexturesItem) |
---|
2467 | 2963 | { |
---|
2468 | 2964 | SetTexRes(0); |
---|
2469 | 2965 | } else |
---|
2470 | | - if (event.getSource() == normalTexturesItem) |
---|
| 2966 | + if (source == normalTexturesItem) |
---|
2471 | 2967 | { |
---|
2472 | 2968 | SetTexRes(1); |
---|
2473 | 2969 | } else |
---|
2474 | | - if (event.getSource() == highTexturesItem) |
---|
| 2970 | + if (source == highTexturesItem) |
---|
2475 | 2971 | { |
---|
2476 | 2972 | SetTexRes(2); |
---|
2477 | 2973 | } else |
---|
2478 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 2974 | + if (source == veryhighTexturesItem) |
---|
2479 | 2975 | { |
---|
2480 | 2976 | SetTexRes(3); |
---|
2481 | 2977 | } else |
---|
2482 | | - if (event.getSource() == maxTexturesItem) |
---|
| 2978 | + if (source == maxTexturesItem) |
---|
2483 | 2979 | { |
---|
2484 | 2980 | SetTexRes(4); |
---|
2485 | 2981 | } else |
---|
2486 | | - if (event.getSource() == panoTexturesItem) |
---|
| 2982 | + if (source == panoTexturesItem) |
---|
2487 | 2983 | { |
---|
2488 | 2984 | SetTexRes(5); |
---|
2489 | 2985 | } else |
---|
2490 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 2986 | + if (source == reverseNormalsItem) |
---|
2491 | 2987 | { |
---|
2492 | 2988 | ReverseNormals(); |
---|
2493 | 2989 | } else |
---|
2494 | | - if (event.getSource() == parseverticesItem) |
---|
| 2990 | + if (source == parseverticesItem) |
---|
2495 | 2991 | { |
---|
2496 | 2992 | ParseVertices(); |
---|
2497 | 2993 | } else |
---|
2498 | | - if (event.getSource() == textureFieldItem) |
---|
| 2994 | + if (source == textureFieldItem) |
---|
2499 | 2995 | { |
---|
2500 | 2996 | TextureVertices(); |
---|
2501 | 2997 | } else |
---|
2502 | | - if (event.getSource() == alignItem) |
---|
| 2998 | + if (source == alignItem) |
---|
2503 | 2999 | { |
---|
2504 | 3000 | Align(); |
---|
2505 | 3001 | } else |
---|
2506 | | - if (event.getSource() == mirrorItem) |
---|
| 3002 | + if (source == mirrorItem) |
---|
2507 | 3003 | { |
---|
2508 | 3004 | MirrorPoses(); |
---|
2509 | 3005 | } else |
---|
2510 | | - if (event.getSource() == reduceMorphItem) |
---|
| 3006 | + if (source == reduceMorphItem) |
---|
2511 | 3007 | { |
---|
2512 | 3008 | MeshReduction(false); |
---|
2513 | 3009 | } else |
---|
2514 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 3010 | + if (source == reduce34MorphItem) |
---|
2515 | 3011 | { |
---|
2516 | 3012 | MeshReduction(true); |
---|
2517 | 3013 | } else |
---|
2518 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 3014 | + if (source == reverseTrianglesItem) |
---|
2519 | 3015 | { |
---|
2520 | 3016 | ReverseTriangles(); |
---|
2521 | 3017 | } else |
---|
2522 | | - if (event.getSource() == reduceMeshItem) |
---|
| 3018 | + if (source == reduceMeshItem) |
---|
2523 | 3019 | { |
---|
2524 | 3020 | ReduceMesh(false); |
---|
2525 | 3021 | } else |
---|
2526 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 3022 | + if (source == reduce34MeshItem) |
---|
2527 | 3023 | { |
---|
2528 | 3024 | ReduceMesh(true); |
---|
2529 | 3025 | } else |
---|
2530 | | - if (event.getSource() == increaseMeshItem) |
---|
| 3026 | + if (source == increaseMeshItem) |
---|
2531 | 3027 | { |
---|
2532 | 3028 | IncreaseMesh(); |
---|
2533 | 3029 | } else |
---|
2534 | | - if (event.getSource() == clipMeshItem) |
---|
| 3030 | + if (source == clipMeshItem) |
---|
2535 | 3031 | { |
---|
2536 | 3032 | ClipMesh(); |
---|
2537 | 3033 | } else |
---|
2538 | | - if (event.getSource() == smoothMeshItem) |
---|
| 3034 | + if (source == smoothMeshItem) |
---|
2539 | 3035 | { |
---|
2540 | 3036 | SmoothMesh(); |
---|
2541 | 3037 | } else |
---|
2542 | | - if (event.getSource() == transformgeometryItem) |
---|
| 3038 | + if (source == transformGeometryItem) |
---|
2543 | 3039 | { |
---|
2544 | 3040 | TransformGeometry(); |
---|
2545 | 3041 | } else |
---|
2546 | | - if (event.getSource() == resetTransformItem) |
---|
| 3042 | + if (source == transformChildrenItem) |
---|
| 3043 | + { |
---|
| 3044 | + TransformChildren(); |
---|
| 3045 | + } else |
---|
| 3046 | + if (source == resetTransformItem) |
---|
2547 | 3047 | { |
---|
2548 | 3048 | ResetTransform(); |
---|
2549 | 3049 | } else |
---|
2550 | | - if (event.getSource() == resetCentroidItem) |
---|
| 3050 | + if (source == resetCentroidItem) |
---|
2551 | 3051 | { |
---|
2552 | | - ResetCentroid(); |
---|
| 3052 | + ResetCentroid(true); |
---|
2553 | 3053 | } else |
---|
2554 | | - if (event.getSource() == resetParentItem) |
---|
| 3054 | + if (source == resetCentroidXZItem) |
---|
| 3055 | + { |
---|
| 3056 | + ResetCentroid(false); |
---|
| 3057 | + } else |
---|
| 3058 | + if (source == resetParentItem) |
---|
2555 | 3059 | { |
---|
2556 | 3060 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2557 | 3061 | { |
---|
.. | .. |
---|
2561 | 3065 | |
---|
2562 | 3066 | refreshContents(); |
---|
2563 | 3067 | } else |
---|
2564 | | - if (event.getSource() == repairParentItem) |
---|
| 3068 | + if (source == repairParentItem) |
---|
2565 | 3069 | { |
---|
2566 | 3070 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2567 | 3071 | { |
---|
.. | .. |
---|
2575 | 3079 | |
---|
2576 | 3080 | refreshContents(); |
---|
2577 | 3081 | } else |
---|
2578 | | - if (event.getSource() == repairShadowItem) |
---|
| 3082 | + if (source == repairShadowItem) |
---|
2579 | 3083 | { |
---|
2580 | 3084 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2581 | 3085 | { |
---|
.. | .. |
---|
2589 | 3093 | |
---|
2590 | 3094 | refreshContents(); |
---|
2591 | 3095 | } else |
---|
2592 | | - if (event.getSource() == sortbysizeItem) |
---|
| 3096 | + if (source == sortbysizeItem) |
---|
2593 | 3097 | { |
---|
2594 | 3098 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2595 | 3099 | { |
---|
.. | .. |
---|
2601 | 3105 | ResetModel(); |
---|
2602 | 3106 | refreshContents(); |
---|
2603 | 3107 | } else |
---|
2604 | | - if (event.getSource() == sortbynameItem) |
---|
| 3108 | + if (source == sortbynameItem) |
---|
2605 | 3109 | { |
---|
2606 | 3110 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2607 | 3111 | { |
---|
.. | .. |
---|
2613 | 3117 | ResetModel(); |
---|
2614 | 3118 | refreshContents(); |
---|
2615 | 3119 | } else |
---|
2616 | | - if (event.getSource() == attachPigmentItem) |
---|
| 3120 | + if (source == attachPigmentItem) |
---|
2617 | 3121 | { |
---|
2618 | 3122 | String texture = GetFile("Attach pigment"); |
---|
2619 | 3123 | Object3D obj; |
---|
.. | .. |
---|
2625 | 3129 | |
---|
2626 | 3130 | refreshContents(); |
---|
2627 | 3131 | } else |
---|
2628 | | - if (event.getSource() == detachPigmentItem) |
---|
| 3132 | + if (source == detachPigmentItem) |
---|
2629 | 3133 | { |
---|
2630 | 3134 | Object3D obj; |
---|
2631 | 3135 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2636 | 3140 | |
---|
2637 | 3141 | refreshContents(); |
---|
2638 | 3142 | } else |
---|
2639 | | - if (event.getSource() == attachBumpItem) |
---|
| 3143 | + if (source == attachBumpItem) |
---|
2640 | 3144 | { |
---|
2641 | 3145 | String texture = GetFile("Attach bump"); |
---|
2642 | 3146 | Object3D obj; |
---|
.. | .. |
---|
2648 | 3152 | |
---|
2649 | 3153 | refreshContents(); |
---|
2650 | 3154 | } else |
---|
2651 | | - if (event.getSource() == detachBumpItem) |
---|
| 3155 | + if (source == detachBumpItem) |
---|
2652 | 3156 | { |
---|
2653 | 3157 | Object3D obj; |
---|
2654 | 3158 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2655 | 3159 | { |
---|
2656 | 3160 | obj = (Object3D)e.nextElement(); |
---|
2657 | | - obj.SetBumpTexture(null); |
---|
| 3161 | + obj.ResetBumpTexture(); |
---|
2658 | 3162 | } |
---|
2659 | 3163 | |
---|
2660 | 3164 | refreshContents(); |
---|
2661 | 3165 | } else |
---|
2662 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 3166 | + if (source == pigmentBumpItem) |
---|
2663 | 3167 | { |
---|
2664 | 3168 | Object3D obj; |
---|
2665 | 3169 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2670 | 3174 | |
---|
2671 | 3175 | refreshContents(); |
---|
2672 | 3176 | } else |
---|
2673 | | - if (event.getSource() == flashSelectionButton) |
---|
| 3177 | + if (source == embedTexturesItem) |
---|
| 3178 | + { |
---|
| 3179 | + Object3D obj; |
---|
| 3180 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3181 | + { |
---|
| 3182 | + obj = (Object3D)e.nextElement(); |
---|
| 3183 | + obj.EmbedTextures(true); |
---|
| 3184 | + } |
---|
| 3185 | + |
---|
| 3186 | + refreshContents(); |
---|
| 3187 | + } else |
---|
| 3188 | + if (source == deEmbedTexturesItem) |
---|
| 3189 | + { |
---|
| 3190 | + Object3D obj; |
---|
| 3191 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3192 | + { |
---|
| 3193 | + obj = (Object3D)e.nextElement(); |
---|
| 3194 | + obj.EmbedTextures(false); |
---|
| 3195 | + } |
---|
| 3196 | + |
---|
| 3197 | + CameraPane.texturepigment.clear(); |
---|
| 3198 | + CameraPane.texturebump.clear(); |
---|
| 3199 | + |
---|
| 3200 | + refreshContents(); |
---|
| 3201 | + } else |
---|
| 3202 | + if (source == flashSelectionButton) |
---|
2674 | 3203 | { |
---|
2675 | 3204 | CameraPane.flash = true; |
---|
2676 | 3205 | refreshContents(); |
---|
2677 | 3206 | } else |
---|
2678 | | - if (event.getSource() == oneButton) |
---|
| 3207 | + if (source == oneButton) |
---|
2679 | 3208 | { |
---|
2680 | 3209 | } else |
---|
2681 | | - if (event.getSource() == twoButton) |
---|
| 3210 | + if (source == twoButton) |
---|
2682 | 3211 | { |
---|
2683 | 3212 | radio.layout = twoButton; |
---|
| 3213 | + |
---|
| 3214 | + if (CameraPane.FULLSCREEN) |
---|
| 3215 | + fullscreenLayout = radio.layout; |
---|
| 3216 | + |
---|
2684 | 3217 | // bug |
---|
2685 | 3218 | //gridPanel.setDividerLocation(1.0); |
---|
2686 | 3219 | //bigPanel.setDividerLocation(0.0); |
---|
2687 | | - bigThree.remove(scenePanel); |
---|
2688 | | - bigThree.remove(centralPanel); |
---|
2689 | | - bigThree.remove(XYZPanel); |
---|
2690 | | - aWindowConstraints.gridx = 0; |
---|
2691 | | - aWindowConstraints.gridy = 0; |
---|
2692 | | - aWindowConstraints.gridwidth = 1; |
---|
2693 | | - // aConstraints.gridheight = 3; |
---|
2694 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2695 | | - aWindowConstraints.weightx = 0; |
---|
2696 | | - aWindowConstraints.weighty = 1; |
---|
2697 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2698 | | - aWindowConstraints.weightx = 1; |
---|
2699 | | - aWindowConstraints.gridwidth = 3; |
---|
2700 | | - // aConstraints.gridheight = 3; |
---|
2701 | | - aWindowConstraints.gridx = 1; |
---|
2702 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2703 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2704 | | - aWindowConstraints.weightx = 0; |
---|
2705 | | - aWindowConstraints.gridx = 4; |
---|
2706 | | - aWindowConstraints.gridwidth = 1; |
---|
2707 | | - // aConstraints.gridheight = 3; |
---|
2708 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2709 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2710 | | - bigThree.revalidate(); |
---|
| 3220 | +// bigThree.remove(scenePanel); |
---|
| 3221 | +// bigThree.remove(centralPanel); |
---|
| 3222 | +// bigThree.remove(XYZPanel); |
---|
| 3223 | +// aWindowConstraints.gridx = 0; |
---|
| 3224 | +// aWindowConstraints.gridy = 0; |
---|
| 3225 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3226 | +// // aConstraints.gridheight = 3; |
---|
| 3227 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3228 | +// aWindowConstraints.weightx = 0; |
---|
| 3229 | +// aWindowConstraints.weighty = 1; |
---|
| 3230 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3231 | +// aWindowConstraints.weightx = 1; |
---|
| 3232 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3233 | +// // aConstraints.gridheight = 3; |
---|
| 3234 | +// aWindowConstraints.gridx = 1; |
---|
| 3235 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3236 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3237 | +// aWindowConstraints.weightx = 0; |
---|
| 3238 | +// aWindowConstraints.gridx = 4; |
---|
| 3239 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3240 | +// // aConstraints.gridheight = 3; |
---|
| 3241 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3242 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3243 | +// scenePanel.setVisible(false); |
---|
| 3244 | +// centralPanel.setVisible(true); |
---|
| 3245 | +// XYZPanel.setVisible(false); |
---|
| 3246 | + bigThree.ClearUI(); |
---|
| 3247 | + bigThree.add(centralPanel); |
---|
| 3248 | + bigThree.FlushUI(); |
---|
| 3249 | + |
---|
| 3250 | + cameraView.requestFocusInWindow(); |
---|
| 3251 | + |
---|
| 3252 | +// refreshContents(true); |
---|
| 3253 | +// |
---|
| 3254 | +// try |
---|
| 3255 | +// { |
---|
| 3256 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3257 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3258 | +// bot.mouseMove(100, 100); |
---|
| 3259 | +// bot.mousePress(mask); |
---|
| 3260 | +// bot.mouseRelease(mask); |
---|
| 3261 | +// } |
---|
| 3262 | +// catch (Exception e) |
---|
| 3263 | +// { |
---|
| 3264 | +// |
---|
| 3265 | +// } |
---|
| 3266 | + |
---|
2711 | 3267 | } else |
---|
2712 | | - if (event.getSource() == threeButton) |
---|
| 3268 | + if (source == threeButton) |
---|
2713 | 3269 | { |
---|
2714 | 3270 | radio.layout = threeButton; |
---|
2715 | | - bigThree.remove(scenePanel); |
---|
2716 | | - bigThree.remove(centralPanel); |
---|
2717 | | - bigThree.remove(XYZPanel); |
---|
2718 | | - aWindowConstraints.gridx = 0; |
---|
2719 | | - aWindowConstraints.gridy = 0; |
---|
2720 | | - aWindowConstraints.gridwidth = 1; |
---|
2721 | | - // aConstraints.gridheight = 3; |
---|
2722 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2723 | | - aWindowConstraints.weightx = 0; |
---|
2724 | | - aWindowConstraints.weighty = 1; |
---|
2725 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2726 | | - aWindowConstraints.weightx = 1; |
---|
2727 | | - aWindowConstraints.gridwidth = 3; |
---|
2728 | | - // aConstraints.gridheight = 3; |
---|
2729 | | - aWindowConstraints.gridx = 1; |
---|
2730 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2731 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2732 | | - aWindowConstraints.weightx = 0; |
---|
2733 | | - aWindowConstraints.gridx = 4; |
---|
2734 | | - aWindowConstraints.gridwidth = 1; |
---|
2735 | | - // aConstraints.gridheight = 3; |
---|
2736 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2737 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2738 | | - bigThree.revalidate(); |
---|
| 3271 | + |
---|
| 3272 | + if (CameraPane.FULLSCREEN) |
---|
| 3273 | + fullscreenLayout = radio.layout; |
---|
| 3274 | + |
---|
| 3275 | +// bigThree.remove(scenePanel); |
---|
| 3276 | +// bigThree.remove(centralPanel); |
---|
| 3277 | +// bigThree.remove(XYZPanel); |
---|
| 3278 | +// aWindowConstraints.gridx = 0; |
---|
| 3279 | +// aWindowConstraints.gridy = 0; |
---|
| 3280 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3281 | +// // aConstraints.gridheight = 3; |
---|
| 3282 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3283 | +// aWindowConstraints.weightx = 0; |
---|
| 3284 | +// aWindowConstraints.weighty = 1; |
---|
| 3285 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3286 | +// aWindowConstraints.weightx = 1; |
---|
| 3287 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3288 | +// // aConstraints.gridheight = 3; |
---|
| 3289 | +// aWindowConstraints.gridx = 1; |
---|
| 3290 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3291 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3292 | +// aWindowConstraints.weightx = 0; |
---|
| 3293 | +// aWindowConstraints.gridx = 4; |
---|
| 3294 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3295 | +// // aConstraints.gridheight = 3; |
---|
| 3296 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3297 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3298 | +// bigThree.validate(); |
---|
| 3299 | +// scenePanel.setVisible(false); |
---|
| 3300 | +// centralPanel.setVisible(true); |
---|
| 3301 | +// XYZPanel.setVisible(true); |
---|
| 3302 | + bigThree.ClearUI(); |
---|
| 3303 | + bigThree.add(scenePanel); |
---|
| 3304 | + bigThree.add(centralPanel); |
---|
| 3305 | + bigThree.FlushUI(); |
---|
| 3306 | + |
---|
| 3307 | + cameraView.requestFocusInWindow(); |
---|
2739 | 3308 | } else |
---|
2740 | | - if (event.getSource() == fourButton) |
---|
| 3309 | + if (source == fourButton) |
---|
2741 | 3310 | { |
---|
2742 | 3311 | radio.layout = fourButton; |
---|
2743 | | - bigThree.remove(scenePanel); |
---|
2744 | | - bigThree.remove(centralPanel); |
---|
2745 | | - bigThree.remove(XYZPanel); |
---|
2746 | | - aWindowConstraints.gridx = 0; |
---|
2747 | | - aWindowConstraints.gridy = 0; |
---|
2748 | | - aWindowConstraints.gridwidth = 1; |
---|
2749 | | - // aWindowConstraints.gridheight = 3; |
---|
2750 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2751 | | - aWindowConstraints.weightx = 1; |
---|
2752 | | - aWindowConstraints.weighty = 1; |
---|
2753 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2754 | | - aWindowConstraints.weightx = 1; |
---|
2755 | | - aWindowConstraints.gridwidth = 3; |
---|
2756 | | - // aConstraints.gridheight = 3; |
---|
2757 | | - aWindowConstraints.gridx = 1; |
---|
2758 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2759 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2760 | | - aWindowConstraints.weightx = 0; |
---|
2761 | | - aWindowConstraints.gridx = 4; |
---|
2762 | | - aWindowConstraints.gridwidth = 1; |
---|
2763 | | - // aWindowConstraints.gridheight = 3; |
---|
2764 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2765 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2766 | | - bigThree.revalidate(); |
---|
| 3312 | + |
---|
| 3313 | + if (CameraPane.FULLSCREEN) |
---|
| 3314 | + fullscreenLayout = radio.layout; |
---|
| 3315 | + |
---|
| 3316 | +// bigThree.remove(scenePanel); |
---|
| 3317 | +// bigThree.remove(centralPanel); |
---|
| 3318 | +// bigThree.remove(XYZPanel); |
---|
| 3319 | +// aWindowConstraints.gridx = 0; |
---|
| 3320 | +// aWindowConstraints.gridy = 0; |
---|
| 3321 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3322 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3323 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3324 | +// aWindowConstraints.weightx = 1; |
---|
| 3325 | +// aWindowConstraints.weighty = 1; |
---|
| 3326 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3327 | +// aWindowConstraints.weightx = 1; |
---|
| 3328 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3329 | +// // aConstraints.gridheight = 3; |
---|
| 3330 | +// aWindowConstraints.gridx = 1; |
---|
| 3331 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3332 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3333 | +// aWindowConstraints.weightx = 0; |
---|
| 3334 | +// aWindowConstraints.gridx = 4; |
---|
| 3335 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3336 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3337 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3338 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3339 | +// bigThree.validate(); |
---|
| 3340 | +// scenePanel.setVisible(true); |
---|
| 3341 | +// centralPanel.setVisible(false); |
---|
| 3342 | +// XYZPanel.setVisible(false); |
---|
| 3343 | + bigThree.ClearUI(); |
---|
| 3344 | + bigThree.add(scenePanel); |
---|
| 3345 | + bigThree.FlushUI(); |
---|
| 3346 | + |
---|
| 3347 | + cameraView.requestFocusInWindow(); |
---|
2767 | 3348 | } else |
---|
2768 | | - if (event.getSource() == sixButton) |
---|
| 3349 | + if (source == sixButton) |
---|
2769 | 3350 | { |
---|
2770 | 3351 | radio.layout = sixButton; |
---|
2771 | | - bigThree.remove(scenePanel); |
---|
2772 | | - bigThree.remove(centralPanel); |
---|
2773 | | - bigThree.remove(XYZPanel); |
---|
2774 | | - aWindowConstraints.gridx = 0; |
---|
2775 | | - aWindowConstraints.gridy = 0; |
---|
2776 | | - aWindowConstraints.gridwidth = 1; |
---|
2777 | | - // aConstraints.gridheight = 3; |
---|
2778 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2779 | | - aWindowConstraints.weightx = 0; |
---|
2780 | | - aWindowConstraints.weighty = 1; |
---|
2781 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2782 | | - aWindowConstraints.weightx = 1; |
---|
2783 | | - aWindowConstraints.gridwidth = 3; |
---|
2784 | | - // aWindowConstraints.gridheight = 3; |
---|
2785 | | - aWindowConstraints.gridx = 1; |
---|
2786 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2787 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2788 | | - aWindowConstraints.weightx = 0; |
---|
2789 | | - aWindowConstraints.gridx = 4; |
---|
2790 | | - aWindowConstraints.gridwidth = 1; |
---|
2791 | | - // aWindowConstraints.gridheight = 3; |
---|
2792 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2793 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2794 | | - bigThree.revalidate(); |
---|
| 3352 | + |
---|
| 3353 | + if (CameraPane.FULLSCREEN) |
---|
| 3354 | + fullscreenLayout = radio.layout; |
---|
| 3355 | + |
---|
| 3356 | +// bigThree.remove(scenePanel); |
---|
| 3357 | +// bigThree.remove(centralPanel); |
---|
| 3358 | +// bigThree.remove(XYZPanel); |
---|
| 3359 | +// aWindowConstraints.gridx = 0; |
---|
| 3360 | +// aWindowConstraints.gridy = 0; |
---|
| 3361 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3362 | +// // aConstraints.gridheight = 3; |
---|
| 3363 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3364 | +// aWindowConstraints.weightx = 0; |
---|
| 3365 | +// aWindowConstraints.weighty = 1; |
---|
| 3366 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3367 | +// aWindowConstraints.weightx = 1; |
---|
| 3368 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3369 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3370 | +// aWindowConstraints.gridx = 1; |
---|
| 3371 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3372 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3373 | +// aWindowConstraints.weightx = 0; |
---|
| 3374 | +// aWindowConstraints.gridx = 4; |
---|
| 3375 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3376 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3377 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3378 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3379 | +// bigThree.validate(); |
---|
| 3380 | +// scenePanel.setVisible(true); |
---|
| 3381 | +// centralPanel.setVisible(true); |
---|
| 3382 | +// XYZPanel.setVisible(false); |
---|
| 3383 | + bigThree.ClearUI(); |
---|
| 3384 | + bigThree.add(centralPanel); |
---|
| 3385 | + bigThree.add(scenePanel); |
---|
| 3386 | + bigThree.FlushUI(); |
---|
| 3387 | + |
---|
| 3388 | + cameraView.requestFocusInWindow(); |
---|
2795 | 3389 | } else |
---|
2796 | | - if (event.getSource() == sevenButton) |
---|
| 3390 | + if (source == sevenButton) |
---|
2797 | 3391 | { |
---|
2798 | 3392 | radio.layout = sevenButton; |
---|
2799 | | - bigThree.remove(scenePanel); |
---|
2800 | | - bigThree.remove(centralPanel); |
---|
2801 | | - bigThree.remove(XYZPanel); |
---|
2802 | | - aWindowConstraints.gridx = 0; |
---|
2803 | | - aWindowConstraints.gridy = 0; |
---|
2804 | | - aWindowConstraints.gridwidth = 1; |
---|
2805 | | - // aWindowConstraints.gridheight = 3; |
---|
2806 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2807 | | - aWindowConstraints.weightx = 0; |
---|
2808 | | - aWindowConstraints.weighty = 1; |
---|
2809 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2810 | | - aWindowConstraints.weightx = 1; |
---|
2811 | | - aWindowConstraints.gridwidth = 3; |
---|
2812 | | - // aWindowConstraints.gridheight = 3; |
---|
2813 | | - aWindowConstraints.gridx = 1; |
---|
2814 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2815 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2816 | | - aWindowConstraints.weightx = 0; |
---|
2817 | | - aWindowConstraints.gridx = 4; |
---|
2818 | | - aWindowConstraints.gridwidth = 1; |
---|
2819 | | - // aConstraints.gridheight = 3; |
---|
2820 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2821 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2822 | | - bigThree.revalidate(); |
---|
| 3393 | + |
---|
| 3394 | + if (CameraPane.FULLSCREEN) |
---|
| 3395 | + fullscreenLayout = radio.layout; |
---|
| 3396 | + |
---|
| 3397 | +// bigThree.remove(scenePanel); |
---|
| 3398 | +// bigThree.remove(centralPanel); |
---|
| 3399 | +// bigThree.remove(XYZPanel); |
---|
| 3400 | +// aWindowConstraints.gridx = 0; |
---|
| 3401 | +// aWindowConstraints.gridy = 0; |
---|
| 3402 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3403 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3404 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3405 | +// aWindowConstraints.weightx = 0; |
---|
| 3406 | +// aWindowConstraints.weighty = 1; |
---|
| 3407 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3408 | +// aWindowConstraints.weightx = 1; |
---|
| 3409 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3410 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3411 | +// aWindowConstraints.gridx = 1; |
---|
| 3412 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3413 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3414 | +// aWindowConstraints.weightx = 0; |
---|
| 3415 | +// aWindowConstraints.gridx = 4; |
---|
| 3416 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3417 | +// // aConstraints.gridheight = 3; |
---|
| 3418 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3419 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3420 | +// bigThree.validate(); |
---|
| 3421 | +// scenePanel.setVisible(true); |
---|
| 3422 | +// centralPanel.setVisible(true); |
---|
| 3423 | +// XYZPanel.setVisible(true); |
---|
| 3424 | + bigThree.ClearUI(); |
---|
| 3425 | + bigThree.add(scenePanel); |
---|
| 3426 | + bigThree.add(centralPanel); |
---|
| 3427 | + bigThree.add(XYZPanel); |
---|
| 3428 | + bigThree.FlushUI(); |
---|
| 3429 | + |
---|
| 3430 | + cameraView.requestFocusInWindow(); |
---|
2823 | 3431 | } else |
---|
2824 | | - if (event.getSource() == rootButton) |
---|
| 3432 | + if (source == rootButton) |
---|
2825 | 3433 | { |
---|
2826 | 3434 | Object3D obj; |
---|
2827 | 3435 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2831 | 3439 | EditObject(obj); |
---|
2832 | 3440 | } |
---|
2833 | 3441 | |
---|
| 3442 | + cameraView.requestFocusInWindow(); |
---|
2834 | 3443 | refreshContents(true); |
---|
2835 | 3444 | } else |
---|
2836 | | - if (event.getSource() == closeButton) |
---|
| 3445 | + if (source == closeButton) |
---|
2837 | 3446 | { |
---|
2838 | 3447 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2839 | 3448 | cRadio ab; |
---|
2840 | 3449 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2841 | 3450 | { |
---|
2842 | 3451 | ab = (cRadio)e.nextElement(); |
---|
2843 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3452 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2844 | 3453 | { |
---|
| 3454 | + // Patch to avoid bug with transparency. |
---|
| 3455 | + if (!ab.hadMaterial) |
---|
| 3456 | + { |
---|
| 3457 | + ab.object.material = null; |
---|
| 3458 | + } |
---|
| 3459 | + |
---|
2845 | 3460 | buttonGroup.remove(ab); |
---|
2846 | 3461 | radioPanel.remove(ab); |
---|
2847 | 3462 | |
---|
2848 | | - ab.GetObject().editWindow = null; |
---|
| 3463 | + //ab.GetObject().editWindow = null; |
---|
| 3464 | + ab.GetObject().manipWindow = null; |
---|
2849 | 3465 | // ab.GetObject().objectUI = null; // ????????? |
---|
2850 | 3466 | |
---|
2851 | 3467 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2852 | 3468 | break; |
---|
2853 | 3469 | } |
---|
2854 | 3470 | } |
---|
| 3471 | + |
---|
| 3472 | + cameraView.requestFocusInWindow(); |
---|
2855 | 3473 | refreshContents(true); |
---|
2856 | 3474 | } else |
---|
2857 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3475 | + if (source == editItem || source == editButton) |
---|
2858 | 3476 | { |
---|
| 3477 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3478 | + { |
---|
| 3479 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3480 | + child.pinned = true; |
---|
| 3481 | + } |
---|
| 3482 | + |
---|
2859 | 3483 | EditSelection(false); |
---|
2860 | 3484 | } else |
---|
2861 | | - if (event.getSource() == uneditButton) |
---|
| 3485 | + if (source == uneditButton) |
---|
2862 | 3486 | { |
---|
2863 | 3487 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2864 | 3488 | { |
---|
2865 | 3489 | Object3D child = (Object3D)e.nextElement(); |
---|
2866 | 3490 | if(child.editWindow != null) |
---|
2867 | 3491 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3492 | + child.pinned = false; |
---|
2868 | 3493 | child.CloseUI(); |
---|
2869 | 3494 | listUI.remove(child); |
---|
2870 | 3495 | |
---|
2871 | | - child.editWindow = null; // ??????????? |
---|
| 3496 | + //child.editWindow = null; // ??????????? |
---|
2872 | 3497 | } |
---|
2873 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3498 | + objEditor.ctrlPanel.FlushUI(); |
---|
2874 | 3499 | //objEditor.jTree.clearSelection(); |
---|
2875 | 3500 | //objEditor.ResetSliders(); |
---|
2876 | 3501 | refreshContents(true); |
---|
2877 | 3502 | } else |
---|
2878 | | - if (event.getSource() == clearPanelButton) |
---|
| 3503 | + if (source == clearPanelButton) |
---|
2879 | 3504 | { |
---|
2880 | 3505 | assert(copy == group); |
---|
2881 | 3506 | //copy.ClearUI(); |
---|
2882 | 3507 | for (Object3D obj : listUI) |
---|
2883 | 3508 | { |
---|
| 3509 | + obj.pinned = false; |
---|
2884 | 3510 | obj.CloseUI(); |
---|
2885 | 3511 | } |
---|
2886 | 3512 | listUI.clear(); |
---|
2887 | 3513 | refreshContents(true); |
---|
2888 | 3514 | } else |
---|
2889 | | - if (event.getSource() == allParamsButton) |
---|
| 3515 | + if (source == allParamsButton) |
---|
2890 | 3516 | { |
---|
2891 | 3517 | assert(copy == group); |
---|
2892 | 3518 | |
---|
2893 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3519 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2894 | 3520 | |
---|
2895 | 3521 | for (Object3D obj : listUI) |
---|
2896 | 3522 | { |
---|
.. | .. |
---|
2907 | 3533 | |
---|
2908 | 3534 | refreshContents(true); |
---|
2909 | 3535 | } else |
---|
2910 | | - if (event.getSource() == unselectButton) |
---|
| 3536 | + if (source == unselectButton) |
---|
2911 | 3537 | { |
---|
2912 | 3538 | objEditor.jTree.clearSelection(); |
---|
2913 | 3539 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2914 | 3540 | objEditor.ResetSliders(); |
---|
2915 | 3541 | refreshContents(true); |
---|
2916 | 3542 | } else |
---|
2917 | | - if(event.getSource() instanceof cRadio) |
---|
| 3543 | + if(source instanceof cRadio) |
---|
2918 | 3544 | { |
---|
2919 | 3545 | group.parent = keepparent; |
---|
2920 | 3546 | group.attributes = 0; |
---|
2921 | 3547 | //group.editWindow = null; |
---|
2922 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3548 | + /*cRadio*/ radio = (cRadio)source; |
---|
2923 | 3549 | Object3D obj = radio.GetObject(); |
---|
2924 | 3550 | System.out.println("Edit " + obj); |
---|
2925 | 3551 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2939 | 3565 | } |
---|
2940 | 3566 | |
---|
2941 | 3567 | copy = group; |
---|
| 3568 | + |
---|
| 3569 | + SetUndoStates(); |
---|
| 3570 | + |
---|
2942 | 3571 | //Globals.theRenderer.object = group; |
---|
2943 | 3572 | if(!useclient) |
---|
2944 | 3573 | { |
---|
.. | .. |
---|
2954 | 3583 | frontView.object = group; |
---|
2955 | 3584 | sideView.object = group; |
---|
2956 | 3585 | } |
---|
2957 | | - group.editWindow = this; |
---|
| 3586 | + |
---|
| 3587 | +// fix "+" issue |
---|
| 3588 | + //group.editWindow = this; |
---|
| 3589 | + group.manipWindow = this; |
---|
| 3590 | + |
---|
2958 | 3591 | /* |
---|
2959 | 3592 | currentLayout = radio.layout; |
---|
2960 | 3593 | if (currentLayout == null) |
---|
2961 | 3594 | currentLayout = sevenButton; |
---|
2962 | 3595 | */ |
---|
2963 | 3596 | radio.layout.doClick(); |
---|
| 3597 | + |
---|
| 3598 | + ClearUnpinned(); |
---|
| 3599 | + //Grafreed.Assert(group != null); |
---|
| 3600 | + //Grafreed.Assert(group.selection != null); |
---|
| 3601 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3602 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3603 | + EditSelection(false); |
---|
2964 | 3604 | keepparent = group.parent; |
---|
2965 | 3605 | // PARENT = NULL or not??? |
---|
2966 | 3606 | //group.parent = null; // ROOT |
---|
2967 | 3607 | //group.attributes = -1; |
---|
2968 | 3608 | ResetModel(); |
---|
| 3609 | + |
---|
| 3610 | + cameraView.requestFocusInWindow(); |
---|
2969 | 3611 | refreshContents(true); |
---|
2970 | | - } |
---|
| 3612 | + } else if (event.getSource() == editCameraItem) |
---|
| 3613 | + { |
---|
| 3614 | + cameraView.ProtectCamera(); |
---|
| 3615 | + cameraView.repaint(); |
---|
| 3616 | + return; |
---|
| 3617 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3618 | + { |
---|
| 3619 | + cameraView.RevertCamera(); |
---|
| 3620 | + cameraView.repaint(); |
---|
| 3621 | + return; |
---|
| 3622 | + // } else if (event.getSource() == textureButton) |
---|
| 3623 | + // { |
---|
| 3624 | + // return; // true; |
---|
| 3625 | + } |
---|
2971 | 3626 | else |
---|
2972 | 3627 | { |
---|
2973 | 3628 | //return super.action(event, arg); |
---|
.. | .. |
---|
2976 | 3631 | } |
---|
2977 | 3632 | |
---|
2978 | 3633 | boolean useclient = false; |
---|
2979 | | - cRadio radio; |
---|
2980 | 3634 | |
---|
2981 | 3635 | void ToggleRoot() |
---|
2982 | 3636 | { |
---|
.. | .. |
---|
3028 | 3682 | refreshContents(); |
---|
3029 | 3683 | } |
---|
3030 | 3684 | |
---|
| 3685 | + void TransformChildren() |
---|
| 3686 | + { |
---|
| 3687 | + Object3D obj; |
---|
| 3688 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3689 | + { |
---|
| 3690 | + obj = (Object3D)e.nextElement(); |
---|
| 3691 | + obj.KeepTextureMatrices(); |
---|
| 3692 | + obj.TransformChildren(); |
---|
| 3693 | + obj.RestoreTextureMatrices(); |
---|
| 3694 | + |
---|
| 3695 | +// if (obj.parent == null) |
---|
| 3696 | +// { |
---|
| 3697 | +// System.out.println("NULL PARENT!"); |
---|
| 3698 | +// new Exception().printStackTrace(); |
---|
| 3699 | +// } |
---|
| 3700 | +// else |
---|
| 3701 | +// TouchTransform(obj); |
---|
| 3702 | +// //obj.parent.Touch(); |
---|
| 3703 | + } |
---|
| 3704 | + |
---|
| 3705 | + refreshContents(); |
---|
| 3706 | + } |
---|
3031 | 3707 | |
---|
3032 | 3708 | void ResetTransform() |
---|
3033 | 3709 | { |
---|
.. | .. |
---|
3140 | 3816 | refreshContents(); |
---|
3141 | 3817 | } |
---|
3142 | 3818 | |
---|
3143 | | - void ResetCentroid() |
---|
| 3819 | + void ResetCentroid(boolean full) |
---|
3144 | 3820 | { |
---|
3145 | 3821 | Object3D obj; |
---|
3146 | 3822 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3155 | 3831 | LA.matIdentity(Object3D.mat); |
---|
3156 | 3832 | obj.getBounds(minima, maxima, false); |
---|
3157 | 3833 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3158 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 3834 | + if (full) |
---|
| 3835 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3159 | 3836 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3160 | 3837 | obj.TransformMesh(Object3D.mat); |
---|
| 3838 | + |
---|
3161 | 3839 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3162 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 3840 | + if (full) |
---|
| 3841 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3163 | 3842 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 3843 | + |
---|
3164 | 3844 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3165 | 3845 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3166 | 3846 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3189 | 3869 | |
---|
3190 | 3870 | int size = obj.MemorySize(); |
---|
3191 | 3871 | |
---|
3192 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3872 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 3873 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3193 | 3874 | } |
---|
3194 | 3875 | } |
---|
3195 | 3876 | catch (Exception e) |
---|
.. | .. |
---|
3226 | 3907 | obj = (Object3D)e.nextElement(); |
---|
3227 | 3908 | |
---|
3228 | 3909 | System.out.println("Object is: " + obj); |
---|
3229 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 3910 | + Grafreed.AnalyzeObject(obj); |
---|
3230 | 3911 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3231 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 3912 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3232 | 3913 | |
---|
3233 | 3914 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3234 | 3915 | } |
---|
.. | .. |
---|
3270 | 3951 | void GenNormals(boolean crease) |
---|
3271 | 3952 | { |
---|
3272 | 3953 | group.GenNormalsS(crease); |
---|
| 3954 | + |
---|
| 3955 | + refreshContents(); |
---|
| 3956 | + } |
---|
| 3957 | + |
---|
| 3958 | + void GenNormalsMESH() |
---|
| 3959 | + { |
---|
| 3960 | + group.GenNormalsMeshS(); |
---|
3273 | 3961 | |
---|
3274 | 3962 | refreshContents(); |
---|
3275 | 3963 | } |
---|
.. | .. |
---|
3442 | 4130 | |
---|
3443 | 4131 | void ParseVertices() |
---|
3444 | 4132 | { |
---|
3445 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3446 | | - GrafreeD.epsequal = true; |
---|
| 4133 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4134 | + Grafreed.epsequal = true; |
---|
3447 | 4135 | |
---|
3448 | 4136 | for (int i=0; i<group.selection.size(); i++) |
---|
3449 | 4137 | { |
---|
.. | .. |
---|
3468 | 4156 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3469 | 4157 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3470 | 4158 | |
---|
3471 | | - g.add(GrafreeD.clipboard); |
---|
| 4159 | + g.add(Grafreed.clipboard); |
---|
3472 | 4160 | |
---|
3473 | 4161 | buffer.add(g); |
---|
3474 | 4162 | } |
---|
.. | .. |
---|
3483 | 4171 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3484 | 4172 | } |
---|
3485 | 4173 | |
---|
3486 | | - GrafreeD.epsequal = epsequal; |
---|
| 4174 | + Grafreed.epsequal = epsequal; |
---|
3487 | 4175 | |
---|
3488 | 4176 | refreshContents(); |
---|
3489 | 4177 | } |
---|
.. | .. |
---|
3501 | 4189 | String pigment = Object3D.GetPigment(tex); |
---|
3502 | 4190 | //String bump = Object3D.GetBump(tex); |
---|
3503 | 4191 | |
---|
3504 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4192 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4193 | + |
---|
| 4194 | + try |
---|
| 4195 | + { |
---|
| 4196 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
| 4197 | + } |
---|
| 4198 | + catch (Exception e) |
---|
| 4199 | + { |
---|
| 4200 | + System.err.println("FAIL: " + node); |
---|
| 4201 | + } |
---|
3505 | 4202 | |
---|
3506 | 4203 | double s = v.s; |
---|
3507 | 4204 | |
---|
.. | .. |
---|
3589 | 4286 | |
---|
3590 | 4287 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3591 | 4288 | |
---|
3592 | | - boolean random = CameraPane.RANDOM; |
---|
3593 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4289 | + boolean random = CameraPane.SWITCH; |
---|
| 4290 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3594 | 4291 | lowres.linkVerticesThis(null); |
---|
3595 | 4292 | lowres.linkVerticesThis(sn); |
---|
3596 | | - CameraPane.RANDOM = random; |
---|
| 4293 | + CameraPane.SWITCH = random; |
---|
3597 | 4294 | |
---|
3598 | 4295 | System.err.flush(); |
---|
3599 | 4296 | |
---|
.. | .. |
---|
3633 | 4330 | return; |
---|
3634 | 4331 | |
---|
3635 | 4332 | Object3D poses = group.selection.get(0); |
---|
3636 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4333 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3637 | 4334 | |
---|
3638 | 4335 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3639 | 4336 | |
---|
.. | .. |
---|
3827 | 4524 | |
---|
3828 | 4525 | void ClipMesh() |
---|
3829 | 4526 | { |
---|
3830 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4527 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3831 | 4528 | { |
---|
3832 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4529 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3833 | 4530 | |
---|
3834 | 4531 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3835 | 4532 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3838 | 4535 | // { |
---|
3839 | 4536 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3840 | 4537 | // } |
---|
3841 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4538 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3842 | 4539 | } |
---|
3843 | 4540 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3844 | 4541 | System.out.println("DONE."); |
---|
.. | .. |
---|
3885 | 4582 | void MarkLeaves(boolean hide) |
---|
3886 | 4583 | { |
---|
3887 | 4584 | group.selection.MarkLeaves(hide); |
---|
| 4585 | + refreshContents(); |
---|
| 4586 | + } |
---|
| 4587 | + |
---|
| 4588 | + void RewindLeaves(boolean hide) |
---|
| 4589 | + { |
---|
| 4590 | + group.selection.RewindLeaves(hide); |
---|
| 4591 | + refreshContents(); |
---|
| 4592 | + } |
---|
| 4593 | + |
---|
| 4594 | + void RandomLeaves(boolean hide) |
---|
| 4595 | + { |
---|
| 4596 | + group.selection.RandomLeaves(hide); |
---|
3888 | 4597 | refreshContents(); |
---|
3889 | 4598 | } |
---|
3890 | 4599 | |
---|
.. | .. |
---|
3959 | 4668 | // } |
---|
3960 | 4669 | // } |
---|
3961 | 4670 | |
---|
3962 | | - static boolean allparams = true; |
---|
3963 | | - |
---|
3964 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
3965 | | - |
---|
3966 | 4671 | void EditSelection(boolean newWindow) |
---|
3967 | 4672 | { |
---|
| 4673 | + if (group.selection == null) |
---|
| 4674 | + { |
---|
| 4675 | + EditElement(group, newWindow); // ? new |
---|
| 4676 | + return; |
---|
| 4677 | + } |
---|
| 4678 | + |
---|
3968 | 4679 | // aConstraints.gridy = 0; |
---|
3969 | 4680 | for (int i=0; i<group.selection.size(); i++) |
---|
3970 | 4681 | { |
---|
3971 | 4682 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
3972 | 4683 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
3973 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 4684 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3974 | 4685 | |
---|
3975 | 4686 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3976 | | - if(elem != group) |
---|
| 4687 | + if(elem != group || !newWindow) |
---|
3977 | 4688 | { |
---|
3978 | | - // if (!(elem instanceof Composite)) |
---|
3979 | | - // newWindow = false; |
---|
3980 | | - listUI.add(elem); |
---|
3981 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
3982 | | - System.out.println("edit : " + elem); |
---|
3983 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4689 | + EditElement(elem, newWindow); // ? new |
---|
3984 | 4690 | } |
---|
3985 | 4691 | } |
---|
3986 | 4692 | } |
---|
.. | .. |
---|
4055 | 4761 | //new Exception().printStackTrace(); |
---|
4056 | 4762 | |
---|
4057 | 4763 | freezemodel = true; |
---|
4058 | | - |
---|
| 4764 | + ClearUnpinned(); |
---|
| 4765 | + |
---|
4059 | 4766 | /**/ |
---|
4060 | 4767 | //switch (event.id) |
---|
4061 | 4768 | { |
---|
.. | .. |
---|
4063 | 4770 | //case 702: // Event.LIST_DESELECT |
---|
4064 | 4771 | group.deselectAll(); |
---|
4065 | 4772 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4066 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4067 | 4773 | if (tps != null) |
---|
4068 | 4774 | { |
---|
4069 | 4775 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4072 | 4778 | |
---|
4073 | 4779 | //if (child.parent != null) |
---|
4074 | 4780 | //child.parent.addSelectee(child); |
---|
| 4781 | + objEditor.SetMaterial(child); |
---|
4075 | 4782 | group.addSelectee(child); |
---|
4076 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4077 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4078 | | - System.err.println("info : " + child.GetPath()); |
---|
4079 | 4783 | } |
---|
4080 | 4784 | } |
---|
4081 | | - else |
---|
4082 | | - { |
---|
4083 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4084 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4085 | | - System.err.println("info : " + group.GetPath()); |
---|
4086 | | - } |
---|
| 4785 | +// else |
---|
| 4786 | +// { |
---|
| 4787 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 4788 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 4789 | +// System.err.println("info : " + group.GetPath()); |
---|
| 4790 | +// } |
---|
4087 | 4791 | |
---|
4088 | | - objEditor.SetText(); // jan 2014 |
---|
4089 | | - |
---|
4090 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 4792 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4091 | 4793 | CameraPane.flash = true; |
---|
4092 | 4794 | |
---|
4093 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 4795 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4094 | 4796 | // a camera |
---|
4095 | 4797 | { |
---|
4096 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4097 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4798 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 4799 | + { |
---|
| 4800 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 4801 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 4802 | + } |
---|
4098 | 4803 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4099 | 4804 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4100 | 4805 | } |
---|
4101 | 4806 | |
---|
| 4807 | + if (tps != null && tps.length == 1) |
---|
| 4808 | + { |
---|
| 4809 | + EditSelection(false); |
---|
| 4810 | + } |
---|
| 4811 | + |
---|
| 4812 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 4813 | + |
---|
4102 | 4814 | refreshContents(); |
---|
4103 | 4815 | //return true; |
---|
4104 | 4816 | } |
---|
.. | .. |
---|
4107 | 4819 | |
---|
4108 | 4820 | freezemodel = false; |
---|
4109 | 4821 | } |
---|
| 4822 | + |
---|
| 4823 | + void SetPinStates(boolean enabled) |
---|
| 4824 | + { |
---|
| 4825 | + editButton.setEnabled(enabled); |
---|
| 4826 | + uneditButton.setEnabled(enabled); |
---|
| 4827 | + unselectButton.setEnabled(enabled); |
---|
| 4828 | + flashSelectionButton.setEnabled(enabled); |
---|
| 4829 | + } |
---|
| 4830 | + |
---|
| 4831 | + void refreshContents(boolean cp) |
---|
| 4832 | + { |
---|
| 4833 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 4834 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 4835 | + { |
---|
| 4836 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 4837 | + |
---|
| 4838 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 4839 | + { |
---|
| 4840 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 4841 | + |
---|
| 4842 | + objEditor.AddInfo(child, this, true); |
---|
| 4843 | + System.err.println("info : " + child.GetPath()); |
---|
| 4844 | + } |
---|
| 4845 | + |
---|
| 4846 | + objEditor.SetText(); // jan 2014 |
---|
| 4847 | + } |
---|
| 4848 | + |
---|
| 4849 | + super.refreshContents(cp); |
---|
| 4850 | + } |
---|
4110 | 4851 | |
---|
4111 | 4852 | void linkSomething(Object3D thing) |
---|
4112 | 4853 | { |
---|
.. | .. |
---|
4178 | 4919 | { |
---|
4179 | 4920 | if (group.selection.isEmpty()) |
---|
4180 | 4921 | return; |
---|
4181 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 4922 | + |
---|
| 4923 | + Grafreed.clipboardIsTempGroup = false; |
---|
4182 | 4924 | Composite tGroup = null; |
---|
4183 | 4925 | if (group.selection.size() > 0) // 1) |
---|
4184 | 4926 | { |
---|
4185 | 4927 | tGroup = new cGroup(); |
---|
4186 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 4928 | + Grafreed.clipboardIsTempGroup = true; |
---|
4187 | 4929 | } |
---|
4188 | 4930 | |
---|
4189 | 4931 | if (cut) |
---|
4190 | 4932 | { |
---|
| 4933 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 4934 | +// Save(); |
---|
4191 | 4935 | //int indices[] = jList.getSelectedIndices(); |
---|
4192 | 4936 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4193 | 4937 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4223 | 4967 | //System.out.println("cut " + child); |
---|
4224 | 4968 | //System.out.println("parent = " + child.parent); |
---|
4225 | 4969 | // tmp.addChild(child); |
---|
4226 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4970 | + if (Grafreed.clipboardIsTempGroup) |
---|
4227 | 4971 | tGroup.add/*Child*/(tmp); |
---|
4228 | 4972 | else |
---|
4229 | | - GrafreeD.clipboard = tmp; |
---|
| 4973 | + Grafreed.clipboard = tmp; |
---|
4230 | 4974 | } |
---|
4231 | 4975 | else |
---|
4232 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 4976 | + if (Grafreed.clipboardIsTempGroup) |
---|
4233 | 4977 | tGroup.add/*Child*/(child); |
---|
4234 | 4978 | else |
---|
4235 | | - GrafreeD.clipboard = child; |
---|
| 4979 | + Grafreed.clipboard = child; |
---|
4236 | 4980 | } |
---|
4237 | 4981 | |
---|
4238 | 4982 | //ResetModel(); |
---|
.. | .. |
---|
4264 | 5008 | //System.out.println("cut " + elem); |
---|
4265 | 5009 | //System.out.println("parent = " + elem.parent); |
---|
4266 | 5010 | // tmp.addChild(elem); |
---|
4267 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5011 | + if (Grafreed.clipboardIsTempGroup) |
---|
4268 | 5012 | tGroup.add/*Child*/(tmp); |
---|
4269 | 5013 | else |
---|
4270 | | - GrafreeD.clipboard = tmp; |
---|
| 5014 | + Grafreed.clipboard = tmp; |
---|
4271 | 5015 | } |
---|
4272 | 5016 | else |
---|
4273 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5017 | + if (Grafreed.clipboardIsTempGroup) |
---|
4274 | 5018 | tGroup.add/*Child*/(child); |
---|
4275 | 5019 | else |
---|
4276 | | - GrafreeD.clipboard = child; |
---|
| 5020 | + Grafreed.clipboard = child; |
---|
4277 | 5021 | } |
---|
4278 | 5022 | |
---|
4279 | 5023 | } |
---|
4280 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4281 | | - GrafreeD.clipboard = tGroup; |
---|
| 5024 | + |
---|
| 5025 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 5026 | + Grafreed.clipboard = tGroup; |
---|
| 5027 | + |
---|
4282 | 5028 | if (cut) |
---|
4283 | 5029 | { |
---|
4284 | 5030 | ResetModel(); |
---|
.. | .. |
---|
4288 | 5034 | |
---|
4289 | 5035 | void paste(boolean expand) |
---|
4290 | 5036 | { |
---|
| 5037 | + if (Globals.REPLACEONMAKE) |
---|
| 5038 | + Save(); |
---|
| 5039 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5040 | + Globals.REPLACEONMAKE = false; |
---|
4291 | 5041 | // if (GrafreeD.clipboard == null) |
---|
4292 | 5042 | // return; |
---|
4293 | 5043 | boolean first = true; |
---|
4294 | 5044 | |
---|
4295 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5045 | + if (Grafreed.clipboardIsTempGroup) |
---|
4296 | 5046 | { |
---|
4297 | 5047 | Composite temp; |
---|
4298 | 5048 | |
---|
.. | .. |
---|
4303 | 5053 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4304 | 5054 | */ |
---|
4305 | 5055 | Object3D elem; |
---|
4306 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5056 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4307 | 5057 | { |
---|
4308 | 5058 | Object3D child = (Object3D)e.nextElement(); |
---|
4309 | 5059 | |
---|
.. | .. |
---|
4337 | 5087 | //Object3D cb = Applet3D.clipboard; |
---|
4338 | 5088 | //temp.addChild(cb); |
---|
4339 | 5089 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4340 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4341 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4342 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4343 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4344 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5090 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5091 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5092 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5093 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5094 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4345 | 5095 | else |
---|
4346 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4347 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5096 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5097 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4348 | 5098 | } |
---|
4349 | 5099 | |
---|
| 5100 | + Globals.REPLACEONMAKE = keep; |
---|
4350 | 5101 | ResetModel(); |
---|
4351 | 5102 | refreshContents(); |
---|
4352 | 5103 | } |
---|
4353 | 5104 | |
---|
4354 | | - void pasteInto(boolean copyit) |
---|
| 5105 | + void pasteInto(boolean copyit, boolean clone) |
---|
4355 | 5106 | { |
---|
4356 | 5107 | // if (GrafreeD.clipboard == null) |
---|
4357 | 5108 | // return; |
---|
.. | .. |
---|
4380 | 5131 | if (copyit) |
---|
4381 | 5132 | { |
---|
4382 | 5133 | // paste(false); |
---|
4383 | | - CloneClipboard(false); // sept 2014 |
---|
| 5134 | + if (clone) |
---|
| 5135 | + { |
---|
| 5136 | + CloneClipboard(false); // sept 2014 |
---|
| 5137 | + } |
---|
| 5138 | + else |
---|
| 5139 | + { |
---|
| 5140 | + paste(false); |
---|
| 5141 | + } |
---|
4384 | 5142 | } |
---|
4385 | 5143 | else |
---|
4386 | 5144 | { |
---|
4387 | 5145 | boolean first = true; |
---|
4388 | 5146 | |
---|
4389 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5147 | + if (Grafreed.clipboardIsTempGroup) |
---|
4390 | 5148 | { |
---|
4391 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5149 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4392 | 5150 | Object3D copy; |
---|
4393 | 5151 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4394 | 5152 | { |
---|
.. | .. |
---|
4398 | 5156 | } |
---|
4399 | 5157 | } else |
---|
4400 | 5158 | { |
---|
4401 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5159 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4402 | 5160 | } |
---|
4403 | 5161 | } |
---|
4404 | 5162 | } |
---|
.. | .. |
---|
4475 | 5233 | |
---|
4476 | 5234 | void group(Object3D csg, boolean grab) |
---|
4477 | 5235 | { |
---|
| 5236 | + if (Globals.REPLACEONMAKE) |
---|
| 5237 | + Save(); |
---|
| 5238 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5239 | + Globals.REPLACEONMAKE = false; |
---|
4478 | 5240 | if (//false) // why?? |
---|
4479 | 5241 | !group.selection.isEmpty()) |
---|
4480 | 5242 | { |
---|
.. | .. |
---|
4588 | 5350 | //node.add(csg); |
---|
4589 | 5351 | //makeSomething(node); |
---|
4590 | 5352 | makeSomething(csg); |
---|
| 5353 | + Globals.REPLACEONMAKE = keep; |
---|
4591 | 5354 | } |
---|
4592 | 5355 | |
---|
4593 | 5356 | void Ungroup(Object3D g) |
---|
4594 | 5357 | { |
---|
| 5358 | + if (Globals.REPLACEONMAKE) |
---|
| 5359 | + Save(); |
---|
| 5360 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5361 | + Globals.REPLACEONMAKE = false; |
---|
4595 | 5362 | if (g instanceof HiddenObject) |
---|
4596 | 5363 | { |
---|
4597 | 5364 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4608 | 5375 | objEditor.makeSomething(g.get(i), false); |
---|
4609 | 5376 | } |
---|
4610 | 5377 | } |
---|
| 5378 | + Globals.REPLACEONMAKE = keep; |
---|
4611 | 5379 | } |
---|
4612 | 5380 | |
---|
4613 | 5381 | void ungroup() |
---|
.. | .. |
---|
4803 | 5571 | } |
---|
4804 | 5572 | */ |
---|
4805 | 5573 | |
---|
4806 | | - void ImportGFD() |
---|
4807 | | - { |
---|
4808 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4809 | | - browser.show(); |
---|
4810 | | - String filename = browser.getFile(); |
---|
4811 | | - if (filename != null && filename.length() > 0) |
---|
4812 | | - { |
---|
4813 | | - String fullname = browser.getDirectory() + filename; |
---|
4814 | | - |
---|
4815 | | - //Object3D readobj = |
---|
4816 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4817 | | - //makeSomething(readobj); |
---|
4818 | | - } |
---|
4819 | | - } |
---|
4820 | | - |
---|
4821 | 5574 | /* |
---|
4822 | 5575 | public void Callback(Object obj) |
---|
4823 | 5576 | { |
---|
.. | .. |
---|
4841 | 5594 | } |
---|
4842 | 5595 | */ |
---|
4843 | 5596 | |
---|
4844 | | - void ImportVRMLX3D() |
---|
4845 | | - { |
---|
4846 | | - if (GrafreeD.standAlone) |
---|
4847 | | - { |
---|
4848 | | - /**/ |
---|
4849 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4850 | | - browser.show(); |
---|
4851 | | - String filename = browser.getFile(); |
---|
4852 | | - if (filename != null && filename.length() > 0) |
---|
4853 | | - { |
---|
4854 | | - String fullname = browser.getDirectory() + filename; |
---|
4855 | | - LoadVRMLX3D(fullname); |
---|
4856 | | - } |
---|
4857 | | - /**/ |
---|
4858 | | - } |
---|
4859 | | - } |
---|
4860 | | - |
---|
4861 | 5597 | String GetFile(String dialogName) |
---|
4862 | 5598 | { |
---|
4863 | | - if (GrafreeD.standAlone) |
---|
| 5599 | + if (Grafreed.standAlone) |
---|
4864 | 5600 | { |
---|
4865 | 5601 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4866 | 5602 | browser.show(); |
---|
.. | .. |
---|
4924 | 5660 | cButton flashSelectionButton; |
---|
4925 | 5661 | cButton editButton; |
---|
4926 | 5662 | cButton uneditButton; |
---|
| 5663 | + JCheckBox allParamsButton; |
---|
4927 | 5664 | cButton clearpanelButton; |
---|
4928 | | - cButton allParamsButton; |
---|
4929 | 5665 | cButton unselectButton; |
---|
4930 | 5666 | |
---|
| 5667 | + cButton restoreCameraButton; |
---|
| 5668 | + |
---|
| 5669 | + cButton saveButton; |
---|
| 5670 | + cButton oneStepButton; |
---|
| 5671 | + |
---|
| 5672 | + cButton groupButton; |
---|
| 5673 | + cButton ungroupButton; |
---|
| 5674 | + cButton compositeButton; |
---|
| 5675 | + cButton switchButton; |
---|
| 5676 | + cButton loopButton; |
---|
| 5677 | + cButton textureButton; |
---|
| 5678 | + |
---|
| 5679 | + cButton gridButton; |
---|
| 5680 | + cButton boxButton; |
---|
| 5681 | + cButton sphereButton; |
---|
| 5682 | + cButton coneButton; |
---|
| 5683 | + cButton torusButton; |
---|
| 5684 | + cButton superButton; |
---|
| 5685 | + cButton kleinButton; |
---|
| 5686 | + cButton particlesButton; |
---|
| 5687 | + cButton overlayButton; |
---|
| 5688 | + cButton lightButton; |
---|
| 5689 | + |
---|
4931 | 5690 | cButton screenfitButton; |
---|
4932 | 5691 | cButton screenfitpointButton; |
---|
4933 | 5692 | cButton snapobjectButton; |
---|
.. | .. |
---|
4939 | 5698 | |
---|
4940 | 5699 | cButton setsupportButton; |
---|
4941 | 5700 | |
---|
4942 | | - cButton twoButton; |
---|
4943 | | - cButton sixButton; |
---|
4944 | | - cButton threeButton; |
---|
4945 | | - cButton sevenButton; |
---|
4946 | | - cButton fourButton; // full panel |
---|
4947 | | - cButton oneButton; // full XYZ |
---|
4948 | | - //cButton currentLayout; |
---|
4949 | | - |
---|
4950 | 5701 | // |
---|
4951 | 5702 | //Composite |
---|
4952 | 5703 | Object3D // to do !! |
---|
.. | .. |
---|
4956 | 5707 | //JTree jTree; |
---|
4957 | 5708 | private MenuItem lookAtItem; |
---|
4958 | 5709 | private MenuItem lookFromItem; |
---|
4959 | | - private MenuItem switchItem; |
---|
| 5710 | + private MenuItem switchViewItem; |
---|
4960 | 5711 | private MenuItem cutItem; |
---|
4961 | | - private MenuItem duplicateItem; |
---|
| 5712 | + private MenuItem undoItem; |
---|
| 5713 | + private MenuItem redoItem; |
---|
| 5714 | + private JMenuItem duplicateItem; |
---|
4962 | 5715 | private MenuItem cloneItem; |
---|
4963 | 5716 | private MenuItem cloneSupportItem; |
---|
4964 | 5717 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
4971 | 5724 | private MenuItem linkverticesItem; |
---|
4972 | 5725 | private MenuItem relinkverticesItem; |
---|
4973 | 5726 | private MenuItem setMasterItem; |
---|
4974 | | - private MenuItem resetMeshItem; |
---|
| 5727 | + private MenuItem resetAllItem; |
---|
4975 | 5728 | private MenuItem stepAllItem; |
---|
4976 | 5729 | private MenuItem revertMeshItem; |
---|
4977 | 5730 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4982 | 5735 | private MenuItem mergeGeometriesItem; |
---|
4983 | 5736 | private MenuItem copyItem; |
---|
4984 | 5737 | private MenuItem pasteItem; |
---|
| 5738 | + private MenuItem pasteIntoItem; |
---|
4985 | 5739 | private MenuItem pasteLinkItem; |
---|
4986 | 5740 | private MenuItem pasteCloneItem; |
---|
4987 | 5741 | private MenuItem pasteExpandItem; |
---|
4988 | | - private MenuItem clearItem; |
---|
| 5742 | + private MenuItem deleteItem; |
---|
4989 | 5743 | private MenuItem clearAllItem; |
---|
4990 | 5744 | private MenuItem genUVItem; |
---|
4991 | 5745 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5020 | 5774 | private MenuItem showleavesItem; |
---|
5021 | 5775 | private MenuItem markleavesItem; |
---|
5022 | 5776 | private MenuItem unmarkleavesItem; |
---|
| 5777 | + private MenuItem rewindleavesItem; |
---|
| 5778 | + private MenuItem unrewindleavesItem; |
---|
| 5779 | + private MenuItem randomleavesItem; |
---|
| 5780 | + private MenuItem unrandomleavesItem; |
---|
5023 | 5781 | |
---|
5024 | 5782 | private MenuItem flipVItem; |
---|
5025 | 5783 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5031 | 5789 | private MenuItem panoTexturesItem; |
---|
5032 | 5790 | |
---|
5033 | 5791 | private MenuItem resetCentroidItem; |
---|
5034 | | - private MenuItem transformgeometryItem; |
---|
| 5792 | + private MenuItem resetCentroidXZItem; |
---|
5035 | 5793 | private MenuItem resetTransformItem; |
---|
| 5794 | + private MenuItem transformGeometryItem; |
---|
| 5795 | + private MenuItem transformChildrenItem; |
---|
5036 | 5796 | private MenuItem hideItem; |
---|
5037 | 5797 | private MenuItem grabItem; |
---|
5038 | 5798 | private MenuItem backItem; |
---|
5039 | 5799 | private MenuItem frontItem; |
---|
5040 | 5800 | private MenuItem cameraItem; |
---|
5041 | 5801 | private MenuItem compositeItem; |
---|
5042 | | - private MenuItem randomItem; |
---|
| 5802 | + private MenuItem switchItem; |
---|
5043 | 5803 | private MenuItem physicsItem; |
---|
5044 | 5804 | private MenuItem frameselectorItem; |
---|
5045 | 5805 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5063 | 5823 | private MenuItem attachBumpItem; |
---|
5064 | 5824 | private MenuItem detachBumpItem; |
---|
5065 | 5825 | private MenuItem pigmentBumpItem; |
---|
| 5826 | + private MenuItem embedTexturesItem; |
---|
| 5827 | + private MenuItem deEmbedTexturesItem; |
---|
5066 | 5828 | |
---|
5067 | 5829 | private MenuItem particleItem; |
---|
5068 | 5830 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5079 | 5841 | private MenuItem blobItem; |
---|
5080 | 5842 | private MenuItem latheItem; |
---|
5081 | 5843 | private MenuItem bezierItem; |
---|
5082 | | - private MenuItem checkerItem; |
---|
| 5844 | + private MenuItem overlayItem; |
---|
5083 | 5845 | private MenuItem meshItem; |
---|
5084 | 5846 | // private MenuItem meshGroupItem; |
---|
5085 | 5847 | private MenuItem springItem; |
---|
.. | .. |
---|
5101 | 5863 | private MenuItem doubleItem; |
---|
5102 | 5864 | private MenuItem tripleItem; |
---|
5103 | 5865 | |
---|
5104 | | - private MenuItem importGFDItem; |
---|
5105 | | - private MenuItem importVRMLX3DItem; |
---|
5106 | | - private MenuItem import3DSItem; |
---|
5107 | | - private MenuItem importOBJItem; |
---|
5108 | | - |
---|
5109 | 5866 | private MenuItem computeAOItem; |
---|
5110 | 5867 | private MenuItem recompileItem; |
---|
5111 | 5868 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5115 | 5872 | private MenuItem analyzeItem; |
---|
5116 | 5873 | private MenuItem dumpItem; |
---|
5117 | 5874 | //boolean freezemodel = false; |
---|
| 5875 | + |
---|
| 5876 | + Menu cameraMenu; |
---|
| 5877 | + MenuItem editCameraItem; |
---|
| 5878 | + MenuItem restoreCameraItem; |
---|
5118 | 5879 | } |
---|