Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
cFileSystemPane.java
....@@ -8,11 +8,13 @@
88
99 import java.io.File;
1010
11
-public class cFileSystemPane extends JPanel implements ActionListener, ItemListener, DragGestureListener,
11
+import grafeme.ui.*;
12
+
13
+public class cFileSystemPane extends cGridBag implements ActionListener, ItemListener, DragGestureListener,
1214 //DragSourceListener,
1315 DropTargetListener
1416 {
15
- cTree jTree = new cTree(null);
17
+ cTree jTree = new cTree();
1618 iCallBack owner;
1719
1820 JButton refreshButton;
....@@ -24,16 +26,16 @@
2426 JCheckBox stripCB;
2527 JCheckBox genUVCB;
2628
27
- JCheckBox mergeAttributesCB;
29
+ cCheckBox mergeAttributesCB;
2830
2931 cFileSystemPane(iCallBack o)
3032 {
3133 owner = o;
3234
33
- setName("File system");
35
+ setName("Files");
3436 //System.out.println("layout : " + getLayout());
3537 //setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
36
- setLayout(new GridBagLayout());
38
+ //setLayout(new GridBagLayout());
3739 //ToolTipManager.sharedInstance().registerComponent(jTree);
3840 jTree.setCellRenderer(new cFileSystemModel.Renderer());
3941
....@@ -58,20 +60,27 @@
5860 GridBagConstraints aConstraints = new GridBagConstraints(0,0,1,1, 1.0,1.0,
5961 GridBagConstraints.EAST,GridBagConstraints.HORIZONTAL,new Insets(1,1,1,1), 0,0);
6062
61
- aConstraints.weighty = 0;
62
- aConstraints.gridwidth = 1;
63
- add(refreshButton = new JButton("Refresh"), aConstraints);
64
- aConstraints.gridx += 1;
65
- add(loadButton = new JButton("Load"), aConstraints);
66
- aConstraints.gridx += 1;
67
- add(printButton = new JButton("Print"), aConstraints);
68
- // aConstraints.gridx += 1;
69
- // add(replaceButton = new JButton("Replace"), aConstraints);
63
+ cGridBag fileCommsnds = new cGridBag();
64
+
65
+ fileCommsnds.add(loadButton = new JButton("Load")); //, aConstraints);
66
+ loadButton.setToolTipText("Load selected file(s)");
67
+ fileCommsnds.add(refreshButton = new JButton("Refresh")); //, aConstraints);
68
+ refreshButton.setToolTipText("Refresh entire tree");
7069
7170 refreshButton.addActionListener(this);
7271 loadButton.addActionListener(this);
73
- printButton.addActionListener(this);
72
+
73
+ if (Globals.ADVANCED)
74
+ {
75
+ fileCommsnds.add(printButton = new JButton("Print")); //, aConstraints);
76
+ printButton.setToolTipText("Print file path in terminal");
77
+ printButton.addActionListener(this);
78
+ fileCommsnds.add(mergeAttributesCB = new cCheckBox("Merge", cJME.mergeAttributes)); //, aConstraints);
79
+ mergeAttributesCB.setToolTipText("Merge common attributes (recommended)");
80
+ mergeAttributesCB.addItemListener(this);
7481 // replaceButton.addActionListener(this);
82
+ // add(replaceButton = new JButton("Replace"), aConstraints);
83
+ }
7584
7685 // aConstraints.gridx += 1;
7786 // add(trimCB = new cCheckBox("Trim", cJME.trim), aConstraints);
....@@ -86,17 +95,18 @@
8695 // add(genUVCB = new cCheckBox("UV", cJME.genUV), aConstraints);
8796 // genUVCB.addItemListener(this);
8897
89
- aConstraints.gridx += 1;
90
- add(mergeAttributesCB = new cCheckBox("Merge", cJME.mergeAttributes), aConstraints);
91
- mergeAttributesCB.addItemListener(this);
98
+ add(fileCommsnds);
99
+ fileCommsnds.preferredHeight = 1;
92100
93
- aConstraints.gridx = 0;
94
- aConstraints.gridy += 1;
95
- aConstraints.weighty = 1;
96
- aConstraints.gridwidth = 10;
97
- aConstraints.fill = GridBagConstraints.BOTH;
98
-
99
- add(tree, aConstraints);
101
+ Return();
102
+
103
+ cGridBag treeBag = new cGridBag();
104
+
105
+ treeBag.add(tree);
106
+
107
+ treeBag.preferredHeight = 30;
108
+
109
+ add(treeBag); //, aConstraints);
100110
101111 GroupEditor oe = (GroupEditor) owner;
102112