Revision 33260

View differences:

branches/v2_0_0_prep/extensions/org.gvsig.installer.app/org.gvsig.installer.app.extension/src/main/java/org/gvsig/installer/app/extension/utils/WindowInstallerListener.java
29 29

  
30 30
import org.gvsig.andami.PluginServices;
31 31
import org.gvsig.andami.ui.mdiManager.IWindow;
32
import org.gvsig.installer.swing.api.wizard.WizardActionListener;
32
import org.gvsig.installer.swing.api.wizard.InstallerWizardActionListener;
33
import org.gvsig.installer.swing.api.wizard.InstallerWizardPanel;
33 34

  
34 35
/**
35 36
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
36 37
 */
37
public class WindowInstallerListener implements WizardActionListener {
38
public class WindowInstallerListener implements InstallerWizardActionListener {
38 39
	private IWindow window = null;
39 40

  
40 41
	public WindowInstallerListener(IWindow window) {
......
45 46
	public void closeWizard() {
46 47
		PluginServices.getMDIManager().closeWindow(window);		
47 48
	}
49

  
50
	public void cancel(InstallerWizardPanel installerWizard) {
51
		PluginServices.getMDIManager().closeWindow(window);		
52
	}
53

  
54
	public void finish(InstallerWizardPanel installerWizard) {
55
		PluginServices.getMDIManager().closeWindow(window);		
56
	}
48 57
	
49 58
}
50 59

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/utils/FrameWizardListener.java
29 29

  
30 30
import javax.swing.JFrame;
31 31

  
32
import org.gvsig.installer.swing.api.wizard.WizardActionListener;
32
import org.gvsig.installer.swing.api.wizard.InstallerWizardActionListener;
33
import org.gvsig.installer.swing.api.wizard.InstallerWizardPanel;
33 34

  
34 35
/**
35 36
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
36 37
 */
37
public class FrameWizardListener implements WizardActionListener{
38
public class FrameWizardListener implements InstallerWizardActionListener{
38 39
	private JFrame frame = null;
39 40
	
40 41
	public FrameWizardListener(JFrame frame) {
......
42 43
		this.frame = frame;
43 44
	}
44 45

  
45
	public void closeWizard() {
46
	public void cancel(InstallerWizardPanel installerWizard) {
46 47
		frame.setVisible(false);
47 48
		System.exit(0);
49
		
48 50
	}
49 51

  
52
	public void finish(InstallerWizardPanel installerWizard) {
53
		frame.setVisible(false);
54
		System.exit(0);		
55
	}
56

  
50 57
}
51 58

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/wizard/WizardPanelCancelAction.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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2010 {Prodevelop}   {Task}
26
*/
27
 
28
package org.gvsig.installer.swing.impl.wizard;
29

  
30
import jwizardcomponent.CancelAction;
31
import jwizardcomponent.JWizardComponents;
32

  
33
import org.gvsig.installer.swing.api.wizard.WizardPanel;
34

  
35
/**
36
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
37
 */
38
public class WizardPanelCancelAction extends CancelAction{
39
private WizardPanel wizardPanel = null;
40
	
41
	public WizardPanelCancelAction(JWizardComponents wizardComponents, WizardPanel wizardPanel) {
42
		super(wizardComponents);
43
		this.wizardPanel = wizardPanel;
44
	}
45

  
46
	public void performAction() {
47
		if (wizardPanel.getWizardActionListener() != null){
48
			wizardPanel.getWizardActionListener().closeWizard();
49
		}
50
	}
51
}
52

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/wizard/WizardPanelWithLogo.java
1
package org.gvsig.installer.swing.impl.wizard;
2

  
3
import java.awt.BorderLayout;
4
import java.awt.Color;
5

  
6
import javax.swing.ImageIcon;
7
import javax.swing.JLabel;
8
import javax.swing.JPanel;
9
import javax.swing.JSeparator;
10

  
11
import jwizardcomponent.CancelAction;
12
import jwizardcomponent.DefaultJWizardComponents;
13
import jwizardcomponent.FinishAction;
14
import jwizardcomponent.common.SimpleButtonPanel;
15

  
16
public class WizardPanelWithLogo extends JPanel {
17
	  DefaultJWizardComponents wizardComponents;
18

  
19
	  JPanel buttonPanel;
20
	  JLabel statusLabel = new JLabel();
21

  
22
	  ImageIcon logo;
23

  
24
	  public WizardPanelWithLogo(ImageIcon logo) {
25
	    this.logo = logo;
26
	    wizardComponents = new DefaultJWizardComponents();
27
	    init();
28
	  }
29

  
30
	  private void init() {
31
	    
32

  
33
	    JPanel logoPanel = new JPanel();
34

  
35
	    String fileString;
36
	    if (logo.toString().indexOf("file:") < 0 &&
37
	        logo.toString().indexOf("http:") < 0) {
38
	      fileString = "file:///" +System.getProperty("user.dir") +"/"
39
	                        +logo.toString();
40
	      fileString = fileString.replaceAll("\\\\", "/");
41
	    } else {
42
	      fileString = logo.toString();
43
	    }
44
	    logoPanel.add(new JLabel(logo));
45
	    logoPanel.setBackground(Color.WHITE);
46
	    this.setLayout(new BorderLayout());
47
	    this.add(logoPanel, BorderLayout.WEST);
48
	    this.add(wizardComponents.getWizardPanelsContainer(),
49
	    							BorderLayout.CENTER);
50

  
51
	    JPanel auxPanel = new JPanel(new BorderLayout());
52
	    auxPanel.add(new JSeparator(), BorderLayout.NORTH);
53

  
54
	    buttonPanel = new SimpleButtonPanel(wizardComponents);
55
	    auxPanel.add(buttonPanel);
56
	    this.add(auxPanel, BorderLayout.SOUTH);
57
	    
58

  
59
	    wizardComponents.setFinishAction(new FinishAction(wizardComponents) {
60
	      public void performAction() {
61
	        // dispose();
62
	      }
63
	    });
64
	    wizardComponents.setCancelAction(new CancelAction(wizardComponents) {
65
	      public void performAction() {
66
	        // dispose();
67
	      }
68
	    });
69
	  }
70

  
71
	  public DefaultJWizardComponents getWizardComponents(){
72
	    return wizardComponents;
73
	  }
74

  
75
	  public void setWizardComponents(DefaultJWizardComponents aWizardComponents){
76
	    wizardComponents = aWizardComponents;
77
	  }
78

  
79
	  public void show() {
80
	    wizardComponents.updateComponents();
81
	    super.setVisible(true);
82
	  }
83

  
84
}
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/wizard/WizardPanelFinishAction.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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2010 {Prodevelop}   {Task}
26
*/
27
 
28
package org.gvsig.installer.swing.impl.wizard;
29

  
30
import jwizardcomponent.FinishAction;
31
import jwizardcomponent.JWizardComponents;
32

  
33
import org.gvsig.installer.swing.api.wizard.WizardPanel;
34

  
35
/**
36
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
37
 */
38
public class WizardPanelFinishAction extends FinishAction{
39
	private WizardPanel wizardPanel = null;
40
	
41
	public WizardPanelFinishAction(JWizardComponents wizardComponents, WizardPanel wizardPanel) {
42
		super(wizardComponents);
43
		this.wizardPanel = wizardPanel;
44
	}
45

  
46
	public void performAction() {
47
		if (wizardPanel.getWizardActionListener() != null){
48
			wizardPanel.getWizardActionListener().closeWizard();
49
		}
50
	}
51

  
52
}
53

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/wizard/WizardListenerAdapter.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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2010 {Prodevelop}   {Task}
26
*/
27
 
28
package org.gvsig.installer.swing.impl.wizard;
29

  
30
import org.gvsig.gui.beans.wizard.WizardPanel;
31
import org.gvsig.gui.beans.wizard.WizardPanelActionListener;
32
import org.gvsig.installer.swing.api.wizard.InstallerWizardPanel;
33

  
34

  
35

  
36
/**
37
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
38
 */
39
public class WizardListenerAdapter implements WizardPanelActionListener {
40
	private InstallerWizardPanel installerWizardPanel;
41
	
42
	public WizardListenerAdapter(
43
			InstallerWizardPanel installerWizardPanel) {
44
		super();
45
		this.installerWizardPanel = installerWizardPanel;
46
	}
47

  
48
	public void cancel(WizardPanel wizardPanel) {
49
		if (installerWizardPanel.getWizardActionListener() != null){
50
			installerWizardPanel.getWizardActionListener().cancel(installerWizardPanel);	
51
		}
52
	}
53

  
54
	public void finish(WizardPanel wizardPanel) {
55
		if (installerWizardPanel.getWizardActionListener() != null){
56
			installerWizardPanel.getWizardActionListener().finish(installerWizardPanel);
57
		}
58
	}
59
}
60

  
0 61

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/wizard/SelectPackagesWizard.java
29 29

  
30 30
import javax.swing.JPanel;
31 31

  
32
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
32 33
import org.gvsig.installer.lib.api.execution.InstallPackageService;
33
import org.gvsig.installer.swing.impl.InstallerWizardPanel;
34 34
import org.gvsig.installer.swing.impl.execution.DefaultInstallPackageWizard;
35 35
import org.gvsig.installer.swing.impl.execution.model.PackagesTableModel;
36 36
import org.gvsig.installer.swing.impl.execution.panel.SelectPackagesPanel;
......
38 38
/**
39 39
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
40 40
 */
41
public class SelectPackagesWizard extends SelectPackagesPanel implements InstallerWizardPanel {
41
public class SelectPackagesWizard extends SelectPackagesPanel implements OptionPanel {
42 42
	private DefaultInstallPackageWizard installerExecutionWizard;
43 43
	
44 44
		public SelectPackagesWizard(DefaultInstallPackageWizard installerExecutionWizard) {
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/wizard/ProgressWizard.java
31 31

  
32 32
import javax.swing.JPanel;
33 33

  
34
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
34 35
import org.gvsig.installer.lib.api.PackageInfo;
35 36
import org.gvsig.installer.lib.api.execution.InstallPackageService;
36 37
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException;
37
import org.gvsig.installer.swing.impl.InstallerWizardPanel;
38 38
import org.gvsig.installer.swing.impl.execution.DefaultInstallPackageWizard;
39 39
import org.gvsig.installer.swing.impl.panel.ProgressPanel;
40 40
import org.slf4j.Logger;
......
43 43
/**
44 44
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
45 45
 */
46
public class ProgressWizard extends ProgressPanel implements InstallerWizardPanel{
46
public class ProgressWizard extends ProgressPanel implements OptionPanel{
47 47
	private DefaultInstallPackageWizard installerExecutionWizard;
48 48
	private static final Logger logger = LoggerFactory.getLogger(ProgressWizard.class);
49 49

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/wizard/SelectBundlesWizard.java
32 32
import javax.swing.JOptionPane;
33 33
import javax.swing.JPanel;
34 34

  
35
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
35 36
import org.gvsig.installer.lib.api.execution.InstallPackageService;
36 37
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException;
37
import org.gvsig.installer.swing.impl.InstallerWizardPanel;
38 38
import org.gvsig.installer.swing.impl.execution.DefaultInstallPackageWizard;
39 39
import org.gvsig.installer.swing.impl.execution.panel.SelectBundlesPanel;
40 40
import org.slf4j.Logger;
......
43 43
/**
44 44
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
45 45
 */
46
public class SelectBundlesWizard extends SelectBundlesPanel implements InstallerWizardPanel {
46
public class SelectBundlesWizard extends SelectBundlesPanel implements OptionPanel {
47 47
	private DefaultInstallPackageWizard installerExecutionWizard;
48 48
	private static final Logger logger = LoggerFactory.getLogger(SelectBundlesWizard.class);
49 49
	
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/execution/DefaultInstallPackageWizard.java
36 36

  
37 37
import jwizardcomponent.DefaultJWizardComponents;
38 38

  
39
import org.gvsig.gui.beans.wizard.WizardPanel;
40
import org.gvsig.gui.beans.wizard.WizardPanelActionListener;
41
import org.gvsig.gui.beans.wizard.WizardPanelWithLogo;
39 42
import org.gvsig.installer.lib.api.InstallerLocator;
40 43
import org.gvsig.installer.lib.api.PackageInfo;
41 44
import org.gvsig.installer.lib.api.execution.InstallPackageService;
42 45
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException;
43 46
import org.gvsig.installer.swing.api.execution.InstallPackageWizard;
44
import org.gvsig.installer.swing.impl.InstallerWizardContainer;
45 47
import org.gvsig.installer.swing.impl.execution.wizard.ProgressWizard;
46 48
import org.gvsig.installer.swing.impl.execution.wizard.SelectBundlesWizard;
47 49
import org.gvsig.installer.swing.impl.execution.wizard.SelectPackagesWizard;
48
import org.gvsig.installer.swing.impl.wizard.WizardPanelCancelAction;
49
import org.gvsig.installer.swing.impl.wizard.WizardPanelFinishAction;
50
import org.gvsig.installer.swing.impl.wizard.WizardPanelWithLogo;
50
import org.gvsig.installer.swing.impl.wizard.WizardListenerAdapter;
51 51
import org.slf4j.Logger;
52 52
import org.slf4j.LoggerFactory;
53 53

  
54 54
/**
55 55
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
56 56
 */
57
public class DefaultInstallPackageWizard extends InstallPackageWizard{
57
public class DefaultInstallPackageWizard extends InstallPackageWizard implements WizardPanel{
58 58
	private WizardPanelWithLogo wizardPanelWithLogo = null;
59 59
	private InstallPackageService installerExecutionService = null;	
60 60
	private static final Logger logger = LoggerFactory.getLogger(DefaultInstallPackageWizard.class);
......
65 65
	private SelectPackagesWizard selectPluginsWizard = null;
66 66
	private ProgressWizard progressWizard = null;
67 67
	
68
	private WizardListenerAdapter wizardListenerAdapter = null;
69
	
68 70
	public DefaultInstallPackageWizard(File applicationDirectory) throws InstallPackageServiceException
69 71
	{
70 72
		super(applicationDirectory);
......
79 81
		addWizards();
80 82
		
81 83
		//Adding the listeners
82
		getWizardComponents().setFinishAction(new WizardPanelFinishAction(getWizardComponents(), this));
83
		getWizardComponents().setCancelAction(new WizardPanelCancelAction(getWizardComponents(), this));
84
		wizardPanelWithLogo.setWizardListener(this);
84 85

  
85 86
		setFinishButtonVisible(false);
86 87
		
......
92 93
	}
93 94
	
94 95
	private void addWizards(){
95
		getWizardComponents().addWizardPanel(
96
				new InstallerWizardContainer(getWizardComponents(), 
97
					selectInstallersWizard));
98
		
99
		getWizardComponents().addWizardPanel(
100
				new InstallerWizardContainer(getWizardComponents(), 
101
						selectPluginsWizard));	
102
		getWizardComponents().addWizardPanel(
103
				new InstallerWizardContainer(getWizardComponents(), 
104
						progressWizard));			
96
		wizardPanelWithLogo.addOptionPanel(selectInstallersWizard);
97
		wizardPanelWithLogo.addOptionPanel(selectPluginsWizard);	
98
		wizardPanelWithLogo.addOptionPanel(progressWizard);			
105 99
	}
106 100

  
107 101
	public DefaultJWizardComponents getWizardComponents()
......
145 139
	public File getDefaultInstallersDirectory()
146 140
	{
147 141
		return new File(applicationDirectory.getAbsolutePath() + File.separator + "install");
142
	}
143

  
144
	public WizardPanelActionListener getWizardPanelActionListener() {
145
		if ((wizardListenerAdapter == null && (getWizardActionListener() != null))){
146
			return new WizardListenerAdapter(this);
147
		}
148
		return wizardListenerAdapter;
149
	}
150

  
151
	public void setWizardPanelActionListener(
152
			WizardPanelActionListener wizardActionListener) {
153
		// TODO Auto-generated method stub
154
		
148 155
	}	
149 156
}
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/DefaultMakePluginPackageWizard.java
35 35

  
36 36
import jwizardcomponent.DefaultJWizardComponents;
37 37

  
38
import org.gvsig.gui.beans.wizard.WizardPanel;
39
import org.gvsig.gui.beans.wizard.WizardPanelActionListener;
40
import org.gvsig.gui.beans.wizard.WizardPanelWithLogo;
38 41
import org.gvsig.installer.lib.api.InstallerLocator;
39 42
import org.gvsig.installer.lib.api.PackageInfo;
40 43
import org.gvsig.installer.lib.api.creation.MakePluginPackageService;
41 44
import org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException;
42 45
import org.gvsig.installer.swing.api.creation.MakePluginPackageWizard;
43
import org.gvsig.installer.swing.impl.InstallerWizardContainer;
44 46
import org.gvsig.installer.swing.impl.creation.wizard.AdvancedModeSelectionWizard;
45 47
import org.gvsig.installer.swing.impl.creation.wizard.AntScriptWizard;
46 48
import org.gvsig.installer.swing.impl.creation.wizard.PluginDescriptionWizard;
......
48 50
import org.gvsig.installer.swing.impl.creation.wizard.SelectFilesWizard;
49 51
import org.gvsig.installer.swing.impl.creation.wizard.SelectOutputFileWizard;
50 52
import org.gvsig.installer.swing.impl.creation.wizard.SelectPlugintoInstallWizard;
51
import org.gvsig.installer.swing.impl.wizard.WizardPanelCancelAction;
52
import org.gvsig.installer.swing.impl.wizard.WizardPanelFinishAction;
53
import org.gvsig.installer.swing.impl.wizard.WizardPanelWithLogo;
53
import org.gvsig.installer.swing.impl.wizard.WizardListenerAdapter;
54 54
import org.gvsig.tools.locator.LocatorException;
55 55

  
56 56
/**
57 57
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
58 58
 */
59
public class DefaultMakePluginPackageWizard extends MakePluginPackageWizard{
59
public class DefaultMakePluginPackageWizard extends MakePluginPackageWizard implements WizardPanel{
60 60
	private WizardPanelWithLogo wizardPanelWithLogo = null;
61 61
	private MakePluginPackageService makePluginPackageService = null;
62 62
	private OutputStream outputStream = null;
......
71 71
	private SelectFilesWizard selectFilesWizard = null;
72 72
	private SelectOutputFileWizard selectOutputFileWizard = null;
73 73
	private SelectPlugintoInstallWizard selectPlugintoInstallWizard = null;
74
	
75
	private WizardListenerAdapter wizardListenerAdapter = null;
74 76

  
75 77
	public DefaultMakePluginPackageWizard(File applicationDirectory) throws LocatorException, MakePluginPackageServiceException
76 78
	{		
......
88 90
		addWizards();
89 91
		
90 92
		//Adding the listeners
91
		getWizardComponents().setFinishAction(new WizardPanelFinishAction(getWizardComponents(), this));
92
		getWizardComponents().setCancelAction(new WizardPanelCancelAction(getWizardComponents(), this));
93
		wizardPanelWithLogo.setWizardListener(this);
93 94
			
94
		setFinishButtonVisible(false);
95
		setFinishButtonEnabled(false);
95 96
		
96 97
		this.setLayout(new BorderLayout());
97 98
		this.add(wizardPanelWithLogo, BorderLayout.CENTER);
......
104 105
	}
105 106

  
106 107
	private void addWizards(){
107
		getWizardComponents().addWizardPanel(
108
				new InstallerWizardContainer(getWizardComponents(), 
109
						selectPlugintoInstallWizard));	
110
		getWizardComponents().addWizardPanel(
111
				new InstallerWizardContainer(getWizardComponents(), 
112
						pluginDescriptionWizard));	
113
		getWizardComponents().addWizardPanel(
114
				new InstallerWizardContainer(getWizardComponents(), 
115
						advancedModeSelectionWizard));	
108
		wizardPanelWithLogo.addOptionPanel(selectPlugintoInstallWizard);	
109
		wizardPanelWithLogo.addOptionPanel(pluginDescriptionWizard);	
110
		wizardPanelWithLogo.addOptionPanel(advancedModeSelectionWizard);	
116 111
		addLastWizards();		
117 112
	}
118 113

  
119 114
	private void addLastWizards(){
120
		getWizardComponents().addWizardPanel(
121
				new InstallerWizardContainer(getWizardComponents(), 
122
						selectOutputFileWizard));	
123
		getWizardComponents().addWizardPanel(
124
				new InstallerWizardContainer(getWizardComponents(), 
125
						progressWizard));	
115
		wizardPanelWithLogo.addOptionPanel(selectOutputFileWizard);	
116
		wizardPanelWithLogo.addOptionPanel(progressWizard);	
126 117
	}
127 118
	
128 119
	private void addAdvancedWizards(){
129
		getWizardComponents().addWizardPanel(
130
				new InstallerWizardContainer(getWizardComponents(), 
131
						selectFilesWizard));	
132
		getWizardComponents().addWizardPanel(
133
				new InstallerWizardContainer(getWizardComponents(), 
134
						antScriptWizard));	
120
		wizardPanelWithLogo.addOptionPanel(selectFilesWizard);	
121
		wizardPanelWithLogo.addOptionPanel(antScriptWizard);	
135 122
	}
136 123

  
137 124

  
......
141 128
	}
142 129

  
143 130
	public void setNextButtonEnabled(boolean isEnabled){
144
		getWizardComponents().getNextButton().setEnabled(isEnabled);
131
		wizardPanelWithLogo.setNextButtonEnabled(isEnabled);
145 132
	}
146 133
	
147 134
	public void setCancelButtonEnabled(boolean isEnabled){
148
		getWizardComponents().getCancelButton().setEnabled(isEnabled);
135
		wizardPanelWithLogo.setCancelButtonEnabled(isEnabled);
149 136
	}
150 137
	
151
	public void setFinishButtonVisible(boolean isVisible){
152
		getWizardComponents().getFinishButton().setVisible(isVisible);
138
	public void setFinishButtonEnabled(boolean isEnabled){
139
		wizardPanelWithLogo.setFinishButtonEnabled(isEnabled);
153 140
	}
154 141

  
155 142
	public void setAdvancedModeSelected(boolean advancedModeSelected) {
......
189 176

  
190 177
	public void setSelectedPackageInfo(PackageInfo selectedPackageInfo) {
191 178
		this.selectedPackageInfo = selectedPackageInfo;
179
	}
180

  
181
	public WizardPanelActionListener getWizardPanelActionListener() {
182
		if ((wizardListenerAdapter == null && (getWizardActionListener() != null))){
183
			return new WizardListenerAdapter(this);
184
		}
185
		return wizardListenerAdapter;
186
	}
187

  
188
	public void setWizardPanelActionListener(
189
			WizardPanelActionListener wizardActionListener) {
190
		// TODO Auto-generated method stub
191
		
192 192
	}	
193 193
}
194 194

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/wizard/AdvancedModeSelectionWizard.java
29 29

  
30 30
import javax.swing.JPanel;
31 31

  
32
import org.gvsig.installer.swing.impl.InstallerWizardPanel;
32
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
33 33
import org.gvsig.installer.swing.impl.creation.DefaultMakePluginPackageWizard;
34 34
import org.gvsig.installer.swing.impl.creation.panel.AdvancedModeSelectionPanel;
35 35

  
36 36
/**
37 37
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
38 38
 */
39
public class AdvancedModeSelectionWizard extends AdvancedModeSelectionPanel implements InstallerWizardPanel{
39
public class AdvancedModeSelectionWizard extends AdvancedModeSelectionPanel implements OptionPanel{
40 40
	private DefaultMakePluginPackageWizard installerCreationWizard;
41 41
		
42 42
	public AdvancedModeSelectionWizard(DefaultMakePluginPackageWizard installerCreationWizard) {
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/wizard/SelectOutputFileWizard.java
34 34
import javax.swing.JOptionPane;
35 35
import javax.swing.JPanel;
36 36

  
37
import org.gvsig.installer.swing.impl.InstallerWizardPanel;
37
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
38 38
import org.gvsig.installer.swing.impl.creation.DefaultMakePluginPackageWizard;
39 39
import org.gvsig.installer.swing.impl.creation.panel.SelectOutputFilePanel;
40 40
import org.slf4j.Logger;
......
43 43
/**
44 44
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
45 45
 */
46
public class SelectOutputFileWizard extends SelectOutputFilePanel implements InstallerWizardPanel{
46
public class SelectOutputFileWizard extends SelectOutputFilePanel implements OptionPanel{
47 47
	private DefaultMakePluginPackageWizard installerCreationWizard;
48 48
	private static final Logger logger = LoggerFactory.getLogger(SelectOutputFileWizard.class);
49 49
	
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/wizard/PluginDescriptionWizard.java
29 29

  
30 30
import javax.swing.JPanel;
31 31

  
32
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
32 33
import org.gvsig.installer.lib.api.PackageInfo;
33
import org.gvsig.installer.swing.impl.InstallerWizardPanel;
34 34
import org.gvsig.installer.swing.impl.creation.DefaultMakePluginPackageWizard;
35 35
import org.gvsig.installer.swing.impl.creation.panel.PluginDescriptionPanel;
36 36
import org.slf4j.Logger;
......
39 39
/**
40 40
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
41 41
 */
42
public class PluginDescriptionWizard extends PluginDescriptionPanel implements InstallerWizardPanel{
42
public class PluginDescriptionWizard extends PluginDescriptionPanel implements OptionPanel{
43 43
	private DefaultMakePluginPackageWizard installerCreationWizard;
44 44
	private static final Logger log = LoggerFactory.getLogger(PluginDescriptionWizard.class);
45 45

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/wizard/SelectFilesWizard.java
32 32

  
33 33
import javax.swing.JPanel;
34 34

  
35
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
35 36
import org.gvsig.installer.lib.api.PackageInfo;
36
import org.gvsig.installer.swing.impl.InstallerWizardPanel;
37 37
import org.gvsig.installer.swing.impl.creation.DefaultMakePluginPackageWizard;
38 38
import org.gvsig.installer.swing.impl.creation.panel.SelectFilesPanel;
39 39
import org.slf4j.Logger;
......
42 42
/**
43 43
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
44 44
 */
45
public class SelectFilesWizard extends SelectFilesPanel implements InstallerWizardPanel{
45
public class SelectFilesWizard extends SelectFilesPanel implements OptionPanel{
46 46
	private DefaultMakePluginPackageWizard installerCreationWizard;
47 47
	private static final Logger log = LoggerFactory.getLogger(SelectFilesWizard.class);
48 48

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/wizard/ProgressWizard.java
29 29

  
30 30
import javax.swing.JPanel;
31 31

  
32
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
32 33
import org.gvsig.installer.lib.api.PackageInfo;
33 34
import org.gvsig.installer.lib.api.creation.MakePluginPackageService;
34 35
import org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException;
35
import org.gvsig.installer.swing.impl.InstallerWizardPanel;
36 36
import org.gvsig.installer.swing.impl.creation.DefaultMakePluginPackageWizard;
37 37
import org.gvsig.installer.swing.impl.panel.ProgressPanel;
38 38
import org.slf4j.Logger;
......
41 41
/**
42 42
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
43 43
 */
44
public class ProgressWizard extends ProgressPanel implements InstallerWizardPanel{
44
public class ProgressWizard extends ProgressPanel implements OptionPanel{
45 45
	private DefaultMakePluginPackageWizard installerCreationWizard;
46 46
	private static final Logger logger = LoggerFactory.getLogger(ProgressWizard.class);
47 47
	
......
59 59
	}
60 60

  
61 61
	public void lastPanel() {
62
		installerCreationWizard.setFinishButtonVisible(false);
62
		installerCreationWizard.setFinishButtonEnabled(false);
63 63
		installerCreationWizard.setCancelButtonEnabled(true);		
64 64
	}
65 65

  
......
90 90
		}	
91 91
		
92 92
		setProgress(100);
93
		installerCreationWizard.setFinishButtonVisible(true);
93
		installerCreationWizard.setFinishButtonEnabled(true);
94 94
		installerCreationWizard.setCancelButtonEnabled(false);	
95 95
	}
96 96

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/wizard/AntScriptWizard.java
33 33
import javax.xml.parsers.DocumentBuilder;
34 34
import javax.xml.parsers.DocumentBuilderFactory;
35 35

  
36
import org.gvsig.gui.beans.wizard.panel.NotContinueWizardException;
37
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
36 38
import org.gvsig.installer.lib.api.PackageInfo;
37 39
import org.gvsig.installer.lib.api.creation.MakePluginPackageService;
38 40
import org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException;
39
import org.gvsig.installer.swing.impl.InstallerWizardPanel;
40
import org.gvsig.installer.swing.impl.NotContinueWizardException;
41 41
import org.gvsig.installer.swing.impl.creation.DefaultMakePluginPackageWizard;
42 42
import org.gvsig.installer.swing.impl.creation.panel.AntScriptPanel;
43 43
import org.slf4j.Logger;
......
46 46
/**
47 47
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
48 48
 */
49
public class AntScriptWizard extends AntScriptPanel implements InstallerWizardPanel{
49
public class AntScriptWizard extends AntScriptPanel implements OptionPanel{
50 50
	private DefaultMakePluginPackageWizard installerCreationWizard;
51 51
	private static final Logger log = LoggerFactory.getLogger(AntScriptWizard.class);
52 52
	
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/creation/wizard/SelectPlugintoInstallWizard.java
29 29

  
30 30
import javax.swing.JPanel;
31 31

  
32
import org.gvsig.gui.beans.wizard.panel.OptionPanel;
32 33
import org.gvsig.installer.lib.api.PackageInfo;
33
import org.gvsig.installer.swing.impl.InstallerWizardPanel;
34 34
import org.gvsig.installer.swing.impl.creation.DefaultMakePluginPackageWizard;
35 35
import org.gvsig.installer.swing.impl.creation.panel.SelectPluginToInstallPanel;
36 36
import org.slf4j.Logger;
......
39 39
/**
40 40
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
41 41
 */
42
public class SelectPlugintoInstallWizard extends SelectPluginToInstallPanel implements InstallerWizardPanel{
42
public class SelectPlugintoInstallWizard extends SelectPluginToInstallPanel implements OptionPanel{
43 43
	private String selectedPluginText;
44 44
	private DefaultMakePluginPackageWizard installerCreationWizard;
45 45
	private static final Logger logger = LoggerFactory.getLogger(SelectPlugintoInstallWizard.class);
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/wizard/WizardActionListener.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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2010 {Prodevelop}   {Task}
26
*/
27
 
28
package org.gvsig.installer.swing.api.wizard;
29
/**
30
 * <p>
31
 * Listener for the wizards used on the installation management. It controls
32
 * the events thrown by the wizard.
33
 * </p> 
34
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
35
 */
36
public interface WizardActionListener {
37

  
38
	/**
39
	 * When the wizard is closed this event is thrown.
40
	 */
41
	public void closeWizard();
42
}
43

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/wizard/WizardPanel.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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2010 {Prodevelop}   {Task}
26
*/
27
 
28
package org.gvsig.installer.swing.api.wizard;
29

  
30

  
31
/**
32
 * This interface must be implemented by all the wizards. It just have a 
33
 * methods to manage the events that the wizard throws.
34
 * 
35
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
36
 */
37
public interface WizardPanel {	
38
	
39
	/**
40
	 * @param wizardActionListener
41
	 * sets the listener for the action events.
42
	 */
43
	public void setWizardActionListener(WizardActionListener wizardActionListener);
44
	
45
	/**
46
	 * @return
47
	 * the listener for the action events
48
	 */
49
	public WizardActionListener getWizardActionListener();
50
}
51

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/wizard/InstallerWizardPanel.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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2010 {Prodevelop}   {Task}
26
*/
27
 
28
package org.gvsig.installer.swing.api.wizard;
29

  
30

  
31
/**
32
 * This interface must be implemented by all the wizards. It just have a 
33
 * methods to manage the events that the wizard throws.
34
 * 
35
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
36
 */
37
public interface InstallerWizardPanel {	
38
	
39
	/**
40
	 * @param wizardActionListener
41
	 * sets the listener for the action events.
42
	 */
43
	public void setWizardActionListener(InstallerWizardActionListener wizardActionListener);
44
	
45
	/**
46
	 * @return
47
	 * the listener for the action events
48
	 */
49
	public InstallerWizardActionListener getWizardActionListener();
50
}
51

  
0 52

  
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/wizard/AbstractInstallerWizard.java
34 34
/**
35 35
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
36 36
 */
37
public abstract class AbstractInstallerWizard extends JPanel implements WizardPanel{
37
public abstract class AbstractInstallerWizard extends JPanel implements InstallerWizardPanel{
38 38
	private static final long serialVersionUID = 5609799260650093733L;
39 39
	protected File applicationDirectory = null;
40
	protected WizardActionListener wizardActionListener = null;
40
	protected InstallerWizardActionListener wizardActionListener = null;
41 41
	
42 42
	public AbstractInstallerWizard(File applicationDirectory) {
43 43
		super();
......
54 54
	
55 55
	
56 56
	public void setWizardActionListener(
57
			WizardActionListener wizardActionListener) {
57
			InstallerWizardActionListener wizardActionListener) {
58 58
		this.wizardActionListener = wizardActionListener;		
59 59
	}
60 60
	
61
	public WizardActionListener getWizardActionListener() {
61
	public InstallerWizardActionListener getWizardActionListener() {
62 62
		return wizardActionListener;
63 63
	}
64 64
}
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.api/src/main/java/org/gvsig/installer/swing/api/wizard/InstallerWizardActionListener.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

  
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2010 {Prodevelop}   {Task}
26
*/
27
 
28
package org.gvsig.installer.swing.api.wizard;
29
/**
30
 * <p>
31
 * Listener for the wizards used on the installation management. It controls
32
 * the events thrown by the wizard.
33
 * </p> 
34
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodr&aacute;</a>
35
 */
36
public interface InstallerWizardActionListener {
37

  
38
	public void finish(InstallerWizardPanel installerWizard);
39
	
40
	public void cancel(InstallerWizardPanel installerWizard);
41
}
42

  
0 43

  

Also available in: Unified diff