Skip to content

Commit

Permalink
Fixed a bug.
Browse files Browse the repository at this point in the history
As no file has not be opened, pressing analizza now prompts a warning.
  • Loading branch information
woland7 committed Sep 6, 2016
1 parent ab90941 commit d1799e1
Show file tree
Hide file tree
Showing 15 changed files with 188 additions and 122 deletions.
Binary file modified .gradle/2.13/taskArtifacts/cache.properties.lock
Binary file not shown.
Binary file modified .gradle/2.13/taskArtifacts/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/2.13/taskArtifacts/fileSnapshots.bin
Binary file not shown.
Binary file modified .gradle/2.13/taskArtifacts/taskArtifacts.bin
Binary file not shown.
234 changes: 148 additions & 86 deletions .idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ buildscript {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'application'

repositories {
mavenCentral()
}



dependencies{
// this dependency is only required when using UserJvmOptionsService
// compile files("${System.properties['java.home']}/../lib/packager.jar")
Expand Down
Binary file modified build/classes/main/analizzatore/prototipo/DHCP.class
Binary file not shown.
Binary file not shown.
Binary file modified build/distributions/Analizzatore-1.0-SNAPSHOT.tar
Binary file not shown.
Binary file modified build/distributions/Analizzatore-1.0-SNAPSHOT.zip
Binary file not shown.
Binary file removed build/libs/Analizzatore-0.1.0.jar
Binary file not shown.
Binary file removed build/libs/Analizzatore-1.0-SNAPSHOT.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions build/scripts/Analizzatore
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ case "`uname`" in
;;
esac

CLASSPATH=$APP_HOME/lib/Analizzatore-1.0-SNAPSHOT.jar:$APP_HOME/lib/groovy-all-2.3.11.jar:$APP_HOME/lib/commons-beanutils-1.9.2.jar:$APP_HOME/lib/commons-collections-3.2.2.jar:$APP_HOME/lib/commons-scxml-0.9.jar:$APP_HOME/lib/commons-jexl-2.1.1.jar:$APP_HOME/lib/xalan-2.7.2.jar:$APP_HOME/lib/commons-jexl-1.1.jar:$APP_HOME/lib/commons-csv-1.4.jar:$APP_HOME/lib/guava-19.0.jar:$APP_HOME/lib/commons-logging-1.1.1.jar:$APP_HOME/lib/serializer-2.7.2.jar:$APP_HOME/lib/junit-3.8.1.jar:$APP_HOME/lib/xml-apis-1.3.04.jar:$APP_HOME/lib/commons-digester-1.8.jar
CLASSPATH=$APP_HOME/lib/gs-gradle-0.1.0.jar:$APP_HOME/lib/groovy-all-2.3.11.jar:$APP_HOME/lib/commons-beanutils-1.9.2.jar:$APP_HOME/lib/commons-collections-3.2.2.jar:$APP_HOME/lib/commons-scxml-0.9.jar:$APP_HOME/lib/commons-jexl-2.1.1.jar:$APP_HOME/lib/xalan-2.7.2.jar:$APP_HOME/lib/commons-jexl-1.1.jar:$APP_HOME/lib/commons-csv-1.4.jar:$APP_HOME/lib/guava-19.0.jar:$APP_HOME/lib/commons-logging-1.1.1.jar:$APP_HOME/lib/serializer-2.7.2.jar:$APP_HOME/lib/junit-3.8.1.jar:$APP_HOME/lib/xml-apis-1.3.04.jar:$APP_HOME/lib/commons-digester-1.8.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
Expand Down Expand Up @@ -161,4 +161,4 @@ function splitJvmOpts() {
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $ANALIZZATORE_OPTS


exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" analizzatore.prototipo.Analizzatore "$@"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" analizzatore.prototipo.AnalyserUI "$@"
4 changes: 2 additions & 2 deletions build/scripts/Analizzatore.bat
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\lib\Analizzatore-1.0-SNAPSHOT.jar;%APP_HOME%\lib\groovy-all-2.3.11.jar;%APP_HOME%\lib\commons-beanutils-1.9.2.jar;%APP_HOME%\lib\commons-collections-3.2.2.jar;%APP_HOME%\lib\commons-scxml-0.9.jar;%APP_HOME%\lib\commons-jexl-2.1.1.jar;%APP_HOME%\lib\xalan-2.7.2.jar;%APP_HOME%\lib\commons-jexl-1.1.jar;%APP_HOME%\lib\commons-csv-1.4.jar;%APP_HOME%\lib\guava-19.0.jar;%APP_HOME%\lib\commons-logging-1.1.1.jar;%APP_HOME%\lib\serializer-2.7.2.jar;%APP_HOME%\lib\junit-3.8.1.jar;%APP_HOME%\lib\xml-apis-1.3.04.jar;%APP_HOME%\lib\commons-digester-1.8.jar
set CLASSPATH=%APP_HOME%\lib\gs-gradle-0.1.0.jar;%APP_HOME%\lib\groovy-all-2.3.11.jar;%APP_HOME%\lib\commons-beanutils-1.9.2.jar;%APP_HOME%\lib\commons-collections-3.2.2.jar;%APP_HOME%\lib\commons-scxml-0.9.jar;%APP_HOME%\lib\commons-jexl-2.1.1.jar;%APP_HOME%\lib\xalan-2.7.2.jar;%APP_HOME%\lib\commons-jexl-1.1.jar;%APP_HOME%\lib\commons-csv-1.4.jar;%APP_HOME%\lib\guava-19.0.jar;%APP_HOME%\lib\commons-logging-1.1.1.jar;%APP_HOME%\lib\serializer-2.7.2.jar;%APP_HOME%\lib\junit-3.8.1.jar;%APP_HOME%\lib\xml-apis-1.3.04.jar;%APP_HOME%\lib\commons-digester-1.8.jar

@rem Execute Analizzatore
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %ANALIZZATORE_OPTS% -classpath "%CLASSPATH%" analizzatore.prototipo.Analizzatore %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %ANALIZZATORE_OPTS% -classpath "%CLASSPATH%" analizzatore.prototipo.AnalyserUI %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
Expand Down
65 changes: 34 additions & 31 deletions src/main/java/analizzatore/prototipo/controller/UIController.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,40 +76,43 @@ private void handleNuovo(){
}

@FXML
private void handleAnalizza()throws IOException{
private void handleAnalizza()throws IOException {
handlePulisci();
output.appendText("Sto analizzando il file....\n");
if(choiceProtocol.getValue().equals(DHCP_PROTOCOL_NAME)) {
DHCP dhcp = new DHCP(file);
try {
ResultDHCP ris = dhcp.run();
compute(ris);
} catch (ProtocolMismatchException e) {
output.appendText(e.getMessage());
} catch (TransitionNotFoundException e) {
output.appendText(e.getMessage());
} catch (TransitionNotValidException e) {
output.appendText(e.getMessage());
if(e.getTransitions() != null)
for(Transition t: e.getTransitions())
output.appendText(t.getEvent()+"\n");
}
}
else{
HTTP http = new HTTP(file);
try{
ResultHTTP ris = http.run();
compute(ris);
} catch (ProtocolMismatchException e) {
output.appendText(e.getMessage());
} catch (TransitionNotFoundException e) {
output.appendText(e.getMessage());
} catch (TransitionNotValidException e) {
output.appendText(e.getMessage());
for(Transition t: e.getTransitions())
output.appendText(t.getEvent()+"\n");
if (file != null) {
output.appendText("Sto analizzando il file....\n");
if (choiceProtocol.getValue().equals(DHCP_PROTOCOL_NAME)) {
DHCP dhcp = new DHCP(file);
try {
ResultDHCP ris = dhcp.run();
compute(ris);
} catch (ProtocolMismatchException e) {
output.appendText(e.getMessage());
} catch (TransitionNotFoundException e) {
output.appendText(e.getMessage());
} catch (TransitionNotValidException e) {
output.appendText(e.getMessage());
if (e.getTransitions() != null)
for (Transition t : e.getTransitions())
output.appendText(t.getEvent() + "\n");
}
} else {
HTTP http = new HTTP(file);
try {
ResultHTTP ris = http.run();
compute(ris);
} catch (ProtocolMismatchException e) {
output.appendText(e.getMessage());
} catch (TransitionNotFoundException e) {
output.appendText(e.getMessage());
} catch (TransitionNotValidException e) {
output.appendText(e.getMessage());
for (Transition t : e.getTransitions())
output.appendText(t.getEvent() + "\n");
}
}
}
else
output.appendText("Ancora nessun file aperto\n.");
}

private void compute(Result ris) throws IOException{
Expand Down

0 comments on commit d1799e1

Please sign in to comment.