Normand Briere
2019-06-27 f78dd18c66d607b693c0bf5937fc59181bf5a26b
Fix multiple selection
2 files deleted
7 files modified
3 files added
89 ■■■■ changed files
CameraPane.java 5 ●●●●● patch | view | raw | blame | history
Grid.java 2 ●●● patch | view | raw | blame | history
GroupEditor.java 52 ●●●●● patch | view | raw | blame | history
ObjEditor.java 22 ●●●● patch | view | raw | blame | history
Object3D.java 2 ●●●●● patch | view | raw | blame | history
cTree.java 6 ●●●● patch | view | raw | blame | history
icons/Media_player_icons-04-512.png patch | view | raw | blame | history
icons/controls.png patch | view | raw | blame | history
icons/flash-light.png patch | view | raw | blame | history
icons/loop0.png patch | view | raw | blame | history
icons/particles0.png patch | view | raw | blame | history
icons/remove.png patch | view | raw | blame | history
CameraPane.java
....@@ -16783,6 +16783,11 @@
1678316783 //System.out.println("objects[color] = " + objects[color]);
1678416784 //objects[color].Select();
1678516785 indexcount = 0;
16786
+ ObjEditor window = object.GetWindow();
16787
+ if (window != null && deselect)
16788
+ {
16789
+ window.Select(null, deselect, true);
16790
+ }
1678616791 object.Select(color, deselect);
1678716792 }
1678816793
Grid.java
....@@ -64,7 +64,7 @@
6464
6565 Vertex biparamFunction(double u, double v)
6666 {
67
- Vertex temp = new Vertex((2*v-1)*radius*8, 0 /*-radius,*/, (2*u-1)*radius*8);
67
+ Vertex temp = new Vertex((2*v-1)*radius*4, 0 /*-radius,*/, (2*u-1)*radius*4);
6868 temp.norm = LA.newVector(0,1,0);
6969 return temp;
7070 }
GroupEditor.java
....@@ -758,16 +758,16 @@
758758 }
759759
760760 // EDIT panel
761
- editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
- editButton.setToolTipText("Edit selection");
761
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ editButton.setToolTipText("Pin selection controls");
763763 editButton.addActionListener(this);
764764
765
- editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
- uneditButton.setToolTipText("Unedit selection");
765
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ uneditButton.setToolTipText("Remove selection controls");
767767 uneditButton.addActionListener(this);
768768
769769 editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
770
- allParamsButton.setToolTipText("Edit all params");
770
+ allParamsButton.setToolTipText("Show all controle");
771771 allParamsButton.addActionListener(this);
772772
773773 editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -784,6 +784,7 @@
784784
785785 editCommandsPanel.preferredHeight = 1;
786786
787
+ SetPinStates(false);
787788 // oe.treePanel.add(commandsPanel);
788789 // oe.treePanel.Return();
789790
....@@ -857,7 +858,7 @@
857858 boxCB.addItemListener(this);
858859
859860 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
860
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
861
+ zoomBoxCB.setToolTipText("Display only for wheel");
861862 zoomBoxCB.addItemListener(this);
862863
863864 if (true) // Globals.ADVANCED)
....@@ -919,7 +920,7 @@
919920 oeilCB.addItemListener(this);
920921
921922 panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
922
- shadowCB.setToolTipText("Compute shadows when live");
923
+ shadowCB.setToolTipText("When live compute shadows");
923924 shadowCB.addItemListener(this);
924925
925926 panel.Return();
....@@ -932,7 +933,7 @@
932933 toggleSwitchCB.addItemListener(this);
933934
934935 panel.add(autosaveCB = new cCheckBox("Auto-save", Globals.SAVEONMAKE)); //, constraints);
935
- autosaveCB.setToolTipText("Auto-save on structure change");
936
+ autosaveCB.setToolTipText("On structure change");
936937 autosaveCB.addItemListener(this);
937938
938939 panel.Return();
....@@ -1628,6 +1629,20 @@
16281629
16291630 makeSomething(shadow);
16301631 }
1632
+
1633
+ private void ClearUnpinned()
1634
+ {
1635
+ //for (Object3D obj : listUI)
1636
+ for (int i=listUI.size(); --i>=0;)
1637
+ {
1638
+ Object3D obj = listUI.elementAt(i);
1639
+ if (!obj.pinned)
1640
+ {
1641
+ obj.CloseUI();
1642
+ listUI.remove(i);
1643
+ }
1644
+ }
1645
+ }
16311646
16321647 /**
16331648 * applyExample
....@@ -3372,7 +3387,7 @@
33723387 //copy.ClearUI();
33733388 for (Object3D obj : listUI)
33743389 {
3375
- obj.pinned = true;
3390
+ obj.pinned = false;
33763391 obj.CloseUI();
33773392 }
33783393 listUI.clear();
....@@ -3457,6 +3472,11 @@
34573472 currentLayout = sevenButton;
34583473 */
34593474 radio.layout.doClick();
3475
+
3476
+ ClearUnpinned();
3477
+ SetPinStates(group.selection.size() > 0);
3478
+ if (group.selection.size() == 1)
3479
+ EditSelection(false);
34603480 keepparent = group.parent;
34613481 // PARENT = NULL or not???
34623482 //group.parent = null; // ROOT
....@@ -4616,17 +4636,7 @@
46164636 //new Exception().printStackTrace();
46174637
46184638 freezemodel = true;
4619
-
4620
- //for (Object3D obj : listUI)
4621
- for (int i=listUI.size(); --i>=0;)
4622
- {
4623
- Object3D obj = listUI.elementAt(i);
4624
- if (!obj.pinned)
4625
- {
4626
- obj.CloseUI();
4627
- listUI.remove(i);
4628
- }
4629
- }
4639
+ ClearUnpinned();
46304640
46314641 /**/
46324642 //switch (event.id)
....@@ -4689,6 +4699,8 @@
46894699 {
46904700 editButton.setEnabled(enabled);
46914701 uneditButton.setEnabled(enabled);
4702
+ unselectButton.setEnabled(enabled);
4703
+ flashSelectionButton.setEnabled(enabled);
46924704 }
46934705
46944706 void refreshContents(boolean cp)
ObjEditor.java
....@@ -15,6 +15,9 @@
1515 //import javax.swing.plaf.ColorUIResource;
1616 //import javax.swing.plaf.metal.DefaultMetalTheme;
1717
18
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
19
+import javax.swing.plaf.basic.BasicSplitPaneUI;
20
+
1821 //import javax.media.opengl.GLCanvas;
1922
2023 import //weka.core.
....@@ -458,7 +461,13 @@
458461 mainPanel.setDividerSize(9);
459462 mainPanel.setDividerLocation(0.5); //1.0);
460463 mainPanel.setResizeWeight(0.5);
461
-
464
+
465
+//mainPanel.setDividerSize((int) (mainPanel.getDividerSize() * 1.5));
466
+// BasicSplitPaneDivider divider = ( (BasicSplitPaneUI) mainPanel.getUI()).getDivider();
467
+// divider.setDividerSize(15);
468
+// divider.setBorder(BorderFactory.createTitledBorder(divider.getBorder(), "Custom border title -- gets rid of the one-touch arrows!"));
469
+
470
+
462471 //ctrlPanel.setLayout(new GridLayout(4, 1, 5, 5));
463472 //mainPanel.setLayout(new GridBagLayout());
464473 toolbarPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
....@@ -1125,7 +1134,7 @@
11251134 hideCB = AddCheckBox(setupPanel, "Hide", copy.hide);
11261135 hideCB.setToolTipText("Hide object");
11271136 markCB = AddCheckBox(setupPanel, "Mark", copy.marked);
1128
- markCB.setToolTipText("Set the animation target transform");
1137
+ markCB.setToolTipText("As animation target transform");
11291138
11301139 setupPanel2 = new cGridBag().setVertical(false);
11311140
....@@ -1133,7 +1142,7 @@
11331142 rewindCB.setToolTipText("Rewind animation");
11341143
11351144 randomCB = AddCheckBox(setupPanel2, "Rand", copy.random);
1136
- randomCB.setToolTipText("Randomly Rewind or Go back and forth");
1145
+ randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
11371146
11381147 if (Globals.ADVANCED)
11391148 {
....@@ -3017,12 +3026,17 @@
30173026 // }
30183027
30193028 /**/
3020
- if (deselect)
3029
+ if (deselect || child == null)
30213030 {
30223031 //group.deselectAll();
30233032 //freeze = true;
30243033 GetTree().clearSelection();
30253034 //freeze = false;
3035
+
3036
+ if (child == null)
3037
+ {
3038
+ return;
3039
+ }
30263040 }
30273041
30283042 //group.addSelectee(child);
Object3D.java
....@@ -5043,6 +5043,7 @@
50435043
50445044 if (child == null)
50455045 continue;
5046
+
50465047 if (child.HasTransparency() && child.size() != 0)
50475048 {
50485049 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -5929,6 +5930,7 @@
59295930 if (GetBRep() != null)
59305931 {
59315932 display.NextIndex();
5933
+
59325934 // vertex color conflict : gl.glCallList(list);
59335935 DrawNode(display, root, selected);
59345936 if (this instanceof BezierPatch)
cTree.java
....@@ -20,7 +20,11 @@
2020 {
2121 public void mousePressed(MouseEvent e)
2222 {
23
- if (e.isPopupTrigger()) {
23
+ if (e.isPopupTrigger())
24
+ {
25
+ int row = getClosestRowForLocation(e.getX(), e.getY());
26
+ if (!isRowSelected(row))
27
+ setSelectionRow(row);
2428 popup.show((JComponent) e.getSource(), e.getX(), e.getY());
2529 }
2630 }
icons/Media_player_icons-04-512.png
Binary files differ
icons/controls.png
Binary files differ
icons/flash-light.png
Binary files differ
icons/loop0.png
deleted file mode 100644Binary files differ
icons/particles0.png
deleted file mode 100644Binary files differ
icons/remove.png
Binary files differ