From: Michele Silva Date: Wed, 18 Jan 2012 00:33:30 +0000 (-0200) Subject: Added new UI to upload bayesian network. X-Git-Url: http://200.18.67.61/gitweb/?p=simdecs.git;a=commitdiff_plain;h=3f2db471cd39158fc42f41ccc0a04aadd5abd9f3 Added new UI to upload bayesian network. --- diff --git a/lib/commons-fileupload-1.2.2.jar b/lib/commons-fileupload-1.2.2.jar new file mode 100644 index 0000000..131f192 Binary files /dev/null and b/lib/commons-fileupload-1.2.2.jar differ diff --git a/lib/commons-io-2.1.jar b/lib/commons-io-2.1.jar new file mode 100644 index 0000000..b5c7d69 Binary files /dev/null and b/lib/commons-io-2.1.jar differ diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 0decccd..6f913dd 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -693,6 +693,8 @@ exists or setup the property manually. For example like this: + + @@ -717,6 +719,8 @@ exists or setup the property manually. For example like this: + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index f140bcb..59b9ae8 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=1f90bca6 +build.xml.data.CRC32=ea275e7b build.xml.script.CRC32=5a865f64 build.xml.stylesheet.CRC32=651128d4@1.36.1.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=1f90bca6 -nbproject/build-impl.xml.script.CRC32=05db1bc7 +nbproject/build-impl.xml.data.CRC32=ea275e7b +nbproject/build-impl.xml.script.CRC32=bd134794 nbproject/build-impl.xml.stylesheet.CRC32=b7883b1f@1.36.1.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index d1c5ee5..e1512a8 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -28,6 +28,8 @@ dist.war=${dist.dir}/${war.name} endorsed.classpath= excludes= file.reference.avalon-framework-4.1.3.jar=lib/avalon-framework-4.1.3.jar +file.reference.commons-fileupload-1.2.2.jar=lib/commons-fileupload-1.2.2.jar +file.reference.commons-io-2.1.jar=lib/commons-io-2.1.jar file.reference.commons-lang3-3.1.jar=lib/commons-lang3-3.1.jar file.reference.commons-logging-1.1.jar=lib/commons-logging-1.1.jar file.reference.icu4j-3.8.jar=lib/icu4j-3.8.jar @@ -77,7 +79,9 @@ javac.classpath=\ ${file.reference.unbbayes-4.10.4-1s.jar}:\ ${file.reference.xalan-2.7.0.jar}:\ ${file.reference.xml-apis-1.0.b2.jar}:\ - ${file.reference.commons-lang3-3.1.jar} + ${file.reference.commons-lang3-3.1.jar}:\ + ${file.reference.commons-fileupload-1.2.2.jar}:\ + ${file.reference.commons-io-2.1.jar} # Space-separated list of extra javac options javac.compilerargs= javac.debug=true diff --git a/nbproject/project.xml b/nbproject/project.xml index 5dee40a..8a6aa3f 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -86,6 +86,14 @@ ${file.reference.commons-lang3-3.1.jar} WEB-INF/lib + + ${file.reference.commons-fileupload-1.2.2.jar} + WEB-INF/lib + + + ${file.reference.commons-io-2.1.jar} + WEB-INF/lib + diff --git a/src/java/org/ufcspa/simdecs/bn/ui/NodeController.java b/src/java/org/ufcspa/simdecs/bn/ui/NodeController.java index bd24dd9..11604a3 100644 --- a/src/java/org/ufcspa/simdecs/bn/ui/NodeController.java +++ b/src/java/org/ufcspa/simdecs/bn/ui/NodeController.java @@ -20,6 +20,7 @@ import javax.faces.model.SelectItem; import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceUnit; import javax.transaction.UserTransaction; +import org.primefaces.event.RowEditEvent; @ManagedBean(name = "nodeController") @SessionScoped @@ -37,6 +38,11 @@ public class NodeController implements Serializable { public NodeController() { } + + public void rowEditListener(RowEditEvent event) throws Exception { + Node node = (Node) event.getObject(); + getJpaController().edit(node); + } public Node getSelected() { if (current == null) { diff --git a/src/java/org/ufcspa/simdecs/bn/ui/NodeTypeController.java b/src/java/org/ufcspa/simdecs/bn/ui/NodeTypeController.java new file mode 100644 index 0000000..81154fa --- /dev/null +++ b/src/java/org/ufcspa/simdecs/bn/ui/NodeTypeController.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.ufcspa.simdecs.bn.ui; + +import java.util.ArrayList; +import java.util.List; +import javax.faces.bean.ApplicationScoped; +import javax.faces.bean.ManagedBean; +import javax.faces.model.SelectItem; +import org.ufcspa.simdecs.bn.entity.NodeType; + +/** + * + * @author mchelem + */ +@ManagedBean(name = "nodeTypeController") +@ApplicationScoped +public class NodeTypeController { + private NodeType nodeType; + + public void setNodeType(NodeType nodeType) { this.nodeType=nodeType; } + + public NodeType getNodeType() { return this.nodeType; } + + public List getNodeTypes() { + List items = new ArrayList(); + for (NodeType type: NodeType.values()) { + items.add(new SelectItem(type, type.toString())); + } + return items; + } +} diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml index 0c3e8eb..8187691 100644 --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -69,4 +69,14 @@ editDiagram.jsf + + PrimeFaces FileUpload Filter + + org.primefaces.webapp.filter.FileUploadFilter + + + + PrimeFaces FileUpload Filter + Faces Servlet + diff --git a/web/bn.xhtml b/web/bn.xhtml index c677556..d42bc8c 100644 --- a/web/bn.xhtml +++ b/web/bn.xhtml @@ -10,245 +10,244 @@

SimDeCS - Cadastro de Redes Bayesianas

- - - - - - - - - + + + + Enviar Redes Bayesianas + + + - - -

- -
- - - - - - - - - - + + +

+ +
+ + + - - - - - - - - - - - - - - - - -
-
+ -
-
-
- - -

- -
- - - - - - - + rowEditListener="#{bayesianNetworkController.rowEditListener}"> + + - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - + + + + - - - + -
- - -

- -
- - - - + + +
+ + +

+ +
+ + + + - - - + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + - - + + - -

- -
-
- - -

- -
- - - - +
+ + +

+ +
+ + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - -

- -
-
+ + + + + + + + + + + + +

+ +
+ + + +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +
+
diff --git a/web/img/bn/browse.png b/web/img/bn/browse.png new file mode 100644 index 0000000..1dc40d2 Binary files /dev/null and b/web/img/bn/browse.png differ diff --git a/web/img/bn/remove.png b/web/img/bn/remove.png new file mode 100644 index 0000000..03e3170 Binary files /dev/null and b/web/img/bn/remove.png differ