242 |
public void paint(Graphics g, Shape s) |
public void paint(Graphics g, Shape s) |
243 |
{ |
{ |
244 |
if (view != null) |
if (view != null) |
245 |
view.paint(g, s); |
view.paint(g, s); |
246 |
} |
} |
247 |
|
|
248 |
|
|
347 |
// Document changed. |
// Document changed. |
348 |
modelChanged(); |
modelChanged(); |
349 |
} |
} |
350 |
|
else if (event.getPropertyName().equals("editable")) |
351 |
|
{ |
352 |
|
if (textComponent.isEditable()) |
353 |
|
textComponent.setBackground(background); |
354 |
|
else |
355 |
|
textComponent.setBackground(inactiveBackground); |
356 |
|
} |
357 |
} |
} |
358 |
} |
} |
359 |
|
|
822 |
*/ |
*/ |
823 |
protected void paintBackground(Graphics g) |
protected void paintBackground(Graphics g) |
824 |
{ |
{ |
825 |
if (textComponent.isEditable()) |
// This method does nothing. All the background filling is done by the |
826 |
textComponent.setBackground(background); |
// ComponentUI update method. However, the method is called by paint |
827 |
else |
// to provide a way for subclasses to draw something different (e.g. background |
828 |
textComponent.setBackground(inactiveBackground); |
// images etc) on the background. |
|
|
|
|
g.setColor(textComponent.getBackground()); |
|
|
g.fillRect(0, 0, textComponent.getWidth(), textComponent.getHeight()); |
|
829 |
} |
} |
830 |
|
|
831 |
/** |
/** |