.. | .. |
---|
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, final String t, cGridBag row) |
---|
| 46 | + { |
---|
| 47 | + cButton textureButton; |
---|
| 48 | + final String path = "textures/" + f + "/"; // + t; |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF)); |
---|
| 50 | + textureButton.setToolTipText(f + "s"); |
---|
| 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 | + cameraView.repaint(); |
---|
| 354 | + } |
---|
| 355 | + |
---|
26 | 356 | //ObjEditor objEditor; |
---|
27 | 357 | public void closeUI2() |
---|
28 | 358 | { |
---|
.. | .. |
---|
60 | 390 | this.copy = this.group = group; |
---|
61 | 391 | //selectees = this.group.selectees; |
---|
62 | 392 | |
---|
| 393 | + if (copy.versionlist == null) |
---|
| 394 | + { |
---|
| 395 | + copy.versionlist = new Object3D[100]; |
---|
| 396 | + copy.versionindex = -1; |
---|
| 397 | + } |
---|
| 398 | + |
---|
63 | 399 | if(ui) |
---|
64 | 400 | SetupUI(objEditor); |
---|
65 | 401 | } |
---|
.. | .. |
---|
74 | 410 | this.copy = this.group = copy; |
---|
75 | 411 | //selectees = this.group.selectees; |
---|
76 | 412 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 413 | + SetupMenu2(this); //objEditor); |
---|
78 | 414 | SetupUI2(objEditor); |
---|
79 | 415 | objEditor.SetupUI(true); |
---|
80 | 416 | SetupViews(objEditor); |
---|
81 | 417 | |
---|
82 | 418 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 419 | + |
---|
| 420 | + if (copy.versionlist == null) |
---|
| 421 | + { |
---|
| 422 | + copy.versionlist = new Object3D[100]; |
---|
| 423 | + copy.versionindex = -1; |
---|
| 424 | + |
---|
| 425 | + Save(true); |
---|
| 426 | + } |
---|
83 | 427 | } |
---|
84 | 428 | |
---|
85 | 429 | void CloneSelection(boolean supports) |
---|
86 | 430 | { |
---|
| 431 | + if (Globals.REPLACEONMAKE) |
---|
| 432 | + Save(); |
---|
| 433 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 434 | + Globals.REPLACEONMAKE = false; |
---|
87 | 435 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 436 | //Object3D obj; |
---|
89 | 437 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 442 | |
---|
95 | 443 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 444 | } |
---|
| 445 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 446 | } |
---|
98 | 447 | |
---|
99 | 448 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
148 | 497 | |
---|
149 | 498 | //JTextField nameField; |
---|
150 | 499 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 500 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 501 | { |
---|
153 | | - if (Globals.ADVANCED) |
---|
154 | | - { |
---|
155 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
156 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
157 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
158 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
159 | | - oe.cameraMenu.add("-"); |
---|
160 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
161 | | - openWindowItem.addActionListener(this); |
---|
162 | | - editLeafItem.addActionListener(this); |
---|
163 | | - lookAtItem.addActionListener(this); |
---|
164 | | - //lookFromItem.addActinoListener(this); |
---|
165 | | - //switchItem.addActionListener(this); |
---|
166 | | - } |
---|
167 | | - |
---|
| 502 | + oe.jTree = new cTree(); |
---|
| 503 | + |
---|
168 | 504 | Menu menu; |
---|
169 | 505 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 506 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 507 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 508 | + |
---|
| 509 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 510 | +// undoItem.addActionListener(this); |
---|
| 511 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 512 | +// redoItem.addActionListener(this); |
---|
| 513 | +// menu.add("-"); |
---|
| 514 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 515 | duplicateItem.addActionListener(this); |
---|
174 | 516 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
175 | 517 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
185 | 527 | copyItem.addActionListener(this); |
---|
186 | 528 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 529 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 530 | |
---|
190 | 531 | menu.add("-"); |
---|
191 | 532 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
197 | 538 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
198 | 539 | // pasteExpandItem.addActionListener(this); |
---|
199 | 540 | menu.add("-"); |
---|
200 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
201 | | - clearItem.addActionListener(this); |
---|
| 541 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 542 | + deleteItem.addActionListener(this); |
---|
202 | 543 | |
---|
203 | 544 | if (Globals.ADVANCED) |
---|
204 | 545 | { |
---|
.. | .. |
---|
206 | 547 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 548 | clearAllItem.addActionListener(this); |
---|
208 | 549 | } |
---|
| 550 | + |
---|
| 551 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 552 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 553 | + //zBufferItem.addActionListener(this); |
---|
| 554 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 555 | + //normalLensItem.addActionListener(this); |
---|
| 556 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 557 | + restoreCameraItem.addActionListener(this); |
---|
| 558 | + |
---|
| 559 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 560 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 561 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 562 | +// cameraMenu.add("-"); |
---|
| 563 | +// |
---|
| 564 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 565 | +// toggleTextureItem.addItemListener(this); |
---|
| 566 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 567 | +// |
---|
| 568 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 569 | +// toggleSwitchItem.addItemListener(this); |
---|
| 570 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 571 | + |
---|
| 572 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 573 | + toggleHandleItem.addItemListener(this); |
---|
| 574 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 575 | + |
---|
| 576 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 577 | + togglePaintItem.addItemListener(this); |
---|
| 578 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 579 | + |
---|
| 580 | + if (Globals.ADVANCED) |
---|
| 581 | + { |
---|
| 582 | + cameraMenu.add("-"); |
---|
| 583 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 584 | + toggleLiveItem.addItemListener(this); |
---|
| 585 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 586 | |
---|
| 587 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 588 | + stepItem.addActionListener(this); |
---|
| 589 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 590 | + // toggleDLItem.addItemListener(this); |
---|
| 591 | + // toggleDLItem.setState(false); |
---|
| 592 | + |
---|
| 593 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 594 | + toggleRenderItem.addItemListener(this); |
---|
| 595 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 596 | + |
---|
| 597 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 598 | + toggleDebugItem.addItemListener(this); |
---|
| 599 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 600 | + |
---|
| 601 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 602 | + toggleFrustumItem.addItemListener(this); |
---|
| 603 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 604 | + |
---|
| 605 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 606 | + toggleFootContactItem.addItemListener(this); |
---|
| 607 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 608 | + |
---|
| 609 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 610 | + toggleTimelineItem.addItemListener(this); |
---|
| 611 | + } |
---|
| 612 | + |
---|
| 613 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 614 | +// toggleRootItem.addItemListener(this); |
---|
| 615 | +// toggleRootItem.setState(false); |
---|
| 616 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 617 | +// animationItem.addItemListener(this); |
---|
| 618 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 619 | + cameraMenu.add("-"); |
---|
| 620 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 621 | + editCameraItem.addActionListener(this); |
---|
| 622 | + |
---|
| 623 | + if (Globals.ADVANCED) |
---|
| 624 | + { |
---|
| 625 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 626 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 627 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 628 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 629 | + oe.cameraMenu.add("-"); |
---|
| 630 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 631 | + openWindowItem.addActionListener(this); |
---|
| 632 | + editLeafItem.addActionListener(this); |
---|
| 633 | + lookAtItem.addActionListener(this); |
---|
| 634 | + //lookFromItem.addActinoListener(this); |
---|
| 635 | + //switchViewItem.addActionListener(this); |
---|
| 636 | + } |
---|
| 637 | + |
---|
210 | 638 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 639 | if (Globals.ADVANCED) |
---|
212 | 640 | { |
---|
213 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
214 | | - resetMeshItem.addActionListener(this); |
---|
215 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
216 | | - stepAllItem.addActionListener(this); |
---|
217 | 641 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 642 | revertMeshItem.addActionListener(this); |
---|
219 | 643 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
253 | 677 | } |
---|
254 | 678 | |
---|
255 | 679 | oe.menuBar.add(menu = new Menu("Group")); |
---|
256 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
257 | | - grabItem.addActionListener(this); |
---|
| 680 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 681 | +// grabItem.addActionListener(this); |
---|
258 | 682 | backItem = menu.add(new MenuItem("Back")); |
---|
259 | 683 | backItem.addActionListener(this); |
---|
260 | 684 | frontItem = menu.add(new MenuItem("Front")); |
---|
261 | 685 | frontItem.addActionListener(this); |
---|
262 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
263 | | - compositeItem.addActionListener(this); |
---|
| 686 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 687 | +// compositeItem.addActionListener(this); |
---|
| 688 | + |
---|
| 689 | + if (Globals.ADVANCED) |
---|
| 690 | + { |
---|
264 | 691 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
265 | 692 | hideItem.addActionListener(this); |
---|
| 693 | + } |
---|
266 | 694 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
267 | 695 | ungroupItem.addActionListener(this); |
---|
268 | | - menu.add("-"); |
---|
269 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
270 | | - randomItem.addActionListener(this); |
---|
| 696 | + |
---|
| 697 | +// menu.add("-"); |
---|
| 698 | +// |
---|
| 699 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 700 | +// switchItem.addActionListener(this); |
---|
| 701 | + if (Globals.ADVANCED) |
---|
| 702 | + { |
---|
271 | 703 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
272 | 704 | switchGeoItem.addActionListener(this); |
---|
273 | 705 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
275 | 707 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
276 | 708 | morphItem.addActionListener(this); |
---|
277 | 709 | |
---|
278 | | - if (Globals.ADVANCED) |
---|
279 | | - { |
---|
280 | 710 | menu.add("-"); |
---|
281 | 711 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
282 | 712 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
284 | 714 | frameselectorItem.addActionListener(this); |
---|
285 | 715 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
286 | 716 | scriptNodeItem.addActionListener(this); |
---|
287 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
288 | | - cameraItem.addActionListener(this); |
---|
289 | 717 | } |
---|
290 | 718 | |
---|
291 | 719 | oe.menuBar.add(menu = new Menu("Object")); |
---|
292 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
293 | | - textureItem.addActionListener(this); |
---|
| 720 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 721 | +// textureItem.addActionListener(this); |
---|
294 | 722 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
295 | 723 | billboardItem.addActionListener(this); |
---|
296 | 724 | csgItem = menu.add(new MenuItem("CSG")); |
---|
297 | 725 | csgItem.addActionListener(this); |
---|
298 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 726 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
299 | 727 | shadowXItem.addActionListener(this); |
---|
300 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 728 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
301 | 729 | shadowYItem.addActionListener(this); |
---|
302 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 730 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
303 | 731 | shadowZItem.addActionListener(this); |
---|
| 732 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 733 | + attributeItem.addActionListener(this); |
---|
| 734 | + |
---|
304 | 735 | if (Globals.ADVANCED) |
---|
305 | 736 | { |
---|
306 | 737 | menu.add("-"); |
---|
307 | 738 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
308 | 739 | linkerItem.addActionListener(this); |
---|
309 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
310 | | - attributeItem.addActionListener(this); |
---|
311 | 740 | templateItem = menu.add(new MenuItem("Template")); |
---|
312 | 741 | templateItem.addActionListener(this); |
---|
313 | 742 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
318 | 747 | resetTransformItem.addActionListener(this); |
---|
319 | 748 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 749 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - transformgeometryItem.addActionListener(this); |
---|
| 750 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 751 | + resetCentroidXZItem.addActionListener(this); |
---|
| 752 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 753 | + transformGeometryItem.addActionListener(this); |
---|
| 754 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 755 | + transformChildrenItem.addActionListener(this); |
---|
323 | 756 | |
---|
324 | 757 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 758 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
332 | 765 | genNormalsMESHItem.addActionListener(this); |
---|
333 | 766 | if (Globals.ADVANCED) |
---|
334 | 767 | { |
---|
335 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 768 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
336 | 769 | genNormalsMINEItem.addActionListener(this); |
---|
337 | 770 | } |
---|
338 | 771 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
368 | 801 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 802 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 803 | clearMaterialsItem.addActionListener(this); |
---|
| 804 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 805 | + resetAllItem.addActionListener(this); |
---|
| 806 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 807 | + stepAllItem.addActionListener(this); |
---|
371 | 808 | menu.add("-"); |
---|
372 | 809 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 810 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
388 | 825 | markleavesItem.addActionListener(this); |
---|
389 | 826 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
390 | 827 | unmarkleavesItem.addActionListener(this); |
---|
| 828 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 829 | + rewindleavesItem.addActionListener(this); |
---|
| 830 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 831 | + unrewindleavesItem.addActionListener(this); |
---|
| 832 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 833 | + randomleavesItem.addActionListener(this); |
---|
| 834 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 835 | + unrandomleavesItem.addActionListener(this); |
---|
391 | 836 | menu.add("-"); |
---|
392 | 837 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
393 | 838 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
413 | 858 | attachBumpItem.addActionListener(this); |
---|
414 | 859 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
415 | 860 | pigmentBumpItem.addActionListener(this); |
---|
| 861 | + //embedTexturesItem |
---|
416 | 862 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
417 | 863 | detachPigmentItem.addActionListener(this); |
---|
418 | 864 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
419 | 865 | detachBumpItem.addActionListener(this); |
---|
| 866 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 867 | + embedTexturesItem.addActionListener(this); |
---|
| 868 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 869 | + deEmbedTexturesItem.addActionListener(this); |
---|
420 | 870 | menu.add("-"); |
---|
421 | 871 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
422 | 872 | sortbysizeItem.addActionListener(this); |
---|
423 | 873 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 874 | sortbynameItem.addActionListener(this); |
---|
| 875 | + menu.add("-"); |
---|
| 876 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 877 | + shareGeometriesItem.addActionListener(this); |
---|
| 878 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 879 | + mergeGeometriesItem.addActionListener(this); |
---|
425 | 880 | if (Globals.ADVANCED) |
---|
426 | 881 | { |
---|
427 | | - menu.add("-"); |
---|
| 882 | + // Pretty much the same as duplicate and clone. |
---|
428 | 883 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 884 | extractGeometriesItem.addActionListener(this); |
---|
430 | 885 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 886 | cloneGeometriesItem.addActionListener(this); |
---|
432 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
433 | | - shareGeometriesItem.addActionListener(this); |
---|
434 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
435 | | - mergeGeometriesItem.addActionListener(this); |
---|
436 | 887 | } |
---|
437 | 888 | |
---|
438 | 889 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 890 | buildCreateMenu(menu); |
---|
440 | 891 | |
---|
441 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
442 | | - importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
443 | | - importOBJItem.addActionListener(this); |
---|
444 | | - menu.add("-"); |
---|
445 | | - import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
446 | | - import3DSItem.addActionListener(this); |
---|
447 | | - menu.add("-"); |
---|
448 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
449 | | - importVRMLX3DItem.addActionListener(this); |
---|
450 | | - menu.add("-"); |
---|
451 | | - importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
452 | | - importGFDItem.addActionListener(this); |
---|
453 | | - |
---|
454 | 892 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
455 | 893 | buildToolsMenu(menu); |
---|
456 | 894 | } |
---|
457 | 895 | |
---|
| 896 | + JTabbedPane resourcecontainer; |
---|
| 897 | + cGridBag currenttab; |
---|
| 898 | + boolean added; // patch for jar |
---|
| 899 | + |
---|
| 900 | + int tabcount = 0; |
---|
| 901 | + int colcount = 0; |
---|
| 902 | + int rowcount = 0; |
---|
| 903 | + |
---|
| 904 | + int columns = 5; |
---|
| 905 | + int rows = 7; |
---|
| 906 | + |
---|
| 907 | + public void ResourceCallBack(String[] path) |
---|
| 908 | + { |
---|
| 909 | + for (int i = 0; i < path.length; i++) |
---|
| 910 | + System.out.print(path[i] + "/"); |
---|
| 911 | + System.out.println(); |
---|
| 912 | + if (rowcount == 0) |
---|
| 913 | + { |
---|
| 914 | + currenttab = new cGridBag(); |
---|
| 915 | + added = false; |
---|
| 916 | + String tabname = String.valueOf((char)('A'+tabcount)); |
---|
| 917 | + currenttab.setName(tabname); |
---|
| 918 | + rowcount = 1; |
---|
| 919 | + } |
---|
| 920 | + |
---|
| 921 | + if (path.length > 1 && path[1].toLowerCase().endsWith(".jpg")) |
---|
| 922 | + { |
---|
| 923 | + if (!added) |
---|
| 924 | + { |
---|
| 925 | + added = true; |
---|
| 926 | + resourcecontainer.add(currenttab); |
---|
| 927 | + String tabname = String.valueOf((char)('A'+tabcount)); |
---|
| 928 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 929 | + } |
---|
| 930 | + |
---|
| 931 | + AddTextureButton(path[0], path[1], currenttab); |
---|
| 932 | + if (++colcount >= columns) |
---|
| 933 | + { |
---|
| 934 | + colcount = 0; |
---|
| 935 | + currenttab.Return(); |
---|
| 936 | + |
---|
| 937 | + if (rowcount++ >= rows) |
---|
| 938 | + { |
---|
| 939 | + rowcount = 0; |
---|
| 940 | + } |
---|
| 941 | + } |
---|
| 942 | + } |
---|
| 943 | + else |
---|
| 944 | + { |
---|
| 945 | +// if (!path[path.length-1].equals("icons")) |
---|
| 946 | +// resourcecontainer.Return(); |
---|
| 947 | + } |
---|
| 948 | + } |
---|
| 949 | + |
---|
| 950 | + void CreateTexturePanel(cGridBag container) |
---|
| 951 | + { |
---|
| 952 | + resourcecontainer = new JTabbedPane(); |
---|
| 953 | + container.add(resourcecontainer); |
---|
| 954 | + |
---|
| 955 | + Grafreed.ParseResources("textures", this); |
---|
| 956 | + } |
---|
| 957 | + |
---|
458 | 958 | void SetupUI2(ObjEditor oe) |
---|
459 | 959 | { |
---|
| 960 | + // June 2019 |
---|
| 961 | + if (oe == null) |
---|
| 962 | + { |
---|
| 963 | + //super.SetupUI2(this); |
---|
| 964 | + //return; |
---|
| 965 | + } |
---|
| 966 | + |
---|
| 967 | + if (copy != group) |
---|
| 968 | + { |
---|
| 969 | + //super.SetupUI2(this); |
---|
| 970 | + } |
---|
| 971 | + |
---|
460 | 972 | //new Exception().printStackTrace(); |
---|
461 | 973 | |
---|
462 | 974 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
485 | 997 | oe.radioPanel.add(dummyButton); |
---|
486 | 998 | oe.buttonGroup.add(dummyButton); |
---|
487 | 999 | */ |
---|
| 1000 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1001 | + |
---|
| 1002 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 1003 | + |
---|
488 | 1004 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
489 | 1005 | |
---|
490 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
491 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 1006 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1007 | + //minButton.setToolTipText("Minimize window"); |
---|
| 1008 | + //minButton.addActionListener(this); |
---|
| 1009 | + |
---|
| 1010 | + if (Globals.ADVANCED) |
---|
| 1011 | + { |
---|
| 1012 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1013 | + maxButton.setToolTipText("Maximize window"); |
---|
| 1014 | + maxButton.addActionListener(this); |
---|
| 1015 | + } |
---|
| 1016 | + |
---|
| 1017 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1018 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 1019 | + fullButton.addActionListener(this); |
---|
| 1020 | + |
---|
| 1021 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1022 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 1023 | + screenfitButton.addActionListener(this); |
---|
| 1024 | + |
---|
| 1025 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1026 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 1027 | + restoreCameraButton.addActionListener(this); |
---|
| 1028 | + |
---|
| 1029 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1030 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 1031 | + saveVersionButton.addActionListener(this); |
---|
| 1032 | + |
---|
| 1033 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1034 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 1035 | + deleteVersionButton.addActionListener(this); |
---|
| 1036 | + |
---|
| 1037 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1038 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 1039 | + previousVersionButton.addActionListener(this); |
---|
| 1040 | + previousVersionButton.setEnabled(false); |
---|
| 1041 | + |
---|
| 1042 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 1043 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1044 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
| 1045 | + restoreButton.addActionListener(this); |
---|
| 1046 | + //restoreButton.setEnabled(false); |
---|
| 1047 | + |
---|
| 1048 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1049 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
| 1050 | + replaceButton.addActionListener(this); |
---|
| 1051 | + //replaceButton.setEnabled(false); |
---|
| 1052 | + |
---|
| 1053 | + copyOptionsPanel.add(updown); |
---|
| 1054 | + |
---|
| 1055 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1056 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 1057 | + nextVersionButton.addActionListener(this); |
---|
| 1058 | + nextVersionButton.setEnabled(false); |
---|
| 1059 | + |
---|
| 1060 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 1061 | + liveCB.setToolTipText("Enable animation"); |
---|
492 | 1062 | liveCB.addItemListener(this); |
---|
493 | 1063 | |
---|
494 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1064 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 1065 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
496 | 1066 | oneStepButton.addActionListener(this); |
---|
497 | 1067 | |
---|
498 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 1068 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
499 | 1069 | fastCB.setToolTipText("Fast mode"); |
---|
500 | 1070 | fastCB.addItemListener(this); |
---|
501 | 1071 | |
---|
502 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
503 | | - trackCB.setToolTipText("Enable tracking"); |
---|
504 | | - trackCB.addItemListener(this); |
---|
505 | | - |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
507 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
508 | | - screenfitButton.addActionListener(this); |
---|
| 1072 | + //oe.toolboxPanel.Return(); |
---|
| 1073 | + |
---|
| 1074 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1075 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 1076 | +// trackCB.addItemListener(this); |
---|
509 | 1077 | |
---|
510 | 1078 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
511 | 1079 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
515 | 1083 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 1084 | snapobjectButton.addActionListener(this); |
---|
517 | 1085 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 1086 | + |
---|
| 1087 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1088 | + fourButton.addActionListener(this); |
---|
| 1089 | + fourButton.setToolTipText("Show control panel only"); |
---|
518 | 1090 | } |
---|
519 | 1091 | |
---|
520 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | | - flashSelectionButton.addActionListener(this); |
---|
| 1092 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
523 | 1093 | |
---|
524 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | | - |
---|
526 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 1094 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1095 | + twoButton.setToolTipText("Show 3D view only"); |
---|
528 | 1096 | twoButton.addActionListener(this); |
---|
529 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | | - fourButton.addActionListener(this); |
---|
531 | | - fourButton.setToolTipText("Show left panel only"); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | | - sixButton.setToolTipText("2-column layout left"); |
---|
534 | | - sixButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 1097 | + this.fullscreenLayout = twoButton; |
---|
| 1098 | + |
---|
| 1099 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1100 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
537 | 1101 | threeButton.addActionListener(this); |
---|
538 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
539 | | - sevenButton.setToolTipText("3-column layout"); |
---|
540 | | - sevenButton.addActionListener(this); |
---|
| 1102 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1103 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1104 | + sixButton.addActionListener(this); |
---|
| 1105 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1106 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1107 | +// sevenButton.addActionListener(this); |
---|
541 | 1108 | // |
---|
542 | 1109 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 1110 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1111 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
545 | 1112 | rootButton.addActionListener(this); |
---|
546 | 1113 | |
---|
547 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1114 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
548 | 1115 | closeButton.setToolTipText("Close tab"); |
---|
549 | 1116 | closeButton.addActionListener(this); |
---|
550 | 1117 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
551 | 1118 | //clearButton.addActionListener(this); |
---|
552 | | - |
---|
553 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 1119 | + |
---|
| 1120 | + cGridBag row1 = new cGridBag(); |
---|
554 | 1121 | |
---|
555 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
556 | | - editButton.setToolTipText("Edit selection"); |
---|
| 1122 | + // INSERT |
---|
| 1123 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1124 | + gridButton.setToolTipText("Create grid"); |
---|
| 1125 | + gridButton.addActionListener(this); |
---|
| 1126 | + |
---|
| 1127 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1128 | + boxButton.setToolTipText("Create box"); |
---|
| 1129 | + boxButton.addActionListener(this); |
---|
| 1130 | + |
---|
| 1131 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1132 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1133 | + sphereButton.addActionListener(this); |
---|
| 1134 | + |
---|
| 1135 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1136 | + coneButton.setToolTipText("Create cone"); |
---|
| 1137 | + coneButton.addActionListener(this); |
---|
| 1138 | + |
---|
| 1139 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1140 | + torusButton.setToolTipText("Create torus"); |
---|
| 1141 | + torusButton.addActionListener(this); |
---|
| 1142 | + |
---|
| 1143 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1144 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1145 | + superButton.addActionListener(this); |
---|
| 1146 | + |
---|
| 1147 | + if (Globals.ADVANCED) |
---|
| 1148 | + { |
---|
| 1149 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1150 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 1151 | + kleinButton.addActionListener(this); |
---|
| 1152 | + } |
---|
| 1153 | + |
---|
| 1154 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1155 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 1156 | + particlesButton.addActionListener(this); |
---|
| 1157 | + |
---|
| 1158 | + oe.toolboxPanel.add(row1); |
---|
| 1159 | + |
---|
| 1160 | + cGridBag row2 = new cGridBag(); |
---|
| 1161 | + |
---|
| 1162 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1163 | + groupButton.setToolTipText("Create group"); |
---|
| 1164 | + groupButton.addActionListener(this); |
---|
| 1165 | + |
---|
| 1166 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1167 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1168 | + compositeButton.addActionListener(this); |
---|
| 1169 | + |
---|
| 1170 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1171 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1172 | + switchButton.addActionListener(this); |
---|
| 1173 | + |
---|
| 1174 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1175 | + loopButton.setToolTipText("Create loop"); |
---|
| 1176 | + loopButton.addActionListener(this); |
---|
| 1177 | + |
---|
| 1178 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1179 | + textureButton.setToolTipText("Create texture"); |
---|
| 1180 | + textureButton.addActionListener(this); |
---|
| 1181 | + |
---|
| 1182 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1183 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1184 | + overlayButton.addActionListener(this); |
---|
| 1185 | + |
---|
| 1186 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1187 | + lightButton.setToolTipText("Create light"); |
---|
| 1188 | + lightButton.addActionListener(this); |
---|
| 1189 | + |
---|
| 1190 | + oe.toolboxPanel.add(row2); |
---|
| 1191 | + |
---|
| 1192 | + cGridBag textures = new cGridBag(); |
---|
| 1193 | + |
---|
| 1194 | + CreateTexturePanel(textures); |
---|
| 1195 | + |
---|
| 1196 | + oe.toolboxPanel.add(textures); |
---|
| 1197 | + |
---|
| 1198 | + textures.preferredHeight = 100; |
---|
| 1199 | + |
---|
| 1200 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
| 1201 | + |
---|
| 1202 | + // EDIT panel |
---|
| 1203 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1204 | + editButton.setToolTipText("Pin selection controls"); |
---|
557 | 1205 | editButton.addActionListener(this); |
---|
558 | 1206 | |
---|
559 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
560 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 1207 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1208 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
561 | 1209 | uneditButton.addActionListener(this); |
---|
562 | 1210 | |
---|
563 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
564 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 1211 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 1212 | + allParamsButton.setToolTipText("Show all controls"); |
---|
565 | 1213 | allParamsButton.addActionListener(this); |
---|
566 | 1214 | |
---|
567 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
568 | | - clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1215 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1216 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
569 | 1217 | clearPanelButton.addActionListener(this); |
---|
570 | 1218 | |
---|
571 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
572 | | - unselectButton.setToolTipText("Unselect"); |
---|
573 | | - unselectButton.addActionListener(this); |
---|
| 1219 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1220 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1221 | + //unselectButton.addActionListener(this); |
---|
574 | 1222 | |
---|
575 | | - commandsPanel.preferredHeight = 1; |
---|
| 1223 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1224 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1225 | + flashSelectionButton.addActionListener(this); |
---|
576 | 1226 | |
---|
577 | | - oe.treePanel.add(commandsPanel); |
---|
578 | | - oe.treePanel.Return(); |
---|
| 1227 | + editCommandsPanel.preferredHeight = 1; |
---|
| 1228 | + |
---|
| 1229 | + SetPinStates(false); |
---|
| 1230 | +// oe.treePanel.add(commandsPanel); |
---|
| 1231 | +// oe.treePanel.Return(); |
---|
579 | 1232 | |
---|
580 | 1233 | // oe.aConstraints.gridx += 1; |
---|
581 | 1234 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
592 | 1245 | |
---|
593 | 1246 | JScrollPane jSP; |
---|
594 | 1247 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
595 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 1248 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
596 | 1249 | ResetModel(); |
---|
597 | 1250 | |
---|
598 | 1251 | oe.treePanel.add(jSPPanel); |
---|
599 | 1252 | oe.treePanel.Return(); |
---|
600 | 1253 | |
---|
601 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
602 | | - |
---|
603 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
604 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
605 | | - colorCB.addItemListener(this); |
---|
606 | | - |
---|
607 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
608 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
609 | | - materialCB.addItemListener(this); |
---|
610 | | - |
---|
611 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
612 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
613 | | - textureCB.addItemListener(this); |
---|
614 | | - |
---|
615 | | - copyOptionsPanel.preferredHeight = 1; |
---|
616 | 1254 | oe.treePanel.add(copyOptionsPanel); |
---|
617 | 1255 | oe.treePanel.Return(); |
---|
| 1256 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1257 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1258 | + sliderPane.preferredHeight = 1; |
---|
618 | 1259 | |
---|
619 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
620 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1260 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1261 | + mainPanel.setResizeWeight(0.4); |
---|
621 | 1262 | |
---|
622 | 1263 | //jList.addListSelectionListener(this); |
---|
623 | 1264 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
625 | 1266 | //jTree.setEditable(true); |
---|
626 | 1267 | oe.jTree.setDragEnabled(true); |
---|
627 | 1268 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
628 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1269 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
629 | 1270 | |
---|
630 | 1271 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
631 | 1272 | |
---|
.. | .. |
---|
637 | 1278 | dgr.addDragGestureListener(this); |
---|
638 | 1279 | }catch(Exception e) {} |
---|
639 | 1280 | */ |
---|
640 | | - radio.layout = sevenButton; |
---|
| 1281 | + radio.layout = threeButton; // sixButton; |
---|
641 | 1282 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
642 | 1283 | } |
---|
643 | 1284 | |
---|
644 | 1285 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
645 | 1286 | { |
---|
| 1287 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1288 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1289 | + colorCB.addItemListener(this); |
---|
| 1290 | + |
---|
| 1291 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1292 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1293 | + materialCB.addItemListener(this); |
---|
| 1294 | + |
---|
| 1295 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1296 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1297 | + textureCB.addItemListener(this); |
---|
| 1298 | + |
---|
| 1299 | + panel.Return(); |
---|
| 1300 | + |
---|
646 | 1301 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
647 | 1302 | boxCB.setToolTipText("Display bounding boxes"); |
---|
648 | 1303 | boxCB.addItemListener(this); |
---|
649 | 1304 | |
---|
650 | 1305 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
651 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1306 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
652 | 1307 | zoomBoxCB.addItemListener(this); |
---|
653 | 1308 | |
---|
654 | | - if (Globals.ADVANCED) |
---|
| 1309 | + if (true) // Globals.ADVANCED) |
---|
655 | 1310 | { |
---|
656 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
657 | | - supportCB.setToolTipText("Enable rigging"); |
---|
658 | | - supportCB.addItemListener(this); |
---|
| 1311 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1312 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1313 | +// supportCB.addItemListener(this); |
---|
| 1314 | + |
---|
| 1315 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1316 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1317 | + freezeCB.addItemListener(this); |
---|
659 | 1318 | |
---|
660 | 1319 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
661 | 1320 | // localCB.addItemListener(this); |
---|
662 | 1321 | |
---|
| 1322 | + panel.Return(); |
---|
| 1323 | + |
---|
663 | 1324 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
664 | 1325 | crowdCB.setToolTipText("Used for crowds"); |
---|
665 | 1326 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
668 | 1329 | smoothCB.setToolTipText("Snapping delay"); |
---|
669 | 1330 | smoothCB.addItemListener(this); |
---|
670 | 1331 | |
---|
671 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
672 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
673 | | - slowCB.addItemListener(this); |
---|
| 1332 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1333 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1334 | +// slowCB.addItemListener(this); |
---|
| 1335 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1336 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1337 | + minshaderCB.addItemListener(this); |
---|
674 | 1338 | |
---|
675 | 1339 | // constraints.gridy += 1; |
---|
676 | 1340 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
677 | 1341 | // speakerMocapCB.addItemListener(this); |
---|
678 | 1342 | |
---|
| 1343 | + panel.Return(); |
---|
| 1344 | + |
---|
679 | 1345 | if (false) |
---|
680 | 1346 | { |
---|
681 | 1347 | // handled in scripts |
---|
.. | .. |
---|
690 | 1356 | //constraints.gridy += 1; |
---|
691 | 1357 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
692 | 1358 | smoothfocusCB.addItemListener(this); |
---|
| 1359 | + panel.Return(); |
---|
693 | 1360 | } |
---|
694 | 1361 | |
---|
695 | 1362 | //constraints.gridx += 1; |
---|
696 | 1363 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
697 | 1364 | // debugCB.addItemListener(this); |
---|
698 | 1365 | |
---|
| 1366 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1367 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1368 | + trackCB.addItemListener(this); |
---|
| 1369 | + |
---|
699 | 1370 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 1371 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
700 | 1372 | oeilCB.addItemListener(this); |
---|
701 | 1373 | |
---|
| 1374 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 1375 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 1376 | + shadowCB.addItemListener(this); |
---|
| 1377 | + |
---|
| 1378 | + panel.Return(); |
---|
| 1379 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1380 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1381 | + toggleTextureCB.addItemListener(this); |
---|
| 1382 | + |
---|
| 1383 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1384 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1385 | + toggleSwitchCB.addItemListener(this); |
---|
| 1386 | + |
---|
| 1387 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1388 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1389 | + autokeepCB.addItemListener(this); |
---|
| 1390 | + |
---|
| 1391 | + panel.Return(); |
---|
| 1392 | + if (Globals.ADVANCED) |
---|
| 1393 | + { |
---|
702 | 1394 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
703 | 1395 | lookAtCB.setToolTipText("Look-at target"); |
---|
704 | 1396 | lookAtCB.addItemListener(this); |
---|
| 1397 | + } |
---|
705 | 1398 | |
---|
706 | 1399 | } |
---|
707 | 1400 | |
---|
708 | 1401 | cGridBag fill = new cGridBag(); |
---|
709 | | - |
---|
710 | 1402 | fill.preferredHeight = 200; |
---|
| 1403 | + cGridBag fill2 = new cGridBag(); |
---|
| 1404 | + fill2.preferredHeight = 200; |
---|
| 1405 | + cGridBag fill3 = new cGridBag(); |
---|
| 1406 | + fill3.preferredHeight = 200; |
---|
711 | 1407 | |
---|
712 | 1408 | panel.add(fill); |
---|
| 1409 | + panel.add(fill2); |
---|
| 1410 | + panel.add(fill3); |
---|
713 | 1411 | |
---|
714 | 1412 | } |
---|
715 | 1413 | |
---|
716 | 1414 | void EditObject(Object3D obj) |
---|
717 | 1415 | { |
---|
718 | 1416 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1417 | + |
---|
| 1418 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1419 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1420 | + if (!radioButton.hadMaterial) |
---|
| 1421 | + { |
---|
| 1422 | + obj.material = new cMaterial(); |
---|
| 1423 | + } |
---|
| 1424 | + |
---|
719 | 1425 | radioButton.SetObject(obj); |
---|
720 | | - radioButton.layout = sevenButton; |
---|
| 1426 | + radioButton.layout = threeButton; // sixButton; |
---|
721 | 1427 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
722 | 1428 | radioButton.addActionListener(this); |
---|
723 | 1429 | radioPanel.add(radioButton); |
---|
724 | 1430 | buttonGroup.add(radioButton); |
---|
725 | 1431 | radioButton.doClick(); |
---|
726 | 1432 | } |
---|
| 1433 | + |
---|
727 | 1434 | void SetupViews(ObjEditor oe) |
---|
728 | 1435 | { |
---|
| 1436 | + theFrame = this; |
---|
| 1437 | + |
---|
729 | 1438 | oe.SetupViews(); |
---|
730 | 1439 | |
---|
731 | 1440 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
734 | 1443 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
735 | 1444 | } |
---|
736 | 1445 | |
---|
737 | | - JCheckBox liveCB; |
---|
738 | | - JCheckBox supportCB; |
---|
739 | | - JCheckBox localCB; |
---|
740 | | - JCheckBox crowdCB; |
---|
741 | | - JCheckBox smoothCB; |
---|
742 | | - JCheckBox fastCB; |
---|
743 | | - JCheckBox slowCB; |
---|
744 | | - JCheckBox boxCB; |
---|
745 | | - JCheckBox zoomBoxCB; |
---|
746 | | - JCheckBox trackCB; |
---|
747 | | - JCheckBox smoothfocusCB; |
---|
| 1446 | + cToggleButton liveCB; |
---|
| 1447 | + cCheckBox supportCB; |
---|
| 1448 | + cCheckBox localCB; |
---|
| 1449 | + cCheckBox crowdCB; |
---|
| 1450 | + cCheckBox smoothCB; |
---|
| 1451 | + cCheckBox minshaderCB; |
---|
| 1452 | + |
---|
| 1453 | + cToggleButton fastCB; |
---|
| 1454 | + cCheckBox slowCB; |
---|
| 1455 | + cCheckBox boxCB; |
---|
| 1456 | + cCheckBox zoomBoxCB; |
---|
| 1457 | + cCheckBox freezeCB; |
---|
| 1458 | + //cToggleButton trackCB; |
---|
| 1459 | + cCheckBox trackCB; |
---|
| 1460 | + cCheckBox smoothfocusCB; |
---|
748 | 1461 | // JCheckBox speakerMocapCB; |
---|
749 | | - JCheckBox speakerCameraCB; |
---|
750 | | - JCheckBox speakerFocusCB; |
---|
751 | | - JCheckBox debugCB; |
---|
752 | | - JCheckBox oeilCB; |
---|
753 | | - JCheckBox lookAtCB; |
---|
| 1462 | + cCheckBox speakerCameraCB; |
---|
| 1463 | + cCheckBox speakerFocusCB; |
---|
| 1464 | + cCheckBox debugCB; |
---|
| 1465 | + |
---|
| 1466 | + cCheckBox oeilCB; |
---|
| 1467 | + cCheckBox shadowCB; |
---|
| 1468 | + cCheckBox autokeepCB; |
---|
| 1469 | + cCheckBox lookAtCB; |
---|
754 | 1470 | |
---|
755 | 1471 | // static int COLOR = 1; |
---|
756 | 1472 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
758 | 1474 | |
---|
759 | 1475 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
760 | 1476 | |
---|
761 | | - JCheckBox colorCB; |
---|
762 | | - JCheckBox materialCB; |
---|
763 | | - JCheckBox textureCB; |
---|
| 1477 | + cCheckBox colorCB; |
---|
| 1478 | + cCheckBox materialCB; |
---|
| 1479 | + cCheckBox textureCB; |
---|
764 | 1480 | |
---|
765 | 1481 | public void itemStateChanged(ItemEvent e) |
---|
766 | 1482 | { |
---|
.. | .. |
---|
788 | 1504 | } else if(e.getSource() == liveCB) |
---|
789 | 1505 | { |
---|
790 | 1506 | cameraView.ToggleLive(); |
---|
| 1507 | + refreshContents(false); |
---|
791 | 1508 | } |
---|
792 | 1509 | else if(e.getSource() == supportCB) |
---|
793 | 1510 | { |
---|
.. | .. |
---|
803 | 1520 | { |
---|
804 | 1521 | cameraView.ToggleInertia(); |
---|
805 | 1522 | cameraView.repaint(); |
---|
| 1523 | + } |
---|
| 1524 | + else if(e.getSource() == minshaderCB) |
---|
| 1525 | + { |
---|
| 1526 | + Globals.MINSHADER ^= true; |
---|
| 1527 | + cameraView.programInitialized = false; |
---|
| 1528 | + cameraView.repaint(); |
---|
806 | 1529 | } |
---|
807 | 1530 | else if(e.getSource() == localCB) |
---|
808 | 1531 | { |
---|
.. | .. |
---|
852 | 1575 | { |
---|
853 | 1576 | cameraView.ToggleOeil(); |
---|
854 | 1577 | } |
---|
| 1578 | + else if(e.getSource() == shadowCB) |
---|
| 1579 | + { |
---|
| 1580 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1581 | + } |
---|
| 1582 | + else if(e.getSource() == freezeCB) |
---|
| 1583 | + { |
---|
| 1584 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1585 | + } |
---|
| 1586 | + else if(e.getSource() == autokeepCB) |
---|
| 1587 | + { |
---|
| 1588 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1589 | + } |
---|
855 | 1590 | else if(e.getSource() == lookAtCB) |
---|
856 | 1591 | { |
---|
857 | 1592 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
868 | 1603 | |
---|
869 | 1604 | /**/ |
---|
870 | 1605 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
871 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1606 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1607 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
872 | 1608 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
873 | 1609 | // We can't move the root node or an empty selection |
---|
874 | 1610 | return; |
---|
.. | .. |
---|
931 | 1667 | } |
---|
932 | 1668 | } |
---|
933 | 1669 | |
---|
934 | | - String string = (String) object; |
---|
935 | | - |
---|
936 | 1670 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
937 | 1671 | // if( object instanceof java.io.File[]) |
---|
938 | 1672 | // { |
---|
.. | .. |
---|
940 | 1674 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
941 | 1675 | // return; |
---|
942 | 1676 | // } |
---|
| 1677 | + |
---|
| 1678 | + String string = object.toString(); |
---|
943 | 1679 | |
---|
944 | 1680 | // File path for Mac and Windows |
---|
945 | 1681 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
985 | 1721 | |
---|
986 | 1722 | assert target == objEditor.jTree; |
---|
987 | 1723 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1724 | + Object3D destinationLeaf; |
---|
988 | 1725 | try { |
---|
989 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1726 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
990 | 1727 | } catch (Exception e) { |
---|
991 | 1728 | System.out.println("destinationPath : " + destinationPath); |
---|
992 | 1729 | return; |
---|
993 | 1730 | } |
---|
994 | 1731 | |
---|
995 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1732 | + for (int i=group.selection.size(); --i>=0;) |
---|
996 | 1733 | { |
---|
| 1734 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1735 | + |
---|
| 1736 | + // Cannot move into itself |
---|
| 1737 | + if (child == destinationLeaf) |
---|
| 1738 | + return; |
---|
| 1739 | + } |
---|
| 1740 | + |
---|
| 1741 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1742 | +// { |
---|
997 | 1743 | loadClipboard(true); |
---|
998 | 1744 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
999 | 1745 | pasteInto(false, false); |
---|
1000 | | - } else { |
---|
1001 | | - loadClipboard(false); |
---|
1002 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1003 | | - pasteInto(false, false); // true); // ??? |
---|
1004 | | - } |
---|
| 1746 | +// } else { |
---|
| 1747 | +// loadClipboard(false); |
---|
| 1748 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1749 | +// pasteInto(false, false); // true); // ??? |
---|
| 1750 | +// } |
---|
1005 | 1751 | } |
---|
1006 | 1752 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1007 | 1753 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1106 | 1852 | { |
---|
1107 | 1853 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1108 | 1854 | //heightFieldItem.addActionListener(this); |
---|
1109 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1110 | | - gridItem.addActionListener(this); |
---|
1111 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1112 | | - rectoidItem.addActionListener(this); |
---|
1113 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1114 | | - ellipsoidItem.addActionListener(this); |
---|
1115 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1116 | | - coneItem.addActionListener(this); |
---|
1117 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1118 | | - torusItem.addActionListener(this); |
---|
1119 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1120 | | - superItem.addActionListener(this); |
---|
| 1855 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1856 | +// gridItem.addActionListener(this); |
---|
| 1857 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1858 | +// rectoidItem.addActionListener(this); |
---|
| 1859 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1860 | +// ellipsoidItem.addActionListener(this); |
---|
| 1861 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1862 | +// coneItem.addActionListener(this); |
---|
| 1863 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1864 | +// torusItem.addActionListener(this); |
---|
| 1865 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1866 | +// superItem.addActionListener(this); |
---|
| 1867 | + |
---|
| 1868 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1869 | + cameraItem.addActionListener(this); |
---|
| 1870 | + |
---|
| 1871 | + if (!Globals.ADVANCED) |
---|
| 1872 | + { |
---|
1121 | 1873 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1122 | 1874 | kleinItem.addActionListener(this); |
---|
1123 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1124 | | - particleItem.addActionListener(this); |
---|
| 1875 | + } |
---|
| 1876 | + |
---|
| 1877 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1878 | +// particleItem.addActionListener(this); |
---|
1125 | 1879 | if (Globals.ADVANCED) |
---|
1126 | 1880 | { |
---|
1127 | 1881 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1147 | 1901 | } |
---|
1148 | 1902 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1149 | 1903 | bezierItem.addActionListener(this); |
---|
1150 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1151 | | - overlayItem.addActionListener(this); |
---|
1152 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1153 | | - lightItem.addActionListener(this); |
---|
| 1904 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1905 | +// overlayItem.addActionListener(this); |
---|
| 1906 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1907 | +// lightItem.addActionListener(this); |
---|
1154 | 1908 | menu.add("-"); |
---|
1155 | 1909 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1156 | 1910 | //superLoopItem.addActionListener(this); |
---|
1157 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1158 | | - loopItem.addActionListener(this); |
---|
| 1911 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1912 | +// loopItem.addActionListener(this); |
---|
1159 | 1913 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1160 | 1914 | doubleItem.addActionListener(this); |
---|
1161 | 1915 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1171 | 1925 | animationItem.addItemListener(this); |
---|
1172 | 1926 | animationItem.setState(Globals.ANIMATION); |
---|
1173 | 1927 | |
---|
| 1928 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1929 | + archiveItem.addActionListener(this); |
---|
| 1930 | + |
---|
1174 | 1931 | menu.add("-"); |
---|
1175 | 1932 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1176 | 1933 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1183 | 1940 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1184 | 1941 | reduce34MorphItem.addActionListener(this); |
---|
1185 | 1942 | menu.add("-"); |
---|
| 1943 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1944 | + memoryItem.addActionListener(this); |
---|
1186 | 1945 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1187 | 1946 | computeAOItem.addActionListener(this); |
---|
1188 | 1947 | |
---|
.. | .. |
---|
1191 | 1950 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1192 | 1951 | mirrorItem.addActionListener(this); |
---|
1193 | 1952 | menu.add("-"); |
---|
1194 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1195 | | - memoryItem.addActionListener(this); |
---|
1196 | 1953 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1197 | 1954 | analyzeItem.addActionListener(this); |
---|
1198 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1955 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1199 | 1956 | dumpItem.addActionListener(this); |
---|
1200 | 1957 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1201 | 1958 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1336 | 2093 | shadow.material = new cMaterial(obj.material); |
---|
1337 | 2094 | shadow.material.diffuse = 0.0001f; |
---|
1338 | 2095 | shadow.material.specular = 0.0001f; |
---|
| 2096 | + //shadow.projectedVertices[1].x = 300; |
---|
1339 | 2097 | |
---|
1340 | 2098 | makeSomething(shadow); |
---|
1341 | 2099 | } |
---|
| 2100 | + |
---|
| 2101 | + private void ClearUnpinned() |
---|
| 2102 | + { |
---|
| 2103 | + //for (Object3D obj : listUI) |
---|
| 2104 | + for (int i=listUI.size(); --i>=0;) |
---|
| 2105 | + { |
---|
| 2106 | + Object3D obj = listUI.elementAt(i); |
---|
| 2107 | + if (!obj.pinned) |
---|
| 2108 | + { |
---|
| 2109 | + obj.CloseUI(); |
---|
| 2110 | + listUI.remove(i); |
---|
| 2111 | + } |
---|
| 2112 | + } |
---|
| 2113 | + } |
---|
| 2114 | + |
---|
| 2115 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2116 | + { |
---|
| 2117 | + // if (!(elem instanceof Composite)) |
---|
| 2118 | + // newWindow = false; |
---|
| 2119 | + listUI.add(elem); |
---|
| 2120 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2121 | + System.out.println("edit : " + elem); |
---|
| 2122 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 2123 | + } |
---|
1342 | 2124 | |
---|
1343 | 2125 | /** |
---|
1344 | 2126 | * applyExample |
---|
.. | .. |
---|
1583 | 2365 | { |
---|
1584 | 2366 | ScreenFit(); |
---|
1585 | 2367 | } else |
---|
1586 | | - if (source == switchItem) |
---|
| 2368 | + if (source == switchViewItem) |
---|
1587 | 2369 | { |
---|
1588 | 2370 | cVector v1 = new cVector(); |
---|
1589 | 2371 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1592 | 2374 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1593 | 2375 | objEditor.cameraView.repaint(); |
---|
1594 | 2376 | } else |
---|
1595 | | - if (source == rectoidItem) |
---|
| 2377 | + if (source == rectoidItem || source == boxButton) |
---|
1596 | 2378 | { |
---|
1597 | 2379 | makeSomething(new Box()); |
---|
1598 | 2380 | } else |
---|
1599 | | - if (source == particleItem) |
---|
| 2381 | + if (source == particleItem || source == particlesButton) |
---|
1600 | 2382 | { |
---|
1601 | 2383 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1602 | 2384 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1675 | 2457 | |
---|
1676 | 2458 | makeSomething(obj); |
---|
1677 | 2459 | } else |
---|
1678 | | - if (source == gridItem) |
---|
| 2460 | + if (source == gridItem || source == gridButton) |
---|
1679 | 2461 | { |
---|
1680 | 2462 | makeSomething(new Grid()); |
---|
1681 | 2463 | } else |
---|
1682 | | - if (source == ellipsoidItem) |
---|
| 2464 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1683 | 2465 | { |
---|
1684 | 2466 | makeSomething(new Sphere()); |
---|
1685 | 2467 | } else |
---|
1686 | | - if (source == coneItem) |
---|
| 2468 | + if (source == coneItem || source == coneButton) |
---|
1687 | 2469 | { |
---|
1688 | 2470 | makeSomething(new Cone()); |
---|
1689 | 2471 | } else |
---|
1690 | | - if (source == torusItem) |
---|
| 2472 | + if (source == torusItem || source == torusButton) |
---|
1691 | 2473 | { |
---|
1692 | 2474 | makeSomething(new Torus()); |
---|
1693 | 2475 | } else |
---|
1694 | | - if (source == superItem) |
---|
| 2476 | + if (source == superItem || source == superButton) |
---|
1695 | 2477 | { |
---|
1696 | 2478 | makeSomething(new Superellipsoid()); |
---|
1697 | 2479 | } else |
---|
1698 | | - if (source == kleinItem) |
---|
| 2480 | + if (source == kleinItem || source == kleinButton) |
---|
1699 | 2481 | { |
---|
1700 | 2482 | makeSomething(new Klein()); |
---|
1701 | 2483 | } else |
---|
.. | .. |
---|
1715 | 2497 | { |
---|
1716 | 2498 | makeSomething(new BezierSurface()); |
---|
1717 | 2499 | } else |
---|
1718 | | - if (source == overlayItem) |
---|
| 2500 | + if (source == overlayItem || source == overlayButton) |
---|
1719 | 2501 | { |
---|
1720 | 2502 | /* |
---|
1721 | 2503 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1763 | 2545 | s.setup(); |
---|
1764 | 2546 | makeSomething(s); |
---|
1765 | 2547 | } else |
---|
1766 | | - if (source == lightItem) |
---|
| 2548 | + if (source == lightItem || source == lightButton) |
---|
1767 | 2549 | { |
---|
1768 | 2550 | makeSomething(new Light()); |
---|
1769 | 2551 | } else |
---|
| 2552 | +// if (source == skybox1Button || |
---|
| 2553 | +// source == skybox2Button || |
---|
| 2554 | +// source == skybox3Button || |
---|
| 2555 | +// source == skybox4Button || |
---|
| 2556 | +// source == skybox5Button || |
---|
| 2557 | +// source == skybox6Button || |
---|
| 2558 | +// source == skybox7Button || |
---|
| 2559 | +// source == skybox11Button || |
---|
| 2560 | +// source == skybox12Button || |
---|
| 2561 | +// source == skybox13Button || |
---|
| 2562 | +// source == skybox14Button || |
---|
| 2563 | +// source == skybox15Button || |
---|
| 2564 | +// source == skybox16Button || |
---|
| 2565 | +// source == skybox17Button) |
---|
| 2566 | +// { |
---|
| 2567 | +// ChangeSkybox(source); |
---|
| 2568 | +// } else |
---|
1770 | 2569 | if (source == csgItem) |
---|
1771 | 2570 | { |
---|
1772 | 2571 | group(new CSG()); |
---|
.. | .. |
---|
1813 | 2612 | |
---|
1814 | 2613 | group(g); |
---|
1815 | 2614 | } else |
---|
1816 | | - if (source == loopItem) |
---|
| 2615 | + if (source == loopItem || source == loopButton) |
---|
1817 | 2616 | { |
---|
1818 | 2617 | Composite csg = new GroupLeaf(); |
---|
1819 | 2618 | csg.count = 5; |
---|
1820 | 2619 | group(csg); |
---|
1821 | | - Composite child = new cGroup(); |
---|
| 2620 | + Composite child = new cGroup("Branch"); |
---|
1822 | 2621 | csg.addChild(child); |
---|
1823 | 2622 | child.addChild(csg); |
---|
1824 | 2623 | } else |
---|
1825 | 2624 | if (source == doubleItem) |
---|
1826 | 2625 | { |
---|
1827 | | - Composite csg = new GroupLeaf(); |
---|
| 2626 | + Composite csg = new GroupLeaf("Fork"); |
---|
1828 | 2627 | csg.count = 5; |
---|
1829 | 2628 | group(csg); |
---|
1830 | | - Composite child = new cGroup(); |
---|
| 2629 | + Composite child = new cGroup("Branch A"); |
---|
1831 | 2630 | csg.addChild(child); |
---|
1832 | 2631 | child.addChild(csg); |
---|
1833 | | - child = new cGroup(); |
---|
| 2632 | + child = new cGroup("Branch B"); |
---|
1834 | 2633 | csg.addChild(child); |
---|
1835 | 2634 | child.addChild(csg); |
---|
1836 | 2635 | } else |
---|
1837 | 2636 | if (source == tripleItem) |
---|
1838 | 2637 | { |
---|
1839 | | - Composite csg = new GroupLeaf(); |
---|
| 2638 | + Composite csg = new GroupLeaf("Trident"); |
---|
1840 | 2639 | csg.count = 4; |
---|
1841 | 2640 | group(csg); |
---|
1842 | 2641 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1849 | 2648 | csg.addChild(child); |
---|
1850 | 2649 | child.addChild(csg); |
---|
1851 | 2650 | } else |
---|
1852 | | - |
---|
1853 | | - if (source == importGFDItem) |
---|
1854 | | - { |
---|
1855 | | - ImportGFD(); |
---|
1856 | | - } else |
---|
1857 | | - if (source == importVRMLX3DItem) |
---|
1858 | | - { |
---|
1859 | | - ImportVRMLX3D(); |
---|
1860 | | - } else |
---|
1861 | | - if (source == import3DSItem) |
---|
1862 | | - { |
---|
1863 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1864 | | - } else |
---|
1865 | | - if (source == importOBJItem) |
---|
1866 | | - { |
---|
1867 | | - //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1868 | | - FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
1869 | | - browser.setVisible(true); |
---|
1870 | | - String filename = browser.getFile(); |
---|
1871 | | - if (filename != null && filename.length() > 0) |
---|
1872 | | - { |
---|
1873 | | - String fullname = browser.getDirectory() + filename; |
---|
1874 | | - makeSomething(ReadOBJ(fullname), true); |
---|
1875 | | - } |
---|
1876 | | - } else |
---|
1877 | 2651 | if (source == computeAOItem) |
---|
1878 | 2652 | { |
---|
1879 | 2653 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1880 | | - Globals.theRenderer.repaint(); |
---|
| 2654 | + cameraView.repaint(); |
---|
1881 | 2655 | } else |
---|
1882 | 2656 | if (source == recompileItem) |
---|
1883 | 2657 | { |
---|
.. | .. |
---|
1892 | 2666 | if (source == invariantsItem) |
---|
1893 | 2667 | { |
---|
1894 | 2668 | System.out.println("Invariants:"); |
---|
1895 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2669 | + Grafreed.grafreed.universe.invariants(); |
---|
1896 | 2670 | } else |
---|
1897 | 2671 | if (source == memoryItem) |
---|
1898 | 2672 | { |
---|
.. | .. |
---|
1911 | 2685 | { |
---|
1912 | 2686 | DumpObject(); |
---|
1913 | 2687 | } else |
---|
| 2688 | + if (source == minButton) |
---|
| 2689 | + { |
---|
| 2690 | + Minimize(); |
---|
| 2691 | + } else |
---|
| 2692 | + if (source == maxButton) |
---|
| 2693 | + { |
---|
| 2694 | + Maximize(); |
---|
| 2695 | + } else |
---|
| 2696 | + if (source == fullButton) |
---|
| 2697 | + { |
---|
| 2698 | + ToggleFullScreen(); |
---|
| 2699 | + } else |
---|
| 2700 | + if (source == previousVersionButton) |
---|
| 2701 | + { |
---|
| 2702 | + // Go to previous version |
---|
| 2703 | + //if (!Undo()) |
---|
| 2704 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2705 | + PreviousVersion(); |
---|
| 2706 | + } else |
---|
| 2707 | + if (source == restoreButton) |
---|
| 2708 | + { |
---|
| 2709 | + // Restore current version |
---|
| 2710 | + Restore(); |
---|
| 2711 | + //restoreButton.setEnabled(false); |
---|
| 2712 | + } else |
---|
| 2713 | + if (source == replaceButton) |
---|
| 2714 | + { |
---|
| 2715 | + // Overwrite current version |
---|
| 2716 | + Replace(); |
---|
| 2717 | + //replaceButton.setEnabled(false); |
---|
| 2718 | + } else |
---|
| 2719 | + if (source == nextVersionButton) |
---|
| 2720 | + { |
---|
| 2721 | + // Go to next version |
---|
| 2722 | + NextVersion(); |
---|
| 2723 | + } else |
---|
| 2724 | + if (source == saveVersionButton) |
---|
| 2725 | + { |
---|
| 2726 | + // Save a new version |
---|
| 2727 | + if (!Save(true)) |
---|
| 2728 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2729 | + } else |
---|
| 2730 | + if (source == deleteVersionButton) |
---|
| 2731 | + { |
---|
| 2732 | + // Delete a new version |
---|
| 2733 | + DeleteVersion(); |
---|
| 2734 | + } else |
---|
1914 | 2735 | if (source == oneStepButton) |
---|
1915 | 2736 | { |
---|
1916 | 2737 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1918 | 2739 | } else |
---|
1919 | 2740 | if (source == screenfitButton) |
---|
1920 | 2741 | { |
---|
1921 | | - //Reload(lastConverter, lastFilename, true); |
---|
1922 | 2742 | ScreenFit(); |
---|
1923 | 2743 | } else |
---|
1924 | 2744 | if (source == screenfitpointButton) |
---|
1925 | 2745 | { |
---|
1926 | | - //Reload(lastConverter, lastFilename, true); |
---|
1927 | 2746 | ScreenFitPoint(); |
---|
1928 | 2747 | } else |
---|
1929 | 2748 | if (source == snapobjectButton) |
---|
1930 | 2749 | { |
---|
1931 | | - //Reload(lastConverter, lastFilename, true); |
---|
1932 | 2750 | SnapObject(); |
---|
1933 | 2751 | } else |
---|
1934 | 2752 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1964 | 2782 | if (source == cutItem || source == clearButton) |
---|
1965 | 2783 | { |
---|
1966 | 2784 | loadClipboard(true); |
---|
| 2785 | + } else |
---|
| 2786 | + if (source == undoItem) |
---|
| 2787 | + { |
---|
| 2788 | + PreviousVersion(); |
---|
| 2789 | + } else |
---|
| 2790 | + if (source == redoItem) |
---|
| 2791 | + { |
---|
| 2792 | + NextVersion(); |
---|
1967 | 2793 | } else |
---|
1968 | 2794 | if (source == duplicateItem) |
---|
1969 | 2795 | { |
---|
.. | .. |
---|
2276 | 3102 | { |
---|
2277 | 3103 | RevertMeshes(); |
---|
2278 | 3104 | } else |
---|
2279 | | - if (source == resetMeshItem) |
---|
| 3105 | + if (source == resetAllItem) |
---|
2280 | 3106 | { |
---|
2281 | 3107 | ResetAll(); |
---|
2282 | 3108 | } else |
---|
.. | .. |
---|
2284 | 3110 | { |
---|
2285 | 3111 | StepAll(); |
---|
2286 | 3112 | } else |
---|
2287 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 3113 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2288 | 3114 | { |
---|
2289 | 3115 | //int indices[] = jList.getSelectedIndices(); |
---|
2290 | 3116 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2296 | 3122 | { |
---|
2297 | 3123 | ClearSelection(true); |
---|
2298 | 3124 | } else |
---|
2299 | | - if (source == grabItem) |
---|
| 3125 | + if (source == grabItem || source == groupButton) |
---|
2300 | 3126 | { |
---|
2301 | | - group(new cGroup(), true); |
---|
| 3127 | + group(new cGroup(), false); // true); |
---|
2302 | 3128 | } else |
---|
2303 | 3129 | if (source == hideItem) |
---|
2304 | 3130 | { |
---|
.. | .. |
---|
2316 | 3142 | { |
---|
2317 | 3143 | makeSomething(new Camera()); |
---|
2318 | 3144 | } else |
---|
2319 | | - if (source == compositeItem) |
---|
| 3145 | + if (source == compositeItem || source == compositeButton) |
---|
2320 | 3146 | { |
---|
2321 | 3147 | group(new Composite()); |
---|
2322 | 3148 | } else |
---|
2323 | | - if (source == randomItem) |
---|
| 3149 | + if (source == switchItem || source == switchButton) |
---|
2324 | 3150 | { |
---|
2325 | 3151 | RandomNode random = new RandomNode(); |
---|
2326 | 3152 | group(random); |
---|
.. | .. |
---|
2422 | 3248 | { |
---|
2423 | 3249 | group(new cLinker()); |
---|
2424 | 3250 | } else |
---|
2425 | | - if (source == textureItem) |
---|
| 3251 | + if (source == textureItem || source == textureButton) |
---|
2426 | 3252 | { |
---|
2427 | 3253 | group(new TextureNode()); |
---|
2428 | 3254 | } else |
---|
.. | .. |
---|
2442 | 3268 | { |
---|
2443 | 3269 | CastShadow(2); |
---|
2444 | 3270 | } else |
---|
2445 | | - if (source == ungroupItem) |
---|
| 3271 | + if (source == ungroupItem || source == ungroupButton) |
---|
2446 | 3272 | { |
---|
2447 | | - //ungroup(); |
---|
| 3273 | + boolean hasRoot = false; |
---|
| 3274 | + |
---|
2448 | 3275 | for (int i=0; i<group.selection.size(); i++) |
---|
2449 | 3276 | { |
---|
2450 | | - Ungroup(group.selection.get(i)); |
---|
| 3277 | + if (group.selection.get(i) == group) |
---|
| 3278 | + { |
---|
| 3279 | + hasRoot = true; |
---|
| 3280 | + break; |
---|
| 3281 | + } |
---|
2451 | 3282 | } |
---|
2452 | 3283 | |
---|
2453 | | - ClearSelection(false); |
---|
2454 | | - |
---|
2455 | | - refreshContents(); |
---|
| 3284 | + if (!hasRoot) |
---|
| 3285 | + { |
---|
| 3286 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3287 | + { |
---|
| 3288 | + Ungroup(group.selection.get(i)); |
---|
| 3289 | + } |
---|
| 3290 | + |
---|
| 3291 | + ClearSelection(false); |
---|
| 3292 | + |
---|
| 3293 | + refreshContents(); |
---|
| 3294 | + } |
---|
2456 | 3295 | } else |
---|
2457 | 3296 | if (source == genUVItem) |
---|
2458 | 3297 | { |
---|
.. | .. |
---|
2464 | 3303 | } else |
---|
2465 | 3304 | if (source == genNormalsMESHItem) |
---|
2466 | 3305 | { |
---|
2467 | | - GenNormals(true); // TODO |
---|
| 3306 | + GenNormalsMESH(); |
---|
2468 | 3307 | } else |
---|
2469 | 3308 | if (source == genNormalsORGANItem) |
---|
2470 | 3309 | { |
---|
.. | .. |
---|
2529 | 3368 | if (source == unmarkleavesItem) |
---|
2530 | 3369 | { |
---|
2531 | 3370 | MarkLeaves(false); |
---|
| 3371 | + } else |
---|
| 3372 | + if (source == rewindleavesItem) |
---|
| 3373 | + { |
---|
| 3374 | + RewindLeaves(true); |
---|
| 3375 | + } else |
---|
| 3376 | + if (source == unrewindleavesItem) |
---|
| 3377 | + { |
---|
| 3378 | + RewindLeaves(false); |
---|
| 3379 | + } else |
---|
| 3380 | + if (source == randomleavesItem) |
---|
| 3381 | + { |
---|
| 3382 | + RandomLeaves(true); |
---|
| 3383 | + } else |
---|
| 3384 | + if (source == unrandomleavesItem) |
---|
| 3385 | + { |
---|
| 3386 | + RandomLeaves(false); |
---|
2532 | 3387 | } else |
---|
2533 | 3388 | if (source == flipVItem) |
---|
2534 | 3389 | { |
---|
.. | .. |
---|
2614 | 3469 | { |
---|
2615 | 3470 | SmoothMesh(); |
---|
2616 | 3471 | } else |
---|
2617 | | - if (source == transformgeometryItem) |
---|
| 3472 | + if (source == transformGeometryItem) |
---|
2618 | 3473 | { |
---|
2619 | 3474 | TransformGeometry(); |
---|
| 3475 | + } else |
---|
| 3476 | + if (source == transformChildrenItem) |
---|
| 3477 | + { |
---|
| 3478 | + TransformChildren(); |
---|
2620 | 3479 | } else |
---|
2621 | 3480 | if (source == resetTransformItem) |
---|
2622 | 3481 | { |
---|
.. | .. |
---|
2624 | 3483 | } else |
---|
2625 | 3484 | if (source == resetCentroidItem) |
---|
2626 | 3485 | { |
---|
2627 | | - ResetCentroid(); |
---|
| 3486 | + ResetCentroid(true); |
---|
| 3487 | + } else |
---|
| 3488 | + if (source == resetCentroidXZItem) |
---|
| 3489 | + { |
---|
| 3490 | + ResetCentroid(false); |
---|
2628 | 3491 | } else |
---|
2629 | 3492 | if (source == resetParentItem) |
---|
2630 | 3493 | { |
---|
.. | .. |
---|
2729 | 3592 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2730 | 3593 | { |
---|
2731 | 3594 | obj = (Object3D)e.nextElement(); |
---|
2732 | | - obj.SetBumpTexture(null); |
---|
| 3595 | + obj.ResetBumpTexture(); |
---|
2733 | 3596 | } |
---|
2734 | 3597 | |
---|
2735 | 3598 | refreshContents(); |
---|
.. | .. |
---|
2745 | 3608 | |
---|
2746 | 3609 | refreshContents(); |
---|
2747 | 3610 | } else |
---|
| 3611 | + if (source == embedTexturesItem) |
---|
| 3612 | + { |
---|
| 3613 | + Object3D obj; |
---|
| 3614 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3615 | + { |
---|
| 3616 | + obj = (Object3D)e.nextElement(); |
---|
| 3617 | + obj.EmbedTextures(true); |
---|
| 3618 | + } |
---|
| 3619 | + |
---|
| 3620 | + refreshContents(); |
---|
| 3621 | + } else |
---|
| 3622 | + if (source == deEmbedTexturesItem) |
---|
| 3623 | + { |
---|
| 3624 | + Object3D obj; |
---|
| 3625 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3626 | + { |
---|
| 3627 | + obj = (Object3D)e.nextElement(); |
---|
| 3628 | + obj.EmbedTextures(false); |
---|
| 3629 | + } |
---|
| 3630 | + |
---|
| 3631 | + CameraPane.texturepigment.clear(); |
---|
| 3632 | + CameraPane.texturebump.clear(); |
---|
| 3633 | + |
---|
| 3634 | + refreshContents(); |
---|
| 3635 | + } else |
---|
2748 | 3636 | if (source == flashSelectionButton) |
---|
2749 | 3637 | { |
---|
2750 | 3638 | CameraPane.flash = true; |
---|
.. | .. |
---|
2756 | 3644 | if (source == twoButton) |
---|
2757 | 3645 | { |
---|
2758 | 3646 | radio.layout = twoButton; |
---|
| 3647 | + |
---|
| 3648 | + if (CameraPane.FULLSCREEN) |
---|
| 3649 | + fullscreenLayout = radio.layout; |
---|
| 3650 | + |
---|
2759 | 3651 | // bug |
---|
2760 | 3652 | //gridPanel.setDividerLocation(1.0); |
---|
2761 | 3653 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2788 | 3680 | bigThree.ClearUI(); |
---|
2789 | 3681 | bigThree.add(centralPanel); |
---|
2790 | 3682 | bigThree.FlushUI(); |
---|
| 3683 | + |
---|
| 3684 | + cameraView.requestFocusInWindow(); |
---|
| 3685 | + |
---|
| 3686 | +// refreshContents(true); |
---|
| 3687 | +// |
---|
| 3688 | +// try |
---|
| 3689 | +// { |
---|
| 3690 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3691 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3692 | +// bot.mouseMove(100, 100); |
---|
| 3693 | +// bot.mousePress(mask); |
---|
| 3694 | +// bot.mouseRelease(mask); |
---|
| 3695 | +// } |
---|
| 3696 | +// catch (Exception e) |
---|
| 3697 | +// { |
---|
| 3698 | +// |
---|
| 3699 | +// } |
---|
| 3700 | + |
---|
2791 | 3701 | } else |
---|
2792 | 3702 | if (source == threeButton) |
---|
2793 | 3703 | { |
---|
2794 | 3704 | radio.layout = threeButton; |
---|
| 3705 | + |
---|
| 3706 | + if (CameraPane.FULLSCREEN) |
---|
| 3707 | + fullscreenLayout = radio.layout; |
---|
2795 | 3708 | |
---|
2796 | 3709 | // bigThree.remove(scenePanel); |
---|
2797 | 3710 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2821 | 3734 | // centralPanel.setVisible(true); |
---|
2822 | 3735 | // XYZPanel.setVisible(true); |
---|
2823 | 3736 | bigThree.ClearUI(); |
---|
| 3737 | + bigThree.add(scenePanel); |
---|
2824 | 3738 | bigThree.add(centralPanel); |
---|
2825 | | - bigThree.add(XYZPanel); |
---|
2826 | 3739 | bigThree.FlushUI(); |
---|
| 3740 | + |
---|
| 3741 | + cameraView.requestFocusInWindow(); |
---|
2827 | 3742 | } else |
---|
2828 | 3743 | if (source == fourButton) |
---|
2829 | 3744 | { |
---|
2830 | 3745 | radio.layout = fourButton; |
---|
| 3746 | + |
---|
| 3747 | + if (CameraPane.FULLSCREEN) |
---|
| 3748 | + fullscreenLayout = radio.layout; |
---|
2831 | 3749 | |
---|
2832 | 3750 | // bigThree.remove(scenePanel); |
---|
2833 | 3751 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2859 | 3777 | bigThree.ClearUI(); |
---|
2860 | 3778 | bigThree.add(scenePanel); |
---|
2861 | 3779 | bigThree.FlushUI(); |
---|
| 3780 | + |
---|
| 3781 | + cameraView.requestFocusInWindow(); |
---|
2862 | 3782 | } else |
---|
2863 | 3783 | if (source == sixButton) |
---|
2864 | 3784 | { |
---|
2865 | 3785 | radio.layout = sixButton; |
---|
| 3786 | + |
---|
| 3787 | + if (CameraPane.FULLSCREEN) |
---|
| 3788 | + fullscreenLayout = radio.layout; |
---|
2866 | 3789 | |
---|
2867 | 3790 | // bigThree.remove(scenePanel); |
---|
2868 | 3791 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2892 | 3815 | // centralPanel.setVisible(true); |
---|
2893 | 3816 | // XYZPanel.setVisible(false); |
---|
2894 | 3817 | bigThree.ClearUI(); |
---|
2895 | | - bigThree.add(scenePanel); |
---|
2896 | 3818 | bigThree.add(centralPanel); |
---|
| 3819 | + bigThree.add(scenePanel); |
---|
2897 | 3820 | bigThree.FlushUI(); |
---|
| 3821 | + |
---|
| 3822 | + cameraView.requestFocusInWindow(); |
---|
2898 | 3823 | } else |
---|
2899 | 3824 | if (source == sevenButton) |
---|
2900 | 3825 | { |
---|
2901 | 3826 | radio.layout = sevenButton; |
---|
| 3827 | + |
---|
| 3828 | + if (CameraPane.FULLSCREEN) |
---|
| 3829 | + fullscreenLayout = radio.layout; |
---|
2902 | 3830 | |
---|
2903 | 3831 | // bigThree.remove(scenePanel); |
---|
2904 | 3832 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2932 | 3860 | bigThree.add(centralPanel); |
---|
2933 | 3861 | bigThree.add(XYZPanel); |
---|
2934 | 3862 | bigThree.FlushUI(); |
---|
| 3863 | + |
---|
| 3864 | + cameraView.requestFocusInWindow(); |
---|
2935 | 3865 | } else |
---|
2936 | 3866 | if (source == rootButton) |
---|
2937 | 3867 | { |
---|
.. | .. |
---|
2943 | 3873 | EditObject(obj); |
---|
2944 | 3874 | } |
---|
2945 | 3875 | |
---|
| 3876 | + cameraView.requestFocusInWindow(); |
---|
2946 | 3877 | refreshContents(true); |
---|
2947 | 3878 | } else |
---|
2948 | 3879 | if (source == closeButton) |
---|
.. | .. |
---|
2952 | 3883 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2953 | 3884 | { |
---|
2954 | 3885 | ab = (cRadio)e.nextElement(); |
---|
2955 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3886 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2956 | 3887 | { |
---|
| 3888 | + // Patch to avoid bug with transparency. |
---|
| 3889 | + if (!ab.hadMaterial) |
---|
| 3890 | + { |
---|
| 3891 | + ab.object.material = null; |
---|
| 3892 | + } |
---|
| 3893 | + |
---|
2957 | 3894 | buttonGroup.remove(ab); |
---|
2958 | 3895 | radioPanel.remove(ab); |
---|
2959 | 3896 | |
---|
2960 | | - ab.GetObject().editWindow = null; |
---|
| 3897 | + //ab.GetObject().editWindow = null; |
---|
| 3898 | + ab.GetObject().manipWindow = null; |
---|
2961 | 3899 | // ab.GetObject().objectUI = null; // ????????? |
---|
2962 | 3900 | |
---|
2963 | 3901 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2964 | 3902 | break; |
---|
2965 | 3903 | } |
---|
2966 | 3904 | } |
---|
| 3905 | + |
---|
| 3906 | + cameraView.requestFocusInWindow(); |
---|
2967 | 3907 | refreshContents(true); |
---|
2968 | 3908 | } else |
---|
2969 | 3909 | if (source == editItem || source == editButton) |
---|
2970 | 3910 | { |
---|
| 3911 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3912 | + { |
---|
| 3913 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3914 | + child.pinned = true; |
---|
| 3915 | + } |
---|
| 3916 | + |
---|
2971 | 3917 | EditSelection(false); |
---|
2972 | 3918 | } else |
---|
2973 | 3919 | if (source == uneditButton) |
---|
.. | .. |
---|
2976 | 3922 | { |
---|
2977 | 3923 | Object3D child = (Object3D)e.nextElement(); |
---|
2978 | 3924 | if(child.editWindow != null) |
---|
2979 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3925 | + child.pinned = false; |
---|
2980 | 3926 | child.CloseUI(); |
---|
2981 | 3927 | listUI.remove(child); |
---|
| 3928 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2982 | 3929 | |
---|
2983 | | - child.editWindow = null; // ??????????? |
---|
| 3930 | + //child.editWindow = null; // ??????????? |
---|
2984 | 3931 | } |
---|
2985 | 3932 | objEditor.ctrlPanel.FlushUI(); |
---|
2986 | 3933 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
2993 | 3940 | //copy.ClearUI(); |
---|
2994 | 3941 | for (Object3D obj : listUI) |
---|
2995 | 3942 | { |
---|
| 3943 | + obj.pinned = false; |
---|
2996 | 3944 | obj.CloseUI(); |
---|
2997 | 3945 | } |
---|
2998 | 3946 | listUI.clear(); |
---|
| 3947 | + SetPinStates(group.selection.size() > 0); |
---|
2999 | 3948 | refreshContents(true); |
---|
3000 | 3949 | } else |
---|
3001 | 3950 | if (source == allParamsButton) |
---|
3002 | 3951 | { |
---|
3003 | 3952 | assert(copy == group); |
---|
3004 | 3953 | |
---|
3005 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3954 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3006 | 3955 | |
---|
3007 | 3956 | for (Object3D obj : listUI) |
---|
3008 | 3957 | { |
---|
.. | .. |
---|
3051 | 4000 | } |
---|
3052 | 4001 | |
---|
3053 | 4002 | copy = group; |
---|
| 4003 | + |
---|
| 4004 | + SetUndoStates(); |
---|
| 4005 | + |
---|
3054 | 4006 | //Globals.theRenderer.object = group; |
---|
3055 | 4007 | if(!useclient) |
---|
3056 | 4008 | { |
---|
.. | .. |
---|
3066 | 4018 | frontView.object = group; |
---|
3067 | 4019 | sideView.object = group; |
---|
3068 | 4020 | } |
---|
3069 | | - group.editWindow = this; |
---|
| 4021 | + |
---|
| 4022 | +// fix "+" issue |
---|
| 4023 | + //group.editWindow = this; |
---|
| 4024 | + group.manipWindow = this; |
---|
| 4025 | + |
---|
3070 | 4026 | /* |
---|
3071 | 4027 | currentLayout = radio.layout; |
---|
3072 | 4028 | if (currentLayout == null) |
---|
3073 | 4029 | currentLayout = sevenButton; |
---|
3074 | 4030 | */ |
---|
3075 | 4031 | radio.layout.doClick(); |
---|
| 4032 | + |
---|
| 4033 | + ClearUnpinned(); |
---|
| 4034 | + |
---|
| 4035 | + //Grafreed.Assert(group != null); |
---|
| 4036 | + //Grafreed.Assert(group.selection != null); |
---|
| 4037 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 4038 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 4039 | + EditSelection(false); |
---|
3076 | 4040 | keepparent = group.parent; |
---|
3077 | 4041 | // PARENT = NULL or not??? |
---|
3078 | 4042 | //group.parent = null; // ROOT |
---|
3079 | 4043 | //group.attributes = -1; |
---|
3080 | 4044 | ResetModel(); |
---|
| 4045 | + |
---|
| 4046 | + cameraView.requestFocusInWindow(); |
---|
3081 | 4047 | refreshContents(true); |
---|
3082 | | - } |
---|
| 4048 | + } else if (event.getSource() == editCameraItem) |
---|
| 4049 | + { |
---|
| 4050 | + cameraView.ProtectCamera(); |
---|
| 4051 | + cameraView.requestFocusInWindow(); |
---|
| 4052 | + cameraView.repaint(); |
---|
| 4053 | + return; |
---|
| 4054 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 4055 | + { |
---|
| 4056 | + cameraView.RevertCamera(); |
---|
| 4057 | + cameraView.requestFocusInWindow(); |
---|
| 4058 | + cameraView.repaint(); |
---|
| 4059 | + return; |
---|
| 4060 | + // } else if (event.getSource() == textureButton) |
---|
| 4061 | + // { |
---|
| 4062 | + // return; // true; |
---|
| 4063 | + } |
---|
3083 | 4064 | else |
---|
3084 | 4065 | { |
---|
3085 | 4066 | //return super.action(event, arg); |
---|
.. | .. |
---|
3088 | 4069 | } |
---|
3089 | 4070 | |
---|
3090 | 4071 | boolean useclient = false; |
---|
3091 | | - cRadio radio; |
---|
3092 | 4072 | |
---|
3093 | 4073 | void ToggleRoot() |
---|
3094 | 4074 | { |
---|
.. | .. |
---|
3140 | 4120 | refreshContents(); |
---|
3141 | 4121 | } |
---|
3142 | 4122 | |
---|
| 4123 | + void TransformChildren() |
---|
| 4124 | + { |
---|
| 4125 | + Object3D obj; |
---|
| 4126 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4127 | + { |
---|
| 4128 | + obj = (Object3D)e.nextElement(); |
---|
| 4129 | + obj.KeepTextureMatrices(); |
---|
| 4130 | + obj.TransformChildren(); |
---|
| 4131 | + obj.RestoreTextureMatrices(); |
---|
| 4132 | + |
---|
| 4133 | +// if (obj.parent == null) |
---|
| 4134 | +// { |
---|
| 4135 | +// System.out.println("NULL PARENT!"); |
---|
| 4136 | +// new Exception().printStackTrace(); |
---|
| 4137 | +// } |
---|
| 4138 | +// else |
---|
| 4139 | +// TouchTransform(obj); |
---|
| 4140 | +// //obj.parent.Touch(); |
---|
| 4141 | + } |
---|
| 4142 | + |
---|
| 4143 | + refreshContents(); |
---|
| 4144 | + } |
---|
3143 | 4145 | |
---|
3144 | 4146 | void ResetTransform() |
---|
3145 | 4147 | { |
---|
.. | .. |
---|
3252 | 4254 | refreshContents(); |
---|
3253 | 4255 | } |
---|
3254 | 4256 | |
---|
3255 | | - void ResetCentroid() |
---|
| 4257 | + void ResetCentroid(boolean full) |
---|
3256 | 4258 | { |
---|
3257 | 4259 | Object3D obj; |
---|
3258 | 4260 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3267 | 4269 | LA.matIdentity(Object3D.mat); |
---|
3268 | 4270 | obj.getBounds(minima, maxima, false); |
---|
3269 | 4271 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3270 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 4272 | + if (full) |
---|
| 4273 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3271 | 4274 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3272 | 4275 | obj.TransformMesh(Object3D.mat); |
---|
| 4276 | + |
---|
3273 | 4277 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3274 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 4278 | + if (full) |
---|
| 4279 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3275 | 4280 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 4281 | + |
---|
3276 | 4282 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3277 | 4283 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3278 | 4284 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3301 | 4307 | |
---|
3302 | 4308 | int size = obj.MemorySize(); |
---|
3303 | 4309 | |
---|
3304 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4310 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4311 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3305 | 4312 | } |
---|
3306 | 4313 | } |
---|
3307 | 4314 | catch (Exception e) |
---|
.. | .. |
---|
3382 | 4389 | void GenNormals(boolean crease) |
---|
3383 | 4390 | { |
---|
3384 | 4391 | group.GenNormalsS(crease); |
---|
| 4392 | + |
---|
| 4393 | + refreshContents(); |
---|
| 4394 | + } |
---|
| 4395 | + |
---|
| 4396 | + void GenNormalsMESH() |
---|
| 4397 | + { |
---|
| 4398 | + group.GenNormalsMeshS(); |
---|
3385 | 4399 | |
---|
3386 | 4400 | refreshContents(); |
---|
3387 | 4401 | } |
---|
.. | .. |
---|
3613 | 4627 | String pigment = Object3D.GetPigment(tex); |
---|
3614 | 4628 | //String bump = Object3D.GetBump(tex); |
---|
3615 | 4629 | |
---|
3616 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4630 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4631 | + |
---|
| 4632 | + try |
---|
| 4633 | + { |
---|
| 4634 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
| 4635 | + } |
---|
| 4636 | + catch (Exception e) |
---|
| 4637 | + { |
---|
| 4638 | + System.err.println("FAIL: " + node); |
---|
| 4639 | + } |
---|
3617 | 4640 | |
---|
3618 | 4641 | double s = v.s; |
---|
3619 | 4642 | |
---|
.. | .. |
---|
4000 | 5023 | refreshContents(); |
---|
4001 | 5024 | } |
---|
4002 | 5025 | |
---|
| 5026 | + void RewindLeaves(boolean hide) |
---|
| 5027 | + { |
---|
| 5028 | + group.selection.RewindLeaves(hide); |
---|
| 5029 | + refreshContents(); |
---|
| 5030 | + } |
---|
| 5031 | + |
---|
| 5032 | + void RandomLeaves(boolean hide) |
---|
| 5033 | + { |
---|
| 5034 | + group.selection.RandomLeaves(hide); |
---|
| 5035 | + refreshContents(); |
---|
| 5036 | + } |
---|
| 5037 | + |
---|
4003 | 5038 | void SetTexRes(int tr) |
---|
4004 | 5039 | { |
---|
4005 | 5040 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4071 | 5106 | // } |
---|
4072 | 5107 | // } |
---|
4073 | 5108 | |
---|
4074 | | - static boolean allparams = true; |
---|
4075 | | - |
---|
4076 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4077 | | - |
---|
4078 | 5109 | void EditSelection(boolean newWindow) |
---|
4079 | 5110 | { |
---|
| 5111 | + if (group.selection == null) |
---|
| 5112 | + { |
---|
| 5113 | + EditElement(group, newWindow); // ? new |
---|
| 5114 | + return; |
---|
| 5115 | + } |
---|
| 5116 | + |
---|
4080 | 5117 | // aConstraints.gridy = 0; |
---|
4081 | 5118 | for (int i=0; i<group.selection.size(); i++) |
---|
4082 | 5119 | { |
---|
4083 | 5120 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4084 | 5121 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4085 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 5122 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4086 | 5123 | |
---|
4087 | 5124 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4088 | | - if(elem != group) |
---|
| 5125 | + if(elem != group || !newWindow) |
---|
4089 | 5126 | { |
---|
4090 | | - // if (!(elem instanceof Composite)) |
---|
4091 | | - // newWindow = false; |
---|
4092 | | - listUI.add(elem); |
---|
4093 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4094 | | - System.out.println("edit : " + elem); |
---|
4095 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5127 | + EditElement(elem, newWindow); // ? new |
---|
4096 | 5128 | } |
---|
4097 | 5129 | } |
---|
4098 | 5130 | } |
---|
.. | .. |
---|
4155 | 5187 | |
---|
4156 | 5188 | freezemodel = false; |
---|
4157 | 5189 | } |
---|
4158 | | - |
---|
4159 | | - boolean flashIt = true; |
---|
4160 | | - |
---|
| 5190 | + |
---|
4161 | 5191 | public void valueChanged(TreeSelectionEvent e) |
---|
4162 | 5192 | //public boolean handleEvent(Event event) |
---|
4163 | 5193 | { |
---|
.. | .. |
---|
4167 | 5197 | //new Exception().printStackTrace(); |
---|
4168 | 5198 | |
---|
4169 | 5199 | freezemodel = true; |
---|
4170 | | - |
---|
| 5200 | + ClearUnpinned(); |
---|
| 5201 | + |
---|
4171 | 5202 | /**/ |
---|
4172 | 5203 | //switch (event.id) |
---|
4173 | 5204 | { |
---|
.. | .. |
---|
4175 | 5206 | //case 702: // Event.LIST_DESELECT |
---|
4176 | 5207 | group.deselectAll(); |
---|
4177 | 5208 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4178 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4179 | 5209 | if (tps != null) |
---|
4180 | 5210 | { |
---|
4181 | 5211 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4184 | 5214 | |
---|
4185 | 5215 | //if (child.parent != null) |
---|
4186 | 5216 | //child.parent.addSelectee(child); |
---|
| 5217 | + objEditor.SetMaterial(child); |
---|
4187 | 5218 | group.addSelectee(child); |
---|
4188 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4189 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4190 | | - System.err.println("info : " + child.GetPath()); |
---|
4191 | 5219 | } |
---|
4192 | 5220 | } |
---|
4193 | 5221 | // else |
---|
.. | .. |
---|
4197 | 5225 | // System.err.println("info : " + group.GetPath()); |
---|
4198 | 5226 | // } |
---|
4199 | 5227 | |
---|
4200 | | - objEditor.SetText(); // jan 2014 |
---|
4201 | | - |
---|
4202 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 5228 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4203 | 5229 | CameraPane.flash = true; |
---|
4204 | 5230 | |
---|
4205 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 5231 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4206 | 5232 | // a camera |
---|
4207 | 5233 | { |
---|
4208 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4209 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5234 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5235 | + { |
---|
| 5236 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 5237 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5238 | + } |
---|
4210 | 5239 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4211 | 5240 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4212 | 5241 | } |
---|
4213 | 5242 | |
---|
| 5243 | + if (tps != null && tps.length == 1) |
---|
| 5244 | + { |
---|
| 5245 | + EditSelection(false); |
---|
| 5246 | + } |
---|
| 5247 | + |
---|
| 5248 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5249 | + |
---|
4214 | 5250 | refreshContents(); |
---|
4215 | 5251 | //return true; |
---|
4216 | 5252 | } |
---|
.. | .. |
---|
4219 | 5255 | |
---|
4220 | 5256 | freezemodel = false; |
---|
4221 | 5257 | } |
---|
| 5258 | + |
---|
| 5259 | + void SetPinStates(boolean enabled) |
---|
| 5260 | + { |
---|
| 5261 | + editButton.setEnabled(enabled); |
---|
| 5262 | + uneditButton.setEnabled(enabled); |
---|
| 5263 | + //unselectButton.setEnabled(enabled); |
---|
| 5264 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5265 | + |
---|
| 5266 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5267 | + } |
---|
| 5268 | + |
---|
| 5269 | + void refreshContents(boolean cp) |
---|
| 5270 | + { |
---|
| 5271 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5272 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 5273 | + { |
---|
| 5274 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 5275 | + |
---|
| 5276 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 5277 | + { |
---|
| 5278 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 5279 | + |
---|
| 5280 | + objEditor.AddInfo(child, this, true); |
---|
| 5281 | + System.err.println("info : " + child.GetPath()); |
---|
| 5282 | + } |
---|
| 5283 | + |
---|
| 5284 | + objEditor.SetText(); // jan 2014 |
---|
| 5285 | + } |
---|
| 5286 | + |
---|
| 5287 | + super.refreshContents(cp); |
---|
| 5288 | + } |
---|
4222 | 5289 | |
---|
4223 | 5290 | void linkSomething(Object3D thing) |
---|
4224 | 5291 | { |
---|
.. | .. |
---|
4290 | 5357 | { |
---|
4291 | 5358 | if (group.selection.isEmpty()) |
---|
4292 | 5359 | return; |
---|
| 5360 | + |
---|
4293 | 5361 | Grafreed.clipboardIsTempGroup = false; |
---|
4294 | 5362 | Composite tGroup = null; |
---|
4295 | 5363 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4300 | 5368 | |
---|
4301 | 5369 | if (cut) |
---|
4302 | 5370 | { |
---|
| 5371 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5372 | +// Save(); |
---|
4303 | 5373 | //int indices[] = jList.getSelectedIndices(); |
---|
4304 | 5374 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4305 | 5375 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4389 | 5459 | } |
---|
4390 | 5460 | |
---|
4391 | 5461 | } |
---|
| 5462 | + |
---|
4392 | 5463 | if (Grafreed.clipboardIsTempGroup) |
---|
4393 | 5464 | Grafreed.clipboard = tGroup; |
---|
| 5465 | + |
---|
4394 | 5466 | if (cut) |
---|
4395 | 5467 | { |
---|
4396 | 5468 | ResetModel(); |
---|
.. | .. |
---|
4400 | 5472 | |
---|
4401 | 5473 | void paste(boolean expand) |
---|
4402 | 5474 | { |
---|
| 5475 | + if (Globals.REPLACEONMAKE) |
---|
| 5476 | + Save(); |
---|
| 5477 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5478 | + Globals.REPLACEONMAKE = false; |
---|
4403 | 5479 | // if (GrafreeD.clipboard == null) |
---|
4404 | 5480 | // return; |
---|
4405 | 5481 | boolean first = true; |
---|
.. | .. |
---|
4459 | 5535 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4460 | 5536 | } |
---|
4461 | 5537 | |
---|
| 5538 | + Globals.REPLACEONMAKE = keep; |
---|
4462 | 5539 | ResetModel(); |
---|
4463 | 5540 | refreshContents(); |
---|
4464 | 5541 | } |
---|
.. | .. |
---|
4594 | 5671 | |
---|
4595 | 5672 | void group(Object3D csg, boolean grab) |
---|
4596 | 5673 | { |
---|
| 5674 | + if (Globals.REPLACEONMAKE) |
---|
| 5675 | + Save(); |
---|
| 5676 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5677 | + Globals.REPLACEONMAKE = false; |
---|
4597 | 5678 | if (//false) // why?? |
---|
4598 | 5679 | !group.selection.isEmpty()) |
---|
4599 | 5680 | { |
---|
.. | .. |
---|
4707 | 5788 | //node.add(csg); |
---|
4708 | 5789 | //makeSomething(node); |
---|
4709 | 5790 | makeSomething(csg); |
---|
| 5791 | + Globals.REPLACEONMAKE = keep; |
---|
4710 | 5792 | } |
---|
4711 | 5793 | |
---|
4712 | 5794 | void Ungroup(Object3D g) |
---|
4713 | 5795 | { |
---|
| 5796 | + if (Globals.REPLACEONMAKE) |
---|
| 5797 | + Save(); |
---|
| 5798 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5799 | + Globals.REPLACEONMAKE = false; |
---|
4714 | 5800 | if (g instanceof HiddenObject) |
---|
4715 | 5801 | { |
---|
4716 | 5802 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4727 | 5813 | objEditor.makeSomething(g.get(i), false); |
---|
4728 | 5814 | } |
---|
4729 | 5815 | } |
---|
| 5816 | + Globals.REPLACEONMAKE = keep; |
---|
4730 | 5817 | } |
---|
4731 | 5818 | |
---|
4732 | 5819 | void ungroup() |
---|
.. | .. |
---|
4922 | 6009 | } |
---|
4923 | 6010 | */ |
---|
4924 | 6011 | |
---|
4925 | | - void ImportGFD() |
---|
4926 | | - { |
---|
4927 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4928 | | - browser.show(); |
---|
4929 | | - String filename = browser.getFile(); |
---|
4930 | | - if (filename != null && filename.length() > 0) |
---|
4931 | | - { |
---|
4932 | | - String fullname = browser.getDirectory() + filename; |
---|
4933 | | - |
---|
4934 | | - //Object3D readobj = |
---|
4935 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4936 | | - //makeSomething(readobj); |
---|
4937 | | - } |
---|
4938 | | - } |
---|
4939 | | - |
---|
4940 | 6012 | /* |
---|
4941 | 6013 | public void Callback(Object obj) |
---|
4942 | 6014 | { |
---|
.. | .. |
---|
4960 | 6032 | } |
---|
4961 | 6033 | */ |
---|
4962 | 6034 | |
---|
4963 | | - void ImportVRMLX3D() |
---|
4964 | | - { |
---|
4965 | | - if (Grafreed.standAlone) |
---|
4966 | | - { |
---|
4967 | | - /**/ |
---|
4968 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4969 | | - browser.show(); |
---|
4970 | | - String filename = browser.getFile(); |
---|
4971 | | - if (filename != null && filename.length() > 0) |
---|
4972 | | - { |
---|
4973 | | - String fullname = browser.getDirectory() + filename; |
---|
4974 | | - LoadVRMLX3D(fullname); |
---|
4975 | | - } |
---|
4976 | | - /**/ |
---|
4977 | | - } |
---|
4978 | | - } |
---|
4979 | | - |
---|
4980 | 6035 | String GetFile(String dialogName) |
---|
4981 | 6036 | { |
---|
4982 | 6037 | if (Grafreed.standAlone) |
---|
.. | .. |
---|
5047 | 6102 | cButton clearpanelButton; |
---|
5048 | 6103 | cButton unselectButton; |
---|
5049 | 6104 | |
---|
| 6105 | + cButton restoreCameraButton; |
---|
| 6106 | + |
---|
5050 | 6107 | cButton oneStepButton; |
---|
| 6108 | + |
---|
| 6109 | + cButton groupButton; |
---|
| 6110 | + cButton ungroupButton; |
---|
| 6111 | + cButton compositeButton; |
---|
| 6112 | + cButton switchButton; |
---|
| 6113 | + cButton loopButton; |
---|
| 6114 | + cButton textureButton; |
---|
| 6115 | + |
---|
| 6116 | + cButton skybox1Button; |
---|
| 6117 | + cButton skybox2Button; |
---|
| 6118 | + cButton skybox3Button; |
---|
| 6119 | + cButton skybox4Button; |
---|
| 6120 | + cButton skybox5Button; |
---|
| 6121 | + cButton skybox6Button; |
---|
| 6122 | + cButton skybox7Button; |
---|
| 6123 | + |
---|
| 6124 | + cButton skybox11Button; |
---|
| 6125 | + cButton skybox12Button; |
---|
| 6126 | + cButton skybox13Button; |
---|
| 6127 | + cButton skybox14Button; |
---|
| 6128 | + cButton skybox15Button; |
---|
| 6129 | + cButton skybox16Button; |
---|
| 6130 | + cButton skybox17Button; |
---|
| 6131 | + |
---|
| 6132 | + cButton gridButton; |
---|
| 6133 | + cButton boxButton; |
---|
| 6134 | + cButton sphereButton; |
---|
| 6135 | + cButton coneButton; |
---|
| 6136 | + cButton torusButton; |
---|
| 6137 | + cButton superButton; |
---|
| 6138 | + cButton kleinButton; |
---|
| 6139 | + cButton particlesButton; |
---|
| 6140 | + cButton overlayButton; |
---|
| 6141 | + cButton lightButton; |
---|
5051 | 6142 | |
---|
5052 | 6143 | cButton screenfitButton; |
---|
5053 | 6144 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5060 | 6151 | |
---|
5061 | 6152 | cButton setsupportButton; |
---|
5062 | 6153 | |
---|
5063 | | - cButton twoButton; |
---|
5064 | | - cButton sixButton; |
---|
5065 | | - cButton threeButton; |
---|
5066 | | - cButton sevenButton; |
---|
5067 | | - cButton fourButton; // full panel |
---|
5068 | | - cButton oneButton; // full XYZ |
---|
5069 | | - //cButton currentLayout; |
---|
5070 | | - |
---|
5071 | 6154 | // |
---|
5072 | 6155 | //Composite |
---|
5073 | 6156 | Object3D // to do !! |
---|
.. | .. |
---|
5077 | 6160 | //JTree jTree; |
---|
5078 | 6161 | private MenuItem lookAtItem; |
---|
5079 | 6162 | private MenuItem lookFromItem; |
---|
5080 | | - private MenuItem switchItem; |
---|
| 6163 | + private MenuItem switchViewItem; |
---|
5081 | 6164 | private MenuItem cutItem; |
---|
5082 | | - private MenuItem duplicateItem; |
---|
| 6165 | + private MenuItem undoItem; |
---|
| 6166 | + private MenuItem redoItem; |
---|
| 6167 | + private JMenuItem duplicateItem; |
---|
5083 | 6168 | private MenuItem cloneItem; |
---|
5084 | 6169 | private MenuItem cloneSupportItem; |
---|
5085 | 6170 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5092 | 6177 | private MenuItem linkverticesItem; |
---|
5093 | 6178 | private MenuItem relinkverticesItem; |
---|
5094 | 6179 | private MenuItem setMasterItem; |
---|
5095 | | - private MenuItem resetMeshItem; |
---|
| 6180 | + private MenuItem resetAllItem; |
---|
5096 | 6181 | private MenuItem stepAllItem; |
---|
5097 | 6182 | private MenuItem revertMeshItem; |
---|
5098 | 6183 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5107 | 6192 | private MenuItem pasteLinkItem; |
---|
5108 | 6193 | private MenuItem pasteCloneItem; |
---|
5109 | 6194 | private MenuItem pasteExpandItem; |
---|
5110 | | - private MenuItem clearItem; |
---|
| 6195 | + private MenuItem deleteItem; |
---|
5111 | 6196 | private MenuItem clearAllItem; |
---|
5112 | 6197 | private MenuItem genUVItem; |
---|
5113 | 6198 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5142 | 6227 | private MenuItem showleavesItem; |
---|
5143 | 6228 | private MenuItem markleavesItem; |
---|
5144 | 6229 | private MenuItem unmarkleavesItem; |
---|
| 6230 | + private MenuItem rewindleavesItem; |
---|
| 6231 | + private MenuItem unrewindleavesItem; |
---|
| 6232 | + private MenuItem randomleavesItem; |
---|
| 6233 | + private MenuItem unrandomleavesItem; |
---|
5145 | 6234 | |
---|
5146 | 6235 | private MenuItem flipVItem; |
---|
5147 | 6236 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5153 | 6242 | private MenuItem panoTexturesItem; |
---|
5154 | 6243 | |
---|
5155 | 6244 | private MenuItem resetCentroidItem; |
---|
5156 | | - private MenuItem transformgeometryItem; |
---|
| 6245 | + private MenuItem resetCentroidXZItem; |
---|
5157 | 6246 | private MenuItem resetTransformItem; |
---|
| 6247 | + private MenuItem transformGeometryItem; |
---|
| 6248 | + private MenuItem transformChildrenItem; |
---|
5158 | 6249 | private MenuItem hideItem; |
---|
5159 | 6250 | private MenuItem grabItem; |
---|
5160 | 6251 | private MenuItem backItem; |
---|
5161 | 6252 | private MenuItem frontItem; |
---|
5162 | 6253 | private MenuItem cameraItem; |
---|
5163 | 6254 | private MenuItem compositeItem; |
---|
5164 | | - private MenuItem randomItem; |
---|
| 6255 | + private MenuItem switchItem; |
---|
5165 | 6256 | private MenuItem physicsItem; |
---|
5166 | 6257 | private MenuItem frameselectorItem; |
---|
5167 | 6258 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5185 | 6276 | private MenuItem attachBumpItem; |
---|
5186 | 6277 | private MenuItem detachBumpItem; |
---|
5187 | 6278 | private MenuItem pigmentBumpItem; |
---|
| 6279 | + private MenuItem embedTexturesItem; |
---|
| 6280 | + private MenuItem deEmbedTexturesItem; |
---|
5188 | 6281 | |
---|
5189 | 6282 | private MenuItem particleItem; |
---|
5190 | 6283 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5223 | 6316 | private MenuItem doubleItem; |
---|
5224 | 6317 | private MenuItem tripleItem; |
---|
5225 | 6318 | |
---|
5226 | | - private MenuItem importGFDItem; |
---|
5227 | | - private MenuItem importVRMLX3DItem; |
---|
5228 | | - private MenuItem import3DSItem; |
---|
5229 | | - private MenuItem importOBJItem; |
---|
5230 | | - |
---|
5231 | 6319 | private MenuItem computeAOItem; |
---|
5232 | 6320 | private MenuItem recompileItem; |
---|
5233 | 6321 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5237 | 6325 | private MenuItem analyzeItem; |
---|
5238 | 6326 | private MenuItem dumpItem; |
---|
5239 | 6327 | //boolean freezemodel = false; |
---|
| 6328 | + |
---|
| 6329 | + Menu cameraMenu; |
---|
| 6330 | + MenuItem editCameraItem; |
---|
| 6331 | + MenuItem restoreCameraItem; |
---|
5240 | 6332 | } |
---|