|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsoftware.authoring.FormMaker
public class FormMaker
It generates a pdf form as a blank ballot. The form contains all the javascript logic and is created from the geometry, the Election Spec and a pdf background
| Constructor Summary | |
|---|---|
FormMaker(org.gwu.voting.standardFormat.electionSpecification.ElectionSpecification es,
BallotGeometry geom)
creates the javascript to put in the pdf from the ElectionSpec and from jsFunctions.js . |
|
| Method Summary | |
|---|---|
static int |
getFontSize(float w,
float h,
java.lang.String zero,
com.lowagie.text.pdf.BaseFont font)
increases the size from 0 to until the string does not fit in a rectangle (width,heigth). |
static int |
getFontSize(com.lowagie.text.Rectangle rect,
com.lowagie.text.pdf.BaseFont font)
|
static int |
getFontSize(com.lowagie.text.Rectangle rect,
java.lang.String zero,
com.lowagie.text.pdf.BaseFont font)
increases the size from 0 to until the string does not fit in the rectangle It returns three quarters from this maximum size. |
java.lang.String |
getJsFunctions()
|
java.lang.String |
getJsInitValues()
|
org.gwu.voting.standardFormat.basic.Question[] |
getQs()
|
static void |
main(java.lang.String[] args)
debug method |
void |
make(java.lang.String background,
java.lang.String outFile)
creates a pdf from representing a ballot, with the only thing missing being the letters. |
com.lowagie.text.pdf.PdfFormField |
makeButtonAlignmentMark(com.lowagie.text.Rectangle possition,
java.lang.String name)
|
com.lowagie.text.pdf.PdfFormField |
makeButtonFinishVoting(com.lowagie.text.Rectangle possition,
java.lang.String name,
java.lang.String text)
|
com.lowagie.text.pdf.PdfFormField |
makeButtonHighlightCandidate(com.lowagie.text.Rectangle possition,
java.lang.String name)
|
com.lowagie.text.pdf.PdfFormField |
makeButtonOrangeBoth(com.lowagie.text.Rectangle possition,
java.lang.String name)
|
com.lowagie.text.pdf.PdfFormField |
makeButtonOrangeBottom(com.lowagie.text.Rectangle possition,
java.lang.String name)
|
com.lowagie.text.pdf.PdfFormField |
makeButtonOrangeTop(com.lowagie.text.Rectangle possition,
java.lang.String name)
|
com.lowagie.text.pdf.PdfFormField |
makeButtonTopHoles(com.lowagie.text.Rectangle possition,
java.lang.String name)
|
com.lowagie.text.pdf.PdfFormField |
makeButtonVoteBottom(com.lowagie.text.Rectangle possition,
java.lang.String name)
|
com.lowagie.text.pdf.PdfFormField |
makeButtonVoteTop(com.lowagie.text.Rectangle possition,
java.lang.String name)
|
com.lowagie.text.pdf.PdfFormField |
makeText(com.lowagie.text.Rectangle possition,
java.lang.String name,
com.lowagie.text.pdf.BaseFont font,
int fontSize)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FormMaker(org.gwu.voting.standardFormat.electionSpecification.ElectionSpecification es,
BallotGeometry geom)
throws java.io.IOException,
com.lowagie.text.DocumentException
es - - the Election Specificationgeom - - the geometry of the ballot (coresponding to the Election Spec)
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown
java.io.IOException
com.lowagie.text.DocumentException| Method Detail |
|---|
public void make(java.lang.String background,
java.lang.String outFile)
throws com.lowagie.text.DocumentException,
java.io.IOException
background - - the background to be used. If null or there is an error reading the background, a white background is usedoutFile - - where the form is produced
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown
com.lowagie.text.DocumentException
java.io.IOException
public com.lowagie.text.pdf.PdfFormField makeText(com.lowagie.text.Rectangle possition,
java.lang.String name,
com.lowagie.text.pdf.BaseFont font,
int fontSize)
possition - - the possition for the created pdf fieldname - - the name of the field (used when filling it in)font - - the font used when filling in the formfontSize - - the size of the font
public com.lowagie.text.pdf.PdfFormField makeButtonOrangeTop(com.lowagie.text.Rectangle possition,
java.lang.String name)
possition - - where the pdf field should be placedname - - the name of the pdf field
public com.lowagie.text.pdf.PdfFormField makeButtonOrangeBottom(com.lowagie.text.Rectangle possition,
java.lang.String name)
possition - - where the pdf filed should be placedname - - the name of the pdf field
public com.lowagie.text.pdf.PdfFormField makeButtonHighlightCandidate(com.lowagie.text.Rectangle possition,
java.lang.String name)
possition - - where the pdf filed should be placedname - - the name of the pdf field
public com.lowagie.text.pdf.PdfFormField makeButtonOrangeBoth(com.lowagie.text.Rectangle possition,
java.lang.String name)
possition - - where the pdf filed should be placedname - - the name of the pdf field
public com.lowagie.text.pdf.PdfFormField makeButtonTopHoles(com.lowagie.text.Rectangle possition,
java.lang.String name)
possition - - where the pdf filed should be placedname - - the name of the pdf field
public com.lowagie.text.pdf.PdfFormField makeButtonAlignmentMark(com.lowagie.text.Rectangle possition,
java.lang.String name)
possition - - where the pdf filed should be placedname - - the name of the pdf field
public com.lowagie.text.pdf.PdfFormField makeButtonFinishVoting(com.lowagie.text.Rectangle possition,
java.lang.String name,
java.lang.String text)
possition - - where the pdf filed should be placedname - - the name of the pdf fieldtext - - the text that appears on the button
public com.lowagie.text.pdf.PdfFormField makeButtonVoteTop(com.lowagie.text.Rectangle possition,
java.lang.String name)
possition - - where the pdf filed should be placedname - - the name of the pdf field
public com.lowagie.text.pdf.PdfFormField makeButtonVoteBottom(com.lowagie.text.Rectangle possition,
java.lang.String name)
possition - - where the pdf filed should be placedname - - the name of the pdf field
public java.lang.String getJsFunctions()
public java.lang.String getJsInitValues()
public org.gwu.voting.standardFormat.basic.Question[] getQs()
public static int getFontSize(com.lowagie.text.Rectangle rect,
com.lowagie.text.pdf.BaseFont font)
public static int getFontSize(com.lowagie.text.Rectangle rect,
java.lang.String zero,
com.lowagie.text.pdf.BaseFont font)
rect - - the bounding rectanglezero - - the caracter that has to fit in the rectanglefont - - the font the character is in
public static int getFontSize(float w,
float h,
java.lang.String zero,
com.lowagie.text.pdf.BaseFont font)
w - - the width of thebounding rectangleh - - the heigth of the bounding rectanglezero - - the caracter that has to fit in the rectanglefont - - the font the character is in
public static void main(java.lang.String[] args)
throws org.gwu.voting.standardFormat.electionSpecification.exceptions.ESException,
org.xml.sax.SAXException,
java.io.IOException,
com.lowagie.text.DocumentException
args -
org.gwu.voting.standardFormat.electionSpecification.exceptions.ESException
org.xml.sax.SAXException
java.io.IOException
com.lowagie.text.DocumentException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||