.. | .. |
---|
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.versions == null) |
---|
| 360 | + { |
---|
| 361 | + copy.versions = new byte[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.versions == null) |
---|
| 387 | + { |
---|
| 388 | + copy.versions = new byte[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) |
---|
.. | .. |
---|
150 | 465 | |
---|
151 | 466 | void SetupMenu2(GroupEditor oe) |
---|
152 | 467 | { |
---|
| 468 | + oe.jTree = new cTree(); |
---|
| 469 | + |
---|
153 | 470 | Menu menu; |
---|
154 | 471 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
155 | 472 | //editItem = menu.add(new MenuItem("Edit")); |
---|
.. | .. |
---|
160 | 477 | // redoItem = menu.add(new MenuItem("Redo")); |
---|
161 | 478 | // redoItem.addActionListener(this); |
---|
162 | 479 | // menu.add("-"); |
---|
163 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 480 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
164 | 481 | duplicateItem.addActionListener(this); |
---|
165 | 482 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
166 | 483 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
187 | 504 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
188 | 505 | // pasteExpandItem.addActionListener(this); |
---|
189 | 506 | menu.add("-"); |
---|
190 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
191 | | - clearItem.addActionListener(this); |
---|
| 507 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 508 | + deleteItem.addActionListener(this); |
---|
192 | 509 | |
---|
193 | 510 | if (Globals.ADVANCED) |
---|
194 | 511 | { |
---|
.. | .. |
---|
202 | 519 | //zBufferItem.addActionListener(this); |
---|
203 | 520 | //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
204 | 521 | //normalLensItem.addActionListener(this); |
---|
205 | | - cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint")); |
---|
206 | | - revertCameraItem.addActionListener(this); |
---|
| 522 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 523 | + restoreCameraItem.addActionListener(this); |
---|
207 | 524 | |
---|
208 | | - cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
209 | | - toggleFullScreenItem.addItemListener(this); |
---|
210 | | - toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
211 | | - cameraMenu.add("-"); |
---|
| 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); |
---|
212 | 537 | |
---|
213 | | - cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
214 | | - toggleTextureItem.addItemListener(this); |
---|
215 | | - toggleTextureItem.setState(CameraPane.textureon); |
---|
216 | | - |
---|
217 | | - cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
218 | | - toggleSwitchItem.addItemListener(this); |
---|
219 | | - toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
220 | | - |
---|
221 | | - cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles")); |
---|
| 538 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
222 | 539 | toggleHandleItem.addItemListener(this); |
---|
223 | 540 | toggleHandleItem.setState(CameraPane.HANDLES); |
---|
224 | 541 | |
---|
.. | .. |
---|
273 | 590 | { |
---|
274 | 591 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
275 | 592 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
276 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
| 593 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
277 | 594 | editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
278 | 595 | oe.cameraMenu.add("-"); |
---|
279 | 596 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
.. | .. |
---|
281 | 598 | editLeafItem.addActionListener(this); |
---|
282 | 599 | lookAtItem.addActionListener(this); |
---|
283 | 600 | //lookFromItem.addActinoListener(this); |
---|
284 | | - //switchItem.addActionListener(this); |
---|
| 601 | + //switchViewItem.addActionListener(this); |
---|
285 | 602 | } |
---|
286 | 603 | |
---|
287 | 604 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
.. | .. |
---|
326 | 643 | } |
---|
327 | 644 | |
---|
328 | 645 | oe.menuBar.add(menu = new Menu("Group")); |
---|
329 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
330 | | - grabItem.addActionListener(this); |
---|
| 646 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 647 | +// grabItem.addActionListener(this); |
---|
331 | 648 | backItem = menu.add(new MenuItem("Back")); |
---|
332 | 649 | backItem.addActionListener(this); |
---|
333 | 650 | frontItem = menu.add(new MenuItem("Front")); |
---|
334 | 651 | frontItem.addActionListener(this); |
---|
335 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
336 | | - compositeItem.addActionListener(this); |
---|
| 652 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 653 | +// compositeItem.addActionListener(this); |
---|
| 654 | + |
---|
| 655 | + if (Globals.ADVANCED) |
---|
| 656 | + { |
---|
337 | 657 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
338 | 658 | hideItem.addActionListener(this); |
---|
| 659 | + } |
---|
339 | 660 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
340 | 661 | ungroupItem.addActionListener(this); |
---|
341 | | - menu.add("-"); |
---|
342 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
343 | | - 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 | + { |
---|
344 | 669 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
345 | 670 | switchGeoItem.addActionListener(this); |
---|
346 | 671 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
348 | 673 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
349 | 674 | morphItem.addActionListener(this); |
---|
350 | 675 | |
---|
351 | | - if (Globals.ADVANCED) |
---|
352 | | - { |
---|
353 | 676 | menu.add("-"); |
---|
354 | 677 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
355 | 678 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
357 | 680 | frameselectorItem.addActionListener(this); |
---|
358 | 681 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
359 | 682 | scriptNodeItem.addActionListener(this); |
---|
360 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
361 | | - cameraItem.addActionListener(this); |
---|
362 | 683 | } |
---|
363 | 684 | |
---|
364 | 685 | oe.menuBar.add(menu = new Menu("Object")); |
---|
365 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
366 | | - textureItem.addActionListener(this); |
---|
| 686 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 687 | +// textureItem.addActionListener(this); |
---|
367 | 688 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
368 | 689 | billboardItem.addActionListener(this); |
---|
369 | 690 | csgItem = menu.add(new MenuItem("CSG")); |
---|
.. | .. |
---|
374 | 695 | shadowYItem.addActionListener(this); |
---|
375 | 696 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
376 | 697 | shadowZItem.addActionListener(this); |
---|
| 698 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 699 | + attributeItem.addActionListener(this); |
---|
| 700 | + |
---|
377 | 701 | if (Globals.ADVANCED) |
---|
378 | 702 | { |
---|
379 | 703 | menu.add("-"); |
---|
380 | 704 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
381 | 705 | linkerItem.addActionListener(this); |
---|
382 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
383 | | - attributeItem.addActionListener(this); |
---|
384 | 706 | templateItem = menu.add(new MenuItem("Template")); |
---|
385 | 707 | templateItem.addActionListener(this); |
---|
386 | 708 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
409 | 731 | genNormalsMESHItem.addActionListener(this); |
---|
410 | 732 | if (Globals.ADVANCED) |
---|
411 | 733 | { |
---|
412 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 734 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
413 | 735 | genNormalsMINEItem.addActionListener(this); |
---|
414 | 736 | } |
---|
415 | 737 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
502 | 824 | attachBumpItem.addActionListener(this); |
---|
503 | 825 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
504 | 826 | pigmentBumpItem.addActionListener(this); |
---|
| 827 | + //embedTexturesItem |
---|
505 | 828 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
506 | 829 | detachPigmentItem.addActionListener(this); |
---|
507 | 830 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
508 | 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); |
---|
509 | 836 | menu.add("-"); |
---|
510 | 837 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
511 | 838 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
532 | 859 | buildToolsMenu(menu); |
---|
533 | 860 | } |
---|
534 | 861 | |
---|
| 862 | + |
---|
535 | 863 | void SetupUI2(ObjEditor oe) |
---|
536 | 864 | { |
---|
537 | 865 | // June 2019 |
---|
.. | .. |
---|
574 | 902 | oe.radioPanel.add(dummyButton); |
---|
575 | 903 | oe.buttonGroup.add(dummyButton); |
---|
576 | 904 | */ |
---|
| 905 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 906 | + |
---|
| 907 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 908 | + |
---|
577 | 909 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
578 | 910 | |
---|
579 | 911 | //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
580 | 912 | //minButton.setToolTipText("Minimize window"); |
---|
581 | 913 | //minButton.addActionListener(this); |
---|
582 | 914 | |
---|
583 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
584 | | - maxButton.setToolTipText("Maximize window"); |
---|
585 | | - 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 | + } |
---|
586 | 921 | |
---|
587 | 922 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
588 | 923 | fullButton.setToolTipText("Full-screen window"); |
---|
589 | 924 | fullButton.addActionListener(this); |
---|
590 | 925 | |
---|
591 | | - oe.toolbarPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
592 | | - undoButton.setToolTipText("Undo changes"); |
---|
593 | | - undoButton.addActionListener(this); |
---|
| 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); |
---|
594 | 933 | |
---|
595 | | - oe.toolbarPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
596 | | - redoButton.setToolTipText("Redo changes"); |
---|
597 | | - redoButton.addActionListener(this); |
---|
598 | | - |
---|
599 | | - oe.toolbarPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
600 | | - saveButton.setToolTipText("Save changes"); |
---|
| 934 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 935 | + saveButton.setToolTipText("New version"); |
---|
601 | 936 | saveButton.addActionListener(this); |
---|
| 937 | + |
---|
| 938 | + copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 939 | + undoButton.setToolTipText("Previous version"); |
---|
| 940 | + undoButton.addActionListener(this); |
---|
| 941 | + undoButton.setEnabled(false); |
---|
602 | 942 | |
---|
603 | | - oe.toolbarPanel.add(liveCB = GetCheckBox("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 943 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 944 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 945 | + restoreButton.setToolTipText("Restore current"); |
---|
| 946 | + restoreButton.addActionListener(this); |
---|
| 947 | + restoreButton.setEnabled(false); |
---|
| 948 | + |
---|
| 949 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 950 | + replaceButton.setToolTipText("Replace current"); |
---|
| 951 | + replaceButton.addActionListener(this); |
---|
| 952 | + replaceButton.setEnabled(false); |
---|
| 953 | + |
---|
| 954 | + copyOptionsPanel.add(updown); |
---|
| 955 | + |
---|
| 956 | + copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 957 | + redoButton.setToolTipText("Next version"); |
---|
| 958 | + redoButton.addActionListener(this); |
---|
| 959 | + redoButton.setEnabled(false); |
---|
| 960 | + |
---|
| 961 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
604 | 962 | liveCB.setToolTipText("Enable animation"); |
---|
605 | 963 | liveCB.addItemListener(this); |
---|
606 | 964 | |
---|
607 | | - oe.toolbarPanel.add(fastCB = GetCheckBox("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
608 | | - fastCB.setToolTipText("Fast mode"); |
---|
609 | | - fastCB.addItemListener(this); |
---|
610 | | - |
---|
611 | 965 | oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
612 | 966 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
613 | 967 | oneStepButton.addActionListener(this); |
---|
614 | 968 | |
---|
615 | | - oe.toolbarPanel.add(trackCB = GetCheckBox("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
616 | | - trackCB.setToolTipText("Enable tracking"); |
---|
617 | | - trackCB.addItemListener(this); |
---|
618 | | - |
---|
619 | | - oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
620 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
621 | | - screenfitButton.addActionListener(this); |
---|
| 969 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 970 | + fastCB.setToolTipText("Fast mode"); |
---|
| 971 | + fastCB.addItemListener(this); |
---|
| 972 | + |
---|
| 973 | + //oe.toolboxPanel.Return(); |
---|
| 974 | + |
---|
| 975 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 976 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 977 | +// trackCB.addItemListener(this); |
---|
622 | 978 | |
---|
623 | 979 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
624 | 980 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
628 | 984 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
629 | 985 | snapobjectButton.addActionListener(this); |
---|
630 | 986 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 987 | + |
---|
| 988 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 989 | + fourButton.addActionListener(this); |
---|
| 990 | + fourButton.setToolTipText("Show control panel only"); |
---|
631 | 991 | } |
---|
632 | 992 | |
---|
633 | | - oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
634 | | - flashSelectionButton.setToolTipText("Highlight selection"); |
---|
635 | | - flashSelectionButton.addActionListener(this); |
---|
| 993 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
636 | 994 | |
---|
637 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
638 | | - |
---|
639 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
640 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 995 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 996 | + twoButton.setToolTipText("Show 3D view only"); |
---|
641 | 997 | twoButton.addActionListener(this); |
---|
642 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
643 | | - fourButton.addActionListener(this); |
---|
644 | | - fourButton.setToolTipText("Show left panel only"); |
---|
645 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
646 | | - sixButton.setToolTipText("2-column layout left"); |
---|
647 | | - sixButton.addActionListener(this); |
---|
648 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
649 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 998 | + this.fullscreenLayout = twoButton; |
---|
| 999 | + |
---|
| 1000 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1001 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
650 | 1002 | threeButton.addActionListener(this); |
---|
651 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
652 | | - sevenButton.setToolTipText("3-column layout"); |
---|
653 | | - sevenButton.addActionListener(this); |
---|
| 1003 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1004 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1005 | + sixButton.addActionListener(this); |
---|
| 1006 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1007 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1008 | +// sevenButton.addActionListener(this); |
---|
654 | 1009 | // |
---|
655 | 1010 | |
---|
656 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
657 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 1011 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1012 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
658 | 1013 | rootButton.addActionListener(this); |
---|
659 | 1014 | |
---|
660 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1015 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
661 | 1016 | closeButton.setToolTipText("Close tab"); |
---|
662 | 1017 | closeButton.addActionListener(this); |
---|
663 | 1018 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
664 | 1019 | //clearButton.addActionListener(this); |
---|
665 | | - |
---|
666 | | - editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
667 | | - editButton.setToolTipText("Edit selection"); |
---|
| 1020 | + |
---|
| 1021 | + cGridBag row1 = new cGridBag(); |
---|
| 1022 | + |
---|
| 1023 | + // INSERT |
---|
| 1024 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1025 | + gridButton.setToolTipText("Create grid"); |
---|
| 1026 | + gridButton.addActionListener(this); |
---|
| 1027 | + |
---|
| 1028 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1029 | + boxButton.setToolTipText("Create box"); |
---|
| 1030 | + boxButton.addActionListener(this); |
---|
| 1031 | + |
---|
| 1032 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1033 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1034 | + sphereButton.addActionListener(this); |
---|
| 1035 | + |
---|
| 1036 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1037 | + coneButton.setToolTipText("Create cone"); |
---|
| 1038 | + coneButton.addActionListener(this); |
---|
| 1039 | + |
---|
| 1040 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1041 | + torusButton.setToolTipText("Create torus"); |
---|
| 1042 | + torusButton.addActionListener(this); |
---|
| 1043 | + |
---|
| 1044 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1045 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1046 | + superButton.addActionListener(this); |
---|
| 1047 | + |
---|
| 1048 | + if (Globals.ADVANCED) |
---|
| 1049 | + { |
---|
| 1050 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1051 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 1052 | + kleinButton.addActionListener(this); |
---|
| 1053 | + } |
---|
| 1054 | + |
---|
| 1055 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1056 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 1057 | + particlesButton.addActionListener(this); |
---|
| 1058 | + |
---|
| 1059 | + oe.toolboxPanel.add(row1); |
---|
| 1060 | + |
---|
| 1061 | + cGridBag row2 = new cGridBag(); |
---|
| 1062 | + |
---|
| 1063 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1064 | + groupButton.setToolTipText("Create group"); |
---|
| 1065 | + groupButton.addActionListener(this); |
---|
| 1066 | + |
---|
| 1067 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1069 | + compositeButton.addActionListener(this); |
---|
| 1070 | + |
---|
| 1071 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1073 | + switchButton.addActionListener(this); |
---|
| 1074 | + |
---|
| 1075 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1076 | + loopButton.setToolTipText("Create loop"); |
---|
| 1077 | + loopButton.addActionListener(this); |
---|
| 1078 | + |
---|
| 1079 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1080 | + textureButton.setToolTipText("Create texture"); |
---|
| 1081 | + textureButton.addActionListener(this); |
---|
| 1082 | + |
---|
| 1083 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1084 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1085 | + overlayButton.addActionListener(this); |
---|
| 1086 | + |
---|
| 1087 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1088 | + lightButton.setToolTipText("Create light"); |
---|
| 1089 | + lightButton.addActionListener(this); |
---|
| 1090 | + |
---|
| 1091 | + oe.toolboxPanel.add(row2); |
---|
| 1092 | + |
---|
| 1093 | + // ENVYMAPS |
---|
| 1094 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1095 | + skyboxpane.preferredHeight = 100; |
---|
| 1096 | + |
---|
| 1097 | + oe.toolboxPanel.add(skyboxpane); |
---|
| 1098 | + |
---|
| 1099 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1100 | + skyboxpane.add(skyboxpanel); |
---|
| 1101 | + |
---|
| 1102 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1103 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1104 | + AddSkyboxTab2(skyboxpanel); |
---|
| 1105 | + AddSkyboxTab3(skyboxpanel); |
---|
| 1106 | + |
---|
| 1107 | + // EDIT panel |
---|
| 1108 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1109 | + editButton.setToolTipText("Pin selection controls"); |
---|
668 | 1110 | editButton.addActionListener(this); |
---|
669 | 1111 | |
---|
670 | | - editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
671 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 1112 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1113 | + uneditButton.setToolTipText("Remove selection controls"); |
---|
672 | 1114 | uneditButton.addActionListener(this); |
---|
673 | 1115 | |
---|
674 | 1116 | editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
675 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 1117 | + allParamsButton.setToolTipText("Show all controle"); |
---|
676 | 1118 | allParamsButton.addActionListener(this); |
---|
677 | 1119 | |
---|
678 | 1120 | editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
683 | 1125 | unselectButton.setToolTipText("Unselect"); |
---|
684 | 1126 | unselectButton.addActionListener(this); |
---|
685 | 1127 | |
---|
| 1128 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1129 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1130 | + flashSelectionButton.addActionListener(this); |
---|
| 1131 | + |
---|
686 | 1132 | editCommandsPanel.preferredHeight = 1; |
---|
687 | 1133 | |
---|
| 1134 | + SetPinStates(false); |
---|
688 | 1135 | // oe.treePanel.add(commandsPanel); |
---|
689 | 1136 | // oe.treePanel.Return(); |
---|
690 | 1137 | |
---|
.. | .. |
---|
703 | 1150 | |
---|
704 | 1151 | JScrollPane jSP; |
---|
705 | 1152 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
706 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 1153 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
707 | 1154 | ResetModel(); |
---|
708 | 1155 | |
---|
709 | 1156 | oe.treePanel.add(jSPPanel); |
---|
710 | 1157 | oe.treePanel.Return(); |
---|
711 | 1158 | |
---|
712 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
713 | | - |
---|
714 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
715 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
716 | | - colorCB.addItemListener(this); |
---|
717 | | - |
---|
718 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
719 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
720 | | - materialCB.addItemListener(this); |
---|
721 | | - |
---|
722 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
723 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
724 | | - textureCB.addItemListener(this); |
---|
725 | | - |
---|
726 | | - copyOptionsPanel.preferredHeight = 1; |
---|
727 | 1159 | oe.treePanel.add(copyOptionsPanel); |
---|
728 | 1160 | oe.treePanel.Return(); |
---|
| 1161 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1162 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1163 | + sliderPane.preferredHeight = 1; |
---|
729 | 1164 | |
---|
730 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
731 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1165 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1166 | + mainPanel.setResizeWeight(0.4); |
---|
732 | 1167 | |
---|
733 | 1168 | //jList.addListSelectionListener(this); |
---|
734 | 1169 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
736 | 1171 | //jTree.setEditable(true); |
---|
737 | 1172 | oe.jTree.setDragEnabled(true); |
---|
738 | 1173 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
739 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1174 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
740 | 1175 | |
---|
741 | 1176 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
742 | 1177 | |
---|
.. | .. |
---|
748 | 1183 | dgr.addDragGestureListener(this); |
---|
749 | 1184 | }catch(Exception e) {} |
---|
750 | 1185 | */ |
---|
751 | | - radio.layout = sevenButton; |
---|
| 1186 | + radio.layout = sixButton; // sevenButton; |
---|
752 | 1187 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
753 | 1188 | } |
---|
754 | 1189 | |
---|
755 | 1190 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
756 | 1191 | { |
---|
| 1192 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1193 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1194 | + colorCB.addItemListener(this); |
---|
| 1195 | + |
---|
| 1196 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1197 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1198 | + materialCB.addItemListener(this); |
---|
| 1199 | + |
---|
| 1200 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1201 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1202 | + textureCB.addItemListener(this); |
---|
| 1203 | + |
---|
| 1204 | + panel.Return(); |
---|
| 1205 | + |
---|
757 | 1206 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
758 | 1207 | boxCB.setToolTipText("Display bounding boxes"); |
---|
759 | 1208 | boxCB.addItemListener(this); |
---|
760 | 1209 | |
---|
761 | 1210 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
762 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1211 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
763 | 1212 | zoomBoxCB.addItemListener(this); |
---|
764 | 1213 | |
---|
765 | 1214 | if (true) // Globals.ADVANCED) |
---|
766 | 1215 | { |
---|
767 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
768 | | - supportCB.setToolTipText("Enable rigging"); |
---|
769 | | - supportCB.addItemListener(this); |
---|
| 1216 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1217 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1218 | +// supportCB.addItemListener(this); |
---|
| 1219 | + |
---|
| 1220 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1221 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1222 | + freezeCB.addItemListener(this); |
---|
770 | 1223 | |
---|
771 | 1224 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
772 | 1225 | // localCB.addItemListener(this); |
---|
773 | 1226 | |
---|
| 1227 | + panel.Return(); |
---|
| 1228 | + |
---|
774 | 1229 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
775 | 1230 | crowdCB.setToolTipText("Used for crowds"); |
---|
776 | 1231 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
787 | 1242 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
788 | 1243 | // speakerMocapCB.addItemListener(this); |
---|
789 | 1244 | |
---|
| 1245 | + panel.Return(); |
---|
| 1246 | + |
---|
790 | 1247 | if (false) |
---|
791 | 1248 | { |
---|
792 | 1249 | // handled in scripts |
---|
.. | .. |
---|
801 | 1258 | //constraints.gridy += 1; |
---|
802 | 1259 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
803 | 1260 | smoothfocusCB.addItemListener(this); |
---|
| 1261 | + panel.Return(); |
---|
804 | 1262 | } |
---|
805 | 1263 | |
---|
806 | 1264 | //constraints.gridx += 1; |
---|
807 | 1265 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
808 | 1266 | // debugCB.addItemListener(this); |
---|
809 | 1267 | |
---|
| 1268 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1269 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1270 | + trackCB.addItemListener(this); |
---|
| 1271 | + |
---|
810 | 1272 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
811 | | - oeilCB.setToolTipText("Move camera when tracking target"); |
---|
| 1273 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
812 | 1274 | oeilCB.addItemListener(this); |
---|
813 | 1275 | |
---|
814 | 1276 | panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
815 | | - shadowCB.setToolTipText("Compute shadows when live"); |
---|
| 1277 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
816 | 1278 | shadowCB.addItemListener(this); |
---|
817 | 1279 | |
---|
818 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
819 | | - autosaveCB.setToolTipText("Auto-save on structure change"); |
---|
820 | | - autosaveCB.addItemListener(this); |
---|
| 1280 | + panel.Return(); |
---|
| 1281 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1282 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1283 | + toggleTextureCB.addItemListener(this); |
---|
| 1284 | + |
---|
| 1285 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1286 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1287 | + toggleSwitchCB.addItemListener(this); |
---|
| 1288 | + |
---|
| 1289 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1290 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1291 | + autokeepCB.addItemListener(this); |
---|
821 | 1292 | |
---|
| 1293 | + panel.Return(); |
---|
822 | 1294 | if (Globals.ADVANCED) |
---|
823 | 1295 | { |
---|
824 | 1296 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
.. | .. |
---|
829 | 1301 | } |
---|
830 | 1302 | |
---|
831 | 1303 | cGridBag fill = new cGridBag(); |
---|
832 | | - |
---|
833 | 1304 | fill.preferredHeight = 200; |
---|
| 1305 | + cGridBag fill2 = new cGridBag(); |
---|
| 1306 | + fill2.preferredHeight = 200; |
---|
| 1307 | + cGridBag fill3 = new cGridBag(); |
---|
| 1308 | + fill3.preferredHeight = 200; |
---|
834 | 1309 | |
---|
835 | 1310 | panel.add(fill); |
---|
| 1311 | + panel.add(fill2); |
---|
| 1312 | + panel.add(fill3); |
---|
836 | 1313 | |
---|
837 | 1314 | } |
---|
838 | 1315 | |
---|
.. | .. |
---|
840 | 1317 | { |
---|
841 | 1318 | cRadio radioButton = new cRadio(obj.name); |
---|
842 | 1319 | |
---|
843 | | - // Patch to avoid bug with transparency. |
---|
| 1320 | + // June 2019. Patch to avoid bug with transparency. |
---|
844 | 1321 | radioButton.hadMaterial = obj.material != null; |
---|
845 | 1322 | if (!radioButton.hadMaterial) |
---|
846 | 1323 | { |
---|
.. | .. |
---|
848 | 1325 | } |
---|
849 | 1326 | |
---|
850 | 1327 | radioButton.SetObject(obj); |
---|
851 | | - radioButton.layout = sevenButton; |
---|
| 1328 | + radioButton.layout = sixButton; // sevenButton; |
---|
852 | 1329 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
853 | 1330 | radioButton.addActionListener(this); |
---|
854 | 1331 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
868 | 1345 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
869 | 1346 | } |
---|
870 | 1347 | |
---|
871 | | - cCheckBox liveCB; |
---|
| 1348 | + cToggleButton liveCB; |
---|
872 | 1349 | cCheckBox supportCB; |
---|
873 | 1350 | cCheckBox localCB; |
---|
874 | 1351 | cCheckBox crowdCB; |
---|
875 | 1352 | cCheckBox smoothCB; |
---|
876 | | - cCheckBox fastCB; |
---|
| 1353 | + cToggleButton fastCB; |
---|
877 | 1354 | cCheckBox slowCB; |
---|
878 | 1355 | cCheckBox boxCB; |
---|
879 | 1356 | cCheckBox zoomBoxCB; |
---|
| 1357 | + cCheckBox freezeCB; |
---|
| 1358 | + //cToggleButton trackCB; |
---|
880 | 1359 | cCheckBox trackCB; |
---|
881 | 1360 | cCheckBox smoothfocusCB; |
---|
882 | 1361 | // JCheckBox speakerMocapCB; |
---|
.. | .. |
---|
886 | 1365 | |
---|
887 | 1366 | cCheckBox oeilCB; |
---|
888 | 1367 | cCheckBox shadowCB; |
---|
889 | | - cCheckBox autosaveCB; |
---|
| 1368 | + cCheckBox autokeepCB; |
---|
890 | 1369 | cCheckBox lookAtCB; |
---|
891 | 1370 | |
---|
892 | 1371 | // static int COLOR = 1; |
---|
.. | .. |
---|
994 | 1473 | { |
---|
995 | 1474 | Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
996 | 1475 | } |
---|
997 | | - else if(e.getSource() == autosaveCB) |
---|
| 1476 | + else if(e.getSource() == freezeCB) |
---|
998 | 1477 | { |
---|
999 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1478 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1479 | + } |
---|
| 1480 | + else if(e.getSource() == autokeepCB) |
---|
| 1481 | + { |
---|
| 1482 | + Globals.REPLACEONMAKE ^= true; |
---|
1000 | 1483 | } |
---|
1001 | 1484 | else if(e.getSource() == lookAtCB) |
---|
1002 | 1485 | { |
---|
.. | .. |
---|
1014 | 1497 | |
---|
1015 | 1498 | /**/ |
---|
1016 | 1499 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
1017 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1500 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1501 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
1018 | 1502 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
1019 | 1503 | // We can't move the root node or an empty selection |
---|
1020 | 1504 | return; |
---|
.. | .. |
---|
1077 | 1561 | } |
---|
1078 | 1562 | } |
---|
1079 | 1563 | |
---|
1080 | | - String string = (String) object; |
---|
1081 | | - |
---|
1082 | 1564 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1083 | 1565 | // if( object instanceof java.io.File[]) |
---|
1084 | 1566 | // { |
---|
.. | .. |
---|
1086 | 1568 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1087 | 1569 | // return; |
---|
1088 | 1570 | // } |
---|
| 1571 | + |
---|
| 1572 | + String string = object.toString(); |
---|
1089 | 1573 | |
---|
1090 | 1574 | // File path for Mac and Windows |
---|
1091 | 1575 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1131 | 1615 | |
---|
1132 | 1616 | assert target == objEditor.jTree; |
---|
1133 | 1617 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1618 | + Object3D destinationLeaf; |
---|
1134 | 1619 | try { |
---|
1135 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1620 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
1136 | 1621 | } catch (Exception e) { |
---|
1137 | 1622 | System.out.println("destinationPath : " + destinationPath); |
---|
1138 | 1623 | return; |
---|
1139 | 1624 | } |
---|
1140 | 1625 | |
---|
1141 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1626 | + for (int i=group.selection.size(); --i>=0;) |
---|
1142 | 1627 | { |
---|
| 1628 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1629 | + |
---|
| 1630 | + // Cannot move into itself |
---|
| 1631 | + if (child == destinationLeaf) |
---|
| 1632 | + return; |
---|
| 1633 | + } |
---|
| 1634 | + |
---|
| 1635 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1636 | +// { |
---|
1143 | 1637 | loadClipboard(true); |
---|
1144 | 1638 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1145 | 1639 | pasteInto(false, false); |
---|
1146 | | - } else { |
---|
1147 | | - loadClipboard(false); |
---|
1148 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1149 | | - pasteInto(false, false); // true); // ??? |
---|
1150 | | - } |
---|
| 1640 | +// } else { |
---|
| 1641 | +// loadClipboard(false); |
---|
| 1642 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1643 | +// pasteInto(false, false); // true); // ??? |
---|
| 1644 | +// } |
---|
1151 | 1645 | } |
---|
1152 | 1646 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1153 | 1647 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1252 | 1746 | { |
---|
1253 | 1747 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1254 | 1748 | //heightFieldItem.addActionListener(this); |
---|
1255 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1256 | | - gridItem.addActionListener(this); |
---|
1257 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1258 | | - rectoidItem.addActionListener(this); |
---|
1259 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1260 | | - ellipsoidItem.addActionListener(this); |
---|
1261 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1262 | | - coneItem.addActionListener(this); |
---|
1263 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1264 | | - torusItem.addActionListener(this); |
---|
1265 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1266 | | - superItem.addActionListener(this); |
---|
| 1749 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1750 | +// gridItem.addActionListener(this); |
---|
| 1751 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1752 | +// rectoidItem.addActionListener(this); |
---|
| 1753 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1754 | +// ellipsoidItem.addActionListener(this); |
---|
| 1755 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1756 | +// coneItem.addActionListener(this); |
---|
| 1757 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1758 | +// torusItem.addActionListener(this); |
---|
| 1759 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1760 | +// superItem.addActionListener(this); |
---|
| 1761 | + |
---|
| 1762 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1763 | + cameraItem.addActionListener(this); |
---|
| 1764 | + |
---|
| 1765 | + if (!Globals.ADVANCED) |
---|
| 1766 | + { |
---|
1267 | 1767 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1268 | 1768 | kleinItem.addActionListener(this); |
---|
1269 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1270 | | - particleItem.addActionListener(this); |
---|
| 1769 | + } |
---|
| 1770 | + |
---|
| 1771 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1772 | +// particleItem.addActionListener(this); |
---|
1271 | 1773 | if (Globals.ADVANCED) |
---|
1272 | 1774 | { |
---|
1273 | 1775 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1293 | 1795 | } |
---|
1294 | 1796 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1295 | 1797 | bezierItem.addActionListener(this); |
---|
1296 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1297 | | - overlayItem.addActionListener(this); |
---|
1298 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1299 | | - lightItem.addActionListener(this); |
---|
| 1798 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1799 | +// overlayItem.addActionListener(this); |
---|
| 1800 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1801 | +// lightItem.addActionListener(this); |
---|
1300 | 1802 | menu.add("-"); |
---|
1301 | 1803 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1302 | 1804 | //superLoopItem.addActionListener(this); |
---|
1303 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1304 | | - loopItem.addActionListener(this); |
---|
| 1805 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1806 | +// loopItem.addActionListener(this); |
---|
1305 | 1807 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1306 | 1808 | doubleItem.addActionListener(this); |
---|
1307 | 1809 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1317 | 1819 | animationItem.addItemListener(this); |
---|
1318 | 1820 | animationItem.setState(Globals.ANIMATION); |
---|
1319 | 1821 | |
---|
| 1822 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1823 | + archiveItem.addActionListener(this); |
---|
| 1824 | + |
---|
1320 | 1825 | menu.add("-"); |
---|
1321 | 1826 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1322 | 1827 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1329 | 1834 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1330 | 1835 | reduce34MorphItem.addActionListener(this); |
---|
1331 | 1836 | menu.add("-"); |
---|
| 1837 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1838 | + memoryItem.addActionListener(this); |
---|
1332 | 1839 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1333 | 1840 | computeAOItem.addActionListener(this); |
---|
1334 | 1841 | |
---|
.. | .. |
---|
1337 | 1844 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1338 | 1845 | mirrorItem.addActionListener(this); |
---|
1339 | 1846 | menu.add("-"); |
---|
1340 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1341 | | - memoryItem.addActionListener(this); |
---|
1342 | 1847 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1343 | 1848 | analyzeItem.addActionListener(this); |
---|
1344 | 1849 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1486 | 1991 | |
---|
1487 | 1992 | makeSomething(shadow); |
---|
1488 | 1993 | } |
---|
| 1994 | + |
---|
| 1995 | + private void ClearUnpinned() |
---|
| 1996 | + { |
---|
| 1997 | + //for (Object3D obj : listUI) |
---|
| 1998 | + for (int i=listUI.size(); --i>=0;) |
---|
| 1999 | + { |
---|
| 2000 | + Object3D obj = listUI.elementAt(i); |
---|
| 2001 | + if (!obj.pinned) |
---|
| 2002 | + { |
---|
| 2003 | + obj.CloseUI(); |
---|
| 2004 | + listUI.remove(i); |
---|
| 2005 | + } |
---|
| 2006 | + } |
---|
| 2007 | + } |
---|
| 2008 | + |
---|
| 2009 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2010 | + { |
---|
| 2011 | + // if (!(elem instanceof Composite)) |
---|
| 2012 | + // newWindow = false; |
---|
| 2013 | + listUI.add(elem); |
---|
| 2014 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2015 | + System.out.println("edit : " + elem); |
---|
| 2016 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 2017 | + } |
---|
1489 | 2018 | |
---|
1490 | 2019 | /** |
---|
1491 | 2020 | * applyExample |
---|
.. | .. |
---|
1730 | 2259 | { |
---|
1731 | 2260 | ScreenFit(); |
---|
1732 | 2261 | } else |
---|
1733 | | - if (source == switchItem) |
---|
| 2262 | + if (source == switchViewItem) |
---|
1734 | 2263 | { |
---|
1735 | 2264 | cVector v1 = new cVector(); |
---|
1736 | 2265 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1739 | 2268 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1740 | 2269 | objEditor.cameraView.repaint(); |
---|
1741 | 2270 | } else |
---|
1742 | | - if (source == rectoidItem) |
---|
| 2271 | + if (source == rectoidItem || source == boxButton) |
---|
1743 | 2272 | { |
---|
1744 | 2273 | makeSomething(new Box()); |
---|
1745 | 2274 | } else |
---|
1746 | | - if (source == particleItem) |
---|
| 2275 | + if (source == particleItem || source == particlesButton) |
---|
1747 | 2276 | { |
---|
1748 | 2277 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1749 | 2278 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1822 | 2351 | |
---|
1823 | 2352 | makeSomething(obj); |
---|
1824 | 2353 | } else |
---|
1825 | | - if (source == gridItem) |
---|
| 2354 | + if (source == gridItem || source == gridButton) |
---|
1826 | 2355 | { |
---|
1827 | 2356 | makeSomething(new Grid()); |
---|
1828 | 2357 | } else |
---|
1829 | | - if (source == ellipsoidItem) |
---|
| 2358 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1830 | 2359 | { |
---|
1831 | 2360 | makeSomething(new Sphere()); |
---|
1832 | 2361 | } else |
---|
1833 | | - if (source == coneItem) |
---|
| 2362 | + if (source == coneItem || source == coneButton) |
---|
1834 | 2363 | { |
---|
1835 | 2364 | makeSomething(new Cone()); |
---|
1836 | 2365 | } else |
---|
1837 | | - if (source == torusItem) |
---|
| 2366 | + if (source == torusItem || source == torusButton) |
---|
1838 | 2367 | { |
---|
1839 | 2368 | makeSomething(new Torus()); |
---|
1840 | 2369 | } else |
---|
1841 | | - if (source == superItem) |
---|
| 2370 | + if (source == superItem || source == superButton) |
---|
1842 | 2371 | { |
---|
1843 | 2372 | makeSomething(new Superellipsoid()); |
---|
1844 | 2373 | } else |
---|
1845 | | - if (source == kleinItem) |
---|
| 2374 | + if (source == kleinItem || source == kleinButton) |
---|
1846 | 2375 | { |
---|
1847 | 2376 | makeSomething(new Klein()); |
---|
1848 | 2377 | } else |
---|
.. | .. |
---|
1862 | 2391 | { |
---|
1863 | 2392 | makeSomething(new BezierSurface()); |
---|
1864 | 2393 | } else |
---|
1865 | | - if (source == overlayItem) |
---|
| 2394 | + if (source == overlayItem || source == overlayButton) |
---|
1866 | 2395 | { |
---|
1867 | 2396 | /* |
---|
1868 | 2397 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1910 | 2439 | s.setup(); |
---|
1911 | 2440 | makeSomething(s); |
---|
1912 | 2441 | } else |
---|
1913 | | - if (source == lightItem) |
---|
| 2442 | + if (source == lightItem || source == lightButton) |
---|
1914 | 2443 | { |
---|
1915 | 2444 | makeSomething(new Light()); |
---|
1916 | 2445 | } else |
---|
| 2446 | +// if (source == skybox1Button || |
---|
| 2447 | +// source == skybox2Button || |
---|
| 2448 | +// source == skybox3Button || |
---|
| 2449 | +// source == skybox4Button || |
---|
| 2450 | +// source == skybox5Button || |
---|
| 2451 | +// source == skybox6Button || |
---|
| 2452 | +// source == skybox7Button || |
---|
| 2453 | +// source == skybox11Button || |
---|
| 2454 | +// source == skybox12Button || |
---|
| 2455 | +// source == skybox13Button || |
---|
| 2456 | +// source == skybox14Button || |
---|
| 2457 | +// source == skybox15Button || |
---|
| 2458 | +// source == skybox16Button || |
---|
| 2459 | +// source == skybox17Button) |
---|
| 2460 | +// { |
---|
| 2461 | +// ChangeSkybox(source); |
---|
| 2462 | +// } else |
---|
1917 | 2463 | if (source == csgItem) |
---|
1918 | 2464 | { |
---|
1919 | 2465 | group(new CSG()); |
---|
.. | .. |
---|
1960 | 2506 | |
---|
1961 | 2507 | group(g); |
---|
1962 | 2508 | } else |
---|
1963 | | - if (source == loopItem) |
---|
| 2509 | + if (source == loopItem || source == loopButton) |
---|
1964 | 2510 | { |
---|
1965 | 2511 | Composite csg = new GroupLeaf(); |
---|
1966 | 2512 | csg.count = 5; |
---|
1967 | 2513 | group(csg); |
---|
1968 | | - Composite child = new cGroup(); |
---|
| 2514 | + Composite child = new cGroup("Branch"); |
---|
1969 | 2515 | csg.addChild(child); |
---|
1970 | 2516 | child.addChild(csg); |
---|
1971 | 2517 | } else |
---|
1972 | 2518 | if (source == doubleItem) |
---|
1973 | 2519 | { |
---|
1974 | | - Composite csg = new GroupLeaf(); |
---|
| 2520 | + Composite csg = new GroupLeaf("Fork"); |
---|
1975 | 2521 | csg.count = 5; |
---|
1976 | 2522 | group(csg); |
---|
1977 | | - Composite child = new cGroup(); |
---|
| 2523 | + Composite child = new cGroup("Branch A"); |
---|
1978 | 2524 | csg.addChild(child); |
---|
1979 | 2525 | child.addChild(csg); |
---|
1980 | | - child = new cGroup(); |
---|
| 2526 | + child = new cGroup("Branch B"); |
---|
1981 | 2527 | csg.addChild(child); |
---|
1982 | 2528 | child.addChild(csg); |
---|
1983 | 2529 | } else |
---|
1984 | 2530 | if (source == tripleItem) |
---|
1985 | 2531 | { |
---|
1986 | | - Composite csg = new GroupLeaf(); |
---|
| 2532 | + Composite csg = new GroupLeaf("Trident"); |
---|
1987 | 2533 | csg.count = 4; |
---|
1988 | 2534 | group(csg); |
---|
1989 | 2535 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1999 | 2545 | if (source == computeAOItem) |
---|
2000 | 2546 | { |
---|
2001 | 2547 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
2002 | | - Globals.theRenderer.repaint(); |
---|
| 2548 | + cameraView.repaint(); |
---|
2003 | 2549 | } else |
---|
2004 | 2550 | if (source == recompileItem) |
---|
2005 | 2551 | { |
---|
.. | .. |
---|
2047 | 2593 | } else |
---|
2048 | 2594 | if (source == undoButton) |
---|
2049 | 2595 | { |
---|
| 2596 | + // Go to previous version |
---|
| 2597 | + //if (!Undo()) |
---|
| 2598 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2050 | 2599 | Undo(); |
---|
| 2600 | + } else |
---|
| 2601 | + if (source == restoreButton) |
---|
| 2602 | + { |
---|
| 2603 | + // Restore current version |
---|
| 2604 | + Restore(); |
---|
| 2605 | + } else |
---|
| 2606 | + if (source == replaceButton) |
---|
| 2607 | + { |
---|
| 2608 | + // Overwrite current version |
---|
| 2609 | + Replace(); |
---|
2051 | 2610 | } else |
---|
2052 | 2611 | if (source == redoButton) |
---|
2053 | 2612 | { |
---|
| 2613 | + // Go to next version |
---|
2054 | 2614 | Redo(); |
---|
2055 | 2615 | } else |
---|
2056 | 2616 | if (source == saveButton) |
---|
2057 | 2617 | { |
---|
2058 | | - Save(); |
---|
| 2618 | + // Save a new version |
---|
| 2619 | + if (!Save(true)) |
---|
| 2620 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2059 | 2621 | } else |
---|
2060 | 2622 | if (source == oneStepButton) |
---|
2061 | 2623 | { |
---|
.. | .. |
---|
2064 | 2626 | } else |
---|
2065 | 2627 | if (source == screenfitButton) |
---|
2066 | 2628 | { |
---|
2067 | | - //Reload(lastConverter, lastFilename, true); |
---|
2068 | 2629 | ScreenFit(); |
---|
2069 | 2630 | } else |
---|
2070 | 2631 | if (source == screenfitpointButton) |
---|
2071 | 2632 | { |
---|
2072 | | - //Reload(lastConverter, lastFilename, true); |
---|
2073 | 2633 | ScreenFitPoint(); |
---|
2074 | 2634 | } else |
---|
2075 | 2635 | if (source == snapobjectButton) |
---|
2076 | 2636 | { |
---|
2077 | | - //Reload(lastConverter, lastFilename, true); |
---|
2078 | 2637 | SnapObject(); |
---|
2079 | 2638 | } else |
---|
2080 | 2639 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2438 | 2997 | { |
---|
2439 | 2998 | StepAll(); |
---|
2440 | 2999 | } else |
---|
2441 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 3000 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2442 | 3001 | { |
---|
2443 | 3002 | //int indices[] = jList.getSelectedIndices(); |
---|
2444 | 3003 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2450 | 3009 | { |
---|
2451 | 3010 | ClearSelection(true); |
---|
2452 | 3011 | } else |
---|
2453 | | - if (source == grabItem) |
---|
| 3012 | + if (source == grabItem || source == groupButton) |
---|
2454 | 3013 | { |
---|
2455 | | - group(new cGroup(), true); |
---|
| 3014 | + group(new cGroup(), false); // true); |
---|
2456 | 3015 | } else |
---|
2457 | 3016 | if (source == hideItem) |
---|
2458 | 3017 | { |
---|
.. | .. |
---|
2470 | 3029 | { |
---|
2471 | 3030 | makeSomething(new Camera()); |
---|
2472 | 3031 | } else |
---|
2473 | | - if (source == compositeItem) |
---|
| 3032 | + if (source == compositeItem || source == compositeButton) |
---|
2474 | 3033 | { |
---|
2475 | 3034 | group(new Composite()); |
---|
2476 | 3035 | } else |
---|
2477 | | - if (source == randomItem) |
---|
| 3036 | + if (source == switchItem || source == switchButton) |
---|
2478 | 3037 | { |
---|
2479 | 3038 | RandomNode random = new RandomNode(); |
---|
2480 | 3039 | group(random); |
---|
.. | .. |
---|
2576 | 3135 | { |
---|
2577 | 3136 | group(new cLinker()); |
---|
2578 | 3137 | } else |
---|
2579 | | - if (source == textureItem) |
---|
| 3138 | + if (source == textureItem || source == textureButton) |
---|
2580 | 3139 | { |
---|
2581 | 3140 | group(new TextureNode()); |
---|
2582 | 3141 | } else |
---|
.. | .. |
---|
2596 | 3155 | { |
---|
2597 | 3156 | CastShadow(2); |
---|
2598 | 3157 | } else |
---|
2599 | | - if (source == ungroupItem) |
---|
| 3158 | + if (source == ungroupItem || source == ungroupButton) |
---|
2600 | 3159 | { |
---|
2601 | | - //ungroup(); |
---|
| 3160 | + boolean hasRoot = false; |
---|
| 3161 | + |
---|
2602 | 3162 | for (int i=0; i<group.selection.size(); i++) |
---|
2603 | 3163 | { |
---|
2604 | | - Ungroup(group.selection.get(i)); |
---|
| 3164 | + if (group.selection.get(i) == group) |
---|
| 3165 | + { |
---|
| 3166 | + hasRoot = true; |
---|
| 3167 | + break; |
---|
| 3168 | + } |
---|
2605 | 3169 | } |
---|
2606 | 3170 | |
---|
2607 | | - ClearSelection(false); |
---|
2608 | | - |
---|
2609 | | - refreshContents(); |
---|
| 3171 | + if (!hasRoot) |
---|
| 3172 | + { |
---|
| 3173 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3174 | + { |
---|
| 3175 | + Ungroup(group.selection.get(i)); |
---|
| 3176 | + } |
---|
| 3177 | + |
---|
| 3178 | + ClearSelection(false); |
---|
| 3179 | + |
---|
| 3180 | + refreshContents(); |
---|
| 3181 | + } |
---|
2610 | 3182 | } else |
---|
2611 | 3183 | if (source == genUVItem) |
---|
2612 | 3184 | { |
---|
.. | .. |
---|
2907 | 3479 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2908 | 3480 | { |
---|
2909 | 3481 | obj = (Object3D)e.nextElement(); |
---|
2910 | | - obj.SetBumpTexture(null); |
---|
| 3482 | + obj.ResetBumpTexture(); |
---|
2911 | 3483 | } |
---|
2912 | 3484 | |
---|
2913 | 3485 | refreshContents(); |
---|
.. | .. |
---|
2923 | 3495 | |
---|
2924 | 3496 | refreshContents(); |
---|
2925 | 3497 | } else |
---|
| 3498 | + if (source == embedTexturesItem) |
---|
| 3499 | + { |
---|
| 3500 | + Object3D obj; |
---|
| 3501 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3502 | + { |
---|
| 3503 | + obj = (Object3D)e.nextElement(); |
---|
| 3504 | + obj.EmbedTextures(true); |
---|
| 3505 | + } |
---|
| 3506 | + |
---|
| 3507 | + refreshContents(); |
---|
| 3508 | + } else |
---|
| 3509 | + if (source == deEmbedTexturesItem) |
---|
| 3510 | + { |
---|
| 3511 | + Object3D obj; |
---|
| 3512 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3513 | + { |
---|
| 3514 | + obj = (Object3D)e.nextElement(); |
---|
| 3515 | + obj.EmbedTextures(false); |
---|
| 3516 | + } |
---|
| 3517 | + |
---|
| 3518 | + CameraPane.texturepigment.clear(); |
---|
| 3519 | + CameraPane.texturebump.clear(); |
---|
| 3520 | + |
---|
| 3521 | + refreshContents(); |
---|
| 3522 | + } else |
---|
2926 | 3523 | if (source == flashSelectionButton) |
---|
2927 | 3524 | { |
---|
2928 | 3525 | CameraPane.flash = true; |
---|
.. | .. |
---|
2934 | 3531 | if (source == twoButton) |
---|
2935 | 3532 | { |
---|
2936 | 3533 | radio.layout = twoButton; |
---|
| 3534 | + |
---|
| 3535 | + if (CameraPane.FULLSCREEN) |
---|
| 3536 | + fullscreenLayout = radio.layout; |
---|
| 3537 | + |
---|
2937 | 3538 | // bug |
---|
2938 | 3539 | //gridPanel.setDividerLocation(1.0); |
---|
2939 | 3540 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2989 | 3590 | { |
---|
2990 | 3591 | radio.layout = threeButton; |
---|
2991 | 3592 | |
---|
| 3593 | + if (CameraPane.FULLSCREEN) |
---|
| 3594 | + fullscreenLayout = radio.layout; |
---|
| 3595 | + |
---|
2992 | 3596 | // bigThree.remove(scenePanel); |
---|
2993 | 3597 | // bigThree.remove(centralPanel); |
---|
2994 | 3598 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3017 | 3621 | // centralPanel.setVisible(true); |
---|
3018 | 3622 | // XYZPanel.setVisible(true); |
---|
3019 | 3623 | bigThree.ClearUI(); |
---|
| 3624 | + bigThree.add(scenePanel); |
---|
3020 | 3625 | bigThree.add(centralPanel); |
---|
3021 | | - bigThree.add(XYZPanel); |
---|
3022 | 3626 | bigThree.FlushUI(); |
---|
3023 | 3627 | |
---|
3024 | 3628 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3026 | 3630 | if (source == fourButton) |
---|
3027 | 3631 | { |
---|
3028 | 3632 | radio.layout = fourButton; |
---|
| 3633 | + |
---|
| 3634 | + if (CameraPane.FULLSCREEN) |
---|
| 3635 | + fullscreenLayout = radio.layout; |
---|
3029 | 3636 | |
---|
3030 | 3637 | // bigThree.remove(scenePanel); |
---|
3031 | 3638 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3064 | 3671 | { |
---|
3065 | 3672 | radio.layout = sixButton; |
---|
3066 | 3673 | |
---|
| 3674 | + if (CameraPane.FULLSCREEN) |
---|
| 3675 | + fullscreenLayout = radio.layout; |
---|
| 3676 | + |
---|
3067 | 3677 | // bigThree.remove(scenePanel); |
---|
3068 | 3678 | // bigThree.remove(centralPanel); |
---|
3069 | 3679 | // bigThree.remove(XYZPanel); |
---|
.. | .. |
---|
3092 | 3702 | // centralPanel.setVisible(true); |
---|
3093 | 3703 | // XYZPanel.setVisible(false); |
---|
3094 | 3704 | bigThree.ClearUI(); |
---|
3095 | | - bigThree.add(scenePanel); |
---|
3096 | 3705 | bigThree.add(centralPanel); |
---|
| 3706 | + bigThree.add(scenePanel); |
---|
3097 | 3707 | bigThree.FlushUI(); |
---|
3098 | 3708 | |
---|
3099 | 3709 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3101 | 3711 | if (source == sevenButton) |
---|
3102 | 3712 | { |
---|
3103 | 3713 | radio.layout = sevenButton; |
---|
| 3714 | + |
---|
| 3715 | + if (CameraPane.FULLSCREEN) |
---|
| 3716 | + fullscreenLayout = radio.layout; |
---|
3104 | 3717 | |
---|
3105 | 3718 | // bigThree.remove(scenePanel); |
---|
3106 | 3719 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
3182 | 3795 | } else |
---|
3183 | 3796 | if (source == editItem || source == editButton) |
---|
3184 | 3797 | { |
---|
| 3798 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3799 | + { |
---|
| 3800 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3801 | + child.pinned = true; |
---|
| 3802 | + } |
---|
| 3803 | + |
---|
3185 | 3804 | EditSelection(false); |
---|
3186 | 3805 | } else |
---|
3187 | 3806 | if (source == uneditButton) |
---|
.. | .. |
---|
3191 | 3810 | Object3D child = (Object3D)e.nextElement(); |
---|
3192 | 3811 | if(child.editWindow != null) |
---|
3193 | 3812 | objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3813 | + child.pinned = false; |
---|
3194 | 3814 | child.CloseUI(); |
---|
3195 | 3815 | listUI.remove(child); |
---|
3196 | 3816 | |
---|
.. | .. |
---|
3207 | 3827 | //copy.ClearUI(); |
---|
3208 | 3828 | for (Object3D obj : listUI) |
---|
3209 | 3829 | { |
---|
| 3830 | + obj.pinned = false; |
---|
3210 | 3831 | obj.CloseUI(); |
---|
3211 | 3832 | } |
---|
3212 | 3833 | listUI.clear(); |
---|
.. | .. |
---|
3216 | 3837 | { |
---|
3217 | 3838 | assert(copy == group); |
---|
3218 | 3839 | |
---|
3219 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3840 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3220 | 3841 | |
---|
3221 | 3842 | for (Object3D obj : listUI) |
---|
3222 | 3843 | { |
---|
.. | .. |
---|
3265 | 3886 | } |
---|
3266 | 3887 | |
---|
3267 | 3888 | copy = group; |
---|
| 3889 | + |
---|
| 3890 | + SetUndoStates(); |
---|
| 3891 | + |
---|
3268 | 3892 | //Globals.theRenderer.object = group; |
---|
3269 | 3893 | if(!useclient) |
---|
3270 | 3894 | { |
---|
.. | .. |
---|
3291 | 3915 | currentLayout = sevenButton; |
---|
3292 | 3916 | */ |
---|
3293 | 3917 | radio.layout.doClick(); |
---|
| 3918 | + |
---|
| 3919 | + ClearUnpinned(); |
---|
| 3920 | + //Grafreed.Assert(group != null); |
---|
| 3921 | + //Grafreed.Assert(group.selection != null); |
---|
| 3922 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3923 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3924 | + EditSelection(false); |
---|
3294 | 3925 | keepparent = group.parent; |
---|
3295 | 3926 | // PARENT = NULL or not??? |
---|
3296 | 3927 | //group.parent = null; // ROOT |
---|
.. | .. |
---|
3304 | 3935 | cameraView.ProtectCamera(); |
---|
3305 | 3936 | cameraView.repaint(); |
---|
3306 | 3937 | return; |
---|
3307 | | - } else if (event.getSource() == revertCameraItem) |
---|
| 3938 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
3308 | 3939 | { |
---|
3309 | 3940 | cameraView.RevertCamera(); |
---|
3310 | 3941 | cameraView.repaint(); |
---|
.. | .. |
---|
3883 | 4514 | |
---|
3884 | 4515 | try |
---|
3885 | 4516 | { |
---|
3886 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4517 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
3887 | 4518 | } |
---|
3888 | 4519 | catch (Exception e) |
---|
3889 | 4520 | { |
---|
.. | .. |
---|
4358 | 4989 | // } |
---|
4359 | 4990 | // } |
---|
4360 | 4991 | |
---|
4361 | | - static boolean allparams = true; |
---|
4362 | | - |
---|
4363 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4364 | | - |
---|
4365 | 4992 | void EditSelection(boolean newWindow) |
---|
4366 | 4993 | { |
---|
| 4994 | + if (group.selection == null) |
---|
| 4995 | + { |
---|
| 4996 | + EditElement(group, newWindow); // ? new |
---|
| 4997 | + return; |
---|
| 4998 | + } |
---|
| 4999 | + |
---|
4367 | 5000 | // aConstraints.gridy = 0; |
---|
4368 | 5001 | for (int i=0; i<group.selection.size(); i++) |
---|
4369 | 5002 | { |
---|
4370 | 5003 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4371 | 5004 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4372 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 5005 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4373 | 5006 | |
---|
4374 | 5007 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4375 | 5008 | if(elem != group || !newWindow) |
---|
4376 | 5009 | { |
---|
4377 | | - // if (!(elem instanceof Composite)) |
---|
4378 | | - // newWindow = false; |
---|
4379 | | - listUI.add(elem); |
---|
4380 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4381 | | - System.out.println("edit : " + elem); |
---|
4382 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5010 | + EditElement(elem, newWindow); // ? new |
---|
4383 | 5011 | } |
---|
4384 | 5012 | } |
---|
4385 | 5013 | } |
---|
.. | .. |
---|
4454 | 5082 | //new Exception().printStackTrace(); |
---|
4455 | 5083 | |
---|
4456 | 5084 | freezemodel = true; |
---|
4457 | | - |
---|
| 5085 | + ClearUnpinned(); |
---|
| 5086 | + |
---|
4458 | 5087 | /**/ |
---|
4459 | 5088 | //switch (event.id) |
---|
4460 | 5089 | { |
---|
.. | .. |
---|
4487 | 5116 | if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4488 | 5117 | // a camera |
---|
4489 | 5118 | { |
---|
4490 | | - if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) |
---|
| 5119 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
4491 | 5120 | { |
---|
4492 | 5121 | CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4493 | 5122 | Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
.. | .. |
---|
4496 | 5125 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4497 | 5126 | } |
---|
4498 | 5127 | |
---|
| 5128 | + if (tps != null && tps.length == 1) |
---|
| 5129 | + { |
---|
| 5130 | + EditSelection(false); |
---|
| 5131 | + } |
---|
| 5132 | + |
---|
| 5133 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5134 | + |
---|
4499 | 5135 | refreshContents(); |
---|
4500 | 5136 | //return true; |
---|
4501 | 5137 | } |
---|
.. | .. |
---|
4505 | 5141 | freezemodel = false; |
---|
4506 | 5142 | } |
---|
4507 | 5143 | |
---|
| 5144 | + void SetPinStates(boolean enabled) |
---|
| 5145 | + { |
---|
| 5146 | + editButton.setEnabled(enabled); |
---|
| 5147 | + uneditButton.setEnabled(enabled); |
---|
| 5148 | + unselectButton.setEnabled(enabled); |
---|
| 5149 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5150 | + } |
---|
| 5151 | + |
---|
4508 | 5152 | void refreshContents(boolean cp) |
---|
4509 | 5153 | { |
---|
4510 | | - if (!Globals.MOUSEDRAGGED) |
---|
| 5154 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5155 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4511 | 5156 | { |
---|
4512 | 5157 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
4513 | 5158 | |
---|
.. | .. |
---|
4606 | 5251 | |
---|
4607 | 5252 | if (cut) |
---|
4608 | 5253 | { |
---|
4609 | | - if (Globals.SAVEONMAKE) |
---|
4610 | | - Save(); |
---|
| 5254 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5255 | +// Save(); |
---|
4611 | 5256 | //int indices[] = jList.getSelectedIndices(); |
---|
4612 | 5257 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4613 | 5258 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4710 | 5355 | |
---|
4711 | 5356 | void paste(boolean expand) |
---|
4712 | 5357 | { |
---|
| 5358 | + if (Globals.REPLACEONMAKE) |
---|
| 5359 | + Save(); |
---|
| 5360 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5361 | + Globals.REPLACEONMAKE = false; |
---|
4713 | 5362 | // if (GrafreeD.clipboard == null) |
---|
4714 | 5363 | // return; |
---|
4715 | 5364 | boolean first = true; |
---|
.. | .. |
---|
4769 | 5418 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4770 | 5419 | } |
---|
4771 | 5420 | |
---|
| 5421 | + Globals.REPLACEONMAKE = keep; |
---|
4772 | 5422 | ResetModel(); |
---|
4773 | 5423 | refreshContents(); |
---|
4774 | 5424 | } |
---|
.. | .. |
---|
4904 | 5554 | |
---|
4905 | 5555 | void group(Object3D csg, boolean grab) |
---|
4906 | 5556 | { |
---|
| 5557 | + if (Globals.REPLACEONMAKE) |
---|
| 5558 | + Save(); |
---|
| 5559 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5560 | + Globals.REPLACEONMAKE = false; |
---|
4907 | 5561 | if (//false) // why?? |
---|
4908 | 5562 | !group.selection.isEmpty()) |
---|
4909 | 5563 | { |
---|
.. | .. |
---|
5017 | 5671 | //node.add(csg); |
---|
5018 | 5672 | //makeSomething(node); |
---|
5019 | 5673 | makeSomething(csg); |
---|
| 5674 | + Globals.REPLACEONMAKE = keep; |
---|
5020 | 5675 | } |
---|
5021 | 5676 | |
---|
5022 | 5677 | void Ungroup(Object3D g) |
---|
5023 | 5678 | { |
---|
| 5679 | + if (Globals.REPLACEONMAKE) |
---|
| 5680 | + Save(); |
---|
| 5681 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5682 | + Globals.REPLACEONMAKE = false; |
---|
5024 | 5683 | if (g instanceof HiddenObject) |
---|
5025 | 5684 | { |
---|
5026 | 5685 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5037 | 5696 | objEditor.makeSomething(g.get(i), false); |
---|
5038 | 5697 | } |
---|
5039 | 5698 | } |
---|
| 5699 | + Globals.REPLACEONMAKE = keep; |
---|
5040 | 5700 | } |
---|
5041 | 5701 | |
---|
5042 | 5702 | void ungroup() |
---|
.. | .. |
---|
5325 | 5985 | cButton clearpanelButton; |
---|
5326 | 5986 | cButton unselectButton; |
---|
5327 | 5987 | |
---|
5328 | | - cButton minButton; |
---|
5329 | | - cButton maxButton; |
---|
5330 | | - cButton fullButton; |
---|
5331 | | - cButton undoButton; |
---|
5332 | | - cButton redoButton; |
---|
| 5988 | + cButton restoreCameraButton; |
---|
| 5989 | + |
---|
5333 | 5990 | cButton saveButton; |
---|
5334 | 5991 | cButton oneStepButton; |
---|
| 5992 | + |
---|
| 5993 | + cButton groupButton; |
---|
| 5994 | + cButton ungroupButton; |
---|
| 5995 | + cButton compositeButton; |
---|
| 5996 | + cButton switchButton; |
---|
| 5997 | + cButton loopButton; |
---|
| 5998 | + cButton textureButton; |
---|
| 5999 | + |
---|
| 6000 | + cButton skybox1Button; |
---|
| 6001 | + cButton skybox2Button; |
---|
| 6002 | + cButton skybox3Button; |
---|
| 6003 | + cButton skybox4Button; |
---|
| 6004 | + cButton skybox5Button; |
---|
| 6005 | + cButton skybox6Button; |
---|
| 6006 | + cButton skybox7Button; |
---|
| 6007 | + |
---|
| 6008 | + cButton skybox11Button; |
---|
| 6009 | + cButton skybox12Button; |
---|
| 6010 | + cButton skybox13Button; |
---|
| 6011 | + cButton skybox14Button; |
---|
| 6012 | + cButton skybox15Button; |
---|
| 6013 | + cButton skybox16Button; |
---|
| 6014 | + cButton skybox17Button; |
---|
| 6015 | + |
---|
| 6016 | + cButton gridButton; |
---|
| 6017 | + cButton boxButton; |
---|
| 6018 | + cButton sphereButton; |
---|
| 6019 | + cButton coneButton; |
---|
| 6020 | + cButton torusButton; |
---|
| 6021 | + cButton superButton; |
---|
| 6022 | + cButton kleinButton; |
---|
| 6023 | + cButton particlesButton; |
---|
| 6024 | + cButton overlayButton; |
---|
| 6025 | + cButton lightButton; |
---|
5335 | 6026 | |
---|
5336 | 6027 | cButton screenfitButton; |
---|
5337 | 6028 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5353 | 6044 | //JTree jTree; |
---|
5354 | 6045 | private MenuItem lookAtItem; |
---|
5355 | 6046 | private MenuItem lookFromItem; |
---|
5356 | | - private MenuItem switchItem; |
---|
| 6047 | + private MenuItem switchViewItem; |
---|
5357 | 6048 | private MenuItem cutItem; |
---|
5358 | 6049 | private MenuItem undoItem; |
---|
5359 | 6050 | private MenuItem redoItem; |
---|
5360 | | - private MenuItem duplicateItem; |
---|
| 6051 | + private JMenuItem duplicateItem; |
---|
5361 | 6052 | private MenuItem cloneItem; |
---|
5362 | 6053 | private MenuItem cloneSupportItem; |
---|
5363 | 6054 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5385 | 6076 | private MenuItem pasteLinkItem; |
---|
5386 | 6077 | private MenuItem pasteCloneItem; |
---|
5387 | 6078 | private MenuItem pasteExpandItem; |
---|
5388 | | - private MenuItem clearItem; |
---|
| 6079 | + private MenuItem deleteItem; |
---|
5389 | 6080 | private MenuItem clearAllItem; |
---|
5390 | 6081 | private MenuItem genUVItem; |
---|
5391 | 6082 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5445 | 6136 | private MenuItem frontItem; |
---|
5446 | 6137 | private MenuItem cameraItem; |
---|
5447 | 6138 | private MenuItem compositeItem; |
---|
5448 | | - private MenuItem randomItem; |
---|
| 6139 | + private MenuItem switchItem; |
---|
5449 | 6140 | private MenuItem physicsItem; |
---|
5450 | 6141 | private MenuItem frameselectorItem; |
---|
5451 | 6142 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5469 | 6160 | private MenuItem attachBumpItem; |
---|
5470 | 6161 | private MenuItem detachBumpItem; |
---|
5471 | 6162 | private MenuItem pigmentBumpItem; |
---|
| 6163 | + private MenuItem embedTexturesItem; |
---|
| 6164 | + private MenuItem deEmbedTexturesItem; |
---|
5472 | 6165 | |
---|
5473 | 6166 | private MenuItem particleItem; |
---|
5474 | 6167 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5519 | 6212 | |
---|
5520 | 6213 | Menu cameraMenu; |
---|
5521 | 6214 | MenuItem editCameraItem; |
---|
5522 | | - MenuItem revertCameraItem; |
---|
| 6215 | + MenuItem restoreCameraItem; |
---|
5523 | 6216 | } |
---|