From 14e33369646f450af13418003d29d0721144321d Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 29 Dec 1998 21:10:42 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'ACE-4_6_10'. --- java/gjt/Separator.java | 90 ------------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 java/gjt/Separator.java (limited to 'java/gjt/Separator.java') diff --git a/java/gjt/Separator.java b/java/gjt/Separator.java deleted file mode 100644 index 6bd610e1ad9..00000000000 --- a/java/gjt/Separator.java +++ /dev/null @@ -1,90 +0,0 @@ -package gjt; - -import java.awt.*; - -/** - * A separator that is drawn either vertically or horizontally - * depending upon how it is laid out. Can be drawn either - * etched-in or etched-out, with varying thicknesses. Both - * thickness and etching are settable at construction time - * only.

- * - * Default thickness is 2 pixels and default etching is - * Etching.IN. Note that thicknesses greater than 4 loose the - * etching effect.

- * - * @version 1.0, Apr 1 1996 - * @author David Geary - * @see Etching - * @see gjt.test.SeparatorTest - */ -public class Separator extends Canvas { - static private Etching _defaultEtching = Etching.IN; - static private int _defaultThickness = 2; - - private Etching etching; - private int thickness; - - public Separator() { - this(_defaultThickness, _defaultEtching); - } - public Separator(int thickness) { - this(thickness, _defaultEtching); - } - public Separator(Etching etching) { - this(_defaultThickness, etching); - } - public Separator(int thickness, Etching etching) { - this.etching = etching; - this.thickness = thickness; - resize(thickness, thickness); - } - public Dimension minimumSize() { - return preferredSize(); - } - public Dimension preferredSize() { - return new Dimension(thickness, thickness); - } - public void paint(Graphics g) { - Dimension size = size(); - Color brighter = getBackground().brighter().brighter(); - Color darker = getBackground().darker().darker(); - - if(etching == Etching.IN) { - if(size.width > size.height) - paintHorizontal(g, size, darker, brighter); - else - paintVertical(g, size, darker, brighter); - } - else { - if(size.width > size.height) - paintHorizontal(g, size, brighter, darker); - else - paintVertical(g, size, brighter, darker); - } - } - public String paramString() { - Dimension size = size(); - Orientation orient = size.width > size.height ? - Orientation.HORIZONTAL : - Orientation.VERTICAL; - return super.paramString() + "thickness=" + - thickness + "," + etching + "," + orient; - } - private void paintHorizontal(Graphics g, Dimension size, - Color top, Color bottom) { - g.setColor(top); - g.fillRect(0, (size.height/2) - (thickness/2), - size.width, thickness/2); - g.setColor(bottom); - g.fillRect(0, size.height/2, size.width, thickness/2); - } - private void paintVertical(Graphics g, Dimension size, - Color left, Color right) { - g.setColor(left); - g.fillRect((size.width/2) - (thickness/2), - 0, thickness/2, size.height); - g.setColor(right); - g.fillRect(size.width/2, 0, thickness/2, size.height); - } -} -- cgit v1.2.1