|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunbbayes.controller.NetworkController
public class NetworkController
This class is responsible for delegating instructions that is going to be executed in a SingleEntityNetwork or MultiEntityBayesianNetwork. Insert node and propagate evidences, for instance.
Constructor Summary | |
---|---|
protected |
NetworkController()
This is the default constructor, initializing nothing. |
|
NetworkController(SingleEntityNetwork singleEntityNetwork,
NetworkWindow screen)
Constructs a controller for SingleEntityNetwork. |
Method Summary | |
---|---|
Rectangle |
calculateNetRectangle()
Method responsible for calculating the network border. |
void |
closeWarningDialog()
Close current warning dialog. |
boolean |
compileNetwork()
Compile the SingleEntityNetwork. |
void |
createContinuousDistribution(ContinuousNode node)
Creates and shows the panel where the user can edit the continuous node normal distribution. |
void |
createDiscreteTable(Node node)
Creates and shows the panel where the user can edit the discrete node table. |
void |
createTable(Node node)
Creates and shows the panel to edit the node's table. |
void |
deleteSelected(Object selected)
Delete the selected object from the network. |
void |
evaluateNetwork()
Change the GUI to allow PN evaluation. |
BaseIO |
getBaseIO()
This is the class responsible for storing the network controlled by this controller. |
Graph |
getGraph()
Obtains the network in a Graph format |
IInferenceAlgorithm |
getInferenceAlgorithm()
|
String |
getLog()
This is just a delegator to getLogContent() ,
which is a delegator to SingleEntityNetwork.getLog() . |
protected String |
getLogContent()
This method is called inside showLog() to retrieve the
content of LOG. |
Network |
getNetwork()
Get the network being controlled. |
NetworkWindow |
getScreen()
Get the network window. |
Node |
getSelectedNode()
Returns the selected node. |
SENController |
getSENController()
|
SingleEntityNetwork |
getSingleEntityNetwork()
Get the single entity network. |
void |
initialize()
Initialize the junction tree beliefs. |
Node |
insertContinuousNode(double x,
double y)
Insert a new continuous node in the SingleEntityNetwork with the standard label and description. |
Node |
insertDecisionNode(double x,
double y)
Insert a new decision node in the SingleEntityNetwork with the standard label and description. |
boolean |
insertEdge(Edge edge)
Insert a new edge in the network. |
Node |
insertProbabilisticNode(double x,
double y)
Insert a new probabilistic node in the SingleEntityNetwork with the standard label and description. |
void |
insertState(Node node)
Insert a new state for the given node. |
Node |
insertUtilityNode(double x,
double y)
Insert a new utility node in the SingleEntityNetwork with the standard label and description. |
void |
keyPressed(KeyEvent e)
Delete all selected objects of the network when the key (KeyEvent.VK_DELETE) is pressed. |
void |
keyReleased(KeyEvent e)
It does nothing when a key is released. |
void |
keyTyped(KeyEvent e)
It does nothing when a key is typed. |
JTable |
makeTable(Node node)
Construct a potential table of the given node. |
void |
openWarningDialog()
Open Warning dialog. |
void |
previewPrintLog(JTextArea texto,
JDialog dialog)
Deprecated. moved to TextAreaDialog |
void |
previewPrintNet(JComponent rede,
Rectangle retangulo)
Preview the net printing. |
void |
previewPrintTable()
Preview the table printing. |
protected void |
printLog(JTextArea textArea)
Deprecated. this method was moved to TextAreaDialog |
void |
printNet(JComponent network,
Rectangle rectangle)
Print the given area of the given network. |
void |
printTable()
Print the table. |
void |
propagate()
Propagate the evidences of the SingleEntityNetwork. |
void |
removeState(Node node)
Remove the last state from the given node. |
protected void |
saveComponentAsImage(Component comp,
int width,
int height,
File file)
|
void |
saveNetImage()
Save the network image to a file. |
void |
saveTableImage()
Save the table image to a file. |
void |
selectNode(Node node)
Selects a node |
void |
setBaseIO(BaseIO baseIO)
This is the class responsible for storing the network controlled by this controller. |
void |
setInferenceAlgorithm(IInferenceAlgorithm inferenceAlgorithm)
|
void |
setScreen(NetworkWindow screen)
|
void |
showExplanationProperties(ProbabilisticNode node)
Show the explanation properties for the given node. |
JDialog |
showLog()
Deprecated. avoid GUI methods in controllers. Use TextAreaDialog instead |
void |
unselectAll()
Unselects all graphical elements |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected NetworkController()
public NetworkController(SingleEntityNetwork singleEntityNetwork, NetworkWindow screen)
Method Detail |
---|
public IInferenceAlgorithm getInferenceAlgorithm()
public void setInferenceAlgorithm(IInferenceAlgorithm inferenceAlgorithm)
public SENController getSENController()
public SingleEntityNetwork getSingleEntityNetwork()
public Network getNetwork()
public Graph getGraph()
public void initialize()
public void createTable(Node node)
node
- The table owner.public void createContinuousDistribution(ContinuousNode node)
node
- The continuous node to create the distribution pane for.public void createDiscreteTable(Node node)
node
- The discrete node to create the table pan for.public JTable makeTable(Node node)
node
- The node to get the data for the table.public void propagate()
public boolean compileNetwork()
public void evaluateNetwork()
public Node insertContinuousNode(double x, double y)
x
- The x position of the new node.y
- The y position of the new node.public Node insertProbabilisticNode(double x, double y)
x
- The x position of the new node.y
- The y position of the new node.public Node insertDecisionNode(double x, double y)
x
- The x position of the new node.y
- The y position of the new node.public Node insertUtilityNode(double x, double y)
x
- The x position of the new node.y
- The y position of the new node.public void showExplanationProperties(ProbabilisticNode node)
node
- The node to show the explanation properties.public boolean insertEdge(Edge edge) throws Exception
edge
- The new edge to be inserted.
Exception
public void insertState(Node node)
node
- The selected node to insert the new state.public void removeState(Node node)
node
- The selected node to remove the last state.public void deleteSelected(Object selected)
selected
- The selected object to delete.public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
e
- The KeyEvent
that is passed from the KeyListener
KeyEvent
,
KeyListener
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
e
- The KeyEvent
that is passed from the KeyListener
KeyEvent
,
KeyListener
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
e
- The KeyEvent
that is passed from the KeyListener
KeyEvent
,
KeyListener
public NetworkWindow getScreen()
public void saveNetImage()
protected void saveComponentAsImage(Component comp, int width, int height, File file)
public void saveTableImage()
protected String getLogContent()
showLog()
to retrieve the
content of LOG. Extend this method in order to customize the log message
(e.g. customize where the log content is stored, and how to retrieve it)
singleEntityNetwork
is null, it returns
an empty string.public String getLog()
getLogContent()
,
which is a delegator to SingleEntityNetwork.getLog()
.
The visibility of getLogContent()
was not altered, for
backward compatibility.
public JDialog showLog()
TextAreaDialog
instead
public void openWarningDialog()
public void closeWarningDialog()
public void previewPrintLog(JTextArea texto, JDialog dialog)
TextAreaDialog
public void previewPrintTable()
public void previewPrintNet(JComponent rede, Rectangle retangulo)
public void printNet(JComponent network, Rectangle rectangle)
network
- A component representing the graphical
representation of the network to be printed.rectangle
- The area to be printed.public void printTable()
protected void printLog(JTextArea textArea)
TextAreaDialog
JTextArea
.
textArea
- The text area containing the log.public Rectangle calculateNetRectangle()
public Node getSelectedNode()
public void selectNode(Node node)
node
- public void unselectAll()
public BaseIO getBaseIO()
setBaseIO(BaseIO)
must be set to a correct controller depending to what type of
network this controller is dealing.
public void setBaseIO(BaseIO baseIO)
setBaseIO(BaseIO)
must be set to a correct controller depending to what type of
network this controller is dealing.
baseIO
- the baseIO to setpublic void setScreen(NetworkWindow screen)
screen
- the screen to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |