|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsoftware.common.BallotGeometry
public class BallotGeometry
| Constructor Summary | |
|---|---|
BallotGeometry(float width,
float height)
Builds a new, blank geometry of size width,height |
|
BallotGeometry(java.lang.String path)
Reads in the geometry of a ballot from a file |
|
| Method Summary | |
|---|---|
void |
addAlignment(Cluster alignment)
|
void |
addContest(int qno,
java.util.Vector<Cluster> top,
java.util.Vector<Cluster> bottom)
Adds a contest to the geometry |
void |
addHoleOnly(Cluster holeOnly)
|
com.lowagie.text.Rectangle |
getBottom(java.lang.String race,
java.lang.String rank,
java.lang.String candidate)
|
Cluster |
getBottomCluster(java.lang.String race,
java.lang.String rank,
java.lang.String candidate)
|
org.w3c.dom.Node |
getBottomNode(java.lang.String race,
java.lang.String rank,
java.lang.String candidate)
|
java.util.Vector<Cluster> |
getContestBottomHoles()
|
org.gwu.voting.standardFormat.electionSpecification.ElectionSpecification |
getDefaultElectionSpec()
|
double |
getDonutThicknessBottom()
|
double |
getDonutThicknessTop()
|
float |
getHeight()
|
float |
getHoleDiameter()
|
java.awt.geom.Point2D.Double |
getLowerAlignment()
|
com.lowagie.text.Rectangle |
getLowerFinishButton()
|
static int |
getNoColumnsFormVectorSortedOnY(java.util.Vector<Cluster> q)
|
int |
getNoDigitsInSerial()
|
int |
getNoRaces()
|
static int |
getNoRowsFromVectorSortedOnX(java.util.Vector<Cluster> q)
|
com.lowagie.text.Rectangle |
getSerialBarcode()
|
org.w3c.dom.Node |
getSerialBarcodeNode()
|
com.lowagie.text.Rectangle |
getSerialBottom(java.lang.String digitId)
|
Cluster |
getSerialBottomCluster(java.lang.String digitId)
|
java.util.Vector<Cluster> |
getSerialBottomHolles()
|
org.w3c.dom.Node |
getSerialBottomNode(java.lang.String digitId)
|
com.lowagie.text.Rectangle[][] |
getSerialBulleted()
Equally divided the rectangle where the serial number should be |
org.w3c.dom.Node |
getSerialBulletedNode()
|
com.lowagie.text.Rectangle |
getSerialTop(java.lang.String digitId)
|
org.w3c.dom.Node |
getSerialTopNode(java.lang.String digitId)
|
com.lowagie.text.Rectangle |
getTop(java.lang.String race,
java.lang.String candidate)
|
com.lowagie.text.Rectangle |
getTop(java.lang.String race,
java.lang.String rank,
java.lang.String candidate)
|
org.w3c.dom.Node |
getTopNode(java.lang.String race,
java.lang.String rank,
java.lang.String candidate)
|
java.awt.geom.Point2D.Double |
getUpperAlignment()
|
com.lowagie.text.Rectangle |
getUpperFinishButton()
|
float |
getWidth()
|
com.lowagie.text.Rectangle |
makeRectangle(org.w3c.dom.Node node)
|
com.lowagie.text.Rectangle |
makeRectangle(java.awt.geom.Point2D.Double p)
|
void |
setSerial(java.util.Vector<Cluster> top,
java.util.Vector<Cluster> bottom)
Adds the where the serial number should be |
void |
setSerialBarcode(Cluster serialBarcode)
|
void |
setSerialBulleted(Cluster serialBulleted)
|
static void |
sortOnX(java.util.Vector<Cluster> q,
int start,
int stop)
Sorts a vector of clusters based on their X coordinates (horizontaly) |
static int |
sortOnXThenOnY(java.util.Vector<Cluster> q)
Sorts a vector on cluster on X (horizontally). |
static void |
sortOnY(java.util.Vector<Cluster> q,
int start,
int stop)
Sorts a vector of clusters based on their Y coordinates (vertically) |
static int |
sortOnYThenOnX(java.util.Vector<Cluster> q)
Sorts a vector on cluster on Y (vertically). |
void |
write(java.io.OutputStream fos)
Writes the geometry |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BallotGeometry(float width,
float height)
width - - the with of the ballot in inchesheight - - the height of the ballot in inches
public BallotGeometry(java.lang.String path)
throws org.xml.sax.SAXException,
java.io.IOException
path - - the path to a xml file with the geometry
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown
org.xml.sax.SAXException
java.io.IOException| Method Detail |
|---|
public int getNoDigitsInSerial()
public com.lowagie.text.Rectangle getSerialTop(java.lang.String digitId)
digitId - the number of the digit in the top serial
public org.w3c.dom.Node getSerialTopNode(java.lang.String digitId)
digitId - the number of the digit in the top serial
public com.lowagie.text.Rectangle getSerialBottom(java.lang.String digitId)
digitId - the number of the digit in the bottom serial
public Cluster getSerialBottomCluster(java.lang.String digitId)
digitId - the number of the digit in the bottom serial
public java.util.Vector<Cluster> getSerialBottomHolles()
public org.w3c.dom.Node getSerialBottomNode(java.lang.String digitId)
digitId - the number of the digit in the bottom serial
public com.lowagie.text.Rectangle getTop(java.lang.String race,
java.lang.String candidate)
race - the race idcandidate - - the candidate id
public com.lowagie.text.Rectangle getTop(java.lang.String race,
java.lang.String rank,
java.lang.String candidate)
race - the race idrank - the rank (if a scantegrity ballot)candidate - - the candidate id
public com.lowagie.text.Rectangle getBottom(java.lang.String race,
java.lang.String rank,
java.lang.String candidate)
race - the race numberrank - candidate -
public Cluster getBottomCluster(java.lang.String race,
java.lang.String rank,
java.lang.String candidate)
race - rank - candidate -
public org.w3c.dom.Node getBottomNode(java.lang.String race,
java.lang.String rank,
java.lang.String candidate)
race - rank - candidate -
public org.w3c.dom.Node getTopNode(java.lang.String race,
java.lang.String rank,
java.lang.String candidate)
race - rank - candidate -
public java.util.Vector<Cluster> getContestBottomHoles()
public void addContest(int qno,
java.util.Vector<Cluster> top,
java.util.Vector<Cluster> bottom)
throws java.lang.Exception
qno - - the question numbertop - - where the top letter shold bebottom - - where the bottom letters should be
java.lang.Exception - if bottom is not null (Scantegrity)
then the number of letter on the bottom must be a multiple of
the number of letters on the top. Otherwise an exception is thrown
public void setSerial(java.util.Vector<Cluster> top,
java.util.Vector<Cluster> bottom)
top - - the serial number on the top pagebottom - - the serial number on the bottom pagepublic void addAlignment(Cluster alignment)
alignment - the alignment mark to be addedpublic void addHoleOnly(Cluster holeOnly)
holeOnly - the place where a hole shoold be drilled (in addition to letters and serial number)
public static void sortOnX(java.util.Vector<Cluster> q,
int start,
int stop)
q - - the vecotr to be sorted (it is modified by this method)start - - the start possition (including)stop - - the stop possition (exclusive)
public static void sortOnY(java.util.Vector<Cluster> q,
int start,
int stop)
q - - the vecotr to be sorted (it is modified by this method)start - - the start possition (including)stop - - the stop possition (exclusive)public static int sortOnXThenOnY(java.util.Vector<Cluster> q)
q - - the vector to be sorted (it is modified by this method)
public static int sortOnYThenOnX(java.util.Vector<Cluster> q)
q - - the vector to be sorted (it is modified by this method)
public static int getNoRowsFromVectorSortedOnX(java.util.Vector<Cluster> q)
q - - a vector of Clusters already sorted on X (does not get modified by this method)
public static int getNoColumnsFormVectorSortedOnY(java.util.Vector<Cluster> q)
q - - a vector of Clusters already sorted on Y (does not get modified by this method)
public void write(java.io.OutputStream fos)
throws java.io.IOException
fos - - the output stream to write to
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown
java.io.IOExceptionpublic com.lowagie.text.Rectangle getUpperFinishButton()
public com.lowagie.text.Rectangle getLowerFinishButton()
public com.lowagie.text.Rectangle makeRectangle(org.w3c.dom.Node node)
node -
public com.lowagie.text.Rectangle makeRectangle(java.awt.geom.Point2D.Double p)
p -
public float getHeight()
public float getWidth()
public float getHoleDiameter()
public java.awt.geom.Point2D.Double getUpperAlignment()
public java.awt.geom.Point2D.Double getLowerAlignment()
public org.gwu.voting.standardFormat.electionSpecification.ElectionSpecification getDefaultElectionSpec()
public int getNoRaces()
public void setSerialBarcode(Cluster serialBarcode)
serialBarcode - where the serial number in barcode is placedpublic void setSerialBulleted(Cluster serialBulleted)
serialBulleted - where the serial number in bullets readable by a mark sense machine is placedpublic com.lowagie.text.Rectangle getSerialBarcode()
public org.w3c.dom.Node getSerialBarcodeNode()
public com.lowagie.text.Rectangle[][] getSerialBulleted()
public org.w3c.dom.Node getSerialBulletedNode()
public double getDonutThicknessBottom()
public double getDonutThicknessTop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||