Rolodex Function Diagram
This file contains the function diagram for the Rolodex Tool. The notation is a simplified textual version of the standard function diagramming style discussed in the design diagram handout. The function calling hierarchy is shown by indenting called functions to the right. E.g., near the top of the main function diagram, main calls RolodexTool (the constructor), which in turn calls Rolodex, which in turn calls CardList.
The function diagram is shown in two major sections:
Functions invoked directly from main have their names printed in blue in the diagram. If one looks in the Java code for function main, the blue-colored functions are called directly from there. Function names shown in black type in the diagram are subsidiary functions invoked by the functions called directly from main.
The functions invoked from main perform the following principle processing:
Following the main function diagram is the event-based section of the function diagram.
main | |-- Screen | |-- RolodexTool |----- File |----- Edit |----- Rolodex |--------- CardList |--------- AddInputErrors |--------- DeleteInputErrors |--------- ChangeInputErrors | |-- RolodexMenuUI |----- super (= View) |----- JMenuBar |----- FileMenu |--------- super (= View) |--------- JMenu |----- Editmenu |--------- super (= View) |--------- JMenu |----- RolodexMenu |--------- super (= View) |--------- JMenu | |----- constructDialogs |--------- AddCardDialog |------------- super (= View) |------------- JTextField |------------- AddCardButtons |----------------- super |----------------- JButton |----------------- OKAddButtonListener |----------------- ClearAddButtonListener |----------------- CancelAddButtonListener |------------- Box | |--------- DeleteCardDialog |------------- super (= View) |------------- JTextField |------------- OKDeleteButtonListener |------------- CancelDeleteButtonListener |------------- Box | |--------- ConfirmChangeDialog |------------- super (= AddCardDialog) |------------- ConfirmChangeButtons |----------------- super (= AddCardButtons) |----------------- OKConfirmChangeButtonListener | |--------- ChangeCardDialog |------------- super |------------- JTextField |------------- OKChangeButtonListener |------------- CancelChangeButtonListener |------------- Box | |--------- FoundCardsDialog |------------- super |------------- JLabel |------------- JLabel.setAlignment |------------- JTextField |------------- FoundCardButtons |------------- Box | |--------- FindCardDialog |------------- super |------------- JTextField |------------- OKFindButtonListener |------------- CancelFindButtonListener |------------- Box | |--------- NoFoundCardsDialog |------------- super (= View) |------------- Box | |--------- ErrorMessageDialog |------------- super (= View) |------------- JLabel[] |------------- Box | |--------- EmptyDialog |------------- JPanel | |-- RolodexMenuUI.compose |----- mvp.Window |----- composeMenuBar |--------- composeFileMenu |------------- FileMenu.compose |----------------- JMenuItem |----------------- ActionListener |----------------- JMenuItem.addActionListener |----------------- JMenu.add |--------- composeEditMenu |------------- EditMenu.compose |----------------- JMenuItem |----------------- ActionListener |----------------- JMenuItem.addActionListener |----------------- JMenu.add |--------- composeRolodexMenu |------------- RolodexMenu.compose |----------------- JMenuItem |----------------- ActionListener |----------------- JMenuItem.addActionListener |----------------- JMenu.add | |----- mvp.Window.setJMenuBar |----- mvp.Window.composeDataArea |--------- JLayeredPane |--------- Dimension |--------- JLayeredPane.setPreferredSize |--------- composeDialogs |------------- composeAndInsert |----------------- View.compose, dispatches to --> | |--------------------- AddCardDialog.compose |------------------------- JPanel |------------------------- JPanel.setOpaque |------------------------- JPanel.add |------------------------- Box.createVerticalStrut |------------------------- Box.add |------------------------- JLabel |------------------------- setAlignmentX |------------------------- setFont |------------------------- setForeground |------------------------- composeLabels |----------------------------- Box.createVerticalStrut |----------------------------- Box.add |----------------------------- addLabel |--------------------------------- Box.createVerticalGlue |--------------------------------- Box.add |--------------------------------- JLabel |--------------------------------- JLabel.setAlignmentX |--------------------------------- JLabel.setFont |--------------------------------- JLabel.setForeground |------------------------- composeTextFields |----------------------------- Box.createVerticalStrut |----------------------------- Box.add |------------------------- composePair |----------------------------- Box.createHorizontalStrut |----------------------------- Box.add |------------------------- AddCardButtons.compose |----------------------------- Box |----------------------------- Box.createHorizontalStrut |----------------------------- Box.add |----------------------------- JButton.addActionListener |------------------------- AddCardButtons.getWidget | |--------------------- DeleteCardDialog.compose |------------------------- JPanel |------------------------- JPanel.setOpaque |------------------------- JPanel.add |------------------------- Box.createVerticalStrut |------------------------- Box.add |------------------------- JLabel |------------------------- setAlignmentX |------------------------- setFont |------------------------- setForeground |------------------------- composeButtons |----------------------------- Box |----------------------------- Box.createHorizontalStrut |----------------------------- Box.add |----------------------------- JButton.addActionListener | |--------------------- ChangeCardDialog.compose |------------------------- JPanel |------------------------- JPanel.setOpaque |------------------------- JPanel.add |------------------------- Box.createVerticalStrut |------------------------- Box.add |------------------------- JLabel |------------------------- setAlignmentX |------------------------- setFont |------------------------- setForeground |------------------------- composeButtons |----------------------------- Box |----------------------------- Box.createHorizontalStrut |----------------------------- Box.add |----------------------------- JButton.addActionListener | |--------------------- ConfirmChangeDialog.compose |------------------------- super.compose (= AddCardDialog) |------------------------- JLabel.setText | |--------------------- FoundCardsDialog.compose |------------------------- JPanel |------------------------- JPanel.setOpaque |------------------------- JPanel.add |------------------------- Box.createVerticalStrut |------------------------- Box.add |------------------------- composeTopMessages |----------------------------- Box.add |----------------------------- JLabel |----------------------------- setLabelProerties |--------------------------------- setAlignmentX |--------------------------------- setFont |--------------------------------- setForeground |------------------------- composeLabels |----------------------------- Box.createVerticalStrut |----------------------------- Box.add |----------------------------- addLabel |--------------------------------- Box.createVerticalGlue |--------------------------------- Box.add |--------------------------------- JLabel |--------------------------------- JLabel.setAlignmentX |--------------------------------- JLabel.setFont |--------------------------------- JLabel.setForeground |------------------------- composeTextFields |----------------------------- Box.createVerticalStrut |----------------------------- Box.add |------------------------- composePair |----------------------------- Box.createHorizontalStrut |----------------------------- Box.add |------------------------- FoundCardsButtons.compose |----------------------------- Box |----------------------------- Box.createHorizontalStrut |----------------------------- Box.add |----------------------------- JButton.addActionListener |------------------------- FoundCardsButtons.getWidget | |--------------------- FindCardDialog.compose |------------------------- JPanel |------------------------- JPanel.setOpaque |------------------------- JPanel.add |------------------------- Box.createVerticalStrut |------------------------- Box.add |------------------------- JLabel |------------------------- setAlignmentX |------------------------- setFont |------------------------- setForeground |------------------------- composeButtons |----------------------------- Box |----------------------------- Box.createHorizontalStrut |----------------------------- Box.add |----------------------------- JButton.addActionListener | |--------------------- NoCardsFoundDialog.compose |------------------------- JPanel |------------------------- JPanel.setOpaque |------------------------- JPanel.add |------------------------- Box.createVerticalStrut |------------------------- Box.add |------------------------- JLabel |------------------------- setAlignmentX |------------------------- setFont |------------------------- setForeground | |--------------------- ErrorDialog.compose |------------------------- JPanel |------------------------- JPanel.setOpaque |------------------------- JPanel.add |------------------------- Box.createVerticalStrut |------------------------- Box.add |------------------------- JLabel |------------------------- setAlignmentX |------------------------- setFont |------------------------- setForeground |--------------------- EmptyDialog.compose |------------------------- JPanel.setOpaque1 |----------------- View.getWidget |----------------- mvp.Widget.setBounds |----------------- JLayeredPane.add | |----- mvp.Window.getContentPane |----- Container.add |----- RolodexMenuUI.showEmptyDialog |--------- EmptyDialog.getWidget |--------- JLayeredPane.moveToFront |----- mvp.Window.setTitle |----- mvp.Window.pack | |-- RolodexTool.setView | |-- RolodexMenuUI.show
The following functions are all triggered by a left-mouse-up event on a menu item or push button. The double vertical line along the left of the diagram indicates event-based invocation, per the diagramming conventions discussed in the design diagram handout. The function names shown in red are those invoked directly by an event. The indented function names in black are subsidiary functions called from the event-invoked functions. All event-based invocation happens after the main thread has terminated.
||-- ("File New" JMenuItem).actionPerformed
||----- FileStub.newFile
||--------- System.out.println
||
||-- ("File Open" JMenuItem).actionPerformed
||----- FileStub.open
||--------- System.out.println
||
||-- ("File Save" JMenuItem).actionPerformed
||----- FileStub.save
||--------- System.out.println
||
||-- ("File Save As" JMenuItem).actionPerformed
||----- FileStub.saveAs
||--------- System.out.println
||
||-- ("File Print" JMenuItem).actionPerformed
||----- FileStub.print
||--------- System.out.println
||
||-- ("File Exit" JMenuItem).actionPerformed
||----- FileStub.exit
||--------- System.out.println
||
||
||-- ("Edit Undo" JMenuItem).actionPerformed
||----- EditStub.undo
||--------- System.out.println
||
||-- ("Edit Cut" JMenuItem).actionPerformed
||----- EditStub.cut
||--------- System.out.println
||
||-- ("Edit Copy" JMenuItem).actionPerformed
||----- EditStub.copy
||--------- System.out.println
||
||-- ("Edit Paste" JMenuItem).actionPerformed
||----- EditStub.paste
||--------- System.out.println
||
||
||-- ("Rolodex Add" JMenuItem).actionPerformed
||----- RolodexMenuUI.showAddCardDialog
||--------- AddCardDialog.getWidget
||--------- JLayeredPane.moveToFront
||
||-- ("Rolodex Delete" JMenuItem).actionPerformed
||----- RolodexMenuUI.showDeleteCardDialog
||--------- DeleteCardDialog.getWidget
||-------- JLayeredPane.moveToFront
||
||-- ("Rolodex Change" JMenuItem).actionPerformed
||----- RolodexMenuUI.showChangeCardDialog
||--------- ChangeCardDialog.getWidget
||--------- JLayeredPane.moveToFront
||
||-- ("Rolodex Find" JMenuItem).actionPerformed
||----- RolodexMenuUI.showFindCardDialog
||--------- FindCardDialog.getWidget
||--------- JLayeredPane.moveToFront
||
||
||-- OKAddButtonListener.actionPerformed
||----- AddCardDialog.getName
||--------- JTextField.getText
||----- Name
||----- AddCardDialog.getId
||--------- JTextField.getText
||--------- Integer
||--------- NumberFormatException
||----- Id
||----- AddCardDialog.getAge
||--------- JTextField.getText
||--------- Integer
||--------- NumberFormatException
||----- Age
||----- AddCardDialog.getSex
||--------- JTextField.getText
||----- Sex
||----- AddCardDialog.getAddress
||--------- JTextField.getText
||----- Address
||----- Card
||----- Rolodex.add
||--------- AddInputErrors.clear
||--------- Card.getId
||--------- Roldex.find
||--------- AddInputErrors.setAlreadyThereError
||--------- validateAddInput
||------------- Card.getName.stringValue.length
||------------- AddInputErrors.setNameError
||------------- Card.getId.integerValue.intValue
||------------- AddInputErrors.setIdError
||------------- Card.getAge.integerValue.intValue
||------------- AddInputErrors.setAgeError
||------------- Card.getSex.isValid
||------------- AddInputErrors.setSexError
||------------- Card.getAddr.stringValue.length
||------------- AddInputErrors.setAddressError
||--------- AddInputErrors.anyErrors.booleanValue
||--------- CardList.add
||----- AddInputErrors
||----- AddInputErrors.getErrorList
||----- RolodexMenuUI.showErrorDialog
||--------- ErrorMessageDialog.clearMessages
||--------- ErrorMessageDialog.setMessages
||------------- StringList.iterator
||------------- Iterator.hasNext
||------------- Iterator.next
||------------- setMessage
||----------------- JLabel.setText
||--------- ErrorMessageDialog.getWidget
||--------- JLayeredPane.moveToFront
||
||-- ClearAddButtonListener
||----- AddCardDialog.clear
||--------- JTextField.setText
||
||-- CancelAddButtonListener
||----- RolodexMenuUI.showEmptyDialog
||
||-- OKDeleteButtonListener.actionPerformed
||----- DeleteCardDialog.getId
||--------- JTextField.getText
||--------- Integer
||--------- NumberFormatException
||----- Id
||----- Rolodex.delete
||----- DeleteInputError
||----- DeleteInputError.getNotThereErrorMessage
||----- RolodexMenuUI.showErrorDialog
||
||-- CancelDeleteButtonListener
||----- RolodexMenuUI.showEmptyDialog
||
||-- OKChangeButtonListener.actionPerformed
||----- ChangeCardDialog.getId
||--------- JTextField.getText
||----- Id
||----- Rolodex.find
||----- DeleteInputError
||----- DeleteInputError.getNotThereErrorMessage
||----- RolodexMenuUI.showConfirmChangeDialog
||--------- ConfirmChangeDialog.getWidget
||--------- JLayeredPane.moveToFront
||----- ConfirmChangeDialog.showCardAndSaveId
||--------- Card.getName
||--------- Name.stringValue
||--------- Card.getId
||--------- Id.stringValue
||--------- Card.getAge
||--------- Age.stringValue
||--------- Card.getSex
||--------- Sex.stringValue
||--------- Card.getAddress
||--------- Address.stringValue
||--------- JTextField.setText
||
||-- CancelChangeButtonListener
||----- RolodexMenuUI.showEmptyDialog
||
||-- OKConfirmChangeListener.actionPerformed
||----- ConfirmChangeDialog.getName
||--------- JTextField.getText
||----- Name
||----- ConfirmChangeDialog.getId
||--------- JTextField.getText
||--------- Integer
||--------- NumberFormatException
||----- Id
||----- ConfirmChangeDialog.getAge
||--------- JTextField.getText
||--------- Integer
||--------- NumberFormatException
||----- Age
||----- ConfirmChangeDialog.getSex
||--------- JTextField.getText
||----- Sex
||----- ConfirmChangeDialog.getAddress
||--------- JTextField.getText
||----- Address
||----- Card
||----- Rolodex.change
||----- ChangeInputErrors
||----- ChangeInputErrors.getErrorList
||----- AddInputErrors
||----- AddInputErrors.getErrorList
||----- RolodexMenuUI.showErrorDialog
||
||-- OKFindButtonListener.actionPerformed
||----- CardList
||----- FindCardDialog.getName
||--------- JTextField.getText
||----- Name
||----- Rolodex.find
||----- CardList.size
||----- RolodexMenuUI.showNoFoundDialog
||--------- NoCardsFoundDialog.getWidget
||--------- JLayeredPane.moveToFront
||----- RolodexMenuUI.showFoundDialog
||--------- FoundCardsDialog.getWidget
||--------- JLayeredPane.moveToFront
||----- FoundCardsDialog.showResults
||--------- CardList.size
||--------- setNextPrevEnabled
||------------- JButton.setEnabled
||--------- showNumberOfCards
||------------- Integer.toString
||------------- JLabel.setText
||--------- next
||------------- CardList.size
||------------- showWhichChard
||------------- CardList.get
||------------- showCardData
||----------------- Card.getName
||----------------- Name.stringValue
||----------------- Card.getId
||----------------- Id.stringValue
||----------------- Card.getAge
||----------------- Age.stringValue
||----------------- Card.getSex
||----------------- Sex.stringValue
||----------------- Card.getAddress
||----------------- Address.stringValue
||----------------- JTextField.setText
||
||-- CancelFindButtonListener
||----- RolodexMenuUI.showEmptyDialog
||
||-- NextCardButtonListener.actionPerformed
||----- FoundCardsDialog.next
||
||-- PreviousCardButtonListener.actionPerformed
||----- FoundCardsDialog.previous
||--------- showWhichChard
||--------- CardList.get
||--------- showCardData
||
||-- DoneFindButtonListener.actionPerformed
||----- RolodexMenuUI.showEmptyDialog