119 |
*/ |
*/ |
120 |
static public org.fenfire.view.lava.FenPDFContext context = null; |
static public org.fenfire.view.lava.FenPDFContext context = null; |
121 |
public void keystroke(String s) { |
public void keystroke(String s) { |
122 |
context.handleKeyStroke(s, this); |
if (context != null) |
123 |
} |
context.handleKeyStroke(s, this); |
|
|
|
|
protected AreaSelectingView2D selection = new AreaSelectingView2D(null); |
|
|
public void setSelection(float x, float y, float x1, float y1) { |
|
|
selection.setArea(x,y,x1,y1); |
|
124 |
} |
} |
125 |
|
|
126 |
public void renderMain(VobScene vs, int into) { |
public void renderMain(VobScene vs, int into) { |
127 |
context.mainNodeToBeRender(vs, into, this); |
// inherited classes will render before this. |
128 |
// extending classes will render after this. |
if (context != null) |
129 |
|
context.mainNodeToBeRender(vs, into, this); |
130 |
|
|
131 |
} |
} |
132 |
public interface Render { |
public interface Render { |
133 |
void mainNodeToBeRender(VobScene vs, int into, |
void mainNodeToBeRender(VobScene vs, int into, |
163 |
} |
} |
164 |
} |
} |
165 |
|
|
166 |
public float[] getXYHitOnPlane(VobScene oldVobScene, float x, float y) { |
public float[] getXYHit(VobScene oldVobScene, float x, float y) { |
167 |
float[] pt = new float[] { x, y, 0 }; |
float[] pt = new float[] { x, y, 0 }; |
168 |
float[] sq = new float[2]; |
if (dbg) p("P1: "+pt[0]+" "+pt[1]+" "+pt[2]); |
169 |
oldVobScene.coords.inverseTransformPoints3( |
oldVobScene.coords.inverseTransformPoints3(box2screen, pt, pt); |
170 |
box2screen, pt, pt); |
if (dbg) p("P2: "+pt[0]+" "+pt[1]+" "+pt[2]); |
171 |
if (this instanceof MainNode2D) { |
oldVobScene.coords.transformPoints3(box2paper, pt, pt); |
172 |
return pt; |
if (dbg) p("P3: "+pt[0]+" "+pt[1]+" "+pt[2]); |
173 |
} else if (this instanceof FisheyeMainNode2D) { |
return pt; |
174 |
oldVobScene.coords.transformPoints3(box2paper, pt, pt); |
} |
|
return pt; |
|
|
} else throw new Error("No known main node view2d"); |
|
|
} |
|
175 |
|
|
176 |
public boolean isHitInsidePlane(int x, int y, VobScene oldVobScene) { |
public boolean isHitInsidePlane(int x, int y, VobScene oldVobScene) { |
177 |
float[] pt = new float[] { x, y, 0 }; |
float[] pt = new float[] { x, y, 0 }; |