|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.visuals.BaseBorder
public class BaseBorder
BaseBorder is a subclass of Border capable of drawing several different styles of borders.
Those styles include: BEZEL, SIMPLE, EMBOSS, and BUTTON. Each of these border styles
can be drawn using either the RAISED or LOWERED lightSources. Text can also
be displayed on the top area of all of the borders.
Notes:
BorderInterface
,
Serialized FormField Summary | |
---|---|
static int |
ALL_SIDES
All sides flags On (combination of com.sas.geometry.Orientations TOP,BOTTOM,LEFT, and RIGHT flags |
static int |
BEZEL
A BEZEL style border, also the DEFAULT border for the BaseBorder class |
static int |
BUTTON
A BUTTON style border, uses the java.awt.SystemColor class control colors |
static int |
CENTER
Text CENTER alignment |
static int |
EMBOSS
A EMBOSS style border |
static int |
LEFT
Text LEFT alignment |
static java.lang.String |
RB_KEY
|
static int |
RIGHT
Text RIGHT alignment |
static int |
SIMPLE
A SIMPLE style single color border |
Fields inherited from class com.sas.visuals.Border |
---|
baseColor, baseColorJ, borderWidth, lightSource, style |
Fields inherited from interface com.sas.visuals.BorderInterface |
---|
BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, LOWERED, NONE, RAISED, TOP_LEFT, TOP_RIGHT |
Constructor Summary | |
---|---|
BaseBorder()
Default Constructor. |
|
BaseBorder(int style)
Constructor to create a BaseBorder with the specified style. |
|
BaseBorder(int style,
int ltSrc)
Constructor to create a BaseBorder with the specified style and lightSource. |
|
BaseBorder(int style,
int ltSrc,
int width)
Constructor to create a BaseBorder with the specified style, lightSource and width. |
|
BaseBorder(int style,
int ltSrc,
int width,
java.awt.Color base)
Constructor to create a BaseBorder with the specified style, lightSource, width, and base color. |
|
BaseBorder(int style,
int ltSrc,
int width,
java.awt.Color base,
java.awt.Color highlight,
java.awt.Color shadow)
Constructor to create a BaseBorder with the specified style, lightSource, width, base color, highlight color, and shadow color. |
|
BaseBorder(int style,
int ltSrc,
int width,
java.awt.Color base,
java.awt.Color highlight,
java.awt.Color shadow,
java.lang.String txt,
int align,
int margin,
java.awt.Font f)
Constructor to create a BaseBorder with the specified style, lightSource, width, base color, highlight color, and shadow color. |
Method Summary | |
---|---|
static void |
drawBezel(java.awt.Graphics g,
int x,
int y,
int width,
int height,
java.awt.Color top,
java.awt.Color left,
java.awt.Color bottom,
java.awt.Color right,
int borderWidth,
int sides)
Convenience method for drawing a bezel with the specified colors and border width. |
static void |
drawBezel(java.awt.Graphics g,
int x,
int y,
int width,
int height,
java.awt.Color topLeft,
java.awt.Color bottomRight,
int borderWidth)
Convenience method for drawing a bezel with the specified colors and border width. |
static void |
drawEmboss(java.awt.Graphics g,
int x,
int y,
int width,
int height,
java.awt.Color top,
java.awt.Color bottom,
int borderWidth)
Convenience method for drawing an embossed border with the specified top and bottom colors and border width. |
static void |
drawEmboss(java.awt.Graphics g,
int x,
int y,
int width,
int height,
java.awt.Color top,
java.awt.Color bottom,
int borderWidth,
int sides)
Convenience method for drawing an embossed border with the specified top and bottom colors and border width. |
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. |
boolean |
equals(java.lang.Object item)
Check if an object is equal to this BaseBorder. |
java.awt.Color |
getBackgroundColor()
Get the background Color used for this BaseBorder when text is drawn. |
int |
getBorderWidth()
Get the width of the BaseBorder |
java.awt.Component |
getComponent()
Get the component the border is drawn on. |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
Returns information used by the com.sas.beans.Introspector to
augment the automatically introspected information about this BaseBorder. |
java.awt.Font |
getFont()
Get the font used to display the border text. |
java.awt.Color |
getForegroundColor()
Get the foreground Color used for this BaseBorder when text is drawn. |
java.awt.Color |
getHighlightColor()
Get the highlight Color used for this BaseBorder. |
java.awt.Insets |
getInsets(java.awt.Component comp)
Get the Insets of the Border on the specified component. |
java.awt.Color |
getShadowColor()
Get the shadow Color used for this BaseBorder. |
int |
getSidesPainted()
Get the ORed bit flags indicating which sides will be painted by the border. |
java.lang.String |
getText()
Get the text to be displayed in the border. |
int |
getTextAlignment()
Get the alignment of the text on the top line of the border: LEFT, RIGHT, or CENTER. |
int |
getTextGap()
Get the gap between the text and the border line. |
int |
getTextMargin()
Get the pixel margin for the text when it is aligned to the LEFT or the RIGHT side. |
int |
hashCode()
|
static void |
paintBorder(java.awt.Graphics g,
int x,
int y,
int width,
int height,
java.awt.Color highlight,
java.awt.Color shadow,
int style,
int bWidth,
int lSource,
int sides)
Paint the border given all the major parameters to describe the border. |
protected java.lang.String |
paramString()
Used in the toString() method |
void |
setBackgroundColor(java.awt.Color c)
Set the background Color for this BaseBorder, used as background for the text. |
void |
setBaseColor(java.awt.Color c)
Set the base Color for this BaseBorder. |
void |
setBorderWidth(int width)
Set the border width for this BaseBorder. |
void |
setComponent(java.awt.Component comp)
Set the component used to find the backgroundColor, foregroundColor, or font if they are not set. |
void |
setFont(java.awt.Font f)
Set the font to be used to display the text on the border. |
void |
setForegroundColor(java.awt.Color c)
Set the foreground Color for this BaseBorder, used as foreground for the text. |
void |
setHighlightColor(java.awt.Color c)
Set the highlight Color for this BaseBorder. |
void |
setShadowColor(java.awt.Color c)
Set the shadow Color for this BaseBorder. |
void |
setSidesPainted(int sides)
Set the ORed bit flags indicating which sides to paint. |
void |
setText(java.lang.String txt)
Set the text to be displayed on the top area of the border. |
void |
setTextAlignment(int a)
Set the text alignment to CENTER, LEFT, or RIGHT for display on the top area of the border. |
void |
setTextGap(int g)
Set the gap between the text and the border line. |
void |
setTextMargin(int m)
Set the margin between the edge of the border the text is aligned to and the text when the alignment is LEFT or RIGHT. |
java.lang.String |
toString()
Returns a string with all this BaseBorder information, inccluding style, alignment, and entire border structure. |
Methods inherited from class com.sas.visuals.Border |
---|
clone, drawInRect, drawInRect, drawInRect, getBaseColor, getBottomMargin, getInsets, getInteriorBounds, getInteriorBounds, getLeftMargin, getLightSource, getRightMargin, getStyle, getTopMargin, setLightSource, setStyle |
Field Detail |
---|
public static final java.lang.String RB_KEY
public static final int CENTER
public static final int RIGHT
public static final int LEFT
public static final int ALL_SIDES
public static final int BEZEL
public static final int SIMPLE
public static final int EMBOSS
public static final int BUTTON
Constructor Detail |
---|
public BaseBorder()
public BaseBorder(int style)
style
- the style border to be drawnpublic BaseBorder(int style, int ltSrc)
style
- the style border to be drawnltSrc
- the lightSource to draw the border withpublic BaseBorder(int style, int ltSrc, int width)
style
- the style border to be drawnltSrc
- the lightSource to draw the border withwidth
- border widthpublic BaseBorder(int style, int ltSrc, int width, java.awt.Color base)
style
- the style border to be drawnltSrc
- the lightSource to draw the border withwidth
- border widthbase
- base color for highlight and shadow colors of the borderpublic BaseBorder(int style, int ltSrc, int width, java.awt.Color base, java.awt.Color highlight, java.awt.Color shadow)
style
- the style border to be drawnltSrc
- the lightSource to draw the border withwidth
- border widthbase
- color for when the simple style is usedhighlight
- the top/left color when the border is RAISED;
the bottom/right color when the border is LOWERED.shadow
- the top/left color when the border is LOWERED;
the bottom/right color when the border is RAISED.public BaseBorder(int style, int ltSrc, int width, java.awt.Color base, java.awt.Color highlight, java.awt.Color shadow, java.lang.String txt, int align, int margin, java.awt.Font f)
style
- the style border to be drawnltSrc
- the lightSource to draw the border withwidth
- border widthbase
- color for when the simple style is usedhighlight
- the top/left color when the border is RAISED;
the bottom/right color when the border is LOWERED.shadow
- the top/left color when the border is LOWERED;
the bottom/right color when the border is RAISED.Method Detail |
---|
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
com.sas.beans.Introspector
to
augment the automatically introspected information about this BaseBorder.
public int getSidesPainted()
public void setSidesPainted(int sides)
sides
- the ORed bit flags of the sides that will be painted.public static void drawBezel(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color topLeft, java.awt.Color bottomRight, int borderWidth)
g
- 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 rectangletopLeft
- the color used on the top and left sidesbottomRight
- the color used on the bottom and right sidesborderWidth
- the width of the bezel sides.public static void drawBezel(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color top, java.awt.Color left, java.awt.Color bottom, java.awt.Color right, int borderWidth, int sides)
g
- 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 rectangletop
- the color used on the top sidesleft
- the color used on the left sidesbottom
- the color used on the bottom sidesright
- the color used on the right sidesborderWidth
- the width of the bezel sides.sides
- the sides to be drawn.public static void drawEmboss(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color top, java.awt.Color bottom, int borderWidth)
g
- 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 rectangletop
- the color used on the top part of the embossbottom
- the color used on the bottom part of the embossborderWidth
- the width of the bezel sides.public static void drawEmboss(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color top, java.awt.Color bottom, int borderWidth, int sides)
g
- 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 rectangletop
- the color used on the top part of the embossbottom
- the color used on the bottom part of the embossborderWidth
- the width of the bezel sides.sides
- the sides to be drawn.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 int getBorderWidth()
getBorderWidth
in interface BorderInterface
getBorderWidth
in class Border
setBorderWidth(int)
public java.awt.Component getComponent()
setComponent(java.awt.Component)
public java.awt.Font getFont()
setFont(java.awt.Font)
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()
getText
in interface com.sas.lang.StringDataInterface
setText(java.lang.String)
public int getTextAlignment()
setTextAlignment(int)
,
Orientations
public int getTextGap()
setTextGap(int)
public int getTextMargin()
setTextMargin(int)
public java.awt.Color getBackgroundColor()
setBackgroundColor(java.awt.Color)
public java.awt.Color getForegroundColor()
setForegroundColor(java.awt.Color)
public java.awt.Color getHighlightColor()
setHighlightColor(java.awt.Color)
public java.awt.Color getShadowColor()
setShadowColor(java.awt.Color)
public static void paintBorder(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color highlight, java.awt.Color shadow, int style, int bWidth, int lSource, int sides)
g
- the Graphics contextx
- the x position of the bordery
- the y position of the borderwidth
- the width of the borderheight
- the height of the borderhighlight
- the highlight color of the bordershadow
- the shadow color of the borderstyle
- the style of the borderbWidth
- the border width of the borderlSource
- the lightSource of the bordersides
- the sides to be drawn on the border NOT IMPLEMENTEDpublic void setBorderWidth(int width)
setBorderWidth
in interface BorderInterface
setBorderWidth
in class Border
width
- desired width in pixelsgetBorderWidth()
public void setComponent(java.awt.Component comp)
comp
- the component the border is to be drawn ongetComponent()
public void setFont(java.awt.Font f)
f
- the font that the text is to be displayed ingetFont()
public void setText(java.lang.String txt)
setText
in interface com.sas.lang.StringDataInterface
txt
- text to be displayed on this BaseBordergetText()
public void setTextAlignment(int a)
a
- the int value CENTER, LEFT, or RIGHT to set the text alignment on bordergetTextAlignment()
public void setTextGap(int g)
g
- the gap at the start and end of the text where the border is not drawn.getTextGap()
public void setTextMargin(int m)
m
- the desired int value in pixels for the border widthgetTextMargin()
public void setBackgroundColor(java.awt.Color c)
c
- color to set background withgetBackgroundColor()
public void setForegroundColor(java.awt.Color c)
c
- color to set the foreground withgetForegroundColor()
public void setBaseColor(java.awt.Color c)
setBaseColor
in class Border
c
- base color for this BaseBorderBorder.getBaseColor()
public void setHighlightColor(java.awt.Color c)
c
- color represent the highlight color of the light sourcegetHighlightColor()
public void setShadowColor(java.awt.Color c)
c
- color of the shadow color of the BaseBordergetShadowColor()
protected java.lang.String paramString()
toString()
method
paramString
in class Border
toString()
public java.lang.String toString()
toString
in class Border
public int hashCode()
hashCode
in class Border
public boolean equals(java.lang.Object item)
equals
in class Border
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |