.. | .. |
---|
31 | 31 | final String path = "cubemaps/" + f + "-skyboxes/" + s; |
---|
32 | 32 | row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF)); |
---|
33 | 33 | //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF)); |
---|
34 | | - skyboxButton.setToolTipText(s); |
---|
| 34 | + skyboxButton.setToolTipText(s.equals("") ? "No background" : s); |
---|
35 | 35 | skyboxButton.addActionListener(new ActionListener() |
---|
36 | 36 | { |
---|
37 | 37 | @Override |
---|
.. | .. |
---|
73 | 73 | cGridBag row5 = new cGridBag(); |
---|
74 | 74 | cGridBag row6 = new cGridBag(); |
---|
75 | 75 | |
---|
76 | | - AddSkyboxButton("default", "rgb", row0); |
---|
| 76 | + AddSkyboxButton("default", "", row0); |
---|
77 | 77 | //AddSkyboxButton("default", "cornell", row0); |
---|
78 | 78 | AddSkyboxButton("penguins", "dust", row0); |
---|
79 | 79 | AddSkyboxButton("penguins", "tropic", row0); |
---|
.. | .. |
---|
330 | 330 | |
---|
331 | 331 | public void ChangeSkybox(String skybox) |
---|
332 | 332 | { |
---|
333 | | - //cameraView.envyoff = false; |
---|
334 | | - group.skyboxname = skybox; |
---|
335 | | - group.skyboxext = "jpg"; |
---|
336 | | - cameraView.repaint(); |
---|
| 333 | + if (skybox.endsWith("/")) |
---|
| 334 | + { |
---|
| 335 | + group.skyboxname = null; |
---|
| 336 | + group.skyboxext = null; |
---|
| 337 | + cameraView.repaint(); |
---|
| 338 | + } |
---|
| 339 | + else |
---|
| 340 | + { |
---|
| 341 | + //cameraView.envyoff = false; |
---|
| 342 | + group.skyboxname = skybox; |
---|
| 343 | + group.skyboxext = "jpg"; |
---|
| 344 | + cameraView.repaint(); |
---|
| 345 | + } |
---|
337 | 346 | } |
---|
338 | 347 | |
---|
339 | 348 | public void CreateSkyboxPanel(cGridBag skyboxPanel) |
---|
.. | .. |
---|
357 | 366 | } |
---|
358 | 367 | |
---|
359 | 368 | refreshContents(); |
---|
| 369 | + } |
---|
| 370 | + |
---|
| 371 | + public void Show3DView() |
---|
| 372 | + { |
---|
| 373 | + // bug |
---|
| 374 | + //gridPanel.setDividerLocation(1.0); |
---|
| 375 | + //bigPanel.setDividerLocation(0.0); |
---|
| 376 | + bigThree.ClearUI(); |
---|
| 377 | + bigThree.add(centralPanel); |
---|
| 378 | + bigThree.FlushUI(); |
---|
360 | 379 | } |
---|
361 | 380 | |
---|
362 | 381 | //ObjEditor objEditor; |
---|
.. | .. |
---|
400 | 419 | { |
---|
401 | 420 | copy.versionlist = new Object3D[100]; |
---|
402 | 421 | copy.versionindex = -1; |
---|
| 422 | + |
---|
| 423 | + Save(true); |
---|
403 | 424 | } |
---|
404 | 425 | |
---|
405 | 426 | if(ui) |
---|
.. | .. |
---|
631 | 652 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
632 | 653 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
633 | 654 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
634 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
635 | 655 | oe.cameraMenu.add("-"); |
---|
636 | 656 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
637 | 657 | openWindowItem.addActionListener(this); |
---|
638 | | - editLeafItem.addActionListener(this); |
---|
639 | 658 | lookAtItem.addActionListener(this); |
---|
640 | 659 | //lookFromItem.addActinoListener(this); |
---|
641 | 660 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
883 | 902 | shareGeometriesItem.addActionListener(this); |
---|
884 | 903 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
885 | 904 | mergeGeometriesItem.addActionListener(this); |
---|
| 905 | + menu.add("-"); |
---|
| 906 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 907 | + editLeafItem.addActionListener(this); |
---|
886 | 908 | if (Globals.ADVANCED) |
---|
887 | 909 | { |
---|
888 | 910 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
984 | 1006 | //new Exception().printStackTrace(); |
---|
985 | 1007 | |
---|
986 | 1008 | oe.radioPanel = new JPanel(new GridBagLayout()); |
---|
987 | | - oe.aConstraints.weightx = 1; |
---|
988 | | - oe.aConstraints.weighty = 0; |
---|
989 | | - oe.aConstraints.fill = GridBagConstraints.HORIZONTAL; |
---|
990 | | - oe.aConstraints.gridwidth = 100; |
---|
991 | | - oe.aConstraints.gridheight = 1; |
---|
992 | 1009 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
993 | 1010 | |
---|
994 | 1011 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
1021 | 1038 | |
---|
1022 | 1039 | if (Globals.ADVANCED) |
---|
1023 | 1040 | { |
---|
1024 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1025 | | - maxButton.setToolTipText("Maximize window"); |
---|
1026 | | - maxButton.addActionListener(this); |
---|
| 1041 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1042 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1043 | +// maxButton.addActionListener(this); |
---|
1027 | 1044 | } |
---|
| 1045 | + |
---|
| 1046 | + cButton gcButton; |
---|
| 1047 | + |
---|
| 1048 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1049 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1050 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1051 | +// { |
---|
| 1052 | +// public void actionPerformed(ActionEvent e) |
---|
| 1053 | +// { |
---|
| 1054 | +// System.gc(); |
---|
| 1055 | +// } |
---|
| 1056 | +// }); |
---|
| 1057 | + |
---|
| 1058 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1059 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1060 | + collapseButton.addActionListener(this); |
---|
| 1061 | + |
---|
| 1062 | + oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1063 | + maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1064 | + maximize3DButton.addActionListener(this); |
---|
| 1065 | + |
---|
| 1066 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1067 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1068 | + twoButton.addActionListener(this); |
---|
| 1069 | + this.fullscreenLayout = twoButton; |
---|
| 1070 | + |
---|
| 1071 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1073 | + threeButton.addActionListener(this); |
---|
| 1074 | + if (Globals.ADVANCED) |
---|
| 1075 | + { |
---|
| 1076 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1077 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1078 | + sixButton.addActionListener(this); |
---|
| 1079 | + } |
---|
| 1080 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1081 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1082 | +// sevenButton.addActionListener(this); |
---|
| 1083 | + // |
---|
1028 | 1084 | |
---|
1029 | 1085 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1030 | 1086 | fullButton.setToolTipText("Full-screen window"); |
---|
.. | .. |
---|
1069 | 1125 | nextVersionButton.addActionListener(this); |
---|
1070 | 1126 | nextVersionButton.setEnabled(false); |
---|
1071 | 1127 | |
---|
1072 | | - oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
1073 | | - liveCB.setToolTipText("Enable animation"); |
---|
1074 | | - liveCB.addItemListener(this); |
---|
1075 | | - |
---|
1076 | 1128 | oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1077 | 1129 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1078 | 1130 | oneStepButton.addActionListener(this); |
---|
1079 | 1131 | |
---|
| 1132 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 1133 | + liveCB.setToolTipText("Enable animation"); |
---|
| 1134 | + liveCB.addItemListener(this); |
---|
| 1135 | + |
---|
1080 | 1136 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
1081 | 1137 | fastCB.setToolTipText("Fast mode"); |
---|
1082 | 1138 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
1103 | 1159 | |
---|
1104 | 1160 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1105 | 1161 | |
---|
1106 | | - oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1107 | | - twoButton.setToolTipText("Show 3D view only"); |
---|
1108 | | - twoButton.addActionListener(this); |
---|
1109 | | - this.fullscreenLayout = twoButton; |
---|
1110 | | - |
---|
1111 | | - oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1112 | | - threeButton.setToolTipText("Show controls and 3D view"); |
---|
1113 | | - threeButton.addActionListener(this); |
---|
1114 | | - oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1115 | | - sixButton.setToolTipText("Show 3D view and controls"); |
---|
1116 | | - sixButton.addActionListener(this); |
---|
1117 | | -// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1118 | | -// sevenButton.setToolTipText("3-column layout"); |
---|
1119 | | -// sevenButton.addActionListener(this); |
---|
1120 | | - // |
---|
1121 | 1162 | |
---|
1122 | 1163 | oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1123 | 1164 | rootButton.setToolTipText("Open selection in new tab"); |
---|
.. | .. |
---|
1133 | 1174 | |
---|
1134 | 1175 | // INSERT |
---|
1135 | 1176 | row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1136 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1177 | + gridButton.setToolTipText("Create ground"); |
---|
1137 | 1178 | gridButton.addActionListener(this); |
---|
1138 | 1179 | |
---|
1139 | 1180 | row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1425 | 1466 | |
---|
1426 | 1467 | void EditObject(Object3D obj) |
---|
1427 | 1468 | { |
---|
| 1469 | + assert(obj instanceof Composite); |
---|
| 1470 | + |
---|
| 1471 | +// if (obj.versionlist == null) |
---|
| 1472 | +// { |
---|
| 1473 | +// obj.versionlist = new Object3D[100]; |
---|
| 1474 | +// obj.versionindex = -1; |
---|
| 1475 | +// } |
---|
| 1476 | + |
---|
1428 | 1477 | cRadio radioButton = new cRadio(obj.name); |
---|
1429 | 1478 | |
---|
1430 | 1479 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1815 | 1864 | TreePath path; |
---|
1816 | 1865 | |
---|
1817 | 1866 | public TransferableTreePath(TreePath tp) { |
---|
1818 | | - path = tp; |
---|
| 1867 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1868 | + for (int i=0; i<objs.length; i++) |
---|
| 1869 | + { |
---|
| 1870 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1871 | + } |
---|
| 1872 | + path = new TreePath(objs); |
---|
1819 | 1873 | } |
---|
1820 | 1874 | |
---|
1821 | 1875 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
2708 | 2762 | if (source == fullButton) |
---|
2709 | 2763 | { |
---|
2710 | 2764 | ToggleFullScreen(); |
---|
| 2765 | + } else |
---|
| 2766 | + if (source == collapseButton) |
---|
| 2767 | + { |
---|
| 2768 | + this.expandedLayout = radio.layout; |
---|
| 2769 | + CollapseToolbar(); |
---|
| 2770 | + } else |
---|
| 2771 | + if (source == maximize3DButton) |
---|
| 2772 | + { |
---|
| 2773 | + this.expandedLayout = radio.layout; |
---|
| 2774 | + radio.layout = twoButton; |
---|
| 2775 | + Show3DView(); |
---|
| 2776 | + CollapseToolbar(); |
---|
2711 | 2777 | } else |
---|
2712 | 2778 | if (source == previousVersionButton) |
---|
2713 | 2779 | { |
---|
.. | .. |
---|
3660 | 3726 | if (CameraPane.FULLSCREEN) |
---|
3661 | 3727 | fullscreenLayout = radio.layout; |
---|
3662 | 3728 | |
---|
3663 | | - // bug |
---|
3664 | | - //gridPanel.setDividerLocation(1.0); |
---|
3665 | | - //bigPanel.setDividerLocation(0.0); |
---|
3666 | | -// bigThree.remove(scenePanel); |
---|
3667 | | -// bigThree.remove(centralPanel); |
---|
3668 | | -// bigThree.remove(XYZPanel); |
---|
3669 | | -// aWindowConstraints.gridx = 0; |
---|
3670 | | -// aWindowConstraints.gridy = 0; |
---|
3671 | | -// aWindowConstraints.gridwidth = 1; |
---|
3672 | | -// // aConstraints.gridheight = 3; |
---|
3673 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3674 | | -// aWindowConstraints.weightx = 0; |
---|
3675 | | -// aWindowConstraints.weighty = 1; |
---|
3676 | | -// //bigThree.add(jtp, aWindowConstraints); |
---|
3677 | | -// aWindowConstraints.weightx = 1; |
---|
3678 | | -// aWindowConstraints.gridwidth = 3; |
---|
3679 | | -// // aConstraints.gridheight = 3; |
---|
3680 | | -// aWindowConstraints.gridx = 1; |
---|
3681 | | -// aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
3682 | | -// bigThree.add(centralPanel, aWindowConstraints); |
---|
3683 | | -// aWindowConstraints.weightx = 0; |
---|
3684 | | -// aWindowConstraints.gridx = 4; |
---|
3685 | | -// aWindowConstraints.gridwidth = 1; |
---|
3686 | | -// // aConstraints.gridheight = 3; |
---|
3687 | | -// aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
3688 | | -// //bigThree.add(XYZPanel, aWindowConstraints); |
---|
3689 | | -// scenePanel.setVisible(false); |
---|
3690 | | -// centralPanel.setVisible(true); |
---|
3691 | | -// XYZPanel.setVisible(false); |
---|
3692 | | - bigThree.ClearUI(); |
---|
3693 | | - bigThree.add(centralPanel); |
---|
3694 | | - bigThree.FlushUI(); |
---|
| 3729 | + Show3DView(); |
---|
3695 | 3730 | |
---|
3696 | 3731 | cameraView.requestFocusInWindow(); |
---|
3697 | 3732 | |
---|
.. | .. |
---|
3877 | 3912 | } else |
---|
3878 | 3913 | if (source == rootButton) |
---|
3879 | 3914 | { |
---|
| 3915 | + Replace(); |
---|
3880 | 3916 | Object3D obj; |
---|
3881 | 3917 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3882 | 3918 | { |
---|
.. | .. |
---|
4013 | 4049 | |
---|
4014 | 4050 | copy = group; |
---|
4015 | 4051 | |
---|
4016 | | - SetUndoStates(); |
---|
4017 | | - |
---|
4018 | 4052 | //Globals.theRenderer.object = group; |
---|
4019 | 4053 | if(!useclient) |
---|
4020 | 4054 | { |
---|
.. | .. |
---|
4042 | 4076 | */ |
---|
4043 | 4077 | radio.layout.doClick(); |
---|
4044 | 4078 | |
---|
| 4079 | + assert(copy instanceof Composite); |
---|
| 4080 | + |
---|
| 4081 | + if (copy.versionlist == null) |
---|
| 4082 | + { |
---|
| 4083 | + copy.versionlist = new Object3D[100]; |
---|
| 4084 | + copy.versionindex = -1; |
---|
| 4085 | + |
---|
| 4086 | + Save(true); |
---|
| 4087 | + } |
---|
| 4088 | + |
---|
| 4089 | + SetVersionStates(); |
---|
| 4090 | + |
---|
4045 | 4091 | ClearUnpinned(); |
---|
4046 | 4092 | |
---|
4047 | 4093 | //Grafreed.Assert(group != null); |
---|
.. | .. |
---|
5276 | 5322 | flashSelectionButton.setEnabled(enabled); |
---|
5277 | 5323 | |
---|
5278 | 5324 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5325 | + |
---|
| 5326 | + boolean allComposites = true; |
---|
| 5327 | + |
---|
| 5328 | + if (group.selection != null) |
---|
| 5329 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5330 | + { |
---|
| 5331 | + if (!(e.nextElement() instanceof Composite)) |
---|
| 5332 | + { |
---|
| 5333 | + allComposites = false; |
---|
| 5334 | + break; |
---|
| 5335 | + } |
---|
| 5336 | + } |
---|
| 5337 | + |
---|
| 5338 | + rootButton.setEnabled(allComposites); |
---|
5279 | 5339 | } |
---|
5280 | 5340 | |
---|
5281 | 5341 | void refreshContents(boolean cp) |
---|
.. | .. |
---|
5290 | 5350 | Object3D child = (Object3D) group.selection.get(i); |
---|
5291 | 5351 | |
---|
5292 | 5352 | objEditor.AddInfo(child, this, true); |
---|
5293 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5353 | +// System.err.println("info : " + child.GetPath()); |
---|
5294 | 5354 | } |
---|
5295 | 5355 | |
---|
5296 | 5356 | objEditor.SetText(); // jan 2014 |
---|