JClass 4.5.0 API
Documentation

com.klg.jclass.field
Class JCInvalidInfo

java.lang.Object
  |
  +--com.klg.jclass.field.JCInvalidInfo

public class JCInvalidInfo
extends Object

This class creates an object which holds the invalid info properties.


Field Summary
protected  boolean beepOnInvalid
           
static int CLEAR_FIELD
          Use with invalidPolicy to clear the field after invalid entry.
protected  Color invalidBackground
           
protected  Color invalidForeground
           
protected  int invalidPolicy
           
static int RESTORE_DEFAULT
          Use with invalidPolicy to restore default value after invalid entry.
static int RESTORE_PREVIOUS
          Use with invalidPolicy to restore previous value after invalid entry.
static int SHOW_INVALID
          Use with invalidPolicy to display invalid values.
 
Constructor Summary
JCInvalidInfo()
          Creates a default instance where beepOnInvalid == true, policy == SHOW_INVALID, and the rest of the values are null.
JCInvalidInfo(boolean beep_on_invalid, int invalid_policy)
          Creates an instance where beepOnInvalid and invalidPolicy are set as specified and the rest of the values are null.
JCInvalidInfo(boolean beep_on_invalid, int invalid_policy, Color invalid_foreground, Color invalid_background)
          Creates a InvalidInfo object with the specified defaultValue and with invalidPolicy == RESTORE_DEFAULT, beepOnInvalid == true, and the invalid colors are null.
JCInvalidInfo(Color invalid_foreground, Color invalid_background)
          Creates a InvalidInfo object with the specified invalid colors and with invalidPolicy == SHOW_INVALID, beepOnInvalid == true, and defaultValue == null.
JCInvalidInfo(int invalid_policy)
          Creates an instance where invalidPolicy is set as specified, beepOnInvalid == true and the rest of the values are null.
 
Method Summary
 boolean getBeepOnInvalid()
          Returns whether the component should beep or not when the user types an invalid entry.
 Color getInvalidBackground()
          Returns the background color to be used if the invalid policy is SHOW_INVALID.
 Color getInvalidForeground()
          Returns the foreground color to be used if the invalid policy is SHOW_INVALID.
 int getInvalidPolicy()
          Returns the invalid policy.
 void setBeepOnInvalid(boolean beep_on_invalid)
          Sets whether the component should beep or not when the user types an invalid entry.
 void setInvalidBackground(Color background)
          Sets the background color to be used if the invalid policy is SHOW_INVALID.
 void setInvalidForeground(Color foreground)
          Sets the foreground color to be used if the invalid policy is SHOW_INVALID.
 void setInvalidPolicy(int invalid_policy)
          Sets the invalid policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHOW_INVALID

public static final int SHOW_INVALID
Use with invalidPolicy to display invalid values.

RESTORE_DEFAULT

public static final int RESTORE_DEFAULT
Use with invalidPolicy to restore default value after invalid entry.

RESTORE_PREVIOUS

public static final int RESTORE_PREVIOUS
Use with invalidPolicy to restore previous value after invalid entry.

CLEAR_FIELD

public static final int CLEAR_FIELD
Use with invalidPolicy to clear the field after invalid entry.

beepOnInvalid

protected boolean beepOnInvalid

invalidPolicy

protected int invalidPolicy

invalidForeground

protected Color invalidForeground

invalidBackground

protected Color invalidBackground
Constructor Detail

JCInvalidInfo

public JCInvalidInfo()
Creates a default instance where beepOnInvalid == true, policy == SHOW_INVALID, and the rest of the values are null.

JCInvalidInfo

public JCInvalidInfo(boolean beep_on_invalid,
                     int invalid_policy)
Creates an instance where beepOnInvalid and invalidPolicy are set as specified and the rest of the values are null.

JCInvalidInfo

public JCInvalidInfo(int invalid_policy)
Creates an instance where invalidPolicy is set as specified, beepOnInvalid == true and the rest of the values are null.

JCInvalidInfo

public JCInvalidInfo(Color invalid_foreground,
                     Color invalid_background)
Creates a InvalidInfo object with the specified invalid colors and with invalidPolicy == SHOW_INVALID, beepOnInvalid == true, and defaultValue == null.

JCInvalidInfo

public JCInvalidInfo(boolean beep_on_invalid,
                     int invalid_policy,
                     Color invalid_foreground,
                     Color invalid_background)
Creates a InvalidInfo object with the specified defaultValue and with invalidPolicy == RESTORE_DEFAULT, beepOnInvalid == true, and the invalid colors are null.
Method Detail

getBeepOnInvalid

public boolean getBeepOnInvalid()
Returns whether the component should beep or not when the user types an invalid entry.

setBeepOnInvalid

public void setBeepOnInvalid(boolean beep_on_invalid)
Sets whether the component should beep or not when the user types an invalid entry.

getInvalidPolicy

public int getInvalidPolicy()
Returns the invalid policy. Valid values are:
SHOW_INVALID - display invalid entry (default)
RESTORE_DEFAULT - restore the default value on invalid entry
RESTORE_PREVIOUS - restore the previous valid entry on invalid entry
CLEAR_FIELD - clear the field

setInvalidPolicy

public void setInvalidPolicy(int invalid_policy)
Sets the invalid policy. Valid values are:
SHOW_INVALID - display invalid entry (default)
RESTORE_DEFAULT - restore the default value on invalid entry
RESTORE_PREVIOUS - restore the previous valid entry on invalid entry
CLEAR_FIELD - clear the field

getInvalidBackground

public Color getInvalidBackground()
Returns the background color to be used if the invalid policy is SHOW_INVALID. Null means use the normal background color.

setInvalidBackground

public void setInvalidBackground(Color background)
Sets the background color to be used if the invalid policy is SHOW_INVALID. Null means use the normal background color.

getInvalidForeground

public Color getInvalidForeground()
Returns the foreground color to be used if the invalid policy is SHOW_INVALID. Null means use the normal foreground color.

setInvalidForeground

public void setInvalidForeground(Color foreground)
Sets the foreground color to be used if the invalid policy is SHOW_INVALID. Null means use the normal foreground color.

Copyright© 1999-2000 KL Group Inc.
All rights reserved.