|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.visuals.BaseBorder
public class BaseBorder
BaseBorder is a subclass of AbstractBorder 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:
Border
,
Serialized FormField Summary | |
---|---|
static int |
ALL_SIDES
All sides flags On (combination of com.sas.geometry.Orientations TOP,BOTTOM,LEFT, and RIGHT flags |
protected java.awt.Color |
baseColorJ
color value for the base color of the border |
static int |
BEZEL
A BEZEL style border, also the DEFAULT border for the BaseBorder class |
static int |
BOTTOM_LEFT
Bottom/left lightSource |
static int |
BOTTOM_RIGHT
Bottom/right lightSource |
static int |
BUTTON
A BUTTON style border, uses the java.awt.SystemColor class control colors |
static int |
CENTER
Text CENTER alignment |
static int |
DEFAULT
Default border style shown |
static int |
EMBOSS
A EMBOSS style border |
static int |
LEFT
Text LEFT alignment |
protected int |
lightSource
int value (TOP_LEFT ) representing the light source, derived from com.sas.geometry.CornerOrientation |
static int |
LOWERED
Lowered border lightSource |
static int |
NONE
No border style shown |
static int |
RAISED
Raised border lightSource |
static java.lang.String |
RB_KEY
|
static int |
RIGHT
Text RIGHT alignment |
static int |
SIMPLE
A SIMPLE style single color border |
protected int |
style
int value representing the style of the border intially set to NONE Derived from com.sas.geometry.Orientations |
static int |
TOP_LEFT
Top/left lightSource |
static int |
TOP_RIGHT
Top/right lightSource |
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. |
void |
drawInRect(java.awt.Graphics g,
int x,
int y,
int width,
int height)
Draw the Border within the specified rectangle. |
void |
drawInRect(java.awt.Graphics g,
java.awt.Rectangle rect)
Draws the Border within the specified rectangle Calls the abstract version of drawInRect() with null for the component |
void |
drawInRect(java.awt.Graphics g,
java.awt.Rectangle rect,
int lSource)
Convenience method to draw the Border within the specified rectangle with the specified lightSource. |
boolean |
equals(java.lang.Object item)
Check if an object is equal to this BaseBorder. |
void |
firePropertyChange(java.lang.String propertyName,
int oldValue,
int newValue)
Reports a bound property change. |
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Supports reporting bound property changes. |
java.awt.Color |
getBackgroundColor()
Get the background Color used for this BaseBorder when text is drawn. |
java.awt.Color |
getBaseColor()
Gets the base color |
java.awt.Insets |
getBorderInsets(java.awt.Component comp)
Get the Insets of the Border on the specified component. |
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()
Gets the Insets of this Border. |
int |
getLightSource()
Gets the Light Source of the Border. |
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. |
int |
getStyle()
Gets the style of 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()
|
void |
paintBorder(java.awt.Component c,
java.awt.Graphics g,
int x,
int y,
int width,
int height)
Paint the border on the given component. |
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 |
setLightSource(int ltSrc)
Sets the type of the Border. |
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 |
setStyle(int s)
Sets the style of the Border. |
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. |
Field Detail |
---|
public static final java.lang.String RB_KEY
protected java.awt.Color baseColorJ
protected int lightSource
protected int style
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
public static final int NONE
public static final int DEFAULT
public static final int RAISED
public static final int LOWERED
public static final int TOP_LEFT
public static final int TOP_RIGHT
public static final int BOTTOM_RIGHT
public static final int BOTTOM_LEFT
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.
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
public void setFoo(int newValue) { int oldValue = foo; foo = newValue; firePropertyChange("foo", oldValue, newValue); }
propertyName
- the programmatic name of the property that was changedoldValue
- the old value of the propertynewValue
- the new value of the propertyPropertyChangeSupport
public void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)
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.Graphics g, java.awt.Rectangle rect)
g
- the Graphics contextrect
- the rectangle to draw the border inpublic void drawInRect(java.awt.Graphics g, java.awt.Rectangle rect, int lSource)
g
- the Graphics contextrect
- the rectangle to draw the Border inlSource
- the lightSource the Border should usepublic void drawInRect(java.awt.Graphics g, int x, int y, int width, int height)
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 rectanglepublic void drawInRect(java.awt.Component comp, java.awt.Graphics g, int x, int y, int width, int height)
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()
setBorderWidth(int)
public java.awt.Color getBaseColor()
public int getLightSource()
BorderInterface
public int getStyle()
public java.awt.Insets getInsets()
null
.public java.awt.Component getComponent()
setComponent(java.awt.Component)
public java.awt.Font getFont()
setFont(java.awt.Font)
public java.awt.Insets getBorderInsets(java.awt.Component comp)
getBorderInsets
in interface javax.swing.border.Border
getBorderInsets
in class javax.swing.border.AbstractBorder
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 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
paintBorder
in interface javax.swing.border.Border
paintBorder
in class javax.swing.border.AbstractBorder
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 borderpublic 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)
width
- desired width in pixelsgetBorderWidth()
public void setStyle(int s)
s
- NONE or DEFAULT or some id set by a subclasspublic void setLightSource(int ltSrc)
ltSrc
- one of the lightSource values from com.sas.visuals.BorderInterfaceBorderInterface
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)
c
- base color for this BaseBordergetBaseColor()
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
toString()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object item)
equals
in class java.lang.Object
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |