1 |
/* Border.java -- |
/* Border.java -- |
2 |
Copyright (C) 2002 Free Software Foundation, Inc. |
Copyright (C) 2003 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
42 |
import java.awt.Graphics; |
import java.awt.Graphics; |
43 |
import java.awt.Insets; |
import java.awt.Insets; |
44 |
|
|
45 |
|
|
46 |
|
/** |
47 |
|
* An interface for decorative or spacing borders around a Component. |
48 |
|
* |
49 |
|
* <p>To reduce memory consumption, several Components may share a |
50 |
|
* single Border instance. {@link javax.swing.BorderFactory} is a |
51 |
|
* factory class for producing commonly used shared borders. |
52 |
|
* |
53 |
|
* @see javax.swing.BorderFactory |
54 |
|
* @see EmptyBorder |
55 |
|
* @see CompoundBorder |
56 |
|
* @see BevelBorder |
57 |
|
* @see EtchedBorder |
58 |
|
* @see LineBorder |
59 |
|
* @see MatteBorder |
60 |
|
* @see SoftBevelBorder |
61 |
|
* @see TitledBorder |
62 |
|
* @see AbstractBorder |
63 |
|
* |
64 |
|
* @author Ronald Veldema (rveldema@cs.vu.nl) |
65 |
|
* @author Michael Koch (konqueror@gmx.de) |
66 |
|
* @author Sascha Brawer (brawer@dandelis.ch) |
67 |
|
*/ |
68 |
public interface Border |
public interface Border |
69 |
{ |
{ |
70 |
public Insets getBorderInsets (Component c); |
/** |
71 |
public boolean isBorderOpaque (); |
* Paints the border for a given component. |
72 |
public void paintBorder (Component c, Graphics g, int x, int y, |
* |
73 |
int width, int height); |
* @param c the component whose border is to be painted. |
74 |
|
* @param g the graphics for painting. |
75 |
|
* @param x the horizontal position for painting the border. |
76 |
|
* @param y the vertical position for painting the border. |
77 |
|
* @param width the width of the available area for painting the border. |
78 |
|
* @param height the height of the available area for painting the border. |
79 |
|
*/ |
80 |
|
public void paintBorder(Component c, Graphics g, |
81 |
|
int x, int y, int width, int height); |
82 |
|
|
83 |
|
|
84 |
|
/** |
85 |
|
* Measures the width of this border. |
86 |
|
* |
87 |
|
* @param c the component whose border is to be measured. |
88 |
|
* |
89 |
|
* @return an Insets object whose <code>left</code>, <code>right</code>, |
90 |
|
* <code>top</code> and <code>bottom</code> fields indicate the |
91 |
|
* width of the border at the respective edge. |
92 |
|
*/ |
93 |
|
public Insets getBorderInsets(Component c); |
94 |
|
|
95 |
|
|
96 |
|
/** |
97 |
|
* Determines whether this border fills every pixel in its area |
98 |
|
* when painting. |
99 |
|
* |
100 |
|
* @return <code>true</code> if the border is fully opaque, or |
101 |
|
* <code>false</code> if some pixels of the background |
102 |
|
* can shine through the border. |
103 |
|
*/ |
104 |
|
public boolean isBorderOpaque(); |
105 |
} |
} |