.. | .. |
---|
8 | 8 | |
---|
9 | 9 | import java.io.File; |
---|
10 | 10 | |
---|
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, |
---|
12 | 14 | //DragSourceListener, |
---|
13 | 15 | DropTargetListener |
---|
14 | 16 | { |
---|
15 | | - cTree jTree = new cTree(null); |
---|
| 17 | + cTree jTree = new cTree(); |
---|
16 | 18 | iCallBack owner; |
---|
17 | 19 | |
---|
18 | 20 | JButton refreshButton; |
---|
.. | .. |
---|
24 | 26 | JCheckBox stripCB; |
---|
25 | 27 | JCheckBox genUVCB; |
---|
26 | 28 | |
---|
27 | | - JCheckBox mergeAttributesCB; |
---|
| 29 | + cCheckBox mergeAttributesCB; |
---|
28 | 30 | |
---|
29 | 31 | cFileSystemPane(iCallBack o) |
---|
30 | 32 | { |
---|
31 | 33 | owner = o; |
---|
32 | 34 | |
---|
33 | | - setName("File system"); |
---|
| 35 | + setName("Files"); |
---|
34 | 36 | //System.out.println("layout : " + getLayout()); |
---|
35 | 37 | //setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); |
---|
36 | | - setLayout(new GridBagLayout()); |
---|
| 38 | + //setLayout(new GridBagLayout()); |
---|
37 | 39 | //ToolTipManager.sharedInstance().registerComponent(jTree); |
---|
38 | 40 | jTree.setCellRenderer(new cFileSystemModel.Renderer()); |
---|
39 | 41 | |
---|
.. | .. |
---|
58 | 60 | GridBagConstraints aConstraints = new GridBagConstraints(0,0,1,1, 1.0,1.0, |
---|
59 | 61 | GridBagConstraints.EAST,GridBagConstraints.HORIZONTAL,new Insets(1,1,1,1), 0,0); |
---|
60 | 62 | |
---|
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"); |
---|
70 | 69 | |
---|
71 | 70 | refreshButton.addActionListener(this); |
---|
72 | 71 | 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); |
---|
74 | 81 | // replaceButton.addActionListener(this); |
---|
| 82 | + // add(replaceButton = new JButton("Replace"), aConstraints); |
---|
| 83 | + } |
---|
75 | 84 | |
---|
76 | 85 | // aConstraints.gridx += 1; |
---|
77 | 86 | // add(trimCB = new cCheckBox("Trim", cJME.trim), aConstraints); |
---|
.. | .. |
---|
86 | 95 | // add(genUVCB = new cCheckBox("UV", cJME.genUV), aConstraints); |
---|
87 | 96 | // genUVCB.addItemListener(this); |
---|
88 | 97 | |
---|
89 | | - aConstraints.gridx += 1; |
---|
90 | | - add(mergeAttributesCB = new cCheckBox("Merge", cJME.mergeAttributes), aConstraints); |
---|
91 | | - mergeAttributesCB.addItemListener(this); |
---|
| 98 | + add(fileCommsnds); |
---|
| 99 | + fileCommsnds.preferredHeight = 1; |
---|
92 | 100 | |
---|
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); |
---|
100 | 110 | |
---|
101 | 111 | GroupEditor oe = (GroupEditor) owner; |
---|
102 | 112 | |
---|
.. | .. |
---|
235 | 245 | System.out.println("drop2 = " + dtde + "; drop : " + target); |
---|
236 | 246 | |
---|
237 | 247 | //assert dropTarget == dtde.getSource(); |
---|
238 | | - if (target instanceof CameraPane) |
---|
| 248 | + if (target instanceof iCameraPane) |
---|
239 | 249 | { |
---|
240 | 250 | Object object = null; |
---|
241 | 251 | try |
---|