SilverStream
Application Server 3.5

com.sssw.rt.jform
Class AgcJLabel

java.lang.Object
 |
 +--java.awt.Component
       |
       +--java.awt.Container
             |
             +--javax.swing.JComponent
                   |
                   +--javax.swing.JLabel
                         |
                         +--com.sssw.rt.jform.AgcJLabel
All Implemented Interfaces:
Accessible, AgiHelpInfo, ImageObserver, MenuContainer, Serializable, SwingConstants

public class AgcJLabel
extends JLabel
implements AgiHelpInfo

A lightweight component that displays label text, an image, or both. To display multiline text, you can turn on word-wrapping. The label text can have text effects, such as drop shadow or embossing.

AgcJLabel is not a data-bound control and doesn't use a model for the displayed information.

Properties:
Background Color, Border Style, Caption Expression, Caption Text, Control Type, Enabled, Font Name, Font Size, Font Style, Height, Highlight Color, Horizontal Alignment, Horizontal text position, Image, Left, Name, Shadow Color, Text Color, Text Style, Tool Tip, Top, Transparent, Vertical Alignment, Vertical text position, Visible, Width, Word Wrap
Events:
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, validationFailed, validationTest, valueChanged
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JLabel
JLabel.AccessibleJLabel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
static int STYLE_DROP_SHADOW
          Shadow effect (uses the text and shadow colors)
static int STYLE_EMBOSSED
          Embossed effect (uses the text, shadow, and highlight colors)
static int STYLE_NORMAL
          Regular, flat text (uses the text color only)
 
Fields inherited from class javax.swing.JLabel
labelFor
 
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
AgcJLabel()
          Creates an instance of a label control with no image and with an empty string for the title.
AgcJLabel(Icon image)
          Creates an instance of a label control with the specified image.
AgcJLabel(Icon image, int horizontalAlignment)
          Creates an instance of a label control with the specified image and horizontal alignment.
AgcJLabel(String text)
          Creates an instance of a label control with the specified text.
AgcJLabel(String text, Icon icon, int horizontalAlignment)
          Creates an instance of a label control with the specified text, image, and horizontal alignment.
AgcJLabel(String text, int horizontalAlignment)
          Creates an instance of a label control with the specified text and horizontal alignment.
 
Method Summary
 Color getTextHighlightColor()
          Gets the text highlight color.
 Color getTextShadowColor()
          Gets the text shadow color.
 int getTextStyle()
          Gets the text effect currently in use.
 boolean getWordWrap()
          Gets the word wrap setting for the label.
 void setTextHighlightColor(Color color)
          Sets the text highlight color.
 void setTextShadowColor(Color color)
          Sets the text shadow color.
 void setTextStyle(int style)
          Sets the text effect, such as drop-shadow or embossing.
 void setWordWrap(boolean wrap)
          Sets the word wrap setting for the label.
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
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.AgiHelpInfo
getHelpInfo, setHelpInfo
 

Field Detail

STYLE_NORMAL

public static final int STYLE_NORMAL
Regular, flat text (uses the text color only)

STYLE_DROP_SHADOW

public static final int STYLE_DROP_SHADOW
Shadow effect (uses the text and shadow colors)

STYLE_EMBOSSED

public static final int STYLE_EMBOSSED
Embossed effect (uses the text, shadow, and highlight colors)
Constructor Detail

AgcJLabel

public AgcJLabel(String text,
                 Icon icon,
                 int horizontalAlignment)
Creates an instance of a label control with the specified text, image, and horizontal alignment. The label is centered vertically in its display area. The text is on the trailing edge of the image.
Parameters:
text - the text to be displayed by the label
icon - the image to be displayed by the label
horizontalAlignment - one of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING
See Also:
SwingConstants

AgcJLabel

public AgcJLabel(String text,
                 int horizontalAlignment)
Creates an instance of a label control with the specified text and horizontal alignment. The label is centered vertically in its display area.
Parameters:
text - the text to be displayed by the label
horizontalAlignment - one of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING
See Also:
SwingConstants

AgcJLabel

public AgcJLabel(String text)
Creates an instance of a label control with the specified text. The label is aligned against the leading edge of its display area, and centered vertically.
Parameters:
text - the text to be displayed by the label

AgcJLabel

public AgcJLabel(Icon image,
                 int horizontalAlignment)
Creates an instance of a label control with the specified image and horizontal alignment.
Parameters:
icon - the image to be displayed by the label
horizontalAlignment - one of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING
See Also:
SwingConstants

AgcJLabel

public AgcJLabel(Icon image)
Creates an instance of a label control with the specified image. The image is centered vertically and horizontally in its display area.
Parameters:
icon - the image to be displayed by the label

AgcJLabel

public AgcJLabel()
Creates an instance of a label control with no image and with an empty string for the title. The label is centered vertically in its display area. The label's text, once set, will be displayed on the leading edge of the label's display area.
Method Detail

getTextStyle

public int getTextStyle()
Gets the text effect currently in use.
Returns:
an int identifying the text effect
Usage:
Text effect constants are defined as fields in this class.
See Also:
AgcJLabel.setTextStyle(int)

setTextStyle

public void setTextStyle(int style)
Sets the text effect, such as drop-shadow or embossing.
Parameters:
style - an int specifying a text effect
Usage:
Text effect constants are defined as fields in this class.
See Also:
AgcJLabel.getTextStyle()

getTextShadowColor

public Color getTextShadowColor()
Gets the text shadow color.
Returns:
a Color object whose color is used for the text shadow
See Also:
AgcJLabel.setTextShadowColor(Color), AgcJLabel.getTextHighlightColor()

setTextShadowColor

public void setTextShadowColor(Color color)
Sets the text shadow color.
Parameters:
color - a Color object specifying the color to be used for the text shadow
Usage:
The shadow color is not visible when the text style is normal.
See Also:
AgcJLabel.getTextShadowColor(), AgcJLabel.setTextHighlightColor(Color)

getTextHighlightColor

public Color getTextHighlightColor()
Gets the text highlight color.
Returns:
a Color object whose color is used for the text highlight in the embossed text effect
See Also:
AgcJLabel.setTextHighlightColor(Color), AgcJLabel.getTextShadowColor()

setTextHighlightColor

public void setTextHighlightColor(Color color)
Sets the text highlight color.
Parameters:
color - a Color object specifying the color to be used for the text highlight
Usage:
The highlight color is visible on in the embossed text effect.
See Also:
AgcJLabel.getTextHighlightColor(), AgcJLabel.setTextShadowColor(Color)

getWordWrap

public boolean getWordWrap()
Gets the word wrap setting for the label.
Returns:
a boolean value specifying whether word wrap is enabled
See Also:
AgcJLabel.getWordWrap()

setWordWrap

public void setWordWrap(boolean wrap)
Sets the word wrap setting for the label.
Parameters:
wrap - a boolean value specifying whether to enable word wrap
Usage:
If word wrap is enabled and the text value for the label is longer than the width of the label, the text is displayed on multiple lines. If word wrap is not enabled and the text is too long, the text display is truncated.
See Also:
AgcJLabel.setWordWrap(boolean)

SilverStream
Application Server 3.5