Normand Briere
2019-06-29 a69bb4474a3264a9a7a7f8b8d8154ea771f167c8
Fix ungroup.
10 files modified
173 ■■■■■ changed files
CameraPane.java 15 ●●●● patch | view | raw | blame | history
Cone.java 1 ●●●● patch | view | raw | blame | history
Globals.java 2 ●●● patch | view | raw | blame | history
GroupEditor.java 59 ●●●●● patch | view | raw | blame | history
GroupLeaf.java 7 ●●●● patch | view | raw | blame | history
ObjEditor.java 79 ●●●●● patch | view | raw | blame | history
RandomEditor.java 2 ●●● patch | view | raw | blame | history
RandomNode.java 2 ●●● patch | view | raw | blame | history
Torus.java 2 ●●●●● patch | view | raw | blame | history
cButton.java 4 ●●●● patch | view | raw | blame | history
CameraPane.java
....@@ -13375,9 +13375,10 @@
1337513375 "DP3 " + dest + ".z," + "normals," + "eye;" +
1337613376 "MAX " + dest + ".w," + dest + ".z," + "eps.x;" +
1337713377 //"MOV " + dest + ".w," + "normal.z;" +
13378
- "MUL " + dest + ".z," + "params2.w," + dest + ".x;" +
13379
- "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13380
- //"MOV " + dest + ".z," + "params2.w;" +
13378
+// "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + // PRETTY HEURISTIC FOR VELVET
13379
+// "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13380
+
13381
+ "MOV " + dest + ".z," + "params2.w;" + // EXACT
1338113382 "POW " + dest + ".w," + dest + ".w," + dest + ".z;" +
1338213383 "RCP " + dest + ".w," + dest + ".w;" +
1338313384 //"RSQ " + dest + ".w," + dest + ".w;" +
....@@ -15119,9 +15120,9 @@
1511915120 case '_':
1512015121 kompactbit = 5;
1512115122 break;
15122
- case '+':
15123
- kompactbit = 6;
15124
- break;
15123
+// case '+':
15124
+// kompactbit = 6;
15125
+// break;
1512515126 case ' ':
1512615127 ObjEditor.theFrame.ToggleFullScreen();
1512715128 repaint();
....@@ -15170,8 +15171,8 @@
1517015171 case DELETE:
1517115172 ClearSelection();
1517215173 break;
15173
- /*
1517415174 case '+':
15175
+ /*
1517515176 //fontsize += 1;
1517615177 bbzoom *= 2;
1517715178 repaint();
Cone.java
....@@ -2,6 +2,7 @@
22
33 class Cone extends Biparam implements java.io.Serializable
44 {
5
+ static final long serialVersionUID = -679715043452968126L;
56
67 Cone()
78 {
Globals.java
....@@ -16,7 +16,7 @@
1616 public static boolean TIMERRUNNING = false;
1717
1818 // Hold on calculation when moving camera
19
- public static boolean FREEZEONMOVE = false; // true;
19
+ public static boolean FREEZEONMOVE = false;
2020
2121 static boolean CROWD = false;
2222 static public int drawMode = iCameraPane.DEFAULT; // WARNING
GroupEditor.java
....@@ -220,7 +220,7 @@
220220 // toggleSwitchItem.addItemListener(this);
221221 // toggleSwitchItem.setState(CameraPane.SWITCH);
222222
223
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
223
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
224224 toggleHandleItem.addItemListener(this);
225225 toggleHandleItem.setState(CameraPane.HANDLES);
226226
....@@ -582,7 +582,7 @@
582582 */
583583 cGridBag copyOptionsPanel = new cGridBag();
584584
585
- copyOptionsPanel.preferredHeight = 2;
585
+ copyOptionsPanel.preferredHeight = 1;
586586
587587 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
588588
....@@ -726,7 +726,7 @@
726726 compositeButton.addActionListener(this);
727727
728728 oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
729
- switchButton.setToolTipText("Create switch");
729
+ switchButton.setToolTipText("Create item switcher");
730730 switchButton.addActionListener(this);
731731
732732 oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -863,9 +863,13 @@
863863
864864 if (true) // Globals.ADVANCED)
865865 {
866
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
867
- supportCB.setToolTipText("Enable rigging");
868
- supportCB.addItemListener(this);
866
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
867
+// supportCB.setToolTipText("Enable rigging");
868
+// supportCB.addItemListener(this);
869
+
870
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
871
+ freezeCB.setToolTipText("Fast moving camera");
872
+ freezeCB.addItemListener(this);
869873
870874 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
871875 // localCB.addItemListener(this);
....@@ -929,7 +933,7 @@
929933 toggleTextureCB.addItemListener(this);
930934
931935 panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
932
- toggleSwitchCB.setToolTipText("Use switch");
936
+ toggleSwitchCB.setToolTipText("Choose a single item");
933937 toggleSwitchCB.addItemListener(this);
934938
935939 panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
....@@ -1000,6 +1004,7 @@
10001004 cCheckBox slowCB;
10011005 cCheckBox boxCB;
10021006 cCheckBox zoomBoxCB;
1007
+ cCheckBox freezeCB;
10031008 //cToggleButton trackCB;
10041009 cCheckBox trackCB;
10051010 cCheckBox smoothfocusCB;
....@@ -1117,6 +1122,10 @@
11171122 else if(e.getSource() == shadowCB)
11181123 {
11191124 Globals.COMPUTESHADOWWHENLIVE ^= true;
1125
+ }
1126
+ else if(e.getSource() == freezeCB)
1127
+ {
1128
+ Globals.FREEZEONMOVE ^= true;
11201129 }
11211130 else if(e.getSource() == autosaveCB)
11221131 {
....@@ -2122,25 +2131,25 @@
21222131 Composite csg = new GroupLeaf();
21232132 csg.count = 5;
21242133 group(csg);
2125
- Composite child = new cGroup();
2134
+ Composite child = new cGroup("Branch");
21262135 csg.addChild(child);
21272136 child.addChild(csg);
21282137 } else
21292138 if (source == doubleItem)
21302139 {
2131
- Composite csg = new GroupLeaf();
2140
+ Composite csg = new GroupLeaf("Fork");
21322141 csg.count = 5;
21332142 group(csg);
2134
- Composite child = new cGroup();
2143
+ Composite child = new cGroup("Branch A");
21352144 csg.addChild(child);
21362145 child.addChild(csg);
2137
- child = new cGroup();
2146
+ child = new cGroup("Branch B");
21382147 csg.addChild(child);
21392148 child.addChild(csg);
21402149 } else
21412150 if (source == tripleItem)
21422151 {
2143
- Composite csg = new GroupLeaf();
2152
+ Composite csg = new GroupLeaf("Trident");
21442153 csg.count = 4;
21452154 group(csg);
21462155 Composite child = new cGroup();
....@@ -2755,15 +2764,28 @@
27552764 } else
27562765 if (source == ungroupItem || source == ungroupButton)
27572766 {
2758
- //ungroup();
2767
+ boolean hasRoot = false;
2768
+
27592769 for (int i=0; i<group.selection.size(); i++)
27602770 {
2761
- Ungroup(group.selection.get(i));
2771
+ if (group.selection.get(i) == group)
2772
+ {
2773
+ hasRoot = true;
2774
+ break;
2775
+ }
27622776 }
27632777
2764
- ClearSelection(false);
2765
-
2766
- refreshContents();
2778
+ if (!hasRoot)
2779
+ {
2780
+ for (int i=0; i<group.selection.size(); i++)
2781
+ {
2782
+ Ungroup(group.selection.get(i));
2783
+ }
2784
+
2785
+ ClearSelection(false);
2786
+
2787
+ refreshContents();
2788
+ }
27672789 } else
27682790 if (source == genUVItem)
27692791 {
....@@ -5526,9 +5548,6 @@
55265548
55275549 cButton restoreCameraButton;
55285550
5529
- cButton minButton;
5530
- cButton maxButton;
5531
- cButton fullButton;
55325551 cButton saveButton;
55335552 cButton oneStepButton;
55345553
GroupLeaf.java
....@@ -14,7 +14,12 @@
1414
1515 GroupLeaf()
1616 {
17
- super("GroupLeaf");
17
+ this("Loop");
18
+ }
19
+
20
+ GroupLeaf(String name)
21
+ {
22
+ super(name);
1823
1924 addChild(new cGroup("Leaf"));
2025 }
ObjEditor.java
....@@ -449,7 +449,7 @@
449449 // TEXTAREA infoarea.setLineWrap(true);
450450 // TEXTAREA infoarea.setWrapStyleWord(true);
451451 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
452
- infoPanel.setPreferredSize(new Dimension(50, 200));
452
+ //infoPanel.setPreferredSize(new Dimension(50, 200));
453453 infoPanel.setName("Info");
454454 //infoPanel.setLayout(new BorderLayout());
455455 //infoPanel.add(createTextPane());
....@@ -721,10 +721,19 @@
721721 void Minimize()
722722 {
723723 frame.setState(Frame.ICONIFIED);
724
+ frame.validate();
724725 }
725726
727
+// artifactURI=null, type=0, property=${file.reference.jfxrt.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@6767876f, broken=false, additional={}
728
+// artifactURI=null, type=0, property=${file.reference.mac-ui.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@16bdc817, broken=false, additional={}
729
+// artifactURI=null, type=0, property=${file.reference.classes.jar}, object=org.netbeans.modules.java.api.common.classpath.ClassPathSupport$RelativePath@9daa9c17, broken=false, additional={}
726730 void Maximize()
727731 {
732
+ if (CameraPane.FULLSCREEN)
733
+ {
734
+ ToggleFullScreen();
735
+ }
736
+
728737 if (maximized)
729738 {
730739 frame.setBounds(keeprect.x, keeprect.y, keeprect.width, keeprect.height);
....@@ -739,7 +748,13 @@
739748 }
740749
741750 maximized ^= true;
751
+
752
+ frame.validate();
742753 }
754
+
755
+ cButton minButton;
756
+ cButton maxButton;
757
+ cButton fullButton;
743758
744759 void ToggleFullScreen()
745760 {
....@@ -748,6 +763,8 @@
748763 if (!CameraPane.FULLSCREEN)
749764 {
750765 device.setFullScreenWindow(null);
766
+ frame.validate();
767
+
751768 //frame.setVisible(false);
752769 // frame.removeNotify();
753770 // frame.setUndecorated(false);
....@@ -773,6 +790,7 @@
773790 // frame.getToolkit().getScreenSize().height);
774791 //frame.setVisible(false);
775792 device.setFullScreenWindow(frame);
793
+ frame.validate();
776794 // frame.removeNotify();
777795 // frame.setUndecorated(true);
778796 // frame.addNotify();
....@@ -785,6 +803,7 @@
785803 radio.layout.doClick();
786804 //frame.setVisible(true);
787805 }
806
+ frame.validate();
788807 }
789808
790809 private JTextPane createTextPane()
....@@ -1117,7 +1136,7 @@
11171136 namePanel = new cGridBag();
11181137
11191138 nameField = AddText(namePanel, copy.GetName());
1120
- namePanel.add(nameField);
1139
+ namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
11211140 oe.ctrlPanel.add(namePanel);
11221141
11231142 oe.ctrlPanel.Return();
....@@ -1142,7 +1161,7 @@
11421161 rewindCB = AddCheckBox(setupPanel2, "Rewind", copy.rewind);
11431162 rewindCB.setToolTipText("Rewind animation");
11441163
1145
- randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1164
+ randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
11461165 randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
11471166
11481167 if (Globals.ADVANCED)
....@@ -1686,24 +1705,6 @@
16861705 texture.add(textureField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
16871706 colorSection.add(texture);
16881707
1689
- cGridBag anisoU = new cGridBag();
1690
- anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1691
- anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1692
- anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1693
- colorSection.add(anisoU);
1694
-
1695
- cGridBag anisoV = new cGridBag();
1696
- anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1697
- anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1698
- anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1699
- colorSection.add(anisoV);
1700
-
1701
- cGridBag shadowbias = new cGridBag();
1702
- shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1703
- shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1704
- shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1705
- colorSection.add(shadowbias);
1706
-
17071708 panel.add(new JSeparator());
17081709
17091710 panel.add(colorSection);
....@@ -1753,6 +1754,12 @@
17531754 fakedepthLabel.setHorizontalAlignment(SwingConstants.TRAILING);
17541755 fakedepth.add(fakedepthField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
17551756 diffuseSection.add(fakedepth);
1757
+
1758
+ cGridBag shadowbias = new cGridBag();
1759
+ shadowbias.add(shadowbiasLabel = new JLabel("Shadowbias")); // , aConstraints);
1760
+ shadowbiasLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1761
+ shadowbias.add(shadowbiasField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1762
+ diffuseSection.add(shadowbias);
17561763
17571764 panel.add(new JSeparator());
17581765
....@@ -1804,6 +1811,18 @@
18041811 // aConstraints.gridy += 1;
18051812 // aConstraints.gridwidth = 1;
18061813
1814
+ cGridBag anisoU = new cGridBag();
1815
+ anisoU.add(anisoLabel = new JLabel("AnisoU")); // , aConstraints);
1816
+ anisoLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1817
+ anisoU.add(anisoField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1818
+ specularSection.add(anisoU);
1819
+
1820
+ cGridBag anisoV = new cGridBag();
1821
+ anisoV.add(anisoVLabel = new JLabel("AnisoV")); // , aConstraints);
1822
+ anisoVLabel.setHorizontalAlignment(SwingConstants.TRAILING);
1823
+ anisoV.add(anisoVField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1824
+ specularSection.add(anisoV);
1825
+
18071826
18081827 panel.add(new JSeparator());
18091828
....@@ -1811,35 +1830,35 @@
18111830
18121831 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18131832
1814
- cGridBag globalSection = new cGridBag().setVertical(true);
1833
+ //cGridBag globalSection = new cGridBag().setVertical(true);
18151834
18161835 cGridBag camera = new cGridBag();
18171836 camera.add(cameraLabel = new JLabel("GlobalLight")); // , aConstraints);
18181837 cameraLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18191838 camera.add(cameraField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1820
- globalSection.add(camera);
1839
+ colorSection.add(camera);
18211840
18221841 cGridBag ambient = new cGridBag();
18231842 ambient.add(ambientLabel = new JLabel("Ambient")); // , aConstraints);
18241843 ambientLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18251844 ambient.add(ambientField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1826
- globalSection.add(ambient);
1845
+ colorSection.add(ambient);
18271846
18281847 cGridBag backlit = new cGridBag();
18291848 backlit.add(backlitLabel = new JLabel("Backlit")); // , aConstraints);
18301849 backlitLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18311850 backlit.add(backlitField = new cNumberSlider(this, 0.001, 50, -1)); // , aConstraints);
1832
- globalSection.add(backlit);
1851
+ colorSection.add(backlit);
18331852
18341853 cGridBag opacity = new cGridBag();
18351854 opacity.add(opacityLabel = new JLabel("Opacity")); // , aConstraints);
18361855 opacityLabel.setHorizontalAlignment(SwingConstants.TRAILING);
18371856 opacity.add(opacityField = new cNumberSlider(this, 0.001, 1, -0.5)); // , aConstraints);
1838
- globalSection.add(opacity);
1857
+ colorSection.add(opacity);
18391858
1840
- panel.add(new JSeparator());
1859
+ //panel.add(new JSeparator());
18411860
1842
- panel.add(globalSection);
1861
+ //panel.add(globalSection);
18431862
18441863 //ctrlPanel.add(new JLabel("----------------------------------")); // , aConstraints);
18451864
....@@ -3538,8 +3557,10 @@
35383557
35393558 copy.ExtractBigData(hashtable);
35403559
3560
+ byte[] compress = Compress(copy);
3561
+
35413562 //EditorFrame.m_MainFrame.requestFocusInWindow();
3542
- tab.graphs[tab.undoindex++] = Compress(copy);
3563
+ tab.graphs[tab.undoindex++] = compress;
35433564
35443565 copy.RestoreBigData(hashtable);
35453566
RandomEditor.java
....@@ -60,7 +60,7 @@
6060 void SetupUI2(ObjEditor oe)
6161 {
6262 super.SetupUI2(oe);
63
- childPanel = AddSlider(oe.ctrlPanel, "Child: ", 0, switchnode.Size()-1, switchnode.rnd);
63
+ childPanel = AddSlider(oe.ctrlPanel, "Item: ", 0, switchnode.Size()-1, switchnode.rnd);
6464
6565 childField = (cNumberSlider)childPanel.getComponent(1);
6666 oe.ctrlPanel.Return();
RandomNode.java
....@@ -5,7 +5,7 @@
55
66 RandomNode()
77 {
8
- this("Random");
8
+ this("Switch");
99 }
1010
1111 RandomNode(String name)
Torus.java
....@@ -2,6 +2,8 @@
22
33 class Torus extends Biparam implements java.io.Serializable
44 {
5
+ static final long serialVersionUID = -7637054329820073252L;
6
+
57 Torus()
68 {
79 inPnt = new cVector();
cButton.java
....@@ -12,7 +12,7 @@
1212 {
1313 super(name);
1414
15
- setMargin(new java.awt.Insets(1, -8, 1, -8));
15
+ setMargin(new java.awt.Insets(1, -1, 1, -1));
1616
1717 if (border)
1818 setBorder(new javax.swing.border.EtchedBorder());
....@@ -26,7 +26,7 @@
2626 {
2727 super(icon);
2828
29
- setMargin(new java.awt.Insets(-1, -8, -1, -8));
29
+ setMargin(new java.awt.Insets(-1, -1, -1, -1));
3030
3131 //result = new JButton( icon );
3232 //result.setBorderPainted( false );