27 |
*/ |
*/ |
28 |
package org.fenfire.view.buoy; |
package org.fenfire.view.buoy; |
29 |
import org.fenfire.view.View2D; |
import org.fenfire.view.View2D; |
30 |
import org.fenfire.util.ControlBinding; |
import org.nongnu.libvob.mouse.MouseMultiplexer; |
31 |
|
|
32 |
import org.nongnu.libvob.*; |
import org.nongnu.libvob.*; |
33 |
import org.nongnu.libvob.impl.DefaultVobMatcher; |
import org.nongnu.libvob.impl.DefaultVobMatcher; |
44 |
|
|
45 |
static public class MainNode2DFactory implements Factory { |
static public class MainNode2DFactory implements Factory { |
46 |
public float zoom; |
public float zoom; |
47 |
protected ControlBinding controller; |
protected MouseMultiplexer mouseController; |
48 |
public MainNode2DFactory(float zoom, |
public MainNode2DFactory(float zoom, |
49 |
ControlBinding controller) { |
MouseMultiplexer mouse) { |
50 |
this.zoom = zoom; |
this.zoom = zoom; |
51 |
this.controller = controller; |
this.mouseController = mouse; |
52 |
} |
} |
53 |
public AbstractMainNode2D create(Object plane, View2D view2d, |
public AbstractMainNode2D create(Object plane, View2D view2d, |
54 |
float panx, float pany) { |
float panx, float pany) { |
55 |
return new MainNode2D(plane, view2d, |
return new MainNode2D(plane, view2d, |
56 |
new SimpleFocus(panx, pany), zoom, |
new SimpleFocus(panx, pany), zoom, |
57 |
controller); |
mouseController); |
58 |
} |
} |
59 |
} |
} |
60 |
|
|
62 |
*/ |
*/ |
63 |
public MainNode2D(Object plane, View2D view2d, |
public MainNode2D(Object plane, View2D view2d, |
64 |
Focus focus, float zoom, |
Focus focus, float zoom, |
65 |
ControlBinding controller) { |
MouseMultiplexer mouse) { |
66 |
super(plane, view2d, focus, controller); |
super(plane, view2d, focus, mouse); |
67 |
focus.setZoom(zoom); |
focus.setZoom(zoom); |
68 |
} |
} |
69 |
|
|
70 |
/** Create a main node focused the center of a given plane. |
/** Create a main node focused the center of a given plane. |
71 |
*/ |
*/ |
72 |
public MainNode2D(Object plane, View2D view2d, |
public MainNode2D(Object plane, View2D view2d, |
73 |
ControlBinding controller) { |
MouseMultiplexer mouse) { |
74 |
this(plane, view2d, new SimpleFocus(0, 0), 1, |
this(plane, view2d, new SimpleFocus(0, 0), 1, |
75 |
controller); |
mouse); |
76 |
view2d.getSize(plane, tmp); |
view2d.getSize(plane, tmp); |
77 |
if(tmp[0] >= 0) { |
if(tmp[0] >= 0) { |
78 |
focus.setPan(tmp[0] / 2f, tmp[1] / 2f); |
focus.setPan(tmp[0] / 2f, tmp[1] / 2f); |