.. | .. |
---|
23 | 23 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 24 | ItemListener // ListSelectionListener |
---|
25 | 25 | { |
---|
| 26 | + |
---|
| 27 | + public void AddSkyboxButton(String f, String s, cGridBag row) |
---|
| 28 | + { |
---|
| 29 | + cButton skyboxButton; |
---|
| 30 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 31 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 33 | + skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 35 | + { |
---|
| 36 | + @Override |
---|
| 37 | + public void actionPerformed(ActionEvent e) |
---|
| 38 | + { |
---|
| 39 | + ChangeSkybox(path); |
---|
| 40 | + } |
---|
| 41 | + }); |
---|
| 42 | + } |
---|
| 43 | + |
---|
| 44 | + public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
| 45 | + { |
---|
| 46 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 47 | + |
---|
| 48 | + tab0.setName("Urban"); |
---|
| 49 | + skyboxpanel.add(tab0); |
---|
| 50 | + |
---|
| 51 | + cGridBag row0 = new cGridBag(); |
---|
| 52 | + cGridBag row1 = new cGridBag(); |
---|
| 53 | + cGridBag row2 = new cGridBag(); |
---|
| 54 | + cGridBag row3 = new cGridBag(); |
---|
| 55 | + cGridBag row4 = new cGridBag(); |
---|
| 56 | + cGridBag row5 = new cGridBag(); |
---|
| 57 | + cGridBag row6 = new cGridBag(); |
---|
| 58 | + |
---|
| 59 | + AddSkyboxButton("default", "rgb", row0); |
---|
| 60 | + //AddSkyboxButton("default", "cornell", row0); |
---|
| 61 | + AddSkyboxButton("penguins", "dust", row0); |
---|
| 62 | + AddSkyboxButton("penguins", "tropic", row0); |
---|
| 63 | + AddSkyboxButton("penguins", "yonder", row0); |
---|
| 64 | + |
---|
| 65 | + AddSkyboxButton("default", "uffizi", row1); |
---|
| 66 | + AddSkyboxButton("bridge", "Bridge", row1); |
---|
| 67 | + AddSkyboxButton("bridge", "Bridge2", row1); |
---|
| 68 | + AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
| 69 | + |
---|
| 70 | + AddSkyboxButton("urban", "Parliament", row2); |
---|
| 71 | + AddSkyboxButton("urban", "Roundabout", row2); |
---|
| 72 | + AddSkyboxButton("urban", "SaintLazarusChurch", row2); |
---|
| 73 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row2); |
---|
| 74 | + |
---|
| 75 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
| 76 | + AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 77 | + AddSkyboxButton("urban", "Medborgarplatsen", row3); |
---|
| 78 | + AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
| 79 | + |
---|
| 80 | + AddSkyboxButton("park", "Buddha", row4); |
---|
| 81 | + AddSkyboxButton("park", "CNTower2", row4); |
---|
| 82 | + AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
| 83 | + AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
| 84 | + |
---|
| 85 | + AddSkyboxButton("park", "Park", row5); |
---|
| 86 | + AddSkyboxButton("park", "Pond", row5); |
---|
| 87 | + AddSkyboxButton("park", "Skansen", row5); |
---|
| 88 | + AddSkyboxButton("park", "Skansen2", row5); |
---|
| 89 | + |
---|
| 90 | + AddSkyboxButton("park", "Skansen3", row6); |
---|
| 91 | + AddSkyboxButton("park", "Skansen4", row6); |
---|
| 92 | + AddSkyboxButton("park", "Skansen5", row6); |
---|
| 93 | + AddSkyboxButton("persson", "VancouverConventionCentre", row6); |
---|
| 94 | + |
---|
| 95 | + tab0.add(row0); |
---|
| 96 | + tab0.add(row1); |
---|
| 97 | + tab0.add(row2); |
---|
| 98 | + tab0.add(row3); |
---|
| 99 | + tab0.add(row4); |
---|
| 100 | + tab0.add(row5); |
---|
| 101 | + tab0.add(row6); |
---|
| 102 | + |
---|
| 103 | + for (int i=5; --i>=0;) |
---|
| 104 | + { |
---|
| 105 | + //oe.toolboxPanel.Return(); |
---|
| 106 | + //tab0.add(new cGridBag()); |
---|
| 107 | + } |
---|
| 108 | + } |
---|
| 109 | + |
---|
| 110 | + public void AddSkyboxTab1(JTabbedPane skyboxpanel) |
---|
| 111 | + { |
---|
| 112 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 113 | + |
---|
| 114 | + tab0.setName("Nature"); |
---|
| 115 | + skyboxpanel.add(tab0); |
---|
| 116 | + |
---|
| 117 | + cGridBag row0 = new cGridBag(); |
---|
| 118 | + cGridBag row1 = new cGridBag(); |
---|
| 119 | + cGridBag row2 = new cGridBag(); |
---|
| 120 | + cGridBag row3 = new cGridBag(); |
---|
| 121 | + cGridBag row4 = new cGridBag(); |
---|
| 122 | + cGridBag row5 = new cGridBag(); |
---|
| 123 | + cGridBag row6 = new cGridBag(); |
---|
| 124 | + |
---|
| 125 | + AddSkyboxButton("beach", "HeartInTheSand", row0); |
---|
| 126 | + AddSkyboxButton("beach", "LarnacaBeach", row0); |
---|
| 127 | + AddSkyboxButton("beach", "PalmTrees", row0); |
---|
| 128 | + AddSkyboxButton("beach", "Tenerife", row0); |
---|
| 129 | + |
---|
| 130 | + AddSkyboxButton("beach", "Tenerife2", row1); |
---|
| 131 | + AddSkyboxButton("beach", "Tenerife3", row1); |
---|
| 132 | + AddSkyboxButton("field", "FishPond", row1); |
---|
| 133 | + AddSkyboxButton("field", "Footballfield", row1); |
---|
| 134 | + |
---|
| 135 | + AddSkyboxButton("field", "Meadow", row2); |
---|
| 136 | + AddSkyboxButton("field", "Sorsele", row2); |
---|
| 137 | + AddSkyboxButton("field", "Sorsele2", row2); |
---|
| 138 | + AddSkyboxButton("field", "Sorsele3", row2); |
---|
| 139 | + |
---|
| 140 | + AddSkyboxButton("forest", "Brudslojan", row3); |
---|
| 141 | + AddSkyboxButton("forest", "Langholmen2", row3); |
---|
| 142 | + AddSkyboxButton("forest", "Plants", row3); |
---|
| 143 | + AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 144 | + |
---|
| 145 | + AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
| 146 | + AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
| 147 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 148 | + AddSkyboxButton("park", "Tantolunden4", row4); |
---|
| 149 | + |
---|
| 150 | + AddSkyboxButton("park", "Stairs", row5); |
---|
| 151 | + AddSkyboxButton("default", "skycube", row6); |
---|
| 152 | + AddSkyboxButton("rocky", "Langholmen", row5); |
---|
| 153 | + AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 154 | + |
---|
| 155 | + AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 156 | + AddSkyboxButton("default", "CloudyHills", row6); |
---|
| 157 | + AddSkyboxButton("daz", "Autumn", row6); |
---|
| 158 | + AddSkyboxButton("daz", "MountainTrail", row6); |
---|
| 159 | + /* |
---|
| 160 | +Autumn |
---|
| 161 | +Greenlands |
---|
| 162 | +MountainTrail |
---|
| 163 | +Oasis |
---|
| 164 | +TheRock |
---|
| 165 | +TopOfTheWorld |
---|
| 166 | +Winter |
---|
| 167 | + */ |
---|
| 168 | + |
---|
| 169 | + tab0.add(row0); |
---|
| 170 | + tab0.add(row1); |
---|
| 171 | + tab0.add(row2); |
---|
| 172 | + tab0.add(row3); |
---|
| 173 | + tab0.add(row4); |
---|
| 174 | + tab0.add(row5); |
---|
| 175 | + tab0.add(row6); |
---|
| 176 | + |
---|
| 177 | + for (int i=5; --i>=0;) |
---|
| 178 | + { |
---|
| 179 | + //oe.toolboxPanel.Return(); |
---|
| 180 | + //tab0.add(new cGridBag()); |
---|
| 181 | + } |
---|
| 182 | + } |
---|
| 183 | + |
---|
| 184 | + public void AddSkyboxTab2(JTabbedPane skyboxpanel) |
---|
| 185 | + { |
---|
| 186 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 187 | + |
---|
| 188 | + tab0.setName("Night"); |
---|
| 189 | + skyboxpanel.add(tab0); |
---|
| 190 | + |
---|
| 191 | + cGridBag row0 = new cGridBag(); |
---|
| 192 | + cGridBag row1 = new cGridBag(); |
---|
| 193 | + cGridBag row2 = new cGridBag(); |
---|
| 194 | + cGridBag row3 = new cGridBag(); |
---|
| 195 | + cGridBag row4 = new cGridBag(); |
---|
| 196 | + cGridBag row5 = new cGridBag(); |
---|
| 197 | + cGridBag row6 = new cGridBag(); |
---|
| 198 | + |
---|
| 199 | + AddSkyboxButton("night", "NightPath", row0); |
---|
| 200 | + AddSkyboxButton("night", "PondNight", row0); |
---|
| 201 | + AddSkyboxButton("night", "Powerlines", row0); |
---|
| 202 | + AddSkyboxButton("night", "SwedishRoyalCastle", row0); |
---|
| 203 | + |
---|
| 204 | + AddSkyboxButton("urban", "CNTower", row1); |
---|
| 205 | + AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
| 206 | + AddSkyboxButton("rocky", "Riddarfjarden", row1); |
---|
| 207 | + AddSkyboxButton("penguins", "sleepyhollow", row1); |
---|
| 208 | + |
---|
| 209 | + AddSkyboxButton("penguins", "kenon_star", row2); |
---|
| 210 | + AddSkyboxButton("persson", "corona", row2); |
---|
| 211 | + AddSkyboxButton("persson", "spaceskybox", row2); |
---|
| 212 | + AddSkyboxButton("indoors", "Vasa", row2); |
---|
| 213 | + |
---|
| 214 | + AddSkyboxButton("winter", "Backyard", row3); |
---|
| 215 | + AddSkyboxButton("winter", "Creek", row3); |
---|
| 216 | + AddSkyboxButton("winter", "FootballField3", row3); |
---|
| 217 | + AddSkyboxButton("winter", "Forest", row3); |
---|
| 218 | + |
---|
| 219 | + AddSkyboxButton("winter", "HornstullsStrand2", row4); |
---|
| 220 | + AddSkyboxButton("winter", "House", row4); |
---|
| 221 | + AddSkyboxButton("winter", "IceLake", row4); |
---|
| 222 | + AddSkyboxButton("winter", "IceRiver", row4); |
---|
| 223 | + |
---|
| 224 | + AddSkyboxButton("winter", "Park3", row5); |
---|
| 225 | + AddSkyboxButton("winter", "PondWinter", row5); |
---|
| 226 | + AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
| 227 | + AddSkyboxButton("winter", "Vindelalven", row5); |
---|
| 228 | + |
---|
| 229 | + AddSkyboxButton("daz", "TheRock", row6); |
---|
| 230 | + AddSkyboxButton("daz", "TopOfTheWorld", row6); |
---|
| 231 | + AddSkyboxButton("daz", "Winter", row6); |
---|
| 232 | + AddSkyboxButton("mountain", "Ryfjallet", row6); |
---|
| 233 | + |
---|
| 234 | + tab0.add(row0); |
---|
| 235 | + tab0.add(row1); |
---|
| 236 | + tab0.add(row2); |
---|
| 237 | + tab0.add(row3); |
---|
| 238 | + tab0.add(row4); |
---|
| 239 | + tab0.add(row5); |
---|
| 240 | + tab0.add(row6); |
---|
| 241 | + |
---|
| 242 | + for (int i=5; --i>=0;) |
---|
| 243 | + { |
---|
| 244 | + //oe.toolboxPanel.Return(); |
---|
| 245 | + //tab0.add(new cGridBag()); |
---|
| 246 | + } |
---|
| 247 | + } |
---|
| 248 | + |
---|
| 249 | + public void AddSkyboxTab3(JTabbedPane skyboxpanel) |
---|
| 250 | + { |
---|
| 251 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 252 | + |
---|
| 253 | + tab0.setName("Others"); |
---|
| 254 | + skyboxpanel.add(tab0); |
---|
| 255 | + |
---|
| 256 | + cGridBag row0 = new cGridBag(); |
---|
| 257 | + cGridBag row1 = new cGridBag(); |
---|
| 258 | + cGridBag row2 = new cGridBag(); |
---|
| 259 | + cGridBag row3 = new cGridBag(); |
---|
| 260 | + cGridBag row4 = new cGridBag(); |
---|
| 261 | + cGridBag row5 = new cGridBag(); |
---|
| 262 | + cGridBag row6 = new cGridBag(); |
---|
| 263 | + |
---|
| 264 | + AddSkyboxButton("mayhem", "afterrain", row0); |
---|
| 265 | + AddSkyboxButton("mayhem", "aqua4", row0); |
---|
| 266 | + AddSkyboxButton("mayhem", "aqua9", row0); |
---|
| 267 | + AddSkyboxButton("mayhem", "flame", row0); |
---|
| 268 | + |
---|
| 269 | + AddSkyboxButton("mayhem", "h2s", row1); |
---|
| 270 | + AddSkyboxButton("mayhem", "prehistoric", row1); |
---|
| 271 | + AddSkyboxButton("mayhem", "scorched", row1); |
---|
| 272 | + AddSkyboxButton("penguins", "desertdawn", row1); |
---|
| 273 | + |
---|
| 274 | + AddSkyboxButton("persson", "Citadella", row2); |
---|
| 275 | + AddSkyboxButton("persson", "Citadella2", row2); |
---|
| 276 | + AddSkyboxButton("persson", "clouds1", row2); |
---|
| 277 | + AddSkyboxButton("penguins", "wrath", row2); |
---|
| 278 | + |
---|
| 279 | + AddSkyboxButton("persson", "FishermansBastion", row3); |
---|
| 280 | + AddSkyboxButton("persson", "HeroesSquare", row3); |
---|
| 281 | + AddSkyboxButton("indoors", "DallasW", row3); |
---|
| 282 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row3); |
---|
| 283 | + |
---|
| 284 | + AddSkyboxButton("persson", "LancellottiChapel", row4); |
---|
| 285 | + AddSkyboxButton("persson", "PereaBeach1", row4); |
---|
| 286 | + AddSkyboxButton("persson", "PereaBeach2", row4); |
---|
| 287 | + AddSkyboxButton("persson", "redeclipse", row4); |
---|
| 288 | + |
---|
| 289 | + AddSkyboxButton("daz", "Greenlands", row5); |
---|
| 290 | + AddSkyboxButton("daz", "Oasis", row5); |
---|
| 291 | + AddSkyboxButton("elyvisions", "arch3", row5); |
---|
| 292 | + AddSkyboxButton("elyvisions", "calm_sea", row5); |
---|
| 293 | + |
---|
| 294 | + AddSkyboxButton("elyvisions", "rainbow", row6); |
---|
| 295 | + AddSkyboxButton("elyvisions", "distant_sunset", row6); |
---|
| 296 | + AddSkyboxButton("elyvisions", "heaven", row6); |
---|
| 297 | + AddSkyboxButton("elyvisions", "hot", row6); |
---|
| 298 | + |
---|
| 299 | + tab0.add(row0); |
---|
| 300 | + tab0.add(row1); |
---|
| 301 | + tab0.add(row2); |
---|
| 302 | + tab0.add(row3); |
---|
| 303 | + tab0.add(row4); |
---|
| 304 | + tab0.add(row5); |
---|
| 305 | + tab0.add(row6); |
---|
| 306 | + |
---|
| 307 | + for (int i=5; --i>=0;) |
---|
| 308 | + { |
---|
| 309 | + //oe.toolboxPanel.Return(); |
---|
| 310 | + //tab0.add(new cGridBag()); |
---|
| 311 | + } |
---|
| 312 | + } |
---|
| 313 | + |
---|
| 314 | + public void ChangeSkybox(String name) |
---|
| 315 | + { |
---|
| 316 | + //cameraView.envyoff = false; |
---|
| 317 | + group.skyboxname = name; |
---|
| 318 | + group.skyboxext = "jpg"; |
---|
| 319 | + cameraView.repaint(); |
---|
| 320 | + } |
---|
| 321 | + |
---|
26 | 322 | //ObjEditor objEditor; |
---|
27 | 323 | public void closeUI2() |
---|
28 | 324 | { |
---|
.. | .. |
---|
60 | 356 | this.copy = this.group = group; |
---|
61 | 357 | //selectees = this.group.selectees; |
---|
62 | 358 | |
---|
| 359 | + if (copy.versionlist == null) |
---|
| 360 | + { |
---|
| 361 | + copy.versionlist = new Object3D[100]; |
---|
| 362 | + copy.versionindex = -1; |
---|
| 363 | + } |
---|
| 364 | + |
---|
63 | 365 | if(ui) |
---|
64 | 366 | SetupUI(objEditor); |
---|
65 | 367 | } |
---|
.. | .. |
---|
80 | 382 | SetupViews(objEditor); |
---|
81 | 383 | |
---|
82 | 384 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 385 | + |
---|
| 386 | + if (copy.versionlist == null) |
---|
| 387 | + { |
---|
| 388 | + copy.versionlist = new Object3D[100]; |
---|
| 389 | + copy.versionindex = -1; |
---|
| 390 | + |
---|
| 391 | + Save(true); |
---|
| 392 | + } |
---|
83 | 393 | } |
---|
84 | 394 | |
---|
85 | 395 | void CloneSelection(boolean supports) |
---|
86 | 396 | { |
---|
| 397 | + if (Globals.REPLACEONMAKE) |
---|
| 398 | + Save(); |
---|
| 399 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 400 | + Globals.REPLACEONMAKE = false; |
---|
87 | 401 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 402 | //Object3D obj; |
---|
89 | 403 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 408 | |
---|
95 | 409 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 410 | } |
---|
| 411 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 412 | } |
---|
98 | 413 | |
---|
99 | 414 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 465 | |
---|
151 | 466 | void SetupMenu2(GroupEditor oe) |
---|
152 | 467 | { |
---|
| 468 | + oe.jTree = new cTree(); |
---|
| 469 | + |
---|
153 | 470 | Menu menu; |
---|
154 | 471 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 472 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
160 | 477 | // redoItem = menu.add(new MenuItem("Redo")); |
---|
161 | 478 | // redoItem.addActionListener(this); |
---|
162 | 479 | // menu.add("-"); |
---|
163 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 480 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
164 | 481 | duplicateItem.addActionListener(this); |
---|
165 | 482 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
166 | 483 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
176 | 493 | copyItem.addActionListener(this); |
---|
177 | 494 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
178 | 495 | pasteItem.addActionListener(this); |
---|
179 | | - menu.add("-"); |
---|
180 | 496 | |
---|
181 | 497 | menu.add("-"); |
---|
182 | 498 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
188 | 504 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
189 | 505 | // pasteExpandItem.addActionListener(this); |
---|
190 | 506 | menu.add("-"); |
---|
191 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
192 | | - clearItem.addActionListener(this); |
---|
| 507 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 508 | + deleteItem.addActionListener(this); |
---|
193 | 509 | |
---|
194 | 510 | if (Globals.ADVANCED) |
---|
195 | 511 | { |
---|
.. | .. |
---|
203 | 519 | //zBufferItem.addActionListener(this); |
---|
204 | 520 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
205 | 521 | //normalLensItem.addActionListener(this); |
---|
206 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
207 | | - revertCameraItem.addActionListener(this); |
---|
| 522 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 523 | + restoreCameraItem.addActionListener(this); |
---|
208 | 524 | |
---|
209 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
210 | | - toggleFullScreenItem.addItemListener(this); |
---|
211 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
212 | | - cameraMenu.add("-"); |
---|
| 525 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 526 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 527 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 528 | +// cameraMenu.add("-"); |
---|
| 529 | +// |
---|
| 530 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 531 | +// toggleTextureItem.addItemListener(this); |
---|
| 532 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 533 | +// |
---|
| 534 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 535 | +// toggleSwitchItem.addItemListener(this); |
---|
| 536 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
213 | 537 | |
---|
214 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
215 | | - toggleTextureItem.addItemListener(this); |
---|
216 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
217 | | - |
---|
218 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
219 | | - toggleSwitchItem.addItemListener(this); |
---|
220 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
221 | | - |
---|
222 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 538 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
223 | 539 | toggleHandleItem.addItemListener(this); |
---|
224 | 540 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
225 | 541 | |
---|
.. | .. |
---|
246 | 562 | |
---|
247 | 563 | cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
248 | 564 | toggleDebugItem.addItemListener(this); |
---|
249 | | - toggleDebugItem.setState(CameraPane.DEBUG); |
---|
| 565 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
250 | 566 | |
---|
251 | 567 | cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
252 | 568 | toggleFrustumItem.addItemListener(this); |
---|
.. | .. |
---|
274 | 590 | { |
---|
275 | 591 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
276 | 592 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
277 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 593 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
278 | 594 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
279 | 595 | oe.cameraMenu.add("-"); |
---|
280 | 596 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
282 | 598 | editLeafItem.addActionListener(this); |
---|
283 | 599 | lookAtItem.addActionListener(this); |
---|
284 | 600 | //lookFromItem.addActinoListener(this); |
---|
285 | | - //switchItem.addActionListener(this); |
---|
| 601 | + //switchViewItem.addActionListener(this); |
---|
286 | 602 | } |
---|
287 | 603 | |
---|
288 | 604 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
327 | 643 | } |
---|
328 | 644 | |
---|
329 | 645 | oe.menuBar.add(menu = new Menu("Group")); |
---|
330 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
331 | | - grabItem.addActionListener(this); |
---|
| 646 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 647 | +// grabItem.addActionListener(this); |
---|
332 | 648 | backItem = menu.add(new MenuItem("Back")); |
---|
333 | 649 | backItem.addActionListener(this); |
---|
334 | 650 | frontItem = menu.add(new MenuItem("Front")); |
---|
335 | 651 | frontItem.addActionListener(this); |
---|
336 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
337 | | - compositeItem.addActionListener(this); |
---|
| 652 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 653 | +// compositeItem.addActionListener(this); |
---|
| 654 | + |
---|
| 655 | + if (Globals.ADVANCED) |
---|
| 656 | + { |
---|
338 | 657 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
339 | 658 | hideItem.addActionListener(this); |
---|
| 659 | + } |
---|
340 | 660 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
341 | 661 | ungroupItem.addActionListener(this); |
---|
342 | | - menu.add("-"); |
---|
343 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
344 | | - randomItem.addActionListener(this); |
---|
| 662 | + |
---|
| 663 | +// menu.add("-"); |
---|
| 664 | +// |
---|
| 665 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 666 | +// switchItem.addActionListener(this); |
---|
| 667 | + if (Globals.ADVANCED) |
---|
| 668 | + { |
---|
345 | 669 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
346 | 670 | switchGeoItem.addActionListener(this); |
---|
347 | 671 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
349 | 673 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
350 | 674 | morphItem.addActionListener(this); |
---|
351 | 675 | |
---|
352 | | - if (Globals.ADVANCED) |
---|
353 | | - { |
---|
354 | 676 | menu.add("-"); |
---|
355 | 677 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
356 | 678 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
358 | 680 | frameselectorItem.addActionListener(this); |
---|
359 | 681 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
360 | 682 | scriptNodeItem.addActionListener(this); |
---|
361 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
362 | | - cameraItem.addActionListener(this); |
---|
363 | 683 | } |
---|
364 | 684 | |
---|
365 | 685 | oe.menuBar.add(menu = new Menu("Object")); |
---|
366 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
367 | | - textureItem.addActionListener(this); |
---|
| 686 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 687 | +// textureItem.addActionListener(this); |
---|
368 | 688 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
369 | 689 | billboardItem.addActionListener(this); |
---|
370 | 690 | csgItem = menu.add(new MenuItem("CSG")); |
---|
371 | 691 | csgItem.addActionListener(this); |
---|
372 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 692 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
373 | 693 | shadowXItem.addActionListener(this); |
---|
374 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 694 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
375 | 695 | shadowYItem.addActionListener(this); |
---|
376 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 696 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
377 | 697 | shadowZItem.addActionListener(this); |
---|
| 698 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 699 | + attributeItem.addActionListener(this); |
---|
| 700 | + |
---|
378 | 701 | if (Globals.ADVANCED) |
---|
379 | 702 | { |
---|
380 | 703 | menu.add("-"); |
---|
381 | 704 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
382 | 705 | linkerItem.addActionListener(this); |
---|
383 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
384 | | - attributeItem.addActionListener(this); |
---|
385 | 706 | templateItem = menu.add(new MenuItem("Template")); |
---|
386 | 707 | templateItem.addActionListener(this); |
---|
387 | 708 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
410 | 731 | genNormalsMESHItem.addActionListener(this); |
---|
411 | 732 | if (Globals.ADVANCED) |
---|
412 | 733 | { |
---|
413 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 734 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
414 | 735 | genNormalsMINEItem.addActionListener(this); |
---|
415 | 736 | } |
---|
416 | 737 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
470 | 791 | markleavesItem.addActionListener(this); |
---|
471 | 792 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
472 | 793 | unmarkleavesItem.addActionListener(this); |
---|
| 794 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 795 | + rewindleavesItem.addActionListener(this); |
---|
| 796 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 797 | + unrewindleavesItem.addActionListener(this); |
---|
| 798 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 799 | + randomleavesItem.addActionListener(this); |
---|
| 800 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 801 | + unrandomleavesItem.addActionListener(this); |
---|
473 | 802 | menu.add("-"); |
---|
474 | 803 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
475 | 804 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
495 | 824 | attachBumpItem.addActionListener(this); |
---|
496 | 825 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
497 | 826 | pigmentBumpItem.addActionListener(this); |
---|
| 827 | + //embedTexturesItem |
---|
498 | 828 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
499 | 829 | detachPigmentItem.addActionListener(this); |
---|
500 | 830 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
501 | 831 | detachBumpItem.addActionListener(this); |
---|
| 832 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 833 | + embedTexturesItem.addActionListener(this); |
---|
| 834 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 835 | + deEmbedTexturesItem.addActionListener(this); |
---|
502 | 836 | menu.add("-"); |
---|
503 | 837 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
504 | 838 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
525 | 859 | buildToolsMenu(menu); |
---|
526 | 860 | } |
---|
527 | 861 | |
---|
| 862 | + |
---|
528 | 863 | void SetupUI2(ObjEditor oe) |
---|
529 | 864 | { |
---|
| 865 | + // June 2019 |
---|
| 866 | + if (oe == null) |
---|
| 867 | + { |
---|
| 868 | + //super.SetupUI2(this); |
---|
| 869 | + //return; |
---|
| 870 | + } |
---|
| 871 | + |
---|
| 872 | + if (copy != group) |
---|
| 873 | + { |
---|
| 874 | + //super.SetupUI2(this); |
---|
| 875 | + } |
---|
| 876 | + |
---|
530 | 877 | //new Exception().printStackTrace(); |
---|
531 | 878 | |
---|
532 | 879 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
555 | 902 | oe.radioPanel.add(dummyButton); |
---|
556 | 903 | oe.buttonGroup.add(dummyButton); |
---|
557 | 904 | */ |
---|
| 905 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 906 | + |
---|
| 907 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 908 | + |
---|
558 | 909 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
559 | 910 | |
---|
560 | | - oe.toolbarPanel.add(undoButton = new cButton("Undo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
561 | | - undoButton.setToolTipText("Undo changes"); |
---|
562 | | - undoButton.addActionListener(this); |
---|
| 911 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 912 | + //minButton.setToolTipText("Minimize window"); |
---|
| 913 | + //minButton.addActionListener(this); |
---|
563 | 914 | |
---|
564 | | - oe.toolbarPanel.add(redoButton = new cButton("Redo", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | | - redoButton.setToolTipText("Redo changes"); |
---|
566 | | - redoButton.addActionListener(this); |
---|
| 915 | + if (Globals.ADVANCED) |
---|
| 916 | + { |
---|
| 917 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 918 | + maxButton.setToolTipText("Maximize window"); |
---|
| 919 | + maxButton.addActionListener(this); |
---|
| 920 | + } |
---|
567 | 921 | |
---|
568 | | - oe.toolbarPanel.add(saveButton = new cButton("Save", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
569 | | - saveButton.setToolTipText("Save changes"); |
---|
| 922 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 923 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 924 | + fullButton.addActionListener(this); |
---|
| 925 | + |
---|
| 926 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 927 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 928 | + screenfitButton.addActionListener(this); |
---|
| 929 | + |
---|
| 930 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 931 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 932 | + restoreCameraButton.addActionListener(this); |
---|
| 933 | + |
---|
| 934 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 935 | + saveButton.setToolTipText("Duplicate current version"); |
---|
570 | 936 | saveButton.addActionListener(this); |
---|
| 937 | + |
---|
| 938 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 939 | + undoButton.setToolTipText("Previous version"); |
---|
| 940 | + undoButton.addActionListener(this); |
---|
| 941 | + undoButton.setEnabled(false); |
---|
571 | 942 | |
---|
572 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 943 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 944 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 945 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
| 946 | + restoreButton.addActionListener(this); |
---|
| 947 | + restoreButton.setEnabled(false); |
---|
| 948 | + |
---|
| 949 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 950 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
| 951 | + replaceButton.addActionListener(this); |
---|
| 952 | + replaceButton.setEnabled(false); |
---|
| 953 | + |
---|
| 954 | + copyOptionsPanel.add(updown); |
---|
| 955 | + |
---|
| 956 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 957 | + redoButton.setToolTipText("Next version"); |
---|
| 958 | + redoButton.addActionListener(this); |
---|
| 959 | + redoButton.setEnabled(false); |
---|
| 960 | + |
---|
| 961 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
573 | 962 | liveCB.setToolTipText("Enable animation"); |
---|
574 | 963 | liveCB.addItemListener(this); |
---|
575 | 964 | |
---|
576 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 965 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 966 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
578 | 967 | oneStepButton.addActionListener(this); |
---|
579 | 968 | |
---|
580 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 969 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
581 | 970 | fastCB.setToolTipText("Fast mode"); |
---|
582 | 971 | fastCB.addItemListener(this); |
---|
583 | 972 | |
---|
584 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
585 | | - trackCB.setToolTipText("Enable tracking"); |
---|
586 | | - trackCB.addItemListener(this); |
---|
587 | | - |
---|
588 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
589 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
590 | | - screenfitButton.addActionListener(this); |
---|
| 973 | + //oe.toolboxPanel.Return(); |
---|
| 974 | + |
---|
| 975 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 976 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 977 | +// trackCB.addItemListener(this); |
---|
591 | 978 | |
---|
592 | 979 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
593 | 980 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
597 | 984 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 985 | snapobjectButton.addActionListener(this); |
---|
599 | 986 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 987 | + |
---|
| 988 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 989 | + fourButton.addActionListener(this); |
---|
| 990 | + fourButton.setToolTipText("Show control panel only"); |
---|
600 | 991 | } |
---|
601 | 992 | |
---|
602 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
603 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
604 | | - flashSelectionButton.addActionListener(this); |
---|
| 993 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
605 | 994 | |
---|
606 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
607 | | - |
---|
608 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
609 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 995 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 996 | + twoButton.setToolTipText("Show 3D view only"); |
---|
610 | 997 | twoButton.addActionListener(this); |
---|
611 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
612 | | - fourButton.addActionListener(this); |
---|
613 | | - fourButton.setToolTipText("Show left panel only"); |
---|
614 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
615 | | - sixButton.setToolTipText("2-column layout left"); |
---|
616 | | - sixButton.addActionListener(this); |
---|
617 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
618 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 998 | + this.fullscreenLayout = twoButton; |
---|
| 999 | + |
---|
| 1000 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1001 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
619 | 1002 | threeButton.addActionListener(this); |
---|
620 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
621 | | - sevenButton.setToolTipText("3-column layout"); |
---|
622 | | - sevenButton.addActionListener(this); |
---|
| 1003 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1004 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1005 | + sixButton.addActionListener(this); |
---|
| 1006 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1007 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1008 | +// sevenButton.addActionListener(this); |
---|
623 | 1009 | // |
---|
624 | 1010 | |
---|
625 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
626 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 1011 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1012 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
627 | 1013 | rootButton.addActionListener(this); |
---|
628 | 1014 | |
---|
629 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1015 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
630 | 1016 | closeButton.setToolTipText("Close tab"); |
---|
631 | 1017 | closeButton.addActionListener(this); |
---|
632 | 1018 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
633 | 1019 | //clearButton.addActionListener(this); |
---|
634 | | - |
---|
635 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 1020 | + |
---|
| 1021 | + cGridBag row1 = new cGridBag(); |
---|
636 | 1022 | |
---|
637 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
638 | | - editButton.setToolTipText("Edit selection"); |
---|
| 1023 | + // INSERT |
---|
| 1024 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1025 | + gridButton.setToolTipText("Create grid"); |
---|
| 1026 | + gridButton.addActionListener(this); |
---|
| 1027 | + |
---|
| 1028 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1029 | + boxButton.setToolTipText("Create box"); |
---|
| 1030 | + boxButton.addActionListener(this); |
---|
| 1031 | + |
---|
| 1032 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1033 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1034 | + sphereButton.addActionListener(this); |
---|
| 1035 | + |
---|
| 1036 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1037 | + coneButton.setToolTipText("Create cone"); |
---|
| 1038 | + coneButton.addActionListener(this); |
---|
| 1039 | + |
---|
| 1040 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1041 | + torusButton.setToolTipText("Create torus"); |
---|
| 1042 | + torusButton.addActionListener(this); |
---|
| 1043 | + |
---|
| 1044 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1045 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1046 | + superButton.addActionListener(this); |
---|
| 1047 | + |
---|
| 1048 | + if (Globals.ADVANCED) |
---|
| 1049 | + { |
---|
| 1050 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1051 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 1052 | + kleinButton.addActionListener(this); |
---|
| 1053 | + } |
---|
| 1054 | + |
---|
| 1055 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1056 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 1057 | + particlesButton.addActionListener(this); |
---|
| 1058 | + |
---|
| 1059 | + oe.toolboxPanel.add(row1); |
---|
| 1060 | + |
---|
| 1061 | + cGridBag row2 = new cGridBag(); |
---|
| 1062 | + |
---|
| 1063 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1064 | + groupButton.setToolTipText("Create group"); |
---|
| 1065 | + groupButton.addActionListener(this); |
---|
| 1066 | + |
---|
| 1067 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1069 | + compositeButton.addActionListener(this); |
---|
| 1070 | + |
---|
| 1071 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1073 | + switchButton.addActionListener(this); |
---|
| 1074 | + |
---|
| 1075 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1076 | + loopButton.setToolTipText("Create loop"); |
---|
| 1077 | + loopButton.addActionListener(this); |
---|
| 1078 | + |
---|
| 1079 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1080 | + textureButton.setToolTipText("Create texture"); |
---|
| 1081 | + textureButton.addActionListener(this); |
---|
| 1082 | + |
---|
| 1083 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1084 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1085 | + overlayButton.addActionListener(this); |
---|
| 1086 | + |
---|
| 1087 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1088 | + lightButton.setToolTipText("Create light"); |
---|
| 1089 | + lightButton.addActionListener(this); |
---|
| 1090 | + |
---|
| 1091 | + oe.toolboxPanel.add(row2); |
---|
| 1092 | + |
---|
| 1093 | + // ENVYMAPS |
---|
| 1094 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1095 | + skyboxpane.preferredHeight = 100; |
---|
| 1096 | + |
---|
| 1097 | + oe.toolboxPanel.add(skyboxpane); |
---|
| 1098 | + |
---|
| 1099 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1100 | + skyboxpane.add(skyboxpanel); |
---|
| 1101 | + |
---|
| 1102 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1103 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1104 | + AddSkyboxTab2(skyboxpanel); |
---|
| 1105 | + AddSkyboxTab3(skyboxpanel); |
---|
| 1106 | + |
---|
| 1107 | + // EDIT panel |
---|
| 1108 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + editButton.setToolTipText("Pin selection controls"); |
---|
639 | 1110 | editButton.addActionListener(this); |
---|
640 | 1111 | |
---|
641 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
642 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 1112 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
643 | 1114 | uneditButton.addActionListener(this); |
---|
644 | 1115 | |
---|
645 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
646 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 1116 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 1117 | + allParamsButton.setToolTipText("Show all controle"); |
---|
647 | 1118 | allParamsButton.addActionListener(this); |
---|
648 | 1119 | |
---|
649 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1120 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
650 | 1121 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
651 | 1122 | clearPanelButton.addActionListener(this); |
---|
652 | 1123 | |
---|
653 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1124 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
654 | 1125 | unselectButton.setToolTipText("Unselect"); |
---|
655 | 1126 | unselectButton.addActionListener(this); |
---|
656 | 1127 | |
---|
657 | | - commandsPanel.preferredHeight = 1; |
---|
| 1128 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1130 | + flashSelectionButton.addActionListener(this); |
---|
658 | 1131 | |
---|
659 | | - oe.treePanel.add(commandsPanel); |
---|
660 | | - oe.treePanel.Return(); |
---|
| 1132 | + editCommandsPanel.preferredHeight = 1; |
---|
| 1133 | + |
---|
| 1134 | + SetPinStates(false); |
---|
| 1135 | +// oe.treePanel.add(commandsPanel); |
---|
| 1136 | +// oe.treePanel.Return(); |
---|
661 | 1137 | |
---|
662 | 1138 | // oe.aConstraints.gridx += 1; |
---|
663 | 1139 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
674 | 1150 | |
---|
675 | 1151 | JScrollPane jSP; |
---|
676 | 1152 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
677 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 1153 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
678 | 1154 | ResetModel(); |
---|
679 | 1155 | |
---|
680 | 1156 | oe.treePanel.add(jSPPanel); |
---|
681 | 1157 | oe.treePanel.Return(); |
---|
682 | 1158 | |
---|
683 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
684 | | - |
---|
685 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
686 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
687 | | - colorCB.addItemListener(this); |
---|
688 | | - |
---|
689 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
690 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
691 | | - materialCB.addItemListener(this); |
---|
692 | | - |
---|
693 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
694 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
695 | | - textureCB.addItemListener(this); |
---|
696 | | - |
---|
697 | | - copyOptionsPanel.preferredHeight = 1; |
---|
698 | 1159 | oe.treePanel.add(copyOptionsPanel); |
---|
699 | 1160 | oe.treePanel.Return(); |
---|
| 1161 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1162 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1163 | + sliderPane.preferredHeight = 1; |
---|
700 | 1164 | |
---|
701 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
702 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1165 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1166 | + mainPanel.setResizeWeight(0.4); |
---|
703 | 1167 | |
---|
704 | 1168 | //jList.addListSelectionListener(this); |
---|
705 | 1169 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
707 | 1171 | //jTree.setEditable(true); |
---|
708 | 1172 | oe.jTree.setDragEnabled(true); |
---|
709 | 1173 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
710 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1174 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
711 | 1175 | |
---|
712 | 1176 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
713 | 1177 | |
---|
.. | .. |
---|
719 | 1183 | dgr.addDragGestureListener(this); |
---|
720 | 1184 | }catch(Exception e) {} |
---|
721 | 1185 | */ |
---|
722 | | - radio.layout = sevenButton; |
---|
| 1186 | + radio.layout = threeButton; // sixButton; |
---|
723 | 1187 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
724 | 1188 | } |
---|
725 | 1189 | |
---|
726 | 1190 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
727 | 1191 | { |
---|
| 1192 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1193 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1194 | + colorCB.addItemListener(this); |
---|
| 1195 | + |
---|
| 1196 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1197 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1198 | + materialCB.addItemListener(this); |
---|
| 1199 | + |
---|
| 1200 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1201 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1202 | + textureCB.addItemListener(this); |
---|
| 1203 | + |
---|
| 1204 | + panel.Return(); |
---|
| 1205 | + |
---|
728 | 1206 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
729 | 1207 | boxCB.setToolTipText("Display bounding boxes"); |
---|
730 | 1208 | boxCB.addItemListener(this); |
---|
731 | 1209 | |
---|
732 | 1210 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
733 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1211 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
734 | 1212 | zoomBoxCB.addItemListener(this); |
---|
735 | 1213 | |
---|
736 | 1214 | if (true) // Globals.ADVANCED) |
---|
737 | 1215 | { |
---|
738 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
739 | | - supportCB.setToolTipText("Enable rigging"); |
---|
740 | | - supportCB.addItemListener(this); |
---|
| 1216 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1217 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1218 | +// supportCB.addItemListener(this); |
---|
| 1219 | + |
---|
| 1220 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1221 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1222 | + freezeCB.addItemListener(this); |
---|
741 | 1223 | |
---|
742 | 1224 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
743 | 1225 | // localCB.addItemListener(this); |
---|
744 | 1226 | |
---|
| 1227 | + panel.Return(); |
---|
| 1228 | + |
---|
745 | 1229 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
746 | 1230 | crowdCB.setToolTipText("Used for crowds"); |
---|
747 | 1231 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
750 | 1234 | smoothCB.setToolTipText("Snapping delay"); |
---|
751 | 1235 | smoothCB.addItemListener(this); |
---|
752 | 1236 | |
---|
753 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
754 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
755 | | - slowCB.addItemListener(this); |
---|
| 1237 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1238 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1239 | +// slowCB.addItemListener(this); |
---|
| 1240 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1241 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1242 | + minshaderCB.addItemListener(this); |
---|
756 | 1243 | |
---|
757 | 1244 | // constraints.gridy += 1; |
---|
758 | 1245 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
759 | 1246 | // speakerMocapCB.addItemListener(this); |
---|
760 | 1247 | |
---|
| 1248 | + panel.Return(); |
---|
| 1249 | + |
---|
761 | 1250 | if (false) |
---|
762 | 1251 | { |
---|
763 | 1252 | // handled in scripts |
---|
.. | .. |
---|
772 | 1261 | //constraints.gridy += 1; |
---|
773 | 1262 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
774 | 1263 | smoothfocusCB.addItemListener(this); |
---|
| 1264 | + panel.Return(); |
---|
775 | 1265 | } |
---|
776 | 1266 | |
---|
777 | 1267 | //constraints.gridx += 1; |
---|
778 | 1268 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
779 | 1269 | // debugCB.addItemListener(this); |
---|
780 | 1270 | |
---|
| 1271 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1272 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1273 | + trackCB.addItemListener(this); |
---|
| 1274 | + |
---|
781 | 1275 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 1276 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
782 | 1277 | oeilCB.addItemListener(this); |
---|
783 | 1278 | |
---|
| 1279 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 1280 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 1281 | + shadowCB.addItemListener(this); |
---|
| 1282 | + |
---|
| 1283 | + panel.Return(); |
---|
| 1284 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1285 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1286 | + toggleTextureCB.addItemListener(this); |
---|
| 1287 | + |
---|
| 1288 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1289 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1290 | + toggleSwitchCB.addItemListener(this); |
---|
| 1291 | + |
---|
| 1292 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1293 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1294 | + autokeepCB.addItemListener(this); |
---|
| 1295 | + |
---|
| 1296 | + panel.Return(); |
---|
| 1297 | + if (Globals.ADVANCED) |
---|
| 1298 | + { |
---|
784 | 1299 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
785 | 1300 | lookAtCB.setToolTipText("Look-at target"); |
---|
786 | 1301 | lookAtCB.addItemListener(this); |
---|
| 1302 | + } |
---|
787 | 1303 | |
---|
788 | 1304 | } |
---|
789 | 1305 | |
---|
790 | 1306 | cGridBag fill = new cGridBag(); |
---|
791 | | - |
---|
792 | 1307 | fill.preferredHeight = 200; |
---|
| 1308 | + cGridBag fill2 = new cGridBag(); |
---|
| 1309 | + fill2.preferredHeight = 200; |
---|
| 1310 | + cGridBag fill3 = new cGridBag(); |
---|
| 1311 | + fill3.preferredHeight = 200; |
---|
793 | 1312 | |
---|
794 | 1313 | panel.add(fill); |
---|
| 1314 | + panel.add(fill2); |
---|
| 1315 | + panel.add(fill3); |
---|
795 | 1316 | |
---|
796 | 1317 | } |
---|
797 | 1318 | |
---|
798 | 1319 | void EditObject(Object3D obj) |
---|
799 | 1320 | { |
---|
800 | 1321 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1322 | + |
---|
| 1323 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1324 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1325 | + if (!radioButton.hadMaterial) |
---|
| 1326 | + { |
---|
| 1327 | + obj.material = new cMaterial(); |
---|
| 1328 | + } |
---|
| 1329 | + |
---|
801 | 1330 | radioButton.SetObject(obj); |
---|
802 | | - radioButton.layout = sevenButton; |
---|
| 1331 | + radioButton.layout = threeButton; // sixButton; |
---|
803 | 1332 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
804 | 1333 | radioButton.addActionListener(this); |
---|
805 | 1334 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
809 | 1338 | |
---|
810 | 1339 | void SetupViews(ObjEditor oe) |
---|
811 | 1340 | { |
---|
| 1341 | + theFrame = this; |
---|
| 1342 | + |
---|
812 | 1343 | oe.SetupViews(); |
---|
813 | 1344 | |
---|
814 | 1345 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
817 | 1348 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
818 | 1349 | } |
---|
819 | 1350 | |
---|
820 | | - JCheckBox liveCB; |
---|
821 | | - JCheckBox supportCB; |
---|
822 | | - JCheckBox localCB; |
---|
823 | | - JCheckBox crowdCB; |
---|
824 | | - JCheckBox smoothCB; |
---|
825 | | - JCheckBox fastCB; |
---|
826 | | - JCheckBox slowCB; |
---|
827 | | - JCheckBox boxCB; |
---|
828 | | - JCheckBox zoomBoxCB; |
---|
829 | | - JCheckBox trackCB; |
---|
830 | | - JCheckBox smoothfocusCB; |
---|
| 1351 | + cToggleButton liveCB; |
---|
| 1352 | + cCheckBox supportCB; |
---|
| 1353 | + cCheckBox localCB; |
---|
| 1354 | + cCheckBox crowdCB; |
---|
| 1355 | + cCheckBox smoothCB; |
---|
| 1356 | + cCheckBox minshaderCB; |
---|
| 1357 | + |
---|
| 1358 | + cToggleButton fastCB; |
---|
| 1359 | + cCheckBox slowCB; |
---|
| 1360 | + cCheckBox boxCB; |
---|
| 1361 | + cCheckBox zoomBoxCB; |
---|
| 1362 | + cCheckBox freezeCB; |
---|
| 1363 | + //cToggleButton trackCB; |
---|
| 1364 | + cCheckBox trackCB; |
---|
| 1365 | + cCheckBox smoothfocusCB; |
---|
831 | 1366 | // JCheckBox speakerMocapCB; |
---|
832 | | - JCheckBox speakerCameraCB; |
---|
833 | | - JCheckBox speakerFocusCB; |
---|
834 | | - JCheckBox debugCB; |
---|
835 | | - JCheckBox oeilCB; |
---|
836 | | - JCheckBox lookAtCB; |
---|
| 1367 | + cCheckBox speakerCameraCB; |
---|
| 1368 | + cCheckBox speakerFocusCB; |
---|
| 1369 | + cCheckBox debugCB; |
---|
| 1370 | + |
---|
| 1371 | + cCheckBox oeilCB; |
---|
| 1372 | + cCheckBox shadowCB; |
---|
| 1373 | + cCheckBox autokeepCB; |
---|
| 1374 | + cCheckBox lookAtCB; |
---|
837 | 1375 | |
---|
838 | 1376 | // static int COLOR = 1; |
---|
839 | 1377 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
841 | 1379 | |
---|
842 | 1380 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
843 | 1381 | |
---|
844 | | - JCheckBox colorCB; |
---|
845 | | - JCheckBox materialCB; |
---|
846 | | - JCheckBox textureCB; |
---|
| 1382 | + cCheckBox colorCB; |
---|
| 1383 | + cCheckBox materialCB; |
---|
| 1384 | + cCheckBox textureCB; |
---|
847 | 1385 | |
---|
848 | 1386 | public void itemStateChanged(ItemEvent e) |
---|
849 | 1387 | { |
---|
.. | .. |
---|
871 | 1409 | } else if(e.getSource() == liveCB) |
---|
872 | 1410 | { |
---|
873 | 1411 | cameraView.ToggleLive(); |
---|
| 1412 | + refreshContents(false); |
---|
874 | 1413 | } |
---|
875 | 1414 | else if(e.getSource() == supportCB) |
---|
876 | 1415 | { |
---|
.. | .. |
---|
886 | 1425 | { |
---|
887 | 1426 | cameraView.ToggleInertia(); |
---|
888 | 1427 | cameraView.repaint(); |
---|
| 1428 | + } |
---|
| 1429 | + else if(e.getSource() == minshaderCB) |
---|
| 1430 | + { |
---|
| 1431 | + Globals.MINSHADER ^= true; |
---|
| 1432 | + cameraView.programInitialized = false; |
---|
| 1433 | + cameraView.repaint(); |
---|
889 | 1434 | } |
---|
890 | 1435 | else if(e.getSource() == localCB) |
---|
891 | 1436 | { |
---|
.. | .. |
---|
935 | 1480 | { |
---|
936 | 1481 | cameraView.ToggleOeil(); |
---|
937 | 1482 | } |
---|
| 1483 | + else if(e.getSource() == shadowCB) |
---|
| 1484 | + { |
---|
| 1485 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1486 | + } |
---|
| 1487 | + else if(e.getSource() == freezeCB) |
---|
| 1488 | + { |
---|
| 1489 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1490 | + } |
---|
| 1491 | + else if(e.getSource() == autokeepCB) |
---|
| 1492 | + { |
---|
| 1493 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1494 | + } |
---|
938 | 1495 | else if(e.getSource() == lookAtCB) |
---|
939 | 1496 | { |
---|
940 | 1497 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
951 | 1508 | |
---|
952 | 1509 | /**/ |
---|
953 | 1510 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
954 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1511 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1512 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
955 | 1513 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
956 | 1514 | // We can't move the root node or an empty selection |
---|
957 | 1515 | return; |
---|
.. | .. |
---|
1014 | 1572 | } |
---|
1015 | 1573 | } |
---|
1016 | 1574 | |
---|
1017 | | - String string = (String) object; |
---|
1018 | | - |
---|
1019 | 1575 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1020 | 1576 | // if( object instanceof java.io.File[]) |
---|
1021 | 1577 | // { |
---|
.. | .. |
---|
1023 | 1579 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1024 | 1580 | // return; |
---|
1025 | 1581 | // } |
---|
| 1582 | + |
---|
| 1583 | + String string = object.toString(); |
---|
1026 | 1584 | |
---|
1027 | 1585 | // File path for Mac and Windows |
---|
1028 | 1586 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1068 | 1626 | |
---|
1069 | 1627 | assert target == objEditor.jTree; |
---|
1070 | 1628 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1629 | + Object3D destinationLeaf; |
---|
1071 | 1630 | try { |
---|
1072 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1631 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1073 | 1632 | } catch (Exception e) { |
---|
1074 | 1633 | System.out.println("destinationPath : " + destinationPath); |
---|
1075 | 1634 | return; |
---|
1076 | 1635 | } |
---|
1077 | 1636 | |
---|
1078 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1637 | + for (int i=group.selection.size(); --i>=0;) |
---|
1079 | 1638 | { |
---|
| 1639 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1640 | + |
---|
| 1641 | + // Cannot move into itself |
---|
| 1642 | + if (child == destinationLeaf) |
---|
| 1643 | + return; |
---|
| 1644 | + } |
---|
| 1645 | + |
---|
| 1646 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1647 | +// { |
---|
1080 | 1648 | loadClipboard(true); |
---|
1081 | 1649 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1082 | 1650 | pasteInto(false, false); |
---|
1083 | | - } else { |
---|
1084 | | - loadClipboard(false); |
---|
1085 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1086 | | - pasteInto(false, false); // true); // ??? |
---|
1087 | | - } |
---|
| 1651 | +// } else { |
---|
| 1652 | +// loadClipboard(false); |
---|
| 1653 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1654 | +// pasteInto(false, false); // true); // ??? |
---|
| 1655 | +// } |
---|
1088 | 1656 | } |
---|
1089 | 1657 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1090 | 1658 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1189 | 1757 | { |
---|
1190 | 1758 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1191 | 1759 | //heightFieldItem.addActionListener(this); |
---|
1192 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1193 | | - gridItem.addActionListener(this); |
---|
1194 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1195 | | - rectoidItem.addActionListener(this); |
---|
1196 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1197 | | - ellipsoidItem.addActionListener(this); |
---|
1198 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1199 | | - coneItem.addActionListener(this); |
---|
1200 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1201 | | - torusItem.addActionListener(this); |
---|
1202 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1203 | | - superItem.addActionListener(this); |
---|
| 1760 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1761 | +// gridItem.addActionListener(this); |
---|
| 1762 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1763 | +// rectoidItem.addActionListener(this); |
---|
| 1764 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1765 | +// ellipsoidItem.addActionListener(this); |
---|
| 1766 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1767 | +// coneItem.addActionListener(this); |
---|
| 1768 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1769 | +// torusItem.addActionListener(this); |
---|
| 1770 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1771 | +// superItem.addActionListener(this); |
---|
| 1772 | + |
---|
| 1773 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1774 | + cameraItem.addActionListener(this); |
---|
| 1775 | + |
---|
| 1776 | + if (!Globals.ADVANCED) |
---|
| 1777 | + { |
---|
1204 | 1778 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1205 | 1779 | kleinItem.addActionListener(this); |
---|
1206 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1207 | | - particleItem.addActionListener(this); |
---|
| 1780 | + } |
---|
| 1781 | + |
---|
| 1782 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1783 | +// particleItem.addActionListener(this); |
---|
1208 | 1784 | if (Globals.ADVANCED) |
---|
1209 | 1785 | { |
---|
1210 | 1786 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1230 | 1806 | } |
---|
1231 | 1807 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1232 | 1808 | bezierItem.addActionListener(this); |
---|
1233 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1234 | | - overlayItem.addActionListener(this); |
---|
1235 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1236 | | - lightItem.addActionListener(this); |
---|
| 1809 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1810 | +// overlayItem.addActionListener(this); |
---|
| 1811 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1812 | +// lightItem.addActionListener(this); |
---|
1237 | 1813 | menu.add("-"); |
---|
1238 | 1814 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1239 | 1815 | //superLoopItem.addActionListener(this); |
---|
1240 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1241 | | - loopItem.addActionListener(this); |
---|
| 1816 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1817 | +// loopItem.addActionListener(this); |
---|
1242 | 1818 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1243 | 1819 | doubleItem.addActionListener(this); |
---|
1244 | 1820 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1254 | 1830 | animationItem.addItemListener(this); |
---|
1255 | 1831 | animationItem.setState(Globals.ANIMATION); |
---|
1256 | 1832 | |
---|
| 1833 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1834 | + archiveItem.addActionListener(this); |
---|
| 1835 | + |
---|
1257 | 1836 | menu.add("-"); |
---|
1258 | 1837 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1259 | 1838 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1266 | 1845 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1267 | 1846 | reduce34MorphItem.addActionListener(this); |
---|
1268 | 1847 | menu.add("-"); |
---|
| 1848 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1849 | + memoryItem.addActionListener(this); |
---|
1269 | 1850 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1270 | 1851 | computeAOItem.addActionListener(this); |
---|
1271 | 1852 | |
---|
.. | .. |
---|
1274 | 1855 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1275 | 1856 | mirrorItem.addActionListener(this); |
---|
1276 | 1857 | menu.add("-"); |
---|
1277 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1278 | | - memoryItem.addActionListener(this); |
---|
1279 | 1858 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1280 | 1859 | analyzeItem.addActionListener(this); |
---|
1281 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1860 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1282 | 1861 | dumpItem.addActionListener(this); |
---|
1283 | 1862 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1284 | 1863 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1419 | 1998 | shadow.material = new cMaterial(obj.material); |
---|
1420 | 1999 | shadow.material.diffuse = 0.0001f; |
---|
1421 | 2000 | shadow.material.specular = 0.0001f; |
---|
| 2001 | + //shadow.projectedVertices[1].x = 300; |
---|
1422 | 2002 | |
---|
1423 | 2003 | makeSomething(shadow); |
---|
1424 | 2004 | } |
---|
| 2005 | + |
---|
| 2006 | + private void ClearUnpinned() |
---|
| 2007 | + { |
---|
| 2008 | + //for (Object3D obj : listUI) |
---|
| 2009 | + for (int i=listUI.size(); --i>=0;) |
---|
| 2010 | + { |
---|
| 2011 | + Object3D obj = listUI.elementAt(i); |
---|
| 2012 | + if (!obj.pinned) |
---|
| 2013 | + { |
---|
| 2014 | + obj.CloseUI(); |
---|
| 2015 | + listUI.remove(i); |
---|
| 2016 | + } |
---|
| 2017 | + } |
---|
| 2018 | + } |
---|
| 2019 | + |
---|
| 2020 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2021 | + { |
---|
| 2022 | + // if (!(elem instanceof Composite)) |
---|
| 2023 | + // newWindow = false; |
---|
| 2024 | + listUI.add(elem); |
---|
| 2025 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2026 | + System.out.println("edit : " + elem); |
---|
| 2027 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 2028 | + } |
---|
1425 | 2029 | |
---|
1426 | 2030 | /** |
---|
1427 | 2031 | * applyExample |
---|
.. | .. |
---|
1666 | 2270 | { |
---|
1667 | 2271 | ScreenFit(); |
---|
1668 | 2272 | } else |
---|
1669 | | - if (source == switchItem) |
---|
| 2273 | + if (source == switchViewItem) |
---|
1670 | 2274 | { |
---|
1671 | 2275 | cVector v1 = new cVector(); |
---|
1672 | 2276 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1675 | 2279 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1676 | 2280 | objEditor.cameraView.repaint(); |
---|
1677 | 2281 | } else |
---|
1678 | | - if (source == rectoidItem) |
---|
| 2282 | + if (source == rectoidItem || source == boxButton) |
---|
1679 | 2283 | { |
---|
1680 | 2284 | makeSomething(new Box()); |
---|
1681 | 2285 | } else |
---|
1682 | | - if (source == particleItem) |
---|
| 2286 | + if (source == particleItem || source == particlesButton) |
---|
1683 | 2287 | { |
---|
1684 | 2288 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1685 | 2289 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1758 | 2362 | |
---|
1759 | 2363 | makeSomething(obj); |
---|
1760 | 2364 | } else |
---|
1761 | | - if (source == gridItem) |
---|
| 2365 | + if (source == gridItem || source == gridButton) |
---|
1762 | 2366 | { |
---|
1763 | 2367 | makeSomething(new Grid()); |
---|
1764 | 2368 | } else |
---|
1765 | | - if (source == ellipsoidItem) |
---|
| 2369 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1766 | 2370 | { |
---|
1767 | 2371 | makeSomething(new Sphere()); |
---|
1768 | 2372 | } else |
---|
1769 | | - if (source == coneItem) |
---|
| 2373 | + if (source == coneItem || source == coneButton) |
---|
1770 | 2374 | { |
---|
1771 | 2375 | makeSomething(new Cone()); |
---|
1772 | 2376 | } else |
---|
1773 | | - if (source == torusItem) |
---|
| 2377 | + if (source == torusItem || source == torusButton) |
---|
1774 | 2378 | { |
---|
1775 | 2379 | makeSomething(new Torus()); |
---|
1776 | 2380 | } else |
---|
1777 | | - if (source == superItem) |
---|
| 2381 | + if (source == superItem || source == superButton) |
---|
1778 | 2382 | { |
---|
1779 | 2383 | makeSomething(new Superellipsoid()); |
---|
1780 | 2384 | } else |
---|
1781 | | - if (source == kleinItem) |
---|
| 2385 | + if (source == kleinItem || source == kleinButton) |
---|
1782 | 2386 | { |
---|
1783 | 2387 | makeSomething(new Klein()); |
---|
1784 | 2388 | } else |
---|
.. | .. |
---|
1798 | 2402 | { |
---|
1799 | 2403 | makeSomething(new BezierSurface()); |
---|
1800 | 2404 | } else |
---|
1801 | | - if (source == overlayItem) |
---|
| 2405 | + if (source == overlayItem || source == overlayButton) |
---|
1802 | 2406 | { |
---|
1803 | 2407 | /* |
---|
1804 | 2408 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1846 | 2450 | s.setup(); |
---|
1847 | 2451 | makeSomething(s); |
---|
1848 | 2452 | } else |
---|
1849 | | - if (source == lightItem) |
---|
| 2453 | + if (source == lightItem || source == lightButton) |
---|
1850 | 2454 | { |
---|
1851 | 2455 | makeSomething(new Light()); |
---|
1852 | 2456 | } else |
---|
| 2457 | +// if (source == skybox1Button || |
---|
| 2458 | +// source == skybox2Button || |
---|
| 2459 | +// source == skybox3Button || |
---|
| 2460 | +// source == skybox4Button || |
---|
| 2461 | +// source == skybox5Button || |
---|
| 2462 | +// source == skybox6Button || |
---|
| 2463 | +// source == skybox7Button || |
---|
| 2464 | +// source == skybox11Button || |
---|
| 2465 | +// source == skybox12Button || |
---|
| 2466 | +// source == skybox13Button || |
---|
| 2467 | +// source == skybox14Button || |
---|
| 2468 | +// source == skybox15Button || |
---|
| 2469 | +// source == skybox16Button || |
---|
| 2470 | +// source == skybox17Button) |
---|
| 2471 | +// { |
---|
| 2472 | +// ChangeSkybox(source); |
---|
| 2473 | +// } else |
---|
1853 | 2474 | if (source == csgItem) |
---|
1854 | 2475 | { |
---|
1855 | 2476 | group(new CSG()); |
---|
.. | .. |
---|
1896 | 2517 | |
---|
1897 | 2518 | group(g); |
---|
1898 | 2519 | } else |
---|
1899 | | - if (source == loopItem) |
---|
| 2520 | + if (source == loopItem || source == loopButton) |
---|
1900 | 2521 | { |
---|
1901 | 2522 | Composite csg = new GroupLeaf(); |
---|
1902 | 2523 | csg.count = 5; |
---|
1903 | 2524 | group(csg); |
---|
1904 | | - Composite child = new cGroup(); |
---|
| 2525 | + Composite child = new cGroup("Branch"); |
---|
1905 | 2526 | csg.addChild(child); |
---|
1906 | 2527 | child.addChild(csg); |
---|
1907 | 2528 | } else |
---|
1908 | 2529 | if (source == doubleItem) |
---|
1909 | 2530 | { |
---|
1910 | | - Composite csg = new GroupLeaf(); |
---|
| 2531 | + Composite csg = new GroupLeaf("Fork"); |
---|
1911 | 2532 | csg.count = 5; |
---|
1912 | 2533 | group(csg); |
---|
1913 | | - Composite child = new cGroup(); |
---|
| 2534 | + Composite child = new cGroup("Branch A"); |
---|
1914 | 2535 | csg.addChild(child); |
---|
1915 | 2536 | child.addChild(csg); |
---|
1916 | | - child = new cGroup(); |
---|
| 2537 | + child = new cGroup("Branch B"); |
---|
1917 | 2538 | csg.addChild(child); |
---|
1918 | 2539 | child.addChild(csg); |
---|
1919 | 2540 | } else |
---|
1920 | 2541 | if (source == tripleItem) |
---|
1921 | 2542 | { |
---|
1922 | | - Composite csg = new GroupLeaf(); |
---|
| 2543 | + Composite csg = new GroupLeaf("Trident"); |
---|
1923 | 2544 | csg.count = 4; |
---|
1924 | 2545 | group(csg); |
---|
1925 | 2546 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1935 | 2556 | if (source == computeAOItem) |
---|
1936 | 2557 | { |
---|
1937 | 2558 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1938 | | - Globals.theRenderer.repaint(); |
---|
| 2559 | + cameraView.repaint(); |
---|
1939 | 2560 | } else |
---|
1940 | 2561 | if (source == recompileItem) |
---|
1941 | 2562 | { |
---|
.. | .. |
---|
1969 | 2590 | { |
---|
1970 | 2591 | DumpObject(); |
---|
1971 | 2592 | } else |
---|
| 2593 | + if (source == minButton) |
---|
| 2594 | + { |
---|
| 2595 | + Minimize(); |
---|
| 2596 | + } else |
---|
| 2597 | + if (source == maxButton) |
---|
| 2598 | + { |
---|
| 2599 | + Maximize(); |
---|
| 2600 | + } else |
---|
| 2601 | + if (source == fullButton) |
---|
| 2602 | + { |
---|
| 2603 | + ToggleFullScreen(); |
---|
| 2604 | + } else |
---|
1972 | 2605 | if (source == undoButton) |
---|
1973 | 2606 | { |
---|
| 2607 | + // Go to previous version |
---|
| 2608 | + //if (!Undo()) |
---|
| 2609 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
1974 | 2610 | Undo(); |
---|
| 2611 | + } else |
---|
| 2612 | + if (source == restoreButton) |
---|
| 2613 | + { |
---|
| 2614 | + // Restore current version |
---|
| 2615 | + Restore(); |
---|
| 2616 | + restoreButton.setEnabled(false); |
---|
| 2617 | + } else |
---|
| 2618 | + if (source == replaceButton) |
---|
| 2619 | + { |
---|
| 2620 | + // Overwrite current version |
---|
| 2621 | + Replace(); |
---|
| 2622 | + replaceButton.setEnabled(false); |
---|
1975 | 2623 | } else |
---|
1976 | 2624 | if (source == redoButton) |
---|
1977 | 2625 | { |
---|
| 2626 | + // Go to next version |
---|
1978 | 2627 | Redo(); |
---|
1979 | 2628 | } else |
---|
1980 | 2629 | if (source == saveButton) |
---|
1981 | 2630 | { |
---|
1982 | | - Save(); |
---|
| 2631 | + // Save a new version |
---|
| 2632 | + if (!Save(true)) |
---|
| 2633 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
1983 | 2634 | } else |
---|
1984 | 2635 | if (source == oneStepButton) |
---|
1985 | 2636 | { |
---|
.. | .. |
---|
1988 | 2639 | } else |
---|
1989 | 2640 | if (source == screenfitButton) |
---|
1990 | 2641 | { |
---|
1991 | | - //Reload(lastConverter, lastFilename, true); |
---|
1992 | 2642 | ScreenFit(); |
---|
1993 | 2643 | } else |
---|
1994 | 2644 | if (source == screenfitpointButton) |
---|
1995 | 2645 | { |
---|
1996 | | - //Reload(lastConverter, lastFilename, true); |
---|
1997 | 2646 | ScreenFitPoint(); |
---|
1998 | 2647 | } else |
---|
1999 | 2648 | if (source == snapobjectButton) |
---|
2000 | 2649 | { |
---|
2001 | | - //Reload(lastConverter, lastFilename, true); |
---|
2002 | 2650 | SnapObject(); |
---|
2003 | 2651 | } else |
---|
2004 | 2652 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2362 | 3010 | { |
---|
2363 | 3011 | StepAll(); |
---|
2364 | 3012 | } else |
---|
2365 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 3013 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2366 | 3014 | { |
---|
2367 | 3015 | //int indices[] = jList.getSelectedIndices(); |
---|
2368 | 3016 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2374 | 3022 | { |
---|
2375 | 3023 | ClearSelection(true); |
---|
2376 | 3024 | } else |
---|
2377 | | - if (source == grabItem) |
---|
| 3025 | + if (source == grabItem || source == groupButton) |
---|
2378 | 3026 | { |
---|
2379 | | - group(new cGroup(), true); |
---|
| 3027 | + group(new cGroup(), false); // true); |
---|
2380 | 3028 | } else |
---|
2381 | 3029 | if (source == hideItem) |
---|
2382 | 3030 | { |
---|
.. | .. |
---|
2394 | 3042 | { |
---|
2395 | 3043 | makeSomething(new Camera()); |
---|
2396 | 3044 | } else |
---|
2397 | | - if (source == compositeItem) |
---|
| 3045 | + if (source == compositeItem || source == compositeButton) |
---|
2398 | 3046 | { |
---|
2399 | 3047 | group(new Composite()); |
---|
2400 | 3048 | } else |
---|
2401 | | - if (source == randomItem) |
---|
| 3049 | + if (source == switchItem || source == switchButton) |
---|
2402 | 3050 | { |
---|
2403 | 3051 | RandomNode random = new RandomNode(); |
---|
2404 | 3052 | group(random); |
---|
.. | .. |
---|
2500 | 3148 | { |
---|
2501 | 3149 | group(new cLinker()); |
---|
2502 | 3150 | } else |
---|
2503 | | - if (source == textureItem) |
---|
| 3151 | + if (source == textureItem || source == textureButton) |
---|
2504 | 3152 | { |
---|
2505 | 3153 | group(new TextureNode()); |
---|
2506 | 3154 | } else |
---|
.. | .. |
---|
2520 | 3168 | { |
---|
2521 | 3169 | CastShadow(2); |
---|
2522 | 3170 | } else |
---|
2523 | | - if (source == ungroupItem) |
---|
| 3171 | + if (source == ungroupItem || source == ungroupButton) |
---|
2524 | 3172 | { |
---|
2525 | | - //ungroup(); |
---|
| 3173 | + boolean hasRoot = false; |
---|
| 3174 | + |
---|
2526 | 3175 | for (int i=0; i<group.selection.size(); i++) |
---|
2527 | 3176 | { |
---|
2528 | | - Ungroup(group.selection.get(i)); |
---|
| 3177 | + if (group.selection.get(i) == group) |
---|
| 3178 | + { |
---|
| 3179 | + hasRoot = true; |
---|
| 3180 | + break; |
---|
| 3181 | + } |
---|
2529 | 3182 | } |
---|
2530 | 3183 | |
---|
2531 | | - ClearSelection(false); |
---|
2532 | | - |
---|
2533 | | - refreshContents(); |
---|
| 3184 | + if (!hasRoot) |
---|
| 3185 | + { |
---|
| 3186 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3187 | + { |
---|
| 3188 | + Ungroup(group.selection.get(i)); |
---|
| 3189 | + } |
---|
| 3190 | + |
---|
| 3191 | + ClearSelection(false); |
---|
| 3192 | + |
---|
| 3193 | + refreshContents(); |
---|
| 3194 | + } |
---|
2534 | 3195 | } else |
---|
2535 | 3196 | if (source == genUVItem) |
---|
2536 | 3197 | { |
---|
.. | .. |
---|
2542 | 3203 | } else |
---|
2543 | 3204 | if (source == genNormalsMESHItem) |
---|
2544 | 3205 | { |
---|
2545 | | - GenNormals(true); // TODO |
---|
| 3206 | + GenNormalsMESH(); |
---|
2546 | 3207 | } else |
---|
2547 | 3208 | if (source == genNormalsORGANItem) |
---|
2548 | 3209 | { |
---|
.. | .. |
---|
2607 | 3268 | if (source == unmarkleavesItem) |
---|
2608 | 3269 | { |
---|
2609 | 3270 | MarkLeaves(false); |
---|
| 3271 | + } else |
---|
| 3272 | + if (source == rewindleavesItem) |
---|
| 3273 | + { |
---|
| 3274 | + RewindLeaves(true); |
---|
| 3275 | + } else |
---|
| 3276 | + if (source == unrewindleavesItem) |
---|
| 3277 | + { |
---|
| 3278 | + RewindLeaves(false); |
---|
| 3279 | + } else |
---|
| 3280 | + if (source == randomleavesItem) |
---|
| 3281 | + { |
---|
| 3282 | + RandomLeaves(true); |
---|
| 3283 | + } else |
---|
| 3284 | + if (source == unrandomleavesItem) |
---|
| 3285 | + { |
---|
| 3286 | + RandomLeaves(false); |
---|
2610 | 3287 | } else |
---|
2611 | 3288 | if (source == flipVItem) |
---|
2612 | 3289 | { |
---|
.. | .. |
---|
2815 | 3492 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2816 | 3493 | { |
---|
2817 | 3494 | obj = (Object3D)e.nextElement(); |
---|
2818 | | - obj.SetBumpTexture(null); |
---|
| 3495 | + obj.ResetBumpTexture(); |
---|
2819 | 3496 | } |
---|
2820 | 3497 | |
---|
2821 | 3498 | refreshContents(); |
---|
.. | .. |
---|
2831 | 3508 | |
---|
2832 | 3509 | refreshContents(); |
---|
2833 | 3510 | } else |
---|
| 3511 | + if (source == embedTexturesItem) |
---|
| 3512 | + { |
---|
| 3513 | + Object3D obj; |
---|
| 3514 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3515 | + { |
---|
| 3516 | + obj = (Object3D)e.nextElement(); |
---|
| 3517 | + obj.EmbedTextures(true); |
---|
| 3518 | + } |
---|
| 3519 | + |
---|
| 3520 | + refreshContents(); |
---|
| 3521 | + } else |
---|
| 3522 | + if (source == deEmbedTexturesItem) |
---|
| 3523 | + { |
---|
| 3524 | + Object3D obj; |
---|
| 3525 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3526 | + { |
---|
| 3527 | + obj = (Object3D)e.nextElement(); |
---|
| 3528 | + obj.EmbedTextures(false); |
---|
| 3529 | + } |
---|
| 3530 | + |
---|
| 3531 | + CameraPane.texturepigment.clear(); |
---|
| 3532 | + CameraPane.texturebump.clear(); |
---|
| 3533 | + |
---|
| 3534 | + refreshContents(); |
---|
| 3535 | + } else |
---|
2834 | 3536 | if (source == flashSelectionButton) |
---|
2835 | 3537 | { |
---|
2836 | 3538 | CameraPane.flash = true; |
---|
.. | .. |
---|
2842 | 3544 | if (source == twoButton) |
---|
2843 | 3545 | { |
---|
2844 | 3546 | radio.layout = twoButton; |
---|
| 3547 | + |
---|
| 3548 | + if (CameraPane.FULLSCREEN) |
---|
| 3549 | + fullscreenLayout = radio.layout; |
---|
| 3550 | + |
---|
2845 | 3551 | // bug |
---|
2846 | 3552 | //gridPanel.setDividerLocation(1.0); |
---|
2847 | 3553 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2874 | 3580 | bigThree.ClearUI(); |
---|
2875 | 3581 | bigThree.add(centralPanel); |
---|
2876 | 3582 | bigThree.FlushUI(); |
---|
| 3583 | + |
---|
| 3584 | + cameraView.requestFocusInWindow(); |
---|
| 3585 | + |
---|
| 3586 | +// refreshContents(true); |
---|
| 3587 | +// |
---|
| 3588 | +// try |
---|
| 3589 | +// { |
---|
| 3590 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3591 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3592 | +// bot.mouseMove(100, 100); |
---|
| 3593 | +// bot.mousePress(mask); |
---|
| 3594 | +// bot.mouseRelease(mask); |
---|
| 3595 | +// } |
---|
| 3596 | +// catch (Exception e) |
---|
| 3597 | +// { |
---|
| 3598 | +// |
---|
| 3599 | +// } |
---|
| 3600 | + |
---|
2877 | 3601 | } else |
---|
2878 | 3602 | if (source == threeButton) |
---|
2879 | 3603 | { |
---|
2880 | 3604 | radio.layout = threeButton; |
---|
| 3605 | + |
---|
| 3606 | + if (CameraPane.FULLSCREEN) |
---|
| 3607 | + fullscreenLayout = radio.layout; |
---|
2881 | 3608 | |
---|
2882 | 3609 | // bigThree.remove(scenePanel); |
---|
2883 | 3610 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2907 | 3634 | // centralPanel.setVisible(true); |
---|
2908 | 3635 | // XYZPanel.setVisible(true); |
---|
2909 | 3636 | bigThree.ClearUI(); |
---|
| 3637 | + bigThree.add(scenePanel); |
---|
2910 | 3638 | bigThree.add(centralPanel); |
---|
2911 | | - bigThree.add(XYZPanel); |
---|
2912 | 3639 | bigThree.FlushUI(); |
---|
| 3640 | + |
---|
| 3641 | + cameraView.requestFocusInWindow(); |
---|
2913 | 3642 | } else |
---|
2914 | 3643 | if (source == fourButton) |
---|
2915 | 3644 | { |
---|
2916 | 3645 | radio.layout = fourButton; |
---|
| 3646 | + |
---|
| 3647 | + if (CameraPane.FULLSCREEN) |
---|
| 3648 | + fullscreenLayout = radio.layout; |
---|
2917 | 3649 | |
---|
2918 | 3650 | // bigThree.remove(scenePanel); |
---|
2919 | 3651 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2945 | 3677 | bigThree.ClearUI(); |
---|
2946 | 3678 | bigThree.add(scenePanel); |
---|
2947 | 3679 | bigThree.FlushUI(); |
---|
| 3680 | + |
---|
| 3681 | + cameraView.requestFocusInWindow(); |
---|
2948 | 3682 | } else |
---|
2949 | 3683 | if (source == sixButton) |
---|
2950 | 3684 | { |
---|
2951 | 3685 | radio.layout = sixButton; |
---|
| 3686 | + |
---|
| 3687 | + if (CameraPane.FULLSCREEN) |
---|
| 3688 | + fullscreenLayout = radio.layout; |
---|
2952 | 3689 | |
---|
2953 | 3690 | // bigThree.remove(scenePanel); |
---|
2954 | 3691 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2978 | 3715 | // centralPanel.setVisible(true); |
---|
2979 | 3716 | // XYZPanel.setVisible(false); |
---|
2980 | 3717 | bigThree.ClearUI(); |
---|
2981 | | - bigThree.add(scenePanel); |
---|
2982 | 3718 | bigThree.add(centralPanel); |
---|
| 3719 | + bigThree.add(scenePanel); |
---|
2983 | 3720 | bigThree.FlushUI(); |
---|
| 3721 | + |
---|
| 3722 | + cameraView.requestFocusInWindow(); |
---|
2984 | 3723 | } else |
---|
2985 | 3724 | if (source == sevenButton) |
---|
2986 | 3725 | { |
---|
2987 | 3726 | radio.layout = sevenButton; |
---|
| 3727 | + |
---|
| 3728 | + if (CameraPane.FULLSCREEN) |
---|
| 3729 | + fullscreenLayout = radio.layout; |
---|
2988 | 3730 | |
---|
2989 | 3731 | // bigThree.remove(scenePanel); |
---|
2990 | 3732 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3018 | 3760 | bigThree.add(centralPanel); |
---|
3019 | 3761 | bigThree.add(XYZPanel); |
---|
3020 | 3762 | bigThree.FlushUI(); |
---|
| 3763 | + |
---|
| 3764 | + cameraView.requestFocusInWindow(); |
---|
3021 | 3765 | } else |
---|
3022 | 3766 | if (source == rootButton) |
---|
3023 | 3767 | { |
---|
.. | .. |
---|
3029 | 3773 | EditObject(obj); |
---|
3030 | 3774 | } |
---|
3031 | 3775 | |
---|
| 3776 | + cameraView.requestFocusInWindow(); |
---|
3032 | 3777 | refreshContents(true); |
---|
3033 | 3778 | } else |
---|
3034 | 3779 | if (source == closeButton) |
---|
.. | .. |
---|
3038 | 3783 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3039 | 3784 | { |
---|
3040 | 3785 | ab = (cRadio)e.nextElement(); |
---|
3041 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3786 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3042 | 3787 | { |
---|
| 3788 | + // Patch to avoid bug with transparency. |
---|
| 3789 | + if (!ab.hadMaterial) |
---|
| 3790 | + { |
---|
| 3791 | + ab.object.material = null; |
---|
| 3792 | + } |
---|
| 3793 | + |
---|
3043 | 3794 | buttonGroup.remove(ab); |
---|
3044 | 3795 | radioPanel.remove(ab); |
---|
3045 | 3796 | |
---|
3046 | | - ab.GetObject().editWindow = null; |
---|
| 3797 | + //ab.GetObject().editWindow = null; |
---|
| 3798 | + ab.GetObject().manipWindow = null; |
---|
3047 | 3799 | // ab.GetObject().objectUI = null; // ????????? |
---|
3048 | 3800 | |
---|
3049 | 3801 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3050 | 3802 | break; |
---|
3051 | 3803 | } |
---|
3052 | 3804 | } |
---|
| 3805 | + |
---|
| 3806 | + cameraView.requestFocusInWindow(); |
---|
3053 | 3807 | refreshContents(true); |
---|
3054 | 3808 | } else |
---|
3055 | 3809 | if (source == editItem || source == editButton) |
---|
3056 | 3810 | { |
---|
| 3811 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3812 | + { |
---|
| 3813 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3814 | + child.pinned = true; |
---|
| 3815 | + } |
---|
| 3816 | + |
---|
3057 | 3817 | EditSelection(false); |
---|
3058 | 3818 | } else |
---|
3059 | 3819 | if (source == uneditButton) |
---|
.. | .. |
---|
3062 | 3822 | { |
---|
3063 | 3823 | Object3D child = (Object3D)e.nextElement(); |
---|
3064 | 3824 | if(child.editWindow != null) |
---|
3065 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3825 | + child.pinned = false; |
---|
3066 | 3826 | child.CloseUI(); |
---|
3067 | 3827 | listUI.remove(child); |
---|
| 3828 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3068 | 3829 | |
---|
3069 | 3830 | //child.editWindow = null; // ??????????? |
---|
3070 | 3831 | } |
---|
.. | .. |
---|
3079 | 3840 | //copy.ClearUI(); |
---|
3080 | 3841 | for (Object3D obj : listUI) |
---|
3081 | 3842 | { |
---|
| 3843 | + obj.pinned = false; |
---|
3082 | 3844 | obj.CloseUI(); |
---|
3083 | 3845 | } |
---|
3084 | 3846 | listUI.clear(); |
---|
| 3847 | + SetPinStates(group.selection.size() > 0); |
---|
3085 | 3848 | refreshContents(true); |
---|
3086 | 3849 | } else |
---|
3087 | 3850 | if (source == allParamsButton) |
---|
3088 | 3851 | { |
---|
3089 | 3852 | assert(copy == group); |
---|
3090 | 3853 | |
---|
3091 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3854 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3092 | 3855 | |
---|
3093 | 3856 | for (Object3D obj : listUI) |
---|
3094 | 3857 | { |
---|
.. | .. |
---|
3137 | 3900 | } |
---|
3138 | 3901 | |
---|
3139 | 3902 | copy = group; |
---|
| 3903 | + |
---|
| 3904 | + SetUndoStates(); |
---|
| 3905 | + |
---|
3140 | 3906 | //Globals.theRenderer.object = group; |
---|
3141 | 3907 | if(!useclient) |
---|
3142 | 3908 | { |
---|
.. | .. |
---|
3154 | 3920 | } |
---|
3155 | 3921 | |
---|
3156 | 3922 | // fix "+" issue |
---|
3157 | | - group.editWindow = this; |
---|
| 3923 | + //group.editWindow = this; |
---|
| 3924 | + group.manipWindow = this; |
---|
3158 | 3925 | |
---|
3159 | 3926 | /* |
---|
3160 | 3927 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3162 | 3929 | currentLayout = sevenButton; |
---|
3163 | 3930 | */ |
---|
3164 | 3931 | radio.layout.doClick(); |
---|
| 3932 | + |
---|
| 3933 | + ClearUnpinned(); |
---|
| 3934 | + |
---|
| 3935 | + //Grafreed.Assert(group != null); |
---|
| 3936 | + //Grafreed.Assert(group.selection != null); |
---|
| 3937 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3938 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3939 | + EditSelection(false); |
---|
3165 | 3940 | keepparent = group.parent; |
---|
3166 | 3941 | // PARENT = NULL or not??? |
---|
3167 | 3942 | //group.parent = null; // ROOT |
---|
3168 | 3943 | //group.attributes = -1; |
---|
3169 | 3944 | ResetModel(); |
---|
| 3945 | + |
---|
| 3946 | + cameraView.requestFocusInWindow(); |
---|
3170 | 3947 | refreshContents(true); |
---|
3171 | 3948 | } else if (event.getSource() == editCameraItem) |
---|
3172 | 3949 | { |
---|
3173 | 3950 | cameraView.ProtectCamera(); |
---|
| 3951 | + cameraView.requestFocusInWindow(); |
---|
3174 | 3952 | cameraView.repaint(); |
---|
3175 | 3953 | return; |
---|
3176 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3954 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3177 | 3955 | { |
---|
3178 | 3956 | cameraView.RevertCamera(); |
---|
| 3957 | + cameraView.requestFocusInWindow(); |
---|
3179 | 3958 | cameraView.repaint(); |
---|
3180 | 3959 | return; |
---|
3181 | 3960 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
3190 | 3969 | } |
---|
3191 | 3970 | |
---|
3192 | 3971 | boolean useclient = false; |
---|
3193 | | - cRadio radio; |
---|
3194 | 3972 | |
---|
3195 | 3973 | void ToggleRoot() |
---|
3196 | 3974 | { |
---|
.. | .. |
---|
3515 | 4293 | refreshContents(); |
---|
3516 | 4294 | } |
---|
3517 | 4295 | |
---|
| 4296 | + void GenNormalsMESH() |
---|
| 4297 | + { |
---|
| 4298 | + group.GenNormalsMeshS(); |
---|
| 4299 | + |
---|
| 4300 | + refreshContents(); |
---|
| 4301 | + } |
---|
| 4302 | + |
---|
3518 | 4303 | void GenNormalsMINE() |
---|
3519 | 4304 | { |
---|
3520 | 4305 | group.selection.GenNormalsMINE(); |
---|
.. | .. |
---|
3746 | 4531 | |
---|
3747 | 4532 | try |
---|
3748 | 4533 | { |
---|
3749 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4534 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
3750 | 4535 | } |
---|
3751 | 4536 | catch (Exception e) |
---|
3752 | 4537 | { |
---|
.. | .. |
---|
4138 | 4923 | refreshContents(); |
---|
4139 | 4924 | } |
---|
4140 | 4925 | |
---|
| 4926 | + void RewindLeaves(boolean hide) |
---|
| 4927 | + { |
---|
| 4928 | + group.selection.RewindLeaves(hide); |
---|
| 4929 | + refreshContents(); |
---|
| 4930 | + } |
---|
| 4931 | + |
---|
| 4932 | + void RandomLeaves(boolean hide) |
---|
| 4933 | + { |
---|
| 4934 | + group.selection.RandomLeaves(hide); |
---|
| 4935 | + refreshContents(); |
---|
| 4936 | + } |
---|
| 4937 | + |
---|
4141 | 4938 | void SetTexRes(int tr) |
---|
4142 | 4939 | { |
---|
4143 | 4940 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4209 | 5006 | // } |
---|
4210 | 5007 | // } |
---|
4211 | 5008 | |
---|
4212 | | - static boolean allparams = true; |
---|
4213 | | - |
---|
4214 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4215 | | - |
---|
4216 | 5009 | void EditSelection(boolean newWindow) |
---|
4217 | 5010 | { |
---|
| 5011 | + if (group.selection == null) |
---|
| 5012 | + { |
---|
| 5013 | + EditElement(group, newWindow); // ? new |
---|
| 5014 | + return; |
---|
| 5015 | + } |
---|
| 5016 | + |
---|
4218 | 5017 | // aConstraints.gridy = 0; |
---|
4219 | 5018 | for (int i=0; i<group.selection.size(); i++) |
---|
4220 | 5019 | { |
---|
4221 | 5020 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4222 | 5021 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4223 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 5022 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4224 | 5023 | |
---|
4225 | 5024 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4226 | 5025 | if(elem != group || !newWindow) |
---|
4227 | 5026 | { |
---|
4228 | | - // if (!(elem instanceof Composite)) |
---|
4229 | | - // newWindow = false; |
---|
4230 | | - listUI.add(elem); |
---|
4231 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4232 | | - System.out.println("edit : " + elem); |
---|
4233 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5027 | + EditElement(elem, newWindow); // ? new |
---|
4234 | 5028 | } |
---|
4235 | 5029 | } |
---|
4236 | 5030 | } |
---|
.. | .. |
---|
4293 | 5087 | |
---|
4294 | 5088 | freezemodel = false; |
---|
4295 | 5089 | } |
---|
4296 | | - |
---|
4297 | | - boolean flashIt = true; |
---|
4298 | | - |
---|
| 5090 | + |
---|
4299 | 5091 | public void valueChanged(TreeSelectionEvent e) |
---|
4300 | 5092 | //public boolean handleEvent(Event event) |
---|
4301 | 5093 | { |
---|
.. | .. |
---|
4305 | 5097 | //new Exception().printStackTrace(); |
---|
4306 | 5098 | |
---|
4307 | 5099 | freezemodel = true; |
---|
4308 | | - |
---|
| 5100 | + ClearUnpinned(); |
---|
| 5101 | + |
---|
4309 | 5102 | /**/ |
---|
4310 | 5103 | //switch (event.id) |
---|
4311 | 5104 | { |
---|
.. | .. |
---|
4313 | 5106 | //case 702: // Event.LIST_DESELECT |
---|
4314 | 5107 | group.deselectAll(); |
---|
4315 | 5108 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4316 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4317 | 5109 | if (tps != null) |
---|
4318 | 5110 | { |
---|
4319 | 5111 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4322 | 5114 | |
---|
4323 | 5115 | //if (child.parent != null) |
---|
4324 | 5116 | //child.parent.addSelectee(child); |
---|
| 5117 | + objEditor.SetMaterial(child); |
---|
4325 | 5118 | group.addSelectee(child); |
---|
4326 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4327 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4328 | | - System.err.println("info : " + child.GetPath()); |
---|
4329 | 5119 | } |
---|
4330 | 5120 | } |
---|
4331 | 5121 | // else |
---|
.. | .. |
---|
4335 | 5125 | // System.err.println("info : " + group.GetPath()); |
---|
4336 | 5126 | // } |
---|
4337 | 5127 | |
---|
4338 | | - objEditor.SetText(); // jan 2014 |
---|
4339 | | - |
---|
4340 | 5128 | if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4341 | 5129 | CameraPane.flash = true; |
---|
4342 | 5130 | |
---|
4343 | 5131 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4344 | 5132 | // a camera |
---|
4345 | 5133 | { |
---|
4346 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 5134 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4347 | 5135 | { |
---|
4348 | 5136 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4349 | 5137 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4352 | 5140 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4353 | 5141 | } |
---|
4354 | 5142 | |
---|
| 5143 | + if (tps != null && tps.length == 1) |
---|
| 5144 | + { |
---|
| 5145 | + EditSelection(false); |
---|
| 5146 | + } |
---|
| 5147 | + |
---|
| 5148 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5149 | + |
---|
4355 | 5150 | refreshContents(); |
---|
4356 | 5151 | //return true; |
---|
4357 | 5152 | } |
---|
.. | .. |
---|
4360 | 5155 | |
---|
4361 | 5156 | freezemodel = false; |
---|
4362 | 5157 | } |
---|
| 5158 | + |
---|
| 5159 | + void SetPinStates(boolean enabled) |
---|
| 5160 | + { |
---|
| 5161 | + editButton.setEnabled(enabled); |
---|
| 5162 | + uneditButton.setEnabled(enabled); |
---|
| 5163 | + unselectButton.setEnabled(enabled); |
---|
| 5164 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5165 | + |
---|
| 5166 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5167 | + } |
---|
| 5168 | + |
---|
| 5169 | + void refreshContents(boolean cp) |
---|
| 5170 | + { |
---|
| 5171 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5172 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 5173 | + { |
---|
| 5174 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 5175 | + |
---|
| 5176 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 5177 | + { |
---|
| 5178 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 5179 | + |
---|
| 5180 | + objEditor.AddInfo(child, this, true); |
---|
| 5181 | + System.err.println("info : " + child.GetPath()); |
---|
| 5182 | + } |
---|
| 5183 | + |
---|
| 5184 | + objEditor.SetText(); // jan 2014 |
---|
| 5185 | + } |
---|
| 5186 | + |
---|
| 5187 | + super.refreshContents(cp); |
---|
| 5188 | + } |
---|
4363 | 5189 | |
---|
4364 | 5190 | void linkSomething(Object3D thing) |
---|
4365 | 5191 | { |
---|
.. | .. |
---|
4442 | 5268 | |
---|
4443 | 5269 | if (cut) |
---|
4444 | 5270 | { |
---|
4445 | | - Save(); |
---|
| 5271 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5272 | +// Save(); |
---|
4446 | 5273 | //int indices[] = jList.getSelectedIndices(); |
---|
4447 | 5274 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4448 | 5275 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4545 | 5372 | |
---|
4546 | 5373 | void paste(boolean expand) |
---|
4547 | 5374 | { |
---|
| 5375 | + if (Globals.REPLACEONMAKE) |
---|
| 5376 | + Save(); |
---|
| 5377 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5378 | + Globals.REPLACEONMAKE = false; |
---|
4548 | 5379 | // if (GrafreeD.clipboard == null) |
---|
4549 | 5380 | // return; |
---|
4550 | 5381 | boolean first = true; |
---|
.. | .. |
---|
4604 | 5435 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4605 | 5436 | } |
---|
4606 | 5437 | |
---|
| 5438 | + Globals.REPLACEONMAKE = keep; |
---|
4607 | 5439 | ResetModel(); |
---|
4608 | 5440 | refreshContents(); |
---|
4609 | 5441 | } |
---|
.. | .. |
---|
4739 | 5571 | |
---|
4740 | 5572 | void group(Object3D csg, boolean grab) |
---|
4741 | 5573 | { |
---|
| 5574 | + if (Globals.REPLACEONMAKE) |
---|
| 5575 | + Save(); |
---|
| 5576 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5577 | + Globals.REPLACEONMAKE = false; |
---|
4742 | 5578 | if (//false) // why?? |
---|
4743 | 5579 | !group.selection.isEmpty()) |
---|
4744 | 5580 | { |
---|
.. | .. |
---|
4852 | 5688 | //node.add(csg); |
---|
4853 | 5689 | //makeSomething(node); |
---|
4854 | 5690 | makeSomething(csg); |
---|
| 5691 | + Globals.REPLACEONMAKE = keep; |
---|
4855 | 5692 | } |
---|
4856 | 5693 | |
---|
4857 | 5694 | void Ungroup(Object3D g) |
---|
4858 | 5695 | { |
---|
| 5696 | + if (Globals.REPLACEONMAKE) |
---|
| 5697 | + Save(); |
---|
| 5698 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5699 | + Globals.REPLACEONMAKE = false; |
---|
4859 | 5700 | if (g instanceof HiddenObject) |
---|
4860 | 5701 | { |
---|
4861 | 5702 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4872 | 5713 | objEditor.makeSomething(g.get(i), false); |
---|
4873 | 5714 | } |
---|
4874 | 5715 | } |
---|
| 5716 | + Globals.REPLACEONMAKE = keep; |
---|
4875 | 5717 | } |
---|
4876 | 5718 | |
---|
4877 | 5719 | void ungroup() |
---|
.. | .. |
---|
5160 | 6002 | cButton clearpanelButton; |
---|
5161 | 6003 | cButton unselectButton; |
---|
5162 | 6004 | |
---|
| 6005 | + cButton restoreCameraButton; |
---|
| 6006 | + |
---|
5163 | 6007 | cButton saveButton; |
---|
5164 | | - cButton undoButton; |
---|
5165 | | - cButton redoButton; |
---|
5166 | 6008 | cButton oneStepButton; |
---|
| 6009 | + |
---|
| 6010 | + cButton groupButton; |
---|
| 6011 | + cButton ungroupButton; |
---|
| 6012 | + cButton compositeButton; |
---|
| 6013 | + cButton switchButton; |
---|
| 6014 | + cButton loopButton; |
---|
| 6015 | + cButton textureButton; |
---|
| 6016 | + |
---|
| 6017 | + cButton skybox1Button; |
---|
| 6018 | + cButton skybox2Button; |
---|
| 6019 | + cButton skybox3Button; |
---|
| 6020 | + cButton skybox4Button; |
---|
| 6021 | + cButton skybox5Button; |
---|
| 6022 | + cButton skybox6Button; |
---|
| 6023 | + cButton skybox7Button; |
---|
| 6024 | + |
---|
| 6025 | + cButton skybox11Button; |
---|
| 6026 | + cButton skybox12Button; |
---|
| 6027 | + cButton skybox13Button; |
---|
| 6028 | + cButton skybox14Button; |
---|
| 6029 | + cButton skybox15Button; |
---|
| 6030 | + cButton skybox16Button; |
---|
| 6031 | + cButton skybox17Button; |
---|
| 6032 | + |
---|
| 6033 | + cButton gridButton; |
---|
| 6034 | + cButton boxButton; |
---|
| 6035 | + cButton sphereButton; |
---|
| 6036 | + cButton coneButton; |
---|
| 6037 | + cButton torusButton; |
---|
| 6038 | + cButton superButton; |
---|
| 6039 | + cButton kleinButton; |
---|
| 6040 | + cButton particlesButton; |
---|
| 6041 | + cButton overlayButton; |
---|
| 6042 | + cButton lightButton; |
---|
5167 | 6043 | |
---|
5168 | 6044 | cButton screenfitButton; |
---|
5169 | 6045 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5176 | 6052 | |
---|
5177 | 6053 | cButton setsupportButton; |
---|
5178 | 6054 | |
---|
5179 | | - cButton twoButton; |
---|
5180 | | - cButton sixButton; |
---|
5181 | | - cButton threeButton; |
---|
5182 | | - cButton sevenButton; |
---|
5183 | | - cButton fourButton; // full panel |
---|
5184 | | - cButton oneButton; // full XYZ |
---|
5185 | | - //cButton currentLayout; |
---|
5186 | | - |
---|
5187 | 6055 | // |
---|
5188 | 6056 | //Composite |
---|
5189 | 6057 | Object3D // to do !! |
---|
.. | .. |
---|
5193 | 6061 | //JTree jTree; |
---|
5194 | 6062 | private MenuItem lookAtItem; |
---|
5195 | 6063 | private MenuItem lookFromItem; |
---|
5196 | | - private MenuItem switchItem; |
---|
| 6064 | + private MenuItem switchViewItem; |
---|
5197 | 6065 | private MenuItem cutItem; |
---|
5198 | 6066 | private MenuItem undoItem; |
---|
5199 | 6067 | private MenuItem redoItem; |
---|
5200 | | - private MenuItem duplicateItem; |
---|
| 6068 | + private JMenuItem duplicateItem; |
---|
5201 | 6069 | private MenuItem cloneItem; |
---|
5202 | 6070 | private MenuItem cloneSupportItem; |
---|
5203 | 6071 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5225 | 6093 | private MenuItem pasteLinkItem; |
---|
5226 | 6094 | private MenuItem pasteCloneItem; |
---|
5227 | 6095 | private MenuItem pasteExpandItem; |
---|
5228 | | - private MenuItem clearItem; |
---|
| 6096 | + private MenuItem deleteItem; |
---|
5229 | 6097 | private MenuItem clearAllItem; |
---|
5230 | 6098 | private MenuItem genUVItem; |
---|
5231 | 6099 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5260 | 6128 | private MenuItem showleavesItem; |
---|
5261 | 6129 | private MenuItem markleavesItem; |
---|
5262 | 6130 | private MenuItem unmarkleavesItem; |
---|
| 6131 | + private MenuItem rewindleavesItem; |
---|
| 6132 | + private MenuItem unrewindleavesItem; |
---|
| 6133 | + private MenuItem randomleavesItem; |
---|
| 6134 | + private MenuItem unrandomleavesItem; |
---|
5263 | 6135 | |
---|
5264 | 6136 | private MenuItem flipVItem; |
---|
5265 | 6137 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5281 | 6153 | private MenuItem frontItem; |
---|
5282 | 6154 | private MenuItem cameraItem; |
---|
5283 | 6155 | private MenuItem compositeItem; |
---|
5284 | | - private MenuItem randomItem; |
---|
| 6156 | + private MenuItem switchItem; |
---|
5285 | 6157 | private MenuItem physicsItem; |
---|
5286 | 6158 | private MenuItem frameselectorItem; |
---|
5287 | 6159 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5305 | 6177 | private MenuItem attachBumpItem; |
---|
5306 | 6178 | private MenuItem detachBumpItem; |
---|
5307 | 6179 | private MenuItem pigmentBumpItem; |
---|
| 6180 | + private MenuItem embedTexturesItem; |
---|
| 6181 | + private MenuItem deEmbedTexturesItem; |
---|
5308 | 6182 | |
---|
5309 | 6183 | private MenuItem particleItem; |
---|
5310 | 6184 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5355 | 6229 | |
---|
5356 | 6230 | Menu cameraMenu; |
---|
5357 | 6231 | MenuItem editCameraItem; |
---|
5358 | | - MenuItem revertCameraItem; |
---|
| 6232 | + MenuItem restoreCameraItem; |
---|
5359 | 6233 | } |
---|