5 |
import org.nongnu.libvob.*; |
import org.nongnu.libvob.*; |
6 |
import org.nongnu.libvob.vobs.*; |
import org.nongnu.libvob.vobs.*; |
7 |
|
|
8 |
|
/** This node function places a vob. It needs another |
9 |
|
* nodefunction which returns Placeable object to get the size and |
10 |
|
* this size is used to construct ortho coordinate system, where |
11 |
|
* the vob is placed. Placeable object is also placed and that |
12 |
|
* makes a wrapper function of this by wrapping a vob and a placeable |
13 |
|
* object together. |
14 |
|
* @see Placeable |
15 |
|
*/ |
16 |
public class VobWrapperFunction implements NodeFunction { |
public class VobWrapperFunction implements NodeFunction { |
17 |
final NodeFunction function; |
final NodeFunction function; |
18 |
final Vob vob; |
final Vob vob; |
19 |
|
|
20 |
/** Wraps nodefunction, which function returns Placeable object, with |
/** Wrapper function used to wrap a vob and a placeable object. |
21 |
* a vob. |
* @param function A function which returns a Placeable object. |
22 |
|
* @param vob The Vob used to place into ortho coordinate system |
23 |
|
* which is same size as the Placeable returned by |
24 |
|
* the function. |
25 |
|
* @see Placeable |
26 |
*/ |
*/ |
27 |
public VobWrapperFunction(NodeFunction func, Vob vob) { |
public VobWrapperFunction(NodeFunction function, Vob vob) { |
28 |
this.function = func; |
this.function = function; |
29 |
this.vob = vob; |
this.vob = vob; |
30 |
} |
} |
31 |
|
|
32 |
|
/** @return A Placeable object. |
33 |
|
*/ |
34 |
public Object f(final ConstGraph g, final Object node) { |
public Object f(final ConstGraph g, final Object node) { |
35 |
return new org.nongnu.libvob.lava.placeable.Placeable() { |
return new org.nongnu.libvob.lava.placeable.Placeable() { |
36 |
final org.nongnu.libvob.lava.placeable.Placeable content = |
final org.nongnu.libvob.lava.placeable.Placeable content = |