|
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.atlas.AtCanvas | +--com.sssw.rt.form.PvBaseCanvas | +--com.sssw.rt.form.AgcLabel
Static text (Label) control for displaying a single line of text within a specified rectangle.
Inner classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Field Summary | |
static int |
BORDER_GROOVED
Draw a grooved border (default). |
static int |
BORDER_LOWERED
Draw a lowered border. |
static int |
BORDER_NONE
No border is displayed. |
static int |
BORDER_OUTLINE
Draw a one-pixel border. |
static int |
BORDER_RAISED
Draw a raised border. |
static int |
JUSTIFY_CENTER
Text is centered. |
static int |
JUSTIFY_LEFT
Text is left justified (default). |
static int |
JUSTIFY_RIGHT
Text is right justified. |
static int |
STYLE_DROP_SHADOW
Display shadow effect (use the text and shadow colors). |
static int |
STYLE_EMBOSSED
Display with embossed effect (use the text, shadow, and highlight colors). |
static int |
STYLE_NORMAL
Display regular, flat text, using only the text color (default). |
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 | |
AgcLabel()
|
Method Summary | |
Color |
getBackgroundColor()
Deprecated. replaced by Component.getBackground() . |
int |
getBorderStyle()
Returns the control's border style. |
Color |
getForeground()
Used to obtain the Color of the control's text. |
int |
getJustification()
Returns an integer that specifies how the Label's text is aligned on the control. |
String |
getText()
Returns a String that contains the control's text. |
Color |
getTextColor()
Deprecated. use AgcLabel.getForeground() to obtain the Color of the control's text. |
Color |
getTextHighlightColor()
Returns the control's text highlight Color. |
Color |
getTextShadowColor()
Returns the control's text shadow Color. |
int |
getTextStyle()
Returns an integer that represents the control's text style. |
boolean |
getWordWrap()
Returns a boolean value that indicates if the label's text should be wrapped. |
void |
setBackground(Color color)
Assigns the control's background Color. |
void |
setBackgroundColor(Color color)
Set the background color. |
void |
setBorderStyle(int style)
Assigns a style for the control's border. |
void |
setForeground(Color color)
Assigns the control's foreground Color. |
void |
setJustification(int j)
Specifies how label text is aligned on a control. |
void |
setText(String label)
Sets the label text. |
void |
setTextColor(Color color)
Deprecated. use AgcLabel.setForeground(Color) to assign an instance of java.awt.Color
to the control's text. |
void |
setTextHighlightColor(Color color)
Sets the label text highlight color. |
void |
setTextShadowColor(Color color)
Sets the text shadow color. |
void |
setTextStyle(int style)
Assigns the style for the Label's text. |
void |
setWordWrap(boolean wrap)
Takes a boolean value that determines if the Label's text should be wrapped. |
Methods inherited from class com.sssw.rt.form.PvBaseCanvas |
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 |
Field Detail |
public static final int JUSTIFY_LEFT
AgcLabel.getJustification()
,
AgcLabel.setJustification(int)
public static final int JUSTIFY_CENTER
AgcLabel.getJustification()
,
AgcLabel.setJustification(int)
public static final int JUSTIFY_RIGHT
AgcLabel.getJustification()
,
AgcLabel.setJustification(int)
public static final int STYLE_NORMAL
AgcLabel.getTextStyle()
,
AgcLabel.setTextStyle(int)
public static final int STYLE_DROP_SHADOW
AgcLabel.getTextStyle()
,
AgcLabel.setTextStyle(int)
,
AgcLabel.getTextShadowColor()
,
AgcLabel.setTextShadowColor(Color)
public static final int STYLE_EMBOSSED
AgcLabel.getTextStyle()
,
AgcLabel.setTextStyle(int)
,
AgcLabel.getTextShadowColor()
,
AgcLabel.setTextShadowColor(Color)
,
AgcLabel.getTextHighlightColor()
,
AgcLabel.setTextHighlightColor(Color)
public static final int BORDER_NONE
AgcLabel.getBorderStyle()
,
AgcLabel.setBorderStyle(int)
public static final int BORDER_OUTLINE
AgcLabel.getBorderStyle()
,
AgcLabel.setBorderStyle(int)
public static final int BORDER_LOWERED
AgcLabel.getBorderStyle()
,
AgcLabel.setBorderStyle(int)
public static final int BORDER_RAISED
AgcLabel.getBorderStyle()
,
AgcLabel.setBorderStyle(int)
public static final int BORDER_GROOVED
AgcLabel.getBorderStyle()
,
AgcLabel.setBorderStyle(int)
Constructor Detail |
public AgcLabel()
Method Detail |
public String getText()
The following code fragment illustrates how to call getText().
String s; s = ControlName1.getText();
AgcLabel.setText(String)
public void setText(String label)
label
- specifies the text to assign to the control.
The following code fragment illustrates how to use the setText()
method.
ControlName1.setText("Add");
AgcLabel.getText()
public Color getTextColor()
AgcLabel.getForeground()
to obtain the Color of the control's text.
The following code fragment illustrates how to use the getTextColor() method.
Color c; c = ControlName1.getTextColor();
AgcLabel.getForeground()
,
AgcLabel.setTextColor(Color)
public Color getForeground()
The following code fragment illustrates how to use the getForeground()
method.
Color c; c = ControlName1.getForeground();
AgcLabel.setForeground(Color)
public void setTextColor(Color color)
AgcLabel.setForeground(Color)
to assign an instance of java.awt.Color
to the control's text.
color
- specifies the instance of a java.awt.Color Object or one of the Color
constants (for example, Color.red).The following code fragment illustrates how to set the text Color to red.
ControlName1.setTextColor(Color.red);
AgcLabel.getTextColor()
public void setForeground(Color color)
color
- the instance of a java.awt.Color object or one of the Color constants (for example, Color.red).For controls that support it, the Transparent property must be false for the background Color to show.
The following example illustrates how to set the foreground Color on a control using one of the Color constants:
ControlName1.setForeground(Color.white);
This example illustrates how to create a new Color and then use it to set the background Color:
Color colLabelColor = new Color(247, 247, 222); ControlName1.setForeground(colLabelColor);
public Color getTextShadowColor()
The control's text shadow Color can be set at runtime using the setTextShadowColor() method. For the Label control, the Shadow Color is only used when the Text Style is Embossed (AgcLabel.STYLE_EMBOSSED) or Drop Shadow (AgcLabel.STYLE_DROP_SHADOW).
The following code fragment illustrates how to obtain a control's current Text Shadow Color.
Color c; c = ControlName1.getTextShadowColor();
AgcLabel.setTextShadowColor(Color)
public void setTextShadowColor(Color color)
color
- specifies the instance of a java.awt.Color object or one of the Color constants
(for example, Color.red).For the Label control, the Shadow Color is only used when the Text Style is Embossed (AgcLabel.STYLE_EMBOSSED) or Drop Shadow (AgcLabel.STYLE_DROP_SHADOW).
AgcLabel.getTextShadowColor()
public Color getTextHighlightColor()
The Highlight Color is only used when the Text Style is Embossed (AgcLabel.STYLE_EMBOSSED).
The following code fragment illustrates how to obtain a control's text highlight Color.
Color c; c = ControlName1.getTextHighlightColor();
AgcLabel.setTextHighlightColor(Color)
public void setTextHighlightColor(Color color)
color
- specifies the instance of a java.awt.Color object or one of the Color constants
(for example, Color.red).The Highlight Color is only used when the Text Style is Embossed (AgcLabel.STYLE_EMBOSSED).
The following code fragment illustrates how to set the Highlight Color.
ControlName1.setTextHighlightColor(Color.red);
AgcLabel.getTextHighlightColor()
public int getTextStyle()
This class defines constant fields for the possible text styles.
The text style can be established at design time using the Text Style property,
or at runtime using the setTextStyle()
method.
The following code fragment illustrates how to obtain the current text style.
int style; style = ControlName1.getTextStyle();
AgcLabel.setTextStyle(int)
public void setTextStyle(int style)
style
- the text style.This class defines constant fields for the possible text styles.
The following code fragment illustrates how to use the setTextStyle()
method.
ControlName1.setTextStyle(AgcLabel.STYLE_EMBOSSED);
AgcLabel.getTextStyle()
public Color getBackgroundColor()
Component.getBackground()
.
This example illustrates how to obtain the background Color of a control.
Color bgColor; bgColor = ControlName1.getBackgroundColor();
AgcLabel.setBackgroundColor(Color)
public void setBackgroundColor(Color color)
AgcLabel.setBackground(Color)
.
color
- AgcLabel.setBackground(Color)
public void setBackground(Color color)
color
- the instance of a java.awt.Color object or one of the Color constants (for example, Color.red).For controls that support it, the Transparent property must be false for the background Color to show.
The following example illustrates how to set the background Color on a control using one of the Color constants:
ControlName1.setBackground(Color.white);
This example illustrates how to create a new Color and then use it to set the background Color:
Color colLabelColor = new Color(247, 247, 222); ControlName1.setBackground(colLabelColor);
Component.getBackground()
public int getJustification()
This class defines constant fields for the possible justifications.
The following code fragment illustrates how to call getJustification().
int j; j = ControlName1.getJustification(); if (j == AgcLabel.JUSTIFY_CENTER) System.out.println("The label text is centered.");
AgcLabel.setJustification(int)
public void setJustification(int j)
j
- specifies the text alignment.This class defines constant fields for the possible justifications.
The following code fragment illustrates how to use the setJustification()
method.
ControlName1.setJustification(AgcLabel.JUSTIFY_CENTER);
AgcLabel.getJustification()
public boolean getWordWrap()
If the value is true, the label's text wraps (that is, the text is displayed on multiple lines if necessary).
The following code fragment illustrates how to use the getWordWrap() method.
boolean wordWrap; wordWrap = ControlName1.getWordWrap();
AgcLabel.setWordWrap(boolean)
public void setWordWrap(boolean wrap)
wrap
- when true, wordwrap is on.AgcLabel.getWordWrap()
public int getBorderStyle()
This class defines constant fields for the possible border styles.
The following code fragment illustrates how to obtain the border style.
int borderStyle; borderStyle = ControlName1.getBorderStyle();
AgcLabel.setBorderStyle(int)
public void setBorderStyle(int style)
style
- specifies the border style.This class defines constant fields for the possible border styles. These constants must be qualified using the classname, for example, AgcLabel.BORDER_OUTLINE.
The following code fragment illustrates how to set a label's border style to outline style.
ControlName1.setBorderStyle(AgcLabel.BORDER_OUTLINE);
AgcLabel.getBorderStyle()
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |