|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.visuals.StyledLabelView
public class StyledLabelView
StyledLabelView is a sub-class of LabelView that parses the text into
TextElements and paints it based on tags placed in the text.
The StyledLabelView also supports sending ActionEvents when text
between action tags is clicked on by the mouse.
Notes:
TextElement
,
Serialized FormField Summary |
---|
Fields inherited from class com.sas.visuals.LabelView |
---|
BOTTOM, CENTER_LEFT, CENTER_RIGHT, LEFT, RIGHT, TOP |
Fields inherited from interface com.sas.visuals.Alignment |
---|
BEGIN, CENTER, END |
Constructor Summary | |
---|---|
StyledLabelView()
Default constructor. |
|
StyledLabelView(java.lang.String text)
Constructor that sets the text displayed. |
Method Summary | |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener)
Add an ActionListener to listen for ActionEvents on the StyledLabelView |
protected java.awt.Dimension |
calculateTextDisplay()
Parse the textElements and determine their locations and sizes based on the font and text. |
static int |
getDefaultHeight()
|
static int |
getDefaultWidth()
|
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
|
protected java.awt.Point |
getInitialPoint(int x,
int y,
int width,
int height)
Get the initial point to start calling paintTextElements(). |
void |
paint(java.awt.Component component,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paint of the text on the labelView. |
protected void |
paintTextElement(java.awt.Graphics g,
TextElement element,
int x,
int y)
Paint the text element based on its properties. |
protected void |
paintTextElements(java.awt.Graphics g,
TextElement element,
int x,
int y)
Paint the text element at the specified position. |
protected void |
parseText()
Parse the text into the appropriate elements for display. |
protected void |
processActionEvent(java.awt.event.ActionEvent e)
Process ActionEvents. |
protected void |
processEvent(java.awt.AWTEvent e)
Process events. |
void |
removeActionListener(java.awt.event.ActionListener listener)
Remove an ActionListener from the list of listeners to be notified of an ActionEvent. |
static void |
setDefaultHeight(int newHeight)
|
void |
setDefaultValues()
Set the default internal values for the AnimationIconView. |
static void |
setDefaultWidth(int newWidth)
|
void |
setFont(java.awt.Font font)
Sets the font of the LabelView. |
void |
setForeground(java.awt.Color fgColor)
|
void |
setHorizontalAlignment(int align)
Set the horizontal alignment of the text. |
Methods inherited from class com.sas.visuals.LabelView |
---|
addNotify, attachModel, clone, computePreferredSize, detachModel, getHorizontalAlignment, getInsets, getMinimumSize, getRequiredInterfaces, getTabSpace, getText, getVerticalAlignment, isDefaultModelAttached, isResizeToFit, isWordWrap, paint, print, print, propertyChange, refresh, refresh, resizeToFit, setBounds, setEnabled, setInsets, setResizeToFit, setTabSpace, setText, setVerticalAlignment, setWordWrap, wordWrap |
Methods inherited from interface com.sas.visuals.IconInterface |
---|
getPreferredSize |
Constructor Detail |
---|
public StyledLabelView()
public StyledLabelView(java.lang.String text)
text
- the text displayed by the StyledLabelViewMethod Detail |
---|
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public static int getDefaultHeight()
public static int getDefaultWidth()
public static void setDefaultHeight(int newHeight)
public static void setDefaultWidth(int newWidth)
public void addActionListener(java.awt.event.ActionListener listener)
listener
- the ActionListener to send the ActionEvents to.ActionListener
,
removeActionListener(java.awt.event.ActionListener)
public void removeActionListener(java.awt.event.ActionListener listener)
ActionListener
,
addActionListener(java.awt.event.ActionListener)
public void paint(java.awt.Component component, java.awt.Graphics g, int x, int y, int width, int height)
paint
in interface com.sas.visuals.PainterInterface
paint
in class LabelView
comp
- the Component to paint the IconInterface with.g
- Graphics contextx
- the x coordinatey
- the y coordinatewidth
- the width to be painted.height
- the height to be painted.protected void paintTextElements(java.awt.Graphics g, TextElement element, int x, int y)
g
- the Graphics contextelement
- the text elementx
- the x coordinatey
- the coordinateprotected void paintTextElement(java.awt.Graphics g, TextElement element, int x, int y)
g
- the Graphics contextelement
- the TextElementx
- the x coordinatey
- the y coordinateprotected java.awt.Point getInitialPoint(int x, int y, int width, int height)
x
- the x coordinatey
- the y coordinatewidth
- the width of the componentheight
- the height of the component
protected void parseText()
parseText
in class LabelView
protected java.awt.Dimension calculateTextDisplay()
calculateTextDisplay
in class LabelView
protected void processEvent(java.awt.AWTEvent e)
processEvent
in class java.awt.Component
protected void processActionEvent(java.awt.event.ActionEvent e)
public void setDefaultValues()
setDefaultValues
in interface VisualInterface
setDefaultValues
in interface com.sas.ComponentInterface
setDefaultValues
in class LabelView
ComponentInterface.setDefaultValues()
public void setForeground(java.awt.Color fgColor)
setForeground
in class java.awt.Component
public void setFont(java.awt.Font font)
LabelView
setFont
in interface VisualInterface
setFont
in class LabelView
font
- the font to be used when displaying text in this LabelViewVisualInterface.setFont(java.awt.Font)
public void setHorizontalAlignment(int align)
setHorizontalAlignment
in class LabelView
align
- the horizontal alignment values: LEFT, RIGHT, or CENTERLabelView.getHorizontalAlignment()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |