compiile error
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9153]
This commit is contained in:
parent
72906f5910
commit
78bc92d81b
|
@ -29,7 +29,7 @@
|
|||
|
||||
package org.antlr.v4.runtime.tree.gui;
|
||||
|
||||
public class Arial extends FontMetrics {
|
||||
public class Arial extends BasicFontMetrics {
|
||||
{
|
||||
maxCharHeight = 781;
|
||||
widths[32] = 277; // space
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
package org.antlr.v4.runtime.tree.gui;
|
||||
|
||||
public class ArialBlack extends FontMetrics {
|
||||
public class ArialBlack extends BasicFontMetrics {
|
||||
{
|
||||
maxCharHeight = 770;
|
||||
widths[32] = 333; // space
|
||||
|
|
|
@ -67,7 +67,7 @@ package org.antlr.v4.runtime.tree.gui;
|
|||
|
||||
Units are 1000th of an 'em'.
|
||||
*/
|
||||
public abstract class FontMetrics {
|
||||
public abstract class BasicFontMetrics {
|
||||
protected int maxCharHeight;
|
||||
protected int[] widths = new int[128];
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
package org.antlr.v4.runtime.tree.gui;
|
||||
|
||||
public class CourierNew extends FontMetrics {
|
||||
public class CourierNew extends BasicFontMetrics {
|
||||
{
|
||||
maxCharHeight = 678;
|
||||
for (int i=0; i<128; i++) widths[i] = 600;
|
||||
|
|
|
@ -33,7 +33,7 @@ public class PostScriptDocument {
|
|||
protected int boundingBoxWidth;
|
||||
protected int boundingBoxHeight;
|
||||
|
||||
protected FontMetrics fontMetrics;
|
||||
protected BasicFontMetrics fontMetrics;
|
||||
protected String fontName;
|
||||
protected int fontSize = 12;
|
||||
protected double lineWidth = 0.3;
|
||||
|
@ -98,7 +98,7 @@ public class PostScriptDocument {
|
|||
this.fontSize = fontSize;
|
||||
try {
|
||||
Class c = Class.forName("org.antlr.v4.runtime.tree.gui." + fontName);
|
||||
this.fontMetrics = (FontMetrics)c.newInstance();
|
||||
this.fontMetrics = (BasicFontMetrics)c.newInstance();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new UnsupportedOperationException("No font metrics for "+fontName);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
package org.antlr.v4.runtime.tree.gui;
|
||||
|
||||
public class TimesNewRoman extends FontMetrics {
|
||||
public class TimesNewRoman extends BasicFontMetrics {
|
||||
{
|
||||
maxCharHeight = 717;
|
||||
widths[32] = 250; // space
|
||||
|
|
|
@ -163,7 +163,7 @@ public class TreePostScriptGenerator {
|
|||
t.addChild(b);
|
||||
b.addChild(c);
|
||||
b.addChild(d);
|
||||
TreePostScriptGenerator psgen = new TreePostScriptGenerator(null, t, "TimesNewRoman", 11);
|
||||
TreePostScriptGenerator psgen = new TreePostScriptGenerator(null, t, "CourierNew", 11);
|
||||
System.out.println(psgen.getPS());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue