|
SilverStream Application Server 3.5 |
||||||||
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 | +--javax.swing.JPanel | +--com.sssw.rt.atlas.AtPanel | +--com.sssw.rt.form.PvBasePanel | +--com.sssw.rt.jform.AgcJIntegerSpinnerField
A lightweight component that displays an integer in an input field. The field also has spinner buttons. The user can click the buttons to increment or decrement the value by the specified increment amount. You can allow the user to edit the value directly. AgcJIntegerSpinnerField can be bound to a database column.
There are methods for selecting or getting the integer value or individual characters from the input field. These include:
AgcJIntegerSpinnerField.getText()
AgcJIntegerSpinnerField.getSelectedText()
AgcJIntegerSpinnerField.getIntegerValue()
AgcJIntegerSpinnerField.getValue()
Other methods let you change the spinner increment value and the maximum and minimum values for the field. These include:
AgcJIntegerSpinnerField.setIncrement(int)
AgcJIntegerSpinnerField.setMinValue(int)
AgcJIntegerSpinnerField.setMaxValue(int)
AgcJIntegerSpinnerField is not associated with a data model.
Inner classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Field Summary | |
static int |
NO_LIMIT
Used to remove a limit on the allowed values. |
Fields inherited from class com.sssw.rt.atlas.AtPanel |
BGIMAGE_DRAW_CENTERED,
BGIMAGE_DRAW_NORMAL,
BGIMAGE_DRAW_STRETCH,
BGIMAGE_DRAW_TILED |
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 |
Constructor Summary | |
AgcJIntegerSpinnerField()
Creates an integer spinner field. |
Method Summary | |
String |
getDisplayPattern()
Gets the pattern that the control uses to parse input and format the numeric value. |
int |
getDisplayStyle()
Gets the display style that the control uses to parse input and format the numeric value. |
int |
getIncrement()
Gets the value that is added or subtracted from the field value when the user clicks a spinner button. |
Integer |
getIntegerValue()
Gets the field value as an Integer object. |
int |
getMaxValue()
Gets the maximum value that the user is allowed to enter. |
int |
getMinValue()
Gets the minimum value that the user is allowed to enter. |
String |
getSelectedText()
Gets the text that is selected in the input field. |
int |
getSelectionEnd()
Gets the caret position of the end of selected text. |
int |
getSelectionStart()
Gets the caret position of the start of selected text, where 0 is the position before the first character. |
String |
getText()
Gets the text displayed in the input field. |
int |
getValue()
Gets the field value as a primitive int. |
boolean |
isEditable()
Finds out whether the user can type a value in the input field. |
void |
select(int start,
int end)
Selects a range of characters in the input field. |
void |
selectAll()
Selects all the characters in the input field. |
void |
setDisplayPattern(String pattern)
Sets the pattern that the control uses to parse input and format the numeric value. |
void |
setDisplayStyle(int style)
Sets the display style assigned to the control. |
void |
setEditable(boolean b)
Specifies whether the user can type a value in the input field. |
void |
setIncrement(int increment)
Sets the value that is added or subtracted from the field value when the user clicks a spinner button. |
void |
setIntegerValue(Integer value)
Sets the field value with an Integer object. |
void |
setMaxValue(int value)
Sets the maximum value that the user is allowed to enter. |
void |
setMinValue(int value)
Sets the minimum value that the user is allowed to enter. |
void |
setText(String value)
Sets the text displayed in the input field. |
void |
setValue(int value)
Sets the field value. |
Methods inherited from class com.sssw.rt.form.PvBasePanel |
getBackgroundColor,
getFontIdentifier,
setBackgroundColor,
setFontIdentifier |
Methods inherited from class com.sssw.rt.atlas.AtPanel |
addImpl,
addNotify,
clientPaint,
clientPaint,
deliverMouseEvent,
deliverMouseMoveEvent,
doAtCommand,
drawTiledImage,
enableAtCommands,
getBackgroundImage,
getBackgroundImageMode,
getHelper,
getTransparent,
hide,
hideToolTip,
imageUpdate,
isFocusTraversable,
isOptimizedDrawingEnabled,
ownedImage,
paintBorder,
paintComponent,
paintImmediately,
paintImmediately,
paintNow,
preprocessKeyEvent,
processEvent,
reshape,
setBackgroundImage,
setBackgroundImageMode,
setTransparent,
show,
showToolTip |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
processContainerEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Methods implemented from interface java.awt.event.ActionListener |
actionPerformed |
Methods implemented from interface com.sssw.rt.form.AgiControl |
getComponent,
getHelpInfo,
setHelpInfo |
Methods implemented from interface java.awt.event.FocusListener |
focusGained,
focusLost |
Methods implemented from interface java.awt.event.KeyListener |
keyPressed,
keyReleased,
keyTyped |
Methods implemented from interface java.awt.event.MouseListener |
mouseClicked,
mouseEntered,
mouseExited,
mousePressed,
mouseReleased |
Methods implemented from interface java.awt.event.MouseMotionListener |
mouseDragged,
mouseMoved |
Methods implemented from interface java.beans.PropertyChangeListener |
propertyChange |
Field Detail |
public static final int NO_LIMIT
Constructor Detail |
public AgcJIntegerSpinnerField()
Method Detail |
public void setIncrement(int increment)
increment
- the int to be used to increment or decrement the field
valueAgcJIntegerSpinnerField.getIncrement()
public int getIncrement()
AgcJIntegerSpinnerField.setIncrement(int)
public boolean isEditable()
AgcJIntegerSpinnerField.setEditable(boolean)
public void setEditable(boolean b)
b
- a boolean value where:
AgcJIntegerSpinnerField.isEditable()
public void select(int start, int end)
start
- an int specifying caret position of the start of the
selection, where 0 is the position before the first character in the fieldend
- an int specifying the caret position of the end of
the selectionIf the display format adds characters to the displayed number, such as commas, they are counted in determining how many characters to select.
fldSpinner.select(1, 5);
AgcJIntegerSpinnerField.selectAll()
public void selectAll()
AgcJIntegerSpinnerField.select(int, int)
public int getSelectionStart()
AgcJIntegerSpinnerField.getSelectionEnd()
,
AgcJIntegerSpinnerField.getSelectedText()
,
AgcJIntegerSpinnerField.getText()
public int getSelectionEnd()
AgcJIntegerSpinnerField.getSelectionStart()
,
AgcJIntegerSpinnerField.getSelectedText()
,
AgcJIntegerSpinnerField.getText()
public String getSelectedText()
String s = "Start, end, and selected text: " + fldSpinner.getSelectionStart() + " " + fldSpinner.getSelectionEnd() + " " + fldSpinner.getSelectedText();
AgcJIntegerSpinnerField.getSelectionStart()
,
AgcJIntegerSpinnerField.getSelectionEnd()
public String getText()
AgcJIntegerSpinnerField.setText(String)
,
AgcJIntegerSpinnerField.getSelectedText()
public void setText(String value)
value
- a String whose value is the integer to be displayedAgcJIntegerSpinnerField.getText()
public String getDisplayPattern()
For information on display patterns and styles, see Formatting Patterns and Styles in the online General Reference.
AgcJIntegerSpinnerField.setDisplayPattern(String)
,
AgcJIntegerSpinnerField.getDisplayStyle()
,
AgcJIntegerSpinnerField.setDisplayStyle(int)
public void setDisplayPattern(String pattern)
pattern
- a String specifying a format for the numeric dataIf the control has both a display pattern and a display style, the display pattern is used. If neither are specified, a default pattern is used. When you change the display pattern, it doesn't take effect until the value in the control changes.
For information on display patterns and styles, see Formatting Patterns and Styles in the online General Reference.
String pattern = "###,###"; fldSpinner.setDisplayPattern(pattern);
AgcJIntegerSpinnerField.getDisplayPattern()
,
AgcJIntegerSpinnerField.getDisplayStyle()
,
AgcJIntegerSpinnerField.setDisplayStyle(int)
public int getDisplayStyle()
if (fldSpinner.getDisplayStyle() == AgFormat.PERCENTSTYLE) {...}
AgcJIntegerSpinnerField.getDisplayPattern()
,
AgcJIntegerSpinnerField.setDisplayPattern(String)
,
AgcJIntegerSpinnerField.setDisplayStyle(int)
public void setDisplayStyle(int style)
style
- an int identifying a predefined display
style. Specify null to use the default pattern.Typical numeric display styles are percent, number, and currency. For information on display patterns and styles, see Formatting Patterns and Styles in the online General Reference.
A note about the numeric style PERCENTSTYLE: "63%" represents a value of .63, not 63. So this style makes little sense for integer fields (it could only display 100%, 200%, etc).
fldSpinner.setDisplayPattern( null ); fldSpinner.setDisplayStyle( AgFormat.PERCENTSTYLE );
AgcJIntegerSpinnerField.getDisplayPattern()
,
AgcJIntegerSpinnerField.setDisplayPattern(String)
,
AgcJIntegerSpinnerField.getDisplayStyle()
public int getValue()
AgcJIntegerSpinnerField.setValue(int)
public void setValue(int value)
value
- an int specifying the value to be displayed in the fieldfldSpinner.setValue( 55 );
AgcJIntegerSpinnerField.getValue()
,
AgcJIntegerSpinnerField.setIntegerValue(Integer)
,
AgcJIntegerSpinnerField.setText(String)
public Integer getIntegerValue()
if (fldSpinner.getIntegerValue() == null) { ... }
AgcJIntegerSpinnerField.setIntegerValue(Integer)
public void setIntegerValue(Integer value)
value
- an Integer object specifying the value to be displayed in the fieldAgcJIntegerSpinnerField.getIntegerValue()
,
AgcJIntegerSpinnerField.setValue(int)
,
AgcJIntegerSpinnerField.setText(String)
public int getMaxValue()
AgcJIntegerSpinnerField.setMaxValue(int)
public int getMinValue()
AgcJIntegerSpinnerField.setMinValue(int)
public void setMaxValue(int value)
value
- an int specifying the maximum input value. Use the constant
NO_LIMIT to disable the limit.AgcJIntegerSpinnerField.getMaxValue()
,
AgcJIntegerSpinnerField.setMinValue(int)
public void setMinValue(int value)
value
- an int specifying the minimum input value. Use the constant
NO_LIMIT to disable the limit.AgcJIntegerSpinnerField.getMinValue()
,
AgcJIntegerSpinnerField.setMaxValue(int)
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |