From 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Tue, 25 Jun 2019 23:58:09 -0400
Subject: [PATCH] Edit panel pin state.

---
 cFileSystemPane.java |   62 ++++++++++++++++++-------------
 1 files changed, 36 insertions(+), 26 deletions(-)

diff --git a/cFileSystemPane.java b/cFileSystemPane.java
index 8bd7ccd..98b5413 100644
--- a/cFileSystemPane.java
+++ b/cFileSystemPane.java
@@ -8,11 +8,13 @@
 
 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
 {
-    cTree jTree = new cTree(null);
+    cTree jTree = new cTree();
     iCallBack owner;
     
     JButton refreshButton;
@@ -24,16 +26,16 @@
     JCheckBox stripCB;
     JCheckBox genUVCB;
 
-    JCheckBox mergeAttributesCB;
+    cCheckBox mergeAttributesCB;
     
     cFileSystemPane(iCallBack o)
     {
         owner = o;
         
-        setName("File system");
+        setName("Files");
         //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