Normand Briere
2019-08-07 59de607850161a26863f92961d53caae7a2dabc8
Pin button.
4 files modified
2 files added
62 ■■■■ changed files
CameraPane.java 2 ●●● patch | view | raw | blame | history
GroupEditor.java 12 ●●●● patch | view | raw | blame | history
ObjEditor.java 47 ●●●● patch | view | raw | blame | history
Object3D.java 1 ●●●● patch | view | raw | blame | history
icons/pin.png patch | view | raw | blame | history
icons/skybox.jpg patch | view | raw | blame | history
CameraPane.java
....@@ -10841,7 +10841,7 @@
1084110841
1084210842 if (wait)
1084310843 {
10844
- Sleep(500);
10844
+ Sleep(200); // blocks everything
1084510845
1084610846 wait = false;
1084710847 }
GroupEditor.java
....@@ -1111,7 +1111,7 @@
11111111 cGridBag skyboxpane = new cGridBag();
11121112 skyboxpane.preferredHeight = 100;
11131113
1114
- oe.toolboxPanel.add(skyboxpane);
1114
+ oe.skyboxPanel.add(skyboxpane);
11151115
11161116 JTabbedPane skyboxpanel = new JTabbedPane();
11171117 skyboxpane.add(skyboxpanel);
....@@ -1138,9 +1138,9 @@
11381138 clearPanelButton.setToolTipText("Clear edit panel");
11391139 clearPanelButton.addActionListener(this);
11401140
1141
- editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1142
- unselectButton.setToolTipText("Unselect");
1143
- unselectButton.addActionListener(this);
1141
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1142
+ //unselectButton.setToolTipText("Unselect");
1143
+ //unselectButton.addActionListener(this);
11441144
11451145 editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
11461146 flashSelectionButton.setToolTipText("Highlight selection");
....@@ -5182,7 +5182,7 @@
51825182 {
51835183 editButton.setEnabled(enabled);
51845184 uneditButton.setEnabled(enabled);
5185
- unselectButton.setEnabled(enabled);
5185
+ //unselectButton.setEnabled(enabled);
51865186 flashSelectionButton.setEnabled(enabled);
51875187
51885188 clearPanelButton.setEnabled(!listUI.isEmpty());
....@@ -5190,7 +5190,7 @@
51905190
51915191 void refreshContents(boolean cp)
51925192 {
5193
- if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5193
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
51945194 if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
51955195 {
51965196 objEditor.ClearInfo(); // .GetMaterial());
ObjEditor.java
....@@ -34,6 +34,7 @@
3434 iSendInfo
3535 //KeyListener
3636 {
37
+ public cToggleButton pinButton;
3738 boolean timeline;
3839 boolean wasFullScreen;
3940
....@@ -466,6 +467,8 @@
466467
467468 toolboxPanel = new cGridBag().setVertical(true);
468469 //toolboxPanel.setName("Toolbox");
470
+
471
+ skyboxPanel = new cGridBag().setVertical(true);
469472
470473 materialPanel = new cGridBag().setVertical(false);
471474 //materialPanel.setName("Material");
....@@ -1205,6 +1208,18 @@
12051208
12061209 namePanel = new cGridBag();
12071210
1211
+ //if (copy.pinned)
1212
+ {
1213
+ pinButton = GetToggleButton("icons/pin.png", !Grafreed.NIMBUSLAF);
1214
+ pinButton.setSelected(copy.pinned);
1215
+ cGridBag t = new cGridBag();
1216
+ t.preferredWidth = 2;
1217
+ t.add(pinButton);
1218
+ namePanel.add(t);
1219
+
1220
+ pinButton.addItemListener(this);
1221
+ }
1222
+
12081223 nameField = AddText(namePanel, copy.GetName());
12091224 namePanel.add(new JScrollPane(nameField, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
12101225 oe.ctrlPanel.add(namePanel);
....@@ -1558,20 +1573,19 @@
15581573
15591574 objectPanel.add(toolboxPanel);
15601575 objectPanel.setIconAt(1, GetIcon("icons/primitives.png"));
1561
- objectPanel.setToolTipTextAt(1, "Objects & backgrounds");
1576
+ objectPanel.setToolTipTextAt(1, "Objects & textures");
15621577
1578
+ objectPanel.add(skyboxPanel);
1579
+ objectPanel.setIconAt(2, GetIcon("icons/skybox.jpg"));
1580
+ objectPanel.setToolTipTextAt(2, "Backgrounds");
1581
+
15631582 // JPanel north = new JPanel(new BorderLayout());
15641583 // north.setName("Edit");
15651584 // north.add(ctrlPanel, BorderLayout.NORTH);
15661585 // objectPanel.add(north);
15671586 objectPanel.add(editPanel);
1568
- objectPanel.setIconAt(2, GetIcon("icons/write.png"));
1569
- objectPanel.setToolTipTextAt(2, "Edit controls");
1570
-
1571
- //if (Globals.ADVANCED)
1572
- objectPanel.add(infoPanel);
1573
- objectPanel.setIconAt(3, GetIcon("icons/info.png"));
1574
- objectPanel.setToolTipTextAt(3, "Information");
1587
+ objectPanel.setIconAt(3, GetIcon("icons/write.png"));
1588
+ objectPanel.setToolTipTextAt(3, "Edit controls");
15751589
15761590 objectPanel.add(XYZPanel);
15771591 objectPanel.setIconAt(4, GetIcon("icons/XYZ.png"));
....@@ -1613,6 +1627,11 @@
16131627
16141628 scenePanel.add(tabbedPane);
16151629
1630
+ //if (Globals.ADVANCED)
1631
+ tabbedPane.add(infoPanel);
1632
+ tabbedPane.setIconAt(3, GetIcon("icons/info.png"));
1633
+ tabbedPane.setToolTipTextAt(3, "Information");
1634
+
16161635 /*
16171636 cTree jTree = new cTree(null);
16181637 ToolTipManager.sharedInstance().registerComponent(jTree);
....@@ -3574,6 +3593,17 @@
35743593 public void itemStateChanged(ItemEvent event)
35753594 {
35763595 // System.out.println("Propagate = " + propagate);
3596
+ if (event.getSource() == pinButton)
3597
+ {
3598
+ copy.pinned ^= true;
3599
+ if (!copy.pinned && !copy.editWindow.copy.selection.contains(copy))
3600
+ {
3601
+ ((GroupEditor)copy.editWindow).listUI.remove(copy);
3602
+ copy.CloseUI();
3603
+ //copy.editWindow.refreshContents();
3604
+ }
3605
+ }
3606
+ else
35773607 if (event.getSource() == propagateToggle)
35783608 {
35793609 propagate ^= true;
....@@ -5747,6 +5777,7 @@
57475777 ButtonGroup buttonGroup;
57485778
57495779 cGridBag toolboxPanel;
5780
+ cGridBag skyboxPanel;
57505781 cGridBag materialPanel;
57515782 cGridBag ctrlPanel;
57525783
Object3D.java
....@@ -2468,6 +2468,7 @@
24682468 else
24692469 {
24702470 //((ObjEditor)editWindow).SetupUI2(null);
2471
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
24712472 }
24722473 }
24732474
icons/pin.png
Binary files differ
icons/skybox.jpg
Binary files differ