From f1382bc839a74ef1d1534c61ea94e53cf54716df Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Sun, 23 Jun 2019 15:00:47 -0400
Subject: [PATCH] Edit panel

---
 cFileSystemPane.java |   56 +++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 33 insertions(+), 23 deletions(-)

diff --git a/cFileSystemPane.java b/cFileSystemPane.java
index 8bd7ccd..da2f91f 100644
--- a/cFileSystemPane.java
+++ b/cFileSystemPane.java
@@ -8,7 +8,9 @@
 
 import java.io.File;
 
-public class cFileSystemPane extends JPanel implements ActionListener, ItemListener, DragGestureListener,
+import grafeme.ui.*;
+
+public class cFileSystemPane extends cGridBag implements ActionListener, ItemListener, DragGestureListener,
         //DragSourceListener,
         DropTargetListener
 {
@@ -33,7 +35,7 @@
         setName("File system");
         //System.out.println("layout : " + getLayout());
         //setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
-        setLayout(new GridBagLayout());
+        //setLayout(new GridBagLayout());
         //ToolTipManager.sharedInstance().registerComponent(jTree);
         jTree.setCellRenderer(new cFileSystemModel.Renderer());
         
@@ -58,20 +60,27 @@
 	GridBagConstraints aConstraints = new GridBagConstraints(0,0,1,1, 1.0,1.0,
         	GridBagConstraints.EAST,GridBagConstraints.HORIZONTAL,new Insets(1,1,1,1), 0,0);
 
-	aConstraints.weighty = 0;
-	aConstraints.gridwidth = 1;
-        add(refreshButton = new JButton("Refresh"), aConstraints);
-        aConstraints.gridx += 1;
-        add(loadButton = new JButton("Load"), aConstraints);
-        aConstraints.gridx += 1;
-        add(printButton = new JButton("Print"), aConstraints);
-   //     aConstraints.gridx += 1;
-   //     add(replaceButton = new JButton("Replace"), aConstraints);
+        cGridBag fileCommsnds = new cGridBag();
+        
+        fileCommsnds.add(loadButton = new JButton("Load")); //, aConstraints);
+                loadButton.setToolTipText("Load selected file(s)");
+        fileCommsnds.add(refreshButton = new JButton("Refresh")); //, aConstraints);
+                refreshButton.setToolTipText("Refresh entire tree");
         
         refreshButton.addActionListener(this);
         loadButton.addActionListener(this);
-        printButton.addActionListener(this);
+        
+        if (Globals.ADVANCED)
+        {
+                fileCommsnds.add(printButton = new JButton("Print")); //, aConstraints);
+                printButton.setToolTipText("Print file path in terminal");
+                printButton.addActionListener(this);
+                fileCommsnds.add(mergeAttributesCB = new cCheckBox("Merge", cJME.mergeAttributes)); //, aConstraints);
+                mergeAttributesCB.setToolTipText("Merge common attributes (recommended)");
+                mergeAttributesCB.addItemListener(this);
 //        replaceButton.addActionListener(this);
+   //     add(replaceButton = new JButton("Replace"), aConstraints);
+        }
 
 //        aConstraints.gridx += 1;
 //            add(trimCB = new cCheckBox("Trim", cJME.trim), aConstraints);
@@ -86,17 +95,18 @@
 //            add(genUVCB = new cCheckBox("UV", cJME.genUV), aConstraints);
 //			genUVCB.addItemListener(this);
                         
-        aConstraints.gridx += 1;
-            add(mergeAttributesCB = new cCheckBox("Merge", cJME.mergeAttributes), aConstraints);
-			mergeAttributesCB.addItemListener(this);
+        add(fileCommsnds);
+        fileCommsnds.preferredHeight = 1;
         
-        aConstraints.gridx = 0;
-        aConstraints.gridy += 1;
-	aConstraints.weighty = 1;
-	aConstraints.gridwidth = 10;
-	aConstraints.fill = GridBagConstraints.BOTH;
-
-        add(tree, aConstraints);
+        Return();
+        
+        cGridBag treeBag = new cGridBag();
+        
+        treeBag.add(tree);
+        
+        treeBag.preferredHeight = 30;
+        
+        add(treeBag); //, aConstraints);
         
             GroupEditor oe = (GroupEditor) owner;
 
@@ -235,7 +245,7 @@
                     System.out.println("drop2 = " + dtde + "; drop : " + target);
                     
                 //assert dropTarget == dtde.getSource();
-                if (target instanceof CameraPane)
+                if (target instanceof iCameraPane)
                 {
                     Object object = null;
                     try

--
Gitblit v1.6.2