JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.field
Class JCLabelField

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JLabel
                          |
                          +--com.klg.jclass.field.JCLabelField
All Implemented Interfaces:
Accessible, ImageObserver, JCFieldComponent, MenuContainer, Serializable, SwingConstants
Direct Known Subclasses:
DSdbLabelField, JBdbLabelField, JCLabelFieldCellRenderer

public class JCLabelField
extends JLabel
implements JCFieldComponent

JCLabelField has all the capability of JLabelField as well as the ability to validate its contents.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JLabel
JLabel.AccessibleJLabel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  com.klg.jclass.field.Field field
           
protected  boolean required
           
static String version
          Contains the version number of the JClass product.
 
Fields inherited from class javax.swing.JLabel
labelFor
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.klg.jclass.field.JCFieldComponent
INVALID, UNDEREDIT, VALID
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JCLabelField()
          Constructs an empty JCLabelField.
JCLabelField(Class c)
          Constructs an empty JCLabelField, which expects an object of the specified class.
JCLabelField(Class c, com.klg.jclass.field.validate.JCValidator v)
          Constructs an empty JCLabelField, which expects an object of the specified class and which uses the specified validator.
JCLabelField(com.klg.jclass.util.value.JCValueModel m)
          Constructs an empty JCLabelField, which uses the specified value model to contain its value.
JCLabelField(com.klg.jclass.util.value.JCValueModel m, com.klg.jclass.field.validate.JCValidator v)
          Constructs an empty JCLabelField, which uses the specified value model to contain its value and which uses the specified validator.
 
Method Summary
 void addNotify()
          Initializes the field object.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
 void addValueListener(com.klg.jclass.util.value.JCValueListener listener)
          Adds a listener to listen for changes to the value.
 void commitEdit()
          Not used for this component.
protected  void createField(com.klg.jclass.field.validate.JCValidator validator)
          Creates the field object which controls the validation.
 String getAbout()
          Gets the value of the About property.
 com.klg.jclass.field.DataProperties getDataProperties()
          Gets the Bean property which wraps the validator, data model, and Field objects properties into one property.
 com.klg.jclass.field.JCInvalidInfo getInvalidInfo()
          Returns the Invalid properties.
 boolean getSelectOnEnter()
          Returns a flag indicating the selection status on entering the field.
 int getState()
          Returns the state of the component: VALID or INVALID.
 com.klg.jclass.field.validate.JCValidator getValidator()
          Returns the validator currently in use.
 Object getValue()
          Returns the value for the label field.
 com.klg.jclass.util.value.JCValueModel getValueModel()
          Returns the data model being used by the field.
 boolean isRequired()
          Returns true if the field is required.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
          Removes a listener which listens for changes to the value.
 void setAbout(String s)
          Sets the value of the About property.
 void setBackground(Color background)
          Sets the background of the label field.
 void setDataProperties(com.klg.jclass.field.DataProperties dp)
          Sets the Bean property which wraps the validator, data model, and Field objects properties into one property.
 void setForeground(Color foreground)
          Sets the foreground of the label field.
 void setInvalidInfo(com.klg.jclass.field.JCInvalidInfo info)
          Sets the Invalid properties.
 void setLocale(Locale l)
          Sets the locale being used by the label field; sets it on the validator as well.
 void setRequired(boolean required)
          Sets the required property for the current field.
 void setSelectOnEnter(boolean select)
          Not used for this component.
 void setText(String text)
          Overriden: This method should never be called since it will bypass the validation and formatting.
 void setValidator(com.klg.jclass.field.validate.JCValidator validator)
          Sets the validator to use.
 void setValue(Object value)
          Sets the value for the label field.
 void setValueModel(com.klg.jclass.util.value.JCValueModel model)
          Sets the data model being used by the field.
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

field

protected com.klg.jclass.field.Field field

required

protected boolean required

version

public static final String version
Contains the version number of the JClass product.

Constructor Detail

JCLabelField

public JCLabelField()
Constructs an empty JCLabelField.


JCLabelField

public JCLabelField(Class c)
Constructs an empty JCLabelField, which expects an object of the specified class.

Parameters:
c -

JCLabelField

public JCLabelField(Class c,
                    com.klg.jclass.field.validate.JCValidator v)
Constructs an empty JCLabelField, which expects an object of the specified class and which uses the specified validator.

Parameters:
c -
v -

JCLabelField

public JCLabelField(com.klg.jclass.util.value.JCValueModel m)
Constructs an empty JCLabelField, which uses the specified value model to contain its value.

Parameters:
m -

JCLabelField

public JCLabelField(com.klg.jclass.util.value.JCValueModel m,
                    com.klg.jclass.field.validate.JCValidator v)
Constructs an empty JCLabelField, which uses the specified value model to contain its value and which uses the specified validator.

Parameters:
m -
v -
Method Detail

getDataProperties

public com.klg.jclass.field.DataProperties getDataProperties()
Gets the Bean property which wraps the validator, data model, and Field objects properties into one property.

Specified by:
getDataProperties in interface JCFieldComponent
Returns:
See Also:
JCValidator, JCValueModel, JCInvalidInfo

setDataProperties

public void setDataProperties(com.klg.jclass.field.DataProperties dp)
Sets the Bean property which wraps the validator, data model, and Field objects properties into one property.

Specified by:
setDataProperties in interface JCFieldComponent
Parameters:
dp -
See Also:
JCValidator, JCValueModel, JCInvalidInfo

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.

Overrides:
addPropertyChangeListener in class JComponent
Parameters:
listener - the PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Overrides:
removePropertyChangeListener in class JComponent
Parameters:
listener - the PropertyChangeListener to be removed

addValueListener

public void addValueListener(com.klg.jclass.util.value.JCValueListener listener)
Adds a listener to listen for changes to the value.

Specified by:
addValueListener in interface JCFieldComponent
Parameters:
listener -

removeValueListener

public void removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
Removes a listener which listens for changes to the value.

Specified by:
removeValueListener in interface JCFieldComponent
Parameters:
listener -

addNotify

public void addNotify()
Initializes the field object. This method should not need to be called.

Overrides:
addNotify in class JComponent

createField

protected void createField(com.klg.jclass.field.validate.JCValidator validator)
Creates the field object which controls the validation.

Parameters:
validator -

getAbout

public String getAbout()
Gets the value of the About property. The About property displays contact information for Quest Software in the Bean box.

Returns:

setAbout

public void setAbout(String s)
Sets the value of the About property. The About property displays contact information for Quest Software in the Bean box.

Parameters:
s -

setBackground

public void setBackground(Color background)
Sets the background of the label field.

Overrides:
setBackground in class JComponent
Parameters:
background -

setForeground

public void setForeground(Color foreground)
Sets the foreground of the label field.

Overrides:
setForeground in class JComponent
Parameters:
foreground -

getValue

public Object getValue()
Returns the value for the label field.

Specified by:
getValue in interface JCFieldComponent
Returns:
value for the label field

setValue

public void setValue(Object value)
Sets the value for the label field.

Specified by:
setValue in interface JCFieldComponent
Parameters:
value -

getValueModel

public com.klg.jclass.util.value.JCValueModel getValueModel()
Returns the data model being used by the field.

Specified by:
getValueModel in interface JCFieldComponent
Returns:
data model being used by the field
See Also:
JCValueModel

setValueModel

public void setValueModel(com.klg.jclass.util.value.JCValueModel model)
Sets the data model being used by the field.

Specified by:
setValueModel in interface JCFieldComponent
Parameters:
model -
See Also:
JCValueModel

getValidator

public com.klg.jclass.field.validate.JCValidator getValidator()
Returns the validator currently in use.

Specified by:
getValidator in interface JCFieldComponent
Returns:
validator currently in use
See Also:
JCValidator

setValidator

public void setValidator(com.klg.jclass.field.validate.JCValidator validator)
Sets the validator to use.

Specified by:
setValidator in interface JCFieldComponent
Parameters:
validator -
See Also:
JCValidator

getInvalidInfo

public com.klg.jclass.field.JCInvalidInfo getInvalidInfo()
Returns the Invalid properties. The Invalid properties are beepOnInvalid, invalidForeground, invalidBackground, defaultValue, and invalidPolicy.

Specified by:
getInvalidInfo in interface JCFieldComponent
Returns:
the Invalid properties

setInvalidInfo

public void setInvalidInfo(com.klg.jclass.field.JCInvalidInfo info)
Sets the Invalid properties. The Invalid properties are beepOnInvalid, invalidForeground, invalidBackground, defaultValue, and invalidPolicy.

Specified by:
setInvalidInfo in interface JCFieldComponent
Parameters:
info -

getState

public int getState()
Returns the state of the component: VALID or INVALID.

Specified by:
getState in interface JCFieldComponent
Returns:
VALID or INVALID

getSelectOnEnter

public boolean getSelectOnEnter()
Returns a flag indicating the selection status on entering the field.

Specified by:
getSelectOnEnter in interface JCFieldComponent
Returns:
a flag indicating the selection status on entering the field
See Also:
setSelectOnEnter(boolean)

setSelectOnEnter

public void setSelectOnEnter(boolean select)
Not used for this component.

Specified by:
setSelectOnEnter in interface JCFieldComponent
Parameters:
select -

commitEdit

public void commitEdit()
Not used for this component.

Specified by:
commitEdit in interface JCFieldComponent

isRequired

public boolean isRequired()
Returns true if the field is required.

Specified by:
isRequired in interface JCFieldComponent
Returns:
true if the field is required

setRequired

public void setRequired(boolean required)
Sets the required property for the current field.

Specified by:
setRequired in interface JCFieldComponent
Parameters:
required -

setText

public void setText(String text)
Overriden: This method should never be called since it will bypass the validation and formatting. Use the setValue method instead.

Overrides:
setText in class JLabel
Parameters:
text -
See Also:
setValue(java.lang.Object)

setLocale

public void setLocale(Locale l)
Sets the locale being used by the label field; sets it on the validator as well.

Overrides:
setLocale in class Component
Parameters:
l - the new locale to be used

Copyright © 2004 Quest Software Inc..
All rights reserved.