Normand Briere
2019-08-18 66aca73cce89e4b4d7521862760edf4b0888bc38
ObjEditor.java
....@@ -83,7 +83,7 @@
8383 cButton GetButton(String name, boolean border)
8484 {
8585 ImageIcon icon = GetIcon(name);
86
- if (icon != null)
86
+ if (icon != null || name.contains("/"))
8787 return new cButton(icon, border);
8888 else
8989 return new cButton(name, border);
....@@ -1318,7 +1318,7 @@
13181318
13191319 //if (copy.pinned)
13201320 {
1321
- pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF);
1321
+ pinButton = GetToggleButton("icons/pin.png", !Globals.NIMBUSLAF);
13221322 pinButton.setSelected(copy.pinned);
13231323 cGridBag t = new cGridBag();
13241324 t.preferredWidth = 2;
....@@ -1638,7 +1638,8 @@
16381638
16391639 resetTransformPanel.preferredHeight = 2;
16401640
1641
- cButton resetTransform = GetButton("Reset all", !Grafreed.NIMBUSLAF);
1641
+ cButton resetTransform = GetButton("Reset all", !Globals.NIMBUSLAF);
1642
+ resetTransform.setToolTipText("Reset Translation, Rotation and Scale");
16421643 resetTransform.addMouseListener(new MouseAdapter()
16431644 {
16441645 public void mouseClicked(MouseEvent e)
....@@ -1648,7 +1649,8 @@
16481649 });
16491650 resetTransformPanel.add(resetTransform);
16501651
1651
- resetTransform = GetButton("T only", !Grafreed.NIMBUSLAF);
1652
+ resetTransform = GetButton("T only", !Globals.NIMBUSLAF);
1653
+ resetTransform.setToolTipText("Reset Translation only");
16521654 resetTransform.addMouseListener(new MouseAdapter()
16531655 {
16541656 public void mouseClicked(MouseEvent e)
....@@ -1658,7 +1660,8 @@
16581660 });
16591661 resetTransformPanel.add(resetTransform);
16601662
1661
- resetTransform = GetButton("RS only", !Grafreed.NIMBUSLAF);
1663
+ resetTransform = GetButton("RS only", !Globals.NIMBUSLAF);
1664
+ resetTransform.setToolTipText("Reset Rotation and Scale only");
16621665 resetTransform.addMouseListener(new MouseAdapter()
16631666 {
16641667 public void mouseClicked(MouseEvent e)
....@@ -1773,17 +1776,52 @@
17731776
17741777 AddOptions(optionsPanel); //, aConstraints);
17751778
1776
- tabbedPane.add(optionsPanel);
1777
-
17781779 tabbedPane.add(FSPane = new cFileSystemPane(this));
17791780
1781
+ tabbedPane.add(optionsPanel);
1782
+
17801783 scenePanel.add(tabbedPane);
17811784
1782
- //if (Globals.ADVANCED)
1783
-// tabbedPane.add(infoPanel);
1784
-// tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1785
-// tabbedPane.setToolTipTextAt(3, "Information");
1785
+ cGridBag creditsPanel = new cGridBag().setVertical(true);
1786
+ creditsPanel.setName("Credits");
17861787
1788
+ cLabel ogaLabel = new cLabel(" Most Skyboxes courtesy of OpenGameArt!", !Globals.NIMBUSLAF);
1789
+ creditsPanel.add(ogaLabel);
1790
+
1791
+ cButton opengameartButton;
1792
+ creditsPanel.add(opengameartButton = GetButton("icons/sara-logo.png", !Globals.NIMBUSLAF));
1793
+ opengameartButton.setToolTipText("https://opengameart.org");
1794
+
1795
+ opengameartButton.addMouseListener(new MouseAdapter()
1796
+ {
1797
+ public void mouseClicked(MouseEvent e)
1798
+ {
1799
+ try
1800
+ {
1801
+ Desktop.getDesktop().browse(new java.net.URI("https://opengameart.org/"));
1802
+ } catch (Exception e1)
1803
+// } catch (java.io.IOException | java.net.URISyntaxException e1)
1804
+ {
1805
+ e1.printStackTrace();
1806
+ }
1807
+ }
1808
+ });
1809
+
1810
+ for (int i=10; --i>=0;)
1811
+ {
1812
+ creditsPanel.add(new cGridBag());
1813
+ }
1814
+
1815
+ tabbedPane.add(creditsPanel);
1816
+ tabbedPane.setToolTipTextAt(3, "Credits");
1817
+
1818
+ if (Globals.ADVANCED)
1819
+ {
1820
+ tabbedPane.add(infoPanel);
1821
+ tabbedPane.setIconAt(4, GetIcon("icons/info.png"));
1822
+ tabbedPane.setToolTipTextAt(4, "Information");
1823
+ }
1824
+
17871825 /*
17881826 cTree jTree = new cTree(null);
17891827 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -1929,7 +1967,7 @@
19291967 {
19301968 cGridBag presetpanel = new cGridBag().setVertical(true);
19311969
1932
- cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Grafreed.NIMBUSLAF);
1970
+ cLabel skin = GetLabel("icons/shadericons/shadericon00000.png", !Globals.NIMBUSLAF);
19331971 skin.setToolTipText("Skin");
19341972 skin.addMouseListener(new MouseAdapter()
19351973 {
....@@ -1967,7 +2005,7 @@
19672005 });
19682006 presetpanel.add(skin);
19692007
1970
- cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Grafreed.NIMBUSLAF);
2008
+ cLabel lambert = GetLabel("icons/shadericons/shadericon00002.png", !Globals.NIMBUSLAF);
19712009 lambert.setToolTipText("Diffuse");
19722010 lambert.addMouseListener(new MouseAdapter()
19732011 {
....@@ -1985,7 +2023,7 @@
19852023 });
19862024 presetpanel.add(lambert);
19872025
1988
- cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Grafreed.NIMBUSLAF);
2026
+ cLabel diffuse2 = GetLabel("icons/shadericons/shadericon00003.png", !Globals.NIMBUSLAF);
19892027 diffuse2.setToolTipText("Diffuse2");
19902028 diffuse2.addMouseListener(new MouseAdapter()
19912029 {
....@@ -2003,7 +2041,7 @@
20032041 });
20042042 presetpanel.add(diffuse2);
20052043
2006
- cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Grafreed.NIMBUSLAF);
2044
+ cLabel diffusemoon = GetLabel("icons/shadericons/shadericon00004.png", !Globals.NIMBUSLAF);
20072045 diffusemoon.setToolTipText("Moon");
20082046 diffusemoon.addMouseListener(new MouseAdapter()
20092047 {
....@@ -2021,7 +2059,7 @@
20212059 });
20222060 presetpanel.add(diffusemoon);
20232061
2024
- cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Grafreed.NIMBUSLAF);
2062
+ cLabel diffusemoon2 = GetLabel("icons/shadericons/shadericon00005.png", !Globals.NIMBUSLAF);
20252063 diffusemoon2.setToolTipText("Moon2");
20262064 diffusemoon2.addMouseListener(new MouseAdapter()
20272065 {
....@@ -2039,7 +2077,7 @@
20392077 });
20402078 presetpanel.add(diffusemoon2);
20412079
2042
- cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Grafreed.NIMBUSLAF);
2080
+ cLabel diffusemoon3 = GetLabel("icons/shadericons/shadericon00006.png", !Globals.NIMBUSLAF);
20432081 diffusemoon3.setToolTipText("Moon3");
20442082 diffusemoon3.addMouseListener(new MouseAdapter()
20452083 {
....@@ -2057,7 +2095,7 @@
20572095 });
20582096 presetpanel.add(diffusemoon3);
20592097
2060
- cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Grafreed.NIMBUSLAF);
2098
+ cLabel diffusesheen = GetLabel("icons/shadericons/shadericon00007.png", !Globals.NIMBUSLAF);
20612099 diffusesheen.setToolTipText("Sheen");
20622100 diffusesheen.addMouseListener(new MouseAdapter()
20632101 {
....@@ -2074,7 +2112,7 @@
20742112 });
20752113 presetpanel.add(diffusesheen);
20762114
2077
- cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Grafreed.NIMBUSLAF);
2115
+ cLabel rough = GetLabel("icons/shadericons/shadericon00001.png", !Globals.NIMBUSLAF);
20782116 rough.setToolTipText("Rough metal");
20792117 rough.addMouseListener(new MouseAdapter()
20802118 {
....@@ -2092,7 +2130,7 @@
20922130 });
20932131 presetpanel.add(rough);
20942132
2095
- cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Grafreed.NIMBUSLAF);
2133
+ cLabel rough2 = GetLabel("icons/shadericons/shadericon00013.png", !Globals.NIMBUSLAF);
20962134 rough2.setToolTipText("Medium metal");
20972135 rough2.addMouseListener(new MouseAdapter()
20982136 {
....@@ -2110,7 +2148,7 @@
21102148 });
21112149 presetpanel.add(rough2);
21122150
2113
- cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Grafreed.NIMBUSLAF);
2151
+ cLabel shini0 = GetLabel("icons/shadericons/shadericon00014.png", !Globals.NIMBUSLAF);
21142152 shini0.setToolTipText("Shiny");
21152153 shini0.addMouseListener(new MouseAdapter()
21162154 {
....@@ -2128,7 +2166,7 @@
21282166 });
21292167 presetpanel.add(shini0);
21302168
2131
- cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Grafreed.NIMBUSLAF);
2169
+ cLabel shini1 = GetLabel("icons/shadericons/shadericon00011.png", !Globals.NIMBUSLAF);
21322170 shini1.setToolTipText("Shiny2");
21332171 shini1.addMouseListener(new MouseAdapter()
21342172 {
....@@ -2146,7 +2184,7 @@
21462184 });
21472185 presetpanel.add(shini1);
21482186
2149
- cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Grafreed.NIMBUSLAF);
2187
+ cLabel shini2 = GetLabel("icons/shadericons/shadericon00012.png", !Globals.NIMBUSLAF);
21502188 shini2.setToolTipText("Shiny3");
21512189 shini2.addMouseListener(new MouseAdapter()
21522190 {
....@@ -2164,7 +2202,7 @@
21642202 });
21652203 presetpanel.add(shini2);
21662204
2167
- cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Grafreed.NIMBUSLAF);
2205
+ cLabel aniso = GetLabel("icons/shadericons/shadericon00008.png", !Globals.NIMBUSLAF);
21682206 aniso.setToolTipText("AnisoU");
21692207 aniso.addMouseListener(new MouseAdapter()
21702208 {
....@@ -2182,7 +2220,7 @@
21822220 });
21832221 presetpanel.add(aniso);
21842222
2185
- cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Grafreed.NIMBUSLAF);
2223
+ cLabel aniso2 = GetLabel("icons/shadericons/shadericon00009.png", !Globals.NIMBUSLAF);
21862224 aniso2.setToolTipText("AnisoV");
21872225 aniso2.addMouseListener(new MouseAdapter()
21882226 {
....@@ -2200,7 +2238,7 @@
22002238 });
22012239 presetpanel.add(aniso2);
22022240
2203
- cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Grafreed.NIMBUSLAF);
2241
+ cLabel aniso3 = GetLabel("icons/shadericons/shadericon00010.png", !Globals.NIMBUSLAF);
22042242 aniso3.setToolTipText("AnisoUV");
22052243 aniso3.addMouseListener(new MouseAdapter()
22062244 {
....@@ -2218,7 +2256,7 @@
22182256 });
22192257 presetpanel.add(aniso3);
22202258
2221
- cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Grafreed.NIMBUSLAF);
2259
+ cLabel velvet0 = GetLabel("icons/shadericons/shadericon00015.png", !Globals.NIMBUSLAF);
22222260 velvet0.setToolTipText("Velvet");
22232261 velvet0.addMouseListener(new MouseAdapter()
22242262 {
....@@ -2240,7 +2278,7 @@
22402278 });
22412279 presetpanel.add(velvet0);
22422280
2243
- cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Grafreed.NIMBUSLAF);
2281
+ cLabel bump0 = GetLabel("icons/shadericons/shadericon00016.png", !Globals.NIMBUSLAF);
22442282 bump0.setToolTipText("Bump texture");
22452283 bump0.addMouseListener(new MouseAdapter()
22462284 {
....@@ -2259,7 +2297,7 @@
22592297 });
22602298 presetpanel.add(bump0);
22612299
2262
- cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Grafreed.NIMBUSLAF);
2300
+ cLabel borderShader = GetLabel("icons/shadericons/borderfade.jpg", !Globals.NIMBUSLAF);
22632301 borderShader.setToolTipText("Border fade");
22642302 borderShader.addMouseListener(new MouseAdapter()
22652303 {
....@@ -2274,7 +2312,7 @@
22742312 });
22752313 presetpanel.add(borderShader);
22762314
2277
- cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Grafreed.NIMBUSLAF);
2315
+ cLabel halo = GetLabel("icons/shadericons/shadericon00017.png", !Globals.NIMBUSLAF);
22782316 halo.setToolTipText("Halo");
22792317 halo.addMouseListener(new MouseAdapter()
22802318 {
....@@ -2291,7 +2329,7 @@
22912329 });
22922330 presetpanel.add(halo);
22932331
2294
- cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Grafreed.NIMBUSLAF);
2332
+ cLabel candle = GetLabel("icons/shadericons/shadericon00018.png", !Globals.NIMBUSLAF);
22952333 candle.setToolTipText("Candle");
22962334 candle.addMouseListener(new MouseAdapter()
22972335 {
....@@ -2313,7 +2351,7 @@
23132351 });
23142352 presetpanel.add(candle);
23152353
2316
- cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Grafreed.NIMBUSLAF);
2354
+ cLabel shadowShader = GetLabel("icons/shadericons/shadow.png", !Globals.NIMBUSLAF);
23172355 shadowShader.setToolTipText("Shadow");
23182356 shadowShader.addMouseListener(new MouseAdapter()
23192357 {
....@@ -2348,19 +2386,19 @@
23482386
23492387 cGridBag editBar = new cGridBag().setVertical(false);
23502388
2351
- editBar.add(createMaterialButton = new cButton("Create", !Grafreed.NIMBUSLAF)); // , aConstraints);
2389
+ editBar.add(createMaterialButton = new cButton("Create", !Globals.NIMBUSLAF)); // , aConstraints);
23522390 createMaterialButton.setToolTipText("Create material");
23532391
23542392 /*
23552393 ctrlPanel.add(resetSlidersButton = new cButton("Reset All"), aConstraints);
23562394 */
23572395
2358
- editBar.add(clearMaterialButton = new cButton("Clear", !Grafreed.NIMBUSLAF)); // , aConstraints);
2396
+ editBar.add(clearMaterialButton = new cButton("Clear", !Globals.NIMBUSLAF)); // , aConstraints);
23592397 clearMaterialButton.setToolTipText("Clear material");
23602398
23612399 if (Globals.ADVANCED)
23622400 {
2363
- editBar.add(resetSlidersButton = new cButton("Reset", !Grafreed.NIMBUSLAF)); // , aConstraints);
2401
+ editBar.add(resetSlidersButton = new cButton("Reset", !Globals.NIMBUSLAF)); // , aConstraints);
23642402 editBar.add(propagateToggle = new cCheckBox("Prop", propagate)); // , aConstraints);
23652403 editBar.add(multiplyToggle = new cCheckBox("Mult", false)); // , aConstraints);
23662404 }
....@@ -4161,12 +4199,15 @@
41614199
41624200 void New()
41634201 {
4164
- while (copy.Size() > 1)
4202
+ while (copy.Size() > 0)
41654203 {
4166
- copy.remove(1);
4204
+ copy.remove(0);
41674205 }
41684206
4207
+ copy.selection.clear();
4208
+
41694209 ResetModel();
4210
+ SetupViews();
41704211 objEditor.refreshContents();
41714212 }
41724213