JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Class SwingCellBorder

java.lang.Object
  |
  +--com.klg.jclass.table.SwingCellBorder
All Implemented Interfaces:
CellBorderModel, Serializable

public class SwingCellBorder
extends Object
implements Serializable, CellBorderModel

The SwingCellBorder class implements the CellBorderModel interface to provide cell and frame border drawing using Swing borders.

See Also:
Serialized Form

Field Summary
protected  Border border
           
protected  Component component
           
 
Constructor Summary
SwingCellBorder(Component component, Border border)
          SwingCellBorder
 
Method Summary
 void drawBackground(Graphics gc, int borderWidth, int borderSide, int x, int y, int width, int height, Color top_color, Color bottom_color, Color plain_color)
          Draws a Swing Border around the cell.
 Border getCellBorder()
          Returns the type of border.
 void setComponent(Component c)
          Set the component used to render this border
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

component

protected Component component

border

protected Border border
Constructor Detail

SwingCellBorder

public SwingCellBorder(Component component,
                       Border border)
SwingCellBorder

Parameters:
component - the component that controls the drawing of the border
border - the type of border
Method Detail

setComponent

public void setComponent(Component c)
Set the component used to render this border


getCellBorder

public Border getCellBorder()
Returns the type of border.


drawBackground

public void drawBackground(Graphics gc,
                           int borderWidth,
                           int borderSide,
                           int x,
                           int y,
                           int width,
                           int height,
                           Color top_color,
                           Color bottom_color,
                           Color plain_color)
Draws a Swing Border around the cell. Note that with Swing Borders the width is 1, BorderSides are always BORDERSIDE_ALL and color controlled by Swing.

Specified by:
drawBackground in interface CellBorderModel
Parameters:
gc - the color used for the background
borderWidth - the thickness of the cell border
borderSide - the sides on which to draw the border, a bitwise OR of the following:
BORDERSIDE_ALL, BORDERSIDE_LEFT, BORDERSIDE_RIGHT, BORDERSIDE_TOP, BORDERSIDE_BOTTOM
x - the horizontal start position of the border
y - the vertical start position of the border
width - the border width size
height - the border height size
top_color - the color used for drawing the top of IN borders or the bottom of OUT borders
bottom_color - the color used for drawing the bottom of IN borders or the top of OUT borders
plain_color - the color used to draw the sides of PLAIN borders

Copyright © 2004 Quest Software Inc..
All rights reserved.