Author: smartini
Date: Wed Oct 19 20:38:05 2011
New Revision: 1186469

URL: http://svn.apache.org/viewvc?rev=1186469&view=rev
Log:
PIVOT-805 - Note that this fix "only" the case of Print from Pivot using Java 
Print facilities, and should apply to Applications and Applets.
 

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/LabelSkin.java

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/LabelSkin.java
URL: 
http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/LabelSkin.java?rev=1186469&r1=1186468&r2=1186469&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/LabelSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/LabelSkin.java Wed Oct 19 
20:38:05 2011
@@ -19,7 +19,9 @@ package org.apache.pivot.wtk.skin;
 import java.awt.BasicStroke;
 import java.awt.Color;
 import java.awt.Font;
+import java.awt.Graphics;
 import java.awt.Graphics2D;
+import java.awt.PrintGraphics;
 import java.awt.Transparency;
 import java.awt.font.FontRenderContext;
 import java.awt.font.GlyphVector;
@@ -343,7 +345,16 @@ public class LabelSkin extends Component
                     }
                 }
 
-                graphics.drawGlyphVector(glyphVector, x, y + ascent);
+                if (!((Graphics) graphics instanceof PrintGraphics)) {
+                    graphics.drawGlyphVector(glyphVector, x, y + ascent);
+                }
+                else {
+                  Label label = (Label)getComponent();
+                  String text = label.getText();
+                  if (text != null && text.length() > 0) {
+                      graphics.drawString(text, x, y + ascent);
+                  }
+                }
 
                 // Draw the text decoration
                 if (textDecoration != null) {


Reply via email to