2
* Copyright 2005-2010 Kirill Grouchnikov, based on work by
3
* Sun Microsystems, Inc. All rights reserved.
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
package org.pushingpixels.substance.swingx;
22
import javax.swing.plaf.ComponentUI;
24
import org.jdesktop.swingx.JXErrorPane;
25
import org.jdesktop.swingx.plaf.basic.BasicErrorPaneUI;
26
import org.pushingpixels.lafwidget.animation.AnimationConfigurationManager;
27
import org.pushingpixels.lafwidget.animation.AnimationFacet;
28
import org.pushingpixels.substance.internal.animation.IconGlowTracker;
29
import org.pushingpixels.substance.internal.utils.SubstanceCoreUtilities;
30
import org.pushingpixels.substance.internal.utils.icon.GlowingIcon;
33
* UI delegate for the {@link JXErrorPane} component.
35
* @author Kirill Grouchnikov
37
public class SubstanceErrorPaneUI extends BasicErrorPaneUI {
38
protected IconGlowTracker iconGlowTracker;
41
AnimationConfigurationManager.getInstance().allowAnimations(
42
AnimationFacet.ICON_GLOW, JXErrorPane.class);
45
public static ComponentUI createUI(JComponent comp) {
46
SubstanceCoreUtilities.testComponentCreationThreadingViolation(comp);
47
return new SubstanceErrorPaneUI();
53
* @see org.jdesktop.swingx.plaf.basic.BasicErrorPaneUI#installComponents()
56
protected void installComponents() {
57
super.installComponents();
59
this.errorMessage.setBorder(null);
60
this.errorScrollPane.setOpaque(false);
61
this.errorScrollPane.getViewport().setOpaque(false);
63
this.iconGlowTracker = new IconGlowTracker(this.iconLabel);
70
* org.jdesktop.swingx.plaf.basic.BasicErrorPaneUI#getDefaultErrorIcon()
73
protected Icon getDefaultErrorIcon() {
74
Icon errorIcon = UIManager.getIcon("OptionPane.errorIcon");
75
return new GlowingIcon(errorIcon, this.iconGlowTracker);
82
* org.jdesktop.swingx.plaf.basic.BasicErrorPaneUI#getDefaultWarningIcon()
85
protected Icon getDefaultWarningIcon() {
86
Icon errorIcon = UIManager.getIcon("OptionPane.warningIcon");
87
return new GlowingIcon(errorIcon, this.iconGlowTracker);
93
* @see org.jdesktop.swingx.plaf.basic.BasicErrorPaneUI#reinit()
96
protected void reinit() {
99
if (this.iconLabel.getIcon() != null) {
100
this.iconGlowTracker.play(3);