.. | .. |
---|
16 | 16 | //import buoy.widget.BFileChooser; |
---|
17 | 17 | |
---|
18 | 18 | class GroupEditor extends ObjEditor implements //iParse, //iCallBack, |
---|
| 19 | + Grafreed.iResourceCallBack, |
---|
19 | 20 | ObjectUI, |
---|
20 | 21 | Runnable, |
---|
21 | 22 | ActionListener, |
---|
.. | .. |
---|
23 | 24 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 25 | ItemListener // ListSelectionListener |
---|
25 | 26 | { |
---|
| 27 | + |
---|
| 28 | + public void AddSkyboxButton(String f, String s, cGridBag row) |
---|
| 29 | + { |
---|
| 30 | + cButton skyboxButton; |
---|
| 31 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 32 | + row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 33 | + //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 34 | + skyboxButton.setToolTipText(s); |
---|
| 35 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 36 | + { |
---|
| 37 | + @Override |
---|
| 38 | + public void actionPerformed(ActionEvent e) |
---|
| 39 | + { |
---|
| 40 | + ChangeSkybox(path); |
---|
| 41 | + } |
---|
| 42 | + }); |
---|
| 43 | + } |
---|
| 44 | + |
---|
| 45 | + public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
| 46 | + { |
---|
| 47 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 48 | + |
---|
| 49 | + tab0.setName("Urban"); |
---|
| 50 | + skyboxpanel.add(tab0); |
---|
| 51 | + |
---|
| 52 | + cGridBag row0 = new cGridBag(); |
---|
| 53 | + cGridBag row1 = new cGridBag(); |
---|
| 54 | + cGridBag row2 = new cGridBag(); |
---|
| 55 | + cGridBag row3 = new cGridBag(); |
---|
| 56 | + cGridBag row4 = new cGridBag(); |
---|
| 57 | + cGridBag row5 = new cGridBag(); |
---|
| 58 | + cGridBag row6 = new cGridBag(); |
---|
| 59 | + |
---|
| 60 | + AddSkyboxButton("default", "rgb", row0); |
---|
| 61 | + //AddSkyboxButton("default", "cornell", row0); |
---|
| 62 | + AddSkyboxButton("penguins", "dust", row0); |
---|
| 63 | + AddSkyboxButton("penguins", "tropic", row0); |
---|
| 64 | + AddSkyboxButton("penguins", "yonder", row0); |
---|
| 65 | + |
---|
| 66 | + AddSkyboxButton("default", "uffizi", row1); |
---|
| 67 | + AddSkyboxButton("bridge", "Bridge", row1); |
---|
| 68 | + AddSkyboxButton("bridge", "Bridge2", row1); |
---|
| 69 | + AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
| 70 | + |
---|
| 71 | + AddSkyboxButton("urban", "Parliament", row2); |
---|
| 72 | + AddSkyboxButton("urban", "Roundabout", row2); |
---|
| 73 | + AddSkyboxButton("urban", "SaintLazarusChurch", row2); |
---|
| 74 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row2); |
---|
| 75 | + |
---|
| 76 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
| 77 | + AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 78 | + AddSkyboxButton("urban", "Medborgarplatsen", row3); |
---|
| 79 | + AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
| 80 | + |
---|
| 81 | + AddSkyboxButton("park", "Buddha", row4); |
---|
| 82 | + AddSkyboxButton("park", "CNTower2", row4); |
---|
| 83 | + AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
| 84 | + AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
| 85 | + |
---|
| 86 | + AddSkyboxButton("park", "Park", row5); |
---|
| 87 | + AddSkyboxButton("park", "Pond", row5); |
---|
| 88 | + AddSkyboxButton("park", "Skansen", row5); |
---|
| 89 | + AddSkyboxButton("park", "Skansen2", row5); |
---|
| 90 | + |
---|
| 91 | + AddSkyboxButton("park", "Skansen3", row6); |
---|
| 92 | + AddSkyboxButton("park", "Skansen4", row6); |
---|
| 93 | + AddSkyboxButton("park", "Skansen5", row6); |
---|
| 94 | + AddSkyboxButton("persson", "VancouverConventionCentre", row6); |
---|
| 95 | + |
---|
| 96 | + tab0.add(row0); |
---|
| 97 | + tab0.add(row1); |
---|
| 98 | + tab0.add(row2); |
---|
| 99 | + tab0.add(row3); |
---|
| 100 | + tab0.add(row4); |
---|
| 101 | + tab0.add(row5); |
---|
| 102 | + tab0.add(row6); |
---|
| 103 | + |
---|
| 104 | + for (int i=5; --i>=0;) |
---|
| 105 | + { |
---|
| 106 | + //oe.toolboxPanel.Return(); |
---|
| 107 | + //tab0.add(new cGridBag()); |
---|
| 108 | + } |
---|
| 109 | + } |
---|
| 110 | + |
---|
| 111 | + public void AddSkyboxTab1(JTabbedPane skyboxpanel) |
---|
| 112 | + { |
---|
| 113 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 114 | + |
---|
| 115 | + tab0.setName("Nature"); |
---|
| 116 | + skyboxpanel.add(tab0); |
---|
| 117 | + |
---|
| 118 | + cGridBag row0 = new cGridBag(); |
---|
| 119 | + cGridBag row1 = new cGridBag(); |
---|
| 120 | + cGridBag row2 = new cGridBag(); |
---|
| 121 | + cGridBag row3 = new cGridBag(); |
---|
| 122 | + cGridBag row4 = new cGridBag(); |
---|
| 123 | + cGridBag row5 = new cGridBag(); |
---|
| 124 | + cGridBag row6 = new cGridBag(); |
---|
| 125 | + |
---|
| 126 | + AddSkyboxButton("beach", "HeartInTheSand", row0); |
---|
| 127 | + AddSkyboxButton("beach", "LarnacaBeach", row0); |
---|
| 128 | + AddSkyboxButton("beach", "PalmTrees", row0); |
---|
| 129 | + AddSkyboxButton("beach", "Tenerife", row0); |
---|
| 130 | + |
---|
| 131 | + AddSkyboxButton("beach", "Tenerife2", row1); |
---|
| 132 | + AddSkyboxButton("beach", "Tenerife3", row1); |
---|
| 133 | + AddSkyboxButton("field", "FishPond", row1); |
---|
| 134 | + AddSkyboxButton("field", "Footballfield", row1); |
---|
| 135 | + |
---|
| 136 | + AddSkyboxButton("field", "Meadow", row2); |
---|
| 137 | + AddSkyboxButton("field", "Sorsele", row2); |
---|
| 138 | + AddSkyboxButton("field", "Sorsele2", row2); |
---|
| 139 | + AddSkyboxButton("field", "Sorsele3", row2); |
---|
| 140 | + |
---|
| 141 | + AddSkyboxButton("forest", "Brudslojan", row3); |
---|
| 142 | + AddSkyboxButton("forest", "Langholmen2", row3); |
---|
| 143 | + AddSkyboxButton("forest", "Plants", row3); |
---|
| 144 | + AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 145 | + |
---|
| 146 | + AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
| 147 | + AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
| 148 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 149 | + AddSkyboxButton("park", "Tantolunden4", row4); |
---|
| 150 | + |
---|
| 151 | + AddSkyboxButton("park", "Stairs", row5); |
---|
| 152 | + AddSkyboxButton("default", "skycube", row6); |
---|
| 153 | + AddSkyboxButton("rocky", "Langholmen", row5); |
---|
| 154 | + AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 155 | + |
---|
| 156 | + AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 157 | + AddSkyboxButton("default", "CloudyHills", row6); |
---|
| 158 | + AddSkyboxButton("daz", "Autumn", row6); |
---|
| 159 | + AddSkyboxButton("daz", "MountainTrail", row6); |
---|
| 160 | + /* |
---|
| 161 | +Autumn |
---|
| 162 | +Greenlands |
---|
| 163 | +MountainTrail |
---|
| 164 | +Oasis |
---|
| 165 | +TheRock |
---|
| 166 | +TopOfTheWorld |
---|
| 167 | +Winter |
---|
| 168 | + */ |
---|
| 169 | + |
---|
| 170 | + tab0.add(row0); |
---|
| 171 | + tab0.add(row1); |
---|
| 172 | + tab0.add(row2); |
---|
| 173 | + tab0.add(row3); |
---|
| 174 | + tab0.add(row4); |
---|
| 175 | + tab0.add(row5); |
---|
| 176 | + tab0.add(row6); |
---|
| 177 | + |
---|
| 178 | + for (int i=5; --i>=0;) |
---|
| 179 | + { |
---|
| 180 | + //oe.toolboxPanel.Return(); |
---|
| 181 | + //tab0.add(new cGridBag()); |
---|
| 182 | + } |
---|
| 183 | + } |
---|
| 184 | + |
---|
| 185 | + public void AddSkyboxTab2(JTabbedPane skyboxpanel) |
---|
| 186 | + { |
---|
| 187 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 188 | + |
---|
| 189 | + tab0.setName("Night"); |
---|
| 190 | + skyboxpanel.add(tab0); |
---|
| 191 | + |
---|
| 192 | + cGridBag row0 = new cGridBag(); |
---|
| 193 | + cGridBag row1 = new cGridBag(); |
---|
| 194 | + cGridBag row2 = new cGridBag(); |
---|
| 195 | + cGridBag row3 = new cGridBag(); |
---|
| 196 | + cGridBag row4 = new cGridBag(); |
---|
| 197 | + cGridBag row5 = new cGridBag(); |
---|
| 198 | + cGridBag row6 = new cGridBag(); |
---|
| 199 | + |
---|
| 200 | + AddSkyboxButton("night", "NightPath", row0); |
---|
| 201 | + AddSkyboxButton("night", "PondNight", row0); |
---|
| 202 | + AddSkyboxButton("night", "Powerlines", row0); |
---|
| 203 | + AddSkyboxButton("night", "SwedishRoyalCastle", row0); |
---|
| 204 | + |
---|
| 205 | + AddSkyboxButton("urban", "CNTower", row1); |
---|
| 206 | + AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
| 207 | + AddSkyboxButton("rocky", "Riddarfjarden", row1); |
---|
| 208 | + AddSkyboxButton("penguins", "sleepyhollow", row1); |
---|
| 209 | + |
---|
| 210 | + AddSkyboxButton("penguins", "kenon_star", row2); |
---|
| 211 | + AddSkyboxButton("persson", "corona", row2); |
---|
| 212 | + AddSkyboxButton("persson", "spaceskybox", row2); |
---|
| 213 | + AddSkyboxButton("indoors", "Vasa", row2); |
---|
| 214 | + |
---|
| 215 | + AddSkyboxButton("winter", "Backyard", row3); |
---|
| 216 | + AddSkyboxButton("winter", "Creek", row3); |
---|
| 217 | + AddSkyboxButton("winter", "FootballField3", row3); |
---|
| 218 | + AddSkyboxButton("winter", "Forest", row3); |
---|
| 219 | + |
---|
| 220 | + AddSkyboxButton("winter", "HornstullsStrand2", row4); |
---|
| 221 | + AddSkyboxButton("winter", "House", row4); |
---|
| 222 | + AddSkyboxButton("winter", "IceLake", row4); |
---|
| 223 | + AddSkyboxButton("winter", "IceRiver", row4); |
---|
| 224 | + |
---|
| 225 | + AddSkyboxButton("winter", "Park3", row5); |
---|
| 226 | + AddSkyboxButton("winter", "PondWinter", row5); |
---|
| 227 | + AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
| 228 | + AddSkyboxButton("winter", "Vindelalven", row5); |
---|
| 229 | + |
---|
| 230 | + AddSkyboxButton("daz", "TheRock", row6); |
---|
| 231 | + AddSkyboxButton("daz", "TopOfTheWorld", row6); |
---|
| 232 | + AddSkyboxButton("daz", "Winter", row6); |
---|
| 233 | + AddSkyboxButton("mountain", "Ryfjallet", row6); |
---|
| 234 | + |
---|
| 235 | + tab0.add(row0); |
---|
| 236 | + tab0.add(row1); |
---|
| 237 | + tab0.add(row2); |
---|
| 238 | + tab0.add(row3); |
---|
| 239 | + tab0.add(row4); |
---|
| 240 | + tab0.add(row5); |
---|
| 241 | + tab0.add(row6); |
---|
| 242 | + |
---|
| 243 | + for (int i=5; --i>=0;) |
---|
| 244 | + { |
---|
| 245 | + //oe.toolboxPanel.Return(); |
---|
| 246 | + //tab0.add(new cGridBag()); |
---|
| 247 | + } |
---|
| 248 | + } |
---|
| 249 | + |
---|
| 250 | + public void AddSkyboxTab3(JTabbedPane skyboxpanel) |
---|
| 251 | + { |
---|
| 252 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 253 | + |
---|
| 254 | + tab0.setName("Others"); |
---|
| 255 | + skyboxpanel.add(tab0); |
---|
| 256 | + |
---|
| 257 | + cGridBag row0 = new cGridBag(); |
---|
| 258 | + cGridBag row1 = new cGridBag(); |
---|
| 259 | + cGridBag row2 = new cGridBag(); |
---|
| 260 | + cGridBag row3 = new cGridBag(); |
---|
| 261 | + cGridBag row4 = new cGridBag(); |
---|
| 262 | + cGridBag row5 = new cGridBag(); |
---|
| 263 | + cGridBag row6 = new cGridBag(); |
---|
| 264 | + |
---|
| 265 | + AddSkyboxButton("mayhem", "afterrain", row0); |
---|
| 266 | + AddSkyboxButton("mayhem", "aqua4", row0); |
---|
| 267 | + AddSkyboxButton("mayhem", "aqua9", row0); |
---|
| 268 | + AddSkyboxButton("mayhem", "flame", row0); |
---|
| 269 | + |
---|
| 270 | + AddSkyboxButton("mayhem", "h2s", row1); |
---|
| 271 | + AddSkyboxButton("mayhem", "prehistoric", row1); |
---|
| 272 | + AddSkyboxButton("mayhem", "scorched", row1); |
---|
| 273 | + AddSkyboxButton("penguins", "desertdawn", row1); |
---|
| 274 | + |
---|
| 275 | + AddSkyboxButton("persson", "Citadella", row2); |
---|
| 276 | + AddSkyboxButton("persson", "Citadella2", row2); |
---|
| 277 | + AddSkyboxButton("persson", "clouds1", row2); |
---|
| 278 | + AddSkyboxButton("penguins", "wrath", row2); |
---|
| 279 | + |
---|
| 280 | + AddSkyboxButton("persson", "FishermansBastion", row3); |
---|
| 281 | + AddSkyboxButton("persson", "HeroesSquare", row3); |
---|
| 282 | + AddSkyboxButton("indoors", "DallasW", row3); |
---|
| 283 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row3); |
---|
| 284 | + |
---|
| 285 | + AddSkyboxButton("persson", "LancellottiChapel", row4); |
---|
| 286 | + AddSkyboxButton("persson", "PereaBeach1", row4); |
---|
| 287 | + AddSkyboxButton("persson", "PereaBeach2", row4); |
---|
| 288 | + AddSkyboxButton("persson", "redeclipse", row4); |
---|
| 289 | + |
---|
| 290 | + AddSkyboxButton("daz", "Greenlands", row5); |
---|
| 291 | + AddSkyboxButton("daz", "Oasis", row5); |
---|
| 292 | + AddSkyboxButton("elyvisions", "arch3", row5); |
---|
| 293 | + AddSkyboxButton("elyvisions", "calm_sea", row5); |
---|
| 294 | + |
---|
| 295 | + AddSkyboxButton("elyvisions", "rainbow", row6); |
---|
| 296 | + AddSkyboxButton("elyvisions", "distant_sunset", row6); |
---|
| 297 | + AddSkyboxButton("elyvisions", "heaven", row6); |
---|
| 298 | + AddSkyboxButton("elyvisions", "hot", row6); |
---|
| 299 | + |
---|
| 300 | + tab0.add(row0); |
---|
| 301 | + tab0.add(row1); |
---|
| 302 | + tab0.add(row2); |
---|
| 303 | + tab0.add(row3); |
---|
| 304 | + tab0.add(row4); |
---|
| 305 | + tab0.add(row5); |
---|
| 306 | + tab0.add(row6); |
---|
| 307 | + |
---|
| 308 | + for (int i=5; --i>=0;) |
---|
| 309 | + { |
---|
| 310 | + //oe.toolboxPanel.Return(); |
---|
| 311 | + //tab0.add(new cGridBag()); |
---|
| 312 | + } |
---|
| 313 | + } |
---|
| 314 | + |
---|
| 315 | + public void CallBack(String[] path) |
---|
| 316 | + { |
---|
| 317 | + for (int i = 0; i < path.length; i++) |
---|
| 318 | + { |
---|
| 319 | + System.out.print(path[i] + "/"); |
---|
| 320 | + } |
---|
| 321 | + |
---|
| 322 | + System.out.println(); |
---|
| 323 | + } |
---|
| 324 | + |
---|
| 325 | + public void ChangeSkybox(String skybox) |
---|
| 326 | + { |
---|
| 327 | + //cameraView.envyoff = false; |
---|
| 328 | + group.skyboxname = skybox; |
---|
| 329 | + group.skyboxext = "jpg"; |
---|
| 330 | + cameraView.repaint(); |
---|
| 331 | + |
---|
| 332 | + Grafreed.ParseResources("textures", this); |
---|
| 333 | + } |
---|
| 334 | + |
---|
26 | 335 | //ObjEditor objEditor; |
---|
27 | 336 | public void closeUI2() |
---|
28 | 337 | { |
---|
.. | .. |
---|
60 | 369 | this.copy = this.group = group; |
---|
61 | 370 | //selectees = this.group.selectees; |
---|
62 | 371 | |
---|
| 372 | + if (copy.versionlist == null) |
---|
| 373 | + { |
---|
| 374 | + copy.versionlist = new Object3D[100]; |
---|
| 375 | + copy.versionindex = -1; |
---|
| 376 | + } |
---|
| 377 | + |
---|
63 | 378 | if(ui) |
---|
64 | 379 | SetupUI(objEditor); |
---|
65 | 380 | } |
---|
.. | .. |
---|
74 | 389 | this.copy = this.group = copy; |
---|
75 | 390 | //selectees = this.group.selectees; |
---|
76 | 391 | |
---|
77 | | - SetupMenu2(objEditor); |
---|
| 392 | + SetupMenu2(this); //objEditor); |
---|
78 | 393 | SetupUI2(objEditor); |
---|
79 | 394 | objEditor.SetupUI(true); |
---|
80 | 395 | SetupViews(objEditor); |
---|
81 | 396 | |
---|
82 | 397 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 398 | + |
---|
| 399 | + if (copy.versionlist == null) |
---|
| 400 | + { |
---|
| 401 | + copy.versionlist = new Object3D[100]; |
---|
| 402 | + copy.versionindex = -1; |
---|
| 403 | + |
---|
| 404 | + Save(true); |
---|
| 405 | + } |
---|
83 | 406 | } |
---|
84 | 407 | |
---|
85 | 408 | void CloneSelection(boolean supports) |
---|
86 | 409 | { |
---|
| 410 | + if (Globals.REPLACEONMAKE) |
---|
| 411 | + Save(); |
---|
| 412 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 413 | + Globals.REPLACEONMAKE = false; |
---|
87 | 414 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 415 | //Object3D obj; |
---|
89 | 416 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 421 | |
---|
95 | 422 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 423 | } |
---|
| 424 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 425 | } |
---|
98 | 426 | |
---|
99 | 427 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
148 | 476 | |
---|
149 | 477 | //JTextField nameField; |
---|
150 | 478 | |
---|
151 | | - void SetupMenu2(ObjEditor oe) |
---|
| 479 | + void SetupMenu2(GroupEditor oe) |
---|
152 | 480 | { |
---|
153 | | - if (Globals.ADVANCED) |
---|
154 | | - { |
---|
155 | | - oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
156 | | - //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
157 | | - //cameraMenu.add(switchItem = new MenuItem("Reverse View")); |
---|
158 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
159 | | - oe.cameraMenu.add("-"); |
---|
160 | | - openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
161 | | - openWindowItem.addActionListener(this); |
---|
162 | | - editLeafItem.addActionListener(this); |
---|
163 | | - lookAtItem.addActionListener(this); |
---|
164 | | - //lookFromItem.addActinoListener(this); |
---|
165 | | - //switchItem.addActionListener(this); |
---|
166 | | - } |
---|
167 | | - |
---|
| 481 | + oe.jTree = new cTree(); |
---|
| 482 | + |
---|
168 | 483 | Menu menu; |
---|
169 | 484 | oe.menuBar.add(menu = new Menu("Edit")); |
---|
170 | 485 | //editItem = menu.add(new MenuItem("Edit")); |
---|
171 | 486 | //editItem.addActionListener(this); |
---|
172 | | - duplicateItem = menu.add(new MenuItem("Duplicate")); |
---|
| 487 | + |
---|
| 488 | +// undoItem = menu.add(new MenuItem("Undo")); |
---|
| 489 | +// undoItem.addActionListener(this); |
---|
| 490 | +// redoItem = menu.add(new MenuItem("Redo")); |
---|
| 491 | +// redoItem.addActionListener(this); |
---|
| 492 | +// menu.add("-"); |
---|
| 493 | + duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate")); |
---|
173 | 494 | duplicateItem.addActionListener(this); |
---|
174 | 495 | cloneItem = menu.add(new MenuItem("Clone")); |
---|
175 | 496 | cloneItem.addActionListener(this); |
---|
.. | .. |
---|
185 | 506 | copyItem.addActionListener(this); |
---|
186 | 507 | pasteItem = menu.add(new MenuItem("Paste")); |
---|
187 | 508 | pasteItem.addActionListener(this); |
---|
188 | | - menu.add("-"); |
---|
189 | 509 | |
---|
190 | 510 | menu.add("-"); |
---|
191 | 511 | pasteIntoItem = menu.add(new MenuItem("Paste into")); |
---|
.. | .. |
---|
197 | 517 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
198 | 518 | // pasteExpandItem.addActionListener(this); |
---|
199 | 519 | menu.add("-"); |
---|
200 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
201 | | - clearItem.addActionListener(this); |
---|
| 520 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 521 | + deleteItem.addActionListener(this); |
---|
202 | 522 | |
---|
203 | 523 | if (Globals.ADVANCED) |
---|
204 | 524 | { |
---|
.. | .. |
---|
206 | 526 | clearAllItem = menu.add(new MenuItem("Clear All")); |
---|
207 | 527 | clearAllItem.addActionListener(this); |
---|
208 | 528 | } |
---|
| 529 | + |
---|
| 530 | + menuBar.add(cameraMenu = new Menu("View")); |
---|
| 531 | + //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer")); |
---|
| 532 | + //zBufferItem.addActionListener(this); |
---|
| 533 | + //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens")); |
---|
| 534 | + //normalLensItem.addActionListener(this); |
---|
| 535 | + cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint")); |
---|
| 536 | + restoreCameraItem.addActionListener(this); |
---|
| 537 | + |
---|
| 538 | +// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen")); |
---|
| 539 | +// toggleFullScreenItem.addItemListener(this); |
---|
| 540 | +// toggleFullScreenItem.setState(CameraPane.FULLSCREEN); |
---|
| 541 | +// cameraMenu.add("-"); |
---|
| 542 | +// |
---|
| 543 | +// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture")); |
---|
| 544 | +// toggleTextureItem.addItemListener(this); |
---|
| 545 | +// toggleTextureItem.setState(CameraPane.textureon); |
---|
| 546 | +// |
---|
| 547 | +// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch")); |
---|
| 548 | +// toggleSwitchItem.addItemListener(this); |
---|
| 549 | +// toggleSwitchItem.setState(CameraPane.SWITCH); |
---|
| 550 | + |
---|
| 551 | + cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles")); |
---|
| 552 | + toggleHandleItem.addItemListener(this); |
---|
| 553 | + toggleHandleItem.setState(CameraPane.HANDLES); |
---|
| 554 | + |
---|
| 555 | + cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode")); |
---|
| 556 | + togglePaintItem.addItemListener(this); |
---|
| 557 | + togglePaintItem.setState(CameraPane.PAINTMODE); |
---|
| 558 | + |
---|
| 559 | + if (Globals.ADVANCED) |
---|
| 560 | + { |
---|
| 561 | + cameraMenu.add("-"); |
---|
| 562 | + cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live")); |
---|
| 563 | + toggleLiveItem.addItemListener(this); |
---|
| 564 | + toggleLiveItem.setState(Globals.isLIVE()); |
---|
209 | 565 | |
---|
| 566 | + cameraMenu.add(stepItem = new MenuItem("Step")); |
---|
| 567 | + stepItem.addActionListener(this); |
---|
| 568 | + // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List")); |
---|
| 569 | + // toggleDLItem.addItemListener(this); |
---|
| 570 | + // toggleDLItem.setState(false); |
---|
| 571 | + |
---|
| 572 | + cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render")); |
---|
| 573 | + toggleRenderItem.addItemListener(this); |
---|
| 574 | + toggleRenderItem.setState(!CameraPane.frozen); |
---|
| 575 | + |
---|
| 576 | + cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug")); |
---|
| 577 | + toggleDebugItem.addItemListener(this); |
---|
| 578 | + toggleDebugItem.setState(Globals.DEBUG); |
---|
| 579 | + |
---|
| 580 | + cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum")); |
---|
| 581 | + toggleFrustumItem.addItemListener(this); |
---|
| 582 | + toggleFrustumItem.setState(CameraPane.FRUSTUM); |
---|
| 583 | + |
---|
| 584 | + cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact")); |
---|
| 585 | + toggleFootContactItem.addItemListener(this); |
---|
| 586 | + toggleFootContactItem.setState(CameraPane.FOOTCONTACT); |
---|
| 587 | + |
---|
| 588 | + cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline")); |
---|
| 589 | + toggleTimelineItem.addItemListener(this); |
---|
| 590 | + } |
---|
| 591 | + |
---|
| 592 | +// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root")); |
---|
| 593 | +// toggleRootItem.addItemListener(this); |
---|
| 594 | +// toggleRootItem.setState(false); |
---|
| 595 | +// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation")); |
---|
| 596 | +// animationItem.addItemListener(this); |
---|
| 597 | +// animationItem.setState(CameraPane.ANIMATION); |
---|
| 598 | + cameraMenu.add("-"); |
---|
| 599 | + cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint")); |
---|
| 600 | + editCameraItem.addActionListener(this); |
---|
| 601 | + |
---|
| 602 | + if (Globals.ADVANCED) |
---|
| 603 | + { |
---|
| 604 | + oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
| 605 | + //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
| 606 | + //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
| 607 | + editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
| 608 | + oe.cameraMenu.add("-"); |
---|
| 609 | + openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
| 610 | + openWindowItem.addActionListener(this); |
---|
| 611 | + editLeafItem.addActionListener(this); |
---|
| 612 | + lookAtItem.addActionListener(this); |
---|
| 613 | + //lookFromItem.addActinoListener(this); |
---|
| 614 | + //switchViewItem.addActionListener(this); |
---|
| 615 | + } |
---|
| 616 | + |
---|
210 | 617 | oe.menuBar.add(menu = new Menu("Setting")); |
---|
211 | 618 | if (Globals.ADVANCED) |
---|
212 | 619 | { |
---|
.. | .. |
---|
249 | 656 | } |
---|
250 | 657 | |
---|
251 | 658 | oe.menuBar.add(menu = new Menu("Group")); |
---|
252 | | - grabItem = menu.add(new MenuItem("Grab")); |
---|
253 | | - grabItem.addActionListener(this); |
---|
| 659 | +// grabItem = menu.add(new MenuItem("Grab")); |
---|
| 660 | +// grabItem.addActionListener(this); |
---|
254 | 661 | backItem = menu.add(new MenuItem("Back")); |
---|
255 | 662 | backItem.addActionListener(this); |
---|
256 | 663 | frontItem = menu.add(new MenuItem("Front")); |
---|
257 | 664 | frontItem.addActionListener(this); |
---|
258 | | - compositeItem = menu.add(new MenuItem("Composite")); |
---|
259 | | - compositeItem.addActionListener(this); |
---|
| 665 | +// compositeItem = menu.add(new MenuItem("Composite")); |
---|
| 666 | +// compositeItem.addActionListener(this); |
---|
| 667 | + |
---|
| 668 | + if (Globals.ADVANCED) |
---|
| 669 | + { |
---|
260 | 670 | hideItem = menu.add(new MenuItem("Hidden Group")); |
---|
261 | 671 | hideItem.addActionListener(this); |
---|
| 672 | + } |
---|
262 | 673 | ungroupItem = menu.add(new MenuItem("Ungroup")); |
---|
263 | 674 | ungroupItem.addActionListener(this); |
---|
264 | | - menu.add("-"); |
---|
265 | | - randomItem = menu.add(new MenuItem("Switch node")); |
---|
266 | | - randomItem.addActionListener(this); |
---|
| 675 | + |
---|
| 676 | +// menu.add("-"); |
---|
| 677 | +// |
---|
| 678 | +// switchItem = menu.add(new MenuItem("Switch node")); |
---|
| 679 | +// switchItem.addActionListener(this); |
---|
| 680 | + if (Globals.ADVANCED) |
---|
| 681 | + { |
---|
267 | 682 | switchGeoItem = menu.add(new MenuItem("Switch Geometry")); |
---|
268 | 683 | switchGeoItem.addActionListener(this); |
---|
269 | 684 | switchTransfoItem = menu.add(new MenuItem("Switch Transform")); |
---|
.. | .. |
---|
271 | 686 | morphItem = menu.add(new MenuItem("Morph Group")); |
---|
272 | 687 | morphItem.addActionListener(this); |
---|
273 | 688 | |
---|
274 | | - if (Globals.ADVANCED) |
---|
275 | | - { |
---|
276 | 689 | menu.add("-"); |
---|
277 | 690 | physicsItem = menu.add(new MenuItem("Physics")); |
---|
278 | 691 | physicsItem.addActionListener(this); |
---|
.. | .. |
---|
280 | 693 | frameselectorItem.addActionListener(this); |
---|
281 | 694 | scriptNodeItem = menu.add(new MenuItem("Script Node")); |
---|
282 | 695 | scriptNodeItem.addActionListener(this); |
---|
283 | | - cameraItem = menu.add(new MenuItem("Camera")); |
---|
284 | | - cameraItem.addActionListener(this); |
---|
285 | 696 | } |
---|
286 | 697 | |
---|
287 | 698 | oe.menuBar.add(menu = new Menu("Object")); |
---|
288 | | - textureItem = menu.add(new MenuItem("Texture")); |
---|
289 | | - textureItem.addActionListener(this); |
---|
| 699 | +// textureItem = menu.add(new MenuItem("Texture")); |
---|
| 700 | +// textureItem.addActionListener(this); |
---|
290 | 701 | billboardItem = menu.add(new MenuItem("Billboard")); |
---|
291 | 702 | billboardItem.addActionListener(this); |
---|
292 | 703 | csgItem = menu.add(new MenuItem("CSG")); |
---|
293 | 704 | csgItem.addActionListener(this); |
---|
294 | | - shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
| 705 | + shadowXItem = menu.add(new MenuItem("Shadow Red")); |
---|
295 | 706 | shadowXItem.addActionListener(this); |
---|
296 | | - shadowYItem = menu.add(new MenuItem("Shadow Y")); |
---|
| 707 | + shadowYItem = menu.add(new MenuItem("Shadow Green")); |
---|
297 | 708 | shadowYItem.addActionListener(this); |
---|
298 | | - shadowZItem = menu.add(new MenuItem("Shadow Z")); |
---|
| 709 | + shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
299 | 710 | shadowZItem.addActionListener(this); |
---|
| 711 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 712 | + attributeItem.addActionListener(this); |
---|
| 713 | + |
---|
300 | 714 | if (Globals.ADVANCED) |
---|
301 | 715 | { |
---|
302 | 716 | menu.add("-"); |
---|
303 | 717 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
304 | 718 | linkerItem.addActionListener(this); |
---|
305 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
306 | | - attributeItem.addActionListener(this); |
---|
307 | 719 | templateItem = menu.add(new MenuItem("Template")); |
---|
308 | 720 | templateItem.addActionListener(this); |
---|
309 | 721 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
332 | 744 | genNormalsMESHItem.addActionListener(this); |
---|
333 | 745 | if (Globals.ADVANCED) |
---|
334 | 746 | { |
---|
335 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 747 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
336 | 748 | genNormalsMINEItem.addActionListener(this); |
---|
337 | 749 | } |
---|
338 | 750 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
392 | 804 | markleavesItem.addActionListener(this); |
---|
393 | 805 | unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves")); |
---|
394 | 806 | unmarkleavesItem.addActionListener(this); |
---|
| 807 | + rewindleavesItem = menu.add(new MenuItem("Rewind Leaves")); |
---|
| 808 | + rewindleavesItem.addActionListener(this); |
---|
| 809 | + unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves")); |
---|
| 810 | + unrewindleavesItem.addActionListener(this); |
---|
| 811 | + randomleavesItem = menu.add(new MenuItem("Random Leaves")); |
---|
| 812 | + randomleavesItem.addActionListener(this); |
---|
| 813 | + unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves")); |
---|
| 814 | + unrandomleavesItem.addActionListener(this); |
---|
395 | 815 | menu.add("-"); |
---|
396 | 816 | flipVItem = menu.add(new MenuItem("Flip V")); |
---|
397 | 817 | flipVItem.addActionListener(this); |
---|
.. | .. |
---|
417 | 837 | attachBumpItem.addActionListener(this); |
---|
418 | 838 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
419 | 839 | pigmentBumpItem.addActionListener(this); |
---|
| 840 | + //embedTexturesItem |
---|
420 | 841 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
421 | 842 | detachPigmentItem.addActionListener(this); |
---|
422 | 843 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
423 | 844 | detachBumpItem.addActionListener(this); |
---|
| 845 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 846 | + embedTexturesItem.addActionListener(this); |
---|
| 847 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 848 | + deEmbedTexturesItem.addActionListener(this); |
---|
424 | 849 | menu.add("-"); |
---|
425 | 850 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
426 | 851 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
443 | 868 | oe.menuBar.add(menu = new Menu("Insert")); |
---|
444 | 869 | buildCreateMenu(menu); |
---|
445 | 870 | |
---|
446 | | - oe.menuBar.add(menu = new Menu("Include")); |
---|
447 | | - importOBJItem = menu.add(new MenuItem("OBJ file...")); |
---|
448 | | - importOBJItem.addActionListener(this); |
---|
449 | | - menu.add("-"); |
---|
450 | | - import3DSItem = menu.add(new MenuItem("3DS file...")); |
---|
451 | | - import3DSItem.addActionListener(this); |
---|
452 | | - menu.add("-"); |
---|
453 | | - importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file...")); |
---|
454 | | - importVRMLX3DItem.addActionListener(this); |
---|
455 | | - menu.add("-"); |
---|
456 | | - importGFDItem = menu.add(new MenuItem("GrafreeD file...")); |
---|
457 | | - importGFDItem.addActionListener(this); |
---|
458 | | - |
---|
459 | 871 | oe.menuBar.add(menu = new Menu("Tools")); |
---|
460 | 872 | buildToolsMenu(menu); |
---|
461 | 873 | } |
---|
462 | 874 | |
---|
| 875 | + |
---|
463 | 876 | void SetupUI2(ObjEditor oe) |
---|
464 | 877 | { |
---|
| 878 | + // June 2019 |
---|
| 879 | + if (oe == null) |
---|
| 880 | + { |
---|
| 881 | + //super.SetupUI2(this); |
---|
| 882 | + //return; |
---|
| 883 | + } |
---|
| 884 | + |
---|
| 885 | + if (copy != group) |
---|
| 886 | + { |
---|
| 887 | + //super.SetupUI2(this); |
---|
| 888 | + } |
---|
| 889 | + |
---|
465 | 890 | //new Exception().printStackTrace(); |
---|
466 | 891 | |
---|
467 | 892 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
.. | .. |
---|
490 | 915 | oe.radioPanel.add(dummyButton); |
---|
491 | 916 | oe.buttonGroup.add(dummyButton); |
---|
492 | 917 | */ |
---|
| 918 | + cGridBag copyOptionsPanel = new cGridBag(); |
---|
| 919 | + |
---|
| 920 | + copyOptionsPanel.preferredHeight = 2; |
---|
| 921 | + |
---|
493 | 922 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
494 | 923 | |
---|
495 | | - oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 924 | + //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 925 | + //minButton.setToolTipText("Minimize window"); |
---|
| 926 | + //minButton.addActionListener(this); |
---|
| 927 | + |
---|
| 928 | + if (Globals.ADVANCED) |
---|
| 929 | + { |
---|
| 930 | + oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 931 | + maxButton.setToolTipText("Maximize window"); |
---|
| 932 | + maxButton.addActionListener(this); |
---|
| 933 | + } |
---|
| 934 | + |
---|
| 935 | + oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 936 | + fullButton.setToolTipText("Full-screen window"); |
---|
| 937 | + fullButton.addActionListener(this); |
---|
| 938 | + |
---|
| 939 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 940 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 941 | + screenfitButton.addActionListener(this); |
---|
| 942 | + |
---|
| 943 | + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 944 | + restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
| 945 | + restoreCameraButton.addActionListener(this); |
---|
| 946 | + |
---|
| 947 | + copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 948 | + saveVersionButton.setToolTipText("Duplicate current version"); |
---|
| 949 | + saveVersionButton.addActionListener(this); |
---|
| 950 | + |
---|
| 951 | + copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 952 | + deleteVersionButton.setToolTipText("Delete current version"); |
---|
| 953 | + deleteVersionButton.addActionListener(this); |
---|
| 954 | + |
---|
| 955 | + copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 956 | + previousVersionButton.setToolTipText("Previous version"); |
---|
| 957 | + previousVersionButton.addActionListener(this); |
---|
| 958 | + previousVersionButton.setEnabled(false); |
---|
| 959 | + |
---|
| 960 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 961 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 962 | + restoreButton.setToolTipText("Undo (restore current version)"); |
---|
| 963 | + restoreButton.addActionListener(this); |
---|
| 964 | + //restoreButton.setEnabled(false); |
---|
| 965 | + |
---|
| 966 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 967 | + replaceButton.setToolTipText("Save (replace current version)"); |
---|
| 968 | + replaceButton.addActionListener(this); |
---|
| 969 | + //replaceButton.setEnabled(false); |
---|
| 970 | + |
---|
| 971 | + copyOptionsPanel.add(updown); |
---|
| 972 | + |
---|
| 973 | + copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 974 | + nextVersionButton.setToolTipText("Next version"); |
---|
| 975 | + nextVersionButton.addActionListener(this); |
---|
| 976 | + nextVersionButton.setEnabled(false); |
---|
| 977 | + |
---|
| 978 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
496 | 979 | liveCB.setToolTipText("Enable animation"); |
---|
497 | 980 | liveCB.addItemListener(this); |
---|
498 | 981 | |
---|
499 | | - oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 982 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
500 | 983 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
501 | 984 | oneStepButton.addActionListener(this); |
---|
502 | 985 | |
---|
503 | | - oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints); |
---|
| 986 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
504 | 987 | fastCB.setToolTipText("Fast mode"); |
---|
505 | 988 | fastCB.addItemListener(this); |
---|
506 | 989 | |
---|
507 | | - oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
508 | | - trackCB.setToolTipText("Enable tracking"); |
---|
509 | | - trackCB.addItemListener(this); |
---|
510 | | - |
---|
511 | | - oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
512 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
513 | | - screenfitButton.addActionListener(this); |
---|
| 990 | + //oe.toolboxPanel.Return(); |
---|
| 991 | + |
---|
| 992 | +// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 993 | +// trackCB.setToolTipText("Enable tracking"); |
---|
| 994 | +// trackCB.addItemListener(this); |
---|
514 | 995 | |
---|
515 | 996 | // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints); |
---|
516 | 997 | // screenfitpointButton.addActionListener(this); |
---|
.. | .. |
---|
520 | 1001 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
521 | 1002 | snapobjectButton.addActionListener(this); |
---|
522 | 1003 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 1004 | + |
---|
| 1005 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1006 | + fourButton.addActionListener(this); |
---|
| 1007 | + fourButton.setToolTipText("Show control panel only"); |
---|
523 | 1008 | } |
---|
524 | 1009 | |
---|
525 | | - oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
526 | | - flashSelectionButton.setToolTipText("Show selection"); |
---|
527 | | - flashSelectionButton.addActionListener(this); |
---|
| 1010 | + //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
528 | 1011 | |
---|
529 | | - oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
530 | | - |
---|
531 | | - oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
532 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 1012 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1013 | + twoButton.setToolTipText("Show 3D view only"); |
---|
533 | 1014 | twoButton.addActionListener(this); |
---|
534 | | - oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
535 | | - fourButton.addActionListener(this); |
---|
536 | | - fourButton.setToolTipText("Show left panel only"); |
---|
537 | | - oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
538 | | - sixButton.setToolTipText("2-column layout left"); |
---|
539 | | - sixButton.addActionListener(this); |
---|
540 | | - oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
541 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 1015 | + this.fullscreenLayout = twoButton; |
---|
| 1016 | + |
---|
| 1017 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1018 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
542 | 1019 | threeButton.addActionListener(this); |
---|
543 | | - oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
544 | | - sevenButton.setToolTipText("3-column layout"); |
---|
545 | | - sevenButton.addActionListener(this); |
---|
| 1020 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1021 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1022 | + sixButton.addActionListener(this); |
---|
| 1023 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1024 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1025 | +// sevenButton.addActionListener(this); |
---|
546 | 1026 | // |
---|
547 | 1027 | |
---|
548 | | - oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
549 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 1028 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1029 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
550 | 1030 | rootButton.addActionListener(this); |
---|
551 | 1031 | |
---|
552 | | - oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1032 | + oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
553 | 1033 | closeButton.setToolTipText("Close tab"); |
---|
554 | 1034 | closeButton.addActionListener(this); |
---|
555 | 1035 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
556 | 1036 | //clearButton.addActionListener(this); |
---|
557 | | - |
---|
558 | | - cGridBag commandsPanel = new cGridBag(); |
---|
| 1037 | + |
---|
| 1038 | + cGridBag row1 = new cGridBag(); |
---|
559 | 1039 | |
---|
560 | | - commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
561 | | - editButton.setToolTipText("Edit selection"); |
---|
| 1040 | + // INSERT |
---|
| 1041 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1042 | + gridButton.setToolTipText("Create grid"); |
---|
| 1043 | + gridButton.addActionListener(this); |
---|
| 1044 | + |
---|
| 1045 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1046 | + boxButton.setToolTipText("Create box"); |
---|
| 1047 | + boxButton.addActionListener(this); |
---|
| 1048 | + |
---|
| 1049 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1050 | + sphereButton.setToolTipText("Create sphere"); |
---|
| 1051 | + sphereButton.addActionListener(this); |
---|
| 1052 | + |
---|
| 1053 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1054 | + coneButton.setToolTipText("Create cone"); |
---|
| 1055 | + coneButton.addActionListener(this); |
---|
| 1056 | + |
---|
| 1057 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1058 | + torusButton.setToolTipText("Create torus"); |
---|
| 1059 | + torusButton.addActionListener(this); |
---|
| 1060 | + |
---|
| 1061 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1062 | + superButton.setToolTipText("Create superellipsoid"); |
---|
| 1063 | + superButton.addActionListener(this); |
---|
| 1064 | + |
---|
| 1065 | + if (Globals.ADVANCED) |
---|
| 1066 | + { |
---|
| 1067 | + oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | + kleinButton.setToolTipText("Create Klein bottle"); |
---|
| 1069 | + kleinButton.addActionListener(this); |
---|
| 1070 | + } |
---|
| 1071 | + |
---|
| 1072 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1073 | + particlesButton.setToolTipText("Create particle system"); |
---|
| 1074 | + particlesButton.addActionListener(this); |
---|
| 1075 | + |
---|
| 1076 | + oe.toolboxPanel.add(row1); |
---|
| 1077 | + |
---|
| 1078 | + cGridBag row2 = new cGridBag(); |
---|
| 1079 | + |
---|
| 1080 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1081 | + groupButton.setToolTipText("Create group"); |
---|
| 1082 | + groupButton.addActionListener(this); |
---|
| 1083 | + |
---|
| 1084 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1085 | + compositeButton.setToolTipText("Create composite"); |
---|
| 1086 | + compositeButton.addActionListener(this); |
---|
| 1087 | + |
---|
| 1088 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1089 | + switchButton.setToolTipText("Create item switcher"); |
---|
| 1090 | + switchButton.addActionListener(this); |
---|
| 1091 | + |
---|
| 1092 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1093 | + loopButton.setToolTipText("Create loop"); |
---|
| 1094 | + loopButton.addActionListener(this); |
---|
| 1095 | + |
---|
| 1096 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1097 | + textureButton.setToolTipText("Create texture"); |
---|
| 1098 | + textureButton.addActionListener(this); |
---|
| 1099 | + |
---|
| 1100 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1101 | + overlayButton.setToolTipText("Create overlay"); |
---|
| 1102 | + overlayButton.addActionListener(this); |
---|
| 1103 | + |
---|
| 1104 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1105 | + lightButton.setToolTipText("Create light"); |
---|
| 1106 | + lightButton.addActionListener(this); |
---|
| 1107 | + |
---|
| 1108 | + oe.toolboxPanel.add(row2); |
---|
| 1109 | + |
---|
| 1110 | + // ENVYMAPS |
---|
| 1111 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1112 | + skyboxpane.preferredHeight = 100; |
---|
| 1113 | + |
---|
| 1114 | + oe.toolboxPanel.add(skyboxpane); |
---|
| 1115 | + |
---|
| 1116 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1117 | + skyboxpane.add(skyboxpanel); |
---|
| 1118 | + |
---|
| 1119 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1120 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1121 | + AddSkyboxTab2(skyboxpanel); |
---|
| 1122 | + AddSkyboxTab3(skyboxpanel); |
---|
| 1123 | + |
---|
| 1124 | + // EDIT panel |
---|
| 1125 | + editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1126 | + editButton.setToolTipText("Pin selection controls"); |
---|
562 | 1127 | editButton.addActionListener(this); |
---|
563 | 1128 | |
---|
564 | | - commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
565 | | - uneditButton.setToolTipText("Unedit selection"); |
---|
| 1129 | + editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1130 | + uneditButton.setToolTipText("Unpin and remove selection controls"); |
---|
566 | 1131 | uneditButton.addActionListener(this); |
---|
567 | 1132 | |
---|
568 | | - commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
569 | | - allParamsButton.setToolTipText("Edit all params"); |
---|
| 1133 | + editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints); |
---|
| 1134 | + allParamsButton.setToolTipText("Show all controle"); |
---|
570 | 1135 | allParamsButton.addActionListener(this); |
---|
571 | 1136 | |
---|
572 | | - commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1137 | + editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
573 | 1138 | clearPanelButton.setToolTipText("Clear edit panel"); |
---|
574 | 1139 | clearPanelButton.addActionListener(this); |
---|
575 | 1140 | |
---|
576 | | - commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1141 | + editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
577 | 1142 | unselectButton.setToolTipText("Unselect"); |
---|
578 | 1143 | unselectButton.addActionListener(this); |
---|
579 | 1144 | |
---|
580 | | - commandsPanel.preferredHeight = 1; |
---|
| 1145 | + editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1146 | + flashSelectionButton.setToolTipText("Highlight selection"); |
---|
| 1147 | + flashSelectionButton.addActionListener(this); |
---|
581 | 1148 | |
---|
582 | | - oe.treePanel.add(commandsPanel); |
---|
583 | | - oe.treePanel.Return(); |
---|
| 1149 | + editCommandsPanel.preferredHeight = 1; |
---|
| 1150 | + |
---|
| 1151 | + SetPinStates(false); |
---|
| 1152 | +// oe.treePanel.add(commandsPanel); |
---|
| 1153 | +// oe.treePanel.Return(); |
---|
584 | 1154 | |
---|
585 | 1155 | // oe.aConstraints.gridx += 1; |
---|
586 | 1156 | // oe.aConstraints.weighty = 0; |
---|
.. | .. |
---|
597 | 1167 | |
---|
598 | 1168 | JScrollPane jSP; |
---|
599 | 1169 | //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints); |
---|
600 | | - jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints); |
---|
| 1170 | + jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints); |
---|
601 | 1171 | ResetModel(); |
---|
602 | 1172 | |
---|
603 | 1173 | oe.treePanel.add(jSPPanel); |
---|
604 | 1174 | oe.treePanel.Return(); |
---|
605 | 1175 | |
---|
606 | | - cGridBag copyOptionsPanel = new cGridBag(); |
---|
607 | | - |
---|
608 | | - copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
609 | | - colorCB.setToolTipText("Copy color when dropped"); |
---|
610 | | - colorCB.addItemListener(this); |
---|
611 | | - |
---|
612 | | - copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
613 | | - materialCB.setToolTipText("Copy material when dropped"); |
---|
614 | | - materialCB.addItemListener(this); |
---|
615 | | - |
---|
616 | | - copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
617 | | - textureCB.setToolTipText("Copy texture when dropped"); |
---|
618 | | - textureCB.addItemListener(this); |
---|
619 | | - |
---|
620 | | - copyOptionsPanel.preferredHeight = 1; |
---|
621 | 1176 | oe.treePanel.add(copyOptionsPanel); |
---|
622 | 1177 | oe.treePanel.Return(); |
---|
| 1178 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1179 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1180 | + sliderPane.preferredHeight = 1; |
---|
623 | 1181 | |
---|
624 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
625 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1182 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1183 | + mainPanel.setResizeWeight(0.4); |
---|
626 | 1184 | |
---|
627 | 1185 | //jList.addListSelectionListener(this); |
---|
628 | 1186 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
630 | 1188 | //jTree.setEditable(true); |
---|
631 | 1189 | oe.jTree.setDragEnabled(true); |
---|
632 | 1190 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
633 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1191 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
634 | 1192 | |
---|
635 | 1193 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
636 | 1194 | |
---|
.. | .. |
---|
642 | 1200 | dgr.addDragGestureListener(this); |
---|
643 | 1201 | }catch(Exception e) {} |
---|
644 | 1202 | */ |
---|
645 | | - radio.layout = sevenButton; |
---|
| 1203 | + radio.layout = threeButton; // sixButton; |
---|
646 | 1204 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
647 | 1205 | } |
---|
648 | 1206 | |
---|
649 | 1207 | void AddOptions(cGridBag panel) //, GridBagConstraints constraints) |
---|
650 | 1208 | { |
---|
| 1209 | + panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints); |
---|
| 1210 | + colorCB.setToolTipText("Copy color when dropped"); |
---|
| 1211 | + colorCB.addItemListener(this); |
---|
| 1212 | + |
---|
| 1213 | + panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints); |
---|
| 1214 | + materialCB.setToolTipText("Copy material when dropped"); |
---|
| 1215 | + materialCB.addItemListener(this); |
---|
| 1216 | + |
---|
| 1217 | + panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints); |
---|
| 1218 | + textureCB.setToolTipText("Copy texture when dropped"); |
---|
| 1219 | + textureCB.addItemListener(this); |
---|
| 1220 | + |
---|
| 1221 | + panel.Return(); |
---|
| 1222 | + |
---|
651 | 1223 | panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints); |
---|
652 | 1224 | boxCB.setToolTipText("Display bounding boxes"); |
---|
653 | 1225 | boxCB.addItemListener(this); |
---|
654 | 1226 | |
---|
655 | 1227 | panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints); |
---|
656 | | - zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel"); |
---|
| 1228 | + zoomBoxCB.setToolTipText("Display only for wheel"); |
---|
657 | 1229 | zoomBoxCB.addItemListener(this); |
---|
658 | 1230 | |
---|
659 | 1231 | if (true) // Globals.ADVANCED) |
---|
660 | 1232 | { |
---|
661 | | - panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
662 | | - supportCB.setToolTipText("Enable rigging"); |
---|
663 | | - supportCB.addItemListener(this); |
---|
| 1233 | +// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints); |
---|
| 1234 | +// supportCB.setToolTipText("Enable rigging"); |
---|
| 1235 | +// supportCB.addItemListener(this); |
---|
| 1236 | + |
---|
| 1237 | + panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints); |
---|
| 1238 | + freezeCB.setToolTipText("Fast moving camera"); |
---|
| 1239 | + freezeCB.addItemListener(this); |
---|
664 | 1240 | |
---|
665 | 1241 | // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints); |
---|
666 | 1242 | // localCB.addItemListener(this); |
---|
667 | 1243 | |
---|
| 1244 | + panel.Return(); |
---|
| 1245 | + |
---|
668 | 1246 | panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints); |
---|
669 | 1247 | crowdCB.setToolTipText("Used for crowds"); |
---|
670 | 1248 | crowdCB.addItemListener(this); |
---|
.. | .. |
---|
673 | 1251 | smoothCB.setToolTipText("Snapping delay"); |
---|
674 | 1252 | smoothCB.addItemListener(this); |
---|
675 | 1253 | |
---|
676 | | - panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
677 | | - slowCB.setToolTipText("Smooth interpolation"); |
---|
678 | | - slowCB.addItemListener(this); |
---|
| 1254 | +// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints); |
---|
| 1255 | +// slowCB.setToolTipText("Smooth interpolation"); |
---|
| 1256 | +// slowCB.addItemListener(this); |
---|
| 1257 | + panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints); |
---|
| 1258 | + minshaderCB.setToolTipText("Minimal fast shader"); |
---|
| 1259 | + minshaderCB.addItemListener(this); |
---|
679 | 1260 | |
---|
680 | 1261 | // constraints.gridy += 1; |
---|
681 | 1262 | // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints); |
---|
682 | 1263 | // speakerMocapCB.addItemListener(this); |
---|
683 | 1264 | |
---|
| 1265 | + panel.Return(); |
---|
| 1266 | + |
---|
684 | 1267 | if (false) |
---|
685 | 1268 | { |
---|
686 | 1269 | // handled in scripts |
---|
.. | .. |
---|
695 | 1278 | //constraints.gridy += 1; |
---|
696 | 1279 | panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints); |
---|
697 | 1280 | smoothfocusCB.addItemListener(this); |
---|
| 1281 | + panel.Return(); |
---|
698 | 1282 | } |
---|
699 | 1283 | |
---|
700 | 1284 | //constraints.gridx += 1; |
---|
701 | 1285 | //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints); |
---|
702 | 1286 | // debugCB.addItemListener(this); |
---|
703 | 1287 | |
---|
| 1288 | + panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints); |
---|
| 1289 | + trackCB.setToolTipText("Enable tracking target"); |
---|
| 1290 | + trackCB.addItemListener(this); |
---|
| 1291 | + |
---|
704 | 1292 | panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints); |
---|
| 1293 | + oeilCB.setToolTipText("Move camera when tracking"); |
---|
705 | 1294 | oeilCB.addItemListener(this); |
---|
706 | 1295 | |
---|
| 1296 | + panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints); |
---|
| 1297 | + shadowCB.setToolTipText("When live compute shadows"); |
---|
| 1298 | + shadowCB.addItemListener(this); |
---|
| 1299 | + |
---|
| 1300 | + panel.Return(); |
---|
| 1301 | + panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints); |
---|
| 1302 | + toggleTextureCB.setToolTipText("Load textures"); |
---|
| 1303 | + toggleTextureCB.addItemListener(this); |
---|
| 1304 | + |
---|
| 1305 | + panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints); |
---|
| 1306 | + toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
| 1307 | + toggleSwitchCB.addItemListener(this); |
---|
| 1308 | + |
---|
| 1309 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1310 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1311 | + autokeepCB.addItemListener(this); |
---|
| 1312 | + |
---|
| 1313 | + panel.Return(); |
---|
| 1314 | + if (Globals.ADVANCED) |
---|
| 1315 | + { |
---|
707 | 1316 | panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints); |
---|
708 | 1317 | lookAtCB.setToolTipText("Look-at target"); |
---|
709 | 1318 | lookAtCB.addItemListener(this); |
---|
| 1319 | + } |
---|
710 | 1320 | |
---|
711 | 1321 | } |
---|
712 | 1322 | |
---|
713 | 1323 | cGridBag fill = new cGridBag(); |
---|
714 | | - |
---|
715 | 1324 | fill.preferredHeight = 200; |
---|
| 1325 | + cGridBag fill2 = new cGridBag(); |
---|
| 1326 | + fill2.preferredHeight = 200; |
---|
| 1327 | + cGridBag fill3 = new cGridBag(); |
---|
| 1328 | + fill3.preferredHeight = 200; |
---|
716 | 1329 | |
---|
717 | 1330 | panel.add(fill); |
---|
| 1331 | + panel.add(fill2); |
---|
| 1332 | + panel.add(fill3); |
---|
718 | 1333 | |
---|
719 | 1334 | } |
---|
720 | 1335 | |
---|
721 | 1336 | void EditObject(Object3D obj) |
---|
722 | 1337 | { |
---|
723 | 1338 | cRadio radioButton = new cRadio(obj.name); |
---|
| 1339 | + |
---|
| 1340 | + // June 2019. Patch to avoid bug with transparency. |
---|
| 1341 | + radioButton.hadMaterial = obj.material != null; |
---|
| 1342 | + if (!radioButton.hadMaterial) |
---|
| 1343 | + { |
---|
| 1344 | + obj.material = new cMaterial(); |
---|
| 1345 | + } |
---|
| 1346 | + |
---|
724 | 1347 | radioButton.SetObject(obj); |
---|
725 | | - radioButton.layout = sevenButton; |
---|
| 1348 | + radioButton.layout = threeButton; // sixButton; |
---|
726 | 1349 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
727 | 1350 | radioButton.addActionListener(this); |
---|
728 | 1351 | radioPanel.add(radioButton); |
---|
729 | 1352 | buttonGroup.add(radioButton); |
---|
730 | 1353 | radioButton.doClick(); |
---|
731 | 1354 | } |
---|
| 1355 | + |
---|
732 | 1356 | void SetupViews(ObjEditor oe) |
---|
733 | 1357 | { |
---|
| 1358 | + theFrame = this; |
---|
| 1359 | + |
---|
734 | 1360 | oe.SetupViews(); |
---|
735 | 1361 | |
---|
736 | 1362 | System.out.println("SetupViews"); |
---|
.. | .. |
---|
739 | 1365 | /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this); |
---|
740 | 1366 | } |
---|
741 | 1367 | |
---|
742 | | - JCheckBox liveCB; |
---|
743 | | - JCheckBox supportCB; |
---|
744 | | - JCheckBox localCB; |
---|
745 | | - JCheckBox crowdCB; |
---|
746 | | - JCheckBox smoothCB; |
---|
747 | | - JCheckBox fastCB; |
---|
748 | | - JCheckBox slowCB; |
---|
749 | | - JCheckBox boxCB; |
---|
750 | | - JCheckBox zoomBoxCB; |
---|
751 | | - JCheckBox trackCB; |
---|
752 | | - JCheckBox smoothfocusCB; |
---|
| 1368 | + cToggleButton liveCB; |
---|
| 1369 | + cCheckBox supportCB; |
---|
| 1370 | + cCheckBox localCB; |
---|
| 1371 | + cCheckBox crowdCB; |
---|
| 1372 | + cCheckBox smoothCB; |
---|
| 1373 | + cCheckBox minshaderCB; |
---|
| 1374 | + |
---|
| 1375 | + cToggleButton fastCB; |
---|
| 1376 | + cCheckBox slowCB; |
---|
| 1377 | + cCheckBox boxCB; |
---|
| 1378 | + cCheckBox zoomBoxCB; |
---|
| 1379 | + cCheckBox freezeCB; |
---|
| 1380 | + //cToggleButton trackCB; |
---|
| 1381 | + cCheckBox trackCB; |
---|
| 1382 | + cCheckBox smoothfocusCB; |
---|
753 | 1383 | // JCheckBox speakerMocapCB; |
---|
754 | | - JCheckBox speakerCameraCB; |
---|
755 | | - JCheckBox speakerFocusCB; |
---|
756 | | - JCheckBox debugCB; |
---|
757 | | - JCheckBox oeilCB; |
---|
758 | | - JCheckBox lookAtCB; |
---|
| 1384 | + cCheckBox speakerCameraCB; |
---|
| 1385 | + cCheckBox speakerFocusCB; |
---|
| 1386 | + cCheckBox debugCB; |
---|
| 1387 | + |
---|
| 1388 | + cCheckBox oeilCB; |
---|
| 1389 | + cCheckBox shadowCB; |
---|
| 1390 | + cCheckBox autokeepCB; |
---|
| 1391 | + cCheckBox lookAtCB; |
---|
759 | 1392 | |
---|
760 | 1393 | // static int COLOR = 1; |
---|
761 | 1394 | // static int MATERIAL = 2; |
---|
.. | .. |
---|
763 | 1396 | |
---|
764 | 1397 | int dropAttributes = Object3D.COLOR | Object3D.MATERIAL; |
---|
765 | 1398 | |
---|
766 | | - JCheckBox colorCB; |
---|
767 | | - JCheckBox materialCB; |
---|
768 | | - JCheckBox textureCB; |
---|
| 1399 | + cCheckBox colorCB; |
---|
| 1400 | + cCheckBox materialCB; |
---|
| 1401 | + cCheckBox textureCB; |
---|
769 | 1402 | |
---|
770 | 1403 | public void itemStateChanged(ItemEvent e) |
---|
771 | 1404 | { |
---|
.. | .. |
---|
793 | 1426 | } else if(e.getSource() == liveCB) |
---|
794 | 1427 | { |
---|
795 | 1428 | cameraView.ToggleLive(); |
---|
| 1429 | + refreshContents(false); |
---|
796 | 1430 | } |
---|
797 | 1431 | else if(e.getSource() == supportCB) |
---|
798 | 1432 | { |
---|
.. | .. |
---|
808 | 1442 | { |
---|
809 | 1443 | cameraView.ToggleInertia(); |
---|
810 | 1444 | cameraView.repaint(); |
---|
| 1445 | + } |
---|
| 1446 | + else if(e.getSource() == minshaderCB) |
---|
| 1447 | + { |
---|
| 1448 | + Globals.MINSHADER ^= true; |
---|
| 1449 | + cameraView.programInitialized = false; |
---|
| 1450 | + cameraView.repaint(); |
---|
811 | 1451 | } |
---|
812 | 1452 | else if(e.getSource() == localCB) |
---|
813 | 1453 | { |
---|
.. | .. |
---|
857 | 1497 | { |
---|
858 | 1498 | cameraView.ToggleOeil(); |
---|
859 | 1499 | } |
---|
| 1500 | + else if(e.getSource() == shadowCB) |
---|
| 1501 | + { |
---|
| 1502 | + Globals.COMPUTESHADOWWHENLIVE ^= true; |
---|
| 1503 | + } |
---|
| 1504 | + else if(e.getSource() == freezeCB) |
---|
| 1505 | + { |
---|
| 1506 | + Globals.FREEZEONMOVE ^= true; |
---|
| 1507 | + } |
---|
| 1508 | + else if(e.getSource() == autokeepCB) |
---|
| 1509 | + { |
---|
| 1510 | + Globals.REPLACEONMAKE ^= true; |
---|
| 1511 | + } |
---|
860 | 1512 | else if(e.getSource() == lookAtCB) |
---|
861 | 1513 | { |
---|
862 | 1514 | cameraView.ToggleLookAt(); |
---|
.. | .. |
---|
873 | 1525 | |
---|
874 | 1526 | /**/ |
---|
875 | 1527 | //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this); |
---|
876 | | - TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1528 | + //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent()); |
---|
| 1529 | + TreePath path = objEditor.jTree.getSelectionPath(); |
---|
877 | 1530 | if ((path == null) || (path.getPathCount() <= 1)) { |
---|
878 | 1531 | // We can't move the root node or an empty selection |
---|
879 | 1532 | return; |
---|
.. | .. |
---|
936 | 1589 | } |
---|
937 | 1590 | } |
---|
938 | 1591 | |
---|
939 | | - String string = (String) object; |
---|
940 | | - |
---|
941 | 1592 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
942 | 1593 | // if( object instanceof java.io.File[]) |
---|
943 | 1594 | // { |
---|
.. | .. |
---|
945 | 1596 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
946 | 1597 | // return; |
---|
947 | 1598 | // } |
---|
| 1599 | + |
---|
| 1600 | + String string = object.toString(); |
---|
948 | 1601 | |
---|
949 | 1602 | // File path for Mac and Windows |
---|
950 | 1603 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
990 | 1643 | |
---|
991 | 1644 | assert target == objEditor.jTree; |
---|
992 | 1645 | TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y); |
---|
| 1646 | + Object3D destinationLeaf; |
---|
993 | 1647 | try { |
---|
994 | | - Object3D dummy = (Composite) destinationPath.getLastPathComponent(); |
---|
| 1648 | + destinationLeaf = (Composite) destinationPath.getLastPathComponent(); |
---|
995 | 1649 | } catch (Exception e) { |
---|
996 | 1650 | System.out.println("destinationPath : " + destinationPath); |
---|
997 | 1651 | return; |
---|
998 | 1652 | } |
---|
999 | 1653 | |
---|
1000 | | - if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1654 | + for (int i=group.selection.size(); --i>=0;) |
---|
1001 | 1655 | { |
---|
| 1656 | + Object3D child = (Object3D)group.selection.elementAt(i); |
---|
| 1657 | + |
---|
| 1658 | + // Cannot move into itself |
---|
| 1659 | + if (child == destinationLeaf) |
---|
| 1660 | + return; |
---|
| 1661 | + } |
---|
| 1662 | + |
---|
| 1663 | +// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK) |
---|
| 1664 | +// { |
---|
1002 | 1665 | loadClipboard(true); |
---|
1003 | 1666 | objEditor.jTree.setSelectionPath(destinationPath); |
---|
1004 | 1667 | pasteInto(false, false); |
---|
1005 | | - } else { |
---|
1006 | | - loadClipboard(false); |
---|
1007 | | - objEditor.jTree.setSelectionPath(destinationPath); |
---|
1008 | | - pasteInto(false, false); // true); // ??? |
---|
1009 | | - } |
---|
| 1668 | +// } else { |
---|
| 1669 | +// loadClipboard(false); |
---|
| 1670 | +// objEditor.jTree.setSelectionPath(destinationPath); |
---|
| 1671 | +// pasteInto(false, false); // true); // ??? |
---|
| 1672 | +// } |
---|
1010 | 1673 | } |
---|
1011 | 1674 | public void dropActionChanged(DropTargetDragEvent dtde) |
---|
1012 | 1675 | // Called if the user has modified the current drop gesture |
---|
.. | .. |
---|
1111 | 1774 | { |
---|
1112 | 1775 | //heightFieldItem = menu.add(new MenuItem("Height Field")); |
---|
1113 | 1776 | //heightFieldItem.addActionListener(this); |
---|
1114 | | - gridItem = menu.add(new MenuItem("Grid")); |
---|
1115 | | - gridItem.addActionListener(this); |
---|
1116 | | - rectoidItem = menu.add(new MenuItem("Box")); |
---|
1117 | | - rectoidItem.addActionListener(this); |
---|
1118 | | - ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
1119 | | - ellipsoidItem.addActionListener(this); |
---|
1120 | | - coneItem = menu.add(new MenuItem("Cone")); |
---|
1121 | | - coneItem.addActionListener(this); |
---|
1122 | | - torusItem = menu.add(new MenuItem("Torus")); |
---|
1123 | | - torusItem.addActionListener(this); |
---|
1124 | | - superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1125 | | - superItem.addActionListener(this); |
---|
| 1777 | +// gridItem = menu.add(new MenuItem("Grid")); |
---|
| 1778 | +// gridItem.addActionListener(this); |
---|
| 1779 | +// rectoidItem = menu.add(new MenuItem("Box")); |
---|
| 1780 | +// rectoidItem.addActionListener(this); |
---|
| 1781 | +// ellipsoidItem = menu.add(new MenuItem("Sphere")); |
---|
| 1782 | +// ellipsoidItem.addActionListener(this); |
---|
| 1783 | +// coneItem = menu.add(new MenuItem("Cone")); |
---|
| 1784 | +// coneItem.addActionListener(this); |
---|
| 1785 | +// torusItem = menu.add(new MenuItem("Torus")); |
---|
| 1786 | +// torusItem.addActionListener(this); |
---|
| 1787 | +// superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
| 1788 | +// superItem.addActionListener(this); |
---|
| 1789 | + |
---|
| 1790 | + cameraItem = menu.add(new MenuItem("Camera")); |
---|
| 1791 | + cameraItem.addActionListener(this); |
---|
| 1792 | + |
---|
| 1793 | + if (!Globals.ADVANCED) |
---|
| 1794 | + { |
---|
1126 | 1795 | kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
1127 | 1796 | kleinItem.addActionListener(this); |
---|
1128 | | - particleItem = menu.add(new MenuItem("Particle system")); |
---|
1129 | | - particleItem.addActionListener(this); |
---|
| 1797 | + } |
---|
| 1798 | + |
---|
| 1799 | +// particleItem = menu.add(new MenuItem("Particle system")); |
---|
| 1800 | +// particleItem.addActionListener(this); |
---|
1130 | 1801 | if (Globals.ADVANCED) |
---|
1131 | 1802 | { |
---|
1132 | 1803 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1152 | 1823 | } |
---|
1153 | 1824 | bezierItem = menu.add(new MenuItem("Bezier Patch")); |
---|
1154 | 1825 | bezierItem.addActionListener(this); |
---|
1155 | | - overlayItem = menu.add(new MenuItem("Overlay")); |
---|
1156 | | - overlayItem.addActionListener(this); |
---|
1157 | | - lightItem = menu.add(new MenuItem("Light")); |
---|
1158 | | - lightItem.addActionListener(this); |
---|
| 1826 | +// overlayItem = menu.add(new MenuItem("Overlay")); |
---|
| 1827 | +// overlayItem.addActionListener(this); |
---|
| 1828 | +// lightItem = menu.add(new MenuItem("Light")); |
---|
| 1829 | +// lightItem.addActionListener(this); |
---|
1159 | 1830 | menu.add("-"); |
---|
1160 | 1831 | //superLoopItem = menu.add(new MenuItem("Super Loop")); |
---|
1161 | 1832 | //superLoopItem.addActionListener(this); |
---|
1162 | | - loopItem = menu.add(new MenuItem("Loop")); |
---|
1163 | | - loopItem.addActionListener(this); |
---|
| 1833 | +// loopItem = menu.add(new MenuItem("Loop")); |
---|
| 1834 | +// loopItem.addActionListener(this); |
---|
1164 | 1835 | doubleItem = menu.add(new MenuItem("Fork")); |
---|
1165 | 1836 | doubleItem.addActionListener(this); |
---|
1166 | 1837 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
1176 | 1847 | animationItem.addItemListener(this); |
---|
1177 | 1848 | animationItem.setState(Globals.ANIMATION); |
---|
1178 | 1849 | |
---|
| 1850 | + menu.add(archiveItem = new MenuItem("Archive3D...")); |
---|
| 1851 | + archiveItem.addActionListener(this); |
---|
| 1852 | + |
---|
1179 | 1853 | menu.add("-"); |
---|
1180 | 1854 | parseverticesItem = menu.add(new MenuItem("Multiplicity")); |
---|
1181 | 1855 | parseverticesItem.addActionListener(this); |
---|
.. | .. |
---|
1188 | 1862 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1189 | 1863 | reduce34MorphItem.addActionListener(this); |
---|
1190 | 1864 | menu.add("-"); |
---|
| 1865 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1866 | + memoryItem.addActionListener(this); |
---|
1191 | 1867 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1192 | 1868 | computeAOItem.addActionListener(this); |
---|
1193 | 1869 | |
---|
.. | .. |
---|
1196 | 1872 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1197 | 1873 | mirrorItem.addActionListener(this); |
---|
1198 | 1874 | menu.add("-"); |
---|
1199 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1200 | | - memoryItem.addActionListener(this); |
---|
1201 | 1875 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1202 | 1876 | analyzeItem.addActionListener(this); |
---|
1203 | | - menu.add(dumpItem = new MenuItem("Dump")); |
---|
| 1877 | + menu.add(dumpItem = new MenuItem("Print")); |
---|
1204 | 1878 | dumpItem.addActionListener(this); |
---|
1205 | 1879 | // menu.add(pathItem = new MenuItem("From-to path")); |
---|
1206 | 1880 | // pathItem.addActionListener(this); |
---|
.. | .. |
---|
1341 | 2015 | shadow.material = new cMaterial(obj.material); |
---|
1342 | 2016 | shadow.material.diffuse = 0.0001f; |
---|
1343 | 2017 | shadow.material.specular = 0.0001f; |
---|
| 2018 | + //shadow.projectedVertices[1].x = 300; |
---|
1344 | 2019 | |
---|
1345 | 2020 | makeSomething(shadow); |
---|
1346 | 2021 | } |
---|
| 2022 | + |
---|
| 2023 | + private void ClearUnpinned() |
---|
| 2024 | + { |
---|
| 2025 | + //for (Object3D obj : listUI) |
---|
| 2026 | + for (int i=listUI.size(); --i>=0;) |
---|
| 2027 | + { |
---|
| 2028 | + Object3D obj = listUI.elementAt(i); |
---|
| 2029 | + if (!obj.pinned) |
---|
| 2030 | + { |
---|
| 2031 | + obj.CloseUI(); |
---|
| 2032 | + listUI.remove(i); |
---|
| 2033 | + } |
---|
| 2034 | + } |
---|
| 2035 | + } |
---|
| 2036 | + |
---|
| 2037 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 2038 | + { |
---|
| 2039 | + // if (!(elem instanceof Composite)) |
---|
| 2040 | + // newWindow = false; |
---|
| 2041 | + listUI.add(elem); |
---|
| 2042 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 2043 | + System.out.println("edit : " + elem); |
---|
| 2044 | + elem.editWindow.refreshContents(true); // ? new |
---|
| 2045 | + } |
---|
1347 | 2046 | |
---|
1348 | 2047 | /** |
---|
1349 | 2048 | * applyExample |
---|
.. | .. |
---|
1588 | 2287 | { |
---|
1589 | 2288 | ScreenFit(); |
---|
1590 | 2289 | } else |
---|
1591 | | - if (source == switchItem) |
---|
| 2290 | + if (source == switchViewItem) |
---|
1592 | 2291 | { |
---|
1593 | 2292 | cVector v1 = new cVector(); |
---|
1594 | 2293 | cVector v2 = new cVector(); |
---|
.. | .. |
---|
1597 | 2296 | objEditor.cameraView.renderCamera.setAim(v2, v1); |
---|
1598 | 2297 | objEditor.cameraView.repaint(); |
---|
1599 | 2298 | } else |
---|
1600 | | - if (source == rectoidItem) |
---|
| 2299 | + if (source == rectoidItem || source == boxButton) |
---|
1601 | 2300 | { |
---|
1602 | 2301 | makeSomething(new Box()); |
---|
1603 | 2302 | } else |
---|
1604 | | - if (source == particleItem) |
---|
| 2303 | + if (source == particleItem || source == particlesButton) |
---|
1605 | 2304 | { |
---|
1606 | 2305 | ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType); |
---|
1607 | 2306 | ParticleController particleController = new ParticleController(particleGeom); |
---|
.. | .. |
---|
1680 | 2379 | |
---|
1681 | 2380 | makeSomething(obj); |
---|
1682 | 2381 | } else |
---|
1683 | | - if (source == gridItem) |
---|
| 2382 | + if (source == gridItem || source == gridButton) |
---|
1684 | 2383 | { |
---|
1685 | 2384 | makeSomething(new Grid()); |
---|
1686 | 2385 | } else |
---|
1687 | | - if (source == ellipsoidItem) |
---|
| 2386 | + if (source == ellipsoidItem || source == sphereButton) |
---|
1688 | 2387 | { |
---|
1689 | 2388 | makeSomething(new Sphere()); |
---|
1690 | 2389 | } else |
---|
1691 | | - if (source == coneItem) |
---|
| 2390 | + if (source == coneItem || source == coneButton) |
---|
1692 | 2391 | { |
---|
1693 | 2392 | makeSomething(new Cone()); |
---|
1694 | 2393 | } else |
---|
1695 | | - if (source == torusItem) |
---|
| 2394 | + if (source == torusItem || source == torusButton) |
---|
1696 | 2395 | { |
---|
1697 | 2396 | makeSomething(new Torus()); |
---|
1698 | 2397 | } else |
---|
1699 | | - if (source == superItem) |
---|
| 2398 | + if (source == superItem || source == superButton) |
---|
1700 | 2399 | { |
---|
1701 | 2400 | makeSomething(new Superellipsoid()); |
---|
1702 | 2401 | } else |
---|
1703 | | - if (source == kleinItem) |
---|
| 2402 | + if (source == kleinItem || source == kleinButton) |
---|
1704 | 2403 | { |
---|
1705 | 2404 | makeSomething(new Klein()); |
---|
1706 | 2405 | } else |
---|
.. | .. |
---|
1720 | 2419 | { |
---|
1721 | 2420 | makeSomething(new BezierSurface()); |
---|
1722 | 2421 | } else |
---|
1723 | | - if (source == overlayItem) |
---|
| 2422 | + if (source == overlayItem || source == overlayButton) |
---|
1724 | 2423 | { |
---|
1725 | 2424 | /* |
---|
1726 | 2425 | Object3D obj = new BezierSurface(5,8); |
---|
.. | .. |
---|
1768 | 2467 | s.setup(); |
---|
1769 | 2468 | makeSomething(s); |
---|
1770 | 2469 | } else |
---|
1771 | | - if (source == lightItem) |
---|
| 2470 | + if (source == lightItem || source == lightButton) |
---|
1772 | 2471 | { |
---|
1773 | 2472 | makeSomething(new Light()); |
---|
1774 | 2473 | } else |
---|
| 2474 | +// if (source == skybox1Button || |
---|
| 2475 | +// source == skybox2Button || |
---|
| 2476 | +// source == skybox3Button || |
---|
| 2477 | +// source == skybox4Button || |
---|
| 2478 | +// source == skybox5Button || |
---|
| 2479 | +// source == skybox6Button || |
---|
| 2480 | +// source == skybox7Button || |
---|
| 2481 | +// source == skybox11Button || |
---|
| 2482 | +// source == skybox12Button || |
---|
| 2483 | +// source == skybox13Button || |
---|
| 2484 | +// source == skybox14Button || |
---|
| 2485 | +// source == skybox15Button || |
---|
| 2486 | +// source == skybox16Button || |
---|
| 2487 | +// source == skybox17Button) |
---|
| 2488 | +// { |
---|
| 2489 | +// ChangeSkybox(source); |
---|
| 2490 | +// } else |
---|
1775 | 2491 | if (source == csgItem) |
---|
1776 | 2492 | { |
---|
1777 | 2493 | group(new CSG()); |
---|
.. | .. |
---|
1818 | 2534 | |
---|
1819 | 2535 | group(g); |
---|
1820 | 2536 | } else |
---|
1821 | | - if (source == loopItem) |
---|
| 2537 | + if (source == loopItem || source == loopButton) |
---|
1822 | 2538 | { |
---|
1823 | 2539 | Composite csg = new GroupLeaf(); |
---|
1824 | 2540 | csg.count = 5; |
---|
1825 | 2541 | group(csg); |
---|
1826 | | - Composite child = new cGroup(); |
---|
| 2542 | + Composite child = new cGroup("Branch"); |
---|
1827 | 2543 | csg.addChild(child); |
---|
1828 | 2544 | child.addChild(csg); |
---|
1829 | 2545 | } else |
---|
1830 | 2546 | if (source == doubleItem) |
---|
1831 | 2547 | { |
---|
1832 | | - Composite csg = new GroupLeaf(); |
---|
| 2548 | + Composite csg = new GroupLeaf("Fork"); |
---|
1833 | 2549 | csg.count = 5; |
---|
1834 | 2550 | group(csg); |
---|
1835 | | - Composite child = new cGroup(); |
---|
| 2551 | + Composite child = new cGroup("Branch A"); |
---|
1836 | 2552 | csg.addChild(child); |
---|
1837 | 2553 | child.addChild(csg); |
---|
1838 | | - child = new cGroup(); |
---|
| 2554 | + child = new cGroup("Branch B"); |
---|
1839 | 2555 | csg.addChild(child); |
---|
1840 | 2556 | child.addChild(csg); |
---|
1841 | 2557 | } else |
---|
1842 | 2558 | if (source == tripleItem) |
---|
1843 | 2559 | { |
---|
1844 | | - Composite csg = new GroupLeaf(); |
---|
| 2560 | + Composite csg = new GroupLeaf("Trident"); |
---|
1845 | 2561 | csg.count = 4; |
---|
1846 | 2562 | group(csg); |
---|
1847 | 2563 | Composite child = new cGroup(); |
---|
.. | .. |
---|
1854 | 2570 | csg.addChild(child); |
---|
1855 | 2571 | child.addChild(csg); |
---|
1856 | 2572 | } else |
---|
1857 | | - |
---|
1858 | | - if (source == importGFDItem) |
---|
1859 | | - { |
---|
1860 | | - ImportGFD(); |
---|
1861 | | - } else |
---|
1862 | | - if (source == importVRMLX3DItem) |
---|
1863 | | - { |
---|
1864 | | - ImportVRMLX3D(); |
---|
1865 | | - } else |
---|
1866 | | - if (source == import3DSItem) |
---|
1867 | | - { |
---|
1868 | | - objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS"); |
---|
1869 | | - } else |
---|
1870 | | - if (source == importOBJItem) |
---|
1871 | | - { |
---|
1872 | | - //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ"); |
---|
1873 | | - FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD); |
---|
1874 | | - browser.setVisible(true); |
---|
1875 | | - String filename = browser.getFile(); |
---|
1876 | | - if (filename != null && filename.length() > 0) |
---|
1877 | | - { |
---|
1878 | | - String fullname = browser.getDirectory() + filename; |
---|
1879 | | - makeSomething(ReadOBJ(fullname), true); |
---|
1880 | | - } |
---|
1881 | | - } else |
---|
1882 | 2573 | if (source == computeAOItem) |
---|
1883 | 2574 | { |
---|
1884 | 2575 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
1885 | | - Globals.theRenderer.repaint(); |
---|
| 2576 | + cameraView.repaint(); |
---|
1886 | 2577 | } else |
---|
1887 | 2578 | if (source == recompileItem) |
---|
1888 | 2579 | { |
---|
.. | .. |
---|
1897 | 2588 | if (source == invariantsItem) |
---|
1898 | 2589 | { |
---|
1899 | 2590 | System.out.println("Invariants:"); |
---|
1900 | | - Grafreed.grafreeD.universe.invariants(); |
---|
| 2591 | + Grafreed.grafreed.universe.invariants(); |
---|
1901 | 2592 | } else |
---|
1902 | 2593 | if (source == memoryItem) |
---|
1903 | 2594 | { |
---|
.. | .. |
---|
1916 | 2607 | { |
---|
1917 | 2608 | DumpObject(); |
---|
1918 | 2609 | } else |
---|
| 2610 | + if (source == minButton) |
---|
| 2611 | + { |
---|
| 2612 | + Minimize(); |
---|
| 2613 | + } else |
---|
| 2614 | + if (source == maxButton) |
---|
| 2615 | + { |
---|
| 2616 | + Maximize(); |
---|
| 2617 | + } else |
---|
| 2618 | + if (source == fullButton) |
---|
| 2619 | + { |
---|
| 2620 | + ToggleFullScreen(); |
---|
| 2621 | + } else |
---|
| 2622 | + if (source == previousVersionButton) |
---|
| 2623 | + { |
---|
| 2624 | + // Go to previous version |
---|
| 2625 | + //if (!Undo()) |
---|
| 2626 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2627 | + PreviousVersion(); |
---|
| 2628 | + } else |
---|
| 2629 | + if (source == restoreButton) |
---|
| 2630 | + { |
---|
| 2631 | + // Restore current version |
---|
| 2632 | + Restore(); |
---|
| 2633 | + //restoreButton.setEnabled(false); |
---|
| 2634 | + } else |
---|
| 2635 | + if (source == replaceButton) |
---|
| 2636 | + { |
---|
| 2637 | + // Overwrite current version |
---|
| 2638 | + Replace(); |
---|
| 2639 | + //replaceButton.setEnabled(false); |
---|
| 2640 | + } else |
---|
| 2641 | + if (source == nextVersionButton) |
---|
| 2642 | + { |
---|
| 2643 | + // Go to next version |
---|
| 2644 | + NextVersion(); |
---|
| 2645 | + } else |
---|
| 2646 | + if (source == saveVersionButton) |
---|
| 2647 | + { |
---|
| 2648 | + // Save a new version |
---|
| 2649 | + if (!Save(true)) |
---|
| 2650 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
| 2651 | + } else |
---|
| 2652 | + if (source == deleteVersionButton) |
---|
| 2653 | + { |
---|
| 2654 | + // Delete a new version |
---|
| 2655 | + DeleteVersion(); |
---|
| 2656 | + } else |
---|
1919 | 2657 | if (source == oneStepButton) |
---|
1920 | 2658 | { |
---|
1921 | 2659 | Globals.ONESTEP = true; |
---|
.. | .. |
---|
1923 | 2661 | } else |
---|
1924 | 2662 | if (source == screenfitButton) |
---|
1925 | 2663 | { |
---|
1926 | | - //Reload(lastConverter, lastFilename, true); |
---|
1927 | 2664 | ScreenFit(); |
---|
1928 | 2665 | } else |
---|
1929 | 2666 | if (source == screenfitpointButton) |
---|
1930 | 2667 | { |
---|
1931 | | - //Reload(lastConverter, lastFilename, true); |
---|
1932 | 2668 | ScreenFitPoint(); |
---|
1933 | 2669 | } else |
---|
1934 | 2670 | if (source == snapobjectButton) |
---|
1935 | 2671 | { |
---|
1936 | | - //Reload(lastConverter, lastFilename, true); |
---|
1937 | 2672 | SnapObject(); |
---|
1938 | 2673 | } else |
---|
1939 | 2674 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
1969 | 2704 | if (source == cutItem || source == clearButton) |
---|
1970 | 2705 | { |
---|
1971 | 2706 | loadClipboard(true); |
---|
| 2707 | + } else |
---|
| 2708 | + if (source == undoItem) |
---|
| 2709 | + { |
---|
| 2710 | + PreviousVersion(); |
---|
| 2711 | + } else |
---|
| 2712 | + if (source == redoItem) |
---|
| 2713 | + { |
---|
| 2714 | + NextVersion(); |
---|
1972 | 2715 | } else |
---|
1973 | 2716 | if (source == duplicateItem) |
---|
1974 | 2717 | { |
---|
.. | .. |
---|
2289 | 3032 | { |
---|
2290 | 3033 | StepAll(); |
---|
2291 | 3034 | } else |
---|
2292 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 3035 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2293 | 3036 | { |
---|
2294 | 3037 | //int indices[] = jList.getSelectedIndices(); |
---|
2295 | 3038 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
2301 | 3044 | { |
---|
2302 | 3045 | ClearSelection(true); |
---|
2303 | 3046 | } else |
---|
2304 | | - if (source == grabItem) |
---|
| 3047 | + if (source == grabItem || source == groupButton) |
---|
2305 | 3048 | { |
---|
2306 | | - group(new cGroup(), true); |
---|
| 3049 | + group(new cGroup(), false); // true); |
---|
2307 | 3050 | } else |
---|
2308 | 3051 | if (source == hideItem) |
---|
2309 | 3052 | { |
---|
.. | .. |
---|
2321 | 3064 | { |
---|
2322 | 3065 | makeSomething(new Camera()); |
---|
2323 | 3066 | } else |
---|
2324 | | - if (source == compositeItem) |
---|
| 3067 | + if (source == compositeItem || source == compositeButton) |
---|
2325 | 3068 | { |
---|
2326 | 3069 | group(new Composite()); |
---|
2327 | 3070 | } else |
---|
2328 | | - if (source == randomItem) |
---|
| 3071 | + if (source == switchItem || source == switchButton) |
---|
2329 | 3072 | { |
---|
2330 | 3073 | RandomNode random = new RandomNode(); |
---|
2331 | 3074 | group(random); |
---|
.. | .. |
---|
2427 | 3170 | { |
---|
2428 | 3171 | group(new cLinker()); |
---|
2429 | 3172 | } else |
---|
2430 | | - if (source == textureItem) |
---|
| 3173 | + if (source == textureItem || source == textureButton) |
---|
2431 | 3174 | { |
---|
2432 | 3175 | group(new TextureNode()); |
---|
2433 | 3176 | } else |
---|
.. | .. |
---|
2447 | 3190 | { |
---|
2448 | 3191 | CastShadow(2); |
---|
2449 | 3192 | } else |
---|
2450 | | - if (source == ungroupItem) |
---|
| 3193 | + if (source == ungroupItem || source == ungroupButton) |
---|
2451 | 3194 | { |
---|
2452 | | - //ungroup(); |
---|
| 3195 | + boolean hasRoot = false; |
---|
| 3196 | + |
---|
2453 | 3197 | for (int i=0; i<group.selection.size(); i++) |
---|
2454 | 3198 | { |
---|
2455 | | - Ungroup(group.selection.get(i)); |
---|
| 3199 | + if (group.selection.get(i) == group) |
---|
| 3200 | + { |
---|
| 3201 | + hasRoot = true; |
---|
| 3202 | + break; |
---|
| 3203 | + } |
---|
2456 | 3204 | } |
---|
2457 | 3205 | |
---|
2458 | | - ClearSelection(false); |
---|
2459 | | - |
---|
2460 | | - refreshContents(); |
---|
| 3206 | + if (!hasRoot) |
---|
| 3207 | + { |
---|
| 3208 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 3209 | + { |
---|
| 3210 | + Ungroup(group.selection.get(i)); |
---|
| 3211 | + } |
---|
| 3212 | + |
---|
| 3213 | + ClearSelection(false); |
---|
| 3214 | + |
---|
| 3215 | + refreshContents(); |
---|
| 3216 | + } |
---|
2461 | 3217 | } else |
---|
2462 | 3218 | if (source == genUVItem) |
---|
2463 | 3219 | { |
---|
.. | .. |
---|
2469 | 3225 | } else |
---|
2470 | 3226 | if (source == genNormalsMESHItem) |
---|
2471 | 3227 | { |
---|
2472 | | - GenNormals(true); // TODO |
---|
| 3228 | + GenNormalsMESH(); |
---|
2473 | 3229 | } else |
---|
2474 | 3230 | if (source == genNormalsORGANItem) |
---|
2475 | 3231 | { |
---|
.. | .. |
---|
2534 | 3290 | if (source == unmarkleavesItem) |
---|
2535 | 3291 | { |
---|
2536 | 3292 | MarkLeaves(false); |
---|
| 3293 | + } else |
---|
| 3294 | + if (source == rewindleavesItem) |
---|
| 3295 | + { |
---|
| 3296 | + RewindLeaves(true); |
---|
| 3297 | + } else |
---|
| 3298 | + if (source == unrewindleavesItem) |
---|
| 3299 | + { |
---|
| 3300 | + RewindLeaves(false); |
---|
| 3301 | + } else |
---|
| 3302 | + if (source == randomleavesItem) |
---|
| 3303 | + { |
---|
| 3304 | + RandomLeaves(true); |
---|
| 3305 | + } else |
---|
| 3306 | + if (source == unrandomleavesItem) |
---|
| 3307 | + { |
---|
| 3308 | + RandomLeaves(false); |
---|
2537 | 3309 | } else |
---|
2538 | 3310 | if (source == flipVItem) |
---|
2539 | 3311 | { |
---|
.. | .. |
---|
2742 | 3514 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
2743 | 3515 | { |
---|
2744 | 3516 | obj = (Object3D)e.nextElement(); |
---|
2745 | | - obj.SetBumpTexture(null); |
---|
| 3517 | + obj.ResetBumpTexture(); |
---|
2746 | 3518 | } |
---|
2747 | 3519 | |
---|
2748 | 3520 | refreshContents(); |
---|
.. | .. |
---|
2758 | 3530 | |
---|
2759 | 3531 | refreshContents(); |
---|
2760 | 3532 | } else |
---|
| 3533 | + if (source == embedTexturesItem) |
---|
| 3534 | + { |
---|
| 3535 | + Object3D obj; |
---|
| 3536 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3537 | + { |
---|
| 3538 | + obj = (Object3D)e.nextElement(); |
---|
| 3539 | + obj.EmbedTextures(true); |
---|
| 3540 | + } |
---|
| 3541 | + |
---|
| 3542 | + refreshContents(); |
---|
| 3543 | + } else |
---|
| 3544 | + if (source == deEmbedTexturesItem) |
---|
| 3545 | + { |
---|
| 3546 | + Object3D obj; |
---|
| 3547 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3548 | + { |
---|
| 3549 | + obj = (Object3D)e.nextElement(); |
---|
| 3550 | + obj.EmbedTextures(false); |
---|
| 3551 | + } |
---|
| 3552 | + |
---|
| 3553 | + CameraPane.texturepigment.clear(); |
---|
| 3554 | + CameraPane.texturebump.clear(); |
---|
| 3555 | + |
---|
| 3556 | + refreshContents(); |
---|
| 3557 | + } else |
---|
2761 | 3558 | if (source == flashSelectionButton) |
---|
2762 | 3559 | { |
---|
2763 | 3560 | CameraPane.flash = true; |
---|
.. | .. |
---|
2769 | 3566 | if (source == twoButton) |
---|
2770 | 3567 | { |
---|
2771 | 3568 | radio.layout = twoButton; |
---|
| 3569 | + |
---|
| 3570 | + if (CameraPane.FULLSCREEN) |
---|
| 3571 | + fullscreenLayout = radio.layout; |
---|
| 3572 | + |
---|
2772 | 3573 | // bug |
---|
2773 | 3574 | //gridPanel.setDividerLocation(1.0); |
---|
2774 | 3575 | //bigPanel.setDividerLocation(0.0); |
---|
.. | .. |
---|
2801 | 3602 | bigThree.ClearUI(); |
---|
2802 | 3603 | bigThree.add(centralPanel); |
---|
2803 | 3604 | bigThree.FlushUI(); |
---|
| 3605 | + |
---|
| 3606 | + cameraView.requestFocusInWindow(); |
---|
| 3607 | + |
---|
| 3608 | +// refreshContents(true); |
---|
| 3609 | +// |
---|
| 3610 | +// try |
---|
| 3611 | +// { |
---|
| 3612 | +// java.awt.Robot bot = new java.awt.Robot(); |
---|
| 3613 | +// int mask = InputEvent.BUTTON1_MASK; |
---|
| 3614 | +// bot.mouseMove(100, 100); |
---|
| 3615 | +// bot.mousePress(mask); |
---|
| 3616 | +// bot.mouseRelease(mask); |
---|
| 3617 | +// } |
---|
| 3618 | +// catch (Exception e) |
---|
| 3619 | +// { |
---|
| 3620 | +// |
---|
| 3621 | +// } |
---|
| 3622 | + |
---|
2804 | 3623 | } else |
---|
2805 | 3624 | if (source == threeButton) |
---|
2806 | 3625 | { |
---|
2807 | 3626 | radio.layout = threeButton; |
---|
| 3627 | + |
---|
| 3628 | + if (CameraPane.FULLSCREEN) |
---|
| 3629 | + fullscreenLayout = radio.layout; |
---|
2808 | 3630 | |
---|
2809 | 3631 | // bigThree.remove(scenePanel); |
---|
2810 | 3632 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2834 | 3656 | // centralPanel.setVisible(true); |
---|
2835 | 3657 | // XYZPanel.setVisible(true); |
---|
2836 | 3658 | bigThree.ClearUI(); |
---|
| 3659 | + bigThree.add(scenePanel); |
---|
2837 | 3660 | bigThree.add(centralPanel); |
---|
2838 | | - bigThree.add(XYZPanel); |
---|
2839 | 3661 | bigThree.FlushUI(); |
---|
| 3662 | + |
---|
| 3663 | + cameraView.requestFocusInWindow(); |
---|
2840 | 3664 | } else |
---|
2841 | 3665 | if (source == fourButton) |
---|
2842 | 3666 | { |
---|
2843 | 3667 | radio.layout = fourButton; |
---|
| 3668 | + |
---|
| 3669 | + if (CameraPane.FULLSCREEN) |
---|
| 3670 | + fullscreenLayout = radio.layout; |
---|
2844 | 3671 | |
---|
2845 | 3672 | // bigThree.remove(scenePanel); |
---|
2846 | 3673 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2872 | 3699 | bigThree.ClearUI(); |
---|
2873 | 3700 | bigThree.add(scenePanel); |
---|
2874 | 3701 | bigThree.FlushUI(); |
---|
| 3702 | + |
---|
| 3703 | + cameraView.requestFocusInWindow(); |
---|
2875 | 3704 | } else |
---|
2876 | 3705 | if (source == sixButton) |
---|
2877 | 3706 | { |
---|
2878 | 3707 | radio.layout = sixButton; |
---|
| 3708 | + |
---|
| 3709 | + if (CameraPane.FULLSCREEN) |
---|
| 3710 | + fullscreenLayout = radio.layout; |
---|
2879 | 3711 | |
---|
2880 | 3712 | // bigThree.remove(scenePanel); |
---|
2881 | 3713 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2905 | 3737 | // centralPanel.setVisible(true); |
---|
2906 | 3738 | // XYZPanel.setVisible(false); |
---|
2907 | 3739 | bigThree.ClearUI(); |
---|
2908 | | - bigThree.add(scenePanel); |
---|
2909 | 3740 | bigThree.add(centralPanel); |
---|
| 3741 | + bigThree.add(scenePanel); |
---|
2910 | 3742 | bigThree.FlushUI(); |
---|
| 3743 | + |
---|
| 3744 | + cameraView.requestFocusInWindow(); |
---|
2911 | 3745 | } else |
---|
2912 | 3746 | if (source == sevenButton) |
---|
2913 | 3747 | { |
---|
2914 | 3748 | radio.layout = sevenButton; |
---|
| 3749 | + |
---|
| 3750 | + if (CameraPane.FULLSCREEN) |
---|
| 3751 | + fullscreenLayout = radio.layout; |
---|
2915 | 3752 | |
---|
2916 | 3753 | // bigThree.remove(scenePanel); |
---|
2917 | 3754 | // bigThree.remove(centralPanel); |
---|
.. | .. |
---|
2945 | 3782 | bigThree.add(centralPanel); |
---|
2946 | 3783 | bigThree.add(XYZPanel); |
---|
2947 | 3784 | bigThree.FlushUI(); |
---|
| 3785 | + |
---|
| 3786 | + cameraView.requestFocusInWindow(); |
---|
2948 | 3787 | } else |
---|
2949 | 3788 | if (source == rootButton) |
---|
2950 | 3789 | { |
---|
.. | .. |
---|
2956 | 3795 | EditObject(obj); |
---|
2957 | 3796 | } |
---|
2958 | 3797 | |
---|
| 3798 | + cameraView.requestFocusInWindow(); |
---|
2959 | 3799 | refreshContents(true); |
---|
2960 | 3800 | } else |
---|
2961 | 3801 | if (source == closeButton) |
---|
.. | .. |
---|
2965 | 3805 | for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();) |
---|
2966 | 3806 | { |
---|
2967 | 3807 | ab = (cRadio)e.nextElement(); |
---|
2968 | | - if(ab.getModel().isSelected() && ab.GetObject() != client) |
---|
| 3808 | + if (ab.getModel().isSelected() && ab.GetObject() != client) |
---|
2969 | 3809 | { |
---|
| 3810 | + // Patch to avoid bug with transparency. |
---|
| 3811 | + if (!ab.hadMaterial) |
---|
| 3812 | + { |
---|
| 3813 | + ab.object.material = null; |
---|
| 3814 | + } |
---|
| 3815 | + |
---|
2970 | 3816 | buttonGroup.remove(ab); |
---|
2971 | 3817 | radioPanel.remove(ab); |
---|
2972 | 3818 | |
---|
2973 | | - ab.GetObject().editWindow = null; |
---|
| 3819 | + //ab.GetObject().editWindow = null; |
---|
| 3820 | + ab.GetObject().manipWindow = null; |
---|
2974 | 3821 | // ab.GetObject().objectUI = null; // ????????? |
---|
2975 | 3822 | |
---|
2976 | 3823 | ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick(); |
---|
2977 | 3824 | break; |
---|
2978 | 3825 | } |
---|
2979 | 3826 | } |
---|
| 3827 | + |
---|
| 3828 | + cameraView.requestFocusInWindow(); |
---|
2980 | 3829 | refreshContents(true); |
---|
2981 | 3830 | } else |
---|
2982 | 3831 | if (source == editItem || source == editButton) |
---|
2983 | 3832 | { |
---|
| 3833 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3834 | + { |
---|
| 3835 | + Object3D child = (Object3D)e.nextElement(); |
---|
| 3836 | + child.pinned = true; |
---|
| 3837 | + } |
---|
| 3838 | + |
---|
2984 | 3839 | EditSelection(false); |
---|
2985 | 3840 | } else |
---|
2986 | 3841 | if (source == uneditButton) |
---|
.. | .. |
---|
2989 | 3844 | { |
---|
2990 | 3845 | Object3D child = (Object3D)e.nextElement(); |
---|
2991 | 3846 | if(child.editWindow != null) |
---|
2992 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3847 | + child.pinned = false; |
---|
2993 | 3848 | child.CloseUI(); |
---|
2994 | 3849 | listUI.remove(child); |
---|
| 3850 | +// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
2995 | 3851 | |
---|
2996 | | - child.editWindow = null; // ??????????? |
---|
| 3852 | + //child.editWindow = null; // ??????????? |
---|
2997 | 3853 | } |
---|
2998 | 3854 | objEditor.ctrlPanel.FlushUI(); |
---|
2999 | 3855 | //objEditor.jTree.clearSelection(); |
---|
.. | .. |
---|
3006 | 3862 | //copy.ClearUI(); |
---|
3007 | 3863 | for (Object3D obj : listUI) |
---|
3008 | 3864 | { |
---|
| 3865 | + obj.pinned = false; |
---|
3009 | 3866 | obj.CloseUI(); |
---|
3010 | 3867 | } |
---|
3011 | 3868 | listUI.clear(); |
---|
| 3869 | + SetPinStates(group.selection.size() > 0); |
---|
3012 | 3870 | refreshContents(true); |
---|
3013 | 3871 | } else |
---|
3014 | 3872 | if (source == allParamsButton) |
---|
3015 | 3873 | { |
---|
3016 | 3874 | assert(copy == group); |
---|
3017 | 3875 | |
---|
3018 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 3876 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
3019 | 3877 | |
---|
3020 | 3878 | for (Object3D obj : listUI) |
---|
3021 | 3879 | { |
---|
.. | .. |
---|
3064 | 3922 | } |
---|
3065 | 3923 | |
---|
3066 | 3924 | copy = group; |
---|
| 3925 | + |
---|
| 3926 | + SetUndoStates(); |
---|
| 3927 | + |
---|
3067 | 3928 | //Globals.theRenderer.object = group; |
---|
3068 | 3929 | if(!useclient) |
---|
3069 | 3930 | { |
---|
.. | .. |
---|
3079 | 3940 | frontView.object = group; |
---|
3080 | 3941 | sideView.object = group; |
---|
3081 | 3942 | } |
---|
3082 | | - group.editWindow = this; |
---|
| 3943 | + |
---|
| 3944 | +// fix "+" issue |
---|
| 3945 | + //group.editWindow = this; |
---|
| 3946 | + group.manipWindow = this; |
---|
| 3947 | + |
---|
3083 | 3948 | /* |
---|
3084 | 3949 | currentLayout = radio.layout; |
---|
3085 | 3950 | if (currentLayout == null) |
---|
3086 | 3951 | currentLayout = sevenButton; |
---|
3087 | 3952 | */ |
---|
3088 | 3953 | radio.layout.doClick(); |
---|
| 3954 | + |
---|
| 3955 | + ClearUnpinned(); |
---|
| 3956 | + |
---|
| 3957 | + //Grafreed.Assert(group != null); |
---|
| 3958 | + //Grafreed.Assert(group.selection != null); |
---|
| 3959 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3960 | + if (group.selection == null || group.selection.size() == 1) |
---|
| 3961 | + EditSelection(false); |
---|
3089 | 3962 | keepparent = group.parent; |
---|
3090 | 3963 | // PARENT = NULL or not??? |
---|
3091 | 3964 | //group.parent = null; // ROOT |
---|
3092 | 3965 | //group.attributes = -1; |
---|
3093 | 3966 | ResetModel(); |
---|
| 3967 | + |
---|
| 3968 | + cameraView.requestFocusInWindow(); |
---|
3094 | 3969 | refreshContents(true); |
---|
3095 | | - } |
---|
| 3970 | + } else if (event.getSource() == editCameraItem) |
---|
| 3971 | + { |
---|
| 3972 | + cameraView.ProtectCamera(); |
---|
| 3973 | + cameraView.requestFocusInWindow(); |
---|
| 3974 | + cameraView.repaint(); |
---|
| 3975 | + return; |
---|
| 3976 | + } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton) |
---|
| 3977 | + { |
---|
| 3978 | + cameraView.RevertCamera(); |
---|
| 3979 | + cameraView.requestFocusInWindow(); |
---|
| 3980 | + cameraView.repaint(); |
---|
| 3981 | + return; |
---|
| 3982 | + // } else if (event.getSource() == textureButton) |
---|
| 3983 | + // { |
---|
| 3984 | + // return; // true; |
---|
| 3985 | + } |
---|
3096 | 3986 | else |
---|
3097 | 3987 | { |
---|
3098 | 3988 | //return super.action(event, arg); |
---|
.. | .. |
---|
3101 | 3991 | } |
---|
3102 | 3992 | |
---|
3103 | 3993 | boolean useclient = false; |
---|
3104 | | - cRadio radio; |
---|
3105 | 3994 | |
---|
3106 | 3995 | void ToggleRoot() |
---|
3107 | 3996 | { |
---|
.. | .. |
---|
3340 | 4229 | |
---|
3341 | 4230 | int size = obj.MemorySize(); |
---|
3342 | 4231 | |
---|
3343 | | - System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4232 | + //System.err.println((size/1024) + " KB is the size of " + obj); |
---|
| 4233 | + System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)"); |
---|
3344 | 4234 | } |
---|
3345 | 4235 | } |
---|
3346 | 4236 | catch (Exception e) |
---|
.. | .. |
---|
3421 | 4311 | void GenNormals(boolean crease) |
---|
3422 | 4312 | { |
---|
3423 | 4313 | group.GenNormalsS(crease); |
---|
| 4314 | + |
---|
| 4315 | + refreshContents(); |
---|
| 4316 | + } |
---|
| 4317 | + |
---|
| 4318 | + void GenNormalsMESH() |
---|
| 4319 | + { |
---|
| 4320 | + group.GenNormalsMeshS(); |
---|
3424 | 4321 | |
---|
3425 | 4322 | refreshContents(); |
---|
3426 | 4323 | } |
---|
.. | .. |
---|
3656 | 4553 | |
---|
3657 | 4554 | try |
---|
3658 | 4555 | { |
---|
3659 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4556 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
3660 | 4557 | } |
---|
3661 | 4558 | catch (Exception e) |
---|
3662 | 4559 | { |
---|
.. | .. |
---|
4048 | 4945 | refreshContents(); |
---|
4049 | 4946 | } |
---|
4050 | 4947 | |
---|
| 4948 | + void RewindLeaves(boolean hide) |
---|
| 4949 | + { |
---|
| 4950 | + group.selection.RewindLeaves(hide); |
---|
| 4951 | + refreshContents(); |
---|
| 4952 | + } |
---|
| 4953 | + |
---|
| 4954 | + void RandomLeaves(boolean hide) |
---|
| 4955 | + { |
---|
| 4956 | + group.selection.RandomLeaves(hide); |
---|
| 4957 | + refreshContents(); |
---|
| 4958 | + } |
---|
| 4959 | + |
---|
4051 | 4960 | void SetTexRes(int tr) |
---|
4052 | 4961 | { |
---|
4053 | 4962 | group.selection.SetTexRes(tr); |
---|
.. | .. |
---|
4119 | 5028 | // } |
---|
4120 | 5029 | // } |
---|
4121 | 5030 | |
---|
4122 | | - static boolean allparams = true; |
---|
4123 | | - |
---|
4124 | | - static Vector<Object3D> listUI = new Vector<Object3D>(); |
---|
4125 | | - |
---|
4126 | 5031 | void EditSelection(boolean newWindow) |
---|
4127 | 5032 | { |
---|
| 5033 | + if (group.selection == null) |
---|
| 5034 | + { |
---|
| 5035 | + EditElement(group, newWindow); // ? new |
---|
| 5036 | + return; |
---|
| 5037 | + } |
---|
| 5038 | + |
---|
4128 | 5039 | // aConstraints.gridy = 0; |
---|
4129 | 5040 | for (int i=0; i<group.selection.size(); i++) |
---|
4130 | 5041 | { |
---|
4131 | 5042 | //System.out.println("edit : " + objectPanel.indexOfTab("Material")); |
---|
4132 | 5043 | //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false); |
---|
4133 | | - objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
| 5044 | + //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit")); |
---|
4134 | 5045 | |
---|
4135 | 5046 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4136 | | - if(elem != group) |
---|
| 5047 | + if(elem != group || !newWindow) |
---|
4137 | 5048 | { |
---|
4138 | | - // if (!(elem instanceof Composite)) |
---|
4139 | | - // newWindow = false; |
---|
4140 | | - listUI.add(elem); |
---|
4141 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4142 | | - System.out.println("edit : " + elem); |
---|
4143 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 5049 | + EditElement(elem, newWindow); // ? new |
---|
4144 | 5050 | } |
---|
4145 | 5051 | } |
---|
4146 | 5052 | } |
---|
.. | .. |
---|
4203 | 5109 | |
---|
4204 | 5110 | freezemodel = false; |
---|
4205 | 5111 | } |
---|
4206 | | - |
---|
4207 | | - boolean flashIt = true; |
---|
4208 | | - |
---|
| 5112 | + |
---|
4209 | 5113 | public void valueChanged(TreeSelectionEvent e) |
---|
4210 | 5114 | //public boolean handleEvent(Event event) |
---|
4211 | 5115 | { |
---|
.. | .. |
---|
4215 | 5119 | //new Exception().printStackTrace(); |
---|
4216 | 5120 | |
---|
4217 | 5121 | freezemodel = true; |
---|
4218 | | - |
---|
| 5122 | + ClearUnpinned(); |
---|
| 5123 | + |
---|
4219 | 5124 | /**/ |
---|
4220 | 5125 | //switch (event.id) |
---|
4221 | 5126 | { |
---|
.. | .. |
---|
4223 | 5128 | //case 702: // Event.LIST_DESELECT |
---|
4224 | 5129 | group.deselectAll(); |
---|
4225 | 5130 | TreePath tps[] = objEditor.jTree.getSelectionPaths(); |
---|
4226 | | - objEditor.ClearInfo(); // .GetMaterial()); |
---|
4227 | 5131 | if (tps != null) |
---|
4228 | 5132 | { |
---|
4229 | 5133 | for (int i=0; i < tps.length; i++) |
---|
.. | .. |
---|
4232 | 5136 | |
---|
4233 | 5137 | //if (child.parent != null) |
---|
4234 | 5138 | //child.parent.addSelectee(child); |
---|
| 5139 | + objEditor.SetMaterial(child); |
---|
4235 | 5140 | group.addSelectee(child); |
---|
4236 | | - objEditor.SetMaterial(child); // .GetMaterial()); |
---|
4237 | | - objEditor.AddInfo(child, this, true); // .GetMaterial()); |
---|
4238 | | - System.err.println("info : " + child.GetPath()); |
---|
4239 | 5141 | } |
---|
4240 | 5142 | } |
---|
4241 | 5143 | // else |
---|
.. | .. |
---|
4245 | 5147 | // System.err.println("info : " + group.GetPath()); |
---|
4246 | 5148 | // } |
---|
4247 | 5149 | |
---|
4248 | | - objEditor.SetText(); // jan 2014 |
---|
4249 | | - |
---|
4250 | | - if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera)) |
---|
| 5150 | + if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera)) |
---|
4251 | 5151 | CameraPane.flash = true; |
---|
4252 | 5152 | |
---|
4253 | | - if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera) |
---|
| 5153 | + if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera) |
---|
4254 | 5154 | // a camera |
---|
4255 | 5155 | { |
---|
4256 | | - CameraPane.camerachangeframe = 0; // don't refuse it |
---|
4257 | | - Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5156 | + if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace |
---|
| 5157 | + { |
---|
| 5158 | + CameraPane.camerachangeframe = 0; // don't refuse it |
---|
| 5159 | + Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent()); |
---|
| 5160 | + } |
---|
4258 | 5161 | // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera; |
---|
4259 | 5162 | // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera; |
---|
4260 | 5163 | } |
---|
4261 | 5164 | |
---|
| 5165 | + if (tps != null && tps.length == 1) |
---|
| 5166 | + { |
---|
| 5167 | + EditSelection(false); |
---|
| 5168 | + } |
---|
| 5169 | + |
---|
| 5170 | + SetPinStates(tps != null && tps.length > 0); |
---|
| 5171 | + |
---|
4262 | 5172 | refreshContents(); |
---|
4263 | 5173 | //return true; |
---|
4264 | 5174 | } |
---|
.. | .. |
---|
4267 | 5177 | |
---|
4268 | 5178 | freezemodel = false; |
---|
4269 | 5179 | } |
---|
| 5180 | + |
---|
| 5181 | + void SetPinStates(boolean enabled) |
---|
| 5182 | + { |
---|
| 5183 | + editButton.setEnabled(enabled); |
---|
| 5184 | + uneditButton.setEnabled(enabled); |
---|
| 5185 | + unselectButton.setEnabled(enabled); |
---|
| 5186 | + flashSelectionButton.setEnabled(enabled); |
---|
| 5187 | + |
---|
| 5188 | + clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5189 | + } |
---|
| 5190 | + |
---|
| 5191 | + void refreshContents(boolean cp) |
---|
| 5192 | + { |
---|
| 5193 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
| 5194 | + if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
| 5195 | + { |
---|
| 5196 | + objEditor.ClearInfo(); // .GetMaterial()); |
---|
| 5197 | + |
---|
| 5198 | + for (int i=0; i < group.selection.Size(); i++) |
---|
| 5199 | + { |
---|
| 5200 | + Object3D child = (Object3D) group.selection.get(i); |
---|
| 5201 | + |
---|
| 5202 | + objEditor.AddInfo(child, this, true); |
---|
| 5203 | + System.err.println("info : " + child.GetPath()); |
---|
| 5204 | + } |
---|
| 5205 | + |
---|
| 5206 | + objEditor.SetText(); // jan 2014 |
---|
| 5207 | + } |
---|
| 5208 | + |
---|
| 5209 | + super.refreshContents(cp); |
---|
| 5210 | + } |
---|
4270 | 5211 | |
---|
4271 | 5212 | void linkSomething(Object3D thing) |
---|
4272 | 5213 | { |
---|
.. | .. |
---|
4338 | 5279 | { |
---|
4339 | 5280 | if (group.selection.isEmpty()) |
---|
4340 | 5281 | return; |
---|
| 5282 | + |
---|
4341 | 5283 | Grafreed.clipboardIsTempGroup = false; |
---|
4342 | 5284 | Composite tGroup = null; |
---|
4343 | 5285 | if (group.selection.size() > 0) // 1) |
---|
.. | .. |
---|
4348 | 5290 | |
---|
4349 | 5291 | if (cut) |
---|
4350 | 5292 | { |
---|
| 5293 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5294 | +// Save(); |
---|
4351 | 5295 | //int indices[] = jList.getSelectedIndices(); |
---|
4352 | 5296 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4353 | 5297 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4437 | 5381 | } |
---|
4438 | 5382 | |
---|
4439 | 5383 | } |
---|
| 5384 | + |
---|
4440 | 5385 | if (Grafreed.clipboardIsTempGroup) |
---|
4441 | 5386 | Grafreed.clipboard = tGroup; |
---|
| 5387 | + |
---|
4442 | 5388 | if (cut) |
---|
4443 | 5389 | { |
---|
4444 | 5390 | ResetModel(); |
---|
.. | .. |
---|
4448 | 5394 | |
---|
4449 | 5395 | void paste(boolean expand) |
---|
4450 | 5396 | { |
---|
| 5397 | + if (Globals.REPLACEONMAKE) |
---|
| 5398 | + Save(); |
---|
| 5399 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5400 | + Globals.REPLACEONMAKE = false; |
---|
4451 | 5401 | // if (GrafreeD.clipboard == null) |
---|
4452 | 5402 | // return; |
---|
4453 | 5403 | boolean first = true; |
---|
.. | .. |
---|
4507 | 5457 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4508 | 5458 | } |
---|
4509 | 5459 | |
---|
| 5460 | + Globals.REPLACEONMAKE = keep; |
---|
4510 | 5461 | ResetModel(); |
---|
4511 | 5462 | refreshContents(); |
---|
4512 | 5463 | } |
---|
.. | .. |
---|
4642 | 5593 | |
---|
4643 | 5594 | void group(Object3D csg, boolean grab) |
---|
4644 | 5595 | { |
---|
| 5596 | + if (Globals.REPLACEONMAKE) |
---|
| 5597 | + Save(); |
---|
| 5598 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5599 | + Globals.REPLACEONMAKE = false; |
---|
4645 | 5600 | if (//false) // why?? |
---|
4646 | 5601 | !group.selection.isEmpty()) |
---|
4647 | 5602 | { |
---|
.. | .. |
---|
4755 | 5710 | //node.add(csg); |
---|
4756 | 5711 | //makeSomething(node); |
---|
4757 | 5712 | makeSomething(csg); |
---|
| 5713 | + Globals.REPLACEONMAKE = keep; |
---|
4758 | 5714 | } |
---|
4759 | 5715 | |
---|
4760 | 5716 | void Ungroup(Object3D g) |
---|
4761 | 5717 | { |
---|
| 5718 | + if (Globals.REPLACEONMAKE) |
---|
| 5719 | + Save(); |
---|
| 5720 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5721 | + Globals.REPLACEONMAKE = false; |
---|
4762 | 5722 | if (g instanceof HiddenObject) |
---|
4763 | 5723 | { |
---|
4764 | 5724 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
4775 | 5735 | objEditor.makeSomething(g.get(i), false); |
---|
4776 | 5736 | } |
---|
4777 | 5737 | } |
---|
| 5738 | + Globals.REPLACEONMAKE = keep; |
---|
4778 | 5739 | } |
---|
4779 | 5740 | |
---|
4780 | 5741 | void ungroup() |
---|
.. | .. |
---|
4970 | 5931 | } |
---|
4971 | 5932 | */ |
---|
4972 | 5933 | |
---|
4973 | | - void ImportGFD() |
---|
4974 | | - { |
---|
4975 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4976 | | - browser.show(); |
---|
4977 | | - String filename = browser.getFile(); |
---|
4978 | | - if (filename != null && filename.length() > 0) |
---|
4979 | | - { |
---|
4980 | | - String fullname = browser.getDirectory() + filename; |
---|
4981 | | - |
---|
4982 | | - //Object3D readobj = |
---|
4983 | | - objEditor.ReadGFD(fullname, objEditor); |
---|
4984 | | - //makeSomething(readobj); |
---|
4985 | | - } |
---|
4986 | | - } |
---|
4987 | | - |
---|
4988 | 5934 | /* |
---|
4989 | 5935 | public void Callback(Object obj) |
---|
4990 | 5936 | { |
---|
.. | .. |
---|
5008 | 5954 | } |
---|
5009 | 5955 | */ |
---|
5010 | 5956 | |
---|
5011 | | - void ImportVRMLX3D() |
---|
5012 | | - { |
---|
5013 | | - if (Grafreed.standAlone) |
---|
5014 | | - { |
---|
5015 | | - /**/ |
---|
5016 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
5017 | | - browser.show(); |
---|
5018 | | - String filename = browser.getFile(); |
---|
5019 | | - if (filename != null && filename.length() > 0) |
---|
5020 | | - { |
---|
5021 | | - String fullname = browser.getDirectory() + filename; |
---|
5022 | | - LoadVRMLX3D(fullname); |
---|
5023 | | - } |
---|
5024 | | - /**/ |
---|
5025 | | - } |
---|
5026 | | - } |
---|
5027 | | - |
---|
5028 | 5957 | String GetFile(String dialogName) |
---|
5029 | 5958 | { |
---|
5030 | 5959 | if (Grafreed.standAlone) |
---|
.. | .. |
---|
5095 | 6024 | cButton clearpanelButton; |
---|
5096 | 6025 | cButton unselectButton; |
---|
5097 | 6026 | |
---|
| 6027 | + cButton restoreCameraButton; |
---|
| 6028 | + |
---|
5098 | 6029 | cButton oneStepButton; |
---|
| 6030 | + |
---|
| 6031 | + cButton groupButton; |
---|
| 6032 | + cButton ungroupButton; |
---|
| 6033 | + cButton compositeButton; |
---|
| 6034 | + cButton switchButton; |
---|
| 6035 | + cButton loopButton; |
---|
| 6036 | + cButton textureButton; |
---|
| 6037 | + |
---|
| 6038 | + cButton skybox1Button; |
---|
| 6039 | + cButton skybox2Button; |
---|
| 6040 | + cButton skybox3Button; |
---|
| 6041 | + cButton skybox4Button; |
---|
| 6042 | + cButton skybox5Button; |
---|
| 6043 | + cButton skybox6Button; |
---|
| 6044 | + cButton skybox7Button; |
---|
| 6045 | + |
---|
| 6046 | + cButton skybox11Button; |
---|
| 6047 | + cButton skybox12Button; |
---|
| 6048 | + cButton skybox13Button; |
---|
| 6049 | + cButton skybox14Button; |
---|
| 6050 | + cButton skybox15Button; |
---|
| 6051 | + cButton skybox16Button; |
---|
| 6052 | + cButton skybox17Button; |
---|
| 6053 | + |
---|
| 6054 | + cButton gridButton; |
---|
| 6055 | + cButton boxButton; |
---|
| 6056 | + cButton sphereButton; |
---|
| 6057 | + cButton coneButton; |
---|
| 6058 | + cButton torusButton; |
---|
| 6059 | + cButton superButton; |
---|
| 6060 | + cButton kleinButton; |
---|
| 6061 | + cButton particlesButton; |
---|
| 6062 | + cButton overlayButton; |
---|
| 6063 | + cButton lightButton; |
---|
5099 | 6064 | |
---|
5100 | 6065 | cButton screenfitButton; |
---|
5101 | 6066 | cButton screenfitpointButton; |
---|
.. | .. |
---|
5108 | 6073 | |
---|
5109 | 6074 | cButton setsupportButton; |
---|
5110 | 6075 | |
---|
5111 | | - cButton twoButton; |
---|
5112 | | - cButton sixButton; |
---|
5113 | | - cButton threeButton; |
---|
5114 | | - cButton sevenButton; |
---|
5115 | | - cButton fourButton; // full panel |
---|
5116 | | - cButton oneButton; // full XYZ |
---|
5117 | | - //cButton currentLayout; |
---|
5118 | | - |
---|
5119 | 6076 | // |
---|
5120 | 6077 | //Composite |
---|
5121 | 6078 | Object3D // to do !! |
---|
.. | .. |
---|
5125 | 6082 | //JTree jTree; |
---|
5126 | 6083 | private MenuItem lookAtItem; |
---|
5127 | 6084 | private MenuItem lookFromItem; |
---|
5128 | | - private MenuItem switchItem; |
---|
| 6085 | + private MenuItem switchViewItem; |
---|
5129 | 6086 | private MenuItem cutItem; |
---|
5130 | | - private MenuItem duplicateItem; |
---|
| 6087 | + private MenuItem undoItem; |
---|
| 6088 | + private MenuItem redoItem; |
---|
| 6089 | + private JMenuItem duplicateItem; |
---|
5131 | 6090 | private MenuItem cloneItem; |
---|
5132 | 6091 | private MenuItem cloneSupportItem; |
---|
5133 | 6092 | private MenuItem overwriteGeoItem; |
---|
.. | .. |
---|
5155 | 6114 | private MenuItem pasteLinkItem; |
---|
5156 | 6115 | private MenuItem pasteCloneItem; |
---|
5157 | 6116 | private MenuItem pasteExpandItem; |
---|
5158 | | - private MenuItem clearItem; |
---|
| 6117 | + private MenuItem deleteItem; |
---|
5159 | 6118 | private MenuItem clearAllItem; |
---|
5160 | 6119 | private MenuItem genUVItem; |
---|
5161 | 6120 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5190 | 6149 | private MenuItem showleavesItem; |
---|
5191 | 6150 | private MenuItem markleavesItem; |
---|
5192 | 6151 | private MenuItem unmarkleavesItem; |
---|
| 6152 | + private MenuItem rewindleavesItem; |
---|
| 6153 | + private MenuItem unrewindleavesItem; |
---|
| 6154 | + private MenuItem randomleavesItem; |
---|
| 6155 | + private MenuItem unrandomleavesItem; |
---|
5193 | 6156 | |
---|
5194 | 6157 | private MenuItem flipVItem; |
---|
5195 | 6158 | private MenuItem unflipVItem; |
---|
.. | .. |
---|
5211 | 6174 | private MenuItem frontItem; |
---|
5212 | 6175 | private MenuItem cameraItem; |
---|
5213 | 6176 | private MenuItem compositeItem; |
---|
5214 | | - private MenuItem randomItem; |
---|
| 6177 | + private MenuItem switchItem; |
---|
5215 | 6178 | private MenuItem physicsItem; |
---|
5216 | 6179 | private MenuItem frameselectorItem; |
---|
5217 | 6180 | private MenuItem scriptNodeItem; |
---|
.. | .. |
---|
5235 | 6198 | private MenuItem attachBumpItem; |
---|
5236 | 6199 | private MenuItem detachBumpItem; |
---|
5237 | 6200 | private MenuItem pigmentBumpItem; |
---|
| 6201 | + private MenuItem embedTexturesItem; |
---|
| 6202 | + private MenuItem deEmbedTexturesItem; |
---|
5238 | 6203 | |
---|
5239 | 6204 | private MenuItem particleItem; |
---|
5240 | 6205 | private MenuItem ragdollItem; |
---|
.. | .. |
---|
5273 | 6238 | private MenuItem doubleItem; |
---|
5274 | 6239 | private MenuItem tripleItem; |
---|
5275 | 6240 | |
---|
5276 | | - private MenuItem importGFDItem; |
---|
5277 | | - private MenuItem importVRMLX3DItem; |
---|
5278 | | - private MenuItem import3DSItem; |
---|
5279 | | - private MenuItem importOBJItem; |
---|
5280 | | - |
---|
5281 | 6241 | private MenuItem computeAOItem; |
---|
5282 | 6242 | private MenuItem recompileItem; |
---|
5283 | 6243 | private MenuItem editScriptItem; |
---|
.. | .. |
---|
5287 | 6247 | private MenuItem analyzeItem; |
---|
5288 | 6248 | private MenuItem dumpItem; |
---|
5289 | 6249 | //boolean freezemodel = false; |
---|
| 6250 | + |
---|
| 6251 | + Menu cameraMenu; |
---|
| 6252 | + MenuItem editCameraItem; |
---|
| 6253 | + MenuItem restoreCameraItem; |
---|
5290 | 6254 | } |
---|