Revision 8433
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/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.77</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.i18n</artifactId> |
|
31 |
<scope>compile</scope> |
|
32 |
</dependency> |
|
33 |
</dependencies> |
|
34 |
<build> |
|
35 |
<plugins> |
|
36 |
<plugin> |
|
37 |
<groupId>org.apache.maven.plugins</groupId> |
|
38 |
<artifactId>maven-jar-plugin</artifactId> |
|
39 |
<configuration> |
|
40 |
</configuration> |
|
41 |
<executions> |
|
42 |
<!-- |
|
43 |
Generates a jar file only with the test classes |
|
44 |
--> |
|
45 |
<execution> |
|
46 |
<goals> |
|
47 |
<goal>test-jar</goal> |
|
48 |
</goals> |
|
49 |
</execution> |
|
50 |
</executions> |
|
51 |
</plugin> |
|
52 |
</plugins> |
|
53 |
</build> |
|
54 |
</project> |
|
0 | 55 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/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.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterSwingLibrary.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 java.awt.Component; |
|
25 |
import java.util.List; |
|
26 |
|
|
27 |
import javax.swing.JOptionPane; |
|
28 |
|
|
29 |
import org.gvsig.i18n.Messages; |
|
30 |
import org.gvsig.tools.library.AbstractLibrary; |
|
31 |
import org.gvsig.tools.library.LibraryException; |
|
32 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
|
33 |
import org.slf4j.LoggerFactory; |
|
34 |
|
|
35 |
/** |
|
36 |
* Library for Swing API initialization and configuration. |
|
37 |
* |
|
38 |
* @author gvSIG team |
|
39 |
* @version $Id$ |
|
40 |
*/ |
|
41 |
public class RasterSwingLibrary extends AbstractLibrary { |
|
42 |
|
|
43 |
@Override |
|
44 |
protected void doInitialize() throws LibraryException { |
|
45 |
// Do nothing |
|
46 |
} |
|
47 |
|
|
48 |
@Override |
|
49 |
protected void doPostInitialize() throws LibraryException { |
|
50 |
// Validate there is any implementation registered. |
|
51 |
RasterSwingManager manager = |
|
52 |
RasterSwingLocator.getSwingManager(); |
|
53 |
if (manager == null) { |
|
54 |
throw new ReferenceNotRegisteredException( |
|
55 |
RasterSwingLocator.SWING_MANAGER_NAME, |
|
56 |
RasterSwingLocator.getInstance()); |
|
57 |
} |
|
58 |
} |
|
59 |
|
|
60 |
public static boolean messageBoxYesOrNot(String msg, Object parentWindow){ |
|
61 |
String string1 = Messages.getText("yes"); |
|
62 |
String string2 = Messages.getText("no"); |
|
63 |
Object[] options = {string1, string2}; |
|
64 |
Component parent = null; |
|
65 |
if(parentWindow instanceof Component) |
|
66 |
parent = (Component)parentWindow; |
|
67 |
int n = JOptionPane.showOptionDialog(parent, |
|
68 |
"<html>" + Messages.getText(msg).replaceAll("\n", "<br>") + "</html>", |
|
69 |
Messages.getText("confirmacion"), |
|
70 |
JOptionPane.YES_NO_OPTION, |
|
71 |
JOptionPane.QUESTION_MESSAGE, |
|
72 |
null, |
|
73 |
options, |
|
74 |
string1); |
|
75 |
if (n == JOptionPane.YES_OPTION) |
|
76 |
return true; |
|
77 |
else |
|
78 |
return false; |
|
79 |
} |
|
80 |
|
|
81 |
public static void messageBoxError(String msg, Object parentWindow) { |
|
82 |
String string = Messages.getText("accept"); |
|
83 |
Object[] options = {string}; |
|
84 |
Component parent = null; |
|
85 |
if(parentWindow instanceof Component) |
|
86 |
parent = (Component)parentWindow; |
|
87 |
JOptionPane.showOptionDialog(parent, |
|
88 |
"<html>" + Messages.getText(msg).replaceAll("\n", "<br>") + "</html>", |
|
89 |
Messages.getText("confirmacion"), |
|
90 |
JOptionPane.OK_OPTION, |
|
91 |
JOptionPane.ERROR_MESSAGE, |
|
92 |
null, |
|
93 |
options, |
|
94 |
string); |
|
95 |
} |
|
96 |
|
|
97 |
public static void messageBoxInfo(String msg, Object parentWindow) { |
|
98 |
String string = Messages.getText("accept"); |
|
99 |
Object[] options = {string}; |
|
100 |
Component parent = null; |
|
101 |
if(parentWindow instanceof Component) |
|
102 |
parent = (Component)parentWindow; |
|
103 |
JOptionPane.showOptionDialog(parent, |
|
104 |
"<html>" + Messages.getText(msg).replaceAll("\n", "<br>") + "</html>", |
|
105 |
Messages.getText("confirmacion"), |
|
106 |
JOptionPane.OK_OPTION, |
|
107 |
JOptionPane.INFORMATION_MESSAGE, |
|
108 |
null, |
|
109 |
options, |
|
110 |
string); |
|
111 |
} |
|
112 |
|
|
113 |
public static void debug(String msg, Object parent, Exception exception) { |
|
114 |
if(parent != null) |
|
115 |
LoggerFactory |
|
116 |
.getLogger(parent.getClass()).debug(Messages.getText(msg), exception); |
|
117 |
} |
|
118 |
|
|
119 |
public static void messageBoxError(String msg, Object parentWindow, Exception exception) { |
|
120 |
debug(msg, parentWindow, exception); |
|
121 |
messageBoxError(msg, parentWindow); |
|
122 |
} |
|
123 |
|
|
124 |
public static void messageBoxError(String msg, Object parentWindow, List<Exception> exception) { |
|
125 |
for (int i = 0; i < exception.size(); i++) |
|
126 |
debug(msg, parentWindow, exception.get(i)); |
|
127 |
messageBoxError(msg, parentWindow); |
|
128 |
} |
|
129 |
|
|
130 |
public static void messageBoxInfo(String msg, Object parentWindow, Exception exception) { |
|
131 |
debug(msg, parentWindow, exception); |
|
132 |
messageBoxInfo(msg, parentWindow); |
|
133 |
} |
|
134 |
|
|
135 |
public static boolean messageBoxYesOrNot(String msg, Object parentWindow, Exception exception) { |
|
136 |
debug(msg, parentWindow, exception); |
|
137 |
return messageBoxYesOrNot(msg, parentWindow); |
|
138 |
} |
|
139 |
|
|
140 |
} |
|
0 | 141 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/DataSourcePreview.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.preview; |
|
23 |
|
|
24 |
import java.awt.Graphics2D; |
|
25 |
import java.awt.geom.Rectangle2D; |
|
26 |
import java.awt.image.BufferedImage; |
|
27 |
|
|
28 |
import org.gvsig.gui.beans.imagenavigator.ImageUnavailableException; |
|
29 |
import org.gvsig.tools.task.Cancellable; |
|
30 |
|
|
31 |
/** |
|
32 |
* Data source for the raster preview |
|
33 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
34 |
*/ |
|
35 |
@SuppressWarnings("deprecation") |
|
36 |
public interface DataSourcePreview { |
|
37 |
|
|
38 |
public void draw(BufferedImage image, Graphics2D g, double[] coords, int w, int h, Cancellable cancel, double scale) throws ImageUnavailableException; |
|
39 |
|
|
40 |
public Rectangle2D getBBoxRectangle(); |
|
41 |
|
|
42 |
public double getCellSize(); |
|
43 |
|
|
44 |
public void closePreviewLayer(); |
|
45 |
|
|
46 |
public void pushStatus(); |
|
47 |
|
|
48 |
public void popStatus(); |
|
49 |
|
|
50 |
public DataSourcePreview cloneDataSourcePreview(); |
|
51 |
|
|
52 |
public Object getSource(); |
|
53 |
} |
|
0 | 54 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewRenderProcess.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.preview; |
|
23 |
|
|
24 |
import org.gvsig.gui.beans.imagenavigator.ImageUnavailableException; |
|
25 |
|
|
26 |
/** |
|
27 |
* Interfaz para el procesado del rendering antes de dibujar la preview. |
|
28 |
* El cliente puede obtener la lista de filtros del rendering de la imagen |
|
29 |
* que va a dibujarse como preview y modificarla para visulizar la preview |
|
30 |
* modificada. En caso de no modificar la preview se ver? la imagen sin variaciones |
|
31 |
* con respecto a la original. |
|
32 |
* |
|
33 |
* 19/02/2008 |
|
34 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
35 |
*/ |
|
36 |
public interface PreviewRenderProcess { |
|
37 |
|
|
38 |
/** |
|
39 |
* Procesado del rendering |
|
40 |
* @param rendering |
|
41 |
* @throws ImageUnavailable Cuando se ha producido un error y hay que mostrar un mensaje en la |
|
42 |
* previsualizaci?n porque no se puede mostrar la imagen |
|
43 |
*/ |
|
44 |
public void process(DataSourcePreview lyr) throws ImageUnavailableException; |
|
45 |
|
|
46 |
/** |
|
47 |
* Obtiene el flag que informa de si se est? mostrando la previsualizaci?n o no. |
|
48 |
* En caso de no mostrarse deber?a lanzarse una excepci?n ImageUnavailableExcepcion al |
|
49 |
* hacer un process. |
|
50 |
* @return |
|
51 |
*/ |
|
52 |
public boolean isShowPreview(); |
|
53 |
|
|
54 |
/** |
|
55 |
* Asigna el flag para mostrar u ocultar la preview. En caso de no mostrarse deber?a lanzarse una |
|
56 |
* excepci?n ImageUnavailableExcepcion cuando se hace un process. |
|
57 |
* @param showPreview |
|
58 |
*/ |
|
59 |
public void setShowPreview(boolean showPreview); |
|
60 |
} |
|
0 | 61 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewPanel.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.preview; |
|
23 |
|
|
24 |
import java.awt.Dimension; |
|
25 |
|
|
26 |
import javax.swing.JTabbedPane; |
|
27 |
|
|
28 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel; |
|
29 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener; |
|
30 |
import org.gvsig.gui.beans.imagenavigator.ImageNavigator; |
|
31 |
|
|
32 |
/** |
|
33 |
* Base interface for panels with preview |
|
34 |
* |
|
35 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
36 |
*/ |
|
37 |
public interface PreviewPanel { |
|
38 |
|
|
39 |
/** |
|
40 |
* Gets the data source of the preview |
|
41 |
* @return |
|
42 |
*/ |
|
43 |
public DataSourcePreview getDataSourcePreview(); |
|
44 |
|
|
45 |
/** |
|
46 |
* Obtiene el componente con los tabs donde se a?aden las pesta?as del usuario. |
|
47 |
* @return JTabbedPane |
|
48 |
*/ |
|
49 |
public JTabbedPane getTabbedPane(); |
|
50 |
|
|
51 |
/** |
|
52 |
* Obtener el objeto <code>ButtonsPanel</code> del <code>DialogPanel</code>. |
|
53 |
* En caso de no estar creado, lo crear?. |
|
54 |
* |
|
55 |
* @return El componente bp |
|
56 |
*/ |
|
57 |
public ButtonsPanel getButtonsPanel(); |
|
58 |
|
|
59 |
/** |
|
60 |
* Devuelve el componente para la vista previa |
|
61 |
* @return |
|
62 |
*/ |
|
63 |
public ImageNavigator getImageNavigator(); |
|
64 |
|
|
65 |
/** |
|
66 |
* Preview refresh |
|
67 |
*/ |
|
68 |
public void refreshPreview(); |
|
69 |
|
|
70 |
public void addButtonPressedListener(ButtonsPanelListener listener); |
|
71 |
|
|
72 |
/** |
|
73 |
* Sets the size of the preview |
|
74 |
* @param dimension |
|
75 |
*/ |
|
76 |
public void setPreviewSize(Dimension dimension); |
|
77 |
|
|
78 |
/** |
|
79 |
* Sets the data source for the preview. |
|
80 |
* |
|
81 |
* @param layer |
|
82 |
*/ |
|
83 |
public void setLayer(DataSourcePreview fLayer); |
|
84 |
|
|
85 |
/** |
|
86 |
* Initializes the preview size and coordinates. This function should |
|
87 |
* be called after the window has been opened because this call |
|
88 |
* assigns the size of the preview panel. |
|
89 |
* |
|
90 |
* @param layer |
|
91 |
*/ |
|
92 |
public void previewInitializeSizes(); |
|
93 |
|
|
94 |
/** |
|
95 |
* Cierra la capa abierta para previsualizaci?n |
|
96 |
*/ |
|
97 |
public void closePreviewLayer(); |
|
98 |
} |
|
0 | 99 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewBasePanelTab.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.preview; |
|
23 |
|
|
24 |
import javax.swing.JPanel; |
|
25 |
|
|
26 |
|
|
27 |
/** |
|
28 |
* Interfaz que implementan los paneles que se incorporan al PreviewBasePanel |
|
29 |
* |
|
30 |
* 19/02/2008 |
|
31 |
* @author Nacho Brodin nachobrodin@gmail.com |
|
32 |
*/ |
|
33 |
public interface PreviewBasePanelTab { |
|
34 |
/** |
|
35 |
* Obtiene el t?tulo del panel. Esta ser? la etiqueta que se ponga en |
|
36 |
* la pesta?a del tab. |
|
37 |
* @return Cadena con el t?tulo. |
|
38 |
*/ |
|
39 |
public String getTitle(); |
|
40 |
|
|
41 |
/** |
|
42 |
* Obtiene el panel que se a?ade en el tab |
|
43 |
* @return JPanel |
|
44 |
*/ |
|
45 |
public JPanel getPanel(); |
|
46 |
} |
|
0 | 47 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderListener.java | ||
---|---|---|
1 |
package org.gvsig.raster.swing.slider; |
|
2 |
|
|
3 |
import java.util.EventListener; |
|
4 |
|
|
5 |
public interface SliderListener extends EventListener { |
|
6 |
/** |
|
7 |
* Evento que se dispara cuando cambia el valor del componente. Nunca |
|
8 |
* se dispara mientras se hace un dragged con el rat?n. |
|
9 |
* @param e |
|
10 |
*/ |
|
11 |
public void actionValueChanged(SliderEvent e); |
|
12 |
|
|
13 |
/** |
|
14 |
* Evento que se dispara cuando cambia el valor del componente mientras se |
|
15 |
* hace un dragged con el rat?n. |
|
16 |
* @param e |
|
17 |
*/ |
|
18 |
public void actionValueDragged(SliderEvent e); |
|
19 |
} |
|
0 | 20 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderEvent.java | ||
---|---|---|
1 |
package org.gvsig.raster.swing.slider; |
|
2 |
|
|
3 |
import java.util.EventObject; |
|
4 |
|
|
5 |
public class SliderEvent extends EventObject { |
|
6 |
private static final long serialVersionUID = -128111523373280522L; |
|
7 |
|
|
8 |
/** |
|
9 |
* Construye un SliderEvent |
|
10 |
* @param source |
|
11 |
*/ |
|
12 |
public SliderEvent(Object source) { |
|
13 |
super(source); |
|
14 |
} |
|
15 |
} |
|
0 | 16 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderText.java | ||
---|---|---|
1 |
package org.gvsig.raster.swing.slider; |
|
2 |
|
|
3 |
import javax.swing.JComponent; |
|
4 |
|
|
5 |
import org.gvsig.gui.beans.slidertext.listeners.SliderListener; |
|
6 |
|
|
7 |
public interface SliderText { |
|
8 |
|
|
9 |
/** |
|
10 |
* Adds a listener to receive changes in this component |
|
11 |
* @param listener |
|
12 |
*/ |
|
13 |
public void addValueChangedListener(SliderListener listener); |
|
14 |
|
|
15 |
/** |
|
16 |
* Obtiene el valor del control. |
|
17 |
* @return Valor del control en formato double. |
|
18 |
*/ |
|
19 |
public double getValue(); |
|
20 |
|
|
21 |
/** |
|
22 |
* Asigna el valor del control. |
|
23 |
* @return Valor del control en formato double. |
|
24 |
*/ |
|
25 |
public void setValue(double value); |
|
26 |
|
|
27 |
/** |
|
28 |
* Activa o desactiva el control del panel |
|
29 |
* @param active |
|
30 |
*/ |
|
31 |
public void setControlEnabled(boolean active); |
|
32 |
|
|
33 |
/** |
|
34 |
* Asigna el flag que dice si el valor del campo de texto ser? |
|
35 |
* decimal o entero |
|
36 |
* @param dec true si se admiten valores decimales y false si no se admiten |
|
37 |
*/ |
|
38 |
public void setDecimal (boolean dec); |
|
39 |
|
|
40 |
/** |
|
41 |
* Obtiene el flag que dice si el valor del campo de texto es |
|
42 |
* decimal o entero |
|
43 |
* @return true si se admiten valores decimales y false si no se admiten |
|
44 |
*/ |
|
45 |
public boolean getDecimal (); |
|
46 |
|
|
47 |
/** |
|
48 |
* Obtiene el valor m?ximo del slider |
|
49 |
* @return Entero con el valor m?ximo |
|
50 |
*/ |
|
51 |
public int getMax(); |
|
52 |
|
|
53 |
/** |
|
54 |
* Asigna el valor m?ximo del slider |
|
55 |
* @param Entero con el valor m?ximo |
|
56 |
*/ |
|
57 |
public void setMaximum(int max); |
|
58 |
|
|
59 |
/** |
|
60 |
* Obtiene el valor m?nimo del slider |
|
61 |
* @return Entero con el valor m?nimo |
|
62 |
*/ |
|
63 |
public int getMin(); |
|
64 |
|
|
65 |
/** |
|
66 |
* Asigna el valor m?nimo del slider |
|
67 |
* @param Entero con el valor m?nimo |
|
68 |
*/ |
|
69 |
public void setMinimum(int min); |
|
70 |
|
|
71 |
/** |
|
72 |
* Definir un intervalo para el slider |
|
73 |
* @param value |
|
74 |
*/ |
|
75 |
public void setInterval(double value); |
|
76 |
|
|
77 |
/** |
|
78 |
* Obtener el intervalo definido para el slider |
|
79 |
* @return |
|
80 |
*/ |
|
81 |
public double getInterval(); |
|
82 |
|
|
83 |
/** |
|
84 |
* Asigna un borde al componente con el texto pasado como |
|
85 |
* par?metro |
|
86 |
* @param name |
|
87 |
*/ |
|
88 |
public void setBorder(String name); |
|
89 |
|
|
90 |
public JComponent getComponent(); |
|
91 |
} |
|
0 | 92 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/StraightLine.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.gcanvas; |
|
23 |
|
|
24 |
|
|
25 |
/** |
|
26 |
* Graphic layer to paint a straight line |
|
27 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
28 |
*/ |
|
29 |
public interface StraightLine extends BaseFunction { |
|
30 |
/** |
|
31 |
* En una funci?n lineal da igual lo que devuelva, pero es interesante para sus |
|
32 |
* clases derivadas |
|
33 |
* @return |
|
34 |
*/ |
|
35 |
public double getValueFunction(); |
|
36 |
|
|
37 |
/** |
|
38 |
* Borra la lista de puntos |
|
39 |
*/ |
|
40 |
public void clearSquares(); |
|
41 |
|
|
42 |
/** |
|
43 |
* A?ade un punto a la lista de puntos |
|
44 |
* @param x |
|
45 |
* @param y |
|
46 |
*/ |
|
47 |
public void addSquare(double x, double y); |
|
48 |
|
|
49 |
/** |
|
50 |
* Valores de los datos de entrada correspondientes al m?nimo y al m?ximo de |
|
51 |
* cada tramo devuelto en forma de porcentaje |
|
52 |
* |
|
53 |
* @param min |
|
54 |
* @param max |
|
55 |
* @return |
|
56 |
*/ |
|
57 |
public double[] getPercentInValues(); |
|
58 |
|
|
59 |
/** |
|
60 |
* Valores de los datos de salida correspondientes al m?nimo y al m?ximo de |
|
61 |
* cada tramo, devueltos en forma de porcentaje. |
|
62 |
* @return |
|
63 |
*/ |
|
64 |
public double[] getPercentOutValues(); |
|
65 |
|
|
66 |
/** |
|
67 |
* Valores de los datos de entrada correspondientes al m?nimo y al m?ximo de |
|
68 |
* cada tramo. Estos tendr?n un rango entre el m?nimo y el m?ximo en cada |
|
69 |
* banda de la imagen. |
|
70 |
* @param min |
|
71 |
* @param max |
|
72 |
* @return |
|
73 |
*/ |
|
74 |
public double[] getInValues(double min, double max); |
|
75 |
|
|
76 |
/** |
|
77 |
* Valores de los datos de salida correspondientes al m?nimo y al m?ximo de |
|
78 |
* cada tramo. Estos tendr?n un rango entre 0 y 255. |
|
79 |
* @return |
|
80 |
*/ |
|
81 |
public int[] getOutValues(); |
|
82 |
|
|
83 |
/** |
|
84 |
* Devuelve 0 para indicar que estamos en una funcion lineal. |
|
85 |
* @return |
|
86 |
*/ |
|
87 |
public int getFunctionType(); |
|
88 |
} |
|
0 | 89 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/BaseFunction.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.gcanvas; |
|
23 |
|
|
24 |
/** |
|
25 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
26 |
*/ |
|
27 |
public interface BaseFunction { |
|
28 |
|
|
29 |
} |
|
0 | 30 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/DensitySlicingLine.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.gcanvas; |
|
23 |
|
|
24 |
/** |
|
25 |
* Graphic layer to paint a straight line |
|
26 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
27 |
*/ |
|
28 |
public interface DensitySlicingLine extends BaseFunction { |
|
29 |
/** |
|
30 |
* Pone la forma a la l?nea escalonada dependiendo del n?mero de |
|
31 |
* escalones existentes. |
|
32 |
* |
|
33 |
* @param levels |
|
34 |
*/ |
|
35 |
public void setShape(int levels); |
|
36 |
|
|
37 |
/** |
|
38 |
* @return the levels |
|
39 |
*/ |
|
40 |
public int getLevels(); |
|
41 |
} |
|
0 | 42 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/IGCanvasListener.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.gcanvas; |
|
23 |
|
|
24 |
import java.util.EventListener; |
|
25 |
/** |
|
26 |
* Listener que deben implementar las clases que quieran recibir cambios |
|
27 |
* del GCanvas. |
|
28 |
* |
|
29 |
* @version 28/02/2008 |
|
30 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
|
31 |
*/ |
|
32 |
public interface IGCanvasListener extends EventListener { |
|
33 |
/** |
|
34 |
* Evento que se dispara cuando el GCanvas cambia el valor de alg?n elemento |
|
35 |
* @param e |
|
36 |
*/ |
|
37 |
public void actionDataChanged(GCanvasEvent e); |
|
38 |
|
|
39 |
/** |
|
40 |
* Evento que se dispara mientras se esta produciendo la acci?n |
|
41 |
* @param e |
|
42 |
*/ |
|
43 |
public void actionDataDragged(GCanvasEvent e); |
|
44 |
} |
|
0 | 45 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GCanvas.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.gcanvas; |
|
23 |
|
|
24 |
import java.awt.Color; |
|
25 |
import java.awt.Graphics; |
|
26 |
import java.awt.event.MouseListener; |
|
27 |
import java.awt.event.MouseMotionListener; |
|
28 |
import java.util.List; |
|
29 |
|
|
30 |
/** |
|
31 |
* Canvas where graphic elements are painted |
|
32 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
33 |
*/ |
|
34 |
public interface GCanvas extends MouseListener, MouseMotionListener { |
|
35 |
/** |
|
36 |
* Creates a border layer to the graphic canvas |
|
37 |
* @param color |
|
38 |
* @return |
|
39 |
*/ |
|
40 |
public DrawableElement createBorderLayerForGCanvas(Color color); |
|
41 |
|
|
42 |
/** |
|
43 |
* Creates a information layer for the graphic canvas |
|
44 |
* @param colorLayer |
|
45 |
* @return |
|
46 |
*/ |
|
47 |
public InfoLayer createInfoLayerForGCanvas(Color colorLayer); |
|
48 |
|
|
49 |
/** |
|
50 |
* Creates a histogram for the graphic canvas |
|
51 |
* @param data |
|
52 |
* @param color |
|
53 |
* @return |
|
54 |
*/ |
|
55 |
public GraphicHistogram createHistogramForGCanvas(double[] data, Color color); |
|
56 |
|
|
57 |
/** |
|
58 |
* Creates a minmax layer for the graphic canvas |
|
59 |
* @param color |
|
60 |
* @return |
|
61 |
*/ |
|
62 |
public MinMaxLines createMinMaxLinesForGCanvas(Color color); |
|
63 |
|
|
64 |
/** |
|
65 |
* Creates a straight line layer for the graphic canvas |
|
66 |
* @param color |
|
67 |
* @return |
|
68 |
*/ |
|
69 |
public StraightLine createStraightLineForGCanvas(Color color); |
|
70 |
|
|
71 |
/** |
|
72 |
* Creates a logaritmic or exponential function layer for the graphic canvas |
|
73 |
* @param color |
|
74 |
* @return |
|
75 |
*/ |
|
76 |
public LogaritmicExponentialLine createLogaritmicExponentialLineForGCanvas(Color color, double point); |
|
77 |
|
|
78 |
/** |
|
79 |
* Creates a square root or pow line function for the graphic canvas |
|
80 |
* @param color |
|
81 |
* @return |
|
82 |
*/ |
|
83 |
public SquareRootPowLine createSquareRootPowLineForGCanvas(Color color, double point); |
|
84 |
|
|
85 |
/** |
|
86 |
* Creates a density slice function for the graphic canvas |
|
87 |
* @param color |
|
88 |
* @return |
|
89 |
*/ |
|
90 |
public DensitySlicingLine createDensitySliceForGCanvas(Color color, int levels); |
|
91 |
|
|
92 |
|
|
93 |
public void addBorder(int x1, int y1, int x2, int y2); |
|
94 |
|
|
95 |
/** |
|
96 |
* A?adir un listener a la lista de eventos |
|
97 |
* @param listener |
|
98 |
*/ |
|
99 |
public void addValueChangedListener(IGCanvasListener listener); |
|
100 |
|
|
101 |
/** |
|
102 |
* Borrar un listener de la lista de eventos |
|
103 |
* @param listener |
|
104 |
*/ |
|
105 |
public void removeValueChangedListener(IGCanvasListener listener); |
|
106 |
|
|
107 |
/** |
|
108 |
* Invocar a los eventos asociados al componente |
|
109 |
*/ |
|
110 |
public void callDataChanged(String key, Object value); |
|
111 |
|
|
112 |
/** |
|
113 |
* Invocar a los eventos asociados al componente |
|
114 |
*/ |
|
115 |
public void callDataDragged(String key, Object value); |
|
116 |
|
|
117 |
/** |
|
118 |
* A?ade un elemento dibujable a la lista |
|
119 |
* @param element |
|
120 |
*/ |
|
121 |
public void addDrawableElement(DrawableElement element); |
|
122 |
|
|
123 |
/** |
|
124 |
* Reemplaza un elemento dibujable si encuentra uno de su mismo tipo |
|
125 |
* @param element |
|
126 |
*/ |
|
127 |
public void replaceDrawableElement(DrawableElement element); |
|
128 |
|
|
129 |
/** |
|
130 |
* Obtiene todos los elementos dibujable que sean una instancia de c1 |
|
131 |
* @param c1 |
|
132 |
* @return ArrayList de DrawableElements |
|
133 |
*/ |
|
134 |
public List<DrawableElement> getDrawableElements(Class<?> c1); |
|
135 |
|
|
136 |
/** |
|
137 |
* Reemplaza un elemento dibujable si encuentra uno del tipo especificado en el |
|
138 |
* parametro c1 |
|
139 |
* @param element |
|
140 |
* @param c1 |
|
141 |
*/ |
|
142 |
public void replaceDrawableElement(DrawableElement element, Class<?> cl); |
|
143 |
|
|
144 |
/** |
|
145 |
* Elimina un elemento dibujable |
|
146 |
* @param Class clase del elemento a eliminar |
|
147 |
*/ |
|
148 |
public void removeDrawableElement(Class<?> cl); |
|
149 |
|
|
150 |
/** |
|
151 |
* Asigna una lista de elementos dibujables |
|
152 |
* @return |
|
153 |
*/ |
|
154 |
public void setDrawableElements(List<DrawableElement> list); |
|
155 |
|
|
156 |
/** |
|
157 |
* Inicializa el fondo y dibuja el gr?fico sobre el canvas. |
|
158 |
*/ |
|
159 |
public void paint(Graphics g); |
|
160 |
|
|
161 |
/** |
|
162 |
* Ejecuta las acciones antes del primer dibujado de todos |
|
163 |
* los elementos dibujables |
|
164 |
*/ |
|
165 |
public void execFirstDrawActions(); |
|
166 |
|
|
167 |
/** |
|
168 |
* Obtiene la posici?n m?nima en X del canvas donde comenzar a dibujar |
|
169 |
* @return |
|
170 |
*/ |
|
171 |
public int getCanvasMinX(); |
|
172 |
|
|
173 |
/** |
|
174 |
* Obtiene la posici?n m?nima en Y del canvas donde comenzar a dibujar |
|
175 |
* @return |
|
176 |
*/ |
|
177 |
public int getCanvasMinY(); |
|
178 |
|
|
179 |
/** |
|
180 |
* Obtiene la posici?n m?xima en X del canvas donde terminar el dibujado |
|
181 |
* @return |
|
182 |
*/ |
|
183 |
public int getCanvasMaxX(); |
|
184 |
|
|
185 |
/** |
|
186 |
* Obtiene la posici?n m?xima en Y del canvas donde terminar el dibujado |
|
187 |
* @return |
|
188 |
*/ |
|
189 |
public int getCanvasMaxY(); |
|
190 |
|
|
191 |
/** |
|
192 |
* Obtiene el ancho del canvas sumando a partir de getCanvasX donde termina el ?rea de dibujo |
|
193 |
* @return |
|
194 |
*/ |
|
195 |
public int getCanvasWidth(); |
|
196 |
|
|
197 |
/** |
|
198 |
* Obtiene el alto del canvas sumando a partir de getCanvasY donde termina el ?rea de dibujo |
|
199 |
* @return |
|
200 |
*/ |
|
201 |
public int getCanvasHeight(); |
|
202 |
} |
|
0 | 203 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/SquareRootPowLine.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.gcanvas; |
|
23 |
|
|
24 |
/** |
|
25 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
26 |
*/ |
|
27 |
public interface SquareRootPowLine extends BaseFunction { |
|
28 |
|
|
29 |
} |
|
0 | 30 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GCanvasEvent.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.gcanvas; |
|
23 |
|
|
24 |
import java.util.EventObject; |
|
25 |
/** |
|
26 |
* Clase que contiene la informaci?n que se produce al dispararse un evento |
|
27 |
* en el GCanvas |
|
28 |
* |
|
29 |
* @version 28/02/2008 |
|
30 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
|
31 |
*/ |
|
32 |
public class GCanvasEvent extends EventObject { |
|
33 |
private static final long serialVersionUID = 1654248992170060578L; |
|
34 |
private String key; |
|
35 |
private Object value; |
|
36 |
|
|
37 |
public GCanvasEvent(Object source, String key, Object value) { |
|
38 |
super(source); |
|
39 |
this.key = key; |
|
40 |
this.value = value; |
|
41 |
} |
|
42 |
|
|
43 |
/** |
|
44 |
* @return the key |
|
45 |
*/ |
|
46 |
public String getKey() { |
|
47 |
return key; |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* @return the value |
|
52 |
*/ |
|
53 |
public Object getValue() { |
|
54 |
return value; |
|
55 |
} |
|
56 |
} |
|
0 | 57 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/MinMaxLines.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.gcanvas; |
|
23 |
|
|
24 |
/** |
|
25 |
* Graphic layer to paint a two lines with the maximum and the minumun |
|
26 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
27 |
*/ |
|
28 |
public abstract class MinMaxLines extends DrawableElement { |
|
29 |
public abstract void setMinimum(double min); |
|
30 |
|
|
31 |
public abstract void setMaximum(double max); |
|
32 |
} |
|
0 | 33 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/InfoLayer.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.gcanvas; |
|
23 |
|
|
24 |
/** |
|
25 |
* Graphic layer to paint a layer of information |
|
26 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
27 |
*/ |
|
28 |
public abstract class InfoLayer extends DrawableElement { |
|
29 |
/** |
|
30 |
* Sets the maximum and minimum values for this layer |
|
31 |
* @param min |
|
32 |
* @param max |
|
33 |
*/ |
|
34 |
public abstract void setLimits(double min, double max); |
|
35 |
} |
|
0 | 36 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/LogaritmicExponentialLine.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.gcanvas; |
|
23 |
|
|
24 |
/** |
|
25 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
26 |
*/ |
|
27 |
public interface LogaritmicExponentialLine extends BaseFunction { |
|
28 |
/** |
|
29 |
* Devuelve si esta usando la funcion logaritmica |
|
30 |
* @return |
|
31 |
*/ |
|
32 |
public boolean isLogaritmical(); |
|
33 |
|
|
34 |
/** |
|
35 |
* Devuelve si esta usando la funcion exponencial |
|
36 |
* @return |
|
37 |
*/ |
|
38 |
public boolean isExponencial(); |
|
39 |
} |
|
0 | 40 |
org.gvsig.raster/tags/org.gvsig.raster-2.2.77/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/DrawableElement.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.gcanvas; |
|
23 |
|
|
24 |
import java.awt.Color; |
|
25 |
import java.awt.Graphics; |
|
26 |
import java.awt.event.MouseEvent; |
|
27 |
/** |
|
28 |
* Clase base para los gr?ficos a dibujar sobre el canvas |
|
29 |
* |
|
30 |
* 14-oct-2007 |
|
31 |
* @author Nacho Brodin (nachobrodin@gmail.com) |
|
32 |
*/ |
|
33 |
public abstract class DrawableElement { |
|
34 |
protected Color color = Color.BLACK; |
|
35 |
private boolean firstDraw = true; |
|
36 |
private boolean drawing = true; |
|
37 |
|
|
38 |
/** |
|
39 |
* Entorno donde se dibuja |
|
40 |
*/ |
|
41 |
protected GCanvas canvas = null; |
|
42 |
|
|
43 |
/** |
|
44 |
* Dibujado del elemento gr?fico desde el GCanvas. Llamar? antes de dibujar a |
|
45 |
* la funci?n firstDrawActions |
|
46 |
* @param g |
|
47 |
*/ |
|
48 |
public void draw(Graphics g) { |
|
49 |
if(!drawing) |
|
50 |
return; |
|
51 |
if (firstDraw) { |
|
52 |
firstDrawActions(); |
|
53 |
firstDraw = false; |
|
54 |
} |
|
55 |
paint(g); |
|
56 |
} |
|
57 |
|
|
58 |
/** |
|
59 |
* Asigna el flag de dibujado del elemento gr?fico |
|
60 |
* @param draw |
|
61 |
*/ |
|
62 |
public void setDrawing(boolean drawing) { |
|
63 |
this.drawing = drawing; |
|
64 |
} |
|
65 |
|
|
66 |
/** |
|
67 |
* Obtiene el flag que informa si el elemento gr?fico est? dibujandose |
|
68 |
* o no. |
|
69 |
* @return |
|
70 |
*/ |
|
71 |
public boolean isDrawing() { |
|
72 |
return this.drawing; |
|
73 |
} |
|
74 |
|
|
75 |
/** |
|
76 |
* Dibujado del elemento gr?fico |
|
77 |
* @param g |
|
78 |
*/ |
|
79 |
protected abstract void paint(Graphics g); |
|
80 |
|
|
81 |
/** |
|
82 |
* Acciones a ejecutar al asignar el canvas |
|
83 |
*/ |
|
84 |
public abstract void firstActions(); |
|
85 |
|
|
86 |
/** |
|
87 |
* Acciones a ejecutar antes del primer dibujado |
|
88 |
*/ |
|
89 |
public abstract void firstDrawActions(); |
|
90 |
|
|
91 |
/** |
|
92 |
* Asigna el objeto JComponent donde se pintan los elementos. |
|
93 |
* @param canvas |
|
94 |
*/ |
|
95 |
public void setCanvas(GCanvas canvas) { |
|
96 |
this.canvas = canvas; |
|
97 |
} |
|
98 |
|
|
99 |
/** |
|
100 |
* Asigna el color de la l?nea |
|
101 |
* @param c Color |
|
102 |
*/ |
|
103 |
public void setColor(Color c) { |
|
104 |
this.color = c; |
Also available in: Unified diff