home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 2.0 KB | 71 lines |
- package symantec.itools.awt.shape;
-
- import java.beans.PropertyVetoException;
- import java.awt.Rectangle;
-
- // 07/30/97 LAB Updated version to 1.1. Line can now be 1 pixel thick if it is
- // in BEVEL_LINE or BEVEL_NONE mode.
- // 08/13/97 LAB Overrode setBevelStyle to reshape the component to have a thickness
- // of two pixels if the bevel style was rasied or lowered. Addresses Mac
- // Bug #3571
-
- /**
- * This is a vertical line component.
- * @version 1.1, July 30, 1997
- * @author Symantec
- */
- public class VerticalLine extends Rect
- {
- /**
- * Constructs a default VerticalLine. The line width is 2.
- */
- public VerticalLine()
- {
- width = 2;
- }
-
- /**
- * Sets the border style of the shape.
- * @see symantec.itools.awt.shape.Shape#getBevelStyle
- *
- * @exception PropertyVetoException
- * if the specified property value is unacceptable
- */
- public void setBevelStyle(int s) throws PropertyVetoException
- {
- if(style != s)
- {
- super.setBevelStyle(s);
- Rectangle r = getBounds();
-
- reshape(r.x, r.y, r.width == 1 ? 1 : 2, r.height);
- validate();
- }
- }
-
- /**
- * Moves and/or resizes this component.
- * This is a standard Java AWT method which gets called to move and/or
- * resize this component. Components that are in containers with layout
- * managers should not call this method, but rely on the layout manager
- * instead.
- *
- * @param x horizontal position in the parent's coordinate space
- * @param y vertical position in the parent's coordinate space
- * @param width the new width
- * @param height the new height
- */
- public void reshape(int x, int y, int width, int height)
- {
- this.height = height;
-
- //Allow a 1 pixel width if the bevel style is line or none.
- if (width == 1 && (style == BEVEL_LINE || style == BEVEL_NONE))
- this.width = 1;
- else
- this.width = 2;
-
- super.reshape(x, y, this.width, height);
- }
- }
-