.. | .. |
---|
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, |
---|
.. | .. |
---|
24 | 25 | ItemListener // ListSelectionListener |
---|
25 | 26 | { |
---|
26 | 27 | |
---|
27 | | - public void AddSkyboxButton(String f, String s, cGridBag row3) |
---|
| 28 | + public void AddSkyboxButton(String f, String s, cGridBag row) |
---|
28 | 29 | { |
---|
29 | 30 | cButton skyboxButton; |
---|
30 | 31 | final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
31 | | - row3.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF)); |
---|
32 | | - skyboxButton.setToolTipText(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); |
---|
33 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
34 | 36 | { |
---|
35 | 37 | @Override |
---|
.. | .. |
---|
40 | 42 | }); |
---|
41 | 43 | } |
---|
42 | 44 | |
---|
43 | | - public void ChangeSkybox(String name) |
---|
| 45 | + public void AddTextureButton(String f, String c, final String t, int count, cGridBag row) |
---|
44 | 46 | { |
---|
45 | | - cameraView.envyoff = false; |
---|
46 | | - cameraView.skyboxname = name; |
---|
47 | | - cameraView.skyboxext = "jpg"; |
---|
48 | | - cameraView.repaint(); |
---|
| 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 | + }); |
---|
49 | 59 | } |
---|
50 | 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 | + |
---|
51 | 371 | //ObjEditor objEditor; |
---|
52 | 372 | public void closeUI2() |
---|
53 | 373 | { |
---|
.. | .. |
---|
85 | 405 | this.copy = this.group = group; |
---|
86 | 406 | //selectees = this.group.selectees; |
---|
87 | 407 | |
---|
88 | | - if (copy.versions == null) |
---|
89 | | - { |
---|
90 | | - copy.versions = new byte[100][]; |
---|
91 | | - copy.versionindex = -1; |
---|
92 | | - } |
---|
| 408 | + assert(false); |
---|
| 409 | + |
---|
| 410 | +// if (copy.versionlist == null) |
---|
| 411 | +// { |
---|
| 412 | +// copy.versionlist = new Object3D[100]; |
---|
| 413 | +// copy.versionindex = -1; |
---|
| 414 | +// |
---|
| 415 | +// //Save(true); |
---|
| 416 | +// } |
---|
93 | 417 | |
---|
94 | 418 | if(ui) |
---|
95 | 419 | SetupUI(objEditor); |
---|
.. | .. |
---|
112 | 436 | |
---|
113 | 437 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
114 | 438 | |
---|
115 | | - if (copy.versions == null) |
---|
116 | | - { |
---|
117 | | - copy.versions = new byte[100][]; |
---|
118 | | - copy.versionindex = -1; |
---|
119 | | - |
---|
120 | | - Save(true); |
---|
121 | | - } |
---|
| 439 | +// if (copy.versionlist == null) |
---|
| 440 | +// { |
---|
| 441 | +// copy.versionlist = new Object3D[100]; |
---|
| 442 | +// copy.versionindex = -1; |
---|
| 443 | +// |
---|
| 444 | +// //Save(true); |
---|
| 445 | +// } |
---|
122 | 446 | } |
---|
123 | 447 | |
---|
124 | 448 | void CloneSelection(boolean supports) |
---|
.. | .. |
---|
208 | 532 | // menu.add("-"); |
---|
209 | 533 | duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
210 | 534 | duplicateItem.addActionListener(this); |
---|
211 | | - cloneItem = menu.add(new MenuItem("Clone")); |
---|
| 535 | + |
---|
| 536 | + cloneItem = oe.jTree.popup.add(new JMenuItem("Clone")); |
---|
212 | 537 | cloneItem.addActionListener(this); |
---|
213 | | - if (Globals.ADVANCED) |
---|
| 538 | + //if (Globals.ADVANCED) |
---|
214 | 539 | { |
---|
215 | 540 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
216 | 541 | cloneSupportItem.addActionListener(this); |
---|
217 | 542 | } |
---|
| 543 | + oe.jTree.popup.addSeparator(); |
---|
218 | 544 | menu.add("-"); |
---|
219 | | - cutItem = menu.add(new MenuItem("Cut")); |
---|
| 545 | + cutItem = oe.jTree.popup.add(new JMenuItem("Cut")); |
---|
220 | 546 | cutItem.addActionListener(this); |
---|
221 | | - copyItem = menu.add(new MenuItem("Copy")); |
---|
| 547 | + copyItem = oe.jTree.popup.add(new JMenuItem("Copy")); |
---|
222 | 548 | copyItem.addActionListener(this); |
---|
223 | 549 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
224 | 550 | pasteItem.addActionListener(this); |
---|
225 | 551 | |
---|
226 | | - menu.add("-"); |
---|
227 | | - pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 552 | + oe.jTree.popup.addSeparator(); |
---|
| 553 | + //menu.add("-"); |
---|
| 554 | + pasteIntoItem = oe.jTree.popup.add(new JMenuItem("Paste into")); |
---|
228 | 555 | pasteIntoItem.addActionListener(this); |
---|
229 | | - pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
| 556 | + pasteLinkItem = oe.jTree.popup.add(new JMenuItem("Paste link")); |
---|
230 | 557 | pasteLinkItem.addActionListener(this); |
---|
231 | | - pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
| 558 | + pasteCloneItem = oe.jTree.popup.add(new JMenuItem("Paste clone")); |
---|
232 | 559 | pasteCloneItem.addActionListener(this); |
---|
233 | | -// pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
| 560 | +// CRASH pasteExpandItem = oe.jTree.popup.add(new JMenuItem("Paste expand")); |
---|
234 | 561 | // pasteExpandItem.addActionListener(this); |
---|
235 | | - menu.add("-"); |
---|
236 | | - deleteItem = menu.add(new MenuItem("Delete")); |
---|
237 | | - deleteItem.addActionListener(this); |
---|
| 562 | + //menu.add("-"); |
---|
| 563 | + oe.jTree.popup.addSeparator(); |
---|
238 | 564 | |
---|
239 | 565 | if (Globals.ADVANCED) |
---|
240 | 566 | { |
---|
.. | .. |
---|
320 | 646 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
321 | 647 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
322 | 648 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
323 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
324 | 649 | oe.cameraMenu.add("-"); |
---|
325 | 650 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
326 | 651 | openWindowItem.addActionListener(this); |
---|
327 | | - editLeafItem.addActionListener(this); |
---|
328 | 652 | lookAtItem.addActionListener(this); |
---|
329 | 653 | //lookFromItem.addActinoListener(this); |
---|
330 | 654 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
371 | 695 | setMasterItem.addActionListener(this); |
---|
372 | 696 | } |
---|
373 | 697 | |
---|
374 | | - oe.menuBar.add(menu = new Menu("Group")); |
---|
375 | | -// grabItem = menu.add(new MenuItem("Grab")); |
---|
376 | | -// grabItem.addActionListener(this); |
---|
| 698 | + oe.menuBar.add(menu = new Menu("Order")); |
---|
| 699 | + |
---|
377 | 700 | backItem = menu.add(new MenuItem("Back")); |
---|
378 | 701 | backItem.addActionListener(this); |
---|
379 | 702 | frontItem = menu.add(new MenuItem("Front")); |
---|
.. | .. |
---|
381 | 704 | // compositeItem = menu.add(new MenuItem("Composite")); |
---|
382 | 705 | // compositeItem.addActionListener(this); |
---|
383 | 706 | |
---|
| 707 | + grabItem = oe.jTree.popup.add(new JMenuItem("Group")); |
---|
| 708 | + grabItem.addActionListener(this); |
---|
| 709 | + |
---|
384 | 710 | if (Globals.ADVANCED) |
---|
385 | 711 | { |
---|
386 | 712 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
387 | 713 | hideItem.addActionListener(this); |
---|
388 | 714 | } |
---|
389 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 715 | + ungroupItem = oe.jTree.popup.add(new JMenuItem("Ungroup")); |
---|
390 | 716 | ungroupItem.addActionListener(this); |
---|
| 717 | + |
---|
| 718 | + oe.jTree.popup.addSeparator(); |
---|
| 719 | + |
---|
| 720 | + deleteItem = oe.jTree.popup.add(new JMenuItem("Delete")); |
---|
| 721 | + deleteItem.addActionListener(this); |
---|
391 | 722 | |
---|
392 | 723 | // menu.add("-"); |
---|
393 | 724 | // |
---|
.. | .. |
---|
424 | 755 | shadowYItem.addActionListener(this); |
---|
425 | 756 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
426 | 757 | shadowZItem.addActionListener(this); |
---|
| 758 | + |
---|
427 | 759 | attributeItem = menu.add(new MenuItem("Attribute")); |
---|
428 | 760 | attributeItem.addActionListener(this); |
---|
429 | | - |
---|
430 | 761 | if (Globals.ADVANCED) |
---|
431 | 762 | { |
---|
432 | 763 | menu.add("-"); |
---|
.. | .. |
---|
438 | 769 | pointflowItem.addActionListener(this); |
---|
439 | 770 | } |
---|
440 | 771 | menu.add("-"); |
---|
| 772 | + textureRatioRItem = menu.add(new MenuItem("Texture Ratio Red")); |
---|
| 773 | + textureRatioRItem.addActionListener(this); |
---|
| 774 | + textureRatioGItem = menu.add(new MenuItem("Texture Ratio Green")); |
---|
| 775 | + textureRatioGItem.addActionListener(this); |
---|
| 776 | + textureRatioBItem = menu.add(new MenuItem("Texture Ratio Blue")); |
---|
| 777 | + textureRatioBItem.addActionListener(this); |
---|
| 778 | + menu.add("-"); |
---|
441 | 779 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
442 | 780 | resetTransformItem.addActionListener(this); |
---|
443 | 781 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
444 | 782 | resetCentroidItem.addActionListener(this); |
---|
445 | | - resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 783 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XZ")); |
---|
446 | 784 | resetCentroidXZItem.addActionListener(this); |
---|
447 | 785 | transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
448 | 786 | transformGeometryItem.addActionListener(this); |
---|
.. | .. |
---|
494 | 832 | } |
---|
495 | 833 | |
---|
496 | 834 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
| 835 | + clearVersionsItem = menu.add(new MenuItem("Clear Versions")); |
---|
| 836 | + clearVersionsItem.addActionListener(this); |
---|
497 | 837 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
498 | 838 | clearMaterialsItem.addActionListener(this); |
---|
499 | 839 | resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
.. | .. |
---|
516 | 856 | hideleavesItem.addActionListener(this); |
---|
517 | 857 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
518 | 858 | showleavesItem.addActionListener(this); |
---|
519 | | - markleavesItem = menu.add(new MenuItem("Mark Leaves")); |
---|
| 859 | + markleavesItem = menu.add(new MenuItem("Anim Leaves")); |
---|
520 | 860 | markleavesItem.addActionListener(this); |
---|
521 | | - unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
| 861 | + unmarkleavesItem = menu.add(new MenuItem("Unanim Leaves")); |
---|
522 | 862 | unmarkleavesItem.addActionListener(this); |
---|
523 | 863 | rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
524 | 864 | rewindleavesItem.addActionListener(this); |
---|
.. | .. |
---|
572 | 912 | shareGeometriesItem.addActionListener(this); |
---|
573 | 913 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
574 | 914 | mergeGeometriesItem.addActionListener(this); |
---|
| 915 | + menu.add("-"); |
---|
| 916 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 917 | + editLeafItem.addActionListener(this); |
---|
575 | 918 | if (Globals.ADVANCED) |
---|
576 | 919 | { |
---|
577 | 920 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
588 | 931 | buildToolsMenu(menu); |
---|
589 | 932 | } |
---|
590 | 933 | |
---|
| 934 | + JTabbedPane resourcecontainer; |
---|
| 935 | + cGridBag currenttab; |
---|
| 936 | + //boolean added; // patch for jar |
---|
| 937 | + |
---|
| 938 | + int totalcount = 0; |
---|
| 939 | + |
---|
| 940 | + int tabcount = 0; |
---|
| 941 | + int colcount = 0; |
---|
| 942 | + int rowcount = 0; |
---|
| 943 | + int texturecount = 0; |
---|
| 944 | + |
---|
| 945 | + int columns = 5; |
---|
| 946 | + int rows = 7; |
---|
| 947 | + |
---|
| 948 | + public void ResourceCallBack(String[] path) |
---|
| 949 | + { |
---|
| 950 | +// for (int i = 0; i < path.length; i++) |
---|
| 951 | +// System.out.print(path[i] + "/"); |
---|
| 952 | +// System.out.println(); |
---|
| 953 | + |
---|
| 954 | + if (//rowcount == 0 || |
---|
| 955 | + path.length == 1 && !path[0].equals("") && !path[0].equals(".DS_Store")) |
---|
| 956 | + { |
---|
| 957 | + currenttab = new cGridBag(); |
---|
| 958 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 959 | + currenttab.setName(tabname); |
---|
| 960 | + //added = false; |
---|
| 961 | + resourcecontainer.add(currenttab); |
---|
| 962 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 963 | + rowcount = 1; |
---|
| 964 | + colcount = 0; |
---|
| 965 | + texturecount = 0; |
---|
| 966 | + } |
---|
| 967 | + |
---|
| 968 | + if (path.length > 2 && (path[2].toLowerCase().endsWith(".jpg") || path[2].toLowerCase().endsWith(".png"))) |
---|
| 969 | + { |
---|
| 970 | + //if (!added) |
---|
| 971 | + { |
---|
| 972 | + //added = true; |
---|
| 973 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 974 | + currenttab = (cGridBag)resourcecontainer.getComponentAt(resourcecontainer.indexOfTab(tabname)); |
---|
| 975 | + } |
---|
| 976 | + |
---|
| 977 | + AddTextureButton(path[0], path[1], path[2], ++texturecount, currenttab); |
---|
| 978 | + totalcount++; |
---|
| 979 | + |
---|
| 980 | + if (++colcount >= columns) |
---|
| 981 | + { |
---|
| 982 | + colcount = 0; |
---|
| 983 | + currenttab.Return(); |
---|
| 984 | + |
---|
| 985 | + if (rowcount++ >= rows) |
---|
| 986 | + { |
---|
| 987 | + rowcount = 0; |
---|
| 988 | + } |
---|
| 989 | + } |
---|
| 990 | + } |
---|
| 991 | + else |
---|
| 992 | + { |
---|
| 993 | +// if (!path[path.length-1].equals("icons")) |
---|
| 994 | +// resourcecontainer.Return(); |
---|
| 995 | + } |
---|
| 996 | + } |
---|
| 997 | + |
---|
| 998 | + void CreateTexturePanel(cGridBag container) |
---|
| 999 | + { |
---|
| 1000 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 1001 | + container.add(resourcecontainer); |
---|
| 1002 | + |
---|
| 1003 | + Grafreed.ParseResources("textures", this); |
---|
| 1004 | + |
---|
| 1005 | + // 935. System.out.println("Total = " + totalcount); |
---|
| 1006 | + } |
---|
591 | 1007 | |
---|
592 | 1008 | void SetupUI2(ObjEditor oe) |
---|
593 | 1009 | { |
---|
.. | .. |
---|
606 | 1022 | //new Exception().printStackTrace(); |
---|
607 | 1023 | |
---|
608 | 1024 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
609 | | - oe.aConstraints.weightx = 1; |
---|
610 | | - oe.aConstraints.weighty = 0; |
---|
611 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
612 | | - oe.aConstraints.gridwidth = 100; |
---|
613 | | - oe.aConstraints.gridheight = 1; |
---|
614 | 1025 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
615 | 1026 | |
---|
616 | 1027 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
631 | 1042 | oe.radioPanel.add(dummyButton); |
---|
632 | 1043 | oe.buttonGroup.add(dummyButton); |
---|
633 | 1044 | */ |
---|
634 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1045 | + cGridBag versionManagerPanel = new cGridBag(); |
---|
635 | 1046 | |
---|
636 | | - copyOptionsPanel.preferredHeight = 2; |
---|
| 1047 | + versionManagerPanel.preferredHeight = 4; |
---|
637 | 1048 | |
---|
638 | 1049 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
639 | 1050 | |
---|
.. | .. |
---|
643 | 1054 | |
---|
644 | 1055 | if (Globals.ADVANCED) |
---|
645 | 1056 | { |
---|
646 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
647 | | - maxButton.setToolTipText("Maximize window"); |
---|
648 | | - maxButton.addActionListener(this); |
---|
| 1057 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1058 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1059 | +// maxButton.addActionListener(this); |
---|
649 | 1060 | } |
---|
650 | 1061 | |
---|
651 | | - oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
652 | | - fullButton.setToolTipText("Full-screen window"); |
---|
653 | | - fullButton.addActionListener(this); |
---|
| 1062 | + cButton gcButton; |
---|
654 | 1063 | |
---|
655 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1064 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1065 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1066 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1067 | +// { |
---|
| 1068 | +// public void actionPerformed(ActionEvent e) |
---|
| 1069 | +// { |
---|
| 1070 | +// System.gc(); |
---|
| 1071 | +// } |
---|
| 1072 | +// }); |
---|
| 1073 | + |
---|
| 1074 | + oe.toolbarPanel.add(fullScreenButton = GetButton("icons/fullscreen.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1075 | + fullScreenButton.setToolTipText("Full-screen window"); |
---|
| 1076 | + fullScreenButton.addActionListener(this); |
---|
| 1077 | + |
---|
| 1078 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1079 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1080 | + collapseButton.addActionListener(this); |
---|
| 1081 | + |
---|
| 1082 | +// oe.toolbarPanel.add(maximize3DButton = GetButton("icons/square.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1083 | +// maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1084 | +// maximize3DButton.addActionListener(this); |
---|
| 1085 | + |
---|
| 1086 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1088 | + twoButton.addActionListener(this); |
---|
| 1089 | + this.fullscreenLayout = twoButton; |
---|
| 1090 | + |
---|
| 1091 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1092 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1093 | + threeButton.addActionListener(this); |
---|
| 1094 | + if (Globals.ADVANCED) |
---|
| 1095 | + { |
---|
| 1096 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1097 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1098 | + sixButton.addActionListener(this); |
---|
| 1099 | + } |
---|
| 1100 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1101 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1102 | +// sevenButton.addActionListener(this); |
---|
| 1103 | + // |
---|
| 1104 | + |
---|
| 1105 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
656 | 1106 | screenfitButton.setToolTipText("Screen fit"); |
---|
657 | 1107 | screenfitButton.addActionListener(this); |
---|
658 | 1108 | |
---|
659 | | - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
660 | 1110 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
661 | 1111 | restoreCameraButton.addActionListener(this); |
---|
662 | 1112 | |
---|
663 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
664 | | - saveButton.setToolTipText("New version"); |
---|
665 | | - saveButton.addActionListener(this); |
---|
| 1113 | + versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1114 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 1115 | + saveVersionButton.addActionListener(this); |
---|
666 | 1116 | |
---|
667 | | - copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
668 | | - undoButton.setToolTipText("Previous version"); |
---|
669 | | - undoButton.addActionListener(this); |
---|
670 | | - undoButton.setEnabled(false); |
---|
| 1117 | + versionManagerPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 1119 | + deleteVersionButton.addActionListener(this); |
---|
| 1120 | + deleteVersionButton.setEnabled(false); |
---|
| 1121 | + |
---|
| 1122 | + versionManagerPanel.add(previousVersionButton = GetButton("icons/undo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1123 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 1124 | + previousVersionButton.addActionListener(this); |
---|
| 1125 | + previousVersionButton.setEnabled(false); |
---|
671 | 1126 | |
---|
672 | 1127 | cGridBag updown = new cGridBag().setVertical(true); |
---|
673 | | - updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
674 | | - restoreButton.setToolTipText("Restore current"); |
---|
| 1128 | + updown.add(restoreButton = GetButton("icons/restore.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
675 | 1130 | restoreButton.addActionListener(this); |
---|
676 | 1131 | restoreButton.setEnabled(false); |
---|
677 | 1132 | |
---|
678 | | - updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
679 | | - replaceButton.setToolTipText("Replace current"); |
---|
| 1133 | + updown.add(replaceButton = GetButton("icons/replace.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1134 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
680 | 1135 | replaceButton.addActionListener(this); |
---|
681 | 1136 | replaceButton.setEnabled(false); |
---|
682 | 1137 | |
---|
683 | | - copyOptionsPanel.add(updown); |
---|
| 1138 | + versionManagerPanel.add(updown); |
---|
684 | 1139 | |
---|
685 | | - copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
686 | | - redoButton.setToolTipText("Next version"); |
---|
687 | | - redoButton.addActionListener(this); |
---|
688 | | - redoButton.setEnabled(false); |
---|
| 1140 | + versionManagerPanel.add(nextVersionButton = GetButton("icons/redo.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1141 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 1142 | + nextVersionButton.addActionListener(this); |
---|
| 1143 | + nextVersionButton.setEnabled(false); |
---|
| 1144 | + |
---|
| 1145 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1146 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1147 | + oneStepButton.addActionListener(this); |
---|
689 | 1148 | |
---|
690 | 1149 | oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
691 | 1150 | liveCB.setToolTipText("Enable animation"); |
---|
692 | 1151 | liveCB.addItemListener(this); |
---|
693 | 1152 | |
---|
694 | | - oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
695 | | - oneStepButton.setToolTipText("Animate one step forward"); |
---|
696 | | - oneStepButton.addActionListener(this); |
---|
697 | | - |
---|
698 | 1153 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
699 | 1154 | fastCB.setToolTipText("Fast mode"); |
---|
700 | 1155 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
710 | 1165 | |
---|
711 | 1166 | if (Globals.ADVANCED) |
---|
712 | 1167 | { |
---|
713 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1168 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
714 | 1169 | snapobjectButton.addActionListener(this); |
---|
715 | 1170 | snapobjectButton.setToolTipText("Snap Object"); |
---|
716 | 1171 | |
---|
717 | | - oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1172 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
718 | 1173 | fourButton.addActionListener(this); |
---|
719 | 1174 | fourButton.setToolTipText("Show control panel only"); |
---|
720 | 1175 | } |
---|
721 | 1176 | |
---|
722 | 1177 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
723 | 1178 | |
---|
724 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
725 | | - twoButton.setToolTipText("Show 3D view only"); |
---|
726 | | - twoButton.addActionListener(this); |
---|
727 | | - this.fullscreenLayout = twoButton; |
---|
728 | | - |
---|
729 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
730 | | - threeButton.setToolTipText("Show controls and 3D view"); |
---|
731 | | - threeButton.addActionListener(this); |
---|
732 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
733 | | - sixButton.setToolTipText("Show 3D view and controls"); |
---|
734 | | - sixButton.addActionListener(this); |
---|
735 | | -// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
736 | | -// sevenButton.setToolTipText("3-column layout"); |
---|
737 | | -// sevenButton.addActionListener(this); |
---|
738 | | - // |
---|
739 | 1179 | |
---|
740 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1180 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
741 | 1181 | rootButton.setToolTipText("Open selection in new tab"); |
---|
742 | 1182 | rootButton.addActionListener(this); |
---|
743 | 1183 | |
---|
744 | | - oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1184 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
745 | 1185 | closeButton.setToolTipText("Close tab"); |
---|
746 | 1186 | closeButton.addActionListener(this); |
---|
747 | 1187 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
.. | .. |
---|
750 | 1190 | cGridBag row1 = new cGridBag(); |
---|
751 | 1191 | |
---|
752 | 1192 | // INSERT |
---|
753 | | - row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
754 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1193 | + row1.add(gridButton = GetButton("icons/grid.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1194 | + gridButton.setToolTipText("Create ground"); |
---|
755 | 1195 | gridButton.addActionListener(this); |
---|
756 | 1196 | |
---|
757 | | - row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1197 | + row1.add(boxButton = GetButton("icons/box.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
758 | 1198 | boxButton.setToolTipText("Create box"); |
---|
759 | 1199 | boxButton.addActionListener(this); |
---|
760 | 1200 | |
---|
761 | | - row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
762 | | - sphereButton.setToolTipText("Create sphere"); |
---|
763 | | - sphereButton.addActionListener(this); |
---|
764 | | - |
---|
765 | | - row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
766 | | - coneButton.setToolTipText("Create cone"); |
---|
767 | | - coneButton.addActionListener(this); |
---|
768 | | - |
---|
769 | | - row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
770 | | - torusButton.setToolTipText("Create torus"); |
---|
771 | | - torusButton.addActionListener(this); |
---|
772 | | - |
---|
773 | | - row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1201 | + row1.add(superButton = GetButton("icons/super.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
774 | 1202 | superButton.setToolTipText("Create superellipsoid"); |
---|
775 | 1203 | superButton.addActionListener(this); |
---|
776 | 1204 | |
---|
777 | | - if (Globals.ADVANCED) |
---|
| 1205 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1206 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1207 | + sphereButton.addActionListener(this); |
---|
| 1208 | + |
---|
| 1209 | + row1.add(coneButton = GetButton("icons/cone.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1210 | + coneButton.setToolTipText("Create cone"); |
---|
| 1211 | + coneButton.addActionListener(this); |
---|
| 1212 | + |
---|
| 1213 | + row1.add(torusButton = GetButton("icons/torus.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1214 | + torusButton.setToolTipText("Create torus"); |
---|
| 1215 | + torusButton.addActionListener(this); |
---|
| 1216 | + |
---|
| 1217 | + if (false) //Globals.ADVANCED) |
---|
778 | 1218 | { |
---|
779 | | - oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1219 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
780 | 1220 | kleinButton.setToolTipText("Create Klein bottle"); |
---|
781 | 1221 | kleinButton.addActionListener(this); |
---|
782 | 1222 | } |
---|
783 | 1223 | |
---|
784 | | - row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1224 | + row1.add(particlesButton = GetButton("icons/particles.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
785 | 1225 | particlesButton.setToolTipText("Create particle system"); |
---|
786 | 1226 | particlesButton.addActionListener(this); |
---|
787 | 1227 | |
---|
.. | .. |
---|
789 | 1229 | |
---|
790 | 1230 | cGridBag row2 = new cGridBag(); |
---|
791 | 1231 | |
---|
792 | | - row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + row2.add(groupButton = GetButton("icons/group.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
793 | 1233 | groupButton.setToolTipText("Create group"); |
---|
794 | 1234 | groupButton.addActionListener(this); |
---|
795 | 1235 | |
---|
796 | | - row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1236 | + row2.add(compositeButton = GetButton("icons/composite.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
797 | 1237 | compositeButton.setToolTipText("Create composite"); |
---|
798 | 1238 | compositeButton.addActionListener(this); |
---|
799 | 1239 | |
---|
800 | | - row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1240 | + row2.add(switchButton = GetButton("icons/switch.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
801 | 1241 | switchButton.setToolTipText("Create item switcher"); |
---|
802 | 1242 | switchButton.addActionListener(this); |
---|
803 | 1243 | |
---|
804 | | - row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1244 | + row2.add(loopButton = GetButton("icons/loop.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
805 | 1245 | loopButton.setToolTipText("Create loop"); |
---|
806 | 1246 | loopButton.addActionListener(this); |
---|
807 | 1247 | |
---|
808 | | - row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1248 | + row2.add(textureButton = GetButton("icons/texture.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
809 | 1249 | textureButton.setToolTipText("Create texture"); |
---|
810 | 1250 | textureButton.addActionListener(this); |
---|
811 | 1251 | |
---|
812 | | - row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1252 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
813 | 1253 | overlayButton.setToolTipText("Create overlay"); |
---|
814 | 1254 | overlayButton.addActionListener(this); |
---|
815 | 1255 | |
---|
816 | | - row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1256 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
817 | 1257 | lightButton.setToolTipText("Create light"); |
---|
818 | 1258 | lightButton.addActionListener(this); |
---|
819 | 1259 | |
---|
820 | 1260 | oe.toolboxPanel.add(row2); |
---|
821 | 1261 | |
---|
822 | | - // ENVYMAPS |
---|
823 | | - cGridBag row3 = new cGridBag(); |
---|
824 | | - row3.preferredHeight = 20; |
---|
| 1262 | + cGridBag textures = new cGridBag(); |
---|
825 | 1263 | |
---|
826 | | - AddSkyboxButton("default", "rgb", row3); |
---|
827 | | - AddSkyboxButton("default", "cornell", row3); |
---|
828 | | - AddSkyboxButton("default", "uffizi", row3); |
---|
829 | | - AddSkyboxButton("default", "CloudyHills", row3); |
---|
830 | | - AddSkyboxButton("default", "skycube", row3); |
---|
831 | | - |
---|
832 | | - oe.toolboxPanel.add(row3); |
---|
833 | | - |
---|
834 | | - cGridBag row4 = new cGridBag(); |
---|
835 | | - row4.preferredHeight = 20; |
---|
| 1264 | + CreateTexturePanel(textures); |
---|
836 | 1265 | |
---|
837 | | - AddSkyboxButton("bridge", "Bridge2", row4); |
---|
838 | | - AddSkyboxButton("urban", "GamlaStan2", row4); |
---|
839 | | - AddSkyboxButton("urban", "Parliament", row4); |
---|
840 | | - AddSkyboxButton("urban", "Roundabout", row4); |
---|
| 1266 | + int tabCount = resourcecontainer.getTabCount(); |
---|
841 | 1267 | |
---|
842 | | - oe.toolboxPanel.add(row4); |
---|
843 | | - |
---|
844 | | - cGridBag row5 = new cGridBag(); |
---|
845 | | - row5.preferredHeight = 20; |
---|
| 1268 | + if (tabCount > 0) |
---|
| 1269 | + resourcecontainer.setSelectedIndex((int)(Math.random() * tabCount)); |
---|
846 | 1270 | |
---|
847 | | - AddSkyboxButton("urban", "SaintLazarusChurch", row5); |
---|
848 | | - AddSkyboxButton("urban", "SaintLazarusChurch2", row5); |
---|
849 | | - AddSkyboxButton("urban", "SaintLazarusChurch3", row5); |
---|
850 | | - AddSkyboxButton("urban", "UnionSquare", row5); |
---|
| 1271 | + oe.toolboxPanel.add(textures); |
---|
851 | 1272 | |
---|
852 | | - oe.toolboxPanel.add(row5); |
---|
853 | | - |
---|
854 | | - cGridBag row6 = new cGridBag(); |
---|
855 | | - row6.preferredHeight = 20; |
---|
| 1273 | + textures.preferredHeight = 100; |
---|
856 | 1274 | |
---|
857 | | - AddSkyboxButton("park", "BerzeliiPark", row6); |
---|
858 | | - AddSkyboxButton("park", "Buddha", row6); |
---|
859 | | - AddSkyboxButton("park", "CNTower2", row6); |
---|
860 | | - //AddSkyboxButton("park", "Fatbursparken", row6); |
---|
861 | | - AddSkyboxButton("park", "NiagaraFalls1", row6); |
---|
862 | | - |
---|
863 | | - oe.toolboxPanel.add(row6); |
---|
864 | | - |
---|
865 | | - cGridBag row7 = new cGridBag(); |
---|
866 | | - row7.preferredHeight = 20; |
---|
867 | | - |
---|
868 | | - AddSkyboxButton("park", "NiagaraFalls3", row7); |
---|
869 | | - AddSkyboxButton("park", "Park", row7); |
---|
870 | | - //AddSkyboxButton("park", "Park2", row6); |
---|
871 | | - //AddSkyboxButton("park", "Path", row6); |
---|
872 | | - AddSkyboxButton("park", "Pond", row7); |
---|
873 | | - AddSkyboxButton("park", "Skansen", row7); |
---|
874 | | - |
---|
875 | | - oe.toolboxPanel.add(row7); |
---|
876 | | - |
---|
877 | | - cGridBag row8 = new cGridBag(); |
---|
878 | | - row8.preferredHeight = 20; |
---|
879 | | - |
---|
880 | | - AddSkyboxButton("park", "Skansen2", row8); |
---|
881 | | - AddSkyboxButton("park", "Skansen3", row8); |
---|
882 | | - AddSkyboxButton("park", "Skansen4", row8); |
---|
883 | | - AddSkyboxButton("park", "Skansen5", row8); |
---|
884 | | - |
---|
885 | | - oe.toolboxPanel.add(row8); |
---|
886 | | - |
---|
887 | | - cGridBag row9 = new cGridBag(); |
---|
888 | | - row9.preferredHeight = 20; |
---|
889 | | - |
---|
890 | | - AddSkyboxButton("park", "Stairs", row9); |
---|
891 | | - //AddSkyboxButton("park", "Tantolunden", row6); |
---|
892 | | - //AddSkyboxButton("park", "Tantolunden3", row6); |
---|
893 | | - AddSkyboxButton("park", "Tantolunden4", row9); |
---|
894 | | - |
---|
895 | | - oe.toolboxPanel.add(row9); |
---|
896 | | -/* |
---|
897 | | -BerzeliiPark |
---|
898 | | -Buddha |
---|
899 | | -CNTower2 |
---|
900 | | -Fatbursparken |
---|
901 | | -NiagaraFalls1 |
---|
902 | | -NiagaraFalls3 |
---|
903 | | -Park |
---|
904 | | -Park2 |
---|
905 | | -Path |
---|
906 | | -Pond |
---|
907 | | -Skansen |
---|
908 | | -Skansen2 |
---|
909 | | -Skansen3 |
---|
910 | | -Skansen4 |
---|
911 | | -Skansen5 |
---|
912 | | -Stairs |
---|
913 | | -Tantolunden |
---|
914 | | -Tantolunden3 |
---|
915 | | -Tantolunden4 |
---|
916 | | - */ |
---|
917 | | - |
---|
918 | | - for (int i=1; --i>=0;) |
---|
919 | | - { |
---|
920 | | - //oe.toolboxPanel.Return(); |
---|
921 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
922 | | - } |
---|
| 1275 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
923 | 1276 | |
---|
924 | 1277 | // EDIT panel |
---|
925 | | - editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1278 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
926 | 1279 | editButton.setToolTipText("Pin selection controls"); |
---|
927 | 1280 | editButton.addActionListener(this); |
---|
928 | 1281 | |
---|
929 | | - editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
930 | | - uneditButton.setToolTipText("Remove selection controls"); |
---|
| 1282 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1283 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
931 | 1284 | uneditButton.addActionListener(this); |
---|
932 | 1285 | |
---|
933 | 1286 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
934 | | - allParamsButton.setToolTipText("Show all controle"); |
---|
| 1287 | + allParamsButton.setToolTipText("Show all controls"); |
---|
935 | 1288 | allParamsButton.addActionListener(this); |
---|
936 | 1289 | |
---|
937 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
938 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1290 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1291 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
939 | 1292 | clearPanelButton.addActionListener(this); |
---|
940 | 1293 | |
---|
941 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
942 | | - unselectButton.setToolTipText("Unselect"); |
---|
943 | | - unselectButton.addActionListener(this); |
---|
| 1294 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1295 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1296 | + //unselectButton.addActionListener(this); |
---|
944 | 1297 | |
---|
945 | | - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1298 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); |
---|
946 | 1299 | flashSelectionButton.setToolTipText("Highlight selection"); |
---|
947 | 1300 | flashSelectionButton.addActionListener(this); |
---|
948 | 1301 | |
---|
.. | .. |
---|
965 | 1318 | |
---|
966 | 1319 | cGridBag jSPPanel = new cGridBag(); |
---|
967 | 1320 | |
---|
| 1321 | + jSPPanel.preferredHeight = 20; |
---|
| 1322 | + |
---|
968 | 1323 | JScrollPane jSP; |
---|
969 | 1324 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
970 | 1325 | jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
.. | .. |
---|
973 | 1328 | oe.treePanel.add(jSPPanel); |
---|
974 | 1329 | oe.treePanel.Return(); |
---|
975 | 1330 | |
---|
976 | | - oe.treePanel.add(copyOptionsPanel); |
---|
| 1331 | + oe.treePanel.add(versionManagerPanel); |
---|
977 | 1332 | oe.treePanel.Return(); |
---|
978 | | - cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
979 | | - versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
980 | | - sliderPane.preferredHeight = 1; |
---|
| 1333 | + versionSliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1334 | + versionSlider = (cNumberSlider)versionSliderPane.getComponent(1); |
---|
| 1335 | + versionSliderPane.preferredHeight = 3; |
---|
981 | 1336 | |
---|
982 | 1337 | // mainPanel.setDividerLocation(0.1); //1.0); |
---|
983 | 1338 | mainPanel.setResizeWeight(0.4); |
---|
.. | .. |
---|
1000 | 1355 | dgr.addDragGestureListener(this); |
---|
1001 | 1356 | }catch(Exception e) {} |
---|
1002 | 1357 | */ |
---|
1003 | | - radio.layout = sixButton; // sevenButton; |
---|
| 1358 | + radio.layout = threeButton; // sixButton; |
---|
1004 | 1359 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
1005 | 1360 | } |
---|
1006 | 1361 | |
---|
.. | .. |
---|
1051 | 1406 | smoothCB.setToolTipText("Snapping delay"); |
---|
1052 | 1407 | smoothCB.addItemListener(this); |
---|
1053 | 1408 | |
---|
1054 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
1055 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
1056 | | - slowCB.addItemListener(this); |
---|
| 1409 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1410 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1411 | +// slowCB.addItemListener(this); |
---|
| 1412 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1413 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1414 | + minshaderCB.addItemListener(this); |
---|
1057 | 1415 | |
---|
1058 | 1416 | // constraints.gridy += 1; |
---|
1059 | 1417 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
.. | .. |
---|
1132 | 1490 | |
---|
1133 | 1491 | void EditObject(Object3D obj) |
---|
1134 | 1492 | { |
---|
| 1493 | + //assert(obj instanceof Composite); |
---|
| 1494 | + |
---|
| 1495 | +// if (obj.versionlist == null) |
---|
| 1496 | +// { |
---|
| 1497 | +// obj.versionlist = new Object3D[100]; |
---|
| 1498 | +// obj.versionindex = -1; |
---|
| 1499 | +// } |
---|
| 1500 | + |
---|
1135 | 1501 | cRadio radioButton = new cRadio(obj.name); |
---|
1136 | 1502 | |
---|
1137 | 1503 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1142 | 1508 | } |
---|
1143 | 1509 | |
---|
1144 | 1510 | radioButton.SetObject(obj); |
---|
1145 | | - radioButton.layout = sixButton; // sevenButton; |
---|
| 1511 | + radioButton.layout = threeButton; // sixButton; |
---|
1146 | 1512 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
1147 | 1513 | radioButton.addActionListener(this); |
---|
1148 | 1514 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1156 | 1522 | |
---|
1157 | 1523 | oe.SetupViews(); |
---|
1158 | 1524 | |
---|
| 1525 | + if (Globals.DEBUG) |
---|
1159 | 1526 | System.out.println("SetupViews"); |
---|
1160 | 1527 | DragSource.getDefaultDragSource().createDefaultDragGestureRecognizer( |
---|
1161 | 1528 | oe.cameraView, DnDConstants.ACTION_COPY_OR_MOVE, this); // ACTION_LINK ?? |
---|
.. | .. |
---|
1167 | 1534 | cCheckBox localCB; |
---|
1168 | 1535 | cCheckBox crowdCB; |
---|
1169 | 1536 | cCheckBox smoothCB; |
---|
| 1537 | + cCheckBox minshaderCB; |
---|
| 1538 | + |
---|
1170 | 1539 | cToggleButton fastCB; |
---|
1171 | 1540 | cCheckBox slowCB; |
---|
1172 | 1541 | cCheckBox boxCB; |
---|
.. | .. |
---|
1237 | 1606 | { |
---|
1238 | 1607 | cameraView.ToggleInertia(); |
---|
1239 | 1608 | cameraView.repaint(); |
---|
| 1609 | + } |
---|
| 1610 | + else if(e.getSource() == minshaderCB) |
---|
| 1611 | + { |
---|
| 1612 | + Globals.MINSHADER ^= true; |
---|
| 1613 | + cameraView.programInitialized = false; |
---|
| 1614 | + cameraView.repaint(); |
---|
1240 | 1615 | } |
---|
1241 | 1616 | else if(e.getSource() == localCB) |
---|
1242 | 1617 | { |
---|
.. | .. |
---|
1514 | 1889 | TreePath path; |
---|
1515 | 1890 | |
---|
1516 | 1891 | public TransferableTreePath(TreePath tp) { |
---|
1517 | | - path = tp; |
---|
| 1892 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1893 | + for (int i=0; i<objs.length; i++) |
---|
| 1894 | + { |
---|
| 1895 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1896 | + } |
---|
| 1897 | + path = new TreePath(objs); |
---|
1518 | 1898 | } |
---|
1519 | 1899 | |
---|
1520 | 1900 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
1746 | 2126 | switch(axis) |
---|
1747 | 2127 | { |
---|
1748 | 2128 | case 0 : |
---|
1749 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1750 | | - vert2.x = minima.x; vert2.y = maxima.y; vert2.z = minima.z; |
---|
1751 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
1752 | | - vert4.x = minima.x; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
| 2129 | + vert1.x = minima.x + 0.001f; vert1.y = minima.y; vert1.z = minima.z; |
---|
| 2130 | + vert2.x = minima.x + 0.001f; vert2.y = maxima.y; vert2.z = minima.z; |
---|
| 2131 | + vert3.x = minima.x + 0.001f; vert3.y = minima.y; vert3.z = maxima.z; |
---|
| 2132 | + vert4.x = minima.x + 0.001f; vert4.y = maxima.y; vert4.z = maxima.z; |
---|
1753 | 2133 | norm = cVector.X; |
---|
1754 | 2134 | break; |
---|
1755 | 2135 | case 1 : |
---|
1756 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1757 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
1758 | | - vert3.x = minima.x; vert3.y = minima.y; vert3.z = maxima.z; |
---|
1759 | | - vert4.x = maxima.x; vert4.y = minima.y; vert4.z = maxima.z; |
---|
| 2136 | + vert1.x = minima.x; vert1.y = minima.y + 0.001f; vert1.z = minima.z; |
---|
| 2137 | + vert2.x = maxima.x; vert2.y = minima.y + 0.001f; vert2.z = minima.z; |
---|
| 2138 | + vert3.x = minima.x; vert3.y = minima.y + 0.001f; vert3.z = maxima.z; |
---|
| 2139 | + vert4.x = maxima.x; vert4.y = minima.y + 0.001f; vert4.z = maxima.z; |
---|
1760 | 2140 | norm = cVector.Y; |
---|
1761 | 2141 | break; |
---|
1762 | 2142 | case 2 : |
---|
1763 | | - vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z; |
---|
1764 | | - vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z; |
---|
1765 | | - vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z; |
---|
1766 | | - vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z; |
---|
| 2143 | + vert1.x = minima.x; vert1.y = minima.y; vert1.z = minima.z + 0.001f; |
---|
| 2144 | + vert2.x = maxima.x; vert2.y = minima.y; vert2.z = minima.z + 0.001f; |
---|
| 2145 | + vert3.x = minima.x; vert3.y = maxima.y; vert3.z = minima.z + 0.001f; |
---|
| 2146 | + vert4.x = maxima.x; vert4.y = maxima.y; vert4.z = minima.z + 0.001f; |
---|
1767 | 2147 | norm = cVector.Z; |
---|
1768 | 2148 | break; |
---|
1769 | 2149 | } |
---|
.. | .. |
---|
1804 | 2184 | shadow.material = new cMaterial(obj.material); |
---|
1805 | 2185 | shadow.material.diffuse = 0.0001f; |
---|
1806 | 2186 | shadow.material.specular = 0.0001f; |
---|
1807 | | - //shadow.projectedVertices[1].x = 300; |
---|
| 2187 | + shadow.material.opacity = 0.75f; |
---|
| 2188 | + |
---|
| 2189 | + AllocProjectedVertices(shadow); |
---|
| 2190 | + |
---|
| 2191 | + shadow.projectedVertices[1].x = 300; |
---|
1808 | 2192 | |
---|
1809 | 2193 | makeSomething(shadow); |
---|
1810 | 2194 | } |
---|
.. | .. |
---|
2325 | 2709 | } else |
---|
2326 | 2710 | if (source == loopItem || source == loopButton) |
---|
2327 | 2711 | { |
---|
| 2712 | + if (!group.selection.isEmpty()) |
---|
| 2713 | + { |
---|
2328 | 2714 | Composite csg = new GroupLeaf(); |
---|
2329 | | - csg.count = 5; |
---|
2330 | 2715 | group(csg); |
---|
| 2716 | + csg.count = 5; |
---|
2331 | 2717 | Composite child = new cGroup("Branch"); |
---|
2332 | 2718 | csg.addChild(child); |
---|
2333 | 2719 | child.addChild(csg); |
---|
| 2720 | + } |
---|
2334 | 2721 | } else |
---|
2335 | 2722 | if (source == doubleItem) |
---|
2336 | 2723 | { |
---|
| 2724 | + if (!group.selection.isEmpty()) |
---|
| 2725 | + { |
---|
2337 | 2726 | Composite csg = new GroupLeaf("Fork"); |
---|
2338 | | - csg.count = 5; |
---|
2339 | 2727 | group(csg); |
---|
| 2728 | + csg.count = 5; |
---|
2340 | 2729 | Composite child = new cGroup("Branch A"); |
---|
2341 | 2730 | csg.addChild(child); |
---|
2342 | 2731 | child.addChild(csg); |
---|
2343 | 2732 | child = new cGroup("Branch B"); |
---|
2344 | 2733 | csg.addChild(child); |
---|
2345 | 2734 | child.addChild(csg); |
---|
| 2735 | + } |
---|
2346 | 2736 | } else |
---|
2347 | 2737 | if (source == tripleItem) |
---|
2348 | 2738 | { |
---|
| 2739 | + if (!group.selection.isEmpty()) |
---|
| 2740 | + { |
---|
2349 | 2741 | Composite csg = new GroupLeaf("Trident"); |
---|
2350 | 2742 | csg.count = 4; |
---|
2351 | 2743 | group(csg); |
---|
.. | .. |
---|
2358 | 2750 | child = new cGroup(); |
---|
2359 | 2751 | csg.addChild(child); |
---|
2360 | 2752 | child.addChild(csg); |
---|
| 2753 | + } |
---|
2361 | 2754 | } else |
---|
2362 | 2755 | if (source == computeAOItem) |
---|
2363 | 2756 | { |
---|
.. | .. |
---|
2377 | 2770 | if (source == invariantsItem) |
---|
2378 | 2771 | { |
---|
2379 | 2772 | System.out.println("Invariants:"); |
---|
2380 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2773 | + Grafreed.grafreed.universe.invariants(); |
---|
2381 | 2774 | } else |
---|
2382 | 2775 | if (source == memoryItem) |
---|
2383 | 2776 | { |
---|
.. | .. |
---|
2404 | 2797 | { |
---|
2405 | 2798 | Maximize(); |
---|
2406 | 2799 | } else |
---|
2407 | | - if (source == fullButton) |
---|
| 2800 | + if (source == fullScreenButton) |
---|
2408 | 2801 | { |
---|
2409 | 2802 | ToggleFullScreen(); |
---|
2410 | 2803 | } else |
---|
2411 | | - if (source == undoButton) |
---|
| 2804 | + if (source == collapseButton) |
---|
| 2805 | + { |
---|
| 2806 | + this.expandedLayout = radio.layout; |
---|
| 2807 | + CollapseToolbar(); |
---|
| 2808 | + } else |
---|
| 2809 | +// if (source == maximize3DButton) |
---|
| 2810 | +// { |
---|
| 2811 | +// this.expandedLayout = radio.layout; |
---|
| 2812 | +// radio.layout = twoButton; |
---|
| 2813 | +// CollapseToolbar(); |
---|
| 2814 | +// Show3DView(); |
---|
| 2815 | +// } else |
---|
| 2816 | + if (source == previousVersionButton) |
---|
2412 | 2817 | { |
---|
2413 | 2818 | // Go to previous version |
---|
2414 | 2819 | //if (!Undo()) |
---|
2415 | 2820 | //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2416 | | - Undo(); |
---|
| 2821 | + PreviousVersion(); |
---|
2417 | 2822 | } else |
---|
2418 | 2823 | if (source == restoreButton) |
---|
2419 | 2824 | { |
---|
2420 | 2825 | // Restore current version |
---|
2421 | 2826 | Restore(); |
---|
| 2827 | + //restoreButton.setEnabled(false); |
---|
2422 | 2828 | } else |
---|
2423 | 2829 | if (source == replaceButton) |
---|
2424 | 2830 | { |
---|
2425 | 2831 | // Overwrite current version |
---|
2426 | 2832 | Replace(); |
---|
| 2833 | + //replaceButton.setEnabled(false); |
---|
2427 | 2834 | } else |
---|
2428 | | - if (source == redoButton) |
---|
| 2835 | + if (source == nextVersionButton) |
---|
2429 | 2836 | { |
---|
2430 | 2837 | // Go to next version |
---|
2431 | | - Redo(); |
---|
| 2838 | + NextVersion(); |
---|
2432 | 2839 | } else |
---|
2433 | | - if (source == saveButton) |
---|
| 2840 | + if (source == saveVersionButton) |
---|
2434 | 2841 | { |
---|
2435 | 2842 | // Save a new version |
---|
2436 | 2843 | if (!Save(true)) |
---|
2437 | 2844 | java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2845 | + } else |
---|
| 2846 | + if (source == deleteVersionButton) |
---|
| 2847 | + { |
---|
| 2848 | + // Delete a new version |
---|
| 2849 | + DeleteVersion(); |
---|
2438 | 2850 | } else |
---|
2439 | 2851 | if (source == oneStepButton) |
---|
2440 | 2852 | { |
---|
.. | .. |
---|
2489 | 2901 | } else |
---|
2490 | 2902 | if (source == undoItem) |
---|
2491 | 2903 | { |
---|
2492 | | - Undo(); |
---|
| 2904 | + PreviousVersion(); |
---|
2493 | 2905 | } else |
---|
2494 | 2906 | if (source == redoItem) |
---|
2495 | 2907 | { |
---|
2496 | | - Redo(); |
---|
| 2908 | + NextVersion(); |
---|
2497 | 2909 | } else |
---|
2498 | 2910 | if (source == duplicateItem) |
---|
2499 | 2911 | { |
---|
.. | .. |
---|
2974 | 3386 | } else |
---|
2975 | 3387 | if (source == ungroupItem || source == ungroupButton) |
---|
2976 | 3388 | { |
---|
2977 | | - boolean hasRoot = false; |
---|
| 3389 | + boolean canUngroup = true; |
---|
2978 | 3390 | |
---|
2979 | 3391 | for (int i=0; i<group.selection.size(); i++) |
---|
2980 | 3392 | { |
---|
2981 | | - if (group.selection.get(i) == group) |
---|
| 3393 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3394 | + |
---|
| 3395 | + if (selectedItem.Size() == 0) |
---|
2982 | 3396 | { |
---|
2983 | | - hasRoot = true; |
---|
| 3397 | + // Cannot ungroup leaves |
---|
| 3398 | + canUngroup = false; |
---|
| 3399 | + break; |
---|
| 3400 | + } |
---|
| 3401 | + |
---|
| 3402 | + if (selectedItem == group) |
---|
| 3403 | + { |
---|
| 3404 | + // Cannot ungroup root |
---|
| 3405 | + canUngroup = false; |
---|
2984 | 3406 | break; |
---|
2985 | 3407 | } |
---|
2986 | 3408 | } |
---|
2987 | 3409 | |
---|
2988 | | - if (!hasRoot) |
---|
| 3410 | + if (canUngroup) |
---|
2989 | 3411 | { |
---|
2990 | 3412 | for (int i=0; i<group.selection.size(); i++) |
---|
2991 | 3413 | { |
---|
2992 | | - Ungroup(group.selection.get(i)); |
---|
| 3414 | + Object3D selectedItem = group.selection.get(i); |
---|
| 3415 | + |
---|
| 3416 | + Ungroup(selectedItem); |
---|
2993 | 3417 | } |
---|
2994 | 3418 | |
---|
2995 | 3419 | ClearSelection(false); |
---|
.. | .. |
---|
3040 | 3464 | if (source == clearMaterialsItem) |
---|
3041 | 3465 | { |
---|
3042 | 3466 | ClearMaterials(); |
---|
| 3467 | + } else |
---|
| 3468 | + if (source == clearVersionsItem) |
---|
| 3469 | + { |
---|
| 3470 | + ClearVersions(); |
---|
3043 | 3471 | } else |
---|
3044 | 3472 | if (source == liveleavesItem) |
---|
3045 | 3473 | { |
---|
.. | .. |
---|
3180 | 3608 | if (source == transformChildrenItem) |
---|
3181 | 3609 | { |
---|
3182 | 3610 | TransformChildren(); |
---|
| 3611 | + } else |
---|
| 3612 | + if (source == textureRatioRItem) |
---|
| 3613 | + { |
---|
| 3614 | + TextureRatio(0); |
---|
| 3615 | + } else |
---|
| 3616 | + if (source == textureRatioGItem) |
---|
| 3617 | + { |
---|
| 3618 | + TextureRatio(1); |
---|
| 3619 | + } else |
---|
| 3620 | + if (source == textureRatioBItem) |
---|
| 3621 | + { |
---|
| 3622 | + TextureRatio(2); |
---|
3183 | 3623 | } else |
---|
3184 | 3624 | if (source == resetTransformItem) |
---|
3185 | 3625 | { |
---|
.. | .. |
---|
3352 | 3792 | if (CameraPane.FULLSCREEN) |
---|
3353 | 3793 | fullscreenLayout = radio.layout; |
---|
3354 | 3794 | |
---|
3355 | | - // bug |
---|
3356 | | - //gridPanel.setDividerLocation(1.0); |
---|
3357 | | - //bigPanel.setDividerLocation(0.0); |
---|
3358 | | -// bigThree.remove(scenePanel); |
---|
3359 | | -// bigThree.remove(centralPanel); |
---|
3360 | | -// bigThree.remove(XYZPanel); |
---|
3361 | | -// aWindowConstraints.gridx = 0; |
---|
3362 | | -// aWindowConstraints.gridy = 0; |
---|
3363 | | -// aWindowConstraints.gridwidth = 1; |
---|
3364 | | -// // aConstraints.gridheight = 3; |
---|
3365 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3366 | | -// aWindowConstraints.weightx = 0; |
---|
3367 | | -// aWindowConstraints.weighty = 1; |
---|
3368 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3369 | | -// aWindowConstraints.weightx = 1; |
---|
3370 | | -// aWindowConstraints.gridwidth = 3; |
---|
3371 | | -// // aConstraints.gridheight = 3; |
---|
3372 | | -// aWindowConstraints.gridx = 1; |
---|
3373 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3374 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3375 | | -// aWindowConstraints.weightx = 0; |
---|
3376 | | -// aWindowConstraints.gridx = 4; |
---|
3377 | | -// aWindowConstraints.gridwidth = 1; |
---|
3378 | | -// // aConstraints.gridheight = 3; |
---|
3379 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3380 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3381 | | -// scenePanel.setVisible(false); |
---|
3382 | | -// centralPanel.setVisible(true); |
---|
3383 | | -// XYZPanel.setVisible(false); |
---|
3384 | | - bigThree.ClearUI(); |
---|
3385 | | - bigThree.add(centralPanel); |
---|
3386 | | - bigThree.FlushUI(); |
---|
| 3795 | + Show3DView(); |
---|
3387 | 3796 | |
---|
3388 | 3797 | cameraView.requestFocusInWindow(); |
---|
3389 | 3798 | |
---|
.. | .. |
---|
3569 | 3978 | } else |
---|
3570 | 3979 | if (source == rootButton) |
---|
3571 | 3980 | { |
---|
| 3981 | + Replace(); |
---|
3572 | 3982 | Object3D obj; |
---|
3573 | 3983 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3574 | 3984 | { |
---|
.. | .. |
---|
3583 | 3993 | if (source == closeButton) |
---|
3584 | 3994 | { |
---|
3585 | 3995 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
| 3996 | + if (copy.versionlist != null) |
---|
| 3997 | + Replace(); |
---|
| 3998 | + |
---|
3586 | 3999 | cRadio ab; |
---|
3587 | 4000 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
3588 | 4001 | { |
---|
.. | .. |
---|
3626 | 4039 | { |
---|
3627 | 4040 | Object3D child = (Object3D)e.nextElement(); |
---|
3628 | 4041 | if(child.editWindow != null) |
---|
3629 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3630 | 4042 | child.pinned = false; |
---|
3631 | 4043 | child.CloseUI(); |
---|
3632 | 4044 | listUI.remove(child); |
---|
| 4045 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3633 | 4046 | |
---|
3634 | 4047 | //child.editWindow = null; // ??????????? |
---|
3635 | 4048 | } |
---|
.. | .. |
---|
3648 | 4061 | obj.CloseUI(); |
---|
3649 | 4062 | } |
---|
3650 | 4063 | listUI.clear(); |
---|
| 4064 | + SetPinStates(group.selection.size() > 0); |
---|
3651 | 4065 | refreshContents(true); |
---|
3652 | 4066 | } else |
---|
3653 | 4067 | if (source == allParamsButton) |
---|
.. | .. |
---|
3680 | 4094 | } else |
---|
3681 | 4095 | if(source instanceof cRadio) |
---|
3682 | 4096 | { |
---|
| 4097 | + if (copy.versionlist != null) |
---|
| 4098 | + Replace(); |
---|
| 4099 | + |
---|
3683 | 4100 | group.parent = keepparent; |
---|
3684 | 4101 | group.attributes = 0; |
---|
3685 | 4102 | //group.editWindow = null; |
---|
.. | .. |
---|
3704 | 4121 | |
---|
3705 | 4122 | copy = group; |
---|
3706 | 4123 | |
---|
3707 | | - SetUndoStates(); |
---|
3708 | | - |
---|
3709 | 4124 | //Globals.theRenderer.object = group; |
---|
3710 | 4125 | if(!useclient) |
---|
3711 | 4126 | { |
---|
.. | .. |
---|
3733 | 4148 | */ |
---|
3734 | 4149 | radio.layout.doClick(); |
---|
3735 | 4150 | |
---|
| 4151 | + //assert(copy instanceof Composite); |
---|
| 4152 | + |
---|
| 4153 | + if (copy.versionlist == null) |
---|
| 4154 | + { |
---|
| 4155 | + copy.versionindex = -1; |
---|
| 4156 | + |
---|
| 4157 | + // Cannot work with loops |
---|
| 4158 | + // To fix this issue, we first mark all nodes above the root, |
---|
| 4159 | + // and check if any of these nodes are reachable below the root. |
---|
| 4160 | + Grafreed.grafreed.universe.TagObjects(copy, true); |
---|
| 4161 | + |
---|
| 4162 | + if (copy instanceof Composite && !copy.HasTags()) |
---|
| 4163 | + { |
---|
| 4164 | + if (copy.versionlist == null) |
---|
| 4165 | + copy.versionlist = new Object3D[100]; |
---|
| 4166 | + |
---|
| 4167 | + //Save(true); |
---|
| 4168 | + } |
---|
| 4169 | + else |
---|
| 4170 | + copy.versionindex = -2; |
---|
| 4171 | + |
---|
| 4172 | + Grafreed.grafreed.universe.TagObjects(copy, false); |
---|
| 4173 | + } |
---|
| 4174 | + |
---|
| 4175 | + SetVersionStates(); |
---|
| 4176 | + |
---|
3736 | 4177 | ClearUnpinned(); |
---|
| 4178 | + |
---|
3737 | 4179 | //Grafreed.Assert(group != null); |
---|
3738 | 4180 | //Grafreed.Assert(group.selection != null); |
---|
3739 | 4181 | SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
.. | .. |
---|
3750 | 4192 | } else if (event.getSource() == editCameraItem) |
---|
3751 | 4193 | { |
---|
3752 | 4194 | cameraView.ProtectCamera(); |
---|
| 4195 | + cameraView.requestFocusInWindow(); |
---|
3753 | 4196 | cameraView.repaint(); |
---|
3754 | 4197 | return; |
---|
3755 | 4198 | } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3756 | 4199 | { |
---|
3757 | 4200 | cameraView.RevertCamera(); |
---|
| 4201 | + cameraView.requestFocusInWindow(); |
---|
3758 | 4202 | cameraView.repaint(); |
---|
3759 | 4203 | return; |
---|
3760 | 4204 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
3843 | 4287 | refreshContents(); |
---|
3844 | 4288 | } |
---|
3845 | 4289 | |
---|
| 4290 | + void TextureRatio(int axis) |
---|
| 4291 | + { |
---|
| 4292 | + Object3D obj; |
---|
| 4293 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4294 | + { |
---|
| 4295 | + obj = (Object3D)e.nextElement(); |
---|
| 4296 | + obj.TextureRatio(axis); |
---|
| 4297 | + } |
---|
| 4298 | + |
---|
| 4299 | + refreshContents(); |
---|
| 4300 | + } |
---|
| 4301 | + |
---|
3846 | 4302 | void ResetTransform() |
---|
3847 | 4303 | { |
---|
3848 | 4304 | ResetTransform(-1); |
---|
.. | .. |
---|
3858 | 4314 | if (obj.toParent == null) |
---|
3859 | 4315 | continue; |
---|
3860 | 4316 | |
---|
3861 | | - if (mask == -1) |
---|
3862 | | - { |
---|
3863 | | - if (obj instanceof Camera) // jan 2014 |
---|
3864 | | - { |
---|
3865 | | - LA.matIdentity(obj.toParent); |
---|
3866 | | - LA.matIdentity(obj.fromParent); |
---|
3867 | | - } |
---|
3868 | | - else |
---|
3869 | | - { |
---|
3870 | | - obj.toParent = null; // jan 2014 LA.matIdentity(obj.toParent); |
---|
3871 | | - obj.fromParent = null; // LA.matIdentity(obj.fromParent); |
---|
3872 | | - } |
---|
3873 | | - TouchTransform(obj); |
---|
3874 | | - continue; |
---|
3875 | | - } |
---|
3876 | | - if ((mask&2) != 0) // Scale |
---|
3877 | | - { |
---|
3878 | | - obj.toParent[0][0] = obj.toParent[1][1] = obj.toParent[2][2] = 1; |
---|
3879 | | - obj.toParent[0][1] = obj.toParent[1][0] = obj.toParent[2][0] = 0; |
---|
3880 | | - obj.toParent[0][2] = obj.toParent[1][2] = obj.toParent[2][1] = 0; |
---|
3881 | | - obj.fromParent[0][0] = obj.fromParent[1][1] = obj.fromParent[2][2] = 1; |
---|
3882 | | - obj.fromParent[0][1] = obj.fromParent[1][0] = obj.fromParent[2][0] = 0; |
---|
3883 | | - obj.fromParent[0][2] = obj.fromParent[1][2] = obj.fromParent[2][1] = 0; |
---|
3884 | | - } |
---|
3885 | | - if ((mask&4) != 0) // Rotation |
---|
3886 | | - { |
---|
3887 | | - // ? |
---|
3888 | | - } |
---|
3889 | | - if ((mask&1) != 0) // Translation |
---|
3890 | | - { |
---|
3891 | | - if (obj.toParent != null) |
---|
3892 | | - { |
---|
3893 | | - obj.toParent[3][0] = obj.toParent[3][1] = obj.toParent[3][2] = 0; |
---|
3894 | | - obj.fromParent[3][0] = obj.fromParent[3][1] = obj.fromParent[3][2] = 0; |
---|
3895 | | - } |
---|
3896 | | - } |
---|
| 4317 | + obj.ResetTransform(mask); |
---|
| 4318 | + |
---|
3897 | 4319 | if (obj.parent == null) |
---|
3898 | 4320 | { |
---|
3899 | 4321 | System.out.println("NULL PARENT!"); |
---|
.. | .. |
---|
4402 | 4824 | { |
---|
4403 | 4825 | Object3D obj = group.selection.get(i); |
---|
4404 | 4826 | |
---|
| 4827 | + if (obj.toParent == null) |
---|
| 4828 | + { |
---|
| 4829 | + obj.toParent = LA.newMatrix(); |
---|
| 4830 | + obj.fromParent = LA.newMatrix(); |
---|
| 4831 | + } |
---|
| 4832 | + |
---|
4405 | 4833 | LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
4406 | 4834 | LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
4407 | 4835 | } |
---|
.. | .. |
---|
4693 | 5121 | refreshContents(); |
---|
4694 | 5122 | } |
---|
4695 | 5123 | |
---|
| 5124 | + void ClearVersions() |
---|
| 5125 | + { |
---|
| 5126 | + group.selection.ClearVersions(); |
---|
| 5127 | + refreshContents(); |
---|
| 5128 | + } |
---|
| 5129 | + |
---|
4696 | 5130 | void FlipV(boolean flip) |
---|
4697 | 5131 | { |
---|
4698 | 5132 | group.selection.FlipV(flip); |
---|
.. | .. |
---|
4887 | 5321 | |
---|
4888 | 5322 | freezemodel = false; |
---|
4889 | 5323 | } |
---|
4890 | | - |
---|
4891 | | - boolean flashIt = true; |
---|
4892 | | - |
---|
| 5324 | + |
---|
4893 | 5325 | public void valueChanged(TreeSelectionEvent e) |
---|
4894 | 5326 | //public boolean handleEvent(Event event) |
---|
4895 | 5327 | { |
---|
.. | .. |
---|
4933 | 5365 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4934 | 5366 | // a camera |
---|
4935 | 5367 | { |
---|
4936 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5368 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crashes the camera because of invalid lightspace |
---|
4937 | 5369 | { |
---|
4938 | 5370 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4939 | 5371 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4962 | 5394 | { |
---|
4963 | 5395 | editButton.setEnabled(enabled); |
---|
4964 | 5396 | uneditButton.setEnabled(enabled); |
---|
4965 | | - unselectButton.setEnabled(enabled); |
---|
| 5397 | + //unselectButton.setEnabled(enabled); |
---|
4966 | 5398 | flashSelectionButton.setEnabled(enabled); |
---|
| 5399 | + |
---|
| 5400 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5401 | + |
---|
| 5402 | + boolean allComposites = true; |
---|
| 5403 | + |
---|
| 5404 | + if (group.selection != null) |
---|
| 5405 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5406 | + { |
---|
| 5407 | + Object next = e.nextElement(); |
---|
| 5408 | + if (!(next instanceof Composite)) // || (next instanceof GroupLeaf)) |
---|
| 5409 | + { |
---|
| 5410 | + allComposites = false; |
---|
| 5411 | + break; |
---|
| 5412 | + } |
---|
| 5413 | + } |
---|
| 5414 | + |
---|
| 5415 | + rootButton.setEnabled(true); // allComposites); |
---|
4967 | 5416 | } |
---|
4968 | 5417 | |
---|
4969 | 5418 | void refreshContents(boolean cp) |
---|
4970 | 5419 | { |
---|
4971 | | - if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5420 | + if (Globals.SHOWINFO) |
---|
| 5421 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
4972 | 5422 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4973 | 5423 | { |
---|
4974 | 5424 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
4978 | 5428 | Object3D child = (Object3D) group.selection.get(i); |
---|
4979 | 5429 | |
---|
4980 | 5430 | objEditor.AddInfo(child, this, true); |
---|
4981 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5431 | +// System.err.println("info : " + child.GetPath()); |
---|
4982 | 5432 | } |
---|
4983 | 5433 | |
---|
4984 | 5434 | objEditor.SetText(); // jan 2014 |
---|
.. | .. |
---|
5804 | 6254 | |
---|
5805 | 6255 | cButton restoreCameraButton; |
---|
5806 | 6256 | |
---|
5807 | | - cButton saveButton; |
---|
5808 | 6257 | cButton oneStepButton; |
---|
5809 | 6258 | |
---|
5810 | 6259 | cButton groupButton; |
---|
.. | .. |
---|
5862 | 6311 | private MenuItem lookAtItem; |
---|
5863 | 6312 | private MenuItem lookFromItem; |
---|
5864 | 6313 | private MenuItem switchViewItem; |
---|
5865 | | - private MenuItem cutItem; |
---|
| 6314 | + private JMenuItem cutItem; |
---|
5866 | 6315 | private MenuItem undoItem; |
---|
5867 | 6316 | private MenuItem redoItem; |
---|
5868 | 6317 | private JMenuItem duplicateItem; |
---|
5869 | | - private MenuItem cloneItem; |
---|
| 6318 | + private JMenuItem cloneItem; |
---|
5870 | 6319 | private MenuItem cloneSupportItem; |
---|
5871 | 6320 | private MenuItem overwriteGeoItem; |
---|
5872 | 6321 | private MenuItem overwriteMatItem; |
---|
.. | .. |
---|
5887 | 6336 | private MenuItem cloneGeometriesItem; |
---|
5888 | 6337 | private MenuItem shareGeometriesItem; |
---|
5889 | 6338 | private MenuItem mergeGeometriesItem; |
---|
5890 | | - private MenuItem copyItem; |
---|
| 6339 | + private JMenuItem copyItem; |
---|
5891 | 6340 | private MenuItem pasteItem; |
---|
5892 | | - private MenuItem pasteIntoItem; |
---|
5893 | | - private MenuItem pasteLinkItem; |
---|
5894 | | - private MenuItem pasteCloneItem; |
---|
5895 | | - private MenuItem pasteExpandItem; |
---|
5896 | | - private MenuItem deleteItem; |
---|
| 6341 | + private JMenuItem pasteIntoItem; |
---|
| 6342 | + private JMenuItem pasteLinkItem; |
---|
| 6343 | + private JMenuItem pasteCloneItem; |
---|
| 6344 | + private JMenuItem pasteExpandItem; |
---|
| 6345 | + private JMenuItem deleteItem; |
---|
5897 | 6346 | private MenuItem clearAllItem; |
---|
5898 | 6347 | private MenuItem genUVItem; |
---|
5899 | 6348 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5919 | 6368 | private MenuItem clipMeshItem; |
---|
5920 | 6369 | private MenuItem smoothMeshItem; |
---|
5921 | 6370 | private MenuItem clearMaterialsItem; |
---|
| 6371 | + private MenuItem clearVersionsItem; |
---|
5922 | 6372 | |
---|
5923 | 6373 | private MenuItem liveleavesItem; |
---|
5924 | 6374 | private MenuItem unliveleavesItem; |
---|
.. | .. |
---|
5942 | 6392 | private MenuItem maxTexturesItem; |
---|
5943 | 6393 | private MenuItem panoTexturesItem; |
---|
5944 | 6394 | |
---|
| 6395 | + private MenuItem textureRatioRItem; |
---|
| 6396 | + private MenuItem textureRatioGItem; |
---|
| 6397 | + private MenuItem textureRatioBItem; |
---|
5945 | 6398 | private MenuItem resetCentroidItem; |
---|
5946 | 6399 | private MenuItem resetCentroidXZItem; |
---|
5947 | 6400 | private MenuItem resetTransformItem; |
---|
5948 | 6401 | private MenuItem transformGeometryItem; |
---|
5949 | 6402 | private MenuItem transformChildrenItem; |
---|
5950 | 6403 | private MenuItem hideItem; |
---|
5951 | | - private MenuItem grabItem; |
---|
| 6404 | + private JMenuItem grabItem; |
---|
5952 | 6405 | private MenuItem backItem; |
---|
5953 | 6406 | private MenuItem frontItem; |
---|
5954 | 6407 | private MenuItem cameraItem; |
---|
.. | .. |
---|
5961 | 6414 | private MenuItem switchTransfoItem; |
---|
5962 | 6415 | private MenuItem morphItem; |
---|
5963 | 6416 | private MenuItem linkerItem; |
---|
5964 | | - private MenuItem ungroupItem; |
---|
| 6417 | + private JMenuItem ungroupItem; |
---|
5965 | 6418 | private MenuItem editItem; |
---|
5966 | 6419 | private MenuItem openWindowItem; |
---|
5967 | 6420 | private MenuItem editLeafItem; |
---|