001: /*
002: * Copyright (c) 2003-2007 JGoodies Karsten Lentzsch. All Rights Reserved.
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions are met:
006: *
007: * o Redistributions of source code must retain the above copyright notice,
008: * this list of conditions and the following disclaimer.
009: *
010: * o Redistributions in binary form must reproduce the above copyright notice,
011: * this list of conditions and the following disclaimer in the documentation
012: * and/or other materials provided with the distribution.
013: *
014: * o Neither the name of JGoodies Karsten Lentzsch nor the names of
015: * its contributors may be used to endorse or promote products derived
016: * from this software without specific prior written permission.
017: *
018: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
020: * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
021: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
022: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
023: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
025: * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
026: * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
027: * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
028: * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
029: */
030:
031: package com.jgoodies.validation.view;
032:
033: import java.awt.*;
034: import java.beans.PropertyChangeEvent;
035: import java.beans.PropertyChangeListener;
036:
037: import javax.swing.*;
038: import javax.swing.text.JTextComponent;
039:
040: import com.jgoodies.validation.Severity;
041: import com.jgoodies.validation.ValidationMessage;
042: import com.jgoodies.validation.ValidationResult;
043: import com.jgoodies.validation.ValidationResultModel;
044:
045: /**
046: * A factory class that vends views that present the state and contents
047: * of {@link ValidationResult}s. The validation views are composed from
048: * user interface components like text areas, lists, labels, etc.
049: * Most factory methods require a {@link ValidationResultModel} that
050: * notifies the view about changes in an underlying ValidationResult.
051: *
052: * @author Karsten Lentzsch
053: * @version $Revision: 1.11 $
054: *
055: * @see ValidationResult
056: * @see ValidationMessage
057: */
058: public final class ValidationResultViewFactory {
059:
060: private static final Color DEFAULT_REPORT_BACKGROUND = new Color(
061: 255, 255, 210);
062:
063: private ValidationResultViewFactory() {
064: // Override default constructor; prevents instantiation.
065: }
066:
067: // Creating Validation Views **********************************************
068:
069: /**
070: * Creates and returns an icon label that indicates the validation severity.
071: * A handler updates the label's visibility and icon each time the severity
072: * of the given validation result model changes.
073: *
074: * @param model the model that provides the observable validation result
075: * @return a label with an icon that presents the validation severity
076: */
077: public static JLabel createReportIconLabel(
078: ValidationResultModel model) {
079: JLabel label = new JLabel();
080: LabelIconChangeHandler.updateVisibilityAndIcon(label, model
081: .getSeverity());
082: model.addPropertyChangeListener(
083: ValidationResultModel.PROPERTYNAME_SEVERITY,
084: new LabelIconChangeHandler(label));
085: return label;
086: }
087:
088: /**
089: * Creates and returns a label with icon and text that indicates
090: * the validation state and displays the first message text.
091: *
092: * @param model the model that provides the observable validation result
093: * @return a label with text and icon that shows the validation severity
094: * and the first validation message text
095: */
096: public static JLabel createReportIconAndTextLabel(
097: ValidationResultModel model) {
098: JLabel label = createReportIconLabel(model);
099: LabelTextChangeHandler.updateText(label, model.getResult());
100: model.addPropertyChangeListener(
101: ValidationResultModel.PROPERTYNAME_RESULT,
102: new LabelTextChangeHandler(label));
103: return label;
104: }
105:
106: /**
107: * Creates and returns a transparent panel that consists of a report label
108: * and a transparent report text area. Both components are bound to
109: * the given ValidationResultModel: the text content presents
110: * the validation result message text and the whole panel is visible
111: * if and only if the model has messages.
112: *
113: * @param model the model that provides the observable validation result
114: * @return a panel with icon and text area bound to a validation result
115: */
116: public static JComponent createReportIconAndTextPane(
117: ValidationResultModel model) {
118: JLabel label = createReportIconLabel(model);
119: JTextArea area = createReportTextArea(model);
120: area.setOpaque(false);
121:
122: GridBagLayout gbl = new GridBagLayout();
123: GridBagConstraints gbc = new GridBagConstraints();
124: JPanel reportPane = new JPanel(gbl);
125: reportPane.setOpaque(false);
126: reportPane.setVisible(model.hasMessages());
127:
128: gbc.gridwidth = 1;
129: gbc.gridheight = GridBagConstraints.REMAINDER;
130: gbc.anchor = GridBagConstraints.NORTHWEST;
131: gbc.insets = new Insets(2, 0, 0, 0);
132: reportPane.add(label, gbc);
133:
134: gbc.gridwidth = GridBagConstraints.REMAINDER;
135: gbc.fill = GridBagConstraints.BOTH;
136: gbc.insets = new Insets(0, 4, 0, 0);
137: gbc.weightx = 1.0;
138: gbc.weighty = 1.0;
139: reportPane.add(area, gbc);
140:
141: reportPane.setFocusable(false);
142: model.addPropertyChangeListener(
143: ValidationResultModel.PROPERTYNAME_MESSAGES,
144: new MessageStateChangeHandler(reportPane));
145:
146: return reportPane;
147: }
148:
149: /**
150: * Creates and returns a list that presents validation messages.
151: * The list content is bound to the given {@link ValidationResultModel}
152: * using a {@link ValidationResultListAdapter}.
153: *
154: * @param model the model that provides the observable validation result
155: * @return a <code>JList</code> that shows validation messages
156: */
157: public static JComponent createReportList(
158: ValidationResultModel model) {
159: return createReportList(model, DEFAULT_REPORT_BACKGROUND);
160: }
161:
162: /**
163: * Creates and returns a list wrapped in a scroll pane that presents
164: * validation messages. The list content is bound to the given
165: * {@link ValidationResultModel} using a {@link ValidationResultListAdapter}.
166: *
167: * @param model the model that provides the observable validation result
168: * @param backgroundColor the color used to paint the area's background
169: * @return a <code>JList</code> that shows validation messages
170: */
171: public static JComponent createReportList(
172: ValidationResultModel model, Color backgroundColor) {
173: JList list = new JList();
174: list.setFocusable(false);
175: list.setBackground(backgroundColor);
176: list.setCellRenderer(new BasicValidationMessageCellRenderer());
177: list.setModel(new ValidationResultListAdapter(model));
178: JScrollPane scrollPane = new JScrollPane(list);
179: scrollPane.setVisible(model.hasMessages());
180:
181: model.addPropertyChangeListener(
182: ValidationResultModel.PROPERTYNAME_MESSAGES,
183: new MessageStateChangeHandler(scrollPane));
184:
185: return scrollPane;
186: }
187:
188: /**
189: * Creates and returns a text area that is intended to show validation
190: * messages. The area is bound to the given {@link ValidationResultModel}: the text content reflects
191: * the validation result message text and the component is visible
192: * if and only if the model has messages.
193: *
194: * @param model the model that provides the observable validation result
195: * @return a text area intended to show validation messages
196: */
197: public static JTextArea createReportTextArea(
198: ValidationResultModel model) {
199: return createReportTextArea(model, DEFAULT_REPORT_BACKGROUND);
200: }
201:
202: /**
203: * Creates and returns a text area that is intended to show validation
204: * messages. The area is bound to the given {@link ValidationResultModel}:
205: * the text content reflects the validation result message text,
206: * and the component is visible if and only if the model has messages.
207: *
208: * @param model the model that provides the observable validation result
209: * @param backgroundColor the color used to paint the area's background
210: * @return a text area intended to show validation messages
211: */
212: public static JTextArea createReportTextArea(
213: ValidationResultModel model, Color backgroundColor) {
214: JTextArea area = new JTextArea();
215: area.setEditable(false);
216: area.setFocusable(false);
217: area.setOpaque(true);
218: area.setBackground(backgroundColor);
219:
220: MessageTextChangeHandler.updateText(area, model.getResult());
221:
222: model.addPropertyChangeListener(
223: ValidationResultModel.PROPERTYNAME_RESULT,
224: new MessageTextChangeHandler(area));
225: return area;
226: }
227:
228: /**
229: * Creates and returns a text area wrapped by a scroll pane that is
230: * intended to show validation messages. The component is bound to
231: * the given {@link ValidationResultModel}: the text content reflects
232: * the validation result message text and the component is visible
233: * if and only if the model has messages.
234: *
235: * @param model the model that provides the observable validation result
236: * @return a scrollable text component intended to show validation messages
237: */
238: public static JComponent createReportTextPane(
239: ValidationResultModel model) {
240: return createReportTextPane(model, DEFAULT_REPORT_BACKGROUND);
241: }
242:
243: /**
244: * Creates and returns a text area wrapped by a scroll pane that is
245: * intended to show validation messages. The component is bound to
246: * the given {@link ValidationResultModel}: the text content reflects
247: * the validation result message text and the component is visible
248: * if and only if the model has messages.
249: *
250: * @param model the model that provides the observable validation result
251: * @param backgroundColor the color used to paint the area's background
252: * @return a scrollable text component intended to show validation messages
253: */
254: public static JComponent createReportTextPane(
255: ValidationResultModel model, Color backgroundColor) {
256: JTextArea area = createReportTextArea(model, backgroundColor);
257: JScrollPane scrollPane = new JScrollPane(area);
258: scrollPane.setVisible(model.hasMessages());
259:
260: model.addPropertyChangeListener(
261: ValidationResultModel.PROPERTYNAME_MESSAGES,
262: new MessageStateChangeHandler(scrollPane));
263:
264: return scrollPane;
265: }
266:
267: // Accessing Useful Icons *************************************************
268:
269: /**
270: * Returns a default error icon useful to indicate validation errors.
271: *
272: * @return a default error icon
273: */
274: public static ImageIcon getErrorIcon() {
275: return Icons.ERROR_ICON;
276: }
277:
278: /**
279: * Returns a default warnings icon useful to indicate validation warnings.
280: *
281: * @return a default warning icon
282: */
283: public static ImageIcon getWarningIcon() {
284: return Icons.WARNING_ICON;
285: }
286:
287: /**
288: * Returns a small default error icon useful to indicate validation errors
289: * attached to UI components.
290: *
291: * @return a small default error icon
292: */
293: public static ImageIcon getSmallErrorIcon() {
294: return Icons.SMALL_ERROR_ICON;
295: }
296:
297: /**
298: * Returns a small default warning icon useful to indicate validation
299: * warnings attached to UI components.
300: *
301: * @return a small default warning icon
302: */
303: public static ImageIcon getSmallWarningIcon() {
304: return Icons.SMALL_WARNING_ICON;
305: }
306:
307: /**
308: * Returns a default information icon useful to indicate input hints.
309: *
310: * @return a default information icon
311: */
312: public static ImageIcon getInfoIcon() {
313: return Icons.INFO_ICON;
314: }
315:
316: /**
317: * Returns a small default information icon useful to indicate input hints.
318: *
319: * @return a small default information icon
320: */
321: public static ImageIcon getSmallInfoIcon() {
322: return Icons.SMALL_INFO_ICON;
323: }
324:
325: /**
326: * Returns a check icon useful to indicate good vs. no good.
327: *
328: * @return a check icon
329: */
330: public static ImageIcon getCheckIcon() {
331: return Icons.CHECK_ICON;
332: }
333:
334: /**
335: * Returns the warning icon for warnings, the error icon for errors
336: * and <code>null</code> otherwise.
337: *
338: * @param severity the severity used to lookup the icon
339: * @return the warning icon for warnings, error icon for errors,
340: * <code>null</code> otherwise
341: * @see #getWarningIcon()
342: * @see #getErrorIcon()
343: * @see #getSmallIcon(Severity)
344: */
345: public static Icon getIcon(Severity severity) {
346: if (severity == Severity.ERROR) {
347: return getErrorIcon();
348: } else if (severity == Severity.WARNING) {
349: return getWarningIcon();
350: } else {
351: return null;
352: }
353: }
354:
355: /**
356: * Returns the small warning icon for warnings, the small error icon for
357: * errors and <code>null</code> otherwise.
358: *
359: * @param severity the severity used to lookup the icon
360: * @return the small warning icon for warnings, the small error icon for
361: * errors, <code>null</code> otherwise
362: * @see #getSmallWarningIcon()
363: * @see #getSmallErrorIcon()
364: * @see #getIcon(Severity)
365: */
366: public static Icon getSmallIcon(Severity severity) {
367: if (severity == Severity.ERROR) {
368: return getSmallErrorIcon();
369: } else if (severity == Severity.WARNING) {
370: return getSmallWarningIcon();
371: } else {
372: return null;
373: }
374: }
375:
376: // ValidationResultModel Listeners ****************************************
377:
378: /**
379: * Sets a JTextComponent's text to the messages text of a ValidationResult.
380: */
381: private static final class MessageTextChangeHandler implements
382: PropertyChangeListener {
383:
384: private final JTextComponent textComponent;
385:
386: /**
387: * Constructs a MessageTextChangeHandler for the given text component.
388: *
389: * @param textComponent the target component to set texts in
390: */
391: private MessageTextChangeHandler(JTextComponent textComponent) {
392: this .textComponent = textComponent;
393: }
394:
395: /**
396: * Sets the message text of the given ValidationResult as text
397: * in the given component.
398: *
399: * @param aTextComponent the target where to set the message text
400: * @param result used to request the validation message text
401: */
402: private static void updateText(JTextComponent aTextComponent,
403: ValidationResult result) {
404: aTextComponent.setText(result.getMessagesText());
405: aTextComponent.setCaretPosition(0);
406: }
407:
408: /**
409: * The ValidationResult of the observed ValidationResultModel
410: * has changed. Updates this handler's text component's text
411: * to the message text of the new ValidationResult.
412: */
413: public void propertyChange(PropertyChangeEvent evt) {
414: if (evt.getPropertyName().equals(
415: ValidationResultModel.PROPERTYNAME_RESULT)) {
416: updateText(textComponent, (ValidationResult) evt
417: .getNewValue());
418: }
419: }
420:
421: }
422:
423: /**
424: * Sets the component visible iff the validation result has messages.
425: */
426: public static final class MessageStateChangeHandler implements
427: PropertyChangeListener {
428:
429: private final Component component;
430:
431: /**
432: * Constructs a MessageStateHanlder that updates the visibility
433: * of the given Component.
434: *
435: * @param component the component to show and hide
436: */
437: public MessageStateChangeHandler(Component component) {
438: this .component = component;
439: }
440:
441: /**
442: * The ValidationResult's 'messages' property has changed.
443: * Hides or shows the component if the ValidationResult is OK
444: * or has messages resp.
445: */
446: public void propertyChange(PropertyChangeEvent evt) {
447: if (evt.getPropertyName().equals(
448: ValidationResultModel.PROPERTYNAME_MESSAGES)) {
449: boolean hasMessages = ((Boolean) evt.getNewValue())
450: .booleanValue();
451: component.setVisible(hasMessages);
452: }
453: }
454:
455: }
456:
457: /**
458: * Sets the component visible iff the validation result has errors.
459: */
460: private static final class LabelIconChangeHandler implements
461: PropertyChangeListener {
462:
463: private final JLabel label;
464:
465: private LabelIconChangeHandler(JLabel label) {
466: this .label = label;
467: }
468:
469: private static void updateVisibilityAndIcon(JLabel aLabel,
470: Severity severity) {
471: aLabel.setVisible(severity != Severity.OK);
472: if (severity == Severity.ERROR) {
473: aLabel.setIcon(getErrorIcon());
474: } else if (severity == Severity.WARNING) {
475: aLabel.setIcon(getWarningIcon());
476: }
477: }
478:
479: /**
480: * The ValidationResult's severity has changed.
481: * Updates the label's visibility and icon.
482: */
483: public void propertyChange(PropertyChangeEvent evt) {
484: if (evt.getPropertyName().equals(
485: ValidationResultModel.PROPERTYNAME_SEVERITY)) {
486: updateVisibilityAndIcon(label, (Severity) evt
487: .getNewValue());
488: }
489: }
490:
491: }
492:
493: /**
494: * Sets the component visible iff the validation result has errors.
495: */
496: private static final class LabelTextChangeHandler implements
497: PropertyChangeListener {
498:
499: private final JLabel label;
500:
501: private LabelTextChangeHandler(JLabel label) {
502: this .label = label;
503: }
504:
505: private static void updateText(JLabel label,
506: ValidationResult result) {
507: label.setText(result.hasMessages() ? result.getMessages()
508: .get(0).formattedText() : "");
509: }
510:
511: /**
512: * The ValidationResult's content has changed.
513: * Updates the label's text to become the formatted text
514: * of the new ValidationResult.
515: */
516: public void propertyChange(PropertyChangeEvent evt) {
517: if (evt.getPropertyName().equals(
518: ValidationResultModel.PROPERTYNAME_RESULT)) {
519: updateText(label, (ValidationResult) evt.getNewValue());
520: }
521: }
522:
523: }
524:
525: // Renderer ***************************************************************
526:
527: /**
528: * A <code>ListCellRenderer</code> implementation which renders
529: * labels for instances of <code>ValidationMessage</code>.
530: */
531: private static final class BasicValidationMessageCellRenderer
532: extends DefaultListCellRenderer {
533:
534: /**
535: * In addition to the superclass behavior, this method
536: * assumes that the value is a ValidationMessage.
537: * It sets the renderer's icon to the one associated with the
538: * ValidationMessage's severity and sets the renderer's text
539: * to the message's formatted text.
540: */
541: @Override
542: public Component getListCellRendererComponent(JList list,
543: Object value, int index, boolean isSelected,
544: boolean cellHasFocus) {
545: super .getListCellRendererComponent(list, value, index,
546: false, // Ignore the selection state
547: false); // Ignore the cell focus state
548: ValidationMessage message = (ValidationMessage) value;
549: this .setIcon(ValidationResultViewFactory.getIcon(message
550: .severity()));
551: this .setText(message.formattedText());
552: return this ;
553: }
554: }
555:
556: // Icon Pixel Data and Definitions ****************************************
557:
558: /**
559: * Provides icons useful for presenting validation feedback.
560: * These icons are constructed from byte arrays.
561: */
562: private static final class Icons {
563:
564: private static final byte[] ERROR_GIF_BYTES = { 71, 73, 70, 56,
565: 57, 97, 16, 0, 16, 0, -77, 0, 0, -1, 127, 63, -8, 88,
566: 56, -1, 95, 63, -8, 56, 56, -33, 63, 63, -65, 63, 63,
567: -104, 56, 56, 127, 63, 63, -1, -65, -65, -97, 127, 127,
568: -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
569: 0, 0, 33, -7, 4, 1, 0, 0, 11, 0, 44, 0, 0, 0, 0, 16, 0,
570: 16, 0, 0, 4, 84, 112, -55, 73, -85, -67, 120, -91, -62,
571: 75, -54, -59, 32, 14, 68, 97, 92, 33, -96, 8, 65, -96,
572: -104, 85, 50, 0, 0, -94, 12, 10, 82, 126, 83, 26, -32,
573: 57, 18, -84, 55, 96, 1, 69, -91, 3, 37, -12, -77, -35,
574: -124, 74, 98, -64, 54, -96, -106, 78, -109, 4, 1, 55,
575: 66, 32, 76, -68, -119, -127, 64, 46, -101, -94, 21, 67,
576: -121, 99, 64, 91, 18, -19, -125, 33, -100, -87, -37,
577: 41, 17, 0, 59 };
578:
579: private static final byte[] SMALL_ERROR_GIF_BYTES = { 71, 73,
580: 70, 56, 57, 97, 7, 0, 8, 0, -94, 0, 0, -1, 0, 0, -65,
581: 63, 63, 127, 63, 63, -1, 127, 127, -65, 95, 95, -33,
582: -65, -65, -1, -1, -1, -1, -1, -1, 33, -7, 4, 1, 0, 0,
583: 7, 0, 44, 0, 0, 0, 0, 7, 0, 8, 0, 0, 3, 25, 88, -79,
584: -85, 54, 96, -104, 37, -55, 19, 1, 88, 2, -80, 54, 28,
585: 86, 93, -63, 19, 77, -118, -96, 6, 69, 2, 0, 59, 0, 0,
586: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
587:
588: private static final byte[] WARNING_GIF_BYTES = { 71, 73, 70,
589: 56, 57, 97, 16, 0, 16, 0, -77, 0, 0, -1, -1, 95, -1,
590: -33, 63, -33, -65, 63, -1, -33, 95, -65, -97, 63, -1,
591: -65, 63, -97, 127, 63, -65, -65, -65, 95, 95, 95, 0, 0,
592: 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
593: 0, 0, 33, -7, 4, 1, 0, 0, 10, 0, 44, 0, 0, 0, 0, 16, 0,
594: 16, 0, 0, 4, 69, 80, -55, 73, -85, -67, 120, 10, -110,
595: -23, -39, 71, 39, 9, -64, 38, 126, 67, 64, -124, 25,
596: -103, 32, 38, -122, -66, -59, -118, -111, -64, 27, -60,
597: -43, 7, 12, -70, 26, -117, 66, 26, 0, 2, -56, 29, -57,
598: 35, 48, 6, 104, 1, 33, -123, 96, 28, 12, 10, 5, -127,
599: -106, -89, 32, 24, -66, -32, -80, 65, 68, 22, 69, 0, 0,
600: 59 };
601:
602: private static final byte[] SMALL_WARNING_GIF_BYTES = { 71, 73,
603: 70, 56, 57, 97, 7, 0, 8, 0, -77, 0, 0, -1, -1, 63, -1,
604: -1, 127, -65, -65, 127, -33, -33, -65, -1, -33, 63,
605: -65, -97, 63, -97, 127, 63, -1, -65, 95, -1, -1, -1, 0,
606: 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
607: 0, 0, 0, 33, -7, 4, 1, 0, 0, 10, 0, 44, 0, 0, 0, 0, 7,
608: 0, 8, 0, 0, 4, 33, 80, -95, 97, 6, 82, -78, 16, 115,
609: 103, 73, 21, -126, 20, 65, 2, 112, 3, 105, 86, 36, 112,
610: 0, -101, 1, 0, 9, -79, 9, 70, -95, 27, 66, 4, 0, 59 };
611:
612: private static final byte[] INFO_GIF_BYTES = { 71, 73, 70, 56,
613: 57, 97, 16, 0, 16, 0, -94, 0, 0, 0, 0, -1, 63, 63, -65,
614: 95, 95, -65, 127, 127, -65, -90, -54, -16, -1, -1, -1,
615: -1, -1, -1, 0, 0, 0, 33, -7, 4, 1, 0, 0, 6, 0, 44, 0,
616: 0, 0, 0, 16, 0, 16, 0, 0, 3, 48, 104, -70, -36, -2, 80,
617: -107, 57, -93, 28, -128, 20, 107, 10, 0, -63, 102, 21,
618: 68, -96, -115, 84, 21, 21, -62, 55, -120, -48, -28,
619: -62, -15, -52, 121, -64, 123, -37, 43, -2, -46, 13,
620: -42, 39, -96, -117, -91, 84, -100, 71, 2, 0, 59 };
621:
622: private static final byte[] SMALL_INFO_GIF_BYTES = { 71, 73,
623: 70, 56, 57, 97, 9, 0, 9, 0, -77, 0, 0, 0, 0, -124, 57,
624: 57, 90, 57, 90, -100, -100, -100, -100, -1, -1, -1, -1,
625: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
626: -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
627: -1, -1, -1, -1, 33, -7, 4, 1, 0, 0, 3, 0, 44, 0, 0, 0,
628: 0, 9, 0, 9, 0, 0, 4, 29, 112, 12, 65, -87, -100, 36,
629: -25, -128, 51, -48, -127, -96, 125, -101, -24, -127,
630: 38, 65, 18, -31, 8, 14, -127, -74, 93, 65, 93, 75, 17,
631: 0, 59 };
632:
633: private static final byte[] CHECK_ICON_BYTES = { 71, 73, 70,
634: 56, 57, 97, 16, 0, 16, 0, -77, 0, 0, 0, 0, -1, 63, 127,
635: -65, 127, -97, -65, -90, -54, -16, -97, -65, -65, -1,
636: -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
637: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, -7, 4, 1,
638: 0, 0, 5, 0, 44, 0, 0, 0, 0, 16, 0, 16, 0, 0, 4, 43,
639: -80, -56, 73, -85, -67, 56, 19, -112, 105, 0, 67, 39,
640: 125, -124, 88, 124, -95, 40, -128, -26, 0, 8, -40, 0,
641: 23, 110, 16, 3, 44, -102, -83, -17, 43, -30, 56, 19,
642: 47, -11, -101, -103, -114, -56, 8, 0, 59 };
643:
644: private static final ImageIcon ERROR_ICON = new ImageIcon(
645: ERROR_GIF_BYTES);
646:
647: private static final ImageIcon SMALL_ERROR_ICON = new ImageIcon(
648: SMALL_ERROR_GIF_BYTES);
649:
650: private static final ImageIcon WARNING_ICON = new ImageIcon(
651: WARNING_GIF_BYTES);
652:
653: private static final ImageIcon SMALL_WARNING_ICON = new ImageIcon(
654: SMALL_WARNING_GIF_BYTES);
655:
656: private static final ImageIcon INFO_ICON = new ImageIcon(
657: INFO_GIF_BYTES);
658:
659: private static final ImageIcon SMALL_INFO_ICON = new ImageIcon(
660: SMALL_INFO_GIF_BYTES);
661:
662: private static final ImageIcon CHECK_ICON = new ImageIcon(
663: CHECK_ICON_BYTES);
664:
665: }
666:
667: }
|