From: Michele Silva Date: Thu, 19 Jan 2012 20:31:35 +0000 (-0200) Subject: Adding node role (sintoma, diagnóstico, conduta) to Node. X-Git-Url: http://200.18.67.61/gitweb/?p=simdecs.git;a=commitdiff_plain;h=7f3a0a9f7d1ad7127a5c7e53beceb40859b1106d Adding node role (sintoma, diagnóstico, conduta) to Node. --- diff --git a/src/java/org/ufcspa/simdecs/bn/entity/Node.java b/src/java/org/ufcspa/simdecs/bn/entity/Node.java index f646659..80cd40c 100644 --- a/src/java/org/ufcspa/simdecs/bn/entity/Node.java +++ b/src/java/org/ufcspa/simdecs/bn/entity/Node.java @@ -23,6 +23,8 @@ public class Node implements Serializable { private NodeType nodeType; + private NodeType nodeRole; + private Integer time = 0; private Float cost = 0.0f; @@ -57,6 +59,14 @@ public class Node implements Serializable { this.nodeType = nodeType; } + public NodeType getNodeRole() { + return nodeRole; + } + + public void setNodeRole(NodeType nodeRole) { + this.nodeRole = nodeRole; + } + public Integer getTime() { return time; } diff --git a/src/java/org/ufcspa/simdecs/bn/entity/NodeRole.java b/src/java/org/ufcspa/simdecs/bn/entity/NodeRole.java new file mode 100644 index 0000000..bf6d434 --- /dev/null +++ b/src/java/org/ufcspa/simdecs/bn/entity/NodeRole.java @@ -0,0 +1,11 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.ufcspa.simdecs.bn.entity; + +/** + * + * @author mchelem + */ +public enum NodeRole {Sintoma, Diagnóstico, Conduta} diff --git a/src/java/org/ufcspa/simdecs/bn/entity/NodeType.java b/src/java/org/ufcspa/simdecs/bn/entity/NodeType.java index 3ca294c..ace78c9 100644 --- a/src/java/org/ufcspa/simdecs/bn/entity/NodeType.java +++ b/src/java/org/ufcspa/simdecs/bn/entity/NodeType.java @@ -8,4 +8,4 @@ package org.ufcspa.simdecs.bn.entity; * * @author mchelem */ -public enum NodeType {Complementar, Essencial, Excludente, Trigger} +public enum NodeType {Complementar, Essencial, Excludente, Trigger, Bogus} diff --git a/src/java/org/ufcspa/simdecs/bn/ui/NodeRoleController.java b/src/java/org/ufcspa/simdecs/bn/ui/NodeRoleController.java new file mode 100644 index 0000000..d30b742 --- /dev/null +++ b/src/java/org/ufcspa/simdecs/bn/ui/NodeRoleController.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.NodeRole; + +/** + * + * @author mchelem + */ +@ManagedBean(name = "nodeRoleController") +@ApplicationScoped +public class NodeRoleController { + private NodeRole nodeRole; + + public void setNodeRole(NodeRole nodeRole) { this.nodeRole=nodeRole; } + + public NodeRole getNodeRole() { return this.nodeRole; } + + public List getNodeRoles() { + List items = new ArrayList(); + for (NodeRole role: NodeRole.values()) { + items.add(new SelectItem(role, role.toString())); + } + return items; + } +} diff --git a/web/bn.xhtml b/web/bn.xhtml index d42bc8c..b31236f 100644 --- a/web/bn.xhtml +++ b/web/bn.xhtml @@ -25,7 +25,8 @@ - +

@@ -65,7 +66,8 @@
- + +

@@ -111,7 +113,7 @@ - + @@ -126,6 +128,21 @@ + + + + + + + + + + + + @@ -140,7 +157,7 @@
- +

@@ -190,7 +207,7 @@
- +