.. | .. |
---|
23 | 23 | DragGestureListener, DragSourceListener, DropTargetListener, |
---|
24 | 24 | ItemListener // ListSelectionListener |
---|
25 | 25 | { |
---|
| 26 | + |
---|
| 27 | + public void AddSkyboxButton(String f, String s, cGridBag row) |
---|
| 28 | + { |
---|
| 29 | + cButton skyboxButton; |
---|
| 30 | + final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
| 31 | + //row.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF)); |
---|
| 32 | + row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
| 33 | + skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.addActionListener(new ActionListener() |
---|
| 35 | + { |
---|
| 36 | + @Override |
---|
| 37 | + public void actionPerformed(ActionEvent e) |
---|
| 38 | + { |
---|
| 39 | + ChangeSkybox(path); |
---|
| 40 | + } |
---|
| 41 | + }); |
---|
| 42 | + } |
---|
| 43 | + |
---|
| 44 | + public void AddSkyboxTab0(JTabbedPane skyboxpanel) |
---|
| 45 | + { |
---|
| 46 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 47 | + |
---|
| 48 | + tab0.setName("Urban"); |
---|
| 49 | + skyboxpanel.add(tab0); |
---|
| 50 | + |
---|
| 51 | + cGridBag row0 = new cGridBag(); |
---|
| 52 | + cGridBag row1 = new cGridBag(); |
---|
| 53 | + cGridBag row2 = new cGridBag(); |
---|
| 54 | + cGridBag row3 = new cGridBag(); |
---|
| 55 | + cGridBag row4 = new cGridBag(); |
---|
| 56 | + cGridBag row5 = new cGridBag(); |
---|
| 57 | + cGridBag row6 = new cGridBag(); |
---|
| 58 | + |
---|
| 59 | + AddSkyboxButton("default", "rgb", row0); |
---|
| 60 | + AddSkyboxButton("default", "cornell", row0); |
---|
| 61 | + AddSkyboxButton("default", "uffizi", row0); |
---|
| 62 | + AddSkyboxButton("default", "CloudyHills", row0); |
---|
| 63 | + |
---|
| 64 | + AddSkyboxButton("default", "skycube", row1); |
---|
| 65 | + AddSkyboxButton("bridge", "Bridge", row1); |
---|
| 66 | + AddSkyboxButton("bridge", "Bridge2", row1); |
---|
| 67 | + AddSkyboxButton("urban", "GamlaStan2", row1); |
---|
| 68 | + |
---|
| 69 | + AddSkyboxButton("urban", "Parliament", row2); |
---|
| 70 | + AddSkyboxButton("urban", "Roundabout", row2); |
---|
| 71 | + AddSkyboxButton("urban", "SaintLazarusChurch", row2); |
---|
| 72 | + AddSkyboxButton("urban", "SaintLazarusChurch2", row2); |
---|
| 73 | + |
---|
| 74 | + AddSkyboxButton("urban", "SaintLazarusChurch3", row3); |
---|
| 75 | + AddSkyboxButton("urban", "UnionSquare", row3); |
---|
| 76 | + AddSkyboxButton("park", "BerzeliiPark", row3); |
---|
| 77 | + AddSkyboxButton("park", "Buddha", row3); |
---|
| 78 | + |
---|
| 79 | + AddSkyboxButton("park", "CNTower2", row4); |
---|
| 80 | + AddSkyboxButton("park", "NiagaraFalls1", row4); |
---|
| 81 | + AddSkyboxButton("park", "NiagaraFalls3", row4); |
---|
| 82 | + AddSkyboxButton("park", "Park", row4); |
---|
| 83 | + |
---|
| 84 | + AddSkyboxButton("park", "Pond", row5); |
---|
| 85 | + AddSkyboxButton("park", "Skansen", row5); |
---|
| 86 | + AddSkyboxButton("park", "Skansen2", row5); |
---|
| 87 | + AddSkyboxButton("park", "Skansen3", row5); |
---|
| 88 | + |
---|
| 89 | + AddSkyboxButton("park", "Skansen4", row6); |
---|
| 90 | + AddSkyboxButton("park", "Skansen5", row6); |
---|
| 91 | + AddSkyboxButton("park", "Stairs", row6); |
---|
| 92 | + AddSkyboxButton("park", "Tantolunden4", row6); |
---|
| 93 | + |
---|
| 94 | + tab0.add(row0); |
---|
| 95 | + tab0.add(row1); |
---|
| 96 | + tab0.add(row2); |
---|
| 97 | + tab0.add(row3); |
---|
| 98 | + tab0.add(row4); |
---|
| 99 | + tab0.add(row5); |
---|
| 100 | + tab0.add(row6); |
---|
| 101 | + |
---|
| 102 | + for (int i=5; --i>=0;) |
---|
| 103 | + { |
---|
| 104 | + //oe.toolboxPanel.Return(); |
---|
| 105 | + //tab0.add(new cGridBag()); |
---|
| 106 | + } |
---|
| 107 | + } |
---|
| 108 | + |
---|
| 109 | + public void AddSkyboxTab1(JTabbedPane skyboxpanel) |
---|
| 110 | + { |
---|
| 111 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 112 | + |
---|
| 113 | + tab0.setName("Nature"); |
---|
| 114 | + skyboxpanel.add(tab0); |
---|
| 115 | + |
---|
| 116 | + cGridBag row0 = new cGridBag(); |
---|
| 117 | + cGridBag row1 = new cGridBag(); |
---|
| 118 | + cGridBag row2 = new cGridBag(); |
---|
| 119 | + cGridBag row3 = new cGridBag(); |
---|
| 120 | + cGridBag row4 = new cGridBag(); |
---|
| 121 | + cGridBag row5 = new cGridBag(); |
---|
| 122 | + cGridBag row6 = new cGridBag(); |
---|
| 123 | + |
---|
| 124 | + AddSkyboxButton("beach", "HeartInTheSand", row0); |
---|
| 125 | + AddSkyboxButton("beach", "LarnacaBeach", row0); |
---|
| 126 | + AddSkyboxButton("beach", "PalmTrees", row0); |
---|
| 127 | + AddSkyboxButton("beach", "Tenerife", row0); |
---|
| 128 | + |
---|
| 129 | + AddSkyboxButton("beach", "Tenerife2", row1); |
---|
| 130 | + AddSkyboxButton("beach", "Tenerife3", row1); |
---|
| 131 | + AddSkyboxButton("field", "FishPond", row1); |
---|
| 132 | + AddSkyboxButton("field", "Footballfield", row1); |
---|
| 133 | + |
---|
| 134 | + AddSkyboxButton("field", "Meadow", row2); |
---|
| 135 | + AddSkyboxButton("field", "Sorsele", row2); |
---|
| 136 | + AddSkyboxButton("field", "Sorsele2", row2); |
---|
| 137 | + AddSkyboxButton("field", "Sorsele3", row2); |
---|
| 138 | + |
---|
| 139 | + AddSkyboxButton("forest", "Brudslojan", row3); |
---|
| 140 | + AddSkyboxButton("forest", "Langholmen2", row3); |
---|
| 141 | + AddSkyboxButton("forest", "Plants", row3); |
---|
| 142 | + AddSkyboxButton("mountain", "Maskonaive", row3); |
---|
| 143 | + AddSkyboxButton("mountain", "Maskonaive2", row4); |
---|
| 144 | + |
---|
| 145 | + AddSkyboxButton("mountain", "Maskonaive3", row4); |
---|
| 146 | + AddSkyboxButton("mountain", "Ryfjallet", row4); |
---|
| 147 | + AddSkyboxButton("mountain", "Teide", row4); |
---|
| 148 | + |
---|
| 149 | + AddSkyboxButton("rocky", "Langholmen", row5); |
---|
| 150 | + AddSkyboxButton("rocky", "Riddarfjarden", row5); |
---|
| 151 | + AddSkyboxButton("rocky", "Skinnarviksberget", row5); |
---|
| 152 | + AddSkyboxButton("rocky", "Tantolunden6", row5); |
---|
| 153 | + /* |
---|
| 154 | +Kastellholmen |
---|
| 155 | +Langholmen |
---|
| 156 | +Riddarfjarden |
---|
| 157 | +Skinnarviksberget |
---|
| 158 | +Tanto |
---|
| 159 | +Tantolunden2 |
---|
| 160 | +Tantolunden6 |
---|
| 161 | + */ |
---|
| 162 | + |
---|
| 163 | + tab0.add(row0); |
---|
| 164 | + tab0.add(row1); |
---|
| 165 | + tab0.add(row2); |
---|
| 166 | + tab0.add(row3); |
---|
| 167 | + tab0.add(row4); |
---|
| 168 | + tab0.add(row5); |
---|
| 169 | + tab0.add(row6); |
---|
| 170 | + |
---|
| 171 | + for (int i=5; --i>=0;) |
---|
| 172 | + { |
---|
| 173 | + //oe.toolboxPanel.Return(); |
---|
| 174 | + //tab0.add(new cGridBag()); |
---|
| 175 | + } |
---|
| 176 | + } |
---|
| 177 | + |
---|
| 178 | + public void AddSkyboxTab2(JTabbedPane skyboxpanel) |
---|
| 179 | + { |
---|
| 180 | + cGridBag tab0 = new cGridBag().setVertical(true); |
---|
| 181 | + |
---|
| 182 | + tab0.setName("Night"); |
---|
| 183 | + skyboxpanel.add(tab0); |
---|
| 184 | + |
---|
| 185 | + cGridBag row0 = new cGridBag(); |
---|
| 186 | + cGridBag row1 = new cGridBag(); |
---|
| 187 | + cGridBag row2 = new cGridBag(); |
---|
| 188 | + cGridBag row3 = new cGridBag(); |
---|
| 189 | + cGridBag row4 = new cGridBag(); |
---|
| 190 | + cGridBag row5 = new cGridBag(); |
---|
| 191 | + cGridBag row6 = new cGridBag(); |
---|
| 192 | + |
---|
| 193 | + AddSkyboxButton("night", "NightPath", row0); |
---|
| 194 | + AddSkyboxButton("night", "PondNight", row0); |
---|
| 195 | + AddSkyboxButton("night", "Powerlines", row0); |
---|
| 196 | + AddSkyboxButton("night", "SwedishRoyalCastle", row0); |
---|
| 197 | + |
---|
| 198 | + AddSkyboxButton("urban", "CNTower", row1); |
---|
| 199 | + AddSkyboxButton("bridge", "ArstaBridge", row1); |
---|
| 200 | + AddSkyboxButton("indoors", "DallasW", row1); |
---|
| 201 | + AddSkyboxButton("indoors", "MarriottMadisonWest", row1); |
---|
| 202 | + |
---|
| 203 | + AddSkyboxButton("indoors", "Vasa", row2); |
---|
| 204 | + AddSkyboxButton("winter", "Backyard", row2); |
---|
| 205 | + AddSkyboxButton("winter", "Creek", row2); |
---|
| 206 | + AddSkyboxButton("winter", "FootballField3", row2); |
---|
| 207 | + |
---|
| 208 | + AddSkyboxButton("winter", "Forest", row3); |
---|
| 209 | + AddSkyboxButton("winter", "HornstullsStrand2", row3); |
---|
| 210 | + AddSkyboxButton("winter", "House", row3); |
---|
| 211 | + AddSkyboxButton("winter", "IceLake", row3); |
---|
| 212 | + |
---|
| 213 | + AddSkyboxButton("winter", "IceRiver", row4); |
---|
| 214 | + AddSkyboxButton("winter", "Park3", row4); |
---|
| 215 | + AddSkyboxButton("winter", "PondWinter", row4); |
---|
| 216 | + |
---|
| 217 | + AddSkyboxButton("winter", "Tantolunden5", row5); |
---|
| 218 | + AddSkyboxButton("winter", "Vindelalven", row5); |
---|
| 219 | + /* |
---|
| 220 | +Backyard |
---|
| 221 | +Creek |
---|
| 222 | +FootballField3 |
---|
| 223 | +Forest |
---|
| 224 | +HornstullsStrand2 |
---|
| 225 | +House |
---|
| 226 | +IceLake |
---|
| 227 | +IceRiver |
---|
| 228 | +Park3 |
---|
| 229 | +PondWinter |
---|
| 230 | +Tantolunden5 |
---|
| 231 | +Vindelalven * |
---|
| 232 | + */ |
---|
| 233 | + |
---|
| 234 | + tab0.add(row0); |
---|
| 235 | + tab0.add(row1); |
---|
| 236 | + tab0.add(row2); |
---|
| 237 | + tab0.add(row3); |
---|
| 238 | + tab0.add(row4); |
---|
| 239 | + tab0.add(row5); |
---|
| 240 | + tab0.add(row6); |
---|
| 241 | + |
---|
| 242 | + for (int i=5; --i>=0;) |
---|
| 243 | + { |
---|
| 244 | + //oe.toolboxPanel.Return(); |
---|
| 245 | + //tab0.add(new cGridBag()); |
---|
| 246 | + } |
---|
| 247 | + } |
---|
| 248 | + |
---|
| 249 | + public void ChangeSkybox(String name) |
---|
| 250 | + { |
---|
| 251 | + cameraView.envyoff = false; |
---|
| 252 | + cameraView.skyboxname = name; |
---|
| 253 | + cameraView.skyboxext = "jpg"; |
---|
| 254 | + cameraView.repaint(); |
---|
| 255 | + } |
---|
| 256 | + |
---|
26 | 257 | //ObjEditor objEditor; |
---|
27 | 258 | public void closeUI2() |
---|
28 | 259 | { |
---|
.. | .. |
---|
60 | 291 | this.copy = this.group = group; |
---|
61 | 292 | //selectees = this.group.selectees; |
---|
62 | 293 | |
---|
| 294 | + if (copy.versions == null) |
---|
| 295 | + { |
---|
| 296 | + copy.versions = new byte[100][]; |
---|
| 297 | + copy.versionindex = -1; |
---|
| 298 | + } |
---|
| 299 | + |
---|
63 | 300 | if(ui) |
---|
64 | 301 | SetupUI(objEditor); |
---|
65 | 302 | } |
---|
.. | .. |
---|
80 | 317 | SetupViews(objEditor); |
---|
81 | 318 | |
---|
82 | 319 | ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true); |
---|
| 320 | + |
---|
| 321 | + if (copy.versions == null) |
---|
| 322 | + { |
---|
| 323 | + copy.versions = new byte[100][]; |
---|
| 324 | + copy.versionindex = -1; |
---|
| 325 | + |
---|
| 326 | + Save(true); |
---|
| 327 | + } |
---|
83 | 328 | } |
---|
84 | 329 | |
---|
85 | 330 | void CloneSelection(boolean supports) |
---|
86 | 331 | { |
---|
| 332 | + if (Globals.REPLACEONMAKE) |
---|
| 333 | + Save(); |
---|
| 334 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 335 | + Globals.REPLACEONMAKE = false; |
---|
87 | 336 | // Object3D keep = GrafreeD.clipboard; |
---|
88 | 337 | //Object3D obj; |
---|
89 | 338 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
94 | 343 | |
---|
95 | 344 | makeSomething(clone, i==group.selection.size()-1); |
---|
96 | 345 | } |
---|
| 346 | + Globals.REPLACEONMAKE = keep; |
---|
97 | 347 | } |
---|
98 | 348 | |
---|
99 | 349 | void CloneClipboard(boolean supports) |
---|
.. | .. |
---|
189 | 439 | // pasteExpandItem = menu.add(new MenuItem("Paste expand")); |
---|
190 | 440 | // pasteExpandItem.addActionListener(this); |
---|
191 | 441 | menu.add("-"); |
---|
192 | | - clearItem = menu.add(new MenuItem("Clear")); |
---|
193 | | - clearItem.addActionListener(this); |
---|
| 442 | + deleteItem = menu.add(new MenuItem("Delete")); |
---|
| 443 | + deleteItem.addActionListener(this); |
---|
194 | 444 | |
---|
195 | 445 | if (Globals.ADVANCED) |
---|
196 | 446 | { |
---|
.. | .. |
---|
380 | 630 | shadowYItem.addActionListener(this); |
---|
381 | 631 | shadowZItem = menu.add(new MenuItem("Shadow Blue")); |
---|
382 | 632 | shadowZItem.addActionListener(this); |
---|
| 633 | + attributeItem = menu.add(new MenuItem("Attribute")); |
---|
| 634 | + attributeItem.addActionListener(this); |
---|
| 635 | + |
---|
383 | 636 | if (Globals.ADVANCED) |
---|
384 | 637 | { |
---|
385 | 638 | menu.add("-"); |
---|
386 | 639 | linkerItem = menu.add(new MenuItem("Linker")); |
---|
387 | 640 | linkerItem.addActionListener(this); |
---|
388 | | - attributeItem = menu.add(new MenuItem("Attribute")); |
---|
389 | | - attributeItem.addActionListener(this); |
---|
390 | 641 | templateItem = menu.add(new MenuItem("Template")); |
---|
391 | 642 | templateItem.addActionListener(this); |
---|
392 | 643 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
.. | .. |
---|
415 | 666 | genNormalsMESHItem.addActionListener(this); |
---|
416 | 667 | if (Globals.ADVANCED) |
---|
417 | 668 | { |
---|
418 | | - genNormalsMINEItem = menu.add(new MenuItem("My Normals")); |
---|
| 669 | + genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals")); |
---|
419 | 670 | genNormalsMINEItem.addActionListener(this); |
---|
420 | 671 | } |
---|
421 | 672 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
.. | .. |
---|
508 | 759 | attachBumpItem.addActionListener(this); |
---|
509 | 760 | pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump")); |
---|
510 | 761 | pigmentBumpItem.addActionListener(this); |
---|
| 762 | + //embedTexturesItem |
---|
511 | 763 | detachPigmentItem = menu.add(new MenuItem("Detach Pigment")); |
---|
512 | 764 | detachPigmentItem.addActionListener(this); |
---|
513 | 765 | detachBumpItem = menu.add(new MenuItem("Detach Bump")); |
---|
514 | 766 | detachBumpItem.addActionListener(this); |
---|
| 767 | + embedTexturesItem = menu.add(new MenuItem("Embed Textures")); |
---|
| 768 | + embedTexturesItem.addActionListener(this); |
---|
| 769 | + deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures")); |
---|
| 770 | + deEmbedTexturesItem.addActionListener(this); |
---|
515 | 771 | menu.add("-"); |
---|
516 | 772 | sortbysizeItem = menu.add(new MenuItem("Sort by size")); |
---|
517 | 773 | sortbysizeItem.addActionListener(this); |
---|
.. | .. |
---|
538 | 794 | buildToolsMenu(menu); |
---|
539 | 795 | } |
---|
540 | 796 | |
---|
| 797 | + |
---|
541 | 798 | void SetupUI2(ObjEditor oe) |
---|
542 | 799 | { |
---|
543 | 800 | // June 2019 |
---|
.. | .. |
---|
582 | 839 | */ |
---|
583 | 840 | cGridBag copyOptionsPanel = new cGridBag(); |
---|
584 | 841 | |
---|
585 | | - copyOptionsPanel.preferredHeight = 1; |
---|
| 842 | + copyOptionsPanel.preferredHeight = 2; |
---|
586 | 843 | |
---|
587 | 844 | //this.AddOptions(oe.toolbarPanel, oe.aConstraints); |
---|
588 | 845 | |
---|
.. | .. |
---|
601 | 858 | fullButton.setToolTipText("Full-screen window"); |
---|
602 | 859 | fullButton.addActionListener(this); |
---|
603 | 860 | |
---|
| 861 | + oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 862 | + screenfitButton.setToolTipText("Screen fit"); |
---|
| 863 | + screenfitButton.addActionListener(this); |
---|
| 864 | + |
---|
604 | 865 | oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
605 | 866 | restoreCameraButton.setToolTipText("Restore viewpoint"); |
---|
606 | 867 | restoreCameraButton.addActionListener(this); |
---|
607 | 868 | |
---|
| 869 | + copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 870 | + saveButton.setToolTipText("New version"); |
---|
| 871 | + saveButton.addActionListener(this); |
---|
| 872 | + |
---|
608 | 873 | copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
609 | | - undoButton.setToolTipText("Undo changes"); |
---|
| 874 | + undoButton.setToolTipText("Previous version"); |
---|
610 | 875 | undoButton.addActionListener(this); |
---|
611 | 876 | undoButton.setEnabled(false); |
---|
612 | 877 | |
---|
| 878 | + cGridBag updown = new cGridBag().setVertical(true); |
---|
| 879 | + updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 880 | + restoreButton.setToolTipText("Restore current"); |
---|
| 881 | + restoreButton.addActionListener(this); |
---|
| 882 | + restoreButton.setEnabled(false); |
---|
| 883 | + |
---|
| 884 | + updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 885 | + replaceButton.setToolTipText("Replace current"); |
---|
| 886 | + replaceButton.addActionListener(this); |
---|
| 887 | + replaceButton.setEnabled(false); |
---|
| 888 | + |
---|
| 889 | + copyOptionsPanel.add(updown); |
---|
| 890 | + |
---|
613 | 891 | copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
614 | | - redoButton.setToolTipText("Redo changes"); |
---|
| 892 | + redoButton.setToolTipText("Next version"); |
---|
615 | 893 | redoButton.addActionListener(this); |
---|
616 | 894 | redoButton.setEnabled(false); |
---|
617 | 895 | |
---|
618 | | - copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
619 | | - saveButton.setToolTipText("Save changes"); |
---|
620 | | - saveButton.addActionListener(this); |
---|
621 | | - |
---|
622 | | - copyOptionsPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 896 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
623 | 897 | liveCB.setToolTipText("Enable animation"); |
---|
624 | 898 | liveCB.addItemListener(this); |
---|
625 | 899 | |
---|
626 | | - copyOptionsPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 900 | + oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
627 | 901 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
628 | 902 | oneStepButton.addActionListener(this); |
---|
629 | 903 | |
---|
630 | | - copyOptionsPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
| 904 | + oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
631 | 905 | fastCB.setToolTipText("Fast mode"); |
---|
632 | 906 | fastCB.addItemListener(this); |
---|
633 | 907 | |
---|
634 | 908 | //oe.toolboxPanel.Return(); |
---|
635 | 909 | |
---|
636 | | - copyOptionsPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
637 | | - screenfitButton.setToolTipText("Screen fit"); |
---|
638 | | - screenfitButton.addActionListener(this); |
---|
639 | | - |
---|
640 | 910 | // copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints); |
---|
641 | 911 | // trackCB.setToolTipText("Enable tracking"); |
---|
642 | 912 | // trackCB.addItemListener(this); |
---|
.. | .. |
---|
649 | 919 | oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
650 | 920 | snapobjectButton.addActionListener(this); |
---|
651 | 921 | snapobjectButton.setToolTipText("Snap Object"); |
---|
| 922 | + |
---|
| 923 | + oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 924 | + fourButton.addActionListener(this); |
---|
| 925 | + fourButton.setToolTipText("Show control panel only"); |
---|
652 | 926 | } |
---|
653 | 927 | |
---|
654 | 928 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
655 | 929 | |
---|
656 | | - oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
657 | | - twoButton.setToolTipText("Show center view only"); |
---|
| 930 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 931 | + twoButton.setToolTipText("Show 3D view only"); |
---|
658 | 932 | twoButton.addActionListener(this); |
---|
659 | 933 | this.fullscreenLayout = twoButton; |
---|
660 | 934 | |
---|
661 | | - oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
662 | | - fourButton.addActionListener(this); |
---|
663 | | - fourButton.setToolTipText("Show left panel only"); |
---|
664 | | - oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
665 | | - sixButton.setToolTipText("2-column layout left"); |
---|
666 | | - sixButton.addActionListener(this); |
---|
667 | | - oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
668 | | - threeButton.setToolTipText("2-column layout right"); |
---|
| 935 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 936 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
669 | 937 | threeButton.addActionListener(this); |
---|
670 | | - oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
671 | | - sevenButton.setToolTipText("3-column layout"); |
---|
672 | | - sevenButton.addActionListener(this); |
---|
| 938 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 939 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 940 | + sixButton.addActionListener(this); |
---|
| 941 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 942 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 943 | +// sevenButton.addActionListener(this); |
---|
673 | 944 | // |
---|
674 | 945 | |
---|
675 | | - oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
676 | | - rootButton.setToolTipText("Edit selection in new tab"); |
---|
| 946 | + oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 947 | + rootButton.setToolTipText("Open selection in new tab"); |
---|
677 | 948 | rootButton.addActionListener(this); |
---|
678 | 949 | |
---|
679 | 950 | oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
682 | 953 | //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints); |
---|
683 | 954 | //clearButton.addActionListener(this); |
---|
684 | 955 | |
---|
| 956 | + cGridBag row1 = new cGridBag(); |
---|
| 957 | + |
---|
685 | 958 | // INSERT |
---|
686 | | - oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 959 | + row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
687 | 960 | gridButton.setToolTipText("Create grid"); |
---|
688 | 961 | gridButton.addActionListener(this); |
---|
689 | 962 | |
---|
690 | | - oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 963 | + row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
691 | 964 | boxButton.setToolTipText("Create box"); |
---|
692 | 965 | boxButton.addActionListener(this); |
---|
693 | 966 | |
---|
694 | | - oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 967 | + row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
695 | 968 | sphereButton.setToolTipText("Create sphere"); |
---|
696 | 969 | sphereButton.addActionListener(this); |
---|
697 | 970 | |
---|
698 | | - oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 971 | + row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
699 | 972 | coneButton.setToolTipText("Create cone"); |
---|
700 | 973 | coneButton.addActionListener(this); |
---|
701 | 974 | |
---|
702 | | - oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 975 | + row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
703 | 976 | torusButton.setToolTipText("Create torus"); |
---|
704 | 977 | torusButton.addActionListener(this); |
---|
705 | 978 | |
---|
706 | | - oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 979 | + row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
707 | 980 | superButton.setToolTipText("Create superellipsoid"); |
---|
708 | 981 | superButton.addActionListener(this); |
---|
709 | 982 | |
---|
.. | .. |
---|
714 | 987 | kleinButton.addActionListener(this); |
---|
715 | 988 | } |
---|
716 | 989 | |
---|
717 | | - oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 990 | + row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
718 | 991 | particlesButton.setToolTipText("Create particle system"); |
---|
719 | 992 | particlesButton.addActionListener(this); |
---|
720 | 993 | |
---|
721 | | - oe.toolboxPanel.Return(); |
---|
| 994 | + oe.toolboxPanel.add(row1); |
---|
722 | 995 | |
---|
723 | | - oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 996 | + cGridBag row2 = new cGridBag(); |
---|
| 997 | + |
---|
| 998 | + row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
724 | 999 | groupButton.setToolTipText("Create group"); |
---|
725 | 1000 | groupButton.addActionListener(this); |
---|
726 | 1001 | |
---|
727 | | - oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1002 | + row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
728 | 1003 | compositeButton.setToolTipText("Create composite"); |
---|
729 | 1004 | compositeButton.addActionListener(this); |
---|
730 | 1005 | |
---|
731 | | - oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1006 | + row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
732 | 1007 | switchButton.setToolTipText("Create item switcher"); |
---|
733 | 1008 | switchButton.addActionListener(this); |
---|
734 | 1009 | |
---|
735 | | - oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1010 | + row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
736 | 1011 | loopButton.setToolTipText("Create loop"); |
---|
737 | 1012 | loopButton.addActionListener(this); |
---|
738 | 1013 | |
---|
739 | | - oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1014 | + row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
740 | 1015 | textureButton.setToolTipText("Create texture"); |
---|
741 | 1016 | textureButton.addActionListener(this); |
---|
742 | 1017 | |
---|
743 | | - oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1018 | + row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
744 | 1019 | overlayButton.setToolTipText("Create overlay"); |
---|
745 | 1020 | overlayButton.addActionListener(this); |
---|
746 | 1021 | |
---|
747 | | - oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1022 | + row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
748 | 1023 | lightButton.setToolTipText("Create light"); |
---|
749 | 1024 | lightButton.addActionListener(this); |
---|
750 | 1025 | |
---|
751 | | - for (int i=6; --i>=0;) |
---|
752 | | - { |
---|
753 | | - oe.toolboxPanel.Return(); |
---|
754 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
755 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
756 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
757 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
758 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
759 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
760 | | - oe.toolboxPanel.add(new cGridBag()); |
---|
761 | | - } |
---|
| 1026 | + oe.toolboxPanel.add(row2); |
---|
| 1027 | + |
---|
| 1028 | + // ENVYMAPS |
---|
| 1029 | + cGridBag skyboxpane = new cGridBag(); |
---|
| 1030 | + skyboxpane.preferredHeight = 100; |
---|
| 1031 | + |
---|
| 1032 | + oe.toolboxPanel.add(skyboxpane); |
---|
| 1033 | + |
---|
| 1034 | + JTabbedPane skyboxpanel = new JTabbedPane(); |
---|
| 1035 | + skyboxpane.add(skyboxpanel); |
---|
| 1036 | + |
---|
| 1037 | + AddSkyboxTab0(skyboxpanel); |
---|
| 1038 | + AddSkyboxTab1(skyboxpanel); |
---|
| 1039 | + AddSkyboxTab2(skyboxpanel); |
---|
762 | 1040 | |
---|
763 | 1041 | // EDIT panel |
---|
764 | 1042 | editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
814 | 1092 | |
---|
815 | 1093 | oe.treePanel.add(copyOptionsPanel); |
---|
816 | 1094 | oe.treePanel.Return(); |
---|
| 1095 | + cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0); |
---|
| 1096 | + versionSlider = (cNumberSlider)sliderPane.getComponent(1); |
---|
| 1097 | + sliderPane.preferredHeight = 1; |
---|
817 | 1098 | |
---|
818 | | -// mainPanel.setDividerLocation(0.5); //1.0); |
---|
819 | | -// mainPanel.setResizeWeight(0.5); |
---|
| 1099 | +// mainPanel.setDividerLocation(0.1); //1.0); |
---|
| 1100 | + mainPanel.setResizeWeight(0.4); |
---|
820 | 1101 | |
---|
821 | 1102 | //jList.addListSelectionListener(this); |
---|
822 | 1103 | oe.jTree.addTreeSelectionListener(this); |
---|
.. | .. |
---|
824 | 1105 | //jTree.setEditable(true); |
---|
825 | 1106 | oe.jTree.setDragEnabled(true); |
---|
826 | 1107 | //jTree.setPreferredSize(new Dimension(10,10)); |
---|
827 | | - jSP.setPreferredSize(new Dimension(100,200)); |
---|
| 1108 | + //jSP.setPreferredSize(new Dimension(100,200)); |
---|
828 | 1109 | |
---|
829 | 1110 | oe.jTree.setCellRenderer(new cTreeModel.Renderer()); |
---|
830 | 1111 | |
---|
.. | .. |
---|
836 | 1117 | dgr.addDragGestureListener(this); |
---|
837 | 1118 | }catch(Exception e) {} |
---|
838 | 1119 | */ |
---|
839 | | - radio.layout = sevenButton; |
---|
| 1120 | + radio.layout = sixButton; // sevenButton; |
---|
840 | 1121 | oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
841 | 1122 | } |
---|
842 | 1123 | |
---|
.. | .. |
---|
939 | 1220 | toggleSwitchCB.setToolTipText("Choose a single item"); |
---|
940 | 1221 | toggleSwitchCB.addItemListener(this); |
---|
941 | 1222 | |
---|
942 | | - panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints); |
---|
943 | | - autosaveCB.setToolTipText("On structure change"); |
---|
944 | | - autosaveCB.addItemListener(this); |
---|
| 1223 | + panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints); |
---|
| 1224 | + autokeepCB.setToolTipText("On structure change"); |
---|
| 1225 | + autokeepCB.addItemListener(this); |
---|
945 | 1226 | |
---|
946 | 1227 | panel.Return(); |
---|
947 | 1228 | if (Globals.ADVANCED) |
---|
.. | .. |
---|
970 | 1251 | { |
---|
971 | 1252 | cRadio radioButton = new cRadio(obj.name); |
---|
972 | 1253 | |
---|
973 | | - // Patch to avoid bug with transparency. |
---|
| 1254 | + // June 2019. Patch to avoid bug with transparency. |
---|
974 | 1255 | radioButton.hadMaterial = obj.material != null; |
---|
975 | 1256 | if (!radioButton.hadMaterial) |
---|
976 | 1257 | { |
---|
.. | .. |
---|
978 | 1259 | } |
---|
979 | 1260 | |
---|
980 | 1261 | radioButton.SetObject(obj); |
---|
981 | | - radioButton.layout = sevenButton; |
---|
| 1262 | + radioButton.layout = sixButton; // sevenButton; |
---|
982 | 1263 | radioButton.SetCamera(cameraView.renderCamera, false); |
---|
983 | 1264 | radioButton.addActionListener(this); |
---|
984 | 1265 | radioPanel.add(radioButton); |
---|
.. | .. |
---|
1018 | 1299 | |
---|
1019 | 1300 | cCheckBox oeilCB; |
---|
1020 | 1301 | cCheckBox shadowCB; |
---|
1021 | | - cCheckBox autosaveCB; |
---|
| 1302 | + cCheckBox autokeepCB; |
---|
1022 | 1303 | cCheckBox lookAtCB; |
---|
1023 | 1304 | |
---|
1024 | 1305 | // static int COLOR = 1; |
---|
.. | .. |
---|
1130 | 1411 | { |
---|
1131 | 1412 | Globals.FREEZEONMOVE ^= true; |
---|
1132 | 1413 | } |
---|
1133 | | - else if(e.getSource() == autosaveCB) |
---|
| 1414 | + else if(e.getSource() == autokeepCB) |
---|
1134 | 1415 | { |
---|
1135 | | - Globals.SAVEONMAKE ^= true; |
---|
| 1416 | + Globals.REPLACEONMAKE ^= true; |
---|
1136 | 1417 | } |
---|
1137 | 1418 | else if(e.getSource() == lookAtCB) |
---|
1138 | 1419 | { |
---|
.. | .. |
---|
1214 | 1495 | } |
---|
1215 | 1496 | } |
---|
1216 | 1497 | |
---|
1217 | | - String string = (String) object; |
---|
1218 | | - |
---|
1219 | 1498 | System.out.println("Transfer = " + object + "; drop : " + target); |
---|
1220 | 1499 | // if( object instanceof java.io.File[]) |
---|
1221 | 1500 | // { |
---|
.. | .. |
---|
1223 | 1502 | // objEditor.DropFile((java.io.File[]) object, true); |
---|
1224 | 1503 | // return; |
---|
1225 | 1504 | // } |
---|
| 1505 | + |
---|
| 1506 | + String string = object.toString(); |
---|
1226 | 1507 | |
---|
1227 | 1508 | // File path for Mac and Windows |
---|
1228 | 1509 | if (string.charAt(0) == '/' || string.charAt(1) == ':') |
---|
.. | .. |
---|
1487 | 1768 | reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)")); |
---|
1488 | 1769 | reduce34MorphItem.addActionListener(this); |
---|
1489 | 1770 | menu.add("-"); |
---|
| 1771 | + menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
| 1772 | + memoryItem.addActionListener(this); |
---|
1490 | 1773 | menu.add(computeAOItem = new MenuItem("Compute AO")); |
---|
1491 | 1774 | computeAOItem.addActionListener(this); |
---|
1492 | 1775 | |
---|
.. | .. |
---|
1495 | 1778 | mirrorItem = menu.add(new MenuItem("Mirror Poses")); |
---|
1496 | 1779 | mirrorItem.addActionListener(this); |
---|
1497 | 1780 | menu.add("-"); |
---|
1498 | | - menu.add(memoryItem = new MenuItem("Memory Usage")); |
---|
1499 | | - memoryItem.addActionListener(this); |
---|
1500 | 1781 | menu.add(analyzeItem = new MenuItem("Analyze")); |
---|
1501 | 1782 | analyzeItem.addActionListener(this); |
---|
1502 | 1783 | menu.add(dumpItem = new MenuItem("Print")); |
---|
.. | .. |
---|
1657 | 1938 | listUI.remove(i); |
---|
1658 | 1939 | } |
---|
1659 | 1940 | } |
---|
| 1941 | + } |
---|
| 1942 | + |
---|
| 1943 | + private void EditElement(Object3D elem, boolean newWindow) |
---|
| 1944 | + { |
---|
| 1945 | + // if (!(elem instanceof Composite)) |
---|
| 1946 | + // newWindow = false; |
---|
| 1947 | + listUI.add(elem); |
---|
| 1948 | + elem.openEditWindow(this, newWindow); //, false); |
---|
| 1949 | + System.out.println("edit : " + elem); |
---|
| 1950 | + elem.editWindow.refreshContents(true); // ? new |
---|
1660 | 1951 | } |
---|
1661 | 1952 | |
---|
1662 | 1953 | /** |
---|
.. | .. |
---|
2086 | 2377 | { |
---|
2087 | 2378 | makeSomething(new Light()); |
---|
2088 | 2379 | } else |
---|
| 2380 | +// if (source == skybox1Button || |
---|
| 2381 | +// source == skybox2Button || |
---|
| 2382 | +// source == skybox3Button || |
---|
| 2383 | +// source == skybox4Button || |
---|
| 2384 | +// source == skybox5Button || |
---|
| 2385 | +// source == skybox6Button || |
---|
| 2386 | +// source == skybox7Button || |
---|
| 2387 | +// source == skybox11Button || |
---|
| 2388 | +// source == skybox12Button || |
---|
| 2389 | +// source == skybox13Button || |
---|
| 2390 | +// source == skybox14Button || |
---|
| 2391 | +// source == skybox15Button || |
---|
| 2392 | +// source == skybox16Button || |
---|
| 2393 | +// source == skybox17Button) |
---|
| 2394 | +// { |
---|
| 2395 | +// ChangeSkybox(source); |
---|
| 2396 | +// } else |
---|
2089 | 2397 | if (source == csgItem) |
---|
2090 | 2398 | { |
---|
2091 | 2399 | group(new CSG()); |
---|
.. | .. |
---|
2171 | 2479 | if (source == computeAOItem) |
---|
2172 | 2480 | { |
---|
2173 | 2481 | Globals.drawMode = CameraPane.OCCLUSION; |
---|
2174 | | - Globals.theRenderer.repaint(); |
---|
| 2482 | + cameraView.repaint(); |
---|
2175 | 2483 | } else |
---|
2176 | 2484 | if (source == recompileItem) |
---|
2177 | 2485 | { |
---|
.. | .. |
---|
2219 | 2527 | } else |
---|
2220 | 2528 | if (source == undoButton) |
---|
2221 | 2529 | { |
---|
| 2530 | + // Go to previous version |
---|
| 2531 | + //if (!Undo()) |
---|
| 2532 | + //java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2222 | 2533 | Undo(); |
---|
| 2534 | + } else |
---|
| 2535 | + if (source == restoreButton) |
---|
| 2536 | + { |
---|
| 2537 | + // Restore current version |
---|
| 2538 | + Restore(); |
---|
| 2539 | + } else |
---|
| 2540 | + if (source == replaceButton) |
---|
| 2541 | + { |
---|
| 2542 | + // Overwrite current version |
---|
| 2543 | + Replace(); |
---|
2223 | 2544 | } else |
---|
2224 | 2545 | if (source == redoButton) |
---|
2225 | 2546 | { |
---|
| 2547 | + // Go to next version |
---|
2226 | 2548 | Redo(); |
---|
2227 | 2549 | } else |
---|
2228 | 2550 | if (source == saveButton) |
---|
2229 | 2551 | { |
---|
2230 | | - Save(); |
---|
| 2552 | + // Save a new version |
---|
| 2553 | + if (!Save(true)) |
---|
| 2554 | + java.awt.Toolkit.getDefaultToolkit().beep(); |
---|
2231 | 2555 | } else |
---|
2232 | 2556 | if (source == oneStepButton) |
---|
2233 | 2557 | { |
---|
.. | .. |
---|
2236 | 2560 | } else |
---|
2237 | 2561 | if (source == screenfitButton) |
---|
2238 | 2562 | { |
---|
2239 | | - //Reload(lastConverter, lastFilename, true); |
---|
2240 | 2563 | ScreenFit(); |
---|
2241 | 2564 | } else |
---|
2242 | 2565 | if (source == screenfitpointButton) |
---|
2243 | 2566 | { |
---|
2244 | | - //Reload(lastConverter, lastFilename, true); |
---|
2245 | 2567 | ScreenFitPoint(); |
---|
2246 | 2568 | } else |
---|
2247 | 2569 | if (source == snapobjectButton) |
---|
2248 | 2570 | { |
---|
2249 | | - //Reload(lastConverter, lastFilename, true); |
---|
2250 | 2571 | SnapObject(); |
---|
2251 | 2572 | } else |
---|
2252 | 2573 | // if (event.getSource() == recompileButton) |
---|
.. | .. |
---|
2610 | 2931 | { |
---|
2611 | 2932 | StepAll(); |
---|
2612 | 2933 | } else |
---|
2613 | | - if (source == clearItem) // || event.getSource() == clearButton) |
---|
| 2934 | + if (source == deleteItem) // || event.getSource() == clearButton) |
---|
2614 | 2935 | { |
---|
2615 | 2936 | //int indices[] = jList.getSelectedIndices(); |
---|
2616 | 2937 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
.. | .. |
---|
3092 | 3413 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3093 | 3414 | { |
---|
3094 | 3415 | obj = (Object3D)e.nextElement(); |
---|
3095 | | - obj.SetBumpTexture(null); |
---|
| 3416 | + obj.ResetBumpTexture(); |
---|
3096 | 3417 | } |
---|
3097 | 3418 | |
---|
3098 | 3419 | refreshContents(); |
---|
.. | .. |
---|
3106 | 3427 | obj.SetBumpTexture(obj.GetPigmentTexture()); |
---|
3107 | 3428 | } |
---|
3108 | 3429 | |
---|
| 3430 | + refreshContents(); |
---|
| 3431 | + } else |
---|
| 3432 | + if (source == embedTexturesItem) |
---|
| 3433 | + { |
---|
| 3434 | + Object3D obj; |
---|
| 3435 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3436 | + { |
---|
| 3437 | + obj = (Object3D)e.nextElement(); |
---|
| 3438 | + obj.EmbedTextures(true); |
---|
| 3439 | + } |
---|
| 3440 | + |
---|
| 3441 | + refreshContents(); |
---|
| 3442 | + } else |
---|
| 3443 | + if (source == deEmbedTexturesItem) |
---|
| 3444 | + { |
---|
| 3445 | + Object3D obj; |
---|
| 3446 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 3447 | + { |
---|
| 3448 | + obj = (Object3D)e.nextElement(); |
---|
| 3449 | + obj.EmbedTextures(false); |
---|
| 3450 | + } |
---|
| 3451 | + |
---|
| 3452 | + CameraPane.texturepigment.clear(); |
---|
| 3453 | + CameraPane.texturebump.clear(); |
---|
| 3454 | + |
---|
3109 | 3455 | refreshContents(); |
---|
3110 | 3456 | } else |
---|
3111 | 3457 | if (source == flashSelectionButton) |
---|
.. | .. |
---|
3209 | 3555 | // centralPanel.setVisible(true); |
---|
3210 | 3556 | // XYZPanel.setVisible(true); |
---|
3211 | 3557 | bigThree.ClearUI(); |
---|
| 3558 | + bigThree.add(scenePanel); |
---|
3212 | 3559 | bigThree.add(centralPanel); |
---|
3213 | | - bigThree.add(XYZPanel); |
---|
3214 | 3560 | bigThree.FlushUI(); |
---|
3215 | 3561 | |
---|
3216 | 3562 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3290 | 3636 | // centralPanel.setVisible(true); |
---|
3291 | 3637 | // XYZPanel.setVisible(false); |
---|
3292 | 3638 | bigThree.ClearUI(); |
---|
3293 | | - bigThree.add(scenePanel); |
---|
3294 | 3639 | bigThree.add(centralPanel); |
---|
| 3640 | + bigThree.add(scenePanel); |
---|
3295 | 3641 | bigThree.FlushUI(); |
---|
3296 | 3642 | |
---|
3297 | 3643 | cameraView.requestFocusInWindow(); |
---|
.. | .. |
---|
3474 | 3820 | } |
---|
3475 | 3821 | |
---|
3476 | 3822 | copy = group; |
---|
| 3823 | + |
---|
| 3824 | + SetUndoStates(); |
---|
| 3825 | + |
---|
3477 | 3826 | //Globals.theRenderer.object = group; |
---|
3478 | 3827 | if(!useclient) |
---|
3479 | 3828 | { |
---|
.. | .. |
---|
3502 | 3851 | radio.layout.doClick(); |
---|
3503 | 3852 | |
---|
3504 | 3853 | ClearUnpinned(); |
---|
3505 | | - SetPinStates(group.selection.size() > 0); |
---|
3506 | | - if (group.selection.size() == 1) |
---|
| 3854 | + //Grafreed.Assert(group != null); |
---|
| 3855 | + //Grafreed.Assert(group.selection != null); |
---|
| 3856 | + SetPinStates(group.selection == null || group.selection.size() > 0); |
---|
| 3857 | + if (group.selection == null || group.selection.size() == 1) |
---|
3507 | 3858 | EditSelection(false); |
---|
3508 | 3859 | keepparent = group.parent; |
---|
3509 | 3860 | // PARENT = NULL or not??? |
---|
.. | .. |
---|
4097 | 4448 | |
---|
4098 | 4449 | try |
---|
4099 | 4450 | { |
---|
4100 | | - texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres); |
---|
| 4451 | + texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres); |
---|
4101 | 4452 | } |
---|
4102 | 4453 | catch (Exception e) |
---|
4103 | 4454 | { |
---|
.. | .. |
---|
4574 | 4925 | |
---|
4575 | 4926 | void EditSelection(boolean newWindow) |
---|
4576 | 4927 | { |
---|
| 4928 | + if (group.selection == null) |
---|
| 4929 | + { |
---|
| 4930 | + EditElement(group, newWindow); // ? new |
---|
| 4931 | + return; |
---|
| 4932 | + } |
---|
| 4933 | + |
---|
4577 | 4934 | // aConstraints.gridy = 0; |
---|
4578 | 4935 | for (int i=0; i<group.selection.size(); i++) |
---|
4579 | 4936 | { |
---|
.. | .. |
---|
4584 | 4941 | Object3D elem = (Object3D)group.selection.elementAt(i); |
---|
4585 | 4942 | if(elem != group || !newWindow) |
---|
4586 | 4943 | { |
---|
4587 | | - // if (!(elem instanceof Composite)) |
---|
4588 | | - // newWindow = false; |
---|
4589 | | - listUI.add(elem); |
---|
4590 | | - elem.openEditWindow(this, newWindow); //, false); |
---|
4591 | | - System.out.println("edit : " + elem); |
---|
4592 | | - elem.editWindow.refreshContents(true); // ? new |
---|
| 4944 | + EditElement(elem, newWindow); // ? new |
---|
4593 | 4945 | } |
---|
4594 | 4946 | } |
---|
4595 | 4947 | } |
---|
.. | .. |
---|
4733 | 5085 | |
---|
4734 | 5086 | void refreshContents(boolean cp) |
---|
4735 | 5087 | { |
---|
4736 | | - if (objectPanel.getSelectedIndex() == objectPanel.indexOfTab("Info")) |
---|
| 5088 | + if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info")) |
---|
4737 | 5089 | if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING) |
---|
4738 | 5090 | { |
---|
4739 | 5091 | objEditor.ClearInfo(); // .GetMaterial()); |
---|
.. | .. |
---|
4833 | 5185 | |
---|
4834 | 5186 | if (cut) |
---|
4835 | 5187 | { |
---|
4836 | | - if (Globals.SAVEONMAKE) |
---|
4837 | | - Save(); |
---|
| 5188 | +// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save. |
---|
| 5189 | +// Save(); |
---|
4838 | 5190 | //int indices[] = jList.getSelectedIndices(); |
---|
4839 | 5191 | //for (int i = indices.length - 1; i >= 0; i--) |
---|
4840 | 5192 | //jList.remove(indices[i]); |
---|
.. | .. |
---|
4937 | 5289 | |
---|
4938 | 5290 | void paste(boolean expand) |
---|
4939 | 5291 | { |
---|
| 5292 | + if (Globals.REPLACEONMAKE) |
---|
| 5293 | + Save(); |
---|
| 5294 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5295 | + Globals.REPLACEONMAKE = false; |
---|
4940 | 5296 | // if (GrafreeD.clipboard == null) |
---|
4941 | 5297 | // return; |
---|
4942 | 5298 | boolean first = true; |
---|
.. | .. |
---|
4996 | 5352 | Grafreed.clipboard.get(0).parent = keepparent; |
---|
4997 | 5353 | } |
---|
4998 | 5354 | |
---|
| 5355 | + Globals.REPLACEONMAKE = keep; |
---|
4999 | 5356 | ResetModel(); |
---|
5000 | 5357 | refreshContents(); |
---|
5001 | 5358 | } |
---|
.. | .. |
---|
5131 | 5488 | |
---|
5132 | 5489 | void group(Object3D csg, boolean grab) |
---|
5133 | 5490 | { |
---|
| 5491 | + if (Globals.REPLACEONMAKE) |
---|
| 5492 | + Save(); |
---|
| 5493 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5494 | + Globals.REPLACEONMAKE = false; |
---|
5134 | 5495 | if (//false) // why?? |
---|
5135 | 5496 | !group.selection.isEmpty()) |
---|
5136 | 5497 | { |
---|
.. | .. |
---|
5244 | 5605 | //node.add(csg); |
---|
5245 | 5606 | //makeSomething(node); |
---|
5246 | 5607 | makeSomething(csg); |
---|
| 5608 | + Globals.REPLACEONMAKE = keep; |
---|
5247 | 5609 | } |
---|
5248 | 5610 | |
---|
5249 | 5611 | void Ungroup(Object3D g) |
---|
5250 | 5612 | { |
---|
| 5613 | + if (Globals.REPLACEONMAKE) |
---|
| 5614 | + Save(); |
---|
| 5615 | + boolean keep = Globals.REPLACEONMAKE; |
---|
| 5616 | + Globals.REPLACEONMAKE = false; |
---|
5251 | 5617 | if (g instanceof HiddenObject) |
---|
5252 | 5618 | { |
---|
5253 | 5619 | HiddenObject h = (HiddenObject) g; |
---|
.. | .. |
---|
5264 | 5630 | objEditor.makeSomething(g.get(i), false); |
---|
5265 | 5631 | } |
---|
5266 | 5632 | } |
---|
| 5633 | + Globals.REPLACEONMAKE = keep; |
---|
5267 | 5634 | } |
---|
5268 | 5635 | |
---|
5269 | 5636 | void ungroup() |
---|
.. | .. |
---|
5564 | 5931 | cButton loopButton; |
---|
5565 | 5932 | cButton textureButton; |
---|
5566 | 5933 | |
---|
| 5934 | + cButton skybox1Button; |
---|
| 5935 | + cButton skybox2Button; |
---|
| 5936 | + cButton skybox3Button; |
---|
| 5937 | + cButton skybox4Button; |
---|
| 5938 | + cButton skybox5Button; |
---|
| 5939 | + cButton skybox6Button; |
---|
| 5940 | + cButton skybox7Button; |
---|
| 5941 | + |
---|
| 5942 | + cButton skybox11Button; |
---|
| 5943 | + cButton skybox12Button; |
---|
| 5944 | + cButton skybox13Button; |
---|
| 5945 | + cButton skybox14Button; |
---|
| 5946 | + cButton skybox15Button; |
---|
| 5947 | + cButton skybox16Button; |
---|
| 5948 | + cButton skybox17Button; |
---|
| 5949 | + |
---|
5567 | 5950 | cButton gridButton; |
---|
5568 | 5951 | cButton boxButton; |
---|
5569 | 5952 | cButton sphereButton; |
---|
.. | .. |
---|
5627 | 6010 | private MenuItem pasteLinkItem; |
---|
5628 | 6011 | private MenuItem pasteCloneItem; |
---|
5629 | 6012 | private MenuItem pasteExpandItem; |
---|
5630 | | - private MenuItem clearItem; |
---|
| 6013 | + private MenuItem deleteItem; |
---|
5631 | 6014 | private MenuItem clearAllItem; |
---|
5632 | 6015 | private MenuItem genUVItem; |
---|
5633 | 6016 | private MenuItem genNormalsMESHItem; |
---|
.. | .. |
---|
5711 | 6094 | private MenuItem attachBumpItem; |
---|
5712 | 6095 | private MenuItem detachBumpItem; |
---|
5713 | 6096 | private MenuItem pigmentBumpItem; |
---|
| 6097 | + private MenuItem embedTexturesItem; |
---|
| 6098 | + private MenuItem deEmbedTexturesItem; |
---|
5714 | 6099 | |
---|
5715 | 6100 | private MenuItem particleItem; |
---|
5716 | 6101 | private MenuItem ragdollItem; |
---|