summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Mc Neill <[email protected]>2010-12-22 16:19:29 +0000
committerHarvey Harrison <[email protected]>2011-12-31 15:05:45 -0800
commita11750b98a15a5e17f787e1ab90ba4f82ba7cf69 (patch)
treed360e5ca5b00e28a4736fa74f807cd6d5070fb74 /src
parent9f2d34dc4dfdc70820cb75dbf5b841624ea8b3bc (diff)
j3dutils: cherry-pick fix from svn trunk issue 655
Fixed issue 655 git-svn-id: https://svn.java.net/svn/j3d-core-utils~svn/trunk@206 9497e636-51bd-65ba-982d-a4982e1767a5 Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/com/sun/j3d/utils/geometry/Text2D.java41
1 files changed, 34 insertions, 7 deletions
diff --git a/src/classes/share/com/sun/j3d/utils/geometry/Text2D.java b/src/classes/share/com/sun/j3d/utils/geometry/Text2D.java
index f174a89..6a05558 100644
--- a/src/classes/share/com/sun/j3d/utils/geometry/Text2D.java
+++ b/src/classes/share/com/sun/j3d/utils/geometry/Text2D.java
@@ -43,23 +43,28 @@
*/
package com.sun.j3d.utils.geometry;
-import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
-import java.awt.image.WritableRaster;
-import java.awt.image.DataBufferInt;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
-import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
-import java.awt.RenderingHints;
import java.awt.Toolkit;
import java.util.Hashtable;
-import javax.media.j3d.*;
-import javax.vecmath.*;
+import javax.media.j3d.Appearance;
+import javax.media.j3d.ImageComponent;
+import javax.media.j3d.ImageComponent2D;
+import javax.media.j3d.Material;
+import javax.media.j3d.Node;
+import javax.media.j3d.QuadArray;
+import javax.media.j3d.Shape3D;
+import javax.media.j3d.Texture;
+import javax.media.j3d.Texture2D;
+import javax.media.j3d.TransparencyAttributes;
+import javax.vecmath.Color3f;
+import javax.vecmath.Color4f;
/**
* A Text2D object is a representation of a string as a texture mapped
@@ -126,6 +131,28 @@ public class Text2D extends Shape3D {
updateText2D(text, color, fontName, fontSize, fontStyle);
}
+ // issue 655
+ private Text2D() {
+
+ setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
+ setCapability(Shape3D.ALLOW_APPEARANCE_READ);
+ setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
+ }
+
+ // issue 655
+ public Node cloneNode(boolean forceDuplicate) {
+ Text2D t2d = new Text2D();
+
+ t2d.color.set(color);
+ t2d.fontName = fontName;
+ t2d.fontSize = fontSize;
+ t2d.fontStyle = fontStyle;
+ t2d.text = text;
+
+ t2d.duplicateNode(this, forceDuplicate);
+ return t2d;
+ }
+
/*
* Changes text of this Text2D to 'text'. All other
* parameters (color, fontName, fontSize, fontStyle