Revision 31496 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/addlayer/AddLayerDialog.java

View differences:

AddLayerDialog.java
35 35
import org.gvsig.andami.ui.mdiManager.WindowInfo;
36 36
import org.gvsig.app.gui.WizardPanel;
37 37
import org.gvsig.app.gui.wizards.WizardListener;
38
import org.gvsig.app.project.Project;
38
import org.gvsig.app.project.DefaultProject;
39 39
import org.gvsig.gui.beans.AcceptCancelPanel;
40
import org.gvsig.tools.ToolsLocator;
41
import org.gvsig.tools.dispose.Disposable;
40 42

  
41 43
/**
42 44
 * Frame del cuadro de dialogo que contendra los tabs de aperturas de ficheros
......
44 46
 * @version 04/09/2007
45 47
 * @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es)
46 48
 */
47
public class AddLayerDialog extends JPanel implements org.gvsig.andami.ui.mdiManager.IWindow {
49
public class AddLayerDialog extends JPanel implements org.gvsig.andami.ui.mdiManager.IWindow , Disposable{
48 50
	static private IProjection proj           = null;
49 51
	private JTabbedPane        jTabbedPane    = null;
50 52
	private AcceptCancelPanel  jPanel         = null;
......
75 77
   * This method initializes this
76 78
   */
77 79
	private void initialize() {
80
		ToolsLocator.getDisposableManager().bind(this);
81
		
78 82
		this.setLayout(new BorderLayout());
79 83
		this.setSize(523, 385);
80 84
		this.setPreferredSize(new Dimension(523, 385));
......
196 200
	 */
197 201
	public static IProjection getLastProjection() {
198 202
		if (proj == null) {
199
			proj = Project.getDefaultProjection();
203
			proj = DefaultProject.getDefaultProjection();
200 204
		}
201 205
		return proj;
202 206
	}
......
214 218
	}
215 219

  
216 220
	private void closeWindow() {
221
//		JTabbedPane tabbed = getJTabbedPane();
222
//		for (int i = 0; i < tabbed.getTabCount(); i++) {
223
//			Component component = tabbed.getComponentAt(i);
224
//			if (component instanceof WizardPanel) {
225
//				((WizardPanel) component).close();
226
//			}
227
//		}
228
		if (PluginServices.getMainFrame() == null) {
229
			((JDialog) (getParent().getParent().getParent().getParent())).dispose();
230
		} else {
231
			PluginServices.getMDIManager().closeWindow(AddLayerDialog.this);
232
		}
233
	}
234

  
235
	public void dispose() {
217 236
		JTabbedPane tabbed = getJTabbedPane();
218 237
		for (int i = 0; i < tabbed.getTabCount(); i++) {
219 238
			Component component = tabbed.getComponentAt(i);
......
221 240
				((WizardPanel) component).close();
222 241
			}
223 242
		}
224
		if (PluginServices.getMainFrame() == null) {
225
			((JDialog) (getParent().getParent().getParent().getParent())).dispose();
226
		} else {
227
			PluginServices.getMDIManager().closeWindow(AddLayerDialog.this);
228
		}
243
		ToolsLocator.getDisposableManager().release(this);
229 244
	}
245
	
230 246
}

Also available in: Unified diff