1 |
/* BasicOptionPaneUI.java |
/* BasicOptionPaneUI.java -- |
2 |
Copyright (C) 2004 Free Software Foundation, Inc. |
Copyright (C) 2004 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
35 |
obligated to do so. If you do not wish to do so, delete this |
obligated to do so. If you do not wish to do so, delete this |
36 |
exception statement from your version. */ |
exception statement from your version. */ |
37 |
|
|
38 |
|
|
39 |
package javax.swing.plaf.basic; |
package javax.swing.plaf.basic; |
40 |
|
|
41 |
import java.awt.BorderLayout; |
import java.awt.BorderLayout; |
43 |
import java.awt.Component; |
import java.awt.Component; |
44 |
import java.awt.Container; |
import java.awt.Container; |
45 |
import java.awt.Dimension; |
import java.awt.Dimension; |
|
import java.awt.FlowLayout; |
|
|
import java.awt.FontMetrics; |
|
46 |
import java.awt.Graphics; |
import java.awt.Graphics; |
47 |
import java.awt.GridBagConstraints; |
import java.awt.GridBagConstraints; |
48 |
import java.awt.GridBagLayout; |
import java.awt.GridBagLayout; |
49 |
import java.awt.Insets; |
import java.awt.Insets; |
50 |
import java.awt.LayoutManager; |
import java.awt.LayoutManager; |
51 |
import java.awt.Polygon; |
import java.awt.Polygon; |
|
import java.awt.Rectangle; |
|
52 |
import java.awt.Window; |
import java.awt.Window; |
53 |
import java.awt.event.ActionEvent; |
import java.awt.event.ActionEvent; |
54 |
import java.awt.event.ActionListener; |
import java.awt.event.ActionListener; |
55 |
import java.beans.PropertyChangeEvent; |
import java.beans.PropertyChangeEvent; |
56 |
import java.beans.PropertyChangeListener; |
import java.beans.PropertyChangeListener; |
57 |
import java.beans.PropertyVetoException; |
import java.beans.PropertyVetoException; |
58 |
|
|
59 |
import javax.swing.Box; |
import javax.swing.Box; |
60 |
import javax.swing.BoxLayout; |
import javax.swing.BoxLayout; |
61 |
import javax.swing.Icon; |
import javax.swing.Icon; |
74 |
import javax.swing.UIManager; |
import javax.swing.UIManager; |
75 |
import javax.swing.border.Border; |
import javax.swing.border.Border; |
76 |
import javax.swing.plaf.ComponentUI; |
import javax.swing.plaf.ComponentUI; |
|
import javax.swing.plaf.IconUIResource; |
|
77 |
import javax.swing.plaf.OptionPaneUI; |
import javax.swing.plaf.OptionPaneUI; |
78 |
|
|
|
|
|
79 |
/** |
/** |
80 |
* This class is the UI delegate for JOptionPane in the Basic Look and Feel. |
* This class is the UI delegate for JOptionPane in the Basic Look and Feel. |
81 |
*/ |
*/ |
472 |
* A helper class that implements Icon. This is used temporarily until |
* A helper class that implements Icon. This is used temporarily until |
473 |
* ImageIcons are fixed. |
* ImageIcons are fixed. |
474 |
*/ |
*/ |
475 |
private static class messageIcon implements Icon |
private static class MessageIcon implements Icon |
476 |
{ |
{ |
477 |
/** |
/** |
478 |
* This method returns the width of the icon. |
* This method returns the width of the icon. |
509 |
} |
} |
510 |
|
|
511 |
/** The icon displayed for ERROR_MESSAGE. */ |
/** The icon displayed for ERROR_MESSAGE. */ |
512 |
private static messageIcon errorIcon = new messageIcon() |
private static MessageIcon errorIcon = new MessageIcon() |
513 |
{ |
{ |
514 |
public void paintIcon(Component c, Graphics g, int x, int y) |
public void paintIcon(Component c, Graphics g, int x, int y) |
515 |
{ |
{ |
531 |
}; |
}; |
532 |
|
|
533 |
/** The icon displayed for INFORMATION_MESSAGE. */ |
/** The icon displayed for INFORMATION_MESSAGE. */ |
534 |
private static messageIcon infoIcon = new messageIcon() |
private static MessageIcon infoIcon = new MessageIcon() |
535 |
{ |
{ |
536 |
public void paintIcon(Component c, Graphics g, int x, int y) |
public void paintIcon(Component c, Graphics g, int x, int y) |
537 |
{ |
{ |
557 |
}; |
}; |
558 |
|
|
559 |
/** The icon displayed for WARNING_MESSAGE. */ |
/** The icon displayed for WARNING_MESSAGE. */ |
560 |
private static messageIcon warningIcon = new messageIcon() |
private static MessageIcon warningIcon = new MessageIcon() |
561 |
{ |
{ |
562 |
public void paintIcon(Component c, Graphics g, int x, int y) |
public void paintIcon(Component c, Graphics g, int x, int y) |
563 |
{ |
{ |
582 |
}; |
}; |
583 |
|
|
584 |
/** The icon displayed for MESSAGE_ICON. */ |
/** The icon displayed for MESSAGE_ICON. */ |
585 |
private static messageIcon questionIcon = new messageIcon() |
private static MessageIcon questionIcon = new MessageIcon() |
586 |
{ |
{ |
587 |
public void paintIcon(Component c, Graphics g, int x, int y) |
public void paintIcon(Component c, Graphics g, int x, int y) |
588 |
{ |
{ |