26 |
|
|
27 |
package org.fenfire.view.buoy; |
package org.fenfire.view.buoy; |
28 |
import org.fenfire.view.*; |
import org.fenfire.view.*; |
29 |
import org.fenfire.util.ControlBinding; |
import org.nongnu.libvob.mouse.MouseMultiplexer; |
30 |
|
|
31 |
import org.nongnu.libvob.*; |
import org.nongnu.libvob.*; |
32 |
import org.nongnu.libvob.impl.DefaultVobMatcher; |
import org.nongnu.libvob.impl.DefaultVobMatcher; |
53 |
} |
} |
54 |
|
|
55 |
|
|
56 |
/** The controller associated with this main node. */ |
/** The mouse controller associated with this main node. */ |
57 |
protected ControlBinding controller; |
protected MouseMultiplexer mouseController; |
58 |
|
|
59 |
/** An object representing a focus on a 2D plane. |
/** An object representing a focus on a 2D plane. |
60 |
* The SimpleFocus implementation below just stores |
* The SimpleFocus implementation below just stores |
114 |
protected float boxw, boxh; |
protected float boxw, boxh; |
115 |
|
|
116 |
public AbstractMainNode2D(Object plane, View2D view2d, |
public AbstractMainNode2D(Object plane, View2D view2d, |
117 |
Focus focus, ControlBinding controller ) { |
Focus focus, MouseMultiplexer mouse) { |
118 |
this.plane = plane; this.view2d = view2d; |
this.plane = plane; this.view2d = view2d; |
119 |
this.focus = focus; this.controller = controller; |
this.focus = focus; this.mouseController = mouse; |
120 |
} |
} |
121 |
|
|
122 |
|
|
123 |
/** Render the context into the main node view i.e., |
/** Render the context into the main node view i.e., |
124 |
* text cursor. |
* text cursor. |
125 |
*/ |
*/ |
126 |
static public Render context = null; |
static public Context context = null; |
127 |
public void keystroke(String s) { |
public void keystroke(String s) { |
128 |
throw new Error("Not implemented."); |
throw new Error("Not implemented."); |
129 |
} |
} |
133 |
if (context != null) |
if (context != null) |
134 |
context.mainNodeToBeRender(vs, into, this); |
context.mainNodeToBeRender(vs, into, this); |
135 |
} |
} |
136 |
public interface Render { |
public interface Context { |
137 |
void mainNodeToBeRender(VobScene vs, int into, |
void mainNodeToBeRender(VobScene vs, int into, |
138 |
AbstractMainNode2D main); |
AbstractMainNode2D main); |
139 |
|
boolean changeFastAfterMouseEvent(); |
140 |
} |
} |
141 |
|
|
142 |
/** Cause the changes to the zooming and panning variables |
/** Cause the changes to the zooming and panning variables |
262 |
} |
} |
263 |
|
|
264 |
public boolean mouse(VobMouseEvent e, VobScene oldVobScene) { |
public boolean mouse(VobMouseEvent e, VobScene oldVobScene) { |
265 |
return controller.handleEvent(this, e, oldVobScene); |
mouseController.deliverEvent(e); |
266 |
|
return context.changeFastAfterMouseEvent(); |
267 |
} |
} |
268 |
|
|
269 |
public void chgFast(VobScene oldVobScene, int parent) { |
public void chgFast(VobScene oldVobScene, int parent) { |
273 |
View2D view = getView2D(); |
View2D view = getView2D(); |
274 |
while (view != null) { |
while (view != null) { |
275 |
if (view instanceof org.fenfire.view.lava.FastView) |
if (view instanceof org.fenfire.view.lava.FastView) |
|
/** Jams the machine if called. |
|
|
* ''Single Multiple'' views makes things awful. |
|
|
* |
|
|
* ...working on a better solution. |
|
|
*/ |
|
276 |
((org.fenfire.view.lava.FastView)view) |
((org.fenfire.view.lava.FastView)view) |
277 |
.chgFast(oldVobScene, box2screen); |
.chgFast(oldVobScene, box2screen); |
278 |
view = view.getChildView2D(); |
view = view.getChildView2D(); |