Revision 11507
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/filter/ui/RasterFilterDialog.java | ||
---|---|---|
50 | 50 |
private int width = 0; |
51 | 51 |
private int height = 0; |
52 | 52 |
private RasterFilterPanel filterPanel = null; |
53 |
private FLayer fLayer = null; |
|
54 | 53 |
|
55 | 54 |
/** |
56 | 55 |
* Constructor |
... | ... | |
61 | 60 |
public RasterFilterDialog(FLayer layer, int width, int height) { |
62 | 61 |
this.width = width; |
63 | 62 |
this.height = height; |
64 |
this.fLayer = layer; |
|
65 | 63 |
|
66 | 64 |
this.setLayout(new BorderLayout()); |
67 | 65 |
this.add(getPFilter(), BorderLayout.CENTER); |
68 | 66 |
} |
67 |
|
|
68 |
public void setLayer(FLayer layer) { |
|
69 |
filterPanel.setLayer(layer); |
|
70 |
} |
|
69 | 71 |
|
70 | 72 |
/** |
71 | 73 |
* Obtiene el panel de filtros |
... | ... | |
83 | 85 |
* @see com.iver.mdiApp.ui.MDIManager.View#getViewInfo() |
84 | 86 |
*/ |
85 | 87 |
public WindowInfo getWindowInfo() { |
86 |
WindowInfo m_viewinfo=new WindowInfo(WindowInfo.MODALDIALOG); |
|
88 |
WindowInfo m_viewinfo=new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
|
|
87 | 89 |
m_viewinfo.setTitle(PluginServices.getText(this, "Filtros")); |
88 | 90 |
m_viewinfo.setWidth(width); |
89 | 91 |
m_viewinfo.setHeight(height); |
... | ... | |
244 | 246 |
String filterName = getSelector().getMap().get(model.getElementAt(iListFilter).toString()).toString(); |
245 | 247 |
addFilterByName(filterName); |
246 | 248 |
} |
247 |
fLayer.getMapContext().invalidate(); |
|
248 | 249 |
} |
249 | 250 |
|
250 | 251 |
//Al pulsar Cerrar o Aceptar la ventana se cierra |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/filter/ui/RasterFilterPanel.java | ||
---|---|---|
36 | 36 |
|
37 | 37 |
import javax.swing.JPanel; |
38 | 38 |
|
39 |
import org.gvsig.fmap.layers.FLyrRasterSE; |
|
39 | 40 |
import org.gvsig.gui.beans.buttonspanel.ButtonsPanel; |
40 | 41 |
import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel; |
41 | 42 |
import org.gvsig.gui.beans.imagenavigator.IClientImageNavigator; |
42 | 43 |
import org.gvsig.gui.beans.imagenavigator.ImageNavigator; |
43 | 44 |
import org.gvsig.gui.beans.treelist.TreeListContainer; |
45 |
import org.gvsig.raster.grid.render.Rendering; |
|
44 | 46 |
import org.gvsig.raster.shared.Extent; |
45 | 47 |
import org.gvsig.raster.shared.ViewPortData; |
46 | 48 |
|
47 | 49 |
import com.iver.andami.PluginServices; |
48 | 50 |
import com.iver.cit.gvsig.fmap.ViewPort; |
51 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
49 | 52 |
|
50 | 53 |
/** |
51 | 54 |
* @author Nacho Brodin <brodin_ign@gva.es> |
... | ... | |
55 | 58 |
private TreeListContainer pSelector = null; |
56 | 59 |
private JPanel pSelectedFilter = null; |
57 | 60 |
private JPanel pPreview = null; |
61 |
private ImageNavigator imageNavigator = null; |
|
58 | 62 |
|
63 |
private FLayer fLayer = null; |
|
64 |
|
|
59 | 65 |
/** |
60 | 66 |
* Titulo del panel. Este aparece en el Borde del panel. |
61 | 67 |
*/ |
... | ... | |
78 | 84 |
initialize(); |
79 | 85 |
} |
80 | 86 |
|
87 |
public void setLayer(FLayer layer) { |
|
88 |
this.fLayer = layer; |
|
89 |
|
|
90 |
Extent extent2 = ((FLyrRasterSE) fLayer).getDatasource().getExtent(); |
|
91 |
getImageNavigator().setViewDimensions(extent2.getMin().getX(), extent2.getMax().getY(), extent2.getMax().getX(), extent2.getMin().getY()); |
|
92 |
getImageNavigator().setZoom(1.0/((FLyrRasterSE) fLayer).getDatasource().getXCellSize()); |
|
93 |
getImageNavigator().updateBuffer(); |
|
94 |
} |
|
95 |
|
|
81 | 96 |
/** |
82 | 97 |
* This method initializes this |
83 | 98 |
* |
... | ... | |
89 | 104 |
this.add(getPPreview(), BorderLayout.EAST); |
90 | 105 |
} |
91 | 106 |
|
107 |
public ImageNavigator getImageNavigator() { |
|
108 |
if (imageNavigator == null) { |
|
109 |
imageNavigator = new ImageNavigator(this); |
|
110 |
imageNavigator.setFocusable(true); |
|
111 |
} |
|
112 |
return imageNavigator; |
|
113 |
} |
|
114 |
|
|
92 | 115 |
private JPanel getPPreview() { |
93 | 116 |
if (pPreview == null) { |
94 | 117 |
pPreview = new JPanel(); |
95 |
pPreview.setPreferredSize(new Dimension(180, 0)); |
|
96 |
pPreview.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "vista_previa"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
|
97 |
ImageNavigator pPreviewComp = new ImageNavigator(this, 0.0, 0.0, 1.0); |
|
98 |
pPreview.setLayout(new BorderLayout()); |
|
99 |
pPreview.add(pPreviewComp, BorderLayout.CENTER); |
|
118 |
JPanel jsubpanel = new JPanel(); |
|
119 |
|
|
120 |
pPreview.add(jsubpanel, BorderLayout.NORTH); |
|
121 |
|
|
122 |
jsubpanel.setPreferredSize(new Dimension(180, 180)); |
|
123 |
jsubpanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, PluginServices.getText(this, "vista_previa"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); |
|
124 |
jsubpanel.setLayout(new BorderLayout()); |
|
125 |
jsubpanel.add(getImageNavigator(), BorderLayout.CENTER); |
|
100 | 126 |
} |
101 | 127 |
return pPreview; |
102 | 128 |
} |
... | ... | |
253 | 279 |
} |
254 | 280 |
|
255 | 281 |
public void drawImage(Graphics2D g, double x1, double y1, double x2, double y2, double zoom, int width, int height) { |
256 |
/* |
|
282 |
if (fLayer == null) |
|
283 |
return; |
|
284 |
|
|
285 |
Rendering rendering = ((FLyrRasterSE) fLayer).getSource().getRender(); |
|
286 |
|
|
257 | 287 |
if ((rendering == null) || ((x2 - x1) == 0.0) || ((y2 - y1) == 0.0)) |
258 | 288 |
return; |
259 | 289 |
ViewPort vp = new ViewPort(null); |
... | ... | |
264 | 294 |
ViewPortData vp2 = new ViewPortData(vp.getProjection(), extent, dimension); |
265 | 295 |
vp2.setMat(new AffineTransform(zoom, 0.0, 0.0, zoom, -x1*zoom, -y1*zoom)); |
266 | 296 |
rendering.draw(g, vp2); |
267 |
*/ |
|
268 | 297 |
} |
269 | 298 |
} |
trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/filter/FilterTocMenuEntry.java | ||
---|---|---|
143 | 143 |
|
144 | 144 |
// Cargamos el panel que es visible para el usuario |
145 | 145 |
loadVisiblePanel(); |
146 |
|
|
147 |
rasterFilterDialog.setLayer(lyr); |
|
146 | 148 |
|
147 | 149 |
PluginServices.getMDIManager().addWindow(rasterFilterDialog); |
148 | 150 |
} |
trunk/extensions/extRasterTools-SE/src-test-ui/org/gvsig/imagenavigator/TestImageNavigator.java | ||
---|---|---|
100 | 100 |
|
101 | 101 |
private ImageNavigator getImageNavigator() { |
102 | 102 |
if (imageNavigator == null) { |
103 |
imageNavigator = new ImageNavigator(this, 0.0, 0.0, 1.0);
|
|
103 |
imageNavigator = new ImageNavigator(this); |
|
104 | 104 |
} |
105 | 105 |
return imageNavigator; |
106 | 106 |
} |
trunk/extensions/extRasterTools-SE/src-test-ui/org/gvsig/rastertools/filter/TestFilterRasterPanel.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
*/ |
|
19 |
package org.gvsig.rastertools.filter; |
|
20 |
|
|
21 |
import javax.swing.JFrame; |
|
22 |
import javax.swing.UIManager; |
|
23 |
|
|
24 |
import org.gvsig.rastertools.filter.ui.RasterFilterPanel; |
|
25 |
/** |
|
26 |
* Clase para poder ver la ventana de HistrogramPanel |
|
27 |
* |
|
28 |
* @version 17/04/2007 |
|
29 |
* @author Borja S?nchez Zamorano (borja.sanchez@iver.es) |
|
30 |
*/ |
|
31 |
public class TestFilterRasterPanel { |
|
32 |
private JFrame frame = new JFrame(); |
|
33 |
private RasterFilterPanel hp = null; |
|
34 |
|
|
35 |
public TestFilterRasterPanel() { |
|
36 |
super(); |
|
37 |
initialize(); |
|
38 |
} |
|
39 |
|
|
40 |
public static void main(String[] args){ |
|
41 |
try { |
|
42 |
UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); |
|
43 |
} catch( Exception e ) { |
|
44 |
System.err.println( "No se puede cambiar al LookAndFeel"); |
|
45 |
} |
|
46 |
new TestFilterRasterPanel(); |
|
47 |
} |
|
48 |
|
|
49 |
private void initialize() { |
|
50 |
frame.setSize(new java.awt.Dimension(620,310)); |
|
51 |
hp = new RasterFilterPanel(); |
|
52 |
|
|
53 |
// hp.clearSources(); |
|
54 |
|
|
55 |
// Par?metros de inicializaci?n del histograma |
|
56 |
// hp.setRGBInBandList(true); //Asignaci?n R,G,B en el combo |
|
57 |
// hp.firstRun(); // Mostar por primera vez el histograma |
|
58 |
|
|
59 |
frame.setContentPane(hp); |
|
60 |
frame.setResizable(true); |
|
61 |
frame.setTitle("Histogramas"); |
|
62 |
frame.setVisible(true); |
|
63 |
frame.addWindowListener(new java.awt.event.WindowAdapter() { |
|
64 |
public void windowClosing(java.awt.event.WindowEvent e) { |
|
65 |
System.exit(0); |
|
66 |
} |
|
67 |
}); |
|
68 |
} |
|
69 |
} |
|
0 | 70 |
trunk/extensions/extRasterTools-SE/src-test-ui/org/gvsig/rastertools/histogram/TestHistogramPanel.java | ||
---|---|---|
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
2 |
* |
|
3 |
* Copyright (C) 2007 IVER T.I. and Generalitat Valenciana. |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
18 |
*/ |
|
19 |
package org.gvsig.rastertools.histogram; |
|
20 |
|
|
21 |
import javax.swing.JFrame; |
|
22 |
import javax.swing.UIManager; |
|
23 |
|
|
24 |
import org.gvsig.rastertools.histogram.ui.HistogramPanel; |
|
25 |
/** |
|
26 |
* Clase para poder ver la ventana de HistrogramPanel |
|
27 |
* |
|
28 |
* @version 17/04/2007 |
|
29 |
* @author Borja S?nchez Zamorano (borja.sanchez@iver.es) |
|
30 |
*/ |
|
31 |
public class TestHistogramPanel { |
|
32 |
private JFrame frame = new JFrame(); |
|
33 |
private HistogramPanel hp = null; |
|
34 |
|
|
35 |
public TestHistogramPanel() { |
|
36 |
super(); |
|
37 |
initialize(); |
|
38 |
} |
|
39 |
|
|
40 |
public static void main(String[] args){ |
|
41 |
try { |
|
42 |
UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel"); |
|
43 |
} catch( Exception e ) { |
|
44 |
System.err.println( "No se puede cambiar al LookAndFeel"); |
|
45 |
} |
|
46 |
new TestHistogramPanel(); |
|
47 |
} |
|
48 |
|
|
49 |
private void initialize() { |
|
50 |
frame.setSize(new java.awt.Dimension(800,600)); |
|
51 |
hp = new HistogramPanel(); |
|
52 |
|
|
53 |
hp.clearSources(); |
|
54 |
|
|
55 |
//Par?metros de inicializaci?n del histograma |
|
56 |
hp.setRGBInBandList(true); //Asignaci?n R,G,B en el combo |
|
57 |
hp.firstRun(); // Mostar por primera vez el histograma |
|
58 |
|
|
59 |
frame.setContentPane(hp); |
|
60 |
frame.setResizable(true); |
|
61 |
frame.setTitle("Histogramas"); |
|
62 |
frame.setVisible(true); |
|
63 |
frame.addWindowListener(new java.awt.event.WindowAdapter() { |
|
64 |
public void windowClosing(java.awt.event.WindowEvent e) { |
|
65 |
System.exit(0); |
|
66 |
} |
|
67 |
}); |
|
68 |
} |
|
69 |
} |
|
0 | 70 |
Also available in: Unified diff