|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.awt.Label
public class Label
Label is a component that displays a single line of read-only
text.
The text can be aligned within the label (left aligned, centered, or
right aligned). The default is left alignment.
If text
is not specified, the label is created with default text of "Label".
Label does not accept key events.
Creation:
Label label1 = new Label();
label1.initialize();
Label label1 = new Label("My Text");
label1.initialize();
Label label1 = new Label("My Text", alignment);
label1.initialize();
Label label1 = new Label(RB.getResources(), resourceKey);
label1.initialize();
| Field Summary | |
|---|---|
static java.lang.String |
RB_KEY
|
| Constructor Summary | |
|---|---|
Label()
Default constructor |
|
Label(java.util.ResourceBundle bundle,
java.lang.String textID)
Create a new Label with the specified text obtained from a resource bundle |
|
Label(java.lang.String text)
Create a new Label with the specified text |
|
Label(java.lang.String text,
int alignment)
Create a new Label with the specified text and alignment |
|
| Method Summary | |
|---|---|
void |
addNotify()
Notify the component that it has been added to a container and that the peer should be created. |
void |
attachModel(ModelInterface model)
Attaches a model to the component. |
java.lang.Object |
clone()
Clones the component |
void |
detachModel(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. |
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. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Processes a PropertyChangeEvent sent by the model. |
void |
refresh()
Sets the Label text from the text obtained from the attached model |
void |
refresh(ModelInterface model)
Sets the label text from the text obtained from the attached model |
void |
setAlignment(int alignment)
Sets the text alignment for the label to the specified alignment (Label.LEFT (0), Label.CENTER (1), or Label.RIGHT (2)). |
static void |
setDefaultHeight(int newDefaultHeight)
Sets the default height of the component. |
void |
setDefaultValues()
Sets the initial values to the properties. |
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 |
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 text to the specified text |
| Methods inherited from interface com.sas.lang.StringDataInterface |
|---|
getText |
| Methods inherited from interface com.sas.ViewInterface |
|---|
getModelInterface, getViewInterfaceSupportInfo, removeInterfaceTraps, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsRequiredInterfaces, trapInterfaceEvents |
| Field Detail |
|---|
public static final java.lang.String RB_KEY
| Constructor Detail |
|---|
public Label()
public Label(java.lang.String text)
text - label text
public Label(java.lang.String text,
int alignment)
text - text that appears on the labelalignment - an integer that specifies the text alignment within the label
(Label.LEFT,Label.CENTER,Label.RIGHT)
public Label(java.util.ResourceBundle bundle,
java.lang.String textID)
bundle - resource bundletext - textID identifier in the resource bundle| 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.Labelpublic void attachModel(ModelInterface model)
attachModel in interface ViewInterfaceattachModel in class LabelVisualComponentmodel - model to attachViewInterface.attachModel(com.sas.ModelInterface)
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface com.sas.PublicClonableclone in class LabelVisualComponentjava.lang.CloneNotSupportedException - if the model attached to the component being cloned
will not allow the clone to attach.public void detachModel(ModelInterface model)
detachModel in interface ViewInterfacedetachModel in class LabelVisualComponentmodel - Model to detachViewInterface.detachModel(com.sas.ModelInterface)public java.util.Vector getRequiredInterfaces()
getRequiredInterfaces in interface ViewInterfacegetRequiredInterfaces in class LabelVisualComponentViewInterface.getRequiredInterfaces()public boolean isDefaultModelAttached()
isDefaultModelAttached in interface ViewDefaultModelInterfacepublic boolean isResizeToFit()
isResizeToFit in interface ResizeToFitInterfacesetResizeToFit(boolean)public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class LabelVisualComponentevent - The event from the model indicating what property changedPropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)public void refresh()
public void refresh(ModelInterface model)
refresh in interface ViewInterfacerefresh in class LabelVisualComponentmodel - attached modelViewInterface.refresh(com.sas.ModelInterface)public void setAlignment(int alignment)
setAlignment in class java.awt.Labelalignment - alignment value (Label.LEFT (0), Label.CENTER (1), or Label.RIGHT (2))public void setDefaultValues()
setDefaultValues in interface VisualInterfacesetDefaultValues in interface ComponentInterfacesetDefaultValues in class LabelVisualComponentComponentInterface.setDefaultValues()public void setFont(java.awt.Font font)
setFont in interface VisualInterfacesetFont in class LabelVisualComponentfont - fontComponent.setFont(java.awt.Font),
LabelVisualComponent.getFont()public void setResizeToFit(boolean resizeToFit)
setResizeToFit in interface ResizeToFitInterfaceresizeToFit - boolean valueisResizeToFit()public void setText(java.lang.String text)
setText in interface com.sas.lang.StringDataInterfacesetText in class java.awt.Labeltext - label textLabel.getText()
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||