fenfire-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fenfire-dev] Re: [ff-cvs] fenfire/org/fenfire/view PageNodeView.java


From: Tuomas Lukka
Subject: [Fenfire-dev] Re: [ff-cvs] fenfire/org/fenfire/view PageNodeView.java
Date: Tue, 26 Aug 2003 11:03:27 +0300
User-agent: Mutt/1.5.4i

On Mon, Aug 25, 2003 at 05:17:43PM -0400, Matti Katila wrote:
> CVSROOT:      /cvsroot/fenfire
> Module name:  fenfire
> Branch:       
> Changes by:   Matti Katila <address@hidden>   03/08/25 17:17:43
> 
> Modified files:
>       org/fenfire/view: PageNodeView.java 
> 
> Log message:
>       put lines around page node

This is a good idea, but:::

> Patches:
> Index: fenfire/org/fenfire/view/PageNodeView.java
> diff -u fenfire/org/fenfire/view/PageNodeView.java:1.2 
> fenfire/org/fenfire/view/PageNodeView.java:1.3
> --- fenfire/org/fenfire/view/PageNodeView.java:1.2    Tue Jul 15 03:18:11 2003
> +++ fenfire/org/fenfire/view/PageNodeView.java        Mon Aug 25 17:17:42 2003
> @@ -31,6 +31,7 @@
>  import org.nongnu.alph.*;
>  import org.nongnu.libvob.*;
>  import org.nongnu.libvob.vobs.*;
> +import java.awt.Color;
>  
>  /** A node function returning a vob that shows
>   *  the given node as a pageimage or sequence of pages.
> @@ -39,15 +40,32 @@
>  
>      final NodeFunction nodeContent;
>      final SpanImageFactory spanImageFactory;
> +    final Color color;
>  
>      public PageNodeView(NodeFunction nodeContent,
> -                     SpanImageFactory spanImageFactory) {
> +                     SpanImageFactory spanImageFactory,
> +                     Color color) {
>       this.nodeContent = nodeContent;
>       this.spanImageFactory = spanImageFactory;
> +     this.color = color;
>      }
>  
>      public Object f(ConstGraph g, Object node) {
> -     Enfilade1D enf = (Enfilade1D)nodeContent.f(g, node);
> -     return new PageSpanLayout(enf, spanImageFactory);
> +     final Enfilade1D enf = (Enfilade1D)nodeContent.f(g, node);
> +     return new org.nongnu.libvob.lava.placeable.Placeable() {
> +             private final PageSpanLayout page = new PageSpanLayout(enf, 
> spanImageFactory);
> +             private final Vob borders = 
> +                 new org.nongnu.libvob.vobs.ContinuousLineVob(8, new float[]
> +                     {0,0,0 , 1f,0,0 , 1f,1f,0 ,  0,1f,0}, true, 100, color);
> +
> +             public void place(VobScene vs, int into) {
> +                 page.place(vs, into);
> +                 int cs = vs.orthoCS(into, enf.toString(),0, 0,0, 
> page.getWidth(), page.getHeight());
> +                 vs.put(borders, cs);
> +             }
> +
> +             public float getWidth() { return page.getWidth(); }
> +             public float getHeight() { return page.getHeight(); }
> +         };
>      }
>  }
> 

Could we rather have this as a wrapper, i.e. another nodefunction that
wraps around the earlier one? Then we could have the same code do this
for different types of nodes

        Tuomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]