root / tags / v1_1_Build_1010 / extensions / extRasterTools / src / org / gvsig / rasterTools / saveRaster / ui / main / ButtonsPanel.java @ 12804
History | View | Annotate | Download (2.98 KB)
1 |
package org.gvsig.rasterTools.saveRaster.ui.main; |
---|---|
2 |
|
3 |
import javax.swing.JPanel; |
4 |
import java.awt.GridBagLayout; |
5 |
import java.awt.GridBagConstraints; |
6 |
import java.awt.GridLayout; |
7 |
|
8 |
import javax.swing.JLabel; |
9 |
import javax.swing.JButton; |
10 |
import java.awt.FlowLayout; |
11 |
|
12 |
public class ButtonsPanel extends JPanel { |
13 |
|
14 |
private JPanel pFileName = null; |
15 |
private JPanel pButtons = null; |
16 |
private JLabel lFileTag = null; |
17 |
private JLabel lFileName = null; |
18 |
private JButton bSelect = null; |
19 |
private JButton bProperties = null; |
20 |
|
21 |
/**
|
22 |
* This is the default constructor
|
23 |
*/
|
24 |
public ButtonsPanel() {
|
25 |
super();
|
26 |
initialize(); |
27 |
} |
28 |
|
29 |
/**
|
30 |
* This method initializes this
|
31 |
*
|
32 |
* @return void
|
33 |
*/
|
34 |
private void initialize() { |
35 |
|
36 |
this.setLayout(new GridLayout(2,1)); |
37 |
this.setSize(347, 55); |
38 |
this.add(getJPanel(), null); |
39 |
this.add(getJPanel1(), null); |
40 |
|
41 |
} |
42 |
|
43 |
/**
|
44 |
* This method initializes jPanel
|
45 |
*
|
46 |
* @return javax.swing.JPanel
|
47 |
*/
|
48 |
private JPanel getJPanel() { |
49 |
if (pFileName == null) { |
50 |
FlowLayout flowLayout1 = new FlowLayout(); |
51 |
flowLayout1.setHgap(1);
|
52 |
flowLayout1.setAlignment(java.awt.FlowLayout.LEFT); |
53 |
flowLayout1.setVgap(2);
|
54 |
lFileName = new JLabel(); |
55 |
lFileName.setText("");
|
56 |
lFileTag = new JLabel(); |
57 |
lFileTag.setText("File:");
|
58 |
pFileName = new JPanel(); |
59 |
pFileName.setLayout(flowLayout1); |
60 |
pFileName.setPreferredSize(new java.awt.Dimension(347,20)); |
61 |
pFileName.add(lFileTag, null);
|
62 |
pFileName.add(lFileName, null);
|
63 |
} |
64 |
return pFileName;
|
65 |
} |
66 |
|
67 |
/**
|
68 |
* This method initializes jPanel1
|
69 |
*
|
70 |
* @return javax.swing.JPanel
|
71 |
*/
|
72 |
public JPanel getJPanel1() { |
73 |
if (pButtons == null) { |
74 |
FlowLayout flowLayout = new FlowLayout(); |
75 |
flowLayout.setAlignment(java.awt.FlowLayout.RIGHT); |
76 |
flowLayout.setHgap(2);
|
77 |
flowLayout.setVgap(2);
|
78 |
pButtons = new JPanel(); |
79 |
pButtons.setLayout(flowLayout); |
80 |
pButtons.setPreferredSize(new java.awt.Dimension(347,22)); |
81 |
pButtons.add(getBSelect(), null);
|
82 |
pButtons.add(getBProperties(), null);
|
83 |
} |
84 |
return pButtons;
|
85 |
} |
86 |
|
87 |
/**
|
88 |
* This method initializes jButton
|
89 |
*
|
90 |
* @return javax.swing.JButton
|
91 |
*/
|
92 |
public JButton getBSelect() { |
93 |
if (bSelect == null) { |
94 |
bSelect = new JButton(); |
95 |
bSelect.setPreferredSize(new java.awt.Dimension(110,20)); |
96 |
bSelect.setText("Seleccionar");
|
97 |
} |
98 |
return bSelect;
|
99 |
} |
100 |
|
101 |
/**
|
102 |
* This method initializes jButton1
|
103 |
*
|
104 |
* @return javax.swing.JButton
|
105 |
*/
|
106 |
public JButton getBProperties() { |
107 |
if (bProperties == null) { |
108 |
bProperties = new JButton(); |
109 |
bProperties.setPreferredSize(new java.awt.Dimension(160,20)); |
110 |
bProperties.setText("Propiedades GTiff");
|
111 |
} |
112 |
return bProperties;
|
113 |
} |
114 |
|
115 |
/**
|
116 |
* Asigna el valor del texto de la etiqueta
|
117 |
* @param text cadena con el texto
|
118 |
*/
|
119 |
public void setLabelText(String text){ |
120 |
lFileName.setText(text); |
121 |
} |
122 |
|
123 |
/**
|
124 |
* Obtiene el valor del texto de la etiqueta
|
125 |
* @return text cadena con el texto
|
126 |
*/
|
127 |
public JLabel getLabelText(){ |
128 |
return lFileName;
|
129 |
} |
130 |
|
131 |
/**
|
132 |
* Asigna el valor del texto de la etiqueta
|
133 |
* @param text cadena con el texto
|
134 |
*/
|
135 |
public void setTag(String tag){ |
136 |
lFileTag.setText(tag); |
137 |
} |
138 |
} |