unbbayes.gui
Class NetworkWindow

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JInternalFrame
                  extended by unbbayes.util.extension.UnBBayesModule
                      extended by unbbayes.gui.NetworkWindow
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, IPersistenceAwareWindow

public class NetworkWindow
extends UnBBayesModule

Class responsible for representing the network window.

Version:
02/13/2010 - MEBN code was moved to unbbayes.gui.mebn.MEBNNetworkWindow
Author:
Michael, Rommel, Laecio Lima dos Santos, Shou Matsumoto
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JInternalFrame
JInternalFrame.AccessibleJInternalFrame, JInternalFrame.JDesktopIcon
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static Integer PN_MODE
           
 
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
protected NetworkWindow()
          Default constructor useful for extended classes
  NetworkWindow(Network net)
           
 
Method Summary
 void changeToEditNet()
           
 void changeToHierarchy()
          M_todo respons_vel por fazer as altera__es necess_rias para a mudar da tela de edi__o para a tela de defini__o da hierarquia.
 void changeToPNCompilationPane()
          M_todo respons_vel por fazer as altera__es necess_rias para a mudar da tela de edi__o para a de compila__o.
 void changeToPNEditionPane()
          M_todo respons_vel por fazer as altera__es necess_rias para a mudar da tela de compila__o para a de edi__o.
 void changeToPNEvaluationPane(JPanel evaluationPane)
           
 CardLayout getCardLayout()
           
 NetworkController getController()
           
 EditNet getEditNet()
           
 EvidenceTree getEvidenceTree()
          Retorna a arvore de evidencias.
 String getFileName()
           
 GraphPane getGraphPane()
          Retorna o grafo responsavel pela representacao grafica da rede.
 JViewport getGraphViewport()
          Retorna o container, graphViewport (JViewport), que contem o grafo responsavel pela representacao grafica da rede.
 HierarchicDefinitionPane getHierarchicDefinitionPanel()
           
 JInternalFrame getInternalFrame()
          Obtains the internal frame to be created by UnBBayes Swing core when a file listed within #getSupportedFileExtensions() is opened by the user.
 BaseIO getIO()
          Returns the I/O class that is responsible to open/save files of a extension declared in #getSupportedFileExtensions()
 JScrollPane getJspGraph()
          Retorna o painel do draw.
 JScrollPane getJspTree()
          Retorna o painel da arvore.
 Integer getMode()
           
 String getModuleName()
          Obtains the name of this module.
 Network getNet()
           
 PNCompilationPane getNetWindowCompilation()
          Retorna a tela de compila__o (PNCompilationPane).
 PNEditionPane getNetWindowEdition()
          Retorna a tela de edi__o (PNEditionPane).
 NetworkController getNetworkController()
           
 Graph getPersistingGraph()
          Obtains the graph to be persisted or is being edited by this window.
 String getSavingMessage()
          Obtains a message to be shown to user while saving a net editted by a window implementing this interface.
 SingleEntityNetwork getSingleEntityNetwork()
          Retorna a rede probabil_stica (ProbabilisticNetwork)
 JLabel getStatus()
           
 JTable getTable()
          Returns the CPT JTable.
 Node getTableOwner()
           
 JTextField getTxtDescription()
          Returns the JTextField that has the node's description.
 JTextField getTxtName()
          Returns the JTextField that has the node's name.
 boolean isBCompiled()
           
 boolean isCompiled()
          Retorna se a janela que esta aparecendo esta em modo de edicao(false) ou se ela esta em modo de compila__o(true).
 UnBBayesModule openFile(File file)
          Opens a new desktop window into currently used java desktop
 void setAddRemoveStateButtonVisible(boolean visible)
           
 void setBCompiled(boolean compiled)
           
 void setCardLayout(CardLayout card)
           
 void setController(NetworkController controller)
           
 void setDistributionPane(JPanel distributionPane)
           
 void setFileName(String fileName)
           
 void setGraphPane(GraphPane graphPane)
           
 void setGraphViewport(JViewport graphViewport)
           
 void setJspGraph(JScrollPane jspGraph)
           
 void setMode(Integer mode)
           
 void setModuleName(String moduleName)
           
 void setNet(Network net)
           
 void setStatus(JLabel status)
           
 void setStatus(String status)
          Seta o status exibido na barra de status.
 void setTable(JTable table, Node tableOwner)
          Delegates to #getPnEditionPane()#setTable(JTable, Node)
 void setTableOwner(Node node)
           
 void showProbabilityDistributionPanel(IProbabilityFunctionPanelBuilder builder)
          This method builds a customized probability distribution panel (e.g.
 void updateTitle()
           
 
Methods inherited from class unbbayes.util.extension.UnBBayesModule
getModuleID, getSupportedFileExtensions, getSupportedFilesDescription, getUnbbayesFrame, setModuleID, setName, setUnbbayesFrame
 
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, dispose, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLastCursor, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setCursor, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, show, toBack, toFront, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PN_MODE

public static final Integer PN_MODE
Constructor Detail

NetworkWindow

protected NetworkWindow()
Default constructor useful for extended classes


NetworkWindow

public NetworkWindow(Network net)
Method Detail

updateTitle

public void updateTitle()

getGraphPane

public GraphPane getGraphPane()
Retorna o grafo responsavel pela representacao grafica da rede.

Returns:
retorna o (GraphPane)
See Also:
GraphPane

getEvidenceTree

public EvidenceTree getEvidenceTree()
Retorna a arvore de evidencias.

Returns:
retorna o evidenceTree (JTree)
See Also:
JTree

getGraphViewport

public JViewport getGraphViewport()
Retorna o container, graphViewport (JViewport), que contem o grafo responsavel pela representacao grafica da rede.

Returns:
retorna o graphViewport(JViewport)
See Also:
JViewport

getTable

public JTable getTable()
Returns the CPT JTable.

Returns:
the CPT JTable.
See Also:
JTable

getTxtDescription

public JTextField getTxtDescription()
Returns the JTextField that has the node's description.

Returns:
the JTextField that has the node's description.
See Also:
JTextField

getTxtName

public JTextField getTxtName()
Returns the JTextField that has the node's name.

Returns:
the JTextField that has the node's name.
See Also:
JTextField

setDistributionPane

public void setDistributionPane(JPanel distributionPane)

setTable

public void setTable(JTable table,
                     Node tableOwner)
Delegates to #getPnEditionPane()#setTable(JTable, Node)

Parameters:
table -
tableOwner -
See Also:
PNEditionPane.setTable(JTable, Node)

getJspGraph

public JScrollPane getJspGraph()
Retorna o painel do draw.

Returns:
retorna o jspDraw (JScrollPane)
See Also:
JScrollPane

getJspTree

public JScrollPane getJspTree()
Retorna o painel da arvore.

Returns:
retorna o jspTree (JScrollPane)
See Also:
JScrollPane

getTableOwner

public Node getTableOwner()

setTableOwner

public void setTableOwner(Node node)

getSingleEntityNetwork

public SingleEntityNetwork getSingleEntityNetwork()
Retorna a rede probabil_stica (ProbabilisticNetwork)

Returns:
a rede probabil_stica
See Also:
ProbabilisticNetwork

setStatus

public void setStatus(String status)
Seta o status exibido na barra de status.

Parameters:
status - mensagem de status.

changeToPNCompilationPane

public void changeToPNCompilationPane()
M_todo respons_vel por fazer as altera__es necess_rias para a mudar da tela de edi__o para a de compila__o.


changeToPNEvaluationPane

public void changeToPNEvaluationPane(JPanel evaluationPane)

changeToPNEditionPane

public void changeToPNEditionPane()
M_todo respons_vel por fazer as altera__es necess_rias para a mudar da tela de compila__o para a de edi__o.


changeToHierarchy

public void changeToHierarchy()
M_todo respons_vel por fazer as altera__es necess_rias para a mudar da tela de edi__o para a tela de defini__o da hierarquia.


changeToEditNet

public void changeToEditNet()

isCompiled

public boolean isCompiled()
Retorna se a janela que esta aparecendo esta em modo de edicao(false) ou se ela esta em modo de compila__o(true).

Returns:
true se estiver em modo de compila__o, e false caso contr_rio.

getNetWindowEdition

public PNEditionPane getNetWindowEdition()
Retorna a tela de edi__o (PNEditionPane).

Returns:
a tela de edi__o
See Also:
PNEditionPane

getNetWindowCompilation

public PNCompilationPane getNetWindowCompilation()
Retorna a tela de compila__o (PNCompilationPane).

Returns:
a tela de compila__o
See Also:
PNCompilationPane

getHierarchicDefinitionPanel

public HierarchicDefinitionPane getHierarchicDefinitionPanel()

getNetworkController

public NetworkController getNetworkController()

getEditNet

public EditNet getEditNet()

getFileName

public String getFileName()

setFileName

public void setFileName(String fileName)

setAddRemoveStateButtonVisible

public void setAddRemoveStateButtonVisible(boolean visible)

getMode

public Integer getMode()
Returns:
the mode

setMode

public void setMode(Integer mode)
Parameters:
mode - the mode to set

getSavingMessage

public String getSavingMessage()
Description copied from interface: IPersistenceAwareWindow
Obtains a message to be shown to user while saving a net editted by a window implementing this interface. For example, you may want a FileChooser to show personalized title depending on what you are saving.

Specified by:
getSavingMessage in interface IPersistenceAwareWindow
Overrides:
getSavingMessage in class UnBBayesModule
Returns:

getController

public NetworkController getController()
Returns:
the controller

setController

public void setController(NetworkController controller)
Parameters:
controller - the controller to set

getInternalFrame

public JInternalFrame getInternalFrame()
Description copied from interface: IPersistenceAwareWindow
Obtains the internal frame to be created by UnBBayes Swing core when a file listed within #getSupportedFileExtensions() is opened by the user.

Specified by:
getInternalFrame in interface IPersistenceAwareWindow
Overrides:
getInternalFrame in class UnBBayesModule
Returns:
a instance of JInternalFrame

getIO

public BaseIO getIO()
Description copied from interface: IPersistenceAwareWindow
Returns the I/O class that is responsible to open/save files of a extension declared in #getSupportedFileExtensions()

Returns:
instance of BaseIO. BaseIO#supportsExtension(String) must return true in this case.
See Also:
BaseIO#supportsExtension(String)

getPersistingGraph

public Graph getPersistingGraph()
Description copied from interface: IPersistenceAwareWindow
Obtains the graph to be persisted or is being edited by this window.

Returns:

getModuleName

public String getModuleName()
Description copied from class: UnBBayesModule
Obtains the name of this module.

Specified by:
getModuleName in class UnBBayesModule
Returns:
the name of this module.

setModuleName

public void setModuleName(String moduleName)
Parameters:
moduleName - the moduleName to set

openFile

public UnBBayesModule openFile(File file)
                        throws IOException
Opens a new desktop window into currently used java desktop

Specified by:
openFile in class UnBBayesModule
Parameters:
file - : the file to be opened
Returns:
the UnBBayesModule which has the new opened graph. If null, no internal frame will be displayed to user.
Throws:
IOException
See Also:
UnBBayesModule.openFile(java.io.File)

showProbabilityDistributionPanel

public void showProbabilityDistributionPanel(IProbabilityFunctionPanelBuilder builder)
This method builds a customized probability distribution panel (e.g. a panel to edit a node's probability function, using plugin support). Other methods usually calls a method within controller to show a table, but in order to avoid dependency inversion at MVC model, I'm implementing this method at view layer.

Parameters:
builder: - a panel builder handling a panel and its associated node. The probability function panel's owner must be the currently selected node.

getNet

public Network getNet()
Returns:
the net

setNet

public void setNet(Network net)
Parameters:
net - the net to set

getCardLayout

public CardLayout getCardLayout()
Returns:
the card

setCardLayout

public void setCardLayout(CardLayout card)
Parameters:
card - the card to set

setGraphViewport

public void setGraphViewport(JViewport graphViewport)
Parameters:
graphViewport - the graphViewport to set

setGraphPane

public void setGraphPane(GraphPane graphPane)
Parameters:
graphPane - the graphPane to set

setJspGraph

public void setJspGraph(JScrollPane jspGraph)
Parameters:
jspGraph - the jspGraph to set

isBCompiled

public boolean isBCompiled()
Returns:
the bCompiled

setBCompiled

public void setBCompiled(boolean compiled)
Parameters:
compiled - the bCompiled to set

getStatus

public JLabel getStatus()
Returns:
the status

setStatus

public void setStatus(JLabel status)
Parameters:
status - the status to set


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.