Revision 4171 org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/properties/panel/GeneralPanel.java

View differences:

GeneralPanel.java
2 2
*
3 3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4 4
* of the Valencian Government (CIT)
5
* 
5
*
6 6
* This program is free software; you can redistribute it and/or
7 7
* modify it under the terms of the GNU General Public License
8 8
* as published by the Free Software Foundation; either version 2
9 9
* of the License, or (at your option) any later version.
10
* 
10
*
11 11
* This program is distributed in the hope that it will be useful,
12 12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13 13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 14
* GNU General Public License for more details.
15
* 
15
*
16 16
* You should have received a copy of the GNU General Public License
17 17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 19
* MA  02110-1301, USA.
20
* 
20
*
21 21
*/
22 22
package org.gvsig.raster.tools.app.basic.tool.properties.panel;
23 23

  
......
57 57

  
58 58
/**
59 59
 * Main panel of Properties window. This panel contains general options.
60
 * 
60
 *
61 61
 * @author Nacho Brodin (nachobrodin@gmail.com)
62 62
 */
63 63
public class GeneralPanel extends AbstractPanel implements ActionListener, IProcessActions {
......
82 82
	private JPanel              recalcStatsPanel    = null;
83 83
	private NoDataPanel      pNoDataPanel        = null;
84 84
	//private Transparency        transparency        = null;
85
	
85

  
86 86
	private JScrollPane         jScrollPane         = null;
87 87
	private JEditorPane         jEditorPane         = null;
88 88

  
......
142 142
		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
143 143
		gridBagConstraints.weightx = 1.0;
144 144
		add(getScalePanel(), gridBagConstraints);
145
		
145

  
146 146
		gridBagConstraints = new java.awt.GridBagConstraints();
147 147
		gridBagConstraints.gridx = 0;
148 148
		gridBagConstraints.gridy = 1;
......
155 155
		gridBagConstraints.weighty = 1.0;
156 156
		gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
157 157
		add(getRecalcStatsPanel(), gridBagConstraints);
158
		
158

  
159 159
		this.setPreferredSize(new Dimension(100, 80));
160

  
161
		this.setPriority(90);
160 162
	}
161
	
162
	
163

  
164

  
163 165
	private void actionEnabled() {
164 166
		IRasterLayerActions actions = null;
165 167
		if(fLayer instanceof IRasterLayerActions)
......
167 169

  
168 170
		if (!actions.isActionEnabled(IRasterLayerActions.STATS))
169 171
			getRecalcStatsPanel().setVisible(false);
170
		
172

  
171 173
		if (!actions.isActionEnabled(IRasterLayerActions.NODATA))
172 174
			getNoDataPanel().setVisible(false);
173 175
	}
174
	
176

  
175 177
	/**
176 178
	 * This method initializes TranspOpacitySliderPanel
177 179
	 * @return javax.swing.JPanel
......
184 186

  
185 187
		return pNoDataPanel;
186 188
	}
187
	
189

  
188 190
	public JPanel getScalePanel() {
189 191
		if (scalePanel == null) {
190 192
			scalePanel = new JPanel();
191 193
			scalePanel.setLayout(new GridBagLayout());
192
			
194

  
193 195
			GridBagConstraints gridBagConstraints;
194 196

  
195 197
			int y = 0;
......
266 268
		if (recalcStatsPanel == null) {
267 269
			recalcStatsPanel = new JPanel();
268 270
			recalcStatsPanel.setLayout(new BorderLayout(5, 5));
269
			
271

  
270 272
			recalcStatsPanel.add(getJScrollPane(), BorderLayout.CENTER);
271 273
			recalcStatsPanel.add(getCalcStatsButton(), BorderLayout.SOUTH);
272 274
		}
......
371 373
			process.setActions(this);
372 374
			process.start();
373 375
		}
374
		
376

  
375 377
		if (e.getSource() == getJCheckBoxMaxim()) {
376 378
			boolean enabled = getJCheckBoxMaxim().isSelected();
377 379
			getJLabelMaxim().setEnabled(enabled);
......
390 392
		rowColor = !rowColor;
391 393
		return color;
392 394
	}
393
	
395

  
394 396
	/**
395 397
	 * Obtiene una entrada de la tabla en formato HTML a partir de una propiedad,
396 398
	 * un valor y un color.
......
443 445
		return "<table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" width=\"100%\">" + content + "</table>";
444 446
	}
445 447

  
446
	
448

  
447 449
	/*
448 450
	 * (non-Javadoc)
449 451
	 * @see org.gvsig.gui.beans.panelGroup.panels.AbstractPanel#setReference(java.lang.Object)
......
455 457
			return;
456 458

  
457 459
		fLayer = (FLyrRaster) ref;
458
		
460

  
459 461
		actionEnabled();
460 462

  
461 463
		getNoDataPanel().setLayer(fLayer);
......
483 485
		refreshHTMLStatistics();
484 486
		setValuesFromPanelToTransparency();
485 487
	}
486
		
488

  
487 489
	/**
488 490
	 * Refresca el HTML del cuadro de texto de las estadisticas de todas las capas
489 491
	 */
......
521 523
		getJEditorStatsPanel().setText(html);
522 524
		getJEditorStatsPanel().setCaretPosition(0);
523 525
	}
524
	
526

  
525 527
	/**
526 528
	 * This method initializes jScrollPane
527 529
	 *
......
534 536
		}
535 537
		return jScrollPane;
536 538
	}
537
	
539

  
538 540
	/**
539 541
	 * This method initializes jEditorPane
540 542
	 *
......
565 567
			return;
566 568

  
567 569
		fLayer.setNoDataTransparent(getNoDataPanel().getCheckBoxNoDataEnabled().isSelected());
568
		
570

  
569 571
		// Redibujamos
570 572
		fLayer.getMapContext().invalidate();
571 573
	}

Also available in: Unified diff