gvsig-raster / org.gvsig.raster.postgis / trunk / org.gvsig.raster.postgis / org.gvsig.raster.postgis.swing / org.gvsig.raster.postgis.swing.impl / src / main / java / org / gvsig / raster / postgis / swing / impl / addlayer / AddPostGISRasterLayerMainPanel.java @ 956
History | View | Annotate | Download (3.67 KB)
1 |
package org.gvsig.raster.postgis.swing.impl.addlayer; |
---|---|
2 |
|
3 |
import java.awt.GridBagConstraints; |
4 |
import java.awt.GridBagLayout; |
5 |
|
6 |
import javax.swing.JCheckBox; |
7 |
import javax.swing.JList; |
8 |
import javax.swing.JPanel; |
9 |
import javax.swing.JScrollPane; |
10 |
import javax.swing.ListSelectionModel; |
11 |
|
12 |
import org.gvsig.andami.PluginServices; |
13 |
import org.gvsig.i18n.Messages; |
14 |
|
15 |
public class AddPostGISRasterLayerMainPanel extends JPanel { |
16 |
private static final long serialVersionUID = 1L; |
17 |
private static final int margin = 4; |
18 |
private ConnectionChooserPanel northPanel = null; |
19 |
private JList list = null; |
20 |
private JList subdatasetList = null; |
21 |
private JScrollPane scroll = null; |
22 |
private JScrollPane subdatasetScroll = null; |
23 |
private JCheckBox chkTileCache = null; |
24 |
|
25 |
public AddPostGISRasterLayerMainPanel() {
|
26 |
init(); |
27 |
} |
28 |
|
29 |
private void init() { |
30 |
this.setLayout(new GridBagLayout()); |
31 |
GridBagConstraints gridBagConstraints = new GridBagConstraints(); |
32 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
33 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; |
34 |
gridBagConstraints.weightx = 1;
|
35 |
gridBagConstraints.insets = new java.awt.Insets(margin, margin, margin, margin);
|
36 |
this.add(getNorthPanel(), gridBagConstraints);
|
37 |
|
38 |
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |
39 |
gridBagConstraints.weighty = 1;
|
40 |
gridBagConstraints.gridy = 1;
|
41 |
this.add(getScrollPanel(), gridBagConstraints);
|
42 |
|
43 |
gridBagConstraints.gridy = 2;
|
44 |
this.add(getSubdatasetScrollPanel(), gridBagConstraints);
|
45 |
|
46 |
gridBagConstraints.gridy = 3;
|
47 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
48 |
gridBagConstraints.weighty = 0;
|
49 |
this.add(getChkTileCache(), gridBagConstraints);
|
50 |
} |
51 |
|
52 |
public ConnectionChooserPanel getNorthPanel() {
|
53 |
if(northPanel == null) { |
54 |
northPanel = new ConnectionChooserPanel(true); |
55 |
} |
56 |
return northPanel;
|
57 |
} |
58 |
|
59 |
public JCheckBox getChkTileCache() { |
60 |
if (chkTileCache == null) { |
61 |
chkTileCache = new JCheckBox(); |
62 |
chkTileCache.setBounds(7, 72, 249, 20); |
63 |
chkTileCache.setText(PluginServices.getText(this, "tile_cache")); |
64 |
chkTileCache.setToolTipText(PluginServices.getText(this, "tile_cache_tooltip")); |
65 |
chkTileCache.setSelected(true);
|
66 |
} |
67 |
return chkTileCache;
|
68 |
} |
69 |
|
70 |
public JList getList() { |
71 |
if(list == null) { |
72 |
list = new JList(); |
73 |
list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
74 |
list.setLayoutOrientation(JList.VERTICAL);
|
75 |
list.setVisibleRowCount(-1);
|
76 |
} |
77 |
return list;
|
78 |
} |
79 |
|
80 |
public JList getSubdatasetList() { |
81 |
if(subdatasetList == null) { |
82 |
subdatasetList = new JList(); |
83 |
subdatasetList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
|
84 |
subdatasetList.setLayoutOrientation(JList.VERTICAL);
|
85 |
subdatasetList.setVisibleRowCount(-1);
|
86 |
} |
87 |
return subdatasetList;
|
88 |
} |
89 |
|
90 |
public JScrollPane getScrollPanel() { |
91 |
if(scroll == null) { |
92 |
scroll = new JScrollPane(getList()); |
93 |
scroll.setBorder(javax.swing.BorderFactory.createTitledBorder(null, Messages.getText("tables_chooser"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
94 |
} |
95 |
return scroll;
|
96 |
} |
97 |
|
98 |
public JScrollPane getSubdatasetScrollPanel() { |
99 |
if(subdatasetScroll == null) { |
100 |
subdatasetScroll = new JScrollPane(getSubdatasetList()); |
101 |
subdatasetScroll.setBorder(javax.swing.BorderFactory.createTitledBorder(null, Messages.getText("subdataset_chooser"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
102 |
} |
103 |
return subdatasetScroll;
|
104 |
} |
105 |
} |