marketplace
Class MarketplaceFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--marketplace.MarketplaceFrame

public class MarketplaceFrame
extends javax.swing.JFrame
implements CIAgentEventListener

The MarketplaceFrame class implements the marketplace application.

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)  BestBuyerAgent advancedBuyerAgent
           
(package private)  javax.swing.JCheckBoxMenuItem advancedBuyerCheckBoxMenuItem
           
(package private)  BestSellerAgent advancedSellerAgent
           
(package private)  javax.swing.JCheckBoxMenuItem advancedSellerCheckBoxMenuItem
           
(package private)  BuyerAgent basicBuyerAgent
           
(package private)  javax.swing.JCheckBoxMenuItem basicBuyerCheckBoxMenuItem
           
(package private)  SellerAgent basicSellerAgent
           
(package private)  javax.swing.JCheckBoxMenuItem basicSellerCheckBoxMenuItem
           
(package private)  java.awt.BorderLayout borderLayout1
           
(package private)  java.awt.BorderLayout borderLayout2
           
(package private)  java.awt.BorderLayout borderLayout3
           
(package private)  javax.swing.JMenuItem clearMenuItem
           
static int DETAILS
           
(package private)  javax.swing.JCheckBoxMenuItem detailsCheckBoxMenuItem
           
(package private)  javax.swing.JMenuItem exitMenuItem
           
(package private)  FacilitatorAgent facilitator
           
(package private)  javax.swing.JMenu HelpMenu
           
(package private)  BetterBuyerAgent intermedBuyerAgent
           
(package private)  javax.swing.JCheckBoxMenuItem intermediateBuyerCheckBoxMenuItem
           
(package private)  javax.swing.JCheckBoxMenuItem intermediateSellerCheckBoxMenuItem
           
(package private)  BetterSellerAgent intermedSellerAgent
           
(package private)  javax.swing.JLabel jLabel1
           
(package private)  javax.swing.JLabel jLabel2
           
(package private)  javax.swing.JMenu jMenu2
           
(package private)  javax.swing.JMenu jMenu3
           
(package private)  javax.swing.JMenu jMenu4
           
(package private)  javax.swing.JPanel jPanel1
           
(package private)  javax.swing.JPanel jPanel2
           
(package private)  javax.swing.JScrollPane jScrollPane1
           
(package private)  javax.swing.JScrollPane jScrollPane2
           
(package private)  javax.swing.JMenuBar menuBar1
           
(package private)  javax.swing.JMenu menuFile
           
(package private)  javax.swing.JMenuItem startMenuItem
           
(package private)  javax.swing.JMenuItem stopMenuItem
           
static int SUMMARY
           
(package private)  javax.swing.JCheckBoxMenuItem summaryCheckBoxMenuItem
           
(package private)  javax.swing.JTextArea topTextArea
           
(package private)  javax.swing.JTextArea traceTextArea
           
 
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
MarketplaceFrame()
          Creates a MarketplaceFrame object.
 
Method Summary
(package private)  void aboutMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Method aboutMenuItem_actionPerformed
(package private)  void clearMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Clears the text areas only, does not affect the agent processing
(package private)  void detailsCheckBoxMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Sets the trace level to DETAILS.
(package private)  void exitMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Exits the application.
 void fileExit_actionPerformed(java.awt.event.ActionEvent e)
          Exits the application.
 void postCIAgentEvent(CIAgentEvent event)
          Method postCIAgentEvent
 void processCIAgentEvent(CIAgentEvent event)
          Processes a CIAgentEvent if it contains a trace message.
protected  void processWindowEvent(java.awt.event.WindowEvent e)
          Used to close or repaint the window.
(package private)  void startMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Starts the application and creates the facilitator, buyer, and seller agents.
(package private)  void stopMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Stops the facilator, buyer, and seller agents.
(package private)  void summaryCheckBoxMenuItem_actionPerformed(java.awt.event.ActionEvent e)
          Sets the trace level to SUMMARY.
(package private)  void trace(java.lang.String msg)
          Used by agents to display messages in marketplace pane.
(package private)  void traceFacilitator(java.lang.String msg)
          Used by the Facilitator agent to display msgs in top pane.
 
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

menuBar1

javax.swing.JMenuBar menuBar1

menuFile

javax.swing.JMenu menuFile

borderLayout1

java.awt.BorderLayout borderLayout1

jPanel1

javax.swing.JPanel jPanel1

jPanel2

javax.swing.JPanel jPanel2

borderLayout2

java.awt.BorderLayout borderLayout2

jLabel1

javax.swing.JLabel jLabel1

jScrollPane1

javax.swing.JScrollPane jScrollPane1

topTextArea

javax.swing.JTextArea topTextArea

borderLayout3

java.awt.BorderLayout borderLayout3

jLabel2

javax.swing.JLabel jLabel2

jScrollPane2

javax.swing.JScrollPane jScrollPane2

traceTextArea

javax.swing.JTextArea traceTextArea

clearMenuItem

javax.swing.JMenuItem clearMenuItem

exitMenuItem

javax.swing.JMenuItem exitMenuItem

startMenuItem

javax.swing.JMenuItem startMenuItem

stopMenuItem

javax.swing.JMenuItem stopMenuItem

jMenu2

javax.swing.JMenu jMenu2

jMenu3

javax.swing.JMenu jMenu3

jMenu4

javax.swing.JMenu jMenu4

HelpMenu

javax.swing.JMenu HelpMenu

aboutMenuItem

javax.swing.JMenuItem aboutMenuItem

basicBuyerCheckBoxMenuItem

javax.swing.JCheckBoxMenuItem basicBuyerCheckBoxMenuItem

intermediateBuyerCheckBoxMenuItem

javax.swing.JCheckBoxMenuItem intermediateBuyerCheckBoxMenuItem

advancedBuyerCheckBoxMenuItem

javax.swing.JCheckBoxMenuItem advancedBuyerCheckBoxMenuItem

basicSellerCheckBoxMenuItem

javax.swing.JCheckBoxMenuItem basicSellerCheckBoxMenuItem

intermediateSellerCheckBoxMenuItem

javax.swing.JCheckBoxMenuItem intermediateSellerCheckBoxMenuItem

advancedSellerCheckBoxMenuItem

javax.swing.JCheckBoxMenuItem advancedSellerCheckBoxMenuItem

detailsCheckBoxMenuItem

javax.swing.JCheckBoxMenuItem detailsCheckBoxMenuItem

summaryCheckBoxMenuItem

javax.swing.JCheckBoxMenuItem summaryCheckBoxMenuItem

facilitator

FacilitatorAgent facilitator

basicBuyerAgent

BuyerAgent basicBuyerAgent

intermedBuyerAgent

BetterBuyerAgent intermedBuyerAgent

advancedBuyerAgent

BestBuyerAgent advancedBuyerAgent

basicSellerAgent

SellerAgent basicSellerAgent

intermedSellerAgent

BetterSellerAgent intermedSellerAgent

advancedSellerAgent

BestSellerAgent advancedSellerAgent

SUMMARY

public static final int SUMMARY

DETAILS

public static final int DETAILS
Constructor Detail

MarketplaceFrame

public MarketplaceFrame()
Creates a MarketplaceFrame object.
Method Detail

fileExit_actionPerformed

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

processWindowEvent

protected void processWindowEvent(java.awt.event.WindowEvent e)
Used to close or repaint the window.
Parameters:
e - the WindowEvent object generated when the GUI event occurred
Overrides:
processWindowEvent in class javax.swing.JFrame

clearMenuItem_actionPerformed

void clearMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Clears the text areas only, does not affect the agent processing
Parameters:
e - the ActionEvent object generated when Clear 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

startMenuItem_actionPerformed

void startMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Starts the application and creates the facilitator, buyer, and seller agents.
Parameters:
e - the ActionEvent object generated when Start was selected

stopMenuItem_actionPerformed

void stopMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Stops the facilator, buyer, and seller agents.
Parameters:
e - the ActionEvent object generated when Stop was selected

detailsCheckBoxMenuItem_actionPerformed

void detailsCheckBoxMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Sets the trace level to DETAILS.
Parameters:
e - the ActionEvent object generated when details was checked

summaryCheckBoxMenuItem_actionPerformed

void summaryCheckBoxMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Sets the trace level to SUMMARY.
Parameters:
e - the ActionEvent object generated when summary was checked

trace

void trace(java.lang.String msg)
Used by agents to display messages in marketplace pane.
Parameters:
msg - the String object that contains the message to be displayed

traceFacilitator

void traceFacilitator(java.lang.String msg)
Used by the Facilitator agent to display msgs in top pane.
Parameters:
msg - the String object that contains the message to be displayed

processCIAgentEvent

public void processCIAgentEvent(CIAgentEvent event)
Processes a CIAgentEvent if it contains a trace message.
Specified by:
processCIAgentEvent in interface CIAgentEventListener
Parameters:
event - the CIAgentEvent object to be processed

postCIAgentEvent

public void postCIAgentEvent(CIAgentEvent event)
Method postCIAgentEvent
Specified by:
postCIAgentEvent in interface CIAgentEventListener
Parameters:
event - the CIAgentEvent object

aboutMenuItem_actionPerformed

void aboutMenuItem_actionPerformed(java.awt.event.ActionEvent e)
Method aboutMenuItem_actionPerformed
Parameters:
e - the ActionEvent object