/[svn]/jsampler/trunk/src/org/jsampler/view/fantasia/FantasiaListCellRenderer.java
ViewVC logotype

Annotation of /jsampler/trunk/src/org/jsampler/view/fantasia/FantasiaListCellRenderer.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1743 - (hide annotations) (download)
Sat May 31 23:04:01 2008 UTC (15 years, 11 months ago) by iliev
File size: 2639 byte(s)
* Renamed the column labels in the Channel Routing dialog: The column
  representing the sampler channel's audio channels is "Audio In" and
  the column representing the audio device's channels is "Audio Out"
* Remember the last used tab in the Preferences dialog
* Fantasia: The sampler channels are now referenced by their position
  in the list, not by their ID
* Fantasia: Implemented options to show the channel number and/or the MIDI
  input port/channel on the sampler channel screen when using Small View
  (choose Edit/Preferences, then click the `Channels' tab)
* Fantasia: Migrated to substance 5

1 iliev 1286 /*
2     * JSampler - a java front-end for LinuxSampler
3     *
4     * Copyright (C) 2005-2007 Grigor Iliev <grigor@grigoriliev.com>
5     *
6     * This file is part of JSampler.
7     *
8     * JSampler is free software; you can redistribute it and/or modify
9     * it under the terms of the GNU General Public License version 2
10     * as published by the Free Software Foundation.
11     *
12     * JSampler is distributed in the hope that it will be useful,
13     * but WITHOUT ANY WARRANTY; without even the implied warranty of
14     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     * GNU General Public License for more details.
16     *
17     * You should have received a copy of the GNU General Public License
18     * along with JSampler; if not, write to the Free Software
19     * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20     * MA 02111-1307 USA
21     */
22    
23     package org.jsampler.view.fantasia;
24    
25     import java.awt.Graphics;
26 iliev 1496 import java.awt.Graphics2D;
27 iliev 1286 import java.awt.Insets;
28    
29     import javax.swing.BorderFactory;
30     import javax.swing.JLabel;
31     import javax.swing.JList;
32    
33 iliev 1743 import org.jvnet.substance.api.renderers.SubstanceDefaultListCellRenderer;
34 iliev 1286
35     /**
36     *
37     * @author Grigor Iliev
38     */
39     public class FantasiaListCellRenderer extends SubstanceDefaultListCellRenderer {
40     private FantasiaRenderer renderer = new FantasiaRenderer();
41    
42     /** Creates a new instance of <code>FantasiaListCellRenderer</code> */
43     public
44     FantasiaListCellRenderer() {
45    
46     }
47    
48     public java.awt.Component
49     getListCellRendererComponent (
50     JList list, Object value, int index, boolean isSelected, boolean cellHasFocus
51     ) {
52     if(index == -1) {
53     renderer.setText(value == null ? "" : value.toString());
54     return renderer;
55     }
56     return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
57     }
58    
59     static class FantasiaRenderer extends JLabel {
60     private static java.awt.Color textColor = new java.awt.Color(0xFFA300);
61     private static Insets pixmapInsets = new Insets(3, 5, 6, 5);
62    
63     FantasiaRenderer() {
64     setOpaque(false);
65 iliev 1730 setBorder(BorderFactory.createEmptyBorder(4, 5, 6, 5));
66 iliev 1286 setForeground(new java.awt.Color(0xFFA300));
67 iliev 1730 setBackground(new java.awt.Color(0x818181));
68 iliev 1286 setFont(Res.fontScreen);
69     }
70    
71     protected void
72     paintComponent(Graphics g) {
73 iliev 1496 Graphics2D g2d = (Graphics2D)g;
74    
75     g2d.setRenderingHint (
76     java.awt.RenderingHints.KEY_TEXT_ANTIALIASING,
77     java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON
78     );
79    
80 iliev 1286 PixmapPane.paintComponent(this, g, Res.gfxCbLabelBg, pixmapInsets);
81     super.paintComponent(g);
82     }
83    
84     public java.awt.Color
85     getForeground() { return textColor; }
86    
87     public java.awt.Font
88     getFont() { return Res.fontScreen; }
89     }
90     }

  ViewVC Help
Powered by ViewVC