51 |
this.zoom = zoom; |
this.zoom = zoom; |
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, panx, pany, zoom); |
return new MainNode2D(plane, view2d, |
56 |
|
new SimpleFocus(panx, pany), zoom); |
57 |
} |
} |
58 |
} |
} |
59 |
|
|
60 |
/** Create a main node with a given plane, pan, and zoom. |
/** Create a main node with a given plane, pan, and zoom. |
61 |
*/ |
*/ |
62 |
public MainNode2D(Object plane, View2D view2d, |
public MainNode2D(Object plane, View2D view2d, |
63 |
float panX, float panY, float zoom) { |
Focus focus, float zoom) { |
64 |
super(plane, view2d, panX, panY); |
super(plane, view2d, focus); |
65 |
this.zoom = zoom; |
this.zoom = zoom; |
66 |
} |
} |
67 |
|
|
68 |
/** Create a main node focused the center of a given plane. |
/** Create a main node focused the center of a given plane. |
69 |
*/ |
*/ |
70 |
public MainNode2D(Object plane, View2D view2d) { |
public MainNode2D(Object plane, View2D view2d) { |
71 |
this(plane, view2d, 0, 0, 1); |
this(plane, view2d, new SimpleFocus(0, 0), 1); |
72 |
view2d.getSize(plane, tmp); |
view2d.getSize(plane, tmp); |
73 |
if(tmp[0] >= 0) { |
if(tmp[0] >= 0) { |
74 |
panX = tmp[0] / 2f; |
focus.setPan(tmp[0] / 2f, tmp[1] / 2f); |
|
panY = tmp[1] / 2f; |
|
75 |
} |
} |
76 |
} |
} |
77 |
|
|
91 |
|
|
92 |
protected void setZoomPan(VobScene vs, int mainFrame) { |
protected void setZoomPan(VobScene vs, int mainFrame) { |
93 |
vs.coords.setOrthoBoxParams(box2paper, 0, |
vs.coords.setOrthoBoxParams(box2paper, 0, |
94 |
panX-boxw/zoom/2, panY-boxh/zoom/2, |
focus.getPanX()-boxw/zoom/2, focus.getPanY()-boxh/zoom/2, |
95 |
1/zoom, 1/zoom, boxw, boxh); |
1/zoom, 1/zoom, boxw, boxh); |
96 |
} |
} |
97 |
|
|