KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: SLineBorder.java,v 1.5 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 line border around a component.
22  * <span style="border-style: solid; border-width: 3px;">LABEL</span>
23  *
24  * @author <a HREF="mailto:haaf@mercatis.de">Armin Haaf</a>
25  * @author <a HREF="mailto:andre@lison.de">Andre Lison</a>
26  * @version $Revision: 1.5 $
27  */

28 public class SLineBorder
29         extends SAbstractBorder {
30
31     public static final String JavaDoc DOTTED = "dotted";
32     public static final String JavaDoc DASHED = "dashed";
33     public static final String JavaDoc SOLID = "solid";
34
35     private String JavaDoc borderStyle = SOLID;
36
37     public SLineBorder() {
38         setBorderStyle(SOLID);
39     }
40
41     public SLineBorder(int thickness) {
42         super(thickness);
43         setBorderStyle(SOLID);
44     }
45
46     public SLineBorder(Color c) {
47         super(c);
48         setBorderStyle(SOLID);
49     }
50
51     public SLineBorder(Color c, String JavaDoc borderStyle) {
52         super(c);
53         setBorderStyle(borderStyle);
54         setBorderStyle(SOLID);
55     }
56
57     public SLineBorder(int thickness, Insets insets) {
58         super(Color.black, thickness, insets);
59         setBorderStyle(SOLID);
60     }
61
62     public void setBorderStyle(String JavaDoc style) {
63         this.borderStyle = style;
64         attributes.put(CSSProperty.BORDER_STYLE, style);
65     }
66
67     public final String JavaDoc getBorderStyle() { return borderStyle; }
68 }
69
70
71
Popular Tags