1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com> |
* Copyright (C) 2005-2010 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
27 |
import java.awt.Insets; |
import java.awt.Insets; |
28 |
|
|
29 |
import javax.swing.BorderFactory; |
import javax.swing.BorderFactory; |
30 |
|
import javax.swing.ImageIcon; |
31 |
import javax.swing.JLabel; |
import javax.swing.JLabel; |
32 |
import javax.swing.JList; |
import javax.swing.JList; |
33 |
|
|
34 |
import org.jsampler.view.fantasia.Res; |
import org.jsampler.view.fantasia.Res; |
35 |
|
import org.jsampler.view.std.StdUtils; |
36 |
|
|
37 |
import org.jvnet.substance.api.renderers.SubstanceDefaultListCellRenderer; |
import org.pushingpixels.substance.api.renderers.SubstanceDefaultListCellRenderer; |
38 |
|
|
39 |
/** |
/** |
40 |
* |
* |
61 |
return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
62 |
} |
} |
63 |
|
|
64 |
static class FantasiaRenderer extends JLabel { |
public static class FantasiaRenderer extends JLabel { |
65 |
private static java.awt.Color textColor = new java.awt.Color(0xFFA300); |
private static java.awt.Color textColor = new java.awt.Color(0xFFA300); |
66 |
private static Insets pixmapInsets = new Insets(3, 5, 6, 5); |
private static Insets pixmapInsets = new Insets(3, 5, 6, 5); |
67 |
|
private static ImageIcon bgImage = null; |
68 |
|
|
69 |
FantasiaRenderer() { |
FantasiaRenderer() { |
70 |
setOpaque(false); |
setOpaque(false); |
72 |
setForeground(new java.awt.Color(0xFFA300)); |
setForeground(new java.awt.Color(0xFFA300)); |
73 |
setBackground(new java.awt.Color(0x818181)); |
setBackground(new java.awt.Color(0x818181)); |
74 |
setFont(Res.fontScreen); |
setFont(Res.fontScreen); |
75 |
|
|
76 |
|
if(bgImage == null) bgImage = StdUtils.createImageIcon ( |
77 |
|
Res.gfxCbLabelBg.getImage(), new java.awt.Color(0x818181) |
78 |
|
); |
79 |
} |
} |
80 |
|
|
81 |
@Override |
@Override |
88 |
java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON |
java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON |
89 |
); |
); |
90 |
|
|
91 |
PixmapPane.paintComponent(this, g, Res.gfxCbLabelBg, pixmapInsets); |
PixmapPane.paintComponent(this, g, bgImage, pixmapInsets); |
92 |
super.paintComponent(g); |
super.paintComponent(g); |
93 |
} |
} |
94 |
|
|