backend
Class SphereFileWriter

java.lang.Object
  extended by backend.SphereFileWriter

public class SphereFileWriter
extends java.lang.Object

SphereFileWriter will write a files with points, lines, and information panel dialogs Anything in () is the type for the data being writen Anything in [] means optional Anything in '' means print what is inside: '' TYPES: int - a Java 'int' type float - a Java 'float' type PT_LBL - Label of the current point. It is a string and the only symbol it is not allowed to contain is '\n' and ':' PT_TYPE - Is a string representing the type of point that a given point is. Possible values are: 1. 'PI' - SpherePointIntrModel 2. 'PL' - SpherePointLineModel 3. 'PR' - SphereRotatedPointModel 4. 'PT' - SphereParaPointModel 5. 'PN' - SpherePointModel 6. 'PC' - SpherePointCircleModel PARA_FLAG - The string 'T' LN_TYPE - Is a string representing what kind of line we are using Possible values are: 1. 'GREAT_CIRCLE' - For a great circle 2. 'LONG_LINE' - For a long line 3. 'SHORT_LINE' - For a short line LN_TYPE_S - String representing shorthand notation for a line type 1. 'G' - Great Circle 2. 'L' - Long Line 3. 'S' - Short Line ID_TYPE - A Java 'int' type which is unique for each point PT_OBJ - A shorthand type for a point which has already been read in and it takes the following format: PT_TYPE '(' point(ID_TYPE) ')' NL MLT_OBJ - Shorthand for a SphereMultiPointBase object this can either be a LN_OBJ or a CIRC_OBJ LN_OBJ - A shorthand type for a line which has already been read in It has the following format: [(PARA_FLAG)] LN_TYPE_S '(' point1(ID_TYPE) ',' point2(ID_TYPE) ')' NL CIRC_OBJ - A shorthand type for a circle which has already been read in It has the following format: 'C' '(' center_point(ID_TYPE) ',' radius_point(ID_TYPE) ')' NL EOF - End of file SP - Space -- spaces should ONLY be placed where you see SP NL - New line -- new lines should only be placed where you see NL FILE FORMAT: sphere_radius (float) NL sphere_center_x (float) SP sphere_center_y(float) SP sphere_center_z(float)NL number_of_points (int) NL for each point: PT_TYPE point(ID_TYPE) point_x(int) SP point_y(int) SP point_z(int): (PT_LBL) NL number_of_lines (int) NL for each line: [(PARA_FLAG)] LN_TYPE SP 'from' SP point1(ID_TYPE) SP 'to' SP point2(ID_TYPE) NL number_of_circles (int) NL for each circle: center_point(PT_OBJ) SP radius_point(PT_OBJ) NL number_of_line_intersections (int) NL for each intersection: line1(MLT_OBJ) SP line2(MLT_OBJ) SP intr_p1(PT_OBJ) [SP intr_pt2(PT_OBJ)] NL number_of_point_lines (int) NL for each point line: point(ID_TYPE) PS line(LN_OBJ) NL number_of_point_circles (int) NL for each point circle: sphere_point_model(PT_OBJ) SP circle(CIRC_OBJ) NL number_of_rotated_points (int) NL for each rotated point: rotated_point(ID_TYPE) SP axis_point(ID_TYPE) SP ref_point(ID_TYPE) SP angle (float) NL number_of_parallel_transported_lines (int) NL for each parallel transported line: transported_line(LN_OBJ) SP line_of_transport(LN_OBJ) SP reference_line(LN_OBJ) NL number_of_information_nuggets (int) NL for each information nugget: if TriangleAreaNugget 'TAN' SP point1(PT_OBJ) SP point2(PT_OBJ) SP point3(PT_OBJ) NL elif AngleNugget 'AN' SP point1(PT_OBJ) SP point2(PT_OBJ) SP point3(PT_OBJ) NL elif LineLengthNugget 'LLN' SP line(LN_OBJ) NL EOF


Constructor Summary
SphereFileWriter(java.lang.String filename, java.awt.Component errorMsgFrame, float sphereRad, javax.vecmath.Point3f sphereCenter)
          SphereFileWriter default constructor
 
Method Summary
 void addCircleToWrite(SphereCircleModel writeMe)
          addCircleToWrite will allow for the saving of circles
 void addInformationNugget(InformationNugget writeMe)
          addInfoPanString will add a String to the informaiton panel
 void addIntersectionToWrite(SphereIntrModel myIntr)
          addIntersectionToWrite should be used to add all intersections to the data file
 void addLineToWrite(SphereLineModel writeMe)
          addLineToWrite will add a line to be written out to the file
 void addParaTrans(SphereParaTransModel writeMe)
          addParaTrans will add a SphereParaTransModel to write out to the file
 void addPointToWrite(SpherePointModel writeMe)
          addPointToWrite will add a point to be written out to the file
 void finalizeWrite()
          finalizeWrite will take all of the data collected so far and make the file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SphereFileWriter

public SphereFileWriter(java.lang.String filename,
                        java.awt.Component errorMsgFrame,
                        float sphereRad,
                        javax.vecmath.Point3f sphereCenter)
SphereFileWriter default constructor

Parameters:
filename - is the file to write the data to
errorMsgFrame - is the frame to display error messages in
sphereRad - is the radius of the sphere we are writing data for
sphereCenter - is the location of the center of the Sphere
Method Detail

addPointToWrite

public void addPointToWrite(SpherePointModel writeMe)
addPointToWrite will add a point to be written out to the file

Parameters:
writeMe - the point to write to the file

addLineToWrite

public void addLineToWrite(SphereLineModel writeMe)
addLineToWrite will add a line to be written out to the file

Parameters:
writeMe - the line to write to the file

addIntersectionToWrite

public void addIntersectionToWrite(SphereIntrModel myIntr)
addIntersectionToWrite should be used to add all intersections to the data file

Parameters:
myIntr - is the intersection to add

addInformationNugget

public void addInformationNugget(InformationNugget writeMe)
addInfoPanString will add a String to the informaiton panel

Parameters:
writeMe - is the String to add to the information panel

addParaTrans

public void addParaTrans(SphereParaTransModel writeMe)
addParaTrans will add a SphereParaTransModel to write out to the file

Parameters:
writeMe - is the SphereParaTransModel to write to the data file

addCircleToWrite

public void addCircleToWrite(SphereCircleModel writeMe)
addCircleToWrite will allow for the saving of circles

Parameters:
writeMe - a SphereCircleModel to save to file

finalizeWrite

public void finalizeWrite()
finalizeWrite will take all of the data collected so far and make the file. This function must be called at the end or a file won't be written and you will have a whole lot of nothing