.. | .. |
---|
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 AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
| 46 | + { |
---|
| 47 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 48 | + |
---|
| 49 | + tab0.setName("Urban"); |
---|
| 50 | + skyboxpanel.add(tab0); |
---|
| 51 | + |
---|
| 52 | + cGridBag row0 = new cGridBag(); |
---|
| 53 | + cGridBag row1 = new cGridBag(); |
---|
| 54 | + cGridBag row2 = new cGridBag(); |
---|
| 55 | + cGridBag row3 = new cGridBag(); |
---|
| 56 | + cGridBag row4 = new cGridBag(); |
---|
| 57 | + cGridBag row5 = new cGridBag(); |
---|
| 58 | + cGridBag row6 = new cGridBag(); |
---|
| 59 | + |
---|
| 60 | + AddSkyboxButton("default", "rgb", row0); |
---|
| 61 | + //AddSkyboxButton("default", "cornell", row0); |
---|
| 62 | + AddSkyboxButton("penguins", "dust", row0); |
---|
| 63 | + AddSkyboxButton("penguins", "tropic", row0); |
---|
| 64 | + AddSkyboxButton("penguins", "yonder", row0); |
---|
| 65 | + |
---|
| 66 | + AddSkyboxButton("default", "uffizi", row1); |
---|
| 67 | + AddSkyboxButton("bridge", "Bridge", row1); |
---|
| 68 | + AddSkyboxButton("bridge", "Bridge2", row1); |
---|
| 69 | + AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
| 70 | + |
---|
| 71 | + AddSkyboxButton("urban", "Parliament", row2); |
---|
| 72 | + AddSkyboxButton("urban", "Roundabout", row2); |
---|
| 73 | + AddSkyboxButton("urban", "SaintLazarusChurch", row2); |
---|
| 74 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row2); |
---|
| 75 | + |
---|
| 76 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
| 77 | + AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 78 | + AddSkyboxButton("urban", "Medborgarplatsen", row3); |
---|
| 79 | + AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
| 80 | + |
---|
| 81 | + AddSkyboxButton("park", "Buddha", row4); |
---|
| 82 | + AddSkyboxButton("park", "CNTower2", row4); |
---|
| 83 | + AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
| 84 | + AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
| 85 | + |
---|
| 86 | + AddSkyboxButton("park", "Park", row5); |
---|
| 87 | + AddSkyboxButton("park", "Pond", row5); |
---|
| 88 | + AddSkyboxButton("park", "Skansen", row5); |
---|
| 89 | + AddSkyboxButton("park", "Skansen2", row5); |
---|
| 90 | + |
---|
| 91 | + AddSkyboxButton("park", "Skansen3", row6); |
---|
| 92 | + AddSkyboxButton("park", "Skansen4", row6); |
---|
| 93 | + AddSkyboxButton("park", "Skansen5", row6); |
---|
| 94 | + AddSkyboxButton("persson", "VancouverConventionCentre", row6); |
---|
| 95 | + |
---|
| 96 | + tab0.add(row0); |
---|
| 97 | + tab0.add(row1); |
---|
| 98 | + tab0.add(row2); |
---|
| 99 | + tab0.add(row3); |
---|
| 100 | + tab0.add(row4); |
---|
| 101 | + tab0.add(row5); |
---|
| 102 | + tab0.add(row6); |
---|
| 103 | + |
---|
| 104 | + for (int i=5; --i>=0;) |
---|
| 105 | + { |
---|
| 106 | + //oe.toolboxPanel.Return(); |
---|
| 107 | + //tab0.add(new cGridBag()); |
---|
| 108 | + } |
---|
| 109 | + } |
---|
| 110 | + |
---|
| 111 | + public void AddSkyboxTab1(JTabbedPane skyboxpanel) |
---|
| 112 | + { |
---|
| 113 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 114 | + |
---|
| 115 | + tab0.setName("Nature"); |
---|
| 116 | + skyboxpanel.add(tab0); |
---|
| 117 | + |
---|
| 118 | + cGridBag row0 = new cGridBag(); |
---|
| 119 | + cGridBag row1 = new cGridBag(); |
---|
| 120 | + cGridBag row2 = new cGridBag(); |
---|
| 121 | + cGridBag row3 = new cGridBag(); |
---|
| 122 | + cGridBag row4 = new cGridBag(); |
---|
| 123 | + cGridBag row5 = new cGridBag(); |
---|
| 124 | + cGridBag row6 = new cGridBag(); |
---|
| 125 | + |
---|
| 126 | + AddSkyboxButton("beach", "HeartInTheSand", row0); |
---|
| 127 | + AddSkyboxButton("beach", "LarnacaBeach", row0); |
---|
| 128 | + AddSkyboxButton("beach", "PalmTrees", row0); |
---|
| 129 | + AddSkyboxButton("beach", "Tenerife", row0); |
---|
| 130 | + |
---|
| 131 | + AddSkyboxButton("beach", "Tenerife2", row1); |
---|
| 132 | + AddSkyboxButton("beach", "Tenerife3", row1); |
---|
| 133 | + AddSkyboxButton("field", "FishPond", row1); |
---|
| 134 | + AddSkyboxButton("field", "Footballfield", row1); |
---|
| 135 | + |
---|
| 136 | + AddSkyboxButton("field", "Meadow", row2); |
---|
| 137 | + AddSkyboxButton("field", "Sorsele", row2); |
---|
| 138 | + AddSkyboxButton("field", "Sorsele2", row2); |
---|
| 139 | + AddSkyboxButton("field", "Sorsele3", row2); |
---|
| 140 | + |
---|
| 141 | + AddSkyboxButton("forest", "Brudslojan", row3); |
---|
| 142 | + AddSkyboxButton("forest", "Langholmen2", row3); |
---|
| 143 | + AddSkyboxButton("forest", "Plants", row3); |
---|
| 144 | + AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 145 | + |
---|
| 146 | + AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
| 147 | + AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
| 148 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 149 | + AddSkyboxButton("park", "Tantolunden4", row4); |
---|
| 150 | + |
---|
| 151 | + AddSkyboxButton("park", "Stairs", row5); |
---|
| 152 | + AddSkyboxButton("default", "skycube", row6); |
---|
| 153 | + AddSkyboxButton("rocky", "Langholmen", row5); |
---|
| 154 | + AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 155 | + |
---|
| 156 | + AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 157 | + AddSkyboxButton("default", "CloudyHills", row6); |
---|
| 158 | + AddSkyboxButton("daz", "Autumn", row6); |
---|
| 159 | + AddSkyboxButton("daz", "MountainTrail", row6); |
---|
| 160 | + /* |
---|
| 161 | +Autumn |
---|
| 162 | +Greenlands |
---|
| 163 | +MountainTrail |
---|
| 164 | +Oasis |
---|
| 165 | +TheRock |
---|
| 166 | +TopOfTheWorld |
---|
| 167 | +Winter |
---|
| 168 | + */ |
---|
| 169 | + |
---|
| 170 | + tab0.add(row0); |
---|
| 171 | + tab0.add(row1); |
---|
| 172 | + tab0.add(row2); |
---|
| 173 | + tab0.add(row3); |
---|
| 174 | + tab0.add(row4); |
---|
| 175 | + tab0.add(row5); |
---|
| 176 | + tab0.add(row6); |
---|
| 177 | + |
---|
| 178 | + for (int i=5; --i>=0;) |
---|
| 179 | + { |
---|
| 180 | + //oe.toolboxPanel.Return(); |
---|
| 181 | + //tab0.add(new cGridBag()); |
---|
| 182 | + } |
---|
| 183 | + } |
---|
| 184 | + |
---|
| 185 | + public void AddSkyboxTab2(JTabbedPane skyboxpanel) |
---|
| 186 | + { |
---|
| 187 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 188 | + |
---|
| 189 | + tab0.setName("Night"); |
---|
| 190 | + skyboxpanel.add(tab0); |
---|
| 191 | + |
---|
| 192 | + cGridBag row0 = new cGridBag(); |
---|
| 193 | + cGridBag row1 = new cGridBag(); |
---|
| 194 | + cGridBag row2 = new cGridBag(); |
---|
| 195 | + cGridBag row3 = new cGridBag(); |
---|
| 196 | + cGridBag row4 = new cGridBag(); |
---|
| 197 | + cGridBag row5 = new cGridBag(); |
---|
| 198 | + cGridBag row6 = new cGridBag(); |
---|
| 199 | + |
---|
| 200 | + AddSkyboxButton("night", "NightPath", row0); |
---|
| 201 | + AddSkyboxButton("night", "PondNight", row0); |
---|
| 202 | + AddSkyboxButton("night", "Powerlines", row0); |
---|
| 203 | + AddSkyboxButton("night", "SwedishRoyalCastle", row0); |
---|
| 204 | + |
---|
| 205 | + AddSkyboxButton("urban", "CNTower", row1); |
---|
| 206 | + AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
| 207 | + AddSkyboxButton("rocky", "Riddarfjarden", row1); |
---|
| 208 | + AddSkyboxButton("penguins", "sleepyhollow", row1); |
---|
| 209 | + |
---|
| 210 | + AddSkyboxButton("penguins", "kenon_star", row2); |
---|
| 211 | + AddSkyboxButton("persson", "corona", row2); |
---|
| 212 | + AddSkyboxButton("persson", "spaceskybox", row2); |
---|
| 213 | + AddSkyboxButton("indoors", "Vasa", row2); |
---|
| 214 | + |
---|
| 215 | + AddSkyboxButton("winter", "Backyard", row3); |
---|
| 216 | + AddSkyboxButton("winter", "Creek", row3); |
---|
| 217 | + AddSkyboxButton("winter", "FootballField3", row3); |
---|
| 218 | + AddSkyboxButton("winter", "Forest", row3); |
---|
| 219 | + |
---|
| 220 | + AddSkyboxButton("winter", "HornstullsStrand2", row4); |
---|
| 221 | + AddSkyboxButton("winter", "House", row4); |
---|
| 222 | + AddSkyboxButton("winter", "IceLake", row4); |
---|
| 223 | + AddSkyboxButton("winter", "IceRiver", row4); |
---|
| 224 | + |
---|
| 225 | + AddSkyboxButton("winter", "Park3", row5); |
---|
| 226 | + AddSkyboxButton("winter", "PondWinter", row5); |
---|
| 227 | + AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
| 228 | + AddSkyboxButton("winter", "Vindelalven", row5); |
---|
| 229 | + |
---|
| 230 | + AddSkyboxButton("daz", "TheRock", row6); |
---|
| 231 | + AddSkyboxButton("daz", "TopOfTheWorld", row6); |
---|
| 232 | + AddSkyboxButton("daz", "Winter", row6); |
---|
| 233 | + AddSkyboxButton("mountain", "Ryfjallet", row6); |
---|
| 234 | + |
---|
| 235 | + tab0.add(row0); |
---|
| 236 | + tab0.add(row1); |
---|
| 237 | + tab0.add(row2); |
---|
| 238 | + tab0.add(row3); |
---|
| 239 | + tab0.add(row4); |
---|
| 240 | + tab0.add(row5); |
---|
| 241 | + tab0.add(row6); |
---|
| 242 | + |
---|
| 243 | + for (int i=5; --i>=0;) |
---|
| 244 | + { |
---|
| 245 | + //oe.toolboxPanel.Return(); |
---|
| 246 | + //tab0.add(new cGridBag()); |
---|
| 247 | + } |
---|
| 248 | + } |
---|
| 249 | + |
---|
| 250 | + public void AddSkyboxTab3(JTabbedPane skyboxpanel) |
---|
| 251 | + { |
---|
| 252 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 253 | + |
---|
| 254 | + tab0.setName("Others"); |
---|
| 255 | + skyboxpanel.add(tab0); |
---|
| 256 | + |
---|
| 257 | + cGridBag row0 = new cGridBag(); |
---|
| 258 | + cGridBag row1 = new cGridBag(); |
---|
| 259 | + cGridBag row2 = new cGridBag(); |
---|
| 260 | + cGridBag row3 = new cGridBag(); |
---|
| 261 | + cGridBag row4 = new cGridBag(); |
---|
| 262 | + cGridBag row5 = new cGridBag(); |
---|
| 263 | + cGridBag row6 = new cGridBag(); |
---|
| 264 | + |
---|
| 265 | + AddSkyboxButton("mayhem", "afterrain", row0); |
---|
| 266 | + AddSkyboxButton("mayhem", "aqua4", row0); |
---|
| 267 | + AddSkyboxButton("mayhem", "aqua9", row0); |
---|
| 268 | + AddSkyboxButton("mayhem", "flame", row0); |
---|
| 269 | + |
---|
| 270 | + AddSkyboxButton("mayhem", "h2s", row1); |
---|
| 271 | + AddSkyboxButton("mayhem", "prehistoric", row1); |
---|
| 272 | + AddSkyboxButton("mayhem", "scorched", row1); |
---|
| 273 | + AddSkyboxButton("penguins", "desertdawn", row1); |
---|
| 274 | + |
---|
| 275 | + AddSkyboxButton("persson", "Citadella", row2); |
---|
| 276 | + AddSkyboxButton("persson", "Citadella2", row2); |
---|
| 277 | + AddSkyboxButton("persson", "clouds1", row2); |
---|
| 278 | + AddSkyboxButton("penguins", "wrath", row2); |
---|
| 279 | + |
---|
| 280 | + AddSkyboxButton("persson", "FishermansBastion", row3); |
---|
| 281 | + AddSkyboxButton("persson", "HeroesSquare", row3); |
---|
| 282 | + AddSkyboxButton("indoors", "DallasW", row3); |
---|
| 283 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row3); |
---|
| 284 | + |
---|
| 285 | + AddSkyboxButton("persson", "LancellottiChapel", row4); |
---|
| 286 | + AddSkyboxButton("persson", "PereaBeach1", row4); |
---|
| 287 | + AddSkyboxButton("persson", "PereaBeach2", row4); |
---|
| 288 | + AddSkyboxButton("persson", "redeclipse", row4); |
---|
| 289 | + |
---|
| 290 | + AddSkyboxButton("daz", "Greenlands", row5); |
---|
| 291 | + AddSkyboxButton("daz", "Oasis", row5); |
---|
| 292 | + AddSkyboxButton("elyvisions", "arch3", row5); |
---|
| 293 | + AddSkyboxButton("elyvisions", "calm_sea", row5); |
---|
| 294 | + |
---|
| 295 | + AddSkyboxButton("elyvisions", "rainbow", row6); |
---|
| 296 | + AddSkyboxButton("elyvisions", "distant_sunset", row6); |
---|
| 297 | + AddSkyboxButton("elyvisions", "heaven", row6); |
---|
| 298 | + AddSkyboxButton("elyvisions", "hot", row6); |
---|
| 299 | + |
---|
| 300 | + tab0.add(row0); |
---|
| 301 | + tab0.add(row1); |
---|
| 302 | + tab0.add(row2); |
---|
| 303 | + tab0.add(row3); |
---|
| 304 | + tab0.add(row4); |
---|
| 305 | + tab0.add(row5); |
---|
| 306 | + tab0.add(row6); |
---|
| 307 | + |
---|
| 308 | + for (int i=5; --i>=0;) |
---|
| 309 | + { |
---|
| 310 | + //oe.toolboxPanel.Return(); |
---|
| 311 | + //tab0.add(new cGridBag()); |
---|
| 312 | + } |
---|
| 313 | + } |
---|
| 314 | + |
---|
| 315 | + public void CallBack(String[] path) |
---|
| 316 | + { |
---|
| 317 | + for (int i = 0; i < path.length; i++) |
---|
| 318 | + { |
---|
| 319 | + System.out.print(path[i] + "/"); |
---|
| 320 | + } |
---|
| 321 | + |
---|
| 322 | + System.out.println(); |
---|
| 323 | + } |
---|
| 324 | + |
---|
| 325 | + public void ChangeSkybox(String skybox) |
---|
| 326 | + { |
---|
| 327 | + //cameraView.envyoff = false; |
---|
| 328 | + group.skyboxname = skybox; |
---|
| 329 | + group.skyboxext = "jpg"; |
---|
| 330 | + cameraView.repaint(); |
---|
| 331 | + |
---|
| 332 | + Grafreed.ParseResources("textures", this); |
---|
| 333 | + } |
---|
| 334 | + |
---|
25 | 335 | //ObjEditor objEditor; |
---|
26 | 336 | public void closeUI2() |
---|
27 | 337 | { |
---|
.. | .. |
---|
59 | 369 | this.copy = this.group = group; |
---|
60 | 370 | //selectees = this.group.selectees; |
---|
61 | 371 | |
---|
| 372 | + if (copy.versionlist == null) |
---|
| 373 | + { |
---|
| 374 | + copy.versionlist = new Object3D[100]; |
---|
| 375 | + copy.versionindex = -1; |
---|
| 376 | + } |
---|
| 377 | + |
---|
62 | 378 | if(ui) |
---|
63 | 379 | SetupUI(objEditor); |
---|
64 | 380 | } |
---|
.. | .. |
---|
73 | 389 | this.copy = this.group = copy; |
---|
74 | 390 | //selectees = this.group.selectees; |
---|
75 | 391 | |
---|
76 | | - SetupMenu2(objEditor); |
---|
| 392 | + SetupMenu2(this); //objEditor); |
---|
77 | 393 | SetupUI2(objEditor); |
---|
78 | 394 | objEditor.SetupUI(true); |
---|
79 | 395 | SetupViews(objEditor); |
---|
80 | 396 | |
---|
81 | 397 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 398 | + |
---|
| 399 | + if (copy.versionlist == null) |
---|
| 400 | + { |
---|
| 401 | + copy.versionlist = new Object3D[100]; |
---|
| 402 | + copy.versionindex = -1; |
---|
| 403 | + |
---|
| 404 | + Save(true); |
---|
| 405 | + } |
---|
82 | 406 | } |
---|
83 | 407 | |
---|
84 | 408 | void CloneSelection(boolean supports) |
---|
85 | 409 | { |
---|
| 410 | + if (Globals.REPLACEONMAKE) |
---|
| 411 | + Save(); |
---|
| 412 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 413 | + Globals.REPLACEONMAKE = false; |
---|
86 | 414 | // Object3D keep = GrafreeD.clipboard; |
---|
87 | 415 | //Object3D obj; |
---|
88 | 416 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
93 | 421 | |
---|
94 | 422 | makeSomething(clone, i==group.selection.size()-1); |
---|
95 | 423 | } |
---|
| 424 | + Globals.REPLACEONMAKE = keep; |
---|
96 | 425 | } |
---|
97 | 426 | |
---|
98 | 427 | void CloneClipboard(boolean supports) |
---|
99 | 428 | { |
---|
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)); |
---|
| 429 | + assert(Grafreed.clipboard.parent == null); |
---|
| 430 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 431 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 432 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 433 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
105 | 434 | else |
---|
106 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
107 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 435 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 436 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 437 | } |
---|
109 | 438 | |
---|
110 | 439 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 447 | // obj.support = null; |
---|
119 | 448 | if (!supports) |
---|
120 | 449 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 450 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 451 | obj.parent = parent; |
---|
123 | 452 | // obj.support = support; |
---|
124 | 453 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
147 | 476 | |
---|
148 | 477 | //JTextField nameField; |
---|
149 | 478 | |
---|
150 | | - void SetupMenu2(ObjEditor oe) |
---|
| 479 | + void SetupMenu2(GroupEditor oe) |
---|
151 | 480 | { |
---|
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); |
---|
| 481 | + oe.jTree = new cTree(); |
---|
| 482 | + |
---|
163 | 483 | Menu menu; |
---|
164 | 484 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | 485 | //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | 486 | //editItem.addActionListener(this); |
---|
167 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 487 | + |
---|
| 488 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 489 | +// undoItem.addActionListener(this); |
---|
| 490 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 491 | +// redoItem.addActionListener(this); |
---|
| 492 | +// menu.add("-"); |
---|
| 493 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
168 | 494 | duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | 495 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | 496 | cloneItem.addActionListener(this); |
---|
| 497 | + if (Globals.ADVANCED) |
---|
| 498 | + { |
---|
172 | 499 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | 500 | cloneSupportItem.addActionListener(this); |
---|
| 501 | + } |
---|
174 | 502 | menu.add("-"); |
---|
175 | 503 | cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | 504 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
178 | 506 | copyItem.addActionListener(this); |
---|
179 | 507 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | 508 | pasteItem.addActionListener(this); |
---|
| 509 | + |
---|
| 510 | + menu.add("-"); |
---|
| 511 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 512 | + pasteIntoItem.addActionListener(this); |
---|
181 | 513 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | 514 | pasteLinkItem.addActionListener(this); |
---|
183 | 515 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | 516 | pasteCloneItem.addActionListener(this); |
---|
185 | 517 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | 518 | // pasteExpandItem.addActionListener(this); |
---|
187 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | | - clearItem.addActionListener(this); |
---|
| 519 | + menu.add("-"); |
---|
| 520 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 521 | + deleteItem.addActionListener(this); |
---|
| 522 | + |
---|
| 523 | + if (Globals.ADVANCED) |
---|
| 524 | + { |
---|
| 525 | + // Deletes the cameras... |
---|
189 | 526 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | 527 | clearAllItem.addActionListener(this); |
---|
| 528 | + } |
---|
| 529 | + |
---|
| 530 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 531 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 532 | + //zBufferItem.addActionListener(this); |
---|
| 533 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 534 | + //normalLensItem.addActionListener(this); |
---|
| 535 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 536 | + restoreCameraItem.addActionListener(this); |
---|
| 537 | + |
---|
| 538 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 539 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 540 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 541 | +// cameraMenu.add("-"); |
---|
| 542 | +// |
---|
| 543 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 544 | +// toggleTextureItem.addItemListener(this); |
---|
| 545 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 546 | +// |
---|
| 547 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 548 | +// toggleSwitchItem.addItemListener(this); |
---|
| 549 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 550 | + |
---|
| 551 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 552 | + toggleHandleItem.addItemListener(this); |
---|
| 553 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 554 | + |
---|
| 555 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 556 | + togglePaintItem.addItemListener(this); |
---|
| 557 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 558 | + |
---|
| 559 | + if (Globals.ADVANCED) |
---|
| 560 | + { |
---|
| 561 | + cameraMenu.add("-"); |
---|
| 562 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 563 | + toggleLiveItem.addItemListener(this); |
---|
| 564 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
191 | 565 | |
---|
| 566 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 567 | + stepItem.addActionListener(this); |
---|
| 568 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 569 | + // toggleDLItem.addItemListener(this); |
---|
| 570 | + // toggleDLItem.setState(false); |
---|
| 571 | + |
---|
| 572 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 573 | + toggleRenderItem.addItemListener(this); |
---|
| 574 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 575 | + |
---|
| 576 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 577 | + toggleDebugItem.addItemListener(this); |
---|
| 578 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 579 | + |
---|
| 580 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 581 | + toggleFrustumItem.addItemListener(this); |
---|
| 582 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 583 | + |
---|
| 584 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 585 | + toggleFootContactItem.addItemListener(this); |
---|
| 586 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 587 | + |
---|
| 588 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 589 | + toggleTimelineItem.addItemListener(this); |
---|
| 590 | + } |
---|
| 591 | + |
---|
| 592 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 593 | +// toggleRootItem.addItemListener(this); |
---|
| 594 | +// toggleRootItem.setState(false); |
---|
| 595 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 596 | +// animationItem.addItemListener(this); |
---|
| 597 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 598 | + cameraMenu.add("-"); |
---|
| 599 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 600 | + editCameraItem.addActionListener(this); |
---|
| 601 | + |
---|
| 602 | + if (Globals.ADVANCED) |
---|
| 603 | + { |
---|
| 604 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 605 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 606 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 607 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 608 | + oe.cameraMenu.add("-"); |
---|
| 609 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 610 | + openWindowItem.addActionListener(this); |
---|
| 611 | + editLeafItem.addActionListener(this); |
---|
| 612 | + lookAtItem.addActionListener(this); |
---|
| 613 | + //lookFromItem.addActinoListener(this); |
---|
| 614 | + //switchViewItem.addActionListener(this); |
---|
| 615 | + } |
---|
| 616 | + |
---|
192 | 617 | 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); |
---|
| 618 | + if (Globals.ADVANCED) |
---|
| 619 | + { |
---|
197 | 620 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 621 | revertMeshItem.addActionListener(this); |
---|
199 | 622 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 623 | resetreferencesItem.addActionListener(this); |
---|
201 | 624 | menu.add("-"); |
---|
| 625 | + } |
---|
202 | 626 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 627 | overwriteGeoItem.addActionListener(this); |
---|
204 | 628 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 634 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 635 | overwriteUVItem.addActionListener(this); |
---|
212 | 636 | menu.add("-"); |
---|
| 637 | + if (Globals.ADVANCED) |
---|
| 638 | + { |
---|
213 | 639 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 640 | generateMeshItem.addActionListener(this); |
---|
215 | 641 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 642 | poseMeshItem.addActionListener(this); |
---|
217 | 643 | menu.add("-"); |
---|
| 644 | + } |
---|
218 | 645 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 646 | resetsupportItem.addActionListener(this); |
---|
220 | 647 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 648 | linkverticesItem.addActionListener(this); |
---|
| 649 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 650 | + relinkverticesItem.addActionListener(this); |
---|
| 651 | + |
---|
| 652 | + if (Globals.ADVANCED) |
---|
| 653 | + { |
---|
222 | 654 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
223 | 655 | setMasterItem.addActionListener(this); |
---|
| 656 | + } |
---|
224 | 657 | |
---|
225 | 658 | oe.menuBar.add(menu = new Menu("Group")); |
---|
226 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
227 | | - grabItem.addActionListener(this); |
---|
| 659 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 660 | +// grabItem.addActionListener(this); |
---|
228 | 661 | backItem = menu.add(new MenuItem("Back")); |
---|
229 | 662 | backItem.addActionListener(this); |
---|
230 | 663 | frontItem = menu.add(new MenuItem("Front")); |
---|
231 | 664 | frontItem.addActionListener(this); |
---|
232 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
233 | | - compositeItem.addActionListener(this); |
---|
234 | | - menu.add("-"); |
---|
235 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
236 | | - randomItem.addActionListener(this); |
---|
237 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
238 | | - physicsItem.addActionListener(this); |
---|
239 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
240 | | - frameselectorItem.addActionListener(this); |
---|
| 665 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 666 | +// compositeItem.addActionListener(this); |
---|
| 667 | + |
---|
| 668 | + if (Globals.ADVANCED) |
---|
| 669 | + { |
---|
| 670 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
| 671 | + hideItem.addActionListener(this); |
---|
| 672 | + } |
---|
| 673 | + ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
| 674 | + ungroupItem.addActionListener(this); |
---|
| 675 | + |
---|
| 676 | +// menu.add("-"); |
---|
| 677 | +// |
---|
| 678 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 679 | +// switchItem.addActionListener(this); |
---|
| 680 | + if (Globals.ADVANCED) |
---|
| 681 | + { |
---|
241 | 682 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
242 | 683 | switchGeoItem.addActionListener(this); |
---|
243 | 684 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
244 | 685 | switchTransfoItem.addActionListener(this); |
---|
245 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 686 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
246 | 687 | morphItem.addActionListener(this); |
---|
| 688 | + |
---|
| 689 | + menu.add("-"); |
---|
| 690 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 691 | + physicsItem.addActionListener(this); |
---|
| 692 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 693 | + frameselectorItem.addActionListener(this); |
---|
247 | 694 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
248 | 695 | scriptNodeItem.addActionListener(this); |
---|
249 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
250 | | - cameraItem.addActionListener(this); |
---|
| 696 | + } |
---|
251 | 697 | |
---|
252 | 698 | oe.menuBar.add(menu = new Menu("Object")); |
---|
253 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
254 | | - textureItem.addActionListener(this); |
---|
| 699 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 700 | +// textureItem.addActionListener(this); |
---|
| 701 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 702 | + billboardItem.addActionListener(this); |
---|
255 | 703 | csgItem = menu.add(new MenuItem("CSG")); |
---|
256 | 704 | csgItem.addActionListener(this); |
---|
257 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 705 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
258 | 706 | shadowXItem.addActionListener(this); |
---|
259 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 707 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
260 | 708 | shadowYItem.addActionListener(this); |
---|
261 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 709 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
262 | 710 | shadowZItem.addActionListener(this); |
---|
| 711 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 712 | + attributeItem.addActionListener(this); |
---|
| 713 | + |
---|
| 714 | + if (Globals.ADVANCED) |
---|
| 715 | + { |
---|
| 716 | + menu.add("-"); |
---|
263 | 717 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
264 | 718 | linkerItem.addActionListener(this); |
---|
265 | 719 | templateItem = menu.add(new MenuItem("Template")); |
---|
266 | 720 | templateItem.addActionListener(this); |
---|
267 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
268 | | - attributeItem.addActionListener(this); |
---|
269 | 721 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
270 | 722 | pointflowItem.addActionListener(this); |
---|
| 723 | + } |
---|
271 | 724 | menu.add("-"); |
---|
272 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
273 | | - transformgeometryItem.addActionListener(this); |
---|
274 | 725 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
275 | 726 | resetTransformItem.addActionListener(this); |
---|
276 | 727 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
277 | 728 | resetCentroidItem.addActionListener(this); |
---|
278 | | - ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
279 | | - ungroupItem.addActionListener(this); |
---|
| 729 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 730 | + resetCentroidXZItem.addActionListener(this); |
---|
| 731 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 732 | + transformGeometryItem.addActionListener(this); |
---|
| 733 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 734 | + transformChildrenItem.addActionListener(this); |
---|
280 | 735 | |
---|
281 | 736 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
282 | 737 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
285 | 740 | genNormalsORGANItem.addActionListener(this); |
---|
286 | 741 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
287 | 742 | genNormalsCADItem.addActionListener(this); |
---|
| 743 | + genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
| 744 | + genNormalsMESHItem.addActionListener(this); |
---|
| 745 | + if (Globals.ADVANCED) |
---|
| 746 | + { |
---|
| 747 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
| 748 | + genNormalsMINEItem.addActionListener(this); |
---|
| 749 | + } |
---|
288 | 750 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
289 | 751 | stripifyItem.addActionListener(this); |
---|
290 | 752 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
306 | 768 | reduce34MeshItem.addActionListener(this); |
---|
307 | 769 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
308 | 770 | increaseMeshItem.addActionListener(this); |
---|
309 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
310 | | - smoothMeshItem.addActionListener(this); |
---|
311 | 771 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
312 | 772 | clipMeshItem.addActionListener(this); |
---|
| 773 | + |
---|
| 774 | + if (Globals.ADVANCED) |
---|
| 775 | + { |
---|
| 776 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 777 | + smoothMeshItem.addActionListener(this); |
---|
| 778 | + } |
---|
313 | 779 | |
---|
314 | 780 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
315 | 781 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
316 | 782 | clearMaterialsItem.addActionListener(this); |
---|
| 783 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 784 | + resetAllItem.addActionListener(this); |
---|
| 785 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 786 | + stepAllItem.addActionListener(this); |
---|
317 | 787 | menu.add("-"); |
---|
318 | 788 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
319 | 789 | liveleavesItem.addActionListener(this); |
---|
320 | 790 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
321 | 791 | unliveleavesItem.addActionListener(this); |
---|
| 792 | + if (Globals.ADVANCED) |
---|
| 793 | + { |
---|
322 | 794 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
323 | 795 | supportleavesItem.addActionListener(this); |
---|
324 | 796 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
325 | 797 | unsupportleavesItem.addActionListener(this); |
---|
| 798 | + } |
---|
326 | 799 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
327 | 800 | hideleavesItem.addActionListener(this); |
---|
328 | 801 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
331 | 804 | markleavesItem.addActionListener(this); |
---|
332 | 805 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
333 | 806 | unmarkleavesItem.addActionListener(this); |
---|
| 807 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 808 | + rewindleavesItem.addActionListener(this); |
---|
| 809 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 810 | + unrewindleavesItem.addActionListener(this); |
---|
| 811 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 812 | + randomleavesItem.addActionListener(this); |
---|
| 813 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 814 | + unrandomleavesItem.addActionListener(this); |
---|
334 | 815 | menu.add("-"); |
---|
335 | 816 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
336 | 817 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
356 | 837 | attachBumpItem.addActionListener(this); |
---|
357 | 838 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
358 | 839 | pigmentBumpItem.addActionListener(this); |
---|
| 840 | + //embedTexturesItem |
---|
359 | 841 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
360 | 842 | detachPigmentItem.addActionListener(this); |
---|
361 | 843 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
362 | 844 | detachBumpItem.addActionListener(this); |
---|
| 845 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 846 | + embedTexturesItem.addActionListener(this); |
---|
| 847 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 848 | + deEmbedTexturesItem.addActionListener(this); |
---|
363 | 849 | menu.add("-"); |
---|
364 | 850 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
365 | 851 | sortbysizeItem.addActionListener(this); |
---|
366 | 852 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
367 | 853 | sortbynameItem.addActionListener(this); |
---|
368 | 854 | menu.add("-"); |
---|
| 855 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 856 | + shareGeometriesItem.addActionListener(this); |
---|
| 857 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 858 | + mergeGeometriesItem.addActionListener(this); |
---|
| 859 | + if (Globals.ADVANCED) |
---|
| 860 | + { |
---|
| 861 | + // Pretty much the same as duplicate and clone. |
---|
369 | 862 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
370 | 863 | extractGeometriesItem.addActionListener(this); |
---|
371 | 864 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
372 | 865 | cloneGeometriesItem.addActionListener(this); |
---|
373 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
374 | | - shareGeometriesItem.addActionListener(this); |
---|
375 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
376 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 866 | + } |
---|
377 | 867 | |
---|
378 | 868 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
379 | 869 | buildCreateMenu(menu); |
---|
380 | 870 | |
---|
381 | | - |
---|
382 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
383 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
384 | | - importGFDItem.addActionListener(this); |
---|
385 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
386 | | - importVRMLX3DItem.addActionListener(this); |
---|
387 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
388 | | - importOBJItem.addActionListener(this); |
---|
389 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
390 | | - import3DSItem.addActionListener(this); |
---|
391 | | - |
---|
392 | 871 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
393 | 872 | buildToolsMenu(menu); |
---|
394 | 873 | } |
---|
395 | 874 | |
---|
| 875 | + |
---|
396 | 876 | void SetupUI2(ObjEditor oe) |
---|
397 | 877 | { |
---|
| 878 | + // June 2019 |
---|
| 879 | + if (oe == null) |
---|
| 880 | + { |
---|
| 881 | + //super.SetupUI2(this); |
---|
| 882 | + //return; |
---|
| 883 | + } |
---|
| 884 | + |
---|
| 885 | + if (copy != group) |
---|
| 886 | + { |
---|
| 887 | + //super.SetupUI2(this); |
---|
| 888 | + } |
---|
| 889 | + |
---|
398 | 890 | //new Exception().printStackTrace(); |
---|
399 | 891 | |
---|
400 | 892 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
423 | 915 | oe.radioPanel.add(dummyButton); |
---|
424 | 916 | oe.buttonGroup.add(dummyButton); |
---|
425 | 917 | */ |
---|
426 | | - aConstraints.gridy += 1; |
---|
427 | | - oe.aConstraints.gridwidth = 1; |
---|
428 | | - oe.aConstraints.gridx = 0; |
---|
| 918 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 919 | + |
---|
| 920 | + copyOptionsPanel.preferredHeight = 2; |
---|
429 | 921 | |
---|
430 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints); |
---|
| 922 | + //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
| 923 | + |
---|
| 924 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 925 | + //minButton.setToolTipText("Minimize window"); |
---|
| 926 | + //minButton.addActionListener(this); |
---|
| 927 | + |
---|
| 928 | + if (Globals.ADVANCED) |
---|
| 929 | + { |
---|
| 930 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 931 | + maxButton.setToolTipText("Maximize window"); |
---|
| 932 | + maxButton.addActionListener(this); |
---|
| 933 | + } |
---|
| 934 | + |
---|
| 935 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 936 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 937 | + fullButton.addActionListener(this); |
---|
| 938 | + |
---|
| 939 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 940 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 941 | + screenfitButton.addActionListener(this); |
---|
| 942 | + |
---|
| 943 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 944 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 945 | + restoreCameraButton.addActionListener(this); |
---|
| 946 | + |
---|
| 947 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 948 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 949 | + saveVersionButton.addActionListener(this); |
---|
| 950 | + |
---|
| 951 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 952 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 953 | + deleteVersionButton.addActionListener(this); |
---|
| 954 | + |
---|
| 955 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 956 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 957 | + previousVersionButton.addActionListener(this); |
---|
| 958 | + previousVersionButton.setEnabled(false); |
---|
| 959 | + |
---|
| 960 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 961 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 962 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
| 963 | + restoreButton.addActionListener(this); |
---|
| 964 | + //restoreButton.setEnabled(false); |
---|
| 965 | + |
---|
| 966 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 967 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
| 968 | + replaceButton.addActionListener(this); |
---|
| 969 | + //replaceButton.setEnabled(false); |
---|
| 970 | + |
---|
| 971 | + copyOptionsPanel.add(updown); |
---|
| 972 | + |
---|
| 973 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 974 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 975 | + nextVersionButton.addActionListener(this); |
---|
| 976 | + nextVersionButton.setEnabled(false); |
---|
| 977 | + |
---|
| 978 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 979 | + liveCB.setToolTipText("Enable animation"); |
---|
431 | 980 | liveCB.addItemListener(this); |
---|
432 | 981 | |
---|
433 | | - oe.aConstraints.gridx += 1; |
---|
434 | | - oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints); |
---|
435 | | - supportCB.addItemListener(this); |
---|
436 | | - |
---|
437 | | - // oe.aConstraints.gridx += 1; |
---|
438 | | - // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints); |
---|
439 | | - // localCB.addItemListener(this); |
---|
440 | | - |
---|
441 | | - oe.aConstraints.gridx += 1; |
---|
442 | | - oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints); |
---|
443 | | - crowdCB.addItemListener(this); |
---|
444 | | - |
---|
445 | | - oe.aConstraints.gridx += 1; |
---|
446 | | - oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints); |
---|
447 | | - smoothCB.addItemListener(this); |
---|
448 | | - |
---|
449 | | - oe.aConstraints.gridx += 1; |
---|
450 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints); |
---|
| 982 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 983 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 984 | + oneStepButton.addActionListener(this); |
---|
| 985 | + |
---|
| 986 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 987 | + fastCB.setToolTipText("Fast mode"); |
---|
451 | 988 | fastCB.addItemListener(this); |
---|
452 | | - oe.aConstraints.gridx += 1; |
---|
453 | | - oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints); |
---|
454 | | - slowCB.addItemListener(this); |
---|
455 | | - oe.aConstraints.gridx += 1; |
---|
456 | | - oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints); |
---|
457 | | - boxCB.addItemListener(this); |
---|
| 989 | + |
---|
| 990 | + //oe.toolboxPanel.Return(); |
---|
| 991 | + |
---|
| 992 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 993 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 994 | +// trackCB.addItemListener(this); |
---|
458 | 995 | |
---|
459 | | -// oe.aConstraints.gridx += 1; |
---|
460 | | -// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints); |
---|
461 | | -// speakerMocapCB.addItemListener(this); |
---|
462 | | - |
---|
463 | | - if (false) |
---|
464 | | - { |
---|
465 | | - // handled in scripts |
---|
466 | | - oe.aConstraints.gridx += 1; |
---|
467 | | - oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints); |
---|
468 | | - speakerCameraCB.addItemListener(this); |
---|
469 | | - |
---|
470 | | - oe.aConstraints.gridx += 1; |
---|
471 | | - oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints); |
---|
472 | | - speakerFocusCB.addItemListener(this); |
---|
473 | | - |
---|
474 | | - oe.aConstraints.gridx += 1; |
---|
475 | | - oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints); |
---|
476 | | - smoothfocusCB.addItemListener(this); |
---|
477 | | - } |
---|
478 | | - |
---|
479 | | -//oe.aConstraints.gridx += 1; |
---|
480 | | -//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints); |
---|
481 | | -// debugCB.addItemListener(this); |
---|
482 | | - |
---|
483 | | - oe.aConstraints.gridx += 1; |
---|
484 | | - oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints); |
---|
485 | | - oeilCB.addItemListener(this); |
---|
486 | | - |
---|
487 | | - oe.aConstraints.gridx += 1; |
---|
488 | | - oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints); |
---|
489 | | - lookAtCB.addItemListener(this); |
---|
490 | | - |
---|
491 | | - oe.aConstraints.gridx += 1; |
---|
492 | | - oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints); |
---|
493 | | - trackCB.addItemListener(this); |
---|
494 | | - |
---|
495 | | - oe.aConstraints.gridx += 1; |
---|
496 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
497 | | - screenfitButton.addActionListener(this); |
---|
498 | | - oe.aConstraints.gridx += 1; |
---|
499 | 996 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
500 | 997 | // screenfitpointButton.addActionListener(this); |
---|
501 | | -// oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
503 | | - snapobjectButton.addActionListener(this); |
---|
504 | | - oe.aConstraints.gridx += 1; |
---|
505 | 998 | |
---|
506 | | - //aConstraints.gridx = 0; |
---|
507 | | - //aConstraints.gridy += 1; |
---|
508 | | - oe.aConstraints.weighty = 0; |
---|
509 | | - oe.aConstraints.gridwidth = 1; |
---|
510 | | - |
---|
511 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
512 | | - flashSelectionButton.addActionListener(this); |
---|
513 | | - oe.aConstraints.gridx += 1; |
---|
514 | | - oe.aConstraints.weighty = 0; |
---|
515 | | - oe.aConstraints.gridwidth = 1; |
---|
516 | | - |
---|
517 | | - // |
---|
518 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
519 | | - twoButton.addActionListener(this); |
---|
520 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 999 | + if (Globals.ADVANCED) |
---|
| 1000 | + { |
---|
| 1001 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1002 | + snapobjectButton.addActionListener(this); |
---|
| 1003 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 1004 | + |
---|
| 1005 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | 1006 | fourButton.addActionListener(this); |
---|
522 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
523 | | - sixButton.addActionListener(this); |
---|
524 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
| 1007 | + fourButton.setToolTipText("Show control panel only"); |
---|
| 1008 | + } |
---|
| 1009 | + |
---|
| 1010 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 1011 | + |
---|
| 1012 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1013 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1014 | + twoButton.addActionListener(this); |
---|
| 1015 | + this.fullscreenLayout = twoButton; |
---|
| 1016 | + |
---|
| 1017 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1018 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
525 | 1019 | threeButton.addActionListener(this); |
---|
526 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
527 | | - sevenButton.addActionListener(this); |
---|
| 1020 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1021 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1022 | + sixButton.addActionListener(this); |
---|
| 1023 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1024 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1025 | +// sevenButton.addActionListener(this); |
---|
528 | 1026 | // |
---|
529 | 1027 | |
---|
530 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints); |
---|
| 1028 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1029 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
531 | 1030 | rootButton.addActionListener(this); |
---|
532 | | - oe.aConstraints.gridx += 1; |
---|
533 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 1031 | + |
---|
| 1032 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1033 | + closeButton.setToolTipText("Close tab"); |
---|
534 | 1034 | closeButton.addActionListener(this); |
---|
535 | 1035 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
536 | 1036 | //clearButton.addActionListener(this); |
---|
537 | | - oe.aConstraints.gridx += 1; |
---|
538 | | - |
---|
539 | | - oe.aConstraints.gridx = 1; // |
---|
540 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
541 | | - editButton.addActionListener(this); |
---|
542 | | - oe.aConstraints.gridx += 1; |
---|
543 | | - oe.aConstraints.weighty = 0; |
---|
544 | | - oe.aConstraints.gridwidth = 1; |
---|
545 | 1037 | |
---|
546 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 1038 | + cGridBag row1 = new cGridBag(); |
---|
| 1039 | + |
---|
| 1040 | + // INSERT |
---|
| 1041 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1042 | + gridButton.setToolTipText("Create grid"); |
---|
| 1043 | + gridButton.addActionListener(this); |
---|
| 1044 | + |
---|
| 1045 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1046 | + boxButton.setToolTipText("Create box"); |
---|
| 1047 | + boxButton.addActionListener(this); |
---|
| 1048 | + |
---|
| 1049 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1050 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1051 | + sphereButton.addActionListener(this); |
---|
| 1052 | + |
---|
| 1053 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1054 | + coneButton.setToolTipText("Create cone"); |
---|
| 1055 | + coneButton.addActionListener(this); |
---|
| 1056 | + |
---|
| 1057 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1058 | + torusButton.setToolTipText("Create torus"); |
---|
| 1059 | + torusButton.addActionListener(this); |
---|
| 1060 | + |
---|
| 1061 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1062 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1063 | + superButton.addActionListener(this); |
---|
| 1064 | + |
---|
| 1065 | + if (Globals.ADVANCED) |
---|
| 1066 | + { |
---|
| 1067 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 1069 | + kleinButton.addActionListener(this); |
---|
| 1070 | + } |
---|
| 1071 | + |
---|
| 1072 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1073 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 1074 | + particlesButton.addActionListener(this); |
---|
| 1075 | + |
---|
| 1076 | + oe.toolboxPanel.add(row1); |
---|
| 1077 | + |
---|
| 1078 | + cGridBag row2 = new cGridBag(); |
---|
| 1079 | + |
---|
| 1080 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1081 | + groupButton.setToolTipText("Create group"); |
---|
| 1082 | + groupButton.addActionListener(this); |
---|
| 1083 | + |
---|
| 1084 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1085 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1086 | + compositeButton.addActionListener(this); |
---|
| 1087 | + |
---|
| 1088 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1089 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1090 | + switchButton.addActionListener(this); |
---|
| 1091 | + |
---|
| 1092 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1093 | + loopButton.setToolTipText("Create loop"); |
---|
| 1094 | + loopButton.addActionListener(this); |
---|
| 1095 | + |
---|
| 1096 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1097 | + textureButton.setToolTipText("Create texture"); |
---|
| 1098 | + textureButton.addActionListener(this); |
---|
| 1099 | + |
---|
| 1100 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1101 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1102 | + overlayButton.addActionListener(this); |
---|
| 1103 | + |
---|
| 1104 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1105 | + lightButton.setToolTipText("Create light"); |
---|
| 1106 | + lightButton.addActionListener(this); |
---|
| 1107 | + |
---|
| 1108 | + oe.toolboxPanel.add(row2); |
---|
| 1109 | + |
---|
| 1110 | + // ENVYMAPS |
---|
| 1111 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1112 | + skyboxpane.preferredHeight = 100; |
---|
| 1113 | + |
---|
| 1114 | + oe.toolboxPanel.add(skyboxpane); |
---|
| 1115 | + |
---|
| 1116 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1117 | + skyboxpane.add(skyboxpanel); |
---|
| 1118 | + |
---|
| 1119 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1120 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1121 | + AddSkyboxTab2(skyboxpanel); |
---|
| 1122 | + AddSkyboxTab3(skyboxpanel); |
---|
| 1123 | + |
---|
| 1124 | + // EDIT panel |
---|
| 1125 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1126 | + editButton.setToolTipText("Pin selection controls"); |
---|
| 1127 | + editButton.addActionListener(this); |
---|
| 1128 | + |
---|
| 1129 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1130 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
547 | 1131 | uneditButton.addActionListener(this); |
---|
548 | 1132 | |
---|
549 | | - oe.aConstraints.gridx += 1; |
---|
550 | | - oe.aConstraints.weighty = 0; |
---|
551 | | - oe.aConstraints.gridwidth = 1; |
---|
552 | | - |
---|
553 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
554 | | - clearPanelButton.addActionListener(this); |
---|
555 | | - |
---|
556 | | - oe.aConstraints.gridx += 1; |
---|
557 | | - oe.aConstraints.weighty = 0; |
---|
558 | | - oe.aConstraints.gridwidth = 1; |
---|
559 | | - |
---|
560 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 1133 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 1134 | + allParamsButton.setToolTipText("Show all controle"); |
---|
561 | 1135 | allParamsButton.addActionListener(this); |
---|
562 | 1136 | |
---|
563 | | - oe.aConstraints.gridx += 1; |
---|
564 | | - oe.aConstraints.weighty = 0; |
---|
565 | | - oe.aConstraints.gridwidth = 1; |
---|
566 | | - |
---|
567 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 1137 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1138 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1139 | + clearPanelButton.addActionListener(this); |
---|
| 1140 | + |
---|
| 1141 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1142 | + unselectButton.setToolTipText("Unselect"); |
---|
568 | 1143 | unselectButton.addActionListener(this); |
---|
569 | 1144 | |
---|
| 1145 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1146 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1147 | + flashSelectionButton.addActionListener(this); |
---|
| 1148 | + |
---|
| 1149 | + editCommandsPanel.preferredHeight = 1; |
---|
| 1150 | + |
---|
| 1151 | + SetPinStates(false); |
---|
| 1152 | +// oe.treePanel.add(commandsPanel); |
---|
| 1153 | +// oe.treePanel.Return(); |
---|
| 1154 | + |
---|
570 | 1155 | // oe.aConstraints.gridx += 1; |
---|
571 | 1156 | // oe.aConstraints.weighty = 0; |
---|
572 | 1157 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
578 | 1163 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
579 | 1164 | // gcButton.addActionListener(this); |
---|
580 | 1165 | |
---|
581 | | - oe.aConstraints.gridx = 0; |
---|
582 | | - oe.aConstraints.gridy += 1; |
---|
583 | | - |
---|
584 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
585 | | - oe.aConstraints.gridwidth = 100; |
---|
586 | | - // oe.aConstraints.gridheight = 100; |
---|
587 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
588 | | - oe.aConstraints.gridheight = 1; |
---|
589 | | - oe.aConstraints.weighty = 0.5; |
---|
590 | | - oe.aConstraints.gridx = 0; |
---|
591 | | - JScrollPane jSP; |
---|
| 1166 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 1167 | + |
---|
| 1168 | + JScrollPane jSP; |
---|
592 | 1169 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
593 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 1170 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
594 | 1171 | ResetModel(); |
---|
595 | | - oe.aConstraints.weighty = 0.5; |
---|
596 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
597 | | - oe.aConstraints.gridy += 1; |
---|
598 | | - oe.aConstraints.gridwidth = 1; |
---|
599 | | - |
---|
600 | | - oe.aConstraints.weighty = 0; |
---|
601 | | - oe.aConstraints.gridwidth = 2; |
---|
602 | | - |
---|
603 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
604 | | - colorCB.addItemListener(this); |
---|
605 | | - oe.aConstraints.gridx += 2; |
---|
606 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
607 | | - materialCB.addItemListener(this); |
---|
608 | | - oe.aConstraints.gridx += 2; |
---|
609 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
610 | | - textureCB.addItemListener(this); |
---|
611 | | - |
---|
612 | | - oe.aConstraints.gridx = 0; |
---|
613 | | - oe.aConstraints.gridy += 1; |
---|
614 | 1172 | |
---|
| 1173 | + oe.treePanel.add(jSPPanel); |
---|
| 1174 | + oe.treePanel.Return(); |
---|
| 1175 | + |
---|
| 1176 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 1177 | + oe.treePanel.Return(); |
---|
| 1178 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1179 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1180 | + sliderPane.preferredHeight = 1; |
---|
| 1181 | + |
---|
| 1182 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1183 | + mainPanel.setResizeWeight(0.4); |
---|
| 1184 | + |
---|
615 | 1185 | //jList.addListSelectionListener(this); |
---|
616 | 1186 | oe.jTree.addTreeSelectionListener(this); |
---|
617 | 1187 | //jTree.setRootVisible(false); |
---|
618 | 1188 | //jTree.setEditable(true); |
---|
619 | 1189 | oe.jTree.setDragEnabled(true); |
---|
620 | 1190 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
621 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1191 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
622 | 1192 | |
---|
623 | 1193 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
624 | 1194 | |
---|
.. | .. |
---|
630 | 1200 | dgr.addDragGestureListener(this); |
---|
631 | 1201 | }catch(Exception e) {} |
---|
632 | 1202 | */ |
---|
633 | | - radio.layout = sevenButton; |
---|
| 1203 | + radio.layout = threeButton; // sixButton; |
---|
634 | 1204 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
635 | 1205 | } |
---|
| 1206 | + |
---|
| 1207 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
| 1208 | + { |
---|
| 1209 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1210 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1211 | + colorCB.addItemListener(this); |
---|
| 1212 | + |
---|
| 1213 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1214 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1215 | + materialCB.addItemListener(this); |
---|
| 1216 | + |
---|
| 1217 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1218 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1219 | + textureCB.addItemListener(this); |
---|
| 1220 | + |
---|
| 1221 | + panel.Return(); |
---|
| 1222 | + |
---|
| 1223 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 1224 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 1225 | + boxCB.addItemListener(this); |
---|
| 1226 | + |
---|
| 1227 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 1228 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
| 1229 | + zoomBoxCB.addItemListener(this); |
---|
| 1230 | + |
---|
| 1231 | + if (true) // Globals.ADVANCED) |
---|
| 1232 | + { |
---|
| 1233 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1234 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1235 | +// supportCB.addItemListener(this); |
---|
| 1236 | + |
---|
| 1237 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1238 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1239 | + freezeCB.addItemListener(this); |
---|
| 1240 | + |
---|
| 1241 | + // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
| 1242 | + // localCB.addItemListener(this); |
---|
| 1243 | + |
---|
| 1244 | + panel.Return(); |
---|
| 1245 | + |
---|
| 1246 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
| 1247 | + crowdCB.setToolTipText("Used for crowds"); |
---|
| 1248 | + crowdCB.addItemListener(this); |
---|
| 1249 | + |
---|
| 1250 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
| 1251 | + smoothCB.setToolTipText("Snapping delay"); |
---|
| 1252 | + smoothCB.addItemListener(this); |
---|
| 1253 | + |
---|
| 1254 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1255 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1256 | +// slowCB.addItemListener(this); |
---|
| 1257 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1258 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1259 | + minshaderCB.addItemListener(this); |
---|
| 1260 | + |
---|
| 1261 | +// constraints.gridy += 1; |
---|
| 1262 | +// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
| 1263 | +// speakerMocapCB.addItemListener(this); |
---|
| 1264 | + |
---|
| 1265 | + panel.Return(); |
---|
| 1266 | + |
---|
| 1267 | + if (false) |
---|
| 1268 | + { |
---|
| 1269 | + // handled in scripts |
---|
| 1270 | + //constraints.gridy += 1; |
---|
| 1271 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
| 1272 | + speakerCameraCB.addItemListener(this); |
---|
| 1273 | + |
---|
| 1274 | + //constraints.gridy += 1; |
---|
| 1275 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
| 1276 | + speakerFocusCB.addItemListener(this); |
---|
| 1277 | + |
---|
| 1278 | + //constraints.gridy += 1; |
---|
| 1279 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
| 1280 | + smoothfocusCB.addItemListener(this); |
---|
| 1281 | + panel.Return(); |
---|
| 1282 | + } |
---|
| 1283 | + |
---|
| 1284 | +//constraints.gridx += 1; |
---|
| 1285 | +//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
| 1286 | +// debugCB.addItemListener(this); |
---|
| 1287 | + |
---|
| 1288 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1289 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1290 | + trackCB.addItemListener(this); |
---|
| 1291 | + |
---|
| 1292 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 1293 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
| 1294 | + oeilCB.addItemListener(this); |
---|
| 1295 | + |
---|
| 1296 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 1297 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 1298 | + shadowCB.addItemListener(this); |
---|
| 1299 | + |
---|
| 1300 | + panel.Return(); |
---|
| 1301 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1302 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1303 | + toggleTextureCB.addItemListener(this); |
---|
| 1304 | + |
---|
| 1305 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1306 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1307 | + toggleSwitchCB.addItemListener(this); |
---|
| 1308 | + |
---|
| 1309 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1310 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1311 | + autokeepCB.addItemListener(this); |
---|
| 1312 | + |
---|
| 1313 | + panel.Return(); |
---|
| 1314 | + if (Globals.ADVANCED) |
---|
| 1315 | + { |
---|
| 1316 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
| 1317 | + lookAtCB.setToolTipText("Look-at target"); |
---|
| 1318 | + lookAtCB.addItemListener(this); |
---|
| 1319 | + } |
---|
| 1320 | + |
---|
| 1321 | + } |
---|
| 1322 | + |
---|
| 1323 | + cGridBag fill = new cGridBag(); |
---|
| 1324 | + fill.preferredHeight = 200; |
---|
| 1325 | + cGridBag fill2 = new cGridBag(); |
---|
| 1326 | + fill2.preferredHeight = 200; |
---|
| 1327 | + cGridBag fill3 = new cGridBag(); |
---|
| 1328 | + fill3.preferredHeight = 200; |
---|
| 1329 | + |
---|
| 1330 | + panel.add(fill); |
---|
| 1331 | + panel.add(fill2); |
---|
| 1332 | + panel.add(fill3); |
---|
| 1333 | + |
---|
| 1334 | + } |
---|
636 | 1335 | |
---|
637 | 1336 | void EditObject(Object3D obj) |
---|
638 | 1337 | { |
---|
639 | | - cRadio dummyButton = new cRadio(obj.name); |
---|
640 | | - dummyButton.SetObject(obj); |
---|
641 | | - dummyButton.layout = sevenButton; |
---|
642 | | - dummyButton.SetCamera(cameraView.renderCamera, false); |
---|
643 | | - dummyButton.addActionListener(this); |
---|
644 | | - radioPanel.add(dummyButton); |
---|
645 | | - buttonGroup.add(dummyButton); |
---|
646 | | - dummyButton.doClick(); |
---|
| 1338 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 1339 | + |
---|
| 1340 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1341 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1342 | + if (!radioButton.hadMaterial) |
---|
| 1343 | + { |
---|
| 1344 | + obj.material = new cMaterial(); |
---|
| 1345 | + } |
---|
| 1346 | + |
---|
| 1347 | + radioButton.SetObject(obj); |
---|
| 1348 | + radioButton.layout = threeButton; // sixButton; |
---|
| 1349 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 1350 | + radioButton.addActionListener(this); |
---|
| 1351 | + radioPanel.add(radioButton); |
---|
| 1352 | + buttonGroup.add(radioButton); |
---|
| 1353 | + radioButton.doClick(); |
---|
647 | 1354 | } |
---|
| 1355 | + |
---|
648 | 1356 | void SetupViews(ObjEditor oe) |
---|
649 | 1357 | { |
---|
| 1358 | + theFrame = this; |
---|
| 1359 | + |
---|
650 | 1360 | oe.SetupViews(); |
---|
651 | 1361 | |
---|
652 | 1362 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
655 | 1365 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
656 | 1366 | } |
---|
657 | 1367 | |
---|
658 | | - JCheckBox liveCB; |
---|
659 | | - JCheckBox supportCB; |
---|
660 | | - JCheckBox localCB; |
---|
661 | | - JCheckBox crowdCB; |
---|
662 | | - JCheckBox smoothCB; |
---|
663 | | - JCheckBox fastCB; |
---|
664 | | - JCheckBox slowCB; |
---|
665 | | - JCheckBox boxCB; |
---|
666 | | - JCheckBox trackCB; |
---|
667 | | - JCheckBox smoothfocusCB; |
---|
| 1368 | + cToggleButton liveCB; |
---|
| 1369 | + cCheckBox supportCB; |
---|
| 1370 | + cCheckBox localCB; |
---|
| 1371 | + cCheckBox crowdCB; |
---|
| 1372 | + cCheckBox smoothCB; |
---|
| 1373 | + cCheckBox minshaderCB; |
---|
| 1374 | + |
---|
| 1375 | + cToggleButton fastCB; |
---|
| 1376 | + cCheckBox slowCB; |
---|
| 1377 | + cCheckBox boxCB; |
---|
| 1378 | + cCheckBox zoomBoxCB; |
---|
| 1379 | + cCheckBox freezeCB; |
---|
| 1380 | + //cToggleButton trackCB; |
---|
| 1381 | + cCheckBox trackCB; |
---|
| 1382 | + cCheckBox smoothfocusCB; |
---|
668 | 1383 | // JCheckBox speakerMocapCB; |
---|
669 | | - JCheckBox speakerCameraCB; |
---|
670 | | - JCheckBox speakerFocusCB; |
---|
671 | | - JCheckBox debugCB; |
---|
672 | | - JCheckBox oeilCB; |
---|
673 | | - JCheckBox lookAtCB; |
---|
| 1384 | + cCheckBox speakerCameraCB; |
---|
| 1385 | + cCheckBox speakerFocusCB; |
---|
| 1386 | + cCheckBox debugCB; |
---|
| 1387 | + |
---|
| 1388 | + cCheckBox oeilCB; |
---|
| 1389 | + cCheckBox shadowCB; |
---|
| 1390 | + cCheckBox autokeepCB; |
---|
| 1391 | + cCheckBox lookAtCB; |
---|
674 | 1392 | |
---|
675 | 1393 | // static int COLOR = 1; |
---|
676 | 1394 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
678 | 1396 | |
---|
679 | 1397 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
680 | 1398 | |
---|
681 | | - JCheckBox colorCB; |
---|
682 | | - JCheckBox materialCB; |
---|
683 | | - JCheckBox textureCB; |
---|
| 1399 | + cCheckBox colorCB; |
---|
| 1400 | + cCheckBox materialCB; |
---|
| 1401 | + cCheckBox textureCB; |
---|
684 | 1402 | |
---|
685 | 1403 | public void itemStateChanged(ItemEvent e) |
---|
686 | 1404 | { |
---|
.. | .. |
---|
705 | 1423 | dropAttributes |= Object3D.TEXTURE; |
---|
706 | 1424 | else |
---|
707 | 1425 | dropAttributes &= ~Object3D.TEXTURE; |
---|
708 | | - } |
---|
709 | | - else if(e.getSource() == liveCB) |
---|
| 1426 | + } else if(e.getSource() == liveCB) |
---|
710 | 1427 | { |
---|
711 | 1428 | cameraView.ToggleLive(); |
---|
| 1429 | + refreshContents(false); |
---|
712 | 1430 | } |
---|
713 | 1431 | else if(e.getSource() == supportCB) |
---|
714 | 1432 | { |
---|
.. | .. |
---|
724 | 1442 | { |
---|
725 | 1443 | cameraView.ToggleInertia(); |
---|
726 | 1444 | cameraView.repaint(); |
---|
| 1445 | + } |
---|
| 1446 | + else if(e.getSource() == minshaderCB) |
---|
| 1447 | + { |
---|
| 1448 | + Globals.MINSHADER ^= true; |
---|
| 1449 | + cameraView.programInitialized = false; |
---|
| 1450 | + cameraView.repaint(); |
---|
727 | 1451 | } |
---|
728 | 1452 | else if(e.getSource() == localCB) |
---|
729 | 1453 | { |
---|
.. | .. |
---|
743 | 1467 | Recompile(); |
---|
744 | 1468 | cameraView.repaint(); |
---|
745 | 1469 | // refreshContents(); |
---|
| 1470 | + } |
---|
| 1471 | + else if(e.getSource() == zoomBoxCB) |
---|
| 1472 | + { |
---|
| 1473 | + cameraView.ToggleZoomBoxMode(); |
---|
746 | 1474 | } |
---|
747 | 1475 | else if(e.getSource() == smoothfocusCB) |
---|
748 | 1476 | { |
---|
.. | .. |
---|
769 | 1497 | { |
---|
770 | 1498 | cameraView.ToggleOeil(); |
---|
771 | 1499 | } |
---|
| 1500 | + else if(e.getSource() == shadowCB) |
---|
| 1501 | + { |
---|
| 1502 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1503 | + } |
---|
| 1504 | + else if(e.getSource() == freezeCB) |
---|
| 1505 | + { |
---|
| 1506 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1507 | + } |
---|
| 1508 | + else if(e.getSource() == autokeepCB) |
---|
| 1509 | + { |
---|
| 1510 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1511 | + } |
---|
772 | 1512 | else if(e.getSource() == lookAtCB) |
---|
773 | 1513 | { |
---|
774 | 1514 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
785 | 1525 | |
---|
786 | 1526 | /**/ |
---|
787 | 1527 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
788 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1528 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1529 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
789 | 1530 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
790 | 1531 | // We can't move the root node or an empty selection |
---|
791 | 1532 | return; |
---|
.. | .. |
---|
848 | 1589 | } |
---|
849 | 1590 | } |
---|
850 | 1591 | |
---|
851 | | - String string = (String) object; |
---|
852 | | - |
---|
853 | 1592 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
854 | 1593 | // if( object instanceof java.io.File[]) |
---|
855 | 1594 | // { |
---|
.. | .. |
---|
857 | 1596 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
858 | 1597 | // return; |
---|
859 | 1598 | // } |
---|
860 | | - if (string.charAt(0) == '/') |
---|
| 1599 | + |
---|
| 1600 | + String string = object.toString(); |
---|
| 1601 | + |
---|
| 1602 | + // File path for Mac and Windows |
---|
| 1603 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
861 | 1604 | { |
---|
862 | 1605 | // file(s) |
---|
863 | 1606 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
884 | 1627 | |
---|
885 | 1628 | flashIt = false; |
---|
886 | 1629 | CameraPane pane = (CameraPane) target; |
---|
887 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1630 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
888 | 1631 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
889 | 1632 | |
---|
890 | 1633 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
900 | 1643 | |
---|
901 | 1644 | assert target == objEditor.jTree; |
---|
902 | 1645 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1646 | + Object3D destinationLeaf; |
---|
903 | 1647 | try { |
---|
904 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1648 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
905 | 1649 | } catch (Exception e) { |
---|
906 | 1650 | System.out.println("destinationPath : " + destinationPath); |
---|
907 | 1651 | return; |
---|
908 | 1652 | } |
---|
909 | 1653 | |
---|
910 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1654 | + for (int i=group.selection.size(); --i>=0;) |
---|
911 | 1655 | { |
---|
| 1656 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1657 | + |
---|
| 1658 | + // Cannot move into itself |
---|
| 1659 | + if (child == destinationLeaf) |
---|
| 1660 | + return; |
---|
| 1661 | + } |
---|
| 1662 | + |
---|
| 1663 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1664 | +// { |
---|
912 | 1665 | loadClipboard(true); |
---|
913 | 1666 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
914 | | - pasteInto(false); |
---|
915 | | - } else { |
---|
916 | | - loadClipboard(false); |
---|
917 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
918 | | - pasteInto(false); // true); // ??? |
---|
919 | | - } |
---|
| 1667 | + pasteInto(false, false); |
---|
| 1668 | +// } else { |
---|
| 1669 | +// loadClipboard(false); |
---|
| 1670 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1671 | +// pasteInto(false, false); // true); // ??? |
---|
| 1672 | +// } |
---|
920 | 1673 | } |
---|
921 | 1674 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
922 | 1675 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1021 | 1774 | { |
---|
1022 | 1775 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1023 | 1776 | //heightFieldItem.addActionListener(this); |
---|
1024 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1025 | | - gridItem.addActionListener(this); |
---|
1026 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1027 | | - rectoidItem.addActionListener(this); |
---|
1028 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1029 | | - ellipsoidItem.addActionListener(this); |
---|
1030 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1031 | | - coneItem.addActionListener(this); |
---|
1032 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1033 | | - torusItem.addActionListener(this); |
---|
1034 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1035 | | - superItem.addActionListener(this); |
---|
1036 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1037 | | - particleItem.addActionListener(this); |
---|
| 1777 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1778 | +// gridItem.addActionListener(this); |
---|
| 1779 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1780 | +// rectoidItem.addActionListener(this); |
---|
| 1781 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1782 | +// ellipsoidItem.addActionListener(this); |
---|
| 1783 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1784 | +// coneItem.addActionListener(this); |
---|
| 1785 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1786 | +// torusItem.addActionListener(this); |
---|
| 1787 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1788 | +// superItem.addActionListener(this); |
---|
| 1789 | + |
---|
| 1790 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1791 | + cameraItem.addActionListener(this); |
---|
| 1792 | + |
---|
| 1793 | + if (!Globals.ADVANCED) |
---|
| 1794 | + { |
---|
| 1795 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1796 | + kleinItem.addActionListener(this); |
---|
| 1797 | + } |
---|
| 1798 | + |
---|
| 1799 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1800 | +// particleItem.addActionListener(this); |
---|
| 1801 | + if (Globals.ADVANCED) |
---|
| 1802 | + { |
---|
1038 | 1803 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1039 | 1804 | ragdollItem.addActionListener(this); |
---|
1040 | 1805 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1041 | 1806 | ragdoll2Item.addActionListener(this); |
---|
| 1807 | + } |
---|
1042 | 1808 | menu.add("-"); |
---|
1043 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1809 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1044 | 1810 | meshItem.addActionListener(this); |
---|
1045 | 1811 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1046 | 1812 | // meshGroupItem.addActionListener(this); |
---|
| 1813 | + if (Globals.ADVANCED) |
---|
| 1814 | + { |
---|
1047 | 1815 | springItem = menu.add(new MenuItem("Spring")); |
---|
1048 | 1816 | springItem.addActionListener(this); |
---|
1049 | 1817 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1050 | 1818 | flagItem.addActionListener(this); |
---|
1051 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1052 | | - bezierItem.addActionListener(this); |
---|
1053 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1054 | | - checkerItem.addActionListener(this); |
---|
1055 | 1819 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1056 | 1820 | blobItem.addActionListener(this); |
---|
1057 | 1821 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1058 | 1822 | latheItem.addActionListener(this); |
---|
1059 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1060 | | - lightItem.addActionListener(this); |
---|
| 1823 | + } |
---|
| 1824 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1825 | + bezierItem.addActionListener(this); |
---|
| 1826 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1827 | +// overlayItem.addActionListener(this); |
---|
| 1828 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1829 | +// lightItem.addActionListener(this); |
---|
1061 | 1830 | menu.add("-"); |
---|
1062 | 1831 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1063 | 1832 | //superLoopItem.addActionListener(this); |
---|
1064 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1065 | | - loopItem.addActionListener(this); |
---|
| 1833 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1834 | +// loopItem.addActionListener(this); |
---|
1066 | 1835 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1067 | 1836 | doubleItem.addActionListener(this); |
---|
| 1837 | + if (Globals.ADVANCED) |
---|
| 1838 | + { |
---|
1068 | 1839 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1069 | 1840 | tripleItem.addActionListener(this); |
---|
| 1841 | + } |
---|
1070 | 1842 | } |
---|
1071 | 1843 | |
---|
1072 | 1844 | void buildToolsMenu(Menu menu) |
---|
1073 | 1845 | { |
---|
1074 | 1846 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1075 | 1847 | animationItem.addItemListener(this); |
---|
1076 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1848 | + animationItem.setState(Globals.ANIMATION); |
---|
| 1849 | + |
---|
| 1850 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1851 | + archiveItem.addActionListener(this); |
---|
1077 | 1852 | |
---|
1078 | 1853 | menu.add("-"); |
---|
1079 | 1854 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1080 | 1855 | parseverticesItem.addActionListener(this); |
---|
1081 | 1856 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1082 | 1857 | textureFieldItem.addActionListener(this); |
---|
1083 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1858 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1084 | 1859 | alignItem.addActionListener(this); |
---|
1085 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1086 | | - mirrorItem.addActionListener(this); |
---|
1087 | 1860 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1088 | 1861 | reduceMorphItem.addActionListener(this); |
---|
1089 | 1862 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1090 | 1863 | reduce34MorphItem.addActionListener(this); |
---|
1091 | | - |
---|
1092 | | - menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1093 | | - computeAOItem.addActionListener(this); |
---|
1094 | 1864 | menu.add("-"); |
---|
1095 | | - |
---|
1096 | 1865 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1097 | 1866 | memoryItem.addActionListener(this); |
---|
| 1867 | + menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
| 1868 | + computeAOItem.addActionListener(this); |
---|
| 1869 | + |
---|
| 1870 | + if (Globals.ADVANCED) |
---|
| 1871 | + { |
---|
| 1872 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1873 | + mirrorItem.addActionListener(this); |
---|
| 1874 | + menu.add("-"); |
---|
1098 | 1875 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1099 | 1876 | analyzeItem.addActionListener(this); |
---|
1100 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1877 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1101 | 1878 | dumpItem.addActionListener(this); |
---|
1102 | 1879 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1103 | 1880 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1106 | 1883 | resetParentItem.addActionListener(this); |
---|
1107 | 1884 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1108 | 1885 | repairParentItem.addActionListener(this); |
---|
| 1886 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1887 | + repairShadowItem.addActionListener(this); |
---|
1109 | 1888 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1110 | 1889 | invariantsItem.addActionListener(this); |
---|
1111 | 1890 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1113 | 1892 | menu.add("-"); |
---|
1114 | 1893 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1115 | 1894 | editScriptItem.addActionListener(this); |
---|
| 1895 | + } |
---|
1116 | 1896 | } |
---|
1117 | 1897 | |
---|
1118 | 1898 | void ScreenFit() |
---|
.. | .. |
---|
1235 | 2015 | shadow.material = new cMaterial(obj.material); |
---|
1236 | 2016 | shadow.material.diffuse = 0.0001f; |
---|
1237 | 2017 | shadow.material.specular = 0.0001f; |
---|
| 2018 | + //shadow.projectedVertices[1].x = 300; |
---|
1238 | 2019 | |
---|
1239 | 2020 | makeSomething(shadow); |
---|
1240 | 2021 | } |
---|
| 2022 | + |
---|
| 2023 | + private void ClearUnpinned() |
---|
| 2024 | + { |
---|
| 2025 | + //for (Object3D obj : listUI) |
---|
| 2026 | + for (int i=listUI.size(); --i>=0;) |
---|
| 2027 | + { |
---|
| 2028 | + Object3D obj = listUI.elementAt(i); |
---|
| 2029 | + if (!obj.pinned) |
---|
| 2030 | + { |
---|
| 2031 | + obj.CloseUI(); |
---|
| 2032 | + listUI.remove(i); |
---|
| 2033 | + } |
---|
| 2034 | + } |
---|
| 2035 | + } |
---|
| 2036 | + |
---|
| 2037 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2038 | + { |
---|
| 2039 | + // if (!(elem instanceof Composite)) |
---|
| 2040 | + // newWindow = false; |
---|
| 2041 | + listUI.add(elem); |
---|
| 2042 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2043 | + System.out.println("edit : " + elem); |
---|
| 2044 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 2045 | + } |
---|
1241 | 2046 | |
---|
1242 | 2047 | /** |
---|
1243 | 2048 | * applyExample |
---|
.. | .. |
---|
1441 | 2246 | |
---|
1442 | 2247 | void Overwrite(int mask) |
---|
1443 | 2248 | { |
---|
1444 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2249 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1445 | 2250 | { |
---|
1446 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2251 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1447 | 2252 | |
---|
1448 | 2253 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1449 | 2254 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1466 | 2271 | // |
---|
1467 | 2272 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1468 | 2273 | { |
---|
| 2274 | + Object source = event.getSource(); |
---|
1469 | 2275 | /* |
---|
1470 | 2276 | if (event.getSource() == nameField) |
---|
1471 | 2277 | { |
---|
.. | .. |
---|
1477 | 2283 | } |
---|
1478 | 2284 | else |
---|
1479 | 2285 | */ |
---|
1480 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 2286 | + if (source == lookAtItem || source == lookFromItem) |
---|
1481 | 2287 | { |
---|
1482 | 2288 | ScreenFit(); |
---|
1483 | 2289 | } else |
---|
1484 | | - if (event.getSource() == switchItem) |
---|
| 2290 | + if (source == switchViewItem) |
---|
1485 | 2291 | { |
---|
1486 | 2292 | cVector v1 = new cVector(); |
---|
1487 | 2293 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1490 | 2296 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1491 | 2297 | objEditor.cameraView.repaint(); |
---|
1492 | 2298 | } else |
---|
1493 | | - if (event.getSource() == rectoidItem) |
---|
| 2299 | + if (source == rectoidItem || source == boxButton) |
---|
1494 | 2300 | { |
---|
1495 | 2301 | makeSomething(new Box()); |
---|
1496 | 2302 | } else |
---|
1497 | | - if (event.getSource() == particleItem) |
---|
| 2303 | + if (source == particleItem || source == particlesButton) |
---|
1498 | 2304 | { |
---|
1499 | 2305 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1500 | 2306 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1515 | 2321 | applyExample(particleGeom, "SMOKE"); |
---|
1516 | 2322 | makeSomething(particleGeom); |
---|
1517 | 2323 | } else |
---|
1518 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 2324 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1519 | 2325 | { |
---|
1520 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 2326 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1521 | 2327 | |
---|
1522 | 2328 | ragdoll.toParent = LA.newMatrix(); |
---|
1523 | 2329 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1535 | 2341 | } else |
---|
1536 | 2342 | /* |
---|
1537 | 2343 | */ |
---|
1538 | | - if (event.getSource() == heightFieldItem) |
---|
| 2344 | + if (source == heightFieldItem) |
---|
1539 | 2345 | { |
---|
1540 | 2346 | Object3D obj = new Object3D(); |
---|
1541 | 2347 | |
---|
.. | .. |
---|
1573 | 2379 | |
---|
1574 | 2380 | makeSomething(obj); |
---|
1575 | 2381 | } else |
---|
1576 | | - if (event.getSource() == gridItem) |
---|
| 2382 | + if (source == gridItem || source == gridButton) |
---|
1577 | 2383 | { |
---|
1578 | 2384 | makeSomething(new Grid()); |
---|
1579 | 2385 | } else |
---|
1580 | | - if (event.getSource() == ellipsoidItem) |
---|
| 2386 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1581 | 2387 | { |
---|
1582 | 2388 | makeSomething(new Sphere()); |
---|
1583 | 2389 | } else |
---|
1584 | | - if (event.getSource() == coneItem) |
---|
| 2390 | + if (source == coneItem || source == coneButton) |
---|
1585 | 2391 | { |
---|
1586 | 2392 | makeSomething(new Cone()); |
---|
1587 | 2393 | } else |
---|
1588 | | - if (event.getSource() == torusItem) |
---|
| 2394 | + if (source == torusItem || source == torusButton) |
---|
1589 | 2395 | { |
---|
1590 | 2396 | makeSomething(new Torus()); |
---|
1591 | 2397 | } else |
---|
1592 | | - if (event.getSource() == superItem) |
---|
| 2398 | + if (source == superItem || source == superButton) |
---|
1593 | 2399 | { |
---|
1594 | 2400 | makeSomething(new Superellipsoid()); |
---|
1595 | 2401 | } else |
---|
1596 | | - if (event.getSource() == blobItem) |
---|
| 2402 | + if (source == kleinItem || source == kleinButton) |
---|
| 2403 | + { |
---|
| 2404 | + makeSomething(new Klein()); |
---|
| 2405 | + } else |
---|
| 2406 | + if (source == blobItem) |
---|
1597 | 2407 | { |
---|
1598 | 2408 | Blob blob = new Blob(); |
---|
1599 | 2409 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1601 | 2411 | //blob.retile(); |
---|
1602 | 2412 | makeSomething(blob); |
---|
1603 | 2413 | } else |
---|
1604 | | - if (event.getSource() == latheItem) |
---|
| 2414 | + if (source == latheItem) |
---|
1605 | 2415 | { |
---|
1606 | 2416 | makeSomething(new Lathe()); |
---|
1607 | 2417 | } else |
---|
1608 | | - if (event.getSource() == bezierItem) |
---|
| 2418 | + if (source == bezierItem) |
---|
1609 | 2419 | { |
---|
1610 | 2420 | makeSomething(new BezierSurface()); |
---|
1611 | 2421 | } else |
---|
1612 | | - if (event.getSource() == checkerItem) |
---|
| 2422 | + if (source == overlayItem || source == overlayButton) |
---|
1613 | 2423 | { |
---|
1614 | 2424 | /* |
---|
1615 | 2425 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1624 | 2434 | */ |
---|
1625 | 2435 | makeSomething(new Checker()); |
---|
1626 | 2436 | } else |
---|
1627 | | - if (event.getSource() == meshItem) |
---|
| 2437 | + if (source == meshItem) |
---|
1628 | 2438 | { |
---|
1629 | 2439 | Object3D itemtomake = new Object3D(); |
---|
1630 | 2440 | Object3D child; |
---|
.. | .. |
---|
1645 | 2455 | makeSomething(child); |
---|
1646 | 2456 | } |
---|
1647 | 2457 | } else |
---|
1648 | | - if (event.getSource() == springItem) |
---|
| 2458 | + if (source == springItem) |
---|
1649 | 2459 | { |
---|
1650 | 2460 | cSpring s = new cSpring(); |
---|
1651 | 2461 | s.setup(); |
---|
1652 | 2462 | makeSomething(s); |
---|
1653 | 2463 | } else |
---|
1654 | | - if (event.getSource() == flagItem) |
---|
| 2464 | + if (source == flagItem) |
---|
1655 | 2465 | { |
---|
1656 | 2466 | cSpring s = new cFlag(); |
---|
1657 | 2467 | s.setup(); |
---|
1658 | 2468 | makeSomething(s); |
---|
1659 | 2469 | } else |
---|
1660 | | - if (event.getSource() == lightItem) |
---|
| 2470 | + if (source == lightItem || source == lightButton) |
---|
1661 | 2471 | { |
---|
1662 | 2472 | makeSomething(new Light()); |
---|
1663 | 2473 | } else |
---|
1664 | | - if (event.getSource() == csgItem) |
---|
| 2474 | +// if (source == skybox1Button || |
---|
| 2475 | +// source == skybox2Button || |
---|
| 2476 | +// source == skybox3Button || |
---|
| 2477 | +// source == skybox4Button || |
---|
| 2478 | +// source == skybox5Button || |
---|
| 2479 | +// source == skybox6Button || |
---|
| 2480 | +// source == skybox7Button || |
---|
| 2481 | +// source == skybox11Button || |
---|
| 2482 | +// source == skybox12Button || |
---|
| 2483 | +// source == skybox13Button || |
---|
| 2484 | +// source == skybox14Button || |
---|
| 2485 | +// source == skybox15Button || |
---|
| 2486 | +// source == skybox16Button || |
---|
| 2487 | +// source == skybox17Button) |
---|
| 2488 | +// { |
---|
| 2489 | +// ChangeSkybox(source); |
---|
| 2490 | +// } else |
---|
| 2491 | + if (source == csgItem) |
---|
1665 | 2492 | { |
---|
1666 | 2493 | group(new CSG()); |
---|
1667 | 2494 | } else |
---|
1668 | | - if (event.getSource() == templateItem) |
---|
| 2495 | + if (source == templateItem) |
---|
1669 | 2496 | { |
---|
1670 | 2497 | group(new cTemplate()); |
---|
1671 | 2498 | } else |
---|
1672 | | - if (event.getSource() == attributeItem) |
---|
| 2499 | + if (source == attributeItem) |
---|
1673 | 2500 | { |
---|
1674 | 2501 | makeSomething(new Attribute()); |
---|
1675 | 2502 | } else |
---|
1676 | | - if (event.getSource() == pointflowItem) |
---|
| 2503 | + if (source == pointflowItem) |
---|
1677 | 2504 | { |
---|
1678 | 2505 | makeSomething(new PointFlow()); |
---|
1679 | 2506 | } else |
---|
.. | .. |
---|
1685 | 2512 | } else |
---|
1686 | 2513 | */ |
---|
1687 | 2514 | |
---|
1688 | | - if (event.getSource() == superLoopItem) |
---|
| 2515 | + if (source == superLoopItem) |
---|
1689 | 2516 | { |
---|
1690 | 2517 | Composite g = new cGroup(); |
---|
1691 | 2518 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1707 | 2534 | |
---|
1708 | 2535 | group(g); |
---|
1709 | 2536 | } else |
---|
1710 | | - if (event.getSource() == loopItem) |
---|
| 2537 | + if (source == loopItem || source == loopButton) |
---|
1711 | 2538 | { |
---|
1712 | 2539 | Composite csg = new GroupLeaf(); |
---|
1713 | 2540 | csg.count = 5; |
---|
1714 | 2541 | group(csg); |
---|
1715 | | - Composite child = new cGroup(); |
---|
| 2542 | + Composite child = new cGroup("Branch"); |
---|
1716 | 2543 | csg.addChild(child); |
---|
1717 | 2544 | child.addChild(csg); |
---|
1718 | 2545 | } else |
---|
1719 | | - if (event.getSource() == doubleItem) |
---|
| 2546 | + if (source == doubleItem) |
---|
1720 | 2547 | { |
---|
1721 | | - Composite csg = new GroupLeaf(); |
---|
| 2548 | + Composite csg = new GroupLeaf("Fork"); |
---|
1722 | 2549 | csg.count = 5; |
---|
1723 | 2550 | group(csg); |
---|
1724 | | - Composite child = new cGroup(); |
---|
| 2551 | + Composite child = new cGroup("Branch A"); |
---|
1725 | 2552 | csg.addChild(child); |
---|
1726 | 2553 | child.addChild(csg); |
---|
1727 | | - child = new cGroup(); |
---|
| 2554 | + child = new cGroup("Branch B"); |
---|
1728 | 2555 | csg.addChild(child); |
---|
1729 | 2556 | child.addChild(csg); |
---|
1730 | 2557 | } else |
---|
1731 | | - if (event.getSource() == tripleItem) |
---|
| 2558 | + if (source == tripleItem) |
---|
1732 | 2559 | { |
---|
1733 | | - Composite csg = new GroupLeaf(); |
---|
| 2560 | + Composite csg = new GroupLeaf("Trident"); |
---|
1734 | 2561 | csg.count = 4; |
---|
1735 | 2562 | group(csg); |
---|
1736 | 2563 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1743 | 2570 | csg.addChild(child); |
---|
1744 | 2571 | child.addChild(csg); |
---|
1745 | 2572 | } else |
---|
1746 | | - |
---|
1747 | | - if (event.getSource() == importGFDItem) |
---|
| 2573 | + if (source == computeAOItem) |
---|
1748 | 2574 | { |
---|
1749 | | - ImportGFD(); |
---|
| 2575 | + Globals.drawMode = CameraPane.OCCLUSION; |
---|
| 2576 | + cameraView.repaint(); |
---|
1750 | 2577 | } else |
---|
1751 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1752 | | - { |
---|
1753 | | - ImportVRMLX3D(); |
---|
1754 | | - } else |
---|
1755 | | - if (event.getSource() == import3DSItem) |
---|
1756 | | - { |
---|
1757 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1758 | | - } else |
---|
1759 | | - if (event.getSource() == importOBJItem) |
---|
1760 | | - { |
---|
1761 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1762 | | - } else |
---|
1763 | | - if (event.getSource() == computeAOItem) |
---|
1764 | | - { |
---|
1765 | | - CameraPane.drawMode = CameraPane.OCCLUSION; |
---|
1766 | | - CameraPane.theRenderer.repaint(); |
---|
1767 | | - } else |
---|
1768 | | - if (event.getSource() == recompileItem) |
---|
| 2578 | + if (source == recompileItem) |
---|
1769 | 2579 | { |
---|
1770 | 2580 | Recompile(); |
---|
1771 | 2581 | refreshContents(); |
---|
1772 | 2582 | } else |
---|
1773 | | - if (event.getSource() == editScriptItem) |
---|
| 2583 | + if (source == editScriptItem) |
---|
1774 | 2584 | { |
---|
1775 | 2585 | OpenDialog(); |
---|
1776 | 2586 | refreshContents(); |
---|
1777 | 2587 | } else |
---|
1778 | | - if (event.getSource() == invariantsItem) |
---|
| 2588 | + if (source == invariantsItem) |
---|
1779 | 2589 | { |
---|
1780 | 2590 | System.out.println("Invariants:"); |
---|
1781 | | - GrafreeD.theApplet3D.universe.invariants(); |
---|
| 2591 | + Grafreed.grafreed.universe.invariants(); |
---|
1782 | 2592 | } else |
---|
1783 | | - if (event.getSource() == memoryItem) |
---|
| 2593 | + if (source == memoryItem) |
---|
1784 | 2594 | { |
---|
1785 | 2595 | //System.out.println("Invariants:"); |
---|
1786 | 2596 | PrintMemory(); |
---|
1787 | 2597 | } else |
---|
1788 | | - if (event.getSource() == pathItem) |
---|
| 2598 | + if (source == pathItem) |
---|
1789 | 2599 | { |
---|
1790 | 2600 | PrintPath(); |
---|
1791 | 2601 | } else |
---|
1792 | | - if (event.getSource() == analyzeItem) |
---|
| 2602 | + if (source == analyzeItem) |
---|
1793 | 2603 | { |
---|
1794 | 2604 | AnalyzeObject(); |
---|
1795 | 2605 | } else |
---|
1796 | | - if (event.getSource() == dumpItem) |
---|
| 2606 | + if (source == dumpItem) |
---|
1797 | 2607 | { |
---|
1798 | 2608 | DumpObject(); |
---|
1799 | 2609 | } else |
---|
1800 | | - if (event.getSource() == screenfitButton) |
---|
| 2610 | + if (source == minButton) |
---|
1801 | 2611 | { |
---|
1802 | | - //Reload(lastConverter, lastFilename, true); |
---|
| 2612 | + Minimize(); |
---|
| 2613 | + } else |
---|
| 2614 | + if (source == maxButton) |
---|
| 2615 | + { |
---|
| 2616 | + Maximize(); |
---|
| 2617 | + } else |
---|
| 2618 | + if (source == fullButton) |
---|
| 2619 | + { |
---|
| 2620 | + ToggleFullScreen(); |
---|
| 2621 | + } else |
---|
| 2622 | + if (source == previousVersionButton) |
---|
| 2623 | + { |
---|
| 2624 | + // Go to previous version |
---|
| 2625 | + //if (!Undo()) |
---|
| 2626 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2627 | + PreviousVersion(); |
---|
| 2628 | + } else |
---|
| 2629 | + if (source == restoreButton) |
---|
| 2630 | + { |
---|
| 2631 | + // Restore current version |
---|
| 2632 | + Restore(); |
---|
| 2633 | + //restoreButton.setEnabled(false); |
---|
| 2634 | + } else |
---|
| 2635 | + if (source == replaceButton) |
---|
| 2636 | + { |
---|
| 2637 | + // Overwrite current version |
---|
| 2638 | + Replace(); |
---|
| 2639 | + //replaceButton.setEnabled(false); |
---|
| 2640 | + } else |
---|
| 2641 | + if (source == nextVersionButton) |
---|
| 2642 | + { |
---|
| 2643 | + // Go to next version |
---|
| 2644 | + NextVersion(); |
---|
| 2645 | + } else |
---|
| 2646 | + if (source == saveVersionButton) |
---|
| 2647 | + { |
---|
| 2648 | + // Save a new version |
---|
| 2649 | + if (!Save(true)) |
---|
| 2650 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2651 | + } else |
---|
| 2652 | + if (source == deleteVersionButton) |
---|
| 2653 | + { |
---|
| 2654 | + // Delete a new version |
---|
| 2655 | + DeleteVersion(); |
---|
| 2656 | + } else |
---|
| 2657 | + if (source == oneStepButton) |
---|
| 2658 | + { |
---|
| 2659 | + Globals.ONESTEP = true; |
---|
| 2660 | + cameraView.repaint(); |
---|
| 2661 | + } else |
---|
| 2662 | + if (source == screenfitButton) |
---|
| 2663 | + { |
---|
1803 | 2664 | ScreenFit(); |
---|
1804 | 2665 | } else |
---|
1805 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2666 | + if (source == screenfitpointButton) |
---|
1806 | 2667 | { |
---|
1807 | | - //Reload(lastConverter, lastFilename, true); |
---|
1808 | 2668 | ScreenFitPoint(); |
---|
1809 | 2669 | } else |
---|
1810 | | - if (event.getSource() == snapobjectButton) |
---|
| 2670 | + if (source == snapobjectButton) |
---|
1811 | 2671 | { |
---|
1812 | | - //Reload(lastConverter, lastFilename, true); |
---|
1813 | 2672 | SnapObject(); |
---|
1814 | 2673 | } else |
---|
1815 | 2674 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1818 | 2677 | // Recompile(); |
---|
1819 | 2678 | // refreshContents(); |
---|
1820 | 2679 | // } else |
---|
1821 | | - if (event.getSource() == gcButton) |
---|
| 2680 | + if (source == gcButton) |
---|
1822 | 2681 | { |
---|
1823 | 2682 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1824 | 2683 | System.gc(); |
---|
1825 | 2684 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1826 | 2685 | } else |
---|
1827 | | - if (event.getSource() == editLeafItem) |
---|
| 2686 | + if (source == editLeafItem) |
---|
1828 | 2687 | { |
---|
1829 | 2688 | Object3D obj; |
---|
1830 | 2689 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1838 | 2697 | } |
---|
1839 | 2698 | refreshContents(true); |
---|
1840 | 2699 | } else |
---|
1841 | | - if (event.getSource() == openWindowItem) |
---|
| 2700 | + if (source == openWindowItem) |
---|
1842 | 2701 | { |
---|
1843 | 2702 | EditSelection(true); |
---|
1844 | 2703 | } else |
---|
1845 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2704 | + if (source == cutItem || source == clearButton) |
---|
1846 | 2705 | { |
---|
1847 | 2706 | loadClipboard(true); |
---|
1848 | 2707 | } else |
---|
1849 | | - if (event.getSource() == duplicateItem) |
---|
| 2708 | + if (source == undoItem) |
---|
1850 | 2709 | { |
---|
1851 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2710 | + PreviousVersion(); |
---|
| 2711 | + } else |
---|
| 2712 | + if (source == redoItem) |
---|
| 2713 | + { |
---|
| 2714 | + NextVersion(); |
---|
| 2715 | + } else |
---|
| 2716 | + if (source == duplicateItem) |
---|
| 2717 | + { |
---|
| 2718 | + Object3D keep = Grafreed.clipboard; |
---|
1852 | 2719 | loadClipboard(false); |
---|
1853 | 2720 | paste(false); |
---|
1854 | | - GrafreeD.clipboard = keep; |
---|
| 2721 | + Grafreed.clipboard = keep; |
---|
1855 | 2722 | } else |
---|
1856 | | - if (event.getSource() == cloneItem) |
---|
| 2723 | + if (source == cloneItem) |
---|
1857 | 2724 | { |
---|
1858 | 2725 | CloneSelection(false); |
---|
1859 | 2726 | } else |
---|
1860 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2727 | + if (source == cloneSupportItem) |
---|
1861 | 2728 | { |
---|
1862 | 2729 | CloneSelection(true); |
---|
1863 | 2730 | } else |
---|
1864 | | - if (event.getSource() == copyItem) |
---|
| 2731 | + if (source == copyItem) |
---|
1865 | 2732 | { |
---|
1866 | 2733 | loadClipboard(false); |
---|
1867 | 2734 | } else |
---|
1868 | | - if (event.getSource() == pasteItem) |
---|
| 2735 | + if (source == pasteItem) |
---|
1869 | 2736 | { |
---|
1870 | 2737 | paste(false); |
---|
1871 | 2738 | } else |
---|
1872 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2739 | + if (source == pasteIntoItem) |
---|
1873 | 2740 | { |
---|
1874 | | - pasteInto(false); |
---|
| 2741 | + pasteInto(true, false); |
---|
1875 | 2742 | } else |
---|
1876 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2743 | + if (source == pasteLinkItem) |
---|
1877 | 2744 | { |
---|
1878 | | - pasteInto(true); |
---|
| 2745 | + pasteInto(false, false); |
---|
1879 | 2746 | } else |
---|
1880 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2747 | + if (source == pasteCloneItem) |
---|
| 2748 | + { |
---|
| 2749 | + pasteInto(true, true); |
---|
| 2750 | + } else |
---|
| 2751 | + if (source == pasteExpandItem) |
---|
1881 | 2752 | { |
---|
1882 | 2753 | paste(true); |
---|
1883 | 2754 | } else |
---|
1884 | | - if (event.getSource() == synchronizeItem) |
---|
| 2755 | + if (source == synchronizeItem) |
---|
1885 | 2756 | { |
---|
1886 | 2757 | Overwrite(Object3D.TRANSFORM); |
---|
1887 | 2758 | } else |
---|
1888 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2759 | + if (source == overwriteNameItem) |
---|
1889 | 2760 | { |
---|
1890 | 2761 | Overwrite(Object3D.NAME); |
---|
1891 | 2762 | } else |
---|
1892 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2763 | + if (source == overwriteUVItem) |
---|
1893 | 2764 | { |
---|
1894 | 2765 | Overwrite(Object3D.UV); |
---|
1895 | 2766 | } else |
---|
1896 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2767 | + if (source == overwriteMatItem) |
---|
1897 | 2768 | { |
---|
1898 | 2769 | /* july 2015 |
---|
1899 | 2770 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1913 | 2784 | |
---|
1914 | 2785 | Overwrite(dropAttributes); |
---|
1915 | 2786 | } |
---|
1916 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2787 | + if (source == overwriteGeoItem) |
---|
1917 | 2788 | { |
---|
1918 | 2789 | Overwrite(Object3D.GEOMETRY); |
---|
1919 | 2790 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1930 | 2801 | // refreshContents(); |
---|
1931 | 2802 | // } |
---|
1932 | 2803 | } else |
---|
1933 | | - if (event.getSource() == generateMeshItem) |
---|
| 2804 | + if (source == generateMeshItem) |
---|
1934 | 2805 | { |
---|
1935 | 2806 | //if (group.selection.size() == 1) |
---|
1936 | 2807 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1941 | 2812 | ResetModel(); |
---|
1942 | 2813 | refreshContents(); |
---|
1943 | 2814 | } else |
---|
1944 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2815 | + if (source == extractGeometriesItem) |
---|
1945 | 2816 | { |
---|
1946 | 2817 | boolean one = false; |
---|
1947 | 2818 | |
---|
.. | .. |
---|
1968 | 2839 | ResetModel(); |
---|
1969 | 2840 | refreshContents(); |
---|
1970 | 2841 | } else |
---|
1971 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2842 | + if (source == cloneGeometriesItem) |
---|
1972 | 2843 | { |
---|
1973 | 2844 | boolean one = false; |
---|
1974 | 2845 | |
---|
.. | .. |
---|
1994 | 2865 | ResetModel(); |
---|
1995 | 2866 | refreshContents(); |
---|
1996 | 2867 | } else |
---|
1997 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2868 | + if (source == shareGeometriesItem) |
---|
1998 | 2869 | { |
---|
1999 | 2870 | boolean one = false; |
---|
2000 | 2871 | |
---|
2001 | 2872 | if (group.selection.size() == 1) |
---|
2002 | 2873 | one = true; |
---|
2003 | 2874 | |
---|
| 2875 | + Object3D merge = null; |
---|
| 2876 | + |
---|
2004 | 2877 | Object3D content = new cGroup(); |
---|
2005 | 2878 | |
---|
2006 | 2879 | for (int i=0; i<group.selection.size(); i++) |
---|
2007 | 2880 | { |
---|
2008 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2881 | + merge = new Merge(group.selection.get(i)); |
---|
2009 | 2882 | |
---|
2010 | 2883 | if (one) |
---|
2011 | | - makeSomething(sel, false); |
---|
| 2884 | + makeSomething(merge, false); |
---|
2012 | 2885 | else |
---|
2013 | | - content.addChild(sel); |
---|
| 2886 | + content.addChild(merge); |
---|
2014 | 2887 | } |
---|
2015 | 2888 | |
---|
2016 | 2889 | if (!one) |
---|
2017 | | - makeSomething(content, false); |
---|
2018 | | - |
---|
2019 | | - ResetModel(); |
---|
2020 | | - refreshContents(); |
---|
| 2890 | + makeSomething(content, true); |
---|
| 2891 | + else |
---|
| 2892 | + { |
---|
| 2893 | + ResetModel(); |
---|
| 2894 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2895 | + refreshContents(); |
---|
| 2896 | + } |
---|
2021 | 2897 | } else |
---|
2022 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2898 | + if (source == mergeGeometriesItem) |
---|
2023 | 2899 | { |
---|
2024 | 2900 | boolean one = false; |
---|
2025 | 2901 | |
---|
.. | .. |
---|
2049 | 2925 | ResetModel(); |
---|
2050 | 2926 | refreshContents(); |
---|
2051 | 2927 | } else |
---|
2052 | | - if (event.getSource() == linkverticesItem) |
---|
| 2928 | + if (source == linkverticesItem) |
---|
2053 | 2929 | { |
---|
2054 | 2930 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2055 | 2931 | // { |
---|
.. | .. |
---|
2062 | 2938 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2063 | 2939 | // refreshContents(); |
---|
2064 | 2940 | // } |
---|
2065 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2941 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2066 | 2942 | { |
---|
2067 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2943 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2068 | 2944 | |
---|
2069 | 2945 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2070 | 2946 | content = ((cGroup)content).get(0); |
---|
2071 | 2947 | |
---|
2072 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
| 2948 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2073 | 2949 | for (int i=0; i<group.selection.size(); i++) |
---|
2074 | 2950 | { |
---|
2075 | | - boolean random = CameraPane.RANDOM; |
---|
2076 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2951 | + boolean random = CameraPane.SWITCH; |
---|
| 2952 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2077 | 2953 | group.selection.get(i).linkVerticesThis(content); |
---|
2078 | 2954 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2079 | | - CameraPane.RANDOM = random; |
---|
| 2955 | + CameraPane.SWITCH = random; |
---|
2080 | 2956 | } |
---|
2081 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 2957 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2082 | 2958 | refreshContents(); |
---|
2083 | 2959 | } |
---|
2084 | 2960 | } else |
---|
2085 | | - if (event.getSource() == resetsupportItem) |
---|
| 2961 | + if (source == resetsupportItem) |
---|
2086 | 2962 | { |
---|
2087 | 2963 | for (int i=0; i<group.selection.size(); i++) |
---|
2088 | 2964 | { |
---|
2089 | | - boolean random = CameraPane.RANDOM; |
---|
2090 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2965 | + boolean random = CameraPane.SWITCH; |
---|
| 2966 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2091 | 2967 | group.selection.get(i).linkVerticesThis(null); |
---|
2092 | | - CameraPane.RANDOM = random; |
---|
| 2968 | + CameraPane.SWITCH = random; |
---|
2093 | 2969 | } |
---|
2094 | 2970 | |
---|
2095 | 2971 | refreshContents(); |
---|
2096 | 2972 | } else |
---|
2097 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2973 | + if (source == relinkverticesItem) |
---|
| 2974 | + { |
---|
| 2975 | + boolean random = CameraPane.SWITCH; |
---|
| 2976 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
| 2977 | + group.selection.RelinkToSupport(); |
---|
| 2978 | + CameraPane.SWITCH = random; |
---|
| 2979 | + |
---|
| 2980 | + refreshContents(); |
---|
| 2981 | + } else |
---|
| 2982 | + if (source == resetreferencesItem) |
---|
2098 | 2983 | { |
---|
2099 | 2984 | for (int i=0; i<group.selection.size(); i++) |
---|
2100 | 2985 | { |
---|
.. | .. |
---|
2103 | 2988 | |
---|
2104 | 2989 | refreshContents(); |
---|
2105 | 2990 | } else |
---|
2106 | | - if (event.getSource() == setMasterItem) |
---|
| 2991 | + if (source == setMasterItem) |
---|
2107 | 2992 | { |
---|
2108 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2993 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2109 | 2994 | { |
---|
2110 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2995 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2111 | 2996 | |
---|
2112 | 2997 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2113 | 2998 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2116 | 3001 | refreshContents(); |
---|
2117 | 3002 | } |
---|
2118 | 3003 | } else |
---|
2119 | | - if (event.getSource() == poseMeshItem) |
---|
| 3004 | + if (source == poseMeshItem) |
---|
2120 | 3005 | { |
---|
2121 | 3006 | if (group.selection.size() == 1) |
---|
2122 | 3007 | { |
---|
2123 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 3008 | + if (Grafreed.clipboard.size() == 1) |
---|
2124 | 3009 | { |
---|
2125 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 3010 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2126 | 3011 | |
---|
2127 | 3012 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2128 | 3013 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2135 | 3020 | } |
---|
2136 | 3021 | |
---|
2137 | 3022 | } else |
---|
2138 | | - if (event.getSource() == revertMeshItem) |
---|
| 3023 | + if (source == revertMeshItem) |
---|
2139 | 3024 | { |
---|
2140 | 3025 | RevertMeshes(); |
---|
2141 | 3026 | } else |
---|
2142 | | - if (event.getSource() == resetMeshItem) |
---|
| 3027 | + if (source == resetAllItem) |
---|
2143 | 3028 | { |
---|
2144 | 3029 | ResetAll(); |
---|
2145 | 3030 | } else |
---|
2146 | | - if (event.getSource() == stepAllItem) |
---|
| 3031 | + if (source == stepAllItem) |
---|
2147 | 3032 | { |
---|
2148 | 3033 | StepAll(); |
---|
2149 | 3034 | } else |
---|
2150 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 3035 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2151 | 3036 | { |
---|
2152 | 3037 | //int indices[] = jList.getSelectedIndices(); |
---|
2153 | 3038 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2155 | 3040 | |
---|
2156 | 3041 | ClearSelection(false); |
---|
2157 | 3042 | } else |
---|
2158 | | - if (event.getSource() == clearAllItem) |
---|
| 3043 | + if (source == clearAllItem) |
---|
2159 | 3044 | { |
---|
2160 | 3045 | ClearSelection(true); |
---|
2161 | 3046 | } else |
---|
2162 | | - if (event.getSource() == grabItem) |
---|
| 3047 | + if (source == grabItem || source == groupButton) |
---|
2163 | 3048 | { |
---|
2164 | | - group(new cGroup(), true); |
---|
| 3049 | + group(new cGroup(), false); // true); |
---|
2165 | 3050 | } else |
---|
2166 | | - if (event.getSource() == frontItem) |
---|
| 3051 | + if (source == hideItem) |
---|
| 3052 | + { |
---|
| 3053 | + group(new HiddenObject()); |
---|
| 3054 | + } else |
---|
| 3055 | + if (source == frontItem) |
---|
2167 | 3056 | { |
---|
2168 | 3057 | front(); |
---|
2169 | 3058 | } else |
---|
2170 | | - if (event.getSource() == backItem) |
---|
| 3059 | + if (source == backItem) |
---|
2171 | 3060 | { |
---|
2172 | 3061 | back(); |
---|
2173 | 3062 | } else |
---|
2174 | | - if (event.getSource() == cameraItem) |
---|
| 3063 | + if (source == cameraItem) |
---|
2175 | 3064 | { |
---|
2176 | 3065 | makeSomething(new Camera()); |
---|
2177 | 3066 | } else |
---|
2178 | | - if (event.getSource() == compositeItem) |
---|
| 3067 | + if (source == compositeItem || source == compositeButton) |
---|
2179 | 3068 | { |
---|
2180 | 3069 | group(new Composite()); |
---|
2181 | 3070 | } else |
---|
2182 | | - if (event.getSource() == randomItem) |
---|
| 3071 | + if (source == switchItem || source == switchButton) |
---|
2183 | 3072 | { |
---|
2184 | 3073 | RandomNode random = new RandomNode(); |
---|
2185 | 3074 | group(random); |
---|
2186 | 3075 | if (random.size() > 0) |
---|
2187 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 3076 | + random.name = random.get(0).name + "Switch"; |
---|
2188 | 3077 | } else |
---|
2189 | | - if (event.getSource() == physicsItem) |
---|
| 3078 | + if (source == physicsItem) |
---|
2190 | 3079 | { |
---|
2191 | 3080 | group(new PhysicsNode()); |
---|
2192 | 3081 | } else |
---|
2193 | | - if (event.getSource() == frameselectorItem) |
---|
| 3082 | + if (source == frameselectorItem) |
---|
2194 | 3083 | { |
---|
2195 | 3084 | for (int i=0; i<group.selection.size(); i++) |
---|
2196 | 3085 | { |
---|
.. | .. |
---|
2202 | 3091 | ResetModel(); |
---|
2203 | 3092 | refreshContents(); |
---|
2204 | 3093 | } else |
---|
2205 | | - if (event.getSource() == switchGeoItem) |
---|
| 3094 | + if (source == switchGeoItem) |
---|
2206 | 3095 | { |
---|
2207 | 3096 | for (int i=0; i<group.selection.size(); i++) |
---|
2208 | 3097 | { |
---|
.. | .. |
---|
2214 | 3103 | ResetModel(); |
---|
2215 | 3104 | refreshContents(); |
---|
2216 | 3105 | } else |
---|
2217 | | - if (event.getSource() == switchTransfoItem) |
---|
| 3106 | + if (source == switchTransfoItem) |
---|
2218 | 3107 | { |
---|
2219 | 3108 | for (int i=0; i<group.selection.size(); i++) |
---|
2220 | 3109 | { |
---|
.. | .. |
---|
2226 | 3115 | ResetModel(); |
---|
2227 | 3116 | refreshContents(); |
---|
2228 | 3117 | } else |
---|
2229 | | - if (event.getSource() == morphItem) |
---|
| 3118 | + if (source == morphItem) |
---|
2230 | 3119 | { |
---|
2231 | 3120 | for (int i=0; i<group.selection.size(); i++) |
---|
2232 | 3121 | { |
---|
.. | .. |
---|
2238 | 3127 | ResetModel(); |
---|
2239 | 3128 | refreshContents(); |
---|
2240 | 3129 | } else |
---|
2241 | | - if (event.getSource() == scriptNodeItem) |
---|
| 3130 | + if (source == scriptNodeItem) |
---|
2242 | 3131 | { |
---|
2243 | 3132 | boolean atleastone = false; |
---|
2244 | 3133 | |
---|
.. | .. |
---|
2277 | 3166 | } |
---|
2278 | 3167 | } |
---|
2279 | 3168 | } else |
---|
2280 | | - if (event.getSource() == linkerItem) |
---|
| 3169 | + if (source == linkerItem) |
---|
2281 | 3170 | { |
---|
2282 | 3171 | group(new cLinker()); |
---|
2283 | 3172 | } else |
---|
2284 | | - if (event.getSource() == textureItem) |
---|
| 3173 | + if (source == textureItem || source == textureButton) |
---|
2285 | 3174 | { |
---|
2286 | 3175 | group(new TextureNode()); |
---|
2287 | 3176 | } else |
---|
2288 | | - if (event.getSource() == shadowXItem) |
---|
| 3177 | + if (source == billboardItem) |
---|
| 3178 | + { |
---|
| 3179 | + group(new BillboardNode()); |
---|
| 3180 | + } else |
---|
| 3181 | + if (source == shadowXItem) |
---|
2289 | 3182 | { |
---|
2290 | 3183 | CastShadow(0); |
---|
2291 | 3184 | } else |
---|
2292 | | - if (event.getSource() == shadowYItem) |
---|
| 3185 | + if (source == shadowYItem) |
---|
2293 | 3186 | { |
---|
2294 | 3187 | CastShadow(1); |
---|
2295 | 3188 | } else |
---|
2296 | | - if (event.getSource() == shadowZItem) |
---|
| 3189 | + if (source == shadowZItem) |
---|
2297 | 3190 | { |
---|
2298 | 3191 | CastShadow(2); |
---|
2299 | 3192 | } else |
---|
2300 | | - if (event.getSource() == ungroupItem) |
---|
| 3193 | + if (source == ungroupItem || source == ungroupButton) |
---|
2301 | 3194 | { |
---|
2302 | | - ungroup(); |
---|
| 3195 | + boolean hasRoot = false; |
---|
| 3196 | + |
---|
| 3197 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3198 | + { |
---|
| 3199 | + if (group.selection.get(i) == group) |
---|
| 3200 | + { |
---|
| 3201 | + hasRoot = true; |
---|
| 3202 | + break; |
---|
| 3203 | + } |
---|
| 3204 | + } |
---|
| 3205 | + |
---|
| 3206 | + if (!hasRoot) |
---|
| 3207 | + { |
---|
| 3208 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3209 | + { |
---|
| 3210 | + Ungroup(group.selection.get(i)); |
---|
| 3211 | + } |
---|
| 3212 | + |
---|
| 3213 | + ClearSelection(false); |
---|
| 3214 | + |
---|
| 3215 | + refreshContents(); |
---|
| 3216 | + } |
---|
2303 | 3217 | } else |
---|
2304 | | - if (event.getSource() == genUVItem) |
---|
| 3218 | + if (source == genUVItem) |
---|
2305 | 3219 | { |
---|
2306 | 3220 | GenUV(); |
---|
2307 | 3221 | } else |
---|
2308 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 3222 | + if (source == genNormalsCADItem) |
---|
2309 | 3223 | { |
---|
2310 | 3224 | GenNormals(true); |
---|
2311 | 3225 | } else |
---|
2312 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 3226 | + if (source == genNormalsMESHItem) |
---|
| 3227 | + { |
---|
| 3228 | + GenNormalsMESH(); |
---|
| 3229 | + } else |
---|
| 3230 | + if (source == genNormalsORGANItem) |
---|
2313 | 3231 | { |
---|
2314 | 3232 | GenNormals(false); |
---|
2315 | 3233 | } else |
---|
2316 | | - if (event.getSource() == stripifyItem) |
---|
| 3234 | + if (source == genNormalsMINEItem) |
---|
| 3235 | + { |
---|
| 3236 | + GenNormalsMINE(); |
---|
| 3237 | + } else |
---|
| 3238 | + if (source == stripifyItem) |
---|
2317 | 3239 | { |
---|
2318 | 3240 | Stripify(); |
---|
2319 | 3241 | } else |
---|
2320 | | - if (event.getSource() == unstripifyItem) |
---|
| 3242 | + if (source == unstripifyItem) |
---|
2321 | 3243 | { |
---|
2322 | 3244 | Unstripify(); |
---|
2323 | 3245 | } else |
---|
2324 | | - if (event.getSource() == trimItem) |
---|
| 3246 | + if (source == trimItem) |
---|
2325 | 3247 | { |
---|
2326 | 3248 | Trim(); |
---|
2327 | 3249 | } else |
---|
2328 | | - if (event.getSource() == untrimItem) |
---|
| 3250 | + if (source == untrimItem) |
---|
2329 | 3251 | { |
---|
2330 | 3252 | Untrim(); |
---|
2331 | 3253 | } else |
---|
2332 | | - if (event.getSource() == clearColorsItem) |
---|
| 3254 | + if (source == clearColorsItem) |
---|
2333 | 3255 | { |
---|
2334 | 3256 | ClearColors(); |
---|
2335 | 3257 | } else |
---|
2336 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 3258 | + if (source == clearMaterialsItem) |
---|
2337 | 3259 | { |
---|
2338 | 3260 | ClearMaterials(); |
---|
2339 | 3261 | } else |
---|
2340 | | - if (event.getSource() == liveleavesItem) |
---|
| 3262 | + if (source == liveleavesItem) |
---|
2341 | 3263 | { |
---|
2342 | 3264 | LiveLeaves(true); |
---|
2343 | 3265 | } else |
---|
2344 | | - if (event.getSource() == unliveleavesItem) |
---|
| 3266 | + if (source == unliveleavesItem) |
---|
2345 | 3267 | { |
---|
2346 | 3268 | LiveLeaves(false); |
---|
2347 | 3269 | } else |
---|
2348 | | - if (event.getSource() == supportleavesItem) |
---|
| 3270 | + if (source == supportleavesItem) |
---|
2349 | 3271 | { |
---|
2350 | 3272 | SupportLeaves(true); |
---|
2351 | 3273 | } else |
---|
2352 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 3274 | + if (source == unsupportleavesItem) |
---|
2353 | 3275 | { |
---|
2354 | 3276 | SupportLeaves(false); |
---|
2355 | 3277 | } else |
---|
2356 | | - if (event.getSource() == hideleavesItem) |
---|
| 3278 | + if (source == hideleavesItem) |
---|
2357 | 3279 | { |
---|
2358 | 3280 | HideLeaves(true); |
---|
2359 | 3281 | } else |
---|
2360 | | - if (event.getSource() == showleavesItem) |
---|
| 3282 | + if (source == showleavesItem) |
---|
2361 | 3283 | { |
---|
2362 | 3284 | HideLeaves(false); |
---|
2363 | 3285 | } else |
---|
2364 | | - if (event.getSource() == markleavesItem) |
---|
| 3286 | + if (source == markleavesItem) |
---|
2365 | 3287 | { |
---|
2366 | 3288 | MarkLeaves(true); |
---|
2367 | 3289 | } else |
---|
2368 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 3290 | + if (source == unmarkleavesItem) |
---|
2369 | 3291 | { |
---|
2370 | 3292 | MarkLeaves(false); |
---|
2371 | 3293 | } else |
---|
2372 | | - if (event.getSource() == flipVItem) |
---|
| 3294 | + if (source == rewindleavesItem) |
---|
| 3295 | + { |
---|
| 3296 | + RewindLeaves(true); |
---|
| 3297 | + } else |
---|
| 3298 | + if (source == unrewindleavesItem) |
---|
| 3299 | + { |
---|
| 3300 | + RewindLeaves(false); |
---|
| 3301 | + } else |
---|
| 3302 | + if (source == randomleavesItem) |
---|
| 3303 | + { |
---|
| 3304 | + RandomLeaves(true); |
---|
| 3305 | + } else |
---|
| 3306 | + if (source == unrandomleavesItem) |
---|
| 3307 | + { |
---|
| 3308 | + RandomLeaves(false); |
---|
| 3309 | + } else |
---|
| 3310 | + if (source == flipVItem) |
---|
2373 | 3311 | { |
---|
2374 | 3312 | FlipV(true); |
---|
2375 | 3313 | } else |
---|
2376 | | - if (event.getSource() == unflipVItem) |
---|
| 3314 | + if (source == unflipVItem) |
---|
2377 | 3315 | { |
---|
2378 | 3316 | FlipV(false); |
---|
2379 | 3317 | } else |
---|
2380 | | - if (event.getSource() == lowTexturesItem) |
---|
| 3318 | + if (source == lowTexturesItem) |
---|
2381 | 3319 | { |
---|
2382 | 3320 | SetTexRes(0); |
---|
2383 | 3321 | } else |
---|
2384 | | - if (event.getSource() == normalTexturesItem) |
---|
| 3322 | + if (source == normalTexturesItem) |
---|
2385 | 3323 | { |
---|
2386 | 3324 | SetTexRes(1); |
---|
2387 | 3325 | } else |
---|
2388 | | - if (event.getSource() == highTexturesItem) |
---|
| 3326 | + if (source == highTexturesItem) |
---|
2389 | 3327 | { |
---|
2390 | 3328 | SetTexRes(2); |
---|
2391 | 3329 | } else |
---|
2392 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 3330 | + if (source == veryhighTexturesItem) |
---|
2393 | 3331 | { |
---|
2394 | 3332 | SetTexRes(3); |
---|
2395 | 3333 | } else |
---|
2396 | | - if (event.getSource() == maxTexturesItem) |
---|
| 3334 | + if (source == maxTexturesItem) |
---|
2397 | 3335 | { |
---|
2398 | 3336 | SetTexRes(4); |
---|
2399 | 3337 | } else |
---|
2400 | | - if (event.getSource() == panoTexturesItem) |
---|
| 3338 | + if (source == panoTexturesItem) |
---|
2401 | 3339 | { |
---|
2402 | 3340 | SetTexRes(5); |
---|
2403 | 3341 | } else |
---|
2404 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 3342 | + if (source == reverseNormalsItem) |
---|
2405 | 3343 | { |
---|
2406 | 3344 | ReverseNormals(); |
---|
2407 | 3345 | } else |
---|
2408 | | - if (event.getSource() == parseverticesItem) |
---|
| 3346 | + if (source == parseverticesItem) |
---|
2409 | 3347 | { |
---|
2410 | 3348 | ParseVertices(); |
---|
2411 | 3349 | } else |
---|
2412 | | - if (event.getSource() == textureFieldItem) |
---|
| 3350 | + if (source == textureFieldItem) |
---|
2413 | 3351 | { |
---|
2414 | 3352 | TextureVertices(); |
---|
2415 | 3353 | } else |
---|
2416 | | - if (event.getSource() == alignItem) |
---|
| 3354 | + if (source == alignItem) |
---|
2417 | 3355 | { |
---|
2418 | 3356 | Align(); |
---|
2419 | 3357 | } else |
---|
2420 | | - if (event.getSource() == mirrorItem) |
---|
| 3358 | + if (source == mirrorItem) |
---|
2421 | 3359 | { |
---|
2422 | 3360 | MirrorPoses(); |
---|
2423 | 3361 | } else |
---|
2424 | | - if (event.getSource() == reduceMorphItem) |
---|
| 3362 | + if (source == reduceMorphItem) |
---|
2425 | 3363 | { |
---|
2426 | 3364 | MeshReduction(false); |
---|
2427 | 3365 | } else |
---|
2428 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 3366 | + if (source == reduce34MorphItem) |
---|
2429 | 3367 | { |
---|
2430 | 3368 | MeshReduction(true); |
---|
2431 | 3369 | } else |
---|
2432 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 3370 | + if (source == reverseTrianglesItem) |
---|
2433 | 3371 | { |
---|
2434 | 3372 | ReverseTriangles(); |
---|
2435 | 3373 | } else |
---|
2436 | | - if (event.getSource() == reduceMeshItem) |
---|
| 3374 | + if (source == reduceMeshItem) |
---|
2437 | 3375 | { |
---|
2438 | 3376 | ReduceMesh(false); |
---|
2439 | 3377 | } else |
---|
2440 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 3378 | + if (source == reduce34MeshItem) |
---|
2441 | 3379 | { |
---|
2442 | 3380 | ReduceMesh(true); |
---|
2443 | 3381 | } else |
---|
2444 | | - if (event.getSource() == increaseMeshItem) |
---|
| 3382 | + if (source == increaseMeshItem) |
---|
2445 | 3383 | { |
---|
2446 | 3384 | IncreaseMesh(); |
---|
2447 | 3385 | } else |
---|
2448 | | - if (event.getSource() == clipMeshItem) |
---|
| 3386 | + if (source == clipMeshItem) |
---|
2449 | 3387 | { |
---|
2450 | 3388 | ClipMesh(); |
---|
2451 | 3389 | } else |
---|
2452 | | - if (event.getSource() == smoothMeshItem) |
---|
| 3390 | + if (source == smoothMeshItem) |
---|
2453 | 3391 | { |
---|
2454 | 3392 | SmoothMesh(); |
---|
2455 | 3393 | } else |
---|
2456 | | - if (event.getSource() == transformgeometryItem) |
---|
| 3394 | + if (source == transformGeometryItem) |
---|
2457 | 3395 | { |
---|
2458 | 3396 | TransformGeometry(); |
---|
2459 | 3397 | } else |
---|
2460 | | - if (event.getSource() == resetTransformItem) |
---|
| 3398 | + if (source == transformChildrenItem) |
---|
| 3399 | + { |
---|
| 3400 | + TransformChildren(); |
---|
| 3401 | + } else |
---|
| 3402 | + if (source == resetTransformItem) |
---|
2461 | 3403 | { |
---|
2462 | 3404 | ResetTransform(); |
---|
2463 | 3405 | } else |
---|
2464 | | - if (event.getSource() == resetCentroidItem) |
---|
| 3406 | + if (source == resetCentroidItem) |
---|
2465 | 3407 | { |
---|
2466 | | - ResetCentroid(); |
---|
| 3408 | + ResetCentroid(true); |
---|
2467 | 3409 | } else |
---|
2468 | | - if (event.getSource() == resetParentItem) |
---|
| 3410 | + if (source == resetCentroidXZItem) |
---|
| 3411 | + { |
---|
| 3412 | + ResetCentroid(false); |
---|
| 3413 | + } else |
---|
| 3414 | + if (source == resetParentItem) |
---|
2469 | 3415 | { |
---|
2470 | 3416 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2471 | 3417 | { |
---|
.. | .. |
---|
2475 | 3421 | |
---|
2476 | 3422 | refreshContents(); |
---|
2477 | 3423 | } else |
---|
2478 | | - if (event.getSource() == repairParentItem) |
---|
| 3424 | + if (source == repairParentItem) |
---|
2479 | 3425 | { |
---|
2480 | 3426 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2481 | 3427 | { |
---|
.. | .. |
---|
2489 | 3435 | |
---|
2490 | 3436 | refreshContents(); |
---|
2491 | 3437 | } else |
---|
2492 | | - if (event.getSource() == sortbysizeItem) |
---|
| 3438 | + if (source == repairShadowItem) |
---|
| 3439 | + { |
---|
| 3440 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3441 | + { |
---|
| 3442 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 3443 | + obj.RepairShadow(); |
---|
| 3444 | +// for (int i=0; i<obj.size(); i++) |
---|
| 3445 | +// { |
---|
| 3446 | +// obj.get(i).parent = obj; |
---|
| 3447 | +// } |
---|
| 3448 | + } |
---|
| 3449 | + |
---|
| 3450 | + refreshContents(); |
---|
| 3451 | + } else |
---|
| 3452 | + if (source == sortbysizeItem) |
---|
2493 | 3453 | { |
---|
2494 | 3454 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2495 | 3455 | { |
---|
.. | .. |
---|
2501 | 3461 | ResetModel(); |
---|
2502 | 3462 | refreshContents(); |
---|
2503 | 3463 | } else |
---|
2504 | | - if (event.getSource() == sortbynameItem) |
---|
| 3464 | + if (source == sortbynameItem) |
---|
2505 | 3465 | { |
---|
2506 | 3466 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2507 | 3467 | { |
---|
.. | .. |
---|
2513 | 3473 | ResetModel(); |
---|
2514 | 3474 | refreshContents(); |
---|
2515 | 3475 | } else |
---|
2516 | | - if (event.getSource() == attachPigmentItem) |
---|
| 3476 | + if (source == attachPigmentItem) |
---|
2517 | 3477 | { |
---|
2518 | 3478 | String texture = GetFile("Attach pigment"); |
---|
2519 | 3479 | Object3D obj; |
---|
.. | .. |
---|
2525 | 3485 | |
---|
2526 | 3486 | refreshContents(); |
---|
2527 | 3487 | } else |
---|
2528 | | - if (event.getSource() == detachPigmentItem) |
---|
| 3488 | + if (source == detachPigmentItem) |
---|
2529 | 3489 | { |
---|
2530 | 3490 | Object3D obj; |
---|
2531 | 3491 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2536 | 3496 | |
---|
2537 | 3497 | refreshContents(); |
---|
2538 | 3498 | } else |
---|
2539 | | - if (event.getSource() == attachBumpItem) |
---|
| 3499 | + if (source == attachBumpItem) |
---|
2540 | 3500 | { |
---|
2541 | 3501 | String texture = GetFile("Attach bump"); |
---|
2542 | 3502 | Object3D obj; |
---|
.. | .. |
---|
2548 | 3508 | |
---|
2549 | 3509 | refreshContents(); |
---|
2550 | 3510 | } else |
---|
2551 | | - if (event.getSource() == detachBumpItem) |
---|
| 3511 | + if (source == detachBumpItem) |
---|
2552 | 3512 | { |
---|
2553 | 3513 | Object3D obj; |
---|
2554 | 3514 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2555 | 3515 | { |
---|
2556 | 3516 | obj = (Object3D)e.nextElement(); |
---|
2557 | | - obj.SetBumpTexture(null); |
---|
| 3517 | + obj.ResetBumpTexture(); |
---|
2558 | 3518 | } |
---|
2559 | 3519 | |
---|
2560 | 3520 | refreshContents(); |
---|
2561 | 3521 | } else |
---|
2562 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 3522 | + if (source == pigmentBumpItem) |
---|
2563 | 3523 | { |
---|
2564 | 3524 | Object3D obj; |
---|
2565 | 3525 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2570 | 3530 | |
---|
2571 | 3531 | refreshContents(); |
---|
2572 | 3532 | } else |
---|
2573 | | - if (event.getSource() == flashSelectionButton) |
---|
| 3533 | + if (source == embedTexturesItem) |
---|
| 3534 | + { |
---|
| 3535 | + Object3D obj; |
---|
| 3536 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3537 | + { |
---|
| 3538 | + obj = (Object3D)e.nextElement(); |
---|
| 3539 | + obj.EmbedTextures(true); |
---|
| 3540 | + } |
---|
| 3541 | + |
---|
| 3542 | + refreshContents(); |
---|
| 3543 | + } else |
---|
| 3544 | + if (source == deEmbedTexturesItem) |
---|
| 3545 | + { |
---|
| 3546 | + Object3D obj; |
---|
| 3547 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3548 | + { |
---|
| 3549 | + obj = (Object3D)e.nextElement(); |
---|
| 3550 | + obj.EmbedTextures(false); |
---|
| 3551 | + } |
---|
| 3552 | + |
---|
| 3553 | + CameraPane.texturepigment.clear(); |
---|
| 3554 | + CameraPane.texturebump.clear(); |
---|
| 3555 | + |
---|
| 3556 | + refreshContents(); |
---|
| 3557 | + } else |
---|
| 3558 | + if (source == flashSelectionButton) |
---|
2574 | 3559 | { |
---|
2575 | 3560 | CameraPane.flash = true; |
---|
2576 | 3561 | refreshContents(); |
---|
2577 | 3562 | } else |
---|
2578 | | - if (event.getSource() == oneButton) |
---|
| 3563 | + if (source == oneButton) |
---|
2579 | 3564 | { |
---|
2580 | 3565 | } else |
---|
2581 | | - if (event.getSource() == twoButton) |
---|
| 3566 | + if (source == twoButton) |
---|
2582 | 3567 | { |
---|
2583 | 3568 | radio.layout = twoButton; |
---|
| 3569 | + |
---|
| 3570 | + if (CameraPane.FULLSCREEN) |
---|
| 3571 | + fullscreenLayout = radio.layout; |
---|
| 3572 | + |
---|
2584 | 3573 | // bug |
---|
2585 | 3574 | //gridPanel.setDividerLocation(1.0); |
---|
2586 | 3575 | //bigPanel.setDividerLocation(0.0); |
---|
2587 | | - bigThree.remove(jtp); |
---|
2588 | | - bigThree.remove(cameraPanel); |
---|
2589 | | - bigThree.remove(XYZPanel); |
---|
2590 | | - aWindowConstraints.gridx = 0; |
---|
2591 | | - aWindowConstraints.gridy = 0; |
---|
2592 | | - aWindowConstraints.gridwidth = 1; |
---|
2593 | | - // aConstraints.gridheight = 3; |
---|
2594 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2595 | | - aWindowConstraints.weightx = 0; |
---|
2596 | | - aWindowConstraints.weighty = 1; |
---|
2597 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2598 | | - aWindowConstraints.weightx = 1; |
---|
2599 | | - aWindowConstraints.gridwidth = 3; |
---|
2600 | | - // aConstraints.gridheight = 3; |
---|
2601 | | - aWindowConstraints.gridx = 1; |
---|
2602 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2603 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2604 | | - aWindowConstraints.weightx = 0; |
---|
2605 | | - aWindowConstraints.gridx = 4; |
---|
2606 | | - aWindowConstraints.gridwidth = 1; |
---|
2607 | | - // aConstraints.gridheight = 3; |
---|
2608 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2609 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2610 | | - bigThree.revalidate(); |
---|
| 3576 | +// bigThree.remove(scenePanel); |
---|
| 3577 | +// bigThree.remove(centralPanel); |
---|
| 3578 | +// bigThree.remove(XYZPanel); |
---|
| 3579 | +// aWindowConstraints.gridx = 0; |
---|
| 3580 | +// aWindowConstraints.gridy = 0; |
---|
| 3581 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3582 | +// // aConstraints.gridheight = 3; |
---|
| 3583 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3584 | +// aWindowConstraints.weightx = 0; |
---|
| 3585 | +// aWindowConstraints.weighty = 1; |
---|
| 3586 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3587 | +// aWindowConstraints.weightx = 1; |
---|
| 3588 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3589 | +// // aConstraints.gridheight = 3; |
---|
| 3590 | +// aWindowConstraints.gridx = 1; |
---|
| 3591 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3592 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3593 | +// aWindowConstraints.weightx = 0; |
---|
| 3594 | +// aWindowConstraints.gridx = 4; |
---|
| 3595 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3596 | +// // aConstraints.gridheight = 3; |
---|
| 3597 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3598 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3599 | +// scenePanel.setVisible(false); |
---|
| 3600 | +// centralPanel.setVisible(true); |
---|
| 3601 | +// XYZPanel.setVisible(false); |
---|
| 3602 | + bigThree.ClearUI(); |
---|
| 3603 | + bigThree.add(centralPanel); |
---|
| 3604 | + bigThree.FlushUI(); |
---|
| 3605 | + |
---|
| 3606 | + cameraView.requestFocusInWindow(); |
---|
| 3607 | + |
---|
| 3608 | +// refreshContents(true); |
---|
| 3609 | +// |
---|
| 3610 | +// try |
---|
| 3611 | +// { |
---|
| 3612 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3613 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3614 | +// bot.mouseMove(100, 100); |
---|
| 3615 | +// bot.mousePress(mask); |
---|
| 3616 | +// bot.mouseRelease(mask); |
---|
| 3617 | +// } |
---|
| 3618 | +// catch (Exception e) |
---|
| 3619 | +// { |
---|
| 3620 | +// |
---|
| 3621 | +// } |
---|
| 3622 | + |
---|
2611 | 3623 | } else |
---|
2612 | | - if (event.getSource() == threeButton) |
---|
| 3624 | + if (source == threeButton) |
---|
2613 | 3625 | { |
---|
2614 | 3626 | radio.layout = threeButton; |
---|
2615 | | - bigThree.remove(jtp); |
---|
2616 | | - bigThree.remove(cameraPanel); |
---|
2617 | | - bigThree.remove(XYZPanel); |
---|
2618 | | - aWindowConstraints.gridx = 0; |
---|
2619 | | - aWindowConstraints.gridy = 0; |
---|
2620 | | - aWindowConstraints.gridwidth = 1; |
---|
2621 | | - // aConstraints.gridheight = 3; |
---|
2622 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2623 | | - aWindowConstraints.weightx = 0; |
---|
2624 | | - aWindowConstraints.weighty = 1; |
---|
2625 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2626 | | - aWindowConstraints.weightx = 1; |
---|
2627 | | - aWindowConstraints.gridwidth = 3; |
---|
2628 | | - // aConstraints.gridheight = 3; |
---|
2629 | | - aWindowConstraints.gridx = 1; |
---|
2630 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2631 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2632 | | - aWindowConstraints.weightx = 0; |
---|
2633 | | - aWindowConstraints.gridx = 4; |
---|
2634 | | - aWindowConstraints.gridwidth = 1; |
---|
2635 | | - // aConstraints.gridheight = 3; |
---|
2636 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2637 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2638 | | - bigThree.revalidate(); |
---|
| 3627 | + |
---|
| 3628 | + if (CameraPane.FULLSCREEN) |
---|
| 3629 | + fullscreenLayout = radio.layout; |
---|
| 3630 | + |
---|
| 3631 | +// bigThree.remove(scenePanel); |
---|
| 3632 | +// bigThree.remove(centralPanel); |
---|
| 3633 | +// bigThree.remove(XYZPanel); |
---|
| 3634 | +// aWindowConstraints.gridx = 0; |
---|
| 3635 | +// aWindowConstraints.gridy = 0; |
---|
| 3636 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3637 | +// // aConstraints.gridheight = 3; |
---|
| 3638 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3639 | +// aWindowConstraints.weightx = 0; |
---|
| 3640 | +// aWindowConstraints.weighty = 1; |
---|
| 3641 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3642 | +// aWindowConstraints.weightx = 1; |
---|
| 3643 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3644 | +// // aConstraints.gridheight = 3; |
---|
| 3645 | +// aWindowConstraints.gridx = 1; |
---|
| 3646 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3647 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3648 | +// aWindowConstraints.weightx = 0; |
---|
| 3649 | +// aWindowConstraints.gridx = 4; |
---|
| 3650 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3651 | +// // aConstraints.gridheight = 3; |
---|
| 3652 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3653 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3654 | +// bigThree.validate(); |
---|
| 3655 | +// scenePanel.setVisible(false); |
---|
| 3656 | +// centralPanel.setVisible(true); |
---|
| 3657 | +// XYZPanel.setVisible(true); |
---|
| 3658 | + bigThree.ClearUI(); |
---|
| 3659 | + bigThree.add(scenePanel); |
---|
| 3660 | + bigThree.add(centralPanel); |
---|
| 3661 | + bigThree.FlushUI(); |
---|
| 3662 | + |
---|
| 3663 | + cameraView.requestFocusInWindow(); |
---|
2639 | 3664 | } else |
---|
2640 | | - if (event.getSource() == fourButton) |
---|
| 3665 | + if (source == fourButton) |
---|
2641 | 3666 | { |
---|
2642 | 3667 | radio.layout = fourButton; |
---|
2643 | | - bigThree.remove(jtp); |
---|
2644 | | - bigThree.remove(cameraPanel); |
---|
2645 | | - bigThree.remove(XYZPanel); |
---|
2646 | | - aWindowConstraints.gridx = 0; |
---|
2647 | | - aWindowConstraints.gridy = 0; |
---|
2648 | | - aWindowConstraints.gridwidth = 1; |
---|
2649 | | - // aWindowConstraints.gridheight = 3; |
---|
2650 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2651 | | - aWindowConstraints.weightx = 1; |
---|
2652 | | - aWindowConstraints.weighty = 1; |
---|
2653 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2654 | | - aWindowConstraints.weightx = 1; |
---|
2655 | | - aWindowConstraints.gridwidth = 3; |
---|
2656 | | - // aConstraints.gridheight = 3; |
---|
2657 | | - aWindowConstraints.gridx = 1; |
---|
2658 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2659 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2660 | | - aWindowConstraints.weightx = 0; |
---|
2661 | | - aWindowConstraints.gridx = 4; |
---|
2662 | | - aWindowConstraints.gridwidth = 1; |
---|
2663 | | - // aWindowConstraints.gridheight = 3; |
---|
2664 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2665 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2666 | | - bigThree.revalidate(); |
---|
| 3668 | + |
---|
| 3669 | + if (CameraPane.FULLSCREEN) |
---|
| 3670 | + fullscreenLayout = radio.layout; |
---|
| 3671 | + |
---|
| 3672 | +// bigThree.remove(scenePanel); |
---|
| 3673 | +// bigThree.remove(centralPanel); |
---|
| 3674 | +// bigThree.remove(XYZPanel); |
---|
| 3675 | +// aWindowConstraints.gridx = 0; |
---|
| 3676 | +// aWindowConstraints.gridy = 0; |
---|
| 3677 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3678 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3679 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3680 | +// aWindowConstraints.weightx = 1; |
---|
| 3681 | +// aWindowConstraints.weighty = 1; |
---|
| 3682 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3683 | +// aWindowConstraints.weightx = 1; |
---|
| 3684 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3685 | +// // aConstraints.gridheight = 3; |
---|
| 3686 | +// aWindowConstraints.gridx = 1; |
---|
| 3687 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3688 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3689 | +// aWindowConstraints.weightx = 0; |
---|
| 3690 | +// aWindowConstraints.gridx = 4; |
---|
| 3691 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3692 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3693 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3694 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3695 | +// bigThree.validate(); |
---|
| 3696 | +// scenePanel.setVisible(true); |
---|
| 3697 | +// centralPanel.setVisible(false); |
---|
| 3698 | +// XYZPanel.setVisible(false); |
---|
| 3699 | + bigThree.ClearUI(); |
---|
| 3700 | + bigThree.add(scenePanel); |
---|
| 3701 | + bigThree.FlushUI(); |
---|
| 3702 | + |
---|
| 3703 | + cameraView.requestFocusInWindow(); |
---|
2667 | 3704 | } else |
---|
2668 | | - if (event.getSource() == sixButton) |
---|
| 3705 | + if (source == sixButton) |
---|
2669 | 3706 | { |
---|
2670 | 3707 | radio.layout = sixButton; |
---|
2671 | | - bigThree.remove(jtp); |
---|
2672 | | - bigThree.remove(cameraPanel); |
---|
2673 | | - bigThree.remove(XYZPanel); |
---|
2674 | | - aWindowConstraints.gridx = 0; |
---|
2675 | | - aWindowConstraints.gridy = 0; |
---|
2676 | | - aWindowConstraints.gridwidth = 1; |
---|
2677 | | - // aConstraints.gridheight = 3; |
---|
2678 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2679 | | - aWindowConstraints.weightx = 0; |
---|
2680 | | - aWindowConstraints.weighty = 1; |
---|
2681 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2682 | | - aWindowConstraints.weightx = 1; |
---|
2683 | | - aWindowConstraints.gridwidth = 3; |
---|
2684 | | - // aWindowConstraints.gridheight = 3; |
---|
2685 | | - aWindowConstraints.gridx = 1; |
---|
2686 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2687 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2688 | | - aWindowConstraints.weightx = 0; |
---|
2689 | | - aWindowConstraints.gridx = 4; |
---|
2690 | | - aWindowConstraints.gridwidth = 1; |
---|
2691 | | - // aWindowConstraints.gridheight = 3; |
---|
2692 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2693 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2694 | | - bigThree.revalidate(); |
---|
| 3708 | + |
---|
| 3709 | + if (CameraPane.FULLSCREEN) |
---|
| 3710 | + fullscreenLayout = radio.layout; |
---|
| 3711 | + |
---|
| 3712 | +// bigThree.remove(scenePanel); |
---|
| 3713 | +// bigThree.remove(centralPanel); |
---|
| 3714 | +// bigThree.remove(XYZPanel); |
---|
| 3715 | +// aWindowConstraints.gridx = 0; |
---|
| 3716 | +// aWindowConstraints.gridy = 0; |
---|
| 3717 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3718 | +// // aConstraints.gridheight = 3; |
---|
| 3719 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3720 | +// aWindowConstraints.weightx = 0; |
---|
| 3721 | +// aWindowConstraints.weighty = 1; |
---|
| 3722 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3723 | +// aWindowConstraints.weightx = 1; |
---|
| 3724 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3725 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3726 | +// aWindowConstraints.gridx = 1; |
---|
| 3727 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3728 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3729 | +// aWindowConstraints.weightx = 0; |
---|
| 3730 | +// aWindowConstraints.gridx = 4; |
---|
| 3731 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3732 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3733 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3734 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3735 | +// bigThree.validate(); |
---|
| 3736 | +// scenePanel.setVisible(true); |
---|
| 3737 | +// centralPanel.setVisible(true); |
---|
| 3738 | +// XYZPanel.setVisible(false); |
---|
| 3739 | + bigThree.ClearUI(); |
---|
| 3740 | + bigThree.add(centralPanel); |
---|
| 3741 | + bigThree.add(scenePanel); |
---|
| 3742 | + bigThree.FlushUI(); |
---|
| 3743 | + |
---|
| 3744 | + cameraView.requestFocusInWindow(); |
---|
2695 | 3745 | } else |
---|
2696 | | - if (event.getSource() == sevenButton) |
---|
| 3746 | + if (source == sevenButton) |
---|
2697 | 3747 | { |
---|
2698 | 3748 | radio.layout = sevenButton; |
---|
2699 | | - bigThree.remove(jtp); |
---|
2700 | | - bigThree.remove(cameraPanel); |
---|
2701 | | - bigThree.remove(XYZPanel); |
---|
2702 | | - aWindowConstraints.gridx = 0; |
---|
2703 | | - aWindowConstraints.gridy = 0; |
---|
2704 | | - aWindowConstraints.gridwidth = 1; |
---|
2705 | | - // aWindowConstraints.gridheight = 3; |
---|
2706 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2707 | | - aWindowConstraints.weightx = 0; |
---|
2708 | | - aWindowConstraints.weighty = 1; |
---|
2709 | | - bigThree.add(jtp, aWindowConstraints); |
---|
2710 | | - aWindowConstraints.weightx = 1; |
---|
2711 | | - aWindowConstraints.gridwidth = 3; |
---|
2712 | | - // aWindowConstraints.gridheight = 3; |
---|
2713 | | - aWindowConstraints.gridx = 1; |
---|
2714 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2715 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
2716 | | - aWindowConstraints.weightx = 0; |
---|
2717 | | - aWindowConstraints.gridx = 4; |
---|
2718 | | - aWindowConstraints.gridwidth = 1; |
---|
2719 | | - // aConstraints.gridheight = 3; |
---|
2720 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2721 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2722 | | - bigThree.revalidate(); |
---|
| 3749 | + |
---|
| 3750 | + if (CameraPane.FULLSCREEN) |
---|
| 3751 | + fullscreenLayout = radio.layout; |
---|
| 3752 | + |
---|
| 3753 | +// bigThree.remove(scenePanel); |
---|
| 3754 | +// bigThree.remove(centralPanel); |
---|
| 3755 | +// bigThree.remove(XYZPanel); |
---|
| 3756 | +// aWindowConstraints.gridx = 0; |
---|
| 3757 | +// aWindowConstraints.gridy = 0; |
---|
| 3758 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3759 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3760 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3761 | +// aWindowConstraints.weightx = 0; |
---|
| 3762 | +// aWindowConstraints.weighty = 1; |
---|
| 3763 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3764 | +// aWindowConstraints.weightx = 1; |
---|
| 3765 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3766 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3767 | +// aWindowConstraints.gridx = 1; |
---|
| 3768 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3769 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3770 | +// aWindowConstraints.weightx = 0; |
---|
| 3771 | +// aWindowConstraints.gridx = 4; |
---|
| 3772 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3773 | +// // aConstraints.gridheight = 3; |
---|
| 3774 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3775 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3776 | +// bigThree.validate(); |
---|
| 3777 | +// scenePanel.setVisible(true); |
---|
| 3778 | +// centralPanel.setVisible(true); |
---|
| 3779 | +// XYZPanel.setVisible(true); |
---|
| 3780 | + bigThree.ClearUI(); |
---|
| 3781 | + bigThree.add(scenePanel); |
---|
| 3782 | + bigThree.add(centralPanel); |
---|
| 3783 | + bigThree.add(XYZPanel); |
---|
| 3784 | + bigThree.FlushUI(); |
---|
| 3785 | + |
---|
| 3786 | + cameraView.requestFocusInWindow(); |
---|
2723 | 3787 | } else |
---|
2724 | | - if (event.getSource() == rootButton) |
---|
| 3788 | + if (source == rootButton) |
---|
2725 | 3789 | { |
---|
2726 | 3790 | Object3D obj; |
---|
2727 | 3791 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2731 | 3795 | EditObject(obj); |
---|
2732 | 3796 | } |
---|
2733 | 3797 | |
---|
| 3798 | + cameraView.requestFocusInWindow(); |
---|
2734 | 3799 | refreshContents(true); |
---|
2735 | 3800 | } else |
---|
2736 | | - if (event.getSource() == closeButton) |
---|
| 3801 | + if (source == closeButton) |
---|
2737 | 3802 | { |
---|
2738 | 3803 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2739 | 3804 | cRadio ab; |
---|
2740 | 3805 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2741 | 3806 | { |
---|
2742 | 3807 | ab = (cRadio)e.nextElement(); |
---|
2743 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3808 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2744 | 3809 | { |
---|
| 3810 | + // Patch to avoid bug with transparency. |
---|
| 3811 | + if (!ab.hadMaterial) |
---|
| 3812 | + { |
---|
| 3813 | + ab.object.material = null; |
---|
| 3814 | + } |
---|
| 3815 | + |
---|
2745 | 3816 | buttonGroup.remove(ab); |
---|
2746 | 3817 | radioPanel.remove(ab); |
---|
2747 | 3818 | |
---|
2748 | | - ab.GetObject().editWindow = null; |
---|
| 3819 | + //ab.GetObject().editWindow = null; |
---|
| 3820 | + ab.GetObject().manipWindow = null; |
---|
2749 | 3821 | // ab.GetObject().objectUI = null; // ????????? |
---|
2750 | 3822 | |
---|
2751 | 3823 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2752 | 3824 | break; |
---|
2753 | 3825 | } |
---|
2754 | 3826 | } |
---|
| 3827 | + |
---|
| 3828 | + cameraView.requestFocusInWindow(); |
---|
2755 | 3829 | refreshContents(true); |
---|
2756 | 3830 | } else |
---|
2757 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3831 | + if (source == editItem || source == editButton) |
---|
2758 | 3832 | { |
---|
| 3833 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3834 | + { |
---|
| 3835 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3836 | + child.pinned = true; |
---|
| 3837 | + } |
---|
| 3838 | + |
---|
2759 | 3839 | EditSelection(false); |
---|
2760 | 3840 | } else |
---|
2761 | | - if (event.getSource() == uneditButton) |
---|
| 3841 | + if (source == uneditButton) |
---|
2762 | 3842 | { |
---|
2763 | 3843 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2764 | 3844 | { |
---|
2765 | 3845 | Object3D child = (Object3D)e.nextElement(); |
---|
2766 | 3846 | if(child.editWindow != null) |
---|
2767 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3847 | + child.pinned = false; |
---|
2768 | 3848 | child.CloseUI(); |
---|
2769 | 3849 | listUI.remove(child); |
---|
| 3850 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2770 | 3851 | |
---|
2771 | | - child.editWindow = null; // ??????????? |
---|
| 3852 | + //child.editWindow = null; // ??????????? |
---|
2772 | 3853 | } |
---|
2773 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3854 | + objEditor.ctrlPanel.FlushUI(); |
---|
2774 | 3855 | //objEditor.jTree.clearSelection(); |
---|
2775 | 3856 | //objEditor.ResetSliders(); |
---|
2776 | 3857 | refreshContents(true); |
---|
2777 | 3858 | } else |
---|
2778 | | - if (event.getSource() == clearPanelButton) |
---|
| 3859 | + if (source == clearPanelButton) |
---|
2779 | 3860 | { |
---|
2780 | 3861 | assert(copy == group); |
---|
2781 | 3862 | //copy.ClearUI(); |
---|
2782 | 3863 | for (Object3D obj : listUI) |
---|
2783 | 3864 | { |
---|
| 3865 | + obj.pinned = false; |
---|
2784 | 3866 | obj.CloseUI(); |
---|
2785 | 3867 | } |
---|
2786 | 3868 | listUI.clear(); |
---|
| 3869 | + SetPinStates(group.selection.size() > 0); |
---|
2787 | 3870 | refreshContents(true); |
---|
2788 | 3871 | } else |
---|
2789 | | - if (event.getSource() == allParamsButton) |
---|
| 3872 | + if (source == allParamsButton) |
---|
2790 | 3873 | { |
---|
2791 | 3874 | assert(copy == group); |
---|
2792 | 3875 | |
---|
2793 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3876 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2794 | 3877 | |
---|
2795 | 3878 | for (Object3D obj : listUI) |
---|
2796 | 3879 | { |
---|
.. | .. |
---|
2807 | 3890 | |
---|
2808 | 3891 | refreshContents(true); |
---|
2809 | 3892 | } else |
---|
2810 | | - if (event.getSource() == unselectButton) |
---|
| 3893 | + if (source == unselectButton) |
---|
2811 | 3894 | { |
---|
2812 | 3895 | objEditor.jTree.clearSelection(); |
---|
2813 | 3896 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2814 | 3897 | objEditor.ResetSliders(); |
---|
2815 | 3898 | refreshContents(true); |
---|
2816 | 3899 | } else |
---|
2817 | | - if(event.getSource() instanceof cRadio) |
---|
| 3900 | + if(source instanceof cRadio) |
---|
2818 | 3901 | { |
---|
2819 | 3902 | group.parent = keepparent; |
---|
2820 | 3903 | group.attributes = 0; |
---|
2821 | 3904 | //group.editWindow = null; |
---|
2822 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3905 | + /*cRadio*/ radio = (cRadio)source; |
---|
2823 | 3906 | Object3D obj = radio.GetObject(); |
---|
2824 | 3907 | System.out.println("Edit " + obj); |
---|
2825 | 3908 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2839 | 3922 | } |
---|
2840 | 3923 | |
---|
2841 | 3924 | copy = group; |
---|
2842 | | - //CameraPane.theRenderer.object = group; |
---|
| 3925 | + |
---|
| 3926 | + SetUndoStates(); |
---|
| 3927 | + |
---|
| 3928 | + //Globals.theRenderer.object = group; |
---|
2843 | 3929 | if(!useclient) |
---|
2844 | 3930 | { |
---|
2845 | 3931 | cameraView.renderCamera = radio.camera; |
---|
.. | .. |
---|
2848 | 3934 | cameraView.cameras[cameraView.cameracount] = radio.camera; |
---|
2849 | 3935 | cameraView.targetLookAt.set(radio.camera.lookAt); |
---|
2850 | 3936 | cameraView.object = group; |
---|
2851 | | - cameraView.lighttouched = true; |
---|
| 3937 | + //cameraView.lighttouched = true; |
---|
| 3938 | + Globals.lighttouched = true; |
---|
2852 | 3939 | topView.object = group; |
---|
2853 | 3940 | frontView.object = group; |
---|
2854 | 3941 | sideView.object = group; |
---|
2855 | 3942 | } |
---|
2856 | | - group.editWindow = this; |
---|
| 3943 | + |
---|
| 3944 | +// fix "+" issue |
---|
| 3945 | + //group.editWindow = this; |
---|
| 3946 | + group.manipWindow = this; |
---|
| 3947 | + |
---|
2857 | 3948 | /* |
---|
2858 | 3949 | currentLayout = radio.layout; |
---|
2859 | 3950 | if (currentLayout == null) |
---|
2860 | 3951 | currentLayout = sevenButton; |
---|
2861 | 3952 | */ |
---|
2862 | 3953 | radio.layout.doClick(); |
---|
| 3954 | + |
---|
| 3955 | + ClearUnpinned(); |
---|
| 3956 | + |
---|
| 3957 | + //Grafreed.Assert(group != null); |
---|
| 3958 | + //Grafreed.Assert(group.selection != null); |
---|
| 3959 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3960 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3961 | + EditSelection(false); |
---|
2863 | 3962 | keepparent = group.parent; |
---|
2864 | 3963 | // PARENT = NULL or not??? |
---|
2865 | 3964 | //group.parent = null; // ROOT |
---|
2866 | 3965 | //group.attributes = -1; |
---|
2867 | 3966 | ResetModel(); |
---|
| 3967 | + |
---|
| 3968 | + cameraView.requestFocusInWindow(); |
---|
2868 | 3969 | refreshContents(true); |
---|
2869 | | - } |
---|
| 3970 | + } else if (event.getSource() == editCameraItem) |
---|
| 3971 | + { |
---|
| 3972 | + cameraView.ProtectCamera(); |
---|
| 3973 | + cameraView.requestFocusInWindow(); |
---|
| 3974 | + cameraView.repaint(); |
---|
| 3975 | + return; |
---|
| 3976 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3977 | + { |
---|
| 3978 | + cameraView.RevertCamera(); |
---|
| 3979 | + cameraView.requestFocusInWindow(); |
---|
| 3980 | + cameraView.repaint(); |
---|
| 3981 | + return; |
---|
| 3982 | + // } else if (event.getSource() == textureButton) |
---|
| 3983 | + // { |
---|
| 3984 | + // return; // true; |
---|
| 3985 | + } |
---|
2870 | 3986 | else |
---|
2871 | 3987 | { |
---|
2872 | 3988 | //return super.action(event, arg); |
---|
.. | .. |
---|
2875 | 3991 | } |
---|
2876 | 3992 | |
---|
2877 | 3993 | boolean useclient = false; |
---|
2878 | | - cRadio radio; |
---|
2879 | 3994 | |
---|
2880 | 3995 | void ToggleRoot() |
---|
2881 | 3996 | { |
---|
.. | .. |
---|
2884 | 3999 | if (useclient) |
---|
2885 | 4000 | { |
---|
2886 | 4001 | cameraView.object = client; |
---|
2887 | | - cameraView.lighttouched = true; |
---|
| 4002 | + Globals.lighttouched = true; |
---|
2888 | 4003 | //topView.object = client; |
---|
2889 | 4004 | //frontView.object = client; |
---|
2890 | 4005 | //sideView.object = client; |
---|
.. | .. |
---|
2892 | 4007 | else |
---|
2893 | 4008 | { |
---|
2894 | 4009 | cameraView.object = group; |
---|
2895 | | - cameraView.lighttouched = true; |
---|
| 4010 | + Globals.lighttouched = true; |
---|
2896 | 4011 | //topView.object = group; |
---|
2897 | 4012 | //frontView.object = group; |
---|
2898 | 4013 | //sideView.object = group; |
---|
.. | .. |
---|
2927 | 4042 | refreshContents(); |
---|
2928 | 4043 | } |
---|
2929 | 4044 | |
---|
| 4045 | + void TransformChildren() |
---|
| 4046 | + { |
---|
| 4047 | + Object3D obj; |
---|
| 4048 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4049 | + { |
---|
| 4050 | + obj = (Object3D)e.nextElement(); |
---|
| 4051 | + obj.KeepTextureMatrices(); |
---|
| 4052 | + obj.TransformChildren(); |
---|
| 4053 | + obj.RestoreTextureMatrices(); |
---|
| 4054 | + |
---|
| 4055 | +// if (obj.parent == null) |
---|
| 4056 | +// { |
---|
| 4057 | +// System.out.println("NULL PARENT!"); |
---|
| 4058 | +// new Exception().printStackTrace(); |
---|
| 4059 | +// } |
---|
| 4060 | +// else |
---|
| 4061 | +// TouchTransform(obj); |
---|
| 4062 | +// //obj.parent.Touch(); |
---|
| 4063 | + } |
---|
| 4064 | + |
---|
| 4065 | + refreshContents(); |
---|
| 4066 | + } |
---|
2930 | 4067 | |
---|
2931 | 4068 | void ResetTransform() |
---|
2932 | 4069 | { |
---|
.. | .. |
---|
3039 | 4176 | refreshContents(); |
---|
3040 | 4177 | } |
---|
3041 | 4178 | |
---|
3042 | | - void ResetCentroid() |
---|
| 4179 | + void ResetCentroid(boolean full) |
---|
3043 | 4180 | { |
---|
3044 | 4181 | Object3D obj; |
---|
3045 | 4182 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3054 | 4191 | LA.matIdentity(Object3D.mat); |
---|
3055 | 4192 | obj.getBounds(minima, maxima, false); |
---|
3056 | 4193 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3057 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 4194 | + if (full) |
---|
| 4195 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3058 | 4196 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3059 | 4197 | obj.TransformMesh(Object3D.mat); |
---|
| 4198 | + |
---|
3060 | 4199 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3061 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 4200 | + if (full) |
---|
| 4201 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3062 | 4202 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 4203 | + |
---|
3063 | 4204 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3064 | 4205 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3065 | 4206 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3088 | 4229 | |
---|
3089 | 4230 | int size = obj.MemorySize(); |
---|
3090 | 4231 | |
---|
3091 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4232 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4233 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3092 | 4234 | } |
---|
3093 | 4235 | } |
---|
3094 | 4236 | catch (Exception e) |
---|
.. | .. |
---|
3125 | 4267 | obj = (Object3D)e.nextElement(); |
---|
3126 | 4268 | |
---|
3127 | 4269 | System.out.println("Object is: " + obj); |
---|
3128 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 4270 | + Grafreed.AnalyzeObject(obj); |
---|
3129 | 4271 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3130 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 4272 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3131 | 4273 | |
---|
3132 | 4274 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3133 | 4275 | } |
---|
.. | .. |
---|
3169 | 4311 | void GenNormals(boolean crease) |
---|
3170 | 4312 | { |
---|
3171 | 4313 | group.GenNormalsS(crease); |
---|
| 4314 | + |
---|
| 4315 | + refreshContents(); |
---|
| 4316 | + } |
---|
| 4317 | + |
---|
| 4318 | + void GenNormalsMESH() |
---|
| 4319 | + { |
---|
| 4320 | + group.GenNormalsMeshS(); |
---|
| 4321 | + |
---|
| 4322 | + refreshContents(); |
---|
| 4323 | + } |
---|
| 4324 | + |
---|
| 4325 | + void GenNormalsMINE() |
---|
| 4326 | + { |
---|
| 4327 | + group.selection.GenNormalsMINE(); |
---|
3172 | 4328 | |
---|
3173 | 4329 | refreshContents(); |
---|
3174 | 4330 | } |
---|
.. | .. |
---|
3334 | 4490 | |
---|
3335 | 4491 | void ParseVertices() |
---|
3336 | 4492 | { |
---|
3337 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3338 | | - GrafreeD.epsequal = true; |
---|
| 4493 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4494 | + Grafreed.epsequal = true; |
---|
3339 | 4495 | |
---|
3340 | 4496 | for (int i=0; i<group.selection.size(); i++) |
---|
3341 | 4497 | { |
---|
.. | .. |
---|
3360 | 4516 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3361 | 4517 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3362 | 4518 | |
---|
3363 | | - g.add(GrafreeD.clipboard); |
---|
| 4519 | + g.add(Grafreed.clipboard); |
---|
3364 | 4520 | |
---|
3365 | 4521 | buffer.add(g); |
---|
3366 | 4522 | } |
---|
.. | .. |
---|
3375 | 4531 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3376 | 4532 | } |
---|
3377 | 4533 | |
---|
3378 | | - GrafreeD.epsequal = epsequal; |
---|
| 4534 | + Grafreed.epsequal = epsequal; |
---|
3379 | 4535 | |
---|
3380 | 4536 | refreshContents(); |
---|
3381 | 4537 | } |
---|
.. | .. |
---|
3393 | 4549 | String pigment = Object3D.GetPigment(tex); |
---|
3394 | 4550 | //String bump = Object3D.GetBump(tex); |
---|
3395 | 4551 | |
---|
3396 | | - com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4552 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4553 | + |
---|
| 4554 | + try |
---|
| 4555 | + { |
---|
| 4556 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
| 4557 | + } |
---|
| 4558 | + catch (Exception e) |
---|
| 4559 | + { |
---|
| 4560 | + System.err.println("FAIL: " + node); |
---|
| 4561 | + } |
---|
3397 | 4562 | |
---|
3398 | 4563 | double s = v.s; |
---|
3399 | 4564 | |
---|
.. | .. |
---|
3441 | 4606 | |
---|
3442 | 4607 | void Align() |
---|
3443 | 4608 | { |
---|
| 4609 | + if (group.selection.size() == 0) |
---|
| 4610 | + return; |
---|
| 4611 | + |
---|
| 4612 | + cVector bbmin = new cVector(); |
---|
| 4613 | + cVector bbmax = new cVector(); |
---|
| 4614 | + |
---|
| 4615 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 4616 | + |
---|
| 4617 | + double dx = bbmax.x - bbmin.x; |
---|
| 4618 | + double dy = bbmax.y - bbmin.y; |
---|
| 4619 | + double dz = bbmax.z - bbmin.z; |
---|
| 4620 | + |
---|
| 4621 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 4622 | + |
---|
3444 | 4623 | for (int i=0; i<group.selection.size(); i++) |
---|
3445 | 4624 | { |
---|
3446 | 4625 | Object3D obj = group.selection.get(i); |
---|
3447 | 4626 | |
---|
3448 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3449 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 4627 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 4628 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3450 | 4629 | } |
---|
3451 | 4630 | |
---|
3452 | 4631 | refreshContents(); |
---|
.. | .. |
---|
3467 | 4646 | |
---|
3468 | 4647 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3469 | 4648 | |
---|
3470 | | - boolean random = CameraPane.RANDOM; |
---|
3471 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4649 | + boolean random = CameraPane.SWITCH; |
---|
| 4650 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3472 | 4651 | lowres.linkVerticesThis(null); |
---|
3473 | 4652 | lowres.linkVerticesThis(sn); |
---|
3474 | | - CameraPane.RANDOM = random; |
---|
| 4653 | + CameraPane.SWITCH = random; |
---|
3475 | 4654 | |
---|
3476 | 4655 | System.err.flush(); |
---|
3477 | 4656 | |
---|
.. | .. |
---|
3511 | 4690 | return; |
---|
3512 | 4691 | |
---|
3513 | 4692 | Object3D poses = group.selection.get(0); |
---|
3514 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4693 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3515 | 4694 | |
---|
3516 | 4695 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3517 | 4696 | |
---|
.. | .. |
---|
3680 | 4859 | group.selection.RelinkToSupport(); // july 2014 |
---|
3681 | 4860 | System.out.println("DONE."); |
---|
3682 | 4861 | refreshContents(); |
---|
3683 | | - CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
| 4862 | + Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
3684 | 4863 | } |
---|
3685 | 4864 | |
---|
3686 | 4865 | void ReduceMesh(boolean reduction34) |
---|
.. | .. |
---|
3705 | 4884 | |
---|
3706 | 4885 | void ClipMesh() |
---|
3707 | 4886 | { |
---|
3708 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4887 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3709 | 4888 | { |
---|
3710 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4889 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3711 | 4890 | |
---|
3712 | 4891 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3713 | 4892 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3716 | 4895 | // { |
---|
3717 | 4896 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3718 | 4897 | // } |
---|
3719 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4898 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3720 | 4899 | } |
---|
3721 | 4900 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3722 | 4901 | System.out.println("DONE."); |
---|
.. | .. |
---|
3763 | 4942 | void MarkLeaves(boolean hide) |
---|
3764 | 4943 | { |
---|
3765 | 4944 | group.selection.MarkLeaves(hide); |
---|
| 4945 | + refreshContents(); |
---|
| 4946 | + } |
---|
| 4947 | + |
---|
| 4948 | + void RewindLeaves(boolean hide) |
---|
| 4949 | + { |
---|
| 4950 | + group.selection.RewindLeaves(hide); |
---|
| 4951 | + refreshContents(); |
---|
| 4952 | + } |
---|
| 4953 | + |
---|
| 4954 | + void RandomLeaves(boolean hide) |
---|
| 4955 | + { |
---|
| 4956 | + group.selection.RandomLeaves(hide); |
---|
3766 | 4957 | refreshContents(); |
---|
3767 | 4958 | } |
---|
3768 | 4959 | |
---|
.. | .. |
---|
3837 | 5028 | // } |
---|
3838 | 5029 | // } |
---|
3839 | 5030 | |
---|
3840 | | - static boolean allparams = true; |
---|
3841 | | - |
---|
3842 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
3843 | | - |
---|
3844 | 5031 | void EditSelection(boolean newWindow) |
---|
3845 | 5032 | { |
---|
| 5033 | + if (group.selection == null) |
---|
| 5034 | + { |
---|
| 5035 | + EditElement(group, newWindow); // ? new |
---|
| 5036 | + return; |
---|
| 5037 | + } |
---|
| 5038 | + |
---|
3846 | 5039 | // aConstraints.gridy = 0; |
---|
3847 | 5040 | for (int i=0; i<group.selection.size(); i++) |
---|
3848 | 5041 | { |
---|
3849 | 5042 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
3850 | 5043 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
3851 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 5044 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3852 | 5045 | |
---|
3853 | 5046 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3854 | | - if(elem != group) |
---|
| 5047 | + if(elem != group || !newWindow) |
---|
3855 | 5048 | { |
---|
3856 | | - // if (!(elem instanceof Composite)) |
---|
3857 | | - // newWindow = false; |
---|
3858 | | - listUI.add(elem); |
---|
3859 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
3860 | | - System.out.println("edit : " + elem); |
---|
3861 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5049 | + EditElement(elem, newWindow); // ? new |
---|
3862 | 5050 | } |
---|
3863 | 5051 | } |
---|
3864 | 5052 | } |
---|
.. | .. |
---|
3921 | 5109 | |
---|
3922 | 5110 | freezemodel = false; |
---|
3923 | 5111 | } |
---|
3924 | | - |
---|
3925 | | - boolean flashIt = true; |
---|
3926 | | - |
---|
| 5112 | + |
---|
3927 | 5113 | public void valueChanged(TreeSelectionEvent e) |
---|
3928 | 5114 | //public boolean handleEvent(Event event) |
---|
3929 | 5115 | { |
---|
.. | .. |
---|
3933 | 5119 | //new Exception().printStackTrace(); |
---|
3934 | 5120 | |
---|
3935 | 5121 | freezemodel = true; |
---|
3936 | | - |
---|
| 5122 | + ClearUnpinned(); |
---|
| 5123 | + |
---|
3937 | 5124 | /**/ |
---|
3938 | 5125 | //switch (event.id) |
---|
3939 | 5126 | { |
---|
.. | .. |
---|
3941 | 5128 | //case 702: // Event.LIST_DESELECT |
---|
3942 | 5129 | group.deselectAll(); |
---|
3943 | 5130 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
3944 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
3945 | 5131 | if (tps != null) |
---|
3946 | 5132 | { |
---|
3947 | 5133 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
3950 | 5136 | |
---|
3951 | 5137 | //if (child.parent != null) |
---|
3952 | 5138 | //child.parent.addSelectee(child); |
---|
| 5139 | + objEditor.SetMaterial(child); |
---|
3953 | 5140 | group.addSelectee(child); |
---|
3954 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
3955 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
3956 | | - System.err.println("info : " + child.GetPath()); |
---|
3957 | 5141 | } |
---|
3958 | 5142 | } |
---|
3959 | | - else |
---|
3960 | | - { |
---|
3961 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
3962 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
3963 | | - System.err.println("info : " + group.GetPath()); |
---|
3964 | | - } |
---|
| 5143 | +// else |
---|
| 5144 | +// { |
---|
| 5145 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 5146 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 5147 | +// System.err.println("info : " + group.GetPath()); |
---|
| 5148 | +// } |
---|
3965 | 5149 | |
---|
3966 | | - objEditor.SetText(); // jan 2014 |
---|
3967 | | - |
---|
3968 | | - if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 5150 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
3969 | 5151 | CameraPane.flash = true; |
---|
3970 | 5152 | |
---|
3971 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 5153 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
3972 | 5154 | // a camera |
---|
3973 | 5155 | { |
---|
3974 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
3975 | | - CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
3976 | | - // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera; |
---|
3977 | | - // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera; |
---|
| 5156 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5157 | + { |
---|
| 5158 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 5159 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5160 | + } |
---|
| 5161 | + // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
| 5162 | + // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
3978 | 5163 | } |
---|
3979 | 5164 | |
---|
| 5165 | + if (tps != null && tps.length == 1) |
---|
| 5166 | + { |
---|
| 5167 | + EditSelection(false); |
---|
| 5168 | + } |
---|
| 5169 | + |
---|
| 5170 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5171 | + |
---|
3980 | 5172 | refreshContents(); |
---|
3981 | 5173 | //return true; |
---|
3982 | 5174 | } |
---|
.. | .. |
---|
3985 | 5177 | |
---|
3986 | 5178 | freezemodel = false; |
---|
3987 | 5179 | } |
---|
| 5180 | + |
---|
| 5181 | + void SetPinStates(boolean enabled) |
---|
| 5182 | + { |
---|
| 5183 | + editButton.setEnabled(enabled); |
---|
| 5184 | + uneditButton.setEnabled(enabled); |
---|
| 5185 | + unselectButton.setEnabled(enabled); |
---|
| 5186 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5187 | + |
---|
| 5188 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5189 | + } |
---|
| 5190 | + |
---|
| 5191 | + void refreshContents(boolean cp) |
---|
| 5192 | + { |
---|
| 5193 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5194 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 5195 | + { |
---|
| 5196 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 5197 | + |
---|
| 5198 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 5199 | + { |
---|
| 5200 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 5201 | + |
---|
| 5202 | + objEditor.AddInfo(child, this, true); |
---|
| 5203 | + System.err.println("info : " + child.GetPath()); |
---|
| 5204 | + } |
---|
| 5205 | + |
---|
| 5206 | + objEditor.SetText(); // jan 2014 |
---|
| 5207 | + } |
---|
| 5208 | + |
---|
| 5209 | + super.refreshContents(cp); |
---|
| 5210 | + } |
---|
3988 | 5211 | |
---|
3989 | 5212 | void linkSomething(Object3D thing) |
---|
3990 | 5213 | { |
---|
.. | .. |
---|
4056 | 5279 | { |
---|
4057 | 5280 | if (group.selection.isEmpty()) |
---|
4058 | 5281 | return; |
---|
4059 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 5282 | + |
---|
| 5283 | + Grafreed.clipboardIsTempGroup = false; |
---|
4060 | 5284 | Composite tGroup = null; |
---|
4061 | 5285 | if (group.selection.size() > 0) // 1) |
---|
4062 | 5286 | { |
---|
4063 | 5287 | tGroup = new cGroup(); |
---|
4064 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 5288 | + Grafreed.clipboardIsTempGroup = true; |
---|
4065 | 5289 | } |
---|
4066 | 5290 | |
---|
4067 | 5291 | if (cut) |
---|
4068 | 5292 | { |
---|
| 5293 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5294 | +// Save(); |
---|
4069 | 5295 | //int indices[] = jList.getSelectedIndices(); |
---|
4070 | 5296 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4071 | 5297 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4101 | 5327 | //System.out.println("cut " + child); |
---|
4102 | 5328 | //System.out.println("parent = " + child.parent); |
---|
4103 | 5329 | // tmp.addChild(child); |
---|
4104 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5330 | + if (Grafreed.clipboardIsTempGroup) |
---|
4105 | 5331 | tGroup.add/*Child*/(tmp); |
---|
4106 | 5332 | else |
---|
4107 | | - GrafreeD.clipboard = tmp; |
---|
| 5333 | + Grafreed.clipboard = tmp; |
---|
4108 | 5334 | } |
---|
4109 | 5335 | else |
---|
4110 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5336 | + if (Grafreed.clipboardIsTempGroup) |
---|
4111 | 5337 | tGroup.add/*Child*/(child); |
---|
4112 | 5338 | else |
---|
4113 | | - GrafreeD.clipboard = child; |
---|
| 5339 | + Grafreed.clipboard = child; |
---|
4114 | 5340 | } |
---|
4115 | 5341 | |
---|
4116 | 5342 | //ResetModel(); |
---|
.. | .. |
---|
4142 | 5368 | //System.out.println("cut " + elem); |
---|
4143 | 5369 | //System.out.println("parent = " + elem.parent); |
---|
4144 | 5370 | // tmp.addChild(elem); |
---|
4145 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5371 | + if (Grafreed.clipboardIsTempGroup) |
---|
4146 | 5372 | tGroup.add/*Child*/(tmp); |
---|
4147 | 5373 | else |
---|
4148 | | - GrafreeD.clipboard = tmp; |
---|
| 5374 | + Grafreed.clipboard = tmp; |
---|
4149 | 5375 | } |
---|
4150 | 5376 | else |
---|
4151 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5377 | + if (Grafreed.clipboardIsTempGroup) |
---|
4152 | 5378 | tGroup.add/*Child*/(child); |
---|
4153 | 5379 | else |
---|
4154 | | - GrafreeD.clipboard = child; |
---|
| 5380 | + Grafreed.clipboard = child; |
---|
4155 | 5381 | } |
---|
4156 | 5382 | |
---|
4157 | 5383 | } |
---|
4158 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4159 | | - GrafreeD.clipboard = tGroup; |
---|
| 5384 | + |
---|
| 5385 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 5386 | + Grafreed.clipboard = tGroup; |
---|
| 5387 | + |
---|
4160 | 5388 | if (cut) |
---|
4161 | 5389 | { |
---|
4162 | 5390 | ResetModel(); |
---|
.. | .. |
---|
4166 | 5394 | |
---|
4167 | 5395 | void paste(boolean expand) |
---|
4168 | 5396 | { |
---|
| 5397 | + if (Globals.REPLACEONMAKE) |
---|
| 5398 | + Save(); |
---|
| 5399 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5400 | + Globals.REPLACEONMAKE = false; |
---|
4169 | 5401 | // if (GrafreeD.clipboard == null) |
---|
4170 | 5402 | // return; |
---|
4171 | 5403 | boolean first = true; |
---|
4172 | 5404 | |
---|
4173 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5405 | + if (Grafreed.clipboardIsTempGroup) |
---|
4174 | 5406 | { |
---|
4175 | 5407 | Composite temp; |
---|
4176 | 5408 | |
---|
.. | .. |
---|
4181 | 5413 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4182 | 5414 | */ |
---|
4183 | 5415 | Object3D elem; |
---|
4184 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5416 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4185 | 5417 | { |
---|
4186 | 5418 | Object3D child = (Object3D)e.nextElement(); |
---|
4187 | 5419 | |
---|
.. | .. |
---|
4215 | 5447 | //Object3D cb = Applet3D.clipboard; |
---|
4216 | 5448 | //temp.addChild(cb); |
---|
4217 | 5449 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4218 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4219 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4220 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4221 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4222 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5450 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5451 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5452 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5453 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5454 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4223 | 5455 | else |
---|
4224 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4225 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5456 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5457 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4226 | 5458 | } |
---|
4227 | 5459 | |
---|
| 5460 | + Globals.REPLACEONMAKE = keep; |
---|
4228 | 5461 | ResetModel(); |
---|
4229 | 5462 | refreshContents(); |
---|
4230 | 5463 | } |
---|
4231 | 5464 | |
---|
4232 | | - void pasteInto(boolean copyit) |
---|
| 5465 | + void pasteInto(boolean copyit, boolean clone) |
---|
4233 | 5466 | { |
---|
4234 | 5467 | // if (GrafreeD.clipboard == null) |
---|
4235 | 5468 | // return; |
---|
.. | .. |
---|
4258 | 5491 | if (copyit) |
---|
4259 | 5492 | { |
---|
4260 | 5493 | // paste(false); |
---|
4261 | | - CloneClipboard(false); // sept 2014 |
---|
| 5494 | + if (clone) |
---|
| 5495 | + { |
---|
| 5496 | + CloneClipboard(false); // sept 2014 |
---|
| 5497 | + } |
---|
| 5498 | + else |
---|
| 5499 | + { |
---|
| 5500 | + paste(false); |
---|
| 5501 | + } |
---|
4262 | 5502 | } |
---|
4263 | 5503 | else |
---|
4264 | 5504 | { |
---|
4265 | 5505 | boolean first = true; |
---|
4266 | 5506 | |
---|
4267 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5507 | + if (Grafreed.clipboardIsTempGroup) |
---|
4268 | 5508 | { |
---|
4269 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5509 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4270 | 5510 | Object3D copy; |
---|
4271 | 5511 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4272 | 5512 | { |
---|
.. | .. |
---|
4276 | 5516 | } |
---|
4277 | 5517 | } else |
---|
4278 | 5518 | { |
---|
4279 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5519 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4280 | 5520 | } |
---|
4281 | 5521 | } |
---|
4282 | 5522 | } |
---|
.. | .. |
---|
4353 | 5593 | |
---|
4354 | 5594 | void group(Object3D csg, boolean grab) |
---|
4355 | 5595 | { |
---|
| 5596 | + if (Globals.REPLACEONMAKE) |
---|
| 5597 | + Save(); |
---|
| 5598 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5599 | + Globals.REPLACEONMAKE = false; |
---|
4356 | 5600 | if (//false) // why?? |
---|
4357 | 5601 | !group.selection.isEmpty()) |
---|
4358 | 5602 | { |
---|
.. | .. |
---|
4466 | 5710 | //node.add(csg); |
---|
4467 | 5711 | //makeSomething(node); |
---|
4468 | 5712 | makeSomething(csg); |
---|
| 5713 | + Globals.REPLACEONMAKE = keep; |
---|
4469 | 5714 | } |
---|
4470 | 5715 | |
---|
| 5716 | + void Ungroup(Object3D g) |
---|
| 5717 | + { |
---|
| 5718 | + if (Globals.REPLACEONMAKE) |
---|
| 5719 | + Save(); |
---|
| 5720 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5721 | + Globals.REPLACEONMAKE = false; |
---|
| 5722 | + if (g instanceof HiddenObject) |
---|
| 5723 | + { |
---|
| 5724 | + HiddenObject h = (HiddenObject) g; |
---|
| 5725 | + |
---|
| 5726 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 5727 | + { |
---|
| 5728 | + objEditor.makeSomething(h.get(i), false); |
---|
| 5729 | + } |
---|
| 5730 | + } |
---|
| 5731 | + else |
---|
| 5732 | + { |
---|
| 5733 | + for (int i=0; i<g.Size(); i++) |
---|
| 5734 | + { |
---|
| 5735 | + objEditor.makeSomething(g.get(i), false); |
---|
| 5736 | + } |
---|
| 5737 | + } |
---|
| 5738 | + Globals.REPLACEONMAKE = keep; |
---|
| 5739 | + } |
---|
| 5740 | + |
---|
4471 | 5741 | void ungroup() |
---|
4472 | 5742 | { |
---|
4473 | 5743 | /* |
---|
.. | .. |
---|
4661 | 5931 | } |
---|
4662 | 5932 | */ |
---|
4663 | 5933 | |
---|
4664 | | - void ImportGFD() |
---|
4665 | | - { |
---|
4666 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4667 | | - browser.show(); |
---|
4668 | | - String filename = browser.getFile(); |
---|
4669 | | - if (filename != null && filename.length() > 0) |
---|
4670 | | - { |
---|
4671 | | - String fullname = browser.getDirectory() + filename; |
---|
4672 | | - |
---|
4673 | | - //Object3D readobj = |
---|
4674 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4675 | | - //makeSomething(readobj); |
---|
4676 | | - } |
---|
4677 | | - } |
---|
4678 | | - |
---|
4679 | 5934 | /* |
---|
4680 | 5935 | public void Callback(Object obj) |
---|
4681 | 5936 | { |
---|
.. | .. |
---|
4699 | 5954 | } |
---|
4700 | 5955 | */ |
---|
4701 | 5956 | |
---|
4702 | | - void ImportVRMLX3D() |
---|
4703 | | - { |
---|
4704 | | - if (GrafreeD.standAlone) |
---|
4705 | | - { |
---|
4706 | | - /**/ |
---|
4707 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4708 | | - browser.show(); |
---|
4709 | | - String filename = browser.getFile(); |
---|
4710 | | - if (filename != null && filename.length() > 0) |
---|
4711 | | - { |
---|
4712 | | - String fullname = browser.getDirectory() + filename; |
---|
4713 | | - LoadVRMLX3D(fullname); |
---|
4714 | | - } |
---|
4715 | | - /**/ |
---|
4716 | | - } |
---|
4717 | | - } |
---|
4718 | | - |
---|
4719 | 5957 | String GetFile(String dialogName) |
---|
4720 | 5958 | { |
---|
4721 | | - if (GrafreeD.standAlone) |
---|
| 5959 | + if (Grafreed.standAlone) |
---|
4722 | 5960 | { |
---|
4723 | 5961 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4724 | 5962 | browser.show(); |
---|
.. | .. |
---|
4782 | 6020 | cButton flashSelectionButton; |
---|
4783 | 6021 | cButton editButton; |
---|
4784 | 6022 | cButton uneditButton; |
---|
| 6023 | + JCheckBox allParamsButton; |
---|
4785 | 6024 | cButton clearpanelButton; |
---|
4786 | | - cButton allParamsButton; |
---|
4787 | 6025 | cButton unselectButton; |
---|
4788 | 6026 | |
---|
| 6027 | + cButton restoreCameraButton; |
---|
| 6028 | + |
---|
| 6029 | + cButton oneStepButton; |
---|
| 6030 | + |
---|
| 6031 | + cButton groupButton; |
---|
| 6032 | + cButton ungroupButton; |
---|
| 6033 | + cButton compositeButton; |
---|
| 6034 | + cButton switchButton; |
---|
| 6035 | + cButton loopButton; |
---|
| 6036 | + cButton textureButton; |
---|
| 6037 | + |
---|
| 6038 | + cButton skybox1Button; |
---|
| 6039 | + cButton skybox2Button; |
---|
| 6040 | + cButton skybox3Button; |
---|
| 6041 | + cButton skybox4Button; |
---|
| 6042 | + cButton skybox5Button; |
---|
| 6043 | + cButton skybox6Button; |
---|
| 6044 | + cButton skybox7Button; |
---|
| 6045 | + |
---|
| 6046 | + cButton skybox11Button; |
---|
| 6047 | + cButton skybox12Button; |
---|
| 6048 | + cButton skybox13Button; |
---|
| 6049 | + cButton skybox14Button; |
---|
| 6050 | + cButton skybox15Button; |
---|
| 6051 | + cButton skybox16Button; |
---|
| 6052 | + cButton skybox17Button; |
---|
| 6053 | + |
---|
| 6054 | + cButton gridButton; |
---|
| 6055 | + cButton boxButton; |
---|
| 6056 | + cButton sphereButton; |
---|
| 6057 | + cButton coneButton; |
---|
| 6058 | + cButton torusButton; |
---|
| 6059 | + cButton superButton; |
---|
| 6060 | + cButton kleinButton; |
---|
| 6061 | + cButton particlesButton; |
---|
| 6062 | + cButton overlayButton; |
---|
| 6063 | + cButton lightButton; |
---|
| 6064 | + |
---|
4789 | 6065 | cButton screenfitButton; |
---|
4790 | 6066 | cButton screenfitpointButton; |
---|
4791 | 6067 | cButton snapobjectButton; |
---|
.. | .. |
---|
4797 | 6073 | |
---|
4798 | 6074 | cButton setsupportButton; |
---|
4799 | 6075 | |
---|
4800 | | - cButton twoButton; |
---|
4801 | | - cButton sixButton; |
---|
4802 | | - cButton threeButton; |
---|
4803 | | - cButton sevenButton; |
---|
4804 | | - cButton fourButton; // full panel |
---|
4805 | | - cButton oneButton; // full XYZ |
---|
4806 | | - //cButton currentLayout; |
---|
4807 | | - |
---|
4808 | 6076 | // |
---|
4809 | 6077 | //Composite |
---|
4810 | 6078 | Object3D // to do !! |
---|
.. | .. |
---|
4814 | 6082 | //JTree jTree; |
---|
4815 | 6083 | private MenuItem lookAtItem; |
---|
4816 | 6084 | private MenuItem lookFromItem; |
---|
4817 | | - private MenuItem switchItem; |
---|
| 6085 | + private MenuItem switchViewItem; |
---|
4818 | 6086 | private MenuItem cutItem; |
---|
4819 | | - private MenuItem duplicateItem; |
---|
| 6087 | + private MenuItem undoItem; |
---|
| 6088 | + private MenuItem redoItem; |
---|
| 6089 | + private JMenuItem duplicateItem; |
---|
4820 | 6090 | private MenuItem cloneItem; |
---|
4821 | 6091 | private MenuItem cloneSupportItem; |
---|
4822 | 6092 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
4827 | 6097 | private MenuItem resetsupportItem; |
---|
4828 | 6098 | private MenuItem resetreferencesItem; |
---|
4829 | 6099 | private MenuItem linkverticesItem; |
---|
| 6100 | + private MenuItem relinkverticesItem; |
---|
4830 | 6101 | private MenuItem setMasterItem; |
---|
4831 | | - private MenuItem resetMeshItem; |
---|
| 6102 | + private MenuItem resetAllItem; |
---|
4832 | 6103 | private MenuItem stepAllItem; |
---|
4833 | 6104 | private MenuItem revertMeshItem; |
---|
4834 | 6105 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4839 | 6110 | private MenuItem mergeGeometriesItem; |
---|
4840 | 6111 | private MenuItem copyItem; |
---|
4841 | 6112 | private MenuItem pasteItem; |
---|
| 6113 | + private MenuItem pasteIntoItem; |
---|
4842 | 6114 | private MenuItem pasteLinkItem; |
---|
4843 | 6115 | private MenuItem pasteCloneItem; |
---|
4844 | 6116 | private MenuItem pasteExpandItem; |
---|
4845 | | - private MenuItem clearItem; |
---|
| 6117 | + private MenuItem deleteItem; |
---|
4846 | 6118 | private MenuItem clearAllItem; |
---|
4847 | 6119 | private MenuItem genUVItem; |
---|
| 6120 | + private MenuItem genNormalsMESHItem; |
---|
4848 | 6121 | private MenuItem genNormalsCADItem; |
---|
4849 | 6122 | private MenuItem genNormalsORGANItem; |
---|
| 6123 | + private MenuItem genNormalsMINEItem; |
---|
4850 | 6124 | private MenuItem stripifyItem; |
---|
4851 | 6125 | private MenuItem unstripifyItem; |
---|
4852 | 6126 | private MenuItem trimItem; |
---|
.. | .. |
---|
4875 | 6149 | private MenuItem showleavesItem; |
---|
4876 | 6150 | private MenuItem markleavesItem; |
---|
4877 | 6151 | private MenuItem unmarkleavesItem; |
---|
| 6152 | + private MenuItem rewindleavesItem; |
---|
| 6153 | + private MenuItem unrewindleavesItem; |
---|
| 6154 | + private MenuItem randomleavesItem; |
---|
| 6155 | + private MenuItem unrandomleavesItem; |
---|
4878 | 6156 | |
---|
4879 | 6157 | private MenuItem flipVItem; |
---|
4880 | 6158 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
4886 | 6164 | private MenuItem panoTexturesItem; |
---|
4887 | 6165 | |
---|
4888 | 6166 | private MenuItem resetCentroidItem; |
---|
4889 | | - private MenuItem transformgeometryItem; |
---|
| 6167 | + private MenuItem resetCentroidXZItem; |
---|
4890 | 6168 | private MenuItem resetTransformItem; |
---|
| 6169 | + private MenuItem transformGeometryItem; |
---|
| 6170 | + private MenuItem transformChildrenItem; |
---|
| 6171 | + private MenuItem hideItem; |
---|
4891 | 6172 | private MenuItem grabItem; |
---|
4892 | 6173 | private MenuItem backItem; |
---|
4893 | 6174 | private MenuItem frontItem; |
---|
4894 | 6175 | private MenuItem cameraItem; |
---|
4895 | 6176 | private MenuItem compositeItem; |
---|
4896 | | - private MenuItem randomItem; |
---|
| 6177 | + private MenuItem switchItem; |
---|
4897 | 6178 | private MenuItem physicsItem; |
---|
4898 | 6179 | private MenuItem frameselectorItem; |
---|
4899 | 6180 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
4908 | 6189 | |
---|
4909 | 6190 | private MenuItem resetParentItem; |
---|
4910 | 6191 | private MenuItem repairParentItem; |
---|
| 6192 | + private MenuItem repairShadowItem; |
---|
4911 | 6193 | private MenuItem sortbysizeItem; |
---|
4912 | 6194 | private MenuItem sortbynameItem; |
---|
4913 | 6195 | |
---|
.. | .. |
---|
4916 | 6198 | private MenuItem attachBumpItem; |
---|
4917 | 6199 | private MenuItem detachBumpItem; |
---|
4918 | 6200 | private MenuItem pigmentBumpItem; |
---|
| 6201 | + private MenuItem embedTexturesItem; |
---|
| 6202 | + private MenuItem deEmbedTexturesItem; |
---|
4919 | 6203 | |
---|
4920 | 6204 | private MenuItem particleItem; |
---|
4921 | 6205 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
4928 | 6212 | private MenuItem coneItem; |
---|
4929 | 6213 | private MenuItem torusItem; |
---|
4930 | 6214 | private MenuItem superItem; |
---|
| 6215 | + private MenuItem kleinItem; |
---|
4931 | 6216 | private MenuItem blobItem; |
---|
4932 | 6217 | private MenuItem latheItem; |
---|
4933 | 6218 | private MenuItem bezierItem; |
---|
4934 | | - private MenuItem checkerItem; |
---|
| 6219 | + private MenuItem overlayItem; |
---|
4935 | 6220 | private MenuItem meshItem; |
---|
4936 | 6221 | // private MenuItem meshGroupItem; |
---|
4937 | 6222 | private MenuItem springItem; |
---|
.. | .. |
---|
4940 | 6225 | private MenuItem csgItem; |
---|
4941 | 6226 | private MenuItem templateItem; |
---|
4942 | 6227 | private MenuItem textureItem; |
---|
| 6228 | + private MenuItem billboardItem; |
---|
4943 | 6229 | private MenuItem shadowXItem; |
---|
4944 | 6230 | private MenuItem shadowYItem; |
---|
4945 | 6231 | private MenuItem shadowZItem; |
---|
.. | .. |
---|
4952 | 6238 | private MenuItem doubleItem; |
---|
4953 | 6239 | private MenuItem tripleItem; |
---|
4954 | 6240 | |
---|
4955 | | - private MenuItem importGFDItem; |
---|
4956 | | - private MenuItem importVRMLX3DItem; |
---|
4957 | | - private MenuItem import3DSItem; |
---|
4958 | | - private MenuItem importOBJItem; |
---|
4959 | | - |
---|
4960 | 6241 | private MenuItem computeAOItem; |
---|
4961 | 6242 | private MenuItem recompileItem; |
---|
4962 | 6243 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
4966 | 6247 | private MenuItem analyzeItem; |
---|
4967 | 6248 | private MenuItem dumpItem; |
---|
4968 | 6249 | //boolean freezemodel = false; |
---|
| 6250 | + |
---|
| 6251 | + Menu cameraMenu; |
---|
| 6252 | + MenuItem editCameraItem; |
---|
| 6253 | + MenuItem restoreCameraItem; |
---|
4969 | 6254 | } |
---|