Skip to content
Snippets Groups Projects
Commit 1c6536d8 authored by Shanshan Jiang's avatar Shanshan Jiang
Browse files

tested with MW2.0 DeployManager. Can find DeployManager and execute...

tested with MW2.0 DeployManager. Can find DeployManager and execute requestToInstall with success. Works on one node and two nodes (can select configuration).
parent 5b2850b0
No related branches found
No related tags found
No related merge requests found
Showing
with 103 additions and 63 deletions
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<groupId>org.apache.felix</groupId> <groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId> <artifactId>org.osgi.core</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.sf.qtjambi</groupId> <groupId>net.sf.qtjambi</groupId>
<artifactId>qtjambi</artifactId> <artifactId>qtjambi</artifactId>
<version>4.5.2_01</version> <version>4.5.2_01</version>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<dependency> <dependency>
<groupId>net.sf.qtjambi</groupId> <groupId>net.sf.qtjambi</groupId>
<artifactId>qtjambi</artifactId> <artifactId>qtjambi</artifactId>
<version>4.6.3</version> <version>4.5.2_01</version>
</dependency> </dependency>
<!-- <dependency> <!-- <dependency>
<groupId>com.hp.hpl.jena</groupId> <groupId>com.hp.hpl.jena</groupId>
...@@ -52,8 +52,6 @@ ...@@ -52,8 +52,6 @@
<artifactId>mw.managers.api</artifactId> <artifactId>mw.managers.api</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -44,7 +44,7 @@ import org.universAAL.ucc.core.Activator; ...@@ -44,7 +44,7 @@ import org.universAAL.ucc.core.Activator;
* @version 1.0 * @version 1.0
* @created 11-Jul-2011 15:57:26 * @created 11-Jul-2011 15:57:26
* *
* modified 31-05-2012 by Shanshan * modified 19-09-2012 by Shanshan
* *
*/ */
public class Installer extends ApplicationManager implements IInstaller { public class Installer extends ApplicationManager implements IInstaller {
...@@ -55,6 +55,7 @@ public class Installer extends ApplicationManager implements IInstaller { ...@@ -55,6 +55,7 @@ public class Installer extends ApplicationManager implements IInstaller {
private boolean initialized = false; private boolean initialized = false;
private DeployManager deployManager; private DeployManager deployManager;
private AALSpaceManager aalSpaceManager; private AALSpaceManager aalSpaceManager;
private static String MPA_EXTENSION="-mpa";
public Installer(BundleContext con) { public Installer(BundleContext con) {
context=con; context=con;
...@@ -118,7 +119,7 @@ public class Installer extends ApplicationManager implements IInstaller { ...@@ -118,7 +119,7 @@ public class Installer extends ApplicationManager implements IInstaller {
if(content[i].endsWith(".jar")) jarok=true; if(content[i].endsWith(".jar")) jarok=true;
if(content[i].equals("config.owl")) configok=true; if(content[i].equals("config.owl")) configok=true;
if(content[i].equals("EULA.txt")) eulaok=true; if(content[i].equals("EULA.txt")) eulaok=true;
if(content[i].endsWith(".mpa")) mpa=true; if(content[i].contains(MPA_EXTENSION)) mpa=true;
} }
if(!jarok) throw new Exception("There is no installable jar File in uaal Package!"); if(!jarok) throw new Exception("There is no installable jar File in uaal Package!");
if(!configok) throw new Exception("config.owl file not found!"); if(!configok) throw new Exception("config.owl file not found!");
...@@ -278,25 +279,32 @@ static public void extractFolder(String zipFile, String destdir) throws ZipExcep ...@@ -278,25 +279,32 @@ static public void extractFolder(String zipFile, String destdir) throws ZipExcep
* - get DeployManager * - get DeployManager
*/ */
private boolean initMpaInstallation() { private boolean initMpaInstallation() {
//System.out.println("[Installer.initMpaInstallation]"); System.out.println("[Installer.initMpaInstallation]");
ModuleContext moduleContext = uAALBundleContainer.THE_CONTAINER.registerModule(new Object[] { context }); ModuleContext moduleContext = uAALBundleContainer.THE_CONTAINER.registerModule(new Object[] { context });
Object[] aalManagers = (Object[]) moduleContext.getContainer().fetchSharedObject(moduleContext,new Object[]{AALSpaceManager.class.getName().toString()}); if (moduleContext==null)
System.out.println("[Installer.initMpaInstallation] moduleContext is null!");
else {
System.out.println("[Installer.initMpaInstallation] moduleContext exists!");
moduleContext.logDebug("[Installer.initMpaInstallation] moduleContext exists", null, null);
}
//Object[] aalManagers = (Object[]) moduleContext.getContainer().fetchSharedObject(moduleContext,new Object[]{AALSpaceManager.class.getName().toString()});
Object aalManagers = moduleContext.getContainer().fetchSharedObject(moduleContext,new Object[]{AALSpaceManager.class.getName().toString()});
if(aalManagers != null){ if(aalManagers != null){
moduleContext.logDebug("AALSpaceManagers found...", null); moduleContext.logDebug("[Installer.initMpaInstallation] AALSpaceManagers found...", null, null);
System.out.println("[MpaParser] AALSpaceManagers found..."); System.out.println("[Installer.initMpaInstallation] AALSpaceManagers found...");
if(aalManagers[0] instanceof AALSpaceManager){ if(aalManagers instanceof AALSpaceManager){
aalSpaceManager = (AALSpaceManager)aalManagers[0]; aalSpaceManager = (AALSpaceManager)aalManagers;
} }
else{ else{
moduleContext.logWarn("No AALSpaceManagers found", null); moduleContext.logWarn("Installer.initMpaInstallation] No AALSpaceManagers found", null, null);
System.out.println("[Installer.initMpaInstallation]No AALSpaceManagers found"); System.out.println("[Installer.initMpaInstallation]No AALSpaceManagers found");
initialized = false; initialized = false;
return initialized; return initialized;
} }
}else{ }else{
moduleContext.logWarn("No AALSpaceManagers found", null); moduleContext.logWarn("Installer.initMpaInstallation] No AALSpaceManagers found", null, null);
System.out.println("[MpaParser]No AALSpaceManagers found"); System.out.println("[MpaParser]No AALSpaceManagers found");
initialized = false; initialized = false;
return initialized; return initialized;
...@@ -305,29 +313,12 @@ static public void extractFolder(String zipFile, String destdir) throws ZipExcep ...@@ -305,29 +313,12 @@ static public void extractFolder(String zipFile, String destdir) throws ZipExcep
Object refs = moduleContext.getContainer().fetchSharedObject(moduleContext,new Object[]{DeployManager.class.getName().toString()}); Object refs = moduleContext.getContainer().fetchSharedObject(moduleContext,new Object[]{DeployManager.class.getName().toString()});
if(refs != null){ if(refs != null){
deployManager = (DeployManager)refs; deployManager = (DeployManager)refs;
// -- just for testing
URI mpaUri = null;
try {
mpaUri = new URI("http://aaloa.isti.cnr.it/Ping-Pong-mpa.xml");
Map layout = new HashMap();
PeerCard card1= new PeerCard("DeployNode1", PeerRole.PEER);
layout.put(card1, "Part1");
System.out.println("[Installer] call deploy manager to install " + mpaUri.toString() + " for "
+ layout.toString());
deployManager.requestToInstall(mpaUri, layout);
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// -- end for testing
initialized = true; initialized = true;
return initialized; return initialized;
}else{ }else{
moduleContext.logWarn("No DeployManager found", null); moduleContext.logWarn("Installer.initMpaInstallation] No DeployManager found", null, null);
System.out.println("No DeployManager found"); System.out.println("Installer.initMpaInstallation] No DeployManager found");
initialized = false; initialized = false;
return initialized; return initialized;
} }
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<classpathentry kind="src" output="target/classes" path="src/main/java"/> <classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="src" path="Generated JUIC files"/> <classpathentry kind="src" path="Generated JUIC files"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<groupId>org.universAAL.tools.ucc</groupId> <groupId>org.universAAL.tools.ucc</groupId>
<artifactId>ucc.pom</artifactId> <artifactId>ucc.pom</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.2.1-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>universAAL Control Center</name> <name>universAAL Control Center</name>
...@@ -40,20 +40,25 @@ ...@@ -40,20 +40,25 @@
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>org.universAAL.middleware</groupId>
<artifactId>mw.data.representation.osgi</artifactId>
<version>1.2.1-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>org.universAAL.middleware</groupId> <groupId>org.universAAL.middleware</groupId>
<artifactId>mw.data.representation</artifactId> <artifactId>mw.bus.model.osgi</artifactId>
<version>1.1.1-SNAPSHOT</version> <version>1.2.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.universAAL.middleware</groupId> <groupId>org.universAAL.middleware</groupId>
<artifactId>mw.bus.model</artifactId> <artifactId>mw.bus.ui.osgi</artifactId>
<version>1.1.1-SNAPSHOT</version> <version>1.2.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.universAAL.middleware</groupId> <groupId>org.universAAL.middleware</groupId>
<artifactId>mw.bus.ui</artifactId> <artifactId>mw.acl.interfaces.osgi</artifactId>
<version>1.1.1-SNAPSHOT</version> <version>1.2.1-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
...@@ -83,6 +88,15 @@ ...@@ -83,6 +88,15 @@
</roles> </roles>
<timezone>CEST/CET</timezone> <timezone>CEST/CET</timezone>
</developer> </developer>
<developer>
<id>shanshan</id>
<email>Shanshan.Jiang@sintef.no</email>
<name>Shanshan Jiang</name>
<roles>
<role>developer</role>
</roles>
<timezone>CEST/CET</timezone>
</developer>
</developers> </developers>
<contributors /> <contributors />
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<Bundle-Description>${project.description}</Bundle-Description> <Bundle-Description>${project.description}</Bundle-Description>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Private-Package>org.universAAL.ucc.viewjambi.impl,org.universAAL.ucc.viewjambi.information,org.universAAL.ucc.viewjambi.install,org.universAAL.ucc.viewjambi.juic,org.universAAL.ucc.viewjambi.layouts,org.universAAL.ucc.viewjambi.overview,org.universAAL.ucc.viewjambi.store</Private-Package> <Private-Package>org.universAAL.ucc.viewjambi.impl,org.universAAL.ucc.viewjambi.information,org.universAAL.ucc.viewjambi.install,org.universAAL.ucc.viewjambi.juic,org.universAAL.ucc.viewjambi.layouts,org.universAAL.ucc.viewjambi.overview,org.universAAL.ucc.viewjambi.store</Private-Package>
<Export-Package>org.universAAL.ucc.viewjambi.common,com.trolltech.qt.*</Export-Package> <Export-Package>org.universAAL.ucc.viewjambi.common, com.trolltech.qt.*</Export-Package>
<Include-Resource> <Include-Resource>
{maven-resources} {maven-resources}
</Include-Resource> </Include-Resource>
......
...@@ -109,12 +109,11 @@ public class DeployConfigView extends SubWindow { ...@@ -109,12 +109,11 @@ public class DeployConfigView extends SubWindow {
// check the validity of the configuration layout // check the validity of the configuration layout
if (!checkLayout()) { if (!checkLayout()) {
// the selection is not valid // the selection is not valid
QMessageBox.information(this, "Configure error", "The configuration is not valid. Please try again!"); QMessageBox.warning(this, "Configure error", "The configuration is not valid. Please try again!");
return; return;
} }
MainWindow.getInstance().removeSubWindow(this); MainWindow.getInstance().removeSubWindow(this);
System.out.println("Start deploying..."); System.out.println("Start deploying...");
QMessageBox.information(this, "Deploy", "start deploying the multi-part application...");
//save the deploy configuration //save the deploy configuration
for(Part part : layout.keySet()){ for(Part part : layout.keySet()){
PeerCard card = peers.get(layout.get(part)); PeerCard card = peers.get(layout.get(part));
...@@ -122,8 +121,11 @@ public class DeployConfigView extends SubWindow { ...@@ -122,8 +121,11 @@ public class DeployConfigView extends SubWindow {
+ ":" + layout.get(part) + "/" + part.getPartId()); + ":" + layout.get(part) + "/" + part.getPartId());
mpaLayout.put(card, part); mpaLayout.put(card, part);
} }
ProgressThread progress = new ProgressThread();
progress.start();
// call MW deploy manager requestToInstall // call MW deploy manager requestToInstall
InstallationResults results = Activator.getInstaller().requestToInstall((new File(deployPath)).toURI(), mpaLayout); InstallationResults results = Activator.getInstaller().requestToInstall((new File(deployPath)).toURI(), mpaLayout);
progress.finished=true;
switch (results) { switch (results) {
case SUCCESS: case SUCCESS:
QMessageBox.information(this, "Installation result", "The multi-part application has been successfully installed!"); QMessageBox.information(this, "Installation result", "The multi-part application has been successfully installed!");
...@@ -131,17 +133,17 @@ public class DeployConfigView extends SubWindow { ...@@ -131,17 +133,17 @@ public class DeployConfigView extends SubWindow {
break; break;
case FAILED: case FAILED:
QMessageBox.information(this, "Installation result", "The installation of the multi-part application has been failed!"); QMessageBox.warning(this, "Installation result", "The installation of the multi-part application has been failed!");
System.out.println("[DeployConfigView.nextScreen] The installation of the multi-part application has been failed!"); System.out.println("[DeployConfigView.nextScreen] The installation of the multi-part application has been failed!");
break; break;
case NO_AALSPACE_JOINED: case NO_AALSPACE_JOINED:
QMessageBox.information(this, "Installation result", "Error in the installation of the multi-part application: no AALspace joined!"); QMessageBox.warning(this, "Installation result", "Error in the installation of the multi-part application: no AALspace joined!");
System.out.println("[DeployConfigView.nextScreen] Error in the installation of the multi-part application: no AALspace joined!"); System.out.println("[DeployConfigView.nextScreen] Error in the installation of the multi-part application: no AALspace joined!");
break; break;
case MPA_URI_INVALID: case MPA_URI_INVALID:
QMessageBox.information(this, "Installation result", "Error in the installation of the multi-part application: MPA uri is invalid!"); QMessageBox.warning(this, "Installation result", "Error in the installation of the multi-part application: MPA uri is invalid!");
System.out.println("[DeployConfigView.nextScreen] Error in the installation of the multi-part application: MPA uri is invalid!"); System.out.println("[DeployConfigView.nextScreen] Error in the installation of the multi-part application: MPA uri is invalid!");
break; break;
...@@ -215,15 +217,15 @@ public class DeployConfigView extends SubWindow { ...@@ -215,15 +217,15 @@ public class DeployConfigView extends SubWindow {
} }
else System.out.println("[DeployConfigView.checkLayout] The part " + part.getPartId() + " can be installed on the peer " + layout.get(part)); else System.out.println("[DeployConfigView.checkLayout] The part " + part.getPartId() + " can be installed on the peer " + layout.get(part));
} }
// check if a peer is associated with more than one part // check if a peer is associated with more than one part -- no need for such check
for (String peerId: layout.values()) { /* for (String peerId: layout.values()) {
System.out.println("[DeployConfigView.checkLayout] check for peer " + peerId); System.out.println("[DeployConfigView.checkLayout] check for peer " + peerId);
if (countPeer(peerId)>1) { if (countPeer(peerId)>1) {
System.out.println("[DeployConfigView.checkLayout] " + peerId + " has been associated with more than one part!"); System.out.println("[DeployConfigView.checkLayout] " + peerId + " has been associated with more than one part!");
QMessageBox.information(this, "Validity check", peerId + " has been associated with more than one part!"); QMessageBox.information(this, "Validity check", peerId + " has been associated with more than one part!");
valid = false; valid = false;
} }
} } */
return valid; return valid;
} }
......
...@@ -16,6 +16,7 @@ import org.universAAL.ucc.viewjambi.impl.Activator; ...@@ -16,6 +16,7 @@ import org.universAAL.ucc.viewjambi.impl.Activator;
import org.universAAL.ucc.viewjambi.impl.MainWindow; import org.universAAL.ucc.viewjambi.impl.MainWindow;
import org.universAAL.ucc.viewjambi.juic.Ui_DeployStrategyView; import org.universAAL.ucc.viewjambi.juic.Ui_DeployStrategyView;
import com.trolltech.qt.core.QTimer;
import com.trolltech.qt.gui.*; import com.trolltech.qt.gui.*;
public class DeployStrategyView extends SubWindow { public class DeployStrategyView extends SubWindow {
...@@ -25,7 +26,7 @@ public class DeployStrategyView extends SubWindow { ...@@ -25,7 +26,7 @@ public class DeployStrategyView extends SubWindow {
String deployPath; String deployPath;
MpaParser mpaParser; MpaParser mpaParser;
Map<String, PeerCard> peers; Map<String, PeerCard> peers;
/** /**
* *
* @param path deployPath, i.e., path of the extracted files from .uaal * @param path deployPath, i.e., path of the extracted files from .uaal
...@@ -68,7 +69,11 @@ public class DeployStrategyView extends SubWindow { ...@@ -68,7 +69,11 @@ public class DeployStrategyView extends SubWindow {
if (defaultStrategy) { if (defaultStrategy) {
Map config = buildDefaultInstallationLayout(); Map config = buildDefaultInstallationLayout();
InstallationResults results = Activator.getInstaller().requestToInstall((new File(deployPath)).toURI(), config); MainWindow.getInstance().removeSubWindow(this);
ProgressThread progress = new ProgressThread();
progress.start();
InstallationResults results = Activator.getInstaller().requestToInstall((new File(deployPath)).toURI(), config);
progress.finished = true;
switch (results) { switch (results) {
case SUCCESS: case SUCCESS:
QMessageBox.information(this, "Installation result", "The multi-part application has been successfully installed!"); QMessageBox.information(this, "Installation result", "The multi-part application has been successfully installed!");
...@@ -76,17 +81,17 @@ public class DeployStrategyView extends SubWindow { ...@@ -76,17 +81,17 @@ public class DeployStrategyView extends SubWindow {
break; break;
case FAILED: case FAILED:
QMessageBox.information(this, "Installation result", "The installation of the multi-part application has been failed!"); QMessageBox.warning(this, "Installation result", "The installation of the multi-part application has been failed!");
System.out.println("[DeployStrategyView.ok] The installation of the multi-part application has been failed!"); System.out.println("[DeployStrategyView.ok] The installation of the multi-part application has been failed!");
break; break;
case NO_AALSPACE_JOINED: case NO_AALSPACE_JOINED:
QMessageBox.information(this, "Installation result", "Error in the installation of the multi-part application: no AALspace joined!"); QMessageBox.warning(this, "Installation result", "Error in the installation of the multi-part application: no AALspace joined!");
System.out.println("[DeployStrategyView.ok] Error in the installation of the multi-part application: no AALspace joined!"); System.out.println("[DeployStrategyView.ok] Error in the installation of the multi-part application: no AALspace joined!");
break; break;
case MPA_URI_INVALID: case MPA_URI_INVALID:
QMessageBox.information(this, "Installation result", "Error in the installation of the multi-part application: MPA uri is invalid!"); QMessageBox.warning(this, "Installation result", "Error in the installation of the multi-part application: MPA uri is invalid!");
System.out.println("[DeployStrategyView.ok] Error in the installation of the multi-part application: MPA uri is invalid!"); System.out.println("[DeployStrategyView.ok] Error in the installation of the multi-part application: MPA uri is invalid!");
break; break;
...@@ -175,8 +180,6 @@ public class DeployStrategyView extends SubWindow { ...@@ -175,8 +180,6 @@ public class DeployStrategyView extends SubWindow {
private void cancel() { private void cancel() {
MainWindow.getInstance().removeSubWindow(this); MainWindow.getInstance().removeSubWindow(this);
} }
} }
...@@ -17,6 +17,7 @@ public class LicenseView extends SubWindow { ...@@ -17,6 +17,7 @@ public class LicenseView extends SubWindow {
private static Ui_License install_base = new Ui_License(); private static Ui_License install_base = new Ui_License();
private static String appDir; private static String appDir;
private static boolean mpa=false; private static boolean mpa=false;
private static String MPA_EXTENSION="-mpa";
public LicenseView(String path) throws IOException { public LicenseView(String path) throws IOException {
super(LicenseView.install_base); super(LicenseView.install_base);
...@@ -69,7 +70,7 @@ public class LicenseView extends SubWindow { ...@@ -69,7 +70,7 @@ public class LicenseView extends SubWindow {
File folder=new File(appDir); File folder=new File(appDir);
String[] content = folder.list(); String[] content = folder.list();
for(int i=0;i<content.length;i++){ for(int i=0;i<content.length;i++){
if(content[i].endsWith(".mpa")) if(content[i].contains(MPA_EXTENSION))
return true; return true;
} }
return false; return false;
......
...@@ -12,6 +12,7 @@ import org.universAAL.middleware.connectors.deploy.model.ObjectFactory; ...@@ -12,6 +12,7 @@ import org.universAAL.middleware.connectors.deploy.model.ObjectFactory;
public class MpaParser { public class MpaParser {
AalMpa mpa = null; AalMpa mpa = null;
private static String MPA_EXTENSION="-mpa";
private JAXBContext jc; private JAXBContext jc;
private Unmarshaller unmarshaller; private Unmarshaller unmarshaller;
...@@ -29,7 +30,7 @@ public class MpaParser { ...@@ -29,7 +30,7 @@ public class MpaParser {
File appDir=new File(deployPath); File appDir=new File(deployPath);
String[] filelist=appDir.list(); String[] filelist=appDir.list();
for(int i=0;i<filelist.length;i++){ for(int i=0;i<filelist.length;i++){
if(filelist[i].endsWith(".mpa")){ if(filelist[i].contains(MPA_EXTENSION)){
String mpaName = deployPath+File.separator+filelist[i]; String mpaName = deployPath+File.separator+filelist[i];
System.out.println("[MpaParser] the mpa file is: " + mpaName); System.out.println("[MpaParser] the mpa file is: " + mpaName);
// convert"\" to "//" -- this is OS dependent, solve later // convert"\" to "//" -- this is OS dependent, solve later
......
package org.universAAL.ucc.viewjambi.install;
import com.trolltech.qt.gui.QProgressDialog;
public class ProgressThread extends Thread {
boolean finished = false;
public void run() {
QProgressDialog qd = new QProgressDialog("Installing the multi-part application...", null, 0, 100);
qd.setWindowTitle("Installing");
qd.setAutoClose(true);
int i=1;
qd.setValue(10);
while(!finished) {
try {
sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (i<10) {
qd.setValue(i*10);
System.out.println("progressing: " + i*10 + "%");
i++;
}
}
qd.setValue(100);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment