RBNgui
Class Primula

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by RBNgui.Primula
All Implemented Interfaces:
edu.ucla.belief.ui.primula.PrimulaUIInt, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class Primula
extends javax.swing.JFrame
implements edu.ucla.belief.ui.primula.PrimulaUIInt, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  Bavaria bavaria
           
protected  java.io.File bnoutfile
           
protected  int bnsystem
           
static int CF_ESUM
           
static int CF_INVSUM
           
static int CF_MEAN
           
static int CF_NOR
           
static java.awt.Color COLOR_BLUE
           
static java.awt.Color COLOR_BLUE_SELECTED
           
static java.awt.Color COLOR_GREEN
           
static java.awt.Color COLOR_GREEN_SELECTED
           
static java.awt.Color COLOR_RED
           
static java.awt.Color COLOR_RED_SELECTED
           
static java.awt.Color COLOR_YELLOW
           
static java.awt.Color COLOR_YELLOW_SELECTED
           
protected  int decomposemode
           
protected  int evidencemode
           
protected  EvidenceModule evidenceModule
           
static boolean FLAG_DEBUG
           
protected  Instantiation inst
           
protected  int isolatedzeronodesmode
           
protected  int layoutmode
           
protected  LearnModule learnModule
           
static int OPTION_DECOMPOSE
           
static int OPTION_DECOMPOSE_DETERMINISTIC
           
static int OPTION_ELIMINATE_ISOLATED_ZERO_NODES
           
static int OPTION_EVIDENCE_CONDITIONED
           
static int OPTION_HUGIN
           
static int OPTION_JAVABAYES
           
static int OPTION_LAYOUT
           
static int OPTION_NETICA
           
static int OPTION_NO_LAYOUT
           
static int OPTION_NOT_DECOMPOSE
           
static int OPTION_NOT_ELIMINATE_ISOLATED_ZERO_NODES
           
static int OPTION_NOT_EVIDENCE_CONDITIONED
           
static int OPTION_NOT_QUERY_SPECIFIC
           
static int OPTION_QUERY_SPECIFIC
           
static int OPTION_SAMIAM
           
protected  AtomList queryatoms
           
protected  int querymode
           
protected  RBN rbn
           
protected  java.io.File rbnfile
           
protected  RelStruc rels
           
protected  java.io.File srsfile
           
static java.lang.String STR_FILENAME_LOGO
           
static java.lang.String STR_OPTION_DEBUG
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
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, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Primula()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addOrRenameEvidenceModuleNode()
           
static void appendMessage(java.lang.String message)
           
 void appendMessageThis(java.lang.String message)
           
 javax.swing.JFrame asJFrame()
           
 boolean confirm(java.lang.String text)
           
 void deleteElementFromEvidenceModule(int node)
           
 int evidencemode()
           
 void exitProgram()
           
 void forgetAll()
           
 javax.swing.ImageIcon getIcon(java.lang.String fileName)
           
 Instantiation getInstantiation()
           
 edu.ucla.belief.ui.primula.Preferences getPreferences()
           
 RBN getRBN()
           
 RelStruc getRels()
           
 edu.ucla.belief.ui.primula.SamiamManager getSamiamManager()
           
 edu.ucla.belief.ui.primula.SamiamUIInt getSamIamUIInstanceThis()
           
 boolean instContainsAll(Instantiation old)
           
 boolean isInstEmpty()
           
 boolean isQueryatomsEmpty()
           
 boolean isSystemExitEnabled()
           
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void LoadMLN(java.io.File mln, java.io.File cwdb, java.io.File owdb)
           
 void loadRBNFunction(java.io.File input_file)
           
 void loadSparseRelFile(java.io.File srsfile)
           
static void main(java.lang.String[] args)
           
 java.lang.String makeAlternateName()
           
 java.lang.String makeNetworkName()
           
 void newOrdStruc(int dom)
           
static java.lang.String pluckNameFromPath(java.lang.String path)
           
 void setDecomposeMode(int mode)
           
 void setInputFile(java.io.File inputFile)
           
 void setInst(Instantiation newinst)
           
static void setIsBavariaOpen(boolean b)
           
 void setIsBavariaOpenThis(boolean b)
           
static void setIsEvModuleOpen(boolean b)
           
 void setIsEvModuleOpenThis(boolean b)
           
static void setIsLearnModuleOpen(boolean b)
           
 void setRelStruc(RelStruc srel)
           
 void setStrucEdited(boolean b)
           
 void setSystemExitEnabled(boolean flag)
           
 void setTheSamIamUI(edu.ucla.belief.ui.primula.SamiamUIInt ui)
           
static void showMessage(java.lang.String message)
           
 void showMessageThis(java.lang.String message)
           
 edu.ucla.belief.ace.PrimulaSystemSnapshot snapshot()
           
 void updateMessageArea()
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

COLOR_YELLOW

public static final java.awt.Color COLOR_YELLOW

COLOR_YELLOW_SELECTED

public static final java.awt.Color COLOR_YELLOW_SELECTED

COLOR_BLUE

public static final java.awt.Color COLOR_BLUE

COLOR_BLUE_SELECTED

public static final java.awt.Color COLOR_BLUE_SELECTED

COLOR_GREEN

public static final java.awt.Color COLOR_GREEN

COLOR_GREEN_SELECTED

public static final java.awt.Color COLOR_GREEN_SELECTED

COLOR_RED

public static final java.awt.Color COLOR_RED

COLOR_RED_SELECTED

public static final java.awt.Color COLOR_RED_SELECTED

CF_NOR

public static final int CF_NOR
See Also:
Constant Field Values

CF_MEAN

public static final int CF_MEAN
See Also:
Constant Field Values

CF_INVSUM

public static final int CF_INVSUM
See Also:
Constant Field Values

CF_ESUM

public static final int CF_ESUM
See Also:
Constant Field Values

OPTION_NOT_EVIDENCE_CONDITIONED

public static final int OPTION_NOT_EVIDENCE_CONDITIONED
See Also:
Constant Field Values

OPTION_EVIDENCE_CONDITIONED

public static final int OPTION_EVIDENCE_CONDITIONED
See Also:
Constant Field Values

OPTION_NOT_QUERY_SPECIFIC

public static final int OPTION_NOT_QUERY_SPECIFIC
See Also:
Constant Field Values

OPTION_QUERY_SPECIFIC

public static final int OPTION_QUERY_SPECIFIC
See Also:
Constant Field Values

OPTION_DECOMPOSE

public static final int OPTION_DECOMPOSE
See Also:
Constant Field Values

OPTION_DECOMPOSE_DETERMINISTIC

public static final int OPTION_DECOMPOSE_DETERMINISTIC
See Also:
Constant Field Values

OPTION_NOT_DECOMPOSE

public static final int OPTION_NOT_DECOMPOSE
See Also:
Constant Field Values

OPTION_NOT_ELIMINATE_ISOLATED_ZERO_NODES

public static final int OPTION_NOT_ELIMINATE_ISOLATED_ZERO_NODES
See Also:
Constant Field Values

OPTION_ELIMINATE_ISOLATED_ZERO_NODES

public static final int OPTION_ELIMINATE_ISOLATED_ZERO_NODES
See Also:
Constant Field Values

OPTION_NO_LAYOUT

public static final int OPTION_NO_LAYOUT
See Also:
Constant Field Values

OPTION_LAYOUT

public static final int OPTION_LAYOUT
See Also:
Constant Field Values

OPTION_JAVABAYES

public static final int OPTION_JAVABAYES
See Also:
Constant Field Values

OPTION_HUGIN

public static final int OPTION_HUGIN
See Also:
Constant Field Values

OPTION_NETICA

public static final int OPTION_NETICA
See Also:
Constant Field Values

OPTION_SAMIAM

public static final int OPTION_SAMIAM
See Also:
Constant Field Values

querymode

protected int querymode

evidencemode

protected int evidencemode

decomposemode

protected int decomposemode

isolatedzeronodesmode

protected int isolatedzeronodesmode

layoutmode

protected int layoutmode

bnsystem

protected int bnsystem

STR_OPTION_DEBUG

public static final java.lang.String STR_OPTION_DEBUG
Since:
20061105
See Also:
Constant Field Values

FLAG_DEBUG

public static boolean FLAG_DEBUG

srsfile

protected java.io.File srsfile

rbnfile

protected java.io.File rbnfile

bnoutfile

protected java.io.File bnoutfile

evidenceModule

protected EvidenceModule evidenceModule

learnModule

protected LearnModule learnModule

bavaria

protected Bavaria bavaria

rels

protected RelStruc rels

rbn

protected RBN rbn

inst

protected Instantiation inst

queryatoms

protected AtomList queryatoms

STR_FILENAME_LOGO

public static final java.lang.String STR_FILENAME_LOGO
See Also:
Constant Field Values
Constructor Detail

Primula

public Primula()
Method Detail

getRBN

public RBN getRBN()
Since:
20060728

getRels

public RelStruc getRels()
Since:
20060728

snapshot

public edu.ucla.belief.ace.PrimulaSystemSnapshot snapshot()
Since:
20060515

setDecomposeMode

public void setDecomposeMode(int mode)
Since:
20061201

setTheSamIamUI

public void setTheSamIamUI(edu.ucla.belief.ui.primula.SamiamUIInt ui)
Specified by:
setTheSamIamUI in interface edu.ucla.belief.ui.primula.PrimulaUIInt
Since:
040804

getSamiamManager

public edu.ucla.belief.ui.primula.SamiamManager getSamiamManager()
Since:
050404

forgetAll

public void forgetAll()
Since:
20060602

asJFrame

public javax.swing.JFrame asJFrame()
Specified by:
asJFrame in interface edu.ucla.belief.ui.primula.PrimulaUIInt
Since:
040804

setSystemExitEnabled

public void setSystemExitEnabled(boolean flag)
Specified by:
setSystemExitEnabled in interface edu.ucla.belief.ui.primula.PrimulaUIInt
Since:
040804

isSystemExitEnabled

public boolean isSystemExitEnabled()
Specified by:
isSystemExitEnabled in interface edu.ucla.belief.ui.primula.PrimulaUIInt
Since:
040804

exitProgram

public void exitProgram()
Specified by:
exitProgram in interface edu.ucla.belief.ui.primula.PrimulaUIInt
Since:
040804

getIcon

public javax.swing.ImageIcon getIcon(java.lang.String fileName)
Since:
042104

makeNetworkName

public java.lang.String makeNetworkName()
Since:
040504

makeAlternateName

public java.lang.String makeAlternateName()
Specified by:
makeAlternateName in interface edu.ucla.belief.ui.primula.PrimulaUIInt
Since:
040504

pluckNameFromPath

public static java.lang.String pluckNameFromPath(java.lang.String path)
Since:
040504

getSamIamUIInstanceThis

public edu.ucla.belief.ui.primula.SamiamUIInt getSamIamUIInstanceThis()
Specified by:
getSamIamUIInstanceThis in interface edu.ucla.belief.ui.primula.PrimulaUIInt
Since:
040804

getPreferences

public edu.ucla.belief.ui.primula.Preferences getPreferences()
Since:
050404

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

newOrdStruc

public void newOrdStruc(int dom)
Specified by:
newOrdStruc in interface edu.ucla.belief.ui.primula.PrimulaUIInt

loadSparseRelFile

public void loadSparseRelFile(java.io.File srsfile)
Specified by:
loadSparseRelFile in interface edu.ucla.belief.ui.primula.PrimulaUIInt

loadRBNFunction

public void loadRBNFunction(java.io.File input_file)
Specified by:
loadRBNFunction in interface edu.ucla.belief.ui.primula.PrimulaUIInt

showMessageThis

public void showMessageThis(java.lang.String message)
Specified by:
showMessageThis in interface edu.ucla.belief.ui.primula.PrimulaUIInt

appendMessageThis

public void appendMessageThis(java.lang.String message)
Specified by:
appendMessageThis in interface edu.ucla.belief.ui.primula.PrimulaUIInt

setIsBavariaOpenThis

public void setIsBavariaOpenThis(boolean b)
Specified by:
setIsBavariaOpenThis in interface edu.ucla.belief.ui.primula.PrimulaUIInt

setIsEvModuleOpenThis

public void setIsEvModuleOpenThis(boolean b)
Specified by:
setIsEvModuleOpenThis in interface edu.ucla.belief.ui.primula.PrimulaUIInt

showMessage

public static void showMessage(java.lang.String message)

appendMessage

public static void appendMessage(java.lang.String message)

setIsBavariaOpen

public static void setIsBavariaOpen(boolean b)

setIsEvModuleOpen

public static void setIsEvModuleOpen(boolean b)

setIsLearnModuleOpen

public static void setIsLearnModuleOpen(boolean b)

setRelStruc

public void setRelStruc(RelStruc srel)

setInputFile

public void setInputFile(java.io.File inputFile)
Specified by:
setInputFile in interface edu.ucla.belief.ui.primula.PrimulaUIInt

addOrRenameEvidenceModuleNode

public void addOrRenameEvidenceModuleNode()
Specified by:
addOrRenameEvidenceModuleNode in interface edu.ucla.belief.ui.primula.PrimulaUIInt

deleteElementFromEvidenceModule

public void deleteElementFromEvidenceModule(int node)
Specified by:
deleteElementFromEvidenceModule in interface edu.ucla.belief.ui.primula.PrimulaUIInt

confirm

public boolean confirm(java.lang.String text)
Specified by:
confirm in interface edu.ucla.belief.ui.primula.PrimulaUIInt

getInstantiation

public Instantiation getInstantiation()
Since:
20061023

instContainsAll

public boolean instContainsAll(Instantiation old)
Since:
20061023

isInstEmpty

public boolean isInstEmpty()
Specified by:
isInstEmpty in interface edu.ucla.belief.ui.primula.PrimulaUIInt

isQueryatomsEmpty

public boolean isQueryatomsEmpty()
Specified by:
isQueryatomsEmpty in interface edu.ucla.belief.ui.primula.PrimulaUIInt

setStrucEdited

public void setStrucEdited(boolean b)
Specified by:
setStrucEdited in interface edu.ucla.belief.ui.primula.PrimulaUIInt

evidencemode

public int evidencemode()

LoadMLN

public void LoadMLN(java.io.File mln,
                    java.io.File cwdb,
                    java.io.File owdb)
Parameters:
mln - the file where the mln is stored
owdb - the file where the open world assuptions are declared
cwdb - the file where the close world assuptions are declared

updateMessageArea

public void updateMessageArea()

setInst

public void setInst(Instantiation newinst)

main

public static void main(java.lang.String[] args)