Revision 5280

View differences:

org.gvsig.raster/tags/org.gvsig.raster-2.2.41/org.gvsig.raster.swing/org.gvsig.raster.swing.api/pom.xml
1
<?xml version="1.0" encoding="ISO-8859-1"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
	<modelVersion>4.0.0</modelVersion>
4
	<artifactId>org.gvsig.raster.swing.api</artifactId>
5
	<packaging>jar</packaging>
6
	<name>org.gvsig.raster.swing.api</name>
7
	<parent>
8
		<groupId>org.gvsig</groupId>
9
		<artifactId>org.gvsig.raster.swing</artifactId>
10
		<version>2.2.41</version>
11
	</parent>
12
	<dependencies>
13
		<dependency>
14
            <groupId>org.gvsig</groupId>
15
            <artifactId>org.gvsig.tools.lib</artifactId>      
16
            <scope>compile</scope>
17
        </dependency> 
18
		<dependency>
19
            <groupId>org.gvsig</groupId>
20
            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
21
            <scope>compile</scope>
22
        </dependency>
23
        <dependency>
24
            <groupId>org.gvsig</groupId>
25
            <artifactId>org.gvsig.fmap.mapcontext.impl</artifactId>
26
            <scope>runtime</scope>
27
        </dependency>
28
        <dependency>
29
            <groupId>org.gvsig</groupId>
30
            <artifactId>org.gvsig.fmap.mapcontext.operation</artifactId>
31
            <scope>runtime</scope>
32
        </dependency>
33
        <dependency>
34
            <groupId>org.gvsig</groupId>
35
            <artifactId>org.gvsig.i18n</artifactId>
36
            <scope>compile</scope>
37
        </dependency>
38
	</dependencies>
39
	<build>
40
		<plugins>
41
			<plugin>
42
				<groupId>org.apache.maven.plugins</groupId>
43
				<artifactId>maven-jar-plugin</artifactId>
44
				<configuration>
45
				</configuration>
46
				<executions>
47
				<!--
48
				Generates a jar file only with the test classes
49
				-->
50
					<execution>
51
						<goals>
52
							<goal>test-jar</goal>
53
						</goals>
54
					</execution>
55
				</executions>
56
			</plugin>
57
		</plugins>
58
	</build>
59
</project>
0 60

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

  
24
import java.util.EventObject;
25

  
26
/**
27
 * Evento lanzado por las herramientas de la vista
28
 * 17/01/2008
29
 * @author Nacho Brodin nachobrodin@gmail.com
30
 */
31
public class PagedTableEvent  extends EventObject {
32
	private static final long        serialVersionUID = 1L;
33
	
34
	public static int                EVENT_SELECTED_ROWS           = 0;
35
	public static int                EVENT_ADD_ENTRY               = 1; 
36
	public static int                EVENT_REMOVE_ENTRY            = 2;
37
	public static int                EVENT_REMOVE_ALL              = 3;
38
	public static int                EVENT_SELECTED_PAGE           = 4;
39
	public static int                EVENT_MODIFY_ENTRY            = 5;
40
	public static int                EVENT_SWAP_ENTRIES            = 6;
41
	
42
	private int                      event                         = -1;
43
	private int[]                    rows                          = null;
44
	private Object                   rowDeleted                    = null;
45
	
46
	/**
47
	 * Constructor
48
	 * @param source
49
	 */
50
	public PagedTableEvent(Object source, int id, int[] rows) {
51
		super(source);
52
		this.event = id;
53
		this.rows = rows;
54
	}
55
	
56
	/**
57
	 * Constructor
58
	 * @param source
59
	 */
60
	public PagedTableEvent(Object source, int id, Object rowDeleted) {
61
		super(source);
62
		this.event = id;
63
		this.rowDeleted = rowDeleted;
64
	}
65
	
66
	public int getEvent() {
67
		return event;
68
	}
69
	
70
	public int[] getRows() {
71
		return rows;
72
	}
73
	
74
	public Object getRowDeleted() {
75
		return rowDeleted;
76
	}
77
	
78
}
0 79

  
org.gvsig.raster/tags/org.gvsig.raster-2.2.41/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTableListener.java
1
package org.gvsig.raster.swing.pagedtable;
2

  
3
/**
4
 * Listener for paged tables
5
 * @author Nacho Brodin (nachobrodin@gmail.com)
6
 */
7
public interface PagedTableListener {
8
	public void tableChanged(PagedTableEvent event);
9
}
0 10

  
org.gvsig.raster/tags/org.gvsig.raster-2.2.41/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/ModelLoader.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2012 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.raster.swing.pagedtable;
25

  
26
import javax.swing.table.TableCellEditor;
27
import javax.swing.table.TableCellRenderer;
28

  
29
/**
30
 * Provides a model and renders for columns to a <code>PagedTable</code>
31
 * @author Nacho Brodin (nachobrodin@gmail.com)
32
 *
33
 */
34
public interface ModelLoader {
35

  
36
	public TableModel getTableModel();
37
	
38
	public TableCellRenderer getRenderForColumn(int column);
39
	
40
	public void setRenderForColumn(int column, TableCellRenderer render);
41
	
42
	public TableCellEditor getCellEditorForColumn(int column);
43
	
44
	public void setCellEditorForColumn(int column, TableCellEditor editor);
45
	
46
	public String[] getColumnNames();
47
	
48
	public int[] getColumnWidths();
49
	
50
	public void setColumnNames(String[] columnNames);
51
	
52
	public void setColumnWidths(int[] columnWidths);
53
}
0 54

  
org.gvsig.raster/tags/org.gvsig.raster-2.2.41/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTable.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2012 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.raster.swing.pagedtable;
25

  
26
import javax.swing.JComponent;
27
import javax.swing.JTable;
28

  
29
import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
30

  
31
/**
32
 * API for a <code>PagedTable</code>
33
 * @author Nacho Brodin (nachobrodin@gmail.com)
34
 *
35
 */
36
public interface PagedTable {
37
	/**
38
	 * Gets the value at the selected position
39
	 * @param row
40
	 * @param col
41
	 * @return
42
	 */
43
	public Object getValueAt(int row, int col);
44
	
45
	/**
46
	 * Sets a value in a cell
47
	 * @param obj
48
	 * @param row
49
	 * @param column
50
	 */
51
	public void setValueAt(Object obj, int row, int column);
52
	/**
53
	 * Gets the number of columns
54
	 * @return
55
	 */
56
	public int getColumnCount();
57
	/**
58
	 * Gets the number of rows
59
	 * @return
60
	 */
61
	public int getRowCount();
62
	/**
63
	 * Adds a row to the table.
64
	 * @param list List of strings
65
	 */
66
	public void addRow(Object[] list);
67
	
68
	/**
69
	 * Deletes a row from the table.
70
	 * @param Global position of the entry
71
	 */
72
	public void delRow(int i);
73
	
74
	/**
75
	 * Removes all rows of this table. This call does not
76
	 * show the confirmation message.
77
	 */
78
	public void removeAllRowsWithoutAsk();
79
	
80
	/**
81
	 * Removes all rows of this table.
82
	 */
83
	public void removeAllRows();
84
	
85
	/**
86
	 * Gets the selected rows
87
	 * @return
88
	 * @throws NotInitializeException
89
	 */
90
	public int[] getSelectedRows();
91
	
92
	/**
93
	 * Swap two rows
94
	 * @param i Row to delete
95
	 */
96
	public void swapRow(int i, int j);
97
	
98
	/**
99
	 * Sets the rows selected
100
	 * @param rows
101
	 */
102
	public void setSelectedRows(int[] rows);
103
	
104
	/**
105
	 * Sets the row selected
106
	 * @param rows
107
	 */
108
	public void setSelectedRow(int row);
109
	
110
	/**
111
	 * Increase the selected row
112
	 */
113
	public void increaseSelectedRows();
114
	
115
	/**
116
	 * Decrease the selected row
117
	 */
118
	public void decreaseSelectedRows();
119
	
120
	/**
121
	 * Adds a new row selected without deselecting the old ones
122
	 * @param row
123
	 */
124
	public void addSelectedRow(int row);
125
	
126
	/**
127
	 * Shows or hides the controls to move rows
128
	 * @param show
129
	 */
130
	public void showMoveRowsControls(boolean show);
131
	
132
	/**
133
	 * Shows or hides the table controller
134
	 * @param show
135
	 */
136
	public void showControllerTable(boolean show);
137
	
138
	/**
139
	 * Selects the next page
140
	 */
141
	public void nextPage();
142
	
143
	/**
144
	 * Selects the previous page
145
	 */
146
	public void prevPage();
147
	
148
	/**
149
	 * Sets the page selected
150
	 * @param pageNumber
151
	 */
152
	public void setSelectedPage(int pageNumber);
153
	
154
	/**
155
	 * Gets the table data model
156
	 * @return
157
	 */
158
	public TableModel getTableModel();
159
	
160
	/**
161
	 * Gets the component
162
	 * @return
163
	 */
164
	public JComponent getComponent();
165
	
166
	/**
167
	 * Gets the internal JTable
168
	 * @return
169
	 */
170
	public JTable getJTable();
171
	
172
	/**
173
	 * Adds a listener
174
	 * @param listener
175
	 */
176
	public void addListener(PagedTableListener listener);
177
	
178
	/**
179
	 * Sets a message to ask for confirmation when all
180
	 * entries are going to be deleted
181
	 * @param message
182
	 */
183
	public void setConfirmationMessageDeleteAllEntries(String message);
184
	
185
	/**
186
	 * Sets a message to ask for confirmation when one entry
187
	 * are going to be deleted
188
	 * @param message
189
	 */
190
	public void setConfirmationMessageDeleteOneEntry(String message);
191
}
0 192

  
org.gvsig.raster/tags/org.gvsig.raster-2.2.41/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/TableModel.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2012 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.raster.swing.pagedtable;
25

  
26

  
27
/**
28
 * Interfaz que implementan los modelos de tabla
29
 * 
30
 * @author Nacho Brodin (nachobrodin@gmail.com)
31
 *
32
 */
33
public interface TableModel{
34
    public Object[] getNewLine();
35
    public void addNewLine();
36
}
0 37

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

  
24
/**
25
 * @author Nacho Brodin (nachobrodin@gmail.com)
26
 */
27
public interface ROIPanelDataModel {
28

  
29
}
0 30

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

  
24
import java.awt.event.ActionListener;
25

  
26
import javax.swing.AbstractButton;
27
import javax.swing.JComboBox;
28
import javax.swing.JComponent;
29
import javax.swing.event.ListSelectionListener;
30
import javax.swing.event.TableModelListener;
31

  
32
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
33
import org.gvsig.gui.beans.table.TableContainer;
34

  
35
/**
36
 * Panel for raster ROIs
37
 * 
38
 * @author Nacho Brodin nachobrodin@gmail.com
39
 * 
40
 */
41
public interface ROIPanel {
42
	public static final int         BUTTON_ACCEPT             = 1;
43
	public static final int         BUTTON_CANCEL             = 2;
44
	public static final int         BUTTON_APPLY              = 3;
45
	
46
	public static final int         POLYGON_BUTTON            = 4;
47
	public static final int         POINT_BUTTON              = 5;
48
	public static final int         LINE_BUTTON               = 6;
49
	public static final int         NEW_BUTTON                = 7;
50
	public static final int         DELETE_BUTTON             = 8;
51
	public static final int         EXPORT_BUTTON             = 9;
52
	public static final int         IMPORT_BUTTON             = 10;
53
	public static final int         ADDFLYR_BUTTON            = 11;
54
	public static final int         FLYRS_COMBO               = 12;
55
	public static final int         REMOVE_ROI_FILE_BUTTON    = 13;
56
	
57
	public JComponent getComponent();
58
	
59
	/**
60
	 * Gets the table
61
	 * @return
62
	 */
63
	public TableContainer getTable();
64
	
65
	/**
66
	 * Gets a button. The buttons are defined as a constant in this interface
67
	 * @param button
68
	 * @return
69
	 */
70
	public AbstractButton getButton(int button);
71
	
72
	/**
73
	 * Gets the list of layers
74
	 * @param button
75
	 * @return
76
	 */
77
	public JComboBox getLayerList(int button);
78
	
79
	/**
80
	 * Adds a listener to the buttons
81
	 * @param listener
82
	 */
83
	public void addButtonsListener(
84
			ActionListener listener, 
85
			ButtonsPanelListener mainButtonsListener);
86
	
87
	public void addTableListeners(
88
			ListSelectionListener listSelectionlistener, 
89
			TableModelListener tableModelListener);
90
	
91
	/**
92
	 * Enables or disables the list of tools
93
	 * @param b
94
	 */
95
	public void setToolsEnabled(boolean b);
96
}
0 97

  
org.gvsig.raster/tags/org.gvsig.raster-2.2.41/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/ButtonsPanelEvent.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2012 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.raster.swing.basepanel;
25

  
26
import java.util.EventObject;
27

  
28
/**
29
 *
30
 * @version 09/05/2008
31
 *
32
 * @author BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
33
 */
34
public class ButtonsPanelEvent extends EventObject {
35
	private static final long serialVersionUID = 4275588038151358375L;
36

  
37
	int button = 0;
38

  
39
	public ButtonsPanelEvent(Object source, int button) {
40
		super(source);
41
		this.button = button;
42
	}
43
	
44
	public int getButton() {
45
		return button;
46
	}
47
}
0 48

  
org.gvsig.raster/tags/org.gvsig.raster-2.2.41/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/AbstractButtonsPanel.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2012 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.raster.swing.basepanel;
25

  
26
import java.awt.Component;
27
import java.awt.Container;
28
import java.awt.LayoutManager;
29
import java.awt.Window;
30

  
31
import javax.swing.JPanel;
32

  
33
import org.gvsig.raster.swing.RasterSwingLocator;
34

  
35

  
36
/**
37
 * <code>AbstractButtonsPanel</code> is a panel which inherits of <code>JPanel</code>.
38
 * That reimplemented panel permits add generic buttons of apply, accept and cancel to
39
 * a panel.
40
 * @author BorSanZa - Borja Sanchez Zamorano 
41
 */
42
public abstract class AbstractButtonsPanel extends JPanel {
43
	private static final long serialVersionUID = 1536590395737700551L;
44
	IButtonsPanel             bp               = null;
45
	JPanel                    content          = null;
46
	private int               margin           = 4;
47
	
48
	/**
49
	 * Crea el <code>DefaultButtonsPanel</code> con los botones por defecto.
50
	 */
51
	public AbstractButtonsPanel() {
52
		super.setLayout(new java.awt.BorderLayout(0, 0));
53
		getButtonsPanel().addAccept();
54
		getButtonsPanel().addCancel();
55
		getButtonsPanel().addApply();
56
		super.add((JPanel)getButtonsPanel(), java.awt.BorderLayout.SOUTH);
57
		super.add(getContent(), java.awt.BorderLayout.CENTER);
58
		this.setBorder(javax.swing.BorderFactory.createEmptyBorder(margin, margin, margin, margin));
59
	}
60

  
61
	/**
62
	 * Crea el <code>DialogPanel</code> con los botones que definamos de la clase
63
	 * <code>ButtonsPanel</code>
64
	 *
65
	 * @param buttons Constante para definir que botones se crear?n
66
	 */
67
	public AbstractButtonsPanel(int buttons) {
68
		super.setLayout(new java.awt.BorderLayout(0, 0));
69
		bp = RasterSwingLocator.getSwingManager().createButtonsPanel(buttons, this);
70
		super.add((JPanel)getButtonsPanel(), java.awt.BorderLayout.SOUTH);
71
		super.add(getContent(), java.awt.BorderLayout.CENTER);
72
		this.setBorder(javax.swing.BorderFactory.createEmptyBorder(margin, margin, margin, margin));
73
	}
74

  
75
	/**
76
	 * Obtener el objeto <code>ButtonsPanel</code> del <code>DialogPanel</code>.
77
	 * En caso de no estar creado, lo crear?.
78
	 *
79
	 * @return El componente bp
80
	 */
81
	public IButtonsPanel getButtonsPanel() {
82
		if (bp == null)
83
			bp = RasterSwingLocator.getSwingManager().createButtonsPanel(IButtonsPanel.BUTTONS_NONE, this);
84
		return bp;
85
	}
86

  
87
	/**
88
	 * Obtener el contenido del <code>DialogPanel</code>. En caso de no estar creado,
89
	 * lo crear?.
90
	 *
91
	 * @return El componente content
92
	 */
93
	public JPanel getContent() {
94
		if (content == null)
95
			content = new JPanel();
96
		return content;
97
	}
98

  
99
	public void addButtonPressedListener(ButtonsPanelListener listener) {
100
		getButtonsPanel().addButtonPressedListener(listener);
101
	}
102

  
103
	public void removeButtonPressedListener(ButtonsPanelListener listener) {
104
		getButtonsPanel().removeButtonPressedListener(listener);
105
	}
106

  
107
	/*
108
	 * (non-Javadoc)
109
	 * @see java.awt.Container#getLayout()
110
	 */
111
	public LayoutManager getLayout() {
112
		return getContent().getLayout();
113
	}
114

  
115
	/*
116
	 * (non-Javadoc)
117
	 * @see java.awt.Container#setLayout(java.awt.LayoutManager)
118
	 */
119
	public void setLayout(LayoutManager mgr) {
120
		getContent().setLayout(mgr);
121
	}
122

  
123
	/**
124
	 * Devuelve el Window que contiene dicha ventana o null en caso de que no sea
125
	 * asi
126
	 * @return
127
	 */
128
	public Window getWindow() {
129
		Container container = getParent();
130
		while (container != null) {
131
			if (container instanceof Window)
132
				return (Window) container;
133
			container = container.getParent();
134
		}
135
		return null;
136
	}
137

  
138
	/*
139
	 * (non-Javadoc)
140
	 * @see java.awt.Container#add(java.awt.Component)
141
	 */
142
	public Component add(Component comp) {
143
		return getContent().add(comp);
144
	}
145

  
146
	/*
147
	 * (non-Javadoc)
148
	 * @see java.awt.Container#add(java.awt.Component, int)
149
	 */
150
	public Component add(Component comp, int index) {
151
		return getContent().add(comp, index);
152
	}
153

  
154
	/*
155
	 * (non-Javadoc)
156
	 * @see java.awt.Container#add(java.awt.Component, java.lang.Object)
157
	 */
158
	public void add(Component comp, Object constraints) {
159
		getContent().add(comp, constraints);
160
	}
161

  
162
	/*
163
	 * (non-Javadoc)
164
	 * @see java.awt.Container#add(java.awt.Component, java.lang.Object, int)
165
	 */
166
	public void add(Component comp, Object constraints, int index) {
167
		getContent().add(comp, constraints, index);
168
	}
169

  
170
	/*
171
	 * (non-Javadoc)
172
	 * @see java.awt.Container#add(java.lang.String, java.awt.Component)
173
	 */
174
	public Component add(String name, Component comp) {
175
		return getContent().add(name, comp);
176
	}
177
}
0 178

  
org.gvsig.raster/tags/org.gvsig.raster-2.2.41/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/ButtonsPanelListener.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2012 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.raster.swing.basepanel;
25

  
26
import java.util.EventListener;
27

  
28
/**
29
 *
30
 * @version 09/05/2008
31
 *
32
 * @author BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
33
 */
34
public interface ButtonsPanelListener extends EventListener {
35
  public void actionButtonPressed(ButtonsPanelEvent e);
36
}
0 37

  
org.gvsig.raster/tags/org.gvsig.raster-2.2.41/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/IButtonsPanel.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2012 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.raster.swing.basepanel;
25

  
26
import javax.swing.JButton;
27
import javax.swing.JComponent;
28

  
29
public interface IButtonsPanel {
30
	public static final int BUTTON_ACCEPT             = 1;
31
	public static final int BUTTON_CANCEL             = 2;
32
	public static final int BUTTON_APPLY              = 3;
33
	public static final int BUTTON_YES                = 4;
34
	public static final int BUTTON_NO                 = 5;
35
	public static final int BUTTON_CLOSE              = 6;
36
	public static final int BUTTON_EXIT               = 7;
37
	public static final int BUTTON_SEEDETAILS         = 8;
38
	public static final int BUTTON_HIDEDETAILS        = 9;
39
	public static final int BUTTON_PAUSE              = 10;
40
	public static final int BUTTON_RESTART            = 11;
41
	public static final int BUTTON_SAVE               = 12;
42
	
43
	public static final int BUTTON_USR1               = 100;
44
	public static final int BUTTON_USR2               = 101;
45
	public static final int BUTTON_USR3               = 102;
46
	public static final int BUTTON_USR4               = 103;
47
	public static final int BUTTON_USR5               = 104;
48
	
49
	/**
50
	 * Sirve para cuando se crean botones nuevos, saber el ?ltimo n?mero usado
51
	 * internamente, as? '<code>new_id = BUTTON_LAST + 1;</code>' podr?a ser
52
	 * el ?ndice del nuevo bot?n.
53
	 */
54
	public static final int BUTTON_LAST               = 12;
55
	public static final int BUTTONS_ACCEPT            = 1;
56
	public static final int BUTTONS_ACCEPTCANCEL      = 2;
57
	public static final int BUTTONS_ACCEPTCANCELAPPLY = 3;
58
	public static final int BUTTONS_CANCEL            = 4;
59
	public static final int BUTTONS_YESNO             = 5;
60
	public static final int BUTTONS_CLOSE             = 6;
61
	public static final int BUTTONS_EXIT              = 7;
62
	public static final int BUTTONS_NONE              = 8;
63
	public static final int BUTTONS_APPLYCLOSE        = 9;
64
	
65
	/**
66
	 * A?adir el disparador de cuando se pulsa un bot?n.
67
	 * @param listener
68
	 */
69
	public void addButtonPressedListener(ButtonsPanelListener listener);
70

  
71
	/**
72
	 * Devuelve el array de listeners del componente
73
	 * @return
74
	 */
75
	public Object[] getButtonPressedListeners();
76

  
77
	/**
78
	 * Borrar el disparador de eventos de los botones.
79
	 * @param listener
80
	 */
81
	public void removeButtonPressedListener(ButtonsPanelListener listener);
82
	
83
	/**
84
	 * A?adir el boton Aceptar.
85
	 */
86
	public void addAccept();
87

  
88
	/**
89
	 * A?adir el boton Guardar.
90
	 */
91
	public void addSave();
92

  
93
	/**
94
	 * A?adir el boton Cancelar.
95
	 */
96
	public void addCancel();
97

  
98
	/**
99
	 * A?adir el boton S?.
100
	 */
101
	public void addYes();
102

  
103
	/**
104
	 * A?adir el boton No.
105
	 */
106
	public void addNo();
107

  
108
	/**
109
	 * A?adir el boton Aplicar.
110
	 */
111
	public void addApply();
112

  
113
	/**
114
	 * A?adir el boton Cerrar.
115
	 */
116
	public void addClose();
117

  
118
	/**
119
	 * A?adir el boton Salir.
120
	 */
121
	public void addExit();
122

  
123
	/**
124
	 * A?adir el boton Ver detalles.
125
	 */
126
	public void addSeeDetails();
127

  
128
	/**
129
	 * A?adir el boton Ocultar detalles.
130
	 */
131
	public void addHideDetails();
132

  
133
	/**
134
	 * A?adir el boton Pausar.
135
	 */
136
	public void addPause();
137

  
138
	/**
139
	 * A?adir el boton Reanudar.
140
	 */
141
	public void addRestart();
142

  
143
	/**
144
	 * A?adimos un bot?n definido por el usuario.
145
	 *
146
	 * @param text Texto que contendr? el bot?n
147
	 * @param id Entero para identificar los eventos del bot?n
148
	 */
149
	public void addButton(String text, int id);
150

  
151
	/**
152
	 * Obtener un bot?n por su Entero
153
	 * @param id N?mero del disparador del bot?n
154
	 * @return El bot?n especificado o <code>null</code> si no se encontr? el bot?n.
155
	 */
156
	public JButton getButton(int id);
157

  
158
	/**
159
	 * <p>Removes the button identified by <code>id</code>.</p>
160
	 * 
161
	 * @param id identifier of the button
162
	 * @return <code>true</code> if has removed the button; otherwise <code>false</code>
163
	 */
164
	public boolean removeButton(int id);
165
	
166
	/**
167
	 * <p>Returns the text of the button identified by <code>id</code>.</p>
168
	 * 
169
	 * @param id identifier of the button
170
	 * 
171
	 * @return text of the identified button
172
	 */
173
	public String getButtonText(int id);
174
	
175
	/**
176
	 * <p>Enables (or disables) the button identified by <code>id</code>.</p>
177
	 * 
178
	 * @param id identifier of the button
179
	 * @param b <code>true</code> to enable the button, otherwise <code>false</code>
180
	 * 
181
	 * @return <code>true</code> if there was a button of that kind in this group, otherwise <code>false</code>
182
	 */
183
	public boolean setEnabled(int id, boolean b);
184
	
185
	public JComponent getComponent();
186
}
0 187

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

  
24
import javax.swing.JButton;
25

  
26

  
27
/**
28
 * Bar of buttons of 16x16 pixels
29
 * @author Nacho Brodin (nachobrodin@gmail.com)
30
 */
31
public interface ButtonBar {
32
	/**
33
	 * A?ade un boton al ArrayList de los botones.
34
	 *
35
	 * @param iconName: nombre del icono asignado al boton. La imagen tendr?a que
36
	 * 					estar dentro de la carpeta "images/"
37
	 * @param tip: tip del boton;
38
	 * @param order: orden que ocupar? el boton dentro del control
39
	 */
40
	public void addButton(String iconName, String tip, int order);
41

  
42
	/**
43
	 * Elimina el bot?n correspondiente al indice que le pasamos.
44
	 * @param index
45
	 */
46
	public void delButton(int index);
47

  
48
	/**
49
	 * A?ade en el panel los botones que tenemos en el ArrayList.
50
	 *
51
	 */
52
	public void addList();
53

  
54

  
55
	/**
56
	 * Esta funci?n deshabilita todos los controles y guarda sus valores
57
	 * de habilitado o deshabilitado para que cuando se ejecute restoreControlsValue
58
	 * se vuelvan a quedar como estaba
59
	 */
60
	public void disableAllControls();
61

  
62
	/**
63
	 * Esta funci?n deja los controles como estaban al ejecutar la funci?n
64
	 * disableAllControls
65
	 */
66
	public void restoreControlsValue();
67

  
68
	/**
69
	 * M?todo para acceder a los botones del control;
70
	 * @param index
71
	 * @return
72
	 */
73
	public JButton getButton(int index);
74

  
75
	/**
76
	 * M?todo para establecer la posici?n de los botones dentro del control.
77
	 * @param align: "left" o "right"
78
	 */
79
	public void setButtonAlignment(String align);
80

  
81
	public void setComponentBorder(boolean br);
82
}
0 83

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

  
24
import java.awt.event.ActionListener;
25
import java.util.Observer;
26

  
27
import org.gvsig.raster.swing.pixelinspector.PixelInspector;
28

  
29

  
30
/**
31
 * Main panel for the information by point
32
 * @author Nacho Brodin (nachobrodin@gmail.com)
33
 *
34
 */
35
public interface MainInfoByPointPanel extends Observer {
36
	/**
37
	 * Gets the data model
38
	 * @return
39
	 */
40
	public InfoByPointDataModel getInfoByPointDataModel();
41
	
42
	/**
43
	 * Gets the pixel inspector panel
44
	 * @return
45
	 */
46
	public PixelInspector getPixelInspectorPanel();
47
	
48
	/**
49
	 * Adds a listener to the extended button
50
	 * @param listener
51
	 */
52
	public void addListenerExtendedButton(ActionListener listener);
53
}
0 54

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

  
24
import java.util.List;
25

  
26
/**
27
 * Data model for the information by point
28
 * @author Nacho Brodin (nachobrodin@gmail.com)
29
 *
30
 */
31
public interface InfoByPointDataModel {
32
	public void setBandValues(double[] list);
33
	
34
	public void setNumberOfBands(int n);
35
	
36
	public void setLayerList(List<String> list);
37
	
38
	public void setARGB(int r, int g, int b);
39
	
40
	public void setCMYK(double[] cmyk);
41
	
42
	public void setHSL(double h, double s, double l);
43
	
44
	public void setPixelPoint(double x, double y);
45
	
46
	public void setWorldPoint(double x, double y);
47
	
48
	public void setViewPoint(double x, double y);
49
	
50
	public String getFormatedLayerName(int i);
51
	
52
	public void notifyObservers();
53
	
54
	public void setProjected(boolean projected);
55
}
0 56

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

  
24
import java.io.File;
25

  
26
/**
27
 * Panel to choose a file from disk
28
 * @author Nacho Brodin (nachobrodin@gmail.com)
29
 */
30
public interface OpenFileContainer {
31
	/**
32
	 * Gets the selected file
33
	 * @return
34
	 */
35
	public File getFile();
36
	
37
	/**
38
	 * Sets a path in the field of text
39
	 * @param path
40
	 */
41
	public void setPath(String path);
42
	
43
	public void setEnabled(boolean enabled);
44
}
0 45

  
org.gvsig.raster/tags/org.gvsig.raster-2.2.41/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/openfile/FileFilter.java
1
package org.gvsig.raster.swing.openfile;
2

  
3

  
4
public abstract class FileFilter extends javax.swing.filechooser.FileFilter {
5

  
6
	/**
7
	 * <p>Gets the default file extension, which will be
8
	 * added to the selected file if its extension is not
9
	 * valid.</p>
10
	 * 
11
	 * @return
12
	 */
13
	public abstract String getDefaultExtension();
14
}
0 15

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

  
24
import javax.swing.JPanel;
25

  
26
/**
27
 * Responsible of the window management to show the panels of the
28
 * Validation swing library.
29
 * 
30
 * @see RasterSwingManager
31
 * @see JValidationServicePanel
32
 * @author gvSIG Team
33
 * @version $Id$
34
 */
35
public interface RasterWindowManager {
36

  
37
    public static final int MODE_DIALOG = 1;
38
    public static final int MODE_WINDOW = 2;
39
    public static final int MODE_TOOL = 3;
40

  
41
    /**
42
     * Inserts a Panel in a window with a characteristic properties.
43
     * 
44
     * @param panel
45
     *            JPanel with the content of the window
46
     * @param title
47
     *            String with the title of the window
48
     * @param mode
49
     *            int that defines the type of window
50
     */
51
    public void showWindow(JPanel panel, String title, int mode);
52
}
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff