.. | .. |
---|
23 | 23 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 24 | ItemListener // ListSelectionListener |
---|
25 | 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 | + |
---|
26 | 322 | //ObjEditor objEditor; |
---|
27 | 323 | public void closeUI2() |
---|
28 | 324 | { |
---|
.. | .. |
---|
60 | 356 | this.copy = this.group = group; |
---|
61 | 357 | //selectees = this.group.selectees; |
---|
62 | 358 | |
---|
| 359 | + if (copy.versionlist == null) |
---|
| 360 | + { |
---|
| 361 | + copy.versionlist = new Object3D[100]; |
---|
| 362 | + copy.versionindex = -1; |
---|
| 363 | + } |
---|
| 364 | + |
---|
63 | 365 | if(ui) |
---|
64 | 366 | SetupUI(objEditor); |
---|
65 | 367 | } |
---|
.. | .. |
---|
74 | 376 | this.copy = this.group = copy; |
---|
75 | 377 | //selectees = this.group.selectees; |
---|
76 | 378 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 379 | + SetupMenu2(this); //objEditor); |
---|
78 | 380 | SetupUI2(objEditor); |
---|
79 | 381 | objEditor.SetupUI(true); |
---|
80 | 382 | SetupViews(objEditor); |
---|
81 | 383 | |
---|
82 | 384 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 385 | + |
---|
| 386 | + if (copy.versionlist == null) |
---|
| 387 | + { |
---|
| 388 | + copy.versionlist = new Object3D[100]; |
---|
| 389 | + copy.versionindex = -1; |
---|
| 390 | + |
---|
| 391 | + Save(true); |
---|
| 392 | + } |
---|
83 | 393 | } |
---|
84 | 394 | |
---|
85 | 395 | void CloneSelection(boolean supports) |
---|
86 | 396 | { |
---|
| 397 | + if (Globals.REPLACEONMAKE) |
---|
| 398 | + Save(); |
---|
| 399 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 400 | + Globals.REPLACEONMAKE = false; |
---|
87 | 401 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 402 | //Object3D obj; |
---|
89 | 403 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 408 | |
---|
95 | 409 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 410 | } |
---|
| 411 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 412 | } |
---|
98 | 413 | |
---|
99 | 414 | void CloneClipboard(boolean supports) |
---|
100 | 415 | { |
---|
101 | | - assert(GrafreeD.clipboard.parent == null); |
---|
102 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
103 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
104 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
105 | | - 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)); |
---|
106 | 421 | else |
---|
107 | | - makeSomething(CloneObject(GrafreeD.clipboard, false)); |
---|
108 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 422 | + makeSomething(CloneObject(Grafreed.clipboard, false)); |
---|
| 423 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
109 | 424 | } |
---|
110 | 425 | |
---|
111 | 426 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
119 | 434 | // obj.support = null; |
---|
120 | 435 | if (!supports) |
---|
121 | 436 | obj.SaveSupports(); |
---|
122 | | - Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
| 437 | + Object3D clone = (Object3D)Grafreed.clone(obj); |
---|
123 | 438 | obj.parent = parent; |
---|
124 | 439 | // obj.support = support; |
---|
125 | 440 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
148 | 463 | |
---|
149 | 464 | //JTextField nameField; |
---|
150 | 465 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 466 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 467 | { |
---|
153 | | - if (Globals.ADVANCED) |
---|
154 | | - { |
---|
155 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
156 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
157 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
158 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
159 | | - oe.cameraMenu.add("-"); |
---|
160 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
161 | | - openWindowItem.addActionListener(this); |
---|
162 | | - editLeafItem.addActionListener(this); |
---|
163 | | - lookAtItem.addActionListener(this); |
---|
164 | | - //lookFromItem.addActinoListener(this); |
---|
165 | | - //switchItem.addActionListener(this); |
---|
166 | | - } |
---|
167 | | - |
---|
| 468 | + oe.jTree = new cTree(); |
---|
| 469 | + |
---|
168 | 470 | Menu menu; |
---|
169 | 471 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 472 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 473 | //editItem.addActionListener(this); |
---|
172 | | - 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")); |
---|
173 | 481 | duplicateItem.addActionListener(this); |
---|
174 | 482 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
175 | 483 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
185 | 493 | copyItem.addActionListener(this); |
---|
186 | 494 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 495 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 496 | |
---|
190 | 497 | menu.add("-"); |
---|
191 | 498 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
197 | 504 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
198 | 505 | // pasteExpandItem.addActionListener(this); |
---|
199 | 506 | menu.add("-"); |
---|
200 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
201 | | - clearItem.addActionListener(this); |
---|
| 507 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 508 | + deleteItem.addActionListener(this); |
---|
202 | 509 | |
---|
203 | 510 | if (Globals.ADVANCED) |
---|
204 | 511 | { |
---|
.. | .. |
---|
206 | 513 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 514 | clearAllItem.addActionListener(this); |
---|
208 | 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()); |
---|
209 | 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 | + |
---|
210 | 604 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 605 | if (Globals.ADVANCED) |
---|
212 | 606 | { |
---|
213 | | - resetMeshItem = menu.add(new MenuItem("Reset All")); |
---|
214 | | - resetMeshItem.addActionListener(this); |
---|
215 | | - stepAllItem = menu.add(new MenuItem("Step All")); |
---|
216 | | - stepAllItem.addActionListener(this); |
---|
217 | 607 | revertMeshItem = menu.add(new MenuItem("Revert Meshes")); |
---|
218 | 608 | revertMeshItem.addActionListener(this); |
---|
219 | 609 | resetreferencesItem = menu.add(new MenuItem("Reset Mesh References")); |
---|
.. | .. |
---|
253 | 643 | } |
---|
254 | 644 | |
---|
255 | 645 | oe.menuBar.add(menu = new Menu("Group")); |
---|
256 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
257 | | - grabItem.addActionListener(this); |
---|
| 646 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 647 | +// grabItem.addActionListener(this); |
---|
258 | 648 | backItem = menu.add(new MenuItem("Back")); |
---|
259 | 649 | backItem.addActionListener(this); |
---|
260 | 650 | frontItem = menu.add(new MenuItem("Front")); |
---|
261 | 651 | frontItem.addActionListener(this); |
---|
262 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
263 | | - compositeItem.addActionListener(this); |
---|
| 652 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 653 | +// compositeItem.addActionListener(this); |
---|
| 654 | + |
---|
| 655 | + if (Globals.ADVANCED) |
---|
| 656 | + { |
---|
264 | 657 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
265 | 658 | hideItem.addActionListener(this); |
---|
| 659 | + } |
---|
266 | 660 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
267 | 661 | ungroupItem.addActionListener(this); |
---|
268 | | - menu.add("-"); |
---|
269 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
270 | | - randomItem.addActionListener(this); |
---|
| 662 | + |
---|
| 663 | +// menu.add("-"); |
---|
| 664 | +// |
---|
| 665 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 666 | +// switchItem.addActionListener(this); |
---|
| 667 | + if (Globals.ADVANCED) |
---|
| 668 | + { |
---|
271 | 669 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
272 | 670 | switchGeoItem.addActionListener(this); |
---|
273 | 671 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
275 | 673 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
276 | 674 | morphItem.addActionListener(this); |
---|
277 | 675 | |
---|
278 | | - if (Globals.ADVANCED) |
---|
279 | | - { |
---|
280 | 676 | menu.add("-"); |
---|
281 | 677 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
282 | 678 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
284 | 680 | frameselectorItem.addActionListener(this); |
---|
285 | 681 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
286 | 682 | scriptNodeItem.addActionListener(this); |
---|
287 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
288 | | - cameraItem.addActionListener(this); |
---|
289 | 683 | } |
---|
290 | 684 | |
---|
291 | 685 | oe.menuBar.add(menu = new Menu("Object")); |
---|
292 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
293 | | - textureItem.addActionListener(this); |
---|
| 686 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 687 | +// textureItem.addActionListener(this); |
---|
294 | 688 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
295 | 689 | billboardItem.addActionListener(this); |
---|
296 | 690 | csgItem = menu.add(new MenuItem("CSG")); |
---|
297 | 691 | csgItem.addActionListener(this); |
---|
298 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 692 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
299 | 693 | shadowXItem.addActionListener(this); |
---|
300 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 694 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
301 | 695 | shadowYItem.addActionListener(this); |
---|
302 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 696 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
303 | 697 | shadowZItem.addActionListener(this); |
---|
| 698 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 699 | + attributeItem.addActionListener(this); |
---|
| 700 | + |
---|
304 | 701 | if (Globals.ADVANCED) |
---|
305 | 702 | { |
---|
306 | 703 | menu.add("-"); |
---|
307 | 704 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
308 | 705 | linkerItem.addActionListener(this); |
---|
309 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
310 | | - attributeItem.addActionListener(this); |
---|
311 | 706 | templateItem = menu.add(new MenuItem("Template")); |
---|
312 | 707 | templateItem.addActionListener(this); |
---|
313 | 708 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
318 | 713 | resetTransformItem.addActionListener(this); |
---|
319 | 714 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
320 | 715 | resetCentroidItem.addActionListener(this); |
---|
321 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
322 | | - 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); |
---|
323 | 722 | |
---|
324 | 723 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
325 | 724 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
332 | 731 | genNormalsMESHItem.addActionListener(this); |
---|
333 | 732 | if (Globals.ADVANCED) |
---|
334 | 733 | { |
---|
335 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 734 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
336 | 735 | genNormalsMINEItem.addActionListener(this); |
---|
337 | 736 | } |
---|
338 | 737 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
368 | 767 | oe.menuBar.add(menu = new Menu("Attributes")); |
---|
369 | 768 | clearMaterialsItem = menu.add(new MenuItem("Clear Materials")); |
---|
370 | 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); |
---|
371 | 774 | menu.add("-"); |
---|
372 | 775 | liveleavesItem = menu.add(new MenuItem("Live Leaves")); |
---|
373 | 776 | liveleavesItem.addActionListener(this); |
---|
.. | .. |
---|
388 | 791 | markleavesItem.addActionListener(this); |
---|
389 | 792 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
390 | 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); |
---|
391 | 802 | menu.add("-"); |
---|
392 | 803 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
393 | 804 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
413 | 824 | attachBumpItem.addActionListener(this); |
---|
414 | 825 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
415 | 826 | pigmentBumpItem.addActionListener(this); |
---|
| 827 | + //embedTexturesItem |
---|
416 | 828 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
417 | 829 | detachPigmentItem.addActionListener(this); |
---|
418 | 830 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
419 | 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); |
---|
420 | 836 | menu.add("-"); |
---|
421 | 837 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
422 | 838 | sortbysizeItem.addActionListener(this); |
---|
423 | 839 | sortbynameItem = menu.add(new MenuItem("Sort by name")); |
---|
424 | 840 | sortbynameItem.addActionListener(this); |
---|
| 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); |
---|
425 | 846 | if (Globals.ADVANCED) |
---|
426 | 847 | { |
---|
427 | | - menu.add("-"); |
---|
| 848 | + // Pretty much the same as duplicate and clone. |
---|
428 | 849 | extractGeometriesItem = menu.add(new MenuItem("Link Geometry")); |
---|
429 | 850 | extractGeometriesItem.addActionListener(this); |
---|
430 | 851 | cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry")); |
---|
431 | 852 | cloneGeometriesItem.addActionListener(this); |
---|
432 | | - shareGeometriesItem = menu.add(new MenuItem("Share Geometry")); |
---|
433 | | - shareGeometriesItem.addActionListener(this); |
---|
434 | | - mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry")); |
---|
435 | | - mergeGeometriesItem.addActionListener(this); |
---|
436 | 853 | } |
---|
437 | 854 | |
---|
438 | 855 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
439 | 856 | buildCreateMenu(menu); |
---|
440 | 857 | |
---|
441 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
442 | | - importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
443 | | - importOBJItem.addActionListener(this); |
---|
444 | | - menu.add("-"); |
---|
445 | | - import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
446 | | - import3DSItem.addActionListener(this); |
---|
447 | | - menu.add("-"); |
---|
448 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
449 | | - importVRMLX3DItem.addActionListener(this); |
---|
450 | | - menu.add("-"); |
---|
451 | | - importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
452 | | - importGFDItem.addActionListener(this); |
---|
453 | | - |
---|
454 | 858 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
455 | 859 | buildToolsMenu(menu); |
---|
456 | 860 | } |
---|
457 | 861 | |
---|
| 862 | + |
---|
458 | 863 | void SetupUI2(ObjEditor oe) |
---|
459 | 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 | + |
---|
460 | 877 | //new Exception().printStackTrace(); |
---|
461 | 878 | |
---|
462 | 879 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
485 | 902 | oe.radioPanel.add(dummyButton); |
---|
486 | 903 | oe.buttonGroup.add(dummyButton); |
---|
487 | 904 | */ |
---|
| 905 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 906 | + |
---|
| 907 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 908 | + |
---|
488 | 909 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
489 | 910 | |
---|
490 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
491 | | - liveCB.setToolTipText("Enabled animation"); |
---|
| 911 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 912 | + //minButton.setToolTipText("Minimize window"); |
---|
| 913 | + //minButton.addActionListener(this); |
---|
| 914 | + |
---|
| 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); |
---|
| 927 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 928 | + screenfitButton.addActionListener(this); |
---|
| 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(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 935 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 936 | + saveVersionButton.addActionListener(this); |
---|
| 937 | + |
---|
| 938 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 939 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 940 | + deleteVersionButton.addActionListener(this); |
---|
| 941 | + |
---|
| 942 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 943 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 944 | + previousVersionButton.addActionListener(this); |
---|
| 945 | + previousVersionButton.setEnabled(false); |
---|
| 946 | + |
---|
| 947 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 948 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 949 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
| 950 | + restoreButton.addActionListener(this); |
---|
| 951 | + //restoreButton.setEnabled(false); |
---|
| 952 | + |
---|
| 953 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 954 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
| 955 | + replaceButton.addActionListener(this); |
---|
| 956 | + //replaceButton.setEnabled(false); |
---|
| 957 | + |
---|
| 958 | + copyOptionsPanel.add(updown); |
---|
| 959 | + |
---|
| 960 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 961 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 962 | + nextVersionButton.addActionListener(this); |
---|
| 963 | + nextVersionButton.setEnabled(false); |
---|
| 964 | + |
---|
| 965 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 966 | + liveCB.setToolTipText("Enable animation"); |
---|
492 | 967 | liveCB.addItemListener(this); |
---|
493 | 968 | |
---|
494 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 969 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
495 | 970 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
496 | 971 | oneStepButton.addActionListener(this); |
---|
497 | 972 | |
---|
498 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 973 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
499 | 974 | fastCB.setToolTipText("Fast mode"); |
---|
500 | 975 | fastCB.addItemListener(this); |
---|
501 | 976 | |
---|
502 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
503 | | - trackCB.setToolTipText("Enable tracking"); |
---|
504 | | - trackCB.addItemListener(this); |
---|
505 | | - |
---|
506 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
507 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
508 | | - screenfitButton.addActionListener(this); |
---|
| 977 | + //oe.toolboxPanel.Return(); |
---|
| 978 | + |
---|
| 979 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 980 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 981 | +// trackCB.addItemListener(this); |
---|
509 | 982 | |
---|
510 | 983 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
511 | 984 | // screenfitpointButton.addActionListener(this); |
---|
512 | 985 | |
---|
513 | 986 | if (Globals.ADVANCED) |
---|
514 | 987 | { |
---|
515 | | - oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 988 | + oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
516 | 989 | snapobjectButton.addActionListener(this); |
---|
517 | 990 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 991 | + |
---|
| 992 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 993 | + fourButton.addActionListener(this); |
---|
| 994 | + fourButton.setToolTipText("Show control panel only"); |
---|
518 | 995 | } |
---|
519 | 996 | |
---|
520 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
522 | | - flashSelectionButton.addActionListener(this); |
---|
| 997 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
523 | 998 | |
---|
524 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
525 | | - |
---|
526 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
527 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 999 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1000 | + twoButton.setToolTipText("Show 3D view only"); |
---|
528 | 1001 | twoButton.addActionListener(this); |
---|
529 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
530 | | - fourButton.addActionListener(this); |
---|
531 | | - fourButton.setToolTipText("Show left panel only"); |
---|
532 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
533 | | - sixButton.setToolTipText("2-column layout left"); |
---|
534 | | - sixButton.addActionListener(this); |
---|
535 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
536 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 1002 | + this.fullscreenLayout = twoButton; |
---|
| 1003 | + |
---|
| 1004 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1005 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
537 | 1006 | threeButton.addActionListener(this); |
---|
538 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
539 | | - sevenButton.setToolTipText("3-column layout"); |
---|
540 | | - sevenButton.addActionListener(this); |
---|
| 1007 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1008 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1009 | + sixButton.addActionListener(this); |
---|
| 1010 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1011 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1012 | +// sevenButton.addActionListener(this); |
---|
541 | 1013 | // |
---|
542 | 1014 | |
---|
543 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 1015 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1016 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
545 | 1017 | rootButton.addActionListener(this); |
---|
546 | 1018 | |
---|
547 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1019 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
548 | 1020 | closeButton.setToolTipText("Close tab"); |
---|
549 | 1021 | closeButton.addActionListener(this); |
---|
550 | 1022 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
551 | 1023 | //clearButton.addActionListener(this); |
---|
552 | | - |
---|
553 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 1024 | + |
---|
| 1025 | + cGridBag row1 = new cGridBag(); |
---|
554 | 1026 | |
---|
555 | | - commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
556 | | - editButton.setToolTipText("Edit selection"); |
---|
| 1027 | + // INSERT |
---|
| 1028 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1029 | + gridButton.setToolTipText("Create grid"); |
---|
| 1030 | + gridButton.addActionListener(this); |
---|
| 1031 | + |
---|
| 1032 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1033 | + boxButton.setToolTipText("Create box"); |
---|
| 1034 | + boxButton.addActionListener(this); |
---|
| 1035 | + |
---|
| 1036 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1037 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1038 | + sphereButton.addActionListener(this); |
---|
| 1039 | + |
---|
| 1040 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1041 | + coneButton.setToolTipText("Create cone"); |
---|
| 1042 | + coneButton.addActionListener(this); |
---|
| 1043 | + |
---|
| 1044 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1045 | + torusButton.setToolTipText("Create torus"); |
---|
| 1046 | + torusButton.addActionListener(this); |
---|
| 1047 | + |
---|
| 1048 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1049 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1050 | + superButton.addActionListener(this); |
---|
| 1051 | + |
---|
| 1052 | + if (Globals.ADVANCED) |
---|
| 1053 | + { |
---|
| 1054 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1055 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 1056 | + kleinButton.addActionListener(this); |
---|
| 1057 | + } |
---|
| 1058 | + |
---|
| 1059 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1060 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 1061 | + particlesButton.addActionListener(this); |
---|
| 1062 | + |
---|
| 1063 | + oe.toolboxPanel.add(row1); |
---|
| 1064 | + |
---|
| 1065 | + cGridBag row2 = new cGridBag(); |
---|
| 1066 | + |
---|
| 1067 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | + groupButton.setToolTipText("Create group"); |
---|
| 1069 | + groupButton.addActionListener(this); |
---|
| 1070 | + |
---|
| 1071 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1073 | + compositeButton.addActionListener(this); |
---|
| 1074 | + |
---|
| 1075 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1076 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1077 | + switchButton.addActionListener(this); |
---|
| 1078 | + |
---|
| 1079 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1080 | + loopButton.setToolTipText("Create loop"); |
---|
| 1081 | + loopButton.addActionListener(this); |
---|
| 1082 | + |
---|
| 1083 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1084 | + textureButton.setToolTipText("Create texture"); |
---|
| 1085 | + textureButton.addActionListener(this); |
---|
| 1086 | + |
---|
| 1087 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1088 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1089 | + overlayButton.addActionListener(this); |
---|
| 1090 | + |
---|
| 1091 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1092 | + lightButton.setToolTipText("Create light"); |
---|
| 1093 | + lightButton.addActionListener(this); |
---|
| 1094 | + |
---|
| 1095 | + oe.toolboxPanel.add(row2); |
---|
| 1096 | + |
---|
| 1097 | + // ENVYMAPS |
---|
| 1098 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1099 | + skyboxpane.preferredHeight = 100; |
---|
| 1100 | + |
---|
| 1101 | + oe.toolboxPanel.add(skyboxpane); |
---|
| 1102 | + |
---|
| 1103 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1104 | + skyboxpane.add(skyboxpanel); |
---|
| 1105 | + |
---|
| 1106 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1107 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1108 | + AddSkyboxTab2(skyboxpanel); |
---|
| 1109 | + AddSkyboxTab3(skyboxpanel); |
---|
| 1110 | + |
---|
| 1111 | + // EDIT panel |
---|
| 1112 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + editButton.setToolTipText("Pin selection controls"); |
---|
557 | 1114 | editButton.addActionListener(this); |
---|
558 | 1115 | |
---|
559 | | - commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
560 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 1116 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1117 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
561 | 1118 | uneditButton.addActionListener(this); |
---|
562 | 1119 | |
---|
563 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
564 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 1120 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 1121 | + allParamsButton.setToolTipText("Show all controle"); |
---|
565 | 1122 | allParamsButton.addActionListener(this); |
---|
566 | 1123 | |
---|
567 | | - commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1124 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
568 | 1125 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
569 | 1126 | clearPanelButton.addActionListener(this); |
---|
570 | 1127 | |
---|
571 | | - commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1128 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
572 | 1129 | unselectButton.setToolTipText("Unselect"); |
---|
573 | 1130 | unselectButton.addActionListener(this); |
---|
574 | 1131 | |
---|
575 | | - commandsPanel.preferredHeight = 1; |
---|
| 1132 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1133 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1134 | + flashSelectionButton.addActionListener(this); |
---|
576 | 1135 | |
---|
577 | | - oe.treePanel.add(commandsPanel); |
---|
578 | | - oe.treePanel.Return(); |
---|
| 1136 | + editCommandsPanel.preferredHeight = 1; |
---|
| 1137 | + |
---|
| 1138 | + SetPinStates(false); |
---|
| 1139 | +// oe.treePanel.add(commandsPanel); |
---|
| 1140 | +// oe.treePanel.Return(); |
---|
579 | 1141 | |
---|
580 | 1142 | // oe.aConstraints.gridx += 1; |
---|
581 | 1143 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
592 | 1154 | |
---|
593 | 1155 | JScrollPane jSP; |
---|
594 | 1156 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
595 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 1157 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
596 | 1158 | ResetModel(); |
---|
597 | 1159 | |
---|
598 | 1160 | oe.treePanel.add(jSPPanel); |
---|
599 | 1161 | oe.treePanel.Return(); |
---|
600 | 1162 | |
---|
601 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
602 | | - |
---|
603 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
604 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
605 | | - colorCB.addItemListener(this); |
---|
606 | | - |
---|
607 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
608 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
609 | | - materialCB.addItemListener(this); |
---|
610 | | - |
---|
611 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
612 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
613 | | - textureCB.addItemListener(this); |
---|
614 | | - |
---|
615 | | - copyOptionsPanel.preferredHeight = 1; |
---|
616 | 1163 | oe.treePanel.add(copyOptionsPanel); |
---|
617 | 1164 | oe.treePanel.Return(); |
---|
| 1165 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1166 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1167 | + sliderPane.preferredHeight = 1; |
---|
618 | 1168 | |
---|
619 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
620 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1169 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1170 | + mainPanel.setResizeWeight(0.4); |
---|
621 | 1171 | |
---|
622 | 1172 | //jList.addListSelectionListener(this); |
---|
623 | 1173 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
625 | 1175 | //jTree.setEditable(true); |
---|
626 | 1176 | oe.jTree.setDragEnabled(true); |
---|
627 | 1177 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
628 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1178 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
629 | 1179 | |
---|
630 | 1180 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
631 | 1181 | |
---|
.. | .. |
---|
637 | 1187 | dgr.addDragGestureListener(this); |
---|
638 | 1188 | }catch(Exception e) {} |
---|
639 | 1189 | */ |
---|
640 | | - radio.layout = sevenButton; |
---|
| 1190 | + radio.layout = threeButton; // sixButton; |
---|
641 | 1191 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
642 | 1192 | } |
---|
643 | 1193 | |
---|
644 | 1194 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
645 | 1195 | { |
---|
| 1196 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1197 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1198 | + colorCB.addItemListener(this); |
---|
| 1199 | + |
---|
| 1200 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1201 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1202 | + materialCB.addItemListener(this); |
---|
| 1203 | + |
---|
| 1204 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1205 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1206 | + textureCB.addItemListener(this); |
---|
| 1207 | + |
---|
| 1208 | + panel.Return(); |
---|
| 1209 | + |
---|
646 | 1210 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
647 | 1211 | boxCB.setToolTipText("Display bounding boxes"); |
---|
648 | 1212 | boxCB.addItemListener(this); |
---|
649 | 1213 | |
---|
650 | 1214 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
651 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1215 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
652 | 1216 | zoomBoxCB.addItemListener(this); |
---|
653 | 1217 | |
---|
654 | | - if (Globals.ADVANCED) |
---|
| 1218 | + if (true) // Globals.ADVANCED) |
---|
655 | 1219 | { |
---|
656 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
657 | | - supportCB.setToolTipText("Enable rigging"); |
---|
658 | | - supportCB.addItemListener(this); |
---|
| 1220 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1221 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1222 | +// supportCB.addItemListener(this); |
---|
| 1223 | + |
---|
| 1224 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1225 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1226 | + freezeCB.addItemListener(this); |
---|
659 | 1227 | |
---|
660 | 1228 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
661 | 1229 | // localCB.addItemListener(this); |
---|
662 | 1230 | |
---|
| 1231 | + panel.Return(); |
---|
| 1232 | + |
---|
663 | 1233 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
664 | 1234 | crowdCB.setToolTipText("Used for crowds"); |
---|
665 | 1235 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
668 | 1238 | smoothCB.setToolTipText("Snapping delay"); |
---|
669 | 1239 | smoothCB.addItemListener(this); |
---|
670 | 1240 | |
---|
671 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
672 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
673 | | - slowCB.addItemListener(this); |
---|
| 1241 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1242 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1243 | +// slowCB.addItemListener(this); |
---|
| 1244 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1245 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1246 | + minshaderCB.addItemListener(this); |
---|
674 | 1247 | |
---|
675 | 1248 | // constraints.gridy += 1; |
---|
676 | 1249 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
677 | 1250 | // speakerMocapCB.addItemListener(this); |
---|
678 | 1251 | |
---|
| 1252 | + panel.Return(); |
---|
| 1253 | + |
---|
679 | 1254 | if (false) |
---|
680 | 1255 | { |
---|
681 | 1256 | // handled in scripts |
---|
.. | .. |
---|
690 | 1265 | //constraints.gridy += 1; |
---|
691 | 1266 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
692 | 1267 | smoothfocusCB.addItemListener(this); |
---|
| 1268 | + panel.Return(); |
---|
693 | 1269 | } |
---|
694 | 1270 | |
---|
695 | 1271 | //constraints.gridx += 1; |
---|
696 | 1272 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
697 | 1273 | // debugCB.addItemListener(this); |
---|
698 | 1274 | |
---|
| 1275 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1276 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1277 | + trackCB.addItemListener(this); |
---|
| 1278 | + |
---|
699 | 1279 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 1280 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
700 | 1281 | oeilCB.addItemListener(this); |
---|
701 | 1282 | |
---|
| 1283 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 1284 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 1285 | + shadowCB.addItemListener(this); |
---|
| 1286 | + |
---|
| 1287 | + panel.Return(); |
---|
| 1288 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1289 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1290 | + toggleTextureCB.addItemListener(this); |
---|
| 1291 | + |
---|
| 1292 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1293 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1294 | + toggleSwitchCB.addItemListener(this); |
---|
| 1295 | + |
---|
| 1296 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1297 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1298 | + autokeepCB.addItemListener(this); |
---|
| 1299 | + |
---|
| 1300 | + panel.Return(); |
---|
| 1301 | + if (Globals.ADVANCED) |
---|
| 1302 | + { |
---|
702 | 1303 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
703 | 1304 | lookAtCB.setToolTipText("Look-at target"); |
---|
704 | 1305 | lookAtCB.addItemListener(this); |
---|
| 1306 | + } |
---|
705 | 1307 | |
---|
706 | 1308 | } |
---|
707 | 1309 | |
---|
708 | 1310 | cGridBag fill = new cGridBag(); |
---|
709 | | - |
---|
710 | 1311 | fill.preferredHeight = 200; |
---|
| 1312 | + cGridBag fill2 = new cGridBag(); |
---|
| 1313 | + fill2.preferredHeight = 200; |
---|
| 1314 | + cGridBag fill3 = new cGridBag(); |
---|
| 1315 | + fill3.preferredHeight = 200; |
---|
711 | 1316 | |
---|
712 | 1317 | panel.add(fill); |
---|
| 1318 | + panel.add(fill2); |
---|
| 1319 | + panel.add(fill3); |
---|
713 | 1320 | |
---|
714 | 1321 | } |
---|
715 | 1322 | |
---|
716 | 1323 | void EditObject(Object3D obj) |
---|
717 | 1324 | { |
---|
718 | 1325 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1326 | + |
---|
| 1327 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1328 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1329 | + if (!radioButton.hadMaterial) |
---|
| 1330 | + { |
---|
| 1331 | + obj.material = new cMaterial(); |
---|
| 1332 | + } |
---|
| 1333 | + |
---|
719 | 1334 | radioButton.SetObject(obj); |
---|
720 | | - radioButton.layout = sevenButton; |
---|
| 1335 | + radioButton.layout = threeButton; // sixButton; |
---|
721 | 1336 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
722 | 1337 | radioButton.addActionListener(this); |
---|
723 | 1338 | radioPanel.add(radioButton); |
---|
724 | 1339 | buttonGroup.add(radioButton); |
---|
725 | 1340 | radioButton.doClick(); |
---|
726 | 1341 | } |
---|
| 1342 | + |
---|
727 | 1343 | void SetupViews(ObjEditor oe) |
---|
728 | 1344 | { |
---|
| 1345 | + theFrame = this; |
---|
| 1346 | + |
---|
729 | 1347 | oe.SetupViews(); |
---|
730 | 1348 | |
---|
731 | 1349 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
734 | 1352 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
735 | 1353 | } |
---|
736 | 1354 | |
---|
737 | | - JCheckBox liveCB; |
---|
738 | | - JCheckBox supportCB; |
---|
739 | | - JCheckBox localCB; |
---|
740 | | - JCheckBox crowdCB; |
---|
741 | | - JCheckBox smoothCB; |
---|
742 | | - JCheckBox fastCB; |
---|
743 | | - JCheckBox slowCB; |
---|
744 | | - JCheckBox boxCB; |
---|
745 | | - JCheckBox zoomBoxCB; |
---|
746 | | - JCheckBox trackCB; |
---|
747 | | - JCheckBox smoothfocusCB; |
---|
| 1355 | + cToggleButton liveCB; |
---|
| 1356 | + cCheckBox supportCB; |
---|
| 1357 | + cCheckBox localCB; |
---|
| 1358 | + cCheckBox crowdCB; |
---|
| 1359 | + cCheckBox smoothCB; |
---|
| 1360 | + cCheckBox minshaderCB; |
---|
| 1361 | + |
---|
| 1362 | + cToggleButton fastCB; |
---|
| 1363 | + cCheckBox slowCB; |
---|
| 1364 | + cCheckBox boxCB; |
---|
| 1365 | + cCheckBox zoomBoxCB; |
---|
| 1366 | + cCheckBox freezeCB; |
---|
| 1367 | + //cToggleButton trackCB; |
---|
| 1368 | + cCheckBox trackCB; |
---|
| 1369 | + cCheckBox smoothfocusCB; |
---|
748 | 1370 | // JCheckBox speakerMocapCB; |
---|
749 | | - JCheckBox speakerCameraCB; |
---|
750 | | - JCheckBox speakerFocusCB; |
---|
751 | | - JCheckBox debugCB; |
---|
752 | | - JCheckBox oeilCB; |
---|
753 | | - JCheckBox lookAtCB; |
---|
| 1371 | + cCheckBox speakerCameraCB; |
---|
| 1372 | + cCheckBox speakerFocusCB; |
---|
| 1373 | + cCheckBox debugCB; |
---|
| 1374 | + |
---|
| 1375 | + cCheckBox oeilCB; |
---|
| 1376 | + cCheckBox shadowCB; |
---|
| 1377 | + cCheckBox autokeepCB; |
---|
| 1378 | + cCheckBox lookAtCB; |
---|
754 | 1379 | |
---|
755 | 1380 | // static int COLOR = 1; |
---|
756 | 1381 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
758 | 1383 | |
---|
759 | 1384 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
760 | 1385 | |
---|
761 | | - JCheckBox colorCB; |
---|
762 | | - JCheckBox materialCB; |
---|
763 | | - JCheckBox textureCB; |
---|
| 1386 | + cCheckBox colorCB; |
---|
| 1387 | + cCheckBox materialCB; |
---|
| 1388 | + cCheckBox textureCB; |
---|
764 | 1389 | |
---|
765 | 1390 | public void itemStateChanged(ItemEvent e) |
---|
766 | 1391 | { |
---|
.. | .. |
---|
788 | 1413 | } else if(e.getSource() == liveCB) |
---|
789 | 1414 | { |
---|
790 | 1415 | cameraView.ToggleLive(); |
---|
| 1416 | + refreshContents(false); |
---|
791 | 1417 | } |
---|
792 | 1418 | else if(e.getSource() == supportCB) |
---|
793 | 1419 | { |
---|
.. | .. |
---|
803 | 1429 | { |
---|
804 | 1430 | cameraView.ToggleInertia(); |
---|
805 | 1431 | cameraView.repaint(); |
---|
| 1432 | + } |
---|
| 1433 | + else if(e.getSource() == minshaderCB) |
---|
| 1434 | + { |
---|
| 1435 | + Globals.MINSHADER ^= true; |
---|
| 1436 | + cameraView.programInitialized = false; |
---|
| 1437 | + cameraView.repaint(); |
---|
806 | 1438 | } |
---|
807 | 1439 | else if(e.getSource() == localCB) |
---|
808 | 1440 | { |
---|
.. | .. |
---|
852 | 1484 | { |
---|
853 | 1485 | cameraView.ToggleOeil(); |
---|
854 | 1486 | } |
---|
| 1487 | + else if(e.getSource() == shadowCB) |
---|
| 1488 | + { |
---|
| 1489 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1490 | + } |
---|
| 1491 | + else if(e.getSource() == freezeCB) |
---|
| 1492 | + { |
---|
| 1493 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1494 | + } |
---|
| 1495 | + else if(e.getSource() == autokeepCB) |
---|
| 1496 | + { |
---|
| 1497 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1498 | + } |
---|
855 | 1499 | else if(e.getSource() == lookAtCB) |
---|
856 | 1500 | { |
---|
857 | 1501 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
868 | 1512 | |
---|
869 | 1513 | /**/ |
---|
870 | 1514 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
871 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1515 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1516 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
872 | 1517 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
873 | 1518 | // We can't move the root node or an empty selection |
---|
874 | 1519 | return; |
---|
.. | .. |
---|
931 | 1576 | } |
---|
932 | 1577 | } |
---|
933 | 1578 | |
---|
934 | | - String string = (String) object; |
---|
935 | | - |
---|
936 | 1579 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
937 | 1580 | // if( object instanceof java.io.File[]) |
---|
938 | 1581 | // { |
---|
.. | .. |
---|
940 | 1583 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
941 | 1584 | // return; |
---|
942 | 1585 | // } |
---|
| 1586 | + |
---|
| 1587 | + String string = object.toString(); |
---|
943 | 1588 | |
---|
944 | 1589 | // File path for Mac and Windows |
---|
945 | 1590 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
969 | 1614 | |
---|
970 | 1615 | flashIt = false; |
---|
971 | 1616 | CameraPane pane = (CameraPane) target; |
---|
972 | | - pane.clickStart(objEditor.location.x, objEditor.location.y, 0); |
---|
| 1617 | + pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0); |
---|
973 | 1618 | pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true); |
---|
974 | 1619 | |
---|
975 | 1620 | if (group.selection.size() == 1) |
---|
.. | .. |
---|
985 | 1630 | |
---|
986 | 1631 | assert target == objEditor.jTree; |
---|
987 | 1632 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1633 | + Object3D destinationLeaf; |
---|
988 | 1634 | try { |
---|
989 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1635 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
990 | 1636 | } catch (Exception e) { |
---|
991 | 1637 | System.out.println("destinationPath : " + destinationPath); |
---|
992 | 1638 | return; |
---|
993 | 1639 | } |
---|
994 | 1640 | |
---|
995 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1641 | + for (int i=group.selection.size(); --i>=0;) |
---|
996 | 1642 | { |
---|
| 1643 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1644 | + |
---|
| 1645 | + // Cannot move into itself |
---|
| 1646 | + if (child == destinationLeaf) |
---|
| 1647 | + return; |
---|
| 1648 | + } |
---|
| 1649 | + |
---|
| 1650 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1651 | +// { |
---|
997 | 1652 | loadClipboard(true); |
---|
998 | 1653 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
999 | 1654 | pasteInto(false, false); |
---|
1000 | | - } else { |
---|
1001 | | - loadClipboard(false); |
---|
1002 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1003 | | - pasteInto(false, false); // true); // ??? |
---|
1004 | | - } |
---|
| 1655 | +// } else { |
---|
| 1656 | +// loadClipboard(false); |
---|
| 1657 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1658 | +// pasteInto(false, false); // true); // ??? |
---|
| 1659 | +// } |
---|
1005 | 1660 | } |
---|
1006 | 1661 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1007 | 1662 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1106 | 1761 | { |
---|
1107 | 1762 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1108 | 1763 | //heightFieldItem.addActionListener(this); |
---|
1109 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1110 | | - gridItem.addActionListener(this); |
---|
1111 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1112 | | - rectoidItem.addActionListener(this); |
---|
1113 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1114 | | - ellipsoidItem.addActionListener(this); |
---|
1115 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1116 | | - coneItem.addActionListener(this); |
---|
1117 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1118 | | - torusItem.addActionListener(this); |
---|
1119 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1120 | | - superItem.addActionListener(this); |
---|
| 1764 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1765 | +// gridItem.addActionListener(this); |
---|
| 1766 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1767 | +// rectoidItem.addActionListener(this); |
---|
| 1768 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1769 | +// ellipsoidItem.addActionListener(this); |
---|
| 1770 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1771 | +// coneItem.addActionListener(this); |
---|
| 1772 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1773 | +// torusItem.addActionListener(this); |
---|
| 1774 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1775 | +// superItem.addActionListener(this); |
---|
| 1776 | + |
---|
| 1777 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1778 | + cameraItem.addActionListener(this); |
---|
| 1779 | + |
---|
| 1780 | + if (!Globals.ADVANCED) |
---|
| 1781 | + { |
---|
1121 | 1782 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1122 | 1783 | kleinItem.addActionListener(this); |
---|
1123 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1124 | | - particleItem.addActionListener(this); |
---|
| 1784 | + } |
---|
| 1785 | + |
---|
| 1786 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1787 | +// particleItem.addActionListener(this); |
---|
1125 | 1788 | if (Globals.ADVANCED) |
---|
1126 | 1789 | { |
---|
1127 | 1790 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1147 | 1810 | } |
---|
1148 | 1811 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1149 | 1812 | bezierItem.addActionListener(this); |
---|
1150 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1151 | | - overlayItem.addActionListener(this); |
---|
1152 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1153 | | - lightItem.addActionListener(this); |
---|
| 1813 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1814 | +// overlayItem.addActionListener(this); |
---|
| 1815 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1816 | +// lightItem.addActionListener(this); |
---|
1154 | 1817 | menu.add("-"); |
---|
1155 | 1818 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1156 | 1819 | //superLoopItem.addActionListener(this); |
---|
1157 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1158 | | - loopItem.addActionListener(this); |
---|
| 1820 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1821 | +// loopItem.addActionListener(this); |
---|
1159 | 1822 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1160 | 1823 | doubleItem.addActionListener(this); |
---|
1161 | 1824 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1171 | 1834 | animationItem.addItemListener(this); |
---|
1172 | 1835 | animationItem.setState(Globals.ANIMATION); |
---|
1173 | 1836 | |
---|
| 1837 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1838 | + archiveItem.addActionListener(this); |
---|
| 1839 | + |
---|
1174 | 1840 | menu.add("-"); |
---|
1175 | 1841 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1176 | 1842 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1183 | 1849 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1184 | 1850 | reduce34MorphItem.addActionListener(this); |
---|
1185 | 1851 | menu.add("-"); |
---|
| 1852 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1853 | + memoryItem.addActionListener(this); |
---|
1186 | 1854 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1187 | 1855 | computeAOItem.addActionListener(this); |
---|
1188 | 1856 | |
---|
.. | .. |
---|
1191 | 1859 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1192 | 1860 | mirrorItem.addActionListener(this); |
---|
1193 | 1861 | menu.add("-"); |
---|
1194 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1195 | | - memoryItem.addActionListener(this); |
---|
1196 | 1862 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1197 | 1863 | analyzeItem.addActionListener(this); |
---|
1198 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1864 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1199 | 1865 | dumpItem.addActionListener(this); |
---|
1200 | 1866 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1201 | 1867 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1336 | 2002 | shadow.material = new cMaterial(obj.material); |
---|
1337 | 2003 | shadow.material.diffuse = 0.0001f; |
---|
1338 | 2004 | shadow.material.specular = 0.0001f; |
---|
| 2005 | + //shadow.projectedVertices[1].x = 300; |
---|
1339 | 2006 | |
---|
1340 | 2007 | makeSomething(shadow); |
---|
1341 | 2008 | } |
---|
| 2009 | + |
---|
| 2010 | + private void ClearUnpinned() |
---|
| 2011 | + { |
---|
| 2012 | + //for (Object3D obj : listUI) |
---|
| 2013 | + for (int i=listUI.size(); --i>=0;) |
---|
| 2014 | + { |
---|
| 2015 | + Object3D obj = listUI.elementAt(i); |
---|
| 2016 | + if (!obj.pinned) |
---|
| 2017 | + { |
---|
| 2018 | + obj.CloseUI(); |
---|
| 2019 | + listUI.remove(i); |
---|
| 2020 | + } |
---|
| 2021 | + } |
---|
| 2022 | + } |
---|
| 2023 | + |
---|
| 2024 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2025 | + { |
---|
| 2026 | + // if (!(elem instanceof Composite)) |
---|
| 2027 | + // newWindow = false; |
---|
| 2028 | + listUI.add(elem); |
---|
| 2029 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2030 | + System.out.println("edit : " + elem); |
---|
| 2031 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 2032 | + } |
---|
1342 | 2033 | |
---|
1343 | 2034 | /** |
---|
1344 | 2035 | * applyExample |
---|
.. | .. |
---|
1542 | 2233 | |
---|
1543 | 2234 | void Overwrite(int mask) |
---|
1544 | 2235 | { |
---|
1545 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2236 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
1546 | 2237 | { |
---|
1547 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2238 | + Object3D content = Grafreed.clipboard.get(0); |
---|
1548 | 2239 | |
---|
1549 | 2240 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1550 | 2241 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1583 | 2274 | { |
---|
1584 | 2275 | ScreenFit(); |
---|
1585 | 2276 | } else |
---|
1586 | | - if (source == switchItem) |
---|
| 2277 | + if (source == switchViewItem) |
---|
1587 | 2278 | { |
---|
1588 | 2279 | cVector v1 = new cVector(); |
---|
1589 | 2280 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1592 | 2283 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1593 | 2284 | objEditor.cameraView.repaint(); |
---|
1594 | 2285 | } else |
---|
1595 | | - if (source == rectoidItem) |
---|
| 2286 | + if (source == rectoidItem || source == boxButton) |
---|
1596 | 2287 | { |
---|
1597 | 2288 | makeSomething(new Box()); |
---|
1598 | 2289 | } else |
---|
1599 | | - if (source == particleItem) |
---|
| 2290 | + if (source == particleItem || source == particlesButton) |
---|
1600 | 2291 | { |
---|
1601 | 2292 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1602 | 2293 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1675 | 2366 | |
---|
1676 | 2367 | makeSomething(obj); |
---|
1677 | 2368 | } else |
---|
1678 | | - if (source == gridItem) |
---|
| 2369 | + if (source == gridItem || source == gridButton) |
---|
1679 | 2370 | { |
---|
1680 | 2371 | makeSomething(new Grid()); |
---|
1681 | 2372 | } else |
---|
1682 | | - if (source == ellipsoidItem) |
---|
| 2373 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1683 | 2374 | { |
---|
1684 | 2375 | makeSomething(new Sphere()); |
---|
1685 | 2376 | } else |
---|
1686 | | - if (source == coneItem) |
---|
| 2377 | + if (source == coneItem || source == coneButton) |
---|
1687 | 2378 | { |
---|
1688 | 2379 | makeSomething(new Cone()); |
---|
1689 | 2380 | } else |
---|
1690 | | - if (source == torusItem) |
---|
| 2381 | + if (source == torusItem || source == torusButton) |
---|
1691 | 2382 | { |
---|
1692 | 2383 | makeSomething(new Torus()); |
---|
1693 | 2384 | } else |
---|
1694 | | - if (source == superItem) |
---|
| 2385 | + if (source == superItem || source == superButton) |
---|
1695 | 2386 | { |
---|
1696 | 2387 | makeSomething(new Superellipsoid()); |
---|
1697 | 2388 | } else |
---|
1698 | | - if (source == kleinItem) |
---|
| 2389 | + if (source == kleinItem || source == kleinButton) |
---|
1699 | 2390 | { |
---|
1700 | 2391 | makeSomething(new Klein()); |
---|
1701 | 2392 | } else |
---|
.. | .. |
---|
1715 | 2406 | { |
---|
1716 | 2407 | makeSomething(new BezierSurface()); |
---|
1717 | 2408 | } else |
---|
1718 | | - if (source == overlayItem) |
---|
| 2409 | + if (source == overlayItem || source == overlayButton) |
---|
1719 | 2410 | { |
---|
1720 | 2411 | /* |
---|
1721 | 2412 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1763 | 2454 | s.setup(); |
---|
1764 | 2455 | makeSomething(s); |
---|
1765 | 2456 | } else |
---|
1766 | | - if (source == lightItem) |
---|
| 2457 | + if (source == lightItem || source == lightButton) |
---|
1767 | 2458 | { |
---|
1768 | 2459 | makeSomething(new Light()); |
---|
1769 | 2460 | } else |
---|
| 2461 | +// if (source == skybox1Button || |
---|
| 2462 | +// source == skybox2Button || |
---|
| 2463 | +// source == skybox3Button || |
---|
| 2464 | +// source == skybox4Button || |
---|
| 2465 | +// source == skybox5Button || |
---|
| 2466 | +// source == skybox6Button || |
---|
| 2467 | +// source == skybox7Button || |
---|
| 2468 | +// source == skybox11Button || |
---|
| 2469 | +// source == skybox12Button || |
---|
| 2470 | +// source == skybox13Button || |
---|
| 2471 | +// source == skybox14Button || |
---|
| 2472 | +// source == skybox15Button || |
---|
| 2473 | +// source == skybox16Button || |
---|
| 2474 | +// source == skybox17Button) |
---|
| 2475 | +// { |
---|
| 2476 | +// ChangeSkybox(source); |
---|
| 2477 | +// } else |
---|
1770 | 2478 | if (source == csgItem) |
---|
1771 | 2479 | { |
---|
1772 | 2480 | group(new CSG()); |
---|
.. | .. |
---|
1813 | 2521 | |
---|
1814 | 2522 | group(g); |
---|
1815 | 2523 | } else |
---|
1816 | | - if (source == loopItem) |
---|
| 2524 | + if (source == loopItem || source == loopButton) |
---|
1817 | 2525 | { |
---|
1818 | 2526 | Composite csg = new GroupLeaf(); |
---|
1819 | 2527 | csg.count = 5; |
---|
1820 | 2528 | group(csg); |
---|
1821 | | - Composite child = new cGroup(); |
---|
| 2529 | + Composite child = new cGroup("Branch"); |
---|
1822 | 2530 | csg.addChild(child); |
---|
1823 | 2531 | child.addChild(csg); |
---|
1824 | 2532 | } else |
---|
1825 | 2533 | if (source == doubleItem) |
---|
1826 | 2534 | { |
---|
1827 | | - Composite csg = new GroupLeaf(); |
---|
| 2535 | + Composite csg = new GroupLeaf("Fork"); |
---|
1828 | 2536 | csg.count = 5; |
---|
1829 | 2537 | group(csg); |
---|
1830 | | - Composite child = new cGroup(); |
---|
| 2538 | + Composite child = new cGroup("Branch A"); |
---|
1831 | 2539 | csg.addChild(child); |
---|
1832 | 2540 | child.addChild(csg); |
---|
1833 | | - child = new cGroup(); |
---|
| 2541 | + child = new cGroup("Branch B"); |
---|
1834 | 2542 | csg.addChild(child); |
---|
1835 | 2543 | child.addChild(csg); |
---|
1836 | 2544 | } else |
---|
1837 | 2545 | if (source == tripleItem) |
---|
1838 | 2546 | { |
---|
1839 | | - Composite csg = new GroupLeaf(); |
---|
| 2547 | + Composite csg = new GroupLeaf("Trident"); |
---|
1840 | 2548 | csg.count = 4; |
---|
1841 | 2549 | group(csg); |
---|
1842 | 2550 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1849 | 2557 | csg.addChild(child); |
---|
1850 | 2558 | child.addChild(csg); |
---|
1851 | 2559 | } else |
---|
1852 | | - |
---|
1853 | | - if (source == importGFDItem) |
---|
1854 | | - { |
---|
1855 | | - ImportGFD(); |
---|
1856 | | - } else |
---|
1857 | | - if (source == importVRMLX3DItem) |
---|
1858 | | - { |
---|
1859 | | - ImportVRMLX3D(); |
---|
1860 | | - } else |
---|
1861 | | - if (source == import3DSItem) |
---|
1862 | | - { |
---|
1863 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1864 | | - } else |
---|
1865 | | - if (source == importOBJItem) |
---|
1866 | | - { |
---|
1867 | | - //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1868 | | - FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
1869 | | - browser.setVisible(true); |
---|
1870 | | - String filename = browser.getFile(); |
---|
1871 | | - if (filename != null && filename.length() > 0) |
---|
1872 | | - { |
---|
1873 | | - String fullname = browser.getDirectory() + filename; |
---|
1874 | | - makeSomething(ReadOBJ(fullname), true); |
---|
1875 | | - } |
---|
1876 | | - } else |
---|
1877 | 2560 | if (source == computeAOItem) |
---|
1878 | 2561 | { |
---|
1879 | 2562 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1880 | | - Globals.theRenderer.repaint(); |
---|
| 2563 | + cameraView.repaint(); |
---|
1881 | 2564 | } else |
---|
1882 | 2565 | if (source == recompileItem) |
---|
1883 | 2566 | { |
---|
.. | .. |
---|
1892 | 2575 | if (source == invariantsItem) |
---|
1893 | 2576 | { |
---|
1894 | 2577 | System.out.println("Invariants:"); |
---|
1895 | | - GrafreeD.grafreeD.universe.invariants(); |
---|
| 2578 | + Grafreed.grafreed.universe.invariants(); |
---|
1896 | 2579 | } else |
---|
1897 | 2580 | if (source == memoryItem) |
---|
1898 | 2581 | { |
---|
.. | .. |
---|
1911 | 2594 | { |
---|
1912 | 2595 | DumpObject(); |
---|
1913 | 2596 | } else |
---|
| 2597 | + if (source == minButton) |
---|
| 2598 | + { |
---|
| 2599 | + Minimize(); |
---|
| 2600 | + } else |
---|
| 2601 | + if (source == maxButton) |
---|
| 2602 | + { |
---|
| 2603 | + Maximize(); |
---|
| 2604 | + } else |
---|
| 2605 | + if (source == fullButton) |
---|
| 2606 | + { |
---|
| 2607 | + ToggleFullScreen(); |
---|
| 2608 | + } else |
---|
| 2609 | + if (source == previousVersionButton) |
---|
| 2610 | + { |
---|
| 2611 | + // Go to previous version |
---|
| 2612 | + //if (!Undo()) |
---|
| 2613 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2614 | + PreviousVersion(); |
---|
| 2615 | + } else |
---|
| 2616 | + if (source == restoreButton) |
---|
| 2617 | + { |
---|
| 2618 | + // Restore current version |
---|
| 2619 | + Restore(); |
---|
| 2620 | + //restoreButton.setEnabled(false); |
---|
| 2621 | + } else |
---|
| 2622 | + if (source == replaceButton) |
---|
| 2623 | + { |
---|
| 2624 | + // Overwrite current version |
---|
| 2625 | + Replace(); |
---|
| 2626 | + //replaceButton.setEnabled(false); |
---|
| 2627 | + } else |
---|
| 2628 | + if (source == nextVersionButton) |
---|
| 2629 | + { |
---|
| 2630 | + // Go to next version |
---|
| 2631 | + NextVersion(); |
---|
| 2632 | + } else |
---|
| 2633 | + if (source == saveVersionButton) |
---|
| 2634 | + { |
---|
| 2635 | + // Save a new version |
---|
| 2636 | + if (!Save(true)) |
---|
| 2637 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2638 | + } else |
---|
| 2639 | + if (source == deleteVersionButton) |
---|
| 2640 | + { |
---|
| 2641 | + // Delete a new version |
---|
| 2642 | + DeleteVersion(); |
---|
| 2643 | + } else |
---|
1914 | 2644 | if (source == oneStepButton) |
---|
1915 | 2645 | { |
---|
1916 | 2646 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1918 | 2648 | } else |
---|
1919 | 2649 | if (source == screenfitButton) |
---|
1920 | 2650 | { |
---|
1921 | | - //Reload(lastConverter, lastFilename, true); |
---|
1922 | 2651 | ScreenFit(); |
---|
1923 | 2652 | } else |
---|
1924 | 2653 | if (source == screenfitpointButton) |
---|
1925 | 2654 | { |
---|
1926 | | - //Reload(lastConverter, lastFilename, true); |
---|
1927 | 2655 | ScreenFitPoint(); |
---|
1928 | 2656 | } else |
---|
1929 | 2657 | if (source == snapobjectButton) |
---|
1930 | 2658 | { |
---|
1931 | | - //Reload(lastConverter, lastFilename, true); |
---|
1932 | 2659 | SnapObject(); |
---|
1933 | 2660 | } else |
---|
1934 | 2661 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1965 | 2692 | { |
---|
1966 | 2693 | loadClipboard(true); |
---|
1967 | 2694 | } else |
---|
| 2695 | + if (source == undoItem) |
---|
| 2696 | + { |
---|
| 2697 | + PreviousVersion(); |
---|
| 2698 | + } else |
---|
| 2699 | + if (source == redoItem) |
---|
| 2700 | + { |
---|
| 2701 | + NextVersion(); |
---|
| 2702 | + } else |
---|
1968 | 2703 | if (source == duplicateItem) |
---|
1969 | 2704 | { |
---|
1970 | | - Object3D keep = GrafreeD.clipboard; |
---|
| 2705 | + Object3D keep = Grafreed.clipboard; |
---|
1971 | 2706 | loadClipboard(false); |
---|
1972 | 2707 | paste(false); |
---|
1973 | | - GrafreeD.clipboard = keep; |
---|
| 2708 | + Grafreed.clipboard = keep; |
---|
1974 | 2709 | } else |
---|
1975 | 2710 | if (source == cloneItem) |
---|
1976 | 2711 | { |
---|
.. | .. |
---|
2190 | 2925 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2191 | 2926 | // refreshContents(); |
---|
2192 | 2927 | // } |
---|
2193 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 2928 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
2194 | 2929 | { |
---|
2195 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2930 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2196 | 2931 | |
---|
2197 | 2932 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2198 | 2933 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2242 | 2977 | } else |
---|
2243 | 2978 | if (source == setMasterItem) |
---|
2244 | 2979 | { |
---|
2245 | | - if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
| 2980 | + if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1) |
---|
2246 | 2981 | { |
---|
2247 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2982 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2248 | 2983 | |
---|
2249 | 2984 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2250 | 2985 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2257 | 2992 | { |
---|
2258 | 2993 | if (group.selection.size() == 1) |
---|
2259 | 2994 | { |
---|
2260 | | - if (GrafreeD.clipboard.size() == 1) |
---|
| 2995 | + if (Grafreed.clipboard.size() == 1) |
---|
2261 | 2996 | { |
---|
2262 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 2997 | + Object3D content = Grafreed.clipboard.get(0); |
---|
2263 | 2998 | |
---|
2264 | 2999 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2265 | 3000 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2276 | 3011 | { |
---|
2277 | 3012 | RevertMeshes(); |
---|
2278 | 3013 | } else |
---|
2279 | | - if (source == resetMeshItem) |
---|
| 3014 | + if (source == resetAllItem) |
---|
2280 | 3015 | { |
---|
2281 | 3016 | ResetAll(); |
---|
2282 | 3017 | } else |
---|
.. | .. |
---|
2284 | 3019 | { |
---|
2285 | 3020 | StepAll(); |
---|
2286 | 3021 | } else |
---|
2287 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 3022 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2288 | 3023 | { |
---|
2289 | 3024 | //int indices[] = jList.getSelectedIndices(); |
---|
2290 | 3025 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2296 | 3031 | { |
---|
2297 | 3032 | ClearSelection(true); |
---|
2298 | 3033 | } else |
---|
2299 | | - if (source == grabItem) |
---|
| 3034 | + if (source == grabItem || source == groupButton) |
---|
2300 | 3035 | { |
---|
2301 | | - group(new cGroup(), true); |
---|
| 3036 | + group(new cGroup(), false); // true); |
---|
2302 | 3037 | } else |
---|
2303 | 3038 | if (source == hideItem) |
---|
2304 | 3039 | { |
---|
.. | .. |
---|
2316 | 3051 | { |
---|
2317 | 3052 | makeSomething(new Camera()); |
---|
2318 | 3053 | } else |
---|
2319 | | - if (source == compositeItem) |
---|
| 3054 | + if (source == compositeItem || source == compositeButton) |
---|
2320 | 3055 | { |
---|
2321 | 3056 | group(new Composite()); |
---|
2322 | 3057 | } else |
---|
2323 | | - if (source == randomItem) |
---|
| 3058 | + if (source == switchItem || source == switchButton) |
---|
2324 | 3059 | { |
---|
2325 | 3060 | RandomNode random = new RandomNode(); |
---|
2326 | 3061 | group(random); |
---|
.. | .. |
---|
2422 | 3157 | { |
---|
2423 | 3158 | group(new cLinker()); |
---|
2424 | 3159 | } else |
---|
2425 | | - if (source == textureItem) |
---|
| 3160 | + if (source == textureItem || source == textureButton) |
---|
2426 | 3161 | { |
---|
2427 | 3162 | group(new TextureNode()); |
---|
2428 | 3163 | } else |
---|
.. | .. |
---|
2442 | 3177 | { |
---|
2443 | 3178 | CastShadow(2); |
---|
2444 | 3179 | } else |
---|
2445 | | - if (source == ungroupItem) |
---|
| 3180 | + if (source == ungroupItem || source == ungroupButton) |
---|
2446 | 3181 | { |
---|
2447 | | - //ungroup(); |
---|
| 3182 | + boolean hasRoot = false; |
---|
| 3183 | + |
---|
2448 | 3184 | for (int i=0; i<group.selection.size(); i++) |
---|
2449 | 3185 | { |
---|
2450 | | - Ungroup(group.selection.get(i)); |
---|
| 3186 | + if (group.selection.get(i) == group) |
---|
| 3187 | + { |
---|
| 3188 | + hasRoot = true; |
---|
| 3189 | + break; |
---|
| 3190 | + } |
---|
2451 | 3191 | } |
---|
2452 | 3192 | |
---|
2453 | | - ClearSelection(false); |
---|
2454 | | - |
---|
2455 | | - refreshContents(); |
---|
| 3193 | + if (!hasRoot) |
---|
| 3194 | + { |
---|
| 3195 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3196 | + { |
---|
| 3197 | + Ungroup(group.selection.get(i)); |
---|
| 3198 | + } |
---|
| 3199 | + |
---|
| 3200 | + ClearSelection(false); |
---|
| 3201 | + |
---|
| 3202 | + refreshContents(); |
---|
| 3203 | + } |
---|
2456 | 3204 | } else |
---|
2457 | 3205 | if (source == genUVItem) |
---|
2458 | 3206 | { |
---|
.. | .. |
---|
2464 | 3212 | } else |
---|
2465 | 3213 | if (source == genNormalsMESHItem) |
---|
2466 | 3214 | { |
---|
2467 | | - GenNormals(true); // TODO |
---|
| 3215 | + GenNormalsMESH(); |
---|
2468 | 3216 | } else |
---|
2469 | 3217 | if (source == genNormalsORGANItem) |
---|
2470 | 3218 | { |
---|
.. | .. |
---|
2529 | 3277 | if (source == unmarkleavesItem) |
---|
2530 | 3278 | { |
---|
2531 | 3279 | MarkLeaves(false); |
---|
| 3280 | + } else |
---|
| 3281 | + if (source == rewindleavesItem) |
---|
| 3282 | + { |
---|
| 3283 | + RewindLeaves(true); |
---|
| 3284 | + } else |
---|
| 3285 | + if (source == unrewindleavesItem) |
---|
| 3286 | + { |
---|
| 3287 | + RewindLeaves(false); |
---|
| 3288 | + } else |
---|
| 3289 | + if (source == randomleavesItem) |
---|
| 3290 | + { |
---|
| 3291 | + RandomLeaves(true); |
---|
| 3292 | + } else |
---|
| 3293 | + if (source == unrandomleavesItem) |
---|
| 3294 | + { |
---|
| 3295 | + RandomLeaves(false); |
---|
2532 | 3296 | } else |
---|
2533 | 3297 | if (source == flipVItem) |
---|
2534 | 3298 | { |
---|
.. | .. |
---|
2614 | 3378 | { |
---|
2615 | 3379 | SmoothMesh(); |
---|
2616 | 3380 | } else |
---|
2617 | | - if (source == transformgeometryItem) |
---|
| 3381 | + if (source == transformGeometryItem) |
---|
2618 | 3382 | { |
---|
2619 | 3383 | TransformGeometry(); |
---|
| 3384 | + } else |
---|
| 3385 | + if (source == transformChildrenItem) |
---|
| 3386 | + { |
---|
| 3387 | + TransformChildren(); |
---|
2620 | 3388 | } else |
---|
2621 | 3389 | if (source == resetTransformItem) |
---|
2622 | 3390 | { |
---|
.. | .. |
---|
2624 | 3392 | } else |
---|
2625 | 3393 | if (source == resetCentroidItem) |
---|
2626 | 3394 | { |
---|
2627 | | - ResetCentroid(); |
---|
| 3395 | + ResetCentroid(true); |
---|
| 3396 | + } else |
---|
| 3397 | + if (source == resetCentroidXZItem) |
---|
| 3398 | + { |
---|
| 3399 | + ResetCentroid(false); |
---|
2628 | 3400 | } else |
---|
2629 | 3401 | if (source == resetParentItem) |
---|
2630 | 3402 | { |
---|
.. | .. |
---|
2729 | 3501 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2730 | 3502 | { |
---|
2731 | 3503 | obj = (Object3D)e.nextElement(); |
---|
2732 | | - obj.SetBumpTexture(null); |
---|
| 3504 | + obj.ResetBumpTexture(); |
---|
2733 | 3505 | } |
---|
2734 | 3506 | |
---|
2735 | 3507 | refreshContents(); |
---|
.. | .. |
---|
2745 | 3517 | |
---|
2746 | 3518 | refreshContents(); |
---|
2747 | 3519 | } else |
---|
| 3520 | + if (source == embedTexturesItem) |
---|
| 3521 | + { |
---|
| 3522 | + Object3D obj; |
---|
| 3523 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3524 | + { |
---|
| 3525 | + obj = (Object3D)e.nextElement(); |
---|
| 3526 | + obj.EmbedTextures(true); |
---|
| 3527 | + } |
---|
| 3528 | + |
---|
| 3529 | + refreshContents(); |
---|
| 3530 | + } else |
---|
| 3531 | + if (source == deEmbedTexturesItem) |
---|
| 3532 | + { |
---|
| 3533 | + Object3D obj; |
---|
| 3534 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3535 | + { |
---|
| 3536 | + obj = (Object3D)e.nextElement(); |
---|
| 3537 | + obj.EmbedTextures(false); |
---|
| 3538 | + } |
---|
| 3539 | + |
---|
| 3540 | + CameraPane.texturepigment.clear(); |
---|
| 3541 | + CameraPane.texturebump.clear(); |
---|
| 3542 | + |
---|
| 3543 | + refreshContents(); |
---|
| 3544 | + } else |
---|
2748 | 3545 | if (source == flashSelectionButton) |
---|
2749 | 3546 | { |
---|
2750 | 3547 | CameraPane.flash = true; |
---|
.. | .. |
---|
2756 | 3553 | if (source == twoButton) |
---|
2757 | 3554 | { |
---|
2758 | 3555 | radio.layout = twoButton; |
---|
| 3556 | + |
---|
| 3557 | + if (CameraPane.FULLSCREEN) |
---|
| 3558 | + fullscreenLayout = radio.layout; |
---|
| 3559 | + |
---|
2759 | 3560 | // bug |
---|
2760 | 3561 | //gridPanel.setDividerLocation(1.0); |
---|
2761 | 3562 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2788 | 3589 | bigThree.ClearUI(); |
---|
2789 | 3590 | bigThree.add(centralPanel); |
---|
2790 | 3591 | bigThree.FlushUI(); |
---|
| 3592 | + |
---|
| 3593 | + cameraView.requestFocusInWindow(); |
---|
| 3594 | + |
---|
| 3595 | +// refreshContents(true); |
---|
| 3596 | +// |
---|
| 3597 | +// try |
---|
| 3598 | +// { |
---|
| 3599 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3600 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3601 | +// bot.mouseMove(100, 100); |
---|
| 3602 | +// bot.mousePress(mask); |
---|
| 3603 | +// bot.mouseRelease(mask); |
---|
| 3604 | +// } |
---|
| 3605 | +// catch (Exception e) |
---|
| 3606 | +// { |
---|
| 3607 | +// |
---|
| 3608 | +// } |
---|
| 3609 | + |
---|
2791 | 3610 | } else |
---|
2792 | 3611 | if (source == threeButton) |
---|
2793 | 3612 | { |
---|
2794 | 3613 | radio.layout = threeButton; |
---|
| 3614 | + |
---|
| 3615 | + if (CameraPane.FULLSCREEN) |
---|
| 3616 | + fullscreenLayout = radio.layout; |
---|
2795 | 3617 | |
---|
2796 | 3618 | // bigThree.remove(scenePanel); |
---|
2797 | 3619 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2821 | 3643 | // centralPanel.setVisible(true); |
---|
2822 | 3644 | // XYZPanel.setVisible(true); |
---|
2823 | 3645 | bigThree.ClearUI(); |
---|
| 3646 | + bigThree.add(scenePanel); |
---|
2824 | 3647 | bigThree.add(centralPanel); |
---|
2825 | | - bigThree.add(XYZPanel); |
---|
2826 | 3648 | bigThree.FlushUI(); |
---|
| 3649 | + |
---|
| 3650 | + cameraView.requestFocusInWindow(); |
---|
2827 | 3651 | } else |
---|
2828 | 3652 | if (source == fourButton) |
---|
2829 | 3653 | { |
---|
2830 | 3654 | radio.layout = fourButton; |
---|
| 3655 | + |
---|
| 3656 | + if (CameraPane.FULLSCREEN) |
---|
| 3657 | + fullscreenLayout = radio.layout; |
---|
2831 | 3658 | |
---|
2832 | 3659 | // bigThree.remove(scenePanel); |
---|
2833 | 3660 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2859 | 3686 | bigThree.ClearUI(); |
---|
2860 | 3687 | bigThree.add(scenePanel); |
---|
2861 | 3688 | bigThree.FlushUI(); |
---|
| 3689 | + |
---|
| 3690 | + cameraView.requestFocusInWindow(); |
---|
2862 | 3691 | } else |
---|
2863 | 3692 | if (source == sixButton) |
---|
2864 | 3693 | { |
---|
2865 | 3694 | radio.layout = sixButton; |
---|
| 3695 | + |
---|
| 3696 | + if (CameraPane.FULLSCREEN) |
---|
| 3697 | + fullscreenLayout = radio.layout; |
---|
2866 | 3698 | |
---|
2867 | 3699 | // bigThree.remove(scenePanel); |
---|
2868 | 3700 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2892 | 3724 | // centralPanel.setVisible(true); |
---|
2893 | 3725 | // XYZPanel.setVisible(false); |
---|
2894 | 3726 | bigThree.ClearUI(); |
---|
2895 | | - bigThree.add(scenePanel); |
---|
2896 | 3727 | bigThree.add(centralPanel); |
---|
| 3728 | + bigThree.add(scenePanel); |
---|
2897 | 3729 | bigThree.FlushUI(); |
---|
| 3730 | + |
---|
| 3731 | + cameraView.requestFocusInWindow(); |
---|
2898 | 3732 | } else |
---|
2899 | 3733 | if (source == sevenButton) |
---|
2900 | 3734 | { |
---|
2901 | 3735 | radio.layout = sevenButton; |
---|
| 3736 | + |
---|
| 3737 | + if (CameraPane.FULLSCREEN) |
---|
| 3738 | + fullscreenLayout = radio.layout; |
---|
2902 | 3739 | |
---|
2903 | 3740 | // bigThree.remove(scenePanel); |
---|
2904 | 3741 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2932 | 3769 | bigThree.add(centralPanel); |
---|
2933 | 3770 | bigThree.add(XYZPanel); |
---|
2934 | 3771 | bigThree.FlushUI(); |
---|
| 3772 | + |
---|
| 3773 | + cameraView.requestFocusInWindow(); |
---|
2935 | 3774 | } else |
---|
2936 | 3775 | if (source == rootButton) |
---|
2937 | 3776 | { |
---|
.. | .. |
---|
2943 | 3782 | EditObject(obj); |
---|
2944 | 3783 | } |
---|
2945 | 3784 | |
---|
| 3785 | + cameraView.requestFocusInWindow(); |
---|
2946 | 3786 | refreshContents(true); |
---|
2947 | 3787 | } else |
---|
2948 | 3788 | if (source == closeButton) |
---|
.. | .. |
---|
2952 | 3792 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2953 | 3793 | { |
---|
2954 | 3794 | ab = (cRadio)e.nextElement(); |
---|
2955 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3795 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2956 | 3796 | { |
---|
| 3797 | + // Patch to avoid bug with transparency. |
---|
| 3798 | + if (!ab.hadMaterial) |
---|
| 3799 | + { |
---|
| 3800 | + ab.object.material = null; |
---|
| 3801 | + } |
---|
| 3802 | + |
---|
2957 | 3803 | buttonGroup.remove(ab); |
---|
2958 | 3804 | radioPanel.remove(ab); |
---|
2959 | 3805 | |
---|
2960 | | - ab.GetObject().editWindow = null; |
---|
| 3806 | + //ab.GetObject().editWindow = null; |
---|
| 3807 | + ab.GetObject().manipWindow = null; |
---|
2961 | 3808 | // ab.GetObject().objectUI = null; // ????????? |
---|
2962 | 3809 | |
---|
2963 | 3810 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2964 | 3811 | break; |
---|
2965 | 3812 | } |
---|
2966 | 3813 | } |
---|
| 3814 | + |
---|
| 3815 | + cameraView.requestFocusInWindow(); |
---|
2967 | 3816 | refreshContents(true); |
---|
2968 | 3817 | } else |
---|
2969 | 3818 | if (source == editItem || source == editButton) |
---|
2970 | 3819 | { |
---|
| 3820 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3821 | + { |
---|
| 3822 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3823 | + child.pinned = true; |
---|
| 3824 | + } |
---|
| 3825 | + |
---|
2971 | 3826 | EditSelection(false); |
---|
2972 | 3827 | } else |
---|
2973 | 3828 | if (source == uneditButton) |
---|
.. | .. |
---|
2976 | 3831 | { |
---|
2977 | 3832 | Object3D child = (Object3D)e.nextElement(); |
---|
2978 | 3833 | if(child.editWindow != null) |
---|
2979 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3834 | + child.pinned = false; |
---|
2980 | 3835 | child.CloseUI(); |
---|
2981 | 3836 | listUI.remove(child); |
---|
| 3837 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2982 | 3838 | |
---|
2983 | | - child.editWindow = null; // ??????????? |
---|
| 3839 | + //child.editWindow = null; // ??????????? |
---|
2984 | 3840 | } |
---|
2985 | 3841 | objEditor.ctrlPanel.FlushUI(); |
---|
2986 | 3842 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
2993 | 3849 | //copy.ClearUI(); |
---|
2994 | 3850 | for (Object3D obj : listUI) |
---|
2995 | 3851 | { |
---|
| 3852 | + obj.pinned = false; |
---|
2996 | 3853 | obj.CloseUI(); |
---|
2997 | 3854 | } |
---|
2998 | 3855 | listUI.clear(); |
---|
| 3856 | + SetPinStates(group.selection.size() > 0); |
---|
2999 | 3857 | refreshContents(true); |
---|
3000 | 3858 | } else |
---|
3001 | 3859 | if (source == allParamsButton) |
---|
3002 | 3860 | { |
---|
3003 | 3861 | assert(copy == group); |
---|
3004 | 3862 | |
---|
3005 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3863 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3006 | 3864 | |
---|
3007 | 3865 | for (Object3D obj : listUI) |
---|
3008 | 3866 | { |
---|
.. | .. |
---|
3051 | 3909 | } |
---|
3052 | 3910 | |
---|
3053 | 3911 | copy = group; |
---|
| 3912 | + |
---|
| 3913 | + SetUndoStates(); |
---|
| 3914 | + |
---|
3054 | 3915 | //Globals.theRenderer.object = group; |
---|
3055 | 3916 | if(!useclient) |
---|
3056 | 3917 | { |
---|
.. | .. |
---|
3066 | 3927 | frontView.object = group; |
---|
3067 | 3928 | sideView.object = group; |
---|
3068 | 3929 | } |
---|
3069 | | - group.editWindow = this; |
---|
| 3930 | + |
---|
| 3931 | +// fix "+" issue |
---|
| 3932 | + //group.editWindow = this; |
---|
| 3933 | + group.manipWindow = this; |
---|
| 3934 | + |
---|
3070 | 3935 | /* |
---|
3071 | 3936 | currentLayout = radio.layout; |
---|
3072 | 3937 | if (currentLayout == null) |
---|
3073 | 3938 | currentLayout = sevenButton; |
---|
3074 | 3939 | */ |
---|
3075 | 3940 | radio.layout.doClick(); |
---|
| 3941 | + |
---|
| 3942 | + ClearUnpinned(); |
---|
| 3943 | + |
---|
| 3944 | + //Grafreed.Assert(group != null); |
---|
| 3945 | + //Grafreed.Assert(group.selection != null); |
---|
| 3946 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3947 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3948 | + EditSelection(false); |
---|
3076 | 3949 | keepparent = group.parent; |
---|
3077 | 3950 | // PARENT = NULL or not??? |
---|
3078 | 3951 | //group.parent = null; // ROOT |
---|
3079 | 3952 | //group.attributes = -1; |
---|
3080 | 3953 | ResetModel(); |
---|
| 3954 | + |
---|
| 3955 | + cameraView.requestFocusInWindow(); |
---|
3081 | 3956 | refreshContents(true); |
---|
3082 | | - } |
---|
| 3957 | + } else if (event.getSource() == editCameraItem) |
---|
| 3958 | + { |
---|
| 3959 | + cameraView.ProtectCamera(); |
---|
| 3960 | + cameraView.requestFocusInWindow(); |
---|
| 3961 | + cameraView.repaint(); |
---|
| 3962 | + return; |
---|
| 3963 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3964 | + { |
---|
| 3965 | + cameraView.RevertCamera(); |
---|
| 3966 | + cameraView.requestFocusInWindow(); |
---|
| 3967 | + cameraView.repaint(); |
---|
| 3968 | + return; |
---|
| 3969 | + // } else if (event.getSource() == textureButton) |
---|
| 3970 | + // { |
---|
| 3971 | + // return; // true; |
---|
| 3972 | + } |
---|
3083 | 3973 | else |
---|
3084 | 3974 | { |
---|
3085 | 3975 | //return super.action(event, arg); |
---|
.. | .. |
---|
3088 | 3978 | } |
---|
3089 | 3979 | |
---|
3090 | 3980 | boolean useclient = false; |
---|
3091 | | - cRadio radio; |
---|
3092 | 3981 | |
---|
3093 | 3982 | void ToggleRoot() |
---|
3094 | 3983 | { |
---|
.. | .. |
---|
3140 | 4029 | refreshContents(); |
---|
3141 | 4030 | } |
---|
3142 | 4031 | |
---|
| 4032 | + void TransformChildren() |
---|
| 4033 | + { |
---|
| 4034 | + Object3D obj; |
---|
| 4035 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 4036 | + { |
---|
| 4037 | + obj = (Object3D)e.nextElement(); |
---|
| 4038 | + obj.KeepTextureMatrices(); |
---|
| 4039 | + obj.TransformChildren(); |
---|
| 4040 | + obj.RestoreTextureMatrices(); |
---|
| 4041 | + |
---|
| 4042 | +// if (obj.parent == null) |
---|
| 4043 | +// { |
---|
| 4044 | +// System.out.println("NULL PARENT!"); |
---|
| 4045 | +// new Exception().printStackTrace(); |
---|
| 4046 | +// } |
---|
| 4047 | +// else |
---|
| 4048 | +// TouchTransform(obj); |
---|
| 4049 | +// //obj.parent.Touch(); |
---|
| 4050 | + } |
---|
| 4051 | + |
---|
| 4052 | + refreshContents(); |
---|
| 4053 | + } |
---|
3143 | 4054 | |
---|
3144 | 4055 | void ResetTransform() |
---|
3145 | 4056 | { |
---|
.. | .. |
---|
3252 | 4163 | refreshContents(); |
---|
3253 | 4164 | } |
---|
3254 | 4165 | |
---|
3255 | | - void ResetCentroid() |
---|
| 4166 | + void ResetCentroid(boolean full) |
---|
3256 | 4167 | { |
---|
3257 | 4168 | Object3D obj; |
---|
3258 | 4169 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
3267 | 4178 | LA.matIdentity(Object3D.mat); |
---|
3268 | 4179 | obj.getBounds(minima, maxima, false); |
---|
3269 | 4180 | Object3D.mat[3][0] = -(minima.x + maxima.x)/2; |
---|
3270 | | - Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
| 4181 | + if (full) |
---|
| 4182 | + Object3D.mat[3][1] = -(minima.y + maxima.y)/2; |
---|
3271 | 4183 | Object3D.mat[3][2] = -(minima.z + maxima.z)/2; |
---|
3272 | 4184 | obj.TransformMesh(Object3D.mat); |
---|
| 4185 | + |
---|
3273 | 4186 | Object3D.mat[3][0] = (minima.x + maxima.x)/2; |
---|
3274 | | - Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
| 4187 | + if (full) |
---|
| 4188 | + Object3D.mat[3][1] = (minima.y + maxima.y)/2; |
---|
3275 | 4189 | Object3D.mat[3][2] = (minima.z + maxima.z)/2; |
---|
| 4190 | + |
---|
3276 | 4191 | LA.matConcat(Object3D.mat, obj.toParent, obj.toParent); |
---|
3277 | 4192 | //Object3D.mat[3][0] = -Object3D.mat[3][0]; |
---|
3278 | 4193 | //Object3D.mat[3][1] = -Object3D.mat[3][1]; |
---|
.. | .. |
---|
3301 | 4216 | |
---|
3302 | 4217 | int size = obj.MemorySize(); |
---|
3303 | 4218 | |
---|
3304 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4219 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4220 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3305 | 4221 | } |
---|
3306 | 4222 | } |
---|
3307 | 4223 | catch (Exception e) |
---|
.. | .. |
---|
3338 | 4254 | obj = (Object3D)e.nextElement(); |
---|
3339 | 4255 | |
---|
3340 | 4256 | System.out.println("Object is: " + obj); |
---|
3341 | | - GrafreeD.AnalyzeObject(obj); |
---|
| 4257 | + Grafreed.AnalyzeObject(obj); |
---|
3342 | 4258 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3343 | | - GrafreeD.AnalyzeObject(obj.bRep); |
---|
| 4259 | + Grafreed.AnalyzeObject(obj.bRep); |
---|
3344 | 4260 | |
---|
3345 | 4261 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3346 | 4262 | } |
---|
.. | .. |
---|
3382 | 4298 | void GenNormals(boolean crease) |
---|
3383 | 4299 | { |
---|
3384 | 4300 | group.GenNormalsS(crease); |
---|
| 4301 | + |
---|
| 4302 | + refreshContents(); |
---|
| 4303 | + } |
---|
| 4304 | + |
---|
| 4305 | + void GenNormalsMESH() |
---|
| 4306 | + { |
---|
| 4307 | + group.GenNormalsMeshS(); |
---|
3385 | 4308 | |
---|
3386 | 4309 | refreshContents(); |
---|
3387 | 4310 | } |
---|
.. | .. |
---|
3554 | 4477 | |
---|
3555 | 4478 | void ParseVertices() |
---|
3556 | 4479 | { |
---|
3557 | | - boolean epsequal = GrafreeD.epsequal; |
---|
3558 | | - GrafreeD.epsequal = true; |
---|
| 4480 | + boolean epsequal = Grafreed.epsequal; |
---|
| 4481 | + Grafreed.epsequal = true; |
---|
3559 | 4482 | |
---|
3560 | 4483 | for (int i=0; i<group.selection.size(); i++) |
---|
3561 | 4484 | { |
---|
.. | .. |
---|
3580 | 4503 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3581 | 4504 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3582 | 4505 | |
---|
3583 | | - g.add(GrafreeD.clipboard); |
---|
| 4506 | + g.add(Grafreed.clipboard); |
---|
3584 | 4507 | |
---|
3585 | 4508 | buffer.add(g); |
---|
3586 | 4509 | } |
---|
.. | .. |
---|
3595 | 4518 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3596 | 4519 | } |
---|
3597 | 4520 | |
---|
3598 | | - GrafreeD.epsequal = epsequal; |
---|
| 4521 | + Grafreed.epsequal = epsequal; |
---|
3599 | 4522 | |
---|
3600 | 4523 | refreshContents(); |
---|
3601 | 4524 | } |
---|
.. | .. |
---|
3613 | 4536 | String pigment = Object3D.GetPigment(tex); |
---|
3614 | 4537 | //String bump = Object3D.GetBump(tex); |
---|
3615 | 4538 | |
---|
3616 | | - com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4539 | + com.sun.opengl.util.texture.TextureData texturedata = null; |
---|
| 4540 | + |
---|
| 4541 | + try |
---|
| 4542 | + { |
---|
| 4543 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
| 4544 | + } |
---|
| 4545 | + catch (Exception e) |
---|
| 4546 | + { |
---|
| 4547 | + System.err.println("FAIL: " + node); |
---|
| 4548 | + } |
---|
3617 | 4549 | |
---|
3618 | 4550 | double s = v.s; |
---|
3619 | 4551 | |
---|
.. | .. |
---|
3745 | 4677 | return; |
---|
3746 | 4678 | |
---|
3747 | 4679 | Object3D poses = group.selection.get(0); |
---|
3748 | | - Object3D ref = GrafreeD.clipboard.get(0); |
---|
| 4680 | + Object3D ref = Grafreed.clipboard.get(0); |
---|
3749 | 4681 | |
---|
3750 | 4682 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3751 | 4683 | |
---|
.. | .. |
---|
3939 | 4871 | |
---|
3940 | 4872 | void ClipMesh() |
---|
3941 | 4873 | { |
---|
3942 | | - if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
| 4874 | + if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1) |
---|
3943 | 4875 | { |
---|
3944 | | - Object3D content = GrafreeD.clipboard.get(0); |
---|
| 4876 | + Object3D content = Grafreed.clipboard.get(0); |
---|
3945 | 4877 | |
---|
3946 | 4878 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3947 | 4879 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
3950 | 4882 | // { |
---|
3951 | 4883 | // group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3952 | 4884 | // } |
---|
3953 | | - group.selection.ClipMesh(GrafreeD.clipboard); |
---|
| 4885 | + group.selection.ClipMesh(Grafreed.clipboard); |
---|
3954 | 4886 | } |
---|
3955 | 4887 | // group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3956 | 4888 | System.out.println("DONE."); |
---|
.. | .. |
---|
3997 | 4929 | void MarkLeaves(boolean hide) |
---|
3998 | 4930 | { |
---|
3999 | 4931 | group.selection.MarkLeaves(hide); |
---|
| 4932 | + refreshContents(); |
---|
| 4933 | + } |
---|
| 4934 | + |
---|
| 4935 | + void RewindLeaves(boolean hide) |
---|
| 4936 | + { |
---|
| 4937 | + group.selection.RewindLeaves(hide); |
---|
| 4938 | + refreshContents(); |
---|
| 4939 | + } |
---|
| 4940 | + |
---|
| 4941 | + void RandomLeaves(boolean hide) |
---|
| 4942 | + { |
---|
| 4943 | + group.selection.RandomLeaves(hide); |
---|
4000 | 4944 | refreshContents(); |
---|
4001 | 4945 | } |
---|
4002 | 4946 | |
---|
.. | .. |
---|
4071 | 5015 | // } |
---|
4072 | 5016 | // } |
---|
4073 | 5017 | |
---|
4074 | | - static boolean allparams = true; |
---|
4075 | | - |
---|
4076 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4077 | | - |
---|
4078 | 5018 | void EditSelection(boolean newWindow) |
---|
4079 | 5019 | { |
---|
| 5020 | + if (group.selection == null) |
---|
| 5021 | + { |
---|
| 5022 | + EditElement(group, newWindow); // ? new |
---|
| 5023 | + return; |
---|
| 5024 | + } |
---|
| 5025 | + |
---|
4080 | 5026 | // aConstraints.gridy = 0; |
---|
4081 | 5027 | for (int i=0; i<group.selection.size(); i++) |
---|
4082 | 5028 | { |
---|
4083 | 5029 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4084 | 5030 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4085 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 5031 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4086 | 5032 | |
---|
4087 | 5033 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4088 | | - if(elem != group) |
---|
| 5034 | + if(elem != group || !newWindow) |
---|
4089 | 5035 | { |
---|
4090 | | - // if (!(elem instanceof Composite)) |
---|
4091 | | - // newWindow = false; |
---|
4092 | | - listUI.add(elem); |
---|
4093 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4094 | | - System.out.println("edit : " + elem); |
---|
4095 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5036 | + EditElement(elem, newWindow); // ? new |
---|
4096 | 5037 | } |
---|
4097 | 5038 | } |
---|
4098 | 5039 | } |
---|
.. | .. |
---|
4155 | 5096 | |
---|
4156 | 5097 | freezemodel = false; |
---|
4157 | 5098 | } |
---|
4158 | | - |
---|
4159 | | - boolean flashIt = true; |
---|
4160 | | - |
---|
| 5099 | + |
---|
4161 | 5100 | public void valueChanged(TreeSelectionEvent e) |
---|
4162 | 5101 | //public boolean handleEvent(Event event) |
---|
4163 | 5102 | { |
---|
.. | .. |
---|
4167 | 5106 | //new Exception().printStackTrace(); |
---|
4168 | 5107 | |
---|
4169 | 5108 | freezemodel = true; |
---|
4170 | | - |
---|
| 5109 | + ClearUnpinned(); |
---|
| 5110 | + |
---|
4171 | 5111 | /**/ |
---|
4172 | 5112 | //switch (event.id) |
---|
4173 | 5113 | { |
---|
.. | .. |
---|
4175 | 5115 | //case 702: // Event.LIST_DESELECT |
---|
4176 | 5116 | group.deselectAll(); |
---|
4177 | 5117 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4178 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4179 | 5118 | if (tps != null) |
---|
4180 | 5119 | { |
---|
4181 | 5120 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4184 | 5123 | |
---|
4185 | 5124 | //if (child.parent != null) |
---|
4186 | 5125 | //child.parent.addSelectee(child); |
---|
| 5126 | + objEditor.SetMaterial(child); |
---|
4187 | 5127 | group.addSelectee(child); |
---|
4188 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4189 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4190 | | - System.err.println("info : " + child.GetPath()); |
---|
4191 | 5128 | } |
---|
4192 | 5129 | } |
---|
4193 | 5130 | // else |
---|
.. | .. |
---|
4197 | 5134 | // System.err.println("info : " + group.GetPath()); |
---|
4198 | 5135 | // } |
---|
4199 | 5136 | |
---|
4200 | | - objEditor.SetText(); // jan 2014 |
---|
4201 | | - |
---|
4202 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 5137 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4203 | 5138 | CameraPane.flash = true; |
---|
4204 | 5139 | |
---|
4205 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 5140 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4206 | 5141 | // a camera |
---|
4207 | 5142 | { |
---|
4208 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4209 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5143 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5144 | + { |
---|
| 5145 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 5146 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5147 | + } |
---|
4210 | 5148 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4211 | 5149 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4212 | 5150 | } |
---|
4213 | 5151 | |
---|
| 5152 | + if (tps != null && tps.length == 1) |
---|
| 5153 | + { |
---|
| 5154 | + EditSelection(false); |
---|
| 5155 | + } |
---|
| 5156 | + |
---|
| 5157 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5158 | + |
---|
4214 | 5159 | refreshContents(); |
---|
4215 | 5160 | //return true; |
---|
4216 | 5161 | } |
---|
.. | .. |
---|
4219 | 5164 | |
---|
4220 | 5165 | freezemodel = false; |
---|
4221 | 5166 | } |
---|
| 5167 | + |
---|
| 5168 | + void SetPinStates(boolean enabled) |
---|
| 5169 | + { |
---|
| 5170 | + editButton.setEnabled(enabled); |
---|
| 5171 | + uneditButton.setEnabled(enabled); |
---|
| 5172 | + unselectButton.setEnabled(enabled); |
---|
| 5173 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5174 | + |
---|
| 5175 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5176 | + } |
---|
| 5177 | + |
---|
| 5178 | + void refreshContents(boolean cp) |
---|
| 5179 | + { |
---|
| 5180 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5181 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 5182 | + { |
---|
| 5183 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 5184 | + |
---|
| 5185 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 5186 | + { |
---|
| 5187 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 5188 | + |
---|
| 5189 | + objEditor.AddInfo(child, this, true); |
---|
| 5190 | + System.err.println("info : " + child.GetPath()); |
---|
| 5191 | + } |
---|
| 5192 | + |
---|
| 5193 | + objEditor.SetText(); // jan 2014 |
---|
| 5194 | + } |
---|
| 5195 | + |
---|
| 5196 | + super.refreshContents(cp); |
---|
| 5197 | + } |
---|
4222 | 5198 | |
---|
4223 | 5199 | void linkSomething(Object3D thing) |
---|
4224 | 5200 | { |
---|
.. | .. |
---|
4290 | 5266 | { |
---|
4291 | 5267 | if (group.selection.isEmpty()) |
---|
4292 | 5268 | return; |
---|
4293 | | - GrafreeD.clipboardIsTempGroup = false; |
---|
| 5269 | + |
---|
| 5270 | + Grafreed.clipboardIsTempGroup = false; |
---|
4294 | 5271 | Composite tGroup = null; |
---|
4295 | 5272 | if (group.selection.size() > 0) // 1) |
---|
4296 | 5273 | { |
---|
4297 | 5274 | tGroup = new cGroup(); |
---|
4298 | | - GrafreeD.clipboardIsTempGroup = true; |
---|
| 5275 | + Grafreed.clipboardIsTempGroup = true; |
---|
4299 | 5276 | } |
---|
4300 | 5277 | |
---|
4301 | 5278 | if (cut) |
---|
4302 | 5279 | { |
---|
| 5280 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5281 | +// Save(); |
---|
4303 | 5282 | //int indices[] = jList.getSelectedIndices(); |
---|
4304 | 5283 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4305 | 5284 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4335 | 5314 | //System.out.println("cut " + child); |
---|
4336 | 5315 | //System.out.println("parent = " + child.parent); |
---|
4337 | 5316 | // tmp.addChild(child); |
---|
4338 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5317 | + if (Grafreed.clipboardIsTempGroup) |
---|
4339 | 5318 | tGroup.add/*Child*/(tmp); |
---|
4340 | 5319 | else |
---|
4341 | | - GrafreeD.clipboard = tmp; |
---|
| 5320 | + Grafreed.clipboard = tmp; |
---|
4342 | 5321 | } |
---|
4343 | 5322 | else |
---|
4344 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5323 | + if (Grafreed.clipboardIsTempGroup) |
---|
4345 | 5324 | tGroup.add/*Child*/(child); |
---|
4346 | 5325 | else |
---|
4347 | | - GrafreeD.clipboard = child; |
---|
| 5326 | + Grafreed.clipboard = child; |
---|
4348 | 5327 | } |
---|
4349 | 5328 | |
---|
4350 | 5329 | //ResetModel(); |
---|
.. | .. |
---|
4376 | 5355 | //System.out.println("cut " + elem); |
---|
4377 | 5356 | //System.out.println("parent = " + elem.parent); |
---|
4378 | 5357 | // tmp.addChild(elem); |
---|
4379 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5358 | + if (Grafreed.clipboardIsTempGroup) |
---|
4380 | 5359 | tGroup.add/*Child*/(tmp); |
---|
4381 | 5360 | else |
---|
4382 | | - GrafreeD.clipboard = tmp; |
---|
| 5361 | + Grafreed.clipboard = tmp; |
---|
4383 | 5362 | } |
---|
4384 | 5363 | else |
---|
4385 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5364 | + if (Grafreed.clipboardIsTempGroup) |
---|
4386 | 5365 | tGroup.add/*Child*/(child); |
---|
4387 | 5366 | else |
---|
4388 | | - GrafreeD.clipboard = child; |
---|
| 5367 | + Grafreed.clipboard = child; |
---|
4389 | 5368 | } |
---|
4390 | 5369 | |
---|
4391 | 5370 | } |
---|
4392 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
4393 | | - GrafreeD.clipboard = tGroup; |
---|
| 5371 | + |
---|
| 5372 | + if (Grafreed.clipboardIsTempGroup) |
---|
| 5373 | + Grafreed.clipboard = tGroup; |
---|
| 5374 | + |
---|
4394 | 5375 | if (cut) |
---|
4395 | 5376 | { |
---|
4396 | 5377 | ResetModel(); |
---|
.. | .. |
---|
4400 | 5381 | |
---|
4401 | 5382 | void paste(boolean expand) |
---|
4402 | 5383 | { |
---|
| 5384 | + if (Globals.REPLACEONMAKE) |
---|
| 5385 | + Save(); |
---|
| 5386 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5387 | + Globals.REPLACEONMAKE = false; |
---|
4403 | 5388 | // if (GrafreeD.clipboard == null) |
---|
4404 | 5389 | // return; |
---|
4405 | 5390 | boolean first = true; |
---|
4406 | 5391 | |
---|
4407 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5392 | + if (Grafreed.clipboardIsTempGroup) |
---|
4408 | 5393 | { |
---|
4409 | 5394 | Composite temp; |
---|
4410 | 5395 | |
---|
.. | .. |
---|
4415 | 5400 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4416 | 5401 | */ |
---|
4417 | 5402 | Object3D elem; |
---|
4418 | | - for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 5403 | + for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4419 | 5404 | { |
---|
4420 | 5405 | Object3D child = (Object3D)e.nextElement(); |
---|
4421 | 5406 | |
---|
.. | .. |
---|
4449 | 5434 | //Object3D cb = Applet3D.clipboard; |
---|
4450 | 5435 | //temp.addChild(cb); |
---|
4451 | 5436 | //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0)); |
---|
4452 | | - assert(GrafreeD.clipboard.parent == null); |
---|
4453 | | - Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
4454 | | - GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
4455 | | - if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
4456 | | - makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
| 5437 | + assert(Grafreed.clipboard.parent == null); |
---|
| 5438 | + Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent; |
---|
| 5439 | + Grafreed.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 5440 | + if (LA.isIdentity(Grafreed.clipboard.toParent)) |
---|
| 5441 | + makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy()); |
---|
4457 | 5442 | else |
---|
4458 | | - makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
4459 | | - GrafreeD.clipboard.get(0).parent = keepparent; |
---|
| 5443 | + makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy()); |
---|
| 5444 | + Grafreed.clipboard.get(0).parent = keepparent; |
---|
4460 | 5445 | } |
---|
4461 | 5446 | |
---|
| 5447 | + Globals.REPLACEONMAKE = keep; |
---|
4462 | 5448 | ResetModel(); |
---|
4463 | 5449 | refreshContents(); |
---|
4464 | 5450 | } |
---|
.. | .. |
---|
4505 | 5491 | { |
---|
4506 | 5492 | boolean first = true; |
---|
4507 | 5493 | |
---|
4508 | | - if (GrafreeD.clipboardIsTempGroup) |
---|
| 5494 | + if (Grafreed.clipboardIsTempGroup) |
---|
4509 | 5495 | { |
---|
4510 | | - Composite temp = (Composite)GrafreeD.clipboard; |
---|
| 5496 | + Composite temp = (Composite)Grafreed.clipboard; |
---|
4511 | 5497 | Object3D copy; |
---|
4512 | 5498 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4513 | 5499 | { |
---|
.. | .. |
---|
4517 | 5503 | } |
---|
4518 | 5504 | } else |
---|
4519 | 5505 | { |
---|
4520 | | - linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
| 5506 | + linkSomething(Grafreed.clipboard); //.get(0)); |
---|
4521 | 5507 | } |
---|
4522 | 5508 | } |
---|
4523 | 5509 | } |
---|
.. | .. |
---|
4594 | 5580 | |
---|
4595 | 5581 | void group(Object3D csg, boolean grab) |
---|
4596 | 5582 | { |
---|
| 5583 | + if (Globals.REPLACEONMAKE) |
---|
| 5584 | + Save(); |
---|
| 5585 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5586 | + Globals.REPLACEONMAKE = false; |
---|
4597 | 5587 | if (//false) // why?? |
---|
4598 | 5588 | !group.selection.isEmpty()) |
---|
4599 | 5589 | { |
---|
.. | .. |
---|
4707 | 5697 | //node.add(csg); |
---|
4708 | 5698 | //makeSomething(node); |
---|
4709 | 5699 | makeSomething(csg); |
---|
| 5700 | + Globals.REPLACEONMAKE = keep; |
---|
4710 | 5701 | } |
---|
4711 | 5702 | |
---|
4712 | 5703 | void Ungroup(Object3D g) |
---|
4713 | 5704 | { |
---|
| 5705 | + if (Globals.REPLACEONMAKE) |
---|
| 5706 | + Save(); |
---|
| 5707 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5708 | + Globals.REPLACEONMAKE = false; |
---|
4714 | 5709 | if (g instanceof HiddenObject) |
---|
4715 | 5710 | { |
---|
4716 | 5711 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4727 | 5722 | objEditor.makeSomething(g.get(i), false); |
---|
4728 | 5723 | } |
---|
4729 | 5724 | } |
---|
| 5725 | + Globals.REPLACEONMAKE = keep; |
---|
4730 | 5726 | } |
---|
4731 | 5727 | |
---|
4732 | 5728 | void ungroup() |
---|
.. | .. |
---|
4922 | 5918 | } |
---|
4923 | 5919 | */ |
---|
4924 | 5920 | |
---|
4925 | | - void ImportGFD() |
---|
4926 | | - { |
---|
4927 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4928 | | - browser.show(); |
---|
4929 | | - String filename = browser.getFile(); |
---|
4930 | | - if (filename != null && filename.length() > 0) |
---|
4931 | | - { |
---|
4932 | | - String fullname = browser.getDirectory() + filename; |
---|
4933 | | - |
---|
4934 | | - //Object3D readobj = |
---|
4935 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4936 | | - //makeSomething(readobj); |
---|
4937 | | - } |
---|
4938 | | - } |
---|
4939 | | - |
---|
4940 | 5921 | /* |
---|
4941 | 5922 | public void Callback(Object obj) |
---|
4942 | 5923 | { |
---|
.. | .. |
---|
4960 | 5941 | } |
---|
4961 | 5942 | */ |
---|
4962 | 5943 | |
---|
4963 | | - void ImportVRMLX3D() |
---|
4964 | | - { |
---|
4965 | | - if (GrafreeD.standAlone) |
---|
4966 | | - { |
---|
4967 | | - /**/ |
---|
4968 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
4969 | | - browser.show(); |
---|
4970 | | - String filename = browser.getFile(); |
---|
4971 | | - if (filename != null && filename.length() > 0) |
---|
4972 | | - { |
---|
4973 | | - String fullname = browser.getDirectory() + filename; |
---|
4974 | | - LoadVRMLX3D(fullname); |
---|
4975 | | - } |
---|
4976 | | - /**/ |
---|
4977 | | - } |
---|
4978 | | - } |
---|
4979 | | - |
---|
4980 | 5944 | String GetFile(String dialogName) |
---|
4981 | 5945 | { |
---|
4982 | | - if (GrafreeD.standAlone) |
---|
| 5946 | + if (Grafreed.standAlone) |
---|
4983 | 5947 | { |
---|
4984 | 5948 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4985 | 5949 | browser.show(); |
---|
.. | .. |
---|
5047 | 6011 | cButton clearpanelButton; |
---|
5048 | 6012 | cButton unselectButton; |
---|
5049 | 6013 | |
---|
| 6014 | + cButton restoreCameraButton; |
---|
| 6015 | + |
---|
5050 | 6016 | cButton oneStepButton; |
---|
| 6017 | + |
---|
| 6018 | + cButton groupButton; |
---|
| 6019 | + cButton ungroupButton; |
---|
| 6020 | + cButton compositeButton; |
---|
| 6021 | + cButton switchButton; |
---|
| 6022 | + cButton loopButton; |
---|
| 6023 | + cButton textureButton; |
---|
| 6024 | + |
---|
| 6025 | + cButton skybox1Button; |
---|
| 6026 | + cButton skybox2Button; |
---|
| 6027 | + cButton skybox3Button; |
---|
| 6028 | + cButton skybox4Button; |
---|
| 6029 | + cButton skybox5Button; |
---|
| 6030 | + cButton skybox6Button; |
---|
| 6031 | + cButton skybox7Button; |
---|
| 6032 | + |
---|
| 6033 | + cButton skybox11Button; |
---|
| 6034 | + cButton skybox12Button; |
---|
| 6035 | + cButton skybox13Button; |
---|
| 6036 | + cButton skybox14Button; |
---|
| 6037 | + cButton skybox15Button; |
---|
| 6038 | + cButton skybox16Button; |
---|
| 6039 | + cButton skybox17Button; |
---|
| 6040 | + |
---|
| 6041 | + cButton gridButton; |
---|
| 6042 | + cButton boxButton; |
---|
| 6043 | + cButton sphereButton; |
---|
| 6044 | + cButton coneButton; |
---|
| 6045 | + cButton torusButton; |
---|
| 6046 | + cButton superButton; |
---|
| 6047 | + cButton kleinButton; |
---|
| 6048 | + cButton particlesButton; |
---|
| 6049 | + cButton overlayButton; |
---|
| 6050 | + cButton lightButton; |
---|
5051 | 6051 | |
---|
5052 | 6052 | cButton screenfitButton; |
---|
5053 | 6053 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5060 | 6060 | |
---|
5061 | 6061 | cButton setsupportButton; |
---|
5062 | 6062 | |
---|
5063 | | - cButton twoButton; |
---|
5064 | | - cButton sixButton; |
---|
5065 | | - cButton threeButton; |
---|
5066 | | - cButton sevenButton; |
---|
5067 | | - cButton fourButton; // full panel |
---|
5068 | | - cButton oneButton; // full XYZ |
---|
5069 | | - //cButton currentLayout; |
---|
5070 | | - |
---|
5071 | 6063 | // |
---|
5072 | 6064 | //Composite |
---|
5073 | 6065 | Object3D // to do !! |
---|
.. | .. |
---|
5077 | 6069 | //JTree jTree; |
---|
5078 | 6070 | private MenuItem lookAtItem; |
---|
5079 | 6071 | private MenuItem lookFromItem; |
---|
5080 | | - private MenuItem switchItem; |
---|
| 6072 | + private MenuItem switchViewItem; |
---|
5081 | 6073 | private MenuItem cutItem; |
---|
5082 | | - private MenuItem duplicateItem; |
---|
| 6074 | + private MenuItem undoItem; |
---|
| 6075 | + private MenuItem redoItem; |
---|
| 6076 | + private JMenuItem duplicateItem; |
---|
5083 | 6077 | private MenuItem cloneItem; |
---|
5084 | 6078 | private MenuItem cloneSupportItem; |
---|
5085 | 6079 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5092 | 6086 | private MenuItem linkverticesItem; |
---|
5093 | 6087 | private MenuItem relinkverticesItem; |
---|
5094 | 6088 | private MenuItem setMasterItem; |
---|
5095 | | - private MenuItem resetMeshItem; |
---|
| 6089 | + private MenuItem resetAllItem; |
---|
5096 | 6090 | private MenuItem stepAllItem; |
---|
5097 | 6091 | private MenuItem revertMeshItem; |
---|
5098 | 6092 | private MenuItem poseMeshItem; |
---|
.. | .. |
---|
5107 | 6101 | private MenuItem pasteLinkItem; |
---|
5108 | 6102 | private MenuItem pasteCloneItem; |
---|
5109 | 6103 | private MenuItem pasteExpandItem; |
---|
5110 | | - private MenuItem clearItem; |
---|
| 6104 | + private MenuItem deleteItem; |
---|
5111 | 6105 | private MenuItem clearAllItem; |
---|
5112 | 6106 | private MenuItem genUVItem; |
---|
5113 | 6107 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5142 | 6136 | private MenuItem showleavesItem; |
---|
5143 | 6137 | private MenuItem markleavesItem; |
---|
5144 | 6138 | private MenuItem unmarkleavesItem; |
---|
| 6139 | + private MenuItem rewindleavesItem; |
---|
| 6140 | + private MenuItem unrewindleavesItem; |
---|
| 6141 | + private MenuItem randomleavesItem; |
---|
| 6142 | + private MenuItem unrandomleavesItem; |
---|
5145 | 6143 | |
---|
5146 | 6144 | private MenuItem flipVItem; |
---|
5147 | 6145 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5153 | 6151 | private MenuItem panoTexturesItem; |
---|
5154 | 6152 | |
---|
5155 | 6153 | private MenuItem resetCentroidItem; |
---|
5156 | | - private MenuItem transformgeometryItem; |
---|
| 6154 | + private MenuItem resetCentroidXZItem; |
---|
5157 | 6155 | private MenuItem resetTransformItem; |
---|
| 6156 | + private MenuItem transformGeometryItem; |
---|
| 6157 | + private MenuItem transformChildrenItem; |
---|
5158 | 6158 | private MenuItem hideItem; |
---|
5159 | 6159 | private MenuItem grabItem; |
---|
5160 | 6160 | private MenuItem backItem; |
---|
5161 | 6161 | private MenuItem frontItem; |
---|
5162 | 6162 | private MenuItem cameraItem; |
---|
5163 | 6163 | private MenuItem compositeItem; |
---|
5164 | | - private MenuItem randomItem; |
---|
| 6164 | + private MenuItem switchItem; |
---|
5165 | 6165 | private MenuItem physicsItem; |
---|
5166 | 6166 | private MenuItem frameselectorItem; |
---|
5167 | 6167 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5185 | 6185 | private MenuItem attachBumpItem; |
---|
5186 | 6186 | private MenuItem detachBumpItem; |
---|
5187 | 6187 | private MenuItem pigmentBumpItem; |
---|
| 6188 | + private MenuItem embedTexturesItem; |
---|
| 6189 | + private MenuItem deEmbedTexturesItem; |
---|
5188 | 6190 | |
---|
5189 | 6191 | private MenuItem particleItem; |
---|
5190 | 6192 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5223 | 6225 | private MenuItem doubleItem; |
---|
5224 | 6226 | private MenuItem tripleItem; |
---|
5225 | 6227 | |
---|
5226 | | - private MenuItem importGFDItem; |
---|
5227 | | - private MenuItem importVRMLX3DItem; |
---|
5228 | | - private MenuItem import3DSItem; |
---|
5229 | | - private MenuItem importOBJItem; |
---|
5230 | | - |
---|
5231 | 6228 | private MenuItem computeAOItem; |
---|
5232 | 6229 | private MenuItem recompileItem; |
---|
5233 | 6230 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5237 | 6234 | private MenuItem analyzeItem; |
---|
5238 | 6235 | private MenuItem dumpItem; |
---|
5239 | 6236 | //boolean freezemodel = false; |
---|
| 6237 | + |
---|
| 6238 | + Menu cameraMenu; |
---|
| 6239 | + MenuItem editCameraItem; |
---|
| 6240 | + MenuItem restoreCameraItem; |
---|
5240 | 6241 | } |
---|