|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.awt.Button
public class Button
Button is a pushbutton component that can display a specified text label.
Creation:
Button button1 = new Button();
button1.initialize();
Button button1 = new Button("My Text");
button1.initialize();
true
, changing the text or font may cause the button to expand or
contract. The resizeToFit property is initially set to false
.
If the component is managed by a layout
manager that uses preferred sizes, the component will behave as if the
resizeToFit property has been set to true
regardless of the actual value
of the resizeToFit property .
Field Summary | |
---|---|
static java.lang.String |
RB_KEY
|
Constructor Summary | |
---|---|
Button()
Default constructor |
|
Button(java.lang.String text)
Create a Button with the specified text |
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 Button label. |
boolean |
isDefaultModelAttached()
Returns whether the default model is attached. |
boolean |
isResizeToFit()
Returns the value of the resizeToFit property. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Processes a PropertyChangeEvent sent by the model. |
void |
refresh()
Sets text for the Button component from the text obtained from the attached model |
void |
refresh(com.sas.ModelInterface model)
Set text for the Button from the text obtained from the attached model |
void |
setActionCommand(java.lang.String command)
Sets the string that will be included in any ActionEvents that are generated by the Button |
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 label)
Sets the Button with the specified text |
void |
setResizeToFit(boolean resizeToFit)
Sets 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. |
void |
setText(java.lang.String text)
Sets the Button with the specified text. |
Field Detail |
---|
public static final java.lang.String RB_KEY
Constructor Detail |
---|
public Button()
public Button(java.lang.String text)
text
- text that will appear on the buttonMethod 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.Button
public void attachModel(com.sas.ModelInterface model)
attachModel
in interface com.sas.ViewInterface
attachModel
in class ButtonVisualComponent
model
- model to attachViewInterface.attachModel(com.sas.ModelInterface)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface com.sas.PublicClonable
clone
in class ButtonVisualComponent
java.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 VisualInterface
computePreferredSize
in class ButtonVisualComponent
VisualInterface.computePreferredSize()
public void detachModel(com.sas.ModelInterface model)
detachModel
in interface com.sas.ViewInterface
detachModel
in class ButtonVisualComponent
model
- Model to detachViewInterface.detachModel(com.sas.ModelInterface)
public java.util.Vector getRequiredInterfaces()
getRequiredInterfaces
in interface com.sas.ViewInterface
getRequiredInterfaces
in class ButtonVisualComponent
ViewInterface.getRequiredInterfaces()
public java.lang.String getText()
getText
in interface com.sas.lang.StringDataInterface
setText(java.lang.String)
public boolean isDefaultModelAttached()
isDefaultModelAttached
in interface com.sas.ViewDefaultModelInterface
public boolean isResizeToFit()
isResizeToFit
in interface ResizeToFitInterface
setResizeToFit(boolean)
public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
propertyChange
in class ButtonVisualComponent
event
- 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.ViewInterface
refresh
in class ButtonVisualComponent
model
- attached modelViewInterface.refresh(com.sas.ModelInterface)
public void setActionCommand(java.lang.String command)
setActionCommand
in class java.awt.Button
command
- command string to be included in any ActionEventsButton.getActionCommand()
public void setDefaultValues()
setDefaultValues
in interface VisualInterface
setDefaultValues
in interface com.sas.ComponentInterface
setDefaultValues
in class ButtonVisualComponent
ComponentInterface.setDefaultValues()
public void setFont(java.awt.Font font)
setFont
in interface VisualInterface
setFont
in class ButtonVisualComponent
font
- fontComponent.setFont(java.awt.Font)
,
ButtonVisualComponent.getFont()
public void setLabel(java.lang.String label)
setLabel
in class java.awt.Button
label
- Button textButton.getLabel()
public void setResizeToFit(boolean resizeToFit)
setResizeToFit
in interface ResizeToFitInterface
resizeToFit
- boolean valueisResizeToFit()
public void setText(java.lang.String text)
setText
in interface com.sas.lang.StringDataInterface
text
- Button textgetText()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |