Revision 38317

View differences:

tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/buildNumber.properties
1
#maven.buildNumber.plugin properties file
2
#Tue May 29 16:37:40 CEST 2012
3
buildNumber=2047
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/AllTests.java
1
package org.gvsig.app;
2

  
3
import junit.framework.Test;
4
import junit.framework.TestSuite;
5

  
6
import org.gvsig.app.gui.filter.TestFilterExpressionFromWhereIsEmpty_Method;
7
import org.gvsig.app.panelGroup.Test2ExceptionsUsingTabbedPanel;
8
import org.gvsig.app.panelGroup.Test2ExceptionsUsingTreePanel;
9
import org.gvsig.app.panelGroup.TestPanelGroupLoaderFromExtensionPoint;
10
import org.gvsig.app.project.ProjectTest;
11
import org.gvsig.app.sqlQueryValidation.TestSQLQueryValidation;
12
import org.gvsig.app.test.Persistence;
13

  
14
public class AllTests {
15

  
16
	public static Test suite() {
17
		TestSuite suite = new TestSuite("Test for org.gvsig.app");
18
		//$JUnit-BEGIN$
19
		suite.addTestSuite(Persistence.class);
20
		suite.addTestSuite(ProjectTest.class);
21
		suite.addTestSuite(TestFilterExpressionFromWhereIsEmpty_Method.class);
22
		suite.addTestSuite(TestSQLQueryValidation.class);
23
		suite.addTestSuite(TestPanelGroupLoaderFromExtensionPoint.class);
24
		suite.addTestSuite(Test2ExceptionsUsingTabbedPanel.class);
25
		suite.addTestSuite(Test2ExceptionsUsingTreePanel.class);
26
		
27
		//$JUnit-END$
28
		return suite;
29
	}
30

  
31
}
0 32

  
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/Test2TabbedPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup;
21

  
22
import javax.swing.JFrame;
23

  
24
import org.gvsig.gui.beans.panelGroup.PanelGroupManager;
25
import org.gvsig.gui.beans.panelGroup.tabbedPanel.TabbedPanel;
26
import org.gvsig.tools.exception.BaseException;
27

  
28
import org.gvsig.app.panelGroup.loaders.PanelGroupLoaderFromExtensionPoint;
29
import org.gvsig.app.panelGroup.samples.Samples_ExtensionPointsOfIPanels;
30

  
31
/**
32
 * <p>Tests the creation of a {@link TabbedPanel TabbedPanel} object using {@link PanelGroupLoaderFromExtensionPoint PanelGroupLoaderFromExtensionPoint} .</p>
33
 * 
34
 * @version 16/10/2007
35
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
36
 */
37
public class Test2TabbedPanel {
38
	/**
39
	 * <p>Test method for the Test2TabbedPanel.</p>
40
	 * 
41
	 * @param args optional arguments
42
	 */
43
	public static void main(String[] args) {
44
		try {
45
			Samples_ExtensionPointsOfIPanels.loadSample();
46
			
47
			PanelGroupManager manager = PanelGroupManager.getManager();
48
			manager.registerPanelGroup(TabbedPanel.class);
49
			manager.setDefaultType(TabbedPanel.class);
50

  
51
			TabbedPanel panelGroup = (TabbedPanel) manager.getPanelGroup(Samples_ExtensionPointsOfIPanels.REFERENCE2);
52
			PanelGroupLoaderFromExtensionPoint loader = new PanelGroupLoaderFromExtensionPoint(Samples_ExtensionPointsOfIPanels.EXTENSIONPOINT2_NAME);
53

  
54
			// Begin: Test the normal load
55
			panelGroup.loadPanels(loader);
56
			// End: Test the normal load
57

  
58
			// Objects creation
59
			JFrame jFrame = new JFrame();
60
			jFrame.setTitle("Test TabbedPanel using PanelGroupLoaderFromExtensionPoint");
61
		    jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
62
		    jFrame.setSize(panelGroup.getPreferredSize());
63
		    jFrame.getContentPane().add(panelGroup);
64
		    
65
			jFrame.setVisible(true);
66
			
67
		} catch (BaseException bE) {
68
			System.out.println(bE.getLocalizedMessageStack());
69
		} catch (Exception e) {
70
			e.printStackTrace();
71
		}
72
	}
73
}
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/samples/SampleInvisiblePanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup.samples;
21

  
22
import java.awt.Color;
23
import java.awt.Dimension;
24
import java.io.Serializable;
25

  
26
import javax.swing.JScrollPane;
27
import javax.swing.JTextArea;
28

  
29
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
30

  
31
/**
32
 * <p>Sample of {@link AbstractPanel AbstractPanel}.</p>
33
 * 
34
 * @version 10/12/2007
35
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
36
 */
37
public class SampleInvisiblePanel extends AbstractPanel implements Serializable {
38
	private static final long serialVersionUID = -1629511810619122126L;
39

  
40
	/**
41
	 * <p>Element for the interface.</p>
42
	 */
43
	private JTextArea jTextArea = null;
44
	
45
	/**
46
	 * @see AbstractPanel#AbstractPanel()
47
	 */
48
	public SampleInvisiblePanel() {
49
		super();
50
		initialize();
51
	}
52
	
53
	/**
54
	 * @see AbstractPanel#AbstractPanel(String, String, String)
55
	 */
56
	public SampleInvisiblePanel(String id, String label, String labelGroup) {
57
		super(id, label, labelGroup);
58
		initialize();
59
	}
60
	
61
	@Override
62
	protected void initialize() {
63
		add(new JScrollPane(getJTextArea()));
64
		setToolTipText(getID());
65
		
66
		setID(Samples_ExtensionPointsOfIPanels.PANELS1_IDS[0]);
67
		setLabel(Samples_ExtensionPointsOfIPanels.PANELS1_LABELS[0]);
68
		setLabelGroup(Samples_ExtensionPointsOfIPanels.PANELS1_LABELGROUPS[0]);
69
		setPreferredSize(new Dimension(Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_WIDTH, Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_HEIGHT));
70
		resetChangedStatus();
71
		setVisible(false);
72
	}
73
	
74
	/**
75
	 * This method initializes jTextArea
76
	 *
77
	 * @return JTextArea
78
	 */
79
	private JTextArea getJTextArea() {
80
		if (jTextArea == null) {
81
			jTextArea = new JTextArea(5, 40);
82
			jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
83
			jTextArea.setEditable(false);
84
			jTextArea.setBackground(Color.RED);
85
		}
86

  
87
		return jTextArea;
88
	}
89
	
90
	@Override
91
	public void setID(String id) {
92
		super.setID(id);
93
		
94
		setToolTipText(getID());
95
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
96
		hasChanged = true;
97
	}
98

  
99
	@Override
100
	public void setLabel(String label) {
101
		super.setLabel(label);
102
		
103
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
104
		hasChanged = true;
105
	}
106

  
107
	@Override
108
	public void setLabelGroup(String labelGroup) {
109
		super.setLabelGroup(labelGroup);
110
		
111
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
112
		hasChanged = true;
113
	}
114

  
115
	/*
116
	 * (non-Javadoc)
117
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#accept()
118
	 */
119
	public void accept() {
120
		System.out.println("I'm the IPanel: " + toString() + "\n and I'm executing an 'accept' method.");
121
	}
122

  
123
	/*
124
	 * (non-Javadoc)
125
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#apply()
126
	 */
127
	public void apply() {
128
		System.out.println("I'm the IPanel: " + toString() + "\n and I'm executing an 'apply' method.");
129
	}
130

  
131
	/*
132
	 * (non-Javadoc)
133
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#cancel()
134
	 */
135
	public void cancel() {
136
		System.out.println("I'm the IPanel: " + toString() + "\n and I'm executing a 'cancel' method.");
137
	}
138

  
139
	/*
140
	 * (non-Javadoc)
141
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#selected()
142
	 */
143
	public void selected() {
144
		System.out.println("I'm the IPanel: " + toString() + "\n and I've been selected. My information is: " +
145
				 "\n\tID: " + getID() + "\n\tLABEL_GROUP: " + getLabelGroup() + "\n\tLABEL: " + getLabel() + "\n\tCLASS: " + getClass() +
146
				 "\n\tMy Preferred Size: " + getPreferredSize() + "\n\tAnd My size: " + getSize());
147
	}
148
}
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/samples/SampleBandSetupPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup.samples;
21

  
22
import java.awt.Color;
23
import java.awt.Dimension;
24
import java.awt.event.MouseAdapter;
25
import java.awt.event.MouseEvent;
26
import java.io.Serializable;
27

  
28
import javax.swing.JScrollPane;
29
import javax.swing.JTextArea;
30

  
31
import org.gvsig.gui.beans.panelGroup.AbstractPanelGroup;
32
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
33

  
34
/**
35
 * <p>Sample of {@link AbstractPanel AbstractPanel}.</p>
36
 * 
37
 * @version 16/10/2007
38
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
39
 */
40
public class SampleBandSetupPanel extends AbstractPanel implements Serializable {
41
	private static final long serialVersionUID = 40652963597544670L;
42

  
43
	/**
44
	 * <p>Element for the interface.</p>
45
	 */
46
	private JTextArea jTextArea = null;
47

  
48
	/**
49
	 * @see AbstractPanel#AbstractPanel()
50
	 */
51
	public SampleBandSetupPanel() {
52
		super();
53
		initialize();
54
	}
55

  
56
	/**
57
	 * @see AbstractPanel#AbstractPanel(String, String, String)
58
	 */
59
	public SampleBandSetupPanel(String id, String label, String labelGroup) {
60
		super(id, label, labelGroup);
61
		initialize();
62
	}
63

  
64
	@Override
65
	protected void initialize() {
66
		add(new JScrollPane(getJTextArea()));
67
		setToolTipText(getID());
68
		
69
		setID(Samples_ExtensionPointsOfIPanels.PANELS1_IDS[1]);
70
		setLabel(Samples_ExtensionPointsOfIPanels.PANELS1_LABELS[1]);
71
		setLabelGroup(Samples_ExtensionPointsOfIPanels.PANELS1_LABELGROUPS[1]);
72
		setPreferredSize(new Dimension(Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_WIDTH, Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_HEIGHT));
73
		resetChangedStatus();
74
	}
75
	
76
	/**
77
	 * This method initializes jTextArea
78
	 *
79
	 * @return JTextArea
80
	 */
81
	private JTextArea getJTextArea() {
82
		if (jTextArea == null) {
83
			jTextArea = new JTextArea(5, 40);
84
			jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
85
			jTextArea.setEditable(false);
86
			jTextArea.setBackground(Color.GREEN);
87
			
88
			jTextArea.addMouseListener(new MouseAdapter() {
89
				
90
				public void mouseClicked(MouseEvent e) {
91
					if (getPanelGroup() != null) {
92
						getPanelGroup().setEnabledAcceptButton(! getPanelGroup().isEnabledAcceptButton());
93
						getPanelGroup().setEnabledApplyButton(! getPanelGroup().isEnabledApplyButton());
94
						getPanelGroup().setEnabledCancelButton(! getPanelGroup().isEnabledCancelButton());
95
					}	
96
				}
97
			});
98
		}
99

  
100
		return jTextArea;
101
	}
102

  
103
	@Override
104
	public void setID(String id) {
105
		super.setID(id);
106

  
107
		setToolTipText(getID());
108
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
109
	}
110

  
111
	@Override
112
	public void setLabel(String label) {
113
		super.setLabel(label);
114
		
115
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
116
	}
117

  
118
	@Override
119
	public void setLabelGroup(String labelGroup) {
120
		super.setLabelGroup(labelGroup);
121
		
122
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
123
	}
124

  
125
	public void accept() {
126
	}
127

  
128
	public void apply() {
129
	}
130

  
131
	public void cancel() {
132
	}
133

  
134
	public void selected() {
135
		System.out.println("I'm the IPanel: " + toString() + "\n and I've been selected. My information is: " +
136
				 "\n\tID: " + getID() + "\n\tLABEL_GROUP: " + getLabelGroup() + "\n\tLABEL: " + getLabel() + "\n\tCLASS: " + getClass() +
137
				 "\n\tMy Preferred Size: " + getPreferredSize() + "\n\tAnd My size: " + getSize());
138
	}
139

  
140
	public void setPanelGroup(AbstractPanelGroup panelGroup) {
141
		super.setPanelGroup(panelGroup);
142
	}
143
}
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/samples/SampleEnhancedPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup.samples;
21

  
22
import java.awt.Color;
23
import java.awt.Dimension;
24
import java.awt.event.MouseAdapter;
25
import java.awt.event.MouseEvent;
26
import java.io.Serializable;
27

  
28
import javax.swing.JScrollPane;
29
import javax.swing.JTextArea;
30

  
31
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
32

  
33
/**
34
 * <p>Sample of {@link AbstractPanel AbstractPanel}.</p>
35
 * 
36
 * @version 16/10/2007
37
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
38
 */
39
public class SampleEnhancedPanel extends AbstractPanel implements Serializable {
40
	private static final long serialVersionUID = -7469300452126449245L;
41

  
42
	/**
43
	 * <p>Element for the interface.</p>
44
	 */
45
	private JTextArea jTextArea = null;
46
	
47
	/**
48
	 * @see AbstractPanel#AbstractPanel()
49
	 */
50
	public SampleEnhancedPanel() {
51
		super();
52
		initialize();
53
	}
54
	
55
	/**
56
	 * @see AbstractPanel#AbstractPanel(String, String, String)
57
	 */
58
	public SampleEnhancedPanel(String id, String label, String labelGroup) {
59
		super(id, label, labelGroup);
60
		initialize();
61
	}
62
	
63
	@Override
64
	protected void initialize() {
65
		add(new JScrollPane(getJTextArea()));
66
		setToolTipText(getID());
67
		
68
		setID(Samples_ExtensionPointsOfIPanels.PANELS1_IDS[3]);
69
		setLabel(Samples_ExtensionPointsOfIPanels.PANELS1_LABELS[3]);
70
		setLabelGroup(Samples_ExtensionPointsOfIPanels.PANELS1_LABELGROUPS[3]);
71
		setPreferredSize(new Dimension(Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_WIDTH, Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_HEIGHT));
72
		resetChangedStatus();
73
	}
74
	
75
	/**
76
	 * This method initializes jTextArea
77
	 *
78
	 * @return JTextArea
79
	 */
80
	private JTextArea getJTextArea() {
81
		if (jTextArea == null) {
82
			jTextArea = new JTextArea(5, 40);
83
			jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
84
			jTextArea.setEditable(false);
85
			jTextArea.setBackground(Color.CYAN);
86
			jTextArea.addMouseListener(new MouseAdapter() {
87
				
88
				public void mouseClicked(MouseEvent e) {
89
					if (getPanelGroup() != null) {
90
						getPanelGroup().setEnabledCancelButton(! getPanelGroup().isEnabledCancelButton());
91
					}	
92
				}
93
			});
94
		}
95

  
96
		return jTextArea;
97
	}
98
	
99
	@Override
100
	public void setID(String id) {
101
		super.setID(id);
102

  
103
		setToolTipText(getID());
104
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
105
	}
106

  
107
	@Override
108
	public void setLabel(String label) {
109
		super.setLabel(label);
110
		
111
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
112
	}
113

  
114
	@Override
115
	public void setLabelGroup(String labelGroup) {
116
		super.setLabelGroup(labelGroup);
117
		
118
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
119
	}
120

  
121
	public void accept() {
122
	}
123

  
124

  
125
	public void apply() {
126
	}
127

  
128
	public void cancel() {
129
	}
130

  
131

  
132
	public void selected() {
133
		System.out.println("I'm the IPanel: " + toString() + "\n and I've been selected. My information is: " +
134
				 "\n\tID: " + getID() + "\n\tLABEL_GROUP: " + getLabelGroup() + "\n\tLABEL: " + getLabel() + "\n\tCLASS: " + getClass() +
135
				 "\n\tMy Preferred Size: " + getPreferredSize() + "\n\tAnd My size: " + getSize());
136
	}
137
}
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/samples/SamplePanelGroupLabelRepeated.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup.samples;
21

  
22
import java.awt.Color;
23
import java.awt.Dimension;
24
import java.io.Serializable;
25

  
26
import javax.swing.JScrollPane;
27
import javax.swing.JTextArea;
28

  
29
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
30

  
31
/**
32
 * <p>Sample of {@link AbstractPanel AbstractPanel}.</p>
33
 * 
34
 * @version 23/10/2007
35
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
36
 */
37
public class SamplePanelGroupLabelRepeated extends AbstractPanel implements Serializable {
38
	private static final long serialVersionUID = 1857806149242138609L;
39

  
40
	/**
41
	 * <p>Element for the interface.</p>
42
	 */
43
	private JTextArea jTextArea = null;
44

  
45
	/**
46
	 * @see AbstractPanel#AbstractPanel()
47
	 */
48
	public SamplePanelGroupLabelRepeated() {
49
		super();
50
		initialize();
51
	}
52

  
53
	/**
54
	 * @see AbstractPanel#AbstractPanel(String, String, String)
55
	 */
56
	public SamplePanelGroupLabelRepeated(String id, String label, String labelGroup) {
57
		super(id, label, labelGroup);
58
		initialize();
59
	}
60

  
61
	@Override
62
	protected void initialize() {
63
		add(new JScrollPane(getJTextArea()));
64
		setToolTipText(getID());
65

  
66
		setID(Samples_ExtensionPointsOfIPanels.PANELS3_IDS[1]);
67
		setLabel(Samples_ExtensionPointsOfIPanels.PANELS3_LABELS[1]);
68
		setLabelGroup(Samples_ExtensionPointsOfIPanels.PANELS3_LABELGROUPS[1]);
69
		setPreferredSize(new Dimension(Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_WIDTH, Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_HEIGHT));
70
		resetChangedStatus();
71
	}
72
	
73
	/**
74
	 * This method initializes jTextArea
75
	 *
76
	 * @return JTextArea
77
	 */
78
	private JTextArea getJTextArea() {
79
		if (jTextArea == null) {
80
			jTextArea = new JTextArea(5, 40);
81
			jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
82
			jTextArea.setEditable(false);
83
			jTextArea.setBackground(Color.GRAY);
84
		}
85

  
86
		return jTextArea;
87
	}
88

  
89
	@Override
90
	public void setID(String id) {
91
		super.setID(id);
92

  
93
		setToolTipText(getID());
94
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
95
	}
96

  
97
	@Override
98
	public void setLabel(String label) {
99
		super.setLabel(label);
100
		
101
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
102
	}
103

  
104
	@Override
105
	public void setLabelGroup(String labelGroup) {
106
		super.setLabelGroup(labelGroup);
107
		
108
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
109
	}
110

  
111
	public void accept() {
112
	}
113

  
114
	public void apply() {
115
	}
116

  
117
	public void cancel() {
118
	}
119

  
120
	public void selected() {
121
		System.out.println("I'm the IPanel: " + toString() + "\n and I've been selected. My information is: " +
122
				 "\n\tID: " + getID() + "\n\tLABEL_GROUP: " + getLabelGroup() + "\n\tLABEL: " + getLabel() + "\n\tCLASS: " + getClass() +
123
				 "\n\tMy Preferred Size: " + getPreferredSize() + "\n\tAnd My size: " + getSize());
124
	}
125
}
126

  
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/samples/SampleScalePanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup.samples;
21

  
22
import java.awt.Color;
23
import java.awt.Dimension;
24
import java.awt.event.MouseAdapter;
25
import java.awt.event.MouseEvent;
26
import java.io.Serializable;
27

  
28
import javax.swing.JScrollPane;
29
import javax.swing.JTextArea;
30

  
31
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
32

  
33
/**
34
 * <p>Sample of {@link AbstractPanel AbstractPanel}.</p>
35
 * 
36
 * @version 16/10/2007
37
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
38
 */
39
public class SampleScalePanel extends AbstractPanel implements Serializable {
40
	private static final long serialVersionUID = -4160464669737958732L;
41

  
42
	/**
43
	 * <p>Element for the interface.</p>
44
	 */
45
	private JTextArea jTextArea = null;
46
	
47
	/**
48
	 * @see AbstractPanel#AbstractPanel()
49
	 */
50
	public SampleScalePanel() {
51
		super();
52
		initialize();
53
	}
54
	
55
	/**
56
	 * @see AbstractPanel#AbstractPanel(String, String, String)
57
	 */
58
	public SampleScalePanel(String id, String label, String labelGroup) {
59
		super(id, label, labelGroup);
60
		initialize();
61
	}
62
	
63
	@Override
64
	protected void initialize() {
65
		add(new JScrollPane(getJTextArea()));
66
		setToolTipText(getID());
67
		
68
		setID(Samples_ExtensionPointsOfIPanels.PANELS1_IDS[5]);
69
		setLabel(Samples_ExtensionPointsOfIPanels.PANELS1_LABELS[5]);
70
		setLabelGroup(Samples_ExtensionPointsOfIPanels.PANELS1_LABELGROUPS[5]);
71
		setPreferredSize(new Dimension(Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_WIDTH, Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_HEIGHT));
72
		resetChangedStatus();
73
	}
74
	
75
	/**
76
	 * This method initializes jTextArea
77
	 *
78
	 * @return JTextArea
79
	 */
80
	private JTextArea getJTextArea() {
81
		if (jTextArea == null) {
82
			jTextArea = new JTextArea(5, 40);
83
			jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
84
			jTextArea.setEditable(false);
85
			jTextArea.setBackground(Color.YELLOW);
86
			jTextArea.addMouseListener(new MouseAdapter() {
87
				
88
				public void mouseClicked(MouseEvent e) {
89
					if (getPanelGroup() != null) {
90
						getPanelGroup().setEnabledApplyButton(! getPanelGroup().isEnabledApplyButton());
91
						getPanelGroup().setEnabledCancelButton(! getPanelGroup().isEnabledCancelButton());
92
					}	
93
				}
94
			});
95
		}
96

  
97
		return jTextArea;
98
	}
99
	
100
	@Override
101
	public void setID(String id) {
102
		super.setID(id);
103
		
104
		setToolTipText(getID());
105
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
106
	}
107

  
108
	@Override
109
	public void setLabel(String label) {
110
		super.setLabel(label);
111
		
112
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
113
	}
114

  
115
	@Override
116
	public void setLabelGroup(String labelGroup) {
117
		super.setLabelGroup(labelGroup);
118
		
119
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
120
	}
121

  
122
	public void accept() {
123
	}
124

  
125
	public void apply() {
126
	}
127

  
128
	public void cancel() {
129
	}
130

  
131
	public void selected() {
132
		System.out.println("I'm the IPanel: " + toString() + "\n and I've been selected. My information is: " +
133
				 "\n\tID: " + getID() + "\n\tLABEL_GROUP: " + getLabelGroup() + "\n\tLABEL: " + getLabel() + "\n\tCLASS: " + getClass() +
134
				 "\n\tMy Preferred Size: " + getPreferredSize() + "\n\tAnd My size: " + getSize());
135
	}
136
}
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/samples/SampleInitializingExcetionPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup.samples;
21

  
22
import java.awt.Color;
23
import java.io.Serializable;
24

  
25
import javax.swing.JScrollPane;
26
import javax.swing.JTextArea;
27

  
28
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
29

  
30
/**
31
 * <p>Sample of {@link AbstractPanel AbstractPanel}.</p>
32
 * 
33
 * @version 16/10/2007
34
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
35
 */
36
public class SampleInitializingExcetionPanel extends AbstractPanel implements Serializable {
37
	private static final long serialVersionUID = -876907003975432865L;
38

  
39
	/**
40
	 * <p>Element for the interface.</p>
41
	 */
42
	private JTextArea jTextArea = null;
43

  
44
	/**
45
	 * @see AbstractPanel#AbstractPanel()
46
	 */
47
	public SampleInitializingExcetionPanel() {
48
		super();
49
		initialize();
50
	}
51

  
52
	/**
53
	 * @see AbstractPanel#AbstractPanel(String, String, String)
54
	 */
55
	public SampleInitializingExcetionPanel(String id, String label, String labelGroup) {
56
		super(id, label, labelGroup);
57
		
58
		initialize();
59
	}
60

  
61
	@Override
62
	protected void initialize() {
63
		add(new JScrollPane(getJTextArea()));
64
		setToolTipText(getID());
65
		
66
		setID(Samples_ExtensionPointsOfIPanels.PANELS1_IDS[0]);
67
		setLabel(Samples_ExtensionPointsOfIPanels.PANELS1_LABELS[0]);
68
		setLabelGroup(Samples_ExtensionPointsOfIPanels.PANELS1_LABELGROUPS[0]);
69
		
70
		// Force to generate an exception
71
		double badValue = 2 / 0;
72

  
73
		resetChangedStatus();
74
	}
75
	
76
	/**
77
	 * This method initializes jTextArea
78
	 *
79
	 * @return JTextArea
80
	 */
81
	private JTextArea getJTextArea() {
82
		if (jTextArea == null) {
83
			jTextArea = new JTextArea(5, 40);
84
			jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
85
			jTextArea.setEditable(false);
86
			jTextArea.setBackground(Color.GREEN);
87
		}
88

  
89
		return jTextArea;
90
	}
91

  
92
	@Override
93
	public void setID(String id) {
94
		super.setID(id);
95

  
96
		setToolTipText(getID());
97
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
98
		hasChanged = true;
99
	}
100

  
101
	@Override
102
	public void setLabel(String label) {
103
		super.setLabel(label);
104
		
105
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
106
		hasChanged = true;
107
	}
108

  
109
	@Override
110
	public void setLabelGroup(String labelGroup) {
111
		super.setLabelGroup(labelGroup);
112
		
113
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
114
		hasChanged = true;
115
	}
116

  
117
	/*
118
	 * (non-Javadoc)
119
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#accept()
120
	 */
121
	public void accept() {
122
		System.out.println("I'm the IPanel: " + toString() + "\n and I'm executing an 'accept' method.");
123
	}
124

  
125
	/*
126
	 * (non-Javadoc)
127
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#apply()
128
	 */
129
	public void apply() {
130
		System.out.println("I'm the IPanel: " + toString() + "\n and I'm executing an 'apply' method.");
131
	}
132

  
133
	/*
134
	 * (non-Javadoc)
135
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#cancel()
136
	 */
137
	public void cancel() {
138
		System.out.println("I'm the IPanel: " + toString() + "\n and I'm executing a 'cancel' method.");
139
	}
140

  
141
	/*
142
	 * (non-Javadoc)
143
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#selected()
144
	 */
145
	public void selected() {
146
		System.out.println("I'm the IPanel: " + toString() + "\n and I've been selected. My information is: " +
147
		 "\n\tID: " + getID() + "\n\tLABEL_GROUP: " + getLabelGroup() + "\n\tLABEL: " + getLabel() + "\n\tCLASS: " + getClass() +
148
		 "\n\tMy Preferred Size: " + getPreferredSize() + "\n\tAnd My size: " + getSize());
149
	}
150
}
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/samples/SampleTransparencyPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup.samples;
21

  
22
import java.awt.Color;
23
import java.awt.Dimension;
24
import java.awt.event.MouseAdapter;
25
import java.awt.event.MouseEvent;
26
import java.io.Serializable;
27

  
28
import javax.swing.JScrollPane;
29
import javax.swing.JTextArea;
30

  
31
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
32

  
33

  
34
/**
35
 * <p>Sample of {@link AbstractPanel AbstractPanel}.</p>
36
 * 
37
 * @version 16/10/2007
38
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
39
 */
40
public class SampleTransparencyPanel extends AbstractPanel implements Serializable {
41
	private static final long serialVersionUID = -4145789119404234621L;
42

  
43
	/**
44
	 * <p>Element for the interface.</p>
45
	 */
46
	private JTextArea jTextArea = null;
47
	
48
	/**
49
	 * @see AbstractPanel#AbstractPanel()
50
	 */
51
	public SampleTransparencyPanel() {
52
		super();
53
		initialize();
54
	}
55
	
56
	/**
57
	 * @see AbstractPanel#AbstractPanel(String, String, String)
58
	 */
59
	public SampleTransparencyPanel(String id, String label, String labelGroup) {
60
		super(id, label, labelGroup);
61
		initialize();
62
	}
63
	
64
	@Override
65
	protected void initialize() {
66
		add(new JScrollPane(getJTextArea()));
67
		setToolTipText(getID());
68
		
69
		setID(Samples_ExtensionPointsOfIPanels.PANELS1_IDS[2]);
70
		setLabel(Samples_ExtensionPointsOfIPanels.PANELS1_LABELS[2]);
71
		setLabelGroup(Samples_ExtensionPointsOfIPanels.PANELS1_LABELGROUPS[2]);
72
		setPreferredSize(new Dimension(Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_WIDTH, Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_HEIGHT));
73
		resetChangedStatus();
74
	}
75
	
76
	/**
77
	 * This method initializes jTextArea
78
	 *
79
	 * @return JTextArea
80
	 */
81
	private JTextArea getJTextArea() {
82
		if (jTextArea == null) {
83
			jTextArea = new JTextArea(5, 40);
84
			jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
85
			jTextArea.setEditable(false);
86
			jTextArea.setBackground(Color.BLUE);
87
			jTextArea.addMouseListener(new MouseAdapter() {
88
				
89
				public void mouseClicked(MouseEvent e) {
90
					if (getPanelGroup() != null) {
91
						getPanelGroup().setEnabledApplyButton(! getPanelGroup().isEnabledApplyButton());
92
					}	
93
				}
94
			});
95
		}
96

  
97
		return jTextArea;
98
	}
99
	
100
	@Override
101
	public void setID(String id) {
102
		super.setID(id);
103
		
104
		setToolTipText(getID());
105
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
106
	}
107

  
108
	@Override
109
	public void setLabel(String label) {
110
		super.setLabel(label);
111
		
112
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
113
	}
114

  
115
	@Override
116
	public void setLabelGroup(String labelGroup) {
117
		super.setLabelGroup(labelGroup);
118
		
119
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
120
	}
121

  
122
	public void accept() {
123
	}
124

  
125
	public void apply() {
126
	}
127

  
128
	public void cancel() {
129
	}
130

  
131
	public void selected() {
132
		System.out.println("I'm the IPanel: " + toString() + "\n and I've been selected. My information is: " +
133
				 "\n\tID: " + getID() + "\n\tLABEL_GROUP: " + getLabelGroup() + "\n\tLABEL: " + getLabel() + "\n\tCLASS: " + getClass() +
134
				 "\n\tMy Preferred Size: " + getPreferredSize() + "\n\tAnd My size: " + getSize());
135
	}
136
}
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/samples/SampleUndefinedPreferredSizeExceptionPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup.samples;
21

  
22
import java.awt.Color;
23
import java.io.Serializable;
24

  
25
import javax.swing.JScrollPane;
26
import javax.swing.JTextArea;
27

  
28
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
29

  
30
/**
31
 * 
32
 * @version 30/11/2007
33
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
34
 */
35
public class SampleUndefinedPreferredSizeExceptionPanel extends AbstractPanel implements Serializable {
36
	private static final long serialVersionUID = 1210497562221898739L;
37

  
38
	/**
39
	 * <p>Element for the interface.</p>
40
	 */
41
	private JTextArea jTextArea = null;
42
	
43
	/**
44
	 * @see AbstractPanel#AbstractPanel()
45
	 */
46
	public SampleUndefinedPreferredSizeExceptionPanel() {
47
		super();
48
		initialize();
49
	}
50
	
51
	/**
52
	 * @see AbstractPanel#AbstractPanel(String, String, String)
53
	 */
54
	public SampleUndefinedPreferredSizeExceptionPanel(String id, String label, String labelGroup) {
55
		super(id, label, labelGroup);
56
		initialize();
57
	}
58
	
59
	@Override
60
	protected void initialize() {
61
		add(new JScrollPane(getJTextArea()));
62
		setToolTipText(getID());
63
		
64
		setID(Samples_ExtensionPointsOfIPanels.PANELS1_IDS[0]);
65
		setLabel(Samples_ExtensionPointsOfIPanels.PANELS1_LABELS[0]);
66
		setLabelGroup(Samples_ExtensionPointsOfIPanels.PANELS1_LABELGROUPS[0]);
67
		resetChangedStatus();
68
	}
69
	
70
	/**
71
	 * This method initializes jTextArea
72
	 *
73
	 * @return JTextArea
74
	 */
75
	private JTextArea getJTextArea() {
76
		if (jTextArea == null) {
77
			jTextArea = new JTextArea(5, 40);
78
			jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
79
			jTextArea.setEditable(false);
80
			jTextArea.setBackground(Color.RED);
81
		}
82

  
83
		return jTextArea;
84
	}
85
	
86
	@Override
87
	public void setID(String id) {
88
		super.setID(id);
89
		
90
		setToolTipText(getID());
91
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
92
		hasChanged = true;
93
	}
94

  
95
	@Override
96
	public void setLabel(String label) {
97
		super.setLabel(label);
98
		
99
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
100
		hasChanged = true;
101
	}
102

  
103
	@Override
104
	public void setLabelGroup(String labelGroup) {
105
		super.setLabelGroup(labelGroup);
106
		
107
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
108
		hasChanged = true;
109
	}
110

  
111
	/*
112
	 * (non-Javadoc)
113
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#accept()
114
	 */
115
	public void accept() {
116
		System.out.println("I'm the IPanel: " + toString() + "\n and I'm executing an 'accept' method.");
117
	}
118

  
119
	/*
120
	 * (non-Javadoc)
121
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#apply()
122
	 */
123
	public void apply() {
124
		System.out.println("I'm the IPanel: " + toString() + "\n and I'm executing an 'apply' method.");
125
	}
126

  
127
	/*
128
	 * (non-Javadoc)
129
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#cancel()
130
	 */
131
	public void cancel() {
132
		System.out.println("I'm the IPanel: " + toString() + "\n and I'm executing a 'cancel' method.");
133
	}
134

  
135
	/*
136
	 * (non-Javadoc)
137
	 * @see org.gvsig.gui.beans.panelGroup.panels.IPanel#selected()
138
	 */
139
	public void selected() {
140
		System.out.println("I'm the IPanel: " + toString() + "\n and I've been selected. My information is: " +
141
				 "\n\tID: " + getID() + "\n\tLABEL_GROUP: " + getLabelGroup() + "\n\tLABEL: " + getLabel() + "\n\tCLASS: " + getClass() +
142
				 "\n\tMy Preferred Size: " + getPreferredSize() + "\n\tAnd My size: " + getSize());
143
	}
144
}
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/samples/SampleInfoPanel.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup.samples;
21

  
22
import java.awt.Color;
23
import java.awt.Dimension;
24
import java.awt.event.MouseAdapter;
25
import java.awt.event.MouseEvent;
26
import java.io.Serializable;
27

  
28
import javax.swing.JScrollPane;
29
import javax.swing.JTextArea;
30

  
31
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
32

  
33
/**
34
 * <p>Sample of {@link AbstractPanel AbstractPanel}.</p>
35
 * 
36
 * @version 16/10/2007
37
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es) 
38
 */
39
public class SampleInfoPanel extends AbstractPanel implements Serializable {
40
	private static final long serialVersionUID = -1629511810619122126L;
41

  
42
	/**
43
	 * <p>Element for the interface.</p>
44
	 */
45
	private JTextArea jTextArea = null;
46
	
47
	/**
48
	 * @see AbstractPanel#AbstractPanel()
49
	 */
50
	public SampleInfoPanel() {
51
		super();
52
		initialize();
53
	}
54
	
55
	/**
56
	 * @see AbstractPanel#AbstractPanel(String, String, String)
57
	 */
58
	public SampleInfoPanel(String id, String label, String labelGroup) {
59
		super(id, label, labelGroup);
60
		initialize();
61
	}
62
	
63
	@Override
64
	protected void initialize() {
65
		add(new JScrollPane(getJTextArea()));
66
		setToolTipText(getID());
67
		
68
		setID(Samples_ExtensionPointsOfIPanels.PANELS1_IDS[0]);
69
		setLabel(Samples_ExtensionPointsOfIPanels.PANELS1_LABELS[0]);
70
		setLabelGroup(Samples_ExtensionPointsOfIPanels.PANELS1_LABELGROUPS[0]);
71
		setPreferredSize(new Dimension(Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_WIDTH, Samples_ExtensionPointsOfIPanels.PANELS_DEFAULT_HEIGHT));
72
		resetChangedStatus();
73
	}
74
	
75
	/**
76
	 * This method initializes jTextArea
77
	 *
78
	 * @return JTextArea
79
	 */
80
	private JTextArea getJTextArea() {
81
		if (jTextArea == null) {
82
			jTextArea = new JTextArea(5, 40);
83
			jTextArea.setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
84
			jTextArea.setEditable(false);
85
			jTextArea.setBackground(Color.RED);
86
			
87
			jTextArea.addMouseListener(new MouseAdapter() {
88
				
89
				public void mouseClicked(MouseEvent e) {
90
					if (getPanelGroup() != null) {
91
						getPanelGroup().setEnabledAcceptButton(! getPanelGroup().isEnabledAcceptButton());
92
					}	
93
				}
94
			});
95
		}
96

  
97
		return jTextArea;
98
	}
99
	
100
	@Override
101
	public void setID(String id) {
102
		super.setID(id);
103
		
104
		setToolTipText(getID());
105
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
106
	}
107

  
108
	@Override
109
	public void setLabel(String label) {
110
		super.setLabel(label);
111
		
112
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
113
	}
114

  
115
	@Override
116
	public void setLabelGroup(String labelGroup) {
117
		super.setLabelGroup(labelGroup);
118
		
119
		getJTextArea().setText("I\'m a JTextArea object in the \"Panel\" with:\n\nID: " + getID() + "\nLabel: " + getLabel() + "\nLabelGroup: " + getLabelGroup());
120
	}
121

  
122

  
123
	public void accept() {
124
	}
125

  
126

  
127
	public void apply() {
128
	}
129

  
130

  
131
	public void cancel() {
132
	}
133

  
134

  
135
	public void selected() {
136
		System.out.println("I'm the IPanel: " + toString() + "\n and I've been selected. My information is: " +
137
				 "\n\tID: " + getID() + "\n\tLABEL_GROUP: " + getLabelGroup() + "\n\tLABEL: " + getLabel() + "\n\tCLASS: " + getClass() +
138
				 "\n\tMy Preferred Size: " + getPreferredSize() + "\n\tAnd My size: " + getSize());
139
	}
140
}
tags/v2_0_0_Build_2047/applications/appgvSIG/appgvSIG/src-test/org/gvsig/app/panelGroup/samples/Samples_ExtensionPointsOfIPanels.java
1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19

  
20
package org.gvsig.app.panelGroup.samples;
21

  
22
import org.gvsig.gui.beans.panelGroup.PanelGroupManager;
23
import org.gvsig.gui.beans.panelGroup.loaders.PanelGroupLoaderFromList;
24
import org.gvsig.gui.beans.panelGroup.panels.AbstractPanel;
25
import org.gvsig.gui.beans.panelGroup.tabbedPanel.TabbedPanel;
26
import org.gvsig.gui.beans.panelGroup.treePanel.TreePanel;
27
import org.gvsig.tools.ToolsLocator;
28
import org.gvsig.tools.extensionpoint.ExtensionPoint;
29
import org.gvsig.tools.extensionpoint.ExtensionPointManager;
30

  
31
import org.gvsig.app.panelGroup.PanelGroupDialog;
32
import org.gvsig.app.panelGroup.loaders.PanelGroupLoaderFromExtensionPoint;
33

  
34
/**
35
 * <p>
36
 * This class has information to create samples to test
37
 * {@link PanelGroupManager PanelGroupManager}, {@link TabbedPanel TabbedPanel},
38
 * {@link TreePanel TreePanel}, {@link AbstractPanel AbstractPanel},
39
 * {@link PanelGroupLoaderUtilities PanelGroupLoaderUtilities},
40
 * {@link PanelGroupLoaderFromList PanelGroupLoaderFromList},
41
 * {@link PanelGroupLoaderFromExtensionPoint PanelGroupLoaderFromExtensionPoint}
42
 * , and {@link PanelGroupDialog PanelGroupDialog}.
43
 * </p>
44
 * 
45
 * @version 16/10/2007
46
 * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es)
47
 */
48
public class Samples_ExtensionPointsOfIPanels {
49
	public final static String EXTENSIONPOINT1_NAME = "RasterLayerProperties";
50
	public final static String EXTENSIONPOINT2_NAME = "ImaginaryLayerProperties";
51
	public final static String EXTENSIONPOINT3_NAME = "Other tests";
52
	public final static String EXTENSIONPOINT4_NAME = "Test 1 exceptions";
53
	public final static String EXTENSIONPOINT5_NAME = "Test 2 exceptions";
54
	public final static String EXTENSIONPOINT6_NAME = "Test 3 exceptions";
55
	public final static String EXTENSIONPOINT7_NAME = "Test 4 exceptions";
56
	public final static String EXTENSIONPOINT8_NAME = "Test 5 exceptions";
57
	public final static String EXTENSIONPOINT9_NAME = "Test 6 exceptions";
58
	public final static String EXTENSIONPOINT10_NAME = "Test 7 exceptions";
59
	public final static String[] EXTENSIONPOINTS1_NAMES = {"Information", "Bands", "Transparency", "Enhanced", "PanSharpening", "Scale"};
60
	public final static String[] EXTENSIONPOINTS2_NAMES = {"Information", "Transparency", "Scale"};
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff