1:
37:
38:
39: package ;
40:
41: import ;
42: import ;
43: import ;
44: import ;
45: import ;
46: import ;
47: import ;
48: import ;
49: import ;
50: import ;
51: import ;
52: import ;
53: import ;
54: import ;
55: import ;
56: import ;
57: import ;
58:
59: import ;
60: import ;
61: import ;
62: import ;
63: import ;
64: import ;
65: import ;
66: import ;
67: import ;
68: import ;
69: import ;
70: import ;
71: import ;
72: import ;
73: import ;
74: import ;
75: import ;
76: import ;
77: import ;
78: import ;
79:
80:
83: public class BasicOptionPaneUI extends OptionPaneUI
84: {
85:
93: public class ButtonActionListener implements ActionListener
94: {
95:
96: protected int buttonIndex;
97:
98:
103: public ButtonActionListener(int buttonIndex)
104: {
105: this.buttonIndex = buttonIndex;
106: }
107:
108:
113: public void actionPerformed(ActionEvent e)
114: {
115: Object value = new Integer(JOptionPane.CLOSED_OPTION);
116: Object[] options = optionPane.getOptions();
117: if (options != null)
118: value = new Integer(buttonIndex);
119: else
120: {
121: String text = ((JButton) e.getSource()).getText();
122: if (text.equals(OK_STRING))
123: value = new Integer(JOptionPane.OK_OPTION);
124: if (text.equals(CANCEL_STRING))
125: value = new Integer(JOptionPane.CANCEL_OPTION);
126: if (text.equals(YES_STRING))
127: value = new Integer(JOptionPane.YES_OPTION);
128: if (text.equals(NO_STRING))
129: value = new Integer(JOptionPane.NO_OPTION);
130: }
131: optionPane.setValue(value);
132: resetInputValue();
133:
134: Window owner = SwingUtilities.windowForComponent(optionPane);
135:
136: if (owner instanceof JDialog)
137: ((JDialog) owner).dispose();
138:
139:
140: JInternalFrame inf = (JInternalFrame) SwingUtilities.getAncestorOfClass(JInternalFrame.class,
141: optionPane);
142: if (inf != null)
143: {
144: try
145: {
146: inf.setClosed(true);
147: }
148: catch (PropertyVetoException pve)
149: {
150:
151: }
152: }
153: }
154: }
155:
156:
165: public static class ButtonAreaLayout implements LayoutManager
166: {
167:
168: protected boolean centersChildren = true;
169:
170:
171: protected int padding;
172:
173:
174: protected boolean syncAllWidths;
175:
176:
177: private transient int widthOfWidestButton;
178:
179:
180: private transient int tallestButton;
181:
182:
189: public ButtonAreaLayout(boolean syncAllWidths, int padding)
190: {
191: this.syncAllWidths = syncAllWidths;
192: this.padding = padding;
193: }
194:
195:
201: public void addLayoutComponent(String string, Component comp)
202: {
203:
204: }
205:
206:
211: public boolean getCentersChildren()
212: {
213: return centersChildren;
214: }
215:
216:
221: public int getPadding()
222: {
223: return padding;
224: }
225:
226:
232: public boolean getSyncAllWidths()
233: {
234: return syncAllWidths;
235: }
236:
237:
242: public void layoutContainer(Container container)
243: {
244: Component[] buttonList = container.getComponents();
245: int x = container.getInsets().left;
246: if (getCentersChildren())
247: x += (int) ((double) (container.getSize().width) / 2
248: - (double) (buttonRowLength(container)) / 2);
249: for (int i = 0; i < buttonList.length; i++)
250: {
251: Dimension dims = buttonList[i].getPreferredSize();
252: if (syncAllWidths)
253: {
254: buttonList[i].setBounds(x, 0, widthOfWidestButton, dims.height);
255: x += widthOfWidestButton + getPadding();
256: }
257: else
258: {
259: buttonList[i].setBounds(x, 0, dims.width, dims.height);
260: x += dims.width + getPadding();
261: }
262: }
263: }
264:
265:
273: private int buttonRowLength(Container c)
274: {
275: Component[] buttonList = c.getComponents();
276:
277: int buttonLength = 0;
278: int widest = 0;
279: int tallest = 0;
280:
281: for (int i = 0; i < buttonList.length; i++)
282: {
283: Dimension dims = buttonList[i].getPreferredSize();
284: buttonLength += dims.width + getPadding();
285: widest = Math.max(widest, dims.width);
286: tallest = Math.max(tallest, dims.height);
287: }
288:
289: widthOfWidestButton = widest;
290: tallestButton = tallest;
291:
292: int width;
293: if (getSyncAllWidths())
294: width = widest * buttonList.length
295: + getPadding() * (buttonList.length - 1);
296: else
297: width = buttonLength;
298:
299: Insets insets = c.getInsets();
300: width += insets.left + insets.right;
301:
302: return width;
303: }
304:
305:
312: public Dimension minimumLayoutSize(Container c)
313: {
314: return preferredLayoutSize(c);
315: }
316:
317:
324: public Dimension preferredLayoutSize(Container c)
325: {
326: int w = buttonRowLength(c);
327:
328: return new Dimension(w, tallestButton);
329: }
330:
331:
337: public void removeLayoutComponent(Component c)
338: {
339:
340: }
341:
342:
347: public void setCentersChildren(boolean newValue)
348: {
349: centersChildren = newValue;
350: }
351:
352:
357: public void setPadding(int newPadding)
358: {
359: padding = newPadding;
360: }
361:
362:
367: public void setSyncAllWidths(boolean newValue)
368: {
369: syncAllWidths = newValue;
370: }
371: }
372:
373:
380: public class PropertyChangeHandler implements PropertyChangeListener
381: {
382:
388: public void propertyChange(PropertyChangeEvent e)
389: {
390: if (e.getPropertyName().equals(JOptionPane.ICON_PROPERTY)
391: || e.getPropertyName().equals(JOptionPane.MESSAGE_TYPE_PROPERTY))
392: addIcon(messageAreaContainer);
393: else if (e.getPropertyName().equals(JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY))
394: resetSelectedValue();
395: else if (e.getPropertyName().equals(JOptionPane.INITIAL_VALUE_PROPERTY)
396: || e.getPropertyName().equals(JOptionPane.OPTIONS_PROPERTY)
397: || e.getPropertyName().equals(JOptionPane.OPTION_TYPE_PROPERTY))
398: {
399: Container newButtons = createButtonArea();
400: optionPane.remove(buttonContainer);
401: optionPane.add(newButtons);
402: buttonContainer = newButtons;
403: }
404:
405: else if (e.getPropertyName().equals(JOptionPane.MESSAGE_PROPERTY)
406: || e.getPropertyName().equals(JOptionPane.WANTS_INPUT_PROPERTY)
407: || e.getPropertyName().equals(JOptionPane.SELECTION_VALUES_PROPERTY))
408: {
409: optionPane.remove(messageAreaContainer);
410: messageAreaContainer = createMessageArea();
411: optionPane.add(messageAreaContainer);
412: Container newButtons = createButtonArea();
413: optionPane.remove(buttonContainer);
414: optionPane.add(newButtons);
415: buttonContainer = newButtons;
416: optionPane.add(buttonContainer);
417: }
418: optionPane.invalidate();
419: optionPane.repaint();
420: }
421: }
422:
423:
426: public static final int MinimumWidth = 262;
427:
428:
431: public static final int MinimumHeight = 90;
432:
433:
434: protected boolean hasCustomComponents = false;
435:
436:
437:
438:
439:
440:
441:
446: protected Component initialFocusComponent;
447:
448:
449: protected JComponent inputComponent;
450:
451:
452: protected Dimension minimumSize;
453:
454:
455: protected PropertyChangeListener propertyChangeListener;
456:
457:
458: protected JOptionPane optionPane;
459:
460:
461:
462: private static final int iconSize = 36;
463:
464:
465: private transient Color messageForeground;
466:
467:
468: private transient Border messageBorder;
469:
470:
471: private transient Border buttonBorder;
472:
473:
474: private static final String OK_STRING = "OK";
475:
476:
477: private static final String YES_STRING = "Yes";
478:
479:
480: private static final String NO_STRING = "No";
481:
482:
483: private static final String CANCEL_STRING = "Cancel";
484:
485:
487: transient Container messageAreaContainer;
488:
489:
491: transient Container buttonContainer;
492:
493:
497: private static class MessageIcon implements Icon
498: {
499:
504: public int getIconWidth()
505: {
506: return iconSize;
507: }
508:
509:
514: public int getIconHeight()
515: {
516: return iconSize;
517: }
518:
519:
528: public void paintIcon(Component c, Graphics g, int x, int y)
529: {
530:
531: }
532: }
533:
534:
535: private static MessageIcon errorIcon = new MessageIcon()
536: {
537: public void paintIcon(Component c, Graphics g, int x, int y)
538: {
539: Polygon oct = new Polygon(new int[] { 0, 0, 9, 27, 36, 36, 27, 9 },
540: new int[] { 9, 27, 36, 36, 27, 9, 0, 0 }, 8);
541: g.translate(x, y);
542:
543: Color saved = g.getColor();
544: g.setColor(Color.RED);
545:
546: g.fillPolygon(oct);
547:
548: g.setColor(Color.BLACK);
549: g.drawRect(13, 16, 10, 4);
550:
551: g.setColor(saved);
552: g.translate(-x, -y);
553: }
554: };
555:
556:
557: private static MessageIcon infoIcon = new MessageIcon()
558: {
559: public void paintIcon(Component c, Graphics g, int x, int y)
560: {
561: g.translate(x, y);
562: Color saved = g.getColor();
563:
564:
565: g.setColor(Color.RED);
566:
567: g.fillOval(0, 0, iconSize, iconSize);
568:
569: g.setColor(Color.BLACK);
570: g.drawOval(16, 6, 4, 4);
571:
572: Polygon bottomI = new Polygon(new int[] { 15, 15, 13, 13, 23, 23, 21, 21 },
573: new int[] { 12, 28, 28, 30, 30, 28, 28, 12 },
574: 8);
575: g.drawPolygon(bottomI);
576:
577: g.setColor(saved);
578: g.translate(-x, -y);
579: }
580: };
581:
582:
583: private static MessageIcon warningIcon = new MessageIcon()
584: {
585: public void paintIcon(Component c, Graphics g, int x, int y)
586: {
587: g.translate(x, y);
588: Color saved = g.getColor();
589: g.setColor(Color.YELLOW);
590:
591: Polygon triangle = new Polygon(new int[] { 0, 18, 36 },
592: new int[] { 36, 0, 36 }, 3);
593: g.fillPolygon(triangle);
594:
595: g.setColor(Color.BLACK);
596:
597: Polygon excl = new Polygon(new int[] { 15, 16, 20, 21 },
598: new int[] { 8, 26, 26, 8 }, 4);
599: g.drawPolygon(excl);
600: g.drawOval(16, 30, 4, 4);
601:
602: g.setColor(saved);
603: g.translate(-x, -y);
604: }
605: };
606:
607:
608: private static MessageIcon questionIcon = new MessageIcon()
609: {
610: public void paintIcon(Component c, Graphics g, int x, int y)
611: {
612: g.translate(x, y);
613: Color saved = g.getColor();
614: g.setColor(Color.GREEN);
615:
616: g.fillRect(0, 0, iconSize, iconSize);
617:
618: g.setColor(Color.BLACK);
619:
620: g.drawOval(11, 2, 16, 16);
621: g.drawOval(14, 5, 10, 10);
622:
623: g.setColor(Color.GREEN);
624: g.fillRect(0, 10, iconSize, iconSize - 10);
625:
626: g.setColor(Color.BLACK);
627:
628: g.drawLine(11, 10, 14, 10);
629:
630: g.drawLine(24, 10, 17, 22);
631: g.drawLine(27, 10, 20, 22);
632: g.drawLine(17, 22, 20, 22);
633:
634: g.drawOval(17, 25, 3, 3);
635:
636: g.setColor(saved);
637: g.translate(-x, -y);
638: }
639: };
640:
641:
642:
643:
644:
645:
648: public BasicOptionPaneUI()
649: {
650:
651: }
652:
653:
664: protected void addButtonComponents(Container container, Object[] buttons,
665: int initialIndex)
666: {
667: if (buttons == null)
668: return;
669: for (int i = 0; i < buttons.length; i++)
670: {
671: if (buttons[i] != null)
672: {
673: Component toAdd;
674: if (buttons[i] instanceof Component)
675: toAdd = (Component) buttons[i];
676: else
677: {
678: if (buttons[i] instanceof Icon)
679: toAdd = new JButton((Icon) buttons[i]);
680: else
681: toAdd = new JButton(buttons[i].toString());
682: hasCustomComponents = true;
683: }
684: if (toAdd instanceof JButton)
685: ((JButton) toAdd).addActionListener(createButtonActionListener(i));
686: if (i == initialIndex)
687: initialFocusComponent = toAdd;
688: container.add(toAdd);
689: }
690: }
691: selectInitialValue(optionPane);
692: }
693:
694:
699: protected void addIcon(Container top)
700: {
701: JLabel iconLabel = null;
702: Icon icon = getIcon();
703: if (icon != null)
704: {
705: iconLabel = new JLabel(icon);
706: top.add(iconLabel, BorderLayout.WEST);
707: }
708: }
709:
710:
716: private static GridBagConstraints createConstraints()
717: {
718: GridBagConstraints constraints = new GridBagConstraints();
719: constraints.gridx = GridBagConstraints.REMAINDER;
720: constraints.gridy = GridBagConstraints.REMAINDER;
721: constraints.gridwidth = 0;
722: constraints.anchor = GridBagConstraints.LINE_START;
723: constraints.fill = GridBagConstraints.NONE;
724: constraints.insets = new Insets(0, 0, 3, 0);
725:
726: return constraints;
727: }
728:
729:
745: protected void addMessageComponents(Container container,
746: GridBagConstraints cons, Object msg,
747: int maxll, boolean internallyCreated)
748: {
749: if (msg == null)
750: return;
751: hasCustomComponents = internallyCreated;
752: if (msg instanceof Object[])
753: {
754: Object[] arr = (Object[]) msg;
755: for (int i = 0; i < arr.length; i++)
756: addMessageComponents(container, cons, arr[i], maxll,
757: internallyCreated);
758: return;
759: }
760: else if (msg instanceof Component)
761: {
762: container.add((Component) msg, cons);
763: cons.gridy++;
764: }
765: else if (msg instanceof Icon)
766: {
767: container.add(new JLabel((Icon) msg), cons);
768: cons.gridy++;
769: }
770: else
771: {
772:
773:
774:
775:
776:
777: if (msg.toString().length() > maxll)
778: {
779: Box tmp = new Box(BoxLayout.Y_AXIS);
780: burstStringInto(tmp, msg.toString(), maxll);
781: addMessageComponents(container, cons, tmp, maxll, true);
782: }
783: else
784: addMessageComponents(container, cons, new JLabel(msg.toString()),
785: maxll, true);
786: }
787: }
788:
789:
797: protected void burstStringInto(Container c, String d, int maxll)
798: {
799:
800:
801:
802:
803:
804:
805:
806: if (d == null || c == null)
807: return;
808: JLabel label = new JLabel(d);
809: c.add(label);
810: }
811:
812:
820: public boolean containsCustomComponents(JOptionPane op)
821: {
822: return hasCustomComponents;
823: }
824:
825:
832: protected ActionListener createButtonActionListener(int buttonIndex)
833: {
834: return new ButtonActionListener(buttonIndex);
835: }
836:
837:
842: protected Container createButtonArea()
843: {
844: JPanel buttonPanel = new JPanel();
845:
846: buttonPanel.setLayout(createLayoutManager());
847: addButtonComponents(buttonPanel, getButtons(), getInitialValueIndex());
848:
849: return buttonPanel;
850: }
851:
852:
857: protected LayoutManager createLayoutManager()
858: {
859: return new ButtonAreaLayout(getSizeButtonsToSameWidth(), 6);
860: }
861:
862:
867: protected Container createMessageArea()
868: {
869: JPanel messageArea = new JPanel();
870: messageArea.setLayout(new BorderLayout());
871: addIcon(messageArea);
872:
873: JPanel rightSide = new JPanel();
874: rightSide.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
875: rightSide.setLayout(new GridBagLayout());
876: GridBagConstraints con = createConstraints();
877:
878: addMessageComponents(rightSide, con, getMessage(),
879: getMaxCharactersPerLineCount(), false);
880:
881: if (optionPane.getWantsInput())
882: {
883: Object[] selection = optionPane.getSelectionValues();
884:
885: if (selection == null)
886: inputComponent = new JTextField(15);
887: else if (selection.length < 20)
888: inputComponent = new JComboBox(selection);
889: else
890: inputComponent = new JList(selection);
891: if (inputComponent != null)
892: {
893: addMessageComponents(rightSide, con, inputComponent,
894: getMaxCharactersPerLineCount(), false);
895: resetSelectedValue();
896: selectInitialValue(optionPane);
897: }
898: }
899:
900: messageArea.add(rightSide, BorderLayout.CENTER);
901:
902: return messageArea;
903: }
904:
905:
911: protected PropertyChangeListener createPropertyChangeListener()
912: {
913: return new PropertyChangeHandler();
914: }
915:
916:
922: protected Container createSeparator()
923: {
924:
925:
926: return null;
927: }
928:
929:
936: public static ComponentUI createUI(JComponent x)
937: {
938: return new BasicOptionPaneUI();
939: }
940:
941:
947: protected Object[] getButtons()
948: {
949: if (optionPane.getOptions() != null)
950: return optionPane.getOptions();
951: switch (optionPane.getOptionType())
952: {
953: case JOptionPane.YES_NO_OPTION:
954: return new Object[] { YES_STRING, NO_STRING };
955: case JOptionPane.YES_NO_CANCEL_OPTION:
956: return new Object[] { YES_STRING, NO_STRING, CANCEL_STRING };
957: case JOptionPane.OK_CANCEL_OPTION:
958: return new Object[] { OK_STRING, CANCEL_STRING };
959: case JOptionPane.DEFAULT_OPTION:
960: return (optionPane.getWantsInput() ) ?
961: new Object[] { OK_STRING, CANCEL_STRING } :
962: ( optionPane.getMessageType() == JOptionPane.QUESTION_MESSAGE ) ?
963: new Object[] { YES_STRING, NO_STRING, CANCEL_STRING } :
964:
965: new Object[] { OK_STRING };
966: }
967: return null;
968: }
969:
970:
976: protected Icon getIcon()
977: {
978: if (optionPane.getIcon() != null)
979: return optionPane.getIcon();
980: else
981: return getIconForType(optionPane.getMessageType());
982: }
983:
984:
991: protected Icon getIconForType(int messageType)
992: {
993: Icon tmp = null;
994: switch (messageType)
995: {
996: case JOptionPane.ERROR_MESSAGE:
997: tmp = errorIcon;
998: break;
999: case JOptionPane.INFORMATION_MESSAGE:
1000: tmp = infoIcon;
1001: break;
1002: case JOptionPane.WARNING_MESSAGE:
1003: tmp = warningIcon;
1004: break;
1005: case JOptionPane.QUESTION_MESSAGE:
1006: tmp = questionIcon;
1007: break;
1008: }
1009: return tmp;
1010:
1011:
1012: }
1013:
1014:
1019: protected int getInitialValueIndex()
1020: {
1021: Object[] buttons = getButtons();
1022:
1023: if (buttons == null)
1024: return -1;
1025:
1026: Object select = optionPane.getInitialValue();
1027:
1028: for (int i = 0; i < buttons.length; i++)
1029: {
1030: if (select == buttons[i])
1031: return i;
1032: }
1033: return 0;
1034: }
1035:
1036:
1043: protected int getMaxCharactersPerLineCount()
1044: {
1045: return optionPane.getMaxCharactersPerLineCount();
1046: }
1047:
1048:
1055: public Dimension getMaximumSize(JComponent c)
1056: {
1057: return getPreferredSize(c);
1058: }
1059:
1060:
1065: protected Object getMessage()
1066: {
1067: return optionPane.getMessage();
1068: }
1069:
1070:
1075: public Dimension getMinimumOptionPaneSize()
1076: {
1077: return minimumSize;
1078: }
1079:
1080:
1087: public Dimension getMinimumSize(JComponent c)
1088: {
1089: return getPreferredSize(c);
1090: }
1091:
1092:
1101: public Dimension getPreferredSize(JComponent c)
1102: {
1103: Dimension d = optionPane.getLayout().preferredLayoutSize(optionPane);
1104: Dimension d2 = getMinimumOptionPaneSize();
1105:
1106: int w = Math.max(d.width, d2.width);
1107: int h = Math.max(d.height, d2.height);
1108: return new Dimension(w, h);
1109: }
1110:
1111:
1116: protected boolean getSizeButtonsToSameWidth()
1117: {
1118: return true;
1119: }
1120:
1121:
1124: protected void installComponents()
1125: {
1126:
1127: hasCustomComponents = false;
1128: Container msg = createMessageArea();
1129: if (msg != null)
1130: {
1131: ((JComponent) msg).setBorder(messageBorder);
1132: msg.setForeground(messageForeground);
1133: messageAreaContainer = msg;
1134: optionPane.add(msg);
1135: }
1136:
1137:
1138:
1139:
1140:
1141: Container sep = createSeparator();
1142: if (sep != null)
1143: optionPane.add(sep);
1144:
1145: Container button = createButtonArea();
1146: if (button != null)
1147: {
1148: ((JComponent) button).setBorder(buttonBorder);
1149: buttonContainer = button;
1150: optionPane.add(button);
1151: }
1152:
1153: optionPane.setBorder(BorderFactory.createEmptyBorder(12, 12, 11, 11));
1154: optionPane.invalidate();
1155: }
1156:
1157:
1160: protected void installDefaults()
1161: {
1162: LookAndFeel.installColorsAndFont(optionPane, "OptionPane.background",
1163: "OptionPane.foreground",
1164: "OptionPane.font");
1165: LookAndFeel.installBorder(optionPane, "OptionPane.border");
1166: optionPane.setOpaque(true);
1167:
1168: messageBorder = UIManager.getBorder("OptionPane.messageAreaBorder");
1169: messageForeground = UIManager.getColor("OptionPane.messageForeground");
1170: buttonBorder = UIManager.getBorder("OptionPane.buttonAreaBorder");
1171:
1172: minimumSize = UIManager.getDimension("OptionPane.minimumSize");
1173:
1174:
1175:
1176:
1177:
1183: }
1184:
1185:
1188: protected void installKeyboardActions()
1189: {
1190:
1191: }
1192:
1193:
1196: protected void installListeners()
1197: {
1198: propertyChangeListener = createPropertyChangeListener();
1199:
1200: optionPane.addPropertyChangeListener(propertyChangeListener);
1201: }
1202:
1203:
1208: public void installUI(JComponent c)
1209: {
1210: if (c instanceof JOptionPane)
1211: {
1212: optionPane = (JOptionPane) c;
1213:
1214: installDefaults();
1215: installComponents();
1216: installListeners();
1217: installKeyboardActions();
1218: }
1219: }
1220:
1221:
1225: protected void resetInputValue()
1226: {
1227: if (optionPane.getWantsInput() && inputComponent != null)
1228: {
1229: Object output = null;
1230: if (inputComponent instanceof JTextField)
1231: output = ((JTextField) inputComponent).getText();
1232: else if (inputComponent instanceof JComboBox)
1233: output = ((JComboBox) inputComponent).getSelectedItem();
1234: else if (inputComponent instanceof JList)
1235: output = ((JList) inputComponent).getSelectedValue();
1236:
1237: if (output != null)
1238: optionPane.setInputValue(output);
1239: }
1240: }
1241:
1242:
1248: public void selectInitialValue(JOptionPane op)
1249: {
1250: if (inputComponent != null)
1251: {
1252: inputComponent.requestFocus();
1253: return;
1254: }
1255: if (initialFocusComponent != null)
1256: initialFocusComponent.requestFocus();
1257: }
1258:
1259:
1264: void resetSelectedValue()
1265: {
1266: if (inputComponent != null)
1267: {
1268: Object init = optionPane.getInitialSelectionValue();
1269: if (init == null)
1270: return;
1271: if (inputComponent instanceof JTextField)
1272: ((JTextField) inputComponent).setText((String) init);
1273: else if (inputComponent instanceof JComboBox)
1274: ((JComboBox) inputComponent).setSelectedItem(init);
1275: else if (inputComponent instanceof JList)
1276: {
1277:
1278: }
1279: }
1280: }
1281:
1282:
1285: protected void uninstallComponents()
1286: {
1287: optionPane.removeAll();
1288: buttonContainer = null;
1289: messageAreaContainer = null;
1290: }
1291:
1292:
1295: protected void uninstallDefaults()
1296: {
1297: optionPane.setFont(null);
1298: optionPane.setForeground(null);
1299: optionPane.setBackground(null);
1300:
1301: minimumSize = null;
1302:
1303: messageBorder = null;
1304: buttonBorder = null;
1305: messageForeground = null;
1306:
1307:
1308:
1309:
1315: }
1316:
1317:
1320: protected void uninstallKeyboardActions()
1321: {
1322:
1323: }
1324:
1325:
1328: protected void uninstallListeners()
1329: {
1330: optionPane.removePropertyChangeListener(propertyChangeListener);
1331: propertyChangeListener = null;
1332: }
1333:
1334:
1339: public void uninstallUI(JComponent c)
1340: {
1341: uninstallKeyboardActions();
1342: uninstallListeners();
1343: uninstallComponents();
1344: uninstallDefaults();
1345:
1346: optionPane = null;
1347: }
1348: }