Revision 1932

View differences:

branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src-test/org/cresques/io/raster/PruebaFilter.java
1
/*
2
 * Created on 22-feb-2005
3
 */
4
package org.cresques.io.raster;
5

  
6
import java.awt.Image;
7

  
8

  
9
public abstract class PruebaFilter extends RasterFilter {
10
	
11
	protected RasterBuf 		rasterBuf = null;
12
	
13
    public void pre(){
14
    	rasterBuf = new RasterBuf(RasterBuf.TYPE_INT, width, height, 3, null); 
15
    }
16
	public PruebaFilter(){
17
		super();
18
	}	
19

  
20
}
21

  
0 22

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src-test/org/cresques/io/raster/PruebaShortFilter.java
1
/*
2
 * Created on 22-feb-2005
3
 */
4
package org.cresques.io.raster;
5

  
6
import java.awt.Image;
7

  
8
/**
9
 * Calcula el m?ximo y el m?nimo de un raster.
10
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
11
 */
12
public class PruebaShortFilter extends PruebaFilter {
13
	
14
	public PruebaShortFilter(){
15
		super();
16
	}
17
			
18
	public void pre(){
19
		//Obtenci?n de par?metros
20
		
21
		this.raster = (RasterBuf)params.get("raster");
22
				
23
		height = raster.getHeight();
24
		width = raster.getWidth();
25
		super.pre();
26
	}
27
	
28
	public void process(int x, int y) {
29
		raster.getElemInt(x, y, px);
30
		this.rasterBuf.setElemInt(x, y, px);
31
		
32
	}
33
	
34
	public int getInRasterDataType(){
35
		//return raster.getDataType();
36
		return RasterBuf.TYPE_SHORT;
37
	}
38
	
39
	public int getOutRasterDataType(){
40
		//return raster.getDataType();
41
		return RasterBuf.TYPE_SHORT;
42
	}
43
	
44
	public Object getResult(String name){
45
		if(name.equals("raster"))
46
			return rasterBuf;
47
		else 
48
			return null;
49
	}
50
	
51
	public void processLine(int y){};
52
	public void post(){};
53

  
54
}
55

  
0 56

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src-test/org/cresques/io/raster/PruebaImageFilter.java
1
/*
2
 * Created on 25-feb-2005
3
 */
4
package org.cresques.io.raster;
5

  
6
import java.awt.Image;
7
import java.awt.Point;
8
import java.awt.image.BufferedImage;
9

  
10
/**
11
 * Clase base para los filtros de calculo de m?ximo y m?nimo en sus diferentes 
12
 * tipos de datos.
13
 */ 
14
public class PruebaImageFilter extends PruebaFilter {
15

  
16
	public PruebaImageFilter(){
17
		super();
18
	}
19
	
20
	public void pre(){
21
		//Obtenci?n de par?metros
22

  
23
		this.image = (Image)params.get("raster");
24
				
25
		height = image.getHeight(null);
26
		width = image.getWidth(null);
27
		
28
		super.pre();
29
		
30
	}
31
	
32
	public void process(int x, int y) {
33
		int px = ((BufferedImage) image).getRGB(x,y);
34
		int []px3 = {(px & 0xff0000) >> 16, (px & 0x00ff00) >> 8, (px & 0x0000ff)};
35
		this.rasterBuf.setElemInt(x, y, px3);
36
	}
37
	
38
	public int getInRasterDataType(){
39
		return RasterBuf.TYPE_IMAGE;
40
	}
41
	
42
	public int getOutRasterDataType(){
43
		return RasterBuf.TYPE_SHORT;
44
	}
45
	
46
	public void post(){
47
		image = null;
48
	};
49
	
50
	public Object getResult(String name){
51
		if(name.equals("raster"))
52
			return rasterBuf;
53
		else return null;
54
	}
55
	
56
	public void processLine(int y){};
57
	
58
}
59

  
60

  
0 61

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src-test/org/cresques/io/raster/PruebasRasterStack.java
1
package org.cresques.io.raster;
2

  
3
public class PruebasRasterStack{
4
	
5
	private PruebaStackManager 	stackManager = null;
6
	
7
	public PruebasRasterStack(PruebaStackManager stackManager){
8
		this.stackManager = stackManager;
9
		
10
		int[][] r = {{0,15}};
11
		stackManager.addTransparencyFilter(	r, null, null, 0x10, 0xff, 0xff, 0xff);
12
		int[][] s = {{0,10}, {1,5}};
13
		stackManager.addTransparencyFilter(	r, s, null, 0x10, 0xff, 0xff, 0xff);
14
		stackManager.addPruebaFilter();
15
		stackManager.removeFilter(4);
16
		stackManager.addPruebaFilter();
17
		stackManager.removeFilter(4);
18
		stackManager.addTransparencyFilter(	r, s, null, 0x10, 0xff, 0xff, 0xff);
19
		stackManager.removeFilter(0);
20
		stackManager.addPruebaFilter();
21
		stackManager.addTransparencyFilter(	r, s, null, 0x10, 0xff, 0xff, 0xff);
22
		stackManager.addEnhancedFilter();
23
		stackManager.addTailFilter( 0.1, 0.5);
24
		stackManager.removeFilter(3);
25
		stackManager.removeFilter(1);
26
	}
27
	
28
	public void setRasterFilterStackManager(PruebaStackManager stackManager){
29
		this.stackManager = stackManager;
30
	}
31
	
32
}
0 33

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src-test/org/cresques/io/raster/PruebaStackManager.java
1
package org.cresques.io.raster;
2

  
3
public class PruebaStackManager extends RasterFilterStackManager{
4
	
5
	public final static int		prueba = 4;
6
	
7
	public PruebaStackManager(RasterFilterStack filterStack){
8
		super(filterStack);
9
		addTypeFilter("prueba", PruebaStackManager.prueba, 3);
10
	}
11
	 
12
	/**
13
	 * Filtro de pruebas. 
14
	 */
15
	public void addPruebaFilter(){
16
		RasterFilter filtro = null;
17
		switch(filterStack.getDataTypeInFilter(PruebaStackManager.prueba)){
18
			case RasterBuf.TYPE_IMAGE:filtro = new PruebaImageFilter();break;
19
			case RasterBuf.TYPE_SHORT:
20
			case RasterBuf.TYPE_USHORT:
21
			case RasterBuf.TYPE_INT:filtro = new PruebaShortFilter();break;
22
		}
23
		filterStack.addFilter(PruebaStackManager.prueba, filtro);
24
		super.controlTypes();
25
	}
26
	
27
	public int getType(RasterFilter rasterFilter){
28
		if(rasterFilter instanceof PruebaFilter)
29
			return PruebaStackManager.prueba;
30
					
31
		return super.getType(rasterFilter);
32
	}
33
	
34
}
0 35

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/doc-files/overview.html
1
<html>
2
	<body>Overview 1
3
</body>
4
</html>
5

  
0 6

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/javadoc.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project default="javadoc">
3
    <target name="javadoc">
4
        <javadoc destdir="doc" access="package" source="1.4" use="true" notree="false" nonavbar="false" noindex="false" splitindex="true" author="true" version="true" nodeprecatedlist="false" nodeprecated="false" packagenames="org.cresques.cts.gt2,org.cresques.io,org.cresques.geo.cover,org.cresques.ui,org.cresques.geo,org.cresques.cts,org.cresques.ui.cmd,org.cresques.px.gml,org.cresques.px.dxf,org.cresques.px" sourcepath="src" classpath="lib/jmgeoraster.jar;lib/geojava.jar;bin;C:\java\lib\ermapper.jar;lib/gt2cts.jar" overview="C:\eclipse\workspace\Cq CMS for Java\doc-files\overview.html" doctitle="Cresques Mapping Suite for Java v0.1">
5
            <link href="file:/C:/j2sdk1.4.2_03/docs/api/"/>
6
            <link href="jar:file:/C:/java/lib/ermapperdoc.jar!/Javadoc"/>
7
        </javadoc>
8
    </target>
9
</project>
0 10

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src/org/cresques/.cvsignore
1
*.dfPackage
2
*.wmf
0 3

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src/org/cresques/ui/cts/CSSelectionDialogPanel.java
1
/*
2
 * Creado el 31-ago-2004
3
 */
4
package org.cresques.ui.cts;
5

  
6
import javax.swing.JPanel;
7

  
8
import org.cresques.cts.ProjectionPool;
9
import org.cresques.ui.DefaultDialogPanel;
10
import org.cresques.ui.cts.CSSelectionPanel;
11

  
12
/**
13
 * Dialogo para abrir fichero.
14
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
15
 */
16
public class CSSelectionDialogPanel extends DefaultDialogPanel {
17
	public CSSelectionDialogPanel() {
18
		super();
19
		initialize();
20
	}
21

  
22
	/**
23
	 * This method initializes this
24
	 * 
25
	 * @return void
26
	 */
27
	private void initialize() {
28
        this.setBounds(0,0,321,230);
29
			
30
	}
31
	public CSSelectionPanel getProjPanel() {
32
		return (CSSelectionPanel) getContentPanel();
33
	}
34
	
35
	protected JPanel getContentPanel() {
36
		if (contentPane == null) {
37
			contentPane = new CSSelectionPanel("Sistema de referencia");
38
			contentPane.setBounds(14, 12, 280, 163);
39
			
40
			((CSSelectionPanel)contentPane).setProjection(ProjectionPool.get("EPSG:32619"));
41
		}
42
		return contentPane;
43
	}
44
}
45

  
0 46

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src/org/cresques/ui/cts/CSSelectionPanel.java
1
/*
2
 * Creado el 31-ago-2004
3
 */
4
package org.cresques.ui.cts;
5

  
6
import java.awt.event.ActionEvent;
7
import java.awt.event.ActionListener;
8

  
9
import javax.swing.JComboBox;
10
import javax.swing.JLabel;
11
import javax.swing.JPanel;
12

  
13
import org.cresques.cts.IProjection;
14
import org.cresques.ui.LoadableComboBox;
15

  
16
//import es.gva.cit.geoexplorer.ui.LoadableComboBox;
17

  
18
/**
19
 * Panel de edici?n de Sistemas de referencia	
20
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
21
 */
22
public class CSSelectionPanel extends JPanel {
23
	private LoadableComboBox datumComboBox = null;
24
	private LoadableComboBox projComboBox = null;
25
	private LoadableComboBox huseComboBox = null;
26
	private JLabel jLabel = null;
27
	private JLabel jLabel1 = null;
28
	private JLabel jLabel2 = null;
29
	private int wDisplay = 335;
30
	private int wCombo = 250;
31
	private int h=23, x=14;
32
	private String tit;
33
	private CSSelectionModel model;
34

  
35
	/**
36
	 * Constructor de la clase.
37
	 */
38
	public CSSelectionPanel(String tit) {
39
		super();
40
		if (tit == null) tit = "Sistema de referencia";
41
		this.tit = tit;
42
		setModel(new CSSelectionModel());
43
		initialize();
44
	}
45
	/**
46
	 * Inicializa el panel.
47
	 * @return javax.swing.JPanel	
48
	 */    
49
	private void initialize() {
50
		setPreferredSize(new java.awt.Dimension(280, 155));
51
        setLayout(null);
52
		/*javax.swing.border.Border border = javax.swing.BorderFactory.createCompoundBorder(
53
        	javax.swing. BorderFactory.createTitledBorder("Sistema de coordenadas"),
54
        	javax.swing.BorderFactory.createEmptyBorder(5,5,5,5)); */
55
        setBorder(javax.swing.BorderFactory.createCompoundBorder(
56
        	null, javax.swing.BorderFactory.createTitledBorder(
57
        	null, "Sistema de Referencia", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)));
58
        
59
        jLabel = new JLabel();
60
        jLabel.setBounds(15, 15, 77, 23);
61
        jLabel.setText("Datum :");
62
        add(jLabel, null);
63
        add(getDatumComboBox(), null);
64

  
65
        jLabel1 = new JLabel();
66
        jLabel1.setBounds(15, 60, 77, 23);
67
        jLabel1.setText("Proyecci?n :");
68
        add(jLabel1, null);
69
        add(getProjComboBox(), null);
70

  
71
        jLabel2 = new JLabel();
72
        jLabel2.setBounds(15, 105, 77, 23);
73
        jLabel2.setText("Huso :");
74
        add(jLabel2, null);
75
        add(getHuseComboBox(), null);
76
        
77
        setHuseComboBoxEnabled(false);
78
	}
79
	
80
	public void setModel(CSSelectionModel model) {
81
		this.model = model;
82
		
83
		getHuseComboBox().loadData(model.getHuseList());
84
		getDatumComboBox().loadData(model.getDatumList());
85
		getProjComboBox().loadData(model.getProjectionList());
86
	}
87
	
88
	private void setHuseComboBoxEnabled(boolean enabled) {
89
		if (jLabel2 != null)
90
			jLabel2.setEnabled(enabled);
91
        getHuseComboBox().setEnabled(enabled);
92
	}
93
	
94
	private void setDatumComboBoxEnabled(boolean enabled) {
95
		if (jLabel != null)
96
			jLabel.setEnabled(enabled);
97
        getDatumComboBox().setEnabled(enabled);
98
	}
99
	
100
	public void setProjection(IProjection proj) {
101
		model.setProjection(proj);
102
		if (model.getSelectedDatum() >= 0) {
103
			setDatumComboBoxEnabled(true);
104
			getDatumComboBox().setSelectedIndex(model.getSelectedDatum());
105
		} else {
106
			setDatumComboBoxEnabled(false);
107
			getDatumComboBox().setSelectedIndex(0);
108
		}
109
		getProjComboBox().setSelectedIndex(model.getSelectedProj());
110
		if (model.getSelectedHuse() >= 0) {
111
			setHuseComboBoxEnabled(true);
112
			getHuseComboBox().setSelectedIndex(model.getSelectedHuse());
113
		} else {
114
			setHuseComboBoxEnabled(false);
115
			getHuseComboBox().setSelectedIndex(0);
116
		}
117
	}
118
	
119
	
120
	/**
121
	 * Inicializa datumComboBox	
122
	 * 	
123
	 * @return javax.swing.JComboBox	
124
	 */    
125
	private LoadableComboBox getDatumComboBox() {
126
		if (datumComboBox == null) {
127
			datumComboBox = new LoadableComboBox();
128
			datumComboBox.setBounds(14, 35, 250, 23);
129
//			((LoadableComboBox) datumComboBox).loadData(model.getDatumList());
130
			datumComboBox.addItemListener(new java.awt.event.ItemListener() { 
131
				public void itemStateChanged(java.awt.event.ItemEvent e) {    
132
					model.setSelectedDatum(e.getItem());
133
				}
134
			});
135
		}
136
		return datumComboBox;
137
	}
138
	
139
	/**
140
	 * Inicializa projComboBox	
141
	 * 	
142
	 * @return javax.swing.JComboBox	
143
	 */    
144
	private LoadableComboBox getProjComboBox() {
145
		if (projComboBox == null) {
146
			projComboBox = new LoadableComboBox();
147
			projComboBox.setBounds(14, 80, 250, 23);
148
			projComboBox.addItemListener(new java.awt.event.ItemListener() { 
149
				public void itemStateChanged(java.awt.event.ItemEvent e) {    
150
					model.setSelectedProj(e.getItem());
151
					if (model.getSelectedProjType() == model.TRANSVERSAL)
152
						setHuseComboBoxEnabled(true);
153
					else
154
						setHuseComboBoxEnabled(false);
155
					if (model.getSelectedProjType() == model.NONE)
156
						setDatumComboBoxEnabled(false);
157
					else
158
						setDatumComboBoxEnabled(true);
159
				}
160
			});
161
		}
162
		return projComboBox;
163
	}
164

  
165
	/**
166
	 * Inicializa usoComboBox	
167
	 * 	
168
	 * @return javax.swing.JComboBox	
169
	 */    
170
	private LoadableComboBox getHuseComboBox() {
171
		if (huseComboBox == null) {
172
			huseComboBox = new LoadableComboBox();
173
			huseComboBox.setBounds(14, 125, 250, 23);
174
			huseComboBox.addItemListener(new java.awt.event.ItemListener() { 
175
				public void itemStateChanged(java.awt.event.ItemEvent e) {    
176
					model.setSelectedHuse(e.getItem());
177
				}
178
			});
179
		}
180
		return huseComboBox;
181
	}
182
	/**
183
	 * @return
184
	 */
185
	public IProjection getProjection() {
186
		return model.getProjection();
187
	}
188
}
0 189

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src/org/cresques/ui/cts/CSSelectionModel.java
1
/*
2
 * Created on 24-ene-2005
3
 */
4
package org.cresques.ui.cts;
5

  
6
import org.cresques.cts.IProjection;
7
import org.cresques.cts.ProjectionPool;
8

  
9
/**
10
 * @author Luis W. Sevilla (sevilla_lui@gva.es)
11
 */
12
public class CSSelectionModel {
13
	public static int NONE	= 0x01;
14
	public static int GEODETIC	= 0x02;
15
	public static int TRANSVERSAL = 0x03; 
16

  
17
	public String [] datumList = {
18
			"WGS 84", "European 1950", "Datum 73",
19
			"North American Datum 1927",
20
			"North American Datum 1983"/*,
21
			"Nouvelle Triangulation Francaise",
22
			*/}; 
23
	private String [] projList = {
24
			"Geodesica", "(UTM) Universal Transversal Mercator",
25
			"Datum 73 / Modified Portuguese Grid", "WGS 84 / LCC Canada",
26
			"NAD83 / NRCan LCC Canada"};
27
	private int [] projType = {GEODETIC, TRANSVERSAL, NONE, NONE, NONE};
28
	private String [] huseList = {};
29
	private int selectedDatum = 0, selectedProj = 0, selectedHuse = 0;
30
	/**
31
	 * 
32
	 */
33
	public CSSelectionModel() {
34
		super();
35
		huseList = new String[60];
36
		for (int i=1; i<=60; i++)
37
			huseList[i-1] = "Huso "+Integer.toString(i);
38
		
39
	}
40
	
41
	public String [] getDatumList() { return datumList; }
42

  
43
	public String [] getProjectionList() { return projList; }
44

  
45
	public String [] getHuseList() { return huseList; }
46
	
47
	public void setSelectedDatum(int opNr) { selectedDatum = opNr; }
48
	public void setSelectedDatum(Object item) {
49
		String [] list = datumList;
50
		for (int i=0; i<list.length; i++)
51
			if (list[i].compareTo((String) item) == 0)
52
				selectedDatum = i;
53
	}
54
	public int getSelectedDatum() { return selectedDatum; }
55

  
56
	public void setSelectedProj(int opNr) { selectedProj = opNr; }
57
	public void setSelectedProj(Object item) {
58
		String [] list = projList;
59
		for (int i=0; i<list.length; i++)
60
			if (list[i].compareTo((String) item) == 0)
61
				selectedProj = i;
62
	}
63
	public int getSelectedProj() { return selectedProj; }
64
	public int getSelectedProjType() { return projType[selectedProj]; }
65

  
66
	public void setSelectedHuse(int opNr) { selectedHuse = opNr; }
67
	public void setSelectedHuse(Object item) {
68
		String [] list = huseList;
69
		for (int i=0; i<list.length; i++)
70
			if (list[i].compareTo((String) item) == 0)
71
				selectedHuse = i;
72
	}
73
	public int getSelectedHuse() { return selectedHuse; }
74
	
75
	public void setProjection(IProjection proj) {
76
		String key = proj.getAbrev();
77
		key = key.substring(key.length()-5);
78
		if (key.endsWith(":4326")) {
79
			setSelectedDatum(0);
80
			setSelectedProj(0);
81
			setSelectedHuse(-1);
82
		} else if (key.endsWith(":4230")) {
83
			setSelectedDatum(1);
84
			setSelectedProj(0);
85
			setSelectedHuse(-1);
86
		} else if (key.endsWith(":4267")) {
87
			setSelectedDatum(2);
88
			setSelectedProj(0);
89
			setSelectedHuse(-1);
90
		} else if (key.endsWith(":4269")) {
91
			setSelectedDatum(3);
92
			setSelectedProj(0);
93
			setSelectedHuse(-1);
94
		} else if (key.startsWith("326")) {
95
			setSelectedDatum(0);
96
			setSelectedProj(1);
97
			setSelectedHuse(Integer.parseInt(key.substring(3))-1);
98
		} else if (key.startsWith("230")) {
99
			setSelectedDatum(1);
100
			setSelectedProj(1);
101
			setSelectedHuse(Integer.parseInt(key.substring(3))-1);
102
		} else if (key.startsWith("267")) {
103
			setSelectedDatum(2);
104
			setSelectedProj(1);
105
			setSelectedHuse(Integer.parseInt(key.substring(3))-1);
106
		} else if (key.startsWith("269")) {
107
			setSelectedDatum(3);
108
			setSelectedProj(1);
109
			setSelectedHuse(Integer.parseInt(key.substring(3))-1);
110
		} else if (key.startsWith("27492")) { // Datum 73 / Modified Portuguese Grid
111
			setSelectedDatum(-1);
112
			setSelectedProj(2);
113
			setSelectedHuse(-1);
114
		} else if (key.startsWith("42101")) { // WGS 84 / LCC Canada
115
			setSelectedDatum(-1);
116
			setSelectedProj(3);
117
			setSelectedHuse(-1);
118
		} else if (key.startsWith("42304")) { // NAD83 /  / LCC Canada
119
			setSelectedDatum(-1);
120
			setSelectedProj(4);
121
			setSelectedHuse(-1);
122
		} else
123
			System.err.println("CAGADA EN EL PARSING DE LA PROYECCION: "+key);
124
	}
125
	
126
	public IProjection getProjection() {
127
		if (selectedProj == 2) {
128
			return ProjectionPool.get("EPSG:27492");
129
		} else if (selectedProj == 3) {
130
			return ProjectionPool.get("EPSG:42101");
131
		} else if (selectedProj == 4) {
132
			return ProjectionPool.get("EPSG:42304");
133
		} 
134
		IProjection proj = null;
135
		String datum= "326";
136
		if (selectedDatum == 0)
137
			datum = "326";
138
		else if (selectedDatum == 1)
139
			datum = "230";
140
		else if (selectedDatum == 2)
141
			datum = "267";
142
		else if (selectedDatum == 3)
143
			datum = "269";
144
		if (selectedProj == 0) {
145
			return ProjectionPool.get("EPSG:4"+datum);
146
		} else if (selectedProj == 1) {
147
			String huse = Integer.toString(selectedHuse+1);
148
			if (selectedHuse < 9) huse = "0"+huse;
149
			if (selectedDatum == 2 || selectedDatum == 3) {
150
				if (selectedHuse < 3) huse = "03";
151
				if (selectedHuse > 23) huse = "23";
152
			}
153
			return ProjectionPool.get("EPSG:"+datum+huse);
154
		}
155
		return proj;
156
	}
157
	
158
}
0 159

  
branches/CqCMSGisPlanet/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

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

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

  
0 66

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src/org/cresques/ui/LoadableComboBox.java
1
/*
2
 * Creado el 04-sep-2004
3
 */
4
package org.cresques.ui;
5

  
6
import java.awt.event.ItemEvent;
7

  
8
import javax.swing.JComboBox;
9

  
10
/**
11
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
12
 */
13
public class LoadableComboBox extends JComboBox {
14
	public LoadableComboBox() {
15
		super();
16
		initialize();
17
//		addItemListener(this);
18
//		setSize(new java.awt.Dimension(185, 23));
19
	}
20
	
21
	/**
22
	 * This method initializes this
23
	 * 
24
	 * @return void
25
	 */
26
	private void initialize() {
27
        this.setPreferredSize(new java.awt.Dimension(185,23));
28
			
29
	}
30
	public void loadData(String data[]) {
31
		if (data == null) return;
32
		for (int i=0; i<data.length; i++)
33
			addItem(data[i]);
34
	}
35

  
36
/*	public void itemStateChanged(ItemEvent e) {
37
	    if (e.getStateChange() == ItemEvent.SELECTED) {
38
	        //label.setVisible(true);
39
	    } else {
40
	        //label.setVisible(false);
41
	    }
42
	}*/
43
}
44

  
0 45

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src/org/cresques/ui/.cvsignore
1
*.dfPackage
2
*.wmf
0 3

  
branches/CqCMSGisPlanet/libraries/libCq CMS for java.old/src/org/cresques/ui/package.html
1
<html>
2
	<body>User Interface: Clases para interface de usuario.
3
</body>
4
</html>
0 5

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

  
3
import javax.swing.JPanel;
4
import java.awt.BorderLayout;
5
import javax.swing.JLabel;
6
import java.awt.FlowLayout;
7

  
8
import javax.swing.JScrollPane;
9
import javax.swing.JTextField;
10
import javax.swing.JComboBox;
11
import javax.swing.DefaultComboBoxModel;
12
import javax.swing.plaf.basic.BasicComboBoxEditor;
13
import java.lang.String;
14
import javax.swing.JButton;
15
/*
16
 * Created on 04-mar-2005
17
 *
18
 */
19

  
20
/**
21
 * @author Nacho Brodin <brodin_ign@gva.es>
22
 *
23
 */
24
public class DataInputSaveRaster extends JPanel{
25

  
26
	private JPanel jPanel = null;
27
	private JPanel coordenadas = null;
28
	private JPanel psup_izq = null;
29
	private JPanel pinf_der = null;
30
	private JLabel lsup_izq = null;
31
	private JTextField tsup_izqX = null;
32
	private JTextField tsup_izqY = null;
33
	private JLabel linf_der = null;
34
	private JLabel y = null;
35
	private JTextField tinf_derX = null;
36
	private JTextField tinf_derY = null;
37
	private JPanel datosImagen = null;
38
	private JPanel datosFichero = null;
39
	private JPanel pescalaRes = null;
40
	private JPanel pnombre = null;
41
	private JLabel lescala = null;
42
	private JTextField tescala = null;
43
	private JLabel lfile = null;
44
	private JLabel lresolucion = null;
45
	private JLabel lppp = null;
46
	private DefaultComboBoxModel defaultComboBoxModel = null;   
47
	private BasicComboBoxEditor basicComboBoxEditor = null;   
48
	private String string = null;  
49
	private JComboBox jComboBox = null;
50
	private JButton bseleccion = null;
51
	private JPanel panchoAlto = null;
52
	private JLabel lancho = null;
53
	private JLabel jLabel2 = null;
54
	private JTextField tancho = null;
55
	private JTextField talto = null;
56
	private JButton bpropiedades = null;
57
	
58
	
59
	public DataInputSaveRaster() {
60
		super();
61
		initialize();
62
	}
63
	
64
	private  void initialize() {
65
		this.setLayout(new BorderLayout());
66
		this.setSize(350, 208); //AnchoxAlto panel interior
67
		this.add(getJPanel(), java.awt.BorderLayout.CENTER);
68
	}
69
	
70

  
71
	/**
72
	 * This method initializes jPanel	
73
	 * 	
74
	 * @return javax.swing.JPanel	
75
	 */    
76
	private JPanel getJPanel() {
77
		if (jPanel == null) {
78
			jPanel = new JPanel();
79
			jPanel.setLayout(new BorderLayout());
80
			jPanel.add(getCoordenadas(), java.awt.BorderLayout.NORTH);
81
			jPanel.add(getDatosImagen(), java.awt.BorderLayout.CENTER);
82
			jPanel.add(getDatosFichero(), java.awt.BorderLayout.SOUTH);
83
		}
84
		return jPanel;
85
	}
86
	/**
87
	 * This method initializes jPanel1	
88
	 * 	
89
	 * @return javax.swing.JPanel	
90
	 */    
91
	private JPanel getCoordenadas() {
92
		if (coordenadas == null) {
93
			coordenadas = new JPanel();
94
			coordenadas.setLayout(new BorderLayout());
95
			coordenadas.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,0,0,0));
96
			coordenadas.add(getPsup_izq(), java.awt.BorderLayout.NORTH);
97
			coordenadas.add(getPinf_der(), java.awt.BorderLayout.SOUTH);
98
		}
99
		return coordenadas;
100
	}
101
	/**
102
	 * This method initializes jPanel2	
103
	 * 	
104
	 * @return javax.swing.JPanel	
105
	 */    
106
	private JPanel getPsup_izq() {
107
		if (psup_izq == null) {
108
			lsup_izq = new JLabel();
109
			y = new JLabel();
110
			psup_izq = new JPanel();
111
			FlowLayout flowLayout1 = new FlowLayout();
112
			psup_izq.setLayout(flowLayout1);
113
			lsup_izq.setText("Sup. izq. X:");
114
			y.setText(" Y:");
115
			flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
116
			flowLayout1.setHgap(5);
117
			psup_izq.setAlignmentY(0.5F);
118
			psup_izq.add(lsup_izq, null);
119
			psup_izq.add(getTsup_izqX(), null);
120
			psup_izq.add(y,null);
121
			psup_izq.add(getTsup_izqY(), null);
122
		}
123
		return psup_izq;
124
	}
125
	/**
126
	 * This method initializes jPanel3	
127
	 * 	
128
	 * @return javax.swing.JPanel	
129
	 */    
130
	private JPanel getPinf_der() {
131
		if (pinf_der == null) {
132
			linf_der = new JLabel();
133
			pinf_der = new JPanel();
134
			y = new JLabel();
135
			FlowLayout flowLayout2 = new FlowLayout();
136
			pinf_der.setLayout(flowLayout2);
137
			y.setText(" Y:");
138
			linf_der.setText("Inf. der.  X:");
139
			flowLayout2.setAlignment(java.awt.FlowLayout.LEFT);
140
			pinf_der.add(linf_der, null);
141
			pinf_der.add(getTinf_derX(), null);
142
			pinf_der.add(y,null);
143
			pinf_der.add(getTinf_derY(), null);
144
		}
145
		return pinf_der;
146
	}
147
	/**
148
	 * This method initializes jTextField	
149
	 * 	
150
	 * @return javax.swing.JTextField	
151
	 */    
152
	public JTextField getTsup_izqX() {
153
		if (tsup_izqX == null) {
154
			tsup_izqX = new JTextField();
155
			tsup_izqX.setPreferredSize(new java.awt.Dimension(110,19));
156
			tsup_izqX.setText("0");
157
			tsup_izqX.setMinimumSize(new java.awt.Dimension(110,19));
158
		}
159
		return tsup_izqX;
160
	}
161
	/**
162
	 * This method initializes jTextField	
163
	 * 	
164
	 * @return javax.swing.JTextField	
165
	 */    
166
	public JTextField getTsup_izqY() {
167
		if (tsup_izqY == null) {
168
			tsup_izqY = new JTextField();
169
			tsup_izqY.setMinimumSize(new java.awt.Dimension(110,19));
170
			tsup_izqY.setPreferredSize(new java.awt.Dimension(110,19));
171
			tsup_izqY.setText("0");
172
		}
173
		return tsup_izqY;
174
	}
175
	/**
176
	 * This method initializes jTextField	
177
	 * 	
178
	 * @return javax.swing.JTextField	
179
	 */    
180
	public JTextField getTinf_derX() {
181
		if (tinf_derX == null) {
182
			tinf_derX = new JTextField();
183
			tinf_derX.setMinimumSize(new java.awt.Dimension(110,19));
184
			tinf_derX.setPreferredSize(new java.awt.Dimension(110,19));
185
			tinf_derX.setText("0");
186
		}
187
		return tinf_derX;
188
	}
189
	/**
190
	 * This method initializes jTextField1	
191
	 * 	
192
	 * @return javax.swing.JTextField	
193
	 */    
194
	public JTextField getTinf_derY() {
195
		if (tinf_derY == null) {
196
			tinf_derY = new JTextField();
197
			tinf_derY.setMinimumSize(new java.awt.Dimension(110,19));
198
			tinf_derY.setPreferredSize(new java.awt.Dimension(110,19));
199
			tinf_derY.setText("0");
200
		}
201
		return tinf_derY;
202
	}
203
	/**
204
	 * This method initializes jPanel1	
205
	 * 	
206
	 * @return javax.swing.JPanel	
207
	 */    
208
	private JPanel getDatosImagen() {
209
		if (datosImagen == null) {
210
			BorderLayout borderLayout1 = new BorderLayout();
211
			datosImagen = new JPanel();
212
			datosImagen.setLayout(borderLayout1);
213
			datosImagen.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.gray,1));
214
			datosImagen.setAlignmentY(0.5F);
215
			borderLayout1.setHgap(0);
216
			borderLayout1.setVgap(0);
217
			datosImagen.add(getPescalaRes(), java.awt.BorderLayout.NORTH);
218
			datosImagen.add(getPanchoAlto(), java.awt.BorderLayout.SOUTH);
219
		}
220
		return datosImagen;
221
	}
222
	/**
223
	 * This method initializes jPanel2	
224
	 * 	
225
	 * @return javax.swing.JPanel	
226
	 */    
227
	private JPanel getDatosFichero() {
228
		if (datosFichero == null) {
229
			datosFichero = new JPanel();
230
			datosFichero.setLayout(new BorderLayout());
231
			datosFichero.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
232
			datosFichero.setBorder(javax.swing.BorderFactory.createEmptyBorder(0,0,0,0));
233
			datosFichero.add(getPnombre(), java.awt.BorderLayout.CENTER);
234
		}
235
		return datosFichero;
236
	}
237
	/**
238
	 * This method initializes jPanel1	
239
	 * 	
240
	 * @return javax.swing.JPanel	
241
	 */    
242
	private JPanel getPescalaRes() {
243
		if (pescalaRes == null) {
244
			lescala = new JLabel();
245
			lresolucion = new JLabel();
246
			lppp = new JLabel();
247
			FlowLayout flowLayout3 = new FlowLayout();
248
			pescalaRes = new JPanel();
249
			pescalaRes.setLayout(flowLayout3);
250
			lescala.setText("Escala  1:");
251
			lresolucion.setText("Resoluci?n");
252
			lppp.setText("ppp");
253
			lresolucion.setName("");
254
			flowLayout3.setAlignment(java.awt.FlowLayout.LEFT);
255
			flowLayout3.setVgap(20);
256
			pescalaRes.add(lescala, null);
257
			pescalaRes.add(getTescala(), null);
258
			pescalaRes.add(lresolucion, null);
259
			pescalaRes.add(getJComboBox(), null);
260
			pescalaRes.add(lppp, null);
261
		}
262
		return pescalaRes;
263
	}
264
	/**
265
	 * This method initializes jPanel3	
266
	 * 	
267
	 * @return javax.swing.JPanel	
268
	 */    
269
	private JPanel getPnombre() {
270
		if (pnombre == null) {
271
			lfile = new JLabel();
272
			pnombre = new JPanel();
273
			FlowLayout flowLayout4 = new FlowLayout();
274
			pnombre.setLayout(flowLayout4);
275
			lfile.setText("Fichero");
276
			flowLayout4.setAlignment(java.awt.FlowLayout.LEFT);
277
			pnombre.add(lfile, null);
278
			pnombre.add(getBseleccion(), null);
279
			pnombre.add(this.getBPropiedades(), null);
280
			this.getBPropiedades().setText("Propiedades GeoTiff");
281
		}
282
		return pnombre;
283
	}
284
	/**
285
	 * This method initializes jTextField	
286
	 * 	
287
	 * @return javax.swing.JTextField	
288
	 */    
289
	public JTextField getTescala() {
290
		if (tescala == null) {
291
			tescala = new JTextField();
292
			tescala.setMinimumSize(new java.awt.Dimension(70,19));
293
			tescala.setPreferredSize(new java.awt.Dimension(80,19));
294
			tescala.setText("0");
295
		}
296
		return tescala;
297
	}
298
	
299
	private Object makeObj(final String item)  {
300
	     return new Object() { public String toString() { return item; } };
301
	   }
302
	 
303
	/**
304
	 * This method initializes defaultComboBoxModel	
305
	 * 	
306
	 * @return javax.swing.DefaultComboBoxModel	
307
	 */    
308
	private DefaultComboBoxModel getDefaultComboBoxModel() {
309
		if (defaultComboBoxModel == null) {
310
			defaultComboBoxModel = new DefaultComboBoxModel();
311
		}
312
		return defaultComboBoxModel;
313
	}
314
	/**
315
	 * This method initializes basicComboBoxEditor	
316
	 * 	
317
	 * @return javax.swing.plaf.basic.BasicComboBoxEditor	
318
	 */    
319
	private BasicComboBoxEditor getBasicComboBoxEditor() {
320
		if (basicComboBoxEditor == null) {
321
			basicComboBoxEditor = new BasicComboBoxEditor();
322
			basicComboBoxEditor.setItem(getString());
323
		}
324
		return basicComboBoxEditor;
325
	}
326
	/**
327
	 * This method initializes string	
328
	 * 	
329
	 * @return java.lang.String	
330
	 */    
331
	private String getString() {
332
		if (string == null) {
333
			string = new String();
334
		}
335
		return string;
336
	}
337
	/**
338
	 * This method initializes jComboBox	
339
	 * 	
340
	 * @return javax.swing.JComboBox	
341
	 */    
342
	public JComboBox getJComboBox() {
343
		if (jComboBox == null) {
344
			String[] lista={"75","150","300"};
345
			jComboBox = new JComboBox(lista);
346
			jComboBox.setPreferredSize(new java.awt.Dimension(70,24));
347
		}
348
		return jComboBox;
349
	}
350
	
351
	/**
352
	 * This method initializes jComboBox	
353
	 * 	
354
	 * @return javax.swing.JComboBox	 
355
	 */    
356
	public JButton getBPropiedades() {
357
		if (bpropiedades == null) {
358
			bpropiedades = new JButton();
359
		}
360
		return bpropiedades;
361
	}
362
	
363
	/**
364
	 * This method initializes jButton	
365
	 * 	
366
	 * @return javax.swing.JButton	
367
	 */    
368
	public JButton getBseleccion() {
369
		if (bseleccion == null) {
370
			bseleccion = new JButton();
371
			bseleccion.setText("Seleccionar");
372
		}
373
		return bseleccion;
374
	}
375
	/**
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff