|
JClass 4.5.0 API Documentation |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--com.klg.jclass.util.swing.AbstractSpinBox | +--com.klg.jclass.field.JCSpinField
A spin field allows the user to spin through a range of values. The range of values shown in the spin field is determined by one of two mechanisms. The upper and lower limits on the range can be determined by predefining min and max values. The intermediate values are controlled by the increment property. A pick list offers all the possible values that the spin field can contain. This has precedence over the increment method. Only one value at a time is shown in the spin field. Up and down–arrow buttons are used to change the value by “spinning.” The spin field has access to the same validator functions as the text field.
Inner classes inherited from class com.klg.jclass.util.swing.AbstractSpinBox |
com.klg.jclass.util.swing.AbstractSpinBox.ArrowButton,
com.klg.jclass.util.swing.AbstractSpinBox.MetalArrowButton,
com.klg.jclass.util.swing.AbstractSpinBox.MetalBorder |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Field Summary | |
protected Field |
field
|
protected boolean |
required
|
protected JTextField |
text
|
static String |
version
Contains the version number of the JClass product. |
Fields inherited from class com.klg.jclass.util.swing.AbstractSpinBox |
arrowKeySpinningAllowed,
buttonTimer,
continuousScroll,
currentButton,
DECREMENT,
defaultPreferredSize,
downArrow,
editable,
editor,
editorIsValidateRoot,
INCREMENT,
l,
metalBorder,
NONE,
renderer,
renderPanel,
rl,
upArrow,
valueListeners,
valueModel |
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 |
Constructor Summary | |
JCSpinField()
Constructs a JCSpinField. |
|
JCSpinField(Class c)
Constructs an empty JCSpinField which expects an object of the specified class. |
|
JCSpinField(Class c,
JCValidator v)
Constructs an empty JCSpinField which expects an object of the specified class; which uses the specified validator. |
|
JCSpinField(com.klg.jclass.util.value.JCValueModel m)
Constructs an empty JCSpinField which uses the specified value model to contain its value. |
|
JCSpinField(com.klg.jclass.util.value.JCValueModel m,
JCValidator v)
Constructs an empty JCSpinField 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 for changes to the value. |
protected void |
checkArrowButtons()
|
void |
commitEdit()
Commits the current field under edit. |
protected void |
createField(JCValidator validator)
|
protected Object |
doSpin(boolean spin_up)
Performs spinning given the direction. |
String |
getAbout()
Gets the value of the About property. |
DataProperties |
getDataProperties()
Gets the Bean property which wraps the validator, data model, and Field objects properties into one property. |
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, INVALID, or UNDER_EDIT. |
JCValidator |
getValidator()
Returns the validator currently in use. |
Object |
getValue()
Returns the value for the text 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. |
protected int |
preferredHeightOfView()
Returns the text field's preferred height. |
protected void |
processFocusLost(FocusEvent e)
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. |
void |
removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
Removes a listener 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 spin field. |
void |
setDataProperties(DataProperties dp)
Sets the Bean property which wraps the validator, data model, and Field objects properties into one property. |
void |
setEditable(boolean aFlag)
Determines whether the JCSpinBox field is editable. |
void |
setForeground(Color foreground)
Sets the foreground of the spin field. |
void |
setInvalidInfo(JCInvalidInfo info)
Sets the Invalid properties. |
void |
setRequired(boolean required)
Sets the required property for the current field. |
void |
setSelectOnEnter(boolean select)
Sets a flag to determines whether or the value in the field is selected when the component gains focus. |
void |
setValidator(JCValidator v)
Sets the validator to use. |
void |
setValue(Object value)
Sets the value for the text field. |
void |
setValueModel(com.klg.jclass.util.value.JCValueModel model)
Sets the data model being used by the field. |
protected Object |
spinDown()
Returns the new value generated when spinning down a notch. |
protected Object |
spinUp()
Returns the new value generated when spinning up a notch. |
Methods inherited from class com.klg.jclass.util.swing.AbstractSpinBox |
compareToValue,
configureArrowButtons,
createDecrArrow,
createIncrArrow,
doBorder,
doFocusedLook,
doLayout,
doNonFocusedLook,
getDecrementArrow,
getEditor,
getIncrementArrow,
getPreferredSize,
getRenderer,
handleKeyPressed,
isArrowKeySpinningAllowed,
isContinuousScroll,
isEditable,
isEnabled,
isFocusTraversable,
paint,
preferredWidthOfView,
processValueChanged,
processValueChanging,
requestFocus,
setArrowEnabled,
setArrowKeySpinningAllowed,
setContinuousScroll,
setEditor,
setEnabled,
setLayout,
setRenderer,
setUI,
swapEditorRenderer,
updateUI |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected Field field
protected JTextField text
protected boolean required
public static final String version
Constructor Detail |
public JCSpinField()
public JCSpinField(Class c)
public JCSpinField(Class c, JCValidator v)
public JCSpinField(com.klg.jclass.util.value.JCValueModel m)
public JCSpinField(com.klg.jclass.util.value.JCValueModel m, JCValidator v)
Method Detail |
public DataProperties getDataProperties()
JCValidator
,
JCValueModel
,
JCInvalidInfo
public void setDataProperties(DataProperties dp)
JCValidator
,
JCValueModel
,
JCInvalidInfo
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener to be addedpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removedpublic void addValueListener(com.klg.jclass.util.value.JCValueListener listener)
public void removeValueListener(com.klg.jclass.util.value.JCValueListener listener)
protected void createField(JCValidator validator)
public String getAbout()
public void setAbout(String s)
protected int preferredHeightOfView()
public void setEditable(boolean aFlag)
JCSpinBox
field is editable. An editable JCSpinBox
allows the user to type into the field or select an item from the list
to initialize the field, after which it can be edited. (The editing affects
only the field, the list item remains intact.) A non editable JCSpinBox
displays the selected item in the field, but the selection cannot be
modified.aFlag
- a boolean value, where true indicates that the field is editablepublic void addNotify()
public void setBackground(Color background)
public void setForeground(Color foreground)
protected void checkArrowButtons()
protected Object doSpin(boolean spin_up)
spin_up
- true means to spin up and false means to spin downprotected Object spinUp()
protected Object spinDown()
protected void processFocusLost(FocusEvent e)
public Object getValue()
public void setValue(Object value)
public com.klg.jclass.util.value.JCValueModel getValueModel()
JCValueModel
public void setValueModel(com.klg.jclass.util.value.JCValueModel model)
JCValueModel
public JCValidator getValidator()
JCValidator
public void setValidator(JCValidator v)
JCValidator
public JCInvalidInfo getInvalidInfo()
public void setInvalidInfo(JCInvalidInfo info)
public int getState()
public boolean getSelectOnEnter()
setSelectOnEnter(boolean)
public void setSelectOnEnter(boolean select)
public void commitEdit()
public boolean isRequired()
public void setRequired(boolean required)
|
Copyright© 1999-2000 KL Group Inc. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |