.. | .. |
---|
359 | 359 | refreshContents(); |
---|
360 | 360 | } |
---|
361 | 361 | |
---|
| 362 | + public void Show3DView() |
---|
| 363 | + { |
---|
| 364 | + // bug |
---|
| 365 | + //gridPanel.setDividerLocation(1.0); |
---|
| 366 | + //bigPanel.setDividerLocation(0.0); |
---|
| 367 | + bigThree.ClearUI(); |
---|
| 368 | + bigThree.add(centralPanel); |
---|
| 369 | + bigThree.FlushUI(); |
---|
| 370 | + } |
---|
| 371 | + |
---|
362 | 372 | //ObjEditor objEditor; |
---|
363 | 373 | public void closeUI2() |
---|
364 | 374 | { |
---|
.. | .. |
---|
400 | 410 | { |
---|
401 | 411 | copy.versionlist = new Object3D[100]; |
---|
402 | 412 | copy.versionindex = -1; |
---|
| 413 | + |
---|
| 414 | + Save(true); |
---|
403 | 415 | } |
---|
404 | 416 | |
---|
405 | 417 | if(ui) |
---|
.. | .. |
---|
631 | 643 | oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest")); |
---|
632 | 644 | //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection")); |
---|
633 | 645 | //cameraMenu.add(switchViewItem = new MenuItem("Reverse View")); |
---|
634 | | - editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf")); |
---|
635 | 646 | oe.cameraMenu.add("-"); |
---|
636 | 647 | openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy...")); |
---|
637 | 648 | openWindowItem.addActionListener(this); |
---|
638 | | - editLeafItem.addActionListener(this); |
---|
639 | 649 | lookAtItem.addActionListener(this); |
---|
640 | 650 | //lookFromItem.addActinoListener(this); |
---|
641 | 651 | //switchViewItem.addActionListener(this); |
---|
.. | .. |
---|
883 | 893 | shareGeometriesItem.addActionListener(this); |
---|
884 | 894 | mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries")); |
---|
885 | 895 | mergeGeometriesItem.addActionListener(this); |
---|
| 896 | + menu.add("-"); |
---|
| 897 | + editLeafItem = menu.add(new MenuItem("Edit leaf...")); |
---|
| 898 | + editLeafItem.addActionListener(this); |
---|
886 | 899 | if (Globals.ADVANCED) |
---|
887 | 900 | { |
---|
888 | 901 | // Pretty much the same as duplicate and clone. |
---|
.. | .. |
---|
984 | 997 | //new Exception().printStackTrace(); |
---|
985 | 998 | |
---|
986 | 999 | 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 | 1000 | // oe.toolbarPanel.add(radioPanel); //, oe.aConstraints); |
---|
993 | 1001 | |
---|
994 | 1002 | oe.buttonGroup = new ButtonGroup(); |
---|
.. | .. |
---|
1021 | 1029 | |
---|
1022 | 1030 | if (Globals.ADVANCED) |
---|
1023 | 1031 | { |
---|
1024 | | - oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1025 | | - maxButton.setToolTipText("Maximize window"); |
---|
1026 | | - maxButton.addActionListener(this); |
---|
| 1032 | +// oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1033 | +// maxButton.setToolTipText("Maximize window"); |
---|
| 1034 | +// maxButton.addActionListener(this); |
---|
1027 | 1035 | } |
---|
| 1036 | + |
---|
| 1037 | +// cButton gcButton; |
---|
| 1038 | +// |
---|
| 1039 | +// oe.toolbarPanel.add(gcButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1040 | +// gcButton.setToolTipText("Garbage collect"); |
---|
| 1041 | +// gcButton.addActionListener(new ActionListener() |
---|
| 1042 | +// { |
---|
| 1043 | +// public void actionPerformed(ActionEvent e) |
---|
| 1044 | +// { |
---|
| 1045 | +// System.gc(); |
---|
| 1046 | +// } |
---|
| 1047 | +// }); |
---|
| 1048 | + |
---|
| 1049 | + oe.toolbarPanel.add(collapseButton = GetButton("icons/collapse.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1050 | + collapseButton.setToolTipText("Collapse toolbar"); |
---|
| 1051 | + collapseButton.addActionListener(this); |
---|
| 1052 | + |
---|
| 1053 | + oe.toolbarPanel.add(maximize3DButton = GetButton("", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1054 | + maximize3DButton.setToolTipText("Maximize 3D view"); |
---|
| 1055 | + maximize3DButton.addActionListener(this); |
---|
| 1056 | + |
---|
| 1057 | + oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1058 | + twoButton.setToolTipText("Show 3D view only"); |
---|
| 1059 | + twoButton.addActionListener(this); |
---|
| 1060 | + this.fullscreenLayout = twoButton; |
---|
| 1061 | + |
---|
| 1062 | + oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1063 | + threeButton.setToolTipText("Show controls and 3D view"); |
---|
| 1064 | + threeButton.addActionListener(this); |
---|
| 1065 | + if (Globals.ADVANCED) |
---|
| 1066 | + { |
---|
| 1067 | + oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1068 | + sixButton.setToolTipText("Show 3D view and controls"); |
---|
| 1069 | + sixButton.addActionListener(this); |
---|
| 1070 | + } |
---|
| 1071 | +// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
| 1072 | +// sevenButton.setToolTipText("3-column layout"); |
---|
| 1073 | +// sevenButton.addActionListener(this); |
---|
| 1074 | + // |
---|
1028 | 1075 | |
---|
1029 | 1076 | oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1030 | 1077 | fullButton.setToolTipText("Full-screen window"); |
---|
.. | .. |
---|
1069 | 1116 | nextVersionButton.addActionListener(this); |
---|
1070 | 1117 | nextVersionButton.setEnabled(false); |
---|
1071 | 1118 | |
---|
1072 | | - oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
1073 | | - liveCB.setToolTipText("Enable animation"); |
---|
1074 | | - liveCB.addItemListener(this); |
---|
1075 | | - |
---|
1076 | 1119 | oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1077 | 1120 | oneStepButton.setToolTipText("Animate one step forward"); |
---|
1078 | 1121 | oneStepButton.addActionListener(this); |
---|
1079 | 1122 | |
---|
| 1123 | + oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints); |
---|
| 1124 | + liveCB.setToolTipText("Enable animation"); |
---|
| 1125 | + liveCB.addItemListener(this); |
---|
| 1126 | + |
---|
1080 | 1127 | oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints); |
---|
1081 | 1128 | fastCB.setToolTipText("Fast mode"); |
---|
1082 | 1129 | fastCB.addItemListener(this); |
---|
.. | .. |
---|
1103 | 1150 | |
---|
1104 | 1151 | //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL)); |
---|
1105 | 1152 | |
---|
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 | 1153 | |
---|
1122 | 1154 | oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1123 | 1155 | rootButton.setToolTipText("Open selection in new tab"); |
---|
.. | .. |
---|
1133 | 1165 | |
---|
1134 | 1166 | // INSERT |
---|
1135 | 1167 | row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
1136 | | - gridButton.setToolTipText("Create grid"); |
---|
| 1168 | + gridButton.setToolTipText("Create ground"); |
---|
1137 | 1169 | gridButton.addActionListener(this); |
---|
1138 | 1170 | |
---|
1139 | 1171 | row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints); |
---|
.. | .. |
---|
1425 | 1457 | |
---|
1426 | 1458 | void EditObject(Object3D obj) |
---|
1427 | 1459 | { |
---|
| 1460 | + assert(obj instanceof Composite); |
---|
| 1461 | + |
---|
| 1462 | + if (obj.versionlist == null) |
---|
| 1463 | + { |
---|
| 1464 | + obj.versionlist = new Object3D[100]; |
---|
| 1465 | + obj.versionindex = -1; |
---|
| 1466 | + } |
---|
| 1467 | + |
---|
1428 | 1468 | cRadio radioButton = new cRadio(obj.name); |
---|
1429 | 1469 | |
---|
1430 | 1470 | // June 2019. Patch to avoid bug with transparency. |
---|
.. | .. |
---|
1815 | 1855 | TreePath path; |
---|
1816 | 1856 | |
---|
1817 | 1857 | public TransferableTreePath(TreePath tp) { |
---|
1818 | | - path = tp; |
---|
| 1858 | + Object[] objs = new Object[tp.getPathCount()]; |
---|
| 1859 | + for (int i=0; i<objs.length; i++) |
---|
| 1860 | + { |
---|
| 1861 | + objs[i] = ((Object3D)tp.getPathComponent(i)).GetUUID(); |
---|
| 1862 | + } |
---|
| 1863 | + path = new TreePath(objs); |
---|
1819 | 1864 | } |
---|
1820 | 1865 | |
---|
1821 | 1866 | public synchronized DataFlavor[] getTransferDataFlavors() { |
---|
.. | .. |
---|
2708 | 2753 | if (source == fullButton) |
---|
2709 | 2754 | { |
---|
2710 | 2755 | ToggleFullScreen(); |
---|
| 2756 | + } else |
---|
| 2757 | + if (source == collapseButton) |
---|
| 2758 | + { |
---|
| 2759 | + this.expandedLayout = radio.layout; |
---|
| 2760 | + CollapseToolbar(); |
---|
| 2761 | + } else |
---|
| 2762 | + if (source == maximize3DButton) |
---|
| 2763 | + { |
---|
| 2764 | + this.expandedLayout = radio.layout; |
---|
| 2765 | + radio.layout = twoButton; |
---|
| 2766 | + Show3DView(); |
---|
| 2767 | + CollapseToolbar(); |
---|
2711 | 2768 | } else |
---|
2712 | 2769 | if (source == previousVersionButton) |
---|
2713 | 2770 | { |
---|
.. | .. |
---|
3660 | 3717 | if (CameraPane.FULLSCREEN) |
---|
3661 | 3718 | fullscreenLayout = radio.layout; |
---|
3662 | 3719 | |
---|
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(); |
---|
| 3720 | + Show3DView(); |
---|
3695 | 3721 | |
---|
3696 | 3722 | cameraView.requestFocusInWindow(); |
---|
3697 | 3723 | |
---|
.. | .. |
---|
3877 | 3903 | } else |
---|
3878 | 3904 | if (source == rootButton) |
---|
3879 | 3905 | { |
---|
| 3906 | + Replace(); |
---|
3880 | 3907 | Object3D obj; |
---|
3881 | 3908 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
3882 | 3909 | { |
---|
.. | .. |
---|
4013 | 4040 | |
---|
4014 | 4041 | copy = group; |
---|
4015 | 4042 | |
---|
4016 | | - SetUndoStates(); |
---|
4017 | | - |
---|
4018 | 4043 | //Globals.theRenderer.object = group; |
---|
4019 | 4044 | if(!useclient) |
---|
4020 | 4045 | { |
---|
.. | .. |
---|
4042 | 4067 | */ |
---|
4043 | 4068 | radio.layout.doClick(); |
---|
4044 | 4069 | |
---|
| 4070 | + SetUndoStates(); |
---|
| 4071 | + |
---|
4045 | 4072 | ClearUnpinned(); |
---|
4046 | 4073 | |
---|
4047 | 4074 | //Grafreed.Assert(group != null); |
---|
.. | .. |
---|
5276 | 5303 | flashSelectionButton.setEnabled(enabled); |
---|
5277 | 5304 | |
---|
5278 | 5305 | clearPanelButton.setEnabled(!listUI.isEmpty()); |
---|
| 5306 | + |
---|
| 5307 | + boolean allComposites = true; |
---|
| 5308 | + |
---|
| 5309 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 5310 | + { |
---|
| 5311 | + if (!(e.nextElement() instanceof Composite)) |
---|
| 5312 | + { |
---|
| 5313 | + allComposites = false; |
---|
| 5314 | + break; |
---|
| 5315 | + } |
---|
| 5316 | + } |
---|
| 5317 | + |
---|
| 5318 | + rootButton.setEnabled(allComposites); |
---|
5279 | 5319 | } |
---|
5280 | 5320 | |
---|
5281 | 5321 | void refreshContents(boolean cp) |
---|
.. | .. |
---|
5290 | 5330 | Object3D child = (Object3D) group.selection.get(i); |
---|
5291 | 5331 | |
---|
5292 | 5332 | objEditor.AddInfo(child, this, true); |
---|
5293 | | - System.err.println("info : " + child.GetPath()); |
---|
| 5333 | +// System.err.println("info : " + child.GetPath()); |
---|
5294 | 5334 | } |
---|
5295 | 5335 | |
---|
5296 | 5336 | objEditor.SetText(); // jan 2014 |
---|