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

Diff of /jsampler/trunk/src/org/jsampler/view/fantasia/FantasiaLabel.java

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

revision 1495 by iliev, Fri Aug 10 20:24:23 2007 UTC revision 1496 by iliev, Mon Nov 19 22:22:22 2007 UTC
# Line 23  Line 23 
23  package org.jsampler.view.fantasia;  package org.jsampler.view.fantasia;
24    
25  import java.awt.Graphics;  import java.awt.Graphics;
26    import java.awt.Graphics2D;
27  import java.awt.Insets;  import java.awt.Insets;
28    
29  import javax.swing.BorderFactory;  import javax.swing.BorderFactory;
# Line 37  public class FantasiaLabel extends JLabe Line 38  public class FantasiaLabel extends JLabe
38          private static java.awt.Color textColor = new java.awt.Color(0xFFA300);          private static java.awt.Color textColor = new java.awt.Color(0xFFA300);
39          private static Insets pixmapInsets = new Insets(5, 5, 4, 5);          private static Insets pixmapInsets = new Insets(5, 5, 4, 5);
40                    
41            private boolean antialiased;
42            
43            /** Creates a new instance of <code>FantasiaLabel</code> */
44            public
45            FantasiaLabel(String text) { this(text, false); }
46            
47          /** Creates a new instance of <code>FantasiaLabel</code> */          /** Creates a new instance of <code>FantasiaLabel</code> */
48          public          public
49          FantasiaLabel(String text) {          FantasiaLabel(String text, boolean antialiased) {
50                  super(text);                  super(text);
51                    this.antialiased = antialiased;
52                  setOpaque(false);                  setOpaque(false);
53                  setBorder(BorderFactory.createEmptyBorder(4, 3, 6, 5));                  setBorder(BorderFactory.createEmptyBorder(4, 3, 6, 5));
54                  setForeground(new java.awt.Color(0xFFA300));                  setForeground(new java.awt.Color(0xFFA300));
# Line 49  public class FantasiaLabel extends JLabe Line 57  public class FantasiaLabel extends JLabe
57                    
58          protected void          protected void
59          paintComponent(Graphics g) {          paintComponent(Graphics g) {
60                    if(antialiased) {
61                            Graphics2D g2d = (Graphics2D)g;
62                            
63                            g2d.setRenderingHint (
64                                    java.awt.RenderingHints.KEY_TEXT_ANTIALIASING,
65                                    java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON
66                            );
67                    }
68                    
69                  PixmapPane.paintComponent(this, g, Res.gfxTextField, pixmapInsets);                  PixmapPane.paintComponent(this, g, Res.gfxTextField, pixmapInsets);
70                  super.paintComponent(g);                  super.paintComponent(g);
71          }          }

Legend:
Removed from v.1495  
changed lines
  Added in v.1496

  ViewVC Help
Powered by ViewVC