Necessary Connections


The following table describes the connections that you will need to set up for proper operation of this Magercise, if you are following the example method closely. It may in fact differ from the application you are building.  If it does, this table can serve as a map of how the connections in the sample solution are set up.

* means a parameter is required and immediately follows
** means two parameters are required and immediately follow
= means a parameter is required and should be given a constant value
  (set the value in the connection property sheet, pressing Set paramaters...)
! = you need to set up exceptionOccurred events for the connection
<calc button> means the connection should be set up for each button in the
              calculator
METHOD means the target of the connection is a method call
PROPERTY means the target of the connection is a property
PARM means it is a PARAMETER source connection (going to a property ot method)
EXCEPTION means that the source of the connection is the exceptionOccurred event
  for the last connection with a "!" after it.

actionPerformed Event Connections

Source Bean           Target Bean       Target action
===============       ===========       =============
Menu("Save as")   --> saveDialog        METHOD show()
Menu("Save as")   --> notePadKernel     PROPERTY fileName *
       PARM value --> saveDialog        PROPERTY file
Menu("Save as")   --> notePadKernel     PROPERTY dirName *
       PARM value --> saveDialog        PROPERTY directory
Menu("Save as")   --> notePadKernel     METHOD save()

MenuItem("Open")  --> loadDialog        METHOD show()
MenuItem("Open")  --> notePadKernel     PROPERTY fileName *
       PARM value --> loadDialog        PROPERTY file
MenuItem("Open")  --> notePadKernel     PROPERTY dirName *
       PARM value --> loadDialog        PROPERTY directory
MenuItem("Open")  --> notePadKernel     METHOD load()
MenuItem("Open")  --> loadDialog        METHOD dispose()

MenuItem("New")   --> textArea1         PROPERTY text =""
MenuItem("New")   --> notePadKernel     PROPERTY fileName =""
MenuItem("New")   --> notePadKernel     PROPERTY dirName =""

MenuItem("Save")  --> notePadKernel     METHOD save() !
        EXCEPTION --> saveDialog        METHOD show()
        EXCEPTION --> notePadKernel     PROPERTY dirName *
    PARAM dirname --> saveDialog        PROPERTY directory
        EXCEPTION --> notePadKernel     PROPERTY fileName *
   PARAM fileName --> saveDialog        PROPERTY file
        EXCEPTION --> notePadKernel     METHOD save()
        EXCEPTION --> saveDialog        METHOD dispose()

<calc button>     --> calculatorKernel  METHOD key(String keyName) *
     PARM keyName --> <calc button>     PROPERTY label

toDoAddButton     --> toDoStuff         METHOD addItem(String item) *
        PARM item --> toDoItem          PROPERTY text

toDoRemoveButton  --> toDoStuff         METHOD remove(int position) *
    PARM position --> toDoStuff         PROPERTY selectedIndex

phoneAddButton    --> dialog1           METHOD show()
phoneAddButton    --> choice1           METHOD addItem(String item) *
        PARM item --> textField4        PROPERTY text
phoneAddButton    --> choice1           METHOD select(String str) *
         PARM str --> textField4        PROPERTY text
phoneAddButton    --> textField3        PROPERTY text = "xxx-xxx-xxxx"
phoneAddButton    --> textField2        PROPERTY text = "xxx-xxx-xxxx"
phoneAddButton    --> textField1        PROPERTY text = "xxx-xxx-xxxx"

textField4        --> dialog1           METHOD setVisible(boolean b = false)

phoneRemoveButton --> choice1           METHOD remove(int position)
    PARM position --> choice1           PROPERTY selectedIndex
[need to create a variable stringConv of type java.lang.String]
phoneRemoveButton --> textField3        PROPERTY text * 
       PARM value --> stringConv        METHOD valueOf(Object obj) *
         PARM obj --> busHash           METHOD get(Object key) *
         PARM key --> choice1           PROPERTY selectedItem
phoneRemoveButton --> textField2        PROPERTY text *
       PARM value --> stringConv        METHOD valueOf(Object obj) *
         PARM obj --> homeHash          METHOD get(Object key) *
         PARM key --> choice1           PROPERTY selectedItem
phoneRemoveButton --> textField1        PROPERTY text *
       PARM value --> stringConv        METHOD valueOf(Object obj) *
         PARM obj --> faxHash           METHOD get(Object key) *
         PARM key --> choice1           PROPERTY selectedItem

itemStateChanged Event Connections

choice1           --> textField3        PROPERTY text *
       PARM value --> stringConv        METHOD valueOf(Object obj) *
         PARM obj --> busHash           METHOD get(Object key) *
         PARM key --> choice1           PROPERTY selectedItem
choice1           --> textField2        PROPERTY text *
       PARM value --> stringConv        METHOD valueOf(Object obj) *
         PARM obj --> homeHash          METHOD get(Object key) *
         PARM key --> choice1           PROPERTY selectedItem
choice1           --> textField1        PROPERTY text *
       PARM value --> stringConv        METHOD valueOf(Object obj) *
         PARM obj --> faxHash           METHOD get(Object key) *
         PARM key --> choice1           PROPERTY selectedItem

textValueChanged event connections

textField3        --> busHash           METHOD put(Object key, Object value) **
         PARM key --> choice1           PROPERTY selectedItem
       PARM value --> textField3        PROPERTY text
textField2        --> homeHash          METHOD put(Object key, Object value) **
         PARM key --> choice1           PROPERTY selectedItem
       PARM value --> textField2        PROPERTY text
textField1        --> faxHash           METHOD put(Object key, Object value) **
         PARM key --> choice1           PROPERTY selectedItem
       PARM value --> textField1        PROPERTY text

windowActivated event connections

dialog1           --> textField4        METHOD requestFocus()

windowClosing event connections

miniPim (Frame)   --> toDoListKernel    METHOD save()
miniPim (Frame)   --> phoneListKernel   METHOD save()
miniPim (Frame)   --> miniPim (Frame)   METHOD dispose()
miniPim (Frame)   --> SCRIPT            {System.exit();}

windowOpened event connections

miniPim (Frame)   --> toDoListKernel    METHOD load())
miniPim (Frame)   --> phoneListKernel   METHOD load())
miniPim (Frame)   --> textField3        PROPERTY text *
       PARM value --> stringConv        METHOD valueOf(Object obj) *
         PARM obj --> busHash           METHOD get(Object key) *
         PARM key --> choice1           PROPERTY selectedItem
miniPim (Frame)   --> textField2        PROPERTY text *
       PARM value --> stringConv        METHOD valueOf(Object obj) *
         PARM obj --> homeHash          METHOD get(Object key) *
         PARM key --> choice1           PROPERTY selectedItem
miniPim (Frame)   --> textField1        PROPERTY text *
       PARM value --> stringConv        METHOD valueOf(Object obj) *
         PARM obj --> faxHash           METHOD get(Object key)
         PARM key --> choice1           PROPERTY selectedItem

property-to-property connections

Source Bean         Property        Target Bean      Property
===========         ========        ===========      ==========
calculatorKernel    display   <-->  calcDisplay      text
faxHash             this      <-->  phoneListKernel  fax
homeHash            this      <-->  phoneListKernel  home
choice1             this      <-->  phoneListKernel  name
busHash             this      <-->  phoneListKernel  business
toDoStuff           this      <-->  toDoListKernel   list
textArea1           this      <-->  notePadKernel    text

Copyright © 1996-1997 MageLang Institute. All Rights Reserved.