All Packages Class Hierarchy This Package Previous Next Index
Class mesquite.lib.StringInABox
java.lang.Object
|
+----mesquite.lib.StringInABox
- public class StringInABox
- extends java.lang.Object
A utility class to draw a string in a box, useful for printing and screen display. A bit like TextArea, but
without rectangle around it and with multipage printing facility. The string, font, and width are given to it,
and it calculates a breakdown of the string into an array of strings each of which will fit in the allotted
width, and also calcualted is how high of a rectangle is needed to accommodate all of the text.
-
StringInABox(String, Font, int)
-
-
StringInABox(StringBuffer, Font, int)
-
-
draw(Graphics, int, int)
- draw text based at x, y
-
draw(Graphics, int, int, int, int)
- draw text based at x, y, starting at local position y in box for height h
-
draw(Graphics, int, int, int, int, Component, boolean)
- draw text based at x, y, starting at local position y in box for height h
-
drawInBox(Graphics, Color, int, int)
- draw text based at x, y
-
getHeight()
-
-
getRemainingHeight(int)
-
-
getString()
-
-
getWidth()
-
-
printText(Frame, String, Font)
- Prints the passed string (automatically prints with full page width and on
multiple pages as needed.
-
printText(PrintJob, String, Font)
- Prints the passed string using given PrintJob (automatically prints with full page width and on
multiple pages as needed.
-
setBuffer(int)
-
-
setFont(Font)
-
-
setString(String)
-
-
setString(StringBuffer)
-
-
setWidth(int)
-
StringInABox
public StringInABox(java.lang.StringBuffer s,
java.awt.Font f,
int w)
StringInABox
public StringInABox(java.lang.String s,
java.awt.Font f,
int w)
setBuffer
public void setBuffer(int b)
setFont
public void setFont(java.awt.Font f)
setWidth
public void setWidth(int w)
getWidth
public int getWidth()
setString
public void setString(java.lang.StringBuffer s)
setString
public void setString(java.lang.String s)
getString
public java.lang.String getString()
printText
public static void printText(java.awt.Frame f,
java.lang.String s,
java.awt.Font font)
- Prints the passed string (automatically prints with full page width and on
multiple pages as needed. \n are used as linebreads. Text is wrapped as necessary to
fit onto page
printText
public static void printText(java.awt.PrintJob pjob,
java.lang.String s,
java.awt.Font font)
- Prints the passed string using given PrintJob (automatically prints with full page width and on
multiple pages as needed. \n are used as linebreads. Text is wrapped as necessary to
fit onto page
draw
public int draw(java.awt.Graphics g,
int x,
int y,
int yPos,
int h,
java.awt.Component component,
boolean drawHorizontal)
- draw text based at x, y, starting at local position y in box for height h
draw
public int draw(java.awt.Graphics g,
int x,
int y,
int yPos,
int h)
- draw text based at x, y, starting at local position y in box for height h
draw
public int draw(java.awt.Graphics g,
int x,
int y)
- draw text based at x, y
drawInBox
public int drawInBox(java.awt.Graphics g,
java.awt.Color backgroundColor,
int x,
int y)
- draw text based at x, y
getHeight
public int getHeight()
getRemainingHeight
public int getRemainingHeight(int usedSoFar)
All Packages Class Hierarchy This Package Previous Next Index