Revision 1750

View differences:

branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/DefaultTabPanel.java
1
/*
2
 * Creado el 3-marzo-2005
3
 */
4
package org.cresques.ui;
5

  
6
import java.awt.BorderLayout;
7
import java.awt.Dimension;
8

  
9
import javax.swing.JPanel;
10
import javax.swing.JTabbedPane;
11

  
12
import org.cresques.io.GeoRasterFile;
13
import org.cresques.ui.DefaultDialogPanel;
14
import org.cresques.ui.raster.SaveSetupPanel;
15

  
16
/**
17
 * @author Nacho Brodin <brodin_ign@gva.es>
18
 */
19
public class DefaultTabPanel extends DefaultDialogPanel {
20
	
21
	protected JTabbedPane		tabbedPane = null;
22
	
23
	
24
	/**
25
	 * 
26
	 * @param tabTitle
27
	 * @param panel
28
	 */
29
	public DefaultTabPanel() {
30
		
31
		super();
32
		this.setBounds(0,0,355,230);
33
	    this.getContentPanel();
34
	    this.getTabPane();
35
		contentPane.add( tabbedPane, BorderLayout.CENTER );
36
					
37
	}
38
 
39
	
40
	
41
	private JTabbedPane getTabPane(){
42
	
43
		if(tabbedPane==null){
44
			tabbedPane = new JTabbedPane();
45
		}
46
		return tabbedPane;
47
		
48
	}
49
	/**
50
	 * 
51
	 * @param title
52
	 * @param panel
53
	 */
54
	protected void addTab(String title, JPanel panel){
55
			
56
		tabbedPane.add(title, panel);
57
	}
58
	
59
	/**
60
	 * 
61
	 * @return
62
	 */
63
	public JTabbedPane getTab() {
64
		
65
		return tabbedPane;
66
		
67
	}
68
	
69
}
70

  
0 71

  
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/FilterRasterDialogPanel.java
1
/*
2
 * Creado el 3-marzo-2005
3
 */
4
package org.cresques.ui.raster;
5

  
6
import javax.swing.JPanel;
7

  
8
import org.cresques.io.GeoRasterFile;
9
import org.cresques.ui.DefaultDialogPanel;
10
import org.cresques.ui.DefaultTabPanel;
11

  
12
/**
13
 * @author Nacho Brodin <brodin_ign@gva.es>
14
 */
15
public class FilterRasterDialogPanel extends DefaultTabPanel {
16
	
17
	//Tama?o de panel interior. El tab de dentro es proporcional
18
	protected int	sizePanelX = 350;
19
	protected int 	sizePanelY = 185;
20
	
21
	
22
	public FilterRasterDialogPanel() {
23
		
24
		super();
25
		contentPane.setPreferredSize(new java.awt.Dimension(sizePanelX, sizePanelY));
26
		this.tabbedPane.setPreferredSize(new java.awt.Dimension(sizePanelX, sizePanelY-5));
27
		initPanels();
28
		
29
	}
30
 
31
	/**
32
	 * This method initializes this
33
	 * 
34
	 * @return void
35
	 */
36
	protected void initPanels() {
37
		
38
        this.setBounds(0,0,355,230);
39
        RasterTransparencyPanel ptrans = new RasterTransparencyPanel(this);
40
        this.addTab(ptrans.nom, ptrans);
41
        this.addTab("panel 2", new JPanel());
42
        
43
        //Ocultamos el bot?n de aplicar
44
        
45
        //this.getApplyButton().setVisible(false);
46
        
47
	}
48
	
49
}
50

  
51

  
52

  
53

  
54

  
0 55

  
branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/ui/raster/RasterTransparencyPanel.java
1
package org.cresques.ui.raster;
2

  
3
import java.awt.BorderLayout;
4

  
5
import javax.swing.JPanel;
6

  
7
import javax.swing.JCheckBox;
8
import java.awt.FlowLayout;
9
import javax.swing.JSlider;
10
import javax.swing.JLabel;
11
import javax.swing.JTextField;
12
public class RasterTransparencyPanel extends JPanel{
13
	
14
	String nom = "Transparencia";
15
	FilterRasterDialogPanel parent = null;
16
	
17
	private JPanel jPanel = null;
18
	private JPanel jPanel1 = null;
19
	private JPanel jPanel2 = null;
20
	private JCheckBox jCheckBox = null;
21
	private JCheckBox jCheckBox1 = null;
22
	private JSlider jSlider = null;
23
	private JTextField jTextField = null;
24
	private JPanel jPanel3 = null;
25
	private JPanel jPanel4 = null;
26
	private JPanel jPanel5 = null;
27
	private JLabel jLabel = null;
28
	private JLabel jLabel1 = null;
29
	private JLabel jLabel2 = null;
30
	private JTextField jTextField1 = null;
31
	private JTextField jTextField2 = null;
32
	private JTextField jTextField3 = null;
33
	private JLabel jLabel3 = null;
34
	public RasterTransparencyPanel(FilterRasterDialogPanel parent){
35
		
36
		this.parent = parent;
37
		initialize();
38
	}		
39

  
40
	/**
41
	 * This method initializes this
42
	 * 
43
	 * @return void
44
	 */
45
	private void initialize() {
46
        
47
        this.setLayout(new BorderLayout());
48
        this.setSize(350, 146);
49
        this.add(getJPanel(), java.awt.BorderLayout.NORTH);
50
        this.add(getJPanel1(), java.awt.BorderLayout.WEST);
51
        this.add(getJPanel2(), java.awt.BorderLayout.SOUTH);
52
       			
53
	}
54
	
55
	/**
56
	 * This method initializes jPanel	
57
	 * 	
58
	 * @return javax.swing.JPanel	
59
	 */    
60
	private JPanel getJPanel() {
61
		if (jPanel == null) {
62
			FlowLayout flowLayout8 = new FlowLayout();
63
			jPanel = new JPanel();
64
			jPanel.setLayout(flowLayout8);
65
			flowLayout8.setAlignment(java.awt.FlowLayout.LEFT);
66
			jPanel.add(getJCheckBox(), null);
67
		}
68
		return jPanel;
69
	}
70
	/**
71
	 * This method initializes jPanel1	
72
	 * 	
73
	 * @return javax.swing.JPanel	
74
	 */    
75
	private JPanel getJPanel1() {
76
		if (jPanel1 == null) {
77
			jPanel1 = new JPanel();
78
			jPanel1.setLayout(new BorderLayout());
79
			jPanel1.add(getJPanel3(), java.awt.BorderLayout.NORTH);
80
			jPanel1.add(getJPanel4(), java.awt.BorderLayout.CENTER);
81
			jPanel1.add(getJPanel5(), java.awt.BorderLayout.SOUTH);
82
		}
83
		return jPanel1;
84
	}
85
	/**
86
	 * This method initializes jPanel2	
87
	 * 	
88
	 * @return javax.swing.JPanel	
89
	 */    
90
	private JPanel getJPanel2() {
91
		if (jPanel2 == null) {
92
			FlowLayout flowLayout9 = new FlowLayout();
93
			jPanel2 = new JPanel();
94
			jPanel2.setLayout(flowLayout9);
95
			flowLayout9.setAlignment(java.awt.FlowLayout.LEFT);
96
			jPanel2.add(getJCheckBox1(), null);
97
			jPanel2.add(getJSlider(), null);
98
			jPanel2.add(getJTextField(), null);
99
		}
100
		return jPanel2;
101
	}
102
	/**
103
	 * This method initializes jCheckBox	
104
	 * 	
105
	 * @return javax.swing.JCheckBox	
106
	 */    
107
	private JCheckBox getJCheckBox() {
108
		if (jCheckBox == null) {
109
			jCheckBox = new JCheckBox();
110
			jCheckBox.setText("Transparencia");
111
		}
112
		return jCheckBox;
113
	}
114
	/**
115
	 * This method initializes jCheckBox1	
116
	 * 	
117
	 * @return javax.swing.JCheckBox	
118
	 */    
119
	private JCheckBox getJCheckBox1() {
120
		if (jCheckBox1 == null) {
121
			jCheckBox1 = new JCheckBox();
122
			jCheckBox1.setText("Opacidad");
123
		}
124
		return jCheckBox1;
125
	}
126
	/**
127
	 * This method initializes jSlider	
128
	 * 	
129
	 * @return javax.swing.JSlider	
130
	 */    
131
	private JSlider getJSlider() {
132
		if (jSlider == null) {
133
			jSlider = new JSlider();
134
		}
135
		return jSlider;
136
	}
137
	/**
138
	 * This method initializes jTextField	
139
	 * 	
140
	 * @return javax.swing.JTextField	
141
	 */    
142
	private JTextField getJTextField() {
143
		if (jTextField == null) {
144
			jTextField = new JTextField();
145
			jTextField.setPreferredSize(new java.awt.Dimension(40,19));
146
		}
147
		return jTextField;
148
	}
149
	/**
150
	 * This method initializes jPanel3	
151
	 * 	
152
	 * @return javax.swing.JPanel	
153
	 */    
154
	private JPanel getJPanel3() {
155
		if (jPanel3 == null) {
156
			jLabel = new JLabel();
157
			FlowLayout flowLayout11 = new FlowLayout();
158
			jPanel3 = new JPanel();
159
			jPanel3.setLayout(flowLayout11);
160
			jLabel.setText("Valor Rojo:  ");
161
			flowLayout11.setAlignment(java.awt.FlowLayout.LEFT);
162
			jPanel3.add(jLabel, null);
163
			jPanel3.add(getJTextField1(), null);
164
		}
165
		return jPanel3;
166
	}
167
	/**
168
	 * This method initializes jPanel4	
169
	 * 	
170
	 * @return javax.swing.JPanel	
171
	 */    
172
	private JPanel getJPanel4() {
173
		if (jPanel4 == null) {
174
			jLabel3 = new JLabel();
175
			jLabel1 = new JLabel();
176
			jPanel4 = new JPanel();
177
			jLabel1.setText("Valor Verde: ");
178
			jLabel3.setText("Usar Rangos: 1,3,5:8 ");
179
			jPanel4.add(jLabel1, null);
180
			jPanel4.add(getJTextField2(), null);
181
			jPanel4.add(jLabel3, null);
182
		}
183
		return jPanel4;
184
	}
185
	/**
186
	 * This method initializes jPanel5	
187
	 * 	
188
	 * @return javax.swing.JPanel	
189
	 */    
190
	private JPanel getJPanel5() {
191
		if (jPanel5 == null) {
192
			jLabel2 = new JLabel();
193
			FlowLayout flowLayout10 = new FlowLayout();
194
			jPanel5 = new JPanel();
195
			jPanel5.setLayout(flowLayout10);
196
			jLabel2.setText("Valor Azul:  ");
197
			flowLayout10.setAlignment(java.awt.FlowLayout.LEFT);
198
			jPanel5.add(jLabel2, null);
199
			jPanel5.add(getJTextField3(), null);
200
		}
201
		return jPanel5;
202
	}
203
	/**
204
	 * This method initializes jTextField1	
205
	 * 	
206
	 * @return javax.swing.JTextField	
207
	 */    
208
	private JTextField getJTextField1() {
209
		if (jTextField1 == null) {
210
			jTextField1 = new JTextField();
211
			jTextField1.setPreferredSize(new java.awt.Dimension(60,19));
212
		}
213
		return jTextField1;
214
	}
215
	/**
216
	 * This method initializes jTextField2	
217
	 * 	
218
	 * @return javax.swing.JTextField	
219
	 */    
220
	private JTextField getJTextField2() {
221
		if (jTextField2 == null) {
222
			jTextField2 = new JTextField();
223
			jTextField2.setPreferredSize(new java.awt.Dimension(60,19));
224
		}
225
		return jTextField2;
226
	}
227
	/**
228
	 * This method initializes jTextField3	
229
	 * 	
230
	 * @return javax.swing.JTextField	
231
	 */    
232
	private JTextField getJTextField3() {
233
		if (jTextField3 == null) {
234
			jTextField3 = new JTextField();
235
			jTextField3.setPreferredSize(new java.awt.Dimension(60,19));
236
		}
237
		return jTextField3;
238
	}
239
  }  //  @jve:decl-index=0:visual-constraint="36,15"
0 240

  

Also available in: Unified diff