/[fenfire]/fenfire/org/fenfire/view/RSTText.java
ViewVC logotype

Diff of /fenfire/org/fenfire/view/RSTText.java

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

revision 1.1 by mudyc, Wed May 7 04:08:05 2003 UTC revision 1.2 by mudyc, Tue May 13 22:08:57 2003 UTC
# Line 26  RSTText.java Line 26  RSTText.java
26   * Written by Benja Fallenstein and Matti J. Katila   * Written by Benja Fallenstein and Matti J. Katila
27   */   */
28  package org.fenfire.view;  package org.fenfire.view;
29    import org.fenfire.view.lava.*;
30  import org.fenfire.swamp.*;  import org.fenfire.swamp.*;
31  import org.nongnu.alph.*;  import org.nongnu.alph.*;
32  import org.nongnu.libvob.*;  import org.nongnu.libvob.*;
33    import org.nongnu.libvob.util.*;
34  import org.nongnu.libvob.vobs.*;  import org.nongnu.libvob.vobs.*;
35    
36  /** A node function returning a vob that shows  /** A node function returning a vob that shows
37   *  the given node as text.   *  the given node as text.
38   */   */
39  public class RSTText implements NodeFunction {  public class RSTText extends TextHandler implements NodeFunction {
40        private void p(String s) { System.out.println("RSTText:: "+s); }
41    
42      final NodeFunction nodeContent;      final NodeFunction nodeContent;
43      final TextStyle style;      final TextStyle style;
44      final float scale;      final float scale;
45      FenPDFContext context = null;      private FenPDFContext context = null;
46    
47      public void setContext(FenPDFContext context) {      public void setContext(FenPDFContext context) {
48          this.context = context;          this.context = context;
# Line 56  public class RSTText implements NodeFunc Line 59  public class RSTText implements NodeFunc
59      public Object f(ConstGraph g, Object node) {      public Object f(ConstGraph g, Object node) {
60          if (context == null) throw new Error("No context set");          if (context == null) throw new Error("No context set");
61    
62            context.isToBePlaced(node, this);
63            p("placed");
64    
65          Enfilade1D enf = (Enfilade1D)nodeContent.f(g, node);          Enfilade1D enf = (Enfilade1D)nodeContent.f(g, node);
66                    
67          final Object objNode = node;          final Object objNode = node;
68          String s = enf.makeString();          String s = enf.makeString();
69          final TextVob vob = new TextVob(style, s, false);          final TextVob vob = new TextVob(style, s, false,
70                                            "Color " + ColorUtil.colorGLString(color));
71          final float width = style.getWidth(s, scale);          final float width = style.getWidth(s, scale);
72          final float height = style.getHeight(scale);          final float height = style.getHeight(scale);
73    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26