.. | .. |
---|
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"); |
---|
570 | | - saveButton.addActionListener(this); |
---|
| 922 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 923 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 924 | + fullButton.addActionListener(this); |
---|
571 | 925 | |
---|
572 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 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(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 935 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 936 | + saveVersionButton.addActionListener(this); |
---|
| 937 | + |
---|
| 938 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 939 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 940 | + deleteVersionButton.addActionListener(this); |
---|
| 941 | + |
---|
| 942 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 943 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 944 | + previousVersionButton.addActionListener(this); |
---|
| 945 | + previousVersionButton.setEnabled(false); |
---|
| 946 | + |
---|
| 947 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 948 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 949 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
| 950 | + restoreButton.addActionListener(this); |
---|
| 951 | + //restoreButton.setEnabled(false); |
---|
| 952 | + |
---|
| 953 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 954 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
| 955 | + replaceButton.addActionListener(this); |
---|
| 956 | + //replaceButton.setEnabled(false); |
---|
| 957 | + |
---|
| 958 | + copyOptionsPanel.add(updown); |
---|
| 959 | + |
---|
| 960 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 961 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 962 | + nextVersionButton.addActionListener(this); |
---|
| 963 | + nextVersionButton.setEnabled(false); |
---|
| 964 | + |
---|
| 965 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
573 | 966 | liveCB.setToolTipText("Enable animation"); |
---|
574 | 967 | liveCB.addItemListener(this); |
---|
575 | 968 | |
---|
576 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 969 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 970 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
578 | 971 | oneStepButton.addActionListener(this); |
---|
579 | 972 | |
---|
580 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 973 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
581 | 974 | fastCB.setToolTipText("Fast mode"); |
---|
582 | 975 | fastCB.addItemListener(this); |
---|
583 | 976 | |
---|
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); |
---|
| 977 | + //oe.toolboxPanel.Return(); |
---|
| 978 | + |
---|
| 979 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 980 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 981 | +// trackCB.addItemListener(this); |
---|
591 | 982 | |
---|
592 | 983 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
593 | 984 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
597 | 988 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 989 | snapobjectButton.addActionListener(this); |
---|
599 | 990 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 991 | + |
---|
| 992 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 993 | + fourButton.addActionListener(this); |
---|
| 994 | + fourButton.setToolTipText("Show control panel only"); |
---|
600 | 995 | } |
---|
601 | 996 | |
---|
602 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
603 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
604 | | - flashSelectionButton.addActionListener(this); |
---|
| 997 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
605 | 998 | |
---|
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"); |
---|
| 999 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1000 | + twoButton.setToolTipText("Show 3D view only"); |
---|
610 | 1001 | 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"); |
---|
| 1002 | + this.fullscreenLayout = twoButton; |
---|
| 1003 | + |
---|
| 1004 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1005 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
619 | 1006 | threeButton.addActionListener(this); |
---|
620 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
621 | | - sevenButton.setToolTipText("3-column layout"); |
---|
622 | | - sevenButton.addActionListener(this); |
---|
| 1007 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1008 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1009 | + sixButton.addActionListener(this); |
---|
| 1010 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1011 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1012 | +// sevenButton.addActionListener(this); |
---|
623 | 1013 | // |
---|
624 | 1014 | |
---|
625 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
626 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 1015 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1016 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
627 | 1017 | rootButton.addActionListener(this); |
---|
628 | 1018 | |
---|
629 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1019 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
630 | 1020 | closeButton.setToolTipText("Close tab"); |
---|
631 | 1021 | closeButton.addActionListener(this); |
---|
632 | 1022 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
633 | 1023 | //clearButton.addActionListener(this); |
---|
634 | | - |
---|
635 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 1024 | + |
---|
| 1025 | + cGridBag row1 = new cGridBag(); |
---|
636 | 1026 | |
---|
637 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
638 | | - editButton.setToolTipText("Edit selection"); |
---|
| 1027 | + // INSERT |
---|
| 1028 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1029 | + gridButton.setToolTipText("Create grid"); |
---|
| 1030 | + gridButton.addActionListener(this); |
---|
| 1031 | + |
---|
| 1032 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1033 | + boxButton.setToolTipText("Create box"); |
---|
| 1034 | + boxButton.addActionListener(this); |
---|
| 1035 | + |
---|
| 1036 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1037 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1038 | + sphereButton.addActionListener(this); |
---|
| 1039 | + |
---|
| 1040 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1041 | + coneButton.setToolTipText("Create cone"); |
---|
| 1042 | + coneButton.addActionListener(this); |
---|
| 1043 | + |
---|
| 1044 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1045 | + torusButton.setToolTipText("Create torus"); |
---|
| 1046 | + torusButton.addActionListener(this); |
---|
| 1047 | + |
---|
| 1048 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1049 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1050 | + superButton.addActionListener(this); |
---|
| 1051 | + |
---|
| 1052 | + if (Globals.ADVANCED) |
---|
| 1053 | + { |
---|
| 1054 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1055 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 1056 | + kleinButton.addActionListener(this); |
---|
| 1057 | + } |
---|
| 1058 | + |
---|
| 1059 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1060 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 1061 | + particlesButton.addActionListener(this); |
---|
| 1062 | + |
---|
| 1063 | + oe.toolboxPanel.add(row1); |
---|
| 1064 | + |
---|
| 1065 | + cGridBag row2 = new cGridBag(); |
---|
| 1066 | + |
---|
| 1067 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | + groupButton.setToolTipText("Create group"); |
---|
| 1069 | + groupButton.addActionListener(this); |
---|
| 1070 | + |
---|
| 1071 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1073 | + compositeButton.addActionListener(this); |
---|
| 1074 | + |
---|
| 1075 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1076 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1077 | + switchButton.addActionListener(this); |
---|
| 1078 | + |
---|
| 1079 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1080 | + loopButton.setToolTipText("Create loop"); |
---|
| 1081 | + loopButton.addActionListener(this); |
---|
| 1082 | + |
---|
| 1083 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1084 | + textureButton.setToolTipText("Create texture"); |
---|
| 1085 | + textureButton.addActionListener(this); |
---|
| 1086 | + |
---|
| 1087 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1088 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1089 | + overlayButton.addActionListener(this); |
---|
| 1090 | + |
---|
| 1091 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1092 | + lightButton.setToolTipText("Create light"); |
---|
| 1093 | + lightButton.addActionListener(this); |
---|
| 1094 | + |
---|
| 1095 | + oe.toolboxPanel.add(row2); |
---|
| 1096 | + |
---|
| 1097 | + // ENVYMAPS |
---|
| 1098 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1099 | + skyboxpane.preferredHeight = 100; |
---|
| 1100 | + |
---|
| 1101 | + oe.toolboxPanel.add(skyboxpane); |
---|
| 1102 | + |
---|
| 1103 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1104 | + skyboxpane.add(skyboxpanel); |
---|
| 1105 | + |
---|
| 1106 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1107 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1108 | + AddSkyboxTab2(skyboxpanel); |
---|
| 1109 | + AddSkyboxTab3(skyboxpanel); |
---|
| 1110 | + |
---|
| 1111 | + // EDIT panel |
---|
| 1112 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + editButton.setToolTipText("Pin selection controls"); |
---|
639 | 1114 | editButton.addActionListener(this); |
---|
640 | 1115 | |
---|
641 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
642 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 1116 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1117 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
643 | 1118 | uneditButton.addActionListener(this); |
---|
644 | 1119 | |
---|
645 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
646 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 1120 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 1121 | + allParamsButton.setToolTipText("Show all controle"); |
---|
647 | 1122 | allParamsButton.addActionListener(this); |
---|
648 | 1123 | |
---|
649 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1124 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
650 | 1125 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
651 | 1126 | clearPanelButton.addActionListener(this); |
---|
652 | 1127 | |
---|
653 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1128 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
654 | 1129 | unselectButton.setToolTipText("Unselect"); |
---|
655 | 1130 | unselectButton.addActionListener(this); |
---|
656 | 1131 | |
---|
657 | | - commandsPanel.preferredHeight = 1; |
---|
| 1132 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1133 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1134 | + flashSelectionButton.addActionListener(this); |
---|
658 | 1135 | |
---|
659 | | - oe.treePanel.add(commandsPanel); |
---|
660 | | - oe.treePanel.Return(); |
---|
| 1136 | + editCommandsPanel.preferredHeight = 1; |
---|
| 1137 | + |
---|
| 1138 | + SetPinStates(false); |
---|
| 1139 | +// oe.treePanel.add(commandsPanel); |
---|
| 1140 | +// oe.treePanel.Return(); |
---|
661 | 1141 | |
---|
662 | 1142 | // oe.aConstraints.gridx += 1; |
---|
663 | 1143 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
674 | 1154 | |
---|
675 | 1155 | JScrollPane jSP; |
---|
676 | 1156 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
677 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 1157 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
678 | 1158 | ResetModel(); |
---|
679 | 1159 | |
---|
680 | 1160 | oe.treePanel.add(jSPPanel); |
---|
681 | 1161 | oe.treePanel.Return(); |
---|
682 | 1162 | |
---|
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 | 1163 | oe.treePanel.add(copyOptionsPanel); |
---|
699 | 1164 | oe.treePanel.Return(); |
---|
| 1165 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1166 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1167 | + sliderPane.preferredHeight = 1; |
---|
700 | 1168 | |
---|
701 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
702 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1169 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1170 | + mainPanel.setResizeWeight(0.4); |
---|
703 | 1171 | |
---|
704 | 1172 | //jList.addListSelectionListener(this); |
---|
705 | 1173 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
707 | 1175 | //jTree.setEditable(true); |
---|
708 | 1176 | oe.jTree.setDragEnabled(true); |
---|
709 | 1177 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
710 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1178 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
711 | 1179 | |
---|
712 | 1180 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
713 | 1181 | |
---|
.. | .. |
---|
719 | 1187 | dgr.addDragGestureListener(this); |
---|
720 | 1188 | }catch(Exception e) {} |
---|
721 | 1189 | */ |
---|
722 | | - radio.layout = sevenButton; |
---|
| 1190 | + radio.layout = threeButton; // sixButton; |
---|
723 | 1191 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
724 | 1192 | } |
---|
725 | 1193 | |
---|
726 | 1194 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
727 | 1195 | { |
---|
| 1196 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1197 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1198 | + colorCB.addItemListener(this); |
---|
| 1199 | + |
---|
| 1200 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1201 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1202 | + materialCB.addItemListener(this); |
---|
| 1203 | + |
---|
| 1204 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1205 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1206 | + textureCB.addItemListener(this); |
---|
| 1207 | + |
---|
| 1208 | + panel.Return(); |
---|
| 1209 | + |
---|
728 | 1210 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
729 | 1211 | boxCB.setToolTipText("Display bounding boxes"); |
---|
730 | 1212 | boxCB.addItemListener(this); |
---|
731 | 1213 | |
---|
732 | 1214 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
733 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1215 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
734 | 1216 | zoomBoxCB.addItemListener(this); |
---|
735 | 1217 | |
---|
736 | 1218 | if (true) // Globals.ADVANCED) |
---|
737 | 1219 | { |
---|
738 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
739 | | - supportCB.setToolTipText("Enable rigging"); |
---|
740 | | - supportCB.addItemListener(this); |
---|
| 1220 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1221 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1222 | +// supportCB.addItemListener(this); |
---|
| 1223 | + |
---|
| 1224 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1225 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1226 | + freezeCB.addItemListener(this); |
---|
741 | 1227 | |
---|
742 | 1228 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
743 | 1229 | // localCB.addItemListener(this); |
---|
744 | 1230 | |
---|
| 1231 | + panel.Return(); |
---|
| 1232 | + |
---|
745 | 1233 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
746 | 1234 | crowdCB.setToolTipText("Used for crowds"); |
---|
747 | 1235 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
750 | 1238 | smoothCB.setToolTipText("Snapping delay"); |
---|
751 | 1239 | smoothCB.addItemListener(this); |
---|
752 | 1240 | |
---|
753 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
754 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
755 | | - slowCB.addItemListener(this); |
---|
| 1241 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1242 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1243 | +// slowCB.addItemListener(this); |
---|
| 1244 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1245 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1246 | + minshaderCB.addItemListener(this); |
---|
756 | 1247 | |
---|
757 | 1248 | // constraints.gridy += 1; |
---|
758 | 1249 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
759 | 1250 | // speakerMocapCB.addItemListener(this); |
---|
760 | 1251 | |
---|
| 1252 | + panel.Return(); |
---|
| 1253 | + |
---|
761 | 1254 | if (false) |
---|
762 | 1255 | { |
---|
763 | 1256 | // handled in scripts |
---|
.. | .. |
---|
772 | 1265 | //constraints.gridy += 1; |
---|
773 | 1266 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
774 | 1267 | smoothfocusCB.addItemListener(this); |
---|
| 1268 | + panel.Return(); |
---|
775 | 1269 | } |
---|
776 | 1270 | |
---|
777 | 1271 | //constraints.gridx += 1; |
---|
778 | 1272 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
779 | 1273 | // debugCB.addItemListener(this); |
---|
780 | 1274 | |
---|
| 1275 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1276 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1277 | + trackCB.addItemListener(this); |
---|
| 1278 | + |
---|
781 | 1279 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 1280 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
782 | 1281 | oeilCB.addItemListener(this); |
---|
783 | 1282 | |
---|
| 1283 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 1284 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 1285 | + shadowCB.addItemListener(this); |
---|
| 1286 | + |
---|
| 1287 | + panel.Return(); |
---|
| 1288 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1289 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1290 | + toggleTextureCB.addItemListener(this); |
---|
| 1291 | + |
---|
| 1292 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1293 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1294 | + toggleSwitchCB.addItemListener(this); |
---|
| 1295 | + |
---|
| 1296 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1297 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1298 | + autokeepCB.addItemListener(this); |
---|
| 1299 | + |
---|
| 1300 | + panel.Return(); |
---|
| 1301 | + if (Globals.ADVANCED) |
---|
| 1302 | + { |
---|
784 | 1303 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
785 | 1304 | lookAtCB.setToolTipText("Look-at target"); |
---|
786 | 1305 | lookAtCB.addItemListener(this); |
---|
| 1306 | + } |
---|
787 | 1307 | |
---|
788 | 1308 | } |
---|
789 | 1309 | |
---|
790 | 1310 | cGridBag fill = new cGridBag(); |
---|
791 | | - |
---|
792 | 1311 | fill.preferredHeight = 200; |
---|
| 1312 | + cGridBag fill2 = new cGridBag(); |
---|
| 1313 | + fill2.preferredHeight = 200; |
---|
| 1314 | + cGridBag fill3 = new cGridBag(); |
---|
| 1315 | + fill3.preferredHeight = 200; |
---|
793 | 1316 | |
---|
794 | 1317 | panel.add(fill); |
---|
| 1318 | + panel.add(fill2); |
---|
| 1319 | + panel.add(fill3); |
---|
795 | 1320 | |
---|
796 | 1321 | } |
---|
797 | 1322 | |
---|
798 | 1323 | void EditObject(Object3D obj) |
---|
799 | 1324 | { |
---|
800 | 1325 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1326 | + |
---|
| 1327 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1328 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1329 | + if (!radioButton.hadMaterial) |
---|
| 1330 | + { |
---|
| 1331 | + obj.material = new cMaterial(); |
---|
| 1332 | + } |
---|
| 1333 | + |
---|
801 | 1334 | radioButton.SetObject(obj); |
---|
802 | | - radioButton.layout = sevenButton; |
---|
| 1335 | + radioButton.layout = threeButton; // sixButton; |
---|
803 | 1336 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
804 | 1337 | radioButton.addActionListener(this); |
---|
805 | 1338 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
809 | 1342 | |
---|
810 | 1343 | void SetupViews(ObjEditor oe) |
---|
811 | 1344 | { |
---|
| 1345 | + theFrame = this; |
---|
| 1346 | + |
---|
812 | 1347 | oe.SetupViews(); |
---|
813 | 1348 | |
---|
814 | 1349 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
817 | 1352 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
818 | 1353 | } |
---|
819 | 1354 | |
---|
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; |
---|
| 1355 | + cToggleButton liveCB; |
---|
| 1356 | + cCheckBox supportCB; |
---|
| 1357 | + cCheckBox localCB; |
---|
| 1358 | + cCheckBox crowdCB; |
---|
| 1359 | + cCheckBox smoothCB; |
---|
| 1360 | + cCheckBox minshaderCB; |
---|
| 1361 | + |
---|
| 1362 | + cToggleButton fastCB; |
---|
| 1363 | + cCheckBox slowCB; |
---|
| 1364 | + cCheckBox boxCB; |
---|
| 1365 | + cCheckBox zoomBoxCB; |
---|
| 1366 | + cCheckBox freezeCB; |
---|
| 1367 | + //cToggleButton trackCB; |
---|
| 1368 | + cCheckBox trackCB; |
---|
| 1369 | + cCheckBox smoothfocusCB; |
---|
831 | 1370 | // JCheckBox speakerMocapCB; |
---|
832 | | - JCheckBox speakerCameraCB; |
---|
833 | | - JCheckBox speakerFocusCB; |
---|
834 | | - JCheckBox debugCB; |
---|
835 | | - JCheckBox oeilCB; |
---|
836 | | - JCheckBox lookAtCB; |
---|
| 1371 | + cCheckBox speakerCameraCB; |
---|
| 1372 | + cCheckBox speakerFocusCB; |
---|
| 1373 | + cCheckBox debugCB; |
---|
| 1374 | + |
---|
| 1375 | + cCheckBox oeilCB; |
---|
| 1376 | + cCheckBox shadowCB; |
---|
| 1377 | + cCheckBox autokeepCB; |
---|
| 1378 | + cCheckBox lookAtCB; |
---|
837 | 1379 | |
---|
838 | 1380 | // static int COLOR = 1; |
---|
839 | 1381 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
841 | 1383 | |
---|
842 | 1384 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
843 | 1385 | |
---|
844 | | - JCheckBox colorCB; |
---|
845 | | - JCheckBox materialCB; |
---|
846 | | - JCheckBox textureCB; |
---|
| 1386 | + cCheckBox colorCB; |
---|
| 1387 | + cCheckBox materialCB; |
---|
| 1388 | + cCheckBox textureCB; |
---|
847 | 1389 | |
---|
848 | 1390 | public void itemStateChanged(ItemEvent e) |
---|
849 | 1391 | { |
---|
.. | .. |
---|
871 | 1413 | } else if(e.getSource() == liveCB) |
---|
872 | 1414 | { |
---|
873 | 1415 | cameraView.ToggleLive(); |
---|
| 1416 | + refreshContents(false); |
---|
874 | 1417 | } |
---|
875 | 1418 | else if(e.getSource() == supportCB) |
---|
876 | 1419 | { |
---|
.. | .. |
---|
886 | 1429 | { |
---|
887 | 1430 | cameraView.ToggleInertia(); |
---|
888 | 1431 | cameraView.repaint(); |
---|
| 1432 | + } |
---|
| 1433 | + else if(e.getSource() == minshaderCB) |
---|
| 1434 | + { |
---|
| 1435 | + Globals.MINSHADER ^= true; |
---|
| 1436 | + cameraView.programInitialized = false; |
---|
| 1437 | + cameraView.repaint(); |
---|
889 | 1438 | } |
---|
890 | 1439 | else if(e.getSource() == localCB) |
---|
891 | 1440 | { |
---|
.. | .. |
---|
935 | 1484 | { |
---|
936 | 1485 | cameraView.ToggleOeil(); |
---|
937 | 1486 | } |
---|
| 1487 | + else if(e.getSource() == shadowCB) |
---|
| 1488 | + { |
---|
| 1489 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1490 | + } |
---|
| 1491 | + else if(e.getSource() == freezeCB) |
---|
| 1492 | + { |
---|
| 1493 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1494 | + } |
---|
| 1495 | + else if(e.getSource() == autokeepCB) |
---|
| 1496 | + { |
---|
| 1497 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1498 | + } |
---|
938 | 1499 | else if(e.getSource() == lookAtCB) |
---|
939 | 1500 | { |
---|
940 | 1501 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
951 | 1512 | |
---|
952 | 1513 | /**/ |
---|
953 | 1514 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
954 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1515 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1516 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
955 | 1517 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
956 | 1518 | // We can't move the root node or an empty selection |
---|
957 | 1519 | return; |
---|
.. | .. |
---|
1014 | 1576 | } |
---|
1015 | 1577 | } |
---|
1016 | 1578 | |
---|
1017 | | - String string = (String) object; |
---|
1018 | | - |
---|
1019 | 1579 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1020 | 1580 | // if( object instanceof java.io.File[]) |
---|
1021 | 1581 | // { |
---|
.. | .. |
---|
1023 | 1583 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1024 | 1584 | // return; |
---|
1025 | 1585 | // } |
---|
| 1586 | + |
---|
| 1587 | + String string = object.toString(); |
---|
1026 | 1588 | |
---|
1027 | 1589 | // File path for Mac and Windows |
---|
1028 | 1590 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1068 | 1630 | |
---|
1069 | 1631 | assert target == objEditor.jTree; |
---|
1070 | 1632 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1633 | + Object3D destinationLeaf; |
---|
1071 | 1634 | try { |
---|
1072 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1635 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1073 | 1636 | } catch (Exception e) { |
---|
1074 | 1637 | System.out.println("destinationPath : " + destinationPath); |
---|
1075 | 1638 | return; |
---|
1076 | 1639 | } |
---|
1077 | 1640 | |
---|
1078 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1641 | + for (int i=group.selection.size(); --i>=0;) |
---|
1079 | 1642 | { |
---|
| 1643 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1644 | + |
---|
| 1645 | + // Cannot move into itself |
---|
| 1646 | + if (child == destinationLeaf) |
---|
| 1647 | + return; |
---|
| 1648 | + } |
---|
| 1649 | + |
---|
| 1650 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1651 | +// { |
---|
1080 | 1652 | loadClipboard(true); |
---|
1081 | 1653 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1082 | 1654 | pasteInto(false, false); |
---|
1083 | | - } else { |
---|
1084 | | - loadClipboard(false); |
---|
1085 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1086 | | - pasteInto(false, false); // true); // ??? |
---|
1087 | | - } |
---|
| 1655 | +// } else { |
---|
| 1656 | +// loadClipboard(false); |
---|
| 1657 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1658 | +// pasteInto(false, false); // true); // ??? |
---|
| 1659 | +// } |
---|
1088 | 1660 | } |
---|
1089 | 1661 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1090 | 1662 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1189 | 1761 | { |
---|
1190 | 1762 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1191 | 1763 | //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); |
---|
| 1764 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1765 | +// gridItem.addActionListener(this); |
---|
| 1766 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1767 | +// rectoidItem.addActionListener(this); |
---|
| 1768 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1769 | +// ellipsoidItem.addActionListener(this); |
---|
| 1770 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1771 | +// coneItem.addActionListener(this); |
---|
| 1772 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1773 | +// torusItem.addActionListener(this); |
---|
| 1774 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1775 | +// superItem.addActionListener(this); |
---|
| 1776 | + |
---|
| 1777 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1778 | + cameraItem.addActionListener(this); |
---|
| 1779 | + |
---|
| 1780 | + if (!Globals.ADVANCED) |
---|
| 1781 | + { |
---|
1204 | 1782 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1205 | 1783 | kleinItem.addActionListener(this); |
---|
1206 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1207 | | - particleItem.addActionListener(this); |
---|
| 1784 | + } |
---|
| 1785 | + |
---|
| 1786 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1787 | +// particleItem.addActionListener(this); |
---|
1208 | 1788 | if (Globals.ADVANCED) |
---|
1209 | 1789 | { |
---|
1210 | 1790 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1230 | 1810 | } |
---|
1231 | 1811 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1232 | 1812 | 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); |
---|
| 1813 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1814 | +// overlayItem.addActionListener(this); |
---|
| 1815 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1816 | +// lightItem.addActionListener(this); |
---|
1237 | 1817 | menu.add("-"); |
---|
1238 | 1818 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1239 | 1819 | //superLoopItem.addActionListener(this); |
---|
1240 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1241 | | - loopItem.addActionListener(this); |
---|
| 1820 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1821 | +// loopItem.addActionListener(this); |
---|
1242 | 1822 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1243 | 1823 | doubleItem.addActionListener(this); |
---|
1244 | 1824 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1254 | 1834 | animationItem.addItemListener(this); |
---|
1255 | 1835 | animationItem.setState(Globals.ANIMATION); |
---|
1256 | 1836 | |
---|
| 1837 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1838 | + archiveItem.addActionListener(this); |
---|
| 1839 | + |
---|
1257 | 1840 | menu.add("-"); |
---|
1258 | 1841 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1259 | 1842 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1266 | 1849 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1267 | 1850 | reduce34MorphItem.addActionListener(this); |
---|
1268 | 1851 | menu.add("-"); |
---|
| 1852 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1853 | + memoryItem.addActionListener(this); |
---|
1269 | 1854 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1270 | 1855 | computeAOItem.addActionListener(this); |
---|
1271 | 1856 | |
---|
.. | .. |
---|
1274 | 1859 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1275 | 1860 | mirrorItem.addActionListener(this); |
---|
1276 | 1861 | menu.add("-"); |
---|
1277 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1278 | | - memoryItem.addActionListener(this); |
---|
1279 | 1862 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1280 | 1863 | analyzeItem.addActionListener(this); |
---|
1281 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1864 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1282 | 1865 | dumpItem.addActionListener(this); |
---|
1283 | 1866 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1284 | 1867 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1419 | 2002 | shadow.material = new cMaterial(obj.material); |
---|
1420 | 2003 | shadow.material.diffuse = 0.0001f; |
---|
1421 | 2004 | shadow.material.specular = 0.0001f; |
---|
| 2005 | + //shadow.projectedVertices[1].x = 300; |
---|
1422 | 2006 | |
---|
1423 | 2007 | makeSomething(shadow); |
---|
1424 | 2008 | } |
---|
| 2009 | + |
---|
| 2010 | + private void ClearUnpinned() |
---|
| 2011 | + { |
---|
| 2012 | + //for (Object3D obj : listUI) |
---|
| 2013 | + for (int i=listUI.size(); --i>=0;) |
---|
| 2014 | + { |
---|
| 2015 | + Object3D obj = listUI.elementAt(i); |
---|
| 2016 | + if (!obj.pinned) |
---|
| 2017 | + { |
---|
| 2018 | + obj.CloseUI(); |
---|
| 2019 | + listUI.remove(i); |
---|
| 2020 | + } |
---|
| 2021 | + } |
---|
| 2022 | + } |
---|
| 2023 | + |
---|
| 2024 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2025 | + { |
---|
| 2026 | + // if (!(elem instanceof Composite)) |
---|
| 2027 | + // newWindow = false; |
---|
| 2028 | + listUI.add(elem); |
---|
| 2029 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2030 | + System.out.println("edit : " + elem); |
---|
| 2031 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 2032 | + } |
---|
1425 | 2033 | |
---|
1426 | 2034 | /** |
---|
1427 | 2035 | * applyExample |
---|
.. | .. |
---|
1666 | 2274 | { |
---|
1667 | 2275 | ScreenFit(); |
---|
1668 | 2276 | } else |
---|
1669 | | - if (source == switchItem) |
---|
| 2277 | + if (source == switchViewItem) |
---|
1670 | 2278 | { |
---|
1671 | 2279 | cVector v1 = new cVector(); |
---|
1672 | 2280 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1675 | 2283 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1676 | 2284 | objEditor.cameraView.repaint(); |
---|
1677 | 2285 | } else |
---|
1678 | | - if (source == rectoidItem) |
---|
| 2286 | + if (source == rectoidItem || source == boxButton) |
---|
1679 | 2287 | { |
---|
1680 | 2288 | makeSomething(new Box()); |
---|
1681 | 2289 | } else |
---|
1682 | | - if (source == particleItem) |
---|
| 2290 | + if (source == particleItem || source == particlesButton) |
---|
1683 | 2291 | { |
---|
1684 | 2292 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1685 | 2293 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1758 | 2366 | |
---|
1759 | 2367 | makeSomething(obj); |
---|
1760 | 2368 | } else |
---|
1761 | | - if (source == gridItem) |
---|
| 2369 | + if (source == gridItem || source == gridButton) |
---|
1762 | 2370 | { |
---|
1763 | 2371 | makeSomething(new Grid()); |
---|
1764 | 2372 | } else |
---|
1765 | | - if (source == ellipsoidItem) |
---|
| 2373 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1766 | 2374 | { |
---|
1767 | 2375 | makeSomething(new Sphere()); |
---|
1768 | 2376 | } else |
---|
1769 | | - if (source == coneItem) |
---|
| 2377 | + if (source == coneItem || source == coneButton) |
---|
1770 | 2378 | { |
---|
1771 | 2379 | makeSomething(new Cone()); |
---|
1772 | 2380 | } else |
---|
1773 | | - if (source == torusItem) |
---|
| 2381 | + if (source == torusItem || source == torusButton) |
---|
1774 | 2382 | { |
---|
1775 | 2383 | makeSomething(new Torus()); |
---|
1776 | 2384 | } else |
---|
1777 | | - if (source == superItem) |
---|
| 2385 | + if (source == superItem || source == superButton) |
---|
1778 | 2386 | { |
---|
1779 | 2387 | makeSomething(new Superellipsoid()); |
---|
1780 | 2388 | } else |
---|
1781 | | - if (source == kleinItem) |
---|
| 2389 | + if (source == kleinItem || source == kleinButton) |
---|
1782 | 2390 | { |
---|
1783 | 2391 | makeSomething(new Klein()); |
---|
1784 | 2392 | } else |
---|
.. | .. |
---|
1798 | 2406 | { |
---|
1799 | 2407 | makeSomething(new BezierSurface()); |
---|
1800 | 2408 | } else |
---|
1801 | | - if (source == overlayItem) |
---|
| 2409 | + if (source == overlayItem || source == overlayButton) |
---|
1802 | 2410 | { |
---|
1803 | 2411 | /* |
---|
1804 | 2412 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1846 | 2454 | s.setup(); |
---|
1847 | 2455 | makeSomething(s); |
---|
1848 | 2456 | } else |
---|
1849 | | - if (source == lightItem) |
---|
| 2457 | + if (source == lightItem || source == lightButton) |
---|
1850 | 2458 | { |
---|
1851 | 2459 | makeSomething(new Light()); |
---|
1852 | 2460 | } else |
---|
| 2461 | +// if (source == skybox1Button || |
---|
| 2462 | +// source == skybox2Button || |
---|
| 2463 | +// source == skybox3Button || |
---|
| 2464 | +// source == skybox4Button || |
---|
| 2465 | +// source == skybox5Button || |
---|
| 2466 | +// source == skybox6Button || |
---|
| 2467 | +// source == skybox7Button || |
---|
| 2468 | +// source == skybox11Button || |
---|
| 2469 | +// source == skybox12Button || |
---|
| 2470 | +// source == skybox13Button || |
---|
| 2471 | +// source == skybox14Button || |
---|
| 2472 | +// source == skybox15Button || |
---|
| 2473 | +// source == skybox16Button || |
---|
| 2474 | +// source == skybox17Button) |
---|
| 2475 | +// { |
---|
| 2476 | +// ChangeSkybox(source); |
---|
| 2477 | +// } else |
---|
1853 | 2478 | if (source == csgItem) |
---|
1854 | 2479 | { |
---|
1855 | 2480 | group(new CSG()); |
---|
.. | .. |
---|
1896 | 2521 | |
---|
1897 | 2522 | group(g); |
---|
1898 | 2523 | } else |
---|
1899 | | - if (source == loopItem) |
---|
| 2524 | + if (source == loopItem || source == loopButton) |
---|
1900 | 2525 | { |
---|
1901 | 2526 | Composite csg = new GroupLeaf(); |
---|
1902 | 2527 | csg.count = 5; |
---|
1903 | 2528 | group(csg); |
---|
1904 | | - Composite child = new cGroup(); |
---|
| 2529 | + Composite child = new cGroup("Branch"); |
---|
1905 | 2530 | csg.addChild(child); |
---|
1906 | 2531 | child.addChild(csg); |
---|
1907 | 2532 | } else |
---|
1908 | 2533 | if (source == doubleItem) |
---|
1909 | 2534 | { |
---|
1910 | | - Composite csg = new GroupLeaf(); |
---|
| 2535 | + Composite csg = new GroupLeaf("Fork"); |
---|
1911 | 2536 | csg.count = 5; |
---|
1912 | 2537 | group(csg); |
---|
1913 | | - Composite child = new cGroup(); |
---|
| 2538 | + Composite child = new cGroup("Branch A"); |
---|
1914 | 2539 | csg.addChild(child); |
---|
1915 | 2540 | child.addChild(csg); |
---|
1916 | | - child = new cGroup(); |
---|
| 2541 | + child = new cGroup("Branch B"); |
---|
1917 | 2542 | csg.addChild(child); |
---|
1918 | 2543 | child.addChild(csg); |
---|
1919 | 2544 | } else |
---|
1920 | 2545 | if (source == tripleItem) |
---|
1921 | 2546 | { |
---|
1922 | | - Composite csg = new GroupLeaf(); |
---|
| 2547 | + Composite csg = new GroupLeaf("Trident"); |
---|
1923 | 2548 | csg.count = 4; |
---|
1924 | 2549 | group(csg); |
---|
1925 | 2550 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1935 | 2560 | if (source == computeAOItem) |
---|
1936 | 2561 | { |
---|
1937 | 2562 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1938 | | - Globals.theRenderer.repaint(); |
---|
| 2563 | + cameraView.repaint(); |
---|
1939 | 2564 | } else |
---|
1940 | 2565 | if (source == recompileItem) |
---|
1941 | 2566 | { |
---|
.. | .. |
---|
1950 | 2575 | if (source == invariantsItem) |
---|
1951 | 2576 | { |
---|
1952 | 2577 | System.out.println("Invariants:"); |
---|
1953 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2578 | + Grafreed.grafreed.universe.invariants(); |
---|
1954 | 2579 | } else |
---|
1955 | 2580 | if (source == memoryItem) |
---|
1956 | 2581 | { |
---|
.. | .. |
---|
1969 | 2594 | { |
---|
1970 | 2595 | DumpObject(); |
---|
1971 | 2596 | } else |
---|
1972 | | - if (source == undoButton) |
---|
| 2597 | + if (source == minButton) |
---|
1973 | 2598 | { |
---|
1974 | | - Undo(); |
---|
| 2599 | + Minimize(); |
---|
1975 | 2600 | } else |
---|
1976 | | - if (source == redoButton) |
---|
| 2601 | + if (source == maxButton) |
---|
1977 | 2602 | { |
---|
1978 | | - Redo(); |
---|
| 2603 | + Maximize(); |
---|
1979 | 2604 | } else |
---|
1980 | | - if (source == saveButton) |
---|
| 2605 | + if (source == fullButton) |
---|
1981 | 2606 | { |
---|
1982 | | - Save(); |
---|
| 2607 | + ToggleFullScreen(); |
---|
| 2608 | + } else |
---|
| 2609 | + if (source == previousVersionButton) |
---|
| 2610 | + { |
---|
| 2611 | + // Go to previous version |
---|
| 2612 | + //if (!Undo()) |
---|
| 2613 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2614 | + PreviousVersion(); |
---|
| 2615 | + } else |
---|
| 2616 | + if (source == restoreButton) |
---|
| 2617 | + { |
---|
| 2618 | + // Restore current version |
---|
| 2619 | + Restore(); |
---|
| 2620 | + //restoreButton.setEnabled(false); |
---|
| 2621 | + } else |
---|
| 2622 | + if (source == replaceButton) |
---|
| 2623 | + { |
---|
| 2624 | + // Overwrite current version |
---|
| 2625 | + Replace(); |
---|
| 2626 | + //replaceButton.setEnabled(false); |
---|
| 2627 | + } else |
---|
| 2628 | + if (source == nextVersionButton) |
---|
| 2629 | + { |
---|
| 2630 | + // Go to next version |
---|
| 2631 | + NextVersion(); |
---|
| 2632 | + } else |
---|
| 2633 | + if (source == saveVersionButton) |
---|
| 2634 | + { |
---|
| 2635 | + // Save a new version |
---|
| 2636 | + if (!Save(true)) |
---|
| 2637 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2638 | + } else |
---|
| 2639 | + if (source == deleteVersionButton) |
---|
| 2640 | + { |
---|
| 2641 | + // Delete a new version |
---|
| 2642 | + DeleteVersion(); |
---|
1983 | 2643 | } else |
---|
1984 | 2644 | if (source == oneStepButton) |
---|
1985 | 2645 | { |
---|
.. | .. |
---|
1988 | 2648 | } else |
---|
1989 | 2649 | if (source == screenfitButton) |
---|
1990 | 2650 | { |
---|
1991 | | - //Reload(lastConverter, lastFilename, true); |
---|
1992 | 2651 | ScreenFit(); |
---|
1993 | 2652 | } else |
---|
1994 | 2653 | if (source == screenfitpointButton) |
---|
1995 | 2654 | { |
---|
1996 | | - //Reload(lastConverter, lastFilename, true); |
---|
1997 | 2655 | ScreenFitPoint(); |
---|
1998 | 2656 | } else |
---|
1999 | 2657 | if (source == snapobjectButton) |
---|
2000 | 2658 | { |
---|
2001 | | - //Reload(lastConverter, lastFilename, true); |
---|
2002 | 2659 | SnapObject(); |
---|
2003 | 2660 | } else |
---|
2004 | 2661 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2037 | 2694 | } else |
---|
2038 | 2695 | if (source == undoItem) |
---|
2039 | 2696 | { |
---|
2040 | | - Undo(); |
---|
| 2697 | + PreviousVersion(); |
---|
2041 | 2698 | } else |
---|
2042 | 2699 | if (source == redoItem) |
---|
2043 | 2700 | { |
---|
2044 | | - Redo(); |
---|
| 2701 | + NextVersion(); |
---|
2045 | 2702 | } else |
---|
2046 | 2703 | if (source == duplicateItem) |
---|
2047 | 2704 | { |
---|
.. | .. |
---|
2362 | 3019 | { |
---|
2363 | 3020 | StepAll(); |
---|
2364 | 3021 | } else |
---|
2365 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 3022 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2366 | 3023 | { |
---|
2367 | 3024 | //int indices[] = jList.getSelectedIndices(); |
---|
2368 | 3025 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2374 | 3031 | { |
---|
2375 | 3032 | ClearSelection(true); |
---|
2376 | 3033 | } else |
---|
2377 | | - if (source == grabItem) |
---|
| 3034 | + if (source == grabItem || source == groupButton) |
---|
2378 | 3035 | { |
---|
2379 | | - group(new cGroup(), true); |
---|
| 3036 | + group(new cGroup(), false); // true); |
---|
2380 | 3037 | } else |
---|
2381 | 3038 | if (source == hideItem) |
---|
2382 | 3039 | { |
---|
.. | .. |
---|
2394 | 3051 | { |
---|
2395 | 3052 | makeSomething(new Camera()); |
---|
2396 | 3053 | } else |
---|
2397 | | - if (source == compositeItem) |
---|
| 3054 | + if (source == compositeItem || source == compositeButton) |
---|
2398 | 3055 | { |
---|
2399 | 3056 | group(new Composite()); |
---|
2400 | 3057 | } else |
---|
2401 | | - if (source == randomItem) |
---|
| 3058 | + if (source == switchItem || source == switchButton) |
---|
2402 | 3059 | { |
---|
2403 | 3060 | RandomNode random = new RandomNode(); |
---|
2404 | 3061 | group(random); |
---|
.. | .. |
---|
2500 | 3157 | { |
---|
2501 | 3158 | group(new cLinker()); |
---|
2502 | 3159 | } else |
---|
2503 | | - if (source == textureItem) |
---|
| 3160 | + if (source == textureItem || source == textureButton) |
---|
2504 | 3161 | { |
---|
2505 | 3162 | group(new TextureNode()); |
---|
2506 | 3163 | } else |
---|
.. | .. |
---|
2520 | 3177 | { |
---|
2521 | 3178 | CastShadow(2); |
---|
2522 | 3179 | } else |
---|
2523 | | - if (source == ungroupItem) |
---|
| 3180 | + if (source == ungroupItem || source == ungroupButton) |
---|
2524 | 3181 | { |
---|
2525 | | - //ungroup(); |
---|
| 3182 | + boolean hasRoot = false; |
---|
| 3183 | + |
---|
2526 | 3184 | for (int i=0; i<group.selection.size(); i++) |
---|
2527 | 3185 | { |
---|
2528 | | - Ungroup(group.selection.get(i)); |
---|
| 3186 | + if (group.selection.get(i) == group) |
---|
| 3187 | + { |
---|
| 3188 | + hasRoot = true; |
---|
| 3189 | + break; |
---|
| 3190 | + } |
---|
2529 | 3191 | } |
---|
2530 | 3192 | |
---|
2531 | | - ClearSelection(false); |
---|
2532 | | - |
---|
2533 | | - refreshContents(); |
---|
| 3193 | + if (!hasRoot) |
---|
| 3194 | + { |
---|
| 3195 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3196 | + { |
---|
| 3197 | + Ungroup(group.selection.get(i)); |
---|
| 3198 | + } |
---|
| 3199 | + |
---|
| 3200 | + ClearSelection(false); |
---|
| 3201 | + |
---|
| 3202 | + refreshContents(); |
---|
| 3203 | + } |
---|
2534 | 3204 | } else |
---|
2535 | 3205 | if (source == genUVItem) |
---|
2536 | 3206 | { |
---|
.. | .. |
---|
2607 | 3277 | if (source == unmarkleavesItem) |
---|
2608 | 3278 | { |
---|
2609 | 3279 | MarkLeaves(false); |
---|
| 3280 | + } else |
---|
| 3281 | + if (source == rewindleavesItem) |
---|
| 3282 | + { |
---|
| 3283 | + RewindLeaves(true); |
---|
| 3284 | + } else |
---|
| 3285 | + if (source == unrewindleavesItem) |
---|
| 3286 | + { |
---|
| 3287 | + RewindLeaves(false); |
---|
| 3288 | + } else |
---|
| 3289 | + if (source == randomleavesItem) |
---|
| 3290 | + { |
---|
| 3291 | + RandomLeaves(true); |
---|
| 3292 | + } else |
---|
| 3293 | + if (source == unrandomleavesItem) |
---|
| 3294 | + { |
---|
| 3295 | + RandomLeaves(false); |
---|
2610 | 3296 | } else |
---|
2611 | 3297 | if (source == flipVItem) |
---|
2612 | 3298 | { |
---|
.. | .. |
---|
2815 | 3501 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2816 | 3502 | { |
---|
2817 | 3503 | obj = (Object3D)e.nextElement(); |
---|
2818 | | - obj.SetBumpTexture(null); |
---|
| 3504 | + obj.ResetBumpTexture(); |
---|
2819 | 3505 | } |
---|
2820 | 3506 | |
---|
2821 | 3507 | refreshContents(); |
---|
.. | .. |
---|
2831 | 3517 | |
---|
2832 | 3518 | refreshContents(); |
---|
2833 | 3519 | } else |
---|
| 3520 | + if (source == embedTexturesItem) |
---|
| 3521 | + { |
---|
| 3522 | + Object3D obj; |
---|
| 3523 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3524 | + { |
---|
| 3525 | + obj = (Object3D)e.nextElement(); |
---|
| 3526 | + obj.EmbedTextures(true); |
---|
| 3527 | + } |
---|
| 3528 | + |
---|
| 3529 | + refreshContents(); |
---|
| 3530 | + } else |
---|
| 3531 | + if (source == deEmbedTexturesItem) |
---|
| 3532 | + { |
---|
| 3533 | + Object3D obj; |
---|
| 3534 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3535 | + { |
---|
| 3536 | + obj = (Object3D)e.nextElement(); |
---|
| 3537 | + obj.EmbedTextures(false); |
---|
| 3538 | + } |
---|
| 3539 | + |
---|
| 3540 | + CameraPane.texturepigment.clear(); |
---|
| 3541 | + CameraPane.texturebump.clear(); |
---|
| 3542 | + |
---|
| 3543 | + refreshContents(); |
---|
| 3544 | + } else |
---|
2834 | 3545 | if (source == flashSelectionButton) |
---|
2835 | 3546 | { |
---|
2836 | 3547 | CameraPane.flash = true; |
---|
.. | .. |
---|
2842 | 3553 | if (source == twoButton) |
---|
2843 | 3554 | { |
---|
2844 | 3555 | radio.layout = twoButton; |
---|
| 3556 | + |
---|
| 3557 | + if (CameraPane.FULLSCREEN) |
---|
| 3558 | + fullscreenLayout = radio.layout; |
---|
| 3559 | + |
---|
2845 | 3560 | // bug |
---|
2846 | 3561 | //gridPanel.setDividerLocation(1.0); |
---|
2847 | 3562 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2874 | 3589 | bigThree.ClearUI(); |
---|
2875 | 3590 | bigThree.add(centralPanel); |
---|
2876 | 3591 | bigThree.FlushUI(); |
---|
| 3592 | + |
---|
| 3593 | + cameraView.requestFocusInWindow(); |
---|
| 3594 | + |
---|
| 3595 | +// refreshContents(true); |
---|
| 3596 | +// |
---|
| 3597 | +// try |
---|
| 3598 | +// { |
---|
| 3599 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3600 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3601 | +// bot.mouseMove(100, 100); |
---|
| 3602 | +// bot.mousePress(mask); |
---|
| 3603 | +// bot.mouseRelease(mask); |
---|
| 3604 | +// } |
---|
| 3605 | +// catch (Exception e) |
---|
| 3606 | +// { |
---|
| 3607 | +// |
---|
| 3608 | +// } |
---|
| 3609 | + |
---|
2877 | 3610 | } else |
---|
2878 | 3611 | if (source == threeButton) |
---|
2879 | 3612 | { |
---|
2880 | 3613 | radio.layout = threeButton; |
---|
| 3614 | + |
---|
| 3615 | + if (CameraPane.FULLSCREEN) |
---|
| 3616 | + fullscreenLayout = radio.layout; |
---|
2881 | 3617 | |
---|
2882 | 3618 | // bigThree.remove(scenePanel); |
---|
2883 | 3619 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2907 | 3643 | // centralPanel.setVisible(true); |
---|
2908 | 3644 | // XYZPanel.setVisible(true); |
---|
2909 | 3645 | bigThree.ClearUI(); |
---|
| 3646 | + bigThree.add(scenePanel); |
---|
2910 | 3647 | bigThree.add(centralPanel); |
---|
2911 | | - bigThree.add(XYZPanel); |
---|
2912 | 3648 | bigThree.FlushUI(); |
---|
| 3649 | + |
---|
| 3650 | + cameraView.requestFocusInWindow(); |
---|
2913 | 3651 | } else |
---|
2914 | 3652 | if (source == fourButton) |
---|
2915 | 3653 | { |
---|
2916 | 3654 | radio.layout = fourButton; |
---|
| 3655 | + |
---|
| 3656 | + if (CameraPane.FULLSCREEN) |
---|
| 3657 | + fullscreenLayout = radio.layout; |
---|
2917 | 3658 | |
---|
2918 | 3659 | // bigThree.remove(scenePanel); |
---|
2919 | 3660 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2945 | 3686 | bigThree.ClearUI(); |
---|
2946 | 3687 | bigThree.add(scenePanel); |
---|
2947 | 3688 | bigThree.FlushUI(); |
---|
| 3689 | + |
---|
| 3690 | + cameraView.requestFocusInWindow(); |
---|
2948 | 3691 | } else |
---|
2949 | 3692 | if (source == sixButton) |
---|
2950 | 3693 | { |
---|
2951 | 3694 | radio.layout = sixButton; |
---|
| 3695 | + |
---|
| 3696 | + if (CameraPane.FULLSCREEN) |
---|
| 3697 | + fullscreenLayout = radio.layout; |
---|
2952 | 3698 | |
---|
2953 | 3699 | // bigThree.remove(scenePanel); |
---|
2954 | 3700 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2978 | 3724 | // centralPanel.setVisible(true); |
---|
2979 | 3725 | // XYZPanel.setVisible(false); |
---|
2980 | 3726 | bigThree.ClearUI(); |
---|
2981 | | - bigThree.add(scenePanel); |
---|
2982 | 3727 | bigThree.add(centralPanel); |
---|
| 3728 | + bigThree.add(scenePanel); |
---|
2983 | 3729 | bigThree.FlushUI(); |
---|
| 3730 | + |
---|
| 3731 | + cameraView.requestFocusInWindow(); |
---|
2984 | 3732 | } else |
---|
2985 | 3733 | if (source == sevenButton) |
---|
2986 | 3734 | { |
---|
2987 | 3735 | radio.layout = sevenButton; |
---|
| 3736 | + |
---|
| 3737 | + if (CameraPane.FULLSCREEN) |
---|
| 3738 | + fullscreenLayout = radio.layout; |
---|
2988 | 3739 | |
---|
2989 | 3740 | // bigThree.remove(scenePanel); |
---|
2990 | 3741 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3018 | 3769 | bigThree.add(centralPanel); |
---|
3019 | 3770 | bigThree.add(XYZPanel); |
---|
3020 | 3771 | bigThree.FlushUI(); |
---|
| 3772 | + |
---|
| 3773 | + cameraView.requestFocusInWindow(); |
---|
3021 | 3774 | } else |
---|
3022 | 3775 | if (source == rootButton) |
---|
3023 | 3776 | { |
---|
.. | .. |
---|
3029 | 3782 | EditObject(obj); |
---|
3030 | 3783 | } |
---|
3031 | 3784 | |
---|
| 3785 | + cameraView.requestFocusInWindow(); |
---|
3032 | 3786 | refreshContents(true); |
---|
3033 | 3787 | } else |
---|
3034 | 3788 | if (source == closeButton) |
---|
.. | .. |
---|
3038 | 3792 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3039 | 3793 | { |
---|
3040 | 3794 | ab = (cRadio)e.nextElement(); |
---|
3041 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3795 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
3042 | 3796 | { |
---|
| 3797 | + // Patch to avoid bug with transparency. |
---|
| 3798 | + if (!ab.hadMaterial) |
---|
| 3799 | + { |
---|
| 3800 | + ab.object.material = null; |
---|
| 3801 | + } |
---|
| 3802 | + |
---|
3043 | 3803 | buttonGroup.remove(ab); |
---|
3044 | 3804 | radioPanel.remove(ab); |
---|
3045 | 3805 | |
---|
3046 | | - ab.GetObject().editWindow = null; |
---|
| 3806 | + //ab.GetObject().editWindow = null; |
---|
| 3807 | + ab.GetObject().manipWindow = null; |
---|
3047 | 3808 | // ab.GetObject().objectUI = null; // ????????? |
---|
3048 | 3809 | |
---|
3049 | 3810 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
3050 | 3811 | break; |
---|
3051 | 3812 | } |
---|
3052 | 3813 | } |
---|
| 3814 | + |
---|
| 3815 | + cameraView.requestFocusInWindow(); |
---|
3053 | 3816 | refreshContents(true); |
---|
3054 | 3817 | } else |
---|
3055 | 3818 | if (source == editItem || source == editButton) |
---|
3056 | 3819 | { |
---|
| 3820 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3821 | + { |
---|
| 3822 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3823 | + child.pinned = true; |
---|
| 3824 | + } |
---|
| 3825 | + |
---|
3057 | 3826 | EditSelection(false); |
---|
3058 | 3827 | } else |
---|
3059 | 3828 | if (source == uneditButton) |
---|
.. | .. |
---|
3062 | 3831 | { |
---|
3063 | 3832 | Object3D child = (Object3D)e.nextElement(); |
---|
3064 | 3833 | if(child.editWindow != null) |
---|
3065 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3834 | + child.pinned = false; |
---|
3066 | 3835 | child.CloseUI(); |
---|
3067 | 3836 | listUI.remove(child); |
---|
| 3837 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3068 | 3838 | |
---|
3069 | 3839 | //child.editWindow = null; // ??????????? |
---|
3070 | 3840 | } |
---|
.. | .. |
---|
3079 | 3849 | //copy.ClearUI(); |
---|
3080 | 3850 | for (Object3D obj : listUI) |
---|
3081 | 3851 | { |
---|
| 3852 | + obj.pinned = false; |
---|
3082 | 3853 | obj.CloseUI(); |
---|
3083 | 3854 | } |
---|
3084 | 3855 | listUI.clear(); |
---|
| 3856 | + SetPinStates(group.selection.size() > 0); |
---|
3085 | 3857 | refreshContents(true); |
---|
3086 | 3858 | } else |
---|
3087 | 3859 | if (source == allParamsButton) |
---|
3088 | 3860 | { |
---|
3089 | 3861 | assert(copy == group); |
---|
3090 | 3862 | |
---|
3091 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3863 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3092 | 3864 | |
---|
3093 | 3865 | for (Object3D obj : listUI) |
---|
3094 | 3866 | { |
---|
.. | .. |
---|
3137 | 3909 | } |
---|
3138 | 3910 | |
---|
3139 | 3911 | copy = group; |
---|
| 3912 | + |
---|
| 3913 | + SetUndoStates(); |
---|
| 3914 | + |
---|
3140 | 3915 | //Globals.theRenderer.object = group; |
---|
3141 | 3916 | if(!useclient) |
---|
3142 | 3917 | { |
---|
.. | .. |
---|
3154 | 3929 | } |
---|
3155 | 3930 | |
---|
3156 | 3931 | // fix "+" issue |
---|
3157 | | - group.editWindow = this; |
---|
| 3932 | + //group.editWindow = this; |
---|
| 3933 | + group.manipWindow = this; |
---|
3158 | 3934 | |
---|
3159 | 3935 | /* |
---|
3160 | 3936 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3162 | 3938 | currentLayout = sevenButton; |
---|
3163 | 3939 | */ |
---|
3164 | 3940 | radio.layout.doClick(); |
---|
| 3941 | + |
---|
| 3942 | + ClearUnpinned(); |
---|
| 3943 | + |
---|
| 3944 | + //Grafreed.Assert(group != null); |
---|
| 3945 | + //Grafreed.Assert(group.selection != null); |
---|
| 3946 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3947 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3948 | + EditSelection(false); |
---|
3165 | 3949 | keepparent = group.parent; |
---|
3166 | 3950 | // PARENT = NULL or not??? |
---|
3167 | 3951 | //group.parent = null; // ROOT |
---|
3168 | 3952 | //group.attributes = -1; |
---|
3169 | 3953 | ResetModel(); |
---|
| 3954 | + |
---|
| 3955 | + cameraView.requestFocusInWindow(); |
---|
3170 | 3956 | refreshContents(true); |
---|
3171 | 3957 | } else if (event.getSource() == editCameraItem) |
---|
3172 | 3958 | { |
---|
3173 | 3959 | cameraView.ProtectCamera(); |
---|
| 3960 | + cameraView.requestFocusInWindow(); |
---|
3174 | 3961 | cameraView.repaint(); |
---|
3175 | 3962 | return; |
---|
3176 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3963 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3177 | 3964 | { |
---|
3178 | 3965 | cameraView.RevertCamera(); |
---|
| 3966 | + cameraView.requestFocusInWindow(); |
---|
3179 | 3967 | cameraView.repaint(); |
---|
3180 | 3968 | return; |
---|
3181 | 3969 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
3190 | 3978 | } |
---|
3191 | 3979 | |
---|
3192 | 3980 | boolean useclient = false; |
---|
3193 | | - cRadio radio; |
---|
3194 | 3981 | |
---|
3195 | 3982 | void ToggleRoot() |
---|
3196 | 3983 | { |
---|
.. | .. |
---|
3753 | 4540 | |
---|
3754 | 4541 | try |
---|
3755 | 4542 | { |
---|
3756 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4543 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
3757 | 4544 | } |
---|
3758 | 4545 | catch (Exception e) |
---|
3759 | 4546 | { |
---|
.. | .. |
---|
4145 | 4932 | refreshContents(); |
---|
4146 | 4933 | } |
---|
4147 | 4934 | |
---|
| 4935 | + void RewindLeaves(boolean hide) |
---|
| 4936 | + { |
---|
| 4937 | + group.selection.RewindLeaves(hide); |
---|
| 4938 | + refreshContents(); |
---|
| 4939 | + } |
---|
| 4940 | + |
---|
| 4941 | + void RandomLeaves(boolean hide) |
---|
| 4942 | + { |
---|
| 4943 | + group.selection.RandomLeaves(hide); |
---|
| 4944 | + refreshContents(); |
---|
| 4945 | + } |
---|
| 4946 | + |
---|
4148 | 4947 | void SetTexRes(int tr) |
---|
4149 | 4948 | { |
---|
4150 | 4949 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4216 | 5015 | // } |
---|
4217 | 5016 | // } |
---|
4218 | 5017 | |
---|
4219 | | - static boolean allparams = true; |
---|
4220 | | - |
---|
4221 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4222 | | - |
---|
4223 | 5018 | void EditSelection(boolean newWindow) |
---|
4224 | 5019 | { |
---|
| 5020 | + if (group.selection == null) |
---|
| 5021 | + { |
---|
| 5022 | + EditElement(group, newWindow); // ? new |
---|
| 5023 | + return; |
---|
| 5024 | + } |
---|
| 5025 | + |
---|
4225 | 5026 | // aConstraints.gridy = 0; |
---|
4226 | 5027 | for (int i=0; i<group.selection.size(); i++) |
---|
4227 | 5028 | { |
---|
4228 | 5029 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4229 | 5030 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4230 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 5031 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4231 | 5032 | |
---|
4232 | 5033 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4233 | 5034 | if(elem != group || !newWindow) |
---|
4234 | 5035 | { |
---|
4235 | | - // if (!(elem instanceof Composite)) |
---|
4236 | | - // newWindow = false; |
---|
4237 | | - listUI.add(elem); |
---|
4238 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4239 | | - System.out.println("edit : " + elem); |
---|
4240 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5036 | + EditElement(elem, newWindow); // ? new |
---|
4241 | 5037 | } |
---|
4242 | 5038 | } |
---|
4243 | 5039 | } |
---|
.. | .. |
---|
4300 | 5096 | |
---|
4301 | 5097 | freezemodel = false; |
---|
4302 | 5098 | } |
---|
4303 | | - |
---|
4304 | | - boolean flashIt = true; |
---|
4305 | | - |
---|
| 5099 | + |
---|
4306 | 5100 | public void valueChanged(TreeSelectionEvent e) |
---|
4307 | 5101 | //public boolean handleEvent(Event event) |
---|
4308 | 5102 | { |
---|
.. | .. |
---|
4312 | 5106 | //new Exception().printStackTrace(); |
---|
4313 | 5107 | |
---|
4314 | 5108 | freezemodel = true; |
---|
4315 | | - |
---|
| 5109 | + ClearUnpinned(); |
---|
| 5110 | + |
---|
4316 | 5111 | /**/ |
---|
4317 | 5112 | //switch (event.id) |
---|
4318 | 5113 | { |
---|
.. | .. |
---|
4320 | 5115 | //case 702: // Event.LIST_DESELECT |
---|
4321 | 5116 | group.deselectAll(); |
---|
4322 | 5117 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4323 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4324 | 5118 | if (tps != null) |
---|
4325 | 5119 | { |
---|
4326 | 5120 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4329 | 5123 | |
---|
4330 | 5124 | //if (child.parent != null) |
---|
4331 | 5125 | //child.parent.addSelectee(child); |
---|
| 5126 | + objEditor.SetMaterial(child); |
---|
4332 | 5127 | group.addSelectee(child); |
---|
4333 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4334 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4335 | | - System.err.println("info : " + child.GetPath()); |
---|
4336 | 5128 | } |
---|
4337 | 5129 | } |
---|
4338 | 5130 | // else |
---|
.. | .. |
---|
4342 | 5134 | // System.err.println("info : " + group.GetPath()); |
---|
4343 | 5135 | // } |
---|
4344 | 5136 | |
---|
4345 | | - objEditor.SetText(); // jan 2014 |
---|
4346 | | - |
---|
4347 | 5137 | if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4348 | 5138 | CameraPane.flash = true; |
---|
4349 | 5139 | |
---|
4350 | 5140 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4351 | 5141 | // a camera |
---|
4352 | 5142 | { |
---|
4353 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 5143 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4354 | 5144 | { |
---|
4355 | 5145 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4356 | 5146 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4359 | 5149 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4360 | 5150 | } |
---|
4361 | 5151 | |
---|
| 5152 | + if (tps != null && tps.length == 1) |
---|
| 5153 | + { |
---|
| 5154 | + EditSelection(false); |
---|
| 5155 | + } |
---|
| 5156 | + |
---|
| 5157 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5158 | + |
---|
4362 | 5159 | refreshContents(); |
---|
4363 | 5160 | //return true; |
---|
4364 | 5161 | } |
---|
.. | .. |
---|
4367 | 5164 | |
---|
4368 | 5165 | freezemodel = false; |
---|
4369 | 5166 | } |
---|
| 5167 | + |
---|
| 5168 | + void SetPinStates(boolean enabled) |
---|
| 5169 | + { |
---|
| 5170 | + editButton.setEnabled(enabled); |
---|
| 5171 | + uneditButton.setEnabled(enabled); |
---|
| 5172 | + unselectButton.setEnabled(enabled); |
---|
| 5173 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5174 | + |
---|
| 5175 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5176 | + } |
---|
| 5177 | + |
---|
| 5178 | + void refreshContents(boolean cp) |
---|
| 5179 | + { |
---|
| 5180 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5181 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 5182 | + { |
---|
| 5183 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 5184 | + |
---|
| 5185 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 5186 | + { |
---|
| 5187 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 5188 | + |
---|
| 5189 | + objEditor.AddInfo(child, this, true); |
---|
| 5190 | + System.err.println("info : " + child.GetPath()); |
---|
| 5191 | + } |
---|
| 5192 | + |
---|
| 5193 | + objEditor.SetText(); // jan 2014 |
---|
| 5194 | + } |
---|
| 5195 | + |
---|
| 5196 | + super.refreshContents(cp); |
---|
| 5197 | + } |
---|
4370 | 5198 | |
---|
4371 | 5199 | void linkSomething(Object3D thing) |
---|
4372 | 5200 | { |
---|
.. | .. |
---|
4449 | 5277 | |
---|
4450 | 5278 | if (cut) |
---|
4451 | 5279 | { |
---|
4452 | | - Save(); |
---|
| 5280 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5281 | +// Save(); |
---|
4453 | 5282 | //int indices[] = jList.getSelectedIndices(); |
---|
4454 | 5283 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4455 | 5284 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4552 | 5381 | |
---|
4553 | 5382 | void paste(boolean expand) |
---|
4554 | 5383 | { |
---|
| 5384 | + if (Globals.REPLACEONMAKE) |
---|
| 5385 | + Save(); |
---|
| 5386 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5387 | + Globals.REPLACEONMAKE = false; |
---|
4555 | 5388 | // if (GrafreeD.clipboard == null) |
---|
4556 | 5389 | // return; |
---|
4557 | 5390 | boolean first = true; |
---|
.. | .. |
---|
4611 | 5444 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4612 | 5445 | } |
---|
4613 | 5446 | |
---|
| 5447 | + Globals.REPLACEONMAKE = keep; |
---|
4614 | 5448 | ResetModel(); |
---|
4615 | 5449 | refreshContents(); |
---|
4616 | 5450 | } |
---|
.. | .. |
---|
4746 | 5580 | |
---|
4747 | 5581 | void group(Object3D csg, boolean grab) |
---|
4748 | 5582 | { |
---|
| 5583 | + if (Globals.REPLACEONMAKE) |
---|
| 5584 | + Save(); |
---|
| 5585 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5586 | + Globals.REPLACEONMAKE = false; |
---|
4749 | 5587 | if (//false) // why?? |
---|
4750 | 5588 | !group.selection.isEmpty()) |
---|
4751 | 5589 | { |
---|
.. | .. |
---|
4859 | 5697 | //node.add(csg); |
---|
4860 | 5698 | //makeSomething(node); |
---|
4861 | 5699 | makeSomething(csg); |
---|
| 5700 | + Globals.REPLACEONMAKE = keep; |
---|
4862 | 5701 | } |
---|
4863 | 5702 | |
---|
4864 | 5703 | void Ungroup(Object3D g) |
---|
4865 | 5704 | { |
---|
| 5705 | + if (Globals.REPLACEONMAKE) |
---|
| 5706 | + Save(); |
---|
| 5707 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5708 | + Globals.REPLACEONMAKE = false; |
---|
4866 | 5709 | if (g instanceof HiddenObject) |
---|
4867 | 5710 | { |
---|
4868 | 5711 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4879 | 5722 | objEditor.makeSomething(g.get(i), false); |
---|
4880 | 5723 | } |
---|
4881 | 5724 | } |
---|
| 5725 | + Globals.REPLACEONMAKE = keep; |
---|
4882 | 5726 | } |
---|
4883 | 5727 | |
---|
4884 | 5728 | void ungroup() |
---|
.. | .. |
---|
5167 | 6011 | cButton clearpanelButton; |
---|
5168 | 6012 | cButton unselectButton; |
---|
5169 | 6013 | |
---|
5170 | | - cButton saveButton; |
---|
5171 | | - cButton undoButton; |
---|
5172 | | - cButton redoButton; |
---|
| 6014 | + cButton restoreCameraButton; |
---|
| 6015 | + |
---|
5173 | 6016 | cButton oneStepButton; |
---|
| 6017 | + |
---|
| 6018 | + cButton groupButton; |
---|
| 6019 | + cButton ungroupButton; |
---|
| 6020 | + cButton compositeButton; |
---|
| 6021 | + cButton switchButton; |
---|
| 6022 | + cButton loopButton; |
---|
| 6023 | + cButton textureButton; |
---|
| 6024 | + |
---|
| 6025 | + cButton skybox1Button; |
---|
| 6026 | + cButton skybox2Button; |
---|
| 6027 | + cButton skybox3Button; |
---|
| 6028 | + cButton skybox4Button; |
---|
| 6029 | + cButton skybox5Button; |
---|
| 6030 | + cButton skybox6Button; |
---|
| 6031 | + cButton skybox7Button; |
---|
| 6032 | + |
---|
| 6033 | + cButton skybox11Button; |
---|
| 6034 | + cButton skybox12Button; |
---|
| 6035 | + cButton skybox13Button; |
---|
| 6036 | + cButton skybox14Button; |
---|
| 6037 | + cButton skybox15Button; |
---|
| 6038 | + cButton skybox16Button; |
---|
| 6039 | + cButton skybox17Button; |
---|
| 6040 | + |
---|
| 6041 | + cButton gridButton; |
---|
| 6042 | + cButton boxButton; |
---|
| 6043 | + cButton sphereButton; |
---|
| 6044 | + cButton coneButton; |
---|
| 6045 | + cButton torusButton; |
---|
| 6046 | + cButton superButton; |
---|
| 6047 | + cButton kleinButton; |
---|
| 6048 | + cButton particlesButton; |
---|
| 6049 | + cButton overlayButton; |
---|
| 6050 | + cButton lightButton; |
---|
5174 | 6051 | |
---|
5175 | 6052 | cButton screenfitButton; |
---|
5176 | 6053 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5183 | 6060 | |
---|
5184 | 6061 | cButton setsupportButton; |
---|
5185 | 6062 | |
---|
5186 | | - cButton twoButton; |
---|
5187 | | - cButton sixButton; |
---|
5188 | | - cButton threeButton; |
---|
5189 | | - cButton sevenButton; |
---|
5190 | | - cButton fourButton; // full panel |
---|
5191 | | - cButton oneButton; // full XYZ |
---|
5192 | | - //cButton currentLayout; |
---|
5193 | | - |
---|
5194 | 6063 | // |
---|
5195 | 6064 | //Composite |
---|
5196 | 6065 | Object3D // to do !! |
---|
.. | .. |
---|
5200 | 6069 | //JTree jTree; |
---|
5201 | 6070 | private MenuItem lookAtItem; |
---|
5202 | 6071 | private MenuItem lookFromItem; |
---|
5203 | | - private MenuItem switchItem; |
---|
| 6072 | + private MenuItem switchViewItem; |
---|
5204 | 6073 | private MenuItem cutItem; |
---|
5205 | 6074 | private MenuItem undoItem; |
---|
5206 | 6075 | private MenuItem redoItem; |
---|
5207 | | - private MenuItem duplicateItem; |
---|
| 6076 | + private JMenuItem duplicateItem; |
---|
5208 | 6077 | private MenuItem cloneItem; |
---|
5209 | 6078 | private MenuItem cloneSupportItem; |
---|
5210 | 6079 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5232 | 6101 | private MenuItem pasteLinkItem; |
---|
5233 | 6102 | private MenuItem pasteCloneItem; |
---|
5234 | 6103 | private MenuItem pasteExpandItem; |
---|
5235 | | - private MenuItem clearItem; |
---|
| 6104 | + private MenuItem deleteItem; |
---|
5236 | 6105 | private MenuItem clearAllItem; |
---|
5237 | 6106 | private MenuItem genUVItem; |
---|
5238 | 6107 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5267 | 6136 | private MenuItem showleavesItem; |
---|
5268 | 6137 | private MenuItem markleavesItem; |
---|
5269 | 6138 | private MenuItem unmarkleavesItem; |
---|
| 6139 | + private MenuItem rewindleavesItem; |
---|
| 6140 | + private MenuItem unrewindleavesItem; |
---|
| 6141 | + private MenuItem randomleavesItem; |
---|
| 6142 | + private MenuItem unrandomleavesItem; |
---|
5270 | 6143 | |
---|
5271 | 6144 | private MenuItem flipVItem; |
---|
5272 | 6145 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5288 | 6161 | private MenuItem frontItem; |
---|
5289 | 6162 | private MenuItem cameraItem; |
---|
5290 | 6163 | private MenuItem compositeItem; |
---|
5291 | | - private MenuItem randomItem; |
---|
| 6164 | + private MenuItem switchItem; |
---|
5292 | 6165 | private MenuItem physicsItem; |
---|
5293 | 6166 | private MenuItem frameselectorItem; |
---|
5294 | 6167 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5312 | 6185 | private MenuItem attachBumpItem; |
---|
5313 | 6186 | private MenuItem detachBumpItem; |
---|
5314 | 6187 | private MenuItem pigmentBumpItem; |
---|
| 6188 | + private MenuItem embedTexturesItem; |
---|
| 6189 | + private MenuItem deEmbedTexturesItem; |
---|
5315 | 6190 | |
---|
5316 | 6191 | private MenuItem particleItem; |
---|
5317 | 6192 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5362 | 6237 | |
---|
5363 | 6238 | Menu cameraMenu; |
---|
5364 | 6239 | MenuItem editCameraItem; |
---|
5365 | | - MenuItem revertCameraItem; |
---|
| 6240 | + MenuItem restoreCameraItem; |
---|
5366 | 6241 | } |
---|