[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gzz view/CellHBox.java vob/DefaultLinebreak...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz/gzz view/CellHBox.java vob/DefaultLinebreak... |
Date: |
Sat, 21 Sep 2002 19:00:38 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 02/09/21 19:00:38
Modified files:
gzz/view : CellHBox.java
gzz/vob : DefaultLinebreaker.java HBroken.java
HChain.java LinebreakableChain.java
Log message:
Use more common terminology
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CellHBox.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/DefaultLinebreaker.java.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/HBroken.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/HChain.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/LinebreakableChain.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: gzz/gzz/view/CellHBox.java
diff -c gzz/gzz/view/CellHBox.java:1.1 gzz/gzz/view/CellHBox.java:1.2
*** gzz/gzz/view/CellHBox.java:1.1 Sat Sep 21 18:48:01 2002
--- gzz/gzz/view/CellHBox.java Sat Sep 21 19:00:38 2002
***************
*** 31,37 ****
}
public float getDepth(float scale) {
! throw new UnsupportedOperationException("XXX");
}
public Object getKey() {
--- 31,37 ----
}
public float getDepth(float scale) {
! return 0;
}
public Object getKey() {
Index: gzz/gzz/vob/DefaultLinebreaker.java
diff -c gzz/gzz/vob/DefaultLinebreaker.java:1.1
gzz/gzz/vob/DefaultLinebreaker.java:1.2
*** gzz/gzz/vob/DefaultLinebreaker.java:1.1 Thu Aug 15 17:05:29 2002
--- gzz/gzz/vob/DefaultLinebreaker.java Sat Sep 21 19:00:38 2002
***************
*** 27,33 ****
* <code>Linebreaker</code> interface. <code>;-)</code>
*/
public class DefaultLinebreaker implements Linebreaker {
! String rcsid = "$Id: DefaultLinebreaker.java,v 1.1 2002/08/15 21:05:29 benja
Exp $";
// Trivial linebreaker implementation
// XXX refactor
--- 27,33 ----
* <code>Linebreaker</code> interface. <code>;-)</code>
*/
public class DefaultLinebreaker implements Linebreaker {
! String rcsid = "$Id: DefaultLinebreaker.java,v 1.2 2002/09/21 23:00:38 benja
Exp $";
// Trivial linebreaker implementation
// XXX refactor
***************
*** 86,95 ****
if(line >= scales.length) scale = scales[scales.length-1];
else scale = scales[line];
cur = chompTriv(ch, cur, w, scale);
! int h = (int)ch.getHeight(bro.tokenStarts[line], cur, scale);
bro.lineHeights[line] += h;
height += h;
! int d = (int)ch.getDepth(bro.tokenStarts[line], cur, scale);
bro.lineHeights[line+1] += d;
height += d;
}
--- 86,95 ----
if(line >= scales.length) scale = scales[scales.length-1];
else scale = scales[line];
cur = chompTriv(ch, cur, w, scale);
! int h = (int)ch.getAscent(bro.tokenStarts[line], cur, scale);
bro.lineHeights[line] += h;
height += h;
! int d = (int)ch.getDescent(bro.tokenStarts[line], cur, scale);
bro.lineHeights[line+1] += d;
height += d;
}
Index: gzz/gzz/vob/HBroken.java
diff -c gzz/gzz/vob/HBroken.java:1.2 gzz/gzz/vob/HBroken.java:1.3
*** gzz/gzz/vob/HBroken.java:1.2 Sat Sep 21 18:48:01 2002
--- gzz/gzz/vob/HBroken.java Sat Sep 21 19:00:38 2002
***************
*** 72,78 ****
for(int j=from; j<to; j++) {
HBox box = chain.getBox(j);
float w = box.getWidth(scale);
! float h = box.getHeight(scale);
Object key = box.getKey();
int cs = vs.coords.coordsys(coordsys, key, 0, x, y, w, h);
--- 72,78 ----
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.coords.coordsys(coordsys, key, 0, x, y, w, h);
Index: gzz/gzz/vob/HChain.java
diff -c gzz/gzz/vob/HChain.java:1.3 gzz/gzz/vob/HChain.java:1.4
*** gzz/gzz/vob/HChain.java:1.3 Sat Sep 21 17:49:04 2002
--- gzz/gzz/vob/HChain.java Sat Sep 21 19:00:38 2002
***************
*** 67,78 ****
* simply the maximum of the heights of the individual boxes at
* the given scale.
*/
! float getHeight(int start, int end, float scale);
/** Get the depth of a line given the index of the first and the
* index after the last box in that line. The depth of the line is
* simply the maximum of the heights of the individual boxes at
* the given scale.
*/
! float getDepth(int start, int end, float scale);
}
--- 67,80 ----
* simply the maximum of the heights of the individual boxes at
* the given scale.
*/
! float getAscent(int start, int end, float scale);
/** Get the depth of a line given the index of the first and the
* index after the last box in that line. The depth of the line is
* simply the maximum of the heights of the individual boxes at
* the given scale.
*/
! float getDescent(int start, int end, float scale);
!
! float getHeight(int start, int end, float scale);
}
Index: gzz/gzz/vob/LinebreakableChain.java
diff -c gzz/gzz/vob/LinebreakableChain.java:1.6
gzz/gzz/vob/LinebreakableChain.java:1.7
*** gzz/gzz/vob/LinebreakableChain.java:1.6 Sat Sep 21 17:49:04 2002
--- gzz/gzz/vob/LinebreakableChain.java Sat Sep 21 19:00:38 2002
***************
*** 26,32 ****
/** Default impl of <code>HChain</code>.
*/
public class LinebreakableChain implements HChain {
! String rcsid = "$Id: LinebreakableChain.java,v 1.6 2002/09/21 21:49:04 benja
Exp $";
public static final int GLUE_LENGTH = 0;
public static final int GLUE_STRETCH = 1;
--- 26,32 ----
/** Default impl of <code>HChain</code>.
*/
public class LinebreakableChain implements HChain {
! String rcsid = "$Id: LinebreakableChain.java,v 1.7 2002/09/21 23:00:38 benja
Exp $";
public static final int GLUE_LENGTH = 0;
public static final int GLUE_STRETCH = 1;
***************
*** 128,134 ****
! public float getHeight(int start, int end, float scale) {
float h = 0;
for(int i=start; i<end; i++) {
float curh = boxes[i].getHeight(scale);
--- 128,134 ----
! public float getAscent(int start, int end, float scale) {
float h = 0;
for(int i=start; i<end; i++) {
float curh = boxes[i].getHeight(scale);
***************
*** 137,149 ****
return h;
}
! public float getDepth(int start, int end, float scale) {
float d = 0;
for(int i=start; i<end; i++) {
float curd = boxes[i].getDepth(scale);
if(curd > d) d = curd;
}
return d;
}
--- 137,153 ----
return h;
}
! public float getDescent(int start, int end, float scale) {
float d = 0;
for(int i=start; i<end; i++) {
float curd = boxes[i].getDepth(scale);
if(curd > d) d = curd;
}
return d;
+ }
+
+ public float getHeight(int start, int end, float scale) {
+ return getAscent(start, end, scale) + getDescent(start, end, scale);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/gzz view/CellHBox.java vob/DefaultLinebreak...,
Benja Fallenstein <=