1 50 51 package org.openlaszlo.iv.flash.api.text; 52 53 import org.openlaszlo.iv.flash.util.*; 54 import org.openlaszlo.iv.flash.api.*; 55 import org.openlaszlo.iv.flash.context.Context; 56 import java.io.*; 57 58 70 public final class TextItem extends FlashItem { 71 72 public Font font = null; public Color color = null; public int height; public int style = 0; public int align = 0; public int indent = 0; public int marginleft = 0; public int marginright = 0; public int linesp = 0; public int kerning = 0; public int script = 0; public String text; 85 public TextItem() {} 86 87 public TextItem( String text, Font font, int height, Color color ) { 88 this.text = text; 89 this.font = font; 90 this.height = height; 91 this.color = color; 92 } 93 94 public void apply( Context context ) { 95 text = context.apply(text); 96 text = text.replace( (char) 9, ' ' ); 97 } 98 99 public boolean isConstant() { 100 return !Util.hasVar(text); 101 } 102 103 public void write( FlashOutput fob ) { 104 } 106 107 108 public void printContent( PrintStream out, String indent ) { 109 } 111 112 protected FlashItem copyInto( FlashItem item, ScriptCopier copier ) { 113 TextItem t = (TextItem) item; 114 t.font = font; 115 t.color = (Color) color.getCopy(copier); 116 t.height = height; 117 t.style = style; 118 t.align = align; 119 t.indent = indent; 120 t.marginleft = marginleft; 121 t.marginright = marginright; 122 t.linesp = linesp; 123 t.kerning = kerning; 124 t.script = script; 125 t.text = text; 126 return t; 127 } 128 129 public FlashItem getCopy( ScriptCopier copier ) { 130 return copyInto( new TextItem(), copier ); 131 } 132 133 } 134 135 | Popular Tags |