com.jFormTK
Class JCouple

java.lang.Object
  extended by com.jFormTK.JCouple
All Implemented Interfaces:
JConstants

public class JCouple
extends java.lang.Object
implements JConstants

        This 'jFormTK' Class is used to contain the owner and owner spouse nicknames and to
        control 10 processing modes. This class is used to control the Group Name OR
        Field Name suffixes...

        Each 'JCouple' processing set is initialized via an _IField 'JFormField' "Hook".
        An _IField is an "Invisible" field that is NOT displayed in the Show Panel. It
        was originially designed as a "Holder" type used to contain 'JFormForm.SubClass'
        local parameters that MUST be reset when a 'jFormTK' form is returned to the
        Show Panel after being un-loaded for another form.

        For the 'JCouple' processing the 'jCoupleCommand' control contains the processing
        type [seeBelow]. The '_IField.reference' control is used to contain the .toString
        JRecord instances for the fields to be inserted into the Show Panel...

        The 'JCouple' processing is controlled =F[JFormField.jCoupleCommand] command...
        This command is used as follows:
        1)      _IField JFormField Hook...
                The command contains the 'processType' as follows:
         index  |       Code        |   Description...
   _______|_______________|________________________________________________     
                0       |       "CLOOP_O",      |       Couple LOOP, No Selection, Owner  First...
                1       |       "CLOOP_S",      |       Couple LOOP, No Selection, Spouse First...
                2       |       "CLOOPS",       |       Couple LOOP Select Dialog...
                3       |       "CBOTH_O",      |       Couple BOTH, No Selection, Owner  First...
                4       |       "CBOTH_S",      |       Couple BOTH, No Selection, Spouse First...
                5       |       "CBOTHS",       |       Couple BOTH Select...
                6       |       "CGROUPS",      |       Couple inside GROUP with Select Dialog...
                7       |       "CGROUPSO",     |       Couple inside GROUP, No Selection, Owner  First...
                8       |       "CGROUPSS",     |       Couple inside GROUP, No Selection, Spouse First...
                9       |       "CGROUPC"};     |       Couple inside GROUP with "Choice" 'JFormField'...
   _______|_______________|________________________________________________             

        2)      JFormField's controlled by the JCouple = F[processType]...
                The 'jCoupleCommand' contains the "Insertion Control" to be used to determine
                if the host 'JFormField' SHALL be inserted into the Show Panel. The "Insertion
                Controls" are as follows:
                Control |       Description...
                ________|____________________________________________________________
                  " "   |       Insert in both "Owner" and "Spouse" presentation...
                  "O"   |       Insert in the "Owner" Field presentations ONLY...
                  "S"   |       Insert in the "Spouse" Field presentations ONLY...
                ________|____________________________________________________________

        3)      The 'JCouple' "Add Spouse" 'jFormTK' Button [_BField]...
                This button exist only when the "CLOOP" process Types are used AND when there
                is an existing Spouse. In this case the 'jCoupleCommand' SHALL contain the
                Java String representaion of the following 'Object' Array...
                Element Type    |       Description...
                ________________|____________________________________________________
                        String          |       The 'jFormTK' full ID of a 'JFormField' to be inserted
                                                |       into the Show Panel when the "Add Spouse" 'jFormTK' Button
                                                |       is pressed...
                        JRecord         |       JRecord.toString of a 'JFormField' that has a non-Null
                                                |       "Insertion Control" in the 'jCoupleCommand'. For example,
                                                |       If the first JCouple presentation is the 'Owner',
                                                |       Then this 'JRecord' is used iff the "Insertion Control" in
                                                |       the 'jCoupleCommand' is == "S"...
                ________________|____________________________________________________

        If the "'JCouple' implementation is active,
        Then
                the 'Owner' and or 'Spouse' nicknames SHALL be appended to the the
                'JFormField' instance name and to the Field Label of each 'JFormField' to be
                added OR inserted into the current 'JFormForm.SubClass' Form...

        The JCouple state is "active" iff the following conditions are met:
                1)      The 'JFormTKDB.fJCouple' 'JCouple' Application Control Flag is 'true'.
                2)      The JCouple.coupleActive control is == '1', i.e. the 'jFormTK'
                        Application End User has authorized that the 'JCouple' processing.
                3)      There is an existing Registed User [Owner] Spouse...

        There is an instance of this class for each 'JFormForm' Sub-Class form.
        The instance is created and hosted by the 'JFormState' constructor.

        The 'JCouple.coupleActive' control is defaulted to the 'JFormTKDB.fJCouple' flag.
        Some 'jFormTK' applications may query their End User to let them decide if the
        'JCouple' processing shall be implemented. For example, the SLPlus Application's
        'Directory.Reception' Form enables the End User to confirm the 'JCouple' usage
        after a couple 'jFormTK' Description Dialoges are used to describe the 'JCouple'
        processing...

Version:
1.00, 23 Dec 2008
Author:
Jim Crowell
Professional Computer Solutions [PCS]
URL: http://jFormTK.com/
E-Mail: JimCrowell@EMail.com

Copyright (c) 2009 by Professional Computer Solutions [PCS]
All Rights Reserved

Nested Class Summary
static class JCouple.SelectDialog
           
 
Field Summary
 int CBOTH_O
           
 int CBOTH_S
           
 int CBOTHS
           
 int CGROUPC
           
 int CGROUPS
           
 int CGROUPSO
           
 int CGROUPSS
           
 int CLOOP_O
           
 int CLOOP_S
           
 int CLOOPS
           
 
Fields inherited from interface com.jFormTK.JConstants
__, _AB, _AB_, _AField, _B, _BField, _CField, _CIField, _DField, _EU_, _H, _HEIGHT, _HEIGHT_INV, _HField, _I, _IField, _LField, _MField, _NField, _NotRequired, _PField, _PIField, _QField, _Required, _RField, _TAField, _TField, _WIDTH, _WIDTH_INV, _XField, AB, APP_TRACE_FOCUS, APP_TRACE_GET, APP_TRACE_SET, B_, BAR, BAR_, BB, BH, BI, BREAKPOINT_FOCUS, BREAKPOINT_GET, BREAKPOINT_SET, BVB, C_QUOTE, CLOSE, CLOSE_BRACKET, COLORS_DELIMITER, COMMA, COMMA_, D_ELEMENT, D_ELEMENT_N, D_ELEMENT_N1, D_ELEMENT_N2, D_ELEMENT_N3, D_FIELDS, D_FIELDS_N, D_FIELDS_N1, D_FIELDS_N2, D_FIELDS_N3, D_ITEMS, DASH, DOT, EOL, EOP, EOS, FIELD_TRACE_FOCUS, FIELD_TRACE_GET, FIELD_TRACE_SET, FONT_DELIMITER, H_, HB, HH, HI, I_, IB, IH, II, JLAF_DELIMITER, LF, LISTBRACKET, NO, OPEN, OPEN_BRACKET, pCheckboxGroup, QUOTE, SPACE_, TAB, YES
 
Constructor Summary
JCouple(JFormForm form)
           
 
Method Summary
 java.lang.String displayJCouple()
           
 void endLOOP()
           Clear the 'JCouple' LOOP Control...
 boolean getCoupleActive()
           
 java.lang.String getOwner()
           
 int getProcessDoCase()
           
 java.lang.String getProcessName()
           
 java.lang.String getProcessType()
           
 java.lang.String getSpouse()
           
 boolean isActive()
           Return the 'fCouple' Control to specify if the 'JCouple' processor is active...
 boolean isBoth()
           Return the boolean to specify the 'fBoth' control flag...
 boolean isCoupleActive()
           Return the boolean to specify the Active state...
 int isElement(java.lang.String elementNameIn)
           Return an 'int' to indicate a element name match.
 boolean isSpouse()
           Return the Spouse available Flag...
 void load(java.lang.String savedJCouple)
           
 void loadCouple(java.lang.String ownerNickname, java.lang.String spouseNickname)
           Load the owner and spouse nicknames to be used as the JFormField name suffix when a 'JCouple' LOOP is active...
 java.lang.String selection()
           This method is designed to create and return the 'JCouple' nicknames as a function of the current process DoCase and 'processType'.
 java.lang.String selection(int processDoCase)
           
 void setBoth(boolean flag)
           Set the 'fBoth' control flag.
 void setCoupleActive(boolean flag)
           
 void setCoupleActive(java.lang.String value)
           
 void setCurrentNickname(java.lang.String s)
           
 void setFBoth(java.lang.String s)
           
 void setFSpouse(boolean flag)
           
 void setFSpouse(java.lang.String s)
           
 int setJCoupleProcess(JFormField hook)
           If (the 'JCouple' processing is available) Then If the current 'JCouple' has an existing Spouse Name Then Set the 'JCouple' Process = f[JFormField 'hook' JCouple Command] and return a process 'doCase' int...
 void setOwner(java.lang.String s)
           
 void setProcessHookName(java.lang.String s)
           
 void setSpouse(java.lang.String s)
           
 void showJCouple(java.lang.String header)
           
 java.lang.String startLOOP()
           Initialize the 'JCouple' LOOP with the 'this.owner' parameter...
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLOOP_O

public final int CLOOP_O
See Also:
Constant Field Values

CLOOP_S

public final int CLOOP_S
See Also:
Constant Field Values

CLOOPS

public final int CLOOPS
See Also:
Constant Field Values

CBOTH_O

public final int CBOTH_O
See Also:
Constant Field Values

CBOTH_S

public final int CBOTH_S
See Also:
Constant Field Values

CBOTHS

public final int CBOTHS
See Also:
Constant Field Values

CGROUPS

public final int CGROUPS
See Also:
Constant Field Values

CGROUPSO

public final int CGROUPSO
See Also:
Constant Field Values

CGROUPSS

public final int CGROUPSS
See Also:
Constant Field Values

CGROUPC

public final int CGROUPC
See Also:
Constant Field Values
Constructor Detail

JCouple

public JCouple(JFormForm form)
Method Detail

displayJCouple

public java.lang.String displayJCouple()

endLOOP

public void endLOOP()
        Clear the 'JCouple' LOOP Control...

        Kernel Usage:
        1)      'JFormForm' Sub-Class when a JName LOOP terminates...
        


getCoupleActive

public boolean getCoupleActive()

getOwner

public java.lang.String getOwner()

getProcessDoCase

public int getProcessDoCase()

getProcessName

public java.lang.String getProcessName()

getProcessType

public java.lang.String getProcessType()

getSpouse

public java.lang.String getSpouse()

setJCoupleProcess

public int setJCoupleProcess(JFormField hook)
        If (the 'JCouple' processing is available)
        Then
                If the current 'JCouple' has an existing Spouse Name
                Then
                        Set the 'JCouple' Process = f[JFormField 'hook' JCouple Command]
                        and return a process 'doCase' int...
                Else
                        Return an 'int' == -1 to indicate that no Spouse is current...
                End IF
        Else
                Return an 'int' == -1 to indicate that the 'JCouple' processing is NOT
                available...
        End IF

        Kernel Usage:
        1)      'JFormFrame.doJCouple' method which is invoked when the _IField
                JFormField 'hook' is Pre Processed...
        

Parameters:
hook - JFormField instance that is the _IField hook for a 'JCouple' Process Type...
Returns:
The 'doCase' int iff the given 'JCouple' processes is verified and active...

isActive

public boolean isActive()
        Return the 'fCouple' Control to specify if the 'JCouple' processor is
        active...

        Kernel Usage:
        1)      'JFormForm' Sub-Class when TBD...
        


isBoth

public boolean isBoth()
        Return the boolean to specify the 'fBoth' control flag...

        Kernel Usage:
        1)      'JFormForm' Sub-Class when TBD...
        


isCoupleActive

public boolean isCoupleActive()
        Return the boolean to specify the  Active state...
        NOTE:
        The 'coupleActive' String contains the following data:
                ==      "-1"    Null case. The flag was never set by the 'jFormTK' Application...
                ==      "0"             

        Kernel Usage:
        1)      'JFormForm' Sub-Class when TBD...
        


isElement

public int isElement(java.lang.String elementNameIn)
        Return an 'int' to indicate a element name match.
        If no match, then the return 'int' is -1.

        Kernel Usage:
        1)      Util.loadCouple method...
        

Parameters:
elementNameIn - Element Name String...
Returns:
Matching 'elementNames' index of -1 iff NOT matched...

isSpouse

public boolean isSpouse()
        Return the Spouse available Flag...

        Kernel Usage:
        1)      'JFormForm' Sub-Class when setting the state of the 'JCouple' LOOP
                more Names _AField button...
        


loadCouple

public void loadCouple(java.lang.String ownerNickname,
                       java.lang.String spouseNickname)
        Load the owner and spouse nicknames to be used as the JFormField name suffix
        when a 'JCouple' LOOP is active...

        Kernel Usage:
        1)      'JFormForm' Sub-Class assigned to service the 'jFormTK' Application
                registration controls. For example, class Directory.SLPlusReception of the
                'jFormTK' Survivors List PLUS Application...
        


load

public void load(java.lang.String savedJCouple)

selection

public java.lang.String selection()
        This method is designed to create and return the 'JCouple' nicknames as a
        function of the current process DoCase and 'processType'. The 'processType' was
        derived from the _IField JFormField 'JCouple.command' word.

        This method shall manage the 'SelectDialog' presentation iff the 'processType'
        requires an End User Selection and the JCouple.zzzz control is in the "Null
        character" state.

        The return String shall provide the following delimitted fields [NOTE: the
        delimitter is the 'jFormTK' Items Delimiter [D_ITEMS]:
        1)      Return String == "":
                -       No nickname suffix required for this 'JCouple' State...
        2)      Return String == "nickname" + D_ITEMS + "nickname" + D_ITEMS
                -       Two nickname case where there is an existing 'JCouple.spouse'
                        The 'nicknames' are in the order selected by the 'jFormTK'
                        Application End User [via SelectDialog] or as indicated by the
                        'JCouple.processType'...

        NOTE:   If a single 'nickname' is detected, i.e. no existing 'JCouple.spouse',
                        Then the Null String is returned because the 'jFormTK' specifications
                        states that no-Spouse requires no 'Owner' Nick Name suffix usage...

        Kernel Usage:
        1)      'JFormFrame.doJCouple' method [w/ processDoCase signature]...
        

Returns:
The constructed 'nickName(s)' OR 'Null' String...

selection

public java.lang.String selection(int processDoCase)

setBoth

public void setBoth(boolean flag)
        Set the 'fBoth' control flag.

        Kernel Usage:
        1)      'JFormForm' Sub-Class when the 'jFormTK' developer knows that there is a
                spouse AND the spouse shall be processed via the 'addSpouse' End 'couple'
                Loop processing...
        

Parameters:
flag - boolean to set the 'this.fBoth' variable...

setProcessHookName

public void setProcessHookName(java.lang.String s)

setCurrentNickname

public void setCurrentNickname(java.lang.String s)

setFBoth

public void setFBoth(java.lang.String s)

setFSpouse

public void setFSpouse(java.lang.String s)

setFSpouse

public void setFSpouse(boolean flag)

setCoupleActive

public void setCoupleActive(java.lang.String value)

setCoupleActive

public void setCoupleActive(boolean flag)

setOwner

public void setOwner(java.lang.String s)

setSpouse

public void setSpouse(java.lang.String s)

showJCouple

public void showJCouple(java.lang.String header)

startLOOP

public java.lang.String startLOOP()
        Initialize the 'JCouple' LOOP with the 'this.owner' parameter...

        Kernel Usage:
        1)      'JFormForm' Sub-Class when setting the state of the 'JCouple' LOOP
                more Names _AField button...
        


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object