.. | .. |
---|
16 | 16 | //import buoy.widget.BFileChooser; |
---|
17 | 17 | |
---|
18 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
| 19 | + Grafreed.iResourceCallBack, |
---|
19 | 20 | ObjectUI, |
---|
20 | 21 | Runnable, |
---|
21 | 22 | ActionListener, |
---|
.. | .. |
---|
23 | 24 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 25 | ItemListener // ListSelectionListener |
---|
25 | 26 | { |
---|
| 27 | + |
---|
| 28 | + public void AddSkyboxButton(String f, String s, cGridBag row) |
---|
| 29 | + { |
---|
| 30 | + cButton skyboxButton; |
---|
| 31 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 32 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Globals.NIMBUSLAF)); |
---|
| 33 | + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 34 | + skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
| 35 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 36 | + { |
---|
| 37 | + @Override |
---|
| 38 | + public void actionPerformed(ActionEvent e) |
---|
| 39 | + { |
---|
| 40 | + ChangeSkybox(path); |
---|
| 41 | + } |
---|
| 42 | + }); |
---|
| 43 | + } |
---|
| 44 | + |
---|
| 45 | + public void AddTextureButton(String f, String c, final String t, int count, cGridBag row) |
---|
| 46 | + { |
---|
| 47 | + cButton textureButton; |
---|
| 48 | + final String path = "textures/" + f + "/" + c + "/"; // + t; |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Globals.NIMBUSLAF)); |
---|
| 50 | + textureButton.setToolTipText(c + count); |
---|
| 51 | + textureButton.addActionListener(new ActionListener() |
---|
| 52 | + { |
---|
| 53 | + @Override |
---|
| 54 | + public void actionPerformed(ActionEvent e) |
---|
| 55 | + { |
---|
| 56 | + ChangeTexture(path + t); |
---|
| 57 | + } |
---|
| 58 | + }); |
---|
| 59 | + } |
---|
| 60 | + |
---|
| 61 | + public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
| 62 | + { |
---|
| 63 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 64 | + |
---|
| 65 | + tab0.setName("Urban"); |
---|
| 66 | + skyboxpanel.add(tab0); |
---|
| 67 | + |
---|
| 68 | + cGridBag row0 = new cGridBag(); |
---|
| 69 | + cGridBag row1 = new cGridBag(); |
---|
| 70 | + cGridBag row2 = new cGridBag(); |
---|
| 71 | + cGridBag row3 = new cGridBag(); |
---|
| 72 | + cGridBag row4 = new cGridBag(); |
---|
| 73 | + cGridBag row5 = new cGridBag(); |
---|
| 74 | + cGridBag row6 = new cGridBag(); |
---|
| 75 | + |
---|
| 76 | + AddSkyboxButton("default", "", row0); |
---|
| 77 | + //AddSkyboxButton("default", "cornell", row0); |
---|
| 78 | + AddSkyboxButton("penguins", "dust", row0); |
---|
| 79 | + AddSkyboxButton("penguins", "tropic", row0); |
---|
| 80 | + AddSkyboxButton("penguins", "yonder", row0); |
---|
| 81 | + |
---|
| 82 | + AddSkyboxButton("default", "uffizi", row1); |
---|
| 83 | + AddSkyboxButton("bridge", "Bridge", row1); |
---|
| 84 | + AddSkyboxButton("bridge", "Bridge2", row1); |
---|
| 85 | + AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
| 86 | + |
---|
| 87 | + AddSkyboxButton("urban", "Parliament", row2); |
---|
| 88 | + AddSkyboxButton("urban", "Roundabout", row2); |
---|
| 89 | + AddSkyboxButton("urban", "SaintLazarusChurch", row2); |
---|
| 90 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row2); |
---|
| 91 | + |
---|
| 92 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
| 93 | + AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 94 | + AddSkyboxButton("urban", "Medborgarplatsen", row3); |
---|
| 95 | + AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
| 96 | + |
---|
| 97 | + AddSkyboxButton("park", "Buddha", row4); |
---|
| 98 | + AddSkyboxButton("park", "CNTower2", row4); |
---|
| 99 | + AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
| 100 | + AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
| 101 | + |
---|
| 102 | + AddSkyboxButton("park", "Park", row5); |
---|
| 103 | + AddSkyboxButton("park", "Pond", row5); |
---|
| 104 | + AddSkyboxButton("park", "Skansen", row5); |
---|
| 105 | + AddSkyboxButton("park", "Skansen2", row5); |
---|
| 106 | + |
---|
| 107 | + AddSkyboxButton("park", "Skansen3", row6); |
---|
| 108 | + AddSkyboxButton("park", "Skansen4", row6); |
---|
| 109 | + AddSkyboxButton("park", "Skansen5", row6); |
---|
| 110 | + AddSkyboxButton("persson", "VancouverConventionCentre", row6); |
---|
| 111 | + |
---|
| 112 | + tab0.add(row0); |
---|
| 113 | + tab0.add(row1); |
---|
| 114 | + tab0.add(row2); |
---|
| 115 | + tab0.add(row3); |
---|
| 116 | + tab0.add(row4); |
---|
| 117 | + tab0.add(row5); |
---|
| 118 | + tab0.add(row6); |
---|
| 119 | + |
---|
| 120 | + for (int i=5; --i>=0;) |
---|
| 121 | + { |
---|
| 122 | + //oe.toolboxPanel.Return(); |
---|
| 123 | + //tab0.add(new cGridBag()); |
---|
| 124 | + } |
---|
| 125 | + } |
---|
| 126 | + |
---|
| 127 | + public void AddSkyboxTab1(JTabbedPane skyboxpanel) |
---|
| 128 | + { |
---|
| 129 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 130 | + |
---|
| 131 | + tab0.setName("Nature"); |
---|
| 132 | + skyboxpanel.add(tab0); |
---|
| 133 | + |
---|
| 134 | + cGridBag row0 = new cGridBag(); |
---|
| 135 | + cGridBag row1 = new cGridBag(); |
---|
| 136 | + cGridBag row2 = new cGridBag(); |
---|
| 137 | + cGridBag row3 = new cGridBag(); |
---|
| 138 | + cGridBag row4 = new cGridBag(); |
---|
| 139 | + cGridBag row5 = new cGridBag(); |
---|
| 140 | + cGridBag row6 = new cGridBag(); |
---|
| 141 | + |
---|
| 142 | + AddSkyboxButton("beach", "HeartInTheSand", row0); |
---|
| 143 | + AddSkyboxButton("beach", "LarnacaBeach", row0); |
---|
| 144 | + AddSkyboxButton("beach", "PalmTrees", row0); |
---|
| 145 | + AddSkyboxButton("beach", "Tenerife", row0); |
---|
| 146 | + |
---|
| 147 | + AddSkyboxButton("beach", "Tenerife2", row1); |
---|
| 148 | + AddSkyboxButton("beach", "Tenerife3", row1); |
---|
| 149 | + AddSkyboxButton("field", "FishPond", row1); |
---|
| 150 | + AddSkyboxButton("field", "Footballfield", row1); |
---|
| 151 | + |
---|
| 152 | + AddSkyboxButton("field", "Meadow", row2); |
---|
| 153 | + AddSkyboxButton("field", "Sorsele", row2); |
---|
| 154 | + AddSkyboxButton("field", "Sorsele2", row2); |
---|
| 155 | + AddSkyboxButton("field", "Sorsele3", row2); |
---|
| 156 | + |
---|
| 157 | + AddSkyboxButton("forest", "Brudslojan", row3); |
---|
| 158 | + AddSkyboxButton("forest", "Langholmen2", row3); |
---|
| 159 | + AddSkyboxButton("forest", "Plants", row3); |
---|
| 160 | + AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 161 | + |
---|
| 162 | + AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
| 163 | + AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
| 164 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 165 | + AddSkyboxButton("park", "Tantolunden4", row4); |
---|
| 166 | + |
---|
| 167 | + AddSkyboxButton("park", "Stairs", row5); |
---|
| 168 | + AddSkyboxButton("default", "skycube", row6); |
---|
| 169 | + AddSkyboxButton("rocky", "Langholmen", row5); |
---|
| 170 | + AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 171 | + |
---|
| 172 | + AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 173 | + AddSkyboxButton("default", "CloudyHills", row6); |
---|
| 174 | + AddSkyboxButton("daz", "Autumn", row6); |
---|
| 175 | + AddSkyboxButton("daz", "MountainTrail", row6); |
---|
| 176 | + /* |
---|
| 177 | +Autumn |
---|
| 178 | +Greenlands |
---|
| 179 | +MountainTrail |
---|
| 180 | +Oasis |
---|
| 181 | +TheRock |
---|
| 182 | +TopOfTheWorld |
---|
| 183 | +Winter |
---|
| 184 | + */ |
---|
| 185 | + |
---|
| 186 | + tab0.add(row0); |
---|
| 187 | + tab0.add(row1); |
---|
| 188 | + tab0.add(row2); |
---|
| 189 | + tab0.add(row3); |
---|
| 190 | + tab0.add(row4); |
---|
| 191 | + tab0.add(row5); |
---|
| 192 | + tab0.add(row6); |
---|
| 193 | + |
---|
| 194 | + for (int i=5; --i>=0;) |
---|
| 195 | + { |
---|
| 196 | + //oe.toolboxPanel.Return(); |
---|
| 197 | + //tab0.add(new cGridBag()); |
---|
| 198 | + } |
---|
| 199 | + } |
---|
| 200 | + |
---|
| 201 | + public void AddSkyboxTab2(JTabbedPane skyboxpanel) |
---|
| 202 | + { |
---|
| 203 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 204 | + |
---|
| 205 | + tab0.setName("Night"); |
---|
| 206 | + skyboxpanel.add(tab0); |
---|
| 207 | + |
---|
| 208 | + cGridBag row0 = new cGridBag(); |
---|
| 209 | + cGridBag row1 = new cGridBag(); |
---|
| 210 | + cGridBag row2 = new cGridBag(); |
---|
| 211 | + cGridBag row3 = new cGridBag(); |
---|
| 212 | + cGridBag row4 = new cGridBag(); |
---|
| 213 | + cGridBag row5 = new cGridBag(); |
---|
| 214 | + cGridBag row6 = new cGridBag(); |
---|
| 215 | + |
---|
| 216 | + AddSkyboxButton("night", "NightPath", row0); |
---|
| 217 | + AddSkyboxButton("night", "PondNight", row0); |
---|
| 218 | + AddSkyboxButton("night", "Powerlines", row0); |
---|
| 219 | + AddSkyboxButton("night", "SwedishRoyalCastle", row0); |
---|
| 220 | + |
---|
| 221 | + AddSkyboxButton("urban", "CNTower", row1); |
---|
| 222 | + AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
| 223 | + AddSkyboxButton("rocky", "Riddarfjarden", row1); |
---|
| 224 | + AddSkyboxButton("penguins", "sleepyhollow", row1); |
---|
| 225 | + |
---|
| 226 | + AddSkyboxButton("penguins", "kenon_star", row2); |
---|
| 227 | + AddSkyboxButton("persson", "corona", row2); |
---|
| 228 | + AddSkyboxButton("persson", "spaceskybox", row2); |
---|
| 229 | + AddSkyboxButton("indoors", "Vasa", row2); |
---|
| 230 | + |
---|
| 231 | + AddSkyboxButton("winter", "Backyard", row3); |
---|
| 232 | + AddSkyboxButton("winter", "Creek", row3); |
---|
| 233 | + AddSkyboxButton("winter", "FootballField3", row3); |
---|
| 234 | + AddSkyboxButton("winter", "Forest", row3); |
---|
| 235 | + |
---|
| 236 | + AddSkyboxButton("winter", "HornstullsStrand2", row4); |
---|
| 237 | + AddSkyboxButton("winter", "House", row4); |
---|
| 238 | + AddSkyboxButton("winter", "IceLake", row4); |
---|
| 239 | + AddSkyboxButton("winter", "IceRiver", row4); |
---|
| 240 | + |
---|
| 241 | + AddSkyboxButton("winter", "Park3", row5); |
---|
| 242 | + AddSkyboxButton("winter", "PondWinter", row5); |
---|
| 243 | + AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
| 244 | + AddSkyboxButton("winter", "Vindelalven", row5); |
---|
| 245 | + |
---|
| 246 | + AddSkyboxButton("daz", "TheRock", row6); |
---|
| 247 | + AddSkyboxButton("daz", "TopOfTheWorld", row6); |
---|
| 248 | + AddSkyboxButton("daz", "Winter", row6); |
---|
| 249 | + AddSkyboxButton("mountain", "Ryfjallet", row6); |
---|
| 250 | + |
---|
| 251 | + tab0.add(row0); |
---|
| 252 | + tab0.add(row1); |
---|
| 253 | + tab0.add(row2); |
---|
| 254 | + tab0.add(row3); |
---|
| 255 | + tab0.add(row4); |
---|
| 256 | + tab0.add(row5); |
---|
| 257 | + tab0.add(row6); |
---|
| 258 | + |
---|
| 259 | + for (int i=5; --i>=0;) |
---|
| 260 | + { |
---|
| 261 | + //oe.toolboxPanel.Return(); |
---|
| 262 | + //tab0.add(new cGridBag()); |
---|
| 263 | + } |
---|
| 264 | + } |
---|
| 265 | + |
---|
| 266 | + public void AddSkyboxTab3(JTabbedPane skyboxpanel) |
---|
| 267 | + { |
---|
| 268 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 269 | + |
---|
| 270 | + tab0.setName("Others"); |
---|
| 271 | + skyboxpanel.add(tab0); |
---|
| 272 | + |
---|
| 273 | + cGridBag row0 = new cGridBag(); |
---|
| 274 | + cGridBag row1 = new cGridBag(); |
---|
| 275 | + cGridBag row2 = new cGridBag(); |
---|
| 276 | + cGridBag row3 = new cGridBag(); |
---|
| 277 | + cGridBag row4 = new cGridBag(); |
---|
| 278 | + cGridBag row5 = new cGridBag(); |
---|
| 279 | + cGridBag row6 = new cGridBag(); |
---|
| 280 | + |
---|
| 281 | + AddSkyboxButton("mayhem", "afterrain", row0); |
---|
| 282 | + AddSkyboxButton("mayhem", "aqua4", row0); |
---|
| 283 | + AddSkyboxButton("mayhem", "aqua9", row0); |
---|
| 284 | + AddSkyboxButton("mayhem", "flame", row0); |
---|
| 285 | + |
---|
| 286 | + AddSkyboxButton("mayhem", "h2s", row1); |
---|
| 287 | + AddSkyboxButton("mayhem", "prehistoric", row1); |
---|
| 288 | + AddSkyboxButton("mayhem", "scorched", row1); |
---|
| 289 | + AddSkyboxButton("penguins", "desertdawn", row1); |
---|
| 290 | + |
---|
| 291 | + AddSkyboxButton("persson", "Citadella", row2); |
---|
| 292 | + AddSkyboxButton("persson", "Citadella2", row2); |
---|
| 293 | + AddSkyboxButton("persson", "clouds1", row2); |
---|
| 294 | + AddSkyboxButton("penguins", "wrath", row2); |
---|
| 295 | + |
---|
| 296 | + AddSkyboxButton("persson", "FishermansBastion", row3); |
---|
| 297 | + AddSkyboxButton("persson", "HeroesSquare", row3); |
---|
| 298 | + AddSkyboxButton("indoors", "DallasW", row3); |
---|
| 299 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row3); |
---|
| 300 | + |
---|
| 301 | + AddSkyboxButton("persson", "LancellottiChapel", row4); |
---|
| 302 | + AddSkyboxButton("persson", "PereaBeach1", row4); |
---|
| 303 | + AddSkyboxButton("persson", "PereaBeach2", row4); |
---|
| 304 | + AddSkyboxButton("persson", "redeclipse", row4); |
---|
| 305 | + |
---|
| 306 | + AddSkyboxButton("daz", "Greenlands", row5); |
---|
| 307 | + AddSkyboxButton("daz", "Oasis", row5); |
---|
| 308 | + AddSkyboxButton("elyvisions", "arch3", row5); |
---|
| 309 | + AddSkyboxButton("elyvisions", "calm_sea", row5); |
---|
| 310 | + |
---|
| 311 | + AddSkyboxButton("elyvisions", "rainbow", row6); |
---|
| 312 | + AddSkyboxButton("elyvisions", "distant_sunset", row6); |
---|
| 313 | + AddSkyboxButton("elyvisions", "heaven", row6); |
---|
| 314 | + AddSkyboxButton("elyvisions", "hot", row6); |
---|
| 315 | + |
---|
| 316 | + tab0.add(row0); |
---|
| 317 | + tab0.add(row1); |
---|
| 318 | + tab0.add(row2); |
---|
| 319 | + tab0.add(row3); |
---|
| 320 | + tab0.add(row4); |
---|
| 321 | + tab0.add(row5); |
---|
| 322 | + tab0.add(row6); |
---|
| 323 | + |
---|
| 324 | + for (int i=5; --i>=0;) |
---|
| 325 | + { |
---|
| 326 | + //oe.toolboxPanel.Return(); |
---|
| 327 | + //tab0.add(new cGridBag()); |
---|
| 328 | + } |
---|
| 329 | + } |
---|
| 330 | + |
---|
| 331 | + public void ChangeSkybox(String skybox) |
---|
| 332 | + { |
---|
| 333 | + if (skybox.endsWith("/")) |
---|
| 334 | + { |
---|
| 335 | + group.skyboxname = null; |
---|
| 336 | + group.skyboxext = null; |
---|
| 337 | + cameraView.repaint(); |
---|
| 338 | + } |
---|
| 339 | + else |
---|
| 340 | + { |
---|
| 341 | + //cameraView.envyoff = false; |
---|
| 342 | + group.skyboxname = skybox; |
---|
| 343 | + group.skyboxext = "jpg"; |
---|
| 344 | + cameraView.repaint(); |
---|
| 345 | + } |
---|
| 346 | + } |
---|
| 347 | + |
---|
| 348 | + public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
| 349 | + { |
---|
| 350 | + JTabbedPane skyboxpane = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 351 | + |
---|
| 352 | + AddSkyboxTab0(skyboxpane); |
---|
| 353 | + AddSkyboxTab1(skyboxpane); |
---|
| 354 | + AddSkyboxTab2(skyboxpane); |
---|
| 355 | + AddSkyboxTab3(skyboxpane); |
---|
| 356 | + |
---|
| 357 | + skyboxPanel.add(skyboxpane); |
---|
| 358 | + } |
---|
| 359 | + |
---|
| 360 | + public void ChangeTexture(String texture) |
---|
| 361 | + { |
---|
| 362 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 363 | + { |
---|
| 364 | + Object3D obj = group.selection.get(i); |
---|
| 365 | + obj.SetPigmentTexture("@" + texture); |
---|
| 366 | + } |
---|
| 367 | + |
---|
| 368 | + refreshContents(); |
---|
| 369 | + } |
---|
| 370 | + |
---|
| 371 | + public void Show3DView() |
---|
| 372 | + { |
---|
| 373 | + // bug |
---|
| 374 | + //gridPanel.setDividerLocation(1.0); |
---|
| 375 | + //bigPanel.setDividerLocation(0.0); |
---|
| 376 | + bigThree.ClearUI(); |
---|
| 377 | + bigThree.add(centralPanel); |
---|
| 378 | + bigThree.FlushUI(); |
---|
| 379 | + } |
---|
| 380 | + |
---|
26 | 381 | //ObjEditor objEditor; |
---|
27 | 382 | public void closeUI2() |
---|
28 | 383 | { |
---|
.. | .. |
---|
60 | 415 | this.copy = this.group = group; |
---|
61 | 416 | //selectees = this.group.selectees; |
---|
62 | 417 | |
---|
63 | | - if (copy.versions == null) |
---|
64 | | - { |
---|
65 | | - copy.versions = new byte[100][]; |
---|
66 | | - copy.versionindex = -1; |
---|
67 | | - } |
---|
| 418 | + assert(false); |
---|
| 419 | + |
---|
| 420 | +// if (copy.versionlist == null) |
---|
| 421 | +// { |
---|
| 422 | +// copy.versionlist = new Object3D[100]; |
---|
| 423 | +// copy.versionindex = -1; |
---|
| 424 | +// |
---|
| 425 | +// //Save(true); |
---|
| 426 | +// } |
---|
68 | 427 | |
---|
69 | 428 | if(ui) |
---|
70 | 429 | SetupUI(objEditor); |
---|
.. | .. |
---|
87 | 446 | |
---|
88 | 447 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
89 | 448 | |
---|
90 | | - if (copy.versions == null) |
---|
91 | | - { |
---|
92 | | - copy.versions = new byte[100][]; |
---|
93 | | - copy.versionindex = -1; |
---|
94 | | - |
---|
95 | | - Save(true); |
---|
96 | | - } |
---|
| 449 | +// if (copy.versionlist == null) |
---|
| 450 | +// { |
---|
| 451 | +// copy.versionlist = new Object3D[100]; |
---|
| 452 | +// copy.versionindex = -1; |
---|
| 453 | +// |
---|
| 454 | +// //Save(true); |
---|
| 455 | +// } |
---|
97 | 456 | } |
---|
98 | 457 | |
---|
99 | 458 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
183 | 542 | // menu.add("-"); |
---|
184 | 543 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
185 | 544 | duplicateItem.addActionListener(this); |
---|
186 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 545 | + |
---|
| 546 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
187 | 547 | cloneItem.addActionListener(this); |
---|
188 | | - if (Globals.ADVANCED) |
---|
| 548 | + //if (Globals.ADVANCED) |
---|
189 | 549 | { |
---|
190 | 550 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
191 | 551 | cloneSupportItem.addActionListener(this); |
---|
192 | 552 | } |
---|
| 553 | + oe.jTree.popup.addSeparator(); |
---|
193 | 554 | menu.add("-"); |
---|
194 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 555 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
195 | 556 | cutItem.addActionListener(this); |
---|
196 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 557 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
197 | 558 | copyItem.addActionListener(this); |
---|
198 | 559 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
199 | 560 | pasteItem.addActionListener(this); |
---|
200 | 561 | |
---|
201 | | - menu.add("-"); |
---|
202 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 562 | + oe.jTree.popup.addSeparator(); |
---|
| 563 | + //menu.add("-"); |
---|
| 564 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
203 | 565 | pasteIntoItem.addActionListener(this); |
---|
204 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 566 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
205 | 567 | pasteLinkItem.addActionListener(this); |
---|
206 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 568 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
207 | 569 | pasteCloneItem.addActionListener(this); |
---|
208 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 570 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
209 | 571 | // pasteExpandItem.addActionListener(this); |
---|
210 | | - menu.add("-"); |
---|
211 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
212 | | - deleteItem.addActionListener(this); |
---|
| 572 | + //menu.add("-"); |
---|
| 573 | + oe.jTree.popup.addSeparator(); |
---|
213 | 574 | |
---|
214 | 575 | if (Globals.ADVANCED) |
---|
215 | 576 | { |
---|
.. | .. |
---|
295 | 656 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
296 | 657 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
297 | 658 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
298 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
299 | 659 | oe.cameraMenu.add("-"); |
---|
300 | 660 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
301 | 661 | openWindowItem.addActionListener(this); |
---|
302 | | - editLeafItem.addActionListener(this); |
---|
303 | 662 | lookAtItem.addActionListener(this); |
---|
304 | 663 | //lookFromItem.addActinoListener(this); |
---|
305 | 664 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
346 | 705 | setMasterItem.addActionListener(this); |
---|
347 | 706 | } |
---|
348 | 707 | |
---|
349 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
350 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
351 | | -// grabItem.addActionListener(this); |
---|
| 708 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 709 | + |
---|
352 | 710 | backItem = menu.add(new MenuItem("Back")); |
---|
353 | 711 | backItem.addActionListener(this); |
---|
354 | 712 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
356 | 714 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
357 | 715 | // compositeItem.addActionListener(this); |
---|
358 | 716 | |
---|
| 717 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 718 | + grabItem.addActionListener(this); |
---|
| 719 | + |
---|
359 | 720 | if (Globals.ADVANCED) |
---|
360 | 721 | { |
---|
361 | 722 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
362 | 723 | hideItem.addActionListener(this); |
---|
363 | 724 | } |
---|
364 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 725 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
365 | 726 | ungroupItem.addActionListener(this); |
---|
| 727 | + |
---|
| 728 | + oe.jTree.popup.addSeparator(); |
---|
| 729 | + |
---|
| 730 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 731 | + deleteItem.addActionListener(this); |
---|
366 | 732 | |
---|
367 | 733 | // menu.add("-"); |
---|
368 | 734 | // |
---|
.. | .. |
---|
399 | 765 | shadowYItem.addActionListener(this); |
---|
400 | 766 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
401 | 767 | shadowZItem.addActionListener(this); |
---|
402 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
403 | | - attributeItem.addActionListener(this); |
---|
404 | 768 | |
---|
405 | 769 | if (Globals.ADVANCED) |
---|
406 | 770 | { |
---|
| 771 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 772 | + attributeItem.addActionListener(this); |
---|
407 | 773 | menu.add("-"); |
---|
408 | 774 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
409 | 775 | linkerItem.addActionListener(this); |
---|
.. | .. |
---|
413 | 779 | pointflowItem.addActionListener(this); |
---|
414 | 780 | } |
---|
415 | 781 | menu.add("-"); |
---|
| 782 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 783 | + textureRatioRItem.addActionListener(this); |
---|
| 784 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 785 | + textureRatioGItem.addActionListener(this); |
---|
| 786 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 787 | + textureRatioBItem.addActionListener(this); |
---|
| 788 | + menu.add("-"); |
---|
416 | 789 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
417 | 790 | resetTransformItem.addActionListener(this); |
---|
418 | 791 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
419 | 792 | resetCentroidItem.addActionListener(this); |
---|
420 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 793 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
421 | 794 | resetCentroidXZItem.addActionListener(this); |
---|
422 | 795 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
423 | 796 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
469 | 842 | } |
---|
470 | 843 | |
---|
471 | 844 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 845 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 846 | + clearVersionsItem.addActionListener(this); |
---|
472 | 847 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
473 | 848 | clearMaterialsItem.addActionListener(this); |
---|
474 | 849 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
491 | 866 | hideleavesItem.addActionListener(this); |
---|
492 | 867 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
493 | 868 | showleavesItem.addActionListener(this); |
---|
494 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 869 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
495 | 870 | markleavesItem.addActionListener(this); |
---|
496 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 871 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
497 | 872 | unmarkleavesItem.addActionListener(this); |
---|
498 | 873 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
499 | 874 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
547 | 922 | shareGeometriesItem.addActionListener(this); |
---|
548 | 923 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
549 | 924 | mergeGeometriesItem.addActionListener(this); |
---|
| 925 | + menu.add("-"); |
---|
| 926 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 927 | + editLeafItem.addActionListener(this); |
---|
550 | 928 | if (Globals.ADVANCED) |
---|
551 | 929 | { |
---|
552 | 930 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
563 | 941 | buildToolsMenu(menu); |
---|
564 | 942 | } |
---|
565 | 943 | |
---|
| 944 | + JTabbedPane resourcecontainer; |
---|
| 945 | + cGridBag currenttab; |
---|
| 946 | + //boolean added; // patch for jar |
---|
| 947 | + |
---|
| 948 | + int totalcount = 0; |
---|
| 949 | + |
---|
| 950 | + int tabcount = 0; |
---|
| 951 | + int colcount = 0; |
---|
| 952 | + int rowcount = 0; |
---|
| 953 | + int texturecount = 0; |
---|
| 954 | + |
---|
| 955 | + int columns = 5; |
---|
| 956 | + int rows = 7; |
---|
| 957 | + |
---|
| 958 | + public void ResourceCallBack(String[] path) |
---|
| 959 | + { |
---|
| 960 | +// for (int i = 0; i < path.length; i++) |
---|
| 961 | +// System.out.print(path[i] + "/"); |
---|
| 962 | +// System.out.println(); |
---|
| 963 | + |
---|
| 964 | + if (//rowcount == 0 || |
---|
| 965 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
| 966 | + { |
---|
| 967 | + currenttab = new cGridBag(); |
---|
| 968 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 969 | + currenttab.setName(tabname); |
---|
| 970 | + //added = false; |
---|
| 971 | + resourcecontainer.add(currenttab); |
---|
| 972 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 973 | + rowcount = 1; |
---|
| 974 | + colcount = 0; |
---|
| 975 | + texturecount = 0; |
---|
| 976 | + } |
---|
| 977 | + |
---|
| 978 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
| 979 | + { |
---|
| 980 | + //if (!added) |
---|
| 981 | + { |
---|
| 982 | + //added = true; |
---|
| 983 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 984 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
| 985 | + } |
---|
| 986 | + |
---|
| 987 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 988 | + totalcount++; |
---|
| 989 | + |
---|
| 990 | + if (++colcount >= columns) |
---|
| 991 | + { |
---|
| 992 | + colcount = 0; |
---|
| 993 | + currenttab.Return(); |
---|
| 994 | + |
---|
| 995 | + if (rowcount++ >= rows) |
---|
| 996 | + { |
---|
| 997 | + rowcount = 0; |
---|
| 998 | + } |
---|
| 999 | + } |
---|
| 1000 | + } |
---|
| 1001 | + else |
---|
| 1002 | + { |
---|
| 1003 | +// if (!path[path.length-1].equals("icons")) |
---|
| 1004 | +// resourcecontainer.Return(); |
---|
| 1005 | + } |
---|
| 1006 | + } |
---|
| 1007 | + |
---|
| 1008 | + void CreateTexturePanel(cGridBag container) |
---|
| 1009 | + { |
---|
| 1010 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 1011 | + container.add(resourcecontainer); |
---|
| 1012 | + |
---|
| 1013 | + Grafreed.ParseResources("textures", this); |
---|
| 1014 | + |
---|
| 1015 | + // 935. System.out.println("Total = " + totalcount); |
---|
| 1016 | + } |
---|
566 | 1017 | |
---|
567 | 1018 | void SetupUI2(ObjEditor oe) |
---|
568 | 1019 | { |
---|
.. | .. |
---|
581 | 1032 | //new Exception().printStackTrace(); |
---|
582 | 1033 | |
---|
583 | 1034 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
584 | | - oe.aConstraints.weightx = 1; |
---|
585 | | - oe.aConstraints.weighty = 0; |
---|
586 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
587 | | - oe.aConstraints.gridwidth = 100; |
---|
588 | | - oe.aConstraints.gridheight = 1; |
---|
589 | 1035 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
590 | 1036 | |
---|
591 | 1037 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
606 | 1052 | oe.radioPanel.add(dummyButton); |
---|
607 | 1053 | oe.buttonGroup.add(dummyButton); |
---|
608 | 1054 | */ |
---|
609 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1055 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
610 | 1056 | |
---|
611 | | - copyOptionsPanel.preferredHeight = 1; |
---|
| 1057 | + versionManagerPanel.preferredHeight = 4; |
---|
612 | 1058 | |
---|
613 | 1059 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
614 | 1060 | |
---|
.. | .. |
---|
618 | 1064 | |
---|
619 | 1065 | if (Globals.ADVANCED) |
---|
620 | 1066 | { |
---|
621 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
622 | | - maxButton.setToolTipText("Maximize window"); |
---|
623 | | - maxButton.addActionListener(this); |
---|
| 1067 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1069 | +// maxButton.addActionListener(this); |
---|
624 | 1070 | } |
---|
625 | 1071 | |
---|
626 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | + cButton gcButton; |
---|
| 1073 | + |
---|
| 1074 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1075 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1076 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1077 | +// { |
---|
| 1078 | +// public void actionPerformed(ActionEvent e) |
---|
| 1079 | +// { |
---|
| 1080 | +// System.gc(); |
---|
| 1081 | +// } |
---|
| 1082 | +// }); |
---|
| 1083 | + |
---|
| 1084 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1085 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1086 | + collapseButton.addActionListener(this); |
---|
| 1087 | + |
---|
| 1088 | + oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1089 | + maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1090 | + maximize3DButton.addActionListener(this); |
---|
| 1091 | + |
---|
| 1092 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1093 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1094 | + twoButton.addActionListener(this); |
---|
| 1095 | + this.fullscreenLayout = twoButton; |
---|
| 1096 | + |
---|
| 1097 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1098 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1099 | + threeButton.addActionListener(this); |
---|
| 1100 | + if (Globals.ADVANCED) |
---|
| 1101 | + { |
---|
| 1102 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1103 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1104 | + sixButton.addActionListener(this); |
---|
| 1105 | + } |
---|
| 1106 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1107 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1108 | +// sevenButton.addActionListener(this); |
---|
| 1109 | + // |
---|
| 1110 | + |
---|
| 1111 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
627 | 1112 | fullButton.setToolTipText("Full-screen window"); |
---|
628 | 1113 | fullButton.addActionListener(this); |
---|
629 | 1114 | |
---|
630 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1115 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
631 | 1116 | screenfitButton.setToolTipText("Screen fit"); |
---|
632 | 1117 | screenfitButton.addActionListener(this); |
---|
633 | 1118 | |
---|
634 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1119 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
635 | 1120 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
636 | 1121 | restoreCameraButton.addActionListener(this); |
---|
637 | 1122 | |
---|
638 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
639 | | - saveButton.setToolTipText("New version"); |
---|
640 | | - saveButton.addActionListener(this); |
---|
| 1123 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1124 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 1125 | + saveVersionButton.addActionListener(this); |
---|
641 | 1126 | |
---|
642 | | - copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
643 | | - undoButton.setToolTipText("Previous version"); |
---|
644 | | - undoButton.addActionListener(this); |
---|
645 | | - undoButton.setEnabled(false); |
---|
| 1127 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1128 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 1129 | + deleteVersionButton.addActionListener(this); |
---|
| 1130 | + deleteVersionButton.setEnabled(false); |
---|
| 1131 | + |
---|
| 1132 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1133 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 1134 | + previousVersionButton.addActionListener(this); |
---|
| 1135 | + previousVersionButton.setEnabled(false); |
---|
646 | 1136 | |
---|
647 | 1137 | cGridBag updown = new cGridBag().setVertical(true); |
---|
648 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
649 | | - restoreButton.setToolTipText("Restore current"); |
---|
| 1138 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1139 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
650 | 1140 | restoreButton.addActionListener(this); |
---|
651 | 1141 | restoreButton.setEnabled(false); |
---|
652 | 1142 | |
---|
653 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
654 | | - replaceButton.setToolTipText("Replace current"); |
---|
| 1143 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1144 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
655 | 1145 | replaceButton.addActionListener(this); |
---|
656 | 1146 | replaceButton.setEnabled(false); |
---|
657 | 1147 | |
---|
658 | | - copyOptionsPanel.add(updown); |
---|
| 1148 | + versionManagerPanel.add(updown); |
---|
659 | 1149 | |
---|
660 | | - copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
661 | | - redoButton.setToolTipText("Next version"); |
---|
662 | | - redoButton.addActionListener(this); |
---|
663 | | - redoButton.setEnabled(false); |
---|
| 1150 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1151 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 1152 | + nextVersionButton.addActionListener(this); |
---|
| 1153 | + nextVersionButton.setEnabled(false); |
---|
| 1154 | + |
---|
| 1155 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1156 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1157 | + oneStepButton.addActionListener(this); |
---|
664 | 1158 | |
---|
665 | 1159 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
666 | 1160 | liveCB.setToolTipText("Enable animation"); |
---|
667 | 1161 | liveCB.addItemListener(this); |
---|
668 | 1162 | |
---|
669 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
670 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
671 | | - oneStepButton.addActionListener(this); |
---|
672 | | - |
---|
673 | 1163 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
674 | 1164 | fastCB.setToolTipText("Fast mode"); |
---|
675 | 1165 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
685 | 1175 | |
---|
686 | 1176 | if (Globals.ADVANCED) |
---|
687 | 1177 | { |
---|
688 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1178 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
689 | 1179 | snapobjectButton.addActionListener(this); |
---|
690 | 1180 | snapobjectButton.setToolTipText("Snap Object"); |
---|
691 | 1181 | |
---|
692 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1182 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
693 | 1183 | fourButton.addActionListener(this); |
---|
694 | 1184 | fourButton.setToolTipText("Show control panel only"); |
---|
695 | 1185 | } |
---|
696 | 1186 | |
---|
697 | 1187 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
698 | 1188 | |
---|
699 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
700 | | - twoButton.setToolTipText("Show 3D view only"); |
---|
701 | | - twoButton.addActionListener(this); |
---|
702 | | - this.fullscreenLayout = twoButton; |
---|
703 | | - |
---|
704 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
705 | | - threeButton.setToolTipText("Show controls and 3D view"); |
---|
706 | | - threeButton.addActionListener(this); |
---|
707 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
708 | | - sixButton.setToolTipText("Show 3D view and controls"); |
---|
709 | | - sixButton.addActionListener(this); |
---|
710 | | -// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
711 | | -// sevenButton.setToolTipText("3-column layout"); |
---|
712 | | -// sevenButton.addActionListener(this); |
---|
713 | | - // |
---|
714 | 1189 | |
---|
715 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1190 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
716 | 1191 | rootButton.setToolTipText("Open selection in new tab"); |
---|
717 | 1192 | rootButton.addActionListener(this); |
---|
718 | 1193 | |
---|
719 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1194 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
720 | 1195 | closeButton.setToolTipText("Close tab"); |
---|
721 | 1196 | closeButton.addActionListener(this); |
---|
722 | 1197 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
723 | 1198 | //clearButton.addActionListener(this); |
---|
724 | 1199 | |
---|
| 1200 | + cGridBag row1 = new cGridBag(); |
---|
| 1201 | + |
---|
725 | 1202 | // INSERT |
---|
726 | | - oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
727 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1203 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1204 | + gridButton.setToolTipText("Create ground"); |
---|
728 | 1205 | gridButton.addActionListener(this); |
---|
729 | 1206 | |
---|
730 | | - oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1207 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
731 | 1208 | boxButton.setToolTipText("Create box"); |
---|
732 | 1209 | boxButton.addActionListener(this); |
---|
733 | 1210 | |
---|
734 | | - oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
735 | | - sphereButton.setToolTipText("Create sphere"); |
---|
736 | | - sphereButton.addActionListener(this); |
---|
737 | | - |
---|
738 | | - oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
739 | | - coneButton.setToolTipText("Create cone"); |
---|
740 | | - coneButton.addActionListener(this); |
---|
741 | | - |
---|
742 | | - oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
743 | | - torusButton.setToolTipText("Create torus"); |
---|
744 | | - torusButton.addActionListener(this); |
---|
745 | | - |
---|
746 | | - oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1211 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
747 | 1212 | superButton.setToolTipText("Create superellipsoid"); |
---|
748 | 1213 | superButton.addActionListener(this); |
---|
749 | 1214 | |
---|
750 | | - if (Globals.ADVANCED) |
---|
| 1215 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1216 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1217 | + sphereButton.addActionListener(this); |
---|
| 1218 | + |
---|
| 1219 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1220 | + coneButton.setToolTipText("Create cone"); |
---|
| 1221 | + coneButton.addActionListener(this); |
---|
| 1222 | + |
---|
| 1223 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1224 | + torusButton.setToolTipText("Create torus"); |
---|
| 1225 | + torusButton.addActionListener(this); |
---|
| 1226 | + |
---|
| 1227 | + if (false) //Globals.ADVANCED) |
---|
751 | 1228 | { |
---|
752 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1229 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
753 | 1230 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
754 | 1231 | kleinButton.addActionListener(this); |
---|
755 | 1232 | } |
---|
756 | 1233 | |
---|
757 | | - oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1234 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
758 | 1235 | particlesButton.setToolTipText("Create particle system"); |
---|
759 | 1236 | particlesButton.addActionListener(this); |
---|
760 | 1237 | |
---|
761 | | - oe.toolboxPanel.Return(); |
---|
| 1238 | + oe.toolboxPanel.add(row1); |
---|
762 | 1239 | |
---|
763 | | - oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1240 | + cGridBag row2 = new cGridBag(); |
---|
| 1241 | + |
---|
| 1242 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
764 | 1243 | groupButton.setToolTipText("Create group"); |
---|
765 | 1244 | groupButton.addActionListener(this); |
---|
766 | 1245 | |
---|
767 | | - oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1246 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
768 | 1247 | compositeButton.setToolTipText("Create composite"); |
---|
769 | 1248 | compositeButton.addActionListener(this); |
---|
770 | 1249 | |
---|
771 | | - oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1250 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
772 | 1251 | switchButton.setToolTipText("Create item switcher"); |
---|
773 | 1252 | switchButton.addActionListener(this); |
---|
774 | 1253 | |
---|
775 | | - oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1254 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
776 | 1255 | loopButton.setToolTipText("Create loop"); |
---|
777 | 1256 | loopButton.addActionListener(this); |
---|
778 | 1257 | |
---|
779 | | - oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1258 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
780 | 1259 | textureButton.setToolTipText("Create texture"); |
---|
781 | 1260 | textureButton.addActionListener(this); |
---|
782 | 1261 | |
---|
783 | | - oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1262 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
784 | 1263 | overlayButton.setToolTipText("Create overlay"); |
---|
785 | 1264 | overlayButton.addActionListener(this); |
---|
786 | 1265 | |
---|
787 | | - oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1266 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
788 | 1267 | lightButton.setToolTipText("Create light"); |
---|
789 | 1268 | lightButton.addActionListener(this); |
---|
790 | 1269 | |
---|
791 | | - for (int i=6; --i>=0;) |
---|
792 | | - { |
---|
793 | | - oe.toolboxPanel.Return(); |
---|
794 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
795 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
796 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
797 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
798 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
799 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
800 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
801 | | - } |
---|
| 1270 | + oe.toolboxPanel.add(row2); |
---|
| 1271 | + |
---|
| 1272 | + cGridBag textures = new cGridBag(); |
---|
| 1273 | + |
---|
| 1274 | + CreateTexturePanel(textures); |
---|
| 1275 | + |
---|
| 1276 | + int tabCount = resourcecontainer.getTabCount(); |
---|
| 1277 | + |
---|
| 1278 | + if (tabCount > 0) |
---|
| 1279 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
| 1280 | + |
---|
| 1281 | + oe.toolboxPanel.add(textures); |
---|
| 1282 | + |
---|
| 1283 | + textures.preferredHeight = 100; |
---|
| 1284 | + |
---|
| 1285 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
802 | 1286 | |
---|
803 | 1287 | // EDIT panel |
---|
804 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1288 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
805 | 1289 | editButton.setToolTipText("Pin selection controls"); |
---|
806 | 1290 | editButton.addActionListener(this); |
---|
807 | 1291 | |
---|
808 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
809 | | - uneditButton.setToolTipText("Remove selection controls"); |
---|
| 1292 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1293 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
810 | 1294 | uneditButton.addActionListener(this); |
---|
811 | 1295 | |
---|
812 | 1296 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
813 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1297 | + allParamsButton.setToolTipText("Show all controls"); |
---|
814 | 1298 | allParamsButton.addActionListener(this); |
---|
815 | 1299 | |
---|
816 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
817 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1300 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1301 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
818 | 1302 | clearPanelButton.addActionListener(this); |
---|
819 | 1303 | |
---|
820 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
821 | | - unselectButton.setToolTipText("Unselect"); |
---|
822 | | - unselectButton.addActionListener(this); |
---|
| 1304 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1305 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1306 | + //unselectButton.addActionListener(this); |
---|
823 | 1307 | |
---|
824 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1308 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
825 | 1309 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
826 | 1310 | flashSelectionButton.addActionListener(this); |
---|
827 | 1311 | |
---|
.. | .. |
---|
844 | 1328 | |
---|
845 | 1329 | cGridBag jSPPanel = new cGridBag(); |
---|
846 | 1330 | |
---|
| 1331 | + jSPPanel.preferredHeight = 20; |
---|
| 1332 | + |
---|
847 | 1333 | JScrollPane jSP; |
---|
848 | 1334 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
849 | 1335 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
852 | 1338 | oe.treePanel.add(jSPPanel); |
---|
853 | 1339 | oe.treePanel.Return(); |
---|
854 | 1340 | |
---|
855 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1341 | + oe.treePanel.add(versionManagerPanel); |
---|
856 | 1342 | oe.treePanel.Return(); |
---|
857 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
858 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
859 | | - sliderPane.preferredHeight = 1; |
---|
| 1343 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1344 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1345 | + versionSliderPane.preferredHeight = 3; |
---|
860 | 1346 | |
---|
861 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
862 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1347 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1348 | + mainPanel.setResizeWeight(0.4); |
---|
863 | 1349 | |
---|
864 | 1350 | //jList.addListSelectionListener(this); |
---|
865 | 1351 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
867 | 1353 | //jTree.setEditable(true); |
---|
868 | 1354 | oe.jTree.setDragEnabled(true); |
---|
869 | 1355 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
870 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1356 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
871 | 1357 | |
---|
872 | 1358 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
873 | 1359 | |
---|
.. | .. |
---|
879 | 1365 | dgr.addDragGestureListener(this); |
---|
880 | 1366 | }catch(Exception e) {} |
---|
881 | 1367 | */ |
---|
882 | | - radio.layout = sixButton; // sevenButton; |
---|
| 1368 | + radio.layout = threeButton; // sixButton; |
---|
883 | 1369 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
884 | 1370 | } |
---|
885 | 1371 | |
---|
.. | .. |
---|
930 | 1416 | smoothCB.setToolTipText("Snapping delay"); |
---|
931 | 1417 | smoothCB.addItemListener(this); |
---|
932 | 1418 | |
---|
933 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
934 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
935 | | - slowCB.addItemListener(this); |
---|
| 1419 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1420 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1421 | +// slowCB.addItemListener(this); |
---|
| 1422 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1423 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1424 | + minshaderCB.addItemListener(this); |
---|
936 | 1425 | |
---|
937 | 1426 | // constraints.gridy += 1; |
---|
938 | 1427 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
.. | .. |
---|
1011 | 1500 | |
---|
1012 | 1501 | void EditObject(Object3D obj) |
---|
1013 | 1502 | { |
---|
| 1503 | + //assert(obj instanceof Composite); |
---|
| 1504 | + |
---|
| 1505 | +// if (obj.versionlist == null) |
---|
| 1506 | +// { |
---|
| 1507 | +// obj.versionlist = new Object3D[100]; |
---|
| 1508 | +// obj.versionindex = -1; |
---|
| 1509 | +// } |
---|
| 1510 | + |
---|
1014 | 1511 | cRadio radioButton = new cRadio(obj.name); |
---|
1015 | 1512 | |
---|
1016 | 1513 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1021 | 1518 | } |
---|
1022 | 1519 | |
---|
1023 | 1520 | radioButton.SetObject(obj); |
---|
1024 | | - radioButton.layout = sixButton; // sevenButton; |
---|
| 1521 | + radioButton.layout = threeButton; // sixButton; |
---|
1025 | 1522 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
1026 | 1523 | radioButton.addActionListener(this); |
---|
1027 | 1524 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1035 | 1532 | |
---|
1036 | 1533 | oe.SetupViews(); |
---|
1037 | 1534 | |
---|
| 1535 | + if (Globals.DEBUG) |
---|
1038 | 1536 | System.out.println("SetupViews"); |
---|
1039 | 1537 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1040 | 1538 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
1046 | 1544 | cCheckBox localCB; |
---|
1047 | 1545 | cCheckBox crowdCB; |
---|
1048 | 1546 | cCheckBox smoothCB; |
---|
| 1547 | + cCheckBox minshaderCB; |
---|
| 1548 | + |
---|
1049 | 1549 | cToggleButton fastCB; |
---|
1050 | 1550 | cCheckBox slowCB; |
---|
1051 | 1551 | cCheckBox boxCB; |
---|
.. | .. |
---|
1116 | 1616 | { |
---|
1117 | 1617 | cameraView.ToggleInertia(); |
---|
1118 | 1618 | cameraView.repaint(); |
---|
| 1619 | + } |
---|
| 1620 | + else if(e.getSource() == minshaderCB) |
---|
| 1621 | + { |
---|
| 1622 | + Globals.MINSHADER ^= true; |
---|
| 1623 | + cameraView.programInitialized = false; |
---|
| 1624 | + cameraView.repaint(); |
---|
1119 | 1625 | } |
---|
1120 | 1626 | else if(e.getSource() == localCB) |
---|
1121 | 1627 | { |
---|
.. | .. |
---|
1393 | 1899 | TreePath path; |
---|
1394 | 1900 | |
---|
1395 | 1901 | public TransferableTreePath(TreePath tp) { |
---|
1396 | | - path = tp; |
---|
| 1902 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1903 | + for (int i=0; i<objs.length; i++) |
---|
| 1904 | + { |
---|
| 1905 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1906 | + } |
---|
| 1907 | + path = new TreePath(objs); |
---|
1397 | 1908 | } |
---|
1398 | 1909 | |
---|
1399 | 1910 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
1625 | 2136 | switch(axis) |
---|
1626 | 2137 | { |
---|
1627 | 2138 | case 0 : |
---|
1628 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1629 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
1630 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
1631 | | - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
| 2139 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2140 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2141 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2142 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
1632 | 2143 | norm = cVector.X; |
---|
1633 | 2144 | break; |
---|
1634 | 2145 | case 1 : |
---|
1635 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1636 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
1637 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
1638 | | - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; |
---|
| 2146 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2147 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2148 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2149 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
1639 | 2150 | norm = cVector.Y; |
---|
1640 | 2151 | break; |
---|
1641 | 2152 | case 2 : |
---|
1642 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1643 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
1644 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
1645 | | - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; |
---|
| 2153 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2154 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2155 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2156 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
1646 | 2157 | norm = cVector.Z; |
---|
1647 | 2158 | break; |
---|
1648 | 2159 | } |
---|
.. | .. |
---|
1683 | 2194 | shadow.material = new cMaterial(obj.material); |
---|
1684 | 2195 | shadow.material.diffuse = 0.0001f; |
---|
1685 | 2196 | shadow.material.specular = 0.0001f; |
---|
1686 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2197 | + shadow.material.opacity = 0.75f; |
---|
| 2198 | + |
---|
| 2199 | + AllocProjectedVertices(shadow); |
---|
| 2200 | + |
---|
| 2201 | + shadow.projectedVertices[1].x = 300; |
---|
1687 | 2202 | |
---|
1688 | 2203 | makeSomething(shadow); |
---|
1689 | 2204 | } |
---|
.. | .. |
---|
2139 | 2654 | { |
---|
2140 | 2655 | makeSomething(new Light()); |
---|
2141 | 2656 | } else |
---|
| 2657 | +// if (source == skybox1Button || |
---|
| 2658 | +// source == skybox2Button || |
---|
| 2659 | +// source == skybox3Button || |
---|
| 2660 | +// source == skybox4Button || |
---|
| 2661 | +// source == skybox5Button || |
---|
| 2662 | +// source == skybox6Button || |
---|
| 2663 | +// source == skybox7Button || |
---|
| 2664 | +// source == skybox11Button || |
---|
| 2665 | +// source == skybox12Button || |
---|
| 2666 | +// source == skybox13Button || |
---|
| 2667 | +// source == skybox14Button || |
---|
| 2668 | +// source == skybox15Button || |
---|
| 2669 | +// source == skybox16Button || |
---|
| 2670 | +// source == skybox17Button) |
---|
| 2671 | +// { |
---|
| 2672 | +// ChangeSkybox(source); |
---|
| 2673 | +// } else |
---|
2142 | 2674 | if (source == csgItem) |
---|
2143 | 2675 | { |
---|
2144 | 2676 | group(new CSG()); |
---|
.. | .. |
---|
2187 | 2719 | } else |
---|
2188 | 2720 | if (source == loopItem || source == loopButton) |
---|
2189 | 2721 | { |
---|
| 2722 | + if (!group.selection.isEmpty()) |
---|
| 2723 | + { |
---|
2190 | 2724 | Composite csg = new GroupLeaf(); |
---|
2191 | 2725 | csg.count = 5; |
---|
2192 | | - group(csg); |
---|
2193 | 2726 | Composite child = new cGroup("Branch"); |
---|
2194 | 2727 | csg.addChild(child); |
---|
2195 | 2728 | child.addChild(csg); |
---|
| 2729 | + group(csg); |
---|
| 2730 | + } |
---|
2196 | 2731 | } else |
---|
2197 | 2732 | if (source == doubleItem) |
---|
2198 | 2733 | { |
---|
| 2734 | + if (!group.selection.isEmpty()) |
---|
| 2735 | + { |
---|
2199 | 2736 | Composite csg = new GroupLeaf("Fork"); |
---|
2200 | 2737 | csg.count = 5; |
---|
2201 | | - group(csg); |
---|
2202 | 2738 | Composite child = new cGroup("Branch A"); |
---|
2203 | 2739 | csg.addChild(child); |
---|
2204 | 2740 | child.addChild(csg); |
---|
2205 | 2741 | child = new cGroup("Branch B"); |
---|
2206 | 2742 | csg.addChild(child); |
---|
2207 | 2743 | child.addChild(csg); |
---|
| 2744 | + group(csg); |
---|
| 2745 | + } |
---|
2208 | 2746 | } else |
---|
2209 | 2747 | if (source == tripleItem) |
---|
2210 | 2748 | { |
---|
| 2749 | + if (!group.selection.isEmpty()) |
---|
| 2750 | + { |
---|
2211 | 2751 | Composite csg = new GroupLeaf("Trident"); |
---|
2212 | 2752 | csg.count = 4; |
---|
2213 | 2753 | group(csg); |
---|
.. | .. |
---|
2220 | 2760 | child = new cGroup(); |
---|
2221 | 2761 | csg.addChild(child); |
---|
2222 | 2762 | child.addChild(csg); |
---|
| 2763 | + } |
---|
2223 | 2764 | } else |
---|
2224 | 2765 | if (source == computeAOItem) |
---|
2225 | 2766 | { |
---|
2226 | 2767 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
2227 | | - Globals.theRenderer.repaint(); |
---|
| 2768 | + cameraView.repaint(); |
---|
2228 | 2769 | } else |
---|
2229 | 2770 | if (source == recompileItem) |
---|
2230 | 2771 | { |
---|
.. | .. |
---|
2239 | 2780 | if (source == invariantsItem) |
---|
2240 | 2781 | { |
---|
2241 | 2782 | System.out.println("Invariants:"); |
---|
2242 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2783 | + Grafreed.grafreed.universe.invariants(); |
---|
2243 | 2784 | } else |
---|
2244 | 2785 | if (source == memoryItem) |
---|
2245 | 2786 | { |
---|
.. | .. |
---|
2270 | 2811 | { |
---|
2271 | 2812 | ToggleFullScreen(); |
---|
2272 | 2813 | } else |
---|
2273 | | - if (source == undoButton) |
---|
| 2814 | + if (source == collapseButton) |
---|
| 2815 | + { |
---|
| 2816 | + this.expandedLayout = radio.layout; |
---|
| 2817 | + CollapseToolbar(); |
---|
| 2818 | + } else |
---|
| 2819 | + if (source == maximize3DButton) |
---|
| 2820 | + { |
---|
| 2821 | + this.expandedLayout = radio.layout; |
---|
| 2822 | + radio.layout = twoButton; |
---|
| 2823 | + Show3DView(); |
---|
| 2824 | + CollapseToolbar(); |
---|
| 2825 | + } else |
---|
| 2826 | + if (source == previousVersionButton) |
---|
2274 | 2827 | { |
---|
2275 | 2828 | // Go to previous version |
---|
2276 | 2829 | //if (!Undo()) |
---|
2277 | 2830 | //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2278 | | - Undo(); |
---|
| 2831 | + PreviousVersion(); |
---|
2279 | 2832 | } else |
---|
2280 | 2833 | if (source == restoreButton) |
---|
2281 | 2834 | { |
---|
2282 | 2835 | // Restore current version |
---|
2283 | 2836 | Restore(); |
---|
| 2837 | + //restoreButton.setEnabled(false); |
---|
2284 | 2838 | } else |
---|
2285 | 2839 | if (source == replaceButton) |
---|
2286 | 2840 | { |
---|
2287 | 2841 | // Overwrite current version |
---|
2288 | 2842 | Replace(); |
---|
| 2843 | + //replaceButton.setEnabled(false); |
---|
2289 | 2844 | } else |
---|
2290 | | - if (source == redoButton) |
---|
| 2845 | + if (source == nextVersionButton) |
---|
2291 | 2846 | { |
---|
2292 | 2847 | // Go to next version |
---|
2293 | | - Redo(); |
---|
| 2848 | + NextVersion(); |
---|
2294 | 2849 | } else |
---|
2295 | | - if (source == saveButton) |
---|
| 2850 | + if (source == saveVersionButton) |
---|
2296 | 2851 | { |
---|
2297 | 2852 | // Save a new version |
---|
2298 | 2853 | if (!Save(true)) |
---|
2299 | 2854 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2855 | + } else |
---|
| 2856 | + if (source == deleteVersionButton) |
---|
| 2857 | + { |
---|
| 2858 | + // Delete a new version |
---|
| 2859 | + DeleteVersion(); |
---|
2300 | 2860 | } else |
---|
2301 | 2861 | if (source == oneStepButton) |
---|
2302 | 2862 | { |
---|
.. | .. |
---|
2351 | 2911 | } else |
---|
2352 | 2912 | if (source == undoItem) |
---|
2353 | 2913 | { |
---|
2354 | | - Undo(); |
---|
| 2914 | + PreviousVersion(); |
---|
2355 | 2915 | } else |
---|
2356 | 2916 | if (source == redoItem) |
---|
2357 | 2917 | { |
---|
2358 | | - Redo(); |
---|
| 2918 | + NextVersion(); |
---|
2359 | 2919 | } else |
---|
2360 | 2920 | if (source == duplicateItem) |
---|
2361 | 2921 | { |
---|
.. | .. |
---|
2836 | 3396 | } else |
---|
2837 | 3397 | if (source == ungroupItem || source == ungroupButton) |
---|
2838 | 3398 | { |
---|
2839 | | - boolean hasRoot = false; |
---|
| 3399 | + boolean canUngroup = true; |
---|
2840 | 3400 | |
---|
2841 | 3401 | for (int i=0; i<group.selection.size(); i++) |
---|
2842 | 3402 | { |
---|
2843 | | - if (group.selection.get(i) == group) |
---|
| 3403 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3404 | + |
---|
| 3405 | + if (selectedItem.Size() == 0) |
---|
2844 | 3406 | { |
---|
2845 | | - hasRoot = true; |
---|
| 3407 | + // Cannot ungroup leaves |
---|
| 3408 | + canUngroup = false; |
---|
| 3409 | + break; |
---|
| 3410 | + } |
---|
| 3411 | + |
---|
| 3412 | + if (selectedItem == group) |
---|
| 3413 | + { |
---|
| 3414 | + // Cannot ungroup root |
---|
| 3415 | + canUngroup = false; |
---|
2846 | 3416 | break; |
---|
2847 | 3417 | } |
---|
2848 | 3418 | } |
---|
2849 | 3419 | |
---|
2850 | | - if (!hasRoot) |
---|
| 3420 | + if (canUngroup) |
---|
2851 | 3421 | { |
---|
2852 | 3422 | for (int i=0; i<group.selection.size(); i++) |
---|
2853 | 3423 | { |
---|
2854 | | - Ungroup(group.selection.get(i)); |
---|
| 3424 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3425 | + |
---|
| 3426 | + Ungroup(selectedItem); |
---|
2855 | 3427 | } |
---|
2856 | 3428 | |
---|
2857 | 3429 | ClearSelection(false); |
---|
.. | .. |
---|
2902 | 3474 | if (source == clearMaterialsItem) |
---|
2903 | 3475 | { |
---|
2904 | 3476 | ClearMaterials(); |
---|
| 3477 | + } else |
---|
| 3478 | + if (source == clearVersionsItem) |
---|
| 3479 | + { |
---|
| 3480 | + ClearVersions(); |
---|
2905 | 3481 | } else |
---|
2906 | 3482 | if (source == liveleavesItem) |
---|
2907 | 3483 | { |
---|
.. | .. |
---|
3042 | 3618 | if (source == transformChildrenItem) |
---|
3043 | 3619 | { |
---|
3044 | 3620 | TransformChildren(); |
---|
| 3621 | + } else |
---|
| 3622 | + if (source == textureRatioRItem) |
---|
| 3623 | + { |
---|
| 3624 | + TextureRatio(0); |
---|
| 3625 | + } else |
---|
| 3626 | + if (source == textureRatioGItem) |
---|
| 3627 | + { |
---|
| 3628 | + TextureRatio(1); |
---|
| 3629 | + } else |
---|
| 3630 | + if (source == textureRatioBItem) |
---|
| 3631 | + { |
---|
| 3632 | + TextureRatio(2); |
---|
3045 | 3633 | } else |
---|
3046 | 3634 | if (source == resetTransformItem) |
---|
3047 | 3635 | { |
---|
.. | .. |
---|
3214 | 3802 | if (CameraPane.FULLSCREEN) |
---|
3215 | 3803 | fullscreenLayout = radio.layout; |
---|
3216 | 3804 | |
---|
3217 | | - // bug |
---|
3218 | | - //gridPanel.setDividerLocation(1.0); |
---|
3219 | | - //bigPanel.setDividerLocation(0.0); |
---|
3220 | | -// bigThree.remove(scenePanel); |
---|
3221 | | -// bigThree.remove(centralPanel); |
---|
3222 | | -// bigThree.remove(XYZPanel); |
---|
3223 | | -// aWindowConstraints.gridx = 0; |
---|
3224 | | -// aWindowConstraints.gridy = 0; |
---|
3225 | | -// aWindowConstraints.gridwidth = 1; |
---|
3226 | | -// // aConstraints.gridheight = 3; |
---|
3227 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3228 | | -// aWindowConstraints.weightx = 0; |
---|
3229 | | -// aWindowConstraints.weighty = 1; |
---|
3230 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3231 | | -// aWindowConstraints.weightx = 1; |
---|
3232 | | -// aWindowConstraints.gridwidth = 3; |
---|
3233 | | -// // aConstraints.gridheight = 3; |
---|
3234 | | -// aWindowConstraints.gridx = 1; |
---|
3235 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3236 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3237 | | -// aWindowConstraints.weightx = 0; |
---|
3238 | | -// aWindowConstraints.gridx = 4; |
---|
3239 | | -// aWindowConstraints.gridwidth = 1; |
---|
3240 | | -// // aConstraints.gridheight = 3; |
---|
3241 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3242 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3243 | | -// scenePanel.setVisible(false); |
---|
3244 | | -// centralPanel.setVisible(true); |
---|
3245 | | -// XYZPanel.setVisible(false); |
---|
3246 | | - bigThree.ClearUI(); |
---|
3247 | | - bigThree.add(centralPanel); |
---|
3248 | | - bigThree.FlushUI(); |
---|
| 3805 | + Show3DView(); |
---|
3249 | 3806 | |
---|
3250 | 3807 | cameraView.requestFocusInWindow(); |
---|
3251 | 3808 | |
---|
.. | .. |
---|
3431 | 3988 | } else |
---|
3432 | 3989 | if (source == rootButton) |
---|
3433 | 3990 | { |
---|
| 3991 | + Replace(); |
---|
3434 | 3992 | Object3D obj; |
---|
3435 | 3993 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3436 | 3994 | { |
---|
.. | .. |
---|
3445 | 4003 | if (source == closeButton) |
---|
3446 | 4004 | { |
---|
3447 | 4005 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 4006 | + if (copy.versionlist != null) |
---|
| 4007 | + Replace(); |
---|
| 4008 | + |
---|
3448 | 4009 | cRadio ab; |
---|
3449 | 4010 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3450 | 4011 | { |
---|
.. | .. |
---|
3488 | 4049 | { |
---|
3489 | 4050 | Object3D child = (Object3D)e.nextElement(); |
---|
3490 | 4051 | if(child.editWindow != null) |
---|
3491 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3492 | 4052 | child.pinned = false; |
---|
3493 | 4053 | child.CloseUI(); |
---|
3494 | 4054 | listUI.remove(child); |
---|
| 4055 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3495 | 4056 | |
---|
3496 | 4057 | //child.editWindow = null; // ??????????? |
---|
3497 | 4058 | } |
---|
.. | .. |
---|
3510 | 4071 | obj.CloseUI(); |
---|
3511 | 4072 | } |
---|
3512 | 4073 | listUI.clear(); |
---|
| 4074 | + SetPinStates(group.selection.size() > 0); |
---|
3513 | 4075 | refreshContents(true); |
---|
3514 | 4076 | } else |
---|
3515 | 4077 | if (source == allParamsButton) |
---|
.. | .. |
---|
3542 | 4104 | } else |
---|
3543 | 4105 | if(source instanceof cRadio) |
---|
3544 | 4106 | { |
---|
| 4107 | + if (copy.versionlist != null) |
---|
| 4108 | + Replace(); |
---|
| 4109 | + |
---|
3545 | 4110 | group.parent = keepparent; |
---|
3546 | 4111 | group.attributes = 0; |
---|
3547 | 4112 | //group.editWindow = null; |
---|
.. | .. |
---|
3566 | 4131 | |
---|
3567 | 4132 | copy = group; |
---|
3568 | 4133 | |
---|
3569 | | - SetUndoStates(); |
---|
3570 | | - |
---|
3571 | 4134 | //Globals.theRenderer.object = group; |
---|
3572 | 4135 | if(!useclient) |
---|
3573 | 4136 | { |
---|
.. | .. |
---|
3595 | 4158 | */ |
---|
3596 | 4159 | radio.layout.doClick(); |
---|
3597 | 4160 | |
---|
| 4161 | + //assert(copy instanceof Composite); |
---|
| 4162 | + |
---|
| 4163 | + if (copy.versionlist == null) |
---|
| 4164 | + { |
---|
| 4165 | + copy.versionindex = -1; |
---|
| 4166 | + |
---|
| 4167 | + // Cannot work with loops |
---|
| 4168 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4169 | + // and check if any of these nodes are reachable below the root. |
---|
| 4170 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4171 | + |
---|
| 4172 | + if (copy instanceof Composite && copy.versionlist == null && !copy.HasTags()) |
---|
| 4173 | + { |
---|
| 4174 | + copy.versionlist = new Object3D[100]; |
---|
| 4175 | + |
---|
| 4176 | + //Save(true); |
---|
| 4177 | + } |
---|
| 4178 | + else |
---|
| 4179 | + copy.versionindex = -2; |
---|
| 4180 | + |
---|
| 4181 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4182 | + } |
---|
| 4183 | + |
---|
| 4184 | + SetVersionStates(); |
---|
| 4185 | + |
---|
3598 | 4186 | ClearUnpinned(); |
---|
| 4187 | + |
---|
3599 | 4188 | //Grafreed.Assert(group != null); |
---|
3600 | 4189 | //Grafreed.Assert(group.selection != null); |
---|
3601 | 4190 | SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
.. | .. |
---|
3612 | 4201 | } else if (event.getSource() == editCameraItem) |
---|
3613 | 4202 | { |
---|
3614 | 4203 | cameraView.ProtectCamera(); |
---|
| 4204 | + cameraView.requestFocusInWindow(); |
---|
3615 | 4205 | cameraView.repaint(); |
---|
3616 | 4206 | return; |
---|
3617 | 4207 | } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3618 | 4208 | { |
---|
3619 | 4209 | cameraView.RevertCamera(); |
---|
| 4210 | + cameraView.requestFocusInWindow(); |
---|
3620 | 4211 | cameraView.repaint(); |
---|
3621 | 4212 | return; |
---|
3622 | 4213 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
3705 | 4296 | refreshContents(); |
---|
3706 | 4297 | } |
---|
3707 | 4298 | |
---|
| 4299 | + void TextureRatio(int axis) |
---|
| 4300 | + { |
---|
| 4301 | + Object3D obj; |
---|
| 4302 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4303 | + { |
---|
| 4304 | + obj = (Object3D)e.nextElement(); |
---|
| 4305 | + obj.TextureRatio(axis); |
---|
| 4306 | + } |
---|
| 4307 | + |
---|
| 4308 | + refreshContents(); |
---|
| 4309 | + } |
---|
| 4310 | + |
---|
3708 | 4311 | void ResetTransform() |
---|
3709 | 4312 | { |
---|
3710 | 4313 | ResetTransform(-1); |
---|
.. | .. |
---|
3720 | 4323 | if (obj.toParent == null) |
---|
3721 | 4324 | continue; |
---|
3722 | 4325 | |
---|
3723 | | - if (mask == -1) |
---|
3724 | | - { |
---|
3725 | | - if (obj instanceof Camera) // jan 2014 |
---|
3726 | | - { |
---|
3727 | | - LA.matIdentity(obj.toParent); |
---|
3728 | | - LA.matIdentity(obj.fromParent); |
---|
3729 | | - } |
---|
3730 | | - else |
---|
3731 | | - { |
---|
3732 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
3733 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
3734 | | - } |
---|
3735 | | - TouchTransform(obj); |
---|
3736 | | - continue; |
---|
3737 | | - } |
---|
3738 | | - if ((mask&2) != 0) // Scale |
---|
3739 | | - { |
---|
3740 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
3741 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
3742 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
3743 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
3744 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
3745 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
3746 | | - } |
---|
3747 | | - if ((mask&4) != 0) // Rotation |
---|
3748 | | - { |
---|
3749 | | - // ? |
---|
3750 | | - } |
---|
3751 | | - if ((mask&1) != 0) // Translation |
---|
3752 | | - { |
---|
3753 | | - if (obj.toParent != null) |
---|
3754 | | - { |
---|
3755 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
3756 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
3757 | | - } |
---|
3758 | | - } |
---|
| 4326 | + obj.ResetTransform(mask); |
---|
| 4327 | + |
---|
3759 | 4328 | if (obj.parent == null) |
---|
3760 | 4329 | { |
---|
3761 | 4330 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4264 | 4833 | { |
---|
4265 | 4834 | Object3D obj = group.selection.get(i); |
---|
4266 | 4835 | |
---|
| 4836 | + if (obj.toParent == null) |
---|
| 4837 | + { |
---|
| 4838 | + obj.toParent = LA.newMatrix(); |
---|
| 4839 | + obj.fromParent = LA.newMatrix(); |
---|
| 4840 | + } |
---|
| 4841 | + |
---|
4267 | 4842 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4268 | 4843 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4269 | 4844 | } |
---|
.. | .. |
---|
4555 | 5130 | refreshContents(); |
---|
4556 | 5131 | } |
---|
4557 | 5132 | |
---|
| 5133 | + void ClearVersions() |
---|
| 5134 | + { |
---|
| 5135 | + group.selection.ClearVersions(); |
---|
| 5136 | + refreshContents(); |
---|
| 5137 | + } |
---|
| 5138 | + |
---|
4558 | 5139 | void FlipV(boolean flip) |
---|
4559 | 5140 | { |
---|
4560 | 5141 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
4749 | 5330 | |
---|
4750 | 5331 | freezemodel = false; |
---|
4751 | 5332 | } |
---|
4752 | | - |
---|
4753 | | - boolean flashIt = true; |
---|
4754 | | - |
---|
| 5333 | + |
---|
4755 | 5334 | public void valueChanged(TreeSelectionEvent e) |
---|
4756 | 5335 | //public boolean handleEvent(Event event) |
---|
4757 | 5336 | { |
---|
.. | .. |
---|
4824 | 5403 | { |
---|
4825 | 5404 | editButton.setEnabled(enabled); |
---|
4826 | 5405 | uneditButton.setEnabled(enabled); |
---|
4827 | | - unselectButton.setEnabled(enabled); |
---|
| 5406 | + //unselectButton.setEnabled(enabled); |
---|
4828 | 5407 | flashSelectionButton.setEnabled(enabled); |
---|
| 5408 | + |
---|
| 5409 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5410 | + |
---|
| 5411 | + boolean allComposites = true; |
---|
| 5412 | + |
---|
| 5413 | + if (group.selection != null) |
---|
| 5414 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5415 | + { |
---|
| 5416 | + Object next = e.nextElement(); |
---|
| 5417 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
| 5418 | + { |
---|
| 5419 | + allComposites = false; |
---|
| 5420 | + break; |
---|
| 5421 | + } |
---|
| 5422 | + } |
---|
| 5423 | + |
---|
| 5424 | + rootButton.setEnabled(true); // allComposites); |
---|
4829 | 5425 | } |
---|
4830 | 5426 | |
---|
4831 | 5427 | void refreshContents(boolean cp) |
---|
4832 | 5428 | { |
---|
4833 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5429 | + if (Globals.ADVANCED) |
---|
| 5430 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
4834 | 5431 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4835 | 5432 | { |
---|
4836 | 5433 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
4840 | 5437 | Object3D child = (Object3D) group.selection.get(i); |
---|
4841 | 5438 | |
---|
4842 | 5439 | objEditor.AddInfo(child, this, true); |
---|
4843 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5440 | +// System.err.println("info : " + child.GetPath()); |
---|
4844 | 5441 | } |
---|
4845 | 5442 | |
---|
4846 | 5443 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
5666 | 6263 | |
---|
5667 | 6264 | cButton restoreCameraButton; |
---|
5668 | 6265 | |
---|
5669 | | - cButton saveButton; |
---|
5670 | 6266 | cButton oneStepButton; |
---|
5671 | 6267 | |
---|
5672 | 6268 | cButton groupButton; |
---|
.. | .. |
---|
5675 | 6271 | cButton switchButton; |
---|
5676 | 6272 | cButton loopButton; |
---|
5677 | 6273 | cButton textureButton; |
---|
| 6274 | + |
---|
| 6275 | + cButton skybox1Button; |
---|
| 6276 | + cButton skybox2Button; |
---|
| 6277 | + cButton skybox3Button; |
---|
| 6278 | + cButton skybox4Button; |
---|
| 6279 | + cButton skybox5Button; |
---|
| 6280 | + cButton skybox6Button; |
---|
| 6281 | + cButton skybox7Button; |
---|
| 6282 | + |
---|
| 6283 | + cButton skybox11Button; |
---|
| 6284 | + cButton skybox12Button; |
---|
| 6285 | + cButton skybox13Button; |
---|
| 6286 | + cButton skybox14Button; |
---|
| 6287 | + cButton skybox15Button; |
---|
| 6288 | + cButton skybox16Button; |
---|
| 6289 | + cButton skybox17Button; |
---|
5678 | 6290 | |
---|
5679 | 6291 | cButton gridButton; |
---|
5680 | 6292 | cButton boxButton; |
---|
.. | .. |
---|
5708 | 6320 | private MenuItem lookAtItem; |
---|
5709 | 6321 | private MenuItem lookFromItem; |
---|
5710 | 6322 | private MenuItem switchViewItem; |
---|
5711 | | - private MenuItem cutItem; |
---|
| 6323 | + private JMenuItem cutItem; |
---|
5712 | 6324 | private MenuItem undoItem; |
---|
5713 | 6325 | private MenuItem redoItem; |
---|
5714 | 6326 | private JMenuItem duplicateItem; |
---|
5715 | | - private MenuItem cloneItem; |
---|
| 6327 | + private JMenuItem cloneItem; |
---|
5716 | 6328 | private MenuItem cloneSupportItem; |
---|
5717 | 6329 | private MenuItem overwriteGeoItem; |
---|
5718 | 6330 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
5733 | 6345 | private MenuItem cloneGeometriesItem; |
---|
5734 | 6346 | private MenuItem shareGeometriesItem; |
---|
5735 | 6347 | private MenuItem mergeGeometriesItem; |
---|
5736 | | - private MenuItem copyItem; |
---|
| 6348 | + private JMenuItem copyItem; |
---|
5737 | 6349 | private MenuItem pasteItem; |
---|
5738 | | - private MenuItem pasteIntoItem; |
---|
5739 | | - private MenuItem pasteLinkItem; |
---|
5740 | | - private MenuItem pasteCloneItem; |
---|
5741 | | - private MenuItem pasteExpandItem; |
---|
5742 | | - private MenuItem deleteItem; |
---|
| 6350 | + private JMenuItem pasteIntoItem; |
---|
| 6351 | + private JMenuItem pasteLinkItem; |
---|
| 6352 | + private JMenuItem pasteCloneItem; |
---|
| 6353 | + private JMenuItem pasteExpandItem; |
---|
| 6354 | + private JMenuItem deleteItem; |
---|
5743 | 6355 | private MenuItem clearAllItem; |
---|
5744 | 6356 | private MenuItem genUVItem; |
---|
5745 | 6357 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5765 | 6377 | private MenuItem clipMeshItem; |
---|
5766 | 6378 | private MenuItem smoothMeshItem; |
---|
5767 | 6379 | private MenuItem clearMaterialsItem; |
---|
| 6380 | + private MenuItem clearVersionsItem; |
---|
5768 | 6381 | |
---|
5769 | 6382 | private MenuItem liveleavesItem; |
---|
5770 | 6383 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
5788 | 6401 | private MenuItem maxTexturesItem; |
---|
5789 | 6402 | private MenuItem panoTexturesItem; |
---|
5790 | 6403 | |
---|
| 6404 | + private MenuItem textureRatioRItem; |
---|
| 6405 | + private MenuItem textureRatioGItem; |
---|
| 6406 | + private MenuItem textureRatioBItem; |
---|
5791 | 6407 | private MenuItem resetCentroidItem; |
---|
5792 | 6408 | private MenuItem resetCentroidXZItem; |
---|
5793 | 6409 | private MenuItem resetTransformItem; |
---|
5794 | 6410 | private MenuItem transformGeometryItem; |
---|
5795 | 6411 | private MenuItem transformChildrenItem; |
---|
5796 | 6412 | private MenuItem hideItem; |
---|
5797 | | - private MenuItem grabItem; |
---|
| 6413 | + private JMenuItem grabItem; |
---|
5798 | 6414 | private MenuItem backItem; |
---|
5799 | 6415 | private MenuItem frontItem; |
---|
5800 | 6416 | private MenuItem cameraItem; |
---|
.. | .. |
---|
5807 | 6423 | private MenuItem switchTransfoItem; |
---|
5808 | 6424 | private MenuItem morphItem; |
---|
5809 | 6425 | private MenuItem linkerItem; |
---|
5810 | | - private MenuItem ungroupItem; |
---|
| 6426 | + private JMenuItem ungroupItem; |
---|
5811 | 6427 | private MenuItem editItem; |
---|
5812 | 6428 | private MenuItem openWindowItem; |
---|
5813 | 6429 | private MenuItem editLeafItem; |
---|