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

Diff of /jsampler/trunk/src/org/jsampler/view/fantasia/basic/FantasiaListCellRenderer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2145 by iliev, Tue Oct 7 00:07:14 2008 UTC revision 2146 by iliev, Mon Oct 11 09:31:27 2010 UTC
# Line 1  Line 1 
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   *   *
# Line 27  import java.awt.Graphics2D; Line 27  import java.awt.Graphics2D;
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   *   *
# Line 59  public class FantasiaListCellRenderer ex Line 61  public class FantasiaListCellRenderer ex
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);
# Line 69  public class FantasiaListCellRenderer ex Line 72  public class FantasiaListCellRenderer ex
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
# Line 81  public class FantasiaListCellRenderer ex Line 88  public class FantasiaListCellRenderer ex
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                                    

Legend:
Removed from v.2145  
changed lines
  Added in v.2146

  ViewVC Help
Powered by ViewVC