|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunbbayes.prs.Node
public abstract class Node
A class representing a generic node containing graphical/visual information.
Nested Class Summary | |
---|---|
class |
Node.NodeNameChangedEvent
NAME CHANGE LISTENER |
static interface |
Node.NodeNameChangedListener
|
class |
Node.SetList<E>
This is just an ArrayList which does not allow duplicate elements |
Field Summary | |
---|---|
protected Color |
backColor
|
static int |
CONTINUOUS_NODE_TYPE
|
static int |
DECISION_NODE_TYPE
|
static Point |
DEFAULT_SIZE
|
static int |
DESCRIPTION_TYPE
|
static String |
DISPLAY_MODE_BAR
|
static String |
DISPLAY_MODE_ELLIPSE
|
static int |
EXPLANATION_TYPE
|
int[] |
infoestados
|
protected String |
label
|
protected double[] |
mean
Holds the mean of the values for each class if this is a numeric attribute node |
protected String |
name
|
protected List<Node.NodeNameChangedListener> |
nodeNameChangedListenerList
|
protected ArrayList<Node> |
parents
|
protected SerializablePoint2D |
position
|
static int |
PROBABILISTIC_NODE_TYPE
|
protected SerializablePoint2D |
size
|
protected boolean |
sizeIsVariable
|
protected SerializablePoint2D |
sizeVariable
|
protected double[] |
standardDeviation
Holds the standard deviation of the values for each class if this is a numeric attribute node. |
protected List<String> |
states
|
static int |
UTILITY_NODE_TYPE
|
Constructor Summary | |
---|---|
Node()
Builds a new node and makes the expected initializations. |
Method Summary | |
---|---|
void |
addChild(Node child)
|
void |
addChildNode(INode child)
Adds a child to this node |
void |
addExplanationPhrase(ExplanationPhrase explanationPhrase)
|
void |
addNodeNameChangedListener(Node.NodeNameChangedListener listener)
|
void |
addParent(Node parent)
|
void |
addParentNode(INode parent)
Add a parent to this node |
void |
appendState(String state)
Inserts a state with the specified name at the end of the list. |
void |
atualizatamanhoinfoestados()
Used within dalgo2 |
void |
clearAdjacents()
Clears the list of adjacent nodes. |
int |
compareTo(Node arg0)
|
boolean |
equals(Object obj)
|
List<INode> |
getAdjacentNodes()
Obtains a list of adjacent nodes. |
ArrayList<Node> |
getAdjacents()
Obtains a list of adjacents. |
List<INode> |
getChildNodes()
Obtains a list of children. |
ArrayList<Node> |
getChildren()
Obtains a list of children. |
Color |
getColor()
|
static int |
getDefaultHeight()
Get the node's height. |
static Point |
getDefaultSize()
|
static int |
getDefaultWidth()
Get the node's width. |
String |
getDescription()
Obtains the name of this node. |
String |
getDisplayMode()
|
String |
getExplanationDescription()
Obtains the description of the explanation of the node. |
ExplanationPhrase |
getExplanationPhrase(String node)
|
int |
getHeight()
Get the node's height. |
int |
getInformationType()
Returns the type of information of this node. |
String |
getLabel()
Return the node's label (text of the node). |
double[] |
getMean()
Get the mean of the values if this is a numeric attribute node. |
String |
getName()
Returns the node's literal symbol. |
List<INode> |
getParentNodes()
Obtains a list of parents. |
ArrayList<Node> |
getParents()
Obtains a list of parents. |
ArrayMap<String,ExplanationPhrase> |
getPhrasesMap()
Obtains the ArrayMap with the phrases. |
Point2D.Double |
getPosition()
|
Point2D.Double |
getSize()
Returns the node's size (x,y) where x = width and y = height. |
double[] |
getStandardDeviation()
Get the mean of the values if this is a numeric attribute node. |
String |
getStateAt(int index)
Returns the state of the position given by index |
int |
getStatesSize()
It returns the node's quantity of states. |
int |
getWidth()
Get the node's width. |
boolean |
hasState(String state)
Verifies if the node has a given state. |
boolean |
isChildOf(Node parent)
|
boolean |
isParentOf(Node child)
|
boolean |
isPointInDrawableArea(int x,
int y)
|
boolean |
isSelected()
|
void |
makeAdjacents()
Builds the list of adjacent nodes. |
protected void |
nameChanged(Node.NodeNameChangedEvent event)
|
void |
removeChild(Node child)
|
void |
removeChildNode(INode child)
Removes a child from this node |
void |
removeLastState()
Deletes the node's last inserted state (i.e the last element inside the list of states). |
void |
removeNodeNameChangedListener(Node.NodeNameChangedListener listener)
|
void |
removeParent(Node parent)
|
void |
removeParentNode(INode parent)
Removes a parent from this node |
void |
removeStateAt(int index)
Used within dalgo2. |
void |
setAdjacents(ArrayList<Node> adjacents)
Sets the adjacents. |
void |
setChildNodes(List<INode> children)
Sets a new list of children. |
void |
setChildren(ArrayList<Node> children)
Sets a new list of children. |
void |
setColor(Color c)
|
void |
setDescription(String texto)
Changes node's description. |
void |
setDisplayMode(String s)
|
void |
setExplanationDescription(String text)
Modifica a descriÔøΩÔøΩo da explanaÔøΩÔøΩo do nÔøΩ. |
void |
setInformationType(int informationType)
Modify the node's type of information. |
void |
setLabel(String label)
Set the node's label (text of the node). |
void |
setMean(double[] mean)
Set the mean of the values if this is a numeric attribute node. |
void |
setName(String name)
Set the node's name. |
void |
setParentNodes(List<INode> parents)
Sets a new list of parents. |
void |
setParents(ArrayList<Node> parents)
Sets a new list of parents. |
ArrayMap<String,ExplanationPhrase> |
setPhrasesMap(ArrayMap<String,ExplanationPhrase> phrasesMap)
Modifies the ArrayMap with the phrases |
void |
setPosition(double x,
double y)
|
void |
setSelected(boolean b)
|
void |
setSize(double width,
double height)
Set the node's size. |
void |
setSizeIsVariable(boolean is)
|
void |
setSizeVariable(double width,
double height)
|
void |
setStandardDeviation(double[] standardDeviation)
Set the mean of the values if this is a numeric attribute node. |
void |
setStateAt(String state,
int index)
Replaces a state at given position to the specified position. |
void |
setStates(List<String> states)
Sets the states. |
String |
toString()
Prints a description of the node using "description (name)" format (without the quotes). |
String |
updateLabel()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface unbbayes.prs.INode |
---|
getType |
Field Detail |
---|
protected String name
protected String label
public static Point DEFAULT_SIZE
protected SerializablePoint2D position
protected Color backColor
protected SerializablePoint2D size
protected SerializablePoint2D sizeVariable
protected boolean sizeIsVariable
protected ArrayList<Node> parents
protected List<String> states
public int[] infoestados
public static final String DISPLAY_MODE_ELLIPSE
public static final String DISPLAY_MODE_BAR
public static final int PROBABILISTIC_NODE_TYPE
public static final int UTILITY_NODE_TYPE
public static final int DECISION_NODE_TYPE
public static final int DESCRIPTION_TYPE
public static final int EXPLANATION_TYPE
public static final int CONTINUOUS_NODE_TYPE
protected double[] mean
protected double[] standardDeviation
protected List<Node.NodeNameChangedListener> nodeNameChangedListenerList
Constructor Detail |
---|
public Node()
Method Detail |
---|
public static Point getDefaultSize()
public int getInformationType()
public void setInformationType(int informationType)
informationType
- type of information
Exception
- if the type of information is invalidpublic void addExplanationPhrase(ExplanationPhrase explanationPhrase)
public ExplanationPhrase getExplanationPhrase(String node) throws Exception
Exception
public void setDescription(String texto)
setDescription
in interface INode
texto
- node's description.public void setName(String name)
setName
in interface INode
name
- Node's name.public void setLabel(String label)
label
- Node's label.public String getLabel()
public String updateLabel()
public void setChildren(ArrayList<Node> children)
children
- List of nodes representing the children.public void setParents(ArrayList<Node> parents)
parents
- List of nodes representing the parents.public void addChild(Node child) throws InvalidParentException
InvalidParentException
public void removeChild(Node child)
public void addParent(Node parent) throws InvalidParentException
InvalidParentException
public void removeParent(Node parent)
public boolean isParentOf(Node child)
public boolean isChildOf(Node parent)
public void setExplanationDescription(String text)
texto
- A text representing the node's explanation's description.
descriÔøΩÔøΩo da explanaÔøΩÔøΩo do nÔøΩ.public ArrayMap<String,ExplanationPhrase> setPhrasesMap(ArrayMap<String,ExplanationPhrase> phrasesMap)
phrasesMap
- a new ArrayMap to be set
public String getDescription()
getDescription
in interface INode
public ArrayList<Node> getAdjacents()
public String getName()
getName
in interface INode
public final ArrayList<Node> getChildren()
public final ArrayList<Node> getParents()
public String getExplanationDescription()
public ArrayMap<String,ExplanationPhrase> getPhrasesMap()
public void atualizatamanhoinfoestados()
public boolean hasState(String state)
state
- The state name to look for.
public void appendState(String state)
appendState
in interface INode
state
- Name of the state to be added.public void removeLastState()
removeLastState
in interface INode
public void removeStateAt(int index)
removeStateAt
in interface INode
public void setStateAt(String state, int index)
setStateAt
in interface INode
state
- Name of the new state.index
- Position of the state being substituted. Starts with 0.public final int getStatesSize()
getStatesSize
in interface INode
public final String getStateAt(int index)
index
getStateAt
in interface INode
index
- position of the state to be read.
index
public void makeAdjacents()
public void clearAdjacents()
public void setDisplayMode(String s)
public String getDisplayMode()
public void setAdjacents(ArrayList<Node> adjacents)
adjacents
- The adjacents to setpublic void setStates(List<String> states)
setStates
in interface INode
states
- The states to setpublic String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int compareTo(Node arg0)
compareTo
in interface Comparable<Node>
public boolean isPointInDrawableArea(int x, int y)
public boolean isSelected()
public void setSelected(boolean b)
public Point2D.Double getPosition()
public void setPosition(double x, double y)
public Color getColor()
public void setColor(Color c)
public int getWidth()
public int getHeight()
public static int getDefaultWidth()
public static int getDefaultHeight()
public Point2D.Double getSize()
public void setSize(double width, double height)
width
- The node's width.height
- The node's height.public void setSizeVariable(double width, double height)
public void setSizeIsVariable(boolean is)
public void setMean(double[] mean)
mean
- public void setStandardDeviation(double[] standardDeviation)
mean
- public double[] getMean()
mean
- public double[] getStandardDeviation()
mean
- public void addNodeNameChangedListener(Node.NodeNameChangedListener listener)
public void removeNodeNameChangedListener(Node.NodeNameChangedListener listener)
protected void nameChanged(Node.NodeNameChangedEvent event)
public void addChildNode(INode child) throws InvalidParentException
INode
addChildNode
in interface INode
InvalidParentException
public void addParentNode(INode parent) throws InvalidParentException
INode
addParentNode
in interface INode
InvalidParentException
public List<INode> getAdjacentNodes()
INode
getAdjacentNodes
in interface INode
public List<INode> getChildNodes()
INode
getChildNodes
in interface INode
public List<INode> getParentNodes()
INode
getParentNodes
in interface INode
public void removeChildNode(INode child)
INode
removeChildNode
in interface INode
public void removeParentNode(INode parent)
INode
removeParentNode
in interface INode
public void setChildNodes(List<INode> children)
INode
setChildNodes
in interface INode
children
- List of nodes representing the children.public void setParentNodes(List<INode> parents)
INode
setParentNodes
in interface INode
parents
- List of nodes representing the parents.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |