com.sas.visuals
Class Border

com.sas.visuals.Border
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.PublicClonable, com.sas.ViewInterface, BorderInterface, MultipleValueEventSourceInterface, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener
Direct Known Subclasses:
BaseBorder, CompositeBorder, TabBorder, TextBorder, Windows95Border

public abstract class Border
implements com.sas.PublicClonable, BorderInterface

Border is an abstract class to draw borders around components. There are two abstract methods that need to be overridden and then the Border can be used by components that support a border property. A style can be set to make changes to borders, without having to write a class for each type of Border.
Notes:

Changes:

See Also:
BaseBorder, BorderInterface, Serialized Form

Field Summary
protected  Color baseColor
          not used
protected  java.awt.Color baseColorJ
          color value for the base color of the border
protected  int borderWidth
          int value representing the width of the border
protected  int lightSource
          int value (TOP_LEFT ) representing the light source, derived from com.sas.visuals.BorderInterface
static java.lang.String RB_KEY
           
protected  int style
          int value representing the style of the border intially set to NONE Derived from com.sas.geometry.Orientations
 
Fields inherited from interface com.sas.visuals.BorderInterface
BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, LOWERED, NONE, RAISED, TOP_LEFT, TOP_RIGHT
 
Constructor Summary
Border()
          Default Constructor
 
Method Summary
 java.lang.Object clone()
          Returns a Border clone of the original Border component.
abstract  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 object)
           
 java.awt.Color getBaseColor()
          Gets the base color
 int getBorderWidth()
          Gets the border width.
 int getBottomMargin()
          Gets the width of the Border's bottom side.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about this Border.
 java.awt.Insets getInsets()
          Gets the Insets of this Border.
abstract  java.awt.Insets getInsets(java.awt.Component comp)
          Gets the Insets of the Border on the specified component.
 java.awt.Rectangle getInteriorBounds(int x, int y, int width, int height)
          Gets the Border's interior using the given rectangle.
 java.awt.Rectangle getInteriorBounds(java.awt.Rectangle exterior)
          Gets the Border's interior bounds using the given rectangle.
 int getLeftMargin()
          Gets the width of the Border's left side.
 int getLightSource()
          Gets the Light Source of the Border.
 int getRightMargin()
          Gets the width of the Border's right side.
 int getStyle()
          Gets the style of the Border.
 int getTopMargin()
          Gets the width of the Border's top side.
 int hashCode()
           
protected  java.lang.String paramString()
          Used in the toString method
 void setBaseColor(java.awt.Color c)
          Sets the base color.
 void setBorderWidth(int width)
          Sets the border width.
 void setLightSource(int ltSrc)
          Sets the type of the Border.
 void setStyle(int s)
          Sets the style of the Border.
 java.lang.String toString()
          Returns the border information with insets
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

lightSource

protected int lightSource
int value (TOP_LEFT ) representing the light source, derived from com.sas.visuals.BorderInterface


style

protected int style
int value representing the style of the border intially set to NONE Derived from com.sas.geometry.Orientations


borderWidth

protected int borderWidth
int value representing the width of the border


baseColor

protected Color baseColor
not used


baseColorJ

protected java.awt.Color baseColorJ
color value for the base color of the border

Constructor Detail

Border

public Border()
Default Constructor

Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about this Border.

Returns:
the ExtendedBeanInfo for this class

drawInRect

public 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

Parameters:
g - the Graphics context
rect - the rectangle to draw the border in

drawInRect

public 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. Calls the abstract version of drawInRect() with null for the component

Parameters:
g - the Graphics context
rect - the rectangle to draw the Border in
lSource - the lightSource the Border should use

drawInRect

public void drawInRect(java.awt.Graphics g,
                       int x,
                       int y,
                       int width,
                       int height)
Draw the Border within the specified rectangle. Calls the abstract version of drawInRect() with null for the component

Specified by:
drawInRect in interface BorderInterface
Parameters:
g - the Graphics context
x - the x position of the border rectangle
y - the y position of the border rectangle
width - the width of the border rectangle
height - the height of the border rectangle

drawInRect

public abstract 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.

Specified by:
drawInRect in interface BorderInterface
Parameters:
comp - the java.awt.Component to draw the border on, can be null
g - the Graphics context
x - the x position of the border rectangle
y - the y position of the border rectangle
width - the width of the border rectangle
height - the height of the border rectangle
See Also:
BorderInterface

getBaseColor

public java.awt.Color getBaseColor()
Gets the base color

Returns:
color of the border

getBorderWidth

public int getBorderWidth()
Gets the border width.

Specified by:
getBorderWidth in interface BorderInterface
Returns:
int value of the border width in pixels

getInsets

public java.awt.Insets getInsets()
Gets the Insets of this Border. Calls the abstract version of getInsets() with null for the component

Specified by:
getInsets in interface BorderInterface
Returns:
the Insets of the Border which always returns null.

getInsets

public abstract java.awt.Insets getInsets(java.awt.Component comp)
Gets the Insets of the Border on the specified component.

Specified by:
getInsets in interface BorderInterface
Parameters:
comp - the component to draw the border on, can be null.
Returns:
the Insets of the Border.

getInteriorBounds

public java.awt.Rectangle getInteriorBounds(java.awt.Rectangle exterior)
Gets the Border's interior bounds using the given rectangle.

Parameters:
exterior - the exterior bounds of the border.
Returns:
the interior bounds of the border based on the exterior bounds.

getInteriorBounds

public java.awt.Rectangle getInteriorBounds(int x,
                                            int y,
                                            int width,
                                            int height)
Gets the Border's interior using the given rectangle.

Parameters:
x - the x position of the exterior rectangle
y - the y position of the exterior rectangle
width - the width of the exterior rectangle
height - the height of the exterior rectangle
Returns:
the interior bounds of the border based on the exterior bounds.

getLightSource

public int getLightSource()
Gets the Light Source of the Border.

Specified by:
getLightSource in interface BorderInterface
Returns:
one of the lightSource values from com.sas.visuals.BorderInterface
See Also:
BorderInterface

getStyle

public int getStyle()
Gets the style of the Border.

Specified by:
getStyle in interface BorderInterface
Returns:
NONE or DEFAULT or some id set by a subclass

getLeftMargin

public int getLeftMargin()
Gets the width of the Border's left side.

Returns:
int value of the left margin of the border in pixels

getBottomMargin

public int getBottomMargin()
Gets the width of the Border's bottom side.

Returns:
int value of the bottom margin of the border in pixels

getRightMargin

public int getRightMargin()
Gets the width of the Border's right side.

Returns:
int value of the right margin of the border in pixels

getTopMargin

public int getTopMargin()
Gets the width of the Border's top side.

Returns:
int value of the top margin of the border in pixels

setBaseColor

public void setBaseColor(java.awt.Color c)
Sets the base color.

Parameters:
c - the desired border color

setBorderWidth

public void setBorderWidth(int width)
Sets the border width.

Specified by:
setBorderWidth in interface BorderInterface
Parameters:
width - the desired border width

setStyle

public void setStyle(int s)
Sets the style of the Border.

Specified by:
setStyle in interface BorderInterface
Parameters:
s - NONE or DEFAULT or some id set by a subclass

setLightSource

public void setLightSource(int ltSrc)
Sets the type of the Border.

Specified by:
setLightSource in interface BorderInterface
Parameters:
ltSrc - one of the lightSource values from com.sas.visuals.BorderInterface
See Also:
BorderInterface

paramString

protected java.lang.String paramString()
Used in the toString method

See Also:
toString()

toString

public java.lang.String toString()
Returns the border information with insets

Overrides:
toString in class java.lang.Object
Returns:
string representing the border information

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a Border clone of the original Border component.

Specified by:
clone in interface com.sas.PublicClonable
Overrides:
clone in class com.sas.Component
Returns:
a clone object which is a com.sas.visuals.Border
Throws:
java.lang.CloneNotSupportedException - if it component cannot be cloned.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object



Copyright © 2009 SAS Institute Inc. All Rights Reserved.