SilverStream
Application Server 3.5

com.sssw.rt.tview
Class AgoColumnIntegerSpinnerField

java.lang.Object
 |
 +--com.sssw.rt.tview.AgoColumnBase
       |
       +--com.sssw.rt.tview.AgoColumnIntegerSpinnerField

public class AgoColumnIntegerSpinnerField
extends AgoColumnBase

AgoColumnIntegerSpinnerField is a bound column that represents an integer whose value the user can increment or decrement. The value can optionally be limited to a certain range.


Constructor Summary
AgoColumnIntegerSpinnerField(int width, boolean visible, boolean transparent, Color backgroundColor, int borderType)
           
 
Method Summary
 boolean getEditWhenSelected()
          Returns the state of the edit when selected property.
 int getIncrement()
          Returns an integer value that specifies the amount by which the spinner is incremented (or decremented) when the user presses one of the control's arrow keys.
 int getMaximumValue()
          Returns an integer that represents the highest value to which the control can be set.
 int getMinimumValue()
          Returns an integer that represents the lowest value to which the control can be set.
 void initColumnSpinnerProperty(String propertyName, AgoFontIdentifier fontid, Color textColor, int alignment)
          Initializes a number of parameters for the control
 void setEditWhenSelected(boolean editWhenSelected)
          Sets the state of the edit when selected property.
 void setIncrement(int increment)
          Assigns an integer value by which the spinner is incremented (or decremented) each time the user presses one of the control's arrow keys.
 void setMaximumValue(int maximumValue)
          Assigns the highest integer value to which the control can be set.
 void setMinimumValue(int minimumValue)
          Assigns the lowest integer value to which the control can be set.
 
Methods inherited from class com.sssw.rt.tview.AgoColumnBase
getAlignment, getBackgroundColor, getBorderType, getDisplayWidth, getHidden, getResizable, getSelectable, getTransparent, getVisible, getWidth, isWidthFixed, setAlignment, setBackgroundColor, setBorderType, setFixedWidth, setHidden, setProportionalWidth, setProportionalWidth, setResizable, setSelectable, setTransparent, setVisible, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgoColumnIntegerSpinnerField

public AgoColumnIntegerSpinnerField(int width,
                                    boolean visible,
                                    boolean transparent,
                                    Color backgroundColor,
                                    int borderType)
Parameters:
width - the column width, in pixels
visible - the "visible" property for the column. Set to false to hide the column. If you hide a column, you might also want to hide any headers associated with the column.
transparent - the "transparent" property for the column. Set to true to make it transparent.
backgroundColor - the java.awt.Color object that specifies the column's background color.
borderType - the symbolic constant that specifies the desired border; valid types are defined in AgoColumnBase.
Example:
     AgoColumnIntegerSpinnerField salary;
     salary = new AgoColumnIntegerSpinnerField(100,
                                            true,
                                            false,
                                            Color.white,
                                            AgoColumnBase.BORDER_3D);
See Also:
AgoColumnBase
Method Detail

initColumnSpinnerProperty

public void initColumnSpinnerProperty(String propertyName,
                                      AgoFontIdentifier fontid,
                                      Color textColor,
                                      int alignment)
Initializes a number of parameters for the control
Parameters:
propertyName - the name of the property from which to initialize this column
fontid - the SilverStream font object (AgoFontIdentifier) for the control's text
textColor - the java.awt.Color object for the control's text
alignment - the alignment constant for the contents of the column. See AgoColumnBase for more information
Example:
     AgoColumnIntegerSpinnerField	salary;
     salary = new AgoColumnIntegerSpinnerField(100,true,false,Color.white,0);
     salary.initColumnSpinnerProperty("salary",
                                   new AgoFontIdentifier("Dialog", 0, 12), 
                                   Color.black,
                                   AgoColumnBase.ALIGN_LEFT), 

setIncrement

public void setIncrement(int increment)
Assigns an integer value by which the spinner is incremented (or decremented) each time the user presses one of the control's arrow keys.
Parameters:
increment - the amount by which the control is incremented (or decremented) when the user presses one of the control's arrow keys
Example:
The following example illustrates how to set the increment value to 3.
     salary.setIncrement(3);
See Also:
AgoColumnIntegerSpinnerField.getIncrement()

getIncrement

public int getIncrement()
Returns an integer value that specifies the amount by which the spinner is incremented (or decremented) when the user presses one of the control's arrow keys.
Example:
The following example illustrates how to obtain the current increment value.
   
     int increment;
     increment = salary.getIncrement();
See Also:
AgoColumnIntegerSpinnerField.setIncrement(int increment)

getMinimumValue

public final int getMinimumValue()
Returns an integer that represents the lowest value to which the control can be set.
Example:
The following code fragment illustrates how to obtain the minimum value.
     int MinValue;
     MinValue = salary.getMinimumValue();
See Also:
AgoColumnIntegerSpinnerField.setMinimumValue(int minimumValue)

setMinimumValue

public final void setMinimumValue(int minimumValue)
Assigns the lowest integer value to which the control can be set.
Parameters:
minimumValue - specifies the lowest value that the control can be set to
Example:
The following code fragment illustrates how to assign a minimum value.
     salary.setMinimumValue(5);
           

getMaximumValue

public final int getMaximumValue()
Returns an integer that represents the highest value to which the control can be set.
Example:
The following code fragment illustrates how to obtain the maximum value.
     int MaxValue;
     MaxValue = salary.getMaxValue();
See Also:
AgoColumnIntegerSpinnerField.setMaximumValue(int maximumValue)

setMaximumValue

public final void setMaximumValue(int maximumValue)
Assigns the highest integer value to which the control can be set.
Parameters:
maximumValue - specifies the control's maximum value
     salary.setMaxValue(5);
Example:
The following code fragment illustrates how to assign a maximum value.

getEditWhenSelected

public boolean getEditWhenSelected()
Returns the state of the edit when selected property.
Usage:
This property specifies whether the cells in the column are displayed as integer spinner fields or as text fields. When false, all of the cells in the column are displayed as integer spinner fields. When true, the cells are displayed as text fields until selected by the user. When selected by the user, the field is displayed as an integer spinner field.

The default is true.

If you are displaying a large data set, setting this to false can slow down the performance of this control.

Example:
     boolean editOnSel = salary.getEditWhenSelected();
See Also:
AgoColumnIntegerSpinnerField.setEditWhenSelected(boolean editWhenSelected)

setEditWhenSelected

public void setEditWhenSelected(boolean editWhenSelected)
Sets the state of the edit when selected property.
Parameters:
editWhenSelected - if set to true, cells in the column are always displayed as text cells except when selected by the user. Otherwise, cells are always displayed as spinner field cells.
Usage:
This property specifies whether the cells in the column are always displayed as integer spinner fields or as text fields. When false, all of the cells in the column are displayed as integer spinner fields. When true, the cells are displayed as text fields until selected by the user. When selected by the user, the field is displayed as an integer spinner field.

The default is true.

If you are displaying more than a few rows of data, setting this to false can slow down the performance of this control.

Example:
     salary.setEditWhenSelected(true);
See Also:
AgoColumnIntegerSpinnerField.getEditWhenSelected()

SilverStream
Application Server 3.5