Package org.antlr.v4.gui
Class PostScriptDocument
- java.lang.Object
-
- org.antlr.v4.gui.PostScriptDocument
-
public class PostScriptDocument extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected String
boundingBox
protected int
boundingBoxHeight
protected int
boundingBoxWidth
protected boolean
closed
static String
DEFAULT_FONT
protected SystemFontMetrics
fontMetrics
protected String
fontName
protected int
fontSize
protected double
lineWidth
static Map<String,String>
POSTSCRIPT_FONT_NAMES
protected StringBuilder
ps
-
Constructor Summary
Constructors Constructor Description PostScriptDocument()
PostScriptDocument(String fontName, int fontSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
boundingBox(int w, int h)
void
close()
int
getFontSize()
double
getLineHeight()
String
getPS()
double
getWidth(char c)
All chars are 600 thousands of an 'em' wide if courierdouble
getWidth(String s)
protected StringBuilder
header()
Compute the header separately because we need to wait for the bounding boxvoid
highlight(double x, double y, double width, double height)
Make red boxvoid
line(double x1, double y1, double x2, double y2)
void
lineto(double x, double y)
void
lineWidth(double w)
void
move(double x, double y)
void
rect(double x, double y, double width, double height)
void
setFont(String fontName, int fontSize)
void
stroke()
void
text(String s, double x, double y)
-
-
-
Field Detail
-
DEFAULT_FONT
public static final String DEFAULT_FONT
- See Also:
- Constant Field Values
-
boundingBoxWidth
protected int boundingBoxWidth
-
boundingBoxHeight
protected int boundingBoxHeight
-
fontMetrics
protected SystemFontMetrics fontMetrics
-
fontName
protected String fontName
-
fontSize
protected int fontSize
-
lineWidth
protected double lineWidth
-
boundingBox
protected String boundingBox
-
ps
protected StringBuilder ps
-
closed
protected boolean closed
-
-
Constructor Detail
-
PostScriptDocument
public PostScriptDocument()
-
PostScriptDocument
public PostScriptDocument(String fontName, int fontSize)
-
-
Method Detail
-
getPS
public String getPS()
-
boundingBox
public void boundingBox(int w, int h)
-
close
public void close()
-
header
protected StringBuilder header()
Compute the header separately because we need to wait for the bounding box
-
setFont
public void setFont(String fontName, int fontSize)
-
lineWidth
public void lineWidth(double w)
-
move
public void move(double x, double y)
-
lineto
public void lineto(double x, double y)
-
line
public void line(double x1, double y1, double x2, double y2)
-
rect
public void rect(double x, double y, double width, double height)
-
highlight
public void highlight(double x, double y, double width, double height)
Make red box
-
stroke
public void stroke()
-
text
public void text(String s, double x, double y)
-
getWidth
public double getWidth(char c)
All chars are 600 thousands of an 'em' wide if courier
-
getWidth
public double getWidth(String s)
-
getLineHeight
public double getLineHeight()
-
getFontSize
public int getFontSize()
-
-