svn-gvsig-desktop / trunk / extensions / extCAD / src / com / iver / cit / gvsig / EditionChangeManager.java @ 6338
History | View | Annotate | Download (4.75 KB)
1 | 5063 | jorpiell | package com.iver.cit.gvsig; |
---|---|---|---|
2 | |||
3 | import com.iver.andami.PluginServices; |
||
4 | import com.iver.andami.ui.mdiManager.View; |
||
5 | 5196 | caballero | import com.iver.cit.gvsig.fmap.core.IRow; |
6 | 6338 | fjp | import com.iver.cit.gvsig.fmap.edition.AfterFieldEditEvent; |
7 | 5063 | jorpiell | import com.iver.cit.gvsig.fmap.edition.AfterRowEditEvent; |
8 | 6338 | fjp | import com.iver.cit.gvsig.fmap.edition.BeforeFieldEditEvent; |
9 | 5063 | jorpiell | import com.iver.cit.gvsig.fmap.edition.BeforeRowEditEvent; |
10 | import com.iver.cit.gvsig.fmap.edition.EditionEvent; |
||
11 | import com.iver.cit.gvsig.fmap.edition.IEditionListener; |
||
12 | import com.iver.cit.gvsig.fmap.layers.FLayer; |
||
13 | 5110 | caballero | import com.iver.cit.gvsig.fmap.layers.FLayers; |
14 | 5063 | jorpiell | import com.iver.cit.gvsig.gui.Table; |
15 | |||
16 | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
||
17 | *
|
||
18 | * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
||
19 | *
|
||
20 | * This program is free software; you can redistribute it and/or
|
||
21 | * modify it under the terms of the GNU General Public License
|
||
22 | * as published by the Free Software Foundation; either version 2
|
||
23 | * of the License, or (at your option) any later version.
|
||
24 | *
|
||
25 | * This program is distributed in the hope that it will be useful,
|
||
26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
28 | * GNU General Public License for more details.
|
||
29 | *
|
||
30 | * You should have received a copy of the GNU General Public License
|
||
31 | * along with this program; if not, write to the Free Software
|
||
32 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
33 | *
|
||
34 | * For more information, contact:
|
||
35 | *
|
||
36 | * Generalitat Valenciana
|
||
37 | * Conselleria d'Infraestructures i Transport
|
||
38 | * Av. Blasco Ib??ez, 50
|
||
39 | * 46010 VALENCIA
|
||
40 | * SPAIN
|
||
41 | *
|
||
42 | * +34 963862235
|
||
43 | * gvsig@gva.es
|
||
44 | * www.gvsig.gva.es
|
||
45 | *
|
||
46 | * or
|
||
47 | *
|
||
48 | * IVER T.I. S.A
|
||
49 | * Salamanca 50
|
||
50 | * 46005 Valencia
|
||
51 | * Spain
|
||
52 | *
|
||
53 | * +34 963163400
|
||
54 | * dac@iver.es
|
||
55 | */
|
||
56 | /* CVS MESSAGES:
|
||
57 | *
|
||
58 | * $Id$
|
||
59 | * $Log$
|
||
60 | 6338 | fjp | * Revision 1.6 2006-07-13 12:36:01 fjp
|
61 | * Revisar bien lo de a?adir campos y gestionar un campo gris
|
||
62 | *
|
||
63 | * Revision 1.5 2006/06/21 07:22:48 fjp
|
||
64 | 5923 | fjp | * Posibilidad de marcar capas como "dirty" y tener una que guarde lo que se ha dibujado antes que ella. Al hacer un MapControl.rePaintDirtyLayers(), eso se tiene en cuenta en el redibujado.
|
65 | *
|
||
66 | * Revision 1.4 2006/05/16 07:06:02 caballero
|
||
67 | 5196 | caballero | * Saber si se realiza una operaci?n desde la vista o desde la tabla.
|
68 | *
|
||
69 | * Revision 1.3 2006/05/10 06:26:24 caballero
|
||
70 | 5117 | caballero | * comprobar si tiene capa asociada
|
71 | *
|
||
72 | * Revision 1.2 2006/05/09 09:26:04 caballero
|
||
73 | 5110 | caballero | * refrescar las vistas y tablas
|
74 | *
|
||
75 | * Revision 1.1 2006/05/05 09:06:09 jorpiell
|
||
76 | 5063 | jorpiell | * Se a a?adido la clase EditionChangeManager, que no es m?s que un listener que se ejecuta cuando se produce un evento de edici?n.
|
77 | *
|
||
78 | *
|
||
79 | */
|
||
80 | /**
|
||
81 | * Cuando un tema se pone en edici?n se le debe asociar
|
||
82 | * un listener de este tipo, que se dispar? cuando se produzca
|
||
83 | * un evento de edici?n (borrado, modificaci?n,... sobre la capa.
|
||
84 | 5110 | caballero | *
|
85 | 5063 | jorpiell | * @author Jorge Piera Llodr? (piera_jor@gva.es)
|
86 | */
|
||
87 | public class EditionChangeManager implements IEditionListener{ |
||
88 | private FLayer fLayer = null; |
||
89 | 5110 | caballero | |
90 | 5063 | jorpiell | /**
|
91 | * Constructor
|
||
92 | * @param fLayer
|
||
93 | * Tema que se est? editando
|
||
94 | */
|
||
95 | public EditionChangeManager(FLayer fLayer){
|
||
96 | this.fLayer = fLayer;
|
||
97 | } |
||
98 | /*
|
||
99 | * (non-Javadoc)
|
||
100 | * @see com.iver.cit.gvsig.fmap.edition.IEditionListener#processEvent(com.iver.cit.gvsig.fmap.edition.EditionEvent)
|
||
101 | */
|
||
102 | public void processEvent(EditionEvent e) { |
||
103 | // TODO Auto-generated method stub
|
||
104 | 5110 | caballero | |
105 | 5063 | jorpiell | } |
106 | |||
107 | /*
|
||
108 | * (non-Javadoc)
|
||
109 | * @see com.iver.cit.gvsig.fmap.edition.IEditionListener#beforeRowEditEvent(com.iver.cit.gvsig.fmap.edition.BeforeRowEditEvent)
|
||
110 | */
|
||
111 | 5196 | caballero | public void beforeRowEditEvent(IRow feat,BeforeRowEditEvent e) { |
112 | 5063 | jorpiell | // TODO Auto-generated method stub
|
113 | 5110 | caballero | |
114 | 5063 | jorpiell | } |
115 | |||
116 | /*
|
||
117 | * (non-Javadoc)
|
||
118 | * @see com.iver.cit.gvsig.fmap.edition.IEditionListener#afterRowEditEvent(com.iver.cit.gvsig.fmap.edition.AfterRowEditEvent)
|
||
119 | */
|
||
120 | public void afterRowEditEvent(AfterRowEditEvent e) { |
||
121 | View[] views = (View[]) PluginServices.getMDIManager().getAllViews(); |
||
122 | |||
123 | for (int i=0 ; i<views.length ; i++){ |
||
124 | if (views[i] instanceof Table){ |
||
125 | 5110 | caballero | Table table=(Table)views[i]; |
126 | 5117 | caballero | if (table.getModel().getAssociatedTable()!=null && table.getModel().getAssociatedTable().equals(fLayer)) |
127 | 5110 | caballero | table.refresh(); |
128 | }else if (views[i] instanceof com.iver.cit.gvsig.gui.View){ |
||
129 | com.iver.cit.gvsig.gui.View view=(com.iver.cit.gvsig.gui.View)views[i]; |
||
130 | 5923 | fjp | |
131 | fLayer.setDirty(true);
|
||
132 | view.getMapControl().rePaintDirtyLayers(); |
||
133 | /* FLayers layers=view.getMapControl().getMapContext().getLayers();
|
||
134 | 5110 | caballero | for (int j=0;j<layers.getLayersCount();j++){
|
135 | if (layers.getLayer(j).equals(fLayer)){
|
||
136 | view.repaintMap();
|
||
137 | }
|
||
138 | 5923 | fjp | } */
|
139 | 5063 | jorpiell | } |
140 | } |
||
141 | 5110 | caballero | |
142 | 5063 | jorpiell | } |
143 | 6338 | fjp | public void beforeFieldEditEvent(BeforeFieldEditEvent e) { |
144 | // TODO Auto-generated method stub
|
||
145 | |||
146 | } |
||
147 | public void afterFieldEditEvent(AfterFieldEditEvent e) { |
||
148 | // TODO Auto-generated method stub
|
||
149 | |||
150 | } |
||
151 | 5063 | jorpiell | |
152 | } |