.. | .. |
---|
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", !Grafreed.NIMBUSLAF)); |
---|
| 33 | + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 34 | + skyboxButton.setToolTipText(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, !Grafreed.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", "rgb", 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 | + //cameraView.envyoff = false; |
---|
| 334 | + group.skyboxname = skybox; |
---|
| 335 | + group.skyboxext = "jpg"; |
---|
| 336 | + cameraView.repaint(); |
---|
| 337 | + } |
---|
| 338 | + |
---|
| 339 | + public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
| 340 | + { |
---|
| 341 | + JTabbedPane skyboxpane = new JTabbedPane(); |
---|
| 342 | + |
---|
| 343 | + AddSkyboxTab0(skyboxpane); |
---|
| 344 | + AddSkyboxTab1(skyboxpane); |
---|
| 345 | + AddSkyboxTab2(skyboxpane); |
---|
| 346 | + AddSkyboxTab3(skyboxpane); |
---|
| 347 | + |
---|
| 348 | + skyboxPanel.add(skyboxpane); |
---|
| 349 | + } |
---|
| 350 | + |
---|
| 351 | + public void ChangeTexture(String texture) |
---|
| 352 | + { |
---|
| 353 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 354 | + { |
---|
| 355 | + Object3D obj = group.selection.get(i); |
---|
| 356 | + obj.SetPigmentTexture("@" + texture); |
---|
| 357 | + } |
---|
| 358 | + |
---|
| 359 | + refreshContents(); |
---|
| 360 | + } |
---|
| 361 | + |
---|
26 | 362 | //ObjEditor objEditor; |
---|
27 | 363 | public void closeUI2() |
---|
28 | 364 | { |
---|
.. | .. |
---|
60 | 396 | this.copy = this.group = group; |
---|
61 | 397 | //selectees = this.group.selectees; |
---|
62 | 398 | |
---|
| 399 | + if (copy.versionlist == null) |
---|
| 400 | + { |
---|
| 401 | + copy.versionlist = new Object3D[100]; |
---|
| 402 | + copy.versionindex = -1; |
---|
| 403 | + } |
---|
| 404 | + |
---|
63 | 405 | if(ui) |
---|
64 | 406 | SetupUI(objEditor); |
---|
65 | 407 | } |
---|
.. | .. |
---|
80 | 422 | SetupViews(objEditor); |
---|
81 | 423 | |
---|
82 | 424 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 425 | + |
---|
| 426 | + if (copy.versionlist == null) |
---|
| 427 | + { |
---|
| 428 | + copy.versionlist = new Object3D[100]; |
---|
| 429 | + copy.versionindex = -1; |
---|
| 430 | + |
---|
| 431 | + Save(true); |
---|
| 432 | + } |
---|
83 | 433 | } |
---|
84 | 434 | |
---|
85 | 435 | void CloneSelection(boolean supports) |
---|
86 | 436 | { |
---|
| 437 | + if (Globals.REPLACEONMAKE) |
---|
| 438 | + Save(); |
---|
| 439 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 440 | + Globals.REPLACEONMAKE = false; |
---|
87 | 441 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 442 | //Object3D obj; |
---|
89 | 443 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 448 | |
---|
95 | 449 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 450 | } |
---|
| 451 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 452 | } |
---|
98 | 453 | |
---|
99 | 454 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
150 | 505 | |
---|
151 | 506 | void SetupMenu2(GroupEditor oe) |
---|
152 | 507 | { |
---|
| 508 | + oe.jTree = new cTree(); |
---|
| 509 | + |
---|
153 | 510 | Menu menu; |
---|
154 | 511 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 512 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
160 | 517 | // redoItem = menu.add(new MenuItem("Redo")); |
---|
161 | 518 | // redoItem.addActionListener(this); |
---|
162 | 519 | // menu.add("-"); |
---|
163 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 520 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
164 | 521 | duplicateItem.addActionListener(this); |
---|
165 | 522 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
166 | 523 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
187 | 544 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
188 | 545 | // pasteExpandItem.addActionListener(this); |
---|
189 | 546 | menu.add("-"); |
---|
190 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
191 | | - clearItem.addActionListener(this); |
---|
| 547 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 548 | + deleteItem.addActionListener(this); |
---|
192 | 549 | |
---|
193 | 550 | if (Globals.ADVANCED) |
---|
194 | 551 | { |
---|
.. | .. |
---|
202 | 559 | //zBufferItem.addActionListener(this); |
---|
203 | 560 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 561 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
206 | | - revertCameraItem.addActionListener(this); |
---|
| 562 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 563 | + restoreCameraItem.addActionListener(this); |
---|
207 | 564 | |
---|
208 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
209 | | - toggleFullScreenItem.addItemListener(this); |
---|
210 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
211 | | - cameraMenu.add("-"); |
---|
| 565 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 566 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 567 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 568 | +// cameraMenu.add("-"); |
---|
| 569 | +// |
---|
| 570 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 571 | +// toggleTextureItem.addItemListener(this); |
---|
| 572 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 573 | +// |
---|
| 574 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 575 | +// toggleSwitchItem.addItemListener(this); |
---|
| 576 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
212 | 577 | |
---|
213 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
214 | | - toggleTextureItem.addItemListener(this); |
---|
215 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
216 | | - |
---|
217 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
218 | | - toggleSwitchItem.addItemListener(this); |
---|
219 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
220 | | - |
---|
221 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 578 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
222 | 579 | toggleHandleItem.addItemListener(this); |
---|
223 | 580 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
224 | 581 | |
---|
.. | .. |
---|
273 | 630 | { |
---|
274 | 631 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
275 | 632 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
276 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 633 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
277 | 634 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
278 | 635 | oe.cameraMenu.add("-"); |
---|
279 | 636 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
281 | 638 | editLeafItem.addActionListener(this); |
---|
282 | 639 | lookAtItem.addActionListener(this); |
---|
283 | 640 | //lookFromItem.addActinoListener(this); |
---|
284 | | - //switchItem.addActionListener(this); |
---|
| 641 | + //switchViewItem.addActionListener(this); |
---|
285 | 642 | } |
---|
286 | 643 | |
---|
287 | 644 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
326 | 683 | } |
---|
327 | 684 | |
---|
328 | 685 | oe.menuBar.add(menu = new Menu("Group")); |
---|
329 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
330 | | - grabItem.addActionListener(this); |
---|
| 686 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 687 | +// grabItem.addActionListener(this); |
---|
331 | 688 | backItem = menu.add(new MenuItem("Back")); |
---|
332 | 689 | backItem.addActionListener(this); |
---|
333 | 690 | frontItem = menu.add(new MenuItem("Front")); |
---|
334 | 691 | frontItem.addActionListener(this); |
---|
335 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | | - compositeItem.addActionListener(this); |
---|
| 692 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 693 | +// compositeItem.addActionListener(this); |
---|
| 694 | + |
---|
| 695 | + if (Globals.ADVANCED) |
---|
| 696 | + { |
---|
337 | 697 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 698 | hideItem.addActionListener(this); |
---|
| 699 | + } |
---|
339 | 700 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 701 | ungroupItem.addActionListener(this); |
---|
341 | | - menu.add("-"); |
---|
342 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | | - randomItem.addActionListener(this); |
---|
| 702 | + |
---|
| 703 | +// menu.add("-"); |
---|
| 704 | +// |
---|
| 705 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 706 | +// switchItem.addActionListener(this); |
---|
| 707 | + if (Globals.ADVANCED) |
---|
| 708 | + { |
---|
344 | 709 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 710 | switchGeoItem.addActionListener(this); |
---|
346 | 711 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 713 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 714 | morphItem.addActionListener(this); |
---|
350 | 715 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 716 | menu.add("-"); |
---|
354 | 717 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 718 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
357 | 720 | frameselectorItem.addActionListener(this); |
---|
358 | 721 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
359 | 722 | scriptNodeItem.addActionListener(this); |
---|
360 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
361 | | - cameraItem.addActionListener(this); |
---|
362 | 723 | } |
---|
363 | 724 | |
---|
364 | 725 | oe.menuBar.add(menu = new Menu("Object")); |
---|
365 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
366 | | - textureItem.addActionListener(this); |
---|
| 726 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 727 | +// textureItem.addActionListener(this); |
---|
367 | 728 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
368 | 729 | billboardItem.addActionListener(this); |
---|
369 | 730 | csgItem = menu.add(new MenuItem("CSG")); |
---|
.. | .. |
---|
374 | 735 | shadowYItem.addActionListener(this); |
---|
375 | 736 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 737 | shadowZItem.addActionListener(this); |
---|
| 738 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 739 | + attributeItem.addActionListener(this); |
---|
| 740 | + |
---|
377 | 741 | if (Globals.ADVANCED) |
---|
378 | 742 | { |
---|
379 | 743 | menu.add("-"); |
---|
380 | 744 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
381 | 745 | linkerItem.addActionListener(this); |
---|
382 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
383 | | - attributeItem.addActionListener(this); |
---|
384 | 746 | templateItem = menu.add(new MenuItem("Template")); |
---|
385 | 747 | templateItem.addActionListener(this); |
---|
386 | 748 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
409 | 771 | genNormalsMESHItem.addActionListener(this); |
---|
410 | 772 | if (Globals.ADVANCED) |
---|
411 | 773 | { |
---|
412 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 774 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
413 | 775 | genNormalsMINEItem.addActionListener(this); |
---|
414 | 776 | } |
---|
415 | 777 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
502 | 864 | attachBumpItem.addActionListener(this); |
---|
503 | 865 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
504 | 866 | pigmentBumpItem.addActionListener(this); |
---|
| 867 | + //embedTexturesItem |
---|
505 | 868 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
506 | 869 | detachPigmentItem.addActionListener(this); |
---|
507 | 870 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
508 | 871 | detachBumpItem.addActionListener(this); |
---|
| 872 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 873 | + embedTexturesItem.addActionListener(this); |
---|
| 874 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 875 | + deEmbedTexturesItem.addActionListener(this); |
---|
509 | 876 | menu.add("-"); |
---|
510 | 877 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
511 | 878 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
532 | 899 | buildToolsMenu(menu); |
---|
533 | 900 | } |
---|
534 | 901 | |
---|
| 902 | + JTabbedPane resourcecontainer; |
---|
| 903 | + cGridBag currenttab; |
---|
| 904 | + boolean added; // patch for jar |
---|
| 905 | + |
---|
| 906 | + int tabcount = 0; |
---|
| 907 | + int colcount = 0; |
---|
| 908 | + int rowcount = 0; |
---|
| 909 | + int texturecount = 0; |
---|
| 910 | + |
---|
| 911 | + int columns = 5; |
---|
| 912 | + int rows = 7; |
---|
| 913 | + |
---|
| 914 | + public void ResourceCallBack(String[] path) |
---|
| 915 | + { |
---|
| 916 | +// for (int i = 0; i < path.length; i++) |
---|
| 917 | +// System.out.print(path[i] + "/"); |
---|
| 918 | +// System.out.println(); |
---|
| 919 | + |
---|
| 920 | + if (//rowcount == 0 || |
---|
| 921 | + path.length == 1) |
---|
| 922 | + { |
---|
| 923 | + currenttab = new cGridBag(); |
---|
| 924 | + added = false; |
---|
| 925 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 926 | + currenttab.setName(tabname); |
---|
| 927 | + rowcount = 1; |
---|
| 928 | + colcount = 0; |
---|
| 929 | + texturecount = 0; |
---|
| 930 | + } |
---|
| 931 | + |
---|
| 932 | + if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 933 | + { |
---|
| 934 | + if (!added) |
---|
| 935 | + { |
---|
| 936 | + added = true; |
---|
| 937 | + resourcecontainer.add(currenttab); |
---|
| 938 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 939 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 940 | + } |
---|
| 941 | + |
---|
| 942 | + AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 943 | + |
---|
| 944 | + if (++colcount >= columns) |
---|
| 945 | + { |
---|
| 946 | + colcount = 0; |
---|
| 947 | + currenttab.Return(); |
---|
| 948 | + |
---|
| 949 | + if (rowcount++ >= rows) |
---|
| 950 | + { |
---|
| 951 | + rowcount = 0; |
---|
| 952 | + } |
---|
| 953 | + } |
---|
| 954 | + } |
---|
| 955 | + else |
---|
| 956 | + { |
---|
| 957 | +// if (!path[path.length-1].equals("icons")) |
---|
| 958 | +// resourcecontainer.Return(); |
---|
| 959 | + } |
---|
| 960 | + } |
---|
| 961 | + |
---|
| 962 | + void CreateTexturePanel(cGridBag container) |
---|
| 963 | + { |
---|
| 964 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 965 | + container.add(resourcecontainer); |
---|
| 966 | + |
---|
| 967 | + Grafreed.ParseResources("textures", this); |
---|
| 968 | + } |
---|
| 969 | + |
---|
535 | 970 | void SetupUI2(ObjEditor oe) |
---|
536 | 971 | { |
---|
537 | 972 | // June 2019 |
---|
.. | .. |
---|
574 | 1009 | oe.radioPanel.add(dummyButton); |
---|
575 | 1010 | oe.buttonGroup.add(dummyButton); |
---|
576 | 1011 | */ |
---|
| 1012 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1013 | + |
---|
| 1014 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 1015 | + |
---|
577 | 1016 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
578 | 1017 | |
---|
579 | 1018 | //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
580 | 1019 | //minButton.setToolTipText("Minimize window"); |
---|
581 | 1020 | //minButton.addActionListener(this); |
---|
582 | 1021 | |
---|
583 | | - oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
584 | | - maxButton.setToolTipText("Maximize window"); |
---|
585 | | - maxButton.addActionListener(this); |
---|
| 1022 | + if (Globals.ADVANCED) |
---|
| 1023 | + { |
---|
| 1024 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1025 | + maxButton.setToolTipText("Maximize window"); |
---|
| 1026 | + maxButton.addActionListener(this); |
---|
| 1027 | + } |
---|
586 | 1028 | |
---|
587 | | - oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1029 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
588 | 1030 | fullButton.setToolTipText("Full-screen window"); |
---|
589 | 1031 | fullButton.addActionListener(this); |
---|
590 | 1032 | |
---|
591 | | - oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
592 | | - undoButton.setToolTipText("Undo changes"); |
---|
593 | | - undoButton.addActionListener(this); |
---|
| 1033 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1034 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 1035 | + screenfitButton.addActionListener(this); |
---|
| 1036 | + |
---|
| 1037 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1038 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 1039 | + restoreCameraButton.addActionListener(this); |
---|
594 | 1040 | |
---|
595 | | - oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | | - redoButton.setToolTipText("Redo changes"); |
---|
597 | | - redoButton.addActionListener(this); |
---|
| 1041 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1042 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 1043 | + saveVersionButton.addActionListener(this); |
---|
| 1044 | + |
---|
| 1045 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1046 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 1047 | + deleteVersionButton.addActionListener(this); |
---|
| 1048 | + |
---|
| 1049 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1050 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 1051 | + previousVersionButton.addActionListener(this); |
---|
| 1052 | + previousVersionButton.setEnabled(false); |
---|
598 | 1053 | |
---|
599 | | - oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | | - saveButton.setToolTipText("Save changes"); |
---|
601 | | - saveButton.addActionListener(this); |
---|
| 1054 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 1055 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1056 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
| 1057 | + restoreButton.addActionListener(this); |
---|
| 1058 | + //restoreButton.setEnabled(false); |
---|
602 | 1059 | |
---|
603 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 1060 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1061 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
| 1062 | + replaceButton.addActionListener(this); |
---|
| 1063 | + //replaceButton.setEnabled(false); |
---|
| 1064 | + |
---|
| 1065 | + copyOptionsPanel.add(updown); |
---|
| 1066 | + |
---|
| 1067 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 1069 | + nextVersionButton.addActionListener(this); |
---|
| 1070 | + nextVersionButton.setEnabled(false); |
---|
| 1071 | + |
---|
| 1072 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
604 | 1073 | liveCB.setToolTipText("Enable animation"); |
---|
605 | 1074 | liveCB.addItemListener(this); |
---|
606 | 1075 | |
---|
607 | | - oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1076 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
608 | 1077 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
609 | 1078 | oneStepButton.addActionListener(this); |
---|
610 | 1079 | |
---|
611 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 1080 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
612 | 1081 | fastCB.setToolTipText("Fast mode"); |
---|
613 | 1082 | fastCB.addItemListener(this); |
---|
614 | 1083 | |
---|
615 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints); |
---|
616 | | - trackCB.setToolTipText("Enable tracking"); |
---|
617 | | - trackCB.addItemListener(this); |
---|
618 | | - |
---|
619 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
620 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
621 | | - screenfitButton.addActionListener(this); |
---|
| 1084 | + //oe.toolboxPanel.Return(); |
---|
| 1085 | + |
---|
| 1086 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1087 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 1088 | +// trackCB.addItemListener(this); |
---|
622 | 1089 | |
---|
623 | 1090 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
624 | 1091 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
628 | 1095 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
629 | 1096 | snapobjectButton.addActionListener(this); |
---|
630 | 1097 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 1098 | + |
---|
| 1099 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1100 | + fourButton.addActionListener(this); |
---|
| 1101 | + fourButton.setToolTipText("Show control panel only"); |
---|
631 | 1102 | } |
---|
632 | 1103 | |
---|
633 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
635 | | - flashSelectionButton.addActionListener(this); |
---|
| 1104 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
636 | 1105 | |
---|
637 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
638 | | - |
---|
639 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
640 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 1106 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1107 | + twoButton.setToolTipText("Show 3D view only"); |
---|
641 | 1108 | twoButton.addActionListener(this); |
---|
642 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
643 | | - fourButton.addActionListener(this); |
---|
644 | | - fourButton.setToolTipText("Show left panel only"); |
---|
645 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
646 | | - sixButton.setToolTipText("2-column layout left"); |
---|
647 | | - sixButton.addActionListener(this); |
---|
648 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
649 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 1109 | + this.fullscreenLayout = twoButton; |
---|
| 1110 | + |
---|
| 1111 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1112 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
650 | 1113 | threeButton.addActionListener(this); |
---|
651 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
652 | | - sevenButton.setToolTipText("3-column layout"); |
---|
653 | | - sevenButton.addActionListener(this); |
---|
| 1114 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1115 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1116 | + sixButton.addActionListener(this); |
---|
| 1117 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1119 | +// sevenButton.addActionListener(this); |
---|
654 | 1120 | // |
---|
655 | 1121 | |
---|
656 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
657 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 1122 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1123 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
658 | 1124 | rootButton.addActionListener(this); |
---|
659 | 1125 | |
---|
660 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1126 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
661 | 1127 | closeButton.setToolTipText("Close tab"); |
---|
662 | 1128 | closeButton.addActionListener(this); |
---|
663 | 1129 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
664 | 1130 | //clearButton.addActionListener(this); |
---|
665 | | - |
---|
666 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
667 | | - editButton.setToolTipText("Edit selection"); |
---|
| 1131 | + |
---|
| 1132 | + cGridBag row1 = new cGridBag(); |
---|
| 1133 | + |
---|
| 1134 | + // INSERT |
---|
| 1135 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1136 | + gridButton.setToolTipText("Create grid"); |
---|
| 1137 | + gridButton.addActionListener(this); |
---|
| 1138 | + |
---|
| 1139 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1140 | + boxButton.setToolTipText("Create box"); |
---|
| 1141 | + boxButton.addActionListener(this); |
---|
| 1142 | + |
---|
| 1143 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1144 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1145 | + sphereButton.addActionListener(this); |
---|
| 1146 | + |
---|
| 1147 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1148 | + coneButton.setToolTipText("Create cone"); |
---|
| 1149 | + coneButton.addActionListener(this); |
---|
| 1150 | + |
---|
| 1151 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1152 | + torusButton.setToolTipText("Create torus"); |
---|
| 1153 | + torusButton.addActionListener(this); |
---|
| 1154 | + |
---|
| 1155 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1156 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1157 | + superButton.addActionListener(this); |
---|
| 1158 | + |
---|
| 1159 | + if (Globals.ADVANCED) |
---|
| 1160 | + { |
---|
| 1161 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1162 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 1163 | + kleinButton.addActionListener(this); |
---|
| 1164 | + } |
---|
| 1165 | + |
---|
| 1166 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1167 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 1168 | + particlesButton.addActionListener(this); |
---|
| 1169 | + |
---|
| 1170 | + oe.toolboxPanel.add(row1); |
---|
| 1171 | + |
---|
| 1172 | + cGridBag row2 = new cGridBag(); |
---|
| 1173 | + |
---|
| 1174 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1175 | + groupButton.setToolTipText("Create group"); |
---|
| 1176 | + groupButton.addActionListener(this); |
---|
| 1177 | + |
---|
| 1178 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1179 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1180 | + compositeButton.addActionListener(this); |
---|
| 1181 | + |
---|
| 1182 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1183 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1184 | + switchButton.addActionListener(this); |
---|
| 1185 | + |
---|
| 1186 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1187 | + loopButton.setToolTipText("Create loop"); |
---|
| 1188 | + loopButton.addActionListener(this); |
---|
| 1189 | + |
---|
| 1190 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1191 | + textureButton.setToolTipText("Create texture"); |
---|
| 1192 | + textureButton.addActionListener(this); |
---|
| 1193 | + |
---|
| 1194 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1195 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1196 | + overlayButton.addActionListener(this); |
---|
| 1197 | + |
---|
| 1198 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1199 | + lightButton.setToolTipText("Create light"); |
---|
| 1200 | + lightButton.addActionListener(this); |
---|
| 1201 | + |
---|
| 1202 | + oe.toolboxPanel.add(row2); |
---|
| 1203 | + |
---|
| 1204 | + cGridBag textures = new cGridBag(); |
---|
| 1205 | + |
---|
| 1206 | + CreateTexturePanel(textures); |
---|
| 1207 | + |
---|
| 1208 | + oe.toolboxPanel.add(textures); |
---|
| 1209 | + |
---|
| 1210 | + textures.preferredHeight = 100; |
---|
| 1211 | + |
---|
| 1212 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
| 1213 | + |
---|
| 1214 | + // EDIT panel |
---|
| 1215 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1216 | + editButton.setToolTipText("Pin selection controls"); |
---|
668 | 1217 | editButton.addActionListener(this); |
---|
669 | 1218 | |
---|
670 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
671 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 1219 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1220 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
672 | 1221 | uneditButton.addActionListener(this); |
---|
673 | 1222 | |
---|
674 | 1223 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
675 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 1224 | + allParamsButton.setToolTipText("Show all controls"); |
---|
676 | 1225 | allParamsButton.addActionListener(this); |
---|
677 | 1226 | |
---|
678 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
679 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1227 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1228 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
680 | 1229 | clearPanelButton.addActionListener(this); |
---|
681 | 1230 | |
---|
682 | | - editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
683 | | - unselectButton.setToolTipText("Unselect"); |
---|
684 | | - unselectButton.addActionListener(this); |
---|
| 1231 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1233 | + //unselectButton.addActionListener(this); |
---|
685 | 1234 | |
---|
| 1235 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1236 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1237 | + flashSelectionButton.addActionListener(this); |
---|
| 1238 | + |
---|
686 | 1239 | editCommandsPanel.preferredHeight = 1; |
---|
687 | 1240 | |
---|
| 1241 | + SetPinStates(false); |
---|
688 | 1242 | // oe.treePanel.add(commandsPanel); |
---|
689 | 1243 | // oe.treePanel.Return(); |
---|
690 | 1244 | |
---|
.. | .. |
---|
703 | 1257 | |
---|
704 | 1258 | JScrollPane jSP; |
---|
705 | 1259 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
706 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 1260 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
707 | 1261 | ResetModel(); |
---|
708 | 1262 | |
---|
709 | 1263 | oe.treePanel.add(jSPPanel); |
---|
710 | 1264 | oe.treePanel.Return(); |
---|
711 | 1265 | |
---|
712 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
713 | | - |
---|
714 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
715 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
716 | | - colorCB.addItemListener(this); |
---|
717 | | - |
---|
718 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
719 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
720 | | - materialCB.addItemListener(this); |
---|
721 | | - |
---|
722 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
723 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
724 | | - textureCB.addItemListener(this); |
---|
725 | | - |
---|
726 | | - copyOptionsPanel.preferredHeight = 1; |
---|
727 | 1266 | oe.treePanel.add(copyOptionsPanel); |
---|
728 | 1267 | oe.treePanel.Return(); |
---|
| 1268 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1269 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1270 | + sliderPane.preferredHeight = 1; |
---|
729 | 1271 | |
---|
730 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
731 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1272 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1273 | + mainPanel.setResizeWeight(0.4); |
---|
732 | 1274 | |
---|
733 | 1275 | //jList.addListSelectionListener(this); |
---|
734 | 1276 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
736 | 1278 | //jTree.setEditable(true); |
---|
737 | 1279 | oe.jTree.setDragEnabled(true); |
---|
738 | 1280 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
739 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1281 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
740 | 1282 | |
---|
741 | 1283 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
742 | 1284 | |
---|
.. | .. |
---|
748 | 1290 | dgr.addDragGestureListener(this); |
---|
749 | 1291 | }catch(Exception e) {} |
---|
750 | 1292 | */ |
---|
751 | | - radio.layout = sevenButton; |
---|
| 1293 | + radio.layout = threeButton; // sixButton; |
---|
752 | 1294 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
753 | 1295 | } |
---|
754 | 1296 | |
---|
755 | 1297 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
756 | 1298 | { |
---|
| 1299 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1300 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1301 | + colorCB.addItemListener(this); |
---|
| 1302 | + |
---|
| 1303 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1304 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1305 | + materialCB.addItemListener(this); |
---|
| 1306 | + |
---|
| 1307 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1308 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1309 | + textureCB.addItemListener(this); |
---|
| 1310 | + |
---|
| 1311 | + panel.Return(); |
---|
| 1312 | + |
---|
757 | 1313 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
758 | 1314 | boxCB.setToolTipText("Display bounding boxes"); |
---|
759 | 1315 | boxCB.addItemListener(this); |
---|
760 | 1316 | |
---|
761 | 1317 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
762 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1318 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
763 | 1319 | zoomBoxCB.addItemListener(this); |
---|
764 | 1320 | |
---|
765 | 1321 | if (true) // Globals.ADVANCED) |
---|
766 | 1322 | { |
---|
767 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
768 | | - supportCB.setToolTipText("Enable rigging"); |
---|
769 | | - supportCB.addItemListener(this); |
---|
| 1323 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1324 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1325 | +// supportCB.addItemListener(this); |
---|
| 1326 | + |
---|
| 1327 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1328 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1329 | + freezeCB.addItemListener(this); |
---|
770 | 1330 | |
---|
771 | 1331 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
772 | 1332 | // localCB.addItemListener(this); |
---|
773 | 1333 | |
---|
| 1334 | + panel.Return(); |
---|
| 1335 | + |
---|
774 | 1336 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
775 | 1337 | crowdCB.setToolTipText("Used for crowds"); |
---|
776 | 1338 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
779 | 1341 | smoothCB.setToolTipText("Snapping delay"); |
---|
780 | 1342 | smoothCB.addItemListener(this); |
---|
781 | 1343 | |
---|
782 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
783 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
784 | | - slowCB.addItemListener(this); |
---|
| 1344 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1345 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1346 | +// slowCB.addItemListener(this); |
---|
| 1347 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1348 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1349 | + minshaderCB.addItemListener(this); |
---|
785 | 1350 | |
---|
786 | 1351 | // constraints.gridy += 1; |
---|
787 | 1352 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
788 | 1353 | // speakerMocapCB.addItemListener(this); |
---|
789 | 1354 | |
---|
| 1355 | + panel.Return(); |
---|
| 1356 | + |
---|
790 | 1357 | if (false) |
---|
791 | 1358 | { |
---|
792 | 1359 | // handled in scripts |
---|
.. | .. |
---|
801 | 1368 | //constraints.gridy += 1; |
---|
802 | 1369 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
803 | 1370 | smoothfocusCB.addItemListener(this); |
---|
| 1371 | + panel.Return(); |
---|
804 | 1372 | } |
---|
805 | 1373 | |
---|
806 | 1374 | //constraints.gridx += 1; |
---|
807 | 1375 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
808 | 1376 | // debugCB.addItemListener(this); |
---|
809 | 1377 | |
---|
| 1378 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1379 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1380 | + trackCB.addItemListener(this); |
---|
| 1381 | + |
---|
810 | 1382 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
811 | | - oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 1383 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
812 | 1384 | oeilCB.addItemListener(this); |
---|
813 | 1385 | |
---|
814 | 1386 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
815 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 1387 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
816 | 1388 | shadowCB.addItemListener(this); |
---|
817 | 1389 | |
---|
| 1390 | + panel.Return(); |
---|
| 1391 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1392 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1393 | + toggleTextureCB.addItemListener(this); |
---|
| 1394 | + |
---|
| 1395 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1396 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1397 | + toggleSwitchCB.addItemListener(this); |
---|
| 1398 | + |
---|
| 1399 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1400 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1401 | + autokeepCB.addItemListener(this); |
---|
| 1402 | + |
---|
| 1403 | + panel.Return(); |
---|
818 | 1404 | if (Globals.ADVANCED) |
---|
819 | 1405 | { |
---|
820 | 1406 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
.. | .. |
---|
825 | 1411 | } |
---|
826 | 1412 | |
---|
827 | 1413 | cGridBag fill = new cGridBag(); |
---|
828 | | - |
---|
829 | 1414 | fill.preferredHeight = 200; |
---|
| 1415 | + cGridBag fill2 = new cGridBag(); |
---|
| 1416 | + fill2.preferredHeight = 200; |
---|
| 1417 | + cGridBag fill3 = new cGridBag(); |
---|
| 1418 | + fill3.preferredHeight = 200; |
---|
830 | 1419 | |
---|
831 | 1420 | panel.add(fill); |
---|
| 1421 | + panel.add(fill2); |
---|
| 1422 | + panel.add(fill3); |
---|
832 | 1423 | |
---|
833 | 1424 | } |
---|
834 | 1425 | |
---|
.. | .. |
---|
836 | 1427 | { |
---|
837 | 1428 | cRadio radioButton = new cRadio(obj.name); |
---|
838 | 1429 | |
---|
839 | | - // Patch to avoid bug with transparency. |
---|
| 1430 | + // June 2019. Patch to avoid bug with transparency. |
---|
840 | 1431 | radioButton.hadMaterial = obj.material != null; |
---|
841 | 1432 | if (!radioButton.hadMaterial) |
---|
842 | 1433 | { |
---|
.. | .. |
---|
844 | 1435 | } |
---|
845 | 1436 | |
---|
846 | 1437 | radioButton.SetObject(obj); |
---|
847 | | - radioButton.layout = sevenButton; |
---|
| 1438 | + radioButton.layout = threeButton; // sixButton; |
---|
848 | 1439 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
849 | 1440 | radioButton.addActionListener(this); |
---|
850 | 1441 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
864 | 1455 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
865 | 1456 | } |
---|
866 | 1457 | |
---|
867 | | - JCheckBox liveCB; |
---|
868 | | - JCheckBox supportCB; |
---|
869 | | - JCheckBox localCB; |
---|
870 | | - JCheckBox crowdCB; |
---|
871 | | - JCheckBox smoothCB; |
---|
872 | | - JCheckBox fastCB; |
---|
873 | | - JCheckBox slowCB; |
---|
874 | | - JCheckBox boxCB; |
---|
875 | | - JCheckBox zoomBoxCB; |
---|
876 | | - JCheckBox trackCB; |
---|
877 | | - JCheckBox smoothfocusCB; |
---|
878 | | -// JCheckBox speakerMocapCB; |
---|
879 | | - JCheckBox speakerCameraCB; |
---|
880 | | - JCheckBox speakerFocusCB; |
---|
881 | | - JCheckBox debugCB; |
---|
| 1458 | + cToggleButton liveCB; |
---|
| 1459 | + cCheckBox supportCB; |
---|
| 1460 | + cCheckBox localCB; |
---|
| 1461 | + cCheckBox crowdCB; |
---|
| 1462 | + cCheckBox smoothCB; |
---|
| 1463 | + cCheckBox minshaderCB; |
---|
882 | 1464 | |
---|
883 | | - JCheckBox oeilCB; |
---|
884 | | - JCheckBox shadowCB; |
---|
885 | | - JCheckBox lookAtCB; |
---|
| 1465 | + cToggleButton fastCB; |
---|
| 1466 | + cCheckBox slowCB; |
---|
| 1467 | + cCheckBox boxCB; |
---|
| 1468 | + cCheckBox zoomBoxCB; |
---|
| 1469 | + cCheckBox freezeCB; |
---|
| 1470 | + //cToggleButton trackCB; |
---|
| 1471 | + cCheckBox trackCB; |
---|
| 1472 | + cCheckBox smoothfocusCB; |
---|
| 1473 | +// JCheckBox speakerMocapCB; |
---|
| 1474 | + cCheckBox speakerCameraCB; |
---|
| 1475 | + cCheckBox speakerFocusCB; |
---|
| 1476 | + cCheckBox debugCB; |
---|
| 1477 | + |
---|
| 1478 | + cCheckBox oeilCB; |
---|
| 1479 | + cCheckBox shadowCB; |
---|
| 1480 | + cCheckBox autokeepCB; |
---|
| 1481 | + cCheckBox lookAtCB; |
---|
886 | 1482 | |
---|
887 | 1483 | // static int COLOR = 1; |
---|
888 | 1484 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
890 | 1486 | |
---|
891 | 1487 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
892 | 1488 | |
---|
893 | | - JCheckBox colorCB; |
---|
894 | | - JCheckBox materialCB; |
---|
895 | | - JCheckBox textureCB; |
---|
| 1489 | + cCheckBox colorCB; |
---|
| 1490 | + cCheckBox materialCB; |
---|
| 1491 | + cCheckBox textureCB; |
---|
896 | 1492 | |
---|
897 | 1493 | public void itemStateChanged(ItemEvent e) |
---|
898 | 1494 | { |
---|
.. | .. |
---|
936 | 1532 | { |
---|
937 | 1533 | cameraView.ToggleInertia(); |
---|
938 | 1534 | cameraView.repaint(); |
---|
| 1535 | + } |
---|
| 1536 | + else if(e.getSource() == minshaderCB) |
---|
| 1537 | + { |
---|
| 1538 | + Globals.MINSHADER ^= true; |
---|
| 1539 | + cameraView.programInitialized = false; |
---|
| 1540 | + cameraView.repaint(); |
---|
939 | 1541 | } |
---|
940 | 1542 | else if(e.getSource() == localCB) |
---|
941 | 1543 | { |
---|
.. | .. |
---|
989 | 1591 | { |
---|
990 | 1592 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
991 | 1593 | } |
---|
| 1594 | + else if(e.getSource() == freezeCB) |
---|
| 1595 | + { |
---|
| 1596 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1597 | + } |
---|
| 1598 | + else if(e.getSource() == autokeepCB) |
---|
| 1599 | + { |
---|
| 1600 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1601 | + } |
---|
992 | 1602 | else if(e.getSource() == lookAtCB) |
---|
993 | 1603 | { |
---|
994 | 1604 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
1005 | 1615 | |
---|
1006 | 1616 | /**/ |
---|
1007 | 1617 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
1008 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1618 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1619 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
1009 | 1620 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
1010 | 1621 | // We can't move the root node or an empty selection |
---|
1011 | 1622 | return; |
---|
.. | .. |
---|
1068 | 1679 | } |
---|
1069 | 1680 | } |
---|
1070 | 1681 | |
---|
1071 | | - String string = (String) object; |
---|
1072 | | - |
---|
1073 | 1682 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1074 | 1683 | // if( object instanceof java.io.File[]) |
---|
1075 | 1684 | // { |
---|
.. | .. |
---|
1077 | 1686 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1078 | 1687 | // return; |
---|
1079 | 1688 | // } |
---|
| 1689 | + |
---|
| 1690 | + String string = object.toString(); |
---|
1080 | 1691 | |
---|
1081 | 1692 | // File path for Mac and Windows |
---|
1082 | 1693 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1122 | 1733 | |
---|
1123 | 1734 | assert target == objEditor.jTree; |
---|
1124 | 1735 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1736 | + Object3D destinationLeaf; |
---|
1125 | 1737 | try { |
---|
1126 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1738 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1127 | 1739 | } catch (Exception e) { |
---|
1128 | 1740 | System.out.println("destinationPath : " + destinationPath); |
---|
1129 | 1741 | return; |
---|
1130 | 1742 | } |
---|
1131 | 1743 | |
---|
1132 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1744 | + for (int i=group.selection.size(); --i>=0;) |
---|
1133 | 1745 | { |
---|
| 1746 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1747 | + |
---|
| 1748 | + // Cannot move into itself |
---|
| 1749 | + if (child == destinationLeaf) |
---|
| 1750 | + return; |
---|
| 1751 | + } |
---|
| 1752 | + |
---|
| 1753 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1754 | +// { |
---|
1134 | 1755 | loadClipboard(true); |
---|
1135 | 1756 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1136 | 1757 | pasteInto(false, false); |
---|
1137 | | - } else { |
---|
1138 | | - loadClipboard(false); |
---|
1139 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1140 | | - pasteInto(false, false); // true); // ??? |
---|
1141 | | - } |
---|
| 1758 | +// } else { |
---|
| 1759 | +// loadClipboard(false); |
---|
| 1760 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1761 | +// pasteInto(false, false); // true); // ??? |
---|
| 1762 | +// } |
---|
1142 | 1763 | } |
---|
1143 | 1764 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1144 | 1765 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1243 | 1864 | { |
---|
1244 | 1865 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1245 | 1866 | //heightFieldItem.addActionListener(this); |
---|
1246 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1247 | | - gridItem.addActionListener(this); |
---|
1248 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1249 | | - rectoidItem.addActionListener(this); |
---|
1250 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1251 | | - ellipsoidItem.addActionListener(this); |
---|
1252 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1253 | | - coneItem.addActionListener(this); |
---|
1254 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1255 | | - torusItem.addActionListener(this); |
---|
1256 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1257 | | - superItem.addActionListener(this); |
---|
| 1867 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1868 | +// gridItem.addActionListener(this); |
---|
| 1869 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1870 | +// rectoidItem.addActionListener(this); |
---|
| 1871 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1872 | +// ellipsoidItem.addActionListener(this); |
---|
| 1873 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1874 | +// coneItem.addActionListener(this); |
---|
| 1875 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1876 | +// torusItem.addActionListener(this); |
---|
| 1877 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1878 | +// superItem.addActionListener(this); |
---|
| 1879 | + |
---|
| 1880 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1881 | + cameraItem.addActionListener(this); |
---|
| 1882 | + |
---|
| 1883 | + if (!Globals.ADVANCED) |
---|
| 1884 | + { |
---|
1258 | 1885 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1259 | 1886 | kleinItem.addActionListener(this); |
---|
1260 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1261 | | - particleItem.addActionListener(this); |
---|
| 1887 | + } |
---|
| 1888 | + |
---|
| 1889 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1890 | +// particleItem.addActionListener(this); |
---|
1262 | 1891 | if (Globals.ADVANCED) |
---|
1263 | 1892 | { |
---|
1264 | 1893 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1284 | 1913 | } |
---|
1285 | 1914 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1286 | 1915 | bezierItem.addActionListener(this); |
---|
1287 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1288 | | - overlayItem.addActionListener(this); |
---|
1289 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1290 | | - lightItem.addActionListener(this); |
---|
| 1916 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1917 | +// overlayItem.addActionListener(this); |
---|
| 1918 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1919 | +// lightItem.addActionListener(this); |
---|
1291 | 1920 | menu.add("-"); |
---|
1292 | 1921 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1293 | 1922 | //superLoopItem.addActionListener(this); |
---|
1294 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1295 | | - loopItem.addActionListener(this); |
---|
| 1923 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1924 | +// loopItem.addActionListener(this); |
---|
1296 | 1925 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1297 | 1926 | doubleItem.addActionListener(this); |
---|
1298 | 1927 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1308 | 1937 | animationItem.addItemListener(this); |
---|
1309 | 1938 | animationItem.setState(Globals.ANIMATION); |
---|
1310 | 1939 | |
---|
| 1940 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1941 | + archiveItem.addActionListener(this); |
---|
| 1942 | + |
---|
1311 | 1943 | menu.add("-"); |
---|
1312 | 1944 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1313 | 1945 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1320 | 1952 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1321 | 1953 | reduce34MorphItem.addActionListener(this); |
---|
1322 | 1954 | menu.add("-"); |
---|
| 1955 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1956 | + memoryItem.addActionListener(this); |
---|
1323 | 1957 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1324 | 1958 | computeAOItem.addActionListener(this); |
---|
1325 | 1959 | |
---|
.. | .. |
---|
1328 | 1962 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1329 | 1963 | mirrorItem.addActionListener(this); |
---|
1330 | 1964 | menu.add("-"); |
---|
1331 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1332 | | - memoryItem.addActionListener(this); |
---|
1333 | 1965 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1334 | 1966 | analyzeItem.addActionListener(this); |
---|
1335 | 1967 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1477 | 2109 | |
---|
1478 | 2110 | makeSomething(shadow); |
---|
1479 | 2111 | } |
---|
| 2112 | + |
---|
| 2113 | + private void ClearUnpinned() |
---|
| 2114 | + { |
---|
| 2115 | + //for (Object3D obj : listUI) |
---|
| 2116 | + for (int i=listUI.size(); --i>=0;) |
---|
| 2117 | + { |
---|
| 2118 | + Object3D obj = listUI.elementAt(i); |
---|
| 2119 | + if (!obj.pinned) |
---|
| 2120 | + { |
---|
| 2121 | + obj.CloseUI(); |
---|
| 2122 | + listUI.remove(i); |
---|
| 2123 | + } |
---|
| 2124 | + } |
---|
| 2125 | + } |
---|
| 2126 | + |
---|
| 2127 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2128 | + { |
---|
| 2129 | + // if (!(elem instanceof Composite)) |
---|
| 2130 | + // newWindow = false; |
---|
| 2131 | + listUI.add(elem); |
---|
| 2132 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2133 | + System.out.println("edit : " + elem); |
---|
| 2134 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 2135 | + } |
---|
1480 | 2136 | |
---|
1481 | 2137 | /** |
---|
1482 | 2138 | * applyExample |
---|
.. | .. |
---|
1721 | 2377 | { |
---|
1722 | 2378 | ScreenFit(); |
---|
1723 | 2379 | } else |
---|
1724 | | - if (source == switchItem) |
---|
| 2380 | + if (source == switchViewItem) |
---|
1725 | 2381 | { |
---|
1726 | 2382 | cVector v1 = new cVector(); |
---|
1727 | 2383 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1730 | 2386 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1731 | 2387 | objEditor.cameraView.repaint(); |
---|
1732 | 2388 | } else |
---|
1733 | | - if (source == rectoidItem) |
---|
| 2389 | + if (source == rectoidItem || source == boxButton) |
---|
1734 | 2390 | { |
---|
1735 | 2391 | makeSomething(new Box()); |
---|
1736 | 2392 | } else |
---|
1737 | | - if (source == particleItem) |
---|
| 2393 | + if (source == particleItem || source == particlesButton) |
---|
1738 | 2394 | { |
---|
1739 | 2395 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1740 | 2396 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1813 | 2469 | |
---|
1814 | 2470 | makeSomething(obj); |
---|
1815 | 2471 | } else |
---|
1816 | | - if (source == gridItem) |
---|
| 2472 | + if (source == gridItem || source == gridButton) |
---|
1817 | 2473 | { |
---|
1818 | 2474 | makeSomething(new Grid()); |
---|
1819 | 2475 | } else |
---|
1820 | | - if (source == ellipsoidItem) |
---|
| 2476 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1821 | 2477 | { |
---|
1822 | 2478 | makeSomething(new Sphere()); |
---|
1823 | 2479 | } else |
---|
1824 | | - if (source == coneItem) |
---|
| 2480 | + if (source == coneItem || source == coneButton) |
---|
1825 | 2481 | { |
---|
1826 | 2482 | makeSomething(new Cone()); |
---|
1827 | 2483 | } else |
---|
1828 | | - if (source == torusItem) |
---|
| 2484 | + if (source == torusItem || source == torusButton) |
---|
1829 | 2485 | { |
---|
1830 | 2486 | makeSomething(new Torus()); |
---|
1831 | 2487 | } else |
---|
1832 | | - if (source == superItem) |
---|
| 2488 | + if (source == superItem || source == superButton) |
---|
1833 | 2489 | { |
---|
1834 | 2490 | makeSomething(new Superellipsoid()); |
---|
1835 | 2491 | } else |
---|
1836 | | - if (source == kleinItem) |
---|
| 2492 | + if (source == kleinItem || source == kleinButton) |
---|
1837 | 2493 | { |
---|
1838 | 2494 | makeSomething(new Klein()); |
---|
1839 | 2495 | } else |
---|
.. | .. |
---|
1853 | 2509 | { |
---|
1854 | 2510 | makeSomething(new BezierSurface()); |
---|
1855 | 2511 | } else |
---|
1856 | | - if (source == overlayItem) |
---|
| 2512 | + if (source == overlayItem || source == overlayButton) |
---|
1857 | 2513 | { |
---|
1858 | 2514 | /* |
---|
1859 | 2515 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1901 | 2557 | s.setup(); |
---|
1902 | 2558 | makeSomething(s); |
---|
1903 | 2559 | } else |
---|
1904 | | - if (source == lightItem) |
---|
| 2560 | + if (source == lightItem || source == lightButton) |
---|
1905 | 2561 | { |
---|
1906 | 2562 | makeSomething(new Light()); |
---|
1907 | 2563 | } else |
---|
| 2564 | +// if (source == skybox1Button || |
---|
| 2565 | +// source == skybox2Button || |
---|
| 2566 | +// source == skybox3Button || |
---|
| 2567 | +// source == skybox4Button || |
---|
| 2568 | +// source == skybox5Button || |
---|
| 2569 | +// source == skybox6Button || |
---|
| 2570 | +// source == skybox7Button || |
---|
| 2571 | +// source == skybox11Button || |
---|
| 2572 | +// source == skybox12Button || |
---|
| 2573 | +// source == skybox13Button || |
---|
| 2574 | +// source == skybox14Button || |
---|
| 2575 | +// source == skybox15Button || |
---|
| 2576 | +// source == skybox16Button || |
---|
| 2577 | +// source == skybox17Button) |
---|
| 2578 | +// { |
---|
| 2579 | +// ChangeSkybox(source); |
---|
| 2580 | +// } else |
---|
1908 | 2581 | if (source == csgItem) |
---|
1909 | 2582 | { |
---|
1910 | 2583 | group(new CSG()); |
---|
.. | .. |
---|
1951 | 2624 | |
---|
1952 | 2625 | group(g); |
---|
1953 | 2626 | } else |
---|
1954 | | - if (source == loopItem) |
---|
| 2627 | + if (source == loopItem || source == loopButton) |
---|
1955 | 2628 | { |
---|
1956 | 2629 | Composite csg = new GroupLeaf(); |
---|
1957 | 2630 | csg.count = 5; |
---|
1958 | 2631 | group(csg); |
---|
1959 | | - Composite child = new cGroup(); |
---|
| 2632 | + Composite child = new cGroup("Branch"); |
---|
1960 | 2633 | csg.addChild(child); |
---|
1961 | 2634 | child.addChild(csg); |
---|
1962 | 2635 | } else |
---|
1963 | 2636 | if (source == doubleItem) |
---|
1964 | 2637 | { |
---|
1965 | | - Composite csg = new GroupLeaf(); |
---|
| 2638 | + Composite csg = new GroupLeaf("Fork"); |
---|
1966 | 2639 | csg.count = 5; |
---|
1967 | 2640 | group(csg); |
---|
1968 | | - Composite child = new cGroup(); |
---|
| 2641 | + Composite child = new cGroup("Branch A"); |
---|
1969 | 2642 | csg.addChild(child); |
---|
1970 | 2643 | child.addChild(csg); |
---|
1971 | | - child = new cGroup(); |
---|
| 2644 | + child = new cGroup("Branch B"); |
---|
1972 | 2645 | csg.addChild(child); |
---|
1973 | 2646 | child.addChild(csg); |
---|
1974 | 2647 | } else |
---|
1975 | 2648 | if (source == tripleItem) |
---|
1976 | 2649 | { |
---|
1977 | | - Composite csg = new GroupLeaf(); |
---|
| 2650 | + Composite csg = new GroupLeaf("Trident"); |
---|
1978 | 2651 | csg.count = 4; |
---|
1979 | 2652 | group(csg); |
---|
1980 | 2653 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1990 | 2663 | if (source == computeAOItem) |
---|
1991 | 2664 | { |
---|
1992 | 2665 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1993 | | - Globals.theRenderer.repaint(); |
---|
| 2666 | + cameraView.repaint(); |
---|
1994 | 2667 | } else |
---|
1995 | 2668 | if (source == recompileItem) |
---|
1996 | 2669 | { |
---|
.. | .. |
---|
2005 | 2678 | if (source == invariantsItem) |
---|
2006 | 2679 | { |
---|
2007 | 2680 | System.out.println("Invariants:"); |
---|
2008 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2681 | + Grafreed.grafreed.universe.invariants(); |
---|
2009 | 2682 | } else |
---|
2010 | 2683 | if (source == memoryItem) |
---|
2011 | 2684 | { |
---|
.. | .. |
---|
2036 | 2709 | { |
---|
2037 | 2710 | ToggleFullScreen(); |
---|
2038 | 2711 | } else |
---|
2039 | | - if (source == undoButton) |
---|
| 2712 | + if (source == previousVersionButton) |
---|
2040 | 2713 | { |
---|
2041 | | - Undo(); |
---|
| 2714 | + // Go to previous version |
---|
| 2715 | + //if (!Undo()) |
---|
| 2716 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2717 | + PreviousVersion(); |
---|
2042 | 2718 | } else |
---|
2043 | | - if (source == redoButton) |
---|
| 2719 | + if (source == restoreButton) |
---|
2044 | 2720 | { |
---|
2045 | | - Redo(); |
---|
| 2721 | + // Restore current version |
---|
| 2722 | + Restore(); |
---|
| 2723 | + //restoreButton.setEnabled(false); |
---|
2046 | 2724 | } else |
---|
2047 | | - if (source == saveButton) |
---|
| 2725 | + if (source == replaceButton) |
---|
2048 | 2726 | { |
---|
2049 | | - Save(); |
---|
| 2727 | + // Overwrite current version |
---|
| 2728 | + Replace(); |
---|
| 2729 | + //replaceButton.setEnabled(false); |
---|
| 2730 | + } else |
---|
| 2731 | + if (source == nextVersionButton) |
---|
| 2732 | + { |
---|
| 2733 | + // Go to next version |
---|
| 2734 | + NextVersion(); |
---|
| 2735 | + } else |
---|
| 2736 | + if (source == saveVersionButton) |
---|
| 2737 | + { |
---|
| 2738 | + // Save a new version |
---|
| 2739 | + if (!Save(true)) |
---|
| 2740 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2741 | + } else |
---|
| 2742 | + if (source == deleteVersionButton) |
---|
| 2743 | + { |
---|
| 2744 | + // Delete a new version |
---|
| 2745 | + DeleteVersion(); |
---|
2050 | 2746 | } else |
---|
2051 | 2747 | if (source == oneStepButton) |
---|
2052 | 2748 | { |
---|
.. | .. |
---|
2055 | 2751 | } else |
---|
2056 | 2752 | if (source == screenfitButton) |
---|
2057 | 2753 | { |
---|
2058 | | - //Reload(lastConverter, lastFilename, true); |
---|
2059 | 2754 | ScreenFit(); |
---|
2060 | 2755 | } else |
---|
2061 | 2756 | if (source == screenfitpointButton) |
---|
2062 | 2757 | { |
---|
2063 | | - //Reload(lastConverter, lastFilename, true); |
---|
2064 | 2758 | ScreenFitPoint(); |
---|
2065 | 2759 | } else |
---|
2066 | 2760 | if (source == snapobjectButton) |
---|
2067 | 2761 | { |
---|
2068 | | - //Reload(lastConverter, lastFilename, true); |
---|
2069 | 2762 | SnapObject(); |
---|
2070 | 2763 | } else |
---|
2071 | 2764 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2104 | 2797 | } else |
---|
2105 | 2798 | if (source == undoItem) |
---|
2106 | 2799 | { |
---|
2107 | | - Undo(); |
---|
| 2800 | + PreviousVersion(); |
---|
2108 | 2801 | } else |
---|
2109 | 2802 | if (source == redoItem) |
---|
2110 | 2803 | { |
---|
2111 | | - Redo(); |
---|
| 2804 | + NextVersion(); |
---|
2112 | 2805 | } else |
---|
2113 | 2806 | if (source == duplicateItem) |
---|
2114 | 2807 | { |
---|
.. | .. |
---|
2429 | 3122 | { |
---|
2430 | 3123 | StepAll(); |
---|
2431 | 3124 | } else |
---|
2432 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 3125 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2433 | 3126 | { |
---|
2434 | 3127 | //int indices[] = jList.getSelectedIndices(); |
---|
2435 | 3128 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2441 | 3134 | { |
---|
2442 | 3135 | ClearSelection(true); |
---|
2443 | 3136 | } else |
---|
2444 | | - if (source == grabItem) |
---|
| 3137 | + if (source == grabItem || source == groupButton) |
---|
2445 | 3138 | { |
---|
2446 | | - group(new cGroup(), true); |
---|
| 3139 | + group(new cGroup(), false); // true); |
---|
2447 | 3140 | } else |
---|
2448 | 3141 | if (source == hideItem) |
---|
2449 | 3142 | { |
---|
.. | .. |
---|
2461 | 3154 | { |
---|
2462 | 3155 | makeSomething(new Camera()); |
---|
2463 | 3156 | } else |
---|
2464 | | - if (source == compositeItem) |
---|
| 3157 | + if (source == compositeItem || source == compositeButton) |
---|
2465 | 3158 | { |
---|
2466 | 3159 | group(new Composite()); |
---|
2467 | 3160 | } else |
---|
2468 | | - if (source == randomItem) |
---|
| 3161 | + if (source == switchItem || source == switchButton) |
---|
2469 | 3162 | { |
---|
2470 | 3163 | RandomNode random = new RandomNode(); |
---|
2471 | 3164 | group(random); |
---|
.. | .. |
---|
2567 | 3260 | { |
---|
2568 | 3261 | group(new cLinker()); |
---|
2569 | 3262 | } else |
---|
2570 | | - if (source == textureItem) |
---|
| 3263 | + if (source == textureItem || source == textureButton) |
---|
2571 | 3264 | { |
---|
2572 | 3265 | group(new TextureNode()); |
---|
2573 | 3266 | } else |
---|
.. | .. |
---|
2587 | 3280 | { |
---|
2588 | 3281 | CastShadow(2); |
---|
2589 | 3282 | } else |
---|
2590 | | - if (source == ungroupItem) |
---|
| 3283 | + if (source == ungroupItem || source == ungroupButton) |
---|
2591 | 3284 | { |
---|
2592 | | - //ungroup(); |
---|
| 3285 | + boolean hasRoot = false; |
---|
| 3286 | + |
---|
2593 | 3287 | for (int i=0; i<group.selection.size(); i++) |
---|
2594 | 3288 | { |
---|
2595 | | - Ungroup(group.selection.get(i)); |
---|
| 3289 | + if (group.selection.get(i) == group) |
---|
| 3290 | + { |
---|
| 3291 | + hasRoot = true; |
---|
| 3292 | + break; |
---|
| 3293 | + } |
---|
2596 | 3294 | } |
---|
2597 | 3295 | |
---|
2598 | | - ClearSelection(false); |
---|
2599 | | - |
---|
2600 | | - refreshContents(); |
---|
| 3296 | + if (!hasRoot) |
---|
| 3297 | + { |
---|
| 3298 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3299 | + { |
---|
| 3300 | + Ungroup(group.selection.get(i)); |
---|
| 3301 | + } |
---|
| 3302 | + |
---|
| 3303 | + ClearSelection(false); |
---|
| 3304 | + |
---|
| 3305 | + refreshContents(); |
---|
| 3306 | + } |
---|
2601 | 3307 | } else |
---|
2602 | 3308 | if (source == genUVItem) |
---|
2603 | 3309 | { |
---|
.. | .. |
---|
2898 | 3604 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2899 | 3605 | { |
---|
2900 | 3606 | obj = (Object3D)e.nextElement(); |
---|
2901 | | - obj.SetBumpTexture(null); |
---|
| 3607 | + obj.ResetBumpTexture(); |
---|
2902 | 3608 | } |
---|
2903 | 3609 | |
---|
2904 | 3610 | refreshContents(); |
---|
.. | .. |
---|
2914 | 3620 | |
---|
2915 | 3621 | refreshContents(); |
---|
2916 | 3622 | } else |
---|
| 3623 | + if (source == embedTexturesItem) |
---|
| 3624 | + { |
---|
| 3625 | + Object3D obj; |
---|
| 3626 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3627 | + { |
---|
| 3628 | + obj = (Object3D)e.nextElement(); |
---|
| 3629 | + obj.EmbedTextures(true); |
---|
| 3630 | + } |
---|
| 3631 | + |
---|
| 3632 | + refreshContents(); |
---|
| 3633 | + } else |
---|
| 3634 | + if (source == deEmbedTexturesItem) |
---|
| 3635 | + { |
---|
| 3636 | + Object3D obj; |
---|
| 3637 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3638 | + { |
---|
| 3639 | + obj = (Object3D)e.nextElement(); |
---|
| 3640 | + obj.EmbedTextures(false); |
---|
| 3641 | + } |
---|
| 3642 | + |
---|
| 3643 | + CameraPane.texturepigment.clear(); |
---|
| 3644 | + CameraPane.texturebump.clear(); |
---|
| 3645 | + |
---|
| 3646 | + refreshContents(); |
---|
| 3647 | + } else |
---|
2917 | 3648 | if (source == flashSelectionButton) |
---|
2918 | 3649 | { |
---|
2919 | 3650 | CameraPane.flash = true; |
---|
.. | .. |
---|
2925 | 3656 | if (source == twoButton) |
---|
2926 | 3657 | { |
---|
2927 | 3658 | radio.layout = twoButton; |
---|
| 3659 | + |
---|
| 3660 | + if (CameraPane.FULLSCREEN) |
---|
| 3661 | + fullscreenLayout = radio.layout; |
---|
| 3662 | + |
---|
2928 | 3663 | // bug |
---|
2929 | 3664 | //gridPanel.setDividerLocation(1.0); |
---|
2930 | 3665 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2980 | 3715 | { |
---|
2981 | 3716 | radio.layout = threeButton; |
---|
2982 | 3717 | |
---|
| 3718 | + if (CameraPane.FULLSCREEN) |
---|
| 3719 | + fullscreenLayout = radio.layout; |
---|
| 3720 | + |
---|
2983 | 3721 | // bigThree.remove(scenePanel); |
---|
2984 | 3722 | // bigThree.remove(centralPanel); |
---|
2985 | 3723 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3008 | 3746 | // centralPanel.setVisible(true); |
---|
3009 | 3747 | // XYZPanel.setVisible(true); |
---|
3010 | 3748 | bigThree.ClearUI(); |
---|
| 3749 | + bigThree.add(scenePanel); |
---|
3011 | 3750 | bigThree.add(centralPanel); |
---|
3012 | | - bigThree.add(XYZPanel); |
---|
3013 | 3751 | bigThree.FlushUI(); |
---|
3014 | 3752 | |
---|
3015 | 3753 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3017 | 3755 | if (source == fourButton) |
---|
3018 | 3756 | { |
---|
3019 | 3757 | radio.layout = fourButton; |
---|
| 3758 | + |
---|
| 3759 | + if (CameraPane.FULLSCREEN) |
---|
| 3760 | + fullscreenLayout = radio.layout; |
---|
3020 | 3761 | |
---|
3021 | 3762 | // bigThree.remove(scenePanel); |
---|
3022 | 3763 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3055 | 3796 | { |
---|
3056 | 3797 | radio.layout = sixButton; |
---|
3057 | 3798 | |
---|
| 3799 | + if (CameraPane.FULLSCREEN) |
---|
| 3800 | + fullscreenLayout = radio.layout; |
---|
| 3801 | + |
---|
3058 | 3802 | // bigThree.remove(scenePanel); |
---|
3059 | 3803 | // bigThree.remove(centralPanel); |
---|
3060 | 3804 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3083 | 3827 | // centralPanel.setVisible(true); |
---|
3084 | 3828 | // XYZPanel.setVisible(false); |
---|
3085 | 3829 | bigThree.ClearUI(); |
---|
3086 | | - bigThree.add(scenePanel); |
---|
3087 | 3830 | bigThree.add(centralPanel); |
---|
| 3831 | + bigThree.add(scenePanel); |
---|
3088 | 3832 | bigThree.FlushUI(); |
---|
3089 | 3833 | |
---|
3090 | 3834 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3092 | 3836 | if (source == sevenButton) |
---|
3093 | 3837 | { |
---|
3094 | 3838 | radio.layout = sevenButton; |
---|
| 3839 | + |
---|
| 3840 | + if (CameraPane.FULLSCREEN) |
---|
| 3841 | + fullscreenLayout = radio.layout; |
---|
3095 | 3842 | |
---|
3096 | 3843 | // bigThree.remove(scenePanel); |
---|
3097 | 3844 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3159 | 3906 | buttonGroup.remove(ab); |
---|
3160 | 3907 | radioPanel.remove(ab); |
---|
3161 | 3908 | |
---|
3162 | | - ab.GetObject().editWindow = null; |
---|
| 3909 | + //ab.GetObject().editWindow = null; |
---|
| 3910 | + ab.GetObject().manipWindow = null; |
---|
3163 | 3911 | // ab.GetObject().objectUI = null; // ????????? |
---|
3164 | 3912 | |
---|
3165 | 3913 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
.. | .. |
---|
3172 | 3920 | } else |
---|
3173 | 3921 | if (source == editItem || source == editButton) |
---|
3174 | 3922 | { |
---|
| 3923 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3924 | + { |
---|
| 3925 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3926 | + child.pinned = true; |
---|
| 3927 | + } |
---|
| 3928 | + |
---|
3175 | 3929 | EditSelection(false); |
---|
3176 | 3930 | } else |
---|
3177 | 3931 | if (source == uneditButton) |
---|
.. | .. |
---|
3180 | 3934 | { |
---|
3181 | 3935 | Object3D child = (Object3D)e.nextElement(); |
---|
3182 | 3936 | if(child.editWindow != null) |
---|
3183 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3937 | + child.pinned = false; |
---|
3184 | 3938 | child.CloseUI(); |
---|
3185 | 3939 | listUI.remove(child); |
---|
| 3940 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3186 | 3941 | |
---|
3187 | 3942 | //child.editWindow = null; // ??????????? |
---|
3188 | 3943 | } |
---|
.. | .. |
---|
3197 | 3952 | //copy.ClearUI(); |
---|
3198 | 3953 | for (Object3D obj : listUI) |
---|
3199 | 3954 | { |
---|
| 3955 | + obj.pinned = false; |
---|
3200 | 3956 | obj.CloseUI(); |
---|
3201 | 3957 | } |
---|
3202 | 3958 | listUI.clear(); |
---|
| 3959 | + SetPinStates(group.selection.size() > 0); |
---|
3203 | 3960 | refreshContents(true); |
---|
3204 | 3961 | } else |
---|
3205 | 3962 | if (source == allParamsButton) |
---|
3206 | 3963 | { |
---|
3207 | 3964 | assert(copy == group); |
---|
3208 | 3965 | |
---|
3209 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3966 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3210 | 3967 | |
---|
3211 | 3968 | for (Object3D obj : listUI) |
---|
3212 | 3969 | { |
---|
.. | .. |
---|
3255 | 4012 | } |
---|
3256 | 4013 | |
---|
3257 | 4014 | copy = group; |
---|
| 4015 | + |
---|
| 4016 | + SetUndoStates(); |
---|
| 4017 | + |
---|
3258 | 4018 | //Globals.theRenderer.object = group; |
---|
3259 | 4019 | if(!useclient) |
---|
3260 | 4020 | { |
---|
.. | .. |
---|
3273 | 4033 | |
---|
3274 | 4034 | // fix "+" issue |
---|
3275 | 4035 | //group.editWindow = this; |
---|
| 4036 | + group.manipWindow = this; |
---|
3276 | 4037 | |
---|
3277 | 4038 | /* |
---|
3278 | 4039 | currentLayout = radio.layout; |
---|
.. | .. |
---|
3280 | 4041 | currentLayout = sevenButton; |
---|
3281 | 4042 | */ |
---|
3282 | 4043 | radio.layout.doClick(); |
---|
| 4044 | + |
---|
| 4045 | + ClearUnpinned(); |
---|
| 4046 | + |
---|
| 4047 | + //Grafreed.Assert(group != null); |
---|
| 4048 | + //Grafreed.Assert(group.selection != null); |
---|
| 4049 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 4050 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 4051 | + EditSelection(false); |
---|
3283 | 4052 | keepparent = group.parent; |
---|
3284 | 4053 | // PARENT = NULL or not??? |
---|
3285 | 4054 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3291 | 4060 | } else if (event.getSource() == editCameraItem) |
---|
3292 | 4061 | { |
---|
3293 | 4062 | cameraView.ProtectCamera(); |
---|
| 4063 | + cameraView.requestFocusInWindow(); |
---|
3294 | 4064 | cameraView.repaint(); |
---|
3295 | 4065 | return; |
---|
3296 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 4066 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3297 | 4067 | { |
---|
3298 | 4068 | cameraView.RevertCamera(); |
---|
| 4069 | + cameraView.requestFocusInWindow(); |
---|
3299 | 4070 | cameraView.repaint(); |
---|
3300 | 4071 | return; |
---|
3301 | 4072 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
3872 | 4643 | |
---|
3873 | 4644 | try |
---|
3874 | 4645 | { |
---|
3875 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4646 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
3876 | 4647 | } |
---|
3877 | 4648 | catch (Exception e) |
---|
3878 | 4649 | { |
---|
.. | .. |
---|
4347 | 5118 | // } |
---|
4348 | 5119 | // } |
---|
4349 | 5120 | |
---|
4350 | | - static boolean allparams = true; |
---|
4351 | | - |
---|
4352 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4353 | | - |
---|
4354 | 5121 | void EditSelection(boolean newWindow) |
---|
4355 | 5122 | { |
---|
| 5123 | + if (group.selection == null) |
---|
| 5124 | + { |
---|
| 5125 | + EditElement(group, newWindow); // ? new |
---|
| 5126 | + return; |
---|
| 5127 | + } |
---|
| 5128 | + |
---|
4356 | 5129 | // aConstraints.gridy = 0; |
---|
4357 | 5130 | for (int i=0; i<group.selection.size(); i++) |
---|
4358 | 5131 | { |
---|
4359 | 5132 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4360 | 5133 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4361 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 5134 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4362 | 5135 | |
---|
4363 | 5136 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4364 | 5137 | if(elem != group || !newWindow) |
---|
4365 | 5138 | { |
---|
4366 | | - // if (!(elem instanceof Composite)) |
---|
4367 | | - // newWindow = false; |
---|
4368 | | - listUI.add(elem); |
---|
4369 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4370 | | - System.out.println("edit : " + elem); |
---|
4371 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5139 | + EditElement(elem, newWindow); // ? new |
---|
4372 | 5140 | } |
---|
4373 | 5141 | } |
---|
4374 | 5142 | } |
---|
.. | .. |
---|
4431 | 5199 | |
---|
4432 | 5200 | freezemodel = false; |
---|
4433 | 5201 | } |
---|
4434 | | - |
---|
4435 | | - boolean flashIt = true; |
---|
4436 | | - |
---|
| 5202 | + |
---|
4437 | 5203 | public void valueChanged(TreeSelectionEvent e) |
---|
4438 | 5204 | //public boolean handleEvent(Event event) |
---|
4439 | 5205 | { |
---|
.. | .. |
---|
4443 | 5209 | //new Exception().printStackTrace(); |
---|
4444 | 5210 | |
---|
4445 | 5211 | freezemodel = true; |
---|
4446 | | - |
---|
| 5212 | + ClearUnpinned(); |
---|
| 5213 | + |
---|
4447 | 5214 | /**/ |
---|
4448 | 5215 | //switch (event.id) |
---|
4449 | 5216 | { |
---|
.. | .. |
---|
4476 | 5243 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4477 | 5244 | // a camera |
---|
4478 | 5245 | { |
---|
4479 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 5246 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4480 | 5247 | { |
---|
4481 | 5248 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4482 | 5249 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4485 | 5252 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4486 | 5253 | } |
---|
4487 | 5254 | |
---|
| 5255 | + if (tps != null && tps.length == 1) |
---|
| 5256 | + { |
---|
| 5257 | + EditSelection(false); |
---|
| 5258 | + } |
---|
| 5259 | + |
---|
| 5260 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5261 | + |
---|
4488 | 5262 | refreshContents(); |
---|
4489 | 5263 | //return true; |
---|
4490 | 5264 | } |
---|
.. | .. |
---|
4494 | 5268 | freezemodel = false; |
---|
4495 | 5269 | } |
---|
4496 | 5270 | |
---|
| 5271 | + void SetPinStates(boolean enabled) |
---|
| 5272 | + { |
---|
| 5273 | + editButton.setEnabled(enabled); |
---|
| 5274 | + uneditButton.setEnabled(enabled); |
---|
| 5275 | + //unselectButton.setEnabled(enabled); |
---|
| 5276 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5277 | + |
---|
| 5278 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5279 | + } |
---|
| 5280 | + |
---|
4497 | 5281 | void refreshContents(boolean cp) |
---|
4498 | 5282 | { |
---|
4499 | | - if (!Globals.MOUSEDRAGGED) |
---|
| 5283 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5284 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4500 | 5285 | { |
---|
4501 | 5286 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4502 | 5287 | |
---|
.. | .. |
---|
4595 | 5380 | |
---|
4596 | 5381 | if (cut) |
---|
4597 | 5382 | { |
---|
4598 | | - Save(); |
---|
| 5383 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5384 | +// Save(); |
---|
4599 | 5385 | //int indices[] = jList.getSelectedIndices(); |
---|
4600 | 5386 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4601 | 5387 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4698 | 5484 | |
---|
4699 | 5485 | void paste(boolean expand) |
---|
4700 | 5486 | { |
---|
| 5487 | + if (Globals.REPLACEONMAKE) |
---|
| 5488 | + Save(); |
---|
| 5489 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5490 | + Globals.REPLACEONMAKE = false; |
---|
4701 | 5491 | // if (GrafreeD.clipboard == null) |
---|
4702 | 5492 | // return; |
---|
4703 | 5493 | boolean first = true; |
---|
.. | .. |
---|
4757 | 5547 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4758 | 5548 | } |
---|
4759 | 5549 | |
---|
| 5550 | + Globals.REPLACEONMAKE = keep; |
---|
4760 | 5551 | ResetModel(); |
---|
4761 | 5552 | refreshContents(); |
---|
4762 | 5553 | } |
---|
.. | .. |
---|
4892 | 5683 | |
---|
4893 | 5684 | void group(Object3D csg, boolean grab) |
---|
4894 | 5685 | { |
---|
| 5686 | + if (Globals.REPLACEONMAKE) |
---|
| 5687 | + Save(); |
---|
| 5688 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5689 | + Globals.REPLACEONMAKE = false; |
---|
4895 | 5690 | if (//false) // why?? |
---|
4896 | 5691 | !group.selection.isEmpty()) |
---|
4897 | 5692 | { |
---|
.. | .. |
---|
5005 | 5800 | //node.add(csg); |
---|
5006 | 5801 | //makeSomething(node); |
---|
5007 | 5802 | makeSomething(csg); |
---|
| 5803 | + Globals.REPLACEONMAKE = keep; |
---|
5008 | 5804 | } |
---|
5009 | 5805 | |
---|
5010 | 5806 | void Ungroup(Object3D g) |
---|
5011 | 5807 | { |
---|
| 5808 | + if (Globals.REPLACEONMAKE) |
---|
| 5809 | + Save(); |
---|
| 5810 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5811 | + Globals.REPLACEONMAKE = false; |
---|
5012 | 5812 | if (g instanceof HiddenObject) |
---|
5013 | 5813 | { |
---|
5014 | 5814 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5025 | 5825 | objEditor.makeSomething(g.get(i), false); |
---|
5026 | 5826 | } |
---|
5027 | 5827 | } |
---|
| 5828 | + Globals.REPLACEONMAKE = keep; |
---|
5028 | 5829 | } |
---|
5029 | 5830 | |
---|
5030 | 5831 | void ungroup() |
---|
.. | .. |
---|
5313 | 6114 | cButton clearpanelButton; |
---|
5314 | 6115 | cButton unselectButton; |
---|
5315 | 6116 | |
---|
5316 | | - cButton minButton; |
---|
5317 | | - cButton maxButton; |
---|
5318 | | - cButton fullButton; |
---|
5319 | | - cButton undoButton; |
---|
5320 | | - cButton redoButton; |
---|
5321 | | - cButton saveButton; |
---|
| 6117 | + cButton restoreCameraButton; |
---|
| 6118 | + |
---|
5322 | 6119 | cButton oneStepButton; |
---|
| 6120 | + |
---|
| 6121 | + cButton groupButton; |
---|
| 6122 | + cButton ungroupButton; |
---|
| 6123 | + cButton compositeButton; |
---|
| 6124 | + cButton switchButton; |
---|
| 6125 | + cButton loopButton; |
---|
| 6126 | + cButton textureButton; |
---|
| 6127 | + |
---|
| 6128 | + cButton skybox1Button; |
---|
| 6129 | + cButton skybox2Button; |
---|
| 6130 | + cButton skybox3Button; |
---|
| 6131 | + cButton skybox4Button; |
---|
| 6132 | + cButton skybox5Button; |
---|
| 6133 | + cButton skybox6Button; |
---|
| 6134 | + cButton skybox7Button; |
---|
| 6135 | + |
---|
| 6136 | + cButton skybox11Button; |
---|
| 6137 | + cButton skybox12Button; |
---|
| 6138 | + cButton skybox13Button; |
---|
| 6139 | + cButton skybox14Button; |
---|
| 6140 | + cButton skybox15Button; |
---|
| 6141 | + cButton skybox16Button; |
---|
| 6142 | + cButton skybox17Button; |
---|
| 6143 | + |
---|
| 6144 | + cButton gridButton; |
---|
| 6145 | + cButton boxButton; |
---|
| 6146 | + cButton sphereButton; |
---|
| 6147 | + cButton coneButton; |
---|
| 6148 | + cButton torusButton; |
---|
| 6149 | + cButton superButton; |
---|
| 6150 | + cButton kleinButton; |
---|
| 6151 | + cButton particlesButton; |
---|
| 6152 | + cButton overlayButton; |
---|
| 6153 | + cButton lightButton; |
---|
5323 | 6154 | |
---|
5324 | 6155 | cButton screenfitButton; |
---|
5325 | 6156 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5341 | 6172 | //JTree jTree; |
---|
5342 | 6173 | private MenuItem lookAtItem; |
---|
5343 | 6174 | private MenuItem lookFromItem; |
---|
5344 | | - private MenuItem switchItem; |
---|
| 6175 | + private MenuItem switchViewItem; |
---|
5345 | 6176 | private MenuItem cutItem; |
---|
5346 | 6177 | private MenuItem undoItem; |
---|
5347 | 6178 | private MenuItem redoItem; |
---|
5348 | | - private MenuItem duplicateItem; |
---|
| 6179 | + private JMenuItem duplicateItem; |
---|
5349 | 6180 | private MenuItem cloneItem; |
---|
5350 | 6181 | private MenuItem cloneSupportItem; |
---|
5351 | 6182 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5373 | 6204 | private MenuItem pasteLinkItem; |
---|
5374 | 6205 | private MenuItem pasteCloneItem; |
---|
5375 | 6206 | private MenuItem pasteExpandItem; |
---|
5376 | | - private MenuItem clearItem; |
---|
| 6207 | + private MenuItem deleteItem; |
---|
5377 | 6208 | private MenuItem clearAllItem; |
---|
5378 | 6209 | private MenuItem genUVItem; |
---|
5379 | 6210 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5433 | 6264 | private MenuItem frontItem; |
---|
5434 | 6265 | private MenuItem cameraItem; |
---|
5435 | 6266 | private MenuItem compositeItem; |
---|
5436 | | - private MenuItem randomItem; |
---|
| 6267 | + private MenuItem switchItem; |
---|
5437 | 6268 | private MenuItem physicsItem; |
---|
5438 | 6269 | private MenuItem frameselectorItem; |
---|
5439 | 6270 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5457 | 6288 | private MenuItem attachBumpItem; |
---|
5458 | 6289 | private MenuItem detachBumpItem; |
---|
5459 | 6290 | private MenuItem pigmentBumpItem; |
---|
| 6291 | + private MenuItem embedTexturesItem; |
---|
| 6292 | + private MenuItem deEmbedTexturesItem; |
---|
5460 | 6293 | |
---|
5461 | 6294 | private MenuItem particleItem; |
---|
5462 | 6295 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5507 | 6340 | |
---|
5508 | 6341 | Menu cameraMenu; |
---|
5509 | 6342 | MenuItem editCameraItem; |
---|
5510 | | - MenuItem revertCameraItem; |
---|
| 6343 | + MenuItem restoreCameraItem; |
---|
5511 | 6344 | } |
---|