// (c): Matti J. Katila package org.fenfire.view; import org.fenfire.swamp.*; import org.nongnu.libvob.*; import org.nongnu.libvob.vobs.*; public class VobWrapperFunction implements NodeFunction { final NodeFunction function; final Vob vob; /** Wraps nodefunction, which function returns Placeable object, with * a vob. */ public VobWrapperFunction(NodeFunction func, Vob vob) { this.function = func; this.vob = vob; } public Object f(final ConstGraph g, final Object node) { return new org.nongnu.libvob.lava.placeable.Placeable() { final org.nongnu.libvob.lava.placeable.Placeable content = (org.nongnu.libvob.lava.placeable.Placeable)function.f(g, node); public void place(VobScene vs, int into) { content.place(vs, into); int cs = vs.orthoCS(into, "VobWrapper",0, 0,0, content.getWidth(), content.getHeight()); vs.put(vob, cs); } public float getWidth() { return content.getWidth(); } public float getHeight() { return content.getHeight(); } }; } }