|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.awt.CheckBox
public class CheckBox
CheckBox is a component that maintains a boolean state and displays a specified text label.
A checkbox may optionally be part of
a CheckBoxGroup which enforces mutual exclusion (only one item in the group can be selected at
any given time).
Creation:
Create a Checkbox with no specified label
CheckBox checkBox1 = new CheckBox();
checkBox1.initialize();
CheckBox checkBox1 = new CheckBox("My Text");
checkBox1.initialize();
CheckBox checkBox1 = new CheckBox("My Text", selected);
checkBox1.initialize();
CheckBox checkBox1 = new CheckBox("My Text", selected, checkBoxGroup);
checkBox1.initialize();
| Field Summary | |
|---|---|
static java.lang.String |
RB_KEY
|
| Constructor Summary | |
|---|---|
CheckBox()
Default constructor |
|
CheckBox(java.util.ResourceBundle bundle,
java.lang.String textID)
Create a CheckBox with the specified text obtained from a resource bundle |
|
CheckBox(java.lang.String text)
Create a CheckBox with the specified text |
|
CheckBox(java.lang.String text,
boolean state)
Create a CheckBox with the specified text and boolean state |
|
CheckBox(java.lang.String text,
boolean state,
java.awt.CheckboxGroup group)
Create a CheckBox with the specified text, boolean state, and Checkbox group |
|
| Method Summary | |
|---|---|
void |
addNotify()
Notify the component that it has been added to a container and that the peer should be created. |
void |
attachModel(com.sas.ModelInterface model)
Attaches a model to the component. |
java.lang.Object |
clone()
Clones the component |
java.awt.Dimension |
computePreferredSize()
Returns the preferred size of the component |
void |
detachModel(com.sas.ModelInterface model)
Detaches the current model and attaches the default model if the model is set to null |
static int |
getDefaultHeight()
Returns the default height for instances of this class |
static int |
getDefaultWidth()
Returns the default width for instances of this class |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
Returns the ExtendedBeanInfo for this class. |
java.util.Vector |
getRequiredInterfaces()
Returns the required interfaces Vector for this component. |
java.lang.String |
getText()
Returns the CheckBox text. |
boolean |
isDefaultModelAttached()
Returns whether the default model is attached. |
boolean |
isResizeToFit()
Returns the value of the resizeToFit property The resizeToFit property determines whether to change the size of the component when either the text or font changes. |
boolean |
isSelected()
Returns the current state of the checkBox. |
protected void |
processItemEvent(java.awt.event.ItemEvent e)
Processes item events occurring on this component.Subclasses should always call super so that events are delivered to any ItemListeners. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Processes a PropertyChangeEvent sent by the model. |
void |
refresh()
Sets value of selected property from the value obtained from the attached model |
void |
refresh(com.sas.ModelInterface model)
Sets value of selected property from the value obtained from the attached model |
void |
setCheckboxGroup(java.awt.CheckboxGroup g)
Sets the CheckboxGroup. |
static void |
setDefaultHeight(int newDefaultHeight)
Sets the default height of the component. |
void |
setDefaultValues()
Sets the initial values to the default values. |
static void |
setDefaultWidth(int newDefaultWidth)
Sets the default width of the component. |
void |
setFont(java.awt.Font font)
Sets the font to be used by the component for displaying text. |
void |
setLabel(java.lang.String text)
Sets the CheckBox with the specified text |
void |
setResizeToFit(boolean resizeToFit)
Sets the value of the resizeToFit property. |
void |
setSelected(boolean state)
Sets the CheckBox to the specified boolean state. |
void |
setState(boolean state)
Sets the CheckBox to the specified boolean state |
void |
setText(java.lang.String text)
Sets the CheckBox with the specified text. |
| Field Detail |
|---|
public static final java.lang.String RB_KEY
| Constructor Detail |
|---|
public CheckBox()
public CheckBox(java.lang.String text)
text - text that will appear on the checkbox
public CheckBox(java.util.ResourceBundle bundle,
java.lang.String textID)
bundle - resource bundletextID - text identifier in the resource bundle
public CheckBox(java.lang.String text,
boolean state)
text - text that will appear on the checkboxstate - boolean that indicates whether the checkBox is checked or unchecked
public CheckBox(java.lang.String text,
boolean state,
java.awt.CheckboxGroup group)
text - text that will appear on the checkboxstate - boolean that indicates whether the checkBox is checked or uncheckedgroup - an instance of java.awt.CheckBoxGroup that the checkBox
belongs to| Method Detail |
|---|
public static int getDefaultWidth()
setDefaultWidth(int)public static void setDefaultWidth(int newDefaultWidth)
newDefaultWidth - the new default width in pixelsgetDefaultWidth()public static int getDefaultHeight()
setDefaultHeight(int)public static void setDefaultHeight(int newDefaultHeight)
newDefaultHeight - the new default height in pixelsgetDefaultHeight()public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public void addNotify()
addNotify in class java.awt.Checkboxpublic void attachModel(com.sas.ModelInterface model)
attachModel in interface com.sas.ViewInterfaceattachModel in class CheckBoxVisualComponentmodel - model to attachViewInterface.attachModel(com.sas.ModelInterface)
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface com.sas.PublicClonableclone in class CheckBoxVisualComponentjava.lang.CloneNotSupportedException - if the model attached to the component being cloned
will not allow the clone to attach.public java.awt.Dimension computePreferredSize()
computePreferredSize in interface VisualInterfacecomputePreferredSize in class CheckBoxVisualComponentVisualInterface.computePreferredSize()public void detachModel(com.sas.ModelInterface model)
detachModel in interface com.sas.ViewInterfacedetachModel in class CheckBoxVisualComponentmodel - Model to detachViewInterface.detachModel(com.sas.ModelInterface)public java.util.Vector getRequiredInterfaces()
getRequiredInterfaces in interface com.sas.ViewInterfacegetRequiredInterfaces in class CheckBoxVisualComponentViewInterface.getRequiredInterfaces()public java.lang.String getText()
getText in interface com.sas.lang.StringDataInterfacesetText(java.lang.String)public boolean isDefaultModelAttached()
isDefaultModelAttached in interface com.sas.ViewDefaultModelInterfacepublic boolean isResizeToFit()
isResizeToFit in interface ResizeToFitInterfacesetResizeToFit(boolean)public boolean isSelected()
setSelected(boolean)protected void processItemEvent(java.awt.event.ItemEvent e)
processItemEvent in class java.awt.Checkboxe - event to be handledpublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class CheckBoxVisualComponentevent - The event from the model indicating what property changedPropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)public void refresh()
public void refresh(com.sas.ModelInterface model)
refresh in interface com.sas.ViewInterfacerefresh in class CheckBoxVisualComponentmodel - attached modelViewInterface.refresh(com.sas.ModelInterface)public void setCheckboxGroup(java.awt.CheckboxGroup g)
setCheckboxGroup in class java.awt.Checkboxg - an instance of java.awt.CheckBoxGroup to add the checkBox topublic void setDefaultValues()
setDefaultValues in interface VisualInterfacesetDefaultValues in interface com.sas.ComponentInterfacesetDefaultValues in class CheckBoxVisualComponentComponentInterface.setDefaultValues()public void setFont(java.awt.Font font)
setFont in interface VisualInterfacesetFont in class CheckBoxVisualComponentfont - fontComponent.setFont(java.awt.Font),
CheckBoxVisualComponent.getFont()public void setLabel(java.lang.String text)
setLabel in class java.awt.Checkboxtext - CheckBox textCheckbox.getLabel()public void setResizeToFit(boolean resizeToFit)
setResizeToFit in interface ResizeToFitInterfaceresizeToFit - boolean valueisResizeToFit()public void setSelected(boolean state)
state - boolean stateisSelected()public void setState(boolean state)
setState in class java.awt.Checkboxstate - boolean state#getState - public void setText(java.lang.String text)
setText in interface com.sas.lang.StringDataInterfacetext - CheckBox textgetText()
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||