[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob/org/nongnu/libvob/vobs TextVob.java
From: |
Matti Katila |
Subject: |
[Gzz-commits] libvob/org/nongnu/libvob/vobs TextVob.java |
Date: |
Tue, 13 May 2003 18:33:08 -0400 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Changes by: Matti Katila <address@hidden> 03/05/13 18:33:07
Modified files:
org/nongnu/libvob/vobs: TextVob.java
Log message:
which is better, string or color?
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/vobs/TextVob.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: libvob/org/nongnu/libvob/vobs/TextVob.java
diff -u libvob/org/nongnu/libvob/vobs/TextVob.java:1.3
libvob/org/nongnu/libvob/vobs/TextVob.java:1.4
--- libvob/org/nongnu/libvob/vobs/TextVob.java:1.3 Fri Mar 21 04:42:51 2003
+++ libvob/org/nongnu/libvob/vobs/TextVob.java Tue May 13 18:33:07 2003
@@ -31,8 +31,10 @@
import org.nongnu.libvob.impl.gl.*;
import org.nongnu.libvob.linebreaking.*;
import org.nongnu.libvob.gl.*;
+import org.nongnu.libvob.util.*;
import java.awt.Rectangle;
import java.awt.Shape;
+import java.awt.Color;
/** A single contiguous text string as a Vob.
* This vob implements the HBox interface so it is
@@ -52,14 +54,15 @@
* XXX Diagram!
*/
public class TextVob extends HBox.VobHBox {
-String rcsid = "$Id: TextVob.java,v 1.3 2003/03/21 09:42:51 tjl Exp $";
+String rcsid = "$Id: TextVob.java,v 1.4 2003/05/13 22:33:07 mudyc Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
protected final TextStyle style;
protected final String text;
protected final boolean baselined;
- protected String textColor = null;
+ protected Color color = null;
+ protected String colorString = null;
protected Object key;
@@ -72,20 +75,31 @@
* If false, the text will be comfortably within
the box.
*/
public TextVob(TextStyle style, String text, boolean baselined) {
- this(style, text, baselined, null);
+ this(style, text, baselined, (String)null);
}
/** Same as another constructor but in GL side you can give the color
* with string like "Color 1 0.5 0.5"
* @param color OpenGL Color used to draw the text.
*/
+ public TextVob(TextStyle style, String text, boolean baselined, Color
color) {
+ super();
+ this.style = style;
+ this.baselined = baselined;
+ this.text = text;
+
+ this.color = color;
+ if (color != null)
+ this.colorString ="Color "+ ColorUtil.colorGLString(color);
+ }
+
public TextVob(TextStyle style, String text, boolean baselined, String
color) {
super();
this.style = style;
this.baselined = baselined;
this.text = text;
- this.textColor = color;
+ this.colorString = color;
}
@@ -96,7 +110,11 @@
}
public TextVob(TextStyle style, String text, boolean baselined, Object
key) {
- this(style, text, baselined, null);
+ this(style, text, baselined, (String)null);
+ }
+ public TextVob(TextStyle style, String text, boolean baselined, Object
key, Color color) {
+ this(style, text, baselined, color);
+ this.color = color;
}
public TextVob(TextStyle style, String text, boolean baselined, Object
key, String color) {
this(style, text, baselined, color);
@@ -205,7 +223,7 @@
private Vob setColor() {
if(setColor == null) {
- setColor = GLCache.getCallList(this.textColor == null ? "" :
this.textColor);
+ setColor = GLCache.getCallList(this.colorString == null ? "" :
this.colorString);
}
return setColor;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob/org/nongnu/libvob/vobs TextVob.java,
Matti Katila <=