.. | .. |
---|
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, |
---|
.. | .. |
---|
22 | 23 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
23 | 24 | ItemListener // ListSelectionListener |
---|
24 | 25 | { |
---|
| 26 | + |
---|
| 27 | + public void AddSkyboxButton(String f, String s, cGridBag row) |
---|
| 28 | + { |
---|
| 29 | + cButton skyboxButton; |
---|
| 30 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 31 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 33 | + skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 35 | + { |
---|
| 36 | + @Override |
---|
| 37 | + public void actionPerformed(ActionEvent e) |
---|
| 38 | + { |
---|
| 39 | + ChangeSkybox(path); |
---|
| 40 | + } |
---|
| 41 | + }); |
---|
| 42 | + } |
---|
| 43 | + |
---|
| 44 | + public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
| 45 | + { |
---|
| 46 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 47 | + |
---|
| 48 | + tab0.setName("Urban"); |
---|
| 49 | + skyboxpanel.add(tab0); |
---|
| 50 | + |
---|
| 51 | + cGridBag row0 = new cGridBag(); |
---|
| 52 | + cGridBag row1 = new cGridBag(); |
---|
| 53 | + cGridBag row2 = new cGridBag(); |
---|
| 54 | + cGridBag row3 = new cGridBag(); |
---|
| 55 | + cGridBag row4 = new cGridBag(); |
---|
| 56 | + cGridBag row5 = new cGridBag(); |
---|
| 57 | + cGridBag row6 = new cGridBag(); |
---|
| 58 | + |
---|
| 59 | + AddSkyboxButton("default", "rgb", row0); |
---|
| 60 | + //AddSkyboxButton("default", "cornell", row0); |
---|
| 61 | + AddSkyboxButton("penguins", "dust", row0); |
---|
| 62 | + AddSkyboxButton("penguins", "tropic", row0); |
---|
| 63 | + AddSkyboxButton("penguins", "yonder", row0); |
---|
| 64 | + |
---|
| 65 | + AddSkyboxButton("default", "uffizi", row1); |
---|
| 66 | + AddSkyboxButton("bridge", "Bridge", row1); |
---|
| 67 | + AddSkyboxButton("bridge", "Bridge2", row1); |
---|
| 68 | + AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
| 69 | + |
---|
| 70 | + AddSkyboxButton("urban", "Parliament", row2); |
---|
| 71 | + AddSkyboxButton("urban", "Roundabout", row2); |
---|
| 72 | + AddSkyboxButton("urban", "SaintLazarusChurch", row2); |
---|
| 73 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row2); |
---|
| 74 | + |
---|
| 75 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
| 76 | + AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 77 | + AddSkyboxButton("urban", "Medborgarplatsen", row3); |
---|
| 78 | + AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
| 79 | + |
---|
| 80 | + AddSkyboxButton("park", "Buddha", row4); |
---|
| 81 | + AddSkyboxButton("park", "CNTower2", row4); |
---|
| 82 | + AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
| 83 | + AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
| 84 | + |
---|
| 85 | + AddSkyboxButton("park", "Park", row5); |
---|
| 86 | + AddSkyboxButton("park", "Pond", row5); |
---|
| 87 | + AddSkyboxButton("park", "Skansen", row5); |
---|
| 88 | + AddSkyboxButton("park", "Skansen2", row5); |
---|
| 89 | + |
---|
| 90 | + AddSkyboxButton("park", "Skansen3", row6); |
---|
| 91 | + AddSkyboxButton("park", "Skansen4", row6); |
---|
| 92 | + AddSkyboxButton("park", "Skansen5", row6); |
---|
| 93 | + AddSkyboxButton("persson", "VancouverConventionCentre", row6); |
---|
| 94 | + |
---|
| 95 | + tab0.add(row0); |
---|
| 96 | + tab0.add(row1); |
---|
| 97 | + tab0.add(row2); |
---|
| 98 | + tab0.add(row3); |
---|
| 99 | + tab0.add(row4); |
---|
| 100 | + tab0.add(row5); |
---|
| 101 | + tab0.add(row6); |
---|
| 102 | + |
---|
| 103 | + for (int i=5; --i>=0;) |
---|
| 104 | + { |
---|
| 105 | + //oe.toolboxPanel.Return(); |
---|
| 106 | + //tab0.add(new cGridBag()); |
---|
| 107 | + } |
---|
| 108 | + } |
---|
| 109 | + |
---|
| 110 | + public void AddSkyboxTab1(JTabbedPane skyboxpanel) |
---|
| 111 | + { |
---|
| 112 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 113 | + |
---|
| 114 | + tab0.setName("Nature"); |
---|
| 115 | + skyboxpanel.add(tab0); |
---|
| 116 | + |
---|
| 117 | + cGridBag row0 = new cGridBag(); |
---|
| 118 | + cGridBag row1 = new cGridBag(); |
---|
| 119 | + cGridBag row2 = new cGridBag(); |
---|
| 120 | + cGridBag row3 = new cGridBag(); |
---|
| 121 | + cGridBag row4 = new cGridBag(); |
---|
| 122 | + cGridBag row5 = new cGridBag(); |
---|
| 123 | + cGridBag row6 = new cGridBag(); |
---|
| 124 | + |
---|
| 125 | + AddSkyboxButton("beach", "HeartInTheSand", row0); |
---|
| 126 | + AddSkyboxButton("beach", "LarnacaBeach", row0); |
---|
| 127 | + AddSkyboxButton("beach", "PalmTrees", row0); |
---|
| 128 | + AddSkyboxButton("beach", "Tenerife", row0); |
---|
| 129 | + |
---|
| 130 | + AddSkyboxButton("beach", "Tenerife2", row1); |
---|
| 131 | + AddSkyboxButton("beach", "Tenerife3", row1); |
---|
| 132 | + AddSkyboxButton("field", "FishPond", row1); |
---|
| 133 | + AddSkyboxButton("field", "Footballfield", row1); |
---|
| 134 | + |
---|
| 135 | + AddSkyboxButton("field", "Meadow", row2); |
---|
| 136 | + AddSkyboxButton("field", "Sorsele", row2); |
---|
| 137 | + AddSkyboxButton("field", "Sorsele2", row2); |
---|
| 138 | + AddSkyboxButton("field", "Sorsele3", row2); |
---|
| 139 | + |
---|
| 140 | + AddSkyboxButton("forest", "Brudslojan", row3); |
---|
| 141 | + AddSkyboxButton("forest", "Langholmen2", row3); |
---|
| 142 | + AddSkyboxButton("forest", "Plants", row3); |
---|
| 143 | + AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 144 | + |
---|
| 145 | + AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
| 146 | + AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
| 147 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 148 | + AddSkyboxButton("park", "Tantolunden4", row4); |
---|
| 149 | + |
---|
| 150 | + AddSkyboxButton("park", "Stairs", row5); |
---|
| 151 | + AddSkyboxButton("default", "skycube", row6); |
---|
| 152 | + AddSkyboxButton("rocky", "Langholmen", row5); |
---|
| 153 | + AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 154 | + |
---|
| 155 | + AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 156 | + AddSkyboxButton("default", "CloudyHills", row6); |
---|
| 157 | + AddSkyboxButton("daz", "Autumn", row6); |
---|
| 158 | + AddSkyboxButton("daz", "MountainTrail", row6); |
---|
| 159 | + /* |
---|
| 160 | +Autumn |
---|
| 161 | +Greenlands |
---|
| 162 | +MountainTrail |
---|
| 163 | +Oasis |
---|
| 164 | +TheRock |
---|
| 165 | +TopOfTheWorld |
---|
| 166 | +Winter |
---|
| 167 | + */ |
---|
| 168 | + |
---|
| 169 | + tab0.add(row0); |
---|
| 170 | + tab0.add(row1); |
---|
| 171 | + tab0.add(row2); |
---|
| 172 | + tab0.add(row3); |
---|
| 173 | + tab0.add(row4); |
---|
| 174 | + tab0.add(row5); |
---|
| 175 | + tab0.add(row6); |
---|
| 176 | + |
---|
| 177 | + for (int i=5; --i>=0;) |
---|
| 178 | + { |
---|
| 179 | + //oe.toolboxPanel.Return(); |
---|
| 180 | + //tab0.add(new cGridBag()); |
---|
| 181 | + } |
---|
| 182 | + } |
---|
| 183 | + |
---|
| 184 | + public void AddSkyboxTab2(JTabbedPane skyboxpanel) |
---|
| 185 | + { |
---|
| 186 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 187 | + |
---|
| 188 | + tab0.setName("Night"); |
---|
| 189 | + skyboxpanel.add(tab0); |
---|
| 190 | + |
---|
| 191 | + cGridBag row0 = new cGridBag(); |
---|
| 192 | + cGridBag row1 = new cGridBag(); |
---|
| 193 | + cGridBag row2 = new cGridBag(); |
---|
| 194 | + cGridBag row3 = new cGridBag(); |
---|
| 195 | + cGridBag row4 = new cGridBag(); |
---|
| 196 | + cGridBag row5 = new cGridBag(); |
---|
| 197 | + cGridBag row6 = new cGridBag(); |
---|
| 198 | + |
---|
| 199 | + AddSkyboxButton("night", "NightPath", row0); |
---|
| 200 | + AddSkyboxButton("night", "PondNight", row0); |
---|
| 201 | + AddSkyboxButton("night", "Powerlines", row0); |
---|
| 202 | + AddSkyboxButton("night", "SwedishRoyalCastle", row0); |
---|
| 203 | + |
---|
| 204 | + AddSkyboxButton("urban", "CNTower", row1); |
---|
| 205 | + AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
| 206 | + AddSkyboxButton("rocky", "Riddarfjarden", row1); |
---|
| 207 | + AddSkyboxButton("penguins", "sleepyhollow", row1); |
---|
| 208 | + |
---|
| 209 | + AddSkyboxButton("penguins", "kenon_star", row2); |
---|
| 210 | + AddSkyboxButton("persson", "corona", row2); |
---|
| 211 | + AddSkyboxButton("persson", "spaceskybox", row2); |
---|
| 212 | + AddSkyboxButton("indoors", "Vasa", row2); |
---|
| 213 | + |
---|
| 214 | + AddSkyboxButton("winter", "Backyard", row3); |
---|
| 215 | + AddSkyboxButton("winter", "Creek", row3); |
---|
| 216 | + AddSkyboxButton("winter", "FootballField3", row3); |
---|
| 217 | + AddSkyboxButton("winter", "Forest", row3); |
---|
| 218 | + |
---|
| 219 | + AddSkyboxButton("winter", "HornstullsStrand2", row4); |
---|
| 220 | + AddSkyboxButton("winter", "House", row4); |
---|
| 221 | + AddSkyboxButton("winter", "IceLake", row4); |
---|
| 222 | + AddSkyboxButton("winter", "IceRiver", row4); |
---|
| 223 | + |
---|
| 224 | + AddSkyboxButton("winter", "Park3", row5); |
---|
| 225 | + AddSkyboxButton("winter", "PondWinter", row5); |
---|
| 226 | + AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
| 227 | + AddSkyboxButton("winter", "Vindelalven", row5); |
---|
| 228 | + |
---|
| 229 | + AddSkyboxButton("daz", "TheRock", row6); |
---|
| 230 | + AddSkyboxButton("daz", "TopOfTheWorld", row6); |
---|
| 231 | + AddSkyboxButton("daz", "Winter", row6); |
---|
| 232 | + AddSkyboxButton("mountain", "Ryfjallet", row6); |
---|
| 233 | + |
---|
| 234 | + tab0.add(row0); |
---|
| 235 | + tab0.add(row1); |
---|
| 236 | + tab0.add(row2); |
---|
| 237 | + tab0.add(row3); |
---|
| 238 | + tab0.add(row4); |
---|
| 239 | + tab0.add(row5); |
---|
| 240 | + tab0.add(row6); |
---|
| 241 | + |
---|
| 242 | + for (int i=5; --i>=0;) |
---|
| 243 | + { |
---|
| 244 | + //oe.toolboxPanel.Return(); |
---|
| 245 | + //tab0.add(new cGridBag()); |
---|
| 246 | + } |
---|
| 247 | + } |
---|
| 248 | + |
---|
| 249 | + public void AddSkyboxTab3(JTabbedPane skyboxpanel) |
---|
| 250 | + { |
---|
| 251 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 252 | + |
---|
| 253 | + tab0.setName("Others"); |
---|
| 254 | + skyboxpanel.add(tab0); |
---|
| 255 | + |
---|
| 256 | + cGridBag row0 = new cGridBag(); |
---|
| 257 | + cGridBag row1 = new cGridBag(); |
---|
| 258 | + cGridBag row2 = new cGridBag(); |
---|
| 259 | + cGridBag row3 = new cGridBag(); |
---|
| 260 | + cGridBag row4 = new cGridBag(); |
---|
| 261 | + cGridBag row5 = new cGridBag(); |
---|
| 262 | + cGridBag row6 = new cGridBag(); |
---|
| 263 | + |
---|
| 264 | + AddSkyboxButton("mayhem", "afterrain", row0); |
---|
| 265 | + AddSkyboxButton("mayhem", "aqua4", row0); |
---|
| 266 | + AddSkyboxButton("mayhem", "aqua9", row0); |
---|
| 267 | + AddSkyboxButton("mayhem", "flame", row0); |
---|
| 268 | + |
---|
| 269 | + AddSkyboxButton("mayhem", "h2s", row1); |
---|
| 270 | + AddSkyboxButton("mayhem", "prehistoric", row1); |
---|
| 271 | + AddSkyboxButton("mayhem", "scorched", row1); |
---|
| 272 | + AddSkyboxButton("penguins", "desertdawn", row1); |
---|
| 273 | + |
---|
| 274 | + AddSkyboxButton("persson", "Citadella", row2); |
---|
| 275 | + AddSkyboxButton("persson", "Citadella2", row2); |
---|
| 276 | + AddSkyboxButton("persson", "clouds1", row2); |
---|
| 277 | + AddSkyboxButton("penguins", "wrath", row2); |
---|
| 278 | + |
---|
| 279 | + AddSkyboxButton("persson", "FishermansBastion", row3); |
---|
| 280 | + AddSkyboxButton("persson", "HeroesSquare", row3); |
---|
| 281 | + AddSkyboxButton("indoors", "DallasW", row3); |
---|
| 282 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row3); |
---|
| 283 | + |
---|
| 284 | + AddSkyboxButton("persson", "LancellottiChapel", row4); |
---|
| 285 | + AddSkyboxButton("persson", "PereaBeach1", row4); |
---|
| 286 | + AddSkyboxButton("persson", "PereaBeach2", row4); |
---|
| 287 | + AddSkyboxButton("persson", "redeclipse", row4); |
---|
| 288 | + |
---|
| 289 | + AddSkyboxButton("daz", "Greenlands", row5); |
---|
| 290 | + AddSkyboxButton("daz", "Oasis", row5); |
---|
| 291 | + AddSkyboxButton("elyvisions", "arch3", row5); |
---|
| 292 | + AddSkyboxButton("elyvisions", "calm_sea", row5); |
---|
| 293 | + |
---|
| 294 | + AddSkyboxButton("elyvisions", "rainbow", row6); |
---|
| 295 | + AddSkyboxButton("elyvisions", "distant_sunset", row6); |
---|
| 296 | + AddSkyboxButton("elyvisions", "heaven", row6); |
---|
| 297 | + AddSkyboxButton("elyvisions", "hot", row6); |
---|
| 298 | + |
---|
| 299 | + tab0.add(row0); |
---|
| 300 | + tab0.add(row1); |
---|
| 301 | + tab0.add(row2); |
---|
| 302 | + tab0.add(row3); |
---|
| 303 | + tab0.add(row4); |
---|
| 304 | + tab0.add(row5); |
---|
| 305 | + tab0.add(row6); |
---|
| 306 | + |
---|
| 307 | + for (int i=5; --i>=0;) |
---|
| 308 | + { |
---|
| 309 | + //oe.toolboxPanel.Return(); |
---|
| 310 | + //tab0.add(new cGridBag()); |
---|
| 311 | + } |
---|
| 312 | + } |
---|
| 313 | + |
---|
| 314 | + public void ChangeSkybox(String name) |
---|
| 315 | + { |
---|
| 316 | + //cameraView.envyoff = false; |
---|
| 317 | + group.skyboxname = name; |
---|
| 318 | + group.skyboxext = "jpg"; |
---|
| 319 | + cameraView.repaint(); |
---|
| 320 | + } |
---|
| 321 | + |
---|
25 | 322 | //ObjEditor objEditor; |
---|
26 | 323 | public void closeUI2() |
---|
27 | 324 | { |
---|
.. | .. |
---|
59 | 356 | this.copy = this.group = group; |
---|
60 | 357 | //selectees = this.group.selectees; |
---|
61 | 358 | |
---|
| 359 | + if (copy.versions == null) |
---|
| 360 | + { |
---|
| 361 | + copy.versions = new byte[100][]; |
---|
| 362 | + copy.versionindex = -1; |
---|
| 363 | + } |
---|
| 364 | + |
---|
62 | 365 | if(ui) |
---|
63 | 366 | SetupUI(objEditor); |
---|
64 | 367 | } |
---|
.. | .. |
---|
73 | 376 | this.copy = this.group = copy; |
---|
74 | 377 | //selectees = this.group.selectees; |
---|
75 | 378 | |
---|
76 | | - SetupMenu2(objEditor); |
---|
| 379 | + SetupMenu2(this); //objEditor); |
---|
77 | 380 | SetupUI2(objEditor); |
---|
78 | 381 | objEditor.SetupUI(true); |
---|
79 | 382 | SetupViews(objEditor); |
---|
80 | 383 | |
---|
81 | 384 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 385 | + |
---|
| 386 | + if (copy.versions == null) |
---|
| 387 | + { |
---|
| 388 | + copy.versions = new byte[100][]; |
---|
| 389 | + copy.versionindex = -1; |
---|
| 390 | + |
---|
| 391 | + Save(true); |
---|
| 392 | + } |
---|
82 | 393 | } |
---|
83 | 394 | |
---|
84 | 395 | void CloneSelection(boolean supports) |
---|
85 | 396 | { |
---|
| 397 | + if (Globals.REPLACEONMAKE) |
---|
| 398 | + Save(); |
---|
| 399 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 400 | + Globals.REPLACEONMAKE = false; |
---|
86 | 401 | // Object3D keep = GrafreeD.clipboard; |
---|
87 | 402 | //Object3D obj; |
---|
88 | 403 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
93 | 408 | |
---|
94 | 409 | makeSomething(clone, i==group.selection.size()-1); |
---|
95 | 410 | } |
---|
| 411 | + Globals.REPLACEONMAKE = keep; |
---|
96 | 412 | } |
---|
97 | 413 | |
---|
98 | 414 | void CloneClipboard(boolean supports) |
---|
99 | 415 | { |
---|
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)); |
---|
| 416 | + assert(Grafreed.clipboard.parent == null); |
---|
| 417 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 418 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 419 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 420 | + makeSomething(CloneObject(Grafreed.clipboard.get(0), false)); |
---|
105 | 421 | else |
---|
106 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
107 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 422 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 423 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
108 | 424 | } |
---|
109 | 425 | |
---|
110 | 426 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 434 | // obj.support = null; |
---|
119 | 435 | if (!supports) |
---|
120 | 436 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 437 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
122 | 438 | obj.parent = parent; |
---|
123 | 439 | // obj.support = support; |
---|
124 | 440 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
147 | 463 | |
---|
148 | 464 | //JTextField nameField; |
---|
149 | 465 | |
---|
150 | | - void SetupMenu2(ObjEditor oe) |
---|
| 466 | + void SetupMenu2(GroupEditor oe) |
---|
151 | 467 | { |
---|
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); |
---|
| 468 | + oe.jTree = new cTree(); |
---|
| 469 | + |
---|
163 | 470 | Menu menu; |
---|
164 | 471 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
165 | 472 | //editItem = menu.add(new MenuItem("Edit")); |
---|
166 | 473 | //editItem.addActionListener(this); |
---|
167 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 474 | + |
---|
| 475 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 476 | +// undoItem.addActionListener(this); |
---|
| 477 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 478 | +// redoItem.addActionListener(this); |
---|
| 479 | +// menu.add("-"); |
---|
| 480 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
168 | 481 | duplicateItem.addActionListener(this); |
---|
169 | | - menu.add("-"); |
---|
170 | 482 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
171 | 483 | cloneItem.addActionListener(this); |
---|
| 484 | + if (Globals.ADVANCED) |
---|
| 485 | + { |
---|
172 | 486 | cloneSupportItem = menu.add(new MenuItem("Clone (+supports)")); |
---|
173 | 487 | cloneSupportItem.addActionListener(this); |
---|
| 488 | + } |
---|
174 | 489 | menu.add("-"); |
---|
175 | 490 | cutItem = menu.add(new MenuItem("Cut")); |
---|
176 | 491 | cutItem.addActionListener(this); |
---|
.. | .. |
---|
178 | 493 | copyItem.addActionListener(this); |
---|
179 | 494 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
180 | 495 | pasteItem.addActionListener(this); |
---|
| 496 | + |
---|
| 497 | + menu.add("-"); |
---|
| 498 | + pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
| 499 | + pasteIntoItem.addActionListener(this); |
---|
181 | 500 | pasteLinkItem = menu.add(new MenuItem("Paste link")); |
---|
182 | 501 | pasteLinkItem.addActionListener(this); |
---|
183 | 502 | pasteCloneItem = menu.add(new MenuItem("Paste clone")); |
---|
184 | 503 | pasteCloneItem.addActionListener(this); |
---|
185 | 504 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
186 | 505 | // pasteExpandItem.addActionListener(this); |
---|
187 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
188 | | - clearItem.addActionListener(this); |
---|
| 506 | + menu.add("-"); |
---|
| 507 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 508 | + deleteItem.addActionListener(this); |
---|
| 509 | + |
---|
| 510 | + if (Globals.ADVANCED) |
---|
| 511 | + { |
---|
| 512 | + // Deletes the cameras... |
---|
189 | 513 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
190 | 514 | clearAllItem.addActionListener(this); |
---|
| 515 | + } |
---|
| 516 | + |
---|
| 517 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 518 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 519 | + //zBufferItem.addActionListener(this); |
---|
| 520 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 521 | + //normalLensItem.addActionListener(this); |
---|
| 522 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 523 | + restoreCameraItem.addActionListener(this); |
---|
| 524 | + |
---|
| 525 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 526 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 527 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 528 | +// cameraMenu.add("-"); |
---|
| 529 | +// |
---|
| 530 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 531 | +// toggleTextureItem.addItemListener(this); |
---|
| 532 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 533 | +// |
---|
| 534 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 535 | +// toggleSwitchItem.addItemListener(this); |
---|
| 536 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 537 | + |
---|
| 538 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 539 | + toggleHandleItem.addItemListener(this); |
---|
| 540 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 541 | + |
---|
| 542 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 543 | + togglePaintItem.addItemListener(this); |
---|
| 544 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 545 | + |
---|
| 546 | + if (Globals.ADVANCED) |
---|
| 547 | + { |
---|
| 548 | + cameraMenu.add("-"); |
---|
| 549 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 550 | + toggleLiveItem.addItemListener(this); |
---|
| 551 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
191 | 552 | |
---|
| 553 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 554 | + stepItem.addActionListener(this); |
---|
| 555 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 556 | + // toggleDLItem.addItemListener(this); |
---|
| 557 | + // toggleDLItem.setState(false); |
---|
| 558 | + |
---|
| 559 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 560 | + toggleRenderItem.addItemListener(this); |
---|
| 561 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 562 | + |
---|
| 563 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 564 | + toggleDebugItem.addItemListener(this); |
---|
| 565 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 566 | + |
---|
| 567 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 568 | + toggleFrustumItem.addItemListener(this); |
---|
| 569 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 570 | + |
---|
| 571 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 572 | + toggleFootContactItem.addItemListener(this); |
---|
| 573 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 574 | + |
---|
| 575 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 576 | + toggleTimelineItem.addItemListener(this); |
---|
| 577 | + } |
---|
| 578 | + |
---|
| 579 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 580 | +// toggleRootItem.addItemListener(this); |
---|
| 581 | +// toggleRootItem.setState(false); |
---|
| 582 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 583 | +// animationItem.addItemListener(this); |
---|
| 584 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 585 | + cameraMenu.add("-"); |
---|
| 586 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 587 | + editCameraItem.addActionListener(this); |
---|
| 588 | + |
---|
| 589 | + if (Globals.ADVANCED) |
---|
| 590 | + { |
---|
| 591 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 592 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 593 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 594 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 595 | + oe.cameraMenu.add("-"); |
---|
| 596 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 597 | + openWindowItem.addActionListener(this); |
---|
| 598 | + editLeafItem.addActionListener(this); |
---|
| 599 | + lookAtItem.addActionListener(this); |
---|
| 600 | + //lookFromItem.addActinoListener(this); |
---|
| 601 | + //switchViewItem.addActionListener(this); |
---|
| 602 | + } |
---|
| 603 | + |
---|
192 | 604 | 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); |
---|
| 605 | + if (Globals.ADVANCED) |
---|
| 606 | + { |
---|
197 | 607 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
198 | 608 | revertMeshItem.addActionListener(this); |
---|
199 | 609 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
200 | 610 | resetreferencesItem.addActionListener(this); |
---|
201 | 611 | menu.add("-"); |
---|
| 612 | + } |
---|
202 | 613 | overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry")); |
---|
203 | 614 | overwriteGeoItem.addActionListener(this); |
---|
204 | 615 | overwriteMatItem = menu.add(new MenuItem("Overwrite Material")); |
---|
.. | .. |
---|
210 | 621 | overwriteUVItem = menu.add(new MenuItem("Overwrite UV")); |
---|
211 | 622 | overwriteUVItem.addActionListener(this); |
---|
212 | 623 | menu.add("-"); |
---|
| 624 | + if (Globals.ADVANCED) |
---|
| 625 | + { |
---|
213 | 626 | generateMeshItem = menu.add(new MenuItem("Generate Meshes")); |
---|
214 | 627 | generateMeshItem.addActionListener(this); |
---|
215 | 628 | poseMeshItem = menu.add(new MenuItem("Set Pose Meshes")); |
---|
216 | 629 | poseMeshItem.addActionListener(this); |
---|
217 | 630 | menu.add("-"); |
---|
| 631 | + } |
---|
218 | 632 | resetsupportItem = menu.add(new MenuItem("Reset support")); |
---|
219 | 633 | resetsupportItem.addActionListener(this); |
---|
220 | 634 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 635 | linkverticesItem.addActionListener(this); |
---|
222 | 636 | relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
223 | 637 | relinkverticesItem.addActionListener(this); |
---|
| 638 | + |
---|
| 639 | + if (Globals.ADVANCED) |
---|
| 640 | + { |
---|
224 | 641 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
225 | 642 | setMasterItem.addActionListener(this); |
---|
| 643 | + } |
---|
226 | 644 | |
---|
227 | 645 | oe.menuBar.add(menu = new Menu("Group")); |
---|
228 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
229 | | - grabItem.addActionListener(this); |
---|
| 646 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 647 | +// grabItem.addActionListener(this); |
---|
230 | 648 | backItem = menu.add(new MenuItem("Back")); |
---|
231 | 649 | backItem.addActionListener(this); |
---|
232 | 650 | frontItem = menu.add(new MenuItem("Front")); |
---|
233 | 651 | frontItem.addActionListener(this); |
---|
234 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
235 | | - compositeItem.addActionListener(this); |
---|
236 | | - hideItem = menu.add(new MenuItem("Hide")); |
---|
| 652 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 653 | +// compositeItem.addActionListener(this); |
---|
| 654 | + |
---|
| 655 | + if (Globals.ADVANCED) |
---|
| 656 | + { |
---|
| 657 | + hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
237 | 658 | hideItem.addActionListener(this); |
---|
| 659 | + } |
---|
238 | 660 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
239 | 661 | ungroupItem.addActionListener(this); |
---|
240 | | - menu.add("-"); |
---|
241 | | - randomItem = menu.add(new MenuItem("Random")); |
---|
242 | | - randomItem.addActionListener(this); |
---|
243 | | - physicsItem = menu.add(new MenuItem("Physics")); |
---|
244 | | - physicsItem.addActionListener(this); |
---|
245 | | - frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
246 | | - frameselectorItem.addActionListener(this); |
---|
| 662 | + |
---|
| 663 | +// menu.add("-"); |
---|
| 664 | +// |
---|
| 665 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 666 | +// switchItem.addActionListener(this); |
---|
| 667 | + if (Globals.ADVANCED) |
---|
| 668 | + { |
---|
247 | 669 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
248 | 670 | switchGeoItem.addActionListener(this); |
---|
249 | 671 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
250 | 672 | switchTransfoItem.addActionListener(this); |
---|
251 | | - morphItem = menu.add(new MenuItem("Morph")); |
---|
| 673 | + morphItem = menu.add(new MenuItem("Morph Group")); |
---|
252 | 674 | morphItem.addActionListener(this); |
---|
| 675 | + |
---|
| 676 | + menu.add("-"); |
---|
| 677 | + physicsItem = menu.add(new MenuItem("Physics")); |
---|
| 678 | + physicsItem.addActionListener(this); |
---|
| 679 | + frameselectorItem = menu.add(new MenuItem("Frame Selector")); |
---|
| 680 | + frameselectorItem.addActionListener(this); |
---|
253 | 681 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
254 | 682 | scriptNodeItem.addActionListener(this); |
---|
255 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
256 | | - cameraItem.addActionListener(this); |
---|
| 683 | + } |
---|
257 | 684 | |
---|
258 | 685 | oe.menuBar.add(menu = new Menu("Object")); |
---|
259 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
260 | | - textureItem.addActionListener(this); |
---|
| 686 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 687 | +// textureItem.addActionListener(this); |
---|
261 | 688 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
262 | 689 | billboardItem.addActionListener(this); |
---|
263 | 690 | csgItem = menu.add(new MenuItem("CSG")); |
---|
264 | 691 | csgItem.addActionListener(this); |
---|
265 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 692 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
266 | 693 | shadowXItem.addActionListener(this); |
---|
267 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 694 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
268 | 695 | shadowYItem.addActionListener(this); |
---|
269 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 696 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
270 | 697 | shadowZItem.addActionListener(this); |
---|
| 698 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 699 | + attributeItem.addActionListener(this); |
---|
| 700 | + |
---|
| 701 | + if (Globals.ADVANCED) |
---|
| 702 | + { |
---|
| 703 | + menu.add("-"); |
---|
271 | 704 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
272 | 705 | linkerItem.addActionListener(this); |
---|
273 | 706 | templateItem = menu.add(new MenuItem("Template")); |
---|
274 | 707 | templateItem.addActionListener(this); |
---|
275 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
276 | | - attributeItem.addActionListener(this); |
---|
277 | 708 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
278 | 709 | pointflowItem.addActionListener(this); |
---|
| 710 | + } |
---|
279 | 711 | menu.add("-"); |
---|
280 | 712 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
281 | 713 | resetTransformItem.addActionListener(this); |
---|
282 | 714 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
283 | 715 | resetCentroidItem.addActionListener(this); |
---|
284 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
285 | | - transformgeometryItem.addActionListener(this); |
---|
| 716 | + resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY")); |
---|
| 717 | + resetCentroidXZItem.addActionListener(this); |
---|
| 718 | + transformGeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
| 719 | + transformGeometryItem.addActionListener(this); |
---|
| 720 | + transformChildrenItem = menu.add(new MenuItem("Transform Children")); |
---|
| 721 | + transformChildrenItem.addActionListener(this); |
---|
286 | 722 | |
---|
287 | 723 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
288 | 724 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
293 | 729 | genNormalsCADItem.addActionListener(this); |
---|
294 | 730 | genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals")); |
---|
295 | 731 | genNormalsMESHItem.addActionListener(this); |
---|
296 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 732 | + if (Globals.ADVANCED) |
---|
| 733 | + { |
---|
| 734 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
297 | 735 | genNormalsMINEItem.addActionListener(this); |
---|
| 736 | + } |
---|
298 | 737 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
299 | 738 | stripifyItem.addActionListener(this); |
---|
300 | 739 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
316 | 755 | reduce34MeshItem.addActionListener(this); |
---|
317 | 756 | increaseMeshItem = menu.add(new MenuItem("Increase mesh")); |
---|
318 | 757 | increaseMeshItem.addActionListener(this); |
---|
319 | | - smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
320 | | - smoothMeshItem.addActionListener(this); |
---|
321 | 758 | clipMeshItem = menu.add(new MenuItem("Clip mesh")); |
---|
322 | 759 | clipMeshItem.addActionListener(this); |
---|
| 760 | + |
---|
| 761 | + if (Globals.ADVANCED) |
---|
| 762 | + { |
---|
| 763 | + smoothMeshItem = menu.add(new MenuItem("Smooth mesh")); |
---|
| 764 | + smoothMeshItem.addActionListener(this); |
---|
| 765 | + } |
---|
323 | 766 | |
---|
324 | 767 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
325 | 768 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
326 | 769 | clearMaterialsItem.addActionListener(this); |
---|
| 770 | + resetAllItem = menu.add(new MenuItem("Reset All")); |
---|
| 771 | + resetAllItem.addActionListener(this); |
---|
| 772 | + stepAllItem = menu.add(new MenuItem("Step All")); |
---|
| 773 | + stepAllItem.addActionListener(this); |
---|
327 | 774 | menu.add("-"); |
---|
328 | 775 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
329 | 776 | liveleavesItem.addActionListener(this); |
---|
330 | 777 | unliveleavesItem = menu.add(new MenuItem("Unlive Leaves")); |
---|
331 | 778 | unliveleavesItem.addActionListener(this); |
---|
| 779 | + if (Globals.ADVANCED) |
---|
| 780 | + { |
---|
332 | 781 | supportleavesItem = menu.add(new MenuItem("Support Leaves")); |
---|
333 | 782 | supportleavesItem.addActionListener(this); |
---|
334 | 783 | unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves")); |
---|
335 | 784 | unsupportleavesItem.addActionListener(this); |
---|
| 785 | + } |
---|
336 | 786 | hideleavesItem = menu.add(new MenuItem("Hide Leaves")); |
---|
337 | 787 | hideleavesItem.addActionListener(this); |
---|
338 | 788 | showleavesItem = menu.add(new MenuItem("Show Leaves")); |
---|
.. | .. |
---|
341 | 791 | markleavesItem.addActionListener(this); |
---|
342 | 792 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
343 | 793 | unmarkleavesItem.addActionListener(this); |
---|
| 794 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 795 | + rewindleavesItem.addActionListener(this); |
---|
| 796 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 797 | + unrewindleavesItem.addActionListener(this); |
---|
| 798 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 799 | + randomleavesItem.addActionListener(this); |
---|
| 800 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 801 | + unrandomleavesItem.addActionListener(this); |
---|
344 | 802 | menu.add("-"); |
---|
345 | 803 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
346 | 804 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
366 | 824 | attachBumpItem.addActionListener(this); |
---|
367 | 825 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
368 | 826 | pigmentBumpItem.addActionListener(this); |
---|
| 827 | + //embedTexturesItem |
---|
369 | 828 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
370 | 829 | detachPigmentItem.addActionListener(this); |
---|
371 | 830 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
372 | 831 | detachBumpItem.addActionListener(this); |
---|
| 832 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 833 | + embedTexturesItem.addActionListener(this); |
---|
| 834 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 835 | + deEmbedTexturesItem.addActionListener(this); |
---|
373 | 836 | menu.add("-"); |
---|
374 | 837 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
375 | 838 | sortbysizeItem.addActionListener(this); |
---|
376 | 839 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
377 | 840 | sortbynameItem.addActionListener(this); |
---|
378 | 841 | menu.add("-"); |
---|
| 842 | + shareGeometriesItem = menu.add(new MenuItem("Share Geometries")); |
---|
| 843 | + shareGeometriesItem.addActionListener(this); |
---|
| 844 | + mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
| 845 | + mergeGeometriesItem.addActionListener(this); |
---|
| 846 | + if (Globals.ADVANCED) |
---|
| 847 | + { |
---|
| 848 | + // Pretty much the same as duplicate and clone. |
---|
379 | 849 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
380 | 850 | extractGeometriesItem.addActionListener(this); |
---|
381 | 851 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
382 | 852 | cloneGeometriesItem.addActionListener(this); |
---|
383 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
384 | | - shareGeometriesItem.addActionListener(this); |
---|
385 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
386 | | - mergeGeometriesItem.addActionListener(this); |
---|
| 853 | + } |
---|
387 | 854 | |
---|
388 | 855 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
389 | 856 | buildCreateMenu(menu); |
---|
390 | 857 | |
---|
391 | | - |
---|
392 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
393 | | - importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
394 | | - importGFDItem.addActionListener(this); |
---|
395 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
396 | | - importVRMLX3DItem.addActionListener(this); |
---|
397 | | - importOBJItem = menu.add(new MenuItem("OBJ Object...")); |
---|
398 | | - importOBJItem.addActionListener(this); |
---|
399 | | - import3DSItem = menu.add(new MenuItem("3DS Object...")); |
---|
400 | | - import3DSItem.addActionListener(this); |
---|
401 | | - |
---|
402 | 858 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
403 | 859 | buildToolsMenu(menu); |
---|
404 | 860 | } |
---|
405 | 861 | |
---|
| 862 | + |
---|
406 | 863 | void SetupUI2(ObjEditor oe) |
---|
407 | 864 | { |
---|
| 865 | + // June 2019 |
---|
| 866 | + if (oe == null) |
---|
| 867 | + { |
---|
| 868 | + //super.SetupUI2(this); |
---|
| 869 | + //return; |
---|
| 870 | + } |
---|
| 871 | + |
---|
| 872 | + if (copy != group) |
---|
| 873 | + { |
---|
| 874 | + //super.SetupUI2(this); |
---|
| 875 | + } |
---|
| 876 | + |
---|
408 | 877 | //new Exception().printStackTrace(); |
---|
409 | 878 | |
---|
410 | 879 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
433 | 902 | oe.radioPanel.add(dummyButton); |
---|
434 | 903 | oe.buttonGroup.add(dummyButton); |
---|
435 | 904 | */ |
---|
436 | | - aConstraints.gridy += 1; |
---|
| 905 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 906 | + |
---|
| 907 | + copyOptionsPanel.preferredHeight = 2; |
---|
437 | 908 | |
---|
438 | 909 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
439 | 910 | |
---|
440 | | - oe.aConstraints.gridwidth = 1; |
---|
441 | | - oe.aConstraints.gridx = 0; |
---|
| 911 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 912 | + //minButton.setToolTipText("Minimize window"); |
---|
| 913 | + //minButton.addActionListener(this); |
---|
442 | 914 | |
---|
443 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints); |
---|
444 | | - liveCB.setToolTipText("Enabled animation"); |
---|
445 | | - liveCB.addItemListener(this); |
---|
446 | | - |
---|
447 | | - oe.aConstraints.gridx += 1; |
---|
448 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK), oe.aConstraints); |
---|
449 | | - trackCB.setToolTipText("Enable tracking"); |
---|
450 | | - trackCB.addItemListener(this); |
---|
451 | | - |
---|
452 | | - oe.aConstraints.gridx += 1; |
---|
453 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints); |
---|
| 915 | + if (Globals.ADVANCED) |
---|
| 916 | + { |
---|
| 917 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 918 | + maxButton.setToolTipText("Maximize window"); |
---|
| 919 | + maxButton.addActionListener(this); |
---|
| 920 | + } |
---|
| 921 | + |
---|
| 922 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 923 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 924 | + fullButton.addActionListener(this); |
---|
| 925 | + |
---|
| 926 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
454 | 927 | screenfitButton.setToolTipText("Screen fit"); |
---|
455 | 928 | screenfitButton.addActionListener(this); |
---|
456 | | - oe.aConstraints.gridx += 1; |
---|
| 929 | + |
---|
| 930 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 931 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 932 | + restoreCameraButton.addActionListener(this); |
---|
| 933 | + |
---|
| 934 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 935 | + saveButton.setToolTipText("New version"); |
---|
| 936 | + saveButton.addActionListener(this); |
---|
| 937 | + |
---|
| 938 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 939 | + undoButton.setToolTipText("Previous version"); |
---|
| 940 | + undoButton.addActionListener(this); |
---|
| 941 | + undoButton.setEnabled(false); |
---|
| 942 | + |
---|
| 943 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 944 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 945 | + restoreButton.setToolTipText("Restore current"); |
---|
| 946 | + restoreButton.addActionListener(this); |
---|
| 947 | + restoreButton.setEnabled(false); |
---|
| 948 | + |
---|
| 949 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 950 | + replaceButton.setToolTipText("Replace current"); |
---|
| 951 | + replaceButton.addActionListener(this); |
---|
| 952 | + replaceButton.setEnabled(false); |
---|
| 953 | + |
---|
| 954 | + copyOptionsPanel.add(updown); |
---|
| 955 | + |
---|
| 956 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 957 | + redoButton.setToolTipText("Next version"); |
---|
| 958 | + redoButton.addActionListener(this); |
---|
| 959 | + redoButton.setEnabled(false); |
---|
| 960 | + |
---|
| 961 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 962 | + liveCB.setToolTipText("Enable animation"); |
---|
| 963 | + liveCB.addItemListener(this); |
---|
| 964 | + |
---|
| 965 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 966 | + oneStepButton.setToolTipText("Animate one step forward"); |
---|
| 967 | + oneStepButton.addActionListener(this); |
---|
| 968 | + |
---|
| 969 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 970 | + fastCB.setToolTipText("Fast mode"); |
---|
| 971 | + fastCB.addItemListener(this); |
---|
| 972 | + |
---|
| 973 | + //oe.toolboxPanel.Return(); |
---|
| 974 | + |
---|
| 975 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 976 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 977 | +// trackCB.addItemListener(this); |
---|
| 978 | + |
---|
457 | 979 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
458 | 980 | // screenfitpointButton.addActionListener(this); |
---|
459 | | -// oe.aConstraints.gridx += 1; |
---|
460 | | - oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints); |
---|
461 | | - snapobjectButton.addActionListener(this); |
---|
462 | | - snapobjectButton.setToolTipText("Snap Object"); |
---|
463 | | - oe.aConstraints.gridx += 1; |
---|
464 | 981 | |
---|
465 | | - //aConstraints.gridx = 0; |
---|
466 | | - //aConstraints.gridy += 1; |
---|
467 | | - oe.aConstraints.weighty = 0; |
---|
468 | | - oe.aConstraints.gridwidth = 1; |
---|
469 | | - |
---|
470 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
471 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
472 | | - flashSelectionButton.addActionListener(this); |
---|
473 | | - |
---|
474 | | - oe.toolbarPanel.add(new cButton(" ", false)); |
---|
475 | | - |
---|
476 | | - oe.aConstraints.gridx += 1; |
---|
477 | | - oe.aConstraints.weighty = 0; |
---|
478 | | - oe.aConstraints.gridwidth = 1; |
---|
479 | | - |
---|
480 | | - // |
---|
481 | | - oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints); |
---|
482 | | - twoButton.setToolTipText("Show center view only"); |
---|
483 | | - twoButton.addActionListener(this); |
---|
484 | | - oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints); |
---|
| 982 | + if (Globals.ADVANCED) |
---|
| 983 | + { |
---|
| 984 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 985 | + snapobjectButton.addActionListener(this); |
---|
| 986 | + snapobjectButton.setToolTipText("Snap Object"); |
---|
| 987 | + |
---|
| 988 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
485 | 989 | fourButton.addActionListener(this); |
---|
486 | | - fourButton.setToolTipText("Show left panel only"); |
---|
487 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints); |
---|
488 | | - sixButton.setToolTipText("2-column layout left"); |
---|
489 | | - sixButton.addActionListener(this); |
---|
490 | | - oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints); |
---|
491 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 990 | + fourButton.setToolTipText("Show control panel only"); |
---|
| 991 | + } |
---|
| 992 | + |
---|
| 993 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
| 994 | + |
---|
| 995 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 996 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 997 | + twoButton.addActionListener(this); |
---|
| 998 | + this.fullscreenLayout = twoButton; |
---|
| 999 | + |
---|
| 1000 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1001 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
492 | 1002 | threeButton.addActionListener(this); |
---|
493 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints); |
---|
494 | | - sevenButton.setToolTipText("3-column layout"); |
---|
495 | | - sevenButton.addActionListener(this); |
---|
| 1003 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1004 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1005 | + sixButton.addActionListener(this); |
---|
| 1006 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1007 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1008 | +// sevenButton.addActionListener(this); |
---|
496 | 1009 | // |
---|
497 | 1010 | |
---|
498 | | - oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints); |
---|
499 | | - rootButton.setToolTipText("Edit object in new tab"); |
---|
| 1011 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1012 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
500 | 1013 | rootButton.addActionListener(this); |
---|
501 | | - oe.aConstraints.gridx += 1; |
---|
502 | | - oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints); |
---|
| 1014 | + |
---|
| 1015 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
503 | 1016 | closeButton.setToolTipText("Close tab"); |
---|
504 | 1017 | closeButton.addActionListener(this); |
---|
505 | 1018 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
506 | 1019 | //clearButton.addActionListener(this); |
---|
507 | | - oe.aConstraints.gridx += 1; |
---|
508 | | - |
---|
509 | | - oe.aConstraints.gridx = 1; // |
---|
510 | | - oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints); |
---|
511 | | - editButton.addActionListener(this); |
---|
512 | | - oe.aConstraints.gridx += 1; |
---|
513 | | - oe.aConstraints.weighty = 0; |
---|
514 | | - oe.aConstraints.gridwidth = 1; |
---|
515 | 1020 | |
---|
516 | | - oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints); |
---|
| 1021 | + cGridBag row1 = new cGridBag(); |
---|
| 1022 | + |
---|
| 1023 | + // INSERT |
---|
| 1024 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1025 | + gridButton.setToolTipText("Create grid"); |
---|
| 1026 | + gridButton.addActionListener(this); |
---|
| 1027 | + |
---|
| 1028 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1029 | + boxButton.setToolTipText("Create box"); |
---|
| 1030 | + boxButton.addActionListener(this); |
---|
| 1031 | + |
---|
| 1032 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1033 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1034 | + sphereButton.addActionListener(this); |
---|
| 1035 | + |
---|
| 1036 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1037 | + coneButton.setToolTipText("Create cone"); |
---|
| 1038 | + coneButton.addActionListener(this); |
---|
| 1039 | + |
---|
| 1040 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1041 | + torusButton.setToolTipText("Create torus"); |
---|
| 1042 | + torusButton.addActionListener(this); |
---|
| 1043 | + |
---|
| 1044 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1045 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1046 | + superButton.addActionListener(this); |
---|
| 1047 | + |
---|
| 1048 | + if (Globals.ADVANCED) |
---|
| 1049 | + { |
---|
| 1050 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1051 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 1052 | + kleinButton.addActionListener(this); |
---|
| 1053 | + } |
---|
| 1054 | + |
---|
| 1055 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1056 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 1057 | + particlesButton.addActionListener(this); |
---|
| 1058 | + |
---|
| 1059 | + oe.toolboxPanel.add(row1); |
---|
| 1060 | + |
---|
| 1061 | + cGridBag row2 = new cGridBag(); |
---|
| 1062 | + |
---|
| 1063 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1064 | + groupButton.setToolTipText("Create group"); |
---|
| 1065 | + groupButton.addActionListener(this); |
---|
| 1066 | + |
---|
| 1067 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1069 | + compositeButton.addActionListener(this); |
---|
| 1070 | + |
---|
| 1071 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1073 | + switchButton.addActionListener(this); |
---|
| 1074 | + |
---|
| 1075 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1076 | + loopButton.setToolTipText("Create loop"); |
---|
| 1077 | + loopButton.addActionListener(this); |
---|
| 1078 | + |
---|
| 1079 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1080 | + textureButton.setToolTipText("Create texture"); |
---|
| 1081 | + textureButton.addActionListener(this); |
---|
| 1082 | + |
---|
| 1083 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1084 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1085 | + overlayButton.addActionListener(this); |
---|
| 1086 | + |
---|
| 1087 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1088 | + lightButton.setToolTipText("Create light"); |
---|
| 1089 | + lightButton.addActionListener(this); |
---|
| 1090 | + |
---|
| 1091 | + oe.toolboxPanel.add(row2); |
---|
| 1092 | + |
---|
| 1093 | + // ENVYMAPS |
---|
| 1094 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1095 | + skyboxpane.preferredHeight = 100; |
---|
| 1096 | + |
---|
| 1097 | + oe.toolboxPanel.add(skyboxpane); |
---|
| 1098 | + |
---|
| 1099 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1100 | + skyboxpane.add(skyboxpanel); |
---|
| 1101 | + |
---|
| 1102 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1103 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1104 | + AddSkyboxTab2(skyboxpanel); |
---|
| 1105 | + AddSkyboxTab3(skyboxpanel); |
---|
| 1106 | + |
---|
| 1107 | + // EDIT panel |
---|
| 1108 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + editButton.setToolTipText("Pin selection controls"); |
---|
| 1110 | + editButton.addActionListener(this); |
---|
| 1111 | + |
---|
| 1112 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
517 | 1114 | uneditButton.addActionListener(this); |
---|
518 | 1115 | |
---|
519 | | - oe.aConstraints.gridx += 1; |
---|
520 | | - oe.aConstraints.weighty = 0; |
---|
521 | | - oe.aConstraints.gridwidth = 1; |
---|
522 | | - |
---|
523 | | - oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints); |
---|
524 | | - clearPanelButton.addActionListener(this); |
---|
525 | | - |
---|
526 | | - oe.aConstraints.gridx += 1; |
---|
527 | | - oe.aConstraints.weighty = 0; |
---|
528 | | - oe.aConstraints.gridwidth = 1; |
---|
529 | | - |
---|
530 | | - oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints); |
---|
| 1116 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 1117 | + allParamsButton.setToolTipText("Show all controle"); |
---|
531 | 1118 | allParamsButton.addActionListener(this); |
---|
532 | 1119 | |
---|
533 | | - oe.aConstraints.gridx += 1; |
---|
534 | | - oe.aConstraints.weighty = 0; |
---|
535 | | - oe.aConstraints.gridwidth = 1; |
---|
536 | | - |
---|
537 | | - oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints); |
---|
| 1120 | + editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1121 | + clearPanelButton.setToolTipText("Clear edit panel"); |
---|
| 1122 | + clearPanelButton.addActionListener(this); |
---|
| 1123 | + |
---|
| 1124 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1125 | + unselectButton.setToolTipText("Unselect"); |
---|
538 | 1126 | unselectButton.addActionListener(this); |
---|
539 | 1127 | |
---|
| 1128 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1130 | + flashSelectionButton.addActionListener(this); |
---|
| 1131 | + |
---|
| 1132 | + editCommandsPanel.preferredHeight = 1; |
---|
| 1133 | + |
---|
| 1134 | + SetPinStates(false); |
---|
| 1135 | +// oe.treePanel.add(commandsPanel); |
---|
| 1136 | +// oe.treePanel.Return(); |
---|
| 1137 | + |
---|
540 | 1138 | // oe.aConstraints.gridx += 1; |
---|
541 | 1139 | // oe.aConstraints.weighty = 0; |
---|
542 | 1140 | // oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
548 | 1146 | // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints); |
---|
549 | 1147 | // gcButton.addActionListener(this); |
---|
550 | 1148 | |
---|
551 | | - oe.aConstraints.gridx = 0; |
---|
552 | | - oe.aConstraints.gridy += 1; |
---|
553 | | - |
---|
554 | | - //ctrlPanel.add(objList = new List(5, true)); |
---|
555 | | - oe.aConstraints.gridwidth = 100; |
---|
556 | | - // oe.aConstraints.gridheight = 100; |
---|
557 | | - oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL; |
---|
558 | | - oe.aConstraints.gridheight = 1; |
---|
559 | | - oe.aConstraints.weighty = 0.5; |
---|
560 | | - oe.aConstraints.gridx = 0; |
---|
561 | | - JScrollPane jSP; |
---|
| 1149 | + cGridBag jSPPanel = new cGridBag(); |
---|
| 1150 | + |
---|
| 1151 | + JScrollPane jSP; |
---|
562 | 1152 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
563 | | - oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints); |
---|
| 1153 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
564 | 1154 | ResetModel(); |
---|
565 | | - oe.aConstraints.weighty = 0.5; |
---|
566 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
567 | | - oe.aConstraints.gridy += 1; |
---|
568 | | - oe.aConstraints.gridwidth = 1; |
---|
569 | | - |
---|
570 | | - oe.aConstraints.weighty = 0; |
---|
571 | | - oe.aConstraints.gridwidth = 2; |
---|
572 | | - |
---|
573 | | - oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints); |
---|
574 | | - colorCB.addItemListener(this); |
---|
575 | | - oe.aConstraints.gridx += 2; |
---|
576 | | - oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints); |
---|
577 | | - materialCB.addItemListener(this); |
---|
578 | | - oe.aConstraints.gridx += 2; |
---|
579 | | - oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints); |
---|
580 | | - textureCB.addItemListener(this); |
---|
581 | | - |
---|
582 | | - oe.aConstraints.gridx = 0; |
---|
583 | | - oe.aConstraints.gridy += 1; |
---|
584 | 1155 | |
---|
| 1156 | + oe.treePanel.add(jSPPanel); |
---|
| 1157 | + oe.treePanel.Return(); |
---|
| 1158 | + |
---|
| 1159 | + oe.treePanel.add(copyOptionsPanel); |
---|
| 1160 | + oe.treePanel.Return(); |
---|
| 1161 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1162 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1163 | + sliderPane.preferredHeight = 1; |
---|
| 1164 | + |
---|
| 1165 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1166 | + mainPanel.setResizeWeight(0.4); |
---|
| 1167 | + |
---|
585 | 1168 | //jList.addListSelectionListener(this); |
---|
586 | 1169 | oe.jTree.addTreeSelectionListener(this); |
---|
587 | 1170 | //jTree.setRootVisible(false); |
---|
588 | 1171 | //jTree.setEditable(true); |
---|
589 | 1172 | oe.jTree.setDragEnabled(true); |
---|
590 | 1173 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
591 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1174 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
592 | 1175 | |
---|
593 | 1176 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
594 | 1177 | |
---|
.. | .. |
---|
600 | 1183 | dgr.addDragGestureListener(this); |
---|
601 | 1184 | }catch(Exception e) {} |
---|
602 | 1185 | */ |
---|
603 | | - radio.layout = sevenButton; |
---|
| 1186 | + radio.layout = sixButton; // sevenButton; |
---|
604 | 1187 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
605 | 1188 | } |
---|
606 | 1189 | |
---|
607 | | - void AddOptions(JPanel panel, GridBagConstraints constraints) |
---|
| 1190 | + void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
608 | 1191 | { |
---|
609 | | - constraints.gridx = 0; |
---|
610 | | - constraints.gridy = 0; |
---|
611 | | - panel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), constraints); |
---|
612 | | - fastCB.setToolTipText("Fast mode"); |
---|
613 | | - fastCB.addItemListener(this); |
---|
614 | | - constraints.gridy += 1; |
---|
615 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), constraints); |
---|
616 | | - supportCB.setToolTipText("Enabled rigging"); |
---|
617 | | - supportCB.addItemListener(this); |
---|
| 1192 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1193 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1194 | + colorCB.addItemListener(this); |
---|
618 | 1195 | |
---|
619 | | - // constraints.gridy += 1; |
---|
| 1196 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1197 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1198 | + materialCB.addItemListener(this); |
---|
| 1199 | + |
---|
| 1200 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1201 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1202 | + textureCB.addItemListener(this); |
---|
| 1203 | + |
---|
| 1204 | + panel.Return(); |
---|
| 1205 | + |
---|
| 1206 | + panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
| 1207 | + boxCB.setToolTipText("Display bounding boxes"); |
---|
| 1208 | + boxCB.addItemListener(this); |
---|
| 1209 | + |
---|
| 1210 | + panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
| 1211 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
| 1212 | + zoomBoxCB.addItemListener(this); |
---|
| 1213 | + |
---|
| 1214 | + if (true) // Globals.ADVANCED) |
---|
| 1215 | + { |
---|
| 1216 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1217 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1218 | +// supportCB.addItemListener(this); |
---|
| 1219 | + |
---|
| 1220 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1221 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1222 | + freezeCB.addItemListener(this); |
---|
| 1223 | + |
---|
620 | 1224 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
621 | 1225 | // localCB.addItemListener(this); |
---|
622 | 1226 | |
---|
623 | | - constraints.gridy += 1; |
---|
624 | | - panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), constraints); |
---|
| 1227 | + panel.Return(); |
---|
| 1228 | + |
---|
| 1229 | + panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
625 | 1230 | crowdCB.setToolTipText("Used for crowds"); |
---|
626 | 1231 | crowdCB.addItemListener(this); |
---|
627 | 1232 | |
---|
628 | | - constraints.gridy += 1; |
---|
629 | | - panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), constraints); |
---|
| 1233 | + panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints); |
---|
630 | 1234 | smoothCB.setToolTipText("Snapping delay"); |
---|
631 | 1235 | smoothCB.addItemListener(this); |
---|
632 | 1236 | |
---|
633 | | - constraints.gridy += 1; |
---|
634 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), constraints); |
---|
635 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
636 | | - slowCB.addItemListener(this); |
---|
637 | | - constraints.gridy += 1; |
---|
638 | | - panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), constraints); |
---|
639 | | - boxCB.setToolTipText("Display bounding boxes"); |
---|
640 | | - boxCB.addItemListener(this); |
---|
641 | | - constraints.gridy += 1; |
---|
642 | | - panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), constraints); |
---|
643 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
644 | | - zoomBoxCB.addItemListener(this); |
---|
645 | | - |
---|
| 1237 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1238 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1239 | +// slowCB.addItemListener(this); |
---|
| 1240 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1241 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1242 | + minshaderCB.addItemListener(this); |
---|
| 1243 | + |
---|
646 | 1244 | // constraints.gridy += 1; |
---|
647 | 1245 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
648 | 1246 | // speakerMocapCB.addItemListener(this); |
---|
649 | 1247 | |
---|
| 1248 | + panel.Return(); |
---|
| 1249 | + |
---|
650 | 1250 | if (false) |
---|
651 | 1251 | { |
---|
652 | 1252 | // handled in scripts |
---|
653 | | - constraints.gridy += 1; |
---|
654 | | - panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), constraints); |
---|
| 1253 | + //constraints.gridy += 1; |
---|
| 1254 | + panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints); |
---|
655 | 1255 | speakerCameraCB.addItemListener(this); |
---|
656 | 1256 | |
---|
657 | | - constraints.gridy += 1; |
---|
658 | | - panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), constraints); |
---|
| 1257 | + //constraints.gridy += 1; |
---|
| 1258 | + panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints); |
---|
659 | 1259 | speakerFocusCB.addItemListener(this); |
---|
660 | 1260 | |
---|
661 | | - constraints.gridy += 1; |
---|
662 | | - panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), constraints); |
---|
| 1261 | + //constraints.gridy += 1; |
---|
| 1262 | + panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
663 | 1263 | smoothfocusCB.addItemListener(this); |
---|
| 1264 | + panel.Return(); |
---|
664 | 1265 | } |
---|
665 | 1266 | |
---|
666 | 1267 | //constraints.gridx += 1; |
---|
667 | 1268 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
668 | 1269 | // debugCB.addItemListener(this); |
---|
669 | 1270 | |
---|
670 | | - constraints.gridy += 1; |
---|
671 | | - panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), constraints); |
---|
| 1271 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1272 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1273 | + trackCB.addItemListener(this); |
---|
| 1274 | + |
---|
| 1275 | + panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 1276 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
672 | 1277 | oeilCB.addItemListener(this); |
---|
673 | 1278 | |
---|
674 | | - constraints.gridy += 1; |
---|
675 | | - panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), constraints); |
---|
| 1279 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 1280 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 1281 | + shadowCB.addItemListener(this); |
---|
| 1282 | + |
---|
| 1283 | + panel.Return(); |
---|
| 1284 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1285 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1286 | + toggleTextureCB.addItemListener(this); |
---|
| 1287 | + |
---|
| 1288 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1289 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1290 | + toggleSwitchCB.addItemListener(this); |
---|
| 1291 | + |
---|
| 1292 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1293 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1294 | + autokeepCB.addItemListener(this); |
---|
| 1295 | + |
---|
| 1296 | + panel.Return(); |
---|
| 1297 | + if (Globals.ADVANCED) |
---|
| 1298 | + { |
---|
| 1299 | + panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
676 | 1300 | lookAtCB.setToolTipText("Look-at target"); |
---|
677 | 1301 | lookAtCB.addItemListener(this); |
---|
| 1302 | + } |
---|
| 1303 | + |
---|
| 1304 | + } |
---|
| 1305 | + |
---|
| 1306 | + cGridBag fill = new cGridBag(); |
---|
| 1307 | + fill.preferredHeight = 200; |
---|
| 1308 | + cGridBag fill2 = new cGridBag(); |
---|
| 1309 | + fill2.preferredHeight = 200; |
---|
| 1310 | + cGridBag fill3 = new cGridBag(); |
---|
| 1311 | + fill3.preferredHeight = 200; |
---|
| 1312 | + |
---|
| 1313 | + panel.add(fill); |
---|
| 1314 | + panel.add(fill2); |
---|
| 1315 | + panel.add(fill3); |
---|
678 | 1316 | |
---|
679 | 1317 | } |
---|
680 | 1318 | |
---|
681 | 1319 | void EditObject(Object3D obj) |
---|
682 | 1320 | { |
---|
683 | 1321 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1322 | + |
---|
| 1323 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1324 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1325 | + if (!radioButton.hadMaterial) |
---|
| 1326 | + { |
---|
| 1327 | + obj.material = new cMaterial(); |
---|
| 1328 | + } |
---|
| 1329 | + |
---|
684 | 1330 | radioButton.SetObject(obj); |
---|
685 | | - radioButton.layout = sevenButton; |
---|
| 1331 | + radioButton.layout = sixButton; // sevenButton; |
---|
686 | 1332 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
687 | 1333 | radioButton.addActionListener(this); |
---|
688 | 1334 | radioPanel.add(radioButton); |
---|
689 | 1335 | buttonGroup.add(radioButton); |
---|
690 | 1336 | radioButton.doClick(); |
---|
691 | 1337 | } |
---|
| 1338 | + |
---|
692 | 1339 | void SetupViews(ObjEditor oe) |
---|
693 | 1340 | { |
---|
| 1341 | + theFrame = this; |
---|
| 1342 | + |
---|
694 | 1343 | oe.SetupViews(); |
---|
695 | 1344 | |
---|
696 | 1345 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
699 | 1348 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
700 | 1349 | } |
---|
701 | 1350 | |
---|
702 | | - JCheckBox liveCB; |
---|
703 | | - JCheckBox supportCB; |
---|
704 | | - JCheckBox localCB; |
---|
705 | | - JCheckBox crowdCB; |
---|
706 | | - JCheckBox smoothCB; |
---|
707 | | - JCheckBox fastCB; |
---|
708 | | - JCheckBox slowCB; |
---|
709 | | - JCheckBox boxCB; |
---|
710 | | - JCheckBox zoomBoxCB; |
---|
711 | | - JCheckBox trackCB; |
---|
712 | | - JCheckBox smoothfocusCB; |
---|
| 1351 | + cToggleButton liveCB; |
---|
| 1352 | + cCheckBox supportCB; |
---|
| 1353 | + cCheckBox localCB; |
---|
| 1354 | + cCheckBox crowdCB; |
---|
| 1355 | + cCheckBox smoothCB; |
---|
| 1356 | + cCheckBox minshaderCB; |
---|
| 1357 | + |
---|
| 1358 | + cToggleButton fastCB; |
---|
| 1359 | + cCheckBox slowCB; |
---|
| 1360 | + cCheckBox boxCB; |
---|
| 1361 | + cCheckBox zoomBoxCB; |
---|
| 1362 | + cCheckBox freezeCB; |
---|
| 1363 | + //cToggleButton trackCB; |
---|
| 1364 | + cCheckBox trackCB; |
---|
| 1365 | + cCheckBox smoothfocusCB; |
---|
713 | 1366 | // JCheckBox speakerMocapCB; |
---|
714 | | - JCheckBox speakerCameraCB; |
---|
715 | | - JCheckBox speakerFocusCB; |
---|
716 | | - JCheckBox debugCB; |
---|
717 | | - JCheckBox oeilCB; |
---|
718 | | - JCheckBox lookAtCB; |
---|
| 1367 | + cCheckBox speakerCameraCB; |
---|
| 1368 | + cCheckBox speakerFocusCB; |
---|
| 1369 | + cCheckBox debugCB; |
---|
| 1370 | + |
---|
| 1371 | + cCheckBox oeilCB; |
---|
| 1372 | + cCheckBox shadowCB; |
---|
| 1373 | + cCheckBox autokeepCB; |
---|
| 1374 | + cCheckBox lookAtCB; |
---|
719 | 1375 | |
---|
720 | 1376 | // static int COLOR = 1; |
---|
721 | 1377 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
723 | 1379 | |
---|
724 | 1380 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
725 | 1381 | |
---|
726 | | - JCheckBox colorCB; |
---|
727 | | - JCheckBox materialCB; |
---|
728 | | - JCheckBox textureCB; |
---|
| 1382 | + cCheckBox colorCB; |
---|
| 1383 | + cCheckBox materialCB; |
---|
| 1384 | + cCheckBox textureCB; |
---|
729 | 1385 | |
---|
730 | 1386 | public void itemStateChanged(ItemEvent e) |
---|
731 | 1387 | { |
---|
.. | .. |
---|
753 | 1409 | } else if(e.getSource() == liveCB) |
---|
754 | 1410 | { |
---|
755 | 1411 | cameraView.ToggleLive(); |
---|
| 1412 | + refreshContents(false); |
---|
756 | 1413 | } |
---|
757 | 1414 | else if(e.getSource() == supportCB) |
---|
758 | 1415 | { |
---|
.. | .. |
---|
768 | 1425 | { |
---|
769 | 1426 | cameraView.ToggleInertia(); |
---|
770 | 1427 | cameraView.repaint(); |
---|
| 1428 | + } |
---|
| 1429 | + else if(e.getSource() == minshaderCB) |
---|
| 1430 | + { |
---|
| 1431 | + Globals.MINSHADER ^= true; |
---|
| 1432 | + cameraView.programInitialized = false; |
---|
| 1433 | + cameraView.repaint(); |
---|
771 | 1434 | } |
---|
772 | 1435 | else if(e.getSource() == localCB) |
---|
773 | 1436 | { |
---|
.. | .. |
---|
817 | 1480 | { |
---|
818 | 1481 | cameraView.ToggleOeil(); |
---|
819 | 1482 | } |
---|
| 1483 | + else if(e.getSource() == shadowCB) |
---|
| 1484 | + { |
---|
| 1485 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1486 | + } |
---|
| 1487 | + else if(e.getSource() == freezeCB) |
---|
| 1488 | + { |
---|
| 1489 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1490 | + } |
---|
| 1491 | + else if(e.getSource() == autokeepCB) |
---|
| 1492 | + { |
---|
| 1493 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1494 | + } |
---|
820 | 1495 | else if(e.getSource() == lookAtCB) |
---|
821 | 1496 | { |
---|
822 | 1497 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
833 | 1508 | |
---|
834 | 1509 | /**/ |
---|
835 | 1510 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
836 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1511 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1512 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
837 | 1513 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
838 | 1514 | // We can't move the root node or an empty selection |
---|
839 | 1515 | return; |
---|
.. | .. |
---|
896 | 1572 | } |
---|
897 | 1573 | } |
---|
898 | 1574 | |
---|
899 | | - String string = (String) object; |
---|
900 | | - |
---|
901 | 1575 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
902 | 1576 | // if( object instanceof java.io.File[]) |
---|
903 | 1577 | // { |
---|
.. | .. |
---|
905 | 1579 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
906 | 1580 | // return; |
---|
907 | 1581 | // } |
---|
908 | | - if (string.charAt(0) == '/') |
---|
| 1582 | + |
---|
| 1583 | + String string = object.toString(); |
---|
| 1584 | + |
---|
| 1585 | + // File path for Mac and Windows |
---|
| 1586 | + if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
909 | 1587 | { |
---|
910 | 1588 | // file(s) |
---|
911 | 1589 | String[] names = string.split("\n"); |
---|
.. | .. |
---|
932 | 1610 | |
---|
933 | 1611 | flashIt = false; |
---|
934 | 1612 | CameraPane pane = (CameraPane) target; |
---|
935 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1613 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
936 | 1614 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
937 | 1615 | |
---|
938 | 1616 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
948 | 1626 | |
---|
949 | 1627 | assert target == objEditor.jTree; |
---|
950 | 1628 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1629 | + Object3D destinationLeaf; |
---|
951 | 1630 | try { |
---|
952 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1631 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
953 | 1632 | } catch (Exception e) { |
---|
954 | 1633 | System.out.println("destinationPath : " + destinationPath); |
---|
955 | 1634 | return; |
---|
956 | 1635 | } |
---|
957 | 1636 | |
---|
958 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1637 | + for (int i=group.selection.size(); --i>=0;) |
---|
959 | 1638 | { |
---|
| 1639 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1640 | + |
---|
| 1641 | + // Cannot move into itself |
---|
| 1642 | + if (child == destinationLeaf) |
---|
| 1643 | + return; |
---|
| 1644 | + } |
---|
| 1645 | + |
---|
| 1646 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1647 | +// { |
---|
960 | 1648 | loadClipboard(true); |
---|
961 | 1649 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
962 | | - pasteInto(false); |
---|
963 | | - } else { |
---|
964 | | - loadClipboard(false); |
---|
965 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
966 | | - pasteInto(false); // true); // ??? |
---|
967 | | - } |
---|
| 1650 | + pasteInto(false, false); |
---|
| 1651 | +// } else { |
---|
| 1652 | +// loadClipboard(false); |
---|
| 1653 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1654 | +// pasteInto(false, false); // true); // ??? |
---|
| 1655 | +// } |
---|
968 | 1656 | } |
---|
969 | 1657 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
970 | 1658 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1069 | 1757 | { |
---|
1070 | 1758 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1071 | 1759 | //heightFieldItem.addActionListener(this); |
---|
1072 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1073 | | - gridItem.addActionListener(this); |
---|
1074 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1075 | | - rectoidItem.addActionListener(this); |
---|
1076 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1077 | | - ellipsoidItem.addActionListener(this); |
---|
1078 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1079 | | - coneItem.addActionListener(this); |
---|
1080 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1081 | | - torusItem.addActionListener(this); |
---|
1082 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1083 | | - superItem.addActionListener(this); |
---|
| 1760 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1761 | +// gridItem.addActionListener(this); |
---|
| 1762 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1763 | +// rectoidItem.addActionListener(this); |
---|
| 1764 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1765 | +// ellipsoidItem.addActionListener(this); |
---|
| 1766 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1767 | +// coneItem.addActionListener(this); |
---|
| 1768 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1769 | +// torusItem.addActionListener(this); |
---|
| 1770 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1771 | +// superItem.addActionListener(this); |
---|
| 1772 | + |
---|
| 1773 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1774 | + cameraItem.addActionListener(this); |
---|
| 1775 | + |
---|
| 1776 | + if (!Globals.ADVANCED) |
---|
| 1777 | + { |
---|
1084 | 1778 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1085 | 1779 | kleinItem.addActionListener(this); |
---|
1086 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1087 | | - particleItem.addActionListener(this); |
---|
| 1780 | + } |
---|
| 1781 | + |
---|
| 1782 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1783 | +// particleItem.addActionListener(this); |
---|
| 1784 | + if (Globals.ADVANCED) |
---|
| 1785 | + { |
---|
1088 | 1786 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
1089 | 1787 | ragdollItem.addActionListener(this); |
---|
1090 | 1788 | ragdoll2Item = menu.add(new MenuItem("Rag Fall")); |
---|
1091 | 1789 | ragdoll2Item.addActionListener(this); |
---|
| 1790 | + } |
---|
1092 | 1791 | menu.add("-"); |
---|
1093 | | - meshItem = menu.add(new MenuItem("Mesh")); |
---|
| 1792 | + meshItem = menu.add(new MenuItem("Dynamic Mesh")); |
---|
1094 | 1793 | meshItem.addActionListener(this); |
---|
1095 | 1794 | // meshGroupItem = menu.add(new MenuItem("Mesh Group")); |
---|
1096 | 1795 | // meshGroupItem.addActionListener(this); |
---|
| 1796 | + if (Globals.ADVANCED) |
---|
| 1797 | + { |
---|
1097 | 1798 | springItem = menu.add(new MenuItem("Spring")); |
---|
1098 | 1799 | springItem.addActionListener(this); |
---|
1099 | 1800 | flagItem = menu.add(new MenuItem("Flag")); |
---|
1100 | 1801 | flagItem.addActionListener(this); |
---|
1101 | | - bezierItem = menu.add(new MenuItem("Patch")); |
---|
1102 | | - bezierItem.addActionListener(this); |
---|
1103 | | - checkerItem = menu.add(new MenuItem("Checker")); |
---|
1104 | | - checkerItem.addActionListener(this); |
---|
1105 | 1802 | blobItem = menu.add(new MenuItem("Blob")); |
---|
1106 | 1803 | blobItem.addActionListener(this); |
---|
1107 | 1804 | latheItem = menu.add(new MenuItem("Lathe")); |
---|
1108 | 1805 | latheItem.addActionListener(this); |
---|
1109 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1110 | | - lightItem.addActionListener(this); |
---|
| 1806 | + } |
---|
| 1807 | + bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
| 1808 | + bezierItem.addActionListener(this); |
---|
| 1809 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1810 | +// overlayItem.addActionListener(this); |
---|
| 1811 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1812 | +// lightItem.addActionListener(this); |
---|
1111 | 1813 | menu.add("-"); |
---|
1112 | 1814 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1113 | 1815 | //superLoopItem.addActionListener(this); |
---|
1114 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1115 | | - loopItem.addActionListener(this); |
---|
| 1816 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1817 | +// loopItem.addActionListener(this); |
---|
1116 | 1818 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1117 | 1819 | doubleItem.addActionListener(this); |
---|
| 1820 | + if (Globals.ADVANCED) |
---|
| 1821 | + { |
---|
1118 | 1822 | tripleItem = menu.add(new MenuItem("Trident")); |
---|
1119 | 1823 | tripleItem.addActionListener(this); |
---|
| 1824 | + } |
---|
1120 | 1825 | } |
---|
1121 | 1826 | |
---|
1122 | 1827 | void buildToolsMenu(Menu menu) |
---|
1123 | 1828 | { |
---|
1124 | 1829 | menu.add(animationItem = new CheckboxMenuItem("Animation...")); |
---|
1125 | 1830 | animationItem.addItemListener(this); |
---|
1126 | | - animationItem.setState(CameraPane.ANIMATION); |
---|
| 1831 | + animationItem.setState(Globals.ANIMATION); |
---|
| 1832 | + |
---|
| 1833 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1834 | + archiveItem.addActionListener(this); |
---|
1127 | 1835 | |
---|
1128 | 1836 | menu.add("-"); |
---|
1129 | 1837 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1130 | 1838 | parseverticesItem.addActionListener(this); |
---|
1131 | 1839 | textureFieldItem = menu.add(new MenuItem("Texture Field")); |
---|
1132 | 1840 | textureFieldItem.addActionListener(this); |
---|
1133 | | - alignItem = menu.add(new MenuItem("Align")); |
---|
| 1841 | + alignItem = menu.add(new MenuItem("Align Objects")); |
---|
1134 | 1842 | alignItem.addActionListener(this); |
---|
1135 | | - mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1136 | | - mirrorItem.addActionListener(this); |
---|
1137 | 1843 | reduceMorphItem = menu.add(new MenuItem("Reduce Morphs")); |
---|
1138 | 1844 | reduceMorphItem.addActionListener(this); |
---|
1139 | 1845 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1140 | 1846 | reduce34MorphItem.addActionListener(this); |
---|
1141 | | - |
---|
1142 | | - menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1143 | | - computeAOItem.addActionListener(this); |
---|
1144 | 1847 | menu.add("-"); |
---|
1145 | | - |
---|
1146 | 1848 | menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1147 | 1849 | memoryItem.addActionListener(this); |
---|
| 1850 | + menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
| 1851 | + computeAOItem.addActionListener(this); |
---|
| 1852 | + |
---|
| 1853 | + if (Globals.ADVANCED) |
---|
| 1854 | + { |
---|
| 1855 | + mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
| 1856 | + mirrorItem.addActionListener(this); |
---|
| 1857 | + menu.add("-"); |
---|
1148 | 1858 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1149 | 1859 | analyzeItem.addActionListener(this); |
---|
1150 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1860 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1151 | 1861 | dumpItem.addActionListener(this); |
---|
1152 | 1862 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1153 | 1863 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1165 | 1875 | menu.add("-"); |
---|
1166 | 1876 | menu.add(editScriptItem = new MenuItem("Edit Script...")); |
---|
1167 | 1877 | editScriptItem.addActionListener(this); |
---|
| 1878 | + } |
---|
1168 | 1879 | } |
---|
1169 | 1880 | |
---|
1170 | 1881 | void ScreenFit() |
---|
.. | .. |
---|
1287 | 1998 | shadow.material = new cMaterial(obj.material); |
---|
1288 | 1999 | shadow.material.diffuse = 0.0001f; |
---|
1289 | 2000 | shadow.material.specular = 0.0001f; |
---|
| 2001 | + //shadow.projectedVertices[1].x = 300; |
---|
1290 | 2002 | |
---|
1291 | 2003 | makeSomething(shadow); |
---|
1292 | 2004 | } |
---|
| 2005 | + |
---|
| 2006 | + private void ClearUnpinned() |
---|
| 2007 | + { |
---|
| 2008 | + //for (Object3D obj : listUI) |
---|
| 2009 | + for (int i=listUI.size(); --i>=0;) |
---|
| 2010 | + { |
---|
| 2011 | + Object3D obj = listUI.elementAt(i); |
---|
| 2012 | + if (!obj.pinned) |
---|
| 2013 | + { |
---|
| 2014 | + obj.CloseUI(); |
---|
| 2015 | + listUI.remove(i); |
---|
| 2016 | + } |
---|
| 2017 | + } |
---|
| 2018 | + } |
---|
| 2019 | + |
---|
| 2020 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2021 | + { |
---|
| 2022 | + // if (!(elem instanceof Composite)) |
---|
| 2023 | + // newWindow = false; |
---|
| 2024 | + listUI.add(elem); |
---|
| 2025 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2026 | + System.out.println("edit : " + elem); |
---|
| 2027 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 2028 | + } |
---|
1293 | 2029 | |
---|
1294 | 2030 | /** |
---|
1295 | 2031 | * applyExample |
---|
.. | .. |
---|
1493 | 2229 | |
---|
1494 | 2230 | void Overwrite(int mask) |
---|
1495 | 2231 | { |
---|
1496 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2232 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1497 | 2233 | { |
---|
1498 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2234 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1499 | 2235 | |
---|
1500 | 2236 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1501 | 2237 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1518 | 2254 | // |
---|
1519 | 2255 | public void actionPerformed(ActionEvent event) // , Object arg) |
---|
1520 | 2256 | { |
---|
| 2257 | + Object source = event.getSource(); |
---|
1521 | 2258 | /* |
---|
1522 | 2259 | if (event.getSource() == nameField) |
---|
1523 | 2260 | { |
---|
.. | .. |
---|
1529 | 2266 | } |
---|
1530 | 2267 | else |
---|
1531 | 2268 | */ |
---|
1532 | | - if (event.getSource() == lookAtItem || event.getSource() == lookFromItem) |
---|
| 2269 | + if (source == lookAtItem || source == lookFromItem) |
---|
1533 | 2270 | { |
---|
1534 | 2271 | ScreenFit(); |
---|
1535 | 2272 | } else |
---|
1536 | | - if (event.getSource() == switchItem) |
---|
| 2273 | + if (source == switchViewItem) |
---|
1537 | 2274 | { |
---|
1538 | 2275 | cVector v1 = new cVector(); |
---|
1539 | 2276 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1542 | 2279 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1543 | 2280 | objEditor.cameraView.repaint(); |
---|
1544 | 2281 | } else |
---|
1545 | | - if (event.getSource() == rectoidItem) |
---|
| 2282 | + if (source == rectoidItem || source == boxButton) |
---|
1546 | 2283 | { |
---|
1547 | 2284 | makeSomething(new Box()); |
---|
1548 | 2285 | } else |
---|
1549 | | - if (event.getSource() == particleItem) |
---|
| 2286 | + if (source == particleItem || source == particlesButton) |
---|
1550 | 2287 | { |
---|
1551 | 2288 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1552 | 2289 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1567 | 2304 | applyExample(particleGeom, "SMOKE"); |
---|
1568 | 2305 | makeSomething(particleGeom); |
---|
1569 | 2306 | } else |
---|
1570 | | - if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item) |
---|
| 2307 | + if (source == ragdollItem || source == ragdoll2Item) |
---|
1571 | 2308 | { |
---|
1572 | | - GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem); |
---|
| 2309 | + GenericJoint ragdoll = new GenericJoint(source == ragdollItem); |
---|
1573 | 2310 | |
---|
1574 | 2311 | ragdoll.toParent = LA.newMatrix(); |
---|
1575 | 2312 | ragdoll.fromParent = LA.newMatrix(); |
---|
.. | .. |
---|
1587 | 2324 | } else |
---|
1588 | 2325 | /* |
---|
1589 | 2326 | */ |
---|
1590 | | - if (event.getSource() == heightFieldItem) |
---|
| 2327 | + if (source == heightFieldItem) |
---|
1591 | 2328 | { |
---|
1592 | 2329 | Object3D obj = new Object3D(); |
---|
1593 | 2330 | |
---|
.. | .. |
---|
1625 | 2362 | |
---|
1626 | 2363 | makeSomething(obj); |
---|
1627 | 2364 | } else |
---|
1628 | | - if (event.getSource() == gridItem) |
---|
| 2365 | + if (source == gridItem || source == gridButton) |
---|
1629 | 2366 | { |
---|
1630 | 2367 | makeSomething(new Grid()); |
---|
1631 | 2368 | } else |
---|
1632 | | - if (event.getSource() == ellipsoidItem) |
---|
| 2369 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1633 | 2370 | { |
---|
1634 | 2371 | makeSomething(new Sphere()); |
---|
1635 | 2372 | } else |
---|
1636 | | - if (event.getSource() == coneItem) |
---|
| 2373 | + if (source == coneItem || source == coneButton) |
---|
1637 | 2374 | { |
---|
1638 | 2375 | makeSomething(new Cone()); |
---|
1639 | 2376 | } else |
---|
1640 | | - if (event.getSource() == torusItem) |
---|
| 2377 | + if (source == torusItem || source == torusButton) |
---|
1641 | 2378 | { |
---|
1642 | 2379 | makeSomething(new Torus()); |
---|
1643 | 2380 | } else |
---|
1644 | | - if (event.getSource() == superItem) |
---|
| 2381 | + if (source == superItem || source == superButton) |
---|
1645 | 2382 | { |
---|
1646 | 2383 | makeSomething(new Superellipsoid()); |
---|
1647 | 2384 | } else |
---|
1648 | | - if (event.getSource() == kleinItem) |
---|
| 2385 | + if (source == kleinItem || source == kleinButton) |
---|
1649 | 2386 | { |
---|
1650 | 2387 | makeSomething(new Klein()); |
---|
1651 | 2388 | } else |
---|
1652 | | - if (event.getSource() == blobItem) |
---|
| 2389 | + if (source == blobItem) |
---|
1653 | 2390 | { |
---|
1654 | 2391 | Blob blob = new Blob(); |
---|
1655 | 2392 | BlobComponent comp = new BlobComponent(); |
---|
.. | .. |
---|
1657 | 2394 | //blob.retile(); |
---|
1658 | 2395 | makeSomething(blob); |
---|
1659 | 2396 | } else |
---|
1660 | | - if (event.getSource() == latheItem) |
---|
| 2397 | + if (source == latheItem) |
---|
1661 | 2398 | { |
---|
1662 | 2399 | makeSomething(new Lathe()); |
---|
1663 | 2400 | } else |
---|
1664 | | - if (event.getSource() == bezierItem) |
---|
| 2401 | + if (source == bezierItem) |
---|
1665 | 2402 | { |
---|
1666 | 2403 | makeSomething(new BezierSurface()); |
---|
1667 | 2404 | } else |
---|
1668 | | - if (event.getSource() == checkerItem) |
---|
| 2405 | + if (source == overlayItem || source == overlayButton) |
---|
1669 | 2406 | { |
---|
1670 | 2407 | /* |
---|
1671 | 2408 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1680 | 2417 | */ |
---|
1681 | 2418 | makeSomething(new Checker()); |
---|
1682 | 2419 | } else |
---|
1683 | | - if (event.getSource() == meshItem) |
---|
| 2420 | + if (source == meshItem) |
---|
1684 | 2421 | { |
---|
1685 | 2422 | Object3D itemtomake = new Object3D(); |
---|
1686 | 2423 | Object3D child; |
---|
.. | .. |
---|
1701 | 2438 | makeSomething(child); |
---|
1702 | 2439 | } |
---|
1703 | 2440 | } else |
---|
1704 | | - if (event.getSource() == springItem) |
---|
| 2441 | + if (source == springItem) |
---|
1705 | 2442 | { |
---|
1706 | 2443 | cSpring s = new cSpring(); |
---|
1707 | 2444 | s.setup(); |
---|
1708 | 2445 | makeSomething(s); |
---|
1709 | 2446 | } else |
---|
1710 | | - if (event.getSource() == flagItem) |
---|
| 2447 | + if (source == flagItem) |
---|
1711 | 2448 | { |
---|
1712 | 2449 | cSpring s = new cFlag(); |
---|
1713 | 2450 | s.setup(); |
---|
1714 | 2451 | makeSomething(s); |
---|
1715 | 2452 | } else |
---|
1716 | | - if (event.getSource() == lightItem) |
---|
| 2453 | + if (source == lightItem || source == lightButton) |
---|
1717 | 2454 | { |
---|
1718 | 2455 | makeSomething(new Light()); |
---|
1719 | 2456 | } else |
---|
1720 | | - if (event.getSource() == csgItem) |
---|
| 2457 | +// if (source == skybox1Button || |
---|
| 2458 | +// source == skybox2Button || |
---|
| 2459 | +// source == skybox3Button || |
---|
| 2460 | +// source == skybox4Button || |
---|
| 2461 | +// source == skybox5Button || |
---|
| 2462 | +// source == skybox6Button || |
---|
| 2463 | +// source == skybox7Button || |
---|
| 2464 | +// source == skybox11Button || |
---|
| 2465 | +// source == skybox12Button || |
---|
| 2466 | +// source == skybox13Button || |
---|
| 2467 | +// source == skybox14Button || |
---|
| 2468 | +// source == skybox15Button || |
---|
| 2469 | +// source == skybox16Button || |
---|
| 2470 | +// source == skybox17Button) |
---|
| 2471 | +// { |
---|
| 2472 | +// ChangeSkybox(source); |
---|
| 2473 | +// } else |
---|
| 2474 | + if (source == csgItem) |
---|
1721 | 2475 | { |
---|
1722 | 2476 | group(new CSG()); |
---|
1723 | 2477 | } else |
---|
1724 | | - if (event.getSource() == templateItem) |
---|
| 2478 | + if (source == templateItem) |
---|
1725 | 2479 | { |
---|
1726 | 2480 | group(new cTemplate()); |
---|
1727 | 2481 | } else |
---|
1728 | | - if (event.getSource() == attributeItem) |
---|
| 2482 | + if (source == attributeItem) |
---|
1729 | 2483 | { |
---|
1730 | 2484 | makeSomething(new Attribute()); |
---|
1731 | 2485 | } else |
---|
1732 | | - if (event.getSource() == pointflowItem) |
---|
| 2486 | + if (source == pointflowItem) |
---|
1733 | 2487 | { |
---|
1734 | 2488 | makeSomething(new PointFlow()); |
---|
1735 | 2489 | } else |
---|
.. | .. |
---|
1741 | 2495 | } else |
---|
1742 | 2496 | */ |
---|
1743 | 2497 | |
---|
1744 | | - if (event.getSource() == superLoopItem) |
---|
| 2498 | + if (source == superLoopItem) |
---|
1745 | 2499 | { |
---|
1746 | 2500 | Composite g = new cGroup(); |
---|
1747 | 2501 | for (int i=0; i<15; i++) |
---|
.. | .. |
---|
1763 | 2517 | |
---|
1764 | 2518 | group(g); |
---|
1765 | 2519 | } else |
---|
1766 | | - if (event.getSource() == loopItem) |
---|
| 2520 | + if (source == loopItem || source == loopButton) |
---|
1767 | 2521 | { |
---|
1768 | 2522 | Composite csg = new GroupLeaf(); |
---|
1769 | 2523 | csg.count = 5; |
---|
1770 | 2524 | group(csg); |
---|
1771 | | - Composite child = new cGroup(); |
---|
| 2525 | + Composite child = new cGroup("Branch"); |
---|
1772 | 2526 | csg.addChild(child); |
---|
1773 | 2527 | child.addChild(csg); |
---|
1774 | 2528 | } else |
---|
1775 | | - if (event.getSource() == doubleItem) |
---|
| 2529 | + if (source == doubleItem) |
---|
1776 | 2530 | { |
---|
1777 | | - Composite csg = new GroupLeaf(); |
---|
| 2531 | + Composite csg = new GroupLeaf("Fork"); |
---|
1778 | 2532 | csg.count = 5; |
---|
1779 | 2533 | group(csg); |
---|
1780 | | - Composite child = new cGroup(); |
---|
| 2534 | + Composite child = new cGroup("Branch A"); |
---|
1781 | 2535 | csg.addChild(child); |
---|
1782 | 2536 | child.addChild(csg); |
---|
1783 | | - child = new cGroup(); |
---|
| 2537 | + child = new cGroup("Branch B"); |
---|
1784 | 2538 | csg.addChild(child); |
---|
1785 | 2539 | child.addChild(csg); |
---|
1786 | 2540 | } else |
---|
1787 | | - if (event.getSource() == tripleItem) |
---|
| 2541 | + if (source == tripleItem) |
---|
1788 | 2542 | { |
---|
1789 | | - Composite csg = new GroupLeaf(); |
---|
| 2543 | + Composite csg = new GroupLeaf("Trident"); |
---|
1790 | 2544 | csg.count = 4; |
---|
1791 | 2545 | group(csg); |
---|
1792 | 2546 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1799 | 2553 | csg.addChild(child); |
---|
1800 | 2554 | child.addChild(csg); |
---|
1801 | 2555 | } else |
---|
1802 | | - |
---|
1803 | | - if (event.getSource() == importGFDItem) |
---|
1804 | | - { |
---|
1805 | | - ImportGFD(); |
---|
1806 | | - } else |
---|
1807 | | - if (event.getSource() == importVRMLX3DItem) |
---|
1808 | | - { |
---|
1809 | | - ImportVRMLX3D(); |
---|
1810 | | - } else |
---|
1811 | | - if (event.getSource() == import3DSItem) |
---|
1812 | | - { |
---|
1813 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1814 | | - } else |
---|
1815 | | - if (event.getSource() == importOBJItem) |
---|
1816 | | - { |
---|
1817 | | - objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1818 | | - } else |
---|
1819 | | - if (event.getSource() == computeAOItem) |
---|
| 2556 | + if (source == computeAOItem) |
---|
1820 | 2557 | { |
---|
1821 | 2558 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1822 | | - Globals.theRenderer.repaint(); |
---|
| 2559 | + cameraView.repaint(); |
---|
1823 | 2560 | } else |
---|
1824 | | - if (event.getSource() == recompileItem) |
---|
| 2561 | + if (source == recompileItem) |
---|
1825 | 2562 | { |
---|
1826 | 2563 | Recompile(); |
---|
1827 | 2564 | refreshContents(); |
---|
1828 | 2565 | } else |
---|
1829 | | - if (event.getSource() == editScriptItem) |
---|
| 2566 | + if (source == editScriptItem) |
---|
1830 | 2567 | { |
---|
1831 | 2568 | OpenDialog(); |
---|
1832 | 2569 | refreshContents(); |
---|
1833 | 2570 | } else |
---|
1834 | | - if (event.getSource() == invariantsItem) |
---|
| 2571 | + if (source == invariantsItem) |
---|
1835 | 2572 | { |
---|
1836 | 2573 | System.out.println("Invariants:"); |
---|
1837 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2574 | + Grafreed.grafreeD.universe.invariants(); |
---|
1838 | 2575 | } else |
---|
1839 | | - if (event.getSource() == memoryItem) |
---|
| 2576 | + if (source == memoryItem) |
---|
1840 | 2577 | { |
---|
1841 | 2578 | //System.out.println("Invariants:"); |
---|
1842 | 2579 | PrintMemory(); |
---|
1843 | 2580 | } else |
---|
1844 | | - if (event.getSource() == pathItem) |
---|
| 2581 | + if (source == pathItem) |
---|
1845 | 2582 | { |
---|
1846 | 2583 | PrintPath(); |
---|
1847 | 2584 | } else |
---|
1848 | | - if (event.getSource() == analyzeItem) |
---|
| 2585 | + if (source == analyzeItem) |
---|
1849 | 2586 | { |
---|
1850 | 2587 | AnalyzeObject(); |
---|
1851 | 2588 | } else |
---|
1852 | | - if (event.getSource() == dumpItem) |
---|
| 2589 | + if (source == dumpItem) |
---|
1853 | 2590 | { |
---|
1854 | 2591 | DumpObject(); |
---|
1855 | 2592 | } else |
---|
1856 | | - if (event.getSource() == screenfitButton) |
---|
| 2593 | + if (source == minButton) |
---|
1857 | 2594 | { |
---|
1858 | | - //Reload(lastConverter, lastFilename, true); |
---|
| 2595 | + Minimize(); |
---|
| 2596 | + } else |
---|
| 2597 | + if (source == maxButton) |
---|
| 2598 | + { |
---|
| 2599 | + Maximize(); |
---|
| 2600 | + } else |
---|
| 2601 | + if (source == fullButton) |
---|
| 2602 | + { |
---|
| 2603 | + ToggleFullScreen(); |
---|
| 2604 | + } else |
---|
| 2605 | + if (source == undoButton) |
---|
| 2606 | + { |
---|
| 2607 | + // Go to previous version |
---|
| 2608 | + //if (!Undo()) |
---|
| 2609 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2610 | + Undo(); |
---|
| 2611 | + } else |
---|
| 2612 | + if (source == restoreButton) |
---|
| 2613 | + { |
---|
| 2614 | + // Restore current version |
---|
| 2615 | + Restore(); |
---|
| 2616 | + } else |
---|
| 2617 | + if (source == replaceButton) |
---|
| 2618 | + { |
---|
| 2619 | + // Overwrite current version |
---|
| 2620 | + Replace(); |
---|
| 2621 | + } else |
---|
| 2622 | + if (source == redoButton) |
---|
| 2623 | + { |
---|
| 2624 | + // Go to next version |
---|
| 2625 | + Redo(); |
---|
| 2626 | + } else |
---|
| 2627 | + if (source == saveButton) |
---|
| 2628 | + { |
---|
| 2629 | + // Save a new version |
---|
| 2630 | + if (!Save(true)) |
---|
| 2631 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2632 | + } else |
---|
| 2633 | + if (source == oneStepButton) |
---|
| 2634 | + { |
---|
| 2635 | + Globals.ONESTEP = true; |
---|
| 2636 | + cameraView.repaint(); |
---|
| 2637 | + } else |
---|
| 2638 | + if (source == screenfitButton) |
---|
| 2639 | + { |
---|
1859 | 2640 | ScreenFit(); |
---|
1860 | 2641 | } else |
---|
1861 | | - if (event.getSource() == screenfitpointButton) |
---|
| 2642 | + if (source == screenfitpointButton) |
---|
1862 | 2643 | { |
---|
1863 | | - //Reload(lastConverter, lastFilename, true); |
---|
1864 | 2644 | ScreenFitPoint(); |
---|
1865 | 2645 | } else |
---|
1866 | | - if (event.getSource() == snapobjectButton) |
---|
| 2646 | + if (source == snapobjectButton) |
---|
1867 | 2647 | { |
---|
1868 | | - //Reload(lastConverter, lastFilename, true); |
---|
1869 | 2648 | SnapObject(); |
---|
1870 | 2649 | } else |
---|
1871 | 2650 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1874 | 2653 | // Recompile(); |
---|
1875 | 2654 | // refreshContents(); |
---|
1876 | 2655 | // } else |
---|
1877 | | - if (event.getSource() == gcButton) |
---|
| 2656 | + if (source == gcButton) |
---|
1878 | 2657 | { |
---|
1879 | 2658 | System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1880 | 2659 | System.gc(); |
---|
1881 | 2660 | System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory()); |
---|
1882 | 2661 | } else |
---|
1883 | | - if (event.getSource() == editLeafItem) |
---|
| 2662 | + if (source == editLeafItem) |
---|
1884 | 2663 | { |
---|
1885 | 2664 | Object3D obj; |
---|
1886 | 2665 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
1894 | 2673 | } |
---|
1895 | 2674 | refreshContents(true); |
---|
1896 | 2675 | } else |
---|
1897 | | - if (event.getSource() == openWindowItem) |
---|
| 2676 | + if (source == openWindowItem) |
---|
1898 | 2677 | { |
---|
1899 | 2678 | EditSelection(true); |
---|
1900 | 2679 | } else |
---|
1901 | | - if (event.getSource() == cutItem || event.getSource() == clearButton) |
---|
| 2680 | + if (source == cutItem || source == clearButton) |
---|
1902 | 2681 | { |
---|
1903 | 2682 | loadClipboard(true); |
---|
1904 | 2683 | } else |
---|
1905 | | - if (event.getSource() == duplicateItem) |
---|
| 2684 | + if (source == undoItem) |
---|
1906 | 2685 | { |
---|
1907 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2686 | + Undo(); |
---|
| 2687 | + } else |
---|
| 2688 | + if (source == redoItem) |
---|
| 2689 | + { |
---|
| 2690 | + Redo(); |
---|
| 2691 | + } else |
---|
| 2692 | + if (source == duplicateItem) |
---|
| 2693 | + { |
---|
| 2694 | + Object3D keep = Grafreed.clipboard; |
---|
1908 | 2695 | loadClipboard(false); |
---|
1909 | 2696 | paste(false); |
---|
1910 | | - GrafreeD.clipboard = keep; |
---|
| 2697 | + Grafreed.clipboard = keep; |
---|
1911 | 2698 | } else |
---|
1912 | | - if (event.getSource() == cloneItem) |
---|
| 2699 | + if (source == cloneItem) |
---|
1913 | 2700 | { |
---|
1914 | 2701 | CloneSelection(false); |
---|
1915 | 2702 | } else |
---|
1916 | | - if (event.getSource() == cloneSupportItem) |
---|
| 2703 | + if (source == cloneSupportItem) |
---|
1917 | 2704 | { |
---|
1918 | 2705 | CloneSelection(true); |
---|
1919 | 2706 | } else |
---|
1920 | | - if (event.getSource() == copyItem) |
---|
| 2707 | + if (source == copyItem) |
---|
1921 | 2708 | { |
---|
1922 | 2709 | loadClipboard(false); |
---|
1923 | 2710 | } else |
---|
1924 | | - if (event.getSource() == pasteItem) |
---|
| 2711 | + if (source == pasteItem) |
---|
1925 | 2712 | { |
---|
1926 | 2713 | paste(false); |
---|
1927 | 2714 | } else |
---|
1928 | | - if (event.getSource() == pasteLinkItem) |
---|
| 2715 | + if (source == pasteIntoItem) |
---|
1929 | 2716 | { |
---|
1930 | | - pasteInto(false); |
---|
| 2717 | + pasteInto(true, false); |
---|
1931 | 2718 | } else |
---|
1932 | | - if (event.getSource() == pasteCloneItem) |
---|
| 2719 | + if (source == pasteLinkItem) |
---|
1933 | 2720 | { |
---|
1934 | | - pasteInto(true); |
---|
| 2721 | + pasteInto(false, false); |
---|
1935 | 2722 | } else |
---|
1936 | | - if (event.getSource() == pasteExpandItem) |
---|
| 2723 | + if (source == pasteCloneItem) |
---|
| 2724 | + { |
---|
| 2725 | + pasteInto(true, true); |
---|
| 2726 | + } else |
---|
| 2727 | + if (source == pasteExpandItem) |
---|
1937 | 2728 | { |
---|
1938 | 2729 | paste(true); |
---|
1939 | 2730 | } else |
---|
1940 | | - if (event.getSource() == synchronizeItem) |
---|
| 2731 | + if (source == synchronizeItem) |
---|
1941 | 2732 | { |
---|
1942 | 2733 | Overwrite(Object3D.TRANSFORM); |
---|
1943 | 2734 | } else |
---|
1944 | | - if (event.getSource() == overwriteNameItem) |
---|
| 2735 | + if (source == overwriteNameItem) |
---|
1945 | 2736 | { |
---|
1946 | 2737 | Overwrite(Object3D.NAME); |
---|
1947 | 2738 | } else |
---|
1948 | | - if (event.getSource() == overwriteUVItem) |
---|
| 2739 | + if (source == overwriteUVItem) |
---|
1949 | 2740 | { |
---|
1950 | 2741 | Overwrite(Object3D.UV); |
---|
1951 | 2742 | } else |
---|
1952 | | - if (event.getSource() == overwriteMatItem) |
---|
| 2743 | + if (source == overwriteMatItem) |
---|
1953 | 2744 | { |
---|
1954 | 2745 | /* july 2015 |
---|
1955 | 2746 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
.. | .. |
---|
1969 | 2760 | |
---|
1970 | 2761 | Overwrite(dropAttributes); |
---|
1971 | 2762 | } |
---|
1972 | | - if (event.getSource() == overwriteGeoItem) |
---|
| 2763 | + if (source == overwriteGeoItem) |
---|
1973 | 2764 | { |
---|
1974 | 2765 | Overwrite(Object3D.GEOMETRY); |
---|
1975 | 2766 | // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
.. | .. |
---|
1986 | 2777 | // refreshContents(); |
---|
1987 | 2778 | // } |
---|
1988 | 2779 | } else |
---|
1989 | | - if (event.getSource() == generateMeshItem) |
---|
| 2780 | + if (source == generateMeshItem) |
---|
1990 | 2781 | { |
---|
1991 | 2782 | //if (group.selection.size() == 1) |
---|
1992 | 2783 | // for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
1997 | 2788 | ResetModel(); |
---|
1998 | 2789 | refreshContents(); |
---|
1999 | 2790 | } else |
---|
2000 | | - if (event.getSource() == extractGeometriesItem) |
---|
| 2791 | + if (source == extractGeometriesItem) |
---|
2001 | 2792 | { |
---|
2002 | 2793 | boolean one = false; |
---|
2003 | 2794 | |
---|
.. | .. |
---|
2024 | 2815 | ResetModel(); |
---|
2025 | 2816 | refreshContents(); |
---|
2026 | 2817 | } else |
---|
2027 | | - if (event.getSource() == cloneGeometriesItem) |
---|
| 2818 | + if (source == cloneGeometriesItem) |
---|
2028 | 2819 | { |
---|
2029 | 2820 | boolean one = false; |
---|
2030 | 2821 | |
---|
.. | .. |
---|
2050 | 2841 | ResetModel(); |
---|
2051 | 2842 | refreshContents(); |
---|
2052 | 2843 | } else |
---|
2053 | | - if (event.getSource() == shareGeometriesItem) |
---|
| 2844 | + if (source == shareGeometriesItem) |
---|
2054 | 2845 | { |
---|
2055 | 2846 | boolean one = false; |
---|
2056 | 2847 | |
---|
.. | .. |
---|
2080 | 2871 | refreshContents(); |
---|
2081 | 2872 | } |
---|
2082 | 2873 | } else |
---|
2083 | | - if (event.getSource() == mergeGeometriesItem) |
---|
| 2874 | + if (source == mergeGeometriesItem) |
---|
2084 | 2875 | { |
---|
2085 | 2876 | boolean one = false; |
---|
2086 | 2877 | |
---|
.. | .. |
---|
2110 | 2901 | ResetModel(); |
---|
2111 | 2902 | refreshContents(); |
---|
2112 | 2903 | } else |
---|
2113 | | - if (event.getSource() == linkverticesItem) |
---|
| 2904 | + if (source == linkverticesItem) |
---|
2114 | 2905 | { |
---|
2115 | 2906 | // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2116 | 2907 | // { |
---|
.. | .. |
---|
2123 | 2914 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2124 | 2915 | // refreshContents(); |
---|
2125 | 2916 | // } |
---|
2126 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2917 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2127 | 2918 | { |
---|
2128 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2919 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2129 | 2920 | |
---|
2130 | 2921 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2131 | 2922 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2133 | 2924 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR)); |
---|
2134 | 2925 | for (int i=0; i<group.selection.size(); i++) |
---|
2135 | 2926 | { |
---|
2136 | | - boolean random = CameraPane.RANDOM; |
---|
2137 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2927 | + boolean random = CameraPane.SWITCH; |
---|
| 2928 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2138 | 2929 | group.selection.get(i).linkVerticesThis(content); |
---|
2139 | 2930 | // group.selection.get(i).setMasterThis(content); // should be identity |
---|
2140 | | - CameraPane.RANDOM = random; |
---|
| 2931 | + CameraPane.SWITCH = random; |
---|
2141 | 2932 | } |
---|
2142 | 2933 | Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR)); |
---|
2143 | 2934 | refreshContents(); |
---|
2144 | 2935 | } |
---|
2145 | 2936 | } else |
---|
2146 | | - if (event.getSource() == resetsupportItem) |
---|
| 2937 | + if (source == resetsupportItem) |
---|
2147 | 2938 | { |
---|
2148 | 2939 | for (int i=0; i<group.selection.size(); i++) |
---|
2149 | 2940 | { |
---|
2150 | | - boolean random = CameraPane.RANDOM; |
---|
2151 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2941 | + boolean random = CameraPane.SWITCH; |
---|
| 2942 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2152 | 2943 | group.selection.get(i).linkVerticesThis(null); |
---|
2153 | | - CameraPane.RANDOM = random; |
---|
| 2944 | + CameraPane.SWITCH = random; |
---|
2154 | 2945 | } |
---|
2155 | 2946 | |
---|
2156 | 2947 | refreshContents(); |
---|
2157 | 2948 | } else |
---|
2158 | | - if (event.getSource() == relinkverticesItem) |
---|
| 2949 | + if (source == relinkverticesItem) |
---|
2159 | 2950 | { |
---|
2160 | | - boolean random = CameraPane.RANDOM; |
---|
2161 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2951 | + boolean random = CameraPane.SWITCH; |
---|
| 2952 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
2162 | 2953 | group.selection.RelinkToSupport(); |
---|
2163 | | - CameraPane.RANDOM = random; |
---|
| 2954 | + CameraPane.SWITCH = random; |
---|
2164 | 2955 | |
---|
2165 | 2956 | refreshContents(); |
---|
2166 | 2957 | } else |
---|
2167 | | - if (event.getSource() == resetreferencesItem) |
---|
| 2958 | + if (source == resetreferencesItem) |
---|
2168 | 2959 | { |
---|
2169 | 2960 | for (int i=0; i<group.selection.size(); i++) |
---|
2170 | 2961 | { |
---|
.. | .. |
---|
2173 | 2964 | |
---|
2174 | 2965 | refreshContents(); |
---|
2175 | 2966 | } else |
---|
2176 | | - if (event.getSource() == setMasterItem) |
---|
| 2967 | + if (source == setMasterItem) |
---|
2177 | 2968 | { |
---|
2178 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2969 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2179 | 2970 | { |
---|
2180 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2971 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2181 | 2972 | |
---|
2182 | 2973 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2183 | 2974 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2186 | 2977 | refreshContents(); |
---|
2187 | 2978 | } |
---|
2188 | 2979 | } else |
---|
2189 | | - if (event.getSource() == poseMeshItem) |
---|
| 2980 | + if (source == poseMeshItem) |
---|
2190 | 2981 | { |
---|
2191 | 2982 | if (group.selection.size() == 1) |
---|
2192 | 2983 | { |
---|
2193 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2984 | + if (Grafreed.clipboard.size() == 1) |
---|
2194 | 2985 | { |
---|
2195 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2986 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2196 | 2987 | |
---|
2197 | 2988 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2198 | 2989 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2205 | 2996 | } |
---|
2206 | 2997 | |
---|
2207 | 2998 | } else |
---|
2208 | | - if (event.getSource() == revertMeshItem) |
---|
| 2999 | + if (source == revertMeshItem) |
---|
2209 | 3000 | { |
---|
2210 | 3001 | RevertMeshes(); |
---|
2211 | 3002 | } else |
---|
2212 | | - if (event.getSource() == resetMeshItem) |
---|
| 3003 | + if (source == resetAllItem) |
---|
2213 | 3004 | { |
---|
2214 | 3005 | ResetAll(); |
---|
2215 | 3006 | } else |
---|
2216 | | - if (event.getSource() == stepAllItem) |
---|
| 3007 | + if (source == stepAllItem) |
---|
2217 | 3008 | { |
---|
2218 | 3009 | StepAll(); |
---|
2219 | 3010 | } else |
---|
2220 | | - if (event.getSource() == clearItem) // || event.getSource() == clearButton) |
---|
| 3011 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2221 | 3012 | { |
---|
2222 | 3013 | //int indices[] = jList.getSelectedIndices(); |
---|
2223 | 3014 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2225 | 3016 | |
---|
2226 | 3017 | ClearSelection(false); |
---|
2227 | 3018 | } else |
---|
2228 | | - if (event.getSource() == clearAllItem) |
---|
| 3019 | + if (source == clearAllItem) |
---|
2229 | 3020 | { |
---|
2230 | 3021 | ClearSelection(true); |
---|
2231 | 3022 | } else |
---|
2232 | | - if (event.getSource() == grabItem) |
---|
| 3023 | + if (source == grabItem || source == groupButton) |
---|
2233 | 3024 | { |
---|
2234 | | - group(new cGroup(), true); |
---|
| 3025 | + group(new cGroup(), false); // true); |
---|
2235 | 3026 | } else |
---|
2236 | | - if (event.getSource() == hideItem) |
---|
| 3027 | + if (source == hideItem) |
---|
2237 | 3028 | { |
---|
2238 | 3029 | group(new HiddenObject()); |
---|
2239 | 3030 | } else |
---|
2240 | | - if (event.getSource() == frontItem) |
---|
| 3031 | + if (source == frontItem) |
---|
2241 | 3032 | { |
---|
2242 | 3033 | front(); |
---|
2243 | 3034 | } else |
---|
2244 | | - if (event.getSource() == backItem) |
---|
| 3035 | + if (source == backItem) |
---|
2245 | 3036 | { |
---|
2246 | 3037 | back(); |
---|
2247 | 3038 | } else |
---|
2248 | | - if (event.getSource() == cameraItem) |
---|
| 3039 | + if (source == cameraItem) |
---|
2249 | 3040 | { |
---|
2250 | 3041 | makeSomething(new Camera()); |
---|
2251 | 3042 | } else |
---|
2252 | | - if (event.getSource() == compositeItem) |
---|
| 3043 | + if (source == compositeItem || source == compositeButton) |
---|
2253 | 3044 | { |
---|
2254 | 3045 | group(new Composite()); |
---|
2255 | 3046 | } else |
---|
2256 | | - if (event.getSource() == randomItem) |
---|
| 3047 | + if (source == switchItem || source == switchButton) |
---|
2257 | 3048 | { |
---|
2258 | 3049 | RandomNode random = new RandomNode(); |
---|
2259 | 3050 | group(random); |
---|
2260 | 3051 | if (random.size() > 0) |
---|
2261 | | - random.name = random.get(0).name + "Rnd"; |
---|
| 3052 | + random.name = random.get(0).name + "Switch"; |
---|
2262 | 3053 | } else |
---|
2263 | | - if (event.getSource() == physicsItem) |
---|
| 3054 | + if (source == physicsItem) |
---|
2264 | 3055 | { |
---|
2265 | 3056 | group(new PhysicsNode()); |
---|
2266 | 3057 | } else |
---|
2267 | | - if (event.getSource() == frameselectorItem) |
---|
| 3058 | + if (source == frameselectorItem) |
---|
2268 | 3059 | { |
---|
2269 | 3060 | for (int i=0; i<group.selection.size(); i++) |
---|
2270 | 3061 | { |
---|
.. | .. |
---|
2276 | 3067 | ResetModel(); |
---|
2277 | 3068 | refreshContents(); |
---|
2278 | 3069 | } else |
---|
2279 | | - if (event.getSource() == switchGeoItem) |
---|
| 3070 | + if (source == switchGeoItem) |
---|
2280 | 3071 | { |
---|
2281 | 3072 | for (int i=0; i<group.selection.size(); i++) |
---|
2282 | 3073 | { |
---|
.. | .. |
---|
2288 | 3079 | ResetModel(); |
---|
2289 | 3080 | refreshContents(); |
---|
2290 | 3081 | } else |
---|
2291 | | - if (event.getSource() == switchTransfoItem) |
---|
| 3082 | + if (source == switchTransfoItem) |
---|
2292 | 3083 | { |
---|
2293 | 3084 | for (int i=0; i<group.selection.size(); i++) |
---|
2294 | 3085 | { |
---|
.. | .. |
---|
2300 | 3091 | ResetModel(); |
---|
2301 | 3092 | refreshContents(); |
---|
2302 | 3093 | } else |
---|
2303 | | - if (event.getSource() == morphItem) |
---|
| 3094 | + if (source == morphItem) |
---|
2304 | 3095 | { |
---|
2305 | 3096 | for (int i=0; i<group.selection.size(); i++) |
---|
2306 | 3097 | { |
---|
.. | .. |
---|
2312 | 3103 | ResetModel(); |
---|
2313 | 3104 | refreshContents(); |
---|
2314 | 3105 | } else |
---|
2315 | | - if (event.getSource() == scriptNodeItem) |
---|
| 3106 | + if (source == scriptNodeItem) |
---|
2316 | 3107 | { |
---|
2317 | 3108 | boolean atleastone = false; |
---|
2318 | 3109 | |
---|
.. | .. |
---|
2351 | 3142 | } |
---|
2352 | 3143 | } |
---|
2353 | 3144 | } else |
---|
2354 | | - if (event.getSource() == linkerItem) |
---|
| 3145 | + if (source == linkerItem) |
---|
2355 | 3146 | { |
---|
2356 | 3147 | group(new cLinker()); |
---|
2357 | 3148 | } else |
---|
2358 | | - if (event.getSource() == textureItem) |
---|
| 3149 | + if (source == textureItem || source == textureButton) |
---|
2359 | 3150 | { |
---|
2360 | 3151 | group(new TextureNode()); |
---|
2361 | 3152 | } else |
---|
2362 | | - if (event.getSource() == billboardItem) |
---|
| 3153 | + if (source == billboardItem) |
---|
2363 | 3154 | { |
---|
2364 | 3155 | group(new BillboardNode()); |
---|
2365 | 3156 | } else |
---|
2366 | | - if (event.getSource() == shadowXItem) |
---|
| 3157 | + if (source == shadowXItem) |
---|
2367 | 3158 | { |
---|
2368 | 3159 | CastShadow(0); |
---|
2369 | 3160 | } else |
---|
2370 | | - if (event.getSource() == shadowYItem) |
---|
| 3161 | + if (source == shadowYItem) |
---|
2371 | 3162 | { |
---|
2372 | 3163 | CastShadow(1); |
---|
2373 | 3164 | } else |
---|
2374 | | - if (event.getSource() == shadowZItem) |
---|
| 3165 | + if (source == shadowZItem) |
---|
2375 | 3166 | { |
---|
2376 | 3167 | CastShadow(2); |
---|
2377 | 3168 | } else |
---|
2378 | | - if (event.getSource() == ungroupItem) |
---|
| 3169 | + if (source == ungroupItem || source == ungroupButton) |
---|
2379 | 3170 | { |
---|
2380 | | - //ungroup(); |
---|
| 3171 | + boolean hasRoot = false; |
---|
| 3172 | + |
---|
2381 | 3173 | for (int i=0; i<group.selection.size(); i++) |
---|
2382 | 3174 | { |
---|
2383 | | - Ungroup(group.selection.get(i)); |
---|
| 3175 | + if (group.selection.get(i) == group) |
---|
| 3176 | + { |
---|
| 3177 | + hasRoot = true; |
---|
| 3178 | + break; |
---|
| 3179 | + } |
---|
2384 | 3180 | } |
---|
2385 | 3181 | |
---|
2386 | | - ClearSelection(false); |
---|
2387 | | - |
---|
2388 | | - refreshContents(); |
---|
| 3182 | + if (!hasRoot) |
---|
| 3183 | + { |
---|
| 3184 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3185 | + { |
---|
| 3186 | + Ungroup(group.selection.get(i)); |
---|
| 3187 | + } |
---|
| 3188 | + |
---|
| 3189 | + ClearSelection(false); |
---|
| 3190 | + |
---|
| 3191 | + refreshContents(); |
---|
| 3192 | + } |
---|
2389 | 3193 | } else |
---|
2390 | | - if (event.getSource() == genUVItem) |
---|
| 3194 | + if (source == genUVItem) |
---|
2391 | 3195 | { |
---|
2392 | 3196 | GenUV(); |
---|
2393 | 3197 | } else |
---|
2394 | | - if (event.getSource() == genNormalsCADItem) |
---|
| 3198 | + if (source == genNormalsCADItem) |
---|
2395 | 3199 | { |
---|
2396 | 3200 | GenNormals(true); |
---|
2397 | 3201 | } else |
---|
2398 | | - if (event.getSource() == genNormalsMESHItem) |
---|
| 3202 | + if (source == genNormalsMESHItem) |
---|
2399 | 3203 | { |
---|
2400 | | - GenNormals(true); // TODO |
---|
| 3204 | + GenNormalsMESH(); |
---|
2401 | 3205 | } else |
---|
2402 | | - if (event.getSource() == genNormalsORGANItem) |
---|
| 3206 | + if (source == genNormalsORGANItem) |
---|
2403 | 3207 | { |
---|
2404 | 3208 | GenNormals(false); |
---|
2405 | 3209 | } else |
---|
2406 | | - if (event.getSource() == genNormalsMINEItem) |
---|
| 3210 | + if (source == genNormalsMINEItem) |
---|
2407 | 3211 | { |
---|
2408 | 3212 | GenNormalsMINE(); |
---|
2409 | 3213 | } else |
---|
2410 | | - if (event.getSource() == stripifyItem) |
---|
| 3214 | + if (source == stripifyItem) |
---|
2411 | 3215 | { |
---|
2412 | 3216 | Stripify(); |
---|
2413 | 3217 | } else |
---|
2414 | | - if (event.getSource() == unstripifyItem) |
---|
| 3218 | + if (source == unstripifyItem) |
---|
2415 | 3219 | { |
---|
2416 | 3220 | Unstripify(); |
---|
2417 | 3221 | } else |
---|
2418 | | - if (event.getSource() == trimItem) |
---|
| 3222 | + if (source == trimItem) |
---|
2419 | 3223 | { |
---|
2420 | 3224 | Trim(); |
---|
2421 | 3225 | } else |
---|
2422 | | - if (event.getSource() == untrimItem) |
---|
| 3226 | + if (source == untrimItem) |
---|
2423 | 3227 | { |
---|
2424 | 3228 | Untrim(); |
---|
2425 | 3229 | } else |
---|
2426 | | - if (event.getSource() == clearColorsItem) |
---|
| 3230 | + if (source == clearColorsItem) |
---|
2427 | 3231 | { |
---|
2428 | 3232 | ClearColors(); |
---|
2429 | 3233 | } else |
---|
2430 | | - if (event.getSource() == clearMaterialsItem) |
---|
| 3234 | + if (source == clearMaterialsItem) |
---|
2431 | 3235 | { |
---|
2432 | 3236 | ClearMaterials(); |
---|
2433 | 3237 | } else |
---|
2434 | | - if (event.getSource() == liveleavesItem) |
---|
| 3238 | + if (source == liveleavesItem) |
---|
2435 | 3239 | { |
---|
2436 | 3240 | LiveLeaves(true); |
---|
2437 | 3241 | } else |
---|
2438 | | - if (event.getSource() == unliveleavesItem) |
---|
| 3242 | + if (source == unliveleavesItem) |
---|
2439 | 3243 | { |
---|
2440 | 3244 | LiveLeaves(false); |
---|
2441 | 3245 | } else |
---|
2442 | | - if (event.getSource() == supportleavesItem) |
---|
| 3246 | + if (source == supportleavesItem) |
---|
2443 | 3247 | { |
---|
2444 | 3248 | SupportLeaves(true); |
---|
2445 | 3249 | } else |
---|
2446 | | - if (event.getSource() == unsupportleavesItem) |
---|
| 3250 | + if (source == unsupportleavesItem) |
---|
2447 | 3251 | { |
---|
2448 | 3252 | SupportLeaves(false); |
---|
2449 | 3253 | } else |
---|
2450 | | - if (event.getSource() == hideleavesItem) |
---|
| 3254 | + if (source == hideleavesItem) |
---|
2451 | 3255 | { |
---|
2452 | 3256 | HideLeaves(true); |
---|
2453 | 3257 | } else |
---|
2454 | | - if (event.getSource() == showleavesItem) |
---|
| 3258 | + if (source == showleavesItem) |
---|
2455 | 3259 | { |
---|
2456 | 3260 | HideLeaves(false); |
---|
2457 | 3261 | } else |
---|
2458 | | - if (event.getSource() == markleavesItem) |
---|
| 3262 | + if (source == markleavesItem) |
---|
2459 | 3263 | { |
---|
2460 | 3264 | MarkLeaves(true); |
---|
2461 | 3265 | } else |
---|
2462 | | - if (event.getSource() == unmarkleavesItem) |
---|
| 3266 | + if (source == unmarkleavesItem) |
---|
2463 | 3267 | { |
---|
2464 | 3268 | MarkLeaves(false); |
---|
2465 | 3269 | } else |
---|
2466 | | - if (event.getSource() == flipVItem) |
---|
| 3270 | + if (source == rewindleavesItem) |
---|
| 3271 | + { |
---|
| 3272 | + RewindLeaves(true); |
---|
| 3273 | + } else |
---|
| 3274 | + if (source == unrewindleavesItem) |
---|
| 3275 | + { |
---|
| 3276 | + RewindLeaves(false); |
---|
| 3277 | + } else |
---|
| 3278 | + if (source == randomleavesItem) |
---|
| 3279 | + { |
---|
| 3280 | + RandomLeaves(true); |
---|
| 3281 | + } else |
---|
| 3282 | + if (source == unrandomleavesItem) |
---|
| 3283 | + { |
---|
| 3284 | + RandomLeaves(false); |
---|
| 3285 | + } else |
---|
| 3286 | + if (source == flipVItem) |
---|
2467 | 3287 | { |
---|
2468 | 3288 | FlipV(true); |
---|
2469 | 3289 | } else |
---|
2470 | | - if (event.getSource() == unflipVItem) |
---|
| 3290 | + if (source == unflipVItem) |
---|
2471 | 3291 | { |
---|
2472 | 3292 | FlipV(false); |
---|
2473 | 3293 | } else |
---|
2474 | | - if (event.getSource() == lowTexturesItem) |
---|
| 3294 | + if (source == lowTexturesItem) |
---|
2475 | 3295 | { |
---|
2476 | 3296 | SetTexRes(0); |
---|
2477 | 3297 | } else |
---|
2478 | | - if (event.getSource() == normalTexturesItem) |
---|
| 3298 | + if (source == normalTexturesItem) |
---|
2479 | 3299 | { |
---|
2480 | 3300 | SetTexRes(1); |
---|
2481 | 3301 | } else |
---|
2482 | | - if (event.getSource() == highTexturesItem) |
---|
| 3302 | + if (source == highTexturesItem) |
---|
2483 | 3303 | { |
---|
2484 | 3304 | SetTexRes(2); |
---|
2485 | 3305 | } else |
---|
2486 | | - if (event.getSource() == veryhighTexturesItem) |
---|
| 3306 | + if (source == veryhighTexturesItem) |
---|
2487 | 3307 | { |
---|
2488 | 3308 | SetTexRes(3); |
---|
2489 | 3309 | } else |
---|
2490 | | - if (event.getSource() == maxTexturesItem) |
---|
| 3310 | + if (source == maxTexturesItem) |
---|
2491 | 3311 | { |
---|
2492 | 3312 | SetTexRes(4); |
---|
2493 | 3313 | } else |
---|
2494 | | - if (event.getSource() == panoTexturesItem) |
---|
| 3314 | + if (source == panoTexturesItem) |
---|
2495 | 3315 | { |
---|
2496 | 3316 | SetTexRes(5); |
---|
2497 | 3317 | } else |
---|
2498 | | - if (event.getSource() == reverseNormalsItem) |
---|
| 3318 | + if (source == reverseNormalsItem) |
---|
2499 | 3319 | { |
---|
2500 | 3320 | ReverseNormals(); |
---|
2501 | 3321 | } else |
---|
2502 | | - if (event.getSource() == parseverticesItem) |
---|
| 3322 | + if (source == parseverticesItem) |
---|
2503 | 3323 | { |
---|
2504 | 3324 | ParseVertices(); |
---|
2505 | 3325 | } else |
---|
2506 | | - if (event.getSource() == textureFieldItem) |
---|
| 3326 | + if (source == textureFieldItem) |
---|
2507 | 3327 | { |
---|
2508 | 3328 | TextureVertices(); |
---|
2509 | 3329 | } else |
---|
2510 | | - if (event.getSource() == alignItem) |
---|
| 3330 | + if (source == alignItem) |
---|
2511 | 3331 | { |
---|
2512 | 3332 | Align(); |
---|
2513 | 3333 | } else |
---|
2514 | | - if (event.getSource() == mirrorItem) |
---|
| 3334 | + if (source == mirrorItem) |
---|
2515 | 3335 | { |
---|
2516 | 3336 | MirrorPoses(); |
---|
2517 | 3337 | } else |
---|
2518 | | - if (event.getSource() == reduceMorphItem) |
---|
| 3338 | + if (source == reduceMorphItem) |
---|
2519 | 3339 | { |
---|
2520 | 3340 | MeshReduction(false); |
---|
2521 | 3341 | } else |
---|
2522 | | - if (event.getSource() == reduce34MorphItem) |
---|
| 3342 | + if (source == reduce34MorphItem) |
---|
2523 | 3343 | { |
---|
2524 | 3344 | MeshReduction(true); |
---|
2525 | 3345 | } else |
---|
2526 | | - if (event.getSource() == reverseTrianglesItem) |
---|
| 3346 | + if (source == reverseTrianglesItem) |
---|
2527 | 3347 | { |
---|
2528 | 3348 | ReverseTriangles(); |
---|
2529 | 3349 | } else |
---|
2530 | | - if (event.getSource() == reduceMeshItem) |
---|
| 3350 | + if (source == reduceMeshItem) |
---|
2531 | 3351 | { |
---|
2532 | 3352 | ReduceMesh(false); |
---|
2533 | 3353 | } else |
---|
2534 | | - if (event.getSource() == reduce34MeshItem) |
---|
| 3354 | + if (source == reduce34MeshItem) |
---|
2535 | 3355 | { |
---|
2536 | 3356 | ReduceMesh(true); |
---|
2537 | 3357 | } else |
---|
2538 | | - if (event.getSource() == increaseMeshItem) |
---|
| 3358 | + if (source == increaseMeshItem) |
---|
2539 | 3359 | { |
---|
2540 | 3360 | IncreaseMesh(); |
---|
2541 | 3361 | } else |
---|
2542 | | - if (event.getSource() == clipMeshItem) |
---|
| 3362 | + if (source == clipMeshItem) |
---|
2543 | 3363 | { |
---|
2544 | 3364 | ClipMesh(); |
---|
2545 | 3365 | } else |
---|
2546 | | - if (event.getSource() == smoothMeshItem) |
---|
| 3366 | + if (source == smoothMeshItem) |
---|
2547 | 3367 | { |
---|
2548 | 3368 | SmoothMesh(); |
---|
2549 | 3369 | } else |
---|
2550 | | - if (event.getSource() == transformgeometryItem) |
---|
| 3370 | + if (source == transformGeometryItem) |
---|
2551 | 3371 | { |
---|
2552 | 3372 | TransformGeometry(); |
---|
2553 | 3373 | } else |
---|
2554 | | - if (event.getSource() == resetTransformItem) |
---|
| 3374 | + if (source == transformChildrenItem) |
---|
| 3375 | + { |
---|
| 3376 | + TransformChildren(); |
---|
| 3377 | + } else |
---|
| 3378 | + if (source == resetTransformItem) |
---|
2555 | 3379 | { |
---|
2556 | 3380 | ResetTransform(); |
---|
2557 | 3381 | } else |
---|
2558 | | - if (event.getSource() == resetCentroidItem) |
---|
| 3382 | + if (source == resetCentroidItem) |
---|
2559 | 3383 | { |
---|
2560 | | - ResetCentroid(); |
---|
| 3384 | + ResetCentroid(true); |
---|
2561 | 3385 | } else |
---|
2562 | | - if (event.getSource() == resetParentItem) |
---|
| 3386 | + if (source == resetCentroidXZItem) |
---|
| 3387 | + { |
---|
| 3388 | + ResetCentroid(false); |
---|
| 3389 | + } else |
---|
| 3390 | + if (source == resetParentItem) |
---|
2563 | 3391 | { |
---|
2564 | 3392 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2565 | 3393 | { |
---|
.. | .. |
---|
2569 | 3397 | |
---|
2570 | 3398 | refreshContents(); |
---|
2571 | 3399 | } else |
---|
2572 | | - if (event.getSource() == repairParentItem) |
---|
| 3400 | + if (source == repairParentItem) |
---|
2573 | 3401 | { |
---|
2574 | 3402 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2575 | 3403 | { |
---|
.. | .. |
---|
2583 | 3411 | |
---|
2584 | 3412 | refreshContents(); |
---|
2585 | 3413 | } else |
---|
2586 | | - if (event.getSource() == repairShadowItem) |
---|
| 3414 | + if (source == repairShadowItem) |
---|
2587 | 3415 | { |
---|
2588 | 3416 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2589 | 3417 | { |
---|
.. | .. |
---|
2597 | 3425 | |
---|
2598 | 3426 | refreshContents(); |
---|
2599 | 3427 | } else |
---|
2600 | | - if (event.getSource() == sortbysizeItem) |
---|
| 3428 | + if (source == sortbysizeItem) |
---|
2601 | 3429 | { |
---|
2602 | 3430 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2603 | 3431 | { |
---|
.. | .. |
---|
2609 | 3437 | ResetModel(); |
---|
2610 | 3438 | refreshContents(); |
---|
2611 | 3439 | } else |
---|
2612 | | - if (event.getSource() == sortbynameItem) |
---|
| 3440 | + if (source == sortbynameItem) |
---|
2613 | 3441 | { |
---|
2614 | 3442 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2615 | 3443 | { |
---|
.. | .. |
---|
2621 | 3449 | ResetModel(); |
---|
2622 | 3450 | refreshContents(); |
---|
2623 | 3451 | } else |
---|
2624 | | - if (event.getSource() == attachPigmentItem) |
---|
| 3452 | + if (source == attachPigmentItem) |
---|
2625 | 3453 | { |
---|
2626 | 3454 | String texture = GetFile("Attach pigment"); |
---|
2627 | 3455 | Object3D obj; |
---|
.. | .. |
---|
2633 | 3461 | |
---|
2634 | 3462 | refreshContents(); |
---|
2635 | 3463 | } else |
---|
2636 | | - if (event.getSource() == detachPigmentItem) |
---|
| 3464 | + if (source == detachPigmentItem) |
---|
2637 | 3465 | { |
---|
2638 | 3466 | Object3D obj; |
---|
2639 | 3467 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2644 | 3472 | |
---|
2645 | 3473 | refreshContents(); |
---|
2646 | 3474 | } else |
---|
2647 | | - if (event.getSource() == attachBumpItem) |
---|
| 3475 | + if (source == attachBumpItem) |
---|
2648 | 3476 | { |
---|
2649 | 3477 | String texture = GetFile("Attach bump"); |
---|
2650 | 3478 | Object3D obj; |
---|
.. | .. |
---|
2656 | 3484 | |
---|
2657 | 3485 | refreshContents(); |
---|
2658 | 3486 | } else |
---|
2659 | | - if (event.getSource() == detachBumpItem) |
---|
| 3487 | + if (source == detachBumpItem) |
---|
2660 | 3488 | { |
---|
2661 | 3489 | Object3D obj; |
---|
2662 | 3490 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2663 | 3491 | { |
---|
2664 | 3492 | obj = (Object3D)e.nextElement(); |
---|
2665 | | - obj.SetBumpTexture(null); |
---|
| 3493 | + obj.ResetBumpTexture(); |
---|
2666 | 3494 | } |
---|
2667 | 3495 | |
---|
2668 | 3496 | refreshContents(); |
---|
2669 | 3497 | } else |
---|
2670 | | - if (event.getSource() == pigmentBumpItem) |
---|
| 3498 | + if (source == pigmentBumpItem) |
---|
2671 | 3499 | { |
---|
2672 | 3500 | Object3D obj; |
---|
2673 | 3501 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2678 | 3506 | |
---|
2679 | 3507 | refreshContents(); |
---|
2680 | 3508 | } else |
---|
2681 | | - if (event.getSource() == flashSelectionButton) |
---|
| 3509 | + if (source == embedTexturesItem) |
---|
| 3510 | + { |
---|
| 3511 | + Object3D obj; |
---|
| 3512 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3513 | + { |
---|
| 3514 | + obj = (Object3D)e.nextElement(); |
---|
| 3515 | + obj.EmbedTextures(true); |
---|
| 3516 | + } |
---|
| 3517 | + |
---|
| 3518 | + refreshContents(); |
---|
| 3519 | + } else |
---|
| 3520 | + if (source == deEmbedTexturesItem) |
---|
| 3521 | + { |
---|
| 3522 | + Object3D obj; |
---|
| 3523 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3524 | + { |
---|
| 3525 | + obj = (Object3D)e.nextElement(); |
---|
| 3526 | + obj.EmbedTextures(false); |
---|
| 3527 | + } |
---|
| 3528 | + |
---|
| 3529 | + CameraPane.texturepigment.clear(); |
---|
| 3530 | + CameraPane.texturebump.clear(); |
---|
| 3531 | + |
---|
| 3532 | + refreshContents(); |
---|
| 3533 | + } else |
---|
| 3534 | + if (source == flashSelectionButton) |
---|
2682 | 3535 | { |
---|
2683 | 3536 | CameraPane.flash = true; |
---|
2684 | 3537 | refreshContents(); |
---|
2685 | 3538 | } else |
---|
2686 | | - if (event.getSource() == oneButton) |
---|
| 3539 | + if (source == oneButton) |
---|
2687 | 3540 | { |
---|
2688 | 3541 | } else |
---|
2689 | | - if (event.getSource() == twoButton) |
---|
| 3542 | + if (source == twoButton) |
---|
2690 | 3543 | { |
---|
2691 | 3544 | radio.layout = twoButton; |
---|
| 3545 | + |
---|
| 3546 | + if (CameraPane.FULLSCREEN) |
---|
| 3547 | + fullscreenLayout = radio.layout; |
---|
| 3548 | + |
---|
2692 | 3549 | // bug |
---|
2693 | 3550 | //gridPanel.setDividerLocation(1.0); |
---|
2694 | 3551 | //bigPanel.setDividerLocation(0.0); |
---|
2695 | | - bigThree.remove(scenePanel); |
---|
2696 | | - bigThree.remove(centralPanel); |
---|
2697 | | - bigThree.remove(XYZPanel); |
---|
2698 | | - aWindowConstraints.gridx = 0; |
---|
2699 | | - aWindowConstraints.gridy = 0; |
---|
2700 | | - aWindowConstraints.gridwidth = 1; |
---|
2701 | | - // aConstraints.gridheight = 3; |
---|
2702 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2703 | | - aWindowConstraints.weightx = 0; |
---|
2704 | | - aWindowConstraints.weighty = 1; |
---|
2705 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2706 | | - aWindowConstraints.weightx = 1; |
---|
2707 | | - aWindowConstraints.gridwidth = 3; |
---|
2708 | | - // aConstraints.gridheight = 3; |
---|
2709 | | - aWindowConstraints.gridx = 1; |
---|
2710 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2711 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2712 | | - aWindowConstraints.weightx = 0; |
---|
2713 | | - aWindowConstraints.gridx = 4; |
---|
2714 | | - aWindowConstraints.gridwidth = 1; |
---|
2715 | | - // aConstraints.gridheight = 3; |
---|
2716 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2717 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2718 | | - bigThree.revalidate(); |
---|
| 3552 | +// bigThree.remove(scenePanel); |
---|
| 3553 | +// bigThree.remove(centralPanel); |
---|
| 3554 | +// bigThree.remove(XYZPanel); |
---|
| 3555 | +// aWindowConstraints.gridx = 0; |
---|
| 3556 | +// aWindowConstraints.gridy = 0; |
---|
| 3557 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3558 | +// // aConstraints.gridheight = 3; |
---|
| 3559 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3560 | +// aWindowConstraints.weightx = 0; |
---|
| 3561 | +// aWindowConstraints.weighty = 1; |
---|
| 3562 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3563 | +// aWindowConstraints.weightx = 1; |
---|
| 3564 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3565 | +// // aConstraints.gridheight = 3; |
---|
| 3566 | +// aWindowConstraints.gridx = 1; |
---|
| 3567 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3568 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3569 | +// aWindowConstraints.weightx = 0; |
---|
| 3570 | +// aWindowConstraints.gridx = 4; |
---|
| 3571 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3572 | +// // aConstraints.gridheight = 3; |
---|
| 3573 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3574 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3575 | +// scenePanel.setVisible(false); |
---|
| 3576 | +// centralPanel.setVisible(true); |
---|
| 3577 | +// XYZPanel.setVisible(false); |
---|
| 3578 | + bigThree.ClearUI(); |
---|
| 3579 | + bigThree.add(centralPanel); |
---|
| 3580 | + bigThree.FlushUI(); |
---|
| 3581 | + |
---|
| 3582 | + cameraView.requestFocusInWindow(); |
---|
| 3583 | + |
---|
| 3584 | +// refreshContents(true); |
---|
| 3585 | +// |
---|
| 3586 | +// try |
---|
| 3587 | +// { |
---|
| 3588 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3589 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3590 | +// bot.mouseMove(100, 100); |
---|
| 3591 | +// bot.mousePress(mask); |
---|
| 3592 | +// bot.mouseRelease(mask); |
---|
| 3593 | +// } |
---|
| 3594 | +// catch (Exception e) |
---|
| 3595 | +// { |
---|
| 3596 | +// |
---|
| 3597 | +// } |
---|
| 3598 | + |
---|
2719 | 3599 | } else |
---|
2720 | | - if (event.getSource() == threeButton) |
---|
| 3600 | + if (source == threeButton) |
---|
2721 | 3601 | { |
---|
2722 | 3602 | radio.layout = threeButton; |
---|
2723 | | - bigThree.remove(scenePanel); |
---|
2724 | | - bigThree.remove(centralPanel); |
---|
2725 | | - bigThree.remove(XYZPanel); |
---|
2726 | | - aWindowConstraints.gridx = 0; |
---|
2727 | | - aWindowConstraints.gridy = 0; |
---|
2728 | | - aWindowConstraints.gridwidth = 1; |
---|
2729 | | - // aConstraints.gridheight = 3; |
---|
2730 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2731 | | - aWindowConstraints.weightx = 0; |
---|
2732 | | - aWindowConstraints.weighty = 1; |
---|
2733 | | - //bigThree.add(jtp, aWindowConstraints); |
---|
2734 | | - aWindowConstraints.weightx = 1; |
---|
2735 | | - aWindowConstraints.gridwidth = 3; |
---|
2736 | | - // aConstraints.gridheight = 3; |
---|
2737 | | - aWindowConstraints.gridx = 1; |
---|
2738 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2739 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2740 | | - aWindowConstraints.weightx = 0; |
---|
2741 | | - aWindowConstraints.gridx = 4; |
---|
2742 | | - aWindowConstraints.gridwidth = 1; |
---|
2743 | | - // aConstraints.gridheight = 3; |
---|
2744 | | - aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2745 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2746 | | - bigThree.revalidate(); |
---|
| 3603 | + |
---|
| 3604 | + if (CameraPane.FULLSCREEN) |
---|
| 3605 | + fullscreenLayout = radio.layout; |
---|
| 3606 | + |
---|
| 3607 | +// bigThree.remove(scenePanel); |
---|
| 3608 | +// bigThree.remove(centralPanel); |
---|
| 3609 | +// bigThree.remove(XYZPanel); |
---|
| 3610 | +// aWindowConstraints.gridx = 0; |
---|
| 3611 | +// aWindowConstraints.gridy = 0; |
---|
| 3612 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3613 | +// // aConstraints.gridheight = 3; |
---|
| 3614 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3615 | +// aWindowConstraints.weightx = 0; |
---|
| 3616 | +// aWindowConstraints.weighty = 1; |
---|
| 3617 | +// //bigThree.add(jtp, aWindowConstraints); |
---|
| 3618 | +// aWindowConstraints.weightx = 1; |
---|
| 3619 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3620 | +// // aConstraints.gridheight = 3; |
---|
| 3621 | +// aWindowConstraints.gridx = 1; |
---|
| 3622 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3623 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3624 | +// aWindowConstraints.weightx = 0; |
---|
| 3625 | +// aWindowConstraints.gridx = 4; |
---|
| 3626 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3627 | +// // aConstraints.gridheight = 3; |
---|
| 3628 | +// aConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3629 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3630 | +// bigThree.validate(); |
---|
| 3631 | +// scenePanel.setVisible(false); |
---|
| 3632 | +// centralPanel.setVisible(true); |
---|
| 3633 | +// XYZPanel.setVisible(true); |
---|
| 3634 | + bigThree.ClearUI(); |
---|
| 3635 | + bigThree.add(scenePanel); |
---|
| 3636 | + bigThree.add(centralPanel); |
---|
| 3637 | + bigThree.FlushUI(); |
---|
| 3638 | + |
---|
| 3639 | + cameraView.requestFocusInWindow(); |
---|
2747 | 3640 | } else |
---|
2748 | | - if (event.getSource() == fourButton) |
---|
| 3641 | + if (source == fourButton) |
---|
2749 | 3642 | { |
---|
2750 | 3643 | radio.layout = fourButton; |
---|
2751 | | - bigThree.remove(scenePanel); |
---|
2752 | | - bigThree.remove(centralPanel); |
---|
2753 | | - bigThree.remove(XYZPanel); |
---|
2754 | | - aWindowConstraints.gridx = 0; |
---|
2755 | | - aWindowConstraints.gridy = 0; |
---|
2756 | | - aWindowConstraints.gridwidth = 1; |
---|
2757 | | - // aWindowConstraints.gridheight = 3; |
---|
2758 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2759 | | - aWindowConstraints.weightx = 1; |
---|
2760 | | - aWindowConstraints.weighty = 1; |
---|
2761 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2762 | | - aWindowConstraints.weightx = 1; |
---|
2763 | | - aWindowConstraints.gridwidth = 3; |
---|
2764 | | - // aConstraints.gridheight = 3; |
---|
2765 | | - aWindowConstraints.gridx = 1; |
---|
2766 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2767 | | - //bigThree.add(cameraPanel, aWindowConstraints); |
---|
2768 | | - aWindowConstraints.weightx = 0; |
---|
2769 | | - aWindowConstraints.gridx = 4; |
---|
2770 | | - aWindowConstraints.gridwidth = 1; |
---|
2771 | | - // aWindowConstraints.gridheight = 3; |
---|
2772 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2773 | | - //bigThree.add(XYZPanel, aWindowConstraints); |
---|
2774 | | - bigThree.revalidate(); |
---|
| 3644 | + |
---|
| 3645 | + if (CameraPane.FULLSCREEN) |
---|
| 3646 | + fullscreenLayout = radio.layout; |
---|
| 3647 | + |
---|
| 3648 | +// bigThree.remove(scenePanel); |
---|
| 3649 | +// bigThree.remove(centralPanel); |
---|
| 3650 | +// bigThree.remove(XYZPanel); |
---|
| 3651 | +// aWindowConstraints.gridx = 0; |
---|
| 3652 | +// aWindowConstraints.gridy = 0; |
---|
| 3653 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3654 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3655 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3656 | +// aWindowConstraints.weightx = 1; |
---|
| 3657 | +// aWindowConstraints.weighty = 1; |
---|
| 3658 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3659 | +// aWindowConstraints.weightx = 1; |
---|
| 3660 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3661 | +// // aConstraints.gridheight = 3; |
---|
| 3662 | +// aWindowConstraints.gridx = 1; |
---|
| 3663 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3664 | +// //bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 3665 | +// aWindowConstraints.weightx = 0; |
---|
| 3666 | +// aWindowConstraints.gridx = 4; |
---|
| 3667 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3668 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3669 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3670 | +// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3671 | +// bigThree.validate(); |
---|
| 3672 | +// scenePanel.setVisible(true); |
---|
| 3673 | +// centralPanel.setVisible(false); |
---|
| 3674 | +// XYZPanel.setVisible(false); |
---|
| 3675 | + bigThree.ClearUI(); |
---|
| 3676 | + bigThree.add(scenePanel); |
---|
| 3677 | + bigThree.FlushUI(); |
---|
| 3678 | + |
---|
| 3679 | + cameraView.requestFocusInWindow(); |
---|
2775 | 3680 | } else |
---|
2776 | | - if (event.getSource() == sixButton) |
---|
| 3681 | + if (source == sixButton) |
---|
2777 | 3682 | { |
---|
2778 | 3683 | radio.layout = sixButton; |
---|
2779 | | - bigThree.remove(scenePanel); |
---|
2780 | | - bigThree.remove(centralPanel); |
---|
2781 | | - bigThree.remove(XYZPanel); |
---|
2782 | | - aWindowConstraints.gridx = 0; |
---|
2783 | | - aWindowConstraints.gridy = 0; |
---|
2784 | | - aWindowConstraints.gridwidth = 1; |
---|
2785 | | - // aConstraints.gridheight = 3; |
---|
2786 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2787 | | - aWindowConstraints.weightx = 0; |
---|
2788 | | - aWindowConstraints.weighty = 1; |
---|
2789 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2790 | | - aWindowConstraints.weightx = 1; |
---|
2791 | | - aWindowConstraints.gridwidth = 3; |
---|
2792 | | - // aWindowConstraints.gridheight = 3; |
---|
2793 | | - aWindowConstraints.gridx = 1; |
---|
2794 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2795 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2796 | | - aWindowConstraints.weightx = 0; |
---|
2797 | | - aWindowConstraints.gridx = 4; |
---|
2798 | | - aWindowConstraints.gridwidth = 1; |
---|
2799 | | - // aWindowConstraints.gridheight = 3; |
---|
2800 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2801 | | - //bigThree.add(XYZPanel, aConstraints); |
---|
2802 | | - bigThree.revalidate(); |
---|
| 3684 | + |
---|
| 3685 | + if (CameraPane.FULLSCREEN) |
---|
| 3686 | + fullscreenLayout = radio.layout; |
---|
| 3687 | + |
---|
| 3688 | +// bigThree.remove(scenePanel); |
---|
| 3689 | +// bigThree.remove(centralPanel); |
---|
| 3690 | +// bigThree.remove(XYZPanel); |
---|
| 3691 | +// aWindowConstraints.gridx = 0; |
---|
| 3692 | +// aWindowConstraints.gridy = 0; |
---|
| 3693 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3694 | +// // aConstraints.gridheight = 3; |
---|
| 3695 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3696 | +// aWindowConstraints.weightx = 0; |
---|
| 3697 | +// aWindowConstraints.weighty = 1; |
---|
| 3698 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3699 | +// aWindowConstraints.weightx = 1; |
---|
| 3700 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3701 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3702 | +// aWindowConstraints.gridx = 1; |
---|
| 3703 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3704 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3705 | +// aWindowConstraints.weightx = 0; |
---|
| 3706 | +// aWindowConstraints.gridx = 4; |
---|
| 3707 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3708 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3709 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3710 | +// //bigThree.add(XYZPanel, aConstraints); |
---|
| 3711 | +// bigThree.validate(); |
---|
| 3712 | +// scenePanel.setVisible(true); |
---|
| 3713 | +// centralPanel.setVisible(true); |
---|
| 3714 | +// XYZPanel.setVisible(false); |
---|
| 3715 | + bigThree.ClearUI(); |
---|
| 3716 | + bigThree.add(centralPanel); |
---|
| 3717 | + bigThree.add(scenePanel); |
---|
| 3718 | + bigThree.FlushUI(); |
---|
| 3719 | + |
---|
| 3720 | + cameraView.requestFocusInWindow(); |
---|
2803 | 3721 | } else |
---|
2804 | | - if (event.getSource() == sevenButton) |
---|
| 3722 | + if (source == sevenButton) |
---|
2805 | 3723 | { |
---|
2806 | 3724 | radio.layout = sevenButton; |
---|
2807 | | - bigThree.remove(scenePanel); |
---|
2808 | | - bigThree.remove(centralPanel); |
---|
2809 | | - bigThree.remove(XYZPanel); |
---|
2810 | | - aWindowConstraints.gridx = 0; |
---|
2811 | | - aWindowConstraints.gridy = 0; |
---|
2812 | | - aWindowConstraints.gridwidth = 1; |
---|
2813 | | - // aWindowConstraints.gridheight = 3; |
---|
2814 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2815 | | - aWindowConstraints.weightx = 0; |
---|
2816 | | - aWindowConstraints.weighty = 1; |
---|
2817 | | - bigThree.add(scenePanel, aWindowConstraints); |
---|
2818 | | - aWindowConstraints.weightx = 1; |
---|
2819 | | - aWindowConstraints.gridwidth = 3; |
---|
2820 | | - // aWindowConstraints.gridheight = 3; |
---|
2821 | | - aWindowConstraints.gridx = 1; |
---|
2822 | | - aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2823 | | - bigThree.add(centralPanel, aWindowConstraints); |
---|
2824 | | - aWindowConstraints.weightx = 0; |
---|
2825 | | - aWindowConstraints.gridx = 4; |
---|
2826 | | - aWindowConstraints.gridwidth = 1; |
---|
2827 | | - // aConstraints.gridheight = 3; |
---|
2828 | | - aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2829 | | - bigThree.add(XYZPanel, aWindowConstraints); |
---|
2830 | | - bigThree.revalidate(); |
---|
| 3725 | + |
---|
| 3726 | + if (CameraPane.FULLSCREEN) |
---|
| 3727 | + fullscreenLayout = radio.layout; |
---|
| 3728 | + |
---|
| 3729 | +// bigThree.remove(scenePanel); |
---|
| 3730 | +// bigThree.remove(centralPanel); |
---|
| 3731 | +// bigThree.remove(XYZPanel); |
---|
| 3732 | +// aWindowConstraints.gridx = 0; |
---|
| 3733 | +// aWindowConstraints.gridy = 0; |
---|
| 3734 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3735 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3736 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3737 | +// aWindowConstraints.weightx = 0; |
---|
| 3738 | +// aWindowConstraints.weighty = 1; |
---|
| 3739 | +// bigThree.add(scenePanel, aWindowConstraints); |
---|
| 3740 | +// aWindowConstraints.weightx = 1; |
---|
| 3741 | +// aWindowConstraints.gridwidth = 3; |
---|
| 3742 | +// // aWindowConstraints.gridheight = 3; |
---|
| 3743 | +// aWindowConstraints.gridx = 1; |
---|
| 3744 | +// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
| 3745 | +// bigThree.add(centralPanel, aWindowConstraints); |
---|
| 3746 | +// aWindowConstraints.weightx = 0; |
---|
| 3747 | +// aWindowConstraints.gridx = 4; |
---|
| 3748 | +// aWindowConstraints.gridwidth = 1; |
---|
| 3749 | +// // aConstraints.gridheight = 3; |
---|
| 3750 | +// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
| 3751 | +// bigThree.add(XYZPanel, aWindowConstraints); |
---|
| 3752 | +// bigThree.validate(); |
---|
| 3753 | +// scenePanel.setVisible(true); |
---|
| 3754 | +// centralPanel.setVisible(true); |
---|
| 3755 | +// XYZPanel.setVisible(true); |
---|
| 3756 | + bigThree.ClearUI(); |
---|
| 3757 | + bigThree.add(scenePanel); |
---|
| 3758 | + bigThree.add(centralPanel); |
---|
| 3759 | + bigThree.add(XYZPanel); |
---|
| 3760 | + bigThree.FlushUI(); |
---|
| 3761 | + |
---|
| 3762 | + cameraView.requestFocusInWindow(); |
---|
2831 | 3763 | } else |
---|
2832 | | - if (event.getSource() == rootButton) |
---|
| 3764 | + if (source == rootButton) |
---|
2833 | 3765 | { |
---|
2834 | 3766 | Object3D obj; |
---|
2835 | 3767 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2839 | 3771 | EditObject(obj); |
---|
2840 | 3772 | } |
---|
2841 | 3773 | |
---|
| 3774 | + cameraView.requestFocusInWindow(); |
---|
2842 | 3775 | refreshContents(true); |
---|
2843 | 3776 | } else |
---|
2844 | | - if (event.getSource() == closeButton) |
---|
| 3777 | + if (source == closeButton) |
---|
2845 | 3778 | { |
---|
2846 | 3779 | //System.out.println("CLOSE: " + buttonGroup.getSelection()); |
---|
2847 | 3780 | cRadio ab; |
---|
2848 | 3781 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2849 | 3782 | { |
---|
2850 | 3783 | ab = (cRadio)e.nextElement(); |
---|
2851 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3784 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2852 | 3785 | { |
---|
| 3786 | + // Patch to avoid bug with transparency. |
---|
| 3787 | + if (!ab.hadMaterial) |
---|
| 3788 | + { |
---|
| 3789 | + ab.object.material = null; |
---|
| 3790 | + } |
---|
| 3791 | + |
---|
2853 | 3792 | buttonGroup.remove(ab); |
---|
2854 | 3793 | radioPanel.remove(ab); |
---|
2855 | 3794 | |
---|
2856 | | - ab.GetObject().editWindow = null; |
---|
| 3795 | + //ab.GetObject().editWindow = null; |
---|
| 3796 | + ab.GetObject().manipWindow = null; |
---|
2857 | 3797 | // ab.GetObject().objectUI = null; // ????????? |
---|
2858 | 3798 | |
---|
2859 | 3799 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2860 | 3800 | break; |
---|
2861 | 3801 | } |
---|
2862 | 3802 | } |
---|
| 3803 | + |
---|
| 3804 | + cameraView.requestFocusInWindow(); |
---|
2863 | 3805 | refreshContents(true); |
---|
2864 | 3806 | } else |
---|
2865 | | - if (event.getSource() == editItem || event.getSource() == editButton) |
---|
| 3807 | + if (source == editItem || source == editButton) |
---|
2866 | 3808 | { |
---|
| 3809 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3810 | + { |
---|
| 3811 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3812 | + child.pinned = true; |
---|
| 3813 | + } |
---|
| 3814 | + |
---|
2867 | 3815 | EditSelection(false); |
---|
2868 | 3816 | } else |
---|
2869 | | - if (event.getSource() == uneditButton) |
---|
| 3817 | + if (source == uneditButton) |
---|
2870 | 3818 | { |
---|
2871 | 3819 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2872 | 3820 | { |
---|
2873 | 3821 | Object3D child = (Object3D)e.nextElement(); |
---|
2874 | 3822 | if(child.editWindow != null) |
---|
2875 | 3823 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3824 | + child.pinned = false; |
---|
2876 | 3825 | child.CloseUI(); |
---|
2877 | 3826 | listUI.remove(child); |
---|
2878 | 3827 | |
---|
2879 | | - child.editWindow = null; // ??????????? |
---|
| 3828 | + //child.editWindow = null; // ??????????? |
---|
2880 | 3829 | } |
---|
2881 | | - objEditor.ctrlPanel.revalidate(); |
---|
| 3830 | + objEditor.ctrlPanel.FlushUI(); |
---|
2882 | 3831 | //objEditor.jTree.clearSelection(); |
---|
2883 | 3832 | //objEditor.ResetSliders(); |
---|
2884 | 3833 | refreshContents(true); |
---|
2885 | 3834 | } else |
---|
2886 | | - if (event.getSource() == clearPanelButton) |
---|
| 3835 | + if (source == clearPanelButton) |
---|
2887 | 3836 | { |
---|
2888 | 3837 | assert(copy == group); |
---|
2889 | 3838 | //copy.ClearUI(); |
---|
2890 | 3839 | for (Object3D obj : listUI) |
---|
2891 | 3840 | { |
---|
| 3841 | + obj.pinned = false; |
---|
2892 | 3842 | obj.CloseUI(); |
---|
2893 | 3843 | } |
---|
2894 | 3844 | listUI.clear(); |
---|
2895 | 3845 | refreshContents(true); |
---|
2896 | 3846 | } else |
---|
2897 | | - if (event.getSource() == allParamsButton) |
---|
| 3847 | + if (source == allParamsButton) |
---|
2898 | 3848 | { |
---|
2899 | 3849 | assert(copy == group); |
---|
2900 | 3850 | |
---|
2901 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3851 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2902 | 3852 | |
---|
2903 | 3853 | for (Object3D obj : listUI) |
---|
2904 | 3854 | { |
---|
.. | .. |
---|
2915 | 3865 | |
---|
2916 | 3866 | refreshContents(true); |
---|
2917 | 3867 | } else |
---|
2918 | | - if (event.getSource() == unselectButton) |
---|
| 3868 | + if (source == unselectButton) |
---|
2919 | 3869 | { |
---|
2920 | 3870 | objEditor.jTree.clearSelection(); |
---|
2921 | 3871 | // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2922 | 3872 | objEditor.ResetSliders(); |
---|
2923 | 3873 | refreshContents(true); |
---|
2924 | 3874 | } else |
---|
2925 | | - if(event.getSource() instanceof cRadio) |
---|
| 3875 | + if(source instanceof cRadio) |
---|
2926 | 3876 | { |
---|
2927 | 3877 | group.parent = keepparent; |
---|
2928 | 3878 | group.attributes = 0; |
---|
2929 | 3879 | //group.editWindow = null; |
---|
2930 | | - /*cRadio*/ radio = (cRadio)event.getSource(); |
---|
| 3880 | + /*cRadio*/ radio = (cRadio)source; |
---|
2931 | 3881 | Object3D obj = radio.GetObject(); |
---|
2932 | 3882 | System.out.println("Edit " + obj); |
---|
2933 | 3883 | if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite) |
---|
.. | .. |
---|
2947 | 3897 | } |
---|
2948 | 3898 | |
---|
2949 | 3899 | copy = group; |
---|
| 3900 | + |
---|
| 3901 | + SetUndoStates(); |
---|
| 3902 | + |
---|
2950 | 3903 | //Globals.theRenderer.object = group; |
---|
2951 | 3904 | if(!useclient) |
---|
2952 | 3905 | { |
---|
.. | .. |
---|
2962 | 3915 | frontView.object = group; |
---|
2963 | 3916 | sideView.object = group; |
---|
2964 | 3917 | } |
---|
2965 | | - group.editWindow = this; |
---|
| 3918 | + |
---|
| 3919 | +// fix "+" issue |
---|
| 3920 | + //group.editWindow = this; |
---|
| 3921 | + group.manipWindow = this; |
---|
| 3922 | + |
---|
2966 | 3923 | /* |
---|
2967 | 3924 | currentLayout = radio.layout; |
---|
2968 | 3925 | if (currentLayout == null) |
---|
2969 | 3926 | currentLayout = sevenButton; |
---|
2970 | 3927 | */ |
---|
2971 | 3928 | radio.layout.doClick(); |
---|
| 3929 | + |
---|
| 3930 | + ClearUnpinned(); |
---|
| 3931 | + //Grafreed.Assert(group != null); |
---|
| 3932 | + //Grafreed.Assert(group.selection != null); |
---|
| 3933 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3934 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3935 | + EditSelection(false); |
---|
2972 | 3936 | keepparent = group.parent; |
---|
2973 | 3937 | // PARENT = NULL or not??? |
---|
2974 | 3938 | //group.parent = null; // ROOT |
---|
2975 | 3939 | //group.attributes = -1; |
---|
2976 | 3940 | ResetModel(); |
---|
| 3941 | + |
---|
| 3942 | + cameraView.requestFocusInWindow(); |
---|
2977 | 3943 | refreshContents(true); |
---|
2978 | | - } |
---|
| 3944 | + } else if (event.getSource() == editCameraItem) |
---|
| 3945 | + { |
---|
| 3946 | + cameraView.ProtectCamera(); |
---|
| 3947 | + cameraView.repaint(); |
---|
| 3948 | + return; |
---|
| 3949 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3950 | + { |
---|
| 3951 | + cameraView.RevertCamera(); |
---|
| 3952 | + cameraView.repaint(); |
---|
| 3953 | + return; |
---|
| 3954 | + // } else if (event.getSource() == textureButton) |
---|
| 3955 | + // { |
---|
| 3956 | + // return; // true; |
---|
| 3957 | + } |
---|
2979 | 3958 | else |
---|
2980 | 3959 | { |
---|
2981 | 3960 | //return super.action(event, arg); |
---|
.. | .. |
---|
2984 | 3963 | } |
---|
2985 | 3964 | |
---|
2986 | 3965 | boolean useclient = false; |
---|
2987 | | - cRadio radio; |
---|
2988 | 3966 | |
---|
2989 | 3967 | void ToggleRoot() |
---|
2990 | 3968 | { |
---|
.. | .. |
---|
3036 | 4014 | refreshContents(); |
---|
3037 | 4015 | } |
---|
3038 | 4016 | |
---|
| 4017 | + void TransformChildren() |
---|
| 4018 | + { |
---|
| 4019 | + Object3D obj; |
---|
| 4020 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4021 | + { |
---|
| 4022 | + obj = (Object3D)e.nextElement(); |
---|
| 4023 | + obj.KeepTextureMatrices(); |
---|
| 4024 | + obj.TransformChildren(); |
---|
| 4025 | + obj.RestoreTextureMatrices(); |
---|
| 4026 | + |
---|
| 4027 | +// if (obj.parent == null) |
---|
| 4028 | +// { |
---|
| 4029 | +// System.out.println("NULL PARENT!"); |
---|
| 4030 | +// new Exception().printStackTrace(); |
---|
| 4031 | +// } |
---|
| 4032 | +// else |
---|
| 4033 | +// TouchTransform(obj); |
---|
| 4034 | +// //obj.parent.Touch(); |
---|
| 4035 | + } |
---|
| 4036 | + |
---|
| 4037 | + refreshContents(); |
---|
| 4038 | + } |
---|
3039 | 4039 | |
---|
3040 | 4040 | void ResetTransform() |
---|
3041 | 4041 | { |
---|
.. | .. |
---|
3148 | 4148 | refreshContents(); |
---|
3149 | 4149 | } |
---|
3150 | 4150 | |
---|
3151 | | - void ResetCentroid() |
---|
| 4151 | + void ResetCentroid(boolean full) |
---|
3152 | 4152 | { |
---|
3153 | 4153 | Object3D obj; |
---|
3154 | 4154 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3163 | 4163 | LA.matIdentity(Object3D.mat); |
---|
3164 | 4164 | obj.getBounds(minima, maxima, false); |
---|
3165 | 4165 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3166 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 4166 | + if (full) |
---|
| 4167 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3167 | 4168 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3168 | 4169 | obj.TransformMesh(Object3D.mat); |
---|
| 4170 | + |
---|
3169 | 4171 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3170 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 4172 | + if (full) |
---|
| 4173 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3171 | 4174 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 4175 | + |
---|
3172 | 4176 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3173 | 4177 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3174 | 4178 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3197 | 4201 | |
---|
3198 | 4202 | int size = obj.MemorySize(); |
---|
3199 | 4203 | |
---|
3200 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4204 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4205 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3201 | 4206 | } |
---|
3202 | 4207 | } |
---|
3203 | 4208 | catch (Exception e) |
---|
.. | .. |
---|
3234 | 4239 | obj = (Object3D)e.nextElement(); |
---|
3235 | 4240 | |
---|
3236 | 4241 | System.out.println("Object is: " + obj); |
---|
3237 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 4242 | + Grafreed.AnalyzeObject(obj); |
---|
3238 | 4243 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3239 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 4244 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3240 | 4245 | |
---|
3241 | 4246 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3242 | 4247 | } |
---|
.. | .. |
---|
3278 | 4283 | void GenNormals(boolean crease) |
---|
3279 | 4284 | { |
---|
3280 | 4285 | group.GenNormalsS(crease); |
---|
| 4286 | + |
---|
| 4287 | + refreshContents(); |
---|
| 4288 | + } |
---|
| 4289 | + |
---|
| 4290 | + void GenNormalsMESH() |
---|
| 4291 | + { |
---|
| 4292 | + group.GenNormalsMeshS(); |
---|
3281 | 4293 | |
---|
3282 | 4294 | refreshContents(); |
---|
3283 | 4295 | } |
---|
.. | .. |
---|
3450 | 4462 | |
---|
3451 | 4463 | void ParseVertices() |
---|
3452 | 4464 | { |
---|
3453 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3454 | | - GrafreeD.epsequal = true; |
---|
| 4465 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4466 | + Grafreed.epsequal = true; |
---|
3455 | 4467 | |
---|
3456 | 4468 | for (int i=0; i<group.selection.size(); i++) |
---|
3457 | 4469 | { |
---|
.. | .. |
---|
3476 | 4488 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3477 | 4489 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3478 | 4490 | |
---|
3479 | | - g.add(GrafreeD.clipboard); |
---|
| 4491 | + g.add(Grafreed.clipboard); |
---|
3480 | 4492 | |
---|
3481 | 4493 | buffer.add(g); |
---|
3482 | 4494 | } |
---|
.. | .. |
---|
3491 | 4503 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3492 | 4504 | } |
---|
3493 | 4505 | |
---|
3494 | | - GrafreeD.epsequal = epsequal; |
---|
| 4506 | + Grafreed.epsequal = epsequal; |
---|
3495 | 4507 | |
---|
3496 | 4508 | refreshContents(); |
---|
3497 | 4509 | } |
---|
.. | .. |
---|
3509 | 4521 | String pigment = Object3D.GetPigment(tex); |
---|
3510 | 4522 | //String bump = Object3D.GetBump(tex); |
---|
3511 | 4523 | |
---|
3512 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4524 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4525 | + |
---|
| 4526 | + try |
---|
| 4527 | + { |
---|
| 4528 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
| 4529 | + } |
---|
| 4530 | + catch (Exception e) |
---|
| 4531 | + { |
---|
| 4532 | + System.err.println("FAIL: " + node); |
---|
| 4533 | + } |
---|
3513 | 4534 | |
---|
3514 | 4535 | double s = v.s; |
---|
3515 | 4536 | |
---|
.. | .. |
---|
3597 | 4618 | |
---|
3598 | 4619 | SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY); |
---|
3599 | 4620 | |
---|
3600 | | - boolean random = CameraPane.RANDOM; |
---|
3601 | | - CameraPane.RANDOM = false; // parse all random nodes |
---|
| 4621 | + boolean random = CameraPane.SWITCH; |
---|
| 4622 | + CameraPane.SWITCH = false; // parse all random nodes |
---|
3602 | 4623 | lowres.linkVerticesThis(null); |
---|
3603 | 4624 | lowres.linkVerticesThis(sn); |
---|
3604 | | - CameraPane.RANDOM = random; |
---|
| 4625 | + CameraPane.SWITCH = random; |
---|
3605 | 4626 | |
---|
3606 | 4627 | System.err.flush(); |
---|
3607 | 4628 | |
---|
.. | .. |
---|
3641 | 4662 | return; |
---|
3642 | 4663 | |
---|
3643 | 4664 | Object3D poses = group.selection.get(0); |
---|
3644 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4665 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3645 | 4666 | |
---|
3646 | 4667 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3647 | 4668 | |
---|
.. | .. |
---|
3835 | 4856 | |
---|
3836 | 4857 | void ClipMesh() |
---|
3837 | 4858 | { |
---|
3838 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4859 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3839 | 4860 | { |
---|
3840 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4861 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3841 | 4862 | |
---|
3842 | 4863 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3843 | 4864 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3846 | 4867 | // { |
---|
3847 | 4868 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3848 | 4869 | // } |
---|
3849 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4870 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3850 | 4871 | } |
---|
3851 | 4872 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3852 | 4873 | System.out.println("DONE."); |
---|
.. | .. |
---|
3893 | 4914 | void MarkLeaves(boolean hide) |
---|
3894 | 4915 | { |
---|
3895 | 4916 | group.selection.MarkLeaves(hide); |
---|
| 4917 | + refreshContents(); |
---|
| 4918 | + } |
---|
| 4919 | + |
---|
| 4920 | + void RewindLeaves(boolean hide) |
---|
| 4921 | + { |
---|
| 4922 | + group.selection.RewindLeaves(hide); |
---|
| 4923 | + refreshContents(); |
---|
| 4924 | + } |
---|
| 4925 | + |
---|
| 4926 | + void RandomLeaves(boolean hide) |
---|
| 4927 | + { |
---|
| 4928 | + group.selection.RandomLeaves(hide); |
---|
3896 | 4929 | refreshContents(); |
---|
3897 | 4930 | } |
---|
3898 | 4931 | |
---|
.. | .. |
---|
3967 | 5000 | // } |
---|
3968 | 5001 | // } |
---|
3969 | 5002 | |
---|
3970 | | - static boolean allparams = true; |
---|
3971 | | - |
---|
3972 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
3973 | | - |
---|
3974 | 5003 | void EditSelection(boolean newWindow) |
---|
3975 | 5004 | { |
---|
| 5005 | + if (group.selection == null) |
---|
| 5006 | + { |
---|
| 5007 | + EditElement(group, newWindow); // ? new |
---|
| 5008 | + return; |
---|
| 5009 | + } |
---|
| 5010 | + |
---|
3976 | 5011 | // aConstraints.gridy = 0; |
---|
3977 | 5012 | for (int i=0; i<group.selection.size(); i++) |
---|
3978 | 5013 | { |
---|
3979 | 5014 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
3980 | 5015 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
3981 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 5016 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3982 | 5017 | |
---|
3983 | 5018 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
3984 | | - if(elem != group) |
---|
| 5019 | + if(elem != group || !newWindow) |
---|
3985 | 5020 | { |
---|
3986 | | - // if (!(elem instanceof Composite)) |
---|
3987 | | - // newWindow = false; |
---|
3988 | | - listUI.add(elem); |
---|
3989 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
3990 | | - System.out.println("edit : " + elem); |
---|
3991 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5021 | + EditElement(elem, newWindow); // ? new |
---|
3992 | 5022 | } |
---|
3993 | 5023 | } |
---|
3994 | 5024 | } |
---|
.. | .. |
---|
4063 | 5093 | //new Exception().printStackTrace(); |
---|
4064 | 5094 | |
---|
4065 | 5095 | freezemodel = true; |
---|
4066 | | - |
---|
| 5096 | + ClearUnpinned(); |
---|
| 5097 | + |
---|
4067 | 5098 | /**/ |
---|
4068 | 5099 | //switch (event.id) |
---|
4069 | 5100 | { |
---|
.. | .. |
---|
4071 | 5102 | //case 702: // Event.LIST_DESELECT |
---|
4072 | 5103 | group.deselectAll(); |
---|
4073 | 5104 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4074 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4075 | 5105 | if (tps != null) |
---|
4076 | 5106 | { |
---|
4077 | 5107 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4080 | 5110 | |
---|
4081 | 5111 | //if (child.parent != null) |
---|
4082 | 5112 | //child.parent.addSelectee(child); |
---|
| 5113 | + objEditor.SetMaterial(child); |
---|
4083 | 5114 | group.addSelectee(child); |
---|
4084 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4085 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4086 | | - System.err.println("info : " + child.GetPath()); |
---|
4087 | 5115 | } |
---|
4088 | 5116 | } |
---|
4089 | | - else |
---|
4090 | | - { |
---|
4091 | | - objEditor.SetMaterial(group); // .GetMaterial()); |
---|
4092 | | - objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
4093 | | - System.err.println("info : " + group.GetPath()); |
---|
4094 | | - } |
---|
| 5117 | +// else |
---|
| 5118 | +// { |
---|
| 5119 | +// objEditor.SetMaterial(group); // .GetMaterial()); |
---|
| 5120 | +// objEditor.AddInfo(group, this, true); // .GetMaterial()); |
---|
| 5121 | +// System.err.println("info : " + group.GetPath()); |
---|
| 5122 | +// } |
---|
4095 | 5123 | |
---|
4096 | | - objEditor.SetText(); // jan 2014 |
---|
4097 | | - |
---|
4098 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 5124 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4099 | 5125 | CameraPane.flash = true; |
---|
4100 | 5126 | |
---|
4101 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 5127 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4102 | 5128 | // a camera |
---|
4103 | 5129 | { |
---|
4104 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4105 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5130 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5131 | + { |
---|
| 5132 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 5133 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5134 | + } |
---|
4106 | 5135 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4107 | 5136 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4108 | 5137 | } |
---|
4109 | 5138 | |
---|
| 5139 | + if (tps != null && tps.length == 1) |
---|
| 5140 | + { |
---|
| 5141 | + EditSelection(false); |
---|
| 5142 | + } |
---|
| 5143 | + |
---|
| 5144 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5145 | + |
---|
4110 | 5146 | refreshContents(); |
---|
4111 | 5147 | //return true; |
---|
4112 | 5148 | } |
---|
.. | .. |
---|
4115 | 5151 | |
---|
4116 | 5152 | freezemodel = false; |
---|
4117 | 5153 | } |
---|
| 5154 | + |
---|
| 5155 | + void SetPinStates(boolean enabled) |
---|
| 5156 | + { |
---|
| 5157 | + editButton.setEnabled(enabled); |
---|
| 5158 | + uneditButton.setEnabled(enabled); |
---|
| 5159 | + unselectButton.setEnabled(enabled); |
---|
| 5160 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5161 | + } |
---|
| 5162 | + |
---|
| 5163 | + void refreshContents(boolean cp) |
---|
| 5164 | + { |
---|
| 5165 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5166 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 5167 | + { |
---|
| 5168 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 5169 | + |
---|
| 5170 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 5171 | + { |
---|
| 5172 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 5173 | + |
---|
| 5174 | + objEditor.AddInfo(child, this, true); |
---|
| 5175 | + System.err.println("info : " + child.GetPath()); |
---|
| 5176 | + } |
---|
| 5177 | + |
---|
| 5178 | + objEditor.SetText(); // jan 2014 |
---|
| 5179 | + } |
---|
| 5180 | + |
---|
| 5181 | + super.refreshContents(cp); |
---|
| 5182 | + } |
---|
4118 | 5183 | |
---|
4119 | 5184 | void linkSomething(Object3D thing) |
---|
4120 | 5185 | { |
---|
.. | .. |
---|
4186 | 5251 | { |
---|
4187 | 5252 | if (group.selection.isEmpty()) |
---|
4188 | 5253 | return; |
---|
4189 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 5254 | + |
---|
| 5255 | + Grafreed.clipboardIsTempGroup = false; |
---|
4190 | 5256 | Composite tGroup = null; |
---|
4191 | 5257 | if (group.selection.size() > 0) // 1) |
---|
4192 | 5258 | { |
---|
4193 | 5259 | tGroup = new cGroup(); |
---|
4194 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 5260 | + Grafreed.clipboardIsTempGroup = true; |
---|
4195 | 5261 | } |
---|
4196 | 5262 | |
---|
4197 | 5263 | if (cut) |
---|
4198 | 5264 | { |
---|
| 5265 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5266 | +// Save(); |
---|
4199 | 5267 | //int indices[] = jList.getSelectedIndices(); |
---|
4200 | 5268 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4201 | 5269 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4231 | 5299 | //System.out.println("cut " + child); |
---|
4232 | 5300 | //System.out.println("parent = " + child.parent); |
---|
4233 | 5301 | // tmp.addChild(child); |
---|
4234 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5302 | + if (Grafreed.clipboardIsTempGroup) |
---|
4235 | 5303 | tGroup.add/*Child*/(tmp); |
---|
4236 | 5304 | else |
---|
4237 | | - GrafreeD.clipboard = tmp; |
---|
| 5305 | + Grafreed.clipboard = tmp; |
---|
4238 | 5306 | } |
---|
4239 | 5307 | else |
---|
4240 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5308 | + if (Grafreed.clipboardIsTempGroup) |
---|
4241 | 5309 | tGroup.add/*Child*/(child); |
---|
4242 | 5310 | else |
---|
4243 | | - GrafreeD.clipboard = child; |
---|
| 5311 | + Grafreed.clipboard = child; |
---|
4244 | 5312 | } |
---|
4245 | 5313 | |
---|
4246 | 5314 | //ResetModel(); |
---|
.. | .. |
---|
4272 | 5340 | //System.out.println("cut " + elem); |
---|
4273 | 5341 | //System.out.println("parent = " + elem.parent); |
---|
4274 | 5342 | // tmp.addChild(elem); |
---|
4275 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5343 | + if (Grafreed.clipboardIsTempGroup) |
---|
4276 | 5344 | tGroup.add/*Child*/(tmp); |
---|
4277 | 5345 | else |
---|
4278 | | - GrafreeD.clipboard = tmp; |
---|
| 5346 | + Grafreed.clipboard = tmp; |
---|
4279 | 5347 | } |
---|
4280 | 5348 | else |
---|
4281 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5349 | + if (Grafreed.clipboardIsTempGroup) |
---|
4282 | 5350 | tGroup.add/*Child*/(child); |
---|
4283 | 5351 | else |
---|
4284 | | - GrafreeD.clipboard = child; |
---|
| 5352 | + Grafreed.clipboard = child; |
---|
4285 | 5353 | } |
---|
4286 | 5354 | |
---|
4287 | 5355 | } |
---|
4288 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4289 | | - GrafreeD.clipboard = tGroup; |
---|
| 5356 | + |
---|
| 5357 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 5358 | + Grafreed.clipboard = tGroup; |
---|
| 5359 | + |
---|
4290 | 5360 | if (cut) |
---|
4291 | 5361 | { |
---|
4292 | 5362 | ResetModel(); |
---|
.. | .. |
---|
4296 | 5366 | |
---|
4297 | 5367 | void paste(boolean expand) |
---|
4298 | 5368 | { |
---|
| 5369 | + if (Globals.REPLACEONMAKE) |
---|
| 5370 | + Save(); |
---|
| 5371 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5372 | + Globals.REPLACEONMAKE = false; |
---|
4299 | 5373 | // if (GrafreeD.clipboard == null) |
---|
4300 | 5374 | // return; |
---|
4301 | 5375 | boolean first = true; |
---|
4302 | 5376 | |
---|
4303 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5377 | + if (Grafreed.clipboardIsTempGroup) |
---|
4304 | 5378 | { |
---|
4305 | 5379 | Composite temp; |
---|
4306 | 5380 | |
---|
.. | .. |
---|
4311 | 5385 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4312 | 5386 | */ |
---|
4313 | 5387 | Object3D elem; |
---|
4314 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5388 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4315 | 5389 | { |
---|
4316 | 5390 | Object3D child = (Object3D)e.nextElement(); |
---|
4317 | 5391 | |
---|
.. | .. |
---|
4345 | 5419 | //Object3D cb = Applet3D.clipboard; |
---|
4346 | 5420 | //temp.addChild(cb); |
---|
4347 | 5421 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4348 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4349 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4350 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4351 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4352 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5422 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5423 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5424 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5425 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5426 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4353 | 5427 | else |
---|
4354 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4355 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5428 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5429 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4356 | 5430 | } |
---|
4357 | 5431 | |
---|
| 5432 | + Globals.REPLACEONMAKE = keep; |
---|
4358 | 5433 | ResetModel(); |
---|
4359 | 5434 | refreshContents(); |
---|
4360 | 5435 | } |
---|
4361 | 5436 | |
---|
4362 | | - void pasteInto(boolean copyit) |
---|
| 5437 | + void pasteInto(boolean copyit, boolean clone) |
---|
4363 | 5438 | { |
---|
4364 | 5439 | // if (GrafreeD.clipboard == null) |
---|
4365 | 5440 | // return; |
---|
.. | .. |
---|
4388 | 5463 | if (copyit) |
---|
4389 | 5464 | { |
---|
4390 | 5465 | // paste(false); |
---|
4391 | | - CloneClipboard(false); // sept 2014 |
---|
| 5466 | + if (clone) |
---|
| 5467 | + { |
---|
| 5468 | + CloneClipboard(false); // sept 2014 |
---|
| 5469 | + } |
---|
| 5470 | + else |
---|
| 5471 | + { |
---|
| 5472 | + paste(false); |
---|
| 5473 | + } |
---|
4392 | 5474 | } |
---|
4393 | 5475 | else |
---|
4394 | 5476 | { |
---|
4395 | 5477 | boolean first = true; |
---|
4396 | 5478 | |
---|
4397 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5479 | + if (Grafreed.clipboardIsTempGroup) |
---|
4398 | 5480 | { |
---|
4399 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5481 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4400 | 5482 | Object3D copy; |
---|
4401 | 5483 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4402 | 5484 | { |
---|
.. | .. |
---|
4406 | 5488 | } |
---|
4407 | 5489 | } else |
---|
4408 | 5490 | { |
---|
4409 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5491 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4410 | 5492 | } |
---|
4411 | 5493 | } |
---|
4412 | 5494 | } |
---|
.. | .. |
---|
4483 | 5565 | |
---|
4484 | 5566 | void group(Object3D csg, boolean grab) |
---|
4485 | 5567 | { |
---|
| 5568 | + if (Globals.REPLACEONMAKE) |
---|
| 5569 | + Save(); |
---|
| 5570 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5571 | + Globals.REPLACEONMAKE = false; |
---|
4486 | 5572 | if (//false) // why?? |
---|
4487 | 5573 | !group.selection.isEmpty()) |
---|
4488 | 5574 | { |
---|
.. | .. |
---|
4596 | 5682 | //node.add(csg); |
---|
4597 | 5683 | //makeSomething(node); |
---|
4598 | 5684 | makeSomething(csg); |
---|
| 5685 | + Globals.REPLACEONMAKE = keep; |
---|
4599 | 5686 | } |
---|
4600 | 5687 | |
---|
4601 | 5688 | void Ungroup(Object3D g) |
---|
4602 | 5689 | { |
---|
| 5690 | + if (Globals.REPLACEONMAKE) |
---|
| 5691 | + Save(); |
---|
| 5692 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5693 | + Globals.REPLACEONMAKE = false; |
---|
4603 | 5694 | if (g instanceof HiddenObject) |
---|
4604 | 5695 | { |
---|
4605 | 5696 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4616 | 5707 | objEditor.makeSomething(g.get(i), false); |
---|
4617 | 5708 | } |
---|
4618 | 5709 | } |
---|
| 5710 | + Globals.REPLACEONMAKE = keep; |
---|
4619 | 5711 | } |
---|
4620 | 5712 | |
---|
4621 | 5713 | void ungroup() |
---|
.. | .. |
---|
4811 | 5903 | } |
---|
4812 | 5904 | */ |
---|
4813 | 5905 | |
---|
4814 | | - void ImportGFD() |
---|
4815 | | - { |
---|
4816 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4817 | | - browser.show(); |
---|
4818 | | - String filename = browser.getFile(); |
---|
4819 | | - if (filename != null && filename.length() > 0) |
---|
4820 | | - { |
---|
4821 | | - String fullname = browser.getDirectory() + filename; |
---|
4822 | | - |
---|
4823 | | - //Object3D readobj = |
---|
4824 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4825 | | - //makeSomething(readobj); |
---|
4826 | | - } |
---|
4827 | | - } |
---|
4828 | | - |
---|
4829 | 5906 | /* |
---|
4830 | 5907 | public void Callback(Object obj) |
---|
4831 | 5908 | { |
---|
.. | .. |
---|
4849 | 5926 | } |
---|
4850 | 5927 | */ |
---|
4851 | 5928 | |
---|
4852 | | - void ImportVRMLX3D() |
---|
4853 | | - { |
---|
4854 | | - if (GrafreeD.standAlone) |
---|
4855 | | - { |
---|
4856 | | - /**/ |
---|
4857 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4858 | | - browser.show(); |
---|
4859 | | - String filename = browser.getFile(); |
---|
4860 | | - if (filename != null && filename.length() > 0) |
---|
4861 | | - { |
---|
4862 | | - String fullname = browser.getDirectory() + filename; |
---|
4863 | | - LoadVRMLX3D(fullname); |
---|
4864 | | - } |
---|
4865 | | - /**/ |
---|
4866 | | - } |
---|
4867 | | - } |
---|
4868 | | - |
---|
4869 | 5929 | String GetFile(String dialogName) |
---|
4870 | 5930 | { |
---|
4871 | | - if (GrafreeD.standAlone) |
---|
| 5931 | + if (Grafreed.standAlone) |
---|
4872 | 5932 | { |
---|
4873 | 5933 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4874 | 5934 | browser.show(); |
---|
.. | .. |
---|
4932 | 5992 | cButton flashSelectionButton; |
---|
4933 | 5993 | cButton editButton; |
---|
4934 | 5994 | cButton uneditButton; |
---|
| 5995 | + JCheckBox allParamsButton; |
---|
4935 | 5996 | cButton clearpanelButton; |
---|
4936 | | - cButton allParamsButton; |
---|
4937 | 5997 | cButton unselectButton; |
---|
4938 | 5998 | |
---|
| 5999 | + cButton restoreCameraButton; |
---|
| 6000 | + |
---|
| 6001 | + cButton saveButton; |
---|
| 6002 | + cButton oneStepButton; |
---|
| 6003 | + |
---|
| 6004 | + cButton groupButton; |
---|
| 6005 | + cButton ungroupButton; |
---|
| 6006 | + cButton compositeButton; |
---|
| 6007 | + cButton switchButton; |
---|
| 6008 | + cButton loopButton; |
---|
| 6009 | + cButton textureButton; |
---|
| 6010 | + |
---|
| 6011 | + cButton skybox1Button; |
---|
| 6012 | + cButton skybox2Button; |
---|
| 6013 | + cButton skybox3Button; |
---|
| 6014 | + cButton skybox4Button; |
---|
| 6015 | + cButton skybox5Button; |
---|
| 6016 | + cButton skybox6Button; |
---|
| 6017 | + cButton skybox7Button; |
---|
| 6018 | + |
---|
| 6019 | + cButton skybox11Button; |
---|
| 6020 | + cButton skybox12Button; |
---|
| 6021 | + cButton skybox13Button; |
---|
| 6022 | + cButton skybox14Button; |
---|
| 6023 | + cButton skybox15Button; |
---|
| 6024 | + cButton skybox16Button; |
---|
| 6025 | + cButton skybox17Button; |
---|
| 6026 | + |
---|
| 6027 | + cButton gridButton; |
---|
| 6028 | + cButton boxButton; |
---|
| 6029 | + cButton sphereButton; |
---|
| 6030 | + cButton coneButton; |
---|
| 6031 | + cButton torusButton; |
---|
| 6032 | + cButton superButton; |
---|
| 6033 | + cButton kleinButton; |
---|
| 6034 | + cButton particlesButton; |
---|
| 6035 | + cButton overlayButton; |
---|
| 6036 | + cButton lightButton; |
---|
| 6037 | + |
---|
4939 | 6038 | cButton screenfitButton; |
---|
4940 | 6039 | cButton screenfitpointButton; |
---|
4941 | 6040 | cButton snapobjectButton; |
---|
.. | .. |
---|
4947 | 6046 | |
---|
4948 | 6047 | cButton setsupportButton; |
---|
4949 | 6048 | |
---|
4950 | | - cButton twoButton; |
---|
4951 | | - cButton sixButton; |
---|
4952 | | - cButton threeButton; |
---|
4953 | | - cButton sevenButton; |
---|
4954 | | - cButton fourButton; // full panel |
---|
4955 | | - cButton oneButton; // full XYZ |
---|
4956 | | - //cButton currentLayout; |
---|
4957 | | - |
---|
4958 | 6049 | // |
---|
4959 | 6050 | //Composite |
---|
4960 | 6051 | Object3D // to do !! |
---|
.. | .. |
---|
4964 | 6055 | //JTree jTree; |
---|
4965 | 6056 | private MenuItem lookAtItem; |
---|
4966 | 6057 | private MenuItem lookFromItem; |
---|
4967 | | - private MenuItem switchItem; |
---|
| 6058 | + private MenuItem switchViewItem; |
---|
4968 | 6059 | private MenuItem cutItem; |
---|
4969 | | - private MenuItem duplicateItem; |
---|
| 6060 | + private MenuItem undoItem; |
---|
| 6061 | + private MenuItem redoItem; |
---|
| 6062 | + private JMenuItem duplicateItem; |
---|
4970 | 6063 | private MenuItem cloneItem; |
---|
4971 | 6064 | private MenuItem cloneSupportItem; |
---|
4972 | 6065 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
4979 | 6072 | private MenuItem linkverticesItem; |
---|
4980 | 6073 | private MenuItem relinkverticesItem; |
---|
4981 | 6074 | private MenuItem setMasterItem; |
---|
4982 | | - private MenuItem resetMeshItem; |
---|
| 6075 | + private MenuItem resetAllItem; |
---|
4983 | 6076 | private MenuItem stepAllItem; |
---|
4984 | 6077 | private MenuItem revertMeshItem; |
---|
4985 | 6078 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
4990 | 6083 | private MenuItem mergeGeometriesItem; |
---|
4991 | 6084 | private MenuItem copyItem; |
---|
4992 | 6085 | private MenuItem pasteItem; |
---|
| 6086 | + private MenuItem pasteIntoItem; |
---|
4993 | 6087 | private MenuItem pasteLinkItem; |
---|
4994 | 6088 | private MenuItem pasteCloneItem; |
---|
4995 | 6089 | private MenuItem pasteExpandItem; |
---|
4996 | | - private MenuItem clearItem; |
---|
| 6090 | + private MenuItem deleteItem; |
---|
4997 | 6091 | private MenuItem clearAllItem; |
---|
4998 | 6092 | private MenuItem genUVItem; |
---|
4999 | 6093 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5028 | 6122 | private MenuItem showleavesItem; |
---|
5029 | 6123 | private MenuItem markleavesItem; |
---|
5030 | 6124 | private MenuItem unmarkleavesItem; |
---|
| 6125 | + private MenuItem rewindleavesItem; |
---|
| 6126 | + private MenuItem unrewindleavesItem; |
---|
| 6127 | + private MenuItem randomleavesItem; |
---|
| 6128 | + private MenuItem unrandomleavesItem; |
---|
5031 | 6129 | |
---|
5032 | 6130 | private MenuItem flipVItem; |
---|
5033 | 6131 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5039 | 6137 | private MenuItem panoTexturesItem; |
---|
5040 | 6138 | |
---|
5041 | 6139 | private MenuItem resetCentroidItem; |
---|
5042 | | - private MenuItem transformgeometryItem; |
---|
| 6140 | + private MenuItem resetCentroidXZItem; |
---|
5043 | 6141 | private MenuItem resetTransformItem; |
---|
| 6142 | + private MenuItem transformGeometryItem; |
---|
| 6143 | + private MenuItem transformChildrenItem; |
---|
5044 | 6144 | private MenuItem hideItem; |
---|
5045 | 6145 | private MenuItem grabItem; |
---|
5046 | 6146 | private MenuItem backItem; |
---|
5047 | 6147 | private MenuItem frontItem; |
---|
5048 | 6148 | private MenuItem cameraItem; |
---|
5049 | 6149 | private MenuItem compositeItem; |
---|
5050 | | - private MenuItem randomItem; |
---|
| 6150 | + private MenuItem switchItem; |
---|
5051 | 6151 | private MenuItem physicsItem; |
---|
5052 | 6152 | private MenuItem frameselectorItem; |
---|
5053 | 6153 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5071 | 6171 | private MenuItem attachBumpItem; |
---|
5072 | 6172 | private MenuItem detachBumpItem; |
---|
5073 | 6173 | private MenuItem pigmentBumpItem; |
---|
| 6174 | + private MenuItem embedTexturesItem; |
---|
| 6175 | + private MenuItem deEmbedTexturesItem; |
---|
5074 | 6176 | |
---|
5075 | 6177 | private MenuItem particleItem; |
---|
5076 | 6178 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5087 | 6189 | private MenuItem blobItem; |
---|
5088 | 6190 | private MenuItem latheItem; |
---|
5089 | 6191 | private MenuItem bezierItem; |
---|
5090 | | - private MenuItem checkerItem; |
---|
| 6192 | + private MenuItem overlayItem; |
---|
5091 | 6193 | private MenuItem meshItem; |
---|
5092 | 6194 | // private MenuItem meshGroupItem; |
---|
5093 | 6195 | private MenuItem springItem; |
---|
.. | .. |
---|
5109 | 6211 | private MenuItem doubleItem; |
---|
5110 | 6212 | private MenuItem tripleItem; |
---|
5111 | 6213 | |
---|
5112 | | - private MenuItem importGFDItem; |
---|
5113 | | - private MenuItem importVRMLX3DItem; |
---|
5114 | | - private MenuItem import3DSItem; |
---|
5115 | | - private MenuItem importOBJItem; |
---|
5116 | | - |
---|
5117 | 6214 | private MenuItem computeAOItem; |
---|
5118 | 6215 | private MenuItem recompileItem; |
---|
5119 | 6216 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5123 | 6220 | private MenuItem analyzeItem; |
---|
5124 | 6221 | private MenuItem dumpItem; |
---|
5125 | 6222 | //boolean freezemodel = false; |
---|
| 6223 | + |
---|
| 6224 | + Menu cameraMenu; |
---|
| 6225 | + MenuItem editCameraItem; |
---|
| 6226 | + MenuItem restoreCameraItem; |
---|
5126 | 6227 | } |
---|