|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.visuals.TextBorder
public class TextBorder
TextBorder is a subclass of Border that draws Text on top of another Border.
The text can be aligned horizontally or vertically and placed on either the
top or the bottom side of the border.
BorderInterface
,
Border
,
Serialized FormField Summary | |
---|---|
protected Border |
border
|
static int |
BOTTOM
Text BOTTOM alignment |
static int |
CENTER
Text CENTER alignment |
protected java.awt.Component |
component
|
static int |
LEFT
Text LEFT alignment |
static int |
RIGHT
Text RIGHT alignment |
protected java.lang.String |
text
|
protected int |
textBorderGap
|
protected java.awt.Color |
textColor
|
protected java.awt.Font |
textFont
|
protected int |
textHAlignment
|
protected int |
textMargin
|
protected int |
textPosition
|
protected int |
textVAlignment
|
static int |
TOP
Text TOP alignment |
Fields inherited from class com.sas.visuals.Border |
---|
baseColor, baseColorJ, borderWidth, lightSource, RB_KEY, style |
Fields inherited from interface com.sas.visuals.BorderInterface |
---|
BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, LOWERED, NONE, RAISED, TOP_LEFT, TOP_RIGHT |
Constructor Summary | |
---|---|
TextBorder()
Default constructor. |
|
TextBorder(java.awt.Component comp,
java.lang.String txt)
Constructor that sets the component and text to use. |
|
TextBorder(java.awt.Component comp,
java.lang.String txt,
Border b)
Constructor that sets the component, text, and border to use. |
|
TextBorder(java.awt.Component comp,
java.lang.String txt,
Border b,
int textHAlign,
int textVAlign,
int textPos)
Constructor that sets several attributes of the TextBorder. |
|
TextBorder(java.awt.Component comp,
java.lang.String txt,
Border b,
int textHAlign,
int textVAlign,
int textPos,
java.awt.Font f)
Constructor that sets several attributes of the TextBorder. |
|
TextBorder(java.awt.Component comp,
java.lang.String txt,
Border b,
int textHAlign,
int textVAlign,
int textPos,
java.awt.Font f,
java.awt.Color c)
Constructor that sets several attributes of the TextBorder. |
Method Summary | |
---|---|
void |
drawInRect(java.awt.Component comp,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Draw the Border within the specified rectangle on the specified component. |
Border |
getBorder()
Get the border the text is being drawn on |
java.awt.Component |
getComponent()
Get the component used to get the font and background/foreground color information to draw the border. |
int |
getHorizontalAlignment()
Get the horizontal alignment of the text. |
java.awt.Insets |
getInsets(java.awt.Component comp)
Get the Insets of the Border on the specified component. |
java.lang.String |
getText()
Get the text drawn on the border. |
int |
getTextBorderGap()
Get the pixel gap between the border and the text when the vertical alignment is not CENTER. |
java.awt.Color |
getTextColor()
Get the color used to draw the text |
java.awt.Font |
getTextFont()
Get the font used to draw the text |
protected int |
getTextHeight(java.awt.Component c)
Get the height of the text based on the specified component. |
int |
getTextMargin()
Get the pixel margin for the text when it is aligned to the LEFT or the RIGHT side. |
int |
getTextPosition()
Get the side the text is positioned on. |
int |
getVerticalAlignment()
Get the vertical alignment of the text. |
void |
setBorder(Border b)
Set the border to draw the text on. |
void |
setComponent(java.awt.Component comp)
Set the component to get the font an foreground/background color information from. |
void |
setHorizontalAlignment(int hAlign)
Set the horizontal alignment of the text. |
void |
setText(java.lang.String txt)
Set the text to draw on the border. |
void |
setTextBorderGap(int gap)
Set the pixel gap between the border and the text when the vertical alignment is not CENTER. |
void |
setTextColor(java.awt.Color c)
Set the color used to draw the text. |
void |
setTextFont(java.awt.Font f)
Set the font used to draw the text. |
void |
setTextMargin(int margin)
Set the pixel margin for the text when it is aligned to the LEFT or the RIGHT side. |
void |
setTextPosition(int textPos)
Set the side the text is positioned on. |
void |
setVerticalAlignment(int vAlign)
Set the vertical alignment of the text. |
Methods inherited from class com.sas.visuals.Border |
---|
clone, drawInRect, drawInRect, drawInRect, equals, getBaseColor, getBorderWidth, getBottomMargin, getExtendedBeanInfo, getInsets, getInteriorBounds, getInteriorBounds, getLeftMargin, getLightSource, getRightMargin, getStyle, getTopMargin, hashCode, paramString, setBaseColor, setBorderWidth, setLightSource, setStyle, toString |
Field Detail |
---|
public static final int CENTER
public static final int RIGHT
public static final int LEFT
public static final int TOP
public static final int BOTTOM
protected java.lang.String text
protected int textBorderGap
protected int textPosition
protected int textHAlignment
protected int textVAlignment
protected int textMargin
protected java.awt.Font textFont
protected java.awt.Color textColor
protected Border border
protected java.awt.Component component
Constructor Detail |
---|
public TextBorder()
public TextBorder(java.awt.Component comp, java.lang.String txt)
comp
- the component used to setup the font and background/foreground colorstxt
- the text to be displayed on the borderpublic TextBorder(java.awt.Component comp, java.lang.String txt, Border b)
comp
- the component used to setup the font and background/foreground colorstxt
- the text to be displayed on the borderb
- the border to draw the text onpublic TextBorder(java.awt.Component comp, java.lang.String txt, Border b, int textHAlign, int textVAlign, int textPos)
comp
- the component used to setup the font and background/foreground colorstxt
- the text to be displayed on the borderb
- the border to draw the text ontextHAlign
- the horizontal alignment of the texttextVAlign
- the vertical alignment of the texttextPos
- the side of the border the text is positioned onpublic TextBorder(java.awt.Component comp, java.lang.String txt, Border b, int textHAlign, int textVAlign, int textPos, java.awt.Font f)
comp
- the component used to setup the font and background/foreground colorstxt
- the text to be displayed on the borderb
- the border to draw the text ontextHAlign
- the horizontal alignment of the texttextVAlign
- the vertical alignment of the texttextPos
- the side of the border the text is positioned onf
- the font used to draw the textpublic TextBorder(java.awt.Component comp, java.lang.String txt, Border b, int textHAlign, int textVAlign, int textPos, java.awt.Font f, java.awt.Color c)
comp
- the component used to setup the font and background/foreground colorstxt
- the text to be displayed on the borderb
- the border to draw the text ontextHAlign
- the horizontal alignment of the texttextVAlign
- the vertical alignment of the texttextPos
- the side of the border the text is positioned onf
- the font used to draw the textc
- the color used to draw the textMethod Detail |
---|
public void drawInRect(java.awt.Component comp, java.awt.Graphics g, int x, int y, int width, int height)
drawInRect
in interface BorderInterface
drawInRect
in class Border
comp
- the java.awt.Component to draw the border on, can be nullg
- the Graphics contextx
- the x position of the border rectangley
- the y position of the border rectanglewidth
- the width of the border rectangleheight
- the height of the border rectangleBorderInterface
public Border getBorder()
public java.awt.Component getComponent()
public int getHorizontalAlignment()
public java.awt.Insets getInsets(java.awt.Component comp)
getInsets
in interface BorderInterface
getInsets
in class Border
comp
- the component to draw the border on, can be null.
public java.lang.String getText()
public int getTextBorderGap()
public java.awt.Color getTextColor()
public java.awt.Font getTextFont()
protected int getTextHeight(java.awt.Component c)
public int getTextMargin()
public int getTextPosition()
public int getVerticalAlignment()
public void setBorder(Border b)
public void setComponent(java.awt.Component comp)
public void setHorizontalAlignment(int hAlign)
hAlign
- the alignment can be: LEFT, RIGHT, or CENTERpublic void setText(java.lang.String txt)
public void setTextBorderGap(int gap)
public void setTextColor(java.awt.Color c)
public void setTextFont(java.awt.Font f)
public void setTextMargin(int margin)
public void setTextPosition(int textPos)
textPos
- the text can be on the TOP or BOTTOM sides.public void setVerticalAlignment(int vAlign)
vAlign
- the alignment can be: TOP, BOTTOM, or CENTER
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |