rule
Class RuleFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--rule.RuleFrame

public class RuleFrame
extends javax.swing.JFrame

The RuleFrame class implements the GUI and application logic that demonstrates boolean and fuzzy rule inferencing.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  javax.swing.JMenuItem AboutMenuItem
           
(package private)  javax.swing.JRadioButton backChainRadioButton
           
(package private)  java.awt.BorderLayout borderLayout1
           
(package private)  java.awt.BorderLayout borderLayout2
           
(package private) static BooleanRuleBase bugs
           
(package private)  javax.swing.JRadioButtonMenuItem BugsRadioButtonMenuItem
           
(package private)  javax.swing.ButtonGroup buttonGroup
           
(package private) static RuleBase currentRuleBase
           
(package private)  javax.swing.JMenu DataMenu
           
(package private)  javax.swing.JMenuItem DefaultsMenuItem
           
(package private)  javax.swing.JMenuItem ExitMenuItem
           
(package private)  javax.swing.JMenu FileMenu
           
(package private)  java.awt.FlowLayout flowLayout1
           
(package private)  javax.swing.JRadioButton forwardChainRadioButton
           
(package private)  javax.swing.JComboBox GoalComboBox
           
(package private)  javax.swing.JMenu HelpMenu
           
(package private)  javax.swing.JLabel jLabel1
           
(package private)  javax.swing.JLabel jLabel2
           
(package private)  javax.swing.JMenuBar jMenuBar1
           
(package private)  javax.swing.JPanel jPanel1
           
(package private)  javax.swing.JPanel jPanel2
           
(package private)  javax.swing.JPanel jPanel3
           
(package private)  javax.swing.JScrollPane jScrollPane1
           
(package private) static FuzzyRuleBase motor
           
(package private)  javax.swing.JRadioButtonMenuItem MotorRadioButtonMenuItem
           
(package private) static BooleanRuleBase plants
           
(package private)  javax.swing.JRadioButtonMenuItem PlantsRadioButtonMenuItem
           
(package private)  javax.swing.JMenuItem ResetMenuItem
           
(package private)  javax.swing.JTextField resultTextField
           
(package private)  javax.swing.ButtonGroup ruleBaseButtonGroup
           
(package private)  javax.swing.JMenu RuleBaseMenu
           
(package private)  javax.swing.JMenuItem SetValuesMenuItem
           
(package private)  javax.swing.JMenuItem StartMenuItem
           
(package private)  javax.swing.JTextArea traceTextArea
           
(package private) static BooleanRuleBase vehicles
           
(package private)  javax.swing.JRadioButtonMenuItem VehiclesRadioButtonMenuItem
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Window
inputContext, OPENED, ownedWindowList, state, warningString, windowListener
 
Fields inherited from class java.awt.Container
component, containerListener, layoutMgr, ncomponents
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
RuleFrame()
          Creates a RuleFrame object.
 
Method Summary
(package private)  void AboutMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Displays the About dialog.
(package private)  void BugsRadioButtonMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Switches to the bugs rule base.
(package private)  void DefaultsMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Sets the defaults.
 void demoBugsBC(BooleanRuleBase rb)
          Sets values for the bugs backward chaining demonstration.
 void demoBugsFC(BooleanRuleBase rb)
          Sets values for the bugs forward chaining demonstration.
 void demoMotorBC(FuzzyRuleBase rb)
          Fuzzy rules base does not support backward chaining.
 void demoMotorFC(FuzzyRuleBase rb)
          Sets values for the motor forward chaining demonstration.
 void demoPlantsBC(BooleanRuleBase rb)
          Sets values for the plants backward chaining demonstration.
 void demoPlantsFC(BooleanRuleBase rb)
          Sets values for the plants forward chaining demonstration.
 void demoVehiclesBC(BooleanRuleBase rb)
          Sets values for the vehicles backward chaining demonstration.
 void demoVehiclesFC(BooleanRuleBase rb)
          Sets values for the vehicles forward chaining demonstration.
(package private)  void ExitMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Exits the application.
 void initBugsRuleBase(BooleanRuleBase rb)
          Initializes the Bugs rule base.
 void initMotorRuleBase(FuzzyRuleBase rb)
          Initializes the motor rule base.
 void initPlantsRuleBase(BooleanRuleBase rb)
          Initializes the plants rule base.
 void initVehiclesRuleBase(BooleanRuleBase rb)
          Initializes the vehicles rule base.
(package private)  void MotorRadioButtonMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Switches to the motor rule base.
(package private)  void PlantsRadioButtonMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Switches to the plants rule base.
protected  void processWindowEvent(java.awt.event.WindowEvent e)
          Closes or repaints the window.
(package private)  void ResetMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Resets the current rule base.
(package private)  void SetValuesMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Displays a dialog and allow the user to set variable values.
(package private)  void StartMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Starts the inferencing cycle.
(package private)  void switchRuleBase()
          Changes the context from one rule base to another and clears the text areas.
(package private)  void VehiclesRadioButtonMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Switches to the vehicles rule base.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, postProcessKeyEvent, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isActive, isShowing, nextFocus, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, setFocusOwner, show, toBack, toFront, transferFocus
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, countComponents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, paint, paintComponents, postsOldMouseEvents, preferredSize, print, printComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

borderLayout1

java.awt.BorderLayout borderLayout1

jMenuBar1

javax.swing.JMenuBar jMenuBar1

FileMenu

javax.swing.JMenu FileMenu

StartMenuItem

javax.swing.JMenuItem StartMenuItem

ResetMenuItem

javax.swing.JMenuItem ResetMenuItem

ExitMenuItem

javax.swing.JMenuItem ExitMenuItem

DataMenu

javax.swing.JMenu DataMenu

DefaultsMenuItem

javax.swing.JMenuItem DefaultsMenuItem

SetValuesMenuItem

javax.swing.JMenuItem SetValuesMenuItem

jPanel1

javax.swing.JPanel jPanel1

jPanel2

javax.swing.JPanel jPanel2

jPanel3

javax.swing.JPanel jPanel3

jScrollPane1

javax.swing.JScrollPane jScrollPane1

traceTextArea

javax.swing.JTextArea traceTextArea

forwardChainRadioButton

javax.swing.JRadioButton forwardChainRadioButton

backChainRadioButton

javax.swing.JRadioButton backChainRadioButton

buttonGroup

javax.swing.ButtonGroup buttonGroup

jLabel1

javax.swing.JLabel jLabel1

jLabel2

javax.swing.JLabel jLabel2

resultTextField

javax.swing.JTextField resultTextField

flowLayout1

java.awt.FlowLayout flowLayout1

borderLayout2

java.awt.BorderLayout borderLayout2

HelpMenu

javax.swing.JMenu HelpMenu

AboutMenuItem

javax.swing.JMenuItem AboutMenuItem

RuleBaseMenu

javax.swing.JMenu RuleBaseMenu

VehiclesRadioButtonMenuItem

javax.swing.JRadioButtonMenuItem VehiclesRadioButtonMenuItem

BugsRadioButtonMenuItem

javax.swing.JRadioButtonMenuItem BugsRadioButtonMenuItem

PlantsRadioButtonMenuItem

javax.swing.JRadioButtonMenuItem PlantsRadioButtonMenuItem

MotorRadioButtonMenuItem

javax.swing.JRadioButtonMenuItem MotorRadioButtonMenuItem

ruleBaseButtonGroup

javax.swing.ButtonGroup ruleBaseButtonGroup

GoalComboBox

javax.swing.JComboBox GoalComboBox

bugs

static BooleanRuleBase bugs

plants

static BooleanRuleBase plants

vehicles

static BooleanRuleBase vehicles

motor

static FuzzyRuleBase motor

currentRuleBase

static RuleBase currentRuleBase
Constructor Detail

RuleFrame

public RuleFrame()
Creates a RuleFrame object.
Method Detail

processWindowEvent

protected void processWindowEvent(java.awt.event.WindowEvent e)
Closes or repaints the window.
Parameters:
e - the WindowEvent object generated when window is closed or activated
Overrides:
processWindowEvent in class javax.swing.JFrame

initBugsRuleBase

public void initBugsRuleBase(BooleanRuleBase rb)
Initializes the Bugs rule base.
Parameters:
rb - the BooleanRuleBase object to be initialized

initPlantsRuleBase

public void initPlantsRuleBase(BooleanRuleBase rb)
Initializes the plants rule base.
Parameters:
rb - the BooleanRuleBase object to be initialized

initVehiclesRuleBase

public void initVehiclesRuleBase(BooleanRuleBase rb)
Initializes the vehicles rule base.
Parameters:
rb - the BooleanRuleBase object to be initialized

initMotorRuleBase

public void initMotorRuleBase(FuzzyRuleBase rb)
Initializes the motor rule base.
Parameters:
rb - the FuzzyRuleBase object to be initialized

demoVehiclesFC

public void demoVehiclesFC(BooleanRuleBase rb)
Sets values for the vehicles forward chaining demonstration.
Parameters:
rb - the BooleanRuleBase object set for forward chaining

demoVehiclesBC

public void demoVehiclesBC(BooleanRuleBase rb)
Sets values for the vehicles backward chaining demonstration.
Parameters:
rb - the BooleanRuleBase object set for backward chaining

demoBugsBC

public void demoBugsBC(BooleanRuleBase rb)
Sets values for the bugs backward chaining demonstration.
Parameters:
rb - the BooleanRuleBase object set for backward chaining

demoBugsFC

public void demoBugsFC(BooleanRuleBase rb)
Sets values for the bugs forward chaining demonstration.
Parameters:
rb - the BooleanRuleBase object set for forward chaining

demoPlantsBC

public void demoPlantsBC(BooleanRuleBase rb)
Sets values for the plants backward chaining demonstration.
Parameters:
rb - the BooleanRuleBase object set for backward chaining

demoPlantsFC

public void demoPlantsFC(BooleanRuleBase rb)
Sets values for the plants forward chaining demonstration.
Parameters:
rb - the BooleanRuleBase object set for forward chaining

demoMotorBC

public void demoMotorBC(FuzzyRuleBase rb)
Fuzzy rules base does not support backward chaining.
Parameters:
rb - the FuzzyRuleBase object

demoMotorFC

public void demoMotorFC(FuzzyRuleBase rb)
Sets values for the motor forward chaining demonstration.
Parameters:
rb - the FuzzyRuleBase object set for forward chaining

StartMenuItem_actionPerformed

void StartMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Starts the inferencing cycle.
Parameters:
e - the ActionEvent object generated when start was selected

ResetMenuItem_actionPerformed

void ResetMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Resets the current rule base.
Parameters:
e - the ActionEvent object generated when reset was selected

ExitMenuItem_actionPerformed

void ExitMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Exits the application.
Parameters:
e - the ActionEvent object generated when exit was selected

SetValuesMenuItem_actionPerformed

void SetValuesMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Displays a dialog and allow the user to set variable values.
Parameters:
e - the ActionEvent object generated when the set values was selected

DefaultsMenuItem_actionPerformed

void DefaultsMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Sets the defaults.
Parameters:
e - the ActionEvent object generated when default was selected

switchRuleBase

void switchRuleBase()
Changes the context from one rule base to another and clears the text areas.

AboutMenuItem_actionPerformed

void AboutMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Displays the About dialog.
Parameters:
e - the ActionEvent object generated when About was selected

VehiclesRadioButtonMenuItem_actionPerformed

void VehiclesRadioButtonMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Switches to the vehicles rule base.
Parameters:
e - the ActionEvent object generated when the vehicles button was clicked

BugsRadioButtonMenuItem_actionPerformed

void BugsRadioButtonMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Switches to the bugs rule base.
Parameters:
e - the ActionEvent object generated when the bugs button was clicked

PlantsRadioButtonMenuItem_actionPerformed

void PlantsRadioButtonMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Switches to the plants rule base.
Parameters:
e - the ActionEvent object generated when the plants button was clicked

MotorRadioButtonMenuItem_actionPerformed

void MotorRadioButtonMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Switches to the motor rule base.
Parameters:
e - the ActionEvent object generated when the motor button was clicked