com.sas.visuals
Class CompositeBorder

com.sas.visuals.CompositeBorder
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

public class CompositeBorder

CompositeBorder is a subclass of Border that can combine two BorderInterface objects into one border. The class draws one border inside the other border with a gap amount between the borders.
Notes:


See Also:
BorderInterface, Serialized Form

Field Summary
protected  int borderGap
           
protected  BorderInterface extBorder
           
protected  Border exteriorBorder
           
protected  BorderInterface intBorder
           
protected  Border interiorBorder
           
static java.lang.String RB_KEY
           
 
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
CompositeBorder()
          Default Constructor.
CompositeBorder(BorderInterface exterior, BorderInterface interior, int gap)
          Constructor to create a CompositeBorder out of the specified exterior and interior border and with the specified gap between them.
 
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.
 int getBorderGap()
          Get the gap between the interior and exterior borders Borders
 int getBorderWidth()
          Get the border width.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
           
 BorderInterface getExteriorBorder()
          Get the exterior Border of the CompositeBorder
 java.awt.Insets getInsets(java.awt.Component comp)
          Get the Insets of the Border on the specified component.
 BorderInterface getInteriorBorder()
          Get the interior Border of the CompositeBorder
 void propertyChange(java.beans.PropertyChangeEvent event)
          Handle propertyChange events from either the interior or exterior borders.
 void setBaseColor(java.awt.Color c)
          Deprecated.  
 void setBorderGap(int gap)
          Set the gap between the exterior and the interior borders.
 void setBorderWidth(int width)
          Set the border width.
 void setExteriorBorder(BorderInterface exterior)
          Set the Exterior Border to the specified Border.
 void setInteriorBorder(BorderInterface interior)
          Set the Interior Border to the specified Border.
 void setLightSource(int ltSrc)
          Set the light source of the CompositeBorder.
 void setStyle(int s)
          Set the style of the CompositeBorder.
 
Methods inherited from class com.sas.visuals.Border
clone, drawInRect, drawInRect, drawInRect, equals, getBaseColor, getBottomMargin, getInsets, getInteriorBounds, getInteriorBounds, getLeftMargin, getLightSource, getRightMargin, getStyle, getTopMargin, hashCode, paramString, toString
 

Field Detail

RB_KEY

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

borderGap

protected int borderGap

interiorBorder

protected Border interiorBorder

exteriorBorder

protected Border exteriorBorder

intBorder

protected BorderInterface intBorder

extBorder

protected BorderInterface extBorder
Constructor Detail

CompositeBorder

public CompositeBorder()
Default Constructor. Creates a CompositeBorder using a border Gap of 0 and two BaseBorders with styles of NONE.


CompositeBorder

public CompositeBorder(BorderInterface exterior,
                       BorderInterface interior,
                       int gap)
Constructor to create a CompositeBorder out of the specified exterior and interior border and with the specified gap between them.

Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

drawInRect

public 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
Specified by:
drawInRect in class Border
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

getBorderGap

public int getBorderGap()
Get the gap between the interior and exterior borders Borders


getBorderWidth

public int getBorderWidth()
Get the border width.

Specified by:
getBorderWidth in interface BorderInterface
Overrides:
getBorderWidth in class Border
Returns:
the combined borderWidths of the interior and exterior borders and the borderGap.

getExteriorBorder

public BorderInterface getExteriorBorder()
Get the exterior Border of the CompositeBorder


getInteriorBorder

public BorderInterface getInteriorBorder()
Get the interior Border of the CompositeBorder


getInsets

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

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

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Handle propertyChange events from either the interior or exterior borders.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Overrides:
propertyChange in class com.sas.Component
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

setBaseColor

public void setBaseColor(java.awt.Color c)
Deprecated. 

Set the base Color for the interior and exterior borders. This will also set the highlightColor to baseColor.brighter() and the shadowColor to baseColor.darker().

Overrides:
setBaseColor in class Border
Parameters:
c - the desired border color

setBorderGap

public void setBorderGap(int gap)
Set the gap between the exterior and the interior borders.


setBorderWidth

public void setBorderWidth(int width)
Set the border width. Overridden to do nothing. The borderWidth is based on the borderWidth of both the interior and exterior borders and the border Gap.

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

setExteriorBorder

public void setExteriorBorder(BorderInterface exterior)
Set the Exterior Border to the specified Border. If set to null the exteriorBorder will be set to a new BaseBorder with style = NONE.


setInteriorBorder

public void setInteriorBorder(BorderInterface interior)
Set the Interior Border to the specified Border. If set to null the interiorBorder will be set to a new BaseBorder with style = NONE.


setLightSource

public void setLightSource(int ltSrc)
Set the light source of the CompositeBorder. This will set the light source of both the exterior and the interior borders to the specified style.

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

setStyle

public void setStyle(int s)
Set the style of the CompositeBorder. This will set the style of both the exterior and the interior borders to the specified style.

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



Copyright © 2009 SAS Institute Inc. All Rights Reserved.