KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > border > SEtchedBorder


1 /*
2  * $Id: SEtchedBorder.java,v 1.6 2005/05/27 09:17:33 blueshift Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.border;
15
16 import org.wings.style.CSSProperty;
17
18 import java.awt.*;
19
20 /**
21  * Draw a etched border around a component.
22  * <span style="border-style: ridge; border-width: 3px;">RAISED</span>
23  * <span style="border-style: groove; border-width: 3px;">LOWERED</span>
24  *
25  * @author <a HREF="mailto:haaf@mercatis.de">Armin Haaf</a>
26  * @author <a HREF="mailto:andre@lison.de">Andre Lison</a>
27  * @version $Revision: 1.6 $
28  */

29 public class SEtchedBorder
30         extends SAbstractBorder {
31     public static final int RAISED = 0;
32     public static final int LOWERED = 1;
33
34     int etchedType = RAISED;
35
36     public SEtchedBorder() {
37         setEtchedType(RAISED);
38     }
39
40     public SEtchedBorder(int etchedType) {
41         setEtchedType(etchedType);
42     }
43
44     public SEtchedBorder(int etchedType, Insets insets) {
45         super(Color.black, 2, insets);
46         setEtchedType(etchedType);
47     }
48
49     public void setEtchedType(int etchedType) {
50         this.etchedType = etchedType;
51         attributes.put(CSSProperty.BORDER_STYLE, etchedType == RAISED ? "ridge" : "groove");
52     }
53
54     public int getEtchedType() { return etchedType; }
55 }
56
57
58
Popular Tags