com.jFormTK
Class JLAF

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

public class JLAF
extends java.lang.Object
implements JConstants

This 'jFormTK' Kernel class is designed to control the "Look and Feel" parameters [Color background, Color foreground, Font, Border Control, lineBorderColor] of a 'jFormTK' Kernel Object. NOTE: The 'BorderControl' parameter is an 'int' Code as follows: Code Description ____ __________________________________________________ -1 BevelBorder RAISED/LineColor/White" 0 BevelBorder RAISED 1 BevelBorder LOWERED 2 No Border 3 Line Border, "LINE w/=1", use JLAF.LineBorderColor 4 Line Border, "LINE w/=2", use JLAF.LineBorderColor 5 Line Border, "LINE w/=3", use JLAF.LineBorderColor n Line Border, "LINE w/=JLAF.BorderControl-2", use JLAF.LineBorderColor

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

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

Field Summary
 java.awt.Color Background
           
 boolean Bold
           
 int BorderControl
           
 java.awt.Font Font
           
 java.awt.Color Foreground
           
 boolean Italic
           
 java.awt.Color LineBorderColor
           
 boolean Underline
           
 
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
JLAF()
          Construct and initialize a "Default" JLAF...
JLAF(java.awt.Color background, java.awt.Color foreground)
          Construct Color ONLY parameter JLAF...
JLAF(java.awt.Color background, java.awt.Color foreground, java.awt.Font font)
          Construct Color and Font ONLY parameter JLAF...
JLAF(java.awt.Color background, java.awt.Color foreground, java.awt.Font font, int borderControl)
          Construct Color, Font and Border Control ONLY parameter JLAF...
JLAF(java.awt.Color background, java.awt.Color foreground, java.awt.Font font, int borderControl, java.awt.Color lineBorderColor)
          Constructor with Full JLAF Parameters...
JLAF(java.awt.Font font)
           Construct a 'JLAF' instance using the given Font parameter and the default Application parameters...
JLAF(java.awt.Font font, int borderControl)
           Construct a 'JLAF' instance using the given Font parameter and the default Application parameters...
JLAF(int borderControl)
           Construct a 'JLAF' instance using the given Border Control parameter and the default Application parameters...
JLAF(int borderControl, java.awt.Color lineBorderColor)
           Construct a 'JLAF' instance using the given Border Control and lineBorder Color parameters and the default Application parameters...
JLAF(JLAF laf, java.lang.String from)
          Constructor to make a copy of an existing JLAF object...
JLAF(java.lang.String encodedValue, java.lang.String from)
           Construct from an Encoded String as produced by '*this*.JLAF.toString' Method...
 
Method Summary
 boolean equals(java.lang.Object obj)
           This method overrides the Java 'java.lang.Object.equals' Method so that the individual parameters are compared as required by the 'jFormTK' Kernel
 java.awt.Color getBackground(JFormForm form)
           This methods returns a non-null Color as follows: IF the JLAF.Background Color is not Null, THEN it is returned ELSE IF the given Form's [form] Show Panel Exist THEN the Non-Null Show Panel Background is returned...
 java.awt.Color getForeground(JFormForm form)
           This methods returns a non-null Color as follows: IF the JLAF.Foreground Color is not Null, THEN it is returned ELSE IF the given Form's [form] Show Panel Exist THEN the Non-Null Show Panel Foreground is returned...
 java.lang.String getLAFString()
          Construct a String to annotate the current JLAF parameters...
 void set(java.awt.Color background, java.awt.Color foreground)
          Set the '*this*.JLAF' Color parameters...
 void set(java.awt.Color background, java.awt.Color foreground, java.awt.Font font)
          Set the '*this*.JLAF' Color, and Font parameters...
 void set(java.awt.Color background, java.awt.Color foreground, java.awt.Font font, int borderControl)
          Set the '*this*.JLAF' Color, Font and BorderControl parameters...
 void set(java.awt.Color background, java.awt.Color foreground, java.awt.Font font, int borderControl, java.awt.Color lineBorderColor)
          Set the '*this*.JLAF' FULL parameters...
 void set(JLAF laf)
          Set the '*this*.JLAF' parameters from a given JLAF [laf] instance...
 void set(java.lang.String savedLAF)
          Set the fields of *this* JLAF from the fields of the given 'JLAF' saved String [savedLAF]...
 void set(java.lang.String savedLAF, java.lang.String inID)
           Set the fields of *this* JLAF from the fields of the given 'JLAF' saved String [savedLAF]...
 void setFontControls()
           Set the 'this.Bold', 'this.Italic' and 'this.Underline' Controls each time the 'this.Font' parameter is set OR re-set.
 void setObjectJLAF(java.awt.Component c)
           Set the Look And Feel controls from 'this.JLAF' instance on the given Container[c]...
 void setObjectJLAF(java.awt.Component c, boolean fBorder, java.lang.String from)
           Set the Look And Feel controls from 'this.JLAF' instance on the given Container[c]...
 void setObjectJLAF(java.awt.Component c, javax.swing.border.Border border)
           
 void showJLAF(java.lang.Object parent)
          Display the '*this*.JLAF' in a 'jFormTK' Kernel Dialog window showing the Fields and displays a JButton with the JLAF parameters applied...
 void showJLAF(java.lang.Object parent, char displayType)
           Display the '*this*.JLAF' in a 'jFormTK' Kernel Dialog window iff the parent Object is a 'JFormField' and a the 'JFormField.type' parameter matches the given Dispay Type char.
 void showJLAF(java.lang.String name)
          
 java.lang.String toString()
           Convert the *this*.JLAF parameters to a Saved JLAF String.
 java.lang.String[] toStringArray()
           Convert the *this*.JLAF parameters to a String Array...
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Background

public java.awt.Color Background

Bold

public boolean Bold

BorderControl

public int BorderControl

Font

public java.awt.Font Font

Foreground

public java.awt.Color Foreground

Italic

public boolean Italic

LineBorderColor

public java.awt.Color LineBorderColor

Underline

public boolean Underline
Constructor Detail

JLAF

public JLAF()
Construct and initialize a "Default" JLAF...


JLAF

public JLAF(java.awt.Color background,
            java.awt.Color foreground)
Construct Color ONLY parameter JLAF... NOTE: Remainder of the parameters are set from the JFormTKDB Data Base Defaults...

Parameters:
background - JLAF.Background [Color]
foreground - JLAF.Foreground [Color]

JLAF

public JLAF(java.awt.Color background,
            java.awt.Color foreground,
            java.awt.Font font)
Construct Color and Font ONLY parameter JLAF... NOTE: Remainder of the parameters are set from the JFormTKDB Data Base Defaults...

Parameters:
background - JLAF.Background [Color]
foreground - JLAF.Foreground [Color]
font - JLAF.Font [Font]

JLAF

public JLAF(java.awt.Color background,
            java.awt.Color foreground,
            java.awt.Font font,
            int borderControl)
Construct Color, Font and Border Control ONLY parameter JLAF... NOTE: Remainder of the parameters are set from the JFormTKDB Data Base Defaults...

Parameters:
background - JLAF.Background [Color]
foreground - JLAF.Foreground [Color]
font - JLAF.Font [Font]
borderControl - JLAF.BorderControl [int]

JLAF

public JLAF(java.awt.Color background,
            java.awt.Color foreground,
            java.awt.Font font,
            int borderControl,
            java.awt.Color lineBorderColor)
Constructor with Full JLAF Parameters...

Parameters:
background - JLAF.Background [Color]
foreground - JLAF.Foreground [Color]
font - JLAF.Font [Font]
borderControl - JLAF.BorderControl [int]
lineBorderColor - JLAF.LineBorderColor [Color]

JLAF

public JLAF(JLAF laf,
            java.lang.String from)
Constructor to make a copy of an existing JLAF object...

Parameters:
laf - JLAF to be copied

JLAF

public JLAF(java.lang.String encodedValue,
            java.lang.String from)
 
        Construct from an Encoded String as produced by '*this*.JLAF.toString' Method...
 
        Kernel Usage:
        1)      'jFormTKDB.jTK.getValue' Method to fetch a specific 'jFormTKDB' parameter...
        2)      'JFormField[5] to Re-Set the 'labelLAF' Object...
        3)      'jFormframe.setPrompt' to construct a 'JLAF' instance from an encodedLAF
                provided in a 'promptPhrase' OR 'messagePhrase' Control String...
        4)      'JFormTKDB.JTK.decode' to construct a JLAF instance from an
                Encoded JLAF String...
        5)      'JMessageTable.setStyle' to create the Variable 'v' working JLAF instance...
        6)      'Util.setStyle' to create the Variable 'v' working JLAF instance...
        7)      'Util.setHighliteLAF' Method...
        

Parameters:
encodedValue - JLAF encoded 'toString' String...
from - DEBUG annotation of invoking Class.Method...

JLAF

public JLAF(int borderControl,
            java.awt.Color lineBorderColor)
 Construct a 'JLAF' instance using the given Border Control and lineBorder Color
 parameters and the default Application parameters...
 

Parameters:
borderControl - Border Control for *this* instance...
lineBorderColor - Border Line Color for *this* instance...

JLAF

public JLAF(int borderControl)
 Construct a 'JLAF' instance using the given Border Control
 parameter and the default Application parameters...
 

Parameters:
borderControl - Border Control for *this* instance...

JLAF

public JLAF(java.awt.Font font)
        Construct a 'JLAF' instance using the given Font
        parameter and the default Application parameters...
        

Parameters:
font - Font Instance...

JLAF

public JLAF(java.awt.Font font,
            int borderControl)
        Construct a 'JLAF' instance using the given Font
        parameter and the default Application parameters...
        

Parameters:
font - Font Instance...
Method Detail

equals

public boolean equals(java.lang.Object obj)
        This method overrides the Java 'java.lang.Object.equals' Method so that the
        individual parameters are compared as required by the 'jFormTK' Kernel

Overrides:
equals in class java.lang.Object
See Also:
Kernel Usage: 1) Not used directly by the 'jFormTK' Kernel at this time...

getBackground

public java.awt.Color getBackground(JFormForm form)
        This methods returns a non-null Color as follows:
 
        IF the JLAF.Background Color is not Null,
        THEN it is returned
        ELSE
                IF the given Form's [form] Show Panel Exist
                THEN the Non-Null Show Panel Background is returned...
                ELSE the Color.lightGray Color is returned...
        

Returns:
background JLAF.java Parameter[Color]...

getForeground

public java.awt.Color getForeground(JFormForm form)
        This methods returns a non-null Color as follows:
 
        IF the JLAF.Foreground Color is not Null,
        THEN it is returned
        ELSE
                IF the given Form's [form] Show Panel Exist
                THEN the Non-Null Show Panel Foreground is returned...
                ELSE the Color.lightGray Color is returned...
        

Returns:
'foreground' JLAF.java Parameter[Color]...

getLAFString

public java.lang.String getLAFString()
Construct a String to annotate the current JLAF parameters...

Returns:
Constructed JLAF String...

set

public void set(java.awt.Color background,
                java.awt.Color foreground)
Set the '*this*.JLAF' Color parameters... NOTE: Font, BorderControl and LineBorderColor are set to the JFormTKDB default...

Parameters:
background - JLAF.Background [Color]
foreground - JLAF.Foreground [Color]

set

public void set(java.awt.Color background,
                java.awt.Color foreground,
                java.awt.Font font)
Set the '*this*.JLAF' Color, and Font parameters... NOTE: BorderControl and LineBorderColor are set to the JFormTKDB default...

Parameters:
background - JLAF.Background [Color]
foreground - JLAF.Foreground [Color]
font - JLAF.Font [Font]

set

public void set(java.awt.Color background,
                java.awt.Color foreground,
                java.awt.Font font,
                int borderControl)
Set the '*this*.JLAF' Color, Font and BorderControl parameters... NOTE: LineBorderColor is set to the JFormTKDB default...

Parameters:
background - JLAF.Background [Color]
foreground - JLAF.Foreground [Color]
font - JLAF.Font [Font]
borderControl - JLAF.BorderControl [int]

set

public void set(java.awt.Color background,
                java.awt.Color foreground,
                java.awt.Font font,
                int borderControl,
                java.awt.Color lineBorderColor)
Set the '*this*.JLAF' FULL parameters...

Parameters:
background - JLAF.Background [Color]
foreground - JLAF.Foreground [Color]
font - JLAF.Font [Font]
borderControl - JLAF.BorderControl [int]
lineBorderColor - JLAF.LineBorderColor [Color]

set

public void set(JLAF laf)
Set the '*this*.JLAF' parameters from a given JLAF [laf] instance...

Parameters:
laf - JLAF instance to be copied...

set

public void set(java.lang.String savedLAF)
Set the fields of *this* JLAF from the fields of the given 'JLAF' saved String [savedLAF]... If the given saved JLAF String does not have the 5 rereuired fields Then a 'softAbort' is presented to the 'jFormTK' Application Developer

Parameters:
savedLAF - Saved JLAF String

set

public void set(java.lang.String savedLAF,
                java.lang.String inID)
        Set the fields of *this* JLAF from  the fields of the given 'JLAF' saved
        String [savedLAF]...
        NOTE:
        If the given saved JLAF String does not have the 5 rereuired fields
        Then a 'softAbort' is presented to the 'jFormTK' Application Developer

Parameters:
savedLAF - Saved JLAF String
inID - 'JFormField' ID for DEBUG 'softAbort' Annotation...

setFontControls

public void setFontControls()
        Set the 'this.Bold', 'this.Italic' and 'this.Underline' Controls each time
        the 'this.Font' parameter is set OR re-set. This method is called internally
        when setting the Font's in constructors and in the FULL 'set' Method...
 
        Kernel Usage:
        1)      'JFormField.setFont' Method to set the JLAF Font parameter of the JLAF
        hosted by the '*this*.'JFormField'...
        2)      Throughout this class to set the Font accordingly...
        3)      'JFormField.setFont' Method [NOT CURRENTLY IN USE]...
        


setObjectJLAF

public void setObjectJLAF(java.awt.Component c)
        Set the Look And Feel controls from 'this.JLAF' instance on the given Container[c]...

        Kernel Usage:
        1)      'JFormField.lafLabel' Method to set LAF for a JLabel...
        2)      'JFormField.lafLabel' Method to set LAF for a 'fieldLabel'...
        3)      'JFormField.lafSet' Methods...
        4)      'JFormTKDB.CollectionTable.ButtonRenderer' Method to render a JLAF Instance
                Button for the 'JFormTKDB' Collections Table display...
        

Parameters:
c - Component to apply the 'this.JLAF' parameters to...

setObjectJLAF

public void setObjectJLAF(java.awt.Component c,
                          boolean fBorder,
                          java.lang.String from)
        Set the Look And Feel controls from 'this.JLAF' instance on the given Container[c]...

        Kernel Usage:
        1)      'JFormField.lafLabel' Method to set LAF for a JLabel...
        2)      'JFormField.lafLabel' Method to set LAF for a 'fieldLabel'...
        3)      'JFormField.lafSet' Methods...
        4)      'JFormTKDB.CollectionTable.ButtonRenderer' Method to render a JLAF Instance
                Button for the 'JFormTKDB' Collections Table display...
        

Parameters:
c - Component to apply the 'this.JLAF' parameters to...
fBorder - Flag [boolean] to control the Border setting...

setObjectJLAF

public void setObjectJLAF(java.awt.Component c,
                          javax.swing.border.Border border)

showJLAF

public void showJLAF(java.lang.Object parent)
Display the '*this*.JLAF' in a 'jFormTK' Kernel Dialog window showing the Fields and displays a JButton with the JLAF parameters applied... Kernel Usage: 1) Used for 'jFormTK' DEBUG...

Parameters:
parent - Parent Object...

showJLAF

public void showJLAF(java.lang.Object parent,
                     char displayType)
        Display the '*this*.JLAF' in a 'jFormTK' Kernel Dialog window iff the parent
        Object is a 'JFormField' and a the 'JFormField.type' parameter matches the given
        Dispay Type char. Showing the Fields and displays a JButton with the JLAF parameters 
        applied.
 
        Note:
        If the given 'JFormField' Display Type is = ' '
        Then ALL 'JFormField.type' types shall be displayed...

        Kernel Usage:
        1)      Used for 'jFormTK' DEBUG...
        

Parameters:
parent - Parent Object...
displayType - 'JFormField.type' char to deisplay...

showJLAF

public void showJLAF(java.lang.String name)

        Display the '*this*.JLAF' in a 'jFormTK' Kernel  Dialog window showing the
        Fields and displays a JButton with the JLAF parameters applied. This signature
        does not require a 'parent' object and a given Name [name] shall be used to
        annotate the specific JLAF Name...

        Kernel Usage:
        1)      Used for 'jFormTK' DEBUG...
        

Parameters:
name - Name to identify the specific JLAF being displayed...

toString

public java.lang.String toString()
        Convert the *this*.JLAF parameters to a Saved JLAF String. This String is then
        used to re-load the JLAF.

        Kernel Usage:
        1)      Used by the 'jFormTK' Kernel whenever the state of a JLAF instanc must be
                reset when the 'jFormTK' Application is re-loaded, e.g. 'JFormField.toString'
                Method to construct the Save String for it's JLAF instance...
        

Overrides:
toString in class java.lang.Object
Returns:
Saved JLAF String

toStringArray

public java.lang.String[] toStringArray()
        Convert the *this*.JLAF parameters to a String Array...
 
        Kernel Usage:
        1)      Not directly used by the 'jFormTK' currently...