|
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.form.AgcIntegerSpinnerField
The AgcIntegerSpinnerField control (Integer Spinner) represents an integer whose value the user can increment or decrement. The value can optionally be limited to a certain range.
This class fires a valueChanging event each time the control's value changes and the user is still interacting with the control. For example, if the user clicks and holds down one of the arrow buttons, the value of the control changes continually, and the control fires a valueChanging event after every change. When the user releases the spinner's arrow button, the control fires a valueChanged event.
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
This value represents no maximum or no minimum limit. |
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 | |
AgcIntegerSpinnerField()
|
Method Summary | |
void |
addAgiValueChangingListener(AgiValueChangingListener listener)
|
Color |
getBackgroundColor()
Returns the Color object associated with the control's background. |
String |
getDisplayPattern()
Returns a String that identifies the pattern that the control uses to display the data. |
int |
getDisplayStyle()
Obtains the control's display style. |
boolean |
getEditable()
Returns a boolean that indicates whether or not the user can edit the control's text. |
Color |
getForeground()
A Java method that returns the Color object associated with the control's foreground. |
int |
getIncrement()
Returns an integer that specifies the amount by which the AgcIntegerSpinnerField is incremented (or decremented) when the user presses one of the control's buttons. |
Integer |
getIntegerValue()
|
int |
getMaxValue()
Returns an integer that represents the highest value that the control can be set to. |
int |
getMinValue()
Returns an integer that represents the lowest value that the control can be set to. |
String |
getSelectedText()
Returns a String containing the current selection. |
int |
getSelectionEnd()
Returns an integer that represents the end of the user's selection in the control. |
int |
getSelectionStart()
Returns an integer that represents the beginning of the user's selection in the control. |
String |
getText()
Returns a String that contains the control's text. |
Color |
getTextColor()
Deprecated. replaced by AgcIntegerSpinnerField.getForeground() . |
int |
getValue()
Get the field value as a primitive integer. |
void |
removeAgiValueChangingListener(AgiValueChangingListener listener)
|
void |
select(int start,
int end)
Selects text within the edit control portion of the spinner. |
void |
selectAll()
Selects everything. |
void |
setBackgroundColor(Color backgroundcolor)
Assigns the control's background Color. |
void |
setDisplayPattern(String pattern)
Assigns the control's display format. |
void |
setDisplayStyle(int style)
Assigns the control's display style. |
void |
setEditable(boolean b)
Assigns a boolean value that determines whether the user can edit the control. |
void |
setIncrement(int increment)
Assigns an integer value by which the AgcIntegerSpinnerField is incremented (or decremented) each time the user presses the spin button or one of the arrow keys. |
void |
setIntegerValue(Integer value)
|
void |
setMaxValue(int value)
Assigns the highest int value that the control can be set to. |
void |
setMinValue(int value)
Assigns the lowest int value that the control can be set to. |
void |
setText(String value)
Assigns the control's text. |
void |
setTextColor(Color color)
Deprecated. use Component.setForeground(Color) to assign an instance of java.awt.Color to
the control's text. |
void |
setValue(int value)
Assigns the control's value. |
Methods inherited from class com.sssw.rt.form.PvBasePanel |
getFontIdentifier,
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 com.sssw.rt.form.AgiControl |
getComponent,
getHelpInfo,
setHelpInfo |
Methods implemented from interface com.sssw.rt.util.AgiTabstopHandler |
getTabOrder |
Methods implemented from interface com.sssw.rt.event.AgiValueChangingListener |
valueChanging |
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 |
Methods implemented from interface java.awt.event.TextListener |
textValueChanged |
Field Detail |
public static final int NO_LIMIT
AgcIntegerSpinnerField.setMaxValue(int)
,
AgcIntegerSpinnerField.setMinValue(int)
Constructor Detail |
public AgcIntegerSpinnerField()
Method Detail |
public void setIncrement(int increment)
increment
- specifies the amount by which the control is incremented (or decremented) when
the user presses the spin button or one of the arrow keys.Use the getIncrement() method to retrieve this value at runtime.
The following example illustrates how to set the increment value to 3.
ControlName1.setIncrement(3);
AgcIntegerSpinnerField.getIncrement()
public int getIncrement()
Use the setIncrement() method to assign this value at runtime.
The following example illustrates how to obtain the current increment value.
int increment; increment = ControlName1.getIncrement();
AgcIntegerSpinnerField.setIncrement(int)
public void addAgiValueChangingListener(AgiValueChangingListener listener)
listener
- public void removeAgiValueChangingListener(AgiValueChangingListener listener)
listener
- public boolean getEditable()
When getEditable returns true, the user can edit the text. If the control is enabled but not editable, the user cannot change the value of the text, but can select, copy, and scroll the text.
The following code fragment illustrates how to use the getEditable() method.
boolean editable; editable = ControlName1.getEditable();
AgcIntegerSpinnerField.setEditable(boolean)
public void setEditable(boolean b)
b
- specifies whether the control is editable.Specifies whether the text field portion of the spinner is editable. When the value is true, the user can edit the control.
The following code fragment illustrates how to make a control editable.
ControlName1.setEditable(true);
AgcIntegerSpinnerField.getEditable()
public Color getTextColor()
AgcIntegerSpinnerField.getForeground()
.
The following code fragment illustrates how to use the getTextColor() method.
Color c; c = ControlName1.getTextColor();
AgcIntegerSpinnerField.setTextColor(Color)
public Color getForeground()
This example illustrates how to obtain the foreground Color of a control.
Color bgColor; bgColor = ControlName1.getForeground();
Component.setForeground(Color)
public void setTextColor(Color color)
Component.setForeground(Color)
to assign an instance of java.awt.Color to
the control's text.
color
- Component.setForeground(Color)
,
AgcIntegerSpinnerField.getTextColor()
public Color getBackgroundColor()
Component.getBackground()
.
Component.getBackground()
public void setBackgroundColor(Color backgroundcolor)
Component.setBackground(Color)
.
Component.setBackground(Color)
public void select(int start, int end)
start
- specifies the start of the text selection.end
- specifies the end of the text selection.The select() method can be useful to require a user to replace some invalid text.
AgcIntegerSpinnerField.selectAll()
,
JComponent.requestFocus()
,
AgcIntegerSpinnerField.getSelectionStart()
,
AgcIntegerSpinnerField.getSelectionEnd()
public void selectAll()
The following code fragment illustrates how to use the selectAll() method.
ControlName1.selectAll();
AgcIntegerSpinnerField.select(int,int)
public int getSelectionStart()
Returns the starting character index of the current selection.
The following code fragment illustrates how to obtain the start of the currently selected text.
int start; start = ControlName1.getSelectionStart();
AgcIntegerSpinnerField.getSelectionEnd()
,
AgcIntegerSpinnerField.select(int,int)
public int getSelectionEnd()
Returns the ending character index of the current selection.
The following code fragment illustrates how to obtain the end of the currently selected text.
int end; end = ControlName1.getSelectionEnd();
AgcIntegerSpinnerField.getSelectionStart()
,
AgcIntegerSpinnerField.select(int,int)
public String getSelectedText()
The getSelectedText() method affects the textbox portion of the control only. For drop-down or combobox style controls, it does not affect the listbox portion.
The following code fragment illustrates how to obtain the currently selected text.
String s; s = ControlName1.getSelectedText();
AgcIntegerSpinnerField.getSelectionStart()
,
AgcIntegerSpinnerField.getSelectionEnd()
public String getText()
The following code fragment illustrates how to call getText().
String s; s = ControlName1.getText();
AgcIntegerSpinnerField.setText(String)
public void setText(String value)
value
- specifies the text to assign to the control.For the AgcChoice and AgcComboBox controls, this method programmatically assigns the selected row, but does not update or modify the text. Use getText() to obtain the control's text at runtime.
The following code fragment illustrates how to use the setText() method.
ControlName1.setText("Add");
AgcIntegerSpinnerField.getText()
public String getDisplayPattern()
Note that a display pattern overrides a display style. If the display pattern is null, then the display style is used.
String pattern; pattern = ControlName1.getDisplayPattern();
AgcIntegerSpinnerField.setDisplayPattern(String)
,
AgcIntegerSpinnerField.getDisplayStyle()
,
AgcIntegerSpinnerField.setDisplayStyle(int)
public void setDisplayPattern(String pattern)
pattern
- specifies the pattern.DecimalFormat
.
For Time, Date and Timestamp fields, see also SimpleDateFormat
.
Note that a display pattern overrides a display style. If the display pattern is null, then the display style is used.
ControlName1.setDisplayPattern("$#,##0.00;($#,##0.00)");
AgcIntegerSpinnerField.getDisplayPattern()
,
AgcIntegerSpinnerField.setDisplayStyle(int)
public int getDisplayStyle()
Note that a display pattern overrides a display style. If the display pattern is null, then the display style is used.
int style; style = ControlName1.getDisplayStyle();
AgcIntegerSpinnerField.setDisplayStyle(int)
,
AgcIntegerSpinnerField.getDisplayPattern()
public void setDisplayStyle(int style)
style
- specifies a Style constant.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).
Note that a display pattern overrides a display style. If the display pattern is null, then the display style is used.
ControlName1.setDisplayStyle(AgFormat.CURRENCYSTYLE);
AgcIntegerSpinnerField.getDisplayStyle()
,
AgcIntegerSpinnerField.setDisplayPattern(String)
public int getValue()
int value; value = ControlName1.getValue();
AgcIntegerSpinnerField.setValue(int)
public void setValue(int value)
value
- specifies the value to assign to the control.The following code fragment illustrates how to set the current value of an Integer Spinner field to four.
ControlName1.setValue(4);
AgcIntegerSpinnerField.getValue()
public Integer getIntegerValue()
public void setIntegerValue(Integer value)
public int getMaxValue()
Use the setMaxValue() method to assign this value.
The following code fragment illustrates how to obtain the maximum value.
int MaxValue; MaxValue = ControlName1.getMaxValue();
AgcIntegerSpinnerField.getMinValue()
,
AgcIntegerSpinnerField.setMaxValue(int)
,
AgcIntegerSpinnerField.setMinValue(int)
public int getMinValue()
Use the setMinValue() method to assign this value.
The following code fragment illustrates how to obtain the minimum value.
int MinValue; MinValue = ControlName1.getMinValue();
AgcIntegerSpinnerField.getMaxValue()
,
AgcIntegerSpinnerField.setMinValue(int)
,
AgcIntegerSpinnerField.setMaxValue(int)
public void setMaxValue(int value)
value
- specifies the control's maximum value.
If the user tries to enter a larger value, a ValidationFailed event is fired.
Use the constant AgcIntegerSpinnerField.NO_LIMIT
to disable the limit.
The following code fragment illustrates how to assign a maximum value to the Integer Spinner control.
ControlName1.setMaxValue(5);
AgcIntegerSpinnerField.NO_LIMIT
,
AgcIntegerSpinnerField.getMaxValue()
,
AgcIntegerSpinnerField.setMinValue(int)
public void setMinValue(int value)
value
- an integer that represents the lowest value that the control can be set to.
If the user tries to enter a lower value, a ValidationFailed event is fired.
Use the constant AgcIntegerSpinnerField.NO_LIMIT
to disable the limit.
The following code fragment illustrates how to assign a minimum value to an Integer Spinner control (AgcIntegerSpinnerField).
ControlName1.setMinValue(5);
AgcIntegerSpinnerField.NO_LIMIT
,
AgcIntegerSpinnerField.getMaxValue()
,
AgcIntegerSpinnerField.setMaxValue(int)
,
AgcIntegerSpinnerField.getMinValue()
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |