.. | .. |
---|
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 | } |
---|
.. | .. |
---|
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) |
---|
.. | .. |
---|
189 | 504 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
190 | 505 | // pasteExpandItem.addActionListener(this); |
---|
191 | 506 | menu.add("-"); |
---|
192 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
193 | | - clearItem.addActionListener(this); |
---|
| 507 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 508 | + deleteItem.addActionListener(this); |
---|
194 | 509 | |
---|
195 | 510 | if (Globals.ADVANCED) |
---|
196 | 511 | { |
---|
.. | .. |
---|
220 | 535 | // toggleSwitchItem.addItemListener(this); |
---|
221 | 536 | // toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
222 | 537 | |
---|
223 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 538 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
224 | 539 | toggleHandleItem.addItemListener(this); |
---|
225 | 540 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
226 | 541 | |
---|
.. | .. |
---|
380 | 695 | shadowYItem.addActionListener(this); |
---|
381 | 696 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
382 | 697 | shadowZItem.addActionListener(this); |
---|
| 698 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 699 | + attributeItem.addActionListener(this); |
---|
| 700 | + |
---|
383 | 701 | if (Globals.ADVANCED) |
---|
384 | 702 | { |
---|
385 | 703 | menu.add("-"); |
---|
386 | 704 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
387 | 705 | linkerItem.addActionListener(this); |
---|
388 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
389 | | - attributeItem.addActionListener(this); |
---|
390 | 706 | templateItem = menu.add(new MenuItem("Template")); |
---|
391 | 707 | templateItem.addActionListener(this); |
---|
392 | 708 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
415 | 731 | genNormalsMESHItem.addActionListener(this); |
---|
416 | 732 | if (Globals.ADVANCED) |
---|
417 | 733 | { |
---|
418 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 734 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
419 | 735 | genNormalsMINEItem.addActionListener(this); |
---|
420 | 736 | } |
---|
421 | 737 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
508 | 824 | attachBumpItem.addActionListener(this); |
---|
509 | 825 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
510 | 826 | pigmentBumpItem.addActionListener(this); |
---|
| 827 | + //embedTexturesItem |
---|
511 | 828 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
512 | 829 | detachPigmentItem.addActionListener(this); |
---|
513 | 830 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
514 | 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); |
---|
515 | 836 | menu.add("-"); |
---|
516 | 837 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
517 | 838 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
538 | 859 | buildToolsMenu(menu); |
---|
539 | 860 | } |
---|
540 | 861 | |
---|
| 862 | + |
---|
541 | 863 | void SetupUI2(ObjEditor oe) |
---|
542 | 864 | { |
---|
543 | 865 | // June 2019 |
---|
.. | .. |
---|
590 | 912 | //minButton.setToolTipText("Minimize window"); |
---|
591 | 913 | //minButton.addActionListener(this); |
---|
592 | 914 | |
---|
593 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
594 | | - maxButton.setToolTipText("Maximize window"); |
---|
595 | | - maxButton.addActionListener(this); |
---|
| 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 | + } |
---|
596 | 921 | |
---|
597 | 922 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
598 | 923 | fullButton.setToolTipText("Full-screen window"); |
---|
599 | 924 | fullButton.addActionListener(this); |
---|
600 | 925 | |
---|
| 926 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 927 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 928 | + screenfitButton.addActionListener(this); |
---|
| 929 | + |
---|
601 | 930 | oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
602 | 931 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
603 | 932 | restoreCameraButton.addActionListener(this); |
---|
604 | 933 | |
---|
605 | | - copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
606 | | - undoButton.setToolTipText("Undo changes"); |
---|
607 | | - undoButton.addActionListener(this); |
---|
608 | | - undoButton.setEnabled(false); |
---|
| 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); |
---|
609 | 946 | |
---|
610 | | - copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
611 | | - redoButton.setToolTipText("Redo changes"); |
---|
612 | | - redoButton.addActionListener(this); |
---|
613 | | - redoButton.setEnabled(false); |
---|
| 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); |
---|
614 | 952 | |
---|
615 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
616 | | - saveButton.setToolTipText("Save changes"); |
---|
617 | | - saveButton.addActionListener(this); |
---|
| 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); |
---|
618 | 957 | |
---|
619 | | - copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 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); |
---|
620 | 966 | liveCB.setToolTipText("Enable animation"); |
---|
621 | 967 | liveCB.addItemListener(this); |
---|
622 | 968 | |
---|
623 | | - copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 969 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
624 | 970 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
625 | 971 | oneStepButton.addActionListener(this); |
---|
626 | 972 | |
---|
627 | | - copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 973 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
628 | 974 | fastCB.setToolTipText("Fast mode"); |
---|
629 | 975 | fastCB.addItemListener(this); |
---|
630 | 976 | |
---|
631 | 977 | //oe.toolboxPanel.Return(); |
---|
632 | 978 | |
---|
633 | | - copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
635 | | - screenfitButton.addActionListener(this); |
---|
636 | | - |
---|
637 | 979 | // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
638 | 980 | // trackCB.setToolTipText("Enable tracking"); |
---|
639 | 981 | // trackCB.addItemListener(this); |
---|
.. | .. |
---|
646 | 988 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
647 | 989 | snapobjectButton.addActionListener(this); |
---|
648 | 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"); |
---|
649 | 995 | } |
---|
650 | 996 | |
---|
651 | 997 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
652 | 998 | |
---|
653 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
654 | | - 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"); |
---|
655 | 1001 | twoButton.addActionListener(this); |
---|
656 | 1002 | this.fullscreenLayout = twoButton; |
---|
657 | 1003 | |
---|
658 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
659 | | - fourButton.addActionListener(this); |
---|
660 | | - fourButton.setToolTipText("Show left panel only"); |
---|
661 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
662 | | - sixButton.setToolTipText("2-column layout left"); |
---|
663 | | - sixButton.addActionListener(this); |
---|
664 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
665 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 1004 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1005 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
666 | 1006 | threeButton.addActionListener(this); |
---|
667 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
668 | | - sevenButton.setToolTipText("3-column layout"); |
---|
669 | | - 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); |
---|
670 | 1013 | // |
---|
671 | 1014 | |
---|
672 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
673 | | - 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"); |
---|
674 | 1017 | rootButton.addActionListener(this); |
---|
675 | 1018 | |
---|
676 | 1019 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
679 | 1022 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
680 | 1023 | //clearButton.addActionListener(this); |
---|
681 | 1024 | |
---|
| 1025 | + cGridBag row1 = new cGridBag(); |
---|
| 1026 | + |
---|
682 | 1027 | // INSERT |
---|
683 | | - oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1028 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
684 | 1029 | gridButton.setToolTipText("Create grid"); |
---|
685 | 1030 | gridButton.addActionListener(this); |
---|
686 | 1031 | |
---|
687 | | - oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1032 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
688 | 1033 | boxButton.setToolTipText("Create box"); |
---|
689 | 1034 | boxButton.addActionListener(this); |
---|
690 | 1035 | |
---|
691 | | - oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1036 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
692 | 1037 | sphereButton.setToolTipText("Create sphere"); |
---|
693 | 1038 | sphereButton.addActionListener(this); |
---|
694 | 1039 | |
---|
695 | | - oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1040 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
696 | 1041 | coneButton.setToolTipText("Create cone"); |
---|
697 | 1042 | coneButton.addActionListener(this); |
---|
698 | 1043 | |
---|
699 | | - oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1044 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
700 | 1045 | torusButton.setToolTipText("Create torus"); |
---|
701 | 1046 | torusButton.addActionListener(this); |
---|
702 | 1047 | |
---|
703 | | - oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1048 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
704 | 1049 | superButton.setToolTipText("Create superellipsoid"); |
---|
705 | 1050 | superButton.addActionListener(this); |
---|
706 | 1051 | |
---|
.. | .. |
---|
711 | 1056 | kleinButton.addActionListener(this); |
---|
712 | 1057 | } |
---|
713 | 1058 | |
---|
714 | | - oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1059 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
715 | 1060 | particlesButton.setToolTipText("Create particle system"); |
---|
716 | 1061 | particlesButton.addActionListener(this); |
---|
717 | 1062 | |
---|
718 | | - oe.toolboxPanel.Return(); |
---|
| 1063 | + oe.toolboxPanel.add(row1); |
---|
719 | 1064 | |
---|
720 | | - oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1065 | + cGridBag row2 = new cGridBag(); |
---|
| 1066 | + |
---|
| 1067 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
721 | 1068 | groupButton.setToolTipText("Create group"); |
---|
722 | 1069 | groupButton.addActionListener(this); |
---|
723 | 1070 | |
---|
724 | | - oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1071 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
725 | 1072 | compositeButton.setToolTipText("Create composite"); |
---|
726 | 1073 | compositeButton.addActionListener(this); |
---|
727 | 1074 | |
---|
728 | | - oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
729 | | - switchButton.setToolTipText("Create switch"); |
---|
| 1075 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1076 | + switchButton.setToolTipText("Create item switcher"); |
---|
730 | 1077 | switchButton.addActionListener(this); |
---|
731 | 1078 | |
---|
732 | | - oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1079 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
733 | 1080 | loopButton.setToolTipText("Create loop"); |
---|
734 | 1081 | loopButton.addActionListener(this); |
---|
735 | 1082 | |
---|
736 | | - oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1083 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
737 | 1084 | textureButton.setToolTipText("Create texture"); |
---|
738 | 1085 | textureButton.addActionListener(this); |
---|
739 | 1086 | |
---|
740 | | - oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1087 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
741 | 1088 | overlayButton.setToolTipText("Create overlay"); |
---|
742 | 1089 | overlayButton.addActionListener(this); |
---|
743 | 1090 | |
---|
744 | | - oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1091 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
745 | 1092 | lightButton.setToolTipText("Create light"); |
---|
746 | 1093 | lightButton.addActionListener(this); |
---|
747 | 1094 | |
---|
748 | | - for (int i=6; --i>=0;) |
---|
749 | | - { |
---|
750 | | - oe.toolboxPanel.Return(); |
---|
751 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
752 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
753 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
754 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
755 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
756 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
757 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
758 | | - } |
---|
| 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); |
---|
759 | 1110 | |
---|
760 | 1111 | // EDIT panel |
---|
761 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
762 | | - editButton.setToolTipText("Edit selection"); |
---|
| 1112 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + editButton.setToolTipText("Pin selection controls"); |
---|
763 | 1114 | editButton.addActionListener(this); |
---|
764 | 1115 | |
---|
765 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
766 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 1116 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1117 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
767 | 1118 | uneditButton.addActionListener(this); |
---|
768 | 1119 | |
---|
769 | 1120 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
770 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 1121 | + allParamsButton.setToolTipText("Show all controle"); |
---|
771 | 1122 | allParamsButton.addActionListener(this); |
---|
772 | 1123 | |
---|
773 | | - editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1124 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
774 | 1125 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
775 | 1126 | clearPanelButton.addActionListener(this); |
---|
776 | 1127 | |
---|
.. | .. |
---|
784 | 1135 | |
---|
785 | 1136 | editCommandsPanel.preferredHeight = 1; |
---|
786 | 1137 | |
---|
| 1138 | + SetPinStates(false); |
---|
787 | 1139 | // oe.treePanel.add(commandsPanel); |
---|
788 | 1140 | // oe.treePanel.Return(); |
---|
789 | 1141 | |
---|
.. | .. |
---|
810 | 1162 | |
---|
811 | 1163 | oe.treePanel.add(copyOptionsPanel); |
---|
812 | 1164 | oe.treePanel.Return(); |
---|
| 1165 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1166 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1167 | + sliderPane.preferredHeight = 1; |
---|
813 | 1168 | |
---|
814 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
815 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1169 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1170 | + mainPanel.setResizeWeight(0.4); |
---|
816 | 1171 | |
---|
817 | 1172 | //jList.addListSelectionListener(this); |
---|
818 | 1173 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
820 | 1175 | //jTree.setEditable(true); |
---|
821 | 1176 | oe.jTree.setDragEnabled(true); |
---|
822 | 1177 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
823 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1178 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
824 | 1179 | |
---|
825 | 1180 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
826 | 1181 | |
---|
.. | .. |
---|
832 | 1187 | dgr.addDragGestureListener(this); |
---|
833 | 1188 | }catch(Exception e) {} |
---|
834 | 1189 | */ |
---|
835 | | - radio.layout = sevenButton; |
---|
| 1190 | + radio.layout = threeButton; // sixButton; |
---|
836 | 1191 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
837 | 1192 | } |
---|
838 | 1193 | |
---|
.. | .. |
---|
857 | 1212 | boxCB.addItemListener(this); |
---|
858 | 1213 | |
---|
859 | 1214 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
860 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1215 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
861 | 1216 | zoomBoxCB.addItemListener(this); |
---|
862 | 1217 | |
---|
863 | 1218 | if (true) // Globals.ADVANCED) |
---|
864 | 1219 | { |
---|
865 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
866 | | - supportCB.setToolTipText("Enable rigging"); |
---|
867 | | - 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); |
---|
868 | 1227 | |
---|
869 | 1228 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
870 | 1229 | // localCB.addItemListener(this); |
---|
.. | .. |
---|
879 | 1238 | smoothCB.setToolTipText("Snapping delay"); |
---|
880 | 1239 | smoothCB.addItemListener(this); |
---|
881 | 1240 | |
---|
882 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
883 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
884 | | - 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); |
---|
885 | 1247 | |
---|
886 | 1248 | // constraints.gridy += 1; |
---|
887 | 1249 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
.. | .. |
---|
919 | 1281 | oeilCB.addItemListener(this); |
---|
920 | 1282 | |
---|
921 | 1283 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
922 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 1284 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
923 | 1285 | shadowCB.addItemListener(this); |
---|
924 | 1286 | |
---|
925 | 1287 | panel.Return(); |
---|
.. | .. |
---|
928 | 1290 | toggleTextureCB.addItemListener(this); |
---|
929 | 1291 | |
---|
930 | 1292 | panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
931 | | - toggleSwitchCB.setToolTipText("Use switch"); |
---|
| 1293 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
932 | 1294 | toggleSwitchCB.addItemListener(this); |
---|
933 | 1295 | |
---|
934 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
935 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
936 | | - autosaveCB.addItemListener(this); |
---|
| 1296 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1297 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1298 | + autokeepCB.addItemListener(this); |
---|
937 | 1299 | |
---|
938 | 1300 | panel.Return(); |
---|
939 | 1301 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
962 | 1324 | { |
---|
963 | 1325 | cRadio radioButton = new cRadio(obj.name); |
---|
964 | 1326 | |
---|
965 | | - // Patch to avoid bug with transparency. |
---|
| 1327 | + // June 2019. Patch to avoid bug with transparency. |
---|
966 | 1328 | radioButton.hadMaterial = obj.material != null; |
---|
967 | 1329 | if (!radioButton.hadMaterial) |
---|
968 | 1330 | { |
---|
.. | .. |
---|
970 | 1332 | } |
---|
971 | 1333 | |
---|
972 | 1334 | radioButton.SetObject(obj); |
---|
973 | | - radioButton.layout = sevenButton; |
---|
| 1335 | + radioButton.layout = threeButton; // sixButton; |
---|
974 | 1336 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
975 | 1337 | radioButton.addActionListener(this); |
---|
976 | 1338 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
995 | 1357 | cCheckBox localCB; |
---|
996 | 1358 | cCheckBox crowdCB; |
---|
997 | 1359 | cCheckBox smoothCB; |
---|
| 1360 | + cCheckBox minshaderCB; |
---|
| 1361 | + |
---|
998 | 1362 | cToggleButton fastCB; |
---|
999 | 1363 | cCheckBox slowCB; |
---|
1000 | 1364 | cCheckBox boxCB; |
---|
1001 | 1365 | cCheckBox zoomBoxCB; |
---|
| 1366 | + cCheckBox freezeCB; |
---|
1002 | 1367 | //cToggleButton trackCB; |
---|
1003 | 1368 | cCheckBox trackCB; |
---|
1004 | 1369 | cCheckBox smoothfocusCB; |
---|
.. | .. |
---|
1009 | 1374 | |
---|
1010 | 1375 | cCheckBox oeilCB; |
---|
1011 | 1376 | cCheckBox shadowCB; |
---|
1012 | | - cCheckBox autosaveCB; |
---|
| 1377 | + cCheckBox autokeepCB; |
---|
1013 | 1378 | cCheckBox lookAtCB; |
---|
1014 | 1379 | |
---|
1015 | 1380 | // static int COLOR = 1; |
---|
.. | .. |
---|
1065 | 1430 | cameraView.ToggleInertia(); |
---|
1066 | 1431 | cameraView.repaint(); |
---|
1067 | 1432 | } |
---|
| 1433 | + else if(e.getSource() == minshaderCB) |
---|
| 1434 | + { |
---|
| 1435 | + Globals.MINSHADER ^= true; |
---|
| 1436 | + cameraView.programInitialized = false; |
---|
| 1437 | + cameraView.repaint(); |
---|
| 1438 | + } |
---|
1068 | 1439 | else if(e.getSource() == localCB) |
---|
1069 | 1440 | { |
---|
1070 | 1441 | cameraView.ToggleLocal(); |
---|
.. | .. |
---|
1117 | 1488 | { |
---|
1118 | 1489 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
1119 | 1490 | } |
---|
1120 | | - else if(e.getSource() == autosaveCB) |
---|
| 1491 | + else if(e.getSource() == freezeCB) |
---|
1121 | 1492 | { |
---|
1122 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1493 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1494 | + } |
---|
| 1495 | + else if(e.getSource() == autokeepCB) |
---|
| 1496 | + { |
---|
| 1497 | + Globals.REPLACEONMAKE ^= true; |
---|
1123 | 1498 | } |
---|
1124 | 1499 | else if(e.getSource() == lookAtCB) |
---|
1125 | 1500 | { |
---|
.. | .. |
---|
1201 | 1576 | } |
---|
1202 | 1577 | } |
---|
1203 | 1578 | |
---|
1204 | | - String string = (String) object; |
---|
1205 | | - |
---|
1206 | 1579 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1207 | 1580 | // if( object instanceof java.io.File[]) |
---|
1208 | 1581 | // { |
---|
.. | .. |
---|
1210 | 1583 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1211 | 1584 | // return; |
---|
1212 | 1585 | // } |
---|
| 1586 | + |
---|
| 1587 | + String string = object.toString(); |
---|
1213 | 1588 | |
---|
1214 | 1589 | // File path for Mac and Windows |
---|
1215 | 1590 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1459 | 1834 | animationItem.addItemListener(this); |
---|
1460 | 1835 | animationItem.setState(Globals.ANIMATION); |
---|
1461 | 1836 | |
---|
| 1837 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1838 | + archiveItem.addActionListener(this); |
---|
| 1839 | + |
---|
1462 | 1840 | menu.add("-"); |
---|
1463 | 1841 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1464 | 1842 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1471 | 1849 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1472 | 1850 | reduce34MorphItem.addActionListener(this); |
---|
1473 | 1851 | menu.add("-"); |
---|
| 1852 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1853 | + memoryItem.addActionListener(this); |
---|
1474 | 1854 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1475 | 1855 | computeAOItem.addActionListener(this); |
---|
1476 | 1856 | |
---|
.. | .. |
---|
1479 | 1859 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1480 | 1860 | mirrorItem.addActionListener(this); |
---|
1481 | 1861 | menu.add("-"); |
---|
1482 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1483 | | - memoryItem.addActionListener(this); |
---|
1484 | 1862 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1485 | 1863 | analyzeItem.addActionListener(this); |
---|
1486 | 1864 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1628 | 2006 | |
---|
1629 | 2007 | makeSomething(shadow); |
---|
1630 | 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 | + } |
---|
1631 | 2033 | |
---|
1632 | 2034 | /** |
---|
1633 | 2035 | * applyExample |
---|
.. | .. |
---|
2056 | 2458 | { |
---|
2057 | 2459 | makeSomething(new Light()); |
---|
2058 | 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 |
---|
2059 | 2478 | if (source == csgItem) |
---|
2060 | 2479 | { |
---|
2061 | 2480 | group(new CSG()); |
---|
.. | .. |
---|
2107 | 2526 | Composite csg = new GroupLeaf(); |
---|
2108 | 2527 | csg.count = 5; |
---|
2109 | 2528 | group(csg); |
---|
2110 | | - Composite child = new cGroup(); |
---|
| 2529 | + Composite child = new cGroup("Branch"); |
---|
2111 | 2530 | csg.addChild(child); |
---|
2112 | 2531 | child.addChild(csg); |
---|
2113 | 2532 | } else |
---|
2114 | 2533 | if (source == doubleItem) |
---|
2115 | 2534 | { |
---|
2116 | | - Composite csg = new GroupLeaf(); |
---|
| 2535 | + Composite csg = new GroupLeaf("Fork"); |
---|
2117 | 2536 | csg.count = 5; |
---|
2118 | 2537 | group(csg); |
---|
2119 | | - Composite child = new cGroup(); |
---|
| 2538 | + Composite child = new cGroup("Branch A"); |
---|
2120 | 2539 | csg.addChild(child); |
---|
2121 | 2540 | child.addChild(csg); |
---|
2122 | | - child = new cGroup(); |
---|
| 2541 | + child = new cGroup("Branch B"); |
---|
2123 | 2542 | csg.addChild(child); |
---|
2124 | 2543 | child.addChild(csg); |
---|
2125 | 2544 | } else |
---|
2126 | 2545 | if (source == tripleItem) |
---|
2127 | 2546 | { |
---|
2128 | | - Composite csg = new GroupLeaf(); |
---|
| 2547 | + Composite csg = new GroupLeaf("Trident"); |
---|
2129 | 2548 | csg.count = 4; |
---|
2130 | 2549 | group(csg); |
---|
2131 | 2550 | Composite child = new cGroup(); |
---|
.. | .. |
---|
2141 | 2560 | if (source == computeAOItem) |
---|
2142 | 2561 | { |
---|
2143 | 2562 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
2144 | | - Globals.theRenderer.repaint(); |
---|
| 2563 | + cameraView.repaint(); |
---|
2145 | 2564 | } else |
---|
2146 | 2565 | if (source == recompileItem) |
---|
2147 | 2566 | { |
---|
.. | .. |
---|
2156 | 2575 | if (source == invariantsItem) |
---|
2157 | 2576 | { |
---|
2158 | 2577 | System.out.println("Invariants:"); |
---|
2159 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2578 | + Grafreed.grafreed.universe.invariants(); |
---|
2160 | 2579 | } else |
---|
2161 | 2580 | if (source == memoryItem) |
---|
2162 | 2581 | { |
---|
.. | .. |
---|
2187 | 2606 | { |
---|
2188 | 2607 | ToggleFullScreen(); |
---|
2189 | 2608 | } else |
---|
2190 | | - if (source == undoButton) |
---|
| 2609 | + if (source == previousVersionButton) |
---|
2191 | 2610 | { |
---|
2192 | | - Undo(); |
---|
| 2611 | + // Go to previous version |
---|
| 2612 | + //if (!Undo()) |
---|
| 2613 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2614 | + PreviousVersion(); |
---|
2193 | 2615 | } else |
---|
2194 | | - if (source == redoButton) |
---|
| 2616 | + if (source == restoreButton) |
---|
2195 | 2617 | { |
---|
2196 | | - Redo(); |
---|
| 2618 | + // Restore current version |
---|
| 2619 | + Restore(); |
---|
| 2620 | + //restoreButton.setEnabled(false); |
---|
2197 | 2621 | } else |
---|
2198 | | - if (source == saveButton) |
---|
| 2622 | + if (source == replaceButton) |
---|
2199 | 2623 | { |
---|
2200 | | - Save(); |
---|
| 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(); |
---|
2201 | 2643 | } else |
---|
2202 | 2644 | if (source == oneStepButton) |
---|
2203 | 2645 | { |
---|
.. | .. |
---|
2206 | 2648 | } else |
---|
2207 | 2649 | if (source == screenfitButton) |
---|
2208 | 2650 | { |
---|
2209 | | - //Reload(lastConverter, lastFilename, true); |
---|
2210 | 2651 | ScreenFit(); |
---|
2211 | 2652 | } else |
---|
2212 | 2653 | if (source == screenfitpointButton) |
---|
2213 | 2654 | { |
---|
2214 | | - //Reload(lastConverter, lastFilename, true); |
---|
2215 | 2655 | ScreenFitPoint(); |
---|
2216 | 2656 | } else |
---|
2217 | 2657 | if (source == snapobjectButton) |
---|
2218 | 2658 | { |
---|
2219 | | - //Reload(lastConverter, lastFilename, true); |
---|
2220 | 2659 | SnapObject(); |
---|
2221 | 2660 | } else |
---|
2222 | 2661 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2255 | 2694 | } else |
---|
2256 | 2695 | if (source == undoItem) |
---|
2257 | 2696 | { |
---|
2258 | | - Undo(); |
---|
| 2697 | + PreviousVersion(); |
---|
2259 | 2698 | } else |
---|
2260 | 2699 | if (source == redoItem) |
---|
2261 | 2700 | { |
---|
2262 | | - Redo(); |
---|
| 2701 | + NextVersion(); |
---|
2263 | 2702 | } else |
---|
2264 | 2703 | if (source == duplicateItem) |
---|
2265 | 2704 | { |
---|
.. | .. |
---|
2580 | 3019 | { |
---|
2581 | 3020 | StepAll(); |
---|
2582 | 3021 | } else |
---|
2583 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 3022 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2584 | 3023 | { |
---|
2585 | 3024 | //int indices[] = jList.getSelectedIndices(); |
---|
2586 | 3025 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2740 | 3179 | } else |
---|
2741 | 3180 | if (source == ungroupItem || source == ungroupButton) |
---|
2742 | 3181 | { |
---|
2743 | | - //ungroup(); |
---|
| 3182 | + boolean hasRoot = false; |
---|
| 3183 | + |
---|
2744 | 3184 | for (int i=0; i<group.selection.size(); i++) |
---|
2745 | 3185 | { |
---|
2746 | | - Ungroup(group.selection.get(i)); |
---|
| 3186 | + if (group.selection.get(i) == group) |
---|
| 3187 | + { |
---|
| 3188 | + hasRoot = true; |
---|
| 3189 | + break; |
---|
| 3190 | + } |
---|
2747 | 3191 | } |
---|
2748 | 3192 | |
---|
2749 | | - ClearSelection(false); |
---|
2750 | | - |
---|
2751 | | - 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 | + } |
---|
2752 | 3204 | } else |
---|
2753 | 3205 | if (source == genUVItem) |
---|
2754 | 3206 | { |
---|
.. | .. |
---|
3049 | 3501 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3050 | 3502 | { |
---|
3051 | 3503 | obj = (Object3D)e.nextElement(); |
---|
3052 | | - obj.SetBumpTexture(null); |
---|
| 3504 | + obj.ResetBumpTexture(); |
---|
3053 | 3505 | } |
---|
3054 | 3506 | |
---|
3055 | 3507 | refreshContents(); |
---|
.. | .. |
---|
3063 | 3515 | obj.SetBumpTexture(obj.GetPigmentTexture()); |
---|
3064 | 3516 | } |
---|
3065 | 3517 | |
---|
| 3518 | + refreshContents(); |
---|
| 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 | + |
---|
3066 | 3543 | refreshContents(); |
---|
3067 | 3544 | } else |
---|
3068 | 3545 | if (source == flashSelectionButton) |
---|
.. | .. |
---|
3166 | 3643 | // centralPanel.setVisible(true); |
---|
3167 | 3644 | // XYZPanel.setVisible(true); |
---|
3168 | 3645 | bigThree.ClearUI(); |
---|
| 3646 | + bigThree.add(scenePanel); |
---|
3169 | 3647 | bigThree.add(centralPanel); |
---|
3170 | | - bigThree.add(XYZPanel); |
---|
3171 | 3648 | bigThree.FlushUI(); |
---|
3172 | 3649 | |
---|
3173 | 3650 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3247 | 3724 | // centralPanel.setVisible(true); |
---|
3248 | 3725 | // XYZPanel.setVisible(false); |
---|
3249 | 3726 | bigThree.ClearUI(); |
---|
3250 | | - bigThree.add(scenePanel); |
---|
3251 | 3727 | bigThree.add(centralPanel); |
---|
| 3728 | + bigThree.add(scenePanel); |
---|
3252 | 3729 | bigThree.FlushUI(); |
---|
3253 | 3730 | |
---|
3254 | 3731 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3354 | 3831 | { |
---|
3355 | 3832 | Object3D child = (Object3D)e.nextElement(); |
---|
3356 | 3833 | if(child.editWindow != null) |
---|
3357 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3358 | 3834 | child.pinned = false; |
---|
3359 | 3835 | child.CloseUI(); |
---|
3360 | 3836 | listUI.remove(child); |
---|
| 3837 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3361 | 3838 | |
---|
3362 | 3839 | //child.editWindow = null; // ??????????? |
---|
3363 | 3840 | } |
---|
.. | .. |
---|
3372 | 3849 | //copy.ClearUI(); |
---|
3373 | 3850 | for (Object3D obj : listUI) |
---|
3374 | 3851 | { |
---|
3375 | | - obj.pinned = true; |
---|
| 3852 | + obj.pinned = false; |
---|
3376 | 3853 | obj.CloseUI(); |
---|
3377 | 3854 | } |
---|
3378 | 3855 | listUI.clear(); |
---|
| 3856 | + SetPinStates(group.selection.size() > 0); |
---|
3379 | 3857 | refreshContents(true); |
---|
3380 | 3858 | } else |
---|
3381 | 3859 | if (source == allParamsButton) |
---|
.. | .. |
---|
3431 | 3909 | } |
---|
3432 | 3910 | |
---|
3433 | 3911 | copy = group; |
---|
| 3912 | + |
---|
| 3913 | + SetUndoStates(); |
---|
| 3914 | + |
---|
3434 | 3915 | //Globals.theRenderer.object = group; |
---|
3435 | 3916 | if(!useclient) |
---|
3436 | 3917 | { |
---|
.. | .. |
---|
3457 | 3938 | currentLayout = sevenButton; |
---|
3458 | 3939 | */ |
---|
3459 | 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); |
---|
3460 | 3949 | keepparent = group.parent; |
---|
3461 | 3950 | // PARENT = NULL or not??? |
---|
3462 | 3951 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3468 | 3957 | } else if (event.getSource() == editCameraItem) |
---|
3469 | 3958 | { |
---|
3470 | 3959 | cameraView.ProtectCamera(); |
---|
| 3960 | + cameraView.requestFocusInWindow(); |
---|
3471 | 3961 | cameraView.repaint(); |
---|
3472 | 3962 | return; |
---|
3473 | 3963 | } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3474 | 3964 | { |
---|
3475 | 3965 | cameraView.RevertCamera(); |
---|
| 3966 | + cameraView.requestFocusInWindow(); |
---|
3476 | 3967 | cameraView.repaint(); |
---|
3477 | 3968 | return; |
---|
3478 | 3969 | // } else if (event.getSource() == textureButton) |
---|
.. | .. |
---|
4049 | 4540 | |
---|
4050 | 4541 | try |
---|
4051 | 4542 | { |
---|
4052 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4543 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
4053 | 4544 | } |
---|
4054 | 4545 | catch (Exception e) |
---|
4055 | 4546 | { |
---|
.. | .. |
---|
4526 | 5017 | |
---|
4527 | 5018 | void EditSelection(boolean newWindow) |
---|
4528 | 5019 | { |
---|
| 5020 | + if (group.selection == null) |
---|
| 5021 | + { |
---|
| 5022 | + EditElement(group, newWindow); // ? new |
---|
| 5023 | + return; |
---|
| 5024 | + } |
---|
| 5025 | + |
---|
4529 | 5026 | // aConstraints.gridy = 0; |
---|
4530 | 5027 | for (int i=0; i<group.selection.size(); i++) |
---|
4531 | 5028 | { |
---|
.. | .. |
---|
4536 | 5033 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4537 | 5034 | if(elem != group || !newWindow) |
---|
4538 | 5035 | { |
---|
4539 | | - // if (!(elem instanceof Composite)) |
---|
4540 | | - // newWindow = false; |
---|
4541 | | - listUI.add(elem); |
---|
4542 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4543 | | - System.out.println("edit : " + elem); |
---|
4544 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5036 | + EditElement(elem, newWindow); // ? new |
---|
4545 | 5037 | } |
---|
4546 | 5038 | } |
---|
4547 | 5039 | } |
---|
.. | .. |
---|
4604 | 5096 | |
---|
4605 | 5097 | freezemodel = false; |
---|
4606 | 5098 | } |
---|
4607 | | - |
---|
4608 | | - boolean flashIt = true; |
---|
4609 | | - |
---|
| 5099 | + |
---|
4610 | 5100 | public void valueChanged(TreeSelectionEvent e) |
---|
4611 | 5101 | //public boolean handleEvent(Event event) |
---|
4612 | 5102 | { |
---|
.. | .. |
---|
4616 | 5106 | //new Exception().printStackTrace(); |
---|
4617 | 5107 | |
---|
4618 | 5108 | freezemodel = true; |
---|
4619 | | - |
---|
4620 | | - //for (Object3D obj : listUI) |
---|
4621 | | - for (int i=listUI.size(); --i>=0;) |
---|
4622 | | - { |
---|
4623 | | - Object3D obj = listUI.elementAt(i); |
---|
4624 | | - if (!obj.pinned) |
---|
4625 | | - { |
---|
4626 | | - obj.CloseUI(); |
---|
4627 | | - listUI.remove(i); |
---|
4628 | | - } |
---|
4629 | | - } |
---|
| 5109 | + ClearUnpinned(); |
---|
4630 | 5110 | |
---|
4631 | 5111 | /**/ |
---|
4632 | 5112 | //switch (event.id) |
---|
.. | .. |
---|
4689 | 5169 | { |
---|
4690 | 5170 | editButton.setEnabled(enabled); |
---|
4691 | 5171 | uneditButton.setEnabled(enabled); |
---|
| 5172 | + unselectButton.setEnabled(enabled); |
---|
| 5173 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5174 | + |
---|
| 5175 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
4692 | 5176 | } |
---|
4693 | 5177 | |
---|
4694 | 5178 | void refreshContents(boolean cp) |
---|
4695 | 5179 | { |
---|
4696 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
4697 | | - if (!Globals.MOUSEDRAGGED) // && !Globals.TIMERRUNNING) |
---|
| 5180 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5181 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4698 | 5182 | { |
---|
4699 | 5183 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4700 | 5184 | |
---|
.. | .. |
---|
4793 | 5277 | |
---|
4794 | 5278 | if (cut) |
---|
4795 | 5279 | { |
---|
4796 | | - if (Globals.SAVEONMAKE) |
---|
4797 | | - Save(); |
---|
| 5280 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5281 | +// Save(); |
---|
4798 | 5282 | //int indices[] = jList.getSelectedIndices(); |
---|
4799 | 5283 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4800 | 5284 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4897 | 5381 | |
---|
4898 | 5382 | void paste(boolean expand) |
---|
4899 | 5383 | { |
---|
| 5384 | + if (Globals.REPLACEONMAKE) |
---|
| 5385 | + Save(); |
---|
| 5386 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5387 | + Globals.REPLACEONMAKE = false; |
---|
4900 | 5388 | // if (GrafreeD.clipboard == null) |
---|
4901 | 5389 | // return; |
---|
4902 | 5390 | boolean first = true; |
---|
.. | .. |
---|
4956 | 5444 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4957 | 5445 | } |
---|
4958 | 5446 | |
---|
| 5447 | + Globals.REPLACEONMAKE = keep; |
---|
4959 | 5448 | ResetModel(); |
---|
4960 | 5449 | refreshContents(); |
---|
4961 | 5450 | } |
---|
.. | .. |
---|
5091 | 5580 | |
---|
5092 | 5581 | void group(Object3D csg, boolean grab) |
---|
5093 | 5582 | { |
---|
| 5583 | + if (Globals.REPLACEONMAKE) |
---|
| 5584 | + Save(); |
---|
| 5585 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5586 | + Globals.REPLACEONMAKE = false; |
---|
5094 | 5587 | if (//false) // why?? |
---|
5095 | 5588 | !group.selection.isEmpty()) |
---|
5096 | 5589 | { |
---|
.. | .. |
---|
5204 | 5697 | //node.add(csg); |
---|
5205 | 5698 | //makeSomething(node); |
---|
5206 | 5699 | makeSomething(csg); |
---|
| 5700 | + Globals.REPLACEONMAKE = keep; |
---|
5207 | 5701 | } |
---|
5208 | 5702 | |
---|
5209 | 5703 | void Ungroup(Object3D g) |
---|
5210 | 5704 | { |
---|
| 5705 | + if (Globals.REPLACEONMAKE) |
---|
| 5706 | + Save(); |
---|
| 5707 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5708 | + Globals.REPLACEONMAKE = false; |
---|
5211 | 5709 | if (g instanceof HiddenObject) |
---|
5212 | 5710 | { |
---|
5213 | 5711 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5224 | 5722 | objEditor.makeSomething(g.get(i), false); |
---|
5225 | 5723 | } |
---|
5226 | 5724 | } |
---|
| 5725 | + Globals.REPLACEONMAKE = keep; |
---|
5227 | 5726 | } |
---|
5228 | 5727 | |
---|
5229 | 5728 | void ungroup() |
---|
.. | .. |
---|
5514 | 6013 | |
---|
5515 | 6014 | cButton restoreCameraButton; |
---|
5516 | 6015 | |
---|
5517 | | - cButton minButton; |
---|
5518 | | - cButton maxButton; |
---|
5519 | | - cButton fullButton; |
---|
5520 | | - cButton saveButton; |
---|
5521 | 6016 | cButton oneStepButton; |
---|
5522 | 6017 | |
---|
5523 | 6018 | cButton groupButton; |
---|
.. | .. |
---|
5526 | 6021 | cButton switchButton; |
---|
5527 | 6022 | cButton loopButton; |
---|
5528 | 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; |
---|
5529 | 6040 | |
---|
5530 | 6041 | cButton gridButton; |
---|
5531 | 6042 | cButton boxButton; |
---|
.. | .. |
---|
5590 | 6101 | private MenuItem pasteLinkItem; |
---|
5591 | 6102 | private MenuItem pasteCloneItem; |
---|
5592 | 6103 | private MenuItem pasteExpandItem; |
---|
5593 | | - private MenuItem clearItem; |
---|
| 6104 | + private MenuItem deleteItem; |
---|
5594 | 6105 | private MenuItem clearAllItem; |
---|
5595 | 6106 | private MenuItem genUVItem; |
---|
5596 | 6107 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5674 | 6185 | private MenuItem attachBumpItem; |
---|
5675 | 6186 | private MenuItem detachBumpItem; |
---|
5676 | 6187 | private MenuItem pigmentBumpItem; |
---|
| 6188 | + private MenuItem embedTexturesItem; |
---|
| 6189 | + private MenuItem deEmbedTexturesItem; |
---|
5677 | 6190 | |
---|
5678 | 6191 | private MenuItem particleItem; |
---|
5679 | 6192 | private MenuItem ragdollItem; |
---|