[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz gfx/librenderables/renderables.py gzz/view/...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz gfx/librenderables/renderables.py gzz/view/... |
Date: |
Sun, 29 Sep 2002 10:53:46 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 02/09/29 10:53:45
Modified files:
gfx/librenderables: renderables.py
gzz/view : CellContentView.java CellHBox.java
CellView.java CellVobFactory.java
DimDecorator.java LastOpDecorator.java
LinebrokenCellContentView.java
MarkDecorator.java TextCellContentView.java
VobVanishingClient.java
gzz/vob : HBox.java HBroken.java LinebreakingUtil.java
TextVob.java
Removed files:
gzz/view : SpanCellContentView.java
Log message:
Impl of proposal on mailing list this morning (w/h/one coordsys passed
thru views)
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.82&tr2=1.83&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CellContentView.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CellHBox.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CellView.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CellVobFactory.java.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/DimDecorator.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/LastOpDecorator.java.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/LinebrokenCellContentView.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/MarkDecorator.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/TextCellContentView.java.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/VobVanishingClient.java.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/HBox.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/HBroken.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/LinebreakingUtil.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/TextVob.java.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
Patches:
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.82
gzz/gfx/librenderables/renderables.py:1.83
*** gzz/gfx/librenderables/renderables.py:1.82 Sun Sep 29 10:49:32 2002
--- gzz/gfx/librenderables/renderables.py Sun Sep 29 10:53:45 2002
***************
*** 839,846 ****
"""
},
! # Draw horizontal text with origin from one coordsys and
! # text aspect ratio from another
{
"Type": "2",
"Name": "HorizText2",
--- 839,847 ----
"""
},
! # Draw horizontal text with origin and scale from one coordsys and
! # width and height from another
! # (XXX ignores w and h so far -> should consider in scaling)
{
"Type": "2",
"Name": "HorizText2",
***************
*** 864,901 ****
""",
"ExtraClass" : """
template<class Coords> struct Vertexer {
! const Coords &c, &ci, &c1;
float scale;
! float z;
! Vertexer(Coords &c, Coords &ci, Coords &c1,
! float scale, float z) : c(c), ci(ci), c1(c1),
scale(scale), z(z) { }
template<class T> void operator()(const T &x, const T &y) {
! ZPt tmp(x, y, 0);
! //tmp = c1.transform(tmp);
! //tmp = ci.transform(tmp);
c.vertex(tmp);
- //DBG(dbg_horiztext2) << "Vertex: "<<x<<" "<<y<<" "<<tmp<<"
"<<c.transform(tmp)
- // << "\\n";
}
};
""",
"RenderCode" : """
! Coords *coords2inv = coords2.getInverse();
! ZPt orig = coords2inv->transform(coords1.transform(origin));
! // ZPt h =
coords2inv->transform(coords1.transform(origin+ZVec(0,h1,0)));
! // float scale = (h-orig).length();
! ZPt zero(0, 0, 0);
! ZPt one(1, 1, 0);
! DBG(dbg_horiztext2) << "HT2 coordsys:
"<<coords1.transform(zero)<<coords2.transform(zero)<<coords2.transform(one)<<"\\n";
! DBG(dbg_horiztext2) << "Origin: "<<origin<<"
"<<coords1.transform(origin)<<orig<<"\\n";
! // DBG(dbg_horiztext2) << "h: "<<h1<<" "<<h<<" "<<scale<<"\\n";
! Vertexer<Coords> v(coords2, *coords2inv, coords1, h1, orig.z);
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_BLEND);
switch(magic) {
case 0:
Text::renderIter(*r, txt.begin(), txt.end(),
! orig.x,orig.y,
v
);
break;
--- 865,890 ----
""",
"ExtraClass" : """
template<class Coords> struct Vertexer {
! const Coords &c;
float scale;
! ZPt orig;
! Vertexer(Coords &c, float scale, ZPt orig) : c(c), scale(scale),
orig(orig) { }
template<class T> void operator()(const T &x, const T &y) {
! ZPt tmp(x - orig.x, y - orig.y, 0);
! //tmp.x *= scale; tmp.y *= scale;
! tmp.x += orig.x; tmp.y += orig.y;
c.vertex(tmp);
}
};
""",
"RenderCode" : """
! Vertexer<Coords> v(coords1, h1, origin);
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_BLEND);
switch(magic) {
case 0:
Text::renderIter(*r, txt.begin(), txt.end(),
! origin.x,origin.y,
v
);
break;
***************
*** 904,910 ****
static char buffer[100];
sprintf(buffer, "FPS %2.2f", fps);
Text::renderIter(*r, buffer, buffer+strlen(buffer),
! orig.x,orig.y,
v
);
break;
--- 893,899 ----
static char buffer[100];
sprintf(buffer, "FPS %2.2f", fps);
Text::renderIter(*r, buffer, buffer+strlen(buffer),
! origin.x,origin.y,
v
);
break;
Index: gzz/gzz/view/CellContentView.java
diff -c gzz/gzz/view/CellContentView.java:1.3
gzz/gzz/view/CellContentView.java:1.4
*** gzz/gzz/view/CellContentView.java:1.3 Fri Sep 27 05:07:55 2002
--- gzz/gzz/view/CellContentView.java Sun Sep 29 10:53:45 2002
***************
*** 33,40 ****
* with different kinds of boxes.
*/
public interface CellContentView {
! String rcsid = "$Id: CellContentView.java,v 1.3 2002/09/27 09:07:55 tjl Exp
$";
/** Place the contents of one cell into the given coord system.
*/
! void place(Cell c, VobScene sc, int coordsys_outside, int coordsys_box,
float x, float y, float w, float h, ViewContext context, float scale);
}
--- 33,41 ----
* with different kinds of boxes.
*/
public interface CellContentView {
! String rcsid = "$Id: CellContentView.java,v 1.4 2002/09/29 14:53:45 benja Exp
$";
/** Place the contents of one cell into the given coord system.
*/
! void place(Cell c, VobScene sc, int coordsys, float w, float h,
! ViewContext context, float scale);
}
Index: gzz/gzz/view/CellHBox.java
diff -c gzz/gzz/view/CellHBox.java:1.4 gzz/gzz/view/CellHBox.java:1.5
*** gzz/gzz/view/CellHBox.java:1.4 Fri Sep 27 05:07:56 2002
--- gzz/gzz/view/CellHBox.java Sun Sep 29 10:53:45 2002
***************
*** 59,68 ****
return cell;
}
! public void place(VobScene vs, int coordsys_out, int coordsys_box,
! float x, float y, float w, float h, float scale) {
! view.place(cell, vs, coordsys_out, coordsys_box,
! x, y, w, h, context, scale);
}
public void setPrev(HBox b) {}
--- 59,67 ----
return cell;
}
! public void place(VobScene vs, int coordsys, float scale) {
! float w = getWidth(scale), h = getHeight(scale)+getDepth(scale);
! view.place(cell, vs, coordsys, w, h, context, scale);
}
public void setPrev(HBox b) {}
Index: gzz/gzz/view/CellView.java
diff -c gzz/gzz/view/CellView.java:1.3 gzz/gzz/view/CellView.java:1.4
*** gzz/gzz/view/CellView.java:1.3 Fri Sep 27 05:07:56 2002
--- gzz/gzz/view/CellView.java Sun Sep 29 10:53:45 2002
***************
*** 32,40 ****
/** place a single cell
*/
void place(Cell c, VobScene vs,
! int coordsys_outside,
! int coordsys_box,
! float x, float y, float w, float h, // for now
ViewContext context,
float scale);
--- 32,38 ----
/** place a single cell
*/
void place(Cell c, VobScene vs,
! int coordsys, float w, float h, // for now
ViewContext context,
float scale);
Index: gzz/gzz/view/CellVobFactory.java
diff -c gzz/gzz/view/CellVobFactory.java:1.15
gzz/gzz/view/CellVobFactory.java:1.16
*** gzz/gzz/view/CellVobFactory.java:1.15 Sat Sep 28 18:55:13 2002
--- gzz/gzz/view/CellVobFactory.java Sun Sep 29 10:53:45 2002
***************
*** 46,57 ****
*/
public class CellVobFactory implements CellView {
! public static final String rcsid = "$Id: CellVobFactory.java,v 1.15
2002/09/28 22:55:13 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
static Object CONTENT_KEY = new Object();
static TextStyle style =
GraphicsAPI.getInstance().getTextStyle("SansSerif", Font.PLAIN, 10);
--- 46,58 ----
*/
public class CellVobFactory implements CellView {
! public static final String rcsid = "$Id: CellVobFactory.java,v 1.16
2002/09/29 14:53:45 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
static Object CONTENT_KEY = new Object();
+ static Object BOX_KEY = new Object();
static TextStyle style =
GraphicsAPI.getInstance().getTextStyle("SansSerif", Font.PLAIN, 10);
***************
*** 118,142 ****
static Rectangle rect = new Rectangle();
- public void place(Cell c, VobScene vs, int coordsys_out,
- int coordsys_box,
- float x, float y, float w, float h,
- ViewContext context, float scale) {
- addCellVobs(c, vs, coordsys_out, coordsys_box,
- x, y, w, h, null, context, scale);
- }
-
/** Add the vobs that make up a cell into the given coordinate
* system of the given vobscene.
* @param c The cell
* @param v The vobscene to add to
* @param cs The coordinate system index
*/
! public void addCellVobs(final Cell c, final VobScene v, final int cs_out,
! final int cs_box,
! final float x, final float y, final float w, final float h,
! final Vob content,
! final ViewContext context, final float scale) {
setCenter(context.getAccursed());
if(d_clone == null)
throw new NullPointerException("clone dim not set in
CellVobFactory");
--- 119,133 ----
static Rectangle rect = new Rectangle();
/** Add the vobs that make up a cell into the given coordinate
* system of the given vobscene.
* @param c The cell
* @param v The vobscene to add to
* @param cs The coordinate system index
*/
! public void place(final Cell c, final VobScene v, final int cs,
! final float w, final float h,
! final ViewContext context, final float scale) {
setCenter(context.getAccursed());
if(d_clone == null)
throw new NullPointerException("clone dim not set in
CellVobFactory");
***************
*** 168,198 ****
bg.setBg(new Color(bg.getBg().getRGB() & (int)0xff00ffffL));
*/
! v.map.put(bg, cs_box);
if(!(GraphicsAPI.getInstance() instanceof gzz.client.gl.GLAPI)) {
! Vob.RenderInfo info = v.coords.getRenderInfo(cs_box);
! info.getExtRect(rect);
! final int content_cs = v.coordsys(cs_box, CONTENT_KEY, 0, 5, 5,
! rect.width-10, rect.height-10);
! if(content != null)
! v.map.put(content, content_cs);
! else
! ccv.place(c, v, cs_out, content_cs, x, y, w, h, context, scale);
} else {
! /*gzz.gfx.gl.Stencil.drawStenciled(
v,
new Runnable() { public void run() {
v.map.put(bg, cs_box);
}},
null,
null,
! new Runnable() { public void run() {*/
! ccv.place(c, v, cs_out, cs_box, x, y, w, h, context, scale);
! /*}},
false
! );*/
}
}
}
--- 159,184 ----
bg.setBg(new Color(bg.getBg().getRGB() & (int)0xff00ffffL));
*/
! final int cs_box = v.coordsys(cs, BOX_KEY, 0, 0, 0, w, h);
! v.map.put(bg, cs_box);
if(!(GraphicsAPI.getInstance() instanceof gzz.client.gl.GLAPI)) {
! final int content_cs = v.coordsys(cs, CONTENT_KEY, 0, 5, 5, 2, 2);
! ccv.place(c, v, content_cs, w, h, context, scale);
} else {
! gzz.gfx.gl.Stencil.drawStenciled(
v,
new Runnable() { public void run() {
v.map.put(bg, cs_box);
}},
null,
null,
! new Runnable() { public void run() {
! ccv.place(c, v, cs, w, h, context, scale);
! }},
false
! );
}
}
}
Index: gzz/gzz/view/DimDecorator.java
diff -c gzz/gzz/view/DimDecorator.java:1.7 gzz/gzz/view/DimDecorator.java:1.8
*** gzz/gzz/view/DimDecorator.java:1.7 Sat Sep 28 05:17:14 2002
--- gzz/gzz/view/DimDecorator.java Sun Sep 29 10:53:45 2002
***************
*** 32,38 ****
* vob scene.
*/
public class DimDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: DimDecorator.java,v 1.7 2002/09/28 09:17:14 benja Exp $";
public static boolean dbg = true;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
--- 32,38 ----
* vob scene.
*/
public class DimDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: DimDecorator.java,v 1.8 2002/09/29 14:53:45 benja Exp $";
public static boolean dbg = true;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
***************
*** 46,51 ****
--- 46,52 ----
static Object origKey = new Object(), viewKey = new Object();
static Object[] dimKeys = { new Object(), new Object(), new Object() };
+ static Object boxKey = new Object();
public void render(VobScene sc, int into, Fallback fallback, Fallback.Win
win) {
//p("Placing DimDecorations");
***************
*** 59,80 ****
int w = size.width, h = size.height;
// The coordinate system where the lines start
! int orig = sc.coordsys(into, origKey, 0, 0, 0, w, h);
// The coordinate systems of the dimensions
int[] targ = {
! sc.coordsys(into, dimKeys[0], 0, w, 0, w, h),
! sc.coordsys(into, dimKeys[1], 0, 0, h, w, h),
! sc.coordsys(into, dimKeys[2], 0, w, h, w, h)
};
for(int i=0; i<3; i++) {
sc.map.put(conn, targ[i], orig);
! sc.map.put(bg, targ[i]);
! int cs = sc.coordsys(targ[i], dimKeys[i], 0, 0, 0,
! style.getWidth(dims[i].name, 1),
! style.getHeight(1));
! sc.map.put(new TextVob(style, dims[i].name), cs, into);
}
View view = fallback.viewList[win.viewIndex];
--- 60,81 ----
int w = size.width, h = size.height;
// The coordinate system where the lines start
! int orig = sc.coordsys(into, origKey, 0, 0, 0, 2, 2);
// The coordinate systems of the dimensions
int[] targ = {
! sc.coordsys(into, dimKeys[0], 0, w, 0, 2, 2),
! sc.coordsys(into, dimKeys[1], 0, 0, h, 2, 2),
! sc.coordsys(into, dimKeys[2], 0, w, h, 2, 2)
};
for(int i=0; i<3; i++) {
sc.map.put(conn, targ[i], orig);
! int cs_box = sc.coordsys(targ[i], boxKey, 0, 0, 0, w, h);
! sc.map.put(bg, cs_box);
!
! int cs = sc.coordsys(targ[i], dimKeys[i], 0, 5, 5, 2, 2);
! sc.map.put(new TextVob(style, dims[i].name), cs);
}
View view = fallback.viewList[win.viewIndex];
***************
*** 84,91 ****
sc.coords.getRenderInfo(into).getExtRect(rect);
float vw = style.getWidth(name, 1.6f), vh = style.getHeight(1.6f);
float vx = rect.width - vw - 10;
! int cs = sc.coordsys(into, viewKey, 0, vx, 10, vw, vh);
! sc.map.put(new TextVob(style, 1.6f, name), cs, into);
}
}
}
--- 85,92 ----
sc.coords.getRenderInfo(into).getExtRect(rect);
float vw = style.getWidth(name, 1.6f), vh = style.getHeight(1.6f);
float vx = rect.width - vw - 10;
! int cs = sc.coordsys(into, viewKey, 0, vx, 10, 2, 2);
! sc.map.put(new TextVob(style, 1.6f, name), cs);
}
}
}
Index: gzz/gzz/view/LastOpDecorator.java
diff -c gzz/gzz/view/LastOpDecorator.java:1.12
gzz/gzz/view/LastOpDecorator.java:1.13
*** gzz/gzz/view/LastOpDecorator.java:1.12 Sat Sep 28 18:55:13 2002
--- gzz/gzz/view/LastOpDecorator.java Sun Sep 29 10:53:45 2002
***************
*** 32,38 ****
* directional op entered.
*/
public class LastOpDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: LastOpDecorator.java,v 1.12 2002/09/28 22:55:13 benja
Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
--- 32,38 ----
* directional op entered.
*/
public class LastOpDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: LastOpDecorator.java,v 1.13 2002/09/29 14:53:45 benja
Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
***************
*** 116,122 ****
int cs = sc.coordsys(into, key, 0, x, y, 2, 2);
! br.put(sc, into, cs);
if(dbg) pa("Put "+br+" "+ch.length()+" in cs "+cs+" @ "+x+" "+y+"
"+w+" "+h+" ("+size+")");
}
--- 116,122 ----
int cs = sc.coordsys(into, key, 0, x, y, 2, 2);
! br.put(sc, cs);
if(dbg) pa("Put "+br+" "+ch.length()+" in cs "+cs+" @ "+x+" "+y+"
"+w+" "+h+" ("+size+")");
}
Index: gzz/gzz/view/LinebrokenCellContentView.java
diff -c gzz/gzz/view/LinebrokenCellContentView.java:1.7
gzz/gzz/view/LinebrokenCellContentView.java:1.8
*** gzz/gzz/view/LinebrokenCellContentView.java:1.7 Sat Sep 28 18:55:13 2002
--- gzz/gzz/view/LinebrokenCellContentView.java Sun Sep 29 10:53:45 2002
***************
*** 38,44 ****
*/
public class LinebrokenCellContentView implements CellContentView {
! public static final String rcsid = "$Id: LinebrokenCellContentView.java,v 1.7
2002/09/28 22:55:13 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
--- 38,44 ----
*/
public class LinebrokenCellContentView implements CellContentView {
! public static final String rcsid = "$Id: LinebrokenCellContentView.java,v 1.8
2002/09/29 14:53:45 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
***************
*** 62,77 ****
}
static Rectangle box = new Rectangle();
! public void place(Cell c, VobScene vs, int coordsys_outside, int
coordsys_box, float x, float y, float w, float h, ViewContext context, float
scale) {
HChain ch = getChain(c, scale);
if(dbg) pa(""+w);
HBroken br = breaker.breakLines(ch, w, scale);
!
! //argh!
! int cs = vs.coords.coordsys(coordsys_outside, 0, x, y, 2, 2);
! ((DefaultVobMatcher)vs.matcher).addSub(coordsys_box, cs, ARGH_KEY);
!
! br.put(vs, coordsys_outside, cs);
}
protected HChain getChain(Cell c, float scale) {
--- 62,73 ----
}
static Rectangle box = new Rectangle();
! public void place(Cell c, VobScene vs, int coordsys, float w, float h,
! ViewContext context, float scale) {
HChain ch = getChain(c, scale);
if(dbg) pa(""+w);
HBroken br = breaker.breakLines(ch, w, scale);
! br.put(vs, coordsys);
}
protected HChain getChain(Cell c, float scale) {
Index: gzz/gzz/view/MarkDecorator.java
diff -c gzz/gzz/view/MarkDecorator.java:1.2 gzz/gzz/view/MarkDecorator.java:1.3
*** gzz/gzz/view/MarkDecorator.java:1.2 Sat Sep 28 15:52:02 2002
--- gzz/gzz/view/MarkDecorator.java Sun Sep 29 10:53:45 2002
***************
*** 38,48 ****
if(m.spans != null) return; // for now-- should show span(s)
Cell c = m.cell;
! int cs = sc.coordsys(cs_list, c, 0, 0, i*box.height,
! box.width, box.height);
! cv.place(c, sc, into, cs, x, y+(i*box.height),
! box.width, box.height, win, 1);
}
w = style.getWidth(str, 1);
--- 38,46 ----
if(m.spans != null) return; // for now-- should show span(s)
Cell c = m.cell;
! int cs = sc.coordsys(cs_list, c, 0, 0, i*box.height, 2, 2);
! cv.place(c, sc, cs, box.width, box.height, win, 1);
}
w = style.getWidth(str, 1);
***************
*** 51,57 ****
if(w > box.width)
x += box.width - w;
! int cs = sc.coordsys(into, TEXT_KEY, 0, x, y, w, h);
sc.map.put(new TextVob(style, 1, str), cs);
}
}
--- 49,55 ----
if(w > box.width)
x += box.width - w;
! int cs = sc.coordsys(into, TEXT_KEY, 0, x, y, 2, 2);
sc.map.put(new TextVob(style, 1, str), cs);
}
}
Index: gzz/gzz/view/TextCellContentView.java
diff -c gzz/gzz/view/TextCellContentView.java:1.13
gzz/gzz/view/TextCellContentView.java:1.14
*** gzz/gzz/view/TextCellContentView.java:1.13 Sat Sep 28 18:55:13 2002
--- gzz/gzz/view/TextCellContentView.java Sun Sep 29 10:53:45 2002
***************
*** 37,43 ****
*/
public class TextCellContentView implements CellContentView {
! public static final String rcsid = "$Id: TextCellContentView.java,v 1.13
2002/09/28 22:55:13 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
--- 37,43 ----
*/
public class TextCellContentView implements CellContentView {
! public static final String rcsid = "$Id: TextCellContentView.java,v 1.14
2002/09/29 14:53:45 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
***************
*** 52,58 ****
}
static Rectangle box = new Rectangle();
! public void place(Cell c, VobScene v, int cs_out, int cs_box, float x,
float y, float w, float h, ViewContext context, float scale) {
String s = c.t();
if (s == null) s = "";
int offs = context.getCursorOffset(c);
--- 52,59 ----
}
static Rectangle box = new Rectangle();
! public void place(Cell c, VobScene v, int cs, float w, float h,
! ViewContext context, float scale) {
String s = c.t();
if (s == null) s = "";
int offs = context.getCursorOffset(c);
***************
*** 86,102 ****
else skew = (- left + middle);
Object key = (line < KEY.length) ? KEY[line] : new Integer(line+1);
! // int skewedcs = v.coordsys(cs, key, 0, skew, 0, w, box.height);
! placeVob(c, v, cs_out, cs_box, brBefore, brAfter, offs, context,
scale);
}
! protected void placeVob(Cell c, VobScene v, int cs_out, int cs_box, int
start, int end,
int offs, ViewContext context, float scale) {
TextVob vob = new TextVob(style, scale, c.t().substring(start, end));
! v.map.put(vob, cs_box);//, cs_out);
if(offs >= 0)
! v.map.put(new TextCursorVob(vob, offs), cs_box);
}
}
--- 87,106 ----
else skew = (- left + middle);
Object key = (line < KEY.length) ? KEY[line] : new Integer(line+1);
! int skewedcs = v.coordsys(cs, key, 0, skew, 0, 2, 2);
! placeVob(c, v, skewedcs, w, box.height, brBefore, brAfter, offs,
context, scale);
}
! static Object WH_KEY = new Object();
! protected void placeVob(Cell c, VobScene v, int cs, float w, float h, int
start, int end,
int offs, ViewContext context, float scale) {
TextVob vob = new TextVob(style, scale, c.t().substring(start, end));
! int cs_wh = v.coords.coordsys(0, 0, 0, 0, w, h);
! ((DefaultVobMatcher)v.matcher).addSub(cs, cs_wh, WH_KEY);
! v.map.put(vob, cs, cs_wh);
if(offs >= 0)
! v.map.put(new TextCursorVob(vob, offs), cs, cs_wh);
}
}
Index: gzz/gzz/view/VobVanishingClient.java
diff -c gzz/gzz/view/VobVanishingClient.java:1.11
gzz/gzz/view/VobVanishingClient.java:1.12
*** gzz/gzz/view/VobVanishingClient.java:1.11 Sat Sep 28 18:55:13 2002
--- gzz/gzz/view/VobVanishingClient.java Sun Sep 29 10:53:45 2002
***************
*** 164,175 ****
public void place(Cell c, Object o, float fract, int x0, int y0, int x1,
int y1,
int depth, float rot) {
Vob v = (Vob)o;
! int cs = into.coordsys(intoCS, c, depth, x0, y0, x1-x0, y1-y0);
! if(v != null) ((CellVobFactory)cvf).addCellVobs(c, into,
! intoCS, cs,
! (x0+x1)/2, (y0+y1)/2, (x1-x0)/2, (y1-y0)/2, v, context, fract);
! cvf.place(c, into, intoCS, cs,
! x0, y0, (x1-x0), (y1-y0), context, fract);
}
public void connect(Cell cell1, Cell cell2, int dx, int dy) {
--- 164,171 ----
public void place(Cell c, Object o, float fract, int x0, int y0, int x1,
int y1,
int depth, float rot) {
Vob v = (Vob)o;
! int cs = into.coordsys(intoCS, c, depth, x0, y0, 2, 2);
! cvf.place(c, into, cs, (x1-x0), (y1-y0), context, fract);
}
public void connect(Cell cell1, Cell cell2, int dx, int dy) {
Index: gzz/gzz/vob/HBox.java
diff -c gzz/gzz/vob/HBox.java:1.6 gzz/gzz/vob/HBox.java:1.7
*** gzz/gzz/vob/HBox.java:1.6 Fri Sep 27 05:07:56 2002
--- gzz/gzz/vob/HBox.java Sun Sep 29 10:53:45 2002
***************
*** 31,37 ****
*/
public interface HBox {
! String rcsid = "$Id: HBox.java,v 1.6 2002/09/27 09:07:56 tjl Exp $";
float getWidth(float scale);
--- 31,37 ----
*/
public interface HBox {
! String rcsid = "$Id: HBox.java,v 1.7 2002/09/29 14:53:45 benja Exp $";
float getWidth(float scale);
***************
*** 59,66 ****
* }
* </pre>
*/
! void place(VobScene vs, int coordsys_out, int coordsys_box,
! float x, float y, float w, float h, float scale);
/** The key for this HBox. XXX */
Object getKey();
--- 59,65 ----
* }
* </pre>
*/
! void place(VobScene vs, int coordsys, float scale);
/** The key for this HBox. XXX */
Object getKey();
***************
*** 75,97 ****
public float getWidth(float scale) { return 0; }
public float getHeight(float scale) { return 0; }
public float getDepth(float scale) { return 0; }
! public void place(VobScene vs, int coordsys_out, int coordsys_box,
! float x, float y, float w, float h, float scale) { }
public Object getKey() { return null; }
public void setPrev(HBox b) { }
}
/** A useful base class for hboxes that are vobs.
*/
abstract class VobHBox extends Vob implements HBox {
// public VobHBox(Object key) { super(key); }
protected float scale = 0;
public float getScale() { return scale; }
! public void place(VobScene vs, int coordsys_out, int coordsys_box,
! float x, float y, float w, float h, float scale) {
this.scale = scale;
! vs.map.put(this, coordsys_box);
}
public Object getKey() { return null; /* XXX */ }
--- 74,100 ----
public float getWidth(float scale) { return 0; }
public float getHeight(float scale) { return 0; }
public float getDepth(float scale) { return 0; }
! public void place(VobScene vs, int coordsys, float scale) {}
public Object getKey() { return null; }
public void setPrev(HBox b) { }
}
+ Object WH_KEY = new Object();
/** A useful base class for hboxes that are vobs.
+ * The second coordsys will contain the width and height for this vob.
*/
abstract class VobHBox extends Vob implements HBox {
// public VobHBox(Object key) { super(key); }
protected float scale = 0;
public float getScale() { return scale; }
! public void place(VobScene vs, int coordsys, float scale) {
this.scale = scale;
! float w = getWidth(scale), h = getHeight(scale)+getDepth(scale);
! int cs_wh = vs.coords.coordsys(0, 0, 0, 0, w, h);
! ((DefaultVobMatcher)vs.matcher).addSub(coordsys, cs_wh, WH_KEY);
!
! vs.map.put(this, coordsys, cs_wh);
}
public Object getKey() { return null; /* XXX */ }
Index: gzz/gzz/vob/HBroken.java
diff -c gzz/gzz/vob/HBroken.java:1.6 gzz/gzz/vob/HBroken.java:1.7
*** gzz/gzz/vob/HBroken.java:1.6 Sat Sep 28 18:55:13 2002
--- gzz/gzz/vob/HBroken.java Sun Sep 29 10:53:45 2002
***************
*** 53,59 ****
length++;
}
! public void put(VobScene vs, int coordsys_outside, int coordsys) {
int x = 0, y = 0;
for(int i=0; i<=length; i++) {
--- 53,59 ----
length++;
}
! public void put(VobScene vs, int coordsys) {
int x = 0, y = 0;
for(int i=0; i<=length; i++) {
***************
*** 71,84 ****
for(int j=from; j<to; j++) {
HBox box = chain.getBox(j);
- float w = box.getWidth(scale);
- float h = box.getHeight(scale) + box.getDepth(scale);
Object key = box.getKey();
! int cs = vs.coordsys(coordsys, key, 0, x, y, w, h);
! box.place(vs, coordsys_outside, cs, x, y, w, h, scale);
! x += w;
}
x = 0;
--- 71,82 ----
for(int j=from; j<to; j++) {
HBox box = chain.getBox(j);
Object key = box.getKey();
! int cs = vs.coordsys(coordsys, key, 0, x, y, 2, 2);
! box.place(vs, cs, scale);
! x += box.getWidth(scale);
}
x = 0;
Index: gzz/gzz/vob/LinebreakingUtil.java
diff -c gzz/gzz/vob/LinebreakingUtil.java:1.7
gzz/gzz/vob/LinebreakingUtil.java:1.8
*** gzz/gzz/vob/LinebreakingUtil.java:1.7 Fri Sep 27 05:07:56 2002
--- gzz/gzz/vob/LinebreakingUtil.java Sun Sep 29 10:53:45 2002
***************
*** 27,33 ****
*/
public class LinebreakingUtil {
! String rcsid = "$Id: LinebreakingUtil.java,v 1.7 2002/09/27 09:07:56 tjl Exp
$";
public static final int GLUE_LENGTH = 0;
public static final int GLUE_STRETCH = 1;
--- 27,33 ----
*/
public class LinebreakingUtil {
! String rcsid = "$Id: LinebreakingUtil.java,v 1.8 2002/09/29 14:53:45 benja
Exp $";
public static final int GLUE_LENGTH = 0;
public static final int GLUE_STRETCH = 1;
***************
*** 117,125 ****
over = dw - curwid;
int boxcs = into.coordsys(cs, boxes[i].getKey(), d,
! x + wid, y - curhei, curwid, curhei + curdep);
! boxes[i].place(into, cs, boxcs, x, y, curwid, curhei, scale);
wid += curwid;
}
}
--- 117,125 ----
over = dw - curwid;
int boxcs = into.coordsys(cs, boxes[i].getKey(), d,
! x + wid, y - curhei, 2, 2); //curwid, curhei + curdep);
! boxes[i].place(into, boxcs, scale);
wid += curwid;
}
}
Index: gzz/gzz/vob/TextVob.java
diff -c gzz/gzz/vob/TextVob.java:1.32 gzz/gzz/vob/TextVob.java:1.33
*** gzz/gzz/vob/TextVob.java:1.32 Sun Sep 29 10:49:32 2002
--- gzz/gzz/vob/TextVob.java Sun Sep 29 10:53:45 2002
***************
*** 31,37 ****
* from these and use a LineBreaker.
*/
public class TextVob extends HBox.VobHBox {
! String rcsid = "$Id: TextVob.java,v 1.32 2002/09/29 14:49:32 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
--- 31,37 ----
* from these and use a LineBreaker.
*/
public class TextVob extends HBox.VobHBox {
! String rcsid = "$Id: TextVob.java,v 1.33 2002/09/29 14:53:45 benja Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
***************
*** 119,125 ****
ht = GLRen.createHorizText2(
gls.theFont,
text,
! -1, -1, 0,
sh, 0);
}
if(cl == null) {
--- 119,125 ----
ht = GLRen.createHorizText2(
gls.theFont,
text,
! -1, sh*style.getAscent(1)-1, 0,
sh, 0);
}
if(cl == null) {