Revision 10786 branches/F2/extensions/extJCRS/src/org/gvsig/crs/gui/panels/TreePanel.java

View differences:

TreePanel.java
40 40

  
41 41
package org.gvsig.crs.gui.panels;
42 42

  
43
import java.awt.FlowLayout;
44
import java.awt.GridBagConstraints;
45
import java.awt.GridBagLayout;
43
import java.awt.BorderLayout;
46 44
import java.util.Hashtable;
47 45

  
48 46
import javax.swing.JPanel;
49 47
import javax.swing.JScrollPane;
50 48
import javax.swing.JTextArea;
51 49
import javax.swing.JTree;
50
import javax.swing.border.EmptyBorder;
52 51
import javax.swing.tree.DefaultMutableTreeNode;
53 52
import javax.swing.tree.DefaultTreeModel;
54 53

  
......
58 57
 *
59 58
 */
60 59
public class TreePanel extends JPanel {
61
	
60

  
61
	private static final long serialVersionUID = 1L;
62 62
	private int 		wComp = 190;
63 63
	private int 		hComp = 360;
64 64
	private int 		hTree = (int)Math.floor(hComp * 0.68);
65
	private int 		hList = hComp - hTree;
65
	private int 		hList = 50;
66 66
	private JScrollPane pTree = null;
67 67
	private JScrollPane pList = null;
68 68
	private JTree tree = null;
......
81 81
	private void initialize() {
82 82
		map = new Hashtable();
83 83
		raiz =  new DefaultMutableTreeNode(rootName);
84
        FlowLayout flowLayout = new FlowLayout();
85
        flowLayout.setHgap(0);
86
        flowLayout.setVgap(0);
87
        this.setLayout(flowLayout);
88
		
89
		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
90
		gridBagConstraints1.gridx = 0;
91
		gridBagConstraints1.gridy = 1;
92
		GridBagConstraints gridBagConstraints = new GridBagConstraints();
93
		gridBagConstraints.gridx = 0;
94
		gridBagConstraints.gridy = 0;
95
		setLayout(new GridBagLayout());
96
		setPreferredSize(new java.awt.Dimension(wComp,hComp));
97
		add(getPTree(), gridBagConstraints);
98
		add(getPList(), gridBagConstraints1);
99

  
84
		this.setLayout(new BorderLayout());
85
		this.setBorder(new EmptyBorder(0,10,10,10));
86
		this.add(getPTree(),BorderLayout.CENTER);
87
		this.add(getPList(),BorderLayout.SOUTH);
100 88
	}
101 89
	
102 90
	/**
......
107 95
	private JScrollPane getPTree() {
108 96
		if (pTree == null) {
109 97
			pTree = new JScrollPane();
110
			pTree.setPreferredSize(new java.awt.Dimension(wComp, hTree));
98
			//pTree.setPreferredSize(new java.awt.Dimension(wComp, hTree));
111 99
			pTree.setViewportBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
112 100
			pTree.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
113 101
			pTree.setViewportView(getTree());
......
123 111
	private JScrollPane getPList() {
124 112
		if (pList == null) {
125 113
			pList = new JScrollPane();
126
			pList.setPreferredSize(new java.awt.Dimension(wComp, hList));
114
			//pList.setPreferredSize(new java.awt.Dimension(wComp, hList));
127 115
			pList.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
128 116
			pList.setBackground(java.awt.Color.white);
129 117
			pList.setVerticalScrollBarPolicy(javax.swing.JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);

Also available in: Unified diff