40 |
|
|
41 |
import java.awt.Dimension; |
import java.awt.Dimension; |
42 |
import java.awt.Graphics; |
import java.awt.Graphics; |
43 |
|
import java.awt.Rectangle; |
44 |
|
|
45 |
import javax.accessibility.Accessible; |
import javax.accessibility.Accessible; |
46 |
import javax.swing.JComponent; |
import javax.swing.JComponent; |
87 |
*/ |
*/ |
88 |
public ComponentUI() |
public ComponentUI() |
89 |
{ |
{ |
90 |
|
// Nothing to do here. |
91 |
} |
} |
92 |
|
|
93 |
|
|
159 |
*/ |
*/ |
160 |
public void paint(Graphics g, JComponent c) |
public void paint(Graphics g, JComponent c) |
161 |
{ |
{ |
162 |
|
// Nothing is done here. This method is meant to be overridden by |
163 |
|
// subclasses. |
164 |
} |
} |
165 |
|
|
166 |
|
|
186 |
if (c.isOpaque()) |
if (c.isOpaque()) |
187 |
{ |
{ |
188 |
g.setColor(c.getBackground()); |
g.setColor(c.getBackground()); |
189 |
|
Rectangle clip = g.getClipBounds(); |
190 |
g.fillRect(0, 0, c.getWidth(), c.getHeight()); |
g.fillRect(0, 0, c.getWidth(), c.getHeight()); |
191 |
} |
} |
192 |
paint(g, c); |
paint(g, c); |
193 |
} |
} |
194 |
|
|
|
|
|
195 |
/** |
/** |
196 |
* Determines the preferred size of a component. The default |
* Determines the preferred size of a component. The default |
197 |
* implementation returns <code>null</code>, which means that |
* implementation returns <code>null</code>, which means that |