.. | .. |
---|
12 | 12 | import com.jme.math.Vector3f; |
---|
13 | 13 | import com.jme.renderer.ColorRGBA; |
---|
14 | 14 | |
---|
| 15 | +import grafeme.ui.*; |
---|
15 | 16 | //import buoy.widget.BFileChooser; |
---|
16 | 17 | |
---|
17 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
| 19 | + Grafreed.iResourceCallBack, |
---|
18 | 20 | ObjectUI, |
---|
19 | 21 | Runnable, |
---|
20 | 22 | ActionListener, |
---|
.. | .. |
---|
22 | 24 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
23 | 25 | ItemListener // ListSelectionListener |
---|
24 | 26 | { |
---|
| 27 | + |
---|
| 28 | + public void AddSkyboxButton(String f, String s, cGridBag row) |
---|
| 29 | + { |
---|
| 30 | + cButton skyboxButton; |
---|
| 31 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 32 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 33 | + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 34 | + skyboxButton.setToolTipText(s); |
---|
| 35 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 36 | + { |
---|
| 37 | + @Override |
---|
| 38 | + public void actionPerformed(ActionEvent e) |
---|
| 39 | + { |
---|
| 40 | + ChangeSkybox(path); |
---|
| 41 | + } |
---|
| 42 | + }); |
---|
| 43 | + } |
---|
| 44 | + |
---|
| 45 | + public void AddTextureButton(String f, String c, final String t, int count, cGridBag row) |
---|
| 46 | + { |
---|
| 47 | + cButton textureButton; |
---|
| 48 | + final String path = "textures/" + f + "/" + c + "/"; // + t; |
---|
| 49 | + row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF)); |
---|
| 50 | + textureButton.setToolTipText(c + count); |
---|
| 51 | + textureButton.addActionListener(new ActionListener() |
---|
| 52 | + { |
---|
| 53 | + @Override |
---|
| 54 | + public void actionPerformed(ActionEvent e) |
---|
| 55 | + { |
---|
| 56 | + ChangeTexture(path + t); |
---|
| 57 | + } |
---|
| 58 | + }); |
---|
| 59 | + } |
---|
| 60 | + |
---|
| 61 | + public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
| 62 | + { |
---|
| 63 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 64 | + |
---|
| 65 | + tab0.setName("Urban"); |
---|
| 66 | + skyboxpanel.add(tab0); |
---|
| 67 | + |
---|
| 68 | + cGridBag row0 = new cGridBag(); |
---|
| 69 | + cGridBag row1 = new cGridBag(); |
---|
| 70 | + cGridBag row2 = new cGridBag(); |
---|
| 71 | + cGridBag row3 = new cGridBag(); |
---|
| 72 | + cGridBag row4 = new cGridBag(); |
---|
| 73 | + cGridBag row5 = new cGridBag(); |
---|
| 74 | + cGridBag row6 = new cGridBag(); |
---|
| 75 | + |
---|
| 76 | + AddSkyboxButton("default", "rgb", row0); |
---|
| 77 | + //AddSkyboxButton("default", "cornell", row0); |
---|
| 78 | + AddSkyboxButton("penguins", "dust", row0); |
---|
| 79 | + AddSkyboxButton("penguins", "tropic", row0); |
---|
| 80 | + AddSkyboxButton("penguins", "yonder", row0); |
---|
| 81 | + |
---|
| 82 | + AddSkyboxButton("default", "uffizi", row1); |
---|
| 83 | + AddSkyboxButton("bridge", "Bridge", row1); |
---|
| 84 | + AddSkyboxButton("bridge", "Bridge2", row1); |
---|
| 85 | + AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
| 86 | + |
---|
| 87 | + AddSkyboxButton("urban", "Parliament", row2); |
---|
| 88 | + AddSkyboxButton("urban", "Roundabout", row2); |
---|
| 89 | + AddSkyboxButton("urban", "SaintLazarusChurch", row2); |
---|
| 90 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row2); |
---|
| 91 | + |
---|
| 92 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
| 93 | + AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 94 | + AddSkyboxButton("urban", "Medborgarplatsen", row3); |
---|
| 95 | + AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
| 96 | + |
---|
| 97 | + AddSkyboxButton("park", "Buddha", row4); |
---|
| 98 | + AddSkyboxButton("park", "CNTower2", row4); |
---|
| 99 | + AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
| 100 | + AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
| 101 | + |
---|
| 102 | + AddSkyboxButton("park", "Park", row5); |
---|
| 103 | + AddSkyboxButton("park", "Pond", row5); |
---|
| 104 | + AddSkyboxButton("park", "Skansen", row5); |
---|
| 105 | + AddSkyboxButton("park", "Skansen2", row5); |
---|
| 106 | + |
---|
| 107 | + AddSkyboxButton("park", "Skansen3", row6); |
---|
| 108 | + AddSkyboxButton("park", "Skansen4", row6); |
---|
| 109 | + AddSkyboxButton("park", "Skansen5", row6); |
---|
| 110 | + AddSkyboxButton("persson", "VancouverConventionCentre", row6); |
---|
| 111 | + |
---|
| 112 | + tab0.add(row0); |
---|
| 113 | + tab0.add(row1); |
---|
| 114 | + tab0.add(row2); |
---|
| 115 | + tab0.add(row3); |
---|
| 116 | + tab0.add(row4); |
---|
| 117 | + tab0.add(row5); |
---|
| 118 | + tab0.add(row6); |
---|
| 119 | + |
---|
| 120 | + for (int i=5; --i>=0;) |
---|
| 121 | + { |
---|
| 122 | + //oe.toolboxPanel.Return(); |
---|
| 123 | + //tab0.add(new cGridBag()); |
---|
| 124 | + } |
---|
| 125 | + } |
---|
| 126 | + |
---|
| 127 | + public void AddSkyboxTab1(JTabbedPane skyboxpanel) |
---|
| 128 | + { |
---|
| 129 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 130 | + |
---|
| 131 | + tab0.setName("Nature"); |
---|
| 132 | + skyboxpanel.add(tab0); |
---|
| 133 | + |
---|
| 134 | + cGridBag row0 = new cGridBag(); |
---|
| 135 | + cGridBag row1 = new cGridBag(); |
---|
| 136 | + cGridBag row2 = new cGridBag(); |
---|
| 137 | + cGridBag row3 = new cGridBag(); |
---|
| 138 | + cGridBag row4 = new cGridBag(); |
---|
| 139 | + cGridBag row5 = new cGridBag(); |
---|
| 140 | + cGridBag row6 = new cGridBag(); |
---|
| 141 | + |
---|
| 142 | + AddSkyboxButton("beach", "HeartInTheSand", row0); |
---|
| 143 | + AddSkyboxButton("beach", "LarnacaBeach", row0); |
---|
| 144 | + AddSkyboxButton("beach", "PalmTrees", row0); |
---|
| 145 | + AddSkyboxButton("beach", "Tenerife", row0); |
---|
| 146 | + |
---|
| 147 | + AddSkyboxButton("beach", "Tenerife2", row1); |
---|
| 148 | + AddSkyboxButton("beach", "Tenerife3", row1); |
---|
| 149 | + AddSkyboxButton("field", "FishPond", row1); |
---|
| 150 | + AddSkyboxButton("field", "Footballfield", row1); |
---|
| 151 | + |
---|
| 152 | + AddSkyboxButton("field", "Meadow", row2); |
---|
| 153 | + AddSkyboxButton("field", "Sorsele", row2); |
---|
| 154 | + AddSkyboxButton("field", "Sorsele2", row2); |
---|
| 155 | + AddSkyboxButton("field", "Sorsele3", row2); |
---|
| 156 | + |
---|
| 157 | + AddSkyboxButton("forest", "Brudslojan", row3); |
---|
| 158 | + AddSkyboxButton("forest", "Langholmen2", row3); |
---|
| 159 | + AddSkyboxButton("forest", "Plants", row3); |
---|
| 160 | + AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 161 | + |
---|
| 162 | + AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
| 163 | + AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
| 164 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 165 | + AddSkyboxButton("park", "Tantolunden4", row4); |
---|
| 166 | + |
---|
| 167 | + AddSkyboxButton("park", "Stairs", row5); |
---|
| 168 | + AddSkyboxButton("default", "skycube", row6); |
---|
| 169 | + AddSkyboxButton("rocky", "Langholmen", row5); |
---|
| 170 | + AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 171 | + |
---|
| 172 | + AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 173 | + AddSkyboxButton("default", "CloudyHills", row6); |
---|
| 174 | + AddSkyboxButton("daz", "Autumn", row6); |
---|
| 175 | + AddSkyboxButton("daz", "MountainTrail", row6); |
---|
| 176 | + /* |
---|
| 177 | +Autumn |
---|
| 178 | +Greenlands |
---|
| 179 | +MountainTrail |
---|
| 180 | +Oasis |
---|
| 181 | +TheRock |
---|
| 182 | +TopOfTheWorld |
---|
| 183 | +Winter |
---|
| 184 | + */ |
---|
| 185 | + |
---|
| 186 | + tab0.add(row0); |
---|
| 187 | + tab0.add(row1); |
---|
| 188 | + tab0.add(row2); |
---|
| 189 | + tab0.add(row3); |
---|
| 190 | + tab0.add(row4); |
---|
| 191 | + tab0.add(row5); |
---|
| 192 | + tab0.add(row6); |
---|
| 193 | + |
---|
| 194 | + for (int i=5; --i>=0;) |
---|
| 195 | + { |
---|
| 196 | + //oe.toolboxPanel.Return(); |
---|
| 197 | + //tab0.add(new cGridBag()); |
---|
| 198 | + } |
---|
| 199 | + } |
---|
| 200 | + |
---|
| 201 | + public void AddSkyboxTab2(JTabbedPane skyboxpanel) |
---|
| 202 | + { |
---|
| 203 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 204 | + |
---|
| 205 | + tab0.setName("Night"); |
---|
| 206 | + skyboxpanel.add(tab0); |
---|
| 207 | + |
---|
| 208 | + cGridBag row0 = new cGridBag(); |
---|
| 209 | + cGridBag row1 = new cGridBag(); |
---|
| 210 | + cGridBag row2 = new cGridBag(); |
---|
| 211 | + cGridBag row3 = new cGridBag(); |
---|
| 212 | + cGridBag row4 = new cGridBag(); |
---|
| 213 | + cGridBag row5 = new cGridBag(); |
---|
| 214 | + cGridBag row6 = new cGridBag(); |
---|
| 215 | + |
---|
| 216 | + AddSkyboxButton("night", "NightPath", row0); |
---|
| 217 | + AddSkyboxButton("night", "PondNight", row0); |
---|
| 218 | + AddSkyboxButton("night", "Powerlines", row0); |
---|
| 219 | + AddSkyboxButton("night", "SwedishRoyalCastle", row0); |
---|
| 220 | + |
---|
| 221 | + AddSkyboxButton("urban", "CNTower", row1); |
---|
| 222 | + AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
| 223 | + AddSkyboxButton("rocky", "Riddarfjarden", row1); |
---|
| 224 | + AddSkyboxButton("penguins", "sleepyhollow", row1); |
---|
| 225 | + |
---|
| 226 | + AddSkyboxButton("penguins", "kenon_star", row2); |
---|
| 227 | + AddSkyboxButton("persson", "corona", row2); |
---|
| 228 | + AddSkyboxButton("persson", "spaceskybox", row2); |
---|
| 229 | + AddSkyboxButton("indoors", "Vasa", row2); |
---|
| 230 | + |
---|
| 231 | + AddSkyboxButton("winter", "Backyard", row3); |
---|
| 232 | + AddSkyboxButton("winter", "Creek", row3); |
---|
| 233 | + AddSkyboxButton("winter", "FootballField3", row3); |
---|
| 234 | + AddSkyboxButton("winter", "Forest", row3); |
---|
| 235 | + |
---|
| 236 | + AddSkyboxButton("winter", "HornstullsStrand2", row4); |
---|
| 237 | + AddSkyboxButton("winter", "House", row4); |
---|
| 238 | + AddSkyboxButton("winter", "IceLake", row4); |
---|
| 239 | + AddSkyboxButton("winter", "IceRiver", row4); |
---|
| 240 | + |
---|
| 241 | + AddSkyboxButton("winter", "Park3", row5); |
---|
| 242 | + AddSkyboxButton("winter", "PondWinter", row5); |
---|
| 243 | + AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
| 244 | + AddSkyboxButton("winter", "Vindelalven", row5); |
---|
| 245 | + |
---|
| 246 | + AddSkyboxButton("daz", "TheRock", row6); |
---|
| 247 | + AddSkyboxButton("daz", "TopOfTheWorld", row6); |
---|
| 248 | + AddSkyboxButton("daz", "Winter", row6); |
---|
| 249 | + AddSkyboxButton("mountain", "Ryfjallet", row6); |
---|
| 250 | + |
---|
| 251 | + tab0.add(row0); |
---|
| 252 | + tab0.add(row1); |
---|
| 253 | + tab0.add(row2); |
---|
| 254 | + tab0.add(row3); |
---|
| 255 | + tab0.add(row4); |
---|
| 256 | + tab0.add(row5); |
---|
| 257 | + tab0.add(row6); |
---|
| 258 | + |
---|
| 259 | + for (int i=5; --i>=0;) |
---|
| 260 | + { |
---|
| 261 | + //oe.toolboxPanel.Return(); |
---|
| 262 | + //tab0.add(new cGridBag()); |
---|
| 263 | + } |
---|
| 264 | + } |
---|
| 265 | + |
---|
| 266 | + public void AddSkyboxTab3(JTabbedPane skyboxpanel) |
---|
| 267 | + { |
---|
| 268 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 269 | + |
---|
| 270 | + tab0.setName("Others"); |
---|
| 271 | + skyboxpanel.add(tab0); |
---|
| 272 | + |
---|
| 273 | + cGridBag row0 = new cGridBag(); |
---|
| 274 | + cGridBag row1 = new cGridBag(); |
---|
| 275 | + cGridBag row2 = new cGridBag(); |
---|
| 276 | + cGridBag row3 = new cGridBag(); |
---|
| 277 | + cGridBag row4 = new cGridBag(); |
---|
| 278 | + cGridBag row5 = new cGridBag(); |
---|
| 279 | + cGridBag row6 = new cGridBag(); |
---|
| 280 | + |
---|
| 281 | + AddSkyboxButton("mayhem", "afterrain", row0); |
---|
| 282 | + AddSkyboxButton("mayhem", "aqua4", row0); |
---|
| 283 | + AddSkyboxButton("mayhem", "aqua9", row0); |
---|
| 284 | + AddSkyboxButton("mayhem", "flame", row0); |
---|
| 285 | + |
---|
| 286 | + AddSkyboxButton("mayhem", "h2s", row1); |
---|
| 287 | + AddSkyboxButton("mayhem", "prehistoric", row1); |
---|
| 288 | + AddSkyboxButton("mayhem", "scorched", row1); |
---|
| 289 | + AddSkyboxButton("penguins", "desertdawn", row1); |
---|
| 290 | + |
---|
| 291 | + AddSkyboxButton("persson", "Citadella", row2); |
---|
| 292 | + AddSkyboxButton("persson", "Citadella2", row2); |
---|
| 293 | + AddSkyboxButton("persson", "clouds1", row2); |
---|
| 294 | + AddSkyboxButton("penguins", "wrath", row2); |
---|
| 295 | + |
---|
| 296 | + AddSkyboxButton("persson", "FishermansBastion", row3); |
---|
| 297 | + AddSkyboxButton("persson", "HeroesSquare", row3); |
---|
| 298 | + AddSkyboxButton("indoors", "DallasW", row3); |
---|
| 299 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row3); |
---|
| 300 | + |
---|
| 301 | + AddSkyboxButton("persson", "LancellottiChapel", row4); |
---|
| 302 | + AddSkyboxButton("persson", "PereaBeach1", row4); |
---|
| 303 | + AddSkyboxButton("persson", "PereaBeach2", row4); |
---|
| 304 | + AddSkyboxButton("persson", "redeclipse", row4); |
---|
| 305 | + |
---|
| 306 | + AddSkyboxButton("daz", "Greenlands", row5); |
---|
| 307 | + AddSkyboxButton("daz", "Oasis", row5); |
---|
| 308 | + AddSkyboxButton("elyvisions", "arch3", row5); |
---|
| 309 | + AddSkyboxButton("elyvisions", "calm_sea", row5); |
---|
| 310 | + |
---|
| 311 | + AddSkyboxButton("elyvisions", "rainbow", row6); |
---|
| 312 | + AddSkyboxButton("elyvisions", "distant_sunset", row6); |
---|
| 313 | + AddSkyboxButton("elyvisions", "heaven", row6); |
---|
| 314 | + AddSkyboxButton("elyvisions", "hot", row6); |
---|
| 315 | + |
---|
| 316 | + tab0.add(row0); |
---|
| 317 | + tab0.add(row1); |
---|
| 318 | + tab0.add(row2); |
---|
| 319 | + tab0.add(row3); |
---|
| 320 | + tab0.add(row4); |
---|
| 321 | + tab0.add(row5); |
---|
| 322 | + tab0.add(row6); |
---|
| 323 | + |
---|
| 324 | + for (int i=5; --i>=0;) |
---|
| 325 | + { |
---|
| 326 | + //oe.toolboxPanel.Return(); |
---|
| 327 | + //tab0.add(new cGridBag()); |
---|
| 328 | + } |
---|
| 329 | + } |
---|
| 330 | + |
---|
| 331 | + public void ChangeSkybox(String skybox) |
---|
| 332 | + { |
---|
| 333 | + //cameraView.envyoff = false; |
---|
| 334 | + group.skyboxname = skybox; |
---|
| 335 | + group.skyboxext = "jpg"; |
---|
| 336 | + cameraView.repaint(); |
---|
| 337 | + } |
---|
| 338 | + |
---|
| 339 | + public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
| 340 | + { |
---|
| 341 | + JTabbedPane skyboxpane = new JTabbedPane(); |
---|
| 342 | + |
---|
| 343 | + AddSkyboxTab0(skyboxpane); |
---|
| 344 | + AddSkyboxTab1(skyboxpane); |
---|
| 345 | + AddSkyboxTab2(skyboxpane); |
---|
| 346 | + AddSkyboxTab3(skyboxpane); |
---|
| 347 | + |
---|
| 348 | + skyboxPanel.add(skyboxpane); |
---|
| 349 | + } |
---|
| 350 | + |
---|
| 351 | + public void ChangeTexture(String texture) |
---|
| 352 | + { |
---|
| 353 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 354 | + { |
---|
| 355 | + Object3D obj = group.selection.get(i); |
---|
| 356 | + obj.SetPigmentTexture("@" + texture); |
---|
| 357 | + } |
---|
| 358 | + |
---|
| 359 | + refreshContents(); |
---|
| 360 | + } |
---|
| 361 | + |
---|
25 | 362 | //ObjEditor objEditor; |
---|
26 | 363 | public void closeUI2() |
---|
27 | 364 | { |
---|
.. | .. |
---|
59 | 396 | this.copy = this.group = group; |
---|
60 | 397 | //selectees = this.group.selectees; |
---|
61 | 398 | |
---|
| 399 | + if (copy.versionlist == null) |
---|
| 400 | + { |
---|
| 401 | + copy.versionlist = new Object3D[100]; |
---|
| 402 | + copy.versionindex = -1; |
---|
| 403 | + } |
---|
| 404 | + |
---|
62 | 405 | if(ui) |
---|
63 | 406 | SetupUI(objEditor); |
---|
64 | 407 | } |
---|
.. | .. |
---|
73 | 416 | this.copy = this.group = copy; |
---|
74 | 417 | //selectees = this.group.selectees; |
---|
75 | 418 | |
---|
76 | | - SetupMenu2(objEditor); |
---|
| 419 | + SetupMenu2(this); //objEditor); |
---|
77 | 420 | SetupUI2(objEditor); |
---|
78 | 421 | objEditor.SetupUI(true); |
---|
79 | 422 | SetupViews(objEditor); |
---|
80 | 423 | |
---|
81 | 424 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 425 | + |
---|
| 426 | + if (copy.versionlist == null) |
---|
| 427 | + { |
---|
| 428 | + copy.versionlist = new Object3D[100]; |
---|
| 429 | + copy.versionindex = -1; |
---|
| 430 | + |
---|
| 431 | + Save(true); |
---|
| 432 | + } |
---|
82 | 433 | } |
---|
83 | 434 | |
---|
84 | 435 | void CloneSelection(boolean supports) |
---|
85 | 436 | { |
---|
| 437 | + if (Globals.REPLACEONMAKE) |
---|
| 438 | + Save(); |
---|
| 439 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 440 | + Globals.REPLACEONMAKE = false; |
---|
86 | 441 | // Object3D keep = GrafreeD.clipboard; |
---|
87 | 442 | //Object3D obj; |
---|
88 | 443 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
93 | 448 | |
---|
94 | 449 | makeSomething(clone, i==group.selection.size()-1); |
---|
95 | 450 | } |
---|
| 451 | + Globals.REPLACEONMAKE = keep; |
---|
96 | 452 | } |
---|
97 | 453 | |
---|
98 | 454 | void CloneClipboard(boolean supports) |
---|
99 | 455 | { |
---|
100 | | - assert(GrafreeD.clipboard.parent == null); |
---|
101 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
102 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
103 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
104 | | - makeSomething(CloneObject(GrafreeD.clipboard.get(0), false)); |
---|
| 456 | + assert(Grafreed.clipboard.parent == null); |
---|
| 457 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 458 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 459 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 460 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
105 | 461 | else |
---|
106 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
107 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 462 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 463 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 464 | } |
---|
109 | 465 | |
---|
110 | 466 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 474 | // obj.support = null; |
---|
119 | 475 | if (!supports) |
---|
120 | 476 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 477 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 478 | obj.parent = parent; |
---|
123 | 479 | // obj.support = support; |
---|
124 | 480 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
147 | 503 | |
---|
148 | 504 | //JTextField nameField; |
---|
149 | 505 | |
---|
150 | | - void SetupMenu2(ObjEditor oe) |
---|
| 506 | + void SetupMenu2(GroupEditor oe) |
---|
151 | 507 | { |
---|
152 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
153 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
154 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
155 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
156 | | - oe.cameraMenu.add("-"); |
---|
157 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
158 | | - openWindowItem.addActionListener(this); |
---|
159 | | - editLeafItem.addActionListener(this); |
---|
160 | | - lookAtItem.addActionListener(this); |
---|
161 | | - //lookFromItem.addActinoListener(this); |
---|
162 | | - //switchItem.addActionListener(this); |
---|
| 508 | + oe.jTree = new cTree(); |
---|
| 509 | + |
---|
163 | 510 | Menu menu; |
---|
164 | 511 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | 512 | //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | 513 | //editItem.addActionListener(this); |
---|
167 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 514 | + |
---|
| 515 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 516 | +// undoItem.addActionListener(this); |
---|
| 517 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 518 | +// redoItem.addActionListener(this); |
---|
| 519 | +// menu.add("-"); |
---|
| 520 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
168 | 521 | duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | 522 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | 523 | cloneItem.addActionListener(this); |
---|
| 524 | + if (Globals.ADVANCED) |
---|
| 525 | + { |
---|
172 | 526 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | 527 | cloneSupportItem.addActionListener(this); |
---|
| 528 | + } |
---|
174 | 529 | menu.add("-"); |
---|
175 | 530 | cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | 531 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
178 | 533 | copyItem.addActionListener(this); |
---|
179 | 534 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | 535 | pasteItem.addActionListener(this); |
---|
| 536 | + |
---|
| 537 | + menu.add("-"); |
---|
| 538 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 539 | + pasteIntoItem.addActionListener(this); |
---|
181 | 540 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | 541 | pasteLinkItem.addActionListener(this); |
---|
183 | 542 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | 543 | pasteCloneItem.addActionListener(this); |
---|
185 | 544 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | 545 | // pasteExpandItem.addActionListener(this); |
---|
187 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | | - clearItem.addActionListener(this); |
---|
| 546 | + menu.add("-"); |
---|
| 547 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 548 | + deleteItem.addActionListener(this); |
---|
| 549 | + |
---|
| 550 | + if (Globals.ADVANCED) |
---|
| 551 | + { |
---|
| 552 | + // Deletes the cameras... |
---|
189 | 553 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | 554 | clearAllItem.addActionListener(this); |
---|
| 555 | + } |
---|
| 556 | + |
---|
| 557 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 558 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 559 | + //zBufferItem.addActionListener(this); |
---|
| 560 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 561 | + //normalLensItem.addActionListener(this); |
---|
| 562 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 563 | + restoreCameraItem.addActionListener(this); |
---|
| 564 | + |
---|
| 565 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 566 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 567 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 568 | +// cameraMenu.add("-"); |
---|
| 569 | +// |
---|
| 570 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 571 | +// toggleTextureItem.addItemListener(this); |
---|
| 572 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 573 | +// |
---|
| 574 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 575 | +// toggleSwitchItem.addItemListener(this); |
---|
| 576 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 577 | + |
---|
| 578 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 579 | + toggleHandleItem.addItemListener(this); |
---|
| 580 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 581 | + |
---|
| 582 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 583 | + togglePaintItem.addItemListener(this); |
---|
| 584 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 585 | + |
---|
| 586 | + if (Globals.ADVANCED) |
---|
| 587 | + { |
---|
| 588 | + cameraMenu.add("-"); |
---|
| 589 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 590 | + toggleLiveItem.addItemListener(this); |
---|
| 591 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
191 | 592 | |
---|
| 593 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 594 | + stepItem.addActionListener(this); |
---|
| 595 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 596 | + // toggleDLItem.addItemListener(this); |
---|
| 597 | + // toggleDLItem.setState(false); |
---|
| 598 | + |
---|
| 599 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 600 | + toggleRenderItem.addItemListener(this); |
---|
| 601 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 602 | + |
---|
| 603 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 604 | + toggleDebugItem.addItemListener(this); |
---|
| 605 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 606 | + |
---|
| 607 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 608 | + toggleFrustumItem.addItemListener(this); |
---|
| 609 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 610 | + |
---|
| 611 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 612 | + toggleFootContactItem.addItemListener(this); |
---|
| 613 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 614 | + |
---|
| 615 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 616 | + toggleTimelineItem.addItemListener(this); |
---|
| 617 | + } |
---|
| 618 | + |
---|
| 619 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 620 | +// toggleRootItem.addItemListener(this); |
---|
| 621 | +// toggleRootItem.setState(false); |
---|
| 622 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 623 | +// animationItem.addItemListener(this); |
---|
| 624 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 625 | + cameraMenu.add("-"); |
---|
| 626 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 627 | + editCameraItem.addActionListener(this); |
---|
| 628 | + |
---|
| 629 | + if (Globals.ADVANCED) |
---|
| 630 | + { |
---|
| 631 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 632 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 633 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 634 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 635 | + oe.cameraMenu.add("-"); |
---|
| 636 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 637 | + openWindowItem.addActionListener(this); |
---|
| 638 | + editLeafItem.addActionListener(this); |
---|
| 639 | + lookAtItem.addActionListener(this); |
---|
| 640 | + //lookFromItem.addActinoListener(this); |
---|
| 641 | + //switchViewItem.addActionListener(this); |
---|
| 642 | + } |
---|
| 643 | + |
---|
192 | 644 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
193 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
194 | | - resetMeshItem.addActionListener(this); |
---|
195 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
196 | | - stepAllItem.addActionListener(this); |
---|
| 645 | + if (Globals.ADVANCED) |
---|
| 646 | + { |
---|
197 | 647 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 648 | revertMeshItem.addActionListener(this); |
---|
199 | 649 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 650 | resetreferencesItem.addActionListener(this); |
---|
201 | 651 | menu.add("-"); |
---|
| 652 | + } |
---|
202 | 653 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 654 | overwriteGeoItem.addActionListener(this); |
---|
204 | 655 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 661 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 662 | overwriteUVItem.addActionListener(this); |
---|
212 | 663 | menu.add("-"); |
---|
| 664 | + if (Globals.ADVANCED) |
---|
| 665 | + { |
---|
213 | 666 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 667 | generateMeshItem.addActionListener(this); |
---|
215 | 668 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 669 | poseMeshItem.addActionListener(this); |
---|
217 | 670 | menu.add("-"); |
---|
| 671 | + } |
---|
218 | 672 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 673 | resetsupportItem.addActionListener(this); |
---|
220 | 674 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 675 | linkverticesItem.addActionListener(this); |
---|
222 | 676 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 677 | relinkverticesItem.addActionListener(this); |
---|
| 678 | + |
---|
| 679 | + if (Globals.ADVANCED) |
---|
| 680 | + { |
---|
224 | 681 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 682 | setMasterItem.addActionListener(this); |
---|
| 683 | + } |
---|
226 | 684 | |
---|
227 | 685 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
229 | | - grabItem.addActionListener(this); |
---|
| 686 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 687 | +// grabItem.addActionListener(this); |
---|
230 | 688 | backItem = menu.add(new MenuItem("Back")); |
---|
231 | 689 | backItem.addActionListener(this); |
---|
232 | 690 | frontItem = menu.add(new MenuItem("Front")); |
---|
233 | 691 | frontItem.addActionListener(this); |
---|
234 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | | - compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 692 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 693 | +// compositeItem.addActionListener(this); |
---|
| 694 | + |
---|
| 695 | + if (Globals.ADVANCED) |
---|
| 696 | + { |
---|
| 697 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 698 | hideItem.addActionListener(this); |
---|
| 699 | + } |
---|
238 | 700 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 701 | ungroupItem.addActionListener(this); |
---|
240 | | - menu.add("-"); |
---|
241 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
242 | | - randomItem.addActionListener(this); |
---|
243 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
244 | | - physicsItem.addActionListener(this); |
---|
245 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
246 | | - frameselectorItem.addActionListener(this); |
---|
| 702 | + |
---|
| 703 | +// menu.add("-"); |
---|
| 704 | +// |
---|
| 705 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 706 | +// switchItem.addActionListener(this); |
---|
| 707 | + if (Globals.ADVANCED) |
---|
| 708 | + { |
---|
247 | 709 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 710 | switchGeoItem.addActionListener(this); |
---|
249 | 711 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 712 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 713 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 714 | morphItem.addActionListener(this); |
---|
| 715 | + |
---|
| 716 | + menu.add("-"); |
---|
| 717 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 718 | + physicsItem.addActionListener(this); |
---|
| 719 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 720 | + frameselectorItem.addActionListener(this); |
---|
253 | 721 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 722 | scriptNodeItem.addActionListener(this); |
---|
255 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | | - cameraItem.addActionListener(this); |
---|
| 723 | + } |
---|
257 | 724 | |
---|
258 | 725 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
260 | | - textureItem.addActionListener(this); |
---|
| 726 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 727 | +// textureItem.addActionListener(this); |
---|
261 | 728 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
262 | 729 | billboardItem.addActionListener(this); |
---|
263 | 730 | csgItem = menu.add(new MenuItem("CSG")); |
---|
264 | 731 | csgItem.addActionListener(this); |
---|
265 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 732 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
266 | 733 | shadowXItem.addActionListener(this); |
---|
267 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 734 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
268 | 735 | shadowYItem.addActionListener(this); |
---|
269 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 736 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
270 | 737 | shadowZItem.addActionListener(this); |
---|
| 738 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 739 | + attributeItem.addActionListener(this); |
---|
| 740 | + |
---|
| 741 | + if (Globals.ADVANCED) |
---|
| 742 | + { |
---|
| 743 | + menu.add("-"); |
---|
271 | 744 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 745 | linkerItem.addActionListener(this); |
---|
273 | 746 | templateItem = menu.add(new MenuItem("Template")); |
---|
274 | 747 | templateItem.addActionListener(this); |
---|
275 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | | - attributeItem.addActionListener(this); |
---|
277 | 748 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 749 | pointflowItem.addActionListener(this); |
---|
| 750 | + } |
---|
279 | 751 | menu.add("-"); |
---|
280 | 752 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 753 | resetTransformItem.addActionListener(this); |
---|
282 | 754 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
283 | 755 | resetCentroidItem.addActionListener(this); |
---|
284 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
285 | | - transformgeometryItem.addActionListener(this); |
---|
| 756 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 757 | + resetCentroidXZItem.addActionListener(this); |
---|
| 758 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 759 | + transformGeometryItem.addActionListener(this); |
---|
| 760 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 761 | + transformChildrenItem.addActionListener(this); |
---|
286 | 762 | |
---|
287 | 763 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
288 | 764 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
293 | 769 | genNormalsCADItem.addActionListener(this); |
---|
294 | 770 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 771 | genNormalsMESHItem.addActionListener(this); |
---|
296 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 772 | + if (Globals.ADVANCED) |
---|
| 773 | + { |
---|
| 774 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
297 | 775 | genNormalsMINEItem.addActionListener(this); |
---|
| 776 | + } |
---|
298 | 777 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 778 | stripifyItem.addActionListener(this); |
---|
300 | 779 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 795 | reduce34MeshItem.addActionListener(this); |
---|
317 | 796 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 797 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 798 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 799 | clipMeshItem.addActionListener(this); |
---|
| 800 | + |
---|
| 801 | + if (Globals.ADVANCED) |
---|
| 802 | + { |
---|
| 803 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 804 | + smoothMeshItem.addActionListener(this); |
---|
| 805 | + } |
---|
323 | 806 | |
---|
324 | 807 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 808 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
326 | 809 | clearMaterialsItem.addActionListener(this); |
---|
| 810 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 811 | + resetAllItem.addActionListener(this); |
---|
| 812 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 813 | + stepAllItem.addActionListener(this); |
---|
327 | 814 | menu.add("-"); |
---|
328 | 815 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
329 | 816 | liveleavesItem.addActionListener(this); |
---|
330 | 817 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 818 | unliveleavesItem.addActionListener(this); |
---|
| 819 | + if (Globals.ADVANCED) |
---|
| 820 | + { |
---|
332 | 821 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 822 | supportleavesItem.addActionListener(this); |
---|
334 | 823 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 824 | unsupportleavesItem.addActionListener(this); |
---|
| 825 | + } |
---|
336 | 826 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 827 | hideleavesItem.addActionListener(this); |
---|
338 | 828 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
341 | 831 | markleavesItem.addActionListener(this); |
---|
342 | 832 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
343 | 833 | unmarkleavesItem.addActionListener(this); |
---|
| 834 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 835 | + rewindleavesItem.addActionListener(this); |
---|
| 836 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 837 | + unrewindleavesItem.addActionListener(this); |
---|
| 838 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 839 | + randomleavesItem.addActionListener(this); |
---|
| 840 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 841 | + unrandomleavesItem.addActionListener(this); |
---|
344 | 842 | menu.add("-"); |
---|
345 | 843 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
346 | 844 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
366 | 864 | attachBumpItem.addActionListener(this); |
---|
367 | 865 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
368 | 866 | pigmentBumpItem.addActionListener(this); |
---|
| 867 | + //embedTexturesItem |
---|
369 | 868 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
370 | 869 | detachPigmentItem.addActionListener(this); |
---|
371 | 870 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
372 | 871 | detachBumpItem.addActionListener(this); |
---|
| 872 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 873 | + embedTexturesItem.addActionListener(this); |
---|
| 874 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 875 | + deEmbedTexturesItem.addActionListener(this); |
---|
373 | 876 | menu.add("-"); |
---|
374 | 877 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
375 | 878 | sortbysizeItem.addActionListener(this); |
---|
376 | 879 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 880 | sortbynameItem.addActionListener(this); |
---|
378 | 881 | menu.add("-"); |
---|
| 882 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 883 | + shareGeometriesItem.addActionListener(this); |
---|
| 884 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 885 | + mergeGeometriesItem.addActionListener(this); |
---|
| 886 | + if (Globals.ADVANCED) |
---|
| 887 | + { |
---|
| 888 | + // Pretty much the same as duplicate and clone. |
---|
379 | 889 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 890 | extractGeometriesItem.addActionListener(this); |
---|
381 | 891 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
382 | 892 | cloneGeometriesItem.addActionListener(this); |
---|
383 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
384 | | - shareGeometriesItem.addActionListener(this); |
---|
385 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
386 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 893 | + } |
---|
387 | 894 | |
---|
388 | 895 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 896 | buildCreateMenu(menu); |
---|
390 | 897 | |
---|
391 | | - |
---|
392 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
393 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
394 | | - importGFDItem.addActionListener(this); |
---|
395 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
396 | | - importVRMLX3DItem.addActionListener(this); |
---|
397 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
398 | | - importOBJItem.addActionListener(this); |
---|
399 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
400 | | - import3DSItem.addActionListener(this); |
---|
401 | | - |
---|
402 | 898 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 899 | buildToolsMenu(menu); |
---|
404 | 900 | } |
---|
405 | 901 | |
---|
| 902 | + JTabbedPane resourcecontainer; |
---|
| 903 | + cGridBag currenttab; |
---|
| 904 | + boolean added; // patch for jar |
---|
| 905 | + |
---|
| 906 | + int tabcount = 0; |
---|
| 907 | + int colcount = 0; |
---|
| 908 | + int rowcount = 0; |
---|
| 909 | + int texturecount = 0; |
---|
| 910 | + |
---|
| 911 | + int columns = 5; |
---|
| 912 | + int rows = 7; |
---|
| 913 | + |
---|
| 914 | + public void ResourceCallBack(String[] path) |
---|
| 915 | + { |
---|
| 916 | +// for (int i = 0; i < path.length; i++) |
---|
| 917 | +// System.out.print(path[i] + "/"); |
---|
| 918 | +// System.out.println(); |
---|
| 919 | + |
---|
| 920 | + if (//rowcount == 0 || |
---|
| 921 | + path.length == 1) |
---|
| 922 | + { |
---|
| 923 | + currenttab = new cGridBag(); |
---|
| 924 | + added = false; |
---|
| 925 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 926 | + currenttab.setName(tabname); |
---|
| 927 | + rowcount = 1; |
---|
| 928 | + colcount = 0; |
---|
| 929 | + texturecount = 0; |
---|
| 930 | + } |
---|
| 931 | + |
---|
| 932 | + if (path.length > 2 && path[2].toLowerCase().endsWith(".jpg")) |
---|
| 933 | + { |
---|
| 934 | + if (!added) |
---|
| 935 | + { |
---|
| 936 | + added = true; |
---|
| 937 | + resourcecontainer.add(currenttab); |
---|
| 938 | + String tabname = path[0]; // String.valueOf((char)('A'+tabcount)); |
---|
| 939 | + resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname); |
---|
| 940 | + } |
---|
| 941 | + |
---|
| 942 | + AddTextureButton(path[0], path[1], path[2], texturecount++, currenttab); |
---|
| 943 | + |
---|
| 944 | + if (++colcount >= columns) |
---|
| 945 | + { |
---|
| 946 | + colcount = 0; |
---|
| 947 | + currenttab.Return(); |
---|
| 948 | + |
---|
| 949 | + if (rowcount++ >= rows) |
---|
| 950 | + { |
---|
| 951 | + rowcount = 0; |
---|
| 952 | + } |
---|
| 953 | + } |
---|
| 954 | + } |
---|
| 955 | + else |
---|
| 956 | + { |
---|
| 957 | +// if (!path[path.length-1].equals("icons")) |
---|
| 958 | +// resourcecontainer.Return(); |
---|
| 959 | + } |
---|
| 960 | + } |
---|
| 961 | + |
---|
| 962 | + void CreateTexturePanel(cGridBag container) |
---|
| 963 | + { |
---|
| 964 | + resourcecontainer = new JTabbedPane(JTabbedPane.LEFT); |
---|
| 965 | + container.add(resourcecontainer); |
---|
| 966 | + |
---|
| 967 | + Grafreed.ParseResources("textures", this); |
---|
| 968 | + } |
---|
| 969 | + |
---|
406 | 970 | void SetupUI2(ObjEditor oe) |
---|
407 | 971 | { |
---|
| 972 | + // June 2019 |
---|
| 973 | + if (oe == null) |
---|
| 974 | + { |
---|
| 975 | + //super.SetupUI2(this); |
---|
| 976 | + //return; |
---|
| 977 | + } |
---|
| 978 | + |
---|
| 979 | + if (copy != group) |
---|
| 980 | + { |
---|
| 981 | + //super.SetupUI2(this); |
---|
| 982 | + } |
---|
| 983 | + |
---|
408 | 984 | //new Exception().printStackTrace(); |
---|
409 | 985 | |
---|
410 | 986 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
433 | 1009 | oe.radioPanel.add(dummyButton); |
---|
434 | 1010 | oe.buttonGroup.add(dummyButton); |
---|
435 | 1011 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
437 | | - oe.aConstraints.gridwidth = 1; |
---|
438 | | - oe.aConstraints.gridx = 0; |
---|
| 1012 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 1013 | + |
---|
| 1014 | + copyOptionsPanel.preferredHeight = 2; |
---|
439 | 1015 | |
---|
440 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
| 1016 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
| 1017 | + |
---|
| 1018 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1019 | + //minButton.setToolTipText("Minimize window"); |
---|
| 1020 | + //minButton.addActionListener(this); |
---|
| 1021 | + |
---|
| 1022 | + if (Globals.ADVANCED) |
---|
| 1023 | + { |
---|
| 1024 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1025 | + maxButton.setToolTipText("Maximize window"); |
---|
| 1026 | + maxButton.addActionListener(this); |
---|
| 1027 | + } |
---|
| 1028 | + |
---|
| 1029 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1030 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 1031 | + fullButton.addActionListener(this); |
---|
| 1032 | + |
---|
| 1033 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1034 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 1035 | + screenfitButton.addActionListener(this); |
---|
| 1036 | + |
---|
| 1037 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1038 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 1039 | + restoreCameraButton.addActionListener(this); |
---|
| 1040 | + |
---|
| 1041 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1042 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 1043 | + saveVersionButton.addActionListener(this); |
---|
| 1044 | + |
---|
| 1045 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1046 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 1047 | + deleteVersionButton.addActionListener(this); |
---|
| 1048 | + |
---|
| 1049 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1050 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 1051 | + previousVersionButton.addActionListener(this); |
---|
| 1052 | + previousVersionButton.setEnabled(false); |
---|
| 1053 | + |
---|
| 1054 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 1055 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1056 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
| 1057 | + restoreButton.addActionListener(this); |
---|
| 1058 | + //restoreButton.setEnabled(false); |
---|
| 1059 | + |
---|
| 1060 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1061 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
| 1062 | + replaceButton.addActionListener(this); |
---|
| 1063 | + //replaceButton.setEnabled(false); |
---|
| 1064 | + |
---|
| 1065 | + copyOptionsPanel.add(updown); |
---|
| 1066 | + |
---|
| 1067 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 1069 | + nextVersionButton.addActionListener(this); |
---|
| 1070 | + nextVersionButton.setEnabled(false); |
---|
| 1071 | + |
---|
| 1072 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 1073 | + liveCB.setToolTipText("Enable animation"); |
---|
441 | 1074 | liveCB.addItemListener(this); |
---|
442 | 1075 | |
---|
443 | | - oe.aConstraints.gridx += 1; |
---|
444 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
445 | | - supportCB.addItemListener(this); |
---|
446 | | - |
---|
447 | | - // oe.aConstraints.gridx += 1; |
---|
448 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
449 | | - // localCB.addItemListener(this); |
---|
450 | | - |
---|
451 | | - oe.aConstraints.gridx += 1; |
---|
452 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints); |
---|
453 | | - crowdCB.addItemListener(this); |
---|
454 | | - |
---|
455 | | - oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
457 | | - smoothCB.addItemListener(this); |
---|
458 | | - |
---|
459 | | - oe.aConstraints.gridx += 1; |
---|
460 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 1076 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1077 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 1078 | + oneStepButton.addActionListener(this); |
---|
| 1079 | + |
---|
| 1080 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 1081 | + fastCB.setToolTipText("Fast mode"); |
---|
461 | 1082 | fastCB.addItemListener(this); |
---|
462 | | - oe.aConstraints.gridx += 1; |
---|
463 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
464 | | - slowCB.addItemListener(this); |
---|
465 | | - oe.aConstraints.gridx += 1; |
---|
466 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
467 | | - boxCB.addItemListener(this); |
---|
| 1083 | + |
---|
| 1084 | + //oe.toolboxPanel.Return(); |
---|
| 1085 | + |
---|
| 1086 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1087 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 1088 | +// trackCB.addItemListener(this); |
---|
468 | 1089 | |
---|
469 | | -// oe.aConstraints.gridx += 1; |
---|
470 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
471 | | -// speakerMocapCB.addItemListener(this); |
---|
472 | | - |
---|
473 | | - if (false) |
---|
474 | | - { |
---|
475 | | - // handled in scripts |
---|
476 | | - oe.aConstraints.gridx += 1; |
---|
477 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
478 | | - speakerCameraCB.addItemListener(this); |
---|
479 | | - |
---|
480 | | - oe.aConstraints.gridx += 1; |
---|
481 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
482 | | - speakerFocusCB.addItemListener(this); |
---|
483 | | - |
---|
484 | | - oe.aConstraints.gridx += 1; |
---|
485 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
486 | | - smoothfocusCB.addItemListener(this); |
---|
487 | | - } |
---|
488 | | - |
---|
489 | | -//oe.aConstraints.gridx += 1; |
---|
490 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
491 | | -// debugCB.addItemListener(this); |
---|
492 | | - |
---|
493 | | - oe.aConstraints.gridx += 1; |
---|
494 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
495 | | - oeilCB.addItemListener(this); |
---|
496 | | - |
---|
497 | | - oe.aConstraints.gridx += 1; |
---|
498 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
499 | | - lookAtCB.addItemListener(this); |
---|
500 | | - |
---|
501 | | - oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
503 | | - trackCB.addItemListener(this); |
---|
504 | | - |
---|
505 | | - oe.aConstraints.gridx += 1; |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
507 | | - screenfitButton.addActionListener(this); |
---|
508 | | - oe.aConstraints.gridx += 1; |
---|
509 | 1090 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
510 | 1091 | // screenfitpointButton.addActionListener(this); |
---|
511 | | -// oe.aConstraints.gridx += 1; |
---|
512 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
513 | | - snapobjectButton.addActionListener(this); |
---|
514 | | - oe.aConstraints.gridx += 1; |
---|
515 | 1092 | |
---|
516 | | - //aConstraints.gridx = 0; |
---|
517 | | - //aConstraints.gridy += 1; |
---|
518 | | - oe.aConstraints.weighty = 0; |
---|
519 | | - oe.aConstraints.gridwidth = 1; |
---|
520 | | - |
---|
521 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
522 | | - flashSelectionButton.addActionListener(this); |
---|
523 | | - |
---|
524 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
525 | | - |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - // |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
532 | | - twoButton.addActionListener(this); |
---|
533 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 1093 | + if (Globals.ADVANCED) |
---|
| 1094 | + { |
---|
| 1095 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1096 | + snapobjectButton.addActionListener(this); |
---|
| 1097 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 1098 | + |
---|
| 1099 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
534 | 1100 | fourButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
536 | | - sixButton.addActionListener(this); |
---|
537 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 1101 | + fourButton.setToolTipText("Show control panel only"); |
---|
| 1102 | + } |
---|
| 1103 | + |
---|
| 1104 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 1105 | + |
---|
| 1106 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1107 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1108 | + twoButton.addActionListener(this); |
---|
| 1109 | + this.fullscreenLayout = twoButton; |
---|
| 1110 | + |
---|
| 1111 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1112 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
538 | 1113 | threeButton.addActionListener(this); |
---|
539 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
540 | | - sevenButton.addActionListener(this); |
---|
| 1114 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1115 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1116 | + sixButton.addActionListener(this); |
---|
| 1117 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1118 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1119 | +// sevenButton.addActionListener(this); |
---|
541 | 1120 | // |
---|
542 | 1121 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 1122 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1123 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
544 | 1124 | rootButton.addActionListener(this); |
---|
545 | | - oe.aConstraints.gridx += 1; |
---|
546 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 1125 | + |
---|
| 1126 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1127 | + closeButton.setToolTipText("Close tab"); |
---|
547 | 1128 | closeButton.addActionListener(this); |
---|
548 | 1129 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
549 | 1130 | //clearButton.addActionListener(this); |
---|
550 | | - oe.aConstraints.gridx += 1; |
---|
551 | | - |
---|
552 | | - oe.aConstraints.gridx = 1; // |
---|
553 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
554 | | - editButton.addActionListener(this); |
---|
555 | | - oe.aConstraints.gridx += 1; |
---|
556 | | - oe.aConstraints.weighty = 0; |
---|
557 | | - oe.aConstraints.gridwidth = 1; |
---|
558 | 1131 | |
---|
559 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 1132 | + cGridBag row1 = new cGridBag(); |
---|
| 1133 | + |
---|
| 1134 | + // INSERT |
---|
| 1135 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1136 | + gridButton.setToolTipText("Create grid"); |
---|
| 1137 | + gridButton.addActionListener(this); |
---|
| 1138 | + |
---|
| 1139 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1140 | + boxButton.setToolTipText("Create box"); |
---|
| 1141 | + boxButton.addActionListener(this); |
---|
| 1142 | + |
---|
| 1143 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1144 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1145 | + sphereButton.addActionListener(this); |
---|
| 1146 | + |
---|
| 1147 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1148 | + coneButton.setToolTipText("Create cone"); |
---|
| 1149 | + coneButton.addActionListener(this); |
---|
| 1150 | + |
---|
| 1151 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1152 | + torusButton.setToolTipText("Create torus"); |
---|
| 1153 | + torusButton.addActionListener(this); |
---|
| 1154 | + |
---|
| 1155 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1156 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1157 | + superButton.addActionListener(this); |
---|
| 1158 | + |
---|
| 1159 | + if (Globals.ADVANCED) |
---|
| 1160 | + { |
---|
| 1161 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1162 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 1163 | + kleinButton.addActionListener(this); |
---|
| 1164 | + } |
---|
| 1165 | + |
---|
| 1166 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1167 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 1168 | + particlesButton.addActionListener(this); |
---|
| 1169 | + |
---|
| 1170 | + oe.toolboxPanel.add(row1); |
---|
| 1171 | + |
---|
| 1172 | + cGridBag row2 = new cGridBag(); |
---|
| 1173 | + |
---|
| 1174 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1175 | + groupButton.setToolTipText("Create group"); |
---|
| 1176 | + groupButton.addActionListener(this); |
---|
| 1177 | + |
---|
| 1178 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1179 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1180 | + compositeButton.addActionListener(this); |
---|
| 1181 | + |
---|
| 1182 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1183 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1184 | + switchButton.addActionListener(this); |
---|
| 1185 | + |
---|
| 1186 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1187 | + loopButton.setToolTipText("Create loop"); |
---|
| 1188 | + loopButton.addActionListener(this); |
---|
| 1189 | + |
---|
| 1190 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1191 | + textureButton.setToolTipText("Create texture"); |
---|
| 1192 | + textureButton.addActionListener(this); |
---|
| 1193 | + |
---|
| 1194 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1195 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1196 | + overlayButton.addActionListener(this); |
---|
| 1197 | + |
---|
| 1198 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1199 | + lightButton.setToolTipText("Create light"); |
---|
| 1200 | + lightButton.addActionListener(this); |
---|
| 1201 | + |
---|
| 1202 | + oe.toolboxPanel.add(row2); |
---|
| 1203 | + |
---|
| 1204 | + cGridBag textures = new cGridBag(); |
---|
| 1205 | + |
---|
| 1206 | + CreateTexturePanel(textures); |
---|
| 1207 | + |
---|
| 1208 | + oe.toolboxPanel.add(textures); |
---|
| 1209 | + |
---|
| 1210 | + textures.preferredHeight = 100; |
---|
| 1211 | + |
---|
| 1212 | + CreateSkyboxPanel(oe.skyboxPanel); |
---|
| 1213 | + |
---|
| 1214 | + // EDIT panel |
---|
| 1215 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1216 | + editButton.setToolTipText("Pin selection controls"); |
---|
| 1217 | + editButton.addActionListener(this); |
---|
| 1218 | + |
---|
| 1219 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1220 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
560 | 1221 | uneditButton.addActionListener(this); |
---|
561 | 1222 | |
---|
562 | | - oe.aConstraints.gridx += 1; |
---|
563 | | - oe.aConstraints.weighty = 0; |
---|
564 | | - oe.aConstraints.gridwidth = 1; |
---|
565 | | - |
---|
566 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
567 | | - clearPanelButton.addActionListener(this); |
---|
568 | | - |
---|
569 | | - oe.aConstraints.gridx += 1; |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 1; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 1223 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 1224 | + allParamsButton.setToolTipText("Show all controls"); |
---|
574 | 1225 | allParamsButton.addActionListener(this); |
---|
575 | 1226 | |
---|
576 | | - oe.aConstraints.gridx += 1; |
---|
577 | | - oe.aConstraints.weighty = 0; |
---|
578 | | - oe.aConstraints.gridwidth = 1; |
---|
579 | | - |
---|
580 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
581 | | - unselectButton.addActionListener(this); |
---|
| 1227 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1228 | + clearPanelButton.setToolTipText("Clear all controls"); |
---|
| 1229 | + clearPanelButton.addActionListener(this); |
---|
582 | 1230 | |
---|
| 1231 | + //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1232 | + //unselectButton.setToolTipText("Unselect"); |
---|
| 1233 | + //unselectButton.addActionListener(this); |
---|
| 1234 | + |
---|
| 1235 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1236 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1237 | + flashSelectionButton.addActionListener(this); |
---|
| 1238 | + |
---|
| 1239 | + editCommandsPanel.preferredHeight = 1; |
---|
| 1240 | + |
---|
| 1241 | + SetPinStates(false); |
---|
| 1242 | +// oe.treePanel.add(commandsPanel); |
---|
| 1243 | +// oe.treePanel.Return(); |
---|
| 1244 | + |
---|
583 | 1245 | // oe.aConstraints.gridx += 1; |
---|
584 | 1246 | // oe.aConstraints.weighty = 0; |
---|
585 | 1247 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
591 | 1253 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
592 | 1254 | // gcButton.addActionListener(this); |
---|
593 | 1255 | |
---|
594 | | - oe.aConstraints.gridx = 0; |
---|
595 | | - oe.aConstraints.gridy += 1; |
---|
596 | | - |
---|
597 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
598 | | - oe.aConstraints.gridwidth = 100; |
---|
599 | | - // oe.aConstraints.gridheight = 100; |
---|
600 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
601 | | - oe.aConstraints.gridheight = 1; |
---|
602 | | - oe.aConstraints.weighty = 0.5; |
---|
603 | | - oe.aConstraints.gridx = 0; |
---|
604 | | - JScrollPane jSP; |
---|
| 1256 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 1257 | + |
---|
| 1258 | + JScrollPane jSP; |
---|
605 | 1259 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
606 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 1260 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
607 | 1261 | ResetModel(); |
---|
608 | | - oe.aConstraints.weighty = 0.5; |
---|
609 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
610 | | - oe.aConstraints.gridy += 1; |
---|
611 | | - oe.aConstraints.gridwidth = 1; |
---|
612 | | - |
---|
613 | | - oe.aConstraints.weighty = 0; |
---|
614 | | - oe.aConstraints.gridwidth = 2; |
---|
615 | | - |
---|
616 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
617 | | - colorCB.addItemListener(this); |
---|
618 | | - oe.aConstraints.gridx += 2; |
---|
619 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
620 | | - materialCB.addItemListener(this); |
---|
621 | | - oe.aConstraints.gridx += 2; |
---|
622 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
623 | | - textureCB.addItemListener(this); |
---|
624 | | - |
---|
625 | | - oe.aConstraints.gridx = 0; |
---|
626 | | - oe.aConstraints.gridy += 1; |
---|
627 | 1262 | |
---|
| 1263 | + oe.treePanel.add(jSPPanel); |
---|
| 1264 | + oe.treePanel.Return(); |
---|
| 1265 | + |
---|
| 1266 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 1267 | + oe.treePanel.Return(); |
---|
| 1268 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1269 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1270 | + sliderPane.preferredHeight = 1; |
---|
| 1271 | + |
---|
| 1272 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1273 | + mainPanel.setResizeWeight(0.4); |
---|
| 1274 | + |
---|
628 | 1275 | //jList.addListSelectionListener(this); |
---|
629 | 1276 | oe.jTree.addTreeSelectionListener(this); |
---|
630 | 1277 | //jTree.setRootVisible(false); |
---|
631 | 1278 | //jTree.setEditable(true); |
---|
632 | 1279 | oe.jTree.setDragEnabled(true); |
---|
633 | 1280 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
634 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1281 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
635 | 1282 | |
---|
636 | 1283 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
637 | 1284 | |
---|
.. | .. |
---|
643 | 1290 | dgr.addDragGestureListener(this); |
---|
644 | 1291 | }catch(Exception e) {} |
---|
645 | 1292 | */ |
---|
646 | | - radio.layout = sevenButton; |
---|
| 1293 | + radio.layout = threeButton; // sixButton; |
---|
647 | 1294 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
648 | 1295 | } |
---|
| 1296 | + |
---|
| 1297 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1298 | + { |
---|
| 1299 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1300 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1301 | + colorCB.addItemListener(this); |
---|
| 1302 | + |
---|
| 1303 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1304 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1305 | + materialCB.addItemListener(this); |
---|
| 1306 | + |
---|
| 1307 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1308 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1309 | + textureCB.addItemListener(this); |
---|
| 1310 | + |
---|
| 1311 | + panel.Return(); |
---|
| 1312 | + |
---|
| 1313 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 1314 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 1315 | + boxCB.addItemListener(this); |
---|
| 1316 | + |
---|
| 1317 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 1318 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
| 1319 | + zoomBoxCB.addItemListener(this); |
---|
| 1320 | + |
---|
| 1321 | + if (true) // Globals.ADVANCED) |
---|
| 1322 | + { |
---|
| 1323 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1324 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1325 | +// supportCB.addItemListener(this); |
---|
| 1326 | + |
---|
| 1327 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1328 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1329 | + freezeCB.addItemListener(this); |
---|
| 1330 | + |
---|
| 1331 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 1332 | + // localCB.addItemListener(this); |
---|
| 1333 | + |
---|
| 1334 | + panel.Return(); |
---|
| 1335 | + |
---|
| 1336 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 1337 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 1338 | + crowdCB.addItemListener(this); |
---|
| 1339 | + |
---|
| 1340 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 1341 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 1342 | + smoothCB.addItemListener(this); |
---|
| 1343 | + |
---|
| 1344 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1345 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1346 | +// slowCB.addItemListener(this); |
---|
| 1347 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1348 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1349 | + minshaderCB.addItemListener(this); |
---|
| 1350 | + |
---|
| 1351 | +// constraints.gridy += 1; |
---|
| 1352 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 1353 | +// speakerMocapCB.addItemListener(this); |
---|
| 1354 | + |
---|
| 1355 | + panel.Return(); |
---|
| 1356 | + |
---|
| 1357 | + if (false) |
---|
| 1358 | + { |
---|
| 1359 | + // handled in scripts |
---|
| 1360 | + //constraints.gridy += 1; |
---|
| 1361 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 1362 | + speakerCameraCB.addItemListener(this); |
---|
| 1363 | + |
---|
| 1364 | + //constraints.gridy += 1; |
---|
| 1365 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 1366 | + speakerFocusCB.addItemListener(this); |
---|
| 1367 | + |
---|
| 1368 | + //constraints.gridy += 1; |
---|
| 1369 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 1370 | + smoothfocusCB.addItemListener(this); |
---|
| 1371 | + panel.Return(); |
---|
| 1372 | + } |
---|
| 1373 | + |
---|
| 1374 | +//constraints.gridx += 1; |
---|
| 1375 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 1376 | +// debugCB.addItemListener(this); |
---|
| 1377 | + |
---|
| 1378 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1379 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1380 | + trackCB.addItemListener(this); |
---|
| 1381 | + |
---|
| 1382 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 1383 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
| 1384 | + oeilCB.addItemListener(this); |
---|
| 1385 | + |
---|
| 1386 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 1387 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 1388 | + shadowCB.addItemListener(this); |
---|
| 1389 | + |
---|
| 1390 | + panel.Return(); |
---|
| 1391 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1392 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1393 | + toggleTextureCB.addItemListener(this); |
---|
| 1394 | + |
---|
| 1395 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1396 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1397 | + toggleSwitchCB.addItemListener(this); |
---|
| 1398 | + |
---|
| 1399 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1400 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1401 | + autokeepCB.addItemListener(this); |
---|
| 1402 | + |
---|
| 1403 | + panel.Return(); |
---|
| 1404 | + if (Globals.ADVANCED) |
---|
| 1405 | + { |
---|
| 1406 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 1407 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 1408 | + lookAtCB.addItemListener(this); |
---|
| 1409 | + } |
---|
| 1410 | + |
---|
| 1411 | + } |
---|
| 1412 | + |
---|
| 1413 | + cGridBag fill = new cGridBag(); |
---|
| 1414 | + fill.preferredHeight = 200; |
---|
| 1415 | + cGridBag fill2 = new cGridBag(); |
---|
| 1416 | + fill2.preferredHeight = 200; |
---|
| 1417 | + cGridBag fill3 = new cGridBag(); |
---|
| 1418 | + fill3.preferredHeight = 200; |
---|
| 1419 | + |
---|
| 1420 | + panel.add(fill); |
---|
| 1421 | + panel.add(fill2); |
---|
| 1422 | + panel.add(fill3); |
---|
| 1423 | + |
---|
| 1424 | + } |
---|
649 | 1425 | |
---|
650 | 1426 | void EditObject(Object3D obj) |
---|
651 | 1427 | { |
---|
652 | 1428 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1429 | + |
---|
| 1430 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1431 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1432 | + if (!radioButton.hadMaterial) |
---|
| 1433 | + { |
---|
| 1434 | + obj.material = new cMaterial(); |
---|
| 1435 | + } |
---|
| 1436 | + |
---|
653 | 1437 | radioButton.SetObject(obj); |
---|
654 | | - radioButton.layout = sevenButton; |
---|
| 1438 | + radioButton.layout = threeButton; // sixButton; |
---|
655 | 1439 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
656 | 1440 | radioButton.addActionListener(this); |
---|
657 | 1441 | radioPanel.add(radioButton); |
---|
658 | 1442 | buttonGroup.add(radioButton); |
---|
659 | 1443 | radioButton.doClick(); |
---|
660 | 1444 | } |
---|
| 1445 | + |
---|
661 | 1446 | void SetupViews(ObjEditor oe) |
---|
662 | 1447 | { |
---|
| 1448 | + theFrame = this; |
---|
| 1449 | + |
---|
663 | 1450 | oe.SetupViews(); |
---|
664 | 1451 | |
---|
665 | 1452 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
668 | 1455 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
669 | 1456 | } |
---|
670 | 1457 | |
---|
671 | | - JCheckBox liveCB; |
---|
672 | | - JCheckBox supportCB; |
---|
673 | | - JCheckBox localCB; |
---|
674 | | - JCheckBox crowdCB; |
---|
675 | | - JCheckBox smoothCB; |
---|
676 | | - JCheckBox fastCB; |
---|
677 | | - JCheckBox slowCB; |
---|
678 | | - JCheckBox boxCB; |
---|
679 | | - JCheckBox trackCB; |
---|
680 | | - JCheckBox smoothfocusCB; |
---|
| 1458 | + cToggleButton liveCB; |
---|
| 1459 | + cCheckBox supportCB; |
---|
| 1460 | + cCheckBox localCB; |
---|
| 1461 | + cCheckBox crowdCB; |
---|
| 1462 | + cCheckBox smoothCB; |
---|
| 1463 | + cCheckBox minshaderCB; |
---|
| 1464 | + |
---|
| 1465 | + cToggleButton fastCB; |
---|
| 1466 | + cCheckBox slowCB; |
---|
| 1467 | + cCheckBox boxCB; |
---|
| 1468 | + cCheckBox zoomBoxCB; |
---|
| 1469 | + cCheckBox freezeCB; |
---|
| 1470 | + //cToggleButton trackCB; |
---|
| 1471 | + cCheckBox trackCB; |
---|
| 1472 | + cCheckBox smoothfocusCB; |
---|
681 | 1473 | // JCheckBox speakerMocapCB; |
---|
682 | | - JCheckBox speakerCameraCB; |
---|
683 | | - JCheckBox speakerFocusCB; |
---|
684 | | - JCheckBox debugCB; |
---|
685 | | - JCheckBox oeilCB; |
---|
686 | | - JCheckBox lookAtCB; |
---|
| 1474 | + cCheckBox speakerCameraCB; |
---|
| 1475 | + cCheckBox speakerFocusCB; |
---|
| 1476 | + cCheckBox debugCB; |
---|
| 1477 | + |
---|
| 1478 | + cCheckBox oeilCB; |
---|
| 1479 | + cCheckBox shadowCB; |
---|
| 1480 | + cCheckBox autokeepCB; |
---|
| 1481 | + cCheckBox lookAtCB; |
---|
687 | 1482 | |
---|
688 | 1483 | // static int COLOR = 1; |
---|
689 | 1484 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
691 | 1486 | |
---|
692 | 1487 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
693 | 1488 | |
---|
694 | | - JCheckBox colorCB; |
---|
695 | | - JCheckBox materialCB; |
---|
696 | | - JCheckBox textureCB; |
---|
| 1489 | + cCheckBox colorCB; |
---|
| 1490 | + cCheckBox materialCB; |
---|
| 1491 | + cCheckBox textureCB; |
---|
697 | 1492 | |
---|
698 | 1493 | public void itemStateChanged(ItemEvent e) |
---|
699 | 1494 | { |
---|
.. | .. |
---|
721 | 1516 | } else if(e.getSource() == liveCB) |
---|
722 | 1517 | { |
---|
723 | 1518 | cameraView.ToggleLive(); |
---|
| 1519 | + refreshContents(false); |
---|
724 | 1520 | } |
---|
725 | 1521 | else if(e.getSource() == supportCB) |
---|
726 | 1522 | { |
---|
.. | .. |
---|
736 | 1532 | { |
---|
737 | 1533 | cameraView.ToggleInertia(); |
---|
738 | 1534 | cameraView.repaint(); |
---|
| 1535 | + } |
---|
| 1536 | + else if(e.getSource() == minshaderCB) |
---|
| 1537 | + { |
---|
| 1538 | + Globals.MINSHADER ^= true; |
---|
| 1539 | + cameraView.programInitialized = false; |
---|
| 1540 | + cameraView.repaint(); |
---|
739 | 1541 | } |
---|
740 | 1542 | else if(e.getSource() == localCB) |
---|
741 | 1543 | { |
---|
.. | .. |
---|
755 | 1557 | Recompile(); |
---|
756 | 1558 | cameraView.repaint(); |
---|
757 | 1559 | // refreshContents(); |
---|
| 1560 | + } |
---|
| 1561 | + else if(e.getSource() == zoomBoxCB) |
---|
| 1562 | + { |
---|
| 1563 | + cameraView.ToggleZoomBoxMode(); |
---|
758 | 1564 | } |
---|
759 | 1565 | else if(e.getSource() == smoothfocusCB) |
---|
760 | 1566 | { |
---|
.. | .. |
---|
781 | 1587 | { |
---|
782 | 1588 | cameraView.ToggleOeil(); |
---|
783 | 1589 | } |
---|
| 1590 | + else if(e.getSource() == shadowCB) |
---|
| 1591 | + { |
---|
| 1592 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1593 | + } |
---|
| 1594 | + else if(e.getSource() == freezeCB) |
---|
| 1595 | + { |
---|
| 1596 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1597 | + } |
---|
| 1598 | + else if(e.getSource() == autokeepCB) |
---|
| 1599 | + { |
---|
| 1600 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1601 | + } |
---|
784 | 1602 | else if(e.getSource() == lookAtCB) |
---|
785 | 1603 | { |
---|
786 | 1604 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
797 | 1615 | |
---|
798 | 1616 | /**/ |
---|
799 | 1617 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
800 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1618 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1619 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
801 | 1620 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
802 | 1621 | // We can't move the root node or an empty selection |
---|
803 | 1622 | return; |
---|
.. | .. |
---|
860 | 1679 | } |
---|
861 | 1680 | } |
---|
862 | 1681 | |
---|
863 | | - String string = (String) object; |
---|
864 | | - |
---|
865 | 1682 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
866 | 1683 | // if( object instanceof java.io.File[]) |
---|
867 | 1684 | // { |
---|
.. | .. |
---|
869 | 1686 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
870 | 1687 | // return; |
---|
871 | 1688 | // } |
---|
872 | | - if (string.charAt(0) == '/') |
---|
| 1689 | + |
---|
| 1690 | + String string = object.toString(); |
---|
| 1691 | + |
---|
| 1692 | + // File path for Mac and Windows |
---|
| 1693 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
873 | 1694 | { |
---|
874 | 1695 | // file(s) |
---|
875 | 1696 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
896 | 1717 | |
---|
897 | 1718 | flashIt = false; |
---|
898 | 1719 | CameraPane pane = (CameraPane) target; |
---|
899 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1720 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
900 | 1721 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
901 | 1722 | |
---|
902 | 1723 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
912 | 1733 | |
---|
913 | 1734 | assert target == objEditor.jTree; |
---|
914 | 1735 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1736 | + Object3D destinationLeaf; |
---|
915 | 1737 | try { |
---|
916 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1738 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
917 | 1739 | } catch (Exception e) { |
---|
918 | 1740 | System.out.println("destinationPath : " + destinationPath); |
---|
919 | 1741 | return; |
---|
920 | 1742 | } |
---|
921 | 1743 | |
---|
922 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1744 | + for (int i=group.selection.size(); --i>=0;) |
---|
923 | 1745 | { |
---|
| 1746 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1747 | + |
---|
| 1748 | + // Cannot move into itself |
---|
| 1749 | + if (child == destinationLeaf) |
---|
| 1750 | + return; |
---|
| 1751 | + } |
---|
| 1752 | + |
---|
| 1753 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1754 | +// { |
---|
924 | 1755 | loadClipboard(true); |
---|
925 | 1756 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
926 | | - pasteInto(false); |
---|
927 | | - } else { |
---|
928 | | - loadClipboard(false); |
---|
929 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
930 | | - pasteInto(false); // true); // ??? |
---|
931 | | - } |
---|
| 1757 | + pasteInto(false, false); |
---|
| 1758 | +// } else { |
---|
| 1759 | +// loadClipboard(false); |
---|
| 1760 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1761 | +// pasteInto(false, false); // true); // ??? |
---|
| 1762 | +// } |
---|
932 | 1763 | } |
---|
933 | 1764 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
934 | 1765 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1033 | 1864 | { |
---|
1034 | 1865 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1035 | 1866 | //heightFieldItem.addActionListener(this); |
---|
1036 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1037 | | - gridItem.addActionListener(this); |
---|
1038 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1039 | | - rectoidItem.addActionListener(this); |
---|
1040 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1041 | | - ellipsoidItem.addActionListener(this); |
---|
1042 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1043 | | - coneItem.addActionListener(this); |
---|
1044 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1045 | | - torusItem.addActionListener(this); |
---|
1046 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1047 | | - superItem.addActionListener(this); |
---|
| 1867 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1868 | +// gridItem.addActionListener(this); |
---|
| 1869 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1870 | +// rectoidItem.addActionListener(this); |
---|
| 1871 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1872 | +// ellipsoidItem.addActionListener(this); |
---|
| 1873 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1874 | +// coneItem.addActionListener(this); |
---|
| 1875 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1876 | +// torusItem.addActionListener(this); |
---|
| 1877 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1878 | +// superItem.addActionListener(this); |
---|
| 1879 | + |
---|
| 1880 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1881 | + cameraItem.addActionListener(this); |
---|
| 1882 | + |
---|
| 1883 | + if (!Globals.ADVANCED) |
---|
| 1884 | + { |
---|
1048 | 1885 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1049 | 1886 | kleinItem.addActionListener(this); |
---|
1050 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1051 | | - particleItem.addActionListener(this); |
---|
| 1887 | + } |
---|
| 1888 | + |
---|
| 1889 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1890 | +// particleItem.addActionListener(this); |
---|
| 1891 | + if (Globals.ADVANCED) |
---|
| 1892 | + { |
---|
1052 | 1893 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1053 | 1894 | ragdollItem.addActionListener(this); |
---|
1054 | 1895 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1055 | 1896 | ragdoll2Item.addActionListener(this); |
---|
| 1897 | + } |
---|
1056 | 1898 | menu.add("-"); |
---|
1057 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1899 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1058 | 1900 | meshItem.addActionListener(this); |
---|
1059 | 1901 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1060 | 1902 | // meshGroupItem.addActionListener(this); |
---|
| 1903 | + if (Globals.ADVANCED) |
---|
| 1904 | + { |
---|
1061 | 1905 | springItem = menu.add(new MenuItem("Spring")); |
---|
1062 | 1906 | springItem.addActionListener(this); |
---|
1063 | 1907 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1064 | 1908 | flagItem.addActionListener(this); |
---|
1065 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1066 | | - bezierItem.addActionListener(this); |
---|
1067 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1068 | | - checkerItem.addActionListener(this); |
---|
1069 | 1909 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1070 | 1910 | blobItem.addActionListener(this); |
---|
1071 | 1911 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1072 | 1912 | latheItem.addActionListener(this); |
---|
1073 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1074 | | - lightItem.addActionListener(this); |
---|
| 1913 | + } |
---|
| 1914 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1915 | + bezierItem.addActionListener(this); |
---|
| 1916 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1917 | +// overlayItem.addActionListener(this); |
---|
| 1918 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1919 | +// lightItem.addActionListener(this); |
---|
1075 | 1920 | menu.add("-"); |
---|
1076 | 1921 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1077 | 1922 | //superLoopItem.addActionListener(this); |
---|
1078 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1079 | | - loopItem.addActionListener(this); |
---|
| 1923 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1924 | +// loopItem.addActionListener(this); |
---|
1080 | 1925 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1081 | 1926 | doubleItem.addActionListener(this); |
---|
| 1927 | + if (Globals.ADVANCED) |
---|
| 1928 | + { |
---|
1082 | 1929 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1083 | 1930 | tripleItem.addActionListener(this); |
---|
| 1931 | + } |
---|
1084 | 1932 | } |
---|
1085 | 1933 | |
---|
1086 | 1934 | void buildToolsMenu(Menu menu) |
---|
1087 | 1935 | { |
---|
1088 | 1936 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1089 | 1937 | animationItem.addItemListener(this); |
---|
1090 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1938 | + animationItem.setState(Globals.ANIMATION); |
---|
| 1939 | + |
---|
| 1940 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1941 | + archiveItem.addActionListener(this); |
---|
1091 | 1942 | |
---|
1092 | 1943 | menu.add("-"); |
---|
1093 | 1944 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1094 | 1945 | parseverticesItem.addActionListener(this); |
---|
1095 | 1946 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1096 | 1947 | textureFieldItem.addActionListener(this); |
---|
1097 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1948 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1098 | 1949 | alignItem.addActionListener(this); |
---|
1099 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1100 | | - mirrorItem.addActionListener(this); |
---|
1101 | 1950 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1102 | 1951 | reduceMorphItem.addActionListener(this); |
---|
1103 | 1952 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1104 | 1953 | reduce34MorphItem.addActionListener(this); |
---|
1105 | | - |
---|
1106 | | - menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1107 | | - computeAOItem.addActionListener(this); |
---|
1108 | 1954 | menu.add("-"); |
---|
1109 | | - |
---|
1110 | 1955 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1111 | 1956 | memoryItem.addActionListener(this); |
---|
| 1957 | + menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
| 1958 | + computeAOItem.addActionListener(this); |
---|
| 1959 | + |
---|
| 1960 | + if (Globals.ADVANCED) |
---|
| 1961 | + { |
---|
| 1962 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1963 | + mirrorItem.addActionListener(this); |
---|
| 1964 | + menu.add("-"); |
---|
1112 | 1965 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1113 | 1966 | analyzeItem.addActionListener(this); |
---|
1114 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1967 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1115 | 1968 | dumpItem.addActionListener(this); |
---|
1116 | 1969 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1117 | 1970 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1129 | 1982 | menu.add("-"); |
---|
1130 | 1983 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1131 | 1984 | editScriptItem.addActionListener(this); |
---|
| 1985 | + } |
---|
1132 | 1986 | } |
---|
1133 | 1987 | |
---|
1134 | 1988 | void ScreenFit() |
---|
.. | .. |
---|
1251 | 2105 | shadow.material = new cMaterial(obj.material); |
---|
1252 | 2106 | shadow.material.diffuse = 0.0001f; |
---|
1253 | 2107 | shadow.material.specular = 0.0001f; |
---|
| 2108 | + //shadow.projectedVertices[1].x = 300; |
---|
1254 | 2109 | |
---|
1255 | 2110 | makeSomething(shadow); |
---|
1256 | 2111 | } |
---|
| 2112 | + |
---|
| 2113 | + private void ClearUnpinned() |
---|
| 2114 | + { |
---|
| 2115 | + //for (Object3D obj : listUI) |
---|
| 2116 | + for (int i=listUI.size(); --i>=0;) |
---|
| 2117 | + { |
---|
| 2118 | + Object3D obj = listUI.elementAt(i); |
---|
| 2119 | + if (!obj.pinned) |
---|
| 2120 | + { |
---|
| 2121 | + obj.CloseUI(); |
---|
| 2122 | + listUI.remove(i); |
---|
| 2123 | + } |
---|
| 2124 | + } |
---|
| 2125 | + } |
---|
| 2126 | + |
---|
| 2127 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2128 | + { |
---|
| 2129 | + // if (!(elem instanceof Composite)) |
---|
| 2130 | + // newWindow = false; |
---|
| 2131 | + listUI.add(elem); |
---|
| 2132 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2133 | + System.out.println("edit : " + elem); |
---|
| 2134 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 2135 | + } |
---|
1257 | 2136 | |
---|
1258 | 2137 | /** |
---|
1259 | 2138 | * applyExample |
---|
.. | .. |
---|
1457 | 2336 | |
---|
1458 | 2337 | void Overwrite(int mask) |
---|
1459 | 2338 | { |
---|
1460 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2339 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1461 | 2340 | { |
---|
1462 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2341 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1463 | 2342 | |
---|
1464 | 2343 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1465 | 2344 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1482 | 2361 | // |
---|
1483 | 2362 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1484 | 2363 | { |
---|
| 2364 | + Object source = event.getSource(); |
---|
1485 | 2365 | /* |
---|
1486 | 2366 | if (event.getSource() == nameField) |
---|
1487 | 2367 | { |
---|
.. | .. |
---|
1493 | 2373 | } |
---|
1494 | 2374 | else |
---|
1495 | 2375 | */ |
---|
1496 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 2376 | + if (source == lookAtItem || source == lookFromItem) |
---|
1497 | 2377 | { |
---|
1498 | 2378 | ScreenFit(); |
---|
1499 | 2379 | } else |
---|
1500 | | - if (event.getSource() == switchItem) |
---|
| 2380 | + if (source == switchViewItem) |
---|
1501 | 2381 | { |
---|
1502 | 2382 | cVector v1 = new cVector(); |
---|
1503 | 2383 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1506 | 2386 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1507 | 2387 | objEditor.cameraView.repaint(); |
---|
1508 | 2388 | } else |
---|
1509 | | - if (event.getSource() == rectoidItem) |
---|
| 2389 | + if (source == rectoidItem || source == boxButton) |
---|
1510 | 2390 | { |
---|
1511 | 2391 | makeSomething(new Box()); |
---|
1512 | 2392 | } else |
---|
1513 | | - if (event.getSource() == particleItem) |
---|
| 2393 | + if (source == particleItem || source == particlesButton) |
---|
1514 | 2394 | { |
---|
1515 | 2395 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1516 | 2396 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1531 | 2411 | applyExample(particleGeom, "SMOKE"); |
---|
1532 | 2412 | makeSomething(particleGeom); |
---|
1533 | 2413 | } else |
---|
1534 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 2414 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1535 | 2415 | { |
---|
1536 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 2416 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1537 | 2417 | |
---|
1538 | 2418 | ragdoll.toParent = LA.newMatrix(); |
---|
1539 | 2419 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1551 | 2431 | } else |
---|
1552 | 2432 | /* |
---|
1553 | 2433 | */ |
---|
1554 | | - if (event.getSource() == heightFieldItem) |
---|
| 2434 | + if (source == heightFieldItem) |
---|
1555 | 2435 | { |
---|
1556 | 2436 | Object3D obj = new Object3D(); |
---|
1557 | 2437 | |
---|
.. | .. |
---|
1589 | 2469 | |
---|
1590 | 2470 | makeSomething(obj); |
---|
1591 | 2471 | } else |
---|
1592 | | - if (event.getSource() == gridItem) |
---|
| 2472 | + if (source == gridItem || source == gridButton) |
---|
1593 | 2473 | { |
---|
1594 | 2474 | makeSomething(new Grid()); |
---|
1595 | 2475 | } else |
---|
1596 | | - if (event.getSource() == ellipsoidItem) |
---|
| 2476 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1597 | 2477 | { |
---|
1598 | 2478 | makeSomething(new Sphere()); |
---|
1599 | 2479 | } else |
---|
1600 | | - if (event.getSource() == coneItem) |
---|
| 2480 | + if (source == coneItem || source == coneButton) |
---|
1601 | 2481 | { |
---|
1602 | 2482 | makeSomething(new Cone()); |
---|
1603 | 2483 | } else |
---|
1604 | | - if (event.getSource() == torusItem) |
---|
| 2484 | + if (source == torusItem || source == torusButton) |
---|
1605 | 2485 | { |
---|
1606 | 2486 | makeSomething(new Torus()); |
---|
1607 | 2487 | } else |
---|
1608 | | - if (event.getSource() == superItem) |
---|
| 2488 | + if (source == superItem || source == superButton) |
---|
1609 | 2489 | { |
---|
1610 | 2490 | makeSomething(new Superellipsoid()); |
---|
1611 | 2491 | } else |
---|
1612 | | - if (event.getSource() == kleinItem) |
---|
| 2492 | + if (source == kleinItem || source == kleinButton) |
---|
1613 | 2493 | { |
---|
1614 | 2494 | makeSomething(new Klein()); |
---|
1615 | 2495 | } else |
---|
1616 | | - if (event.getSource() == blobItem) |
---|
| 2496 | + if (source == blobItem) |
---|
1617 | 2497 | { |
---|
1618 | 2498 | Blob blob = new Blob(); |
---|
1619 | 2499 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1621 | 2501 | //blob.retile(); |
---|
1622 | 2502 | makeSomething(blob); |
---|
1623 | 2503 | } else |
---|
1624 | | - if (event.getSource() == latheItem) |
---|
| 2504 | + if (source == latheItem) |
---|
1625 | 2505 | { |
---|
1626 | 2506 | makeSomething(new Lathe()); |
---|
1627 | 2507 | } else |
---|
1628 | | - if (event.getSource() == bezierItem) |
---|
| 2508 | + if (source == bezierItem) |
---|
1629 | 2509 | { |
---|
1630 | 2510 | makeSomething(new BezierSurface()); |
---|
1631 | 2511 | } else |
---|
1632 | | - if (event.getSource() == checkerItem) |
---|
| 2512 | + if (source == overlayItem || source == overlayButton) |
---|
1633 | 2513 | { |
---|
1634 | 2514 | /* |
---|
1635 | 2515 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1644 | 2524 | */ |
---|
1645 | 2525 | makeSomething(new Checker()); |
---|
1646 | 2526 | } else |
---|
1647 | | - if (event.getSource() == meshItem) |
---|
| 2527 | + if (source == meshItem) |
---|
1648 | 2528 | { |
---|
1649 | 2529 | Object3D itemtomake = new Object3D(); |
---|
1650 | 2530 | Object3D child; |
---|
.. | .. |
---|
1665 | 2545 | makeSomething(child); |
---|
1666 | 2546 | } |
---|
1667 | 2547 | } else |
---|
1668 | | - if (event.getSource() == springItem) |
---|
| 2548 | + if (source == springItem) |
---|
1669 | 2549 | { |
---|
1670 | 2550 | cSpring s = new cSpring(); |
---|
1671 | 2551 | s.setup(); |
---|
1672 | 2552 | makeSomething(s); |
---|
1673 | 2553 | } else |
---|
1674 | | - if (event.getSource() == flagItem) |
---|
| 2554 | + if (source == flagItem) |
---|
1675 | 2555 | { |
---|
1676 | 2556 | cSpring s = new cFlag(); |
---|
1677 | 2557 | s.setup(); |
---|
1678 | 2558 | makeSomething(s); |
---|
1679 | 2559 | } else |
---|
1680 | | - if (event.getSource() == lightItem) |
---|
| 2560 | + if (source == lightItem || source == lightButton) |
---|
1681 | 2561 | { |
---|
1682 | 2562 | makeSomething(new Light()); |
---|
1683 | 2563 | } else |
---|
1684 | | - if (event.getSource() == csgItem) |
---|
| 2564 | +// if (source == skybox1Button || |
---|
| 2565 | +// source == skybox2Button || |
---|
| 2566 | +// source == skybox3Button || |
---|
| 2567 | +// source == skybox4Button || |
---|
| 2568 | +// source == skybox5Button || |
---|
| 2569 | +// source == skybox6Button || |
---|
| 2570 | +// source == skybox7Button || |
---|
| 2571 | +// source == skybox11Button || |
---|
| 2572 | +// source == skybox12Button || |
---|
| 2573 | +// source == skybox13Button || |
---|
| 2574 | +// source == skybox14Button || |
---|
| 2575 | +// source == skybox15Button || |
---|
| 2576 | +// source == skybox16Button || |
---|
| 2577 | +// source == skybox17Button) |
---|
| 2578 | +// { |
---|
| 2579 | +// ChangeSkybox(source); |
---|
| 2580 | +// } else |
---|
| 2581 | + if (source == csgItem) |
---|
1685 | 2582 | { |
---|
1686 | 2583 | group(new CSG()); |
---|
1687 | 2584 | } else |
---|
1688 | | - if (event.getSource() == templateItem) |
---|
| 2585 | + if (source == templateItem) |
---|
1689 | 2586 | { |
---|
1690 | 2587 | group(new cTemplate()); |
---|
1691 | 2588 | } else |
---|
1692 | | - if (event.getSource() == attributeItem) |
---|
| 2589 | + if (source == attributeItem) |
---|
1693 | 2590 | { |
---|
1694 | 2591 | makeSomething(new Attribute()); |
---|
1695 | 2592 | } else |
---|
1696 | | - if (event.getSource() == pointflowItem) |
---|
| 2593 | + if (source == pointflowItem) |
---|
1697 | 2594 | { |
---|
1698 | 2595 | makeSomething(new PointFlow()); |
---|
1699 | 2596 | } else |
---|
.. | .. |
---|
1705 | 2602 | } else |
---|
1706 | 2603 | */ |
---|
1707 | 2604 | |
---|
1708 | | - if (event.getSource() == superLoopItem) |
---|
| 2605 | + if (source == superLoopItem) |
---|
1709 | 2606 | { |
---|
1710 | 2607 | Composite g = new cGroup(); |
---|
1711 | 2608 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1727 | 2624 | |
---|
1728 | 2625 | group(g); |
---|
1729 | 2626 | } else |
---|
1730 | | - if (event.getSource() == loopItem) |
---|
| 2627 | + if (source == loopItem || source == loopButton) |
---|
1731 | 2628 | { |
---|
1732 | 2629 | Composite csg = new GroupLeaf(); |
---|
1733 | 2630 | csg.count = 5; |
---|
1734 | 2631 | group(csg); |
---|
1735 | | - Composite child = new cGroup(); |
---|
| 2632 | + Composite child = new cGroup("Branch"); |
---|
1736 | 2633 | csg.addChild(child); |
---|
1737 | 2634 | child.addChild(csg); |
---|
1738 | 2635 | } else |
---|
1739 | | - if (event.getSource() == doubleItem) |
---|
| 2636 | + if (source == doubleItem) |
---|
1740 | 2637 | { |
---|
1741 | | - Composite csg = new GroupLeaf(); |
---|
| 2638 | + Composite csg = new GroupLeaf("Fork"); |
---|
1742 | 2639 | csg.count = 5; |
---|
1743 | 2640 | group(csg); |
---|
1744 | | - Composite child = new cGroup(); |
---|
| 2641 | + Composite child = new cGroup("Branch A"); |
---|
1745 | 2642 | csg.addChild(child); |
---|
1746 | 2643 | child.addChild(csg); |
---|
1747 | | - child = new cGroup(); |
---|
| 2644 | + child = new cGroup("Branch B"); |
---|
1748 | 2645 | csg.addChild(child); |
---|
1749 | 2646 | child.addChild(csg); |
---|
1750 | 2647 | } else |
---|
1751 | | - if (event.getSource() == tripleItem) |
---|
| 2648 | + if (source == tripleItem) |
---|
1752 | 2649 | { |
---|
1753 | | - Composite csg = new GroupLeaf(); |
---|
| 2650 | + Composite csg = new GroupLeaf("Trident"); |
---|
1754 | 2651 | csg.count = 4; |
---|
1755 | 2652 | group(csg); |
---|
1756 | 2653 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1763 | 2660 | csg.addChild(child); |
---|
1764 | 2661 | child.addChild(csg); |
---|
1765 | 2662 | } else |
---|
1766 | | - |
---|
1767 | | - if (event.getSource() == importGFDItem) |
---|
1768 | | - { |
---|
1769 | | - ImportGFD(); |
---|
1770 | | - } else |
---|
1771 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1772 | | - { |
---|
1773 | | - ImportVRMLX3D(); |
---|
1774 | | - } else |
---|
1775 | | - if (event.getSource() == import3DSItem) |
---|
1776 | | - { |
---|
1777 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1778 | | - } else |
---|
1779 | | - if (event.getSource() == importOBJItem) |
---|
1780 | | - { |
---|
1781 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1782 | | - } else |
---|
1783 | | - if (event.getSource() == computeAOItem) |
---|
| 2663 | + if (source == computeAOItem) |
---|
1784 | 2664 | { |
---|
1785 | 2665 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1786 | | - CameraPane.theRenderer.repaint(); |
---|
| 2666 | + cameraView.repaint(); |
---|
1787 | 2667 | } else |
---|
1788 | | - if (event.getSource() == recompileItem) |
---|
| 2668 | + if (source == recompileItem) |
---|
1789 | 2669 | { |
---|
1790 | 2670 | Recompile(); |
---|
1791 | 2671 | refreshContents(); |
---|
1792 | 2672 | } else |
---|
1793 | | - if (event.getSource() == editScriptItem) |
---|
| 2673 | + if (source == editScriptItem) |
---|
1794 | 2674 | { |
---|
1795 | 2675 | OpenDialog(); |
---|
1796 | 2676 | refreshContents(); |
---|
1797 | 2677 | } else |
---|
1798 | | - if (event.getSource() == invariantsItem) |
---|
| 2678 | + if (source == invariantsItem) |
---|
1799 | 2679 | { |
---|
1800 | 2680 | System.out.println("Invariants:"); |
---|
1801 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2681 | + Grafreed.grafreed.universe.invariants(); |
---|
1802 | 2682 | } else |
---|
1803 | | - if (event.getSource() == memoryItem) |
---|
| 2683 | + if (source == memoryItem) |
---|
1804 | 2684 | { |
---|
1805 | 2685 | //System.out.println("Invariants:"); |
---|
1806 | 2686 | PrintMemory(); |
---|
1807 | 2687 | } else |
---|
1808 | | - if (event.getSource() == pathItem) |
---|
| 2688 | + if (source == pathItem) |
---|
1809 | 2689 | { |
---|
1810 | 2690 | PrintPath(); |
---|
1811 | 2691 | } else |
---|
1812 | | - if (event.getSource() == analyzeItem) |
---|
| 2692 | + if (source == analyzeItem) |
---|
1813 | 2693 | { |
---|
1814 | 2694 | AnalyzeObject(); |
---|
1815 | 2695 | } else |
---|
1816 | | - if (event.getSource() == dumpItem) |
---|
| 2696 | + if (source == dumpItem) |
---|
1817 | 2697 | { |
---|
1818 | 2698 | DumpObject(); |
---|
1819 | 2699 | } else |
---|
1820 | | - if (event.getSource() == screenfitButton) |
---|
| 2700 | + if (source == minButton) |
---|
1821 | 2701 | { |
---|
1822 | | - //Reload(lastConverter, lastFilename, true); |
---|
| 2702 | + Minimize(); |
---|
| 2703 | + } else |
---|
| 2704 | + if (source == maxButton) |
---|
| 2705 | + { |
---|
| 2706 | + Maximize(); |
---|
| 2707 | + } else |
---|
| 2708 | + if (source == fullButton) |
---|
| 2709 | + { |
---|
| 2710 | + ToggleFullScreen(); |
---|
| 2711 | + } else |
---|
| 2712 | + if (source == previousVersionButton) |
---|
| 2713 | + { |
---|
| 2714 | + // Go to previous version |
---|
| 2715 | + //if (!Undo()) |
---|
| 2716 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2717 | + PreviousVersion(); |
---|
| 2718 | + } else |
---|
| 2719 | + if (source == restoreButton) |
---|
| 2720 | + { |
---|
| 2721 | + // Restore current version |
---|
| 2722 | + Restore(); |
---|
| 2723 | + //restoreButton.setEnabled(false); |
---|
| 2724 | + } else |
---|
| 2725 | + if (source == replaceButton) |
---|
| 2726 | + { |
---|
| 2727 | + // Overwrite current version |
---|
| 2728 | + Replace(); |
---|
| 2729 | + //replaceButton.setEnabled(false); |
---|
| 2730 | + } else |
---|
| 2731 | + if (source == nextVersionButton) |
---|
| 2732 | + { |
---|
| 2733 | + // Go to next version |
---|
| 2734 | + NextVersion(); |
---|
| 2735 | + } else |
---|
| 2736 | + if (source == saveVersionButton) |
---|
| 2737 | + { |
---|
| 2738 | + // Save a new version |
---|
| 2739 | + if (!Save(true)) |
---|
| 2740 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2741 | + } else |
---|
| 2742 | + if (source == deleteVersionButton) |
---|
| 2743 | + { |
---|
| 2744 | + // Delete a new version |
---|
| 2745 | + DeleteVersion(); |
---|
| 2746 | + } else |
---|
| 2747 | + if (source == oneStepButton) |
---|
| 2748 | + { |
---|
| 2749 | + Globals.ONESTEP = true; |
---|
| 2750 | + cameraView.repaint(); |
---|
| 2751 | + } else |
---|
| 2752 | + if (source == screenfitButton) |
---|
| 2753 | + { |
---|
1823 | 2754 | ScreenFit(); |
---|
1824 | 2755 | } else |
---|
1825 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2756 | + if (source == screenfitpointButton) |
---|
1826 | 2757 | { |
---|
1827 | | - //Reload(lastConverter, lastFilename, true); |
---|
1828 | 2758 | ScreenFitPoint(); |
---|
1829 | 2759 | } else |
---|
1830 | | - if (event.getSource() == snapobjectButton) |
---|
| 2760 | + if (source == snapobjectButton) |
---|
1831 | 2761 | { |
---|
1832 | | - //Reload(lastConverter, lastFilename, true); |
---|
1833 | 2762 | SnapObject(); |
---|
1834 | 2763 | } else |
---|
1835 | 2764 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1838 | 2767 | // Recompile(); |
---|
1839 | 2768 | // refreshContents(); |
---|
1840 | 2769 | // } else |
---|
1841 | | - if (event.getSource() == gcButton) |
---|
| 2770 | + if (source == gcButton) |
---|
1842 | 2771 | { |
---|
1843 | 2772 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1844 | 2773 | System.gc(); |
---|
1845 | 2774 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1846 | 2775 | } else |
---|
1847 | | - if (event.getSource() == editLeafItem) |
---|
| 2776 | + if (source == editLeafItem) |
---|
1848 | 2777 | { |
---|
1849 | 2778 | Object3D obj; |
---|
1850 | 2779 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1858 | 2787 | } |
---|
1859 | 2788 | refreshContents(true); |
---|
1860 | 2789 | } else |
---|
1861 | | - if (event.getSource() == openWindowItem) |
---|
| 2790 | + if (source == openWindowItem) |
---|
1862 | 2791 | { |
---|
1863 | 2792 | EditSelection(true); |
---|
1864 | 2793 | } else |
---|
1865 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2794 | + if (source == cutItem || source == clearButton) |
---|
1866 | 2795 | { |
---|
1867 | 2796 | loadClipboard(true); |
---|
1868 | 2797 | } else |
---|
1869 | | - if (event.getSource() == duplicateItem) |
---|
| 2798 | + if (source == undoItem) |
---|
1870 | 2799 | { |
---|
1871 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2800 | + PreviousVersion(); |
---|
| 2801 | + } else |
---|
| 2802 | + if (source == redoItem) |
---|
| 2803 | + { |
---|
| 2804 | + NextVersion(); |
---|
| 2805 | + } else |
---|
| 2806 | + if (source == duplicateItem) |
---|
| 2807 | + { |
---|
| 2808 | + Object3D keep = Grafreed.clipboard; |
---|
1872 | 2809 | loadClipboard(false); |
---|
1873 | 2810 | paste(false); |
---|
1874 | | - GrafreeD.clipboard = keep; |
---|
| 2811 | + Grafreed.clipboard = keep; |
---|
1875 | 2812 | } else |
---|
1876 | | - if (event.getSource() == cloneItem) |
---|
| 2813 | + if (source == cloneItem) |
---|
1877 | 2814 | { |
---|
1878 | 2815 | CloneSelection(false); |
---|
1879 | 2816 | } else |
---|
1880 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2817 | + if (source == cloneSupportItem) |
---|
1881 | 2818 | { |
---|
1882 | 2819 | CloneSelection(true); |
---|
1883 | 2820 | } else |
---|
1884 | | - if (event.getSource() == copyItem) |
---|
| 2821 | + if (source == copyItem) |
---|
1885 | 2822 | { |
---|
1886 | 2823 | loadClipboard(false); |
---|
1887 | 2824 | } else |
---|
1888 | | - if (event.getSource() == pasteItem) |
---|
| 2825 | + if (source == pasteItem) |
---|
1889 | 2826 | { |
---|
1890 | 2827 | paste(false); |
---|
1891 | 2828 | } else |
---|
1892 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2829 | + if (source == pasteIntoItem) |
---|
1893 | 2830 | { |
---|
1894 | | - pasteInto(false); |
---|
| 2831 | + pasteInto(true, false); |
---|
1895 | 2832 | } else |
---|
1896 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2833 | + if (source == pasteLinkItem) |
---|
1897 | 2834 | { |
---|
1898 | | - pasteInto(true); |
---|
| 2835 | + pasteInto(false, false); |
---|
1899 | 2836 | } else |
---|
1900 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2837 | + if (source == pasteCloneItem) |
---|
| 2838 | + { |
---|
| 2839 | + pasteInto(true, true); |
---|
| 2840 | + } else |
---|
| 2841 | + if (source == pasteExpandItem) |
---|
1901 | 2842 | { |
---|
1902 | 2843 | paste(true); |
---|
1903 | 2844 | } else |
---|
1904 | | - if (event.getSource() == synchronizeItem) |
---|
| 2845 | + if (source == synchronizeItem) |
---|
1905 | 2846 | { |
---|
1906 | 2847 | Overwrite(Object3D.TRANSFORM); |
---|
1907 | 2848 | } else |
---|
1908 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2849 | + if (source == overwriteNameItem) |
---|
1909 | 2850 | { |
---|
1910 | 2851 | Overwrite(Object3D.NAME); |
---|
1911 | 2852 | } else |
---|
1912 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2853 | + if (source == overwriteUVItem) |
---|
1913 | 2854 | { |
---|
1914 | 2855 | Overwrite(Object3D.UV); |
---|
1915 | 2856 | } else |
---|
1916 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2857 | + if (source == overwriteMatItem) |
---|
1917 | 2858 | { |
---|
1918 | 2859 | /* july 2015 |
---|
1919 | 2860 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1933 | 2874 | |
---|
1934 | 2875 | Overwrite(dropAttributes); |
---|
1935 | 2876 | } |
---|
1936 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2877 | + if (source == overwriteGeoItem) |
---|
1937 | 2878 | { |
---|
1938 | 2879 | Overwrite(Object3D.GEOMETRY); |
---|
1939 | 2880 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1950 | 2891 | // refreshContents(); |
---|
1951 | 2892 | // } |
---|
1952 | 2893 | } else |
---|
1953 | | - if (event.getSource() == generateMeshItem) |
---|
| 2894 | + if (source == generateMeshItem) |
---|
1954 | 2895 | { |
---|
1955 | 2896 | //if (group.selection.size() == 1) |
---|
1956 | 2897 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1961 | 2902 | ResetModel(); |
---|
1962 | 2903 | refreshContents(); |
---|
1963 | 2904 | } else |
---|
1964 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2905 | + if (source == extractGeometriesItem) |
---|
1965 | 2906 | { |
---|
1966 | 2907 | boolean one = false; |
---|
1967 | 2908 | |
---|
.. | .. |
---|
1988 | 2929 | ResetModel(); |
---|
1989 | 2930 | refreshContents(); |
---|
1990 | 2931 | } else |
---|
1991 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2932 | + if (source == cloneGeometriesItem) |
---|
1992 | 2933 | { |
---|
1993 | 2934 | boolean one = false; |
---|
1994 | 2935 | |
---|
.. | .. |
---|
2014 | 2955 | ResetModel(); |
---|
2015 | 2956 | refreshContents(); |
---|
2016 | 2957 | } else |
---|
2017 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2958 | + if (source == shareGeometriesItem) |
---|
2018 | 2959 | { |
---|
2019 | 2960 | boolean one = false; |
---|
2020 | 2961 | |
---|
.. | .. |
---|
2044 | 2985 | refreshContents(); |
---|
2045 | 2986 | } |
---|
2046 | 2987 | } else |
---|
2047 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2988 | + if (source == mergeGeometriesItem) |
---|
2048 | 2989 | { |
---|
2049 | 2990 | boolean one = false; |
---|
2050 | 2991 | |
---|
.. | .. |
---|
2074 | 3015 | ResetModel(); |
---|
2075 | 3016 | refreshContents(); |
---|
2076 | 3017 | } else |
---|
2077 | | - if (event.getSource() == linkverticesItem) |
---|
| 3018 | + if (source == linkverticesItem) |
---|
2078 | 3019 | { |
---|
2079 | 3020 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2080 | 3021 | // { |
---|
.. | .. |
---|
2087 | 3028 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2088 | 3029 | // refreshContents(); |
---|
2089 | 3030 | // } |
---|
2090 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 3031 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2091 | 3032 | { |
---|
2092 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 3033 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2093 | 3034 | |
---|
2094 | 3035 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2095 | 3036 | content = ((cGroup)content).get(0); |
---|
2096 | 3037 | |
---|
2097 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 3038 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2098 | 3039 | for (int i=0; i<group.selection.size(); i++) |
---|
2099 | 3040 | { |
---|
2100 | | - boolean random = CameraPane.RANDOM; |
---|
2101 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3041 | + boolean random = CameraPane.SWITCH; |
---|
| 3042 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2102 | 3043 | group.selection.get(i).linkVerticesThis(content); |
---|
2103 | 3044 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2104 | | - CameraPane.RANDOM = random; |
---|
| 3045 | + CameraPane.SWITCH = random; |
---|
2105 | 3046 | } |
---|
2106 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 3047 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2107 | 3048 | refreshContents(); |
---|
2108 | 3049 | } |
---|
2109 | 3050 | } else |
---|
2110 | | - if (event.getSource() == resetsupportItem) |
---|
| 3051 | + if (source == resetsupportItem) |
---|
2111 | 3052 | { |
---|
2112 | 3053 | for (int i=0; i<group.selection.size(); i++) |
---|
2113 | 3054 | { |
---|
2114 | | - boolean random = CameraPane.RANDOM; |
---|
2115 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3055 | + boolean random = CameraPane.SWITCH; |
---|
| 3056 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2116 | 3057 | group.selection.get(i).linkVerticesThis(null); |
---|
2117 | | - CameraPane.RANDOM = random; |
---|
| 3058 | + CameraPane.SWITCH = random; |
---|
2118 | 3059 | } |
---|
2119 | 3060 | |
---|
2120 | 3061 | refreshContents(); |
---|
2121 | 3062 | } else |
---|
2122 | | - if (event.getSource() == relinkverticesItem) |
---|
| 3063 | + if (source == relinkverticesItem) |
---|
2123 | 3064 | { |
---|
2124 | | - boolean random = CameraPane.RANDOM; |
---|
2125 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 3065 | + boolean random = CameraPane.SWITCH; |
---|
| 3066 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2126 | 3067 | group.selection.RelinkToSupport(); |
---|
2127 | | - CameraPane.RANDOM = random; |
---|
| 3068 | + CameraPane.SWITCH = random; |
---|
2128 | 3069 | |
---|
2129 | 3070 | refreshContents(); |
---|
2130 | 3071 | } else |
---|
2131 | | - if (event.getSource() == resetreferencesItem) |
---|
| 3072 | + if (source == resetreferencesItem) |
---|
2132 | 3073 | { |
---|
2133 | 3074 | for (int i=0; i<group.selection.size(); i++) |
---|
2134 | 3075 | { |
---|
.. | .. |
---|
2137 | 3078 | |
---|
2138 | 3079 | refreshContents(); |
---|
2139 | 3080 | } else |
---|
2140 | | - if (event.getSource() == setMasterItem) |
---|
| 3081 | + if (source == setMasterItem) |
---|
2141 | 3082 | { |
---|
2142 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 3083 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2143 | 3084 | { |
---|
2144 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 3085 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2145 | 3086 | |
---|
2146 | 3087 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2147 | 3088 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2150 | 3091 | refreshContents(); |
---|
2151 | 3092 | } |
---|
2152 | 3093 | } else |
---|
2153 | | - if (event.getSource() == poseMeshItem) |
---|
| 3094 | + if (source == poseMeshItem) |
---|
2154 | 3095 | { |
---|
2155 | 3096 | if (group.selection.size() == 1) |
---|
2156 | 3097 | { |
---|
2157 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 3098 | + if (Grafreed.clipboard.size() == 1) |
---|
2158 | 3099 | { |
---|
2159 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 3100 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2160 | 3101 | |
---|
2161 | 3102 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2162 | 3103 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2169 | 3110 | } |
---|
2170 | 3111 | |
---|
2171 | 3112 | } else |
---|
2172 | | - if (event.getSource() == revertMeshItem) |
---|
| 3113 | + if (source == revertMeshItem) |
---|
2173 | 3114 | { |
---|
2174 | 3115 | RevertMeshes(); |
---|
2175 | 3116 | } else |
---|
2176 | | - if (event.getSource() == resetMeshItem) |
---|
| 3117 | + if (source == resetAllItem) |
---|
2177 | 3118 | { |
---|
2178 | 3119 | ResetAll(); |
---|
2179 | 3120 | } else |
---|
2180 | | - if (event.getSource() == stepAllItem) |
---|
| 3121 | + if (source == stepAllItem) |
---|
2181 | 3122 | { |
---|
2182 | 3123 | StepAll(); |
---|
2183 | 3124 | } else |
---|
2184 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 3125 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2185 | 3126 | { |
---|
2186 | 3127 | //int indices[] = jList.getSelectedIndices(); |
---|
2187 | 3128 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2189 | 3130 | |
---|
2190 | 3131 | ClearSelection(false); |
---|
2191 | 3132 | } else |
---|
2192 | | - if (event.getSource() == clearAllItem) |
---|
| 3133 | + if (source == clearAllItem) |
---|
2193 | 3134 | { |
---|
2194 | 3135 | ClearSelection(true); |
---|
2195 | 3136 | } else |
---|
2196 | | - if (event.getSource() == grabItem) |
---|
| 3137 | + if (source == grabItem || source == groupButton) |
---|
2197 | 3138 | { |
---|
2198 | | - group(new cGroup(), true); |
---|
| 3139 | + group(new cGroup(), false); // true); |
---|
2199 | 3140 | } else |
---|
2200 | | - if (event.getSource() == hideItem) |
---|
| 3141 | + if (source == hideItem) |
---|
2201 | 3142 | { |
---|
2202 | 3143 | group(new HiddenObject()); |
---|
2203 | 3144 | } else |
---|
2204 | | - if (event.getSource() == frontItem) |
---|
| 3145 | + if (source == frontItem) |
---|
2205 | 3146 | { |
---|
2206 | 3147 | front(); |
---|
2207 | 3148 | } else |
---|
2208 | | - if (event.getSource() == backItem) |
---|
| 3149 | + if (source == backItem) |
---|
2209 | 3150 | { |
---|
2210 | 3151 | back(); |
---|
2211 | 3152 | } else |
---|
2212 | | - if (event.getSource() == cameraItem) |
---|
| 3153 | + if (source == cameraItem) |
---|
2213 | 3154 | { |
---|
2214 | 3155 | makeSomething(new Camera()); |
---|
2215 | 3156 | } else |
---|
2216 | | - if (event.getSource() == compositeItem) |
---|
| 3157 | + if (source == compositeItem || source == compositeButton) |
---|
2217 | 3158 | { |
---|
2218 | 3159 | group(new Composite()); |
---|
2219 | 3160 | } else |
---|
2220 | | - if (event.getSource() == randomItem) |
---|
| 3161 | + if (source == switchItem || source == switchButton) |
---|
2221 | 3162 | { |
---|
2222 | 3163 | RandomNode random = new RandomNode(); |
---|
2223 | 3164 | group(random); |
---|
2224 | 3165 | if (random.size() > 0) |
---|
2225 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 3166 | + random.name = random.get(0).name + "Switch"; |
---|
2226 | 3167 | } else |
---|
2227 | | - if (event.getSource() == physicsItem) |
---|
| 3168 | + if (source == physicsItem) |
---|
2228 | 3169 | { |
---|
2229 | 3170 | group(new PhysicsNode()); |
---|
2230 | 3171 | } else |
---|
2231 | | - if (event.getSource() == frameselectorItem) |
---|
| 3172 | + if (source == frameselectorItem) |
---|
2232 | 3173 | { |
---|
2233 | 3174 | for (int i=0; i<group.selection.size(); i++) |
---|
2234 | 3175 | { |
---|
.. | .. |
---|
2240 | 3181 | ResetModel(); |
---|
2241 | 3182 | refreshContents(); |
---|
2242 | 3183 | } else |
---|
2243 | | - if (event.getSource() == switchGeoItem) |
---|
| 3184 | + if (source == switchGeoItem) |
---|
2244 | 3185 | { |
---|
2245 | 3186 | for (int i=0; i<group.selection.size(); i++) |
---|
2246 | 3187 | { |
---|
.. | .. |
---|
2252 | 3193 | ResetModel(); |
---|
2253 | 3194 | refreshContents(); |
---|
2254 | 3195 | } else |
---|
2255 | | - if (event.getSource() == switchTransfoItem) |
---|
| 3196 | + if (source == switchTransfoItem) |
---|
2256 | 3197 | { |
---|
2257 | 3198 | for (int i=0; i<group.selection.size(); i++) |
---|
2258 | 3199 | { |
---|
.. | .. |
---|
2264 | 3205 | ResetModel(); |
---|
2265 | 3206 | refreshContents(); |
---|
2266 | 3207 | } else |
---|
2267 | | - if (event.getSource() == morphItem) |
---|
| 3208 | + if (source == morphItem) |
---|
2268 | 3209 | { |
---|
2269 | 3210 | for (int i=0; i<group.selection.size(); i++) |
---|
2270 | 3211 | { |
---|
.. | .. |
---|
2276 | 3217 | ResetModel(); |
---|
2277 | 3218 | refreshContents(); |
---|
2278 | 3219 | } else |
---|
2279 | | - if (event.getSource() == scriptNodeItem) |
---|
| 3220 | + if (source == scriptNodeItem) |
---|
2280 | 3221 | { |
---|
2281 | 3222 | boolean atleastone = false; |
---|
2282 | 3223 | |
---|
.. | .. |
---|
2315 | 3256 | } |
---|
2316 | 3257 | } |
---|
2317 | 3258 | } else |
---|
2318 | | - if (event.getSource() == linkerItem) |
---|
| 3259 | + if (source == linkerItem) |
---|
2319 | 3260 | { |
---|
2320 | 3261 | group(new cLinker()); |
---|
2321 | 3262 | } else |
---|
2322 | | - if (event.getSource() == textureItem) |
---|
| 3263 | + if (source == textureItem || source == textureButton) |
---|
2323 | 3264 | { |
---|
2324 | 3265 | group(new TextureNode()); |
---|
2325 | 3266 | } else |
---|
2326 | | - if (event.getSource() == billboardItem) |
---|
| 3267 | + if (source == billboardItem) |
---|
2327 | 3268 | { |
---|
2328 | 3269 | group(new BillboardNode()); |
---|
2329 | 3270 | } else |
---|
2330 | | - if (event.getSource() == shadowXItem) |
---|
| 3271 | + if (source == shadowXItem) |
---|
2331 | 3272 | { |
---|
2332 | 3273 | CastShadow(0); |
---|
2333 | 3274 | } else |
---|
2334 | | - if (event.getSource() == shadowYItem) |
---|
| 3275 | + if (source == shadowYItem) |
---|
2335 | 3276 | { |
---|
2336 | 3277 | CastShadow(1); |
---|
2337 | 3278 | } else |
---|
2338 | | - if (event.getSource() == shadowZItem) |
---|
| 3279 | + if (source == shadowZItem) |
---|
2339 | 3280 | { |
---|
2340 | 3281 | CastShadow(2); |
---|
2341 | 3282 | } else |
---|
2342 | | - if (event.getSource() == ungroupItem) |
---|
| 3283 | + if (source == ungroupItem || source == ungroupButton) |
---|
2343 | 3284 | { |
---|
2344 | | - //ungroup(); |
---|
| 3285 | + boolean hasRoot = false; |
---|
| 3286 | + |
---|
2345 | 3287 | for (int i=0; i<group.selection.size(); i++) |
---|
2346 | 3288 | { |
---|
2347 | | - Ungroup(group.selection.get(i)); |
---|
| 3289 | + if (group.selection.get(i) == group) |
---|
| 3290 | + { |
---|
| 3291 | + hasRoot = true; |
---|
| 3292 | + break; |
---|
| 3293 | + } |
---|
2348 | 3294 | } |
---|
2349 | 3295 | |
---|
2350 | | - ClearSelection(false); |
---|
2351 | | - |
---|
2352 | | - refreshContents(); |
---|
| 3296 | + if (!hasRoot) |
---|
| 3297 | + { |
---|
| 3298 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3299 | + { |
---|
| 3300 | + Ungroup(group.selection.get(i)); |
---|
| 3301 | + } |
---|
| 3302 | + |
---|
| 3303 | + ClearSelection(false); |
---|
| 3304 | + |
---|
| 3305 | + refreshContents(); |
---|
| 3306 | + } |
---|
2353 | 3307 | } else |
---|
2354 | | - if (event.getSource() == genUVItem) |
---|
| 3308 | + if (source == genUVItem) |
---|
2355 | 3309 | { |
---|
2356 | 3310 | GenUV(); |
---|
2357 | 3311 | } else |
---|
2358 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 3312 | + if (source == genNormalsCADItem) |
---|
2359 | 3313 | { |
---|
2360 | 3314 | GenNormals(true); |
---|
2361 | 3315 | } else |
---|
2362 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 3316 | + if (source == genNormalsMESHItem) |
---|
2363 | 3317 | { |
---|
2364 | | - GenNormals(true); // TODO |
---|
| 3318 | + GenNormalsMESH(); |
---|
2365 | 3319 | } else |
---|
2366 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 3320 | + if (source == genNormalsORGANItem) |
---|
2367 | 3321 | { |
---|
2368 | 3322 | GenNormals(false); |
---|
2369 | 3323 | } else |
---|
2370 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 3324 | + if (source == genNormalsMINEItem) |
---|
2371 | 3325 | { |
---|
2372 | 3326 | GenNormalsMINE(); |
---|
2373 | 3327 | } else |
---|
2374 | | - if (event.getSource() == stripifyItem) |
---|
| 3328 | + if (source == stripifyItem) |
---|
2375 | 3329 | { |
---|
2376 | 3330 | Stripify(); |
---|
2377 | 3331 | } else |
---|
2378 | | - if (event.getSource() == unstripifyItem) |
---|
| 3332 | + if (source == unstripifyItem) |
---|
2379 | 3333 | { |
---|
2380 | 3334 | Unstripify(); |
---|
2381 | 3335 | } else |
---|
2382 | | - if (event.getSource() == trimItem) |
---|
| 3336 | + if (source == trimItem) |
---|
2383 | 3337 | { |
---|
2384 | 3338 | Trim(); |
---|
2385 | 3339 | } else |
---|
2386 | | - if (event.getSource() == untrimItem) |
---|
| 3340 | + if (source == untrimItem) |
---|
2387 | 3341 | { |
---|
2388 | 3342 | Untrim(); |
---|
2389 | 3343 | } else |
---|
2390 | | - if (event.getSource() == clearColorsItem) |
---|
| 3344 | + if (source == clearColorsItem) |
---|
2391 | 3345 | { |
---|
2392 | 3346 | ClearColors(); |
---|
2393 | 3347 | } else |
---|
2394 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 3348 | + if (source == clearMaterialsItem) |
---|
2395 | 3349 | { |
---|
2396 | 3350 | ClearMaterials(); |
---|
2397 | 3351 | } else |
---|
2398 | | - if (event.getSource() == liveleavesItem) |
---|
| 3352 | + if (source == liveleavesItem) |
---|
2399 | 3353 | { |
---|
2400 | 3354 | LiveLeaves(true); |
---|
2401 | 3355 | } else |
---|
2402 | | - if (event.getSource() == unliveleavesItem) |
---|
| 3356 | + if (source == unliveleavesItem) |
---|
2403 | 3357 | { |
---|
2404 | 3358 | LiveLeaves(false); |
---|
2405 | 3359 | } else |
---|
2406 | | - if (event.getSource() == supportleavesItem) |
---|
| 3360 | + if (source == supportleavesItem) |
---|
2407 | 3361 | { |
---|
2408 | 3362 | SupportLeaves(true); |
---|
2409 | 3363 | } else |
---|
2410 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 3364 | + if (source == unsupportleavesItem) |
---|
2411 | 3365 | { |
---|
2412 | 3366 | SupportLeaves(false); |
---|
2413 | 3367 | } else |
---|
2414 | | - if (event.getSource() == hideleavesItem) |
---|
| 3368 | + if (source == hideleavesItem) |
---|
2415 | 3369 | { |
---|
2416 | 3370 | HideLeaves(true); |
---|
2417 | 3371 | } else |
---|
2418 | | - if (event.getSource() == showleavesItem) |
---|
| 3372 | + if (source == showleavesItem) |
---|
2419 | 3373 | { |
---|
2420 | 3374 | HideLeaves(false); |
---|
2421 | 3375 | } else |
---|
2422 | | - if (event.getSource() == markleavesItem) |
---|
| 3376 | + if (source == markleavesItem) |
---|
2423 | 3377 | { |
---|
2424 | 3378 | MarkLeaves(true); |
---|
2425 | 3379 | } else |
---|
2426 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 3380 | + if (source == unmarkleavesItem) |
---|
2427 | 3381 | { |
---|
2428 | 3382 | MarkLeaves(false); |
---|
2429 | 3383 | } else |
---|
2430 | | - if (event.getSource() == flipVItem) |
---|
| 3384 | + if (source == rewindleavesItem) |
---|
| 3385 | + { |
---|
| 3386 | + RewindLeaves(true); |
---|
| 3387 | + } else |
---|
| 3388 | + if (source == unrewindleavesItem) |
---|
| 3389 | + { |
---|
| 3390 | + RewindLeaves(false); |
---|
| 3391 | + } else |
---|
| 3392 | + if (source == randomleavesItem) |
---|
| 3393 | + { |
---|
| 3394 | + RandomLeaves(true); |
---|
| 3395 | + } else |
---|
| 3396 | + if (source == unrandomleavesItem) |
---|
| 3397 | + { |
---|
| 3398 | + RandomLeaves(false); |
---|
| 3399 | + } else |
---|
| 3400 | + if (source == flipVItem) |
---|
2431 | 3401 | { |
---|
2432 | 3402 | FlipV(true); |
---|
2433 | 3403 | } else |
---|
2434 | | - if (event.getSource() == unflipVItem) |
---|
| 3404 | + if (source == unflipVItem) |
---|
2435 | 3405 | { |
---|
2436 | 3406 | FlipV(false); |
---|
2437 | 3407 | } else |
---|
2438 | | - if (event.getSource() == lowTexturesItem) |
---|
| 3408 | + if (source == lowTexturesItem) |
---|
2439 | 3409 | { |
---|
2440 | 3410 | SetTexRes(0); |
---|
2441 | 3411 | } else |
---|
2442 | | - if (event.getSource() == normalTexturesItem) |
---|
| 3412 | + if (source == normalTexturesItem) |
---|
2443 | 3413 | { |
---|
2444 | 3414 | SetTexRes(1); |
---|
2445 | 3415 | } else |
---|
2446 | | - if (event.getSource() == highTexturesItem) |
---|
| 3416 | + if (source == highTexturesItem) |
---|
2447 | 3417 | { |
---|
2448 | 3418 | SetTexRes(2); |
---|
2449 | 3419 | } else |
---|
2450 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 3420 | + if (source == veryhighTexturesItem) |
---|
2451 | 3421 | { |
---|
2452 | 3422 | SetTexRes(3); |
---|
2453 | 3423 | } else |
---|
2454 | | - if (event.getSource() == maxTexturesItem) |
---|
| 3424 | + if (source == maxTexturesItem) |
---|
2455 | 3425 | { |
---|
2456 | 3426 | SetTexRes(4); |
---|
2457 | 3427 | } else |
---|
2458 | | - if (event.getSource() == panoTexturesItem) |
---|
| 3428 | + if (source == panoTexturesItem) |
---|
2459 | 3429 | { |
---|
2460 | 3430 | SetTexRes(5); |
---|
2461 | 3431 | } else |
---|
2462 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 3432 | + if (source == reverseNormalsItem) |
---|
2463 | 3433 | { |
---|
2464 | 3434 | ReverseNormals(); |
---|
2465 | 3435 | } else |
---|
2466 | | - if (event.getSource() == parseverticesItem) |
---|
| 3436 | + if (source == parseverticesItem) |
---|
2467 | 3437 | { |
---|
2468 | 3438 | ParseVertices(); |
---|
2469 | 3439 | } else |
---|
2470 | | - if (event.getSource() == textureFieldItem) |
---|
| 3440 | + if (source == textureFieldItem) |
---|
2471 | 3441 | { |
---|
2472 | 3442 | TextureVertices(); |
---|
2473 | 3443 | } else |
---|
2474 | | - if (event.getSource() == alignItem) |
---|
| 3444 | + if (source == alignItem) |
---|
2475 | 3445 | { |
---|
2476 | 3446 | Align(); |
---|
2477 | 3447 | } else |
---|
2478 | | - if (event.getSource() == mirrorItem) |
---|
| 3448 | + if (source == mirrorItem) |
---|
2479 | 3449 | { |
---|
2480 | 3450 | MirrorPoses(); |
---|
2481 | 3451 | } else |
---|
2482 | | - if (event.getSource() == reduceMorphItem) |
---|
| 3452 | + if (source == reduceMorphItem) |
---|
2483 | 3453 | { |
---|
2484 | 3454 | MeshReduction(false); |
---|
2485 | 3455 | } else |
---|
2486 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 3456 | + if (source == reduce34MorphItem) |
---|
2487 | 3457 | { |
---|
2488 | 3458 | MeshReduction(true); |
---|
2489 | 3459 | } else |
---|
2490 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 3460 | + if (source == reverseTrianglesItem) |
---|
2491 | 3461 | { |
---|
2492 | 3462 | ReverseTriangles(); |
---|
2493 | 3463 | } else |
---|
2494 | | - if (event.getSource() == reduceMeshItem) |
---|
| 3464 | + if (source == reduceMeshItem) |
---|
2495 | 3465 | { |
---|
2496 | 3466 | ReduceMesh(false); |
---|
2497 | 3467 | } else |
---|
2498 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 3468 | + if (source == reduce34MeshItem) |
---|
2499 | 3469 | { |
---|
2500 | 3470 | ReduceMesh(true); |
---|
2501 | 3471 | } else |
---|
2502 | | - if (event.getSource() == increaseMeshItem) |
---|
| 3472 | + if (source == increaseMeshItem) |
---|
2503 | 3473 | { |
---|
2504 | 3474 | IncreaseMesh(); |
---|
2505 | 3475 | } else |
---|
2506 | | - if (event.getSource() == clipMeshItem) |
---|
| 3476 | + if (source == clipMeshItem) |
---|
2507 | 3477 | { |
---|
2508 | 3478 | ClipMesh(); |
---|
2509 | 3479 | } else |
---|
2510 | | - if (event.getSource() == smoothMeshItem) |
---|
| 3480 | + if (source == smoothMeshItem) |
---|
2511 | 3481 | { |
---|
2512 | 3482 | SmoothMesh(); |
---|
2513 | 3483 | } else |
---|
2514 | | - if (event.getSource() == transformgeometryItem) |
---|
| 3484 | + if (source == transformGeometryItem) |
---|
2515 | 3485 | { |
---|
2516 | 3486 | TransformGeometry(); |
---|
2517 | 3487 | } else |
---|
2518 | | - if (event.getSource() == resetTransformItem) |
---|
| 3488 | + if (source == transformChildrenItem) |
---|
| 3489 | + { |
---|
| 3490 | + TransformChildren(); |
---|
| 3491 | + } else |
---|
| 3492 | + if (source == resetTransformItem) |
---|
2519 | 3493 | { |
---|
2520 | 3494 | ResetTransform(); |
---|
2521 | 3495 | } else |
---|
2522 | | - if (event.getSource() == resetCentroidItem) |
---|
| 3496 | + if (source == resetCentroidItem) |
---|
2523 | 3497 | { |
---|
2524 | | - ResetCentroid(); |
---|
| 3498 | + ResetCentroid(true); |
---|
2525 | 3499 | } else |
---|
2526 | | - if (event.getSource() == resetParentItem) |
---|
| 3500 | + if (source == resetCentroidXZItem) |
---|
| 3501 | + { |
---|
| 3502 | + ResetCentroid(false); |
---|
| 3503 | + } else |
---|
| 3504 | + if (source == resetParentItem) |
---|
2527 | 3505 | { |
---|
2528 | 3506 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2529 | 3507 | { |
---|
.. | .. |
---|
2533 | 3511 | |
---|
2534 | 3512 | refreshContents(); |
---|
2535 | 3513 | } else |
---|
2536 | | - if (event.getSource() == repairParentItem) |
---|
| 3514 | + if (source == repairParentItem) |
---|
2537 | 3515 | { |
---|
2538 | 3516 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2539 | 3517 | { |
---|
.. | .. |
---|
2547 | 3525 | |
---|
2548 | 3526 | refreshContents(); |
---|
2549 | 3527 | } else |
---|
2550 | | - if (event.getSource() == repairShadowItem) |
---|
| 3528 | + if (source == repairShadowItem) |
---|
2551 | 3529 | { |
---|
2552 | 3530 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2553 | 3531 | { |
---|
.. | .. |
---|
2561 | 3539 | |
---|
2562 | 3540 | refreshContents(); |
---|
2563 | 3541 | } else |
---|
2564 | | - if (event.getSource() == sortbysizeItem) |
---|
| 3542 | + if (source == sortbysizeItem) |
---|
2565 | 3543 | { |
---|
2566 | 3544 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2567 | 3545 | { |
---|
.. | .. |
---|
2573 | 3551 | ResetModel(); |
---|
2574 | 3552 | refreshContents(); |
---|
2575 | 3553 | } else |
---|
2576 | | - if (event.getSource() == sortbynameItem) |
---|
| 3554 | + if (source == sortbynameItem) |
---|
2577 | 3555 | { |
---|
2578 | 3556 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2579 | 3557 | { |
---|
.. | .. |
---|
2585 | 3563 | ResetModel(); |
---|
2586 | 3564 | refreshContents(); |
---|
2587 | 3565 | } else |
---|
2588 | | - if (event.getSource() == attachPigmentItem) |
---|
| 3566 | + if (source == attachPigmentItem) |
---|
2589 | 3567 | { |
---|
2590 | 3568 | String texture = GetFile("Attach pigment"); |
---|
2591 | 3569 | Object3D obj; |
---|
.. | .. |
---|
2597 | 3575 | |
---|
2598 | 3576 | refreshContents(); |
---|
2599 | 3577 | } else |
---|
2600 | | - if (event.getSource() == detachPigmentItem) |
---|
| 3578 | + if (source == detachPigmentItem) |
---|
2601 | 3579 | { |
---|
2602 | 3580 | Object3D obj; |
---|
2603 | 3581 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2608 | 3586 | |
---|
2609 | 3587 | refreshContents(); |
---|
2610 | 3588 | } else |
---|
2611 | | - if (event.getSource() == attachBumpItem) |
---|
| 3589 | + if (source == attachBumpItem) |
---|
2612 | 3590 | { |
---|
2613 | 3591 | String texture = GetFile("Attach bump"); |
---|
2614 | 3592 | Object3D obj; |
---|
.. | .. |
---|
2620 | 3598 | |
---|
2621 | 3599 | refreshContents(); |
---|
2622 | 3600 | } else |
---|
2623 | | - if (event.getSource() == detachBumpItem) |
---|
| 3601 | + if (source == detachBumpItem) |
---|
2624 | 3602 | { |
---|
2625 | 3603 | Object3D obj; |
---|
2626 | 3604 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2627 | 3605 | { |
---|
2628 | 3606 | obj = (Object3D)e.nextElement(); |
---|
2629 | | - obj.SetBumpTexture(null); |
---|
| 3607 | + obj.ResetBumpTexture(); |
---|
2630 | 3608 | } |
---|
2631 | 3609 | |
---|
2632 | 3610 | refreshContents(); |
---|
2633 | 3611 | } else |
---|
2634 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 3612 | + if (source == pigmentBumpItem) |
---|
2635 | 3613 | { |
---|
2636 | 3614 | Object3D obj; |
---|
2637 | 3615 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2642 | 3620 | |
---|
2643 | 3621 | refreshContents(); |
---|
2644 | 3622 | } else |
---|
2645 | | - if (event.getSource() == flashSelectionButton) |
---|
| 3623 | + if (source == embedTexturesItem) |
---|
| 3624 | + { |
---|
| 3625 | + Object3D obj; |
---|
| 3626 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3627 | + { |
---|
| 3628 | + obj = (Object3D)e.nextElement(); |
---|
| 3629 | + obj.EmbedTextures(true); |
---|
| 3630 | + } |
---|
| 3631 | + |
---|
| 3632 | + refreshContents(); |
---|
| 3633 | + } else |
---|
| 3634 | + if (source == deEmbedTexturesItem) |
---|
| 3635 | + { |
---|
| 3636 | + Object3D obj; |
---|
| 3637 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3638 | + { |
---|
| 3639 | + obj = (Object3D)e.nextElement(); |
---|
| 3640 | + obj.EmbedTextures(false); |
---|
| 3641 | + } |
---|
| 3642 | + |
---|
| 3643 | + CameraPane.texturepigment.clear(); |
---|
| 3644 | + CameraPane.texturebump.clear(); |
---|
| 3645 | + |
---|
| 3646 | + refreshContents(); |
---|
| 3647 | + } else |
---|
| 3648 | + if (source == flashSelectionButton) |
---|
2646 | 3649 | { |
---|
2647 | 3650 | CameraPane.flash = true; |
---|
2648 | 3651 | refreshContents(); |
---|
2649 | 3652 | } else |
---|
2650 | | - if (event.getSource() == oneButton) |
---|
| 3653 | + if (source == oneButton) |
---|
2651 | 3654 | { |
---|
2652 | 3655 | } else |
---|
2653 | | - if (event.getSource() == twoButton) |
---|
| 3656 | + if (source == twoButton) |
---|
2654 | 3657 | { |
---|
2655 | 3658 | radio.layout = twoButton; |
---|
| 3659 | + |
---|
| 3660 | + if (CameraPane.FULLSCREEN) |
---|
| 3661 | + fullscreenLayout = radio.layout; |
---|
| 3662 | + |
---|
2656 | 3663 | // bug |
---|
2657 | 3664 | //gridPanel.setDividerLocation(1.0); |
---|
2658 | 3665 | //bigPanel.setDividerLocation(0.0); |
---|
2659 | | - bigThree.remove(scenePanel); |
---|
2660 | | - bigThree.remove(centralPanel); |
---|
2661 | | - bigThree.remove(XYZPanel); |
---|
2662 | | - aWindowConstraints.gridx = 0; |
---|
2663 | | - aWindowConstraints.gridy = 0; |
---|
2664 | | - aWindowConstraints.gridwidth = 1; |
---|
2665 | | - // aConstraints.gridheight = 3; |
---|
2666 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2667 | | - aWindowConstraints.weightx = 0; |
---|
2668 | | - aWindowConstraints.weighty = 1; |
---|
2669 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2670 | | - aWindowConstraints.weightx = 1; |
---|
2671 | | - aWindowConstraints.gridwidth = 3; |
---|
2672 | | - // aConstraints.gridheight = 3; |
---|
2673 | | - aWindowConstraints.gridx = 1; |
---|
2674 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2675 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2676 | | - aWindowConstraints.weightx = 0; |
---|
2677 | | - aWindowConstraints.gridx = 4; |
---|
2678 | | - aWindowConstraints.gridwidth = 1; |
---|
2679 | | - // aConstraints.gridheight = 3; |
---|
2680 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2681 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2682 | | - bigThree.revalidate(); |
---|
| 3666 | +// bigThree.remove(scenePanel); |
---|
| 3667 | +// bigThree.remove(centralPanel); |
---|
| 3668 | +// bigThree.remove(XYZPanel); |
---|
| 3669 | +// aWindowConstraints.gridx = 0; |
---|
| 3670 | +// aWindowConstraints.gridy = 0; |
---|
| 3671 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3672 | +// // aConstraints.gridheight = 3; |
---|
| 3673 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3674 | +// aWindowConstraints.weightx = 0; |
---|
| 3675 | +// aWindowConstraints.weighty = 1; |
---|
| 3676 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3677 | +// aWindowConstraints.weightx = 1; |
---|
| 3678 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3679 | +// // aConstraints.gridheight = 3; |
---|
| 3680 | +// aWindowConstraints.gridx = 1; |
---|
| 3681 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3682 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3683 | +// aWindowConstraints.weightx = 0; |
---|
| 3684 | +// aWindowConstraints.gridx = 4; |
---|
| 3685 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3686 | +// // aConstraints.gridheight = 3; |
---|
| 3687 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3688 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3689 | +// scenePanel.setVisible(false); |
---|
| 3690 | +// centralPanel.setVisible(true); |
---|
| 3691 | +// XYZPanel.setVisible(false); |
---|
| 3692 | + bigThree.ClearUI(); |
---|
| 3693 | + bigThree.add(centralPanel); |
---|
| 3694 | + bigThree.FlushUI(); |
---|
| 3695 | + |
---|
| 3696 | + cameraView.requestFocusInWindow(); |
---|
| 3697 | + |
---|
| 3698 | +// refreshContents(true); |
---|
| 3699 | +// |
---|
| 3700 | +// try |
---|
| 3701 | +// { |
---|
| 3702 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3703 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3704 | +// bot.mouseMove(100, 100); |
---|
| 3705 | +// bot.mousePress(mask); |
---|
| 3706 | +// bot.mouseRelease(mask); |
---|
| 3707 | +// } |
---|
| 3708 | +// catch (Exception e) |
---|
| 3709 | +// { |
---|
| 3710 | +// |
---|
| 3711 | +// } |
---|
| 3712 | + |
---|
2683 | 3713 | } else |
---|
2684 | | - if (event.getSource() == threeButton) |
---|
| 3714 | + if (source == threeButton) |
---|
2685 | 3715 | { |
---|
2686 | 3716 | radio.layout = threeButton; |
---|
2687 | | - bigThree.remove(scenePanel); |
---|
2688 | | - bigThree.remove(centralPanel); |
---|
2689 | | - bigThree.remove(XYZPanel); |
---|
2690 | | - aWindowConstraints.gridx = 0; |
---|
2691 | | - aWindowConstraints.gridy = 0; |
---|
2692 | | - aWindowConstraints.gridwidth = 1; |
---|
2693 | | - // aConstraints.gridheight = 3; |
---|
2694 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2695 | | - aWindowConstraints.weightx = 0; |
---|
2696 | | - aWindowConstraints.weighty = 1; |
---|
2697 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2698 | | - aWindowConstraints.weightx = 1; |
---|
2699 | | - aWindowConstraints.gridwidth = 3; |
---|
2700 | | - // aConstraints.gridheight = 3; |
---|
2701 | | - aWindowConstraints.gridx = 1; |
---|
2702 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2703 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2704 | | - aWindowConstraints.weightx = 0; |
---|
2705 | | - aWindowConstraints.gridx = 4; |
---|
2706 | | - aWindowConstraints.gridwidth = 1; |
---|
2707 | | - // aConstraints.gridheight = 3; |
---|
2708 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2709 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2710 | | - bigThree.revalidate(); |
---|
| 3717 | + |
---|
| 3718 | + if (CameraPane.FULLSCREEN) |
---|
| 3719 | + fullscreenLayout = radio.layout; |
---|
| 3720 | + |
---|
| 3721 | +// bigThree.remove(scenePanel); |
---|
| 3722 | +// bigThree.remove(centralPanel); |
---|
| 3723 | +// bigThree.remove(XYZPanel); |
---|
| 3724 | +// aWindowConstraints.gridx = 0; |
---|
| 3725 | +// aWindowConstraints.gridy = 0; |
---|
| 3726 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3727 | +// // aConstraints.gridheight = 3; |
---|
| 3728 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3729 | +// aWindowConstraints.weightx = 0; |
---|
| 3730 | +// aWindowConstraints.weighty = 1; |
---|
| 3731 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3732 | +// aWindowConstraints.weightx = 1; |
---|
| 3733 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3734 | +// // aConstraints.gridheight = 3; |
---|
| 3735 | +// aWindowConstraints.gridx = 1; |
---|
| 3736 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3737 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3738 | +// aWindowConstraints.weightx = 0; |
---|
| 3739 | +// aWindowConstraints.gridx = 4; |
---|
| 3740 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3741 | +// // aConstraints.gridheight = 3; |
---|
| 3742 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3743 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3744 | +// bigThree.validate(); |
---|
| 3745 | +// scenePanel.setVisible(false); |
---|
| 3746 | +// centralPanel.setVisible(true); |
---|
| 3747 | +// XYZPanel.setVisible(true); |
---|
| 3748 | + bigThree.ClearUI(); |
---|
| 3749 | + bigThree.add(scenePanel); |
---|
| 3750 | + bigThree.add(centralPanel); |
---|
| 3751 | + bigThree.FlushUI(); |
---|
| 3752 | + |
---|
| 3753 | + cameraView.requestFocusInWindow(); |
---|
2711 | 3754 | } else |
---|
2712 | | - if (event.getSource() == fourButton) |
---|
| 3755 | + if (source == fourButton) |
---|
2713 | 3756 | { |
---|
2714 | 3757 | radio.layout = fourButton; |
---|
2715 | | - bigThree.remove(scenePanel); |
---|
2716 | | - bigThree.remove(centralPanel); |
---|
2717 | | - bigThree.remove(XYZPanel); |
---|
2718 | | - aWindowConstraints.gridx = 0; |
---|
2719 | | - aWindowConstraints.gridy = 0; |
---|
2720 | | - aWindowConstraints.gridwidth = 1; |
---|
2721 | | - // aWindowConstraints.gridheight = 3; |
---|
2722 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2723 | | - aWindowConstraints.weightx = 1; |
---|
2724 | | - aWindowConstraints.weighty = 1; |
---|
2725 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2726 | | - aWindowConstraints.weightx = 1; |
---|
2727 | | - aWindowConstraints.gridwidth = 3; |
---|
2728 | | - // aConstraints.gridheight = 3; |
---|
2729 | | - aWindowConstraints.gridx = 1; |
---|
2730 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2731 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2732 | | - aWindowConstraints.weightx = 0; |
---|
2733 | | - aWindowConstraints.gridx = 4; |
---|
2734 | | - aWindowConstraints.gridwidth = 1; |
---|
2735 | | - // aWindowConstraints.gridheight = 3; |
---|
2736 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2737 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2738 | | - bigThree.revalidate(); |
---|
| 3758 | + |
---|
| 3759 | + if (CameraPane.FULLSCREEN) |
---|
| 3760 | + fullscreenLayout = radio.layout; |
---|
| 3761 | + |
---|
| 3762 | +// bigThree.remove(scenePanel); |
---|
| 3763 | +// bigThree.remove(centralPanel); |
---|
| 3764 | +// bigThree.remove(XYZPanel); |
---|
| 3765 | +// aWindowConstraints.gridx = 0; |
---|
| 3766 | +// aWindowConstraints.gridy = 0; |
---|
| 3767 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3768 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3769 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3770 | +// aWindowConstraints.weightx = 1; |
---|
| 3771 | +// aWindowConstraints.weighty = 1; |
---|
| 3772 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3773 | +// aWindowConstraints.weightx = 1; |
---|
| 3774 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3775 | +// // aConstraints.gridheight = 3; |
---|
| 3776 | +// aWindowConstraints.gridx = 1; |
---|
| 3777 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3778 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3779 | +// aWindowConstraints.weightx = 0; |
---|
| 3780 | +// aWindowConstraints.gridx = 4; |
---|
| 3781 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3782 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3783 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3784 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3785 | +// bigThree.validate(); |
---|
| 3786 | +// scenePanel.setVisible(true); |
---|
| 3787 | +// centralPanel.setVisible(false); |
---|
| 3788 | +// XYZPanel.setVisible(false); |
---|
| 3789 | + bigThree.ClearUI(); |
---|
| 3790 | + bigThree.add(scenePanel); |
---|
| 3791 | + bigThree.FlushUI(); |
---|
| 3792 | + |
---|
| 3793 | + cameraView.requestFocusInWindow(); |
---|
2739 | 3794 | } else |
---|
2740 | | - if (event.getSource() == sixButton) |
---|
| 3795 | + if (source == sixButton) |
---|
2741 | 3796 | { |
---|
2742 | 3797 | radio.layout = sixButton; |
---|
2743 | | - bigThree.remove(scenePanel); |
---|
2744 | | - bigThree.remove(centralPanel); |
---|
2745 | | - bigThree.remove(XYZPanel); |
---|
2746 | | - aWindowConstraints.gridx = 0; |
---|
2747 | | - aWindowConstraints.gridy = 0; |
---|
2748 | | - aWindowConstraints.gridwidth = 1; |
---|
2749 | | - // aConstraints.gridheight = 3; |
---|
2750 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2751 | | - aWindowConstraints.weightx = 0; |
---|
2752 | | - aWindowConstraints.weighty = 1; |
---|
2753 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2754 | | - aWindowConstraints.weightx = 1; |
---|
2755 | | - aWindowConstraints.gridwidth = 3; |
---|
2756 | | - // aWindowConstraints.gridheight = 3; |
---|
2757 | | - aWindowConstraints.gridx = 1; |
---|
2758 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2759 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2760 | | - aWindowConstraints.weightx = 0; |
---|
2761 | | - aWindowConstraints.gridx = 4; |
---|
2762 | | - aWindowConstraints.gridwidth = 1; |
---|
2763 | | - // aWindowConstraints.gridheight = 3; |
---|
2764 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2765 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2766 | | - bigThree.revalidate(); |
---|
| 3798 | + |
---|
| 3799 | + if (CameraPane.FULLSCREEN) |
---|
| 3800 | + fullscreenLayout = radio.layout; |
---|
| 3801 | + |
---|
| 3802 | +// bigThree.remove(scenePanel); |
---|
| 3803 | +// bigThree.remove(centralPanel); |
---|
| 3804 | +// bigThree.remove(XYZPanel); |
---|
| 3805 | +// aWindowConstraints.gridx = 0; |
---|
| 3806 | +// aWindowConstraints.gridy = 0; |
---|
| 3807 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3808 | +// // aConstraints.gridheight = 3; |
---|
| 3809 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3810 | +// aWindowConstraints.weightx = 0; |
---|
| 3811 | +// aWindowConstraints.weighty = 1; |
---|
| 3812 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3813 | +// aWindowConstraints.weightx = 1; |
---|
| 3814 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3815 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3816 | +// aWindowConstraints.gridx = 1; |
---|
| 3817 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3818 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3819 | +// aWindowConstraints.weightx = 0; |
---|
| 3820 | +// aWindowConstraints.gridx = 4; |
---|
| 3821 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3822 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3823 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3824 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3825 | +// bigThree.validate(); |
---|
| 3826 | +// scenePanel.setVisible(true); |
---|
| 3827 | +// centralPanel.setVisible(true); |
---|
| 3828 | +// XYZPanel.setVisible(false); |
---|
| 3829 | + bigThree.ClearUI(); |
---|
| 3830 | + bigThree.add(centralPanel); |
---|
| 3831 | + bigThree.add(scenePanel); |
---|
| 3832 | + bigThree.FlushUI(); |
---|
| 3833 | + |
---|
| 3834 | + cameraView.requestFocusInWindow(); |
---|
2767 | 3835 | } else |
---|
2768 | | - if (event.getSource() == sevenButton) |
---|
| 3836 | + if (source == sevenButton) |
---|
2769 | 3837 | { |
---|
2770 | 3838 | radio.layout = sevenButton; |
---|
2771 | | - bigThree.remove(scenePanel); |
---|
2772 | | - bigThree.remove(centralPanel); |
---|
2773 | | - bigThree.remove(XYZPanel); |
---|
2774 | | - aWindowConstraints.gridx = 0; |
---|
2775 | | - aWindowConstraints.gridy = 0; |
---|
2776 | | - aWindowConstraints.gridwidth = 1; |
---|
2777 | | - // aWindowConstraints.gridheight = 3; |
---|
2778 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2779 | | - aWindowConstraints.weightx = 0; |
---|
2780 | | - aWindowConstraints.weighty = 1; |
---|
2781 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2782 | | - aWindowConstraints.weightx = 1; |
---|
2783 | | - aWindowConstraints.gridwidth = 3; |
---|
2784 | | - // aWindowConstraints.gridheight = 3; |
---|
2785 | | - aWindowConstraints.gridx = 1; |
---|
2786 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2787 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2788 | | - aWindowConstraints.weightx = 0; |
---|
2789 | | - aWindowConstraints.gridx = 4; |
---|
2790 | | - aWindowConstraints.gridwidth = 1; |
---|
2791 | | - // aConstraints.gridheight = 3; |
---|
2792 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2793 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2794 | | - bigThree.revalidate(); |
---|
| 3839 | + |
---|
| 3840 | + if (CameraPane.FULLSCREEN) |
---|
| 3841 | + fullscreenLayout = radio.layout; |
---|
| 3842 | + |
---|
| 3843 | +// bigThree.remove(scenePanel); |
---|
| 3844 | +// bigThree.remove(centralPanel); |
---|
| 3845 | +// bigThree.remove(XYZPanel); |
---|
| 3846 | +// aWindowConstraints.gridx = 0; |
---|
| 3847 | +// aWindowConstraints.gridy = 0; |
---|
| 3848 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3849 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3850 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3851 | +// aWindowConstraints.weightx = 0; |
---|
| 3852 | +// aWindowConstraints.weighty = 1; |
---|
| 3853 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3854 | +// aWindowConstraints.weightx = 1; |
---|
| 3855 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3856 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3857 | +// aWindowConstraints.gridx = 1; |
---|
| 3858 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3859 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3860 | +// aWindowConstraints.weightx = 0; |
---|
| 3861 | +// aWindowConstraints.gridx = 4; |
---|
| 3862 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3863 | +// // aConstraints.gridheight = 3; |
---|
| 3864 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3865 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3866 | +// bigThree.validate(); |
---|
| 3867 | +// scenePanel.setVisible(true); |
---|
| 3868 | +// centralPanel.setVisible(true); |
---|
| 3869 | +// XYZPanel.setVisible(true); |
---|
| 3870 | + bigThree.ClearUI(); |
---|
| 3871 | + bigThree.add(scenePanel); |
---|
| 3872 | + bigThree.add(centralPanel); |
---|
| 3873 | + bigThree.add(XYZPanel); |
---|
| 3874 | + bigThree.FlushUI(); |
---|
| 3875 | + |
---|
| 3876 | + cameraView.requestFocusInWindow(); |
---|
2795 | 3877 | } else |
---|
2796 | | - if (event.getSource() == rootButton) |
---|
| 3878 | + if (source == rootButton) |
---|
2797 | 3879 | { |
---|
2798 | 3880 | Object3D obj; |
---|
2799 | 3881 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2803 | 3885 | EditObject(obj); |
---|
2804 | 3886 | } |
---|
2805 | 3887 | |
---|
| 3888 | + cameraView.requestFocusInWindow(); |
---|
2806 | 3889 | refreshContents(true); |
---|
2807 | 3890 | } else |
---|
2808 | | - if (event.getSource() == closeButton) |
---|
| 3891 | + if (source == closeButton) |
---|
2809 | 3892 | { |
---|
2810 | 3893 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2811 | 3894 | cRadio ab; |
---|
2812 | 3895 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2813 | 3896 | { |
---|
2814 | 3897 | ab = (cRadio)e.nextElement(); |
---|
2815 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3898 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2816 | 3899 | { |
---|
| 3900 | + // Patch to avoid bug with transparency. |
---|
| 3901 | + if (!ab.hadMaterial) |
---|
| 3902 | + { |
---|
| 3903 | + ab.object.material = null; |
---|
| 3904 | + } |
---|
| 3905 | + |
---|
2817 | 3906 | buttonGroup.remove(ab); |
---|
2818 | 3907 | radioPanel.remove(ab); |
---|
2819 | 3908 | |
---|
2820 | | - ab.GetObject().editWindow = null; |
---|
| 3909 | + //ab.GetObject().editWindow = null; |
---|
| 3910 | + ab.GetObject().manipWindow = null; |
---|
2821 | 3911 | // ab.GetObject().objectUI = null; // ????????? |
---|
2822 | 3912 | |
---|
2823 | 3913 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2824 | 3914 | break; |
---|
2825 | 3915 | } |
---|
2826 | 3916 | } |
---|
| 3917 | + |
---|
| 3918 | + cameraView.requestFocusInWindow(); |
---|
2827 | 3919 | refreshContents(true); |
---|
2828 | 3920 | } else |
---|
2829 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3921 | + if (source == editItem || source == editButton) |
---|
2830 | 3922 | { |
---|
| 3923 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3924 | + { |
---|
| 3925 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3926 | + child.pinned = true; |
---|
| 3927 | + } |
---|
| 3928 | + |
---|
2831 | 3929 | EditSelection(false); |
---|
2832 | 3930 | } else |
---|
2833 | | - if (event.getSource() == uneditButton) |
---|
| 3931 | + if (source == uneditButton) |
---|
2834 | 3932 | { |
---|
2835 | 3933 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2836 | 3934 | { |
---|
2837 | 3935 | Object3D child = (Object3D)e.nextElement(); |
---|
2838 | 3936 | if(child.editWindow != null) |
---|
2839 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3937 | + child.pinned = false; |
---|
2840 | 3938 | child.CloseUI(); |
---|
2841 | 3939 | listUI.remove(child); |
---|
| 3940 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2842 | 3941 | |
---|
2843 | | - child.editWindow = null; // ??????????? |
---|
| 3942 | + //child.editWindow = null; // ??????????? |
---|
2844 | 3943 | } |
---|
2845 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3944 | + objEditor.ctrlPanel.FlushUI(); |
---|
2846 | 3945 | //objEditor.jTree.clearSelection(); |
---|
2847 | 3946 | //objEditor.ResetSliders(); |
---|
2848 | 3947 | refreshContents(true); |
---|
2849 | 3948 | } else |
---|
2850 | | - if (event.getSource() == clearPanelButton) |
---|
| 3949 | + if (source == clearPanelButton) |
---|
2851 | 3950 | { |
---|
2852 | 3951 | assert(copy == group); |
---|
2853 | 3952 | //copy.ClearUI(); |
---|
2854 | 3953 | for (Object3D obj : listUI) |
---|
2855 | 3954 | { |
---|
| 3955 | + obj.pinned = false; |
---|
2856 | 3956 | obj.CloseUI(); |
---|
2857 | 3957 | } |
---|
2858 | 3958 | listUI.clear(); |
---|
| 3959 | + SetPinStates(group.selection.size() > 0); |
---|
2859 | 3960 | refreshContents(true); |
---|
2860 | 3961 | } else |
---|
2861 | | - if (event.getSource() == allParamsButton) |
---|
| 3962 | + if (source == allParamsButton) |
---|
2862 | 3963 | { |
---|
2863 | 3964 | assert(copy == group); |
---|
2864 | 3965 | |
---|
2865 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3966 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2866 | 3967 | |
---|
2867 | 3968 | for (Object3D obj : listUI) |
---|
2868 | 3969 | { |
---|
.. | .. |
---|
2879 | 3980 | |
---|
2880 | 3981 | refreshContents(true); |
---|
2881 | 3982 | } else |
---|
2882 | | - if (event.getSource() == unselectButton) |
---|
| 3983 | + if (source == unselectButton) |
---|
2883 | 3984 | { |
---|
2884 | 3985 | objEditor.jTree.clearSelection(); |
---|
2885 | 3986 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2886 | 3987 | objEditor.ResetSliders(); |
---|
2887 | 3988 | refreshContents(true); |
---|
2888 | 3989 | } else |
---|
2889 | | - if(event.getSource() instanceof cRadio) |
---|
| 3990 | + if(source instanceof cRadio) |
---|
2890 | 3991 | { |
---|
2891 | 3992 | group.parent = keepparent; |
---|
2892 | 3993 | group.attributes = 0; |
---|
2893 | 3994 | //group.editWindow = null; |
---|
2894 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3995 | + /*cRadio*/ radio = (cRadio)source; |
---|
2895 | 3996 | Object3D obj = radio.GetObject(); |
---|
2896 | 3997 | System.out.println("Edit " + obj); |
---|
2897 | 3998 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2911 | 4012 | } |
---|
2912 | 4013 | |
---|
2913 | 4014 | copy = group; |
---|
2914 | | - //CameraPane.theRenderer.object = group; |
---|
| 4015 | + |
---|
| 4016 | + SetUndoStates(); |
---|
| 4017 | + |
---|
| 4018 | + //Globals.theRenderer.object = group; |
---|
2915 | 4019 | if(!useclient) |
---|
2916 | 4020 | { |
---|
2917 | 4021 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2926 | 4030 | frontView.object = group; |
---|
2927 | 4031 | sideView.object = group; |
---|
2928 | 4032 | } |
---|
2929 | | - group.editWindow = this; |
---|
| 4033 | + |
---|
| 4034 | +// fix "+" issue |
---|
| 4035 | + //group.editWindow = this; |
---|
| 4036 | + group.manipWindow = this; |
---|
| 4037 | + |
---|
2930 | 4038 | /* |
---|
2931 | 4039 | currentLayout = radio.layout; |
---|
2932 | 4040 | if (currentLayout == null) |
---|
2933 | 4041 | currentLayout = sevenButton; |
---|
2934 | 4042 | */ |
---|
2935 | 4043 | radio.layout.doClick(); |
---|
| 4044 | + |
---|
| 4045 | + ClearUnpinned(); |
---|
| 4046 | + |
---|
| 4047 | + //Grafreed.Assert(group != null); |
---|
| 4048 | + //Grafreed.Assert(group.selection != null); |
---|
| 4049 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 4050 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 4051 | + EditSelection(false); |
---|
2936 | 4052 | keepparent = group.parent; |
---|
2937 | 4053 | // PARENT = NULL or not??? |
---|
2938 | 4054 | //group.parent = null; // ROOT |
---|
2939 | 4055 | //group.attributes = -1; |
---|
2940 | 4056 | ResetModel(); |
---|
| 4057 | + |
---|
| 4058 | + cameraView.requestFocusInWindow(); |
---|
2941 | 4059 | refreshContents(true); |
---|
2942 | | - } |
---|
| 4060 | + } else if (event.getSource() == editCameraItem) |
---|
| 4061 | + { |
---|
| 4062 | + cameraView.ProtectCamera(); |
---|
| 4063 | + cameraView.requestFocusInWindow(); |
---|
| 4064 | + cameraView.repaint(); |
---|
| 4065 | + return; |
---|
| 4066 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 4067 | + { |
---|
| 4068 | + cameraView.RevertCamera(); |
---|
| 4069 | + cameraView.requestFocusInWindow(); |
---|
| 4070 | + cameraView.repaint(); |
---|
| 4071 | + return; |
---|
| 4072 | + // } else if (event.getSource() == textureButton) |
---|
| 4073 | + // { |
---|
| 4074 | + // return; // true; |
---|
| 4075 | + } |
---|
2943 | 4076 | else |
---|
2944 | 4077 | { |
---|
2945 | 4078 | //return super.action(event, arg); |
---|
.. | .. |
---|
2948 | 4081 | } |
---|
2949 | 4082 | |
---|
2950 | 4083 | boolean useclient = false; |
---|
2951 | | - cRadio radio; |
---|
2952 | 4084 | |
---|
2953 | 4085 | void ToggleRoot() |
---|
2954 | 4086 | { |
---|
.. | .. |
---|
3000 | 4132 | refreshContents(); |
---|
3001 | 4133 | } |
---|
3002 | 4134 | |
---|
| 4135 | + void TransformChildren() |
---|
| 4136 | + { |
---|
| 4137 | + Object3D obj; |
---|
| 4138 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4139 | + { |
---|
| 4140 | + obj = (Object3D)e.nextElement(); |
---|
| 4141 | + obj.KeepTextureMatrices(); |
---|
| 4142 | + obj.TransformChildren(); |
---|
| 4143 | + obj.RestoreTextureMatrices(); |
---|
| 4144 | + |
---|
| 4145 | +// if (obj.parent == null) |
---|
| 4146 | +// { |
---|
| 4147 | +// System.out.println("NULL PARENT!"); |
---|
| 4148 | +// new Exception().printStackTrace(); |
---|
| 4149 | +// } |
---|
| 4150 | +// else |
---|
| 4151 | +// TouchTransform(obj); |
---|
| 4152 | +// //obj.parent.Touch(); |
---|
| 4153 | + } |
---|
| 4154 | + |
---|
| 4155 | + refreshContents(); |
---|
| 4156 | + } |
---|
3003 | 4157 | |
---|
3004 | 4158 | void ResetTransform() |
---|
3005 | 4159 | { |
---|
.. | .. |
---|
3112 | 4266 | refreshContents(); |
---|
3113 | 4267 | } |
---|
3114 | 4268 | |
---|
3115 | | - void ResetCentroid() |
---|
| 4269 | + void ResetCentroid(boolean full) |
---|
3116 | 4270 | { |
---|
3117 | 4271 | Object3D obj; |
---|
3118 | 4272 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3127 | 4281 | LA.matIdentity(Object3D.mat); |
---|
3128 | 4282 | obj.getBounds(minima, maxima, false); |
---|
3129 | 4283 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3130 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 4284 | + if (full) |
---|
| 4285 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3131 | 4286 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3132 | 4287 | obj.TransformMesh(Object3D.mat); |
---|
| 4288 | + |
---|
3133 | 4289 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3134 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 4290 | + if (full) |
---|
| 4291 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3135 | 4292 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 4293 | + |
---|
3136 | 4294 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3137 | 4295 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3138 | 4296 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3161 | 4319 | |
---|
3162 | 4320 | int size = obj.MemorySize(); |
---|
3163 | 4321 | |
---|
3164 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4322 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4323 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3165 | 4324 | } |
---|
3166 | 4325 | } |
---|
3167 | 4326 | catch (Exception e) |
---|
.. | .. |
---|
3198 | 4357 | obj = (Object3D)e.nextElement(); |
---|
3199 | 4358 | |
---|
3200 | 4359 | System.out.println("Object is: " + obj); |
---|
3201 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 4360 | + Grafreed.AnalyzeObject(obj); |
---|
3202 | 4361 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3203 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 4362 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3204 | 4363 | |
---|
3205 | 4364 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3206 | 4365 | } |
---|
.. | .. |
---|
3242 | 4401 | void GenNormals(boolean crease) |
---|
3243 | 4402 | { |
---|
3244 | 4403 | group.GenNormalsS(crease); |
---|
| 4404 | + |
---|
| 4405 | + refreshContents(); |
---|
| 4406 | + } |
---|
| 4407 | + |
---|
| 4408 | + void GenNormalsMESH() |
---|
| 4409 | + { |
---|
| 4410 | + group.GenNormalsMeshS(); |
---|
3245 | 4411 | |
---|
3246 | 4412 | refreshContents(); |
---|
3247 | 4413 | } |
---|
.. | .. |
---|
3414 | 4580 | |
---|
3415 | 4581 | void ParseVertices() |
---|
3416 | 4582 | { |
---|
3417 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3418 | | - GrafreeD.epsequal = true; |
---|
| 4583 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4584 | + Grafreed.epsequal = true; |
---|
3419 | 4585 | |
---|
3420 | 4586 | for (int i=0; i<group.selection.size(); i++) |
---|
3421 | 4587 | { |
---|
.. | .. |
---|
3440 | 4606 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3441 | 4607 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3442 | 4608 | |
---|
3443 | | - g.add(GrafreeD.clipboard); |
---|
| 4609 | + g.add(Grafreed.clipboard); |
---|
3444 | 4610 | |
---|
3445 | 4611 | buffer.add(g); |
---|
3446 | 4612 | } |
---|
.. | .. |
---|
3455 | 4621 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3456 | 4622 | } |
---|
3457 | 4623 | |
---|
3458 | | - GrafreeD.epsequal = epsequal; |
---|
| 4624 | + Grafreed.epsequal = epsequal; |
---|
3459 | 4625 | |
---|
3460 | 4626 | refreshContents(); |
---|
3461 | 4627 | } |
---|
.. | .. |
---|
3473 | 4639 | String pigment = Object3D.GetPigment(tex); |
---|
3474 | 4640 | //String bump = Object3D.GetBump(tex); |
---|
3475 | 4641 | |
---|
3476 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4642 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4643 | + |
---|
| 4644 | + try |
---|
| 4645 | + { |
---|
| 4646 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
| 4647 | + } |
---|
| 4648 | + catch (Exception e) |
---|
| 4649 | + { |
---|
| 4650 | + System.err.println("FAIL: " + node); |
---|
| 4651 | + } |
---|
3477 | 4652 | |
---|
3478 | 4653 | double s = v.s; |
---|
3479 | 4654 | |
---|
.. | .. |
---|
3561 | 4736 | |
---|
3562 | 4737 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3563 | 4738 | |
---|
3564 | | - boolean random = CameraPane.RANDOM; |
---|
3565 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4739 | + boolean random = CameraPane.SWITCH; |
---|
| 4740 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3566 | 4741 | lowres.linkVerticesThis(null); |
---|
3567 | 4742 | lowres.linkVerticesThis(sn); |
---|
3568 | | - CameraPane.RANDOM = random; |
---|
| 4743 | + CameraPane.SWITCH = random; |
---|
3569 | 4744 | |
---|
3570 | 4745 | System.err.flush(); |
---|
3571 | 4746 | |
---|
.. | .. |
---|
3605 | 4780 | return; |
---|
3606 | 4781 | |
---|
3607 | 4782 | Object3D poses = group.selection.get(0); |
---|
3608 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4783 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3609 | 4784 | |
---|
3610 | 4785 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3611 | 4786 | |
---|
.. | .. |
---|
3774 | 4949 | group.selection.RelinkToSupport(); // july 2014 |
---|
3775 | 4950 | System.out.println("DONE."); |
---|
3776 | 4951 | refreshContents(); |
---|
3777 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4952 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3778 | 4953 | } |
---|
3779 | 4954 | |
---|
3780 | 4955 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3799 | 4974 | |
---|
3800 | 4975 | void ClipMesh() |
---|
3801 | 4976 | { |
---|
3802 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4977 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3803 | 4978 | { |
---|
3804 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4979 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3805 | 4980 | |
---|
3806 | 4981 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3807 | 4982 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3810 | 4985 | // { |
---|
3811 | 4986 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3812 | 4987 | // } |
---|
3813 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4988 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3814 | 4989 | } |
---|
3815 | 4990 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3816 | 4991 | System.out.println("DONE."); |
---|
.. | .. |
---|
3857 | 5032 | void MarkLeaves(boolean hide) |
---|
3858 | 5033 | { |
---|
3859 | 5034 | group.selection.MarkLeaves(hide); |
---|
| 5035 | + refreshContents(); |
---|
| 5036 | + } |
---|
| 5037 | + |
---|
| 5038 | + void RewindLeaves(boolean hide) |
---|
| 5039 | + { |
---|
| 5040 | + group.selection.RewindLeaves(hide); |
---|
| 5041 | + refreshContents(); |
---|
| 5042 | + } |
---|
| 5043 | + |
---|
| 5044 | + void RandomLeaves(boolean hide) |
---|
| 5045 | + { |
---|
| 5046 | + group.selection.RandomLeaves(hide); |
---|
3860 | 5047 | refreshContents(); |
---|
3861 | 5048 | } |
---|
3862 | 5049 | |
---|
.. | .. |
---|
3931 | 5118 | // } |
---|
3932 | 5119 | // } |
---|
3933 | 5120 | |
---|
3934 | | - static boolean allparams = true; |
---|
3935 | | - |
---|
3936 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
3937 | | - |
---|
3938 | 5121 | void EditSelection(boolean newWindow) |
---|
3939 | 5122 | { |
---|
| 5123 | + if (group.selection == null) |
---|
| 5124 | + { |
---|
| 5125 | + EditElement(group, newWindow); // ? new |
---|
| 5126 | + return; |
---|
| 5127 | + } |
---|
| 5128 | + |
---|
3940 | 5129 | // aConstraints.gridy = 0; |
---|
3941 | 5130 | for (int i=0; i<group.selection.size(); i++) |
---|
3942 | 5131 | { |
---|
3943 | 5132 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
3944 | 5133 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
3945 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 5134 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3946 | 5135 | |
---|
3947 | 5136 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3948 | | - if(elem != group) |
---|
| 5137 | + if(elem != group || !newWindow) |
---|
3949 | 5138 | { |
---|
3950 | | - // if (!(elem instanceof Composite)) |
---|
3951 | | - // newWindow = false; |
---|
3952 | | - listUI.add(elem); |
---|
3953 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
3954 | | - System.out.println("edit : " + elem); |
---|
3955 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5139 | + EditElement(elem, newWindow); // ? new |
---|
3956 | 5140 | } |
---|
3957 | 5141 | } |
---|
3958 | 5142 | } |
---|
.. | .. |
---|
4015 | 5199 | |
---|
4016 | 5200 | freezemodel = false; |
---|
4017 | 5201 | } |
---|
4018 | | - |
---|
4019 | | - boolean flashIt = true; |
---|
4020 | | - |
---|
| 5202 | + |
---|
4021 | 5203 | public void valueChanged(TreeSelectionEvent e) |
---|
4022 | 5204 | //public boolean handleEvent(Event event) |
---|
4023 | 5205 | { |
---|
.. | .. |
---|
4027 | 5209 | //new Exception().printStackTrace(); |
---|
4028 | 5210 | |
---|
4029 | 5211 | freezemodel = true; |
---|
4030 | | - |
---|
| 5212 | + ClearUnpinned(); |
---|
| 5213 | + |
---|
4031 | 5214 | /**/ |
---|
4032 | 5215 | //switch (event.id) |
---|
4033 | 5216 | { |
---|
.. | .. |
---|
4035 | 5218 | //case 702: // Event.LIST_DESELECT |
---|
4036 | 5219 | group.deselectAll(); |
---|
4037 | 5220 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4038 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4039 | 5221 | if (tps != null) |
---|
4040 | 5222 | { |
---|
4041 | 5223 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4044 | 5226 | |
---|
4045 | 5227 | //if (child.parent != null) |
---|
4046 | 5228 | //child.parent.addSelectee(child); |
---|
| 5229 | + objEditor.SetMaterial(child); |
---|
4047 | 5230 | group.addSelectee(child); |
---|
4048 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4049 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4050 | | - System.err.println("info : " + child.GetPath()); |
---|
4051 | 5231 | } |
---|
4052 | 5232 | } |
---|
4053 | | - else |
---|
4054 | | - { |
---|
4055 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4056 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4057 | | - System.err.println("info : " + group.GetPath()); |
---|
4058 | | - } |
---|
| 5233 | +// else |
---|
| 5234 | +// { |
---|
| 5235 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 5236 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 5237 | +// System.err.println("info : " + group.GetPath()); |
---|
| 5238 | +// } |
---|
4059 | 5239 | |
---|
4060 | | - objEditor.SetText(); // jan 2014 |
---|
4061 | | - |
---|
4062 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 5240 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4063 | 5241 | CameraPane.flash = true; |
---|
4064 | 5242 | |
---|
4065 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 5243 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4066 | 5244 | // a camera |
---|
4067 | 5245 | { |
---|
4068 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4069 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
4070 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
4071 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 5246 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5247 | + { |
---|
| 5248 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 5249 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5250 | + } |
---|
| 5251 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 5252 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4072 | 5253 | } |
---|
4073 | 5254 | |
---|
| 5255 | + if (tps != null && tps.length == 1) |
---|
| 5256 | + { |
---|
| 5257 | + EditSelection(false); |
---|
| 5258 | + } |
---|
| 5259 | + |
---|
| 5260 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5261 | + |
---|
4074 | 5262 | refreshContents(); |
---|
4075 | 5263 | //return true; |
---|
4076 | 5264 | } |
---|
.. | .. |
---|
4079 | 5267 | |
---|
4080 | 5268 | freezemodel = false; |
---|
4081 | 5269 | } |
---|
| 5270 | + |
---|
| 5271 | + void SetPinStates(boolean enabled) |
---|
| 5272 | + { |
---|
| 5273 | + editButton.setEnabled(enabled); |
---|
| 5274 | + uneditButton.setEnabled(enabled); |
---|
| 5275 | + //unselectButton.setEnabled(enabled); |
---|
| 5276 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5277 | + |
---|
| 5278 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5279 | + } |
---|
| 5280 | + |
---|
| 5281 | + void refreshContents(boolean cp) |
---|
| 5282 | + { |
---|
| 5283 | + //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5284 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 5285 | + { |
---|
| 5286 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 5287 | + |
---|
| 5288 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 5289 | + { |
---|
| 5290 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 5291 | + |
---|
| 5292 | + objEditor.AddInfo(child, this, true); |
---|
| 5293 | + System.err.println("info : " + child.GetPath()); |
---|
| 5294 | + } |
---|
| 5295 | + |
---|
| 5296 | + objEditor.SetText(); // jan 2014 |
---|
| 5297 | + } |
---|
| 5298 | + |
---|
| 5299 | + super.refreshContents(cp); |
---|
| 5300 | + } |
---|
4082 | 5301 | |
---|
4083 | 5302 | void linkSomething(Object3D thing) |
---|
4084 | 5303 | { |
---|
.. | .. |
---|
4150 | 5369 | { |
---|
4151 | 5370 | if (group.selection.isEmpty()) |
---|
4152 | 5371 | return; |
---|
4153 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 5372 | + |
---|
| 5373 | + Grafreed.clipboardIsTempGroup = false; |
---|
4154 | 5374 | Composite tGroup = null; |
---|
4155 | 5375 | if (group.selection.size() > 0) // 1) |
---|
4156 | 5376 | { |
---|
4157 | 5377 | tGroup = new cGroup(); |
---|
4158 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 5378 | + Grafreed.clipboardIsTempGroup = true; |
---|
4159 | 5379 | } |
---|
4160 | 5380 | |
---|
4161 | 5381 | if (cut) |
---|
4162 | 5382 | { |
---|
| 5383 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5384 | +// Save(); |
---|
4163 | 5385 | //int indices[] = jList.getSelectedIndices(); |
---|
4164 | 5386 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4165 | 5387 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4195 | 5417 | //System.out.println("cut " + child); |
---|
4196 | 5418 | //System.out.println("parent = " + child.parent); |
---|
4197 | 5419 | // tmp.addChild(child); |
---|
4198 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5420 | + if (Grafreed.clipboardIsTempGroup) |
---|
4199 | 5421 | tGroup.add/*Child*/(tmp); |
---|
4200 | 5422 | else |
---|
4201 | | - GrafreeD.clipboard = tmp; |
---|
| 5423 | + Grafreed.clipboard = tmp; |
---|
4202 | 5424 | } |
---|
4203 | 5425 | else |
---|
4204 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5426 | + if (Grafreed.clipboardIsTempGroup) |
---|
4205 | 5427 | tGroup.add/*Child*/(child); |
---|
4206 | 5428 | else |
---|
4207 | | - GrafreeD.clipboard = child; |
---|
| 5429 | + Grafreed.clipboard = child; |
---|
4208 | 5430 | } |
---|
4209 | 5431 | |
---|
4210 | 5432 | //ResetModel(); |
---|
.. | .. |
---|
4236 | 5458 | //System.out.println("cut " + elem); |
---|
4237 | 5459 | //System.out.println("parent = " + elem.parent); |
---|
4238 | 5460 | // tmp.addChild(elem); |
---|
4239 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5461 | + if (Grafreed.clipboardIsTempGroup) |
---|
4240 | 5462 | tGroup.add/*Child*/(tmp); |
---|
4241 | 5463 | else |
---|
4242 | | - GrafreeD.clipboard = tmp; |
---|
| 5464 | + Grafreed.clipboard = tmp; |
---|
4243 | 5465 | } |
---|
4244 | 5466 | else |
---|
4245 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5467 | + if (Grafreed.clipboardIsTempGroup) |
---|
4246 | 5468 | tGroup.add/*Child*/(child); |
---|
4247 | 5469 | else |
---|
4248 | | - GrafreeD.clipboard = child; |
---|
| 5470 | + Grafreed.clipboard = child; |
---|
4249 | 5471 | } |
---|
4250 | 5472 | |
---|
4251 | 5473 | } |
---|
4252 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4253 | | - GrafreeD.clipboard = tGroup; |
---|
| 5474 | + |
---|
| 5475 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 5476 | + Grafreed.clipboard = tGroup; |
---|
| 5477 | + |
---|
4254 | 5478 | if (cut) |
---|
4255 | 5479 | { |
---|
4256 | 5480 | ResetModel(); |
---|
.. | .. |
---|
4260 | 5484 | |
---|
4261 | 5485 | void paste(boolean expand) |
---|
4262 | 5486 | { |
---|
| 5487 | + if (Globals.REPLACEONMAKE) |
---|
| 5488 | + Save(); |
---|
| 5489 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5490 | + Globals.REPLACEONMAKE = false; |
---|
4263 | 5491 | // if (GrafreeD.clipboard == null) |
---|
4264 | 5492 | // return; |
---|
4265 | 5493 | boolean first = true; |
---|
4266 | 5494 | |
---|
4267 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5495 | + if (Grafreed.clipboardIsTempGroup) |
---|
4268 | 5496 | { |
---|
4269 | 5497 | Composite temp; |
---|
4270 | 5498 | |
---|
.. | .. |
---|
4275 | 5503 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4276 | 5504 | */ |
---|
4277 | 5505 | Object3D elem; |
---|
4278 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5506 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4279 | 5507 | { |
---|
4280 | 5508 | Object3D child = (Object3D)e.nextElement(); |
---|
4281 | 5509 | |
---|
.. | .. |
---|
4309 | 5537 | //Object3D cb = Applet3D.clipboard; |
---|
4310 | 5538 | //temp.addChild(cb); |
---|
4311 | 5539 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4312 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4313 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4314 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4315 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4316 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5540 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5541 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5542 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5543 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5544 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4317 | 5545 | else |
---|
4318 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4319 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5546 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5547 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4320 | 5548 | } |
---|
4321 | 5549 | |
---|
| 5550 | + Globals.REPLACEONMAKE = keep; |
---|
4322 | 5551 | ResetModel(); |
---|
4323 | 5552 | refreshContents(); |
---|
4324 | 5553 | } |
---|
4325 | 5554 | |
---|
4326 | | - void pasteInto(boolean copyit) |
---|
| 5555 | + void pasteInto(boolean copyit, boolean clone) |
---|
4327 | 5556 | { |
---|
4328 | 5557 | // if (GrafreeD.clipboard == null) |
---|
4329 | 5558 | // return; |
---|
.. | .. |
---|
4352 | 5581 | if (copyit) |
---|
4353 | 5582 | { |
---|
4354 | 5583 | // paste(false); |
---|
4355 | | - CloneClipboard(false); // sept 2014 |
---|
| 5584 | + if (clone) |
---|
| 5585 | + { |
---|
| 5586 | + CloneClipboard(false); // sept 2014 |
---|
| 5587 | + } |
---|
| 5588 | + else |
---|
| 5589 | + { |
---|
| 5590 | + paste(false); |
---|
| 5591 | + } |
---|
4356 | 5592 | } |
---|
4357 | 5593 | else |
---|
4358 | 5594 | { |
---|
4359 | 5595 | boolean first = true; |
---|
4360 | 5596 | |
---|
4361 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5597 | + if (Grafreed.clipboardIsTempGroup) |
---|
4362 | 5598 | { |
---|
4363 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5599 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4364 | 5600 | Object3D copy; |
---|
4365 | 5601 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4366 | 5602 | { |
---|
.. | .. |
---|
4370 | 5606 | } |
---|
4371 | 5607 | } else |
---|
4372 | 5608 | { |
---|
4373 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5609 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4374 | 5610 | } |
---|
4375 | 5611 | } |
---|
4376 | 5612 | } |
---|
.. | .. |
---|
4447 | 5683 | |
---|
4448 | 5684 | void group(Object3D csg, boolean grab) |
---|
4449 | 5685 | { |
---|
| 5686 | + if (Globals.REPLACEONMAKE) |
---|
| 5687 | + Save(); |
---|
| 5688 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5689 | + Globals.REPLACEONMAKE = false; |
---|
4450 | 5690 | if (//false) // why?? |
---|
4451 | 5691 | !group.selection.isEmpty()) |
---|
4452 | 5692 | { |
---|
.. | .. |
---|
4560 | 5800 | //node.add(csg); |
---|
4561 | 5801 | //makeSomething(node); |
---|
4562 | 5802 | makeSomething(csg); |
---|
| 5803 | + Globals.REPLACEONMAKE = keep; |
---|
4563 | 5804 | } |
---|
4564 | 5805 | |
---|
4565 | 5806 | void Ungroup(Object3D g) |
---|
4566 | 5807 | { |
---|
| 5808 | + if (Globals.REPLACEONMAKE) |
---|
| 5809 | + Save(); |
---|
| 5810 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5811 | + Globals.REPLACEONMAKE = false; |
---|
4567 | 5812 | if (g instanceof HiddenObject) |
---|
4568 | 5813 | { |
---|
4569 | 5814 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4580 | 5825 | objEditor.makeSomething(g.get(i), false); |
---|
4581 | 5826 | } |
---|
4582 | 5827 | } |
---|
| 5828 | + Globals.REPLACEONMAKE = keep; |
---|
4583 | 5829 | } |
---|
4584 | 5830 | |
---|
4585 | 5831 | void ungroup() |
---|
.. | .. |
---|
4775 | 6021 | } |
---|
4776 | 6022 | */ |
---|
4777 | 6023 | |
---|
4778 | | - void ImportGFD() |
---|
4779 | | - { |
---|
4780 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4781 | | - browser.show(); |
---|
4782 | | - String filename = browser.getFile(); |
---|
4783 | | - if (filename != null && filename.length() > 0) |
---|
4784 | | - { |
---|
4785 | | - String fullname = browser.getDirectory() + filename; |
---|
4786 | | - |
---|
4787 | | - //Object3D readobj = |
---|
4788 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4789 | | - //makeSomething(readobj); |
---|
4790 | | - } |
---|
4791 | | - } |
---|
4792 | | - |
---|
4793 | 6024 | /* |
---|
4794 | 6025 | public void Callback(Object obj) |
---|
4795 | 6026 | { |
---|
.. | .. |
---|
4813 | 6044 | } |
---|
4814 | 6045 | */ |
---|
4815 | 6046 | |
---|
4816 | | - void ImportVRMLX3D() |
---|
4817 | | - { |
---|
4818 | | - if (GrafreeD.standAlone) |
---|
4819 | | - { |
---|
4820 | | - /**/ |
---|
4821 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4822 | | - browser.show(); |
---|
4823 | | - String filename = browser.getFile(); |
---|
4824 | | - if (filename != null && filename.length() > 0) |
---|
4825 | | - { |
---|
4826 | | - String fullname = browser.getDirectory() + filename; |
---|
4827 | | - LoadVRMLX3D(fullname); |
---|
4828 | | - } |
---|
4829 | | - /**/ |
---|
4830 | | - } |
---|
4831 | | - } |
---|
4832 | | - |
---|
4833 | 6047 | String GetFile(String dialogName) |
---|
4834 | 6048 | { |
---|
4835 | | - if (GrafreeD.standAlone) |
---|
| 6049 | + if (Grafreed.standAlone) |
---|
4836 | 6050 | { |
---|
4837 | 6051 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4838 | 6052 | browser.show(); |
---|
.. | .. |
---|
4896 | 6110 | cButton flashSelectionButton; |
---|
4897 | 6111 | cButton editButton; |
---|
4898 | 6112 | cButton uneditButton; |
---|
| 6113 | + JCheckBox allParamsButton; |
---|
4899 | 6114 | cButton clearpanelButton; |
---|
4900 | | - cButton allParamsButton; |
---|
4901 | 6115 | cButton unselectButton; |
---|
4902 | 6116 | |
---|
| 6117 | + cButton restoreCameraButton; |
---|
| 6118 | + |
---|
| 6119 | + cButton oneStepButton; |
---|
| 6120 | + |
---|
| 6121 | + cButton groupButton; |
---|
| 6122 | + cButton ungroupButton; |
---|
| 6123 | + cButton compositeButton; |
---|
| 6124 | + cButton switchButton; |
---|
| 6125 | + cButton loopButton; |
---|
| 6126 | + cButton textureButton; |
---|
| 6127 | + |
---|
| 6128 | + cButton skybox1Button; |
---|
| 6129 | + cButton skybox2Button; |
---|
| 6130 | + cButton skybox3Button; |
---|
| 6131 | + cButton skybox4Button; |
---|
| 6132 | + cButton skybox5Button; |
---|
| 6133 | + cButton skybox6Button; |
---|
| 6134 | + cButton skybox7Button; |
---|
| 6135 | + |
---|
| 6136 | + cButton skybox11Button; |
---|
| 6137 | + cButton skybox12Button; |
---|
| 6138 | + cButton skybox13Button; |
---|
| 6139 | + cButton skybox14Button; |
---|
| 6140 | + cButton skybox15Button; |
---|
| 6141 | + cButton skybox16Button; |
---|
| 6142 | + cButton skybox17Button; |
---|
| 6143 | + |
---|
| 6144 | + cButton gridButton; |
---|
| 6145 | + cButton boxButton; |
---|
| 6146 | + cButton sphereButton; |
---|
| 6147 | + cButton coneButton; |
---|
| 6148 | + cButton torusButton; |
---|
| 6149 | + cButton superButton; |
---|
| 6150 | + cButton kleinButton; |
---|
| 6151 | + cButton particlesButton; |
---|
| 6152 | + cButton overlayButton; |
---|
| 6153 | + cButton lightButton; |
---|
| 6154 | + |
---|
4903 | 6155 | cButton screenfitButton; |
---|
4904 | 6156 | cButton screenfitpointButton; |
---|
4905 | 6157 | cButton snapobjectButton; |
---|
.. | .. |
---|
4911 | 6163 | |
---|
4912 | 6164 | cButton setsupportButton; |
---|
4913 | 6165 | |
---|
4914 | | - cButton twoButton; |
---|
4915 | | - cButton sixButton; |
---|
4916 | | - cButton threeButton; |
---|
4917 | | - cButton sevenButton; |
---|
4918 | | - cButton fourButton; // full panel |
---|
4919 | | - cButton oneButton; // full XYZ |
---|
4920 | | - //cButton currentLayout; |
---|
4921 | | - |
---|
4922 | 6166 | // |
---|
4923 | 6167 | //Composite |
---|
4924 | 6168 | Object3D // to do !! |
---|
.. | .. |
---|
4928 | 6172 | //JTree jTree; |
---|
4929 | 6173 | private MenuItem lookAtItem; |
---|
4930 | 6174 | private MenuItem lookFromItem; |
---|
4931 | | - private MenuItem switchItem; |
---|
| 6175 | + private MenuItem switchViewItem; |
---|
4932 | 6176 | private MenuItem cutItem; |
---|
4933 | | - private MenuItem duplicateItem; |
---|
| 6177 | + private MenuItem undoItem; |
---|
| 6178 | + private MenuItem redoItem; |
---|
| 6179 | + private JMenuItem duplicateItem; |
---|
4934 | 6180 | private MenuItem cloneItem; |
---|
4935 | 6181 | private MenuItem cloneSupportItem; |
---|
4936 | 6182 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
4943 | 6189 | private MenuItem linkverticesItem; |
---|
4944 | 6190 | private MenuItem relinkverticesItem; |
---|
4945 | 6191 | private MenuItem setMasterItem; |
---|
4946 | | - private MenuItem resetMeshItem; |
---|
| 6192 | + private MenuItem resetAllItem; |
---|
4947 | 6193 | private MenuItem stepAllItem; |
---|
4948 | 6194 | private MenuItem revertMeshItem; |
---|
4949 | 6195 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4954 | 6200 | private MenuItem mergeGeometriesItem; |
---|
4955 | 6201 | private MenuItem copyItem; |
---|
4956 | 6202 | private MenuItem pasteItem; |
---|
| 6203 | + private MenuItem pasteIntoItem; |
---|
4957 | 6204 | private MenuItem pasteLinkItem; |
---|
4958 | 6205 | private MenuItem pasteCloneItem; |
---|
4959 | 6206 | private MenuItem pasteExpandItem; |
---|
4960 | | - private MenuItem clearItem; |
---|
| 6207 | + private MenuItem deleteItem; |
---|
4961 | 6208 | private MenuItem clearAllItem; |
---|
4962 | 6209 | private MenuItem genUVItem; |
---|
4963 | 6210 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
4992 | 6239 | private MenuItem showleavesItem; |
---|
4993 | 6240 | private MenuItem markleavesItem; |
---|
4994 | 6241 | private MenuItem unmarkleavesItem; |
---|
| 6242 | + private MenuItem rewindleavesItem; |
---|
| 6243 | + private MenuItem unrewindleavesItem; |
---|
| 6244 | + private MenuItem randomleavesItem; |
---|
| 6245 | + private MenuItem unrandomleavesItem; |
---|
4995 | 6246 | |
---|
4996 | 6247 | private MenuItem flipVItem; |
---|
4997 | 6248 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5003 | 6254 | private MenuItem panoTexturesItem; |
---|
5004 | 6255 | |
---|
5005 | 6256 | private MenuItem resetCentroidItem; |
---|
5006 | | - private MenuItem transformgeometryItem; |
---|
| 6257 | + private MenuItem resetCentroidXZItem; |
---|
5007 | 6258 | private MenuItem resetTransformItem; |
---|
| 6259 | + private MenuItem transformGeometryItem; |
---|
| 6260 | + private MenuItem transformChildrenItem; |
---|
5008 | 6261 | private MenuItem hideItem; |
---|
5009 | 6262 | private MenuItem grabItem; |
---|
5010 | 6263 | private MenuItem backItem; |
---|
5011 | 6264 | private MenuItem frontItem; |
---|
5012 | 6265 | private MenuItem cameraItem; |
---|
5013 | 6266 | private MenuItem compositeItem; |
---|
5014 | | - private MenuItem randomItem; |
---|
| 6267 | + private MenuItem switchItem; |
---|
5015 | 6268 | private MenuItem physicsItem; |
---|
5016 | 6269 | private MenuItem frameselectorItem; |
---|
5017 | 6270 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5035 | 6288 | private MenuItem attachBumpItem; |
---|
5036 | 6289 | private MenuItem detachBumpItem; |
---|
5037 | 6290 | private MenuItem pigmentBumpItem; |
---|
| 6291 | + private MenuItem embedTexturesItem; |
---|
| 6292 | + private MenuItem deEmbedTexturesItem; |
---|
5038 | 6293 | |
---|
5039 | 6294 | private MenuItem particleItem; |
---|
5040 | 6295 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5051 | 6306 | private MenuItem blobItem; |
---|
5052 | 6307 | private MenuItem latheItem; |
---|
5053 | 6308 | private MenuItem bezierItem; |
---|
5054 | | - private MenuItem checkerItem; |
---|
| 6309 | + private MenuItem overlayItem; |
---|
5055 | 6310 | private MenuItem meshItem; |
---|
5056 | 6311 | // private MenuItem meshGroupItem; |
---|
5057 | 6312 | private MenuItem springItem; |
---|
.. | .. |
---|
5073 | 6328 | private MenuItem doubleItem; |
---|
5074 | 6329 | private MenuItem tripleItem; |
---|
5075 | 6330 | |
---|
5076 | | - private MenuItem importGFDItem; |
---|
5077 | | - private MenuItem importVRMLX3DItem; |
---|
5078 | | - private MenuItem import3DSItem; |
---|
5079 | | - private MenuItem importOBJItem; |
---|
5080 | | - |
---|
5081 | 6331 | private MenuItem computeAOItem; |
---|
5082 | 6332 | private MenuItem recompileItem; |
---|
5083 | 6333 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5087 | 6337 | private MenuItem analyzeItem; |
---|
5088 | 6338 | private MenuItem dumpItem; |
---|
5089 | 6339 | //boolean freezemodel = false; |
---|
| 6340 | + |
---|
| 6341 | + Menu cameraMenu; |
---|
| 6342 | + MenuItem editCameraItem; |
---|
| 6343 | + MenuItem restoreCameraItem; |
---|
5090 | 6344 | } |
---|